Skip to content

Commit f35e259

Browse files
authored
Merge pull request #767 from liamcottle/fix/wismeshtag-poweroff-wakeup
Fix: WisMeshTag power off and wake up
2 parents 5344f04 + 80d5e2d commit f35e259

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

variants/rak_wismesh_tag/RAKWismeshTagBoard.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class RAKWismeshTagBoard : public mesh::MainBoard {
6262
digitalWrite(LED_PIN, HIGH);
6363
#endif
6464
#ifdef BUTTON_PIN
65-
while(digitalRead(BUTTON_PIN));
65+
// wismesh tag uses LOW to indicate button is pressed, wait until it goes HIGH to indicate it was released
66+
while(digitalRead(BUTTON_PIN) == LOW);
6667
#endif
6768
#ifdef LED_GREEN
6869
digitalWrite(LED_GREEN, LOW);
@@ -72,7 +73,8 @@ class RAKWismeshTagBoard : public mesh::MainBoard {
7273
#endif
7374

7475
#ifdef BUTTON_PIN
75-
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
76+
// configure button press to wake up when in powered off state
77+
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
7678
#endif
7779

7880
sd_power_system_off();

0 commit comments

Comments
 (0)