Update freertos.c

master
ThinkPad-T460P 2021-01-15 17:04:20 +08:00
parent b2f3f88535
commit b43b2a6616
1 changed files with 15 additions and 15 deletions

View File

@ -285,7 +285,7 @@ void MX_FREERTOS_Init(void) {
// CoulombReadHandle = osThreadNew(StartCoulombRead, NULL, &CoulombRead_attributes);
/* creation of PowerMonitTask */
PowerMonitTaskHandle = osThreadNew(StartPowerMonitTask, NULL, &PowerMonitTask_attributes);
// PowerMonitTaskHandle = osThreadNew(StartPowerMonitTask, NULL, &PowerMonitTask_attributes);
/* creation of EventDetect */
EventDetectHandle = osThreadNew(StartEventDetect, NULL, &EventDetect_attributes);
@ -380,30 +380,30 @@ void StartDefaultTask(void *argument)
NaviKit.sys.sta = NaviKit.sys.next_sta;
} break;
case run: {
if(NaviKit.pmb.rails.main_pwr>19){
// if(NaviKit.pmb.rails.main_pwr>19){
enter_run_state(100);
NaviKit.sys.sta = NaviKit.sys.next_sta;
}else{
NaviKit.sys.next_sta = NaviKit.sys.sta;
TaskBeep(500,2);
Log(error,pmb,"Main power not exist, retry after plug in it.");
Log(fatal,pmb,"Main power is exception:%dmV",(uint32_t)(NaviKit.pmb.rails.main_pwr*1000));
}
// }else{
// NaviKit.sys.next_sta = NaviKit.sys.sta;
// TaskBeep(500,2);
// Log(error,pmb,"Main power not exist, retry after plug in it.");
// Log(fatal,pmb,"Main power is exception:%dmV",(uint32_t)(NaviKit.pmb.rails.main_pwr*1000));
// }
}break;
case sleep:{
enter_sleep_state(100);
NaviKit.sys.sta = NaviKit.sys.next_sta;
}break;
case dfu:{
if(NaviKit.pmb.rails.main_pwr>19){
// if(NaviKit.pmb.rails.main_pwr>19){
enter_dfu_state(100);
NaviKit.sys.sta = NaviKit.sys.next_sta;
}else{
NaviKit.sys.next_sta = NaviKit.sys.sta;
TaskBeep(500,2);
Log(error,pmb,"Main power not exist, retry after plug in it.");
Log(fatal,pmb,"Main power is exception:%dmV",(uint32_t)(NaviKit.pmb.rails.main_pwr*1000));
}
// }else{
// NaviKit.sys.next_sta = NaviKit.sys.sta;
// TaskBeep(500,2);
// Log(error,pmb,"Main power not exist, retry after plug in it.");
// Log(fatal,pmb,"Main power is exception:%dmV",(uint32_t)(NaviKit.pmb.rails.main_pwr*1000));
// }
}break;
case isp:{
enter_isp_state();