|
25 | 25 | #include "consts.h"
|
26 | 26 | #include "logging/Level.h"
|
27 | 27 |
|
28 |
| -#define IMU_MPU6050_RUNTIME_CALIBRATION // Comment to revert to |
29 |
| - // startup/traditional-calibration |
30 |
| -#define BNO_USE_ARVR_STABILIZATION \ |
31 |
| - true // Set to false to disable stabilization for BNO085+ IMUs |
32 |
| -#define USE_6_AXIS \ |
33 |
| - true // uses 9 DoF (with mag) if false (only for ICM-20948 and BNO0xx currently) |
34 |
| -#define LOAD_BIAS true // Loads the bias values from NVS on start |
35 |
| -#define SAVE_BIAS true // Periodically saves bias calibration data to NVS |
36 |
| -#define BIAS_DEBUG false // Printing BIAS Variables to serial (ICM20948 only) |
37 |
| -#define ENABLE_TAP \ |
38 |
| - false // monitor accel for (triple) tap events and send them. Uses more cpu, |
39 |
| - // disable if problems. Server does nothing with value so disabled atm |
40 |
| -#define SEND_ACCELERATION true // send linear acceleration to the server |
41 |
| - |
42 |
| -// Debug information |
43 |
| - |
44 |
| -#define LOG_LEVEL LOG_LEVEL_DEBUG |
| 28 | +#ifndef IMU_MPU6050_RUNTIME_CALIBRATION |
| 29 | + // Set to false to revert to startup/traditional-calibration |
| 30 | + #define IMU_MPU6050_RUNTIME_CALIBRATION true |
| 31 | +#endif |
| 32 | + |
| 33 | +#ifndef BNO_USE_ARVR_STABILIZATION |
| 34 | + // Set to false to disable stabilization for BNO085+ IMUs |
| 35 | + #define BNO_USE_ARVR_STABILIZATION true |
| 36 | +#endif |
| 37 | + |
| 38 | +#ifndef BNO_USE_MAGNETOMETER_CORRECTION |
| 39 | + // Set to true to enable magnetometer correction for BNO08x IMUs. |
| 40 | + // Only works with USE_6_AXIS set to true. |
| 41 | + #define BNO_USE_MAGNETOMETER_CORRECTION false |
| 42 | +#endif |
| 43 | + |
| 44 | +#ifndef USE_6_AXIS |
| 45 | + // uses 9 DoF (with mag) if false (only for ICM-20948 and BNO0xx currently) |
| 46 | + #define USE_6_AXIS true |
| 47 | +#endif |
| 48 | + |
| 49 | +#ifndef LOAD_BIAS |
| 50 | + // Loads the bias values from NVS on start |
| 51 | + #define LOAD_BIAS true |
| 52 | +#endif |
| 53 | + |
| 54 | +#ifndef SAVE_BIAS |
| 55 | + // Periodically saves bias calibration data to NVS |
| 56 | + #define SAVE_BIAS true |
| 57 | +#endif |
| 58 | + |
| 59 | +#ifndef BIAS_DEBUG |
| 60 | + // Printing BIAS Variables to serial (ICM20948 only) |
| 61 | + #define BIAS_DEBUG false |
| 62 | +#endif |
| 63 | + |
| 64 | +#ifndef ENABLE_TAP |
| 65 | + // monitor accel for (triple) tap events and send them. Uses more cpu, |
| 66 | + // disable if problems. Server does nothing with value so disabled atm |
| 67 | + #define ENABLE_TAP false |
| 68 | +#endif |
| 69 | + |
| 70 | +#ifndef SEND_ACCELERATION |
| 71 | + // send linear acceleration to the server |
| 72 | + #define SEND_ACCELERATION true |
| 73 | +#endif |
| 74 | +//Debug information |
| 75 | + |
| 76 | +#ifndef LOG_LEVEL |
| 77 | + #define LOG_LEVEL LOG_LEVEL_DEBUG |
| 78 | +#endif |
45 | 79 |
|
46 | 80 | #if LOG_LEVEL == LOG_LEVEL_TRACE
|
47 |
| -#define DEBUG_SENSOR |
48 |
| -#define DEBUG_NETWORK |
49 |
| -#define DEBUG_CONFIGURATION |
| 81 | + #define DEBUG_SENSOR |
| 82 | + #define DEBUG_NETWORK |
| 83 | + #define DEBUG_CONFIGURATION |
50 | 84 | #endif
|
51 | 85 |
|
52 |
| -#define serialDebug false // Set to true to get Serial output for debugging |
53 |
| -#define serialBaudRate 115200 |
54 |
| -#define LED_INTERVAL_STANDBY 10000 |
55 |
| -#define PRINT_STATE_EVERY_MS 60000 |
| 86 | +// Set to true to get Serial output for debugging |
| 87 | +#ifndef serialDebug |
| 88 | + #define serialDebug false |
| 89 | +#endif |
| 90 | + |
| 91 | +#ifndef serialBaudRate |
| 92 | + #define serialBaudRate 115200 |
| 93 | +#endif |
| 94 | + |
| 95 | +#ifndef LED_INTERVAL_STANDBY |
| 96 | + #define LED_INTERVAL_STANDBY 10000 |
| 97 | +#endif |
| 98 | + |
| 99 | +#ifndef PRINT_STATE_EVERY_MS |
| 100 | + #define PRINT_STATE_EVERY_MS 60000 |
| 101 | +#endif |
56 | 102 |
|
57 | 103 | // Determines how often we sample and send data
|
58 |
| -#define samplingRateInMillis 10 |
| 104 | +#ifndef samplingRateInMillis |
| 105 | + #define samplingRateInMillis 10 |
| 106 | +#endif |
59 | 107 |
|
60 | 108 | // Sleeping options
|
61 |
| -#define POWERSAVING_MODE POWER_SAVING_LEGACY // Minimum causes sporadic data pauses |
| 109 | +#ifndef POWERSAVING_MODE |
| 110 | + #define POWERSAVING_MODE POWER_SAVING_LEGACY // Minimum causes sporadic data pauses |
| 111 | +#endif |
62 | 112 | #if POWERSAVING_MODE >= POWER_SAVING_MINIMUM
|
63 |
| -#define TARGET_LOOPTIME_MICROS (samplingRateInMillis * 1000) |
| 113 | + #define TARGET_LOOPTIME_MICROS (samplingRateInMillis * 1000) |
64 | 114 | #endif
|
65 | 115 |
|
66 | 116 | // Packet bundling/aggregation
|
67 |
| -#define PACKET_BUNDLING PACKET_BUNDLING_BUFFERED |
| 117 | +#ifndef PACKET_BUNDLING |
| 118 | + #define PACKET_BUNDLING PACKET_BUNDLING_BUFFERED |
| 119 | +#endif |
| 120 | + |
68 | 121 | // Extra tunable for PACKET_BUNDLING_BUFFERED (10000us = 10ms timeout, 100hz target)
|
69 |
| -#define PACKET_BUNDLING_BUFFER_SIZE_MICROS 10000 |
| 122 | +#ifndef PACKET_BUNDLING_BUFFER_SIZE_MICROS |
| 123 | + #define PACKET_BUNDLING_BUFFER_SIZE_MICROS 10000 |
| 124 | +#endif |
70 | 125 |
|
71 | 126 | // Setup for the Magnetometer
|
72 |
| -#define useFullCalibrationMatrix true |
| 127 | +#ifndef useFullCalibrationMatrix |
| 128 | + #define useFullCalibrationMatrix true |
| 129 | +#endif |
73 | 130 |
|
74 | 131 | // Battery configuration
|
75 |
| -#define batterySampleRate 10000 |
76 |
| -#define BATTERY_LOW_VOLTAGE_DEEP_SLEEP false |
77 |
| -#define BATTERY_LOW_POWER_VOLTAGE 3.3f // Voltage to raise error |
| 132 | +#ifndef batterySampleRate |
| 133 | + #define batterySampleRate 10000 |
| 134 | +#endif |
| 135 | +#ifndef BATTERY_LOW_VOLTAGE_DEEP_SLEEP |
| 136 | + #define BATTERY_LOW_VOLTAGE_DEEP_SLEEP false |
| 137 | +#endif |
| 138 | +#ifndef BATTERY_LOW_POWER_VOLTAGE |
| 139 | + #define BATTERY_LOW_POWER_VOLTAGE 3.3f // Voltage to raise error |
| 140 | +#endif |
78 | 141 |
|
79 | 142 | // Send updates over network only when changes are substantial
|
80 | 143 | // If "false" updates are sent at the sensor update rate (usually 100 TPS)
|
81 | 144 | // If "true" updates will be less frequent in the time of little motion
|
82 | 145 | // Experimental
|
83 |
| -#define OPTIMIZE_UPDATES true |
| 146 | +#ifndef OPTIMIZE_UPDATES |
| 147 | + #define OPTIMIZE_UPDATES true |
| 148 | +#endif |
| 149 | + |
| 150 | +#ifndef I2C_SPEED |
| 151 | + #define I2C_SPEED 400000 |
| 152 | +#endif |
84 | 153 |
|
85 |
| -#define I2C_SPEED 400000 |
| 154 | +#ifndef COMPLIANCE_MODE |
| 155 | + #define COMPLIANCE_MODE true |
| 156 | +#endif |
86 | 157 |
|
87 |
| -#define COMPLIANCE_MODE true |
88 | 158 | #define USE_ATTENUATION COMPLIANCE_MODE&& ESP8266
|
89 |
| -#define ATTENUATION_N 10.0 / 4.0 |
90 |
| -#define ATTENUATION_G 14.0 / 4.0 |
91 |
| -#define ATTENUATION_B 40.0 / 4.0 |
| 159 | +#ifndef ATTENUATION_N |
| 160 | + #define ATTENUATION_N 10.0 / 4.0 |
| 161 | +#endif |
| 162 | +#ifndef ATTENUATION_G |
| 163 | + #define ATTENUATION_G 14.0 / 4.0 |
| 164 | +#endif |
| 165 | +#ifndef ATTENUATION_B |
| 166 | + #define ATTENUATION_B 40.0 / 4.0 |
| 167 | +#endif |
92 | 168 |
|
93 | 169 | // Send inspection packets over the network to a profiler
|
94 | 170 | // Not recommended for production
|
95 |
| -#define ENABLE_INSPECTION false |
| 171 | +#ifndef ENABLE_INSPECTION |
| 172 | + #define ENABLE_INSPECTION false |
| 173 | +#endif |
96 | 174 |
|
97 | 175 | #define PROTOCOL_VERSION 18
|
98 | 176 |
|
|
0 commit comments