diff --git a/src/GlobalVars.h b/src/GlobalVars.h index 255de0823..12e12e742 100644 --- a/src/GlobalVars.h +++ b/src/GlobalVars.h @@ -27,9 +27,11 @@ #include "LEDManager.h" #include "status/StatusManager.h" #include "configuration/Configuration.h" +#include "sensors/SensorManager.h" extern SlimeVR::LEDManager ledManager; extern SlimeVR::Status::StatusManager statusManager; extern SlimeVR::Configuration::Configuration configuration; +extern SlimeVR::Sensors::SensorManager sensorManager; #endif diff --git a/src/debug.h b/src/debug.h index e540ea96b..f2fd12a59 100644 --- a/src/debug.h +++ b/src/debug.h @@ -78,7 +78,7 @@ // Not recommended for production #define ENABLE_INSPECTION false -#define FIRMWARE_BUILD_NUMBER 13 -#define FIRMWARE_VERSION "0.3.0" +#define FIRMWARE_BUILD_NUMBER 14 +#define FIRMWARE_VERSION "0.3.1" #endif // SLIMEVR_DEBUG_H_ diff --git a/src/defines.h b/src/defines.h index 0ce1e736c..b2835ae16 100644 --- a/src/defines.h +++ b/src/defines.h @@ -29,7 +29,7 @@ #define IMU IMU_BNO085 #define SECOND_IMU IMU #define BOARD BOARD_SLIMEVR -#define IMU_ROTATION DEG_90 +#define IMU_ROTATION DEG_270 #define SECOND_IMU_ROTATION DEG_270 // Battery monitoring options (comment to disable): diff --git a/src/sensors/sensor.h b/src/sensors/sensor.h index 58ce67873..55c558436 100644 --- a/src/sensors/sensor.h +++ b/src/sensors/sensor.h @@ -65,6 +65,7 @@ class Sensor return sensorType; }; + bool hadData = false; protected: uint8_t addr = 0; uint8_t sensorId = 0; diff --git a/src/serial/serialcommands.cpp b/src/serial/serialcommands.cpp index 588f40665..45af4424c 100644 --- a/src/serial/serialcommands.cpp +++ b/src/serial/serialcommands.cpp @@ -67,7 +67,16 @@ namespace SerialCommands { FIRMWARE_VERSION, WiFiNetwork::getAddress().toString().c_str() ); - // TODO Print sensors number and types + Sensor* sensor1 = sensorManager.getFirst(); + Sensor* sensor2 = sensorManager.getSecond(); + logger.info( + "Sensor 1: %s", + getIMUNameByType(sensor1->getSensorType()) + ); + logger.info( + "Sensor 2: %s", + getIMUNameByType(sensor2->getSensorType()) + ); } if (parser->equalCmdParam(1, "CONFIG")) { @@ -109,6 +118,27 @@ namespace SerialCommands { LED_INVERTED ); } + + if (parser->equalCmdParam(1, "TEST")) { + logger.info( + "[TEST]Board: %d, hardware: %d, build: %d, firmware: %s, mac: %s", + BOARD, + HARDWARE_MCU, + FIRMWARE_BUILD_NUMBER, + FIRMWARE_VERSION, + WiFi.macAddress() + ); + Sensor* sensor1 = sensorManager.getFirst(); + logger.info( + "[TEST] Sensor 1: %s", + getIMUNameByType(sensor1->getSensorType()) + ); + if(!sensor1->hadData) { + logger.error("[TEST] Sensor 1 didn't send any data yet!"); + } else { + logger.info("[TEST] Sensor 1 sent some data, looks working."); + } + } } void cmdReport(CmdParser * parser) { @@ -151,6 +181,7 @@ namespace SerialCommands { cmdCallbacks.addCmd("FRST", &cmdFactoryReset); cmdCallbacks.addCmd("REP", &cmdReport); cmdCallbacks.addCmd("REBOOT", &cmdReboot); + } void update() {