Disable unused UART commands

saving 212 bytes
This commit is contained in:
reppad committed 2025-07-26 16:49:31 +02:00
1 parent 447c2a820e
commit c150e876c1
2 files changed
+14 -1

No files matched your search

+4
View File
@@ -59,6 +59,7 @@ ENABLE_FEAT_F4HWN_GMRS_FRS_MURS ?= 0
ENABLE_FEAT_F4HWN_CA ?= 1
ENABLE_FEAT_F4HWN_DEBUG ?= 0
ENABLE_REGA ?= 0
ENABLE_EXTRA_UART_CMD ?= 0
# ---- DEBUGGING ----
ENABLE_AM_FIX_SHOW_DATA ?= 0
@@ -485,6 +486,9 @@ endif
ifeq ($(ENABLE_FEAT_F4HWN_DEBUG),1)
CFLAGS += -DENABLE_FEAT_F4HWN_DEBUG
endif
ifeq ($(ENABLE_EXTRA_UART_CMD),1)
CFLAGS += -DENABLE_EXTRA_UART_CMD
endif
LDFLAGS =
LDFLAGS += -z noexecstack -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld -Wl,--gc-sections
+10 -1
View File
@@ -106,6 +106,7 @@ typedef struct {
} Data;
} REPLY_051D_t;
#ifdef ENABLE_EXTRA_UART_CMD
typedef struct {
Header_t Header;
struct {
@@ -127,6 +128,7 @@ typedef struct {
Header_t Header;
uint32_t Response[4];
} CMD_052D_t;
#endif
typedef struct {
Header_t Header;
@@ -136,10 +138,13 @@ typedef struct {
} Data;
} REPLY_052D_t;
#ifdef ENABLE_EXTRA_UART_CMD
typedef struct {
Header_t Header;
uint32_t Timestamp;
} CMD_052F_t;
#endif
static const uint8_t Obfuscation[16] =
{
@@ -329,6 +334,7 @@ static void CMD_051D(const uint8_t *pBuffer)
SendReply(&Reply, sizeof(Reply));
}
#ifdef ENABLE_EXTRA_UART_CMD
// read RSSI
static void CMD_0527(void)
{
@@ -438,6 +444,7 @@ static void CMD_052F(const uint8_t *pBuffer)
SendVersion();
}
#endif
#ifdef ENABLE_UART_RW_BK_REGS
static void CMD_0601_ReadBK4819Reg(const uint8_t *pBuffer)
@@ -591,7 +598,8 @@ void UART_HandleCommand(void)
case 0x0521: // Not implementing non-authentic command
break;
#ifdef ENABLE_EXTRA_UART_CMD
case 0x0527:
CMD_0527();
break;
@@ -609,6 +617,7 @@ void UART_HandleCommand(void)
case 0x052F:
CMD_052F(UART_Command.Buffer);
break;
#endif
case 0x05DD: // reset
#if defined(ENABLE_OVERLAY)