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:
- 41:45c982b1c5b6
- Parent:
- 40:debe99e228d3
- Child:
- 46:5074781a28dd
--- a/userTask.cpp Mon Jan 21 06:32:24 2019 +0000
+++ b/userTask.cpp Mon Jan 21 11:57:35 2019 +0000
@@ -80,7 +80,10 @@
float AxlRow;
float TrtlRow;
while(1){
+ // DISPLAY LED
led1=!led1;
+ setDO4LED(gf_State);
+
hb.proofOfSurvival();
bDoCtrlAtt = false;
bDoCtrlMot = false;
@@ -134,13 +137,13 @@
}
if(hb.chkSWUserOpeAny()){
typUserSw sw = hb.getUserSw();
- sp.printf("%d%d%d%d%d%d%d%d%d%d\r\n",sw.bf.brk_l,sw.bf.flt_off,sw.bf.r_eng_down,sw.bf.r_eng_up,sw.bf.rsv_1
- ,sw.bf.brk_r,sw.bf.flt_on,sw.bf.f_eng_down,sw.bf.f_eng_up, sw.bf.all_stop);
+ //sp.printf("%d%d%d%d%d%d%d%d%d%d\r\n",sw.bf.brk_l,sw.bf.flt_off,sw.bf.r_eng_down,sw.bf.r_eng_up,sw.bf.rsv_1
+ // ,sw.bf.brk_r,sw.bf.flt_on,sw.bf.f_eng_down,sw.bf.f_eng_up, sw.bf.all_stop);
} else {
//TrtlRow = hb.getUserEngTrottleRaw();
- if(gf_Print.bf.ain){
+ if(gf_Print.d2.bf.ain){
AxlRow = hb.getUserMotAxlRaw();
- sp.printf("MotAxl:%f\r\n",AxlRow);
+ sp.printf("MotAxl:%f ",AxlRow);
}
}
// 浮上(離陸)ボタン、着陸ボタンの同時長押し監視
@@ -295,6 +298,10 @@
}
if(hb.chkSWUserOpe(HbUserOpe::R_ENG_UP)){
if(hb.chkSetHvAxl(FRONT)){
+ gf_AxReq[0].bf.req = true;
+ //gf_AxReq[1].bf.req = true;
+ gf_AxReq[0].bf.val = 0;
+ //gf_AxReq[1].bf.val = 0;
setState(CHK_EG_MID);
}
}
@@ -315,6 +322,7 @@
setState(CHK_EG_R);
}
}
+ bDoCtrlEng = true;
break;
case CHK_EG_R:
if(gf_StateEnt){
@@ -329,6 +337,10 @@
}
if(hb.chkSWUserOpe(HbUserOpe::R_ENG_UP)){
if(hb.chkSetHvAxl(REAR)){
+ //gf_AxReq[0].bf.req = true;
+ gf_AxReq[1].bf.req = true;
+ //gf_AxReq[0].bf.val = 0;
+ gf_AxReq[1].bf.val = 0;
setState(CHK_EG_EXIT);
}
}
@@ -347,6 +359,7 @@
setState(SLEEP);
}
}
+ bDoCtrlEng = true;
break;
case CHK_ENT: //チェックエンター
if(gf_StateEnt){
@@ -436,16 +449,13 @@
if(bDoCtrlMot)hb.controlMotor();//モーター指令出し
if(bDoCtrlEng)hb.controlEngine();//エンジン指令出し
- if(gf_Print.bf.stat){
- sp.printf("stat : [%X]\r\n",gf_State);
+ if(gf_Print.d1.bf.stat){
+ sp.printf("stat : [%X] ",gf_State);
}
//表示フラグを落とす(けどモニタフラグが立ってる箇所は残る)
- if(gf_Print.flg!=0){
- gf_Print.flg=gf_Mon.flg;
- sp.printf("\r\n");
- }
- if(gf_DbgPrint.flg != 0){
- gf_DbgPrint.flg = 0;
+ if(gf_Print.d1.flg!=0 || gf_Print.d2.flg!=0){
+ gf_Print.d1.flg=gf_Mon.d1.flg;
+ gf_Print.d2.flg=gf_Mon.d2.flg;
sp.printf("\r\n");
}