From 80d5e2d8bcabdcdc512e48a239b325ddaa4531c3 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 10 Sep 2025 17:04:03 +1200 Subject: [PATCH] fix wismesh tag power off and wake up --- variants/rak_wismesh_tag/RAKWismeshTagBoard.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/variants/rak_wismesh_tag/RAKWismeshTagBoard.h b/variants/rak_wismesh_tag/RAKWismeshTagBoard.h index 22af6f74..e5104a58 100644 --- a/variants/rak_wismesh_tag/RAKWismeshTagBoard.h +++ b/variants/rak_wismesh_tag/RAKWismeshTagBoard.h @@ -62,7 +62,8 @@ public: digitalWrite(LED_PIN, HIGH); #endif #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 #ifdef LED_GREEN digitalWrite(LED_GREEN, LOW); @@ -72,7 +73,8 @@ public: #endif #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 sd_power_system_off();