From: SnickerSun Date: Sat, 27 Apr 2024 11:54:58 +0000 (+0800) Subject: 修复开启powerkey 3秒启动 修改未生效问题。 X-Git-Tag: release_V1.2.70_20241020_135402~1025^2~42^2~6 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=5dd1ff5af5c2bbcf398d5c79d6cbc3023c494b70;p=mirrors%2FFD230.git 修复开启powerkey 3秒启动 修改未生效问题。 --- diff --git a/code/sdk/application/brandy/brandy_standard/board_init.c b/code/sdk/application/brandy/brandy_standard/board_init.c index 1adcbfcd4..909649a35 100755 --- a/code/sdk/application/brandy/brandy_standard/board_init.c +++ b/code/sdk/application/brandy/brandy_standard/board_init.c @@ -100,6 +100,8 @@ static void gpio_func_init(void) static button_press_state_t g_pwrkey_press_state = RELEASED; static startup_reason_t startup_reason = STARTUP_OTHER; + +#define PRESS_COUNT_LIMIT 5 static button_press_state_t porting_button_get_state(void) { if ((readl(ANA_STS) & 0x3) == 0) { @@ -126,14 +128,14 @@ void check_pwrkey_3s(void) g_pwrkey_press_state = porting_button_get_state(); PRINT("bootup timeout %d g_pwrkey_press_state %d"NEWLINE,pressed_count,g_pwrkey_press_state); pressed_count ++ ; - if (pressed_count>=10) + if (pressed_count>=PRESS_COUNT_LIMIT) { break; } uapi_tcxo_delay_ms(200); } - if(pressed_count < 5 ) + if(pressed_count < PRESS_COUNT_LIMIT ) { PRINT("not pressed 3 seconds , poweroff!"NEWLINE); uapi_poweroff_device();