Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of football_project by
Diff: io/MTSSerial.cpp
- 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;
