From 57293bc5eb55f4a22606326e0dea5a6c7dfd6450 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sat, 2 Jul 2016 16:19:28 -0700 Subject: [PATCH] Clear application message queue after baseband is shut down. --- firmware/application/baseband_api.cpp | 2 ++ firmware/common/message_queue.hpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/firmware/application/baseband_api.cpp b/firmware/application/baseband_api.cpp index 10f5a92ae..a28be7777 100644 --- a/firmware/application/baseband_api.cpp +++ b/firmware/application/baseband_api.cpp @@ -115,6 +115,8 @@ void shutdown() { ShutdownMessage message; send_message(&message); + shared_memory.application_queue.reset(); + baseband_image_running = false; } diff --git a/firmware/common/message_queue.hpp b/firmware/common/message_queue.hpp index 3e0a1cbb4..84bbaa9cf 100644 --- a/firmware/common/message_queue.hpp +++ b/firmware/common/message_queue.hpp @@ -74,6 +74,10 @@ public: return fifo.is_empty(); } + void reset() { + fifo.reset(); + } + private: FIFO fifo; Mutex mutex_write;