Class for making communication easier from code to i2c connected Rohm/Kionix sensors. Maybe could be used later also for abstracting Arduino/mbed os. Code ported from 'C'-library rohm-sensor-hal.

Dependents:   kionix-kx123-hello rohm-bh1790glc-hello simple-sensor-client rohm-SensorShield-example

Fork of rohm-sensor-hal by Rohm

Revision:
15:726c671efcce
Parent:
13:3d4508874121
--- a/RegisterWriter/rohm_hal2.h	Mon Feb 18 14:26:35 2019 +0900
+++ b/RegisterWriter/rohm_hal2.h	Wed Feb 27 04:43:21 2019 +0000
@@ -32,17 +32,15 @@
     #include "I2C.h"                //I2C
 
     #define USE_MBED_HARDWARE_I2C
-    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")
+#ifdef _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
-
-#if 0       //Enable/disable debug prints
-    #define DEBUG_print()
-    #define DEBUG_printf()
-    #define DEBUG_println()
 #endif
 
 #endif /* ROHM_HAL_H */