Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: userTask.cpp
- Revision:
- 20:0394e15412c3
- Parent:
- 18:5aa48aec9cae
- Child:
- 21:78302ecdb661
--- a/userTask.cpp Wed Dec 05 00:12:38 2018 +0000 +++ b/userTask.cpp Wed Dec 05 01:43:55 2018 +0000 @@ -65,9 +65,7 @@ pcTaskName = (int8_t *) pvParameters; xLastWakeTime = xTaskGetTickCount(); - - static bool runFlg = true; - + vTaskDelay(300);//制御タスクを先に走らせたいので待たす while(1){ @@ -75,22 +73,20 @@ //コマンド解釈 commandParse(); - if(runFlg){// - if(gf_Chk.flg != 0){//チェックフラグが何かたってた - sp.printf("Enter debug \r\n"); + // + switch(gf.state){ + CHK_ENT: //チェックエンター taskStop(0);//制御タスクを止める taskStart(2);//デバッグタスク再開 - runFlg = false; - } - }else{ - if(gf_Chk.flg == 0){ - sp.printf("Exit debug \r\n"); + break; + CHK_EXIT: //チェックステート脱出 taskStop(2);//デバッグタスクを止める taskStart(0);//制御タスク再開 - runFlg = true; - } - } - + break; + default: + break; + }//switch + //次の周期まで待つ vTaskDelayUntil(&xLastWakeTime, 100 / portTICK_RATE_MS ); } @@ -108,13 +104,14 @@ taskStop(2); while(1){ - if(gf_Chk.flg != 0){ - led3= 1; - fpgaMotorChk(); - led3= 0; + switch(gf.state){ + CHK_MOT://モーターチェック + //hb. + //CHK_MOT:fpgaMotorChk(); + break; } - //タスク停止させて次の周期まで待つ + //自らタスク停止させて次の周期まで待つ taskStop(2); } }