From 5bae6584bc351c28b8bfe1103572dadfd378afbd Mon Sep 17 00:00:00 2001 From: unlogisch04 <98281608+unlogisch04@users.noreply.github.com> Date: Sun, 18 Aug 2024 03:13:04 +0200 Subject: [PATCH 1/4] add guards to some defines Should address #334 Make defines.h more powerfull --- src/debug.h | 158 +++++++++++++----- src/defines_bmi160.h | 22 ++- .../GyroTemperatureCalibrator.h | 10 ++ src/motionprocessing/RestDetection.h | 18 +- src/sensors/SensorFusion.h | 2 + src/sensors/mpu6050sensor.cpp | 8 +- 6 files changed, 165 insertions(+), 53 deletions(-) diff --git a/src/debug.h b/src/debug.h index 79cc6ec5..7cb72af2 100644 --- a/src/debug.h +++ b/src/debug.h @@ -25,74 +25,152 @@ #include "consts.h" #include "logging/Level.h" -#define IMU_MPU6050_RUNTIME_CALIBRATION // Comment to revert to - // startup/traditional-calibration -#define BNO_USE_ARVR_STABILIZATION \ - true // Set to false to disable stabilization for BNO085+ IMUs -#define USE_6_AXIS \ - true // uses 9 DoF (with mag) if false (only for ICM-20948 and BNO0xx currently) -#define LOAD_BIAS true // Loads the bias values from NVS on start -#define SAVE_BIAS true // Periodically saves bias calibration data to NVS -#define BIAS_DEBUG false // Printing BIAS Variables to serial (ICM20948 only) -#define ENABLE_TAP \ - false // monitor accel for (triple) tap events and send them. Uses more cpu, - // disable if problems. Server does nothing with value so disabled atm -#define SEND_ACCELERATION true // send linear acceleration to the server - -// Debug information - -#define LOG_LEVEL LOG_LEVEL_DEBUG +#ifndef IMU_MPU6050_RUNTIME_CALIBRATION + // Set to false to revert to startup/traditional-calibration + #define IMU_MPU6050_RUNTIME_CALIBRATION true +#endif + +#ifndef BNO_USE_ARVR_STABILIZATION + // Set to false to disable stabilization for BNO085+ IMUs + #define BNO_USE_ARVR_STABILIZATION true +#endif + +#ifndef BNO_USE_MAGNETOMETER_CORRECTION + // Set to true to enable magnetometer correction for BNO08x IMUs. + // Only works with USE_6_AXIS set to true. + #define BNO_USE_MAGNETOMETER_CORRECTION false +#endif + +#ifndef USE_6_AXIS + // uses 9 DoF (with mag) if false (only for ICM-20948 and BNO0xx currently) + #define USE_6_AXIS true +#endif + +#ifndef LOAD_BIAS + // Loads the bias values from NVS on start + #define LOAD_BIAS true +#endif + +#ifndef SAVE_BIAS + // Periodically saves bias calibration data to NVS + #define SAVE_BIAS true +#endif + +#ifndef BIAS_DEBUG + // Printing BIAS Variables to serial (ICM20948 only) + #define BIAS_DEBUG false +#endif + +#ifndef ENABLE_TAP + // monitor accel for (triple) tap events and send them. Uses more cpu, + // disable if problems. Server does nothing with value so disabled atm + #define ENABLE_TAP false +#endif + +#ifndef SEND_ACCELERATION + // send linear acceleration to the server + #define SEND_ACCELERATION true +#endif +//Debug information + +#ifndef LOG_LEVEL + #define LOG_LEVEL LOG_LEVEL_DEBUG +#endif #if LOG_LEVEL == LOG_LEVEL_TRACE -#define DEBUG_SENSOR -#define DEBUG_NETWORK -#define DEBUG_CONFIGURATION + #define DEBUG_SENSOR + #define DEBUG_NETWORK + #define DEBUG_CONFIGURATION #endif -#define serialDebug false // Set to true to get Serial output for debugging -#define serialBaudRate 115200 -#define LED_INTERVAL_STANDBY 10000 -#define PRINT_STATE_EVERY_MS 60000 +// Set to true to get Serial output for debugging +#ifndef serialDebug + #define serialDebug false +#endif + +#ifndef serialBaudRate + #define serialBaudRate 115200 +#endif + +#ifndef LED_INTERVAL_STANDBY + #define LED_INTERVAL_STANDBY 10000 +#endif + +#ifndef PRINT_STATE_EVERY_MS + #define PRINT_STATE_EVERY_MS 60000 +#endif // Determines how often we sample and send data -#define samplingRateInMillis 10 +#ifndef samplingRateInMillis + #define samplingRateInMillis 10 +#endif // Sleeping options -#define POWERSAVING_MODE POWER_SAVING_LEGACY // Minimum causes sporadic data pauses +#ifndef POWERSAVING_MODE + #define POWERSAVING_MODE POWER_SAVING_LEGACY // Minimum causes sporadic data pauses +#endif #if POWERSAVING_MODE >= POWER_SAVING_MINIMUM -#define TARGET_LOOPTIME_MICROS (samplingRateInMillis * 1000) + #define TARGET_LOOPTIME_MICROS (samplingRateInMillis * 1000) #endif // Packet bundling/aggregation -#define PACKET_BUNDLING PACKET_BUNDLING_BUFFERED +#ifndef PACKET_BUNDLING + #define PACKET_BUNDLING PACKET_BUNDLING_BUFFERED +#endif + // Extra tunable for PACKET_BUNDLING_BUFFERED (10000us = 10ms timeout, 100hz target) -#define PACKET_BUNDLING_BUFFER_SIZE_MICROS 10000 +#ifndef PACKET_BUNDLING_BUFFER_SIZE_MICROS + #define PACKET_BUNDLING_BUFFER_SIZE_MICROS 10000 +#endif // Setup for the Magnetometer -#define useFullCalibrationMatrix true +#ifndef useFullCalibrationMatrix + #define useFullCalibrationMatrix true +#endif // Battery configuration -#define batterySampleRate 10000 -#define BATTERY_LOW_VOLTAGE_DEEP_SLEEP false -#define BATTERY_LOW_POWER_VOLTAGE 3.3f // Voltage to raise error +#ifndef batterySampleRate + #define batterySampleRate 10000 +#endif +#ifndef BATTERY_LOW_VOLTAGE_DEEP_SLEEP + #define BATTERY_LOW_VOLTAGE_DEEP_SLEEP false +#endif +#ifndef BATTERY_LOW_POWER_VOLTAGE + #define BATTERY_LOW_POWER_VOLTAGE 3.3f // Voltage to raise error +#endif // Send updates over network only when changes are substantial // If "false" updates are sent at the sensor update rate (usually 100 TPS) // If "true" updates will be less frequent in the time of little motion // Experimental -#define OPTIMIZE_UPDATES true +#ifndef OPTIMIZE_UPDATES + #define OPTIMIZE_UPDATES true +#endif + +#ifndef I2C_SPEED + #define I2C_SPEED 400000 +#endif -#define I2C_SPEED 400000 +#ifndef COMPLIANCE_MODE + #define COMPLIANCE_MODE true +#endif -#define COMPLIANCE_MODE true #define USE_ATTENUATION COMPLIANCE_MODE&& ESP8266 -#define ATTENUATION_N 10.0 / 4.0 -#define ATTENUATION_G 14.0 / 4.0 -#define ATTENUATION_B 40.0 / 4.0 +#ifndef ATTENUATION_N + #define ATTENUATION_N 10.0 / 4.0 +#endif +#ifndef ATTENUATION_G + #define ATTENUATION_G 14.0 / 4.0 +#endif +#ifndef ATTENUATION_B + #define ATTENUATION_B 40.0 / 4.0 +#endif // Send inspection packets over the network to a profiler // Not recommended for production -#define ENABLE_INSPECTION false +#ifndef ENABLE_INSPECTION + #define ENABLE_INSPECTION false +#endif #define PROTOCOL_VERSION 18 diff --git a/src/defines_bmi160.h b/src/defines_bmi160.h index 747656c8..10e45369 100644 --- a/src/defines_bmi160.h +++ b/src/defines_bmi160.h @@ -26,24 +26,34 @@ // BMI160 magnetometer type, applies to both main and aux trackers, mixed types are not // supported currently. If only 1 out of 2 trackers has a mag, tracker without a mag // should still function normally. NOT USED if USE_6_AXIS == true Pick one: +#ifndef BMI160_MAG_TYPE #define BMI160_MAG_TYPE BMI160_MAG_TYPE_HMC +#endif // #define BMI160_MAG_TYPE BMI160_MAG_TYPE_QMC // Use VQF instead of mahony sensor fusion. // Features: rest bias estimation, magnetic distortion rejection. +#ifndef BMI160_USE_VQF #define BMI160_USE_VQF true +#endif // Use BasicVQF instead of VQF (if BMI160_USE_VQF == true). // Disables the features above. +#ifndef BMI160_USE_BASIC_VQF #define BMI160_USE_BASIC_VQF false +#endif // Use temperature calibration. +#ifndef BMI160_USE_TEMPCAL #define BMI160_USE_TEMPCAL true +#endif // How long to run gyro calibration for. // Disables this calibration step if value is 0. // Default: 5 +#ifndef BMI160_CALIBRATION_GYRO_SECONDS #define BMI160_CALIBRATION_GYRO_SECONDS 5 +#endif // Calibration method options: // - Skip: disable this calibration step; @@ -52,22 +62,32 @@ // Default: ACCEL_CALIBRATION_METHOD_6POINT // #define BMI160_ACCEL_CALIBRATION_METHOD ACCEL_CALIBRATION_METHOD_SKIP // #define BMI160_ACCEL_CALIBRATION_METHOD ACCEL_CALIBRATION_METHOD_ROTATION +#ifndef BMI160_ACCEL_CALIBRATION_METHOD #define BMI160_ACCEL_CALIBRATION_METHOD ACCEL_CALIBRATION_METHOD_6POINT +#endif // How long to run magnetometer calibration for, if enabled and you have added a // magnetometer. Magnetometer not be used until you calibrate it. Disables this // calibration step if value is 0. NOT USED if USE_6_AXIS == true Default: 20 +#ifndef BMI160_CALIBRATION_MAG_SECONDS #define BMI160_CALIBRATION_MAG_SECONDS 20 +#endif // Send temperature to the server as AXXYY, // where XX is calibration progress from 0 to 60, and YY is temperature, // A is 1: not in calibration mode or 2: calibration in progress. +#ifndef BMI160_TEMPCAL_DEBUG #define BMI160_TEMPCAL_DEBUG false +#endif // Print debug info every second. +#ifndef BMI160_DEBUG #define BMI160_DEBUG false +#endif // Use sensitivity calibration. +#ifndef BMI160_USE_SENSCAL #define BMI160_USE_SENSCAL true +#endif -#endif \ No newline at end of file +#endif diff --git a/src/motionprocessing/GyroTemperatureCalibrator.h b/src/motionprocessing/GyroTemperatureCalibrator.h index 352bb0b9..b4598029 100644 --- a/src/motionprocessing/GyroTemperatureCalibrator.h +++ b/src/motionprocessing/GyroTemperatureCalibrator.h @@ -34,24 +34,34 @@ // Degrees C // default: 15.0f +#ifndef TEMP_CALIBRATION_MIN #define TEMP_CALIBRATION_MIN 15.0f +#endif // Degrees C // default: 45.0f +#ifndef TEMP_CALIBRATION_MAX #define TEMP_CALIBRATION_MAX 45.0f +#endif // Snap calibration to every 1/2 of degree: 20.00, 20.50, 21.00, etc // default: 0.5f +#ifndef TEMP_CALIBRATION_STEP #define TEMP_CALIBRATION_STEP 0.5f +#endif // Record debug samples if current temperature is off by no more than this value; // if snapping point is 20.00 - samples will be recorded in range of 19.80 - 20.20 // default: 0.2f +#ifndef TEMP_CALIBRATION_MAX_DEVIATION_FROM_STEP #define TEMP_CALIBRATION_MAX_DEVIATION_FROM_STEP 0.2f +#endif // How long to average gyro samples for before saving a data point // default: 0.2f +#ifndef TEMP_CALIBRATION_SECONDS_PER_STEP #define TEMP_CALIBRATION_SECONDS_PER_STEP 0.2f +#endif #if IMU == IMU_ICM20948 // 16 bit 333 lsb/K, ~0.00508 degrees per bit diff --git a/src/motionprocessing/RestDetection.h b/src/motionprocessing/RestDetection.h index 33b98260..af8b6a18 100644 --- a/src/motionprocessing/RestDetection.h +++ b/src/motionprocessing/RestDetection.h @@ -8,7 +8,9 @@ #ifndef REST_DETECTION_H #define REST_DETECTION_H -// #define REST_DETECTION_DISABLE_LPF +#ifndef REST_DETECTION_DISABLE_LPF +#define REST_DETECTION_DISABLE_LPF false +#endif #include #include @@ -54,7 +56,7 @@ class RestDetection { setup(); } -#ifndef REST_DETECTION_DISABLE_LPF +#if !REST_DETECTION_DISABLE_LPF void filterInitialState( sensor_real_t x0, const double b[3], @@ -118,7 +120,7 @@ class RestDetection { #endif void updateGyr(const sensor_real_t gyr[3]) { -#ifdef REST_DETECTION_DISABLE_LPF +#if REST_DETECTION_DISABLE_LPF gyrLastSquaredDeviation = square(gyr[0] - lastSample.gyr[0]) + square(gyr[1] - lastSample.gyr[1]) + square(gyr[2] - lastSample.gyr[2]); @@ -168,7 +170,7 @@ class RestDetection { return; } -#ifdef REST_DETECTION_DISABLE_LPF +#if REST_DETECTION_DISABLE_LPF accLastSquaredDeviation = square(acc[0] - lastSample.acc[0]) + square(acc[1] - lastSample.acc[1]) + square(acc[2] - lastSample.acc[2]); @@ -216,7 +218,7 @@ class RestDetection { bool getRestDetected() { return restDetected; } -#ifndef REST_DETECTION_DISABLE_LPF +#if !REST_DETECTION_DISABLE_LPF void resetState() { restDetected = false; @@ -251,7 +253,7 @@ class RestDetection { #endif void setup() { -#ifndef REST_DETECTION_DISABLE_LPF +#if !REST_DETECTION_DISABLE_LPF assert(gyrTs > 0); assert(accTs > 0); @@ -271,7 +273,7 @@ class RestDetection { sensor_real_t gyrTs; sensor_real_t accTs; -#ifndef REST_DETECTION_DISABLE_LPF +#if !REST_DETECTION_DISABLE_LPF sensor_real_t restLastGyrLp[3]; double restGyrLpState[3 * 2]; double restGyrLpB[3]; @@ -288,4 +290,4 @@ class RestDetection { #endif }; -#endif \ No newline at end of file +#endif diff --git a/src/sensors/SensorFusion.h b/src/sensors/SensorFusion.h index c60b02f2..dc0a4271 100644 --- a/src/sensors/SensorFusion.h +++ b/src/sensors/SensorFusion.h @@ -6,7 +6,9 @@ #define SENSOR_DOUBLE_PRECISION 0 +#ifndef SENSOR_FUSION_TYPE #define SENSOR_FUSION_TYPE SENSOR_FUSION_VQF +#endif #define SENSOR_FUSION_MAHONY 1 #define SENSOR_FUSION_MADGWICK 2 diff --git a/src/sensors/mpu6050sensor.cpp b/src/sensors/mpu6050sensor.cpp index 4480c78d..8eb6d637 100644 --- a/src/sensors/mpu6050sensor.cpp +++ b/src/sensors/mpu6050sensor.cpp @@ -23,7 +23,7 @@ #include "globals.h" -#ifdef IMU_MPU6050_RUNTIME_CALIBRATION +#if IMU_MPU6050_RUNTIME_CALIBRATION #include "MPU6050_6Axis_MotionApps_V6_12.h" #else #include "MPU6050_6Axis_MotionApps20.h" @@ -60,7 +60,7 @@ void MPU6050Sensor::motionSetup() { addr ); -#ifndef IMU_MPU6050_RUNTIME_CALIBRATION +#if !IMU_MPU6050_RUNTIME_CALIBRATION // Initialize the configuration { SlimeVR::Configuration::SensorConfig sensorCalibration @@ -93,7 +93,7 @@ void MPU6050Sensor::motionSetup() { devStatus = imu.dmpInitialize(); if (devStatus == 0) { -#ifdef IMU_MPU6050_RUNTIME_CALIBRATION +#if IMU_MPU6050_RUNTIME_CALIBRATION // We don't have to manually calibrate if we are using the dmp's automatic // calibration #else // IMU_MPU6050_RUNTIME_CALIBRATION @@ -191,7 +191,7 @@ void MPU6050Sensor::motionLoop() { void MPU6050Sensor::startCalibration(int calibrationType) { ledManager.on(); -#ifdef IMU_MPU6050_RUNTIME_CALIBRATION +#if IMU_MPU6050_RUNTIME_CALIBRATION m_Logger.info( "MPU is using automatic runtime calibration. Place down the device and it " "should automatically calibrate after a few seconds" From 93aaa29cdaebe3c42ea304c5625f90e90ce8f0ac Mon Sep 17 00:00:00 2001 From: unlogisch04 <98281608+unlogisch04@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:21:46 +0100 Subject: [PATCH 2/4] Make defines.h to be processed in debug.h --- src/debug.h | 3 +++ src/globals.h | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/debug.h b/src/debug.h index 7cb72af2..e0704d2b 100644 --- a/src/debug.h +++ b/src/debug.h @@ -23,6 +23,9 @@ #ifndef SLIMEVR_DEBUG_H_ #define SLIMEVR_DEBUG_H_ #include "consts.h" +#include "defines.h" +#include "defines_bmi160.h" +#include "defines_sensitivity.h" #include "logging/Level.h" #ifndef IMU_MPU6050_RUNTIME_CALIBRATION diff --git a/src/globals.h b/src/globals.h index 67eaac12..bdcc9072 100644 --- a/src/globals.h +++ b/src/globals.h @@ -25,11 +25,7 @@ #include -#include "consts.h" #include "debug.h" -#include "defines.h" -#include "defines_bmi160.h" -#include "defines_sensitivity.h" #ifndef SECOND_IMU #define SECOND_IMU IMU From 940ed5ecb5d282d489a0652b4a21fb923c32d421 Mon Sep 17 00:00:00 2001 From: unlogisch04 <98281608+unlogisch04@users.noreply.github.com> Date: Sun, 17 Nov 2024 01:41:09 +0100 Subject: [PATCH 3/4] add clang formating --- src/debug.h | 90 +++++++++---------- .../GyroTemperatureCalibrator.h | 2 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/debug.h b/src/debug.h index e0704d2b..7b6897cc 100644 --- a/src/debug.h +++ b/src/debug.h @@ -29,117 +29,117 @@ #include "logging/Level.h" #ifndef IMU_MPU6050_RUNTIME_CALIBRATION - // Set to false to revert to startup/traditional-calibration - #define IMU_MPU6050_RUNTIME_CALIBRATION true +// Set to false to revert to startup/traditional-calibration +#define IMU_MPU6050_RUNTIME_CALIBRATION true #endif #ifndef BNO_USE_ARVR_STABILIZATION - // Set to false to disable stabilization for BNO085+ IMUs - #define BNO_USE_ARVR_STABILIZATION true +// Set to false to disable stabilization for BNO085+ IMUs +#define BNO_USE_ARVR_STABILIZATION true #endif #ifndef BNO_USE_MAGNETOMETER_CORRECTION - // Set to true to enable magnetometer correction for BNO08x IMUs. - // Only works with USE_6_AXIS set to true. - #define BNO_USE_MAGNETOMETER_CORRECTION false +// Set to true to enable magnetometer correction for BNO08x IMUs. +// Only works with USE_6_AXIS set to true. +#define BNO_USE_MAGNETOMETER_CORRECTION false #endif #ifndef USE_6_AXIS - // uses 9 DoF (with mag) if false (only for ICM-20948 and BNO0xx currently) - #define USE_6_AXIS true +// uses 9 DoF (with mag) if false (only for ICM-20948 and BNO0xx currently) +#define USE_6_AXIS true #endif #ifndef LOAD_BIAS - // Loads the bias values from NVS on start - #define LOAD_BIAS true +// Loads the bias values from NVS on start +#define LOAD_BIAS true #endif #ifndef SAVE_BIAS - // Periodically saves bias calibration data to NVS - #define SAVE_BIAS true +// Periodically saves bias calibration data to NVS +#define SAVE_BIAS true #endif #ifndef BIAS_DEBUG - // Printing BIAS Variables to serial (ICM20948 only) - #define BIAS_DEBUG false +// Printing BIAS Variables to serial (ICM20948 only) +#define BIAS_DEBUG false #endif #ifndef ENABLE_TAP - // monitor accel for (triple) tap events and send them. Uses more cpu, - // disable if problems. Server does nothing with value so disabled atm - #define ENABLE_TAP false +// monitor accel for (triple) tap events and send them. Uses more cpu, +// disable if problems. Server does nothing with value so disabled atm +#define ENABLE_TAP false #endif #ifndef SEND_ACCELERATION - // send linear acceleration to the server - #define SEND_ACCELERATION true +// send linear acceleration to the server +#define SEND_ACCELERATION true #endif -//Debug information +// Debug information #ifndef LOG_LEVEL - #define LOG_LEVEL LOG_LEVEL_DEBUG +#define LOG_LEVEL LOG_LEVEL_DEBUG #endif #if LOG_LEVEL == LOG_LEVEL_TRACE - #define DEBUG_SENSOR - #define DEBUG_NETWORK - #define DEBUG_CONFIGURATION +#define DEBUG_SENSOR +#define DEBUG_NETWORK +#define DEBUG_CONFIGURATION #endif // Set to true to get Serial output for debugging #ifndef serialDebug - #define serialDebug false +#define serialDebug false #endif #ifndef serialBaudRate - #define serialBaudRate 115200 +#define serialBaudRate 115200 #endif #ifndef LED_INTERVAL_STANDBY - #define LED_INTERVAL_STANDBY 10000 +#define LED_INTERVAL_STANDBY 10000 #endif #ifndef PRINT_STATE_EVERY_MS - #define PRINT_STATE_EVERY_MS 60000 +#define PRINT_STATE_EVERY_MS 60000 #endif // Determines how often we sample and send data #ifndef samplingRateInMillis - #define samplingRateInMillis 10 +#define samplingRateInMillis 10 #endif // Sleeping options #ifndef POWERSAVING_MODE - #define POWERSAVING_MODE POWER_SAVING_LEGACY // Minimum causes sporadic data pauses +#define POWERSAVING_MODE POWER_SAVING_LEGACY // Minimum causes sporadic data pauses #endif #if POWERSAVING_MODE >= POWER_SAVING_MINIMUM - #define TARGET_LOOPTIME_MICROS (samplingRateInMillis * 1000) +#define TARGET_LOOPTIME_MICROS (samplingRateInMillis * 1000) #endif // Packet bundling/aggregation #ifndef PACKET_BUNDLING - #define PACKET_BUNDLING PACKET_BUNDLING_BUFFERED +#define PACKET_BUNDLING PACKET_BUNDLING_BUFFERED #endif // Extra tunable for PACKET_BUNDLING_BUFFERED (10000us = 10ms timeout, 100hz target) #ifndef PACKET_BUNDLING_BUFFER_SIZE_MICROS - #define PACKET_BUNDLING_BUFFER_SIZE_MICROS 10000 +#define PACKET_BUNDLING_BUFFER_SIZE_MICROS 10000 #endif // Setup for the Magnetometer #ifndef useFullCalibrationMatrix - #define useFullCalibrationMatrix true +#define useFullCalibrationMatrix true #endif // Battery configuration #ifndef batterySampleRate - #define batterySampleRate 10000 +#define batterySampleRate 10000 #endif #ifndef BATTERY_LOW_VOLTAGE_DEEP_SLEEP - #define BATTERY_LOW_VOLTAGE_DEEP_SLEEP false +#define BATTERY_LOW_VOLTAGE_DEEP_SLEEP false #endif #ifndef BATTERY_LOW_POWER_VOLTAGE - #define BATTERY_LOW_POWER_VOLTAGE 3.3f // Voltage to raise error +#define BATTERY_LOW_POWER_VOLTAGE 3.3f // Voltage to raise error #endif // Send updates over network only when changes are substantial @@ -147,32 +147,32 @@ // If "true" updates will be less frequent in the time of little motion // Experimental #ifndef OPTIMIZE_UPDATES - #define OPTIMIZE_UPDATES true +#define OPTIMIZE_UPDATES true #endif #ifndef I2C_SPEED - #define I2C_SPEED 400000 +#define I2C_SPEED 400000 #endif #ifndef COMPLIANCE_MODE - #define COMPLIANCE_MODE true +#define COMPLIANCE_MODE true #endif #define USE_ATTENUATION COMPLIANCE_MODE&& ESP8266 #ifndef ATTENUATION_N - #define ATTENUATION_N 10.0 / 4.0 +#define ATTENUATION_N 10.0 / 4.0 #endif #ifndef ATTENUATION_G - #define ATTENUATION_G 14.0 / 4.0 +#define ATTENUATION_G 14.0 / 4.0 #endif #ifndef ATTENUATION_B - #define ATTENUATION_B 40.0 / 4.0 +#define ATTENUATION_B 40.0 / 4.0 #endif // Send inspection packets over the network to a profiler // Not recommended for production #ifndef ENABLE_INSPECTION - #define ENABLE_INSPECTION false +#define ENABLE_INSPECTION false #endif #define PROTOCOL_VERSION 18 diff --git a/src/motionprocessing/GyroTemperatureCalibrator.h b/src/motionprocessing/GyroTemperatureCalibrator.h index b4598029..6abacb7c 100644 --- a/src/motionprocessing/GyroTemperatureCalibrator.h +++ b/src/motionprocessing/GyroTemperatureCalibrator.h @@ -101,7 +101,7 @@ struct GyroTemperatureCalibrationState { , tSum(0.0f) , xSum(0) , ySum(0) - , zSum(0){}; + , zSum(0) {}; }; struct GyroTemperatureOffsetSample { From 51c7c610afcac45369b89786a020503dd847ec00 Mon Sep 17 00:00:00 2001 From: unlogisch04 <98281608+unlogisch04@users.noreply.github.com> Date: Sun, 17 Nov 2024 02:03:06 +0100 Subject: [PATCH 4/4] try again --- src/motionprocessing/GyroTemperatureCalibrator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/motionprocessing/GyroTemperatureCalibrator.h b/src/motionprocessing/GyroTemperatureCalibrator.h index 6abacb7c..0f2a78ea 100644 --- a/src/motionprocessing/GyroTemperatureCalibrator.h +++ b/src/motionprocessing/GyroTemperatureCalibrator.h @@ -101,7 +101,7 @@ struct GyroTemperatureCalibrationState { , tSum(0.0f) , xSum(0) , ySum(0) - , zSum(0) {}; + , zSum(0) {} }; struct GyroTemperatureOffsetSample {