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: SBUS.cpp
- Revision:
- 14:481c23f2e4eb
- Parent:
- 13:17a61a516f0c
- Child:
- 15:c96df23cad7d
diff -r 17a61a516f0c -r 481c23f2e4eb SBUS.cpp --- a/SBUS.cpp Mon Jul 15 00:50:24 2019 +0000 +++ b/SBUS.cpp Mon Jul 15 09:05:23 2019 +0000 @@ -43,14 +43,14 @@ char buf; buf = com.getc(); + if(count >= 25) return; + receivedData[count] = buf; + count++; - if(buf == 0x0F) { + if(count == 25 && receivedData[0] == 0x0F) { decordReceivedData(); count = 0; } - if(count >= 25) return; - receivedData[count] = buf; - count++; } void SBUS::decordReceivedData() {