添加崩溃后恢复TT状态的功能

This commit is contained in:
CSSC-WORK\murmur 2023-09-10 10:09:28 +08:00
parent b23b4bf6c2
commit 5a8a10f105
2 changed files with 22 additions and 0 deletions

View File

@ -262,6 +262,9 @@ void sysInit(void)
initTT();
setWindowMode();
}
else if (isNeedRestore()) {//Restoring configuration after a crash
initTT();
}
}
//INIT_COMPONENT_EXPORT(sysInit);
@ -710,6 +713,7 @@ void deInitTT_thread_entry()
startAlarm();
clearWindowMode();
setManualWindow(-1);
setWorkSta(0);
LOG_W("shunt down TT DONE");
}
// initThread = RT_NULL;
@ -729,6 +733,7 @@ void initTT()
return;
}
set3SRTC();
setWorkSta(1);
initThread = rt_thread_create("initTT", initTT_thread_entry, RT_NULL, 1024 * 5, 25, 10);
/* 创建成功则启动线程 */
if (initThread != RT_NULL)

View File

@ -1783,6 +1783,23 @@ void updateSysRTC(uint8_t *din, size_t len)
}
}
/**
* TT工作后设置状态
* @param flag
*/
void setWorkSta(int flag)
{
set_cfg("isWorking", flag);
}
/**
*
* @return
*/
int isNeedRestore(void)
{
return get_cfg("isWorking");
}
#define FUNC_DEMO
#ifdef FUNC_DEMO //测试时导出命令到控制台