magic PROGMEM defines to avoid hundreds of wrong GCC warnings

This commit is contained in:
MaikStohn
2012-05-03 15:43:23 +02:00
parent 032df0b2c6
commit 3682d9bd5b
2 changed files with 14 additions and 7 deletions

View File

@@ -20,6 +20,13 @@
#include <avr/wdt.h>
#include <avr/interrupt.h>
//do some magic defines in order to prevent hundreds of wrong warnings in gcc
//more info here: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=646359
typedef short prog_short PROGMEM;
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];}))
#include "fastio.h"
#include "Configuration.h"