From e6734ebbc97d8842d02b20821294172a5821d25a Mon Sep 17 00:00:00 2001 From: scilor Date: Thu, 28 Apr 2022 22:02:00 +0200 Subject: [PATCH 1/5] Adjustments for new simplelink API --- Hackiebox.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Hackiebox.cpp b/Hackiebox.cpp index 5d7c529..0a76d37 100755 --- a/Hackiebox.cpp +++ b/Hackiebox.cpp @@ -5,6 +5,15 @@ BoxConfig Config; BoxEvents Events; Hackiebox Box; + +void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *pSlDeviceEvent) { } +int Report(const char *format, ...) { + //Workaround for defined Report in the WiFi/utility/ + va_list args; + va_start(args, format); + Log.printFormat(format, args); + return 0; +} void crash(crashSource source, uint32_t* sp) { //Box.logStreamSse.setSsePaused(true); Log.info("crashSource=%i, sp=%X, sp=%X", source, sp, (uint32_t)sp-0x20004000); From ad134cd71312ec859da08aa3b953238702d9d13b Mon Sep 17 00:00:00 2001 From: scilor Date: Fri, 29 Apr 2022 23:35:41 +0200 Subject: [PATCH 2/5] Add simpleLink EventHandler logger --- Hackiebox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Hackiebox.cpp b/Hackiebox.cpp index 0a76d37..5fd271e 100755 --- a/Hackiebox.cpp +++ b/Hackiebox.cpp @@ -6,7 +6,9 @@ BoxEvents Events; Hackiebox Box; -void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *pSlDeviceEvent) { } +void _SlDrvHandleGeneralEvents(SlDeviceEvent_t *pSlDeviceEvent) { + Log.error("Received _SlDrvHandleGeneralEvents Event=%i", pSlDeviceEvent->Event); +} int Report(const char *format, ...) { //Workaround for defined Report in the WiFi/utility/ va_list args; From 7130de889cb59527c3be3c7e5fcd8a75316d20f4 Mon Sep 17 00:00:00 2001 From: scilor Date: Fri, 29 Apr 2022 23:36:03 +0200 Subject: [PATCH 3/5] add breakpoint/hibernation to crash function --- Hackiebox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Hackiebox.cpp b/Hackiebox.cpp index 5fd271e..d8eb9e8 100755 --- a/Hackiebox.cpp +++ b/Hackiebox.cpp @@ -41,6 +41,10 @@ void crash(crashSource source, uint32_t* sp) { _file.close(); } Log.info("...done"); + + __asm__ volatile("bkpt"); + + Box.boxPower.hibernate(); } void Hackiebox::setup() { if (!watchdog_start()) { From c9647e99d1e1595042c680ed31975b0e793c8a99 Mon Sep 17 00:00:00 2001 From: scilor Date: Sun, 1 May 2022 20:06:27 +0200 Subject: [PATCH 4/5] Flush logstream, stop music when powering down --- BoxPower.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BoxPower.cpp b/BoxPower.cpp index 71f5bf1..1635d69 100644 --- a/BoxPower.cpp +++ b/BoxPower.cpp @@ -47,7 +47,8 @@ void BoxPower::_preparePowerDown() { Log.info("Prepare power down..."); //TODO //smartconfig down - Box.watchdog_stop(); + Box.logStreamMulti.flush(); + Box.boxPlayer.stop(); setSdPower(false); setOtherPower(false); Box.boxLEDs.setAllBool(false); From 4e35fa42ea6551d3a14b3e62769e6fa91fd6a302 Mon Sep 17 00:00:00 2001 From: scilor Date: Sun, 1 May 2022 20:06:45 +0200 Subject: [PATCH 5/5] Disable the watchdog after all (powering down) --- BoxPower.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/BoxPower.cpp b/BoxPower.cpp index 1635d69..234dca2 100644 --- a/BoxPower.cpp +++ b/BoxPower.cpp @@ -53,6 +53,7 @@ void BoxPower::_preparePowerDown() { setOtherPower(false); Box.boxLEDs.setAllBool(false); Serial.end(); + Box.watchdog_stop(); } void BoxPower::reset() { Events.handlePowerEvent(PowerEvent::PRE_RESET);