X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Fprint.h;h=a8dbbc020abc5610bc769b4dfb5e1123f6b57f93;hb=807ed33a9a29ee3c5248226d0e865d0580d7eebc;hp=6a6771f7100acebe523bd9aeaeea2d977bc50255;hpb=f15b2691c92e1d9b3c0e59363c803ec540303f37;p=tmk_firmware.git diff --git a/common/print.h b/common/print.h index 6a6771f..a8dbbc0 100644 --- a/common/print.h +++ b/common/print.h @@ -35,30 +35,30 @@ #ifndef NO_PRINT -#ifdef __AVR__ +#if defined(__AVR__) -#include "xprintf.h" +#include "avr/xprintf.h" // TODO: avoid collision with arduino/Print.h #ifndef __cplusplus #define print(s) xputs(PSTR(s)) #endif -#define println(s) xputs(PSTR(s "\n")) +#define println(s) xputs(PSTR(s "\r\n")) #ifdef __cplusplus -extern "C" { +extern "C" #endif /* function pointer of sendchar to be used by print utility */ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); -#elif __arm__ +#elif defined(__arm__) + +#include "mbed/xprintf.h" -#include "mbed.h" -Serial ser(UART_TX, UART_RX); -#define xprintf ser.printf #define print(s) xprintf(s) -#define println(s) xprintf(s "\n") +#define println(s) xprintf(s "\r\n") + /* TODO: to select output destinations: UART/USBSerial */ #define print_set_sendchar(func)