x9e with horus bt module (#5214)
[opentx.git] / radio / src / pgmtypes.h
blobb9da5383dc5a4a60a22840ac15e11c33b9d0d3ac
1 /*
2 * Copyright (C) OpenTX
4 * Based on code named
5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _PGMTYPES_H_
22 #define _PGMTYPES_H_
24 /* this is workaround for g++ bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734 */
25 #if (((__GNUC__ * 1000) + __GNUC_MINOR__) * 1000 + __GNUC_PATCHLEVEL__) < 4006002
26 # ifdef __cplusplus
27 # undef PROGMEM
28 # define PROGMEM __attribute__(( section(".progmem.data") ))
29 # undef PSTR
30 # endif
31 #endif
33 /* old (pre 1.8.0) avr-libc does not have progmem macros compatible with new gcc
34 * note: even for old gcc, definition was wrong. Old gcc was just more tolerant. */
35 #if (((__AVR_LIBC_MAJOR__ * 1000) + __AVR_LIBC_MINOR__) * 1000 + __AVR_LIBC_REVISION__) < 1008000
36 # ifndef __PGMSPACE_H_
37 # warning "This file should be included after <avr/pgmspace.h>"
38 # endif
39 # undef PSTR
40 # undef PGM_P
41 # undef PGM_VOID_P
42 # define PGM_P const char *
43 # define PGM_VOID_P const void *
44 #endif
46 #ifndef PSTR
47 # define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s);&__c[0];}))
48 #endif
50 typedef void pm_void;
51 typedef char pm_char;
52 typedef unsigned char pm_uchar;
53 typedef int8_t pm_int8_t;
54 typedef uint8_t pm_uint8_t;
55 typedef int16_t pm_int16_t;
56 typedef uint16_t pm_uint16_t;
57 typedef int32_t pm_int32_t;
58 typedef uint32_t pm_uint32_t;
60 #endif // _PGMTYPES_H_