diff --git a/firmware/common/message.hpp b/firmware/common/message.hpp index 842561b3..1bf74878 100644 --- a/firmware/common/message.hpp +++ b/firmware/common/message.hpp @@ -29,6 +29,8 @@ #include "utility.hpp" +#include "ch.h" + class Message { public: static constexpr size_t MAX_SIZE = 276; @@ -251,6 +253,9 @@ public: using MessageHandler = std::function; void register_handler(const Message::ID id, MessageHandler&& handler) { + if( map_[toUType(id)] != nullptr ) { + chDbgPanic("MsgDblReg"); + } map_[toUType(id)] = std::move(handler); }