From e8b554372daf152cf3dfc712ea54a2da2ca262a0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Nov 2022 09:33:01 -0500 Subject: [PATCH] add reboot after mode change --- cubesatsim/cubesatsim.ino | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 9f7ef41d..450f90df 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -43,6 +43,8 @@ #include "LittleFS.h" #include #include "picosstvpp.h" +//#include "pico/bootrom.h" +#include "hardware/watchdog.h" // jpg files to be stored in flash storage on Pico (FS 512kB setting) //#include "sstv1.h" @@ -305,12 +307,19 @@ void loop() { // check to see if the mode has changed if (mode != new_mode) { Serial.println("Changing mode"); +/* if (mode == SSTV) { ITimer1.detachInterrupt(); start_button_isr(); // restart button isr } +*/ mode = new_mode; // change modes if button pressed - write_mode(); + write_mode(); + + watchdog_reboot (0, SRAM_END, 10); // reboot + + sleep(20.0); + if (new_mode != CW) transmit_callsign(callsign); sleep(0.5);