A better workaround for the PSTR warning bug. This seems to work correctly.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@919 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
DrZiplok@gmail.com 2010-11-25 02:59:15 +00:00
parent 2dfb44907f
commit aa2bbe9131
2 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,12 @@
//
#include <FastSerial.h>
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];}))
//
// Create a FastSerial driver that looks just like the stock Arduino
// driver.

View File

@ -48,6 +48,12 @@ extern "C" {
#include "xtoa_fast.h"
}
// workaround for GCC bug c++/34734
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];}))
#define GETBYTE(flag, mask, pnt) ({ \
unsigned char __c; \
asm ( \