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