Fix Cancel 取/消 glyphs and enable auto power-off timer.
Regenerate MiSans bitmaps for 取消; tick idle countdown and shut down when timeout elapses. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
ce7e488994
commit
57caea9bf7
|
|
@ -313,10 +313,40 @@ uint8_t key_toggle[4] = {0};
|
||||||
* UI 公共函数补定义
|
* UI 公共函数补定义
|
||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
/* 自动关机计时复位(简单实现:无操作,占位) */
|
/* 自动关机:有操作时复位秒计数;主循环每秒递减,到 0 关机 */
|
||||||
void ResetAutoPowerCount(void)
|
void ResetAutoPowerCount(void)
|
||||||
{
|
{
|
||||||
/* AutoPower 计时复位逻辑暂未实现 */
|
if (!AutoCloseFlag || AutoCloseTime == 0)
|
||||||
|
return;
|
||||||
|
mAutoPowerOffCount = (uint16_t)(AutoCloseTime * 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AutoPowerOff_Scan(void)
|
||||||
|
{
|
||||||
|
static uint32_t s_last_sec_tick = 0;
|
||||||
|
uint32_t now;
|
||||||
|
|
||||||
|
if (!powon || !AutoCloseFlag || AutoCloseTime == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
now = rt_tick_get();
|
||||||
|
if (s_last_sec_tick == 0)
|
||||||
|
{
|
||||||
|
s_last_sec_tick = now;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ((now - s_last_sec_tick) < RT_TICK_PER_SECOND)
|
||||||
|
return;
|
||||||
|
s_last_sec_tick = now;
|
||||||
|
|
||||||
|
if (mAutoPowerOffCount > 0)
|
||||||
|
mAutoPowerOffCount--;
|
||||||
|
|
||||||
|
if (mAutoPowerOffCount == 0)
|
||||||
|
{
|
||||||
|
LOG_I("PWR", "auto power_off idle=%umin", (unsigned)AutoCloseTime);
|
||||||
|
PowerOff();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GUI 数值调整(简单实现:更新当前值) */
|
/* GUI 数值调整(简单实现:更新当前值) */
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ extern uint8_t KEY_ID_1629;
|
||||||
|
|
||||||
extern bool powon;
|
extern bool powon;
|
||||||
void Power_Key_Scan(void);
|
void Power_Key_Scan(void);
|
||||||
|
void AutoPowerOff_Scan(void);
|
||||||
void System_PowerOn(void);
|
void System_PowerOn(void);
|
||||||
extern uint8_t Led;
|
extern uint8_t Led;
|
||||||
extern bool PressFlag;
|
extern bool PressFlag;
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -223,6 +223,18 @@ void drv_nvm_load_default_calibration_static_value(NvmParam_Type * pData, uint8
|
||||||
if (pData->param.AutoCloseTime > 3)
|
if (pData->param.AutoCloseTime > 3)
|
||||||
pData->param.AutoCloseTime = 1;
|
pData->param.AutoCloseTime = 1;
|
||||||
mGuiData_SystemSETTING[GUI_AUTOCLOSE].Current = pData->param.AutoCloseTime;
|
mGuiData_SystemSETTING[GUI_AUTOCLOSE].Current = pData->param.AutoCloseTime;
|
||||||
|
/* 开机/出厂:同步自动关机运行时秒表 */
|
||||||
|
AutoCloseFlag = true;
|
||||||
|
switch (pData->param.AutoCloseTime)
|
||||||
|
{
|
||||||
|
case 0: AutoCloseTime = 5; break;
|
||||||
|
case 1: AutoCloseTime = 15; break;
|
||||||
|
case 2: AutoCloseTime = 30; break;
|
||||||
|
case 3: AutoCloseTime = 0; AutoCloseFlag = false; break;
|
||||||
|
default: AutoCloseTime = 15; break;
|
||||||
|
}
|
||||||
|
if (AutoCloseFlag && AutoCloseTime)
|
||||||
|
mAutoPowerOffCount = (uint16_t)(AutoCloseTime * 60);
|
||||||
ParamGuiData[SONG_MODE_PARAM].Current = pData->param.Param1;
|
ParamGuiData[SONG_MODE_PARAM].Current = pData->param.Param1;
|
||||||
ParamGuiData[EXPRESS_MODE_PARAM].Current = pData->param.Param2;
|
ParamGuiData[EXPRESS_MODE_PARAM].Current = pData->param.Param2;
|
||||||
ParamGuiData[ALL_MODE_PARAM].Current = pData->param.Param3;
|
ParamGuiData[ALL_MODE_PARAM].Current = pData->param.Param3;
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ int main(void)
|
||||||
}
|
}
|
||||||
/* add user code begin 3 */
|
/* add user code begin 3 */
|
||||||
Power_Key_Scan();
|
Power_Key_Scan();
|
||||||
|
AutoPowerOff_Scan();
|
||||||
LCD_Dump_Poll();
|
LCD_Dump_Poll();
|
||||||
#if !DEBUG_LCD_DUMP
|
#if !DEBUG_LCD_DUMP
|
||||||
app_log_poll();
|
app_log_poll();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue