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 d7a_1x by
Diff: src/d7a_com.cpp
- Revision:
- 89:8c4c0fa6cbfa
- Parent:
- 84:e5388f1b8ed9
diff -r dcebea09aac7 -r 8c4c0fa6cbfa src/d7a_com.cpp
--- a/src/d7a_com.cpp Mon Mar 13 11:58:38 2017 +0000
+++ b/src/d7a_com.cpp Mon Mar 20 09:40:44 2017 +0000
@@ -379,7 +379,10 @@
// copy data to buffer
pkt->blen = g_com_msg.blen;
pkt->id = g_com_msg.id;
- g_com_rx_buf.get(pkt->buffer, g_com_msg.blen);
+ if (g_com_msg.blen)
+ {
+ g_com_rx_buf.get(pkt->buffer, g_com_msg.blen);
+ }
// add packet to queue
d7a_com_new_pkt(pkt);
@@ -388,7 +391,10 @@
{
// Ignore packet
//COM_DPRINT("Ignore pkt id %02X\r\n", g_com_msg.id);
- g_com_rx_buf.get(NULL, g_com_msg.blen);
+ if (g_com_msg.blen)
+ {
+ g_com_rx_buf.get(NULL, g_com_msg.blen);
+ }
}
// Seach for next header
