Persist BMX160 compass calibration

- change updateState function to saveState function for clarity
- increase max save size
This commit is contained in:
Dan Welch 2024-12-13 16:23:14 -07:00
parent 14561f63a8
commit bff3cc183d
2 changed files with 4 additions and 4 deletions

View File

@ -67,7 +67,7 @@ int32_t BMX160Sensor::runOnce()
showingScreen = false;
screen->endAlert();
updateState();
saveState();
}
// LOG_DEBUG("BMX160 min_x: %.4f, max_X: %.4f, min_Y: %.4f, max_Y: %.4f, min_Z: %.4f, max_Z: %.4f", lowestX, highestX,
@ -150,7 +150,7 @@ void BMX160Sensor::loadState()
#endif
}
void BMX160Sensor::updateState()
void BMX160Sensor::saveState()
{
#ifdef FSCom
memcpy(&bmx160State, &bmx160Config, sizeof(BMX160Config));

View File

@ -12,7 +12,7 @@
#include "Fusion/Fusion.h"
#include <Rak_BMX160.h>
#define BMX160_MAX_STATE_BLOB_SIZE (144) // pad size to allow for additional saved config parameters (accel, gyro, etc)
#define BMX160_MAX_STATE_BLOB_SIZE (256) // pad size to allow for additional saved config parameters (accel, gyro, etc)
struct xyzFloat {
float x;
@ -38,7 +38,7 @@ class BMX160Sensor : public MotionSensor
const char *bmx160ConfigFileName = "/prefs/bmx160.dat";
uint8_t bmx160State[BMX160_MAX_STATE_BLOB_SIZE] = {0};
void loadState();
void updateState();
void saveState();
public:
explicit BMX160Sensor(ScanI2C::FoundDevice foundDevice);