Read UART at 4800 then Resend thru the USB

Dependencies:   mbed

Revision:
2:2fc8495988a0
Parent:
1:221b87b26f53
--- a/main.cpp	Thu Jan 28 14:33:47 2016 +0000
+++ b/main.cpp	Thu Jan 28 21:43:12 2016 +0000
@@ -7,17 +7,23 @@
 
 Serial pc(SERIAL_TX, SERIAL_RX);
 Serial gps(PB_10, PC_5);
- 
-int main() {
-  uint8_t c;
-  pc.baud(4800);
-  gps.baud(4800);
-  pc.printf("*** GPS ***\n");
-  while(1) {
-      if (gps.readable()){
-      c = gps.getc();
-      pc.putc(c);
-      }
-  }
+
+int main()
+{
+    uint8_t c;
+    
+    pc.baud(4800);
+    gps.baud(4800);
+    
+    pc.printf("*** GPS ***\n");
+    while(1) {
+        if (gps.readable()) {
+            c = gps.getc();
+            pc.putc(c);
+        }
+        if (pc.readable()) {
+            c = pc.getc();
+            gps.putc(c);
+        }
+    }
 }
- 
\ No newline at end of file