AAA
Dependencies: mbed
Diff: GCS_MUX_CODE.cpp
- Revision:
- 0:22d57f537f92
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GCS_MUX_CODE.cpp Thu May 24 09:38:18 2018 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" +#include "Pin_Assign.h" +#include "Global_Variables.h" +#include "COMMs.h" + +Ticker Timer2gcs; +bool fTimer2gcs=0; +void Timer2gcs_isr(void); + +int main() +{ + Pc.baud(38400); + Trk.baud(38400); + Trg.baud(38400); + + Timer2gcs.attach(&Timer2gcs_isr,0.2); + + while(1) + { + if(Pc.readable()) GetPc(); + if(Trk.readable()) GetTrk(); + if(Trg.readable()) GetTrg(); + if(fTimer2gcs==1) + { + fTimer2gcs=0; + Mux2GCS(); + } + } +} + +void Timer2gcs_isr(void) +{ + fTimer2gcs=1; +} \ No newline at end of file