SignalK / SensESP

Universal Signal K sensor framework for the ESP32 platform
https://signalk.org/SensESP/
Apache License 2.0
152 stars 81 forks source link

Global variables must be removed from sensor_nxp_fxos8700_fxas21002.cpp #243

Closed mairas closed 3 years ago

mairas commented 3 years ago

The global variables present in the magnetometer code take several kilobytes of memory of any SensESP project, regardless of whether the magnetometer is used or not. They need to be removed (moved into classes that are only instantiated when actually used).

Some work in this direction was done in PR #166 but there still exists at least an instance of Adafruit_NXPSensorFusion that takes several KiB of memory. I tested this by removing the magnetometer source code, recompiling, and comparing the free memory figures before and after.

mairas commented 3 years ago

The same applies to orientation_9dof_input.cpp.