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: hbCommand.cpp
- Revision:
- 42:cc8501b824ba
- Parent:
- 41:45c982b1c5b6
- Child:
- 43:156199c2f9b6
--- a/hbCommand.cpp Mon Jan 21 11:57:35 2019 +0000
+++ b/hbCommand.cpp Wed Jan 23 11:58:53 2019 +0000
@@ -34,6 +34,9 @@
else if (strcmp(g_CmdBuf , "re" )==0 ){gf_Print.d1.bf.e1=true; gf_Print.d1.bf.e2=true;}
else if (strcmp(g_CmdBuf , "re1" )==0 ){gf_Print.d1.bf.e1=true;}
else if (strcmp(g_CmdBuf , "re2" )==0 ){gf_Print.d1.bf.e2=true;}
+ else if (strcmp(g_CmdBuf , "rep" )==0 ){gf_Print.d2.bf.ep1=true; gf_Print.d2.bf.ep2=true;}//エンジン用サーボにセットされた値
+ else if (strcmp(g_CmdBuf , "rep1" )==0 ){gf_Print.d2.bf.ep1=true;}//前エンジン用サーボにセットされた値
+ else if (strcmp(g_CmdBuf , "rep2" )==0 ){gf_Print.d2.bf.ep2=true;}//後エンジン用サーボにセットされた値
else if (strcmp(g_CmdBuf , "rm" )==0 ){gf_Print.d1.bf.m1=true;gf_Print.d1.bf.m2=true;gf_Print.d1.bf.m3=true;gf_Print.d1.bf.m4=true;}//リードモーター
else if (strcmp(g_CmdBuf , "rm1" )==0 ){gf_Print.d1.bf.m1=true;}//リードモーター1
else if (strcmp(g_CmdBuf , "rm2" )==0 ){gf_Print.d1.bf.m2=true;}//リードモーター2
@@ -55,6 +58,8 @@
else if (strcmp(g_CmdBuf , "se2" )==0 ){gf_AxReq[1].bf.req=true; gf_AxReq[1].bf.val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
else if (strcmp(g_CmdBuf , "sep1" )==0 ){gf_AxReq[0].bf.val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
else if (strcmp(g_CmdBuf , "sep2" )==0 ){gf_AxReq[1].bf.val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
+ else if (strcmp(g_CmdBuf , "seh1" )==0 ){gf_AxReqH[0].bf.req=true; gf_AxReqH[0].bf.val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
+ else if (strcmp(g_CmdBuf , "seh2" )==0 ){gf_AxReqH[1].bf.req=true; gf_AxReqH[1].bf.val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
else if (strcmp(g_CmdBuf , "sm1" )==0 ){gf_MtReq[0].req=true; gf_MtReq[0].val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
else if (strcmp(g_CmdBuf , "sm2" )==0 ){gf_MtReq[1].req=true; gf_MtReq[1].val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
else if (strcmp(g_CmdBuf , "sm3" )==0 ){gf_MtReq[2].req=true; gf_MtReq[2].val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
@@ -120,6 +125,17 @@
else if (strcmp(g_CmdBuf , "stat")==0 ){gf_Print.d1.bf.stat=true;}//ステート表示
else if (strcmp(g_CmdBuf , "sstatf")==0 ){setStateF((enmHbState)atoi(&g_CmdBuf[arg2pos]));}//ステート強制遷移
+ else if (strcmp(g_CmdBuf , "sw0")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=0;}//SW 0bit目をON
+ else if (strcmp(g_CmdBuf , "sw1")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=1;}//SW 1bit目をON
+ else if (strcmp(g_CmdBuf , "sw2")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=2;}//SW 2bit目をON
+ else if (strcmp(g_CmdBuf , "sw3")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=3;}//SW 3bit目をON
+ else if (strcmp(g_CmdBuf , "sw4")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=4;}//SW 4bit目をON
+ else if (strcmp(g_CmdBuf , "sw5")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=5;}//SW 5bit目をON
+ else if (strcmp(g_CmdBuf , "sw6")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=6;}//SW 6bit目をON
+ else if (strcmp(g_CmdBuf , "sw7")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=7;}//SW 7bit目をON
+ else if (strcmp(g_CmdBuf , "sw8")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=8;}//SW 8bit目をON
+ else if (strcmp(g_CmdBuf , "sw9")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=9;}//SW 9bit目をON
+
else if (strcmp(g_CmdBuf , "stopmot")==0 ){gf_StopMot = true;}//モーター強制停止
else if (strcmp(g_CmdBuf , "spidpp")==0 ){g_PidPara.PP = atof(&g_CmdBuf[arg2pos]);gf_PidParaUpdate=true;}//PIDの係数 Pp設定
@@ -129,37 +145,7 @@
else if (strcmp(g_CmdBuf , "spidimax")==0 ){g_PidPara.IMax = atof(&g_CmdBuf[arg2pos]);gf_PidParaUpdate=true;}//PIDの係数 積分上限値設定
else if (strcmp(g_CmdBuf , "spidimin")==0 ){g_PidPara.IMin = atof(&g_CmdBuf[arg2pos]);gf_PidParaUpdate=true;}//PIDの係数 積分下限値設定
else if (strcmp(g_CmdBuf , "spidv")==0 ){g_PidPara.V = atof(&g_CmdBuf[arg2pos]);gf_PidParaUpdate=true;}//PID2の角速度の係数
-
- // else if (strcmp(g_CmdBuf , "smot1ofs")==0 ){g_MotPara[0].offset = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[0]=true;}//モーター1オフセット設定
- // else if (strcmp(g_CmdBuf , "smot1hi")==0 ){g_MotPara[0].limit_hi = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[0]=true;}//モーター1上限値設定
- // else if (strcmp(g_CmdBuf , "smot1low")==0 ){g_MotPara[0].limit_low = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[0]=true;}//モーター1下限値設定
- // else if (strcmp(g_CmdBuf , "smot2ofs")==0 ){g_MotPara[1].offset = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[1]=true;}//モーター2オフセット設定
- // else if (strcmp(g_CmdBuf , "smot2hi")==0 ){g_MotPara[1].limit_hi = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[1]=true;}//モーター2上限値設定
- // else if (strcmp(g_CmdBuf , "smot2low")==0 ){g_MotPara[1].limit_low = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[1]=true;}//モーター2下限値設定
- // else if (strcmp(g_CmdBuf , "smot3ofs")==0 ){g_MotPara[2].offset = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[2]=true;}//モーター3オフセット設定
- // else if (strcmp(g_CmdBuf , "smot3hi")==0 ){g_MotPara[2].limit_hi = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[2]=true;}//モーター3上限値設定
- // else if (strcmp(g_CmdBuf , "smot3low")==0 ){g_MotPara[2].limit_low = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[2]=true;}//モーター3下限値設定
- // else if (strcmp(g_CmdBuf , "smot4ofs")==0 ){g_MotPara[3].offset = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[3]=true;}//モーター4オフセット設定
- // else if (strcmp(g_CmdBuf , "smot4hi")==0 ){g_MotPara[3].limit_hi = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[3]=true;}//モーター4上限値設定
- // else if (strcmp(g_CmdBuf , "smot4low")==0 ){g_MotPara[3].limit_low = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[3]=true;}//モーター4下限値設定
- // else if (strcmp(g_CmdBuf , "smotofs")==0 ){
- // g_MotPara[0].offset = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[0]=true;
- // g_MotPara[1].offset = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[1]=true;
- // g_MotPara[2].offset = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[2]=true;
- // g_MotPara[3].offset = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[3]=true;
- // }//モーター1~4オフセット設定
- // else if (strcmp(g_CmdBuf , "smothi")==0 ){
- // g_MotPara[0].limit_hi = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[0]=true;
- // g_MotPara[1].limit_hi = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[1]=true;
- // g_MotPara[2].limit_hi = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[2]=true;
- // g_MotPara[3].limit_hi = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[3]=true;
- // }//モーター1~4上限値設定
- // else if (strcmp(g_CmdBuf , "smotlow")==0 ){
- // g_MotPara[0].limit_low = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[0]=true;
- // g_MotPara[1].limit_low = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[1]=true;
- // g_MotPara[2].limit_low = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[2]=true;
- // g_MotPara[3].limit_low = atoi(&g_CmdBuf[arg2pos]);gf_MotParaUpdate[3]=true;
- // }//モーター1~4下限値設定
+
else if (strcmp(g_CmdBuf , "rmo" )==0 ){gf_Print.d2.bf.mo1=true;gf_Print.d2.bf.mo2=true;gf_Print.d2.bf.mo3=true;gf_Print.d2.bf.mo4=true;}//リードモーターオフセット
else if (strcmp(g_CmdBuf , "rmo1" )==0 ){gf_Print.d2.bf.mo1=true;}//リードモーターオフセット1
else if (strcmp(g_CmdBuf , "rmo2" )==0 ){gf_Print.d2.bf.mo2=true;}//リードモーターオフセット2
@@ -179,6 +165,17 @@
else if (strcmp(g_CmdBuf , "stat")==0 ){gf_Print.d1.bf.stat=true;}//ステート表示
else if (strcmp(g_CmdBuf , "sstatf")==0 ){setStateF((enmHbState)atoi(&g_CmdBuf[arg2pos]));}//ステート強制遷移
+ else if (strcmp(g_CmdBuf , "sw0")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=0;}//SW 0bit目をON
+ else if (strcmp(g_CmdBuf , "sw1")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=1;}//SW 1bit目をON
+ else if (strcmp(g_CmdBuf , "sw2")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=2;}//SW 2bit目をON
+ else if (strcmp(g_CmdBuf , "sw3")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=3;}//SW 3bit目をON
+ else if (strcmp(g_CmdBuf , "sw4")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=4;}//SW 4bit目をON
+ else if (strcmp(g_CmdBuf , "sw5")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=5;}//SW 5bit目をON
+ else if (strcmp(g_CmdBuf , "sw6")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=6;}//SW 6bit目をON
+ else if (strcmp(g_CmdBuf , "sw7")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=7;}//SW 7bit目をON
+ else if (strcmp(g_CmdBuf , "sw8")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=8;}//SW 8bit目をON
+ else if (strcmp(g_CmdBuf , "sw9")==0 ){gf_SwCmd.bf.req=true;gf_SwCmd.bf.val=9;}//SW 9bit目をON
+
else if (strcmp(g_CmdBuf , "sm1" )==0 ){gf_MtReq[0].req=true; gf_MtReq[0].val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
else if (strcmp(g_CmdBuf , "sm2" )==0 ){gf_MtReq[1].req=true; gf_MtReq[1].val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}
else if (strcmp(g_CmdBuf , "sm3" )==0 ){gf_MtReq[2].req=true; gf_MtReq[2].val=(UINT16)atoi(&g_CmdBuf[arg2pos]);}