mirror of
https://github.com/thelsing/knx.git
synced 2025-08-17 13:47:28 +02:00
tpuart: Add a way to have debug traces
This commit is contained in:
parent
42a35dd8ce
commit
026e79db38
@ -9,6 +9,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
//#define DEBUG_TPUART_XFER_TX
|
||||||
|
//#define DEBUG_TPUART_XFER_RX
|
||||||
|
//#define DEBUG_TPUART_XFER_TIME
|
||||||
|
|
||||||
// NCN5120
|
// NCN5120
|
||||||
//#define NCN5120
|
//#define NCN5120
|
||||||
|
|
||||||
@ -407,7 +411,12 @@ TpUartDataLinkLayer::TpUartDataLinkLayer(DeviceObject& devObj, AddressTableObjec
|
|||||||
|
|
||||||
void TpUartDataLinkLayer::frameBytesReceived(uint8_t* buffer, uint16_t length)
|
void TpUartDataLinkLayer::frameBytesReceived(uint8_t* buffer, uint16_t length)
|
||||||
{
|
{
|
||||||
//printHex("=>", buffer, length);
|
#ifdef DEBUG_TPUART_XFER_RX
|
||||||
|
#ifdef DEBUG_TPUART_XFER_TIME
|
||||||
|
printf("%llu:",millis());
|
||||||
|
#endif
|
||||||
|
printHex("TPUART ->", buffer, length);
|
||||||
|
#endif
|
||||||
CemiFrame frame(buffer, length);
|
CemiFrame frame(buffer, length);
|
||||||
|
|
||||||
frameRecieved(frame);
|
frameRecieved(frame);
|
||||||
@ -487,6 +496,13 @@ bool TpUartDataLinkLayer::sendSingleFrameByte()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef DEBUG_TPUART_XFER_TX
|
||||||
|
#ifdef DEBUG_TPUART_XFER_TIME
|
||||||
|
printf("%llu:",millis());
|
||||||
|
#endif
|
||||||
|
printHex("TPUART <- ", _sendBuffer, _sendBufferLength);
|
||||||
|
#endif
|
||||||
_TxByteCnt = 0;
|
_TxByteCnt = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user