diff options
Diffstat (limited to 'test_fw/include')
| -rw-r--r-- | test_fw/include/i2c_scan.h | 18 | ||||
| -rw-r--r-- | test_fw/include/log.h | 12 |
2 files changed, 22 insertions, 8 deletions
diff --git a/test_fw/include/i2c_scan.h b/test_fw/include/i2c_scan.h index 1fc81c1..5588f5c 100644 --- a/test_fw/include/i2c_scan.h +++ b/test_fw/include/i2c_scan.h @@ -3,6 +3,8 @@ #include <Arduino.h> #include <Wire.h> +#include "log.h" + namespace ocularium { inline void scan(TwoWire& wire, bool post_delay = true) { @@ -13,18 +15,18 @@ namespace ocularium { if (error == 0) { - Serial.print("I2C device found at address 0x"); + LOGGER.print("I2C device found at address 0x"); if (address<16) - Serial.print("0"); - Serial.print(address,HEX); - Serial.println(); + LOGGER.print("0"); + LOGGER.print(address,HEX); + LOGGER.println(); } else if (error==4) { - Serial.print("Unknown error at address 0x"); + LOGGER.print("Unknown error at address 0x"); if (address<16) - Serial.print("0"); - Serial.println(address,HEX); + LOGGER.print("0"); + LOGGER.println(address,HEX); } } @@ -34,4 +36,4 @@ namespace ocularium { delay(10); } } -}
\ No newline at end of file +} diff --git a/test_fw/include/log.h b/test_fw/include/log.h new file mode 100644 index 0000000..18efa7a --- /dev/null +++ b/test_fw/include/log.h @@ -0,0 +1,12 @@ +#pragma once + +#define USE_RTT 1 + +#define LOGGER Serial + +#if USE_RTT +#include <RTTStream.h> + +extern RTTStream rtt; +#define LOGGER rtt +#endif |
