From 288aba074f5ada5dbaa57f67bb2f383f3dcaf60c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Oct 2011 09:16:05 +1100 Subject: [PATCH] fastserial: allow vprintf() to build without assembler --- libraries/FastSerial/vprintf.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libraries/FastSerial/vprintf.cpp b/libraries/FastSerial/vprintf.cpp index b290e86baf..5bbcac232c 100644 --- a/libraries/FastSerial/vprintf.cpp +++ b/libraries/FastSerial/vprintf.cpp @@ -54,6 +54,15 @@ extern "C" { #undef PSTR #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) ({ \ unsigned char __c; \ asm ( \ @@ -68,15 +77,7 @@ extern "C" { ); \ __c; \ }) -/* -#define GETBYTE(flag, mask, pnt) ({ \ - unsigned char __c; \ - __c = ((flag) & (mask)) \ - ? pgm_read_byte(pnt) : *pnt; \ - pnt++; \ - __c; \ -}) -*/ +#endif #define FL_ZFILL 0x01 #define FL_PLUS 0x02