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 <cursoragent@cursor.com>
This commit is contained in:
yuquanjun 2026-09-05 19:39:15 +08:00
parent 39954589e8
commit c16a13edc3
1 changed files with 4 additions and 5 deletions

View File

@ -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()