- added Delay to Serial flush method
Fork of ArduinoAPI by
Diff: ArduinoSerial.cpp
- Revision:
- 5:8072d40c7f3c
- Parent:
- 0:5ebc917ebd09
- Child:
- 6:926a4df8c0fb
--- a/ArduinoSerial.cpp Tue Feb 10 10:39:42 2015 +0000 +++ b/ArduinoSerial.cpp Sat Mar 14 10:15:36 2015 +0000 @@ -1,9 +1,19 @@ #include "ArduinoSerial.h" +DigitalOut _testPin(P1_20); +class testPin { + public: + testPin() {_testPin=1;}; + ~testPin() {_testPin=0;}; +}; + + ArduinoSerialLinkedNode ArduinoSerial::ms_list_head = {NULL, NULL}; unsigned int ArduinoSerial::ms_instance_counter = 0; void ArduinoSerial::uartIrqCallback(void) { + testPin(); + ArduinoSerialLinkedNode *p; for (p = ms_list_head.next; p != &ms_list_head; p = p->next) { if (p->data != NULL) { @@ -83,6 +93,7 @@ } size_t ArduinoSerial::write(uint8_t data) { + while (!writeable()) {}; putc(data); return 1; }