Browse Source
Merge pull request #636 from fdlamotte/t1000_wait_button_release_before_poweroff
t1000: wait for button release before powering off
pull/638/head
ripplebiz
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
0 deletions
-
variants/t1000-e/T1000eBoard.h
|
|
|
@ -84,12 +84,21 @@ public: |
|
|
|
digitalWrite(PIN_3V3_EN, LOW); |
|
|
|
#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 |
|
|
|
digitalWrite(LED_PIN, LOW); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef BUTTON_PIN |
|
|
|
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH); |
|
|
|
#endif |
|
|
|
|
|
|
|
sd_power_system_off(); |
|
|
|
} |
|
|
|
|
|
|
|
|