mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Reduce code size for accelerometer support (#288)
* Reduce the LIS2DH12 driver's code size. * Reduce the MMA8652FC driver's code size. * Make orientation detection smaller. * Inlined C++ class constructor. * De-unroll I2C register writes. * Removed unused setSensitivity method.
This commit is contained in:
committed by
Ben V. Brown
parent
4718efe79b
commit
215fe8e9e8
@@ -881,7 +881,7 @@ void startMOVTask(void const *argument) {
|
||||
#if ACCELDEBUG
|
||||
uint32_t max = 0;
|
||||
#endif
|
||||
uint8_t rotation = 0;
|
||||
Orientation rotation = ORIENTATION_FLAT;
|
||||
for (;;) {
|
||||
int32_t threshold = 1500 + (9 * 200);
|
||||
threshold -= systemSettings.sensitivity * 200; // 200 is the step size
|
||||
@@ -894,8 +894,8 @@ void startMOVTask(void const *argument) {
|
||||
rotation = accel.getOrientation();
|
||||
}
|
||||
if (systemSettings.OrientationMode == 2) {
|
||||
if (rotation != 0) {
|
||||
lcd.setRotation(rotation == 2); // link the data through
|
||||
if (rotation != ORIENTATION_FLAT) {
|
||||
lcd.setRotation(rotation == ORIENTATION_LEFT_HAND); // link the data through
|
||||
}
|
||||
}
|
||||
datax[currentPointer] = (int32_t) tx;
|
||||
|
||||
Reference in New Issue
Block a user