1
0
forked from me/IronOS

LIS2DH - Adding support for the new accelerometer (#216)

+ Creates a new driver for the LIS2DH accelerometer
+ Fixes timing issues since we're already touching a chunk of code

The LIS2DH driver should output similar numbers to the old MMA accelerometer.

Fixes #202
Fixes #189
This commit is contained in:
Ben V. Brown
2018-03-03 15:43:10 +11:00
committed by GitHub
parent 3ce0cc0d99
commit aef8f5f5bb
10 changed files with 221 additions and 119 deletions

View File

@@ -103,13 +103,13 @@ static void printShortDescription(uint32_t shortDescIndex,
static int userConfirmation(const char* message) {
uint8_t maxOffset = strlen(message) + 7;
uint32_t messageStart = HAL_GetTick();
uint32_t messageStart = xTaskGetTickCount();
lcd.setFont(0);
lcd.setCursor(0, 0);
for (;;) {
int16_t messageOffset = (((HAL_GetTick() - messageStart) / 150) % maxOffset);
int16_t messageOffset = (((xTaskGetTickCount() - messageStart) / 15) % maxOffset);
lcd.clearScreen();
lcd.setCursor(12 * (7 - messageOffset), 0);
@@ -329,7 +329,7 @@ static void settings_setResetSettings(void) {
lcd.print("RESET OK");
lcd.refresh();
waitForButtonPressOrTimeout(2000);
waitForButtonPressOrTimeout(200);
}
}