From 71dddf2ca32e55254a6027cd06e3f6dd1ec292bd Mon Sep 17 00:00:00 2001 From: Angelo Prete <angelo.prete@skywarder.eu> Date: Wed, 22 May 2024 12:13:47 +0200 Subject: [PATCH] [MockupMain] Test config (no nas, no bmx160, no lis3) --- src/boards/MockupMain/Configs/SensorsConfig.h | 10 +++--- src/boards/MockupMain/Sensors/Sensors.cpp | 12 +++---- .../FlightModeManager/FlightModeManager.cpp | 2 +- src/entrypoints/MockupMain/main-entry.cpp | 36 +++++++++---------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/boards/MockupMain/Configs/SensorsConfig.h b/src/boards/MockupMain/Configs/SensorsConfig.h index d98678eca..9985c7d9e 100644 --- a/src/boards/MockupMain/Configs/SensorsConfig.h +++ b/src/boards/MockupMain/Configs/SensorsConfig.h @@ -43,12 +43,12 @@ constexpr Boardcore::BMX160Config::AccelerometerRange BMX160_ACC_FSR_ENUM = Boardcore::BMX160Config::AccelerometerRange::G_16; constexpr Boardcore::BMX160Config::GyroscopeRange BMX160_GYRO_FSR_ENUM = Boardcore::BMX160Config::GyroscopeRange::DEG_1000; -constexpr unsigned int BMX160_ACC_GYRO_ODR = 800; +constexpr unsigned int BMX160_ACC_GYRO_ODR = 200; constexpr Boardcore::BMX160Config::OutputDataRate BMX160_ACC_GYRO_ODR_ENUM = - Boardcore::BMX160Config::OutputDataRate::HZ_800; -constexpr unsigned int BMX160_MAG_ODR = 800; + Boardcore::BMX160Config::OutputDataRate::HZ_200; +constexpr unsigned int BMX160_MAG_ODR = 100; constexpr Boardcore::BMX160Config::OutputDataRate BMX160_MAG_ODR_ENUM = - Boardcore::BMX160Config::OutputDataRate::HZ_800; + Boardcore::BMX160Config::OutputDataRate::HZ_100; constexpr unsigned int BMX160_TEMP_DIVIDER = 1000; @@ -72,7 +72,7 @@ constexpr uint32_t H3LIS331DL_PERIOD = 1; // [ms] 1000Hz // LPS22DF constexpr Boardcore::LPS22DF::AVG LPS22DF_AVG = Boardcore::LPS22DF::AVG_4; constexpr Boardcore::LPS22DF::ODR LPS22DF_ODR = Boardcore::LPS22DF::ODR_50; -constexpr uint32_t LPS22DF_PERIOD = 20; // [ms] 50Hz +constexpr uint32_t LPS22DF_PERIOD = 50; // [ms] 20Hz // UBXGPS constexpr uint8_t UBXGPS_SAMPLE_RATE = 10; diff --git a/src/boards/MockupMain/Sensors/Sensors.cpp b/src/boards/MockupMain/Sensors/Sensors.cpp index 888955909..bf00c2cab 100644 --- a/src/boards/MockupMain/Sensors/Sensors.cpp +++ b/src/boards/MockupMain/Sensors/Sensors.cpp @@ -113,15 +113,15 @@ bool Sensors::start() // Read the magnetometer calibration from predefined file // Init all the sensors - bmx160Init(); - bmx160WithCorrectionInit(); - lis3mdlInit(); + // bmx160Init(); + // bmx160WithCorrectionInit(); + // lis3mdlInit(); h3lisInit(); lps22Init(); - ubxGpsInit(); + // ubxGpsInit(); ads131Init(); - internalADCInit(); - batteryVoltageInit(); + // internalADCInit(); + // batteryVoltageInit(); loadCellInit(); // Add the magnetometer calibration to the scheduler diff --git a/src/boards/MockupMain/StateMachines/FlightModeManager/FlightModeManager.cpp b/src/boards/MockupMain/StateMachines/FlightModeManager/FlightModeManager.cpp index c980c5b68..7ff06df39 100644 --- a/src/boards/MockupMain/StateMachines/FlightModeManager/FlightModeManager.cpp +++ b/src/boards/MockupMain/StateMachines/FlightModeManager/FlightModeManager.cpp @@ -223,7 +223,7 @@ State FlightModeManager::state_sensors_calibration(const Event& event) } case FMM_ALGOS_CALIBRATE: { - return transition(&FlightModeManager::state_algos_calibration); + return transition(&FlightModeManager::state_ready); } default: { diff --git a/src/entrypoints/MockupMain/main-entry.cpp b/src/entrypoints/MockupMain/main-entry.cpp index 841240e1a..61851c5ce 100644 --- a/src/entrypoints/MockupMain/main-entry.cpp +++ b/src/entrypoints/MockupMain/main-entry.cpp @@ -147,11 +147,11 @@ int main() LOG_ERR(logger, "Error starting the Sensors module"); } - if (!modules.get<NASController>()->start()) - { - initResult = false; - LOG_ERR(logger, "Error starting the NAS module"); - } + // if (!modules.get<NASController>()->start()) + // { + // initResult = false; + // LOG_ERR(logger, "Error starting the NAS module"); + // } if (!modules.get<FlightModeManager>()->start()) { @@ -165,11 +165,11 @@ int main() LOG_ERR(logger, "Error starting the Radio module"); } - if (!modules.get<PinHandler>()->start()) - { - initResult = false; - LOG_ERR(logger, "Error starting the PinHandler module"); - } + // if (!modules.get<PinHandler>()->start()) + // { + // initResult = false; + // LOG_ERR(logger, "Error starting the PinHandler module"); + // } if (!modules.get<BoardScheduler>()->start()) { @@ -177,14 +177,14 @@ int main() LOG_ERR(logger, "Error starting the Board Scheduler module"); } - // Log all the events - EventSniffer sniffer(EventBroker::getInstance(), TOPICS_LIST, - [](uint8_t event, uint8_t topic) - { - EventData ev{TimestampTimer::getTimestamp(), event, - topic}; - Logger::getInstance().log(ev); - }); + // // Log all the events + // EventSniffer sniffer(EventBroker::getInstance(), TOPICS_LIST, + // [](uint8_t event, uint8_t topic) + // { + // EventData ev{TimestampTimer::getTimestamp(), event, + // topic}; + // Logger::getInstance().log(ev); + // }); // Check the init result and launch an event if (initResult) -- GitLab