diff --git a/src/boards/Parafoil/Configs/SensorsConfig.h b/src/boards/Parafoil/Configs/SensorsConfig.h index b9057e419389016bbd181b250d618ccc5ce42987..88d628e9ec548e6cc6641596b8157b69ba687668 100644 --- a/src/boards/Parafoil/Configs/SensorsConfig.h +++ b/src/boards/Parafoil/Configs/SensorsConfig.h @@ -119,6 +119,10 @@ constexpr float BATTERY_VOLTAGE_COEFF = (150 + 40.2) / 40.2; // imprecision, avoid clearing the fifo before the interrupt constexpr unsigned int BMX160_SAMPLE_PERIOD = BMX160_FIFO_FILL_TIME * (BMX160_FIFO_WATERMARK + 30) * 4 / 1024; // [ms] +// BMX160_WITH_CORRECTION_SAMPLE_PERIOD should be lower than the +// BMX160_SAMPLE_PERIOD and faster then the NAS +constexpr unsigned int BMX160_WITH_CORRECTION_SAMPLE_PERIOD = 100; // [ms] + constexpr unsigned int LIS3MDL_SAMPLE_PERIOD = 15; constexpr unsigned int INTERNAL_ADC_SAMPLE_PERIOD = 1000; // [ms] constexpr unsigned int INTERNAL_TEMP_SAMPLE_PERIOD = 2000; // [ms] diff --git a/src/boards/Parafoil/Sensors/Sensors.cpp b/src/boards/Parafoil/Sensors/Sensors.cpp index a6a3b393bcb263ffb89925c40d220b9d56ac748b..761cd429b772d515f77c67a36f961b85f1a59806 100644 --- a/src/boards/Parafoil/Sensors/Sensors.cpp +++ b/src/boards/Parafoil/Sensors/Sensors.cpp @@ -244,7 +244,8 @@ void Sensors::bmx160WithCorrectionInit() bmx160WithCorrection = new BMX160WithCorrection(bmx160, BMX160_AXIS_ROTATION); - SensorInfo info("BMX160WithCorrection", BMX160_SAMPLE_PERIOD, + SensorInfo info("BMX160WithCorrection", + BMX160_WITH_CORRECTION_SAMPLE_PERIOD, bind(&Sensors::bmx160WithCorrectionCallback, this)); sensorMap.emplace(make_pair(bmx160WithCorrection, info));