From 64733773a24bbcdc3ad01da1b5d774084d734fd3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 21 Feb 2023 11:43:50 -0500 Subject: [PATCH] remove PB reboot on release, changed to 6 blinks and watchdog_reboot() --- cubesatsim/cubesatsim.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index d3f36c25..c15432cb 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -3417,14 +3417,14 @@ void process_pushbutton() { else digitalWrite(led_builtin_pin, HIGH); // set the built-in LED ON sleep(1.0); - +/* int pb_value = digitalRead(MAIN_PB_PIN); if (pb_value == RELEASED) { Serial.println("PB: Reboot!"); release = TRUE; prompt = PROMPT_REBOOT; } - +*/ blinkTimes(1); sleep(1.5); @@ -3485,7 +3485,7 @@ void process_pushbutton() { } if (release == FALSE) { - Serial.println("PB: Shutdown!"); + Serial.println("PB: Reboot!"); digitalWrite(MAIN_LED_GREEN, LOW); sleep(0.5); digitalWrite(MAIN_LED_GREEN, HIGH); @@ -3497,7 +3497,11 @@ void process_pushbutton() { digitalWrite(MAIN_LED_GREEN, LOW); sleep(0.5); digitalWrite(MAIN_LED_GREEN, HIGH); - sleep(0.5); + sleep(0.5); + + Serial.println("Watchdog reboot now!"); + + watchdog_reboot(0); } if (new_mode != mode)