fastserial: allow vprintf() to build without assembler

This commit is contained in:
Andrew Tridgell 2011-10-08 09:16:05 +11:00
parent 88668dd2d1
commit cb8f8ec083
1 changed files with 10 additions and 9 deletions

View File

@ -54,6 +54,15 @@ extern "C" {
#undef PSTR #undef PSTR
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];})) #define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];}))
#if DESKTOP_BUILD
#define GETBYTE(flag, mask, pnt) ({ \
unsigned char __c; \
__c = ((flag) & (mask)) \
? pgm_read_byte(pnt) : *pnt; \
pnt++; \
__c; \
})
#else
#define GETBYTE(flag, mask, pnt) ({ \ #define GETBYTE(flag, mask, pnt) ({ \
unsigned char __c; \ unsigned char __c; \
asm ( \ asm ( \
@ -68,15 +77,7 @@ extern "C" {
); \ ); \
__c; \ __c; \
}) })
/* #endif
#define GETBYTE(flag, mask, pnt) ({ \
unsigned char __c; \
__c = ((flag) & (mask)) \
? pgm_read_byte(pnt) : *pnt; \
pnt++; \
__c; \
})
*/
#define FL_ZFILL 0x01 #define FL_ZFILL 0x01
#define FL_PLUS 0x02 #define FL_PLUS 0x02