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:
- 22:24c9c2dedca9
- Parent:
- 21:78302ecdb661
- Child:
- 23:79e20be4bc5b
--- a/userTask.cpp Thu Dec 06 01:50:17 2018 +0000
+++ b/userTask.cpp Thu Dec 06 11:03:13 2018 +0000
@@ -44,12 +44,15 @@
//
if(gf_Armed){
- taskStop(0);//制御タスクを止める
- taskStart(2);//デバッグタスク再開
- }else{
- taskStop(2);//デバッグタスクを止める
- taskStart(0);//制御タスク再開
- }//switch
+ setState(WAKEUP);
+ gf_Armed = false;
+ // taskStop(0);//制御タスクを止める
+ // taskStart(2);//デバッグタスク再開
+ }
+ // else{
+ // taskStop(2);//デバッグタスクを止める
+ // taskStart(0);//制御タスク再開
+ // }//switch
//次の周期まで待つ
vTaskDelayUntil(&xLastWakeTime, 50 / portTICK_RATE_MS );
@@ -68,12 +71,34 @@
while(1){
led1=!led1;
//▼①状態読み出し系
- //hb.getAttitude(); //現在角度読み出し
- //hb.controlEngine(); //エンジン回転数読み出し
- //操作ボタン状態読み出し
+ hb.getAttitude(); //現在角度読み出し
+ hb.controlEngine(); //エンジン回転数読み出し
+ hb.getUserCommand(); //操作ボタン状態読み出し
//▼②ステート遷移
-
+ switch(gf_State){
+ case SLEEP:
+ if(gf_Dbg){
+ taskStart(2);
+ }
+ break;
+ case WAKEUP:
+ break;
+ case STANDBY:
+ break;
+ case IDLE:
+ break;
+ case TAKE_OFF:
+ break;
+ case GROUND:
+ break;
+ case HOVER:
+ break;
+ case DRIVE:
+ break;
+ case EMGGND:
+ break;
+ }
//▼③各種設定
//hb.controlAttitude(); //姿勢制御
@@ -100,7 +125,9 @@
//この関数をリターンしてしまうと他のタスクも止まるのでwhileで回すこと!
while(1){
-
+
+
+ gf_Dbg = false;
//自タスク停止させて次の周期まで待つ
taskStop(2);
}