From c16a13edc30f0683558008a5e90df788f1493e2d Mon Sep 17 00:00:00 2001 From: yuquanjun Date: Sat, 5 Sep 2026 19:39:15 +0800 Subject: [PATCH] Fix long-press power to soft-off instead of MCU reset. PowerOff was calling nvic_system_reset after cutting rails, and boot auto power-on made it look like a restart. Co-authored-by: Cursor --- Global/Global.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Global/Global.c b/Global/Global.c index dc7fa52..219467c 100644 --- a/Global/Global.c +++ b/Global/Global.c @@ -220,15 +220,14 @@ static void PowerOff(void) app_tm1629_all_off(); app_tm1617_off(); - /* 关闭电源硬件 */ + /* 关闭电源硬件;MCU 保持运行以便长按开机 / 关机充电画面 */ BSP_MainPowerEnable(0); BSP_DreamCorePowerEnable(0); BSP_HT7178PowerEnable(0); BSP_BlueToothPowerEnable(0); - LOG_I("PWR", "reset"); - __disable_irq(); - nvic_system_reset(); - //MainTask_Sendmsg(MSG_ID_POWER_OFF,0,0,0); + CurrUIProcress = IdleProcess; + MainTask_Sendmsg(MSG_ID_POWER_OFF, 0, 0, 0); + LOG_I("PWR", "power_off done (soft-off, no reset)"); } void Power_Key_Scan()