BjarneBitscrambler / OrientationSensorFusion-ESP

Files for performing orientation sensor fusion using NXP version 7 algorithm, ported to Espressif platforms.
BSD 3-Clause "New" or "Revised" License
23 stars 12 forks source link

Implement method for causing Calibration to be saved #19

Closed BjarneBitscrambler closed 3 years ago

BjarneBitscrambler commented 3 years ago

Magnetic calibration is loaded on boot-up from NVM (EEPROM) if available. Though calibration is checked and generated during regular operation, it is not automatically saved to NVM unless commanded. Currently the only way that command is received is from the NXP Sensor Toolkit. Therefore the sensor has to generate a new magnetic calibration each time it is powered on, which takes a bit of physical manipulation and time.

It is desirable to implement a method in the interface class to cause an existing magnetic calibration to be saved to NVM.

BjarneBitscrambler commented 3 years ago

There is now the method SensorFusion::InjectCommand(const char *command) available in the library interface, which causes a supplied command to be executed by the fusion control subsystem.

By calling this method with the command "SVMC", the current magnetic calibration is saved to non-volatile memory (EEPROM).

A list of other commands can be found in the library file control_input.c