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:
- 36:2cc739c7e4cb
- Parent:
- 35:3779201b4c73
- Child:
- 37:d51dacb4c30f
--- a/globalFlags.cpp Tue Dec 25 08:20:17 2018 +0000 +++ b/globalFlags.cpp Wed Jan 16 10:51:07 2019 +0000 @@ -10,6 +10,9 @@ //モーターアクセル用アナログ入力 AnalogIn AinAxl(p20); +//エンジンスロットル用アナログ入力 +AnalogIn AinThrottle(p19); + char g_CmdBuf[G_CMD_BUF_SIZ] ;// コマンド受け渡しバッファ bool gf_CmdPrs; @@ -29,12 +32,13 @@ typAxlRpm gf_MtReqU[4] ;//モーターユーザー更新フラグ enmHbState gf_State = SLEEP; +bool gf_StateEnt ;//状態遷移後、最初であることを示す bool gf_PidParaUpdate ;//PID Pp,P,I,Dの係数アップデートフラグ typPidPara g_PidPara ;//PID Pp,P,I,Dの係数の外部設定用 -bool gf_MotParaUpdate[4] ;//モーターのパラメータ値更新フラグ -typMotPara g_MotPara[4]; +// bool gf_MotParaUpdate[4] ;//モーターのパラメータ値更新フラグ +// typMotPara g_MotPara[4]; void initFlags(){ memset(g_CmdBuf,0x0,sizeof(g_CmdBuf)); @@ -64,17 +68,18 @@ gf_MtReqDct[i].val = 0; } gf_State = SLEEP; + gf_StateEnt = false; g_PidPara.PP = 2; g_PidPara.P = 0; g_PidPara.I = 0; g_PidPara.D = 0; g_PidPara.IMax = 2000; g_PidPara.IMin = -2000; - for(int i = 0; i < 4; ++i){ - gf_MotParaUpdate[i] = false; - g_MotPara[i].limit_hi = LIM_MOT_INP_MAX; - g_MotPara[i].limit_low = LIM_MOT_INP_MIN; - } + // for(int i = 0; i < 4; ++i){ + // gf_MotParaUpdate[i] = false; + // g_MotPara[i].limit_hi = LIM_MOT_INP_MAX; + // g_MotPara[i].limit_low = LIM_MOT_INP_MIN; + // } } void setState(enmHbState stat){ @@ -91,6 +96,7 @@ sp.printf("state: %d\r\n",stat); gf_State = stat; + gf_StateEnt = true; } void setStateF(enmHbState stat){ sp.printf("state: %d\r\n",stat); @@ -103,6 +109,7 @@ tmp = stat; } gf_State = tmp; + gf_StateEnt = true; } /* //===========================================