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: globalFlags.cpp
- Revision:
- 43:156199c2f9b6
- Parent:
- 42:cc8501b824ba
- Child:
- 45:3b51dd26b579
--- a/globalFlags.cpp Wed Jan 23 11:58:53 2019 +0000 +++ b/globalFlags.cpp Thu Jan 24 13:21:01 2019 +0000 @@ -27,12 +27,15 @@ bool gf_StopMot ;//モーターの強制停止 サーボ全閉 bool gf_FromActiveStat ;//モーターの強制停止 サーボ全閉が動作時に発生したかどうか +bool gf_BlinkLED; + typPrintFlg gf_Print ;// typPrintFlg gf_Mon ;// typCalFlag gf_Cal ;// //typDbgPrintFlg gf_DbgPrint ;//デバッグ用 typAccel gf_AxReq[2] ;//アクセル更新フラグ typAccel gf_AxReqH[2] ;//浮上時アクセル値更新フラグ +typAccel gf_AxStepReq[2] ;//アクセル用サーボ動作ステップ値更新フラグ typAxlRpm gf_MtReq[4] ;//モーター姿勢制御更新フラグ typAxlRpm gf_MtReqOfs[4] ;//モーターオフセット更新フラグ typAxlRpm gf_MtReqDct[8] ;//ダイレクト(FPGA関数直接呼び出し)モーター更新フラグ @@ -55,6 +58,8 @@ gf_Armed = false; gf_Dbg = false; gf_StopMot = false; + + gf_BlinkLED = false; // gf_Print.flg = 0; // gf_Mon.flg = 0; @@ -65,10 +70,14 @@ //gf_DbgPrint.flg = 0; - gf_AxReq[0].dt = 0; - gf_AxReq[1].dt = 0; - gf_AxReqH[0].dt = 0; - gf_AxReqH[1].dt = 0; + // engine + for(int i = 0; i < 2; ++i){ + gf_AxReq[i].dt = 0; + gf_AxReqH[i].dt = 0; + gf_AxStepReq[i].bf.req = false; + gf_AxStepReq[i].bf.val = 100; + } + for(int i=0; i<4;++i){ gf_MtReq[i].req = false; gf_MtReq[i].val = 0; @@ -201,7 +210,13 @@ } else if(stat == TAKE_OFF || stat == HOVER || stat == DRIVE || stat == GROUND || stat == EMGGND) {//PURPLE - setDOCol(PURPLE); + if(gf_BlinkLED){ + setDOCol(BLK_PURPLE); + gf_BlinkLED = false; + } + else{ + setDOCol(PURPLE); + } } else if(stat == CHK_EG_ENT || stat == CHK_EG_MID || stat == CHK_EG_EXIT) {//LIGHT BLUE @@ -221,6 +236,10 @@ } } +//void blinkLED(enmHbState stat){ + +//} + void setState(enmHbState stat){ // ありえない遷移を排除 if(gf_State == SLEEP){if(stat != WAKEUP) return;}