chiark / gitweb /
magic PROGMEM defines to avoid hundreds of wrong GCC warnings
[marlin.git] / Marlin / Marlin.h
index 5bb728c6fa0ed6e3fd171ed65b09536148d4cc8c..5982302dac6c03cb4ea2122d21ce690b11a6c32a 100644 (file)
 #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"