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.
Diff: Receiver.cpp
- Revision:
- 9:8f479f7c1b54
- Parent:
- 8:7c56fb1ed8c0
--- a/Receiver.cpp Wed Oct 25 04:17:42 2017 +0000 +++ b/Receiver.cpp Wed Oct 25 05:43:13 2017 +0000 @@ -16,8 +16,10 @@ { if(dataReady.wait(2)==0) { + timedOut = true; return BitData::timeout; } + char val = data[currentData]; currentData++; if(currentData==size) @@ -46,12 +48,12 @@ if(mode == BitData::zero) { lastTime = curTime; - pushData(BitData::zero); - return; + pushData(BitData::zero); } + return; } // data - if(dif > us_prepare) + else if(dif > us_prepare) { lastTime = curTime; pushData(mode); @@ -96,10 +98,11 @@ val = val|(1 << 7-i); break; case BitData::timeout: + val = 0; return false; } } - pc.printf(" byte:%i\n",val); + //pc.printf(" byte:%i\n",val); return true; }