Merge branch 'deal_crash'

This commit is contained in:
CSSC-WORK\murmur 2023-09-10 17:17:08 +08:00
commit b08370472b
2 changed files with 26 additions and 0 deletions

View File

@ -263,6 +263,9 @@ void sysInit(void)
initTT();
setWindowMode();
}
else if (isNeedRestore()) {//Restoring configuration after a crash
initTT();
}
}
//INIT_COMPONENT_EXPORT(sysInit);
@ -718,6 +721,7 @@ void deInitTT_thread_entry()
startAlarm();
clearWindowMode();
setManualWindow(-1);
setWorkSta(0);
LOG_W("shunt down TT DONE");
}
// initThread = RT_NULL;
@ -737,6 +741,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,27 @@ void updateSysRTC(uint8_t *din, size_t len)
}
}
/**
* TT工作后设置状态
* @param flag
*/
void setWorkSta(int flag)
{
set_cfg("isWorking", flag);
}
/**
*
* @return
*/
int isNeedRestore(void)
{
int rst = get_cfg("isWorking");
if (rst) {
LOG_W("restoring TT after crash");
}
return rst;
}
#define FUNC_DEMO
#ifdef FUNC_DEMO //测试时导出命令到控制台