Skip to content

Commit

Permalink
Increased IMU motion threshold
Browse files Browse the repository at this point in the history
- increased threshold for keeping the device awake from 50 to 100
- remove "bus_shared = true" from LovyanGFX config
  • Loading branch information
CoretechR committed Dec 26, 2024
1 parent ee57f5f commit 2cce14d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Platformio/hardware/ESP32/boardtest/main_boardtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SFE_MAX1704X fuelGauge(MAX1704X_MAX17048);
// IMU declarations
int motion = 0;
#define SLEEP_TIMEOUT 20000 // time until device enters sleep mode in milliseconds
#define MOTION_THRESHOLD 50 // motion above threshold keeps device awake
#define MOTION_THRESHOLD 80 // motion above threshold keeps device awake
int standbyTimer = SLEEP_TIMEOUT;
bool wakeupByIMUEnabled = true;
LIS3DH IMU(I2C_MODE, 0x19); // Default constructor is I2C, addr 0x19.
Expand Down Expand Up @@ -112,7 +112,6 @@ class LGFX : public lgfx::LGFX_Device
cfg.pin_sda = SDA;
cfg.pin_scl = SCL;
cfg.freq = 400000;
cfg.bus_shared = true;
cfg.x_min = 0;
cfg.x_max = screenWidth-1;
cfg.y_min = 0;
Expand Down
2 changes: 1 addition & 1 deletion Platformio/hardware/ESP32/sleep_hal_esp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

uint8_t ACC_INT_GPIO = 13;

int MOTION_THRESHOLD = 50; // motion above threshold keeps device awake
int MOTION_THRESHOLD = 80; // motion above threshold keeps device awake
int DEFAULT_SLEEP_TIMEOUT = 20000; // default time until device enters sleep mode in milliseconds. Can be overridden.

// is "lift to wake" enabled
Expand Down
1 change: 0 additions & 1 deletion Platformio/hardware/ESP32/tft_hal_esp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ LGFX::LGFX(void) {
cfg.pin_sda = SDA_GPIO;
cfg.pin_scl = SCL_GPIO;
cfg.freq = 400000;
cfg.bus_shared = true;
cfg.x_min = 0;
cfg.x_max = SCR_WIDTH-1;
cfg.y_min = 0;
Expand Down

0 comments on commit 2cce14d

Please sign in to comment.