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.
Dependencies: mbed mbed-rtos Xbus
Diff: xbus/xbusparser.c
- Revision:
- 17:680f28e00d17
- Parent:
- 14:155f9a55ec51
- Child:
- 19:46e88d37ecef
--- a/xbus/xbusparser.c Tue May 19 13:40:33 2015 +0200
+++ b/xbus/xbusparser.c Tue May 19 14:01:33 2015 +0200
@@ -101,6 +101,7 @@
if (byte == XBUS_NO_PAYLOAD)
{
parser->currentMessage.length = byte;
+ parser->currentMessage.data = NULL;
parser->state = XBPS_Checksum;
}
else if (byte < XBUS_EXTENDED_LENGTH)
@@ -142,7 +143,9 @@
case XBPS_Checksum:
parser->checksum += byte;
- if ((parser->checksum == 0) && parser->currentMessage.data)
+ if ((parser->checksum == 0) &&
+ ((parser->currentMessage.length == 0) ||
+ parser->currentMessage.data))
{
parser->callbacks.handleMessage(&parser->currentMessage);
}