mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_Progmem: simpler PROGMEM header
This commit is contained in:
parent
abfb601db6
commit
e1e85ecc3d
@ -12,22 +12,11 @@ typedef struct {
|
||||
char c;
|
||||
} prog_char_t;
|
||||
|
||||
#undef PROGMEM
|
||||
#define PROGMEM __attribute__(( section(".progmem.data") ))
|
||||
typedef char prog_char;
|
||||
|
||||
#undef PSTR
|
||||
/* need to define prog_char in avr-gcc 4.7 */
|
||||
#if __AVR__ && __GNUC__ == 4 && __GNUC_MINOR__ > 6
|
||||
typedef char prog_char;
|
||||
#endif
|
||||
/* Need const type for progmem - new for avr-gcc 4.6 */
|
||||
#if __AVR__ && __GNUC__ == 4 && __GNUC_MINOR__ > 5
|
||||
#define PSTR(s) (__extension__({static const prog_char __c[] PROGMEM = (s); \
|
||||
(const prog_char_t *)&__c[0]; }))
|
||||
#else
|
||||
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); \
|
||||
(prog_char_t *)&__c[0]; }))
|
||||
#endif
|
||||
|
||||
|
||||
static inline int strcasecmp_P(const char *str1, const prog_char_t *pstr)
|
||||
|
Loading…
Reference in New Issue
Block a user