Skip to content

Commit

Permalink
tryfix #4384 - don't assume we want that functionality if the Acceler…
Browse files Browse the repository at this point in the history
…ometer was found. This is only for T-Watch
  • Loading branch information
caveman99 committed Sep 6, 2024
1 parent 55292f8 commit 9d67ed6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,6 @@ void setup()
#if !MESHTASTIC_EXCLUDE_I2C
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
if (acc_info.type != ScanI2C::DeviceType::NONE) {
config.display.wake_on_tap_or_motion = true;
moduleConfig.external_notification.enabled = true;
accelerometerThread = new AccelerometerThread(acc_info.type);
}
#endif
Expand Down
1 change: 1 addition & 0 deletions src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ void NodeDB::installDefaultConfig()
#ifdef T_WATCH_S3
config.display.screen_on_secs = 30;
config.display.wake_on_tap_or_motion = true;
moduleConfig.external_notification.enabled = true;
#endif
#ifdef HELTEC_VISION_MASTER_E290
// Orient so that LoRa antenna faces up
Expand Down
6 changes: 4 additions & 2 deletions src/modules/AdminModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
LOG_INFO("Setting config: Device\n");
config.has_device = true;
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
if (config.device.double_tap_as_button_press == false && c.payload_variant.device.double_tap_as_button_press == true) {
if (config.device.double_tap_as_button_press == false && c.payload_variant.device.double_tap_as_button_press == true &&
accelerometerThread->enabled == false) {
accelerometerThread->start();
}
#endif
Expand Down Expand Up @@ -484,7 +485,8 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
requiresReboot = false;
}
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
if (config.display.wake_on_tap_or_motion == false && c.payload_variant.display.wake_on_tap_or_motion == true) {
if (config.display.wake_on_tap_or_motion == false && c.payload_variant.display.wake_on_tap_or_motion == true &&
accelerometerThread->enabled == false) {
accelerometerThread->start();
}
#endif
Expand Down

0 comments on commit 9d67ed6

Please sign in to comment.