diff --git a/firmware/application/main.cpp b/firmware/application/main.cpp index fb4c5e6a..1ae9fec3 100755 --- a/firmware/application/main.cpp +++ b/firmware/application/main.cpp @@ -657,15 +657,3 @@ context.message_map[Message::ID::FSKPacket] = [](const Message* const p) { return 0; } - -void debug_indicate_error_init() { - // TODO: Indicate M4 error. - // led_usb.off(); - // led_tx.off(); -} - -void debug_indicate_error_update() { - // TODO: Indicate M4 error. - // led_usb.toggle(); - // led_tx.toggle(); -} diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp index 2d577791..4e30e573 100755 --- a/firmware/baseband/main.cpp +++ b/firmware/baseband/main.cpp @@ -972,15 +972,3 @@ int main(void) { #endif return 0; } - -void debug_indicate_error_init() { - // TODO: Indicate error, but don't import all of PAL (with init) - // led_rx.off(); - // led_tx.off(); -} - -void debug_indicate_error_update() { - // TODO: Indicate error, but don't import all of PAL (with init) - // led_rx.toggle(); - // led_tx.toggle(); -} diff --git a/firmware/common/debug.cpp b/firmware/common/debug.cpp index 2e758baa..5ae27f7a 100644 --- a/firmware/common/debug.cpp +++ b/firmware/common/debug.cpp @@ -22,6 +22,33 @@ #include "debug.hpp" #include +#include + +#if defined(LPC43XX_M0) +static void debug_indicate_error_init() { + // TODO: Get knowledge of LED GPIO port/bit from shared place. + LPC_GPIO->CLR[2] = (1 << 2); +} + +static void debug_indicate_error_update() { + // Flash RX (yellow) LED to indicate baseband error. + // TODO: Get knowledge of LED GPIO port/bit from shared place. + LPC_GPIO->NOT[2] = (1 << 2); +} +#endif + +#if defined(LPC43XX_M4) +static void debug_indicate_error_init() { + // TODO: Get knowledge of LED GPIO port/bit from shared place. + LPC_GPIO->CLR[2] = (1 << 8); +} + +static void debug_indicate_error_update() { + // Flash TX (red) LED to indicate baseband error. + // TODO: Get knowledge of LED GPIO port/bit from shared place. + LPC_GPIO->NOT[2] = (1 << 8); +} +#endif static void runtime_error() { debug_indicate_error_init(); diff --git a/firmware/common/debug.hpp b/firmware/common/debug.hpp index 7c7076c0..6b5323b7 100644 --- a/firmware/common/debug.hpp +++ b/firmware/common/debug.hpp @@ -22,8 +22,4 @@ #ifndef __DEBUG_H__ #define __DEBUG_H__ -// Defined by application to indicate error in board/hardware-specific manner. -void debug_indicate_error_init(); -void debug_indicate_error_update(); - #endif/*__DEBUG_H__*/