diff options
Diffstat (limited to 'common/print.h')
| -rw-r--r-- | common/print.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/common/print.h b/common/print.h index 6a6771f71..4001bcf1b 100644 --- a/common/print.h +++ b/common/print.h | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | #ifndef NO_PRINT | 35 | #ifndef NO_PRINT |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | #ifdef __AVR__ | 38 | #if defined(__AVR__) |
| 39 | 39 | ||
| 40 | #include "xprintf.h" | 40 | #include "xprintf.h" |
| 41 | 41 | ||
| @@ -44,21 +44,21 @@ | |||
| 44 | #ifndef __cplusplus | 44 | #ifndef __cplusplus |
| 45 | #define print(s) xputs(PSTR(s)) | 45 | #define print(s) xputs(PSTR(s)) |
| 46 | #endif | 46 | #endif |
| 47 | #define println(s) xputs(PSTR(s "\n")) | 47 | #define println(s) xputs(PSTR(s "\r\n")) |
| 48 | 48 | ||
| 49 | #ifdef __cplusplus | 49 | #ifdef __cplusplus |
| 50 | extern "C" { | 50 | extern "C" |
| 51 | #endif | 51 | #endif |
| 52 | /* function pointer of sendchar to be used by print utility */ | 52 | /* function pointer of sendchar to be used by print utility */ |
| 53 | void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); | 53 | void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); |
| 54 | 54 | ||
| 55 | #elif __arm__ | 55 | #elif defined(__arm__) |
| 56 | |||
| 57 | #include "mbed/xprintf.h" | ||
| 56 | 58 | ||
| 57 | #include "mbed.h" | ||
| 58 | Serial ser(UART_TX, UART_RX); | ||
| 59 | #define xprintf ser.printf | ||
| 60 | #define print(s) xprintf(s) | 59 | #define print(s) xprintf(s) |
| 61 | #define println(s) xprintf(s "\n") | 60 | #define println(s) xprintf(s "\r\n") |
| 61 | |||
| 62 | /* TODO: to select output destinations: UART/USBSerial */ | 62 | /* TODO: to select output destinations: UART/USBSerial */ |
| 63 | #define print_set_sendchar(func) | 63 | #define print_set_sendchar(func) |
| 64 | 64 | ||
