add key verify
This commit is contained in:
@@ -32,6 +32,8 @@ extern "C" {
|
||||
#include "dfu_upgrade.h"
|
||||
}
|
||||
|
||||
extern uint8_t key_validate(uint8_t offset);
|
||||
|
||||
#define TIMER_PERIOD 2000000
|
||||
/* 改动原因:与 jok TIMER_2_PERIOD 一致,50ms 驱动 RGB 灯效/工厂复位 LED */
|
||||
#define TIMER_2_PERIOD 5000000
|
||||
@@ -1457,6 +1459,7 @@ void AudioHwRemote2(streaming chanend c, chanend cc_mic_level, client interface
|
||||
unsigned factory_reset_done = 0;
|
||||
/* 改动原因:仅用户真实改音量时写 tx1_dac_vol Flash;high_perf 切换不重写 */
|
||||
unsigned last_saved_dac_hid = 255;
|
||||
unsigned key_verified = 0;
|
||||
|
||||
// TX1 LED effect state for game mode indicators
|
||||
unsigned gpio_leds_dirty = 1; // refresh LEDs on first tick
|
||||
@@ -1473,7 +1476,12 @@ void AudioHwRemote2(streaming chanend c, chanend cc_mic_level, client interface
|
||||
c1_mode = C1_MODE_VALUE_DEFAULT;
|
||||
save_value(C1_MODE_INFO_PATH, c1_mode);
|
||||
}
|
||||
|
||||
key_verified = key_validate(1);
|
||||
if (key_verified == 0) {
|
||||
debug_printf("TX1: Key validation failed\n");
|
||||
} else {
|
||||
debug_printf("TX1: Key validation passed\n");
|
||||
}
|
||||
#if defined(WIN_OS_DETECTION)
|
||||
/* 改动原因:先 OS 检测选固件(Win→fps71_uac2 reboot),再按 Flash 恢复算法;fps71 镜像不再做 Win 检测 */
|
||||
tx1_boot_firmware_select_by_os();
|
||||
@@ -2570,8 +2578,7 @@ void AudioHwRemote2(streaming chanend c, chanend cc_mic_level, client interface
|
||||
if ((se_count % 90) == 0)
|
||||
{
|
||||
|
||||
unsigned key = GetKeyFlag();
|
||||
if (key != 0x20241224)
|
||||
if (key_verified != 1)
|
||||
{
|
||||
debug_printf("se reboot\n");
|
||||
delay_milliseconds(1000);
|
||||
|
||||
Reference in New Issue
Block a user