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 dgps by
Diff: packet.h
- Revision:
- 36:53b69e471b5a
- Parent:
- 32:9cb7bc3fc9e0
- Child:
- 41:df156ae5631b
diff -r 9cb7bc3fc9e0 -r 53b69e471b5a packet.h --- a/packet.h Wed Apr 23 01:43:17 2014 +0000 +++ b/packet.h Wed Apr 23 03:31:16 2014 +0000 @@ -96,15 +96,18 @@ } } - char rx_ready_with_timeout(){ - if(outputDevice.readable()){ + char rx_ready_with_timeout(Serial* serialDevice = NULL){ + if(serialDevice == NULL){ + serialDevice = &outputDevice; + } + if(serialDevice->readable()){ return 1; }else{ EvTimer t; t.set_s_period(3.0); t.start_timer(); while(t.get_num_trips() == 0){ - if(outputDevice.readable()){ + if(serialDevice->readable()){ return 1; } }