diff --git a/firmware/application/main.cpp b/firmware/application/main.cpp index 64eb515f..39d1128e 100755 --- a/firmware/application/main.cpp +++ b/firmware/application/main.cpp @@ -124,7 +124,7 @@ private: void handle_application_queue() { std::array message_buffer; - while(const Message* const message = shared_memory.application_queue.pop(message_buffer)) { + while(Message* const message = shared_memory.application_queue.pop(message_buffer)) { context.message_map.send(message); } } diff --git a/firmware/application/ui_receiver.cpp b/firmware/application/ui_receiver.cpp index 97cc21db..9142aa20 100644 --- a/firmware/application/ui_receiver.cpp +++ b/firmware/application/ui_receiver.cpp @@ -493,8 +493,8 @@ ReceiverView::~ReceiverView() { void ReceiverView::on_show() { context().message_map.register_handler(Message::ID::FSKPacket, - [](const Message* const p) { - const auto message = static_cast(p); + [this](Message* const p) { + auto message = static_cast(p); (void)message; } ); diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp index 71fc37ea..badadb6c 100755 --- a/firmware/baseband/main.cpp +++ b/firmware/baseband/main.cpp @@ -260,7 +260,7 @@ private: void handle_baseband_queue() { std::array message_buffer; - while(const Message* const message = shared_memory.baseband_queue.pop(message_buffer)) { + while(Message* const message = shared_memory.baseband_queue.pop(message_buffer)) { message_map.send(message); } } diff --git a/firmware/common/message.hpp b/firmware/common/message.hpp index 8d028ea9..f5b1c359 100644 --- a/firmware/common/message.hpp +++ b/firmware/common/message.hpp @@ -245,7 +245,7 @@ public: class MessageHandlerMap { public: - using MessageHandler = std::function; + using MessageHandler = std::function; void register_handler(const Message::ID id, MessageHandler&& handler) { map_[toUType(id)] = std::move(handler); @@ -255,7 +255,7 @@ public: map_[toUType(id)] = nullptr; } - void send(const Message* const message) { + void send(Message* const message) { if( message->id < Message::ID::MAX ) { auto& fn = map_[toUType(message->id)]; if( fn ) { diff --git a/firmware/common/message_queue.hpp b/firmware/common/message_queue.hpp index dd6ff72b..94745f3e 100644 --- a/firmware/common/message_queue.hpp +++ b/firmware/common/message_queue.hpp @@ -47,8 +47,8 @@ public: return push(&message, sizeof(message)); } - const Message* pop(std::array& buf) { - const Message* const p = reinterpret_cast(buf.data()); + Message* pop(std::array& buf) { + Message* const p = reinterpret_cast(buf.data()); return fifo.out_r(buf.data(), buf.size()) ? p : nullptr; }