Remove strange CMD_052D (and save 148 bytes)

This commit is contained in:
Armel FAUVEAU
2025-02-11 02:51:16 +01:00
parent 367d9d4683
commit 7558d95267
2 changed files with 34 additions and 31 deletions

View File

@@ -210,13 +210,9 @@ static void SendVersion(void)
SendReply(&Reply, sizeof(Reply)); SendReply(&Reply, sizeof(Reply));
} }
#ifndef ENABLE_FEAT_F4HWN
static bool IsBadChallenge(const uint32_t *pKey, const uint32_t *pIn, const uint32_t *pResponse) static bool IsBadChallenge(const uint32_t *pKey, const uint32_t *pIn, const uint32_t *pResponse)
{ {
#ifdef ENABLE_FEAT_F4HWN
UNUSED(pKey);
UNUSED(pIn);
UNUSED(pResponse);
#else
unsigned int i; unsigned int i;
uint32_t IV[4]; uint32_t IV[4];
@@ -230,9 +226,10 @@ static bool IsBadChallenge(const uint32_t *pKey, const uint32_t *pIn, const uint
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
if (IV[i] != pResponse[i]) if (IV[i] != pResponse[i])
return true; return true;
#endif
return false; return false;
} }
#endif
// session init, sends back version info and state // session init, sends back version info and state
// timestamp is a session id really // timestamp is a session id really
@@ -360,6 +357,7 @@ static void CMD_0529(void)
SendReply(&Reply, sizeof(Reply)); SendReply(&Reply, sizeof(Reply));
} }
#ifndef ENABLE_FEAT_F4HWN
static void CMD_052D(const uint8_t *pBuffer) static void CMD_052D(const uint8_t *pBuffer)
{ {
const CMD_052D_t *pCmd = (const CMD_052D_t *)pBuffer; const CMD_052D_t *pCmd = (const CMD_052D_t *)pBuffer;
@@ -400,6 +398,7 @@ static void CMD_052D(const uint8_t *pBuffer)
SendReply(&Reply, sizeof(Reply)); SendReply(&Reply, sizeof(Reply));
} }
#endif
// session init, sends back version info and state // session init, sends back version info and state
// timestamp is a session id really // timestamp is a session id really
@@ -601,9 +600,11 @@ void UART_HandleCommand(void)
CMD_0529(); CMD_0529();
break; break;
#ifndef ENABLE_FEAT_F4HWN
case 0x052D: case 0x052D:
CMD_052D(UART_Command.Buffer); CMD_052D(UART_Command.Buffer);
break; break;
#endif
case 0x052F: case 0x052F:
CMD_052F(UART_Command.Buffer); CMD_052F(UART_Command.Buffer);

View File

@@ -329,6 +329,7 @@ void SETTINGS_InitEEPROM(void)
// 0F30..0F3F // 0F30..0F3F
EEPROM_ReadBuffer(0x0F30, gCustomAesKey, sizeof(gCustomAesKey)); EEPROM_ReadBuffer(0x0F30, gCustomAesKey, sizeof(gCustomAesKey));
bHasCustomAesKey = false; bHasCustomAesKey = false;
#ifndef ENABLE_FEAT_F4HWN
for (unsigned int i = 0; i < ARRAY_SIZE(gCustomAesKey); i++) for (unsigned int i = 0; i < ARRAY_SIZE(gCustomAesKey); i++)
{ {
if (gCustomAesKey[i] != 0xFFFFFFFFu) if (gCustomAesKey[i] != 0xFFFFFFFFu)
@@ -337,6 +338,7 @@ void SETTINGS_InitEEPROM(void)
return; return;
} }
} }
#endif
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
// 1FF0..0x1FF7 // 1FF0..0x1FF7