フェイルセーフ完成版
Dependencies: HCSR04_2 MPU6050_2 mbed SDFileSystem3
Fork of Autoflight2018_53 by
Diff: main.cpp
- Revision:
- 24:2cc7a3a10e72
- Parent:
- 23:4928a6fd9eee
- Child:
- 25:37bee299a276
--- a/main.cpp Thu Sep 20 06:02:21 2018 +0000 +++ b/main.cpp Thu Sep 20 06:58:59 2018 +0000 @@ -169,8 +169,6 @@ int16_t g_AIL_L_Ratio_rightloop = 0.5; -bool zeroTHR=true;//着陸時のスロットルが0かの判断用 - static float nowAngle[3] = {0,0,0}; const float trimAngle[3] = {0.0, 0.0, 0.0}; @@ -575,14 +573,6 @@ } #endif - if(CheckSW_Up(Ch7)){ - output_status = Auto; - led1 = 1; - }else{ - output_status = Manual; - led1 = 0; - zeroTHR=true; - } } int GetParameter(FILE *fp, const char *paramName,char parameter[]){ @@ -1282,6 +1272,17 @@ //着陸モード(PCからの指令に従う) void UpdateTargetAngle_Approach(float targetAngle[3]){ + static bool zeroTHR=true; + + if(CheckSW_Up(Ch7)){ + output_status = Auto; + led1 = 1; + }else{ + output_status = Manual; + led1 = 0; + zeroTHR=true; + } + NVIC_DisableIRQ(USART2_IRQn); switch(g_landingcommand){