diff --git a/firmware/baseband/clock_recovery.hpp b/firmware/baseband/clock_recovery.hpp index 91f4cf8f..9a6904a3 100644 --- a/firmware/baseband/clock_recovery.hpp +++ b/firmware/baseband/clock_recovery.hpp @@ -168,7 +168,12 @@ private: } void symbol_callback(const float symbol, const float lateness) { - symbol_handler(symbol); + // NOTE: This check is to avoid std::function nullptr check, which + // brings in "_ZSt25__throw_bad_function_callv" and a lot of extra code. + // TODO: Make symbol_handler known at compile time. + if( symbol_handler) { + symbol_handler(symbol); + } const float adjustment = error_filter(lateness); resampler.advance(adjustment); diff --git a/firmware/baseband/packet_builder.hpp b/firmware/baseband/packet_builder.hpp index e3293529..c8a9ea5b 100644 --- a/firmware/baseband/packet_builder.hpp +++ b/firmware/baseband/packet_builder.hpp @@ -89,8 +89,13 @@ public: } if( end(bit_history, packet.size()) ) { - packet.set_timestamp(Timestamp::now()); - payload_handler(packet); + // NOTE: This check is to avoid std::function nullptr check, which + // brings in "_ZSt25__throw_bad_function_callv" and a lot of extra code. + // TODO: Make payload_handler known at compile time. + if( payload_handler ) { + packet.set_timestamp(Timestamp::now()); + payload_handler(packet); + } reset_state(); } else { if( packet_truncated() ) {