From 82373fa9601d62fbda8036e3c330b96de6947a4c Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Fri, 27 Sep 2024 16:27:02 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=20#212=20=E4=BF=AE=E5=A4=8D?= =?utf8?q?=E9=87=8D=E5=90=AF=E5=8A=A8=E7=94=BB=E6=92=AD=E6=94=BE=E5=AE=8C?= =?utf8?q?=E6=AF=95=EF=BC=8C=E6=8C=89powerkey=E4=BC=9A=E9=80=A0=E6=88=90?= =?utf8?q?=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E9=87=8D=E5=90=AF=E7=9A=84?= =?utf8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/application/brandy/brandy_standard/board_init.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/sdk/application/brandy/brandy_standard/board_init.c b/code/sdk/application/brandy/brandy_standard/board_init.c index 08157ef72..0c9d428c1 100755 --- a/code/sdk/application/brandy/brandy_standard/board_init.c +++ b/code/sdk/application/brandy/brandy_standard/board_init.c @@ -19,6 +19,7 @@ #include "lcd_bus.h" #include "button_porting.h" #include "custom_runtime.h" +#include "non_os_reboot.h" static const lcd_bus_api g_display_api_qspi = { .bus_init = lcd_qspi_init, @@ -130,7 +131,13 @@ void check_pwrkey_3s(void) // button_api->button_register_callback(PIN_NONE, (osal_irq_handler)button_irq_callback); uapi_ulp_wkup_type_record(); startup_reason = uapi_get_startup_reason(); - PRINT("bootup reasion %d (0-systick 1-pwrkey 2-vbus 3-other)"NEWLINE,startup_reason); + int cpu_reset_case = get_cpu_utils_reset_cause(); + PRINT("bootup reasion %d (0-systick 1-pwrkey 2-vbus 3-other) cpu_resetcase 0x%04X"NEWLINE,startup_reason,cpu_reset_case); + if (cpu_reset_case == REBOOT_CAUSE_APPLICATION_SYSRESETREQ ) + { + PRINT("CPU reset Case is REBOOT , no need check PowerKey"NEWLINE); + return ; + } if(startup_reason == 1) g_pwrkey_press_state = PRESSED; else g_pwrkey_press_state = RELEASED; -- 2.17.1