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:
- 79:82b01c1a62f6
- Parent:
- 78:f1c0affd99e7
- Child:
- 80:30265d5dd20a
--- a/src/d7a_com.cpp Wed Dec 21 14:11:09 2016 +0000
+++ b/src/d7a_com.cpp Wed Dec 21 15:08:51 2016 +0000
@@ -10,6 +10,14 @@
#include "d7a_sys.h"
#include "cbuffer.h"
+#if 1
+ #define COM_DPRINT(...) DPRINT(__VA_ARGS__)
+ #define DPRINT_DATA(...) DPRINT_DATA(__VA_ARGS__)
+#else
+ #define COM_DPRINT(...);
+ #define DPRINT_DATA(...);
+#endif
+
#define XON_SIGNAL (0x0001 << 0)
#define START_SIGNAL (0x0001 << 1)
@@ -173,7 +181,7 @@
{
FPRINT("\r\n");
- DPRINT("<-- (0x%02X) %d\r\n", tx_buf->buf[4], (tx_buf->len - KAL_COM_HEADER_LEN));
+ COM_DPRINT("<-- (0x%02X) %d\r\n", tx_buf->buf[4], (tx_buf->len - KAL_COM_HEADER_LEN));
*(g_com_rts) = 1;
@@ -245,7 +253,7 @@
{
//FPRINT("\r\n");
- DPRINT("--> (0x%02X) %d\r\n", pkt->id, pkt->blen);
+ COM_DPRINT("--> (0x%02X) %d\r\n", pkt->id, pkt->blen);
// Distribute packet types to processes
switch (KAL_COM_FLOWID(pkt->id))
@@ -264,13 +272,13 @@
if (pkt->id == KAL_COM_FLOW_SYS_XON)
{
FREE(pkt);
- DPRINT("XON\r\n");
+ COM_DPRINT("XON\r\n");
g_com_tx_thread.signal_set(XON_SIGNAL);
}
else if (pkt->id == KAL_COM_FLOW_SYS_XOFF)
{
FREE(pkt);
- DPRINT("XOFF\r\n");
+ COM_DPRINT("XOFF\r\n");
d7a_sys_xack();
}
else
@@ -334,7 +342,7 @@
g_com_data_parsing.release();
}
- //DPRINT("COM header found (id: %02X seq: %d body: %d/%d bytes)\r\n", g_com_msg.id, seqnum, g_com_rx_buf.available_data(), g_com_msg.blen);
+ //COM_DPRINT("COM header found (id: %02X seq: %d body: %d/%d bytes)\r\n", g_com_msg.id, seqnum, g_com_rx_buf.available_data(), g_com_msg.blen);
break;
}
else
@@ -358,7 +366,7 @@
if (KAL_COM_FLOWID(g_com_msg.id) != KAL_COM_FLOWID_TRC)
{
- //DPRINT("COM body found (%d bytes)\r\n", g_com_msg.blen);
+ //COM_DPRINT("COM body found (%d bytes)\r\n", g_com_msg.blen);
d7a_com_rx_msg_t* pkt = (d7a_com_rx_msg_t*)MALLOC(sizeof(d7a_com_rx_msg_t) - 1 + g_com_msg.blen);
@@ -373,7 +381,7 @@
else
{
// Ignore packet
- //DPRINT("Ignore pkt id %02X\r\n", g_com_msg.id);
+ //COM_DPRINT("Ignore pkt id %02X\r\n", g_com_msg.id);
g_com_rx_buf.get(NULL, g_com_msg.blen);
}
@@ -434,7 +442,7 @@
if (KAL_COM_FLOW_SYS_XACK == flow_id)
{
- DPRINT("XACK\r\n");
+ COM_DPRINT("XACK\r\n");
g_com_tx_thread.signal_wait(XON_SIGNAL);
}
}
