mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #767 from liamcottle/fix/wismeshtag-poweroff-wakeup
Fix: WisMeshTag power off and wake up
This commit is contained in:
commit
f35e259fd6
1 changed files with 4 additions and 2 deletions
|
|
@ -62,7 +62,8 @@ public:
|
||||||
digitalWrite(LED_PIN, HIGH);
|
digitalWrite(LED_PIN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
while(digitalRead(BUTTON_PIN));
|
// wismesh tag uses LOW to indicate button is pressed, wait until it goes HIGH to indicate it was released
|
||||||
|
while(digitalRead(BUTTON_PIN) == LOW);
|
||||||
#endif
|
#endif
|
||||||
#ifdef LED_GREEN
|
#ifdef LED_GREEN
|
||||||
digitalWrite(LED_GREEN, LOW);
|
digitalWrite(LED_GREEN, LOW);
|
||||||
|
|
@ -72,7 +73,8 @@ public:
|
||||||
#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);
|
// configure button press to wake up when in powered off state
|
||||||
|
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sd_power_system_off();
|
sd_power_system_off();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue