diff --git a/latest/Firmware/Transponder/.cproject b/latest/Firmware/Transponder/.cproject index c503646..ca4a14c 100644 --- a/latest/Firmware/Transponder/.cproject +++ b/latest/Firmware/Transponder/.cproject @@ -2,7 +2,7 @@ - + @@ -14,7 +14,7 @@ - + - + @@ -186,7 +186,7 @@ - + - + @@ -360,7 +360,7 @@ - + - + @@ -534,7 +534,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + diff --git a/latest/Firmware/Transponder/.gitignore b/latest/Firmware/Transponder/.gitignore index 7faf764..e184254 100644 --- a/latest/Firmware/Transponder/.gitignore +++ b/latest/Firmware/Transponder/.gitignore @@ -19,4 +19,5 @@ Debug /STM32L422-Debug/ /STM32L431-Release/ /STM32L431-Debug/ - +/L422-LegacyBreakouts/ +/L422-NewBreakouts/ diff --git a/latest/Firmware/Transponder/Inc/bsp/bsp.hpp b/latest/Firmware/Transponder/Inc/bsp/bsp.hpp index c6b2924..5ef211c 100644 --- a/latest/Firmware/Transponder/Inc/bsp/bsp.hpp +++ b/latest/Firmware/Transponder/Inc/bsp/bsp.hpp @@ -21,6 +21,7 @@ #define INC_BSP_HPP_ #include +#include "config.h" // See the bottom section for the proper BOARD_REV symbol format and either modify this header diff --git a/latest/Firmware/Transponder/Inc/config.h b/latest/Firmware/Transponder/Inc/config.h index c457192..a087c31 100644 --- a/latest/Firmware/Transponder/Inc/config.h +++ b/latest/Firmware/Transponder/Inc/config.h @@ -94,4 +94,15 @@ #define ENABLE_WDT 1 +/** + * This is a bit of a pain, but in the legacy breakout boards the TX LED + * was manipulated by both a hardware switch and the GPIO, so the MCU logic is reversed. + * + * The only way to support those legacy boards is to build a separate binary + * with this switch predefined as 1. There is no automated way to detect which kind of breakout MAIANA has. + */ +#ifndef LEGACY_BREAKOUTS +#define LEGACY_BREAKOUTS 1 +#endif + #endif /* CONFIG_H_ */ diff --git a/latest/Firmware/Transponder/Src/bsp/bsp_11_0.cpp b/latest/Firmware/Transponder/Src/bsp/bsp_11_0.cpp index a085f70..be7f969 100644 --- a/latest/Firmware/Transponder/Src/bsp/bsp_11_0.cpp +++ b/latest/Firmware/Transponder/Src/bsp/bsp_11_0.cpp @@ -351,12 +351,20 @@ void bsp_rx_led_off() void bsp_tx_led_on() { +#if LEGACY_BREAKOUTS HAL_GPIO_WritePin(TX_EVT_PORT, TX_EVT_PIN, GPIO_PIN_RESET); +#else + HAL_GPIO_WritePin(TX_EVT_PORT, TX_EVT_PIN, GPIO_PIN_SET); +#endif } void bsp_tx_led_off() { +#if LEGACY_BREAKOUTS HAL_GPIO_WritePin(TX_EVT_PORT, TX_EVT_PIN, GPIO_PIN_SET); +#else + HAL_GPIO_WritePin(TX_EVT_PORT, TX_EVT_PIN, GPIO_PIN_RESET); +#endif } void bsp_gps_led_on() @@ -369,7 +377,6 @@ void bsp_gps_led_off() HAL_GPIO_WritePin(GNSS_STATE_PORT, GNSS_STATE_PIN, GPIO_PIN_RESET); } - void bsp_set_tx_mode() { HAL_GPIO_WritePin(LNA_PWR_PORT, LNA_PWR_PIN, GPIO_PIN_RESET);