From 8243577e72be496e52929b5fc8c4a70cd49f8929 Mon Sep 17 00:00:00 2001 From: Ewoud Date: Sun, 23 Jun 2024 21:39:58 +0200 Subject: [PATCH] Switch off MPU6050 per default (switch on in pio.ini) --- platformio.ini | 4 ++-- src/App/LedEffects.h | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 355c1f3d..3c876650 100644 --- a/platformio.ini +++ b/platformio.ini @@ -58,14 +58,14 @@ build_flags = -D STARBASE_DEVMODE ${ESPAsyncWebServer.build_flags} ${STARBASE_USERMOD_E131.build_flags} - ${STARBASE_USERMOD_MPU6050.build_flags} + ; ${STARBASE_USERMOD_MPU6050.build_flags} ; ${STARBASE_USERMOD_HA.build_flags} lib_deps = ${ESPAsyncWebServer.lib_deps} https://github.com/bblanchon/ArduinoJson.git#v7.0.3 ; https://github.com/Jason2866/ESP32_Show_Info.git ${STARBASE_USERMOD_E131.lib_deps} - ${STARBASE_USERMOD_MPU6050.lib_deps} + ; ${STARBASE_USERMOD_MPU6050.lib_deps} ; ${STARBASE_USERMOD_HA.lib_deps} diff --git a/src/App/LedEffects.h b/src/App/LedEffects.h index 1895a564..b63ebc8b 100644 --- a/src/App/LedEffects.h +++ b/src/App/LedEffects.h @@ -16,7 +16,9 @@ #include "../User/UserModE131.h" #endif -#include "../User/UserModMPU6050.h" +#ifdef STARBASE_USERMOD_MPU6050 + #include "../User/UserModMPU6050.h" +#endif //utility function float distance(float x1, float y1, float z1, float x2, float y2, float z2) { @@ -1934,7 +1936,9 @@ class ParticleTest: public Effect { uint8_t speed = leds.sharedData.read(); uint8_t numParticles = leds.sharedData.read(); Coord3D vel = leds.sharedData.read(); - bool gyro = leds.sharedData.read(); + #ifdef STARBASE_USERMOD_MPU6050 + bool gyro = leds.sharedData.read(); + #endif bool debugPrint = leds.sharedData.read(); // Effect Variables @@ -2021,7 +2025,9 @@ class ParticleTest: public Effect { ui->initSlider (parentVar, "Speed", leds.sharedData.write(1), 0, 30); ui->initSlider (parentVar, "Number of Particles", leds.sharedData.write(1), 1, 255); ui->initCoord3D(parentVar, "Velocity", leds.sharedData.write({0,0,0}), -1, 1); - ui->initCheckBox(parentVar, "Gyro", leds.sharedData.write(false)); + #ifdef STARBASE_USERMOD_MPU6050 + ui->initCheckBox(parentVar, "Gyro", leds.sharedData.write(false)); + #endif ui->initCheckBox(parentVar, "Debug Print", leds.sharedData.write(false)); } };