Platform HAL for rohm sensor drivers. Used for abstracting Arduino/mbed os/mbed classic.

Dependents:   rohm-bm1383-hello-mbedclassic rohm-bh1726-hello rohm-rpr0521-hello rohm-bh1745-hello ... more

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Wed Feb 27 04:43:34 2019 +0000
Parent:
8:4d5812bed3fb
Commit message:
Fix debug print

Changed in this revision

rohm-sensor-hal/rohm_hal.h Show annotated file Show diff for this revision Revisions of this file
--- a/rohm-sensor-hal/rohm_hal.h	Mon Feb 18 16:19:45 2019 +0900
+++ b/rohm-sensor-hal/rohm_hal.h	Wed Feb 27 04:43:34 2019 +0000
@@ -22,11 +22,23 @@
     #include "I2C.h"                //I2C
 
     #define USE_MBED_HARDWARE_I2C
+#if MBED_MAJOR_VERSION >= 5
+#if _DEBUG
+    #define DEBUG_print(...)    printf(__VA_ARGS__)
+    #define DEBUG_printf(...)   printf(__VA_ARGS__)
+    #define DEBUG_println(...)  printf(__VA_ARGS__);printf("\r\n")
+#else
+    #define DEBUG_print(...)
+    #define DEBUG_printf(...)
+    #define DEBUG_println(...)
+#endif
+#else
     extern Serial pc;
     //Serial pc(USBTX, USBRX); done in main.cpp
     #define DEBUG_print(...)    pc.printf(__VA_ARGS__)
     #define DEBUG_printf(...)   pc.printf(__VA_ARGS__)
     #define DEBUG_println(...)  pc.printf(__VA_ARGS__);pc.printf("\r\n")
+#endif
 #elif defined(YOTTA_MODULE_NAME)
     /* Mbed OS */
     #include "mbed-drivers/mbed.h"  //types, Serial, I2C -type, ...