確認用

Dependencies:   HCSR04_2 MPU6050_2 mbed SDFileSystem3

Fork of Autoflight2018_29 by 航空研究会

Files at this revision

API Documentation at this revision

Comitter:
taknokolat
Date:
Thu Sep 20 06:58:59 2018 +0000
Parent:
23:4928a6fd9eee
Commit message:
a

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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){