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 buffered-serial1 by
Diff: buffered_serial.cpp
- Revision:
- 2:8ccf9bb8dc65
- Parent:
- 1:eabb26ce183b
- Child:
- 3:a4a21e18acd1
- Child:
- 5:8daa0697fa7f
diff -r eabb26ce183b -r 8ccf9bb8dc65 buffered_serial.cpp
--- a/buffered_serial.cpp Tue Dec 11 00:08:24 2012 +0000
+++ b/buffered_serial.cpp Tue Dec 11 00:12:45 2012 +0000
@@ -56,7 +56,6 @@
i = 0;
// Start Critical Section - don't interrupt while changing global buffer variables
NVIC_DisableIRQ(device_irqn);
- memset(rx_line,LINE_SIZE,0);
// Loop reading rx buffer characters until end of line character
while ((i==0) || (rx_line[i-1] != '\n')) {
// Wait if buffer empty
@@ -75,11 +74,11 @@
rx_out = NEXT(rx_out);
// prevent overflow on rx_line
- /*if(i >= (LINE_SIZE - 1)) // not working!!!
+ if(i == LINE_SIZE)
{
i--;
break;
- }*/
+ }
}
rx_line[i++] = 0;
// End Critical Section
