MODSERIAL

Dependencies:   HCSR04_2 MODSERIAL MPU6050_2 mbed SDFileSystem3

Fork of Autoflight2018_22 by 航空研究会

Files at this revision

API Documentation at this revision

Comitter:
TUATBM
Date:
Tue Sep 18 08:04:37 2018 +0000
Parent:
19:870b3004bc23
Commit message:
????????;

Changed in this revision

MODSERIAL.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 870b3004bc23 -r 5befe788d303 MODSERIAL.lib
--- a/MODSERIAL.lib	Tue Sep 18 06:01:03 2018 +0000
+++ b/MODSERIAL.lib	Tue Sep 18 08:04:37 2018 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/1519026547/code/MODSERIAL/#2ed98fd82186
+https://os.mbed.com/teams/1519026547/code/MODSERIAL/#8d2e26e2345c
diff -r 870b3004bc23 -r 5befe788d303 main.cpp
--- a/main.cpp	Tue Sep 18 06:01:03 2018 +0000
+++ b/main.cpp	Tue Sep 18 08:04:37 2018 +0000
@@ -181,7 +181,6 @@
 
 unsigned int g_distance;
 //Ticker USsensor;
-static char g_buf[16];
 char g_landingcommand='Z';
 float g_SerialTargetYAW;
 
@@ -190,7 +189,7 @@
 Timeout RerurnChickenServo2;
 
 /*-----関数のプロトタイプ宣言-----*/
-void setup(MODSERIAL_IRQ_INFO *info);
+void setup();
 void loop();
 
 void Init_PWM();
@@ -220,7 +219,7 @@
 void Output_PWM(int16_t pwm[6]);    //pwmをサーボへ出力
 
 //シリアル割り込み
-void getSF_Serial();
+void getSF_Serial(MODSERIAL_IRQ_INFO *info);
 float ConvertByteintoFloat(char high, char low);
 
 
@@ -279,7 +278,7 @@
 
 int main()
 {   
-    setup(&info);
+    setup();
     
     
     while(1){
@@ -298,9 +297,8 @@
     
 }
 
-void setup(MODSERIAL_IRQ_INFO *info){
+void setup(){
     //buzzer = 0;
-    MODSERIAL *pc = info->serial;
     led1 = 1;
     led2 = 1;
     led3 = 1;
@@ -329,7 +327,7 @@
     Init_sbus();    
     Init_sensors();
     //switch2.rise(ResetTrim);
-    pc.attach(&getSF_Serial, PA_2);
+    pc.attach(&getSF_Serial, MODSERIAL::RxIrq);
     //USsensor.attach(&UpdateDist, 0.05);
     
     NVIC_SetPriority(USART1_IRQn,0);
@@ -365,7 +363,6 @@
     led4 = 0;
     wait(0.2);
     
-    
     pc.printf("All initialized\r\n");
 }
 
@@ -452,7 +449,7 @@
                 count_op++;
                 if(count_op > changeModeCount){
                     operation_mode = SemiAuto;
-                    pc.printf("Goto SemiAuto mode\r\n");
+                    pc->printf("Goto SemiAuto mode\r\n");
                     count_op = 0;
                 }
             }else count_op = 0;
@@ -465,7 +462,7 @@
                 if(count_op>changeModeCount){
                     output_status = XXX;
                     led2 = 0;
-                    pc.printf("Goto XXX mode\r\n");
+                    pc->printf("Goto XXX mode\r\n");
                     count_op = 0;
                 }else count_op = 0;
                 ConvertPWMintoRAD(targetAngle);
@@ -1028,7 +1025,7 @@
 }
 
 
-void getSF_Serial(){
+void getSF_Serial(MODSERIAL_IRQ_INFO *info){
     
         static char SFbuf[16];
         static int bufcounter=0;
diff -r 870b3004bc23 -r 5befe788d303 mbed.bld
--- a/mbed.bld	Tue Sep 18 06:01:03 2018 +0000
+++ b/mbed.bld	Tue Sep 18 08:04:37 2018 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/5571c4ff569f
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb
\ No newline at end of file