From 5d8c636f4049813c1ea01e9683e1f6271ed03809 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Tue, 1 Sep 2015 13:49:09 -0700 Subject: [PATCH] Halt M4 right after sending M0 the shutdown message. Addresses issue #55. --- firmware/baseband/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp index 82a27049..8952dcca 100755 --- a/firmware/baseband/main.cpp +++ b/firmware/baseband/main.cpp @@ -205,6 +205,13 @@ static void shutdown() { systick_stop(); } +static void halt() { + port_disable(); + while(true) { + port_wait_for_interrupt(); + } +} + class EventDispatcher { public: MessageHandlerMap& message_handlers() { @@ -346,5 +353,7 @@ int main(void) { ShutdownMessage shutdown_message; shared_memory.application_queue.push(shutdown_message); + halt(); + return 0; }