mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-26 18:47:56 +00:00
M4: Handle poweroff
This commit is contained in:
@@ -47,6 +47,16 @@ public:
|
||||
// shutdown common peripherals
|
||||
NRF52Board::shutdownPeripherals();
|
||||
|
||||
#ifdef LED_STATUS
|
||||
digitalWrite(LED_STATUS, HIGH);
|
||||
#endif
|
||||
#ifdef BUTTON_PIN
|
||||
while(!digitalRead(BUTTON_PIN));
|
||||
#endif
|
||||
#ifdef LED_STATUS
|
||||
digitalWrite(LED_STATUS, LOW);
|
||||
#endif
|
||||
|
||||
digitalWrite(LED_BAT1, LOW);
|
||||
digitalWrite(LED_BAT2, LOW);
|
||||
digitalWrite(LED_BAT3, LOW);
|
||||
@@ -57,5 +67,9 @@ public:
|
||||
digitalWrite(PIN_PWR_EN, LOW);
|
||||
digitalWrite(I2C_POWER, !I2C_POWER_ACTIVE);
|
||||
digitalWrite(PIN_GPS_POWER, !GPS_POWER_ACTIVE);
|
||||
|
||||
#ifdef BUTTON_PIN
|
||||
nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ build_flags = ${nrf52_base.build_flags}
|
||||
-I variants/thinknode_m4
|
||||
-I src/helpers/ui
|
||||
-D THINKNODE_M4
|
||||
-D PIN_USER_BTN=12
|
||||
-D PIN_USER_BTN=4
|
||||
-D PIN_STATUS_LED=LED_STATUS
|
||||
-D RADIO_CLASS=CustomLR1110
|
||||
-D WRAPPER_CLASS=CustomLR1110Wrapper
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
#define PIN_BUTTON1 (4)
|
||||
#define BUTTON_PIN PIN_BUTTON1
|
||||
#define USER_BTN_PRESSED HIGH
|
||||
#define USER_BTN_PRESSED LOW
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// GPS
|
||||
|
||||
Reference in New Issue
Block a user