remove PB reboot on release, changed to 6 blinks and watchdog_reboot()

pico-v0.38
alanbjohnston 3 years ago committed by GitHub
parent 65d001d5f9
commit 64733773a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3417,14 +3417,14 @@ void process_pushbutton() {
else else
digitalWrite(led_builtin_pin, HIGH); // set the built-in LED ON digitalWrite(led_builtin_pin, HIGH); // set the built-in LED ON
sleep(1.0); sleep(1.0);
/*
int pb_value = digitalRead(MAIN_PB_PIN); int pb_value = digitalRead(MAIN_PB_PIN);
if (pb_value == RELEASED) { if (pb_value == RELEASED) {
Serial.println("PB: Reboot!"); Serial.println("PB: Reboot!");
release = TRUE; release = TRUE;
prompt = PROMPT_REBOOT; prompt = PROMPT_REBOOT;
} }
*/
blinkTimes(1); blinkTimes(1);
sleep(1.5); sleep(1.5);
@ -3485,7 +3485,7 @@ void process_pushbutton() {
} }
if (release == FALSE) { if (release == FALSE) {
Serial.println("PB: Shutdown!"); Serial.println("PB: Reboot!");
digitalWrite(MAIN_LED_GREEN, LOW); digitalWrite(MAIN_LED_GREEN, LOW);
sleep(0.5); sleep(0.5);
digitalWrite(MAIN_LED_GREEN, HIGH); digitalWrite(MAIN_LED_GREEN, HIGH);
@ -3499,6 +3499,10 @@ void process_pushbutton() {
digitalWrite(MAIN_LED_GREEN, HIGH); digitalWrite(MAIN_LED_GREEN, HIGH);
sleep(0.5); sleep(0.5);
Serial.println("Watchdog reboot now!");
watchdog_reboot(0);
} }
if (new_mode != mode) if (new_mode != mode)
transmit_off(); transmit_off();

Loading…
Cancel
Save

Powered by TurnKey Linux.