summaryrefslogtreecommitdiff
path: root/common/print.h
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-06-16 15:38:39 +0900
committertmk <nobody@nowhere>2014-07-30 14:07:43 +0900
commit04fe78ee0a7fe9baed39f021799a3dbb24ebeb36 (patch)
tree047ab27ca15eedfcc5523ac0daf243611501ef5e /common/print.h
parent867f115bee190515aa195dc3e58f1c381ea9695b (diff)
Fix print and timer
Diffstat (limited to 'common/print.h')
-rw-r--r--common/print.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/print.h b/common/print.h
index 6a6771f710..4001bcf1b5 100644
--- a/common/print.h
+++ b/common/print.h
@@ -35,7 +35,7 @@
#ifndef NO_PRINT
-#ifdef __AVR__
+#if defined(__AVR__)
#include "xprintf.h"
@@ -44,21 +44,21 @@
#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)