mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
t1000: wait for button release before powering off
This commit is contained in:
parent
6e296e8db1
commit
b8f80afee9
1 changed files with 9 additions and 0 deletions
|
|
@ -84,12 +84,21 @@ public:
|
||||||
digitalWrite(PIN_3V3_EN, LOW);
|
digitalWrite(PIN_3V3_EN, LOW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// set led on and wait for button release before poweroff
|
||||||
|
#ifdef LED_PIN
|
||||||
|
digitalWrite(LED_PIN, HIGH);
|
||||||
|
#endif
|
||||||
|
#ifdef BUTTON_PIN
|
||||||
|
while(digitalRead(BUTTON_PIN));
|
||||||
|
#endif
|
||||||
#ifdef LED_PIN
|
#ifdef LED_PIN
|
||||||
digitalWrite(LED_PIN, LOW);
|
digitalWrite(LED_PIN, LOW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
|
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sd_power_system_off();
|
sd_power_system_off();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue