1
0
forked from me/IronOS

Speed up accelerometer data intake.

The LIS2DH12 driver performed an unnecessary endianness conversion, as
data from the sensor was already coming in little-endian format.  The
MMA8652FC driver is now using the rev16 opcode to perform the swap
rather than doing all the bitshuffling operations in multiple steps.
This commit is contained in:
Alessandro Gatti
2019-08-29 04:03:54 +02:00
parent c96f1b528a
commit 5eb3df47df
5 changed files with 29 additions and 23 deletions

View File

@@ -254,10 +254,10 @@ void startMOVTask(void const *argument __unused) {
threshold -= systemSettings.sensitivity * 200; // 200 is the step size
if (PCBVersion == 2) {
LIS2DH12::getAxisReadings(&tx, &ty, &tz);
LIS2DH12::getAxisReadings(tx, ty, tz);
rotation = LIS2DH12::getOrientation();
} else if (PCBVersion == 1) {
MMA8652FC::getAxisReadings(&tx, &ty, &tz);
MMA8652FC::getAxisReadings(tx, ty, tz);
rotation = MMA8652FC::getOrientation();
}
if (systemSettings.OrientationMode == 2) {