Andriy Makukha / Mbed 2 deprecated football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
11:d3aa5fca2330
Parent:
10:72ceef287b0f
Child:
15:b86c4b798aa1
diff -r 72ceef287b0f -r d3aa5fca2330 io/MTSSerial.cpp
--- a/io/MTSSerial.cpp	Tue Apr 21 07:00:55 2015 +0000
+++ b/io/MTSSerial.cpp	Thu Apr 23 06:36:57 2015 +0000
@@ -46,16 +46,16 @@
     serial.format(bits, parity, stop_bits);
 }
 
-extern DigitalOut _led1;  //  ALS
+extern DigitalOut led1;  //  ALS
 
 void MTSSerial::handleRead()
 {
     char byte = serial.getc();
     if(rxBuffer.write(byte) != 1) {
     //  printf("[ERROR] Serial Rx Byte Dropped [%c][0x%02X]\r\n", byte, byte);
-        printf( "\r\n!  " );
+        printf( " ! " );
     }
-    _led1 = !_led1;  // Toggle LED on char in.  ALS
+    led1 = !led1;  // Toggle LED on char in.  ALS
 }
 
 // Currently uses Non-Irq based blocking write calls   -- Now uses TXDRDY IRQ  ALS  20150419
@@ -65,9 +65,11 @@
         if (serial.writeable()) {
             char byte;
             if(txBuffer.read(byte) == 1) {
-                serial.attach(NULL, Serial::RxIrq);
+                //serial.attach(NULL, Serial::RxIrq);
+                disableRxIrq();
                 serial.putc(byte);
-                serial.attach(this, &MTSSerial::handleRead, Serial::RxIrq);
+                //serial.attach(this, &MTSSerial::handleRead, Serial::RxIrq);
+                enableRxIrq();
             }
         } else {
             return;