4D display working with Gecko board STK3600
Fork of 4dGENIE by
Diff: mbed_genie.cpp
- Revision:
- 9:b74deaac80f9
- Parent:
- 8:b5ba0df2d0db
- Child:
- 10:4d9f1be4a901
diff -r b5ba0df2d0db -r b74deaac80f9 mbed_genie.cpp --- a/mbed_genie.cpp Sun Jul 06 17:22:32 2014 +0000 +++ b/mbed_genie.cpp Tue Jul 08 15:52:26 2014 +0000 @@ -28,6 +28,10 @@ do { c = _screen.getc(); + if(_t.read_ms() >= RxMaxTimeout && state == CommInProgress) + { + Reset(); + } ManageReceiveData(c); } while(_screen.readable()); @@ -151,7 +155,7 @@ //Here we dont wiat for a typical answer //The screen will respond with an NACK if the command was not understood, otherwise it will send a report object frame - return WaitForReadAnswer(); + return 0;//WaitForReadAnswer(); } void Mbed4dGenie::writec(char data) { @@ -192,8 +196,9 @@ LastResponse = NO_RESPONSE; return ERROR_NAK; } - else if(LastResponse >= timeout) //check if we timed out while waiting for response + else if(_t.read_ms() >= timeout) //check if we timed out while waiting for response { + LastResponse = NO_RESPONSE; return ERROR_TIMEOUT; } @@ -217,8 +222,9 @@ LastResponse = NO_RESPONSE; return ERROR_NAK; } - else if(LastResponse >= timeout) + else if(_t.read_ms() >= timeout) { + printf("Current timer:%d ; timeout:%d\n\r",_t.read_ms(),timeout); LastResponse = NO_RESPONSE; return ERROR_TIMEOUT; }