pengfei wu
/
ESP8266Program
For test
Diff: ArduinoSerial.cpp
- Revision:
- 12:4e4e72f18047
- Parent:
- 11:7bd1b2a67b1a
- Child:
- 14:40b1decf03f3
--- a/ArduinoSerial.cpp Tue Feb 03 07:31:13 2015 +0000 +++ b/ArduinoSerial.cpp Tue Feb 03 07:54:14 2015 +0000 @@ -5,6 +5,7 @@ void ArduinoSerial::uart_irq_callback(void) { LinkedListNode *p; + for (p = list_head.next; p != &list_head; p = p->next) { if (p->data != NULL) { while(p->data->readable()) { @@ -15,7 +16,7 @@ } ArduinoSerial::ArduinoSerial(PinName tx, PinName rx):Serial(tx, rx) { - printf("Constructor\r\n"); + instance_counter++; if (instance_counter == 1) { init_list_head_node(&list_head); @@ -23,9 +24,9 @@ if (add_node_to_tail(&list_head, this) != NULL) { this->attach(&uart_irq_callback); - printf("Create instance 0x%X ok!\r\n", this); + //printf("Create instance 0x%X ok!\r\n", this); } else { - printf("Create instance 0x%X failed!\r\n", this); + //printf("Create instance 0x%X failed!\r\n", this); } } @@ -33,9 +34,9 @@ instance_counter--; if (del_node_by_data(&list_head, this) != NULL) { this->attach(NULL); - printf("Release instance 0x%X ok!\r\n", this); + //printf("Release instance 0x%X ok!\r\n", this); } else { - printf("Release instance 0x%X failed!\r\n", this); + //printf("Release instance 0x%X failed!\r\n", this); } } @@ -75,7 +76,6 @@ String data; char c; unsigned long i; - printf("1.0\r\n"); for (i = 0; i < find_timeout; i++) { while(available() > 0) { c = read_char(); @@ -87,7 +87,6 @@ } delay(1); } - printf("1.9\r\n"); return ret; }