mirror of
https://github.com/thelsing/knx.git
synced 2025-04-14 01:16:35 +02:00
remove some debug output.
adds a tx queue size limit with warning.
This commit is contained in:
parent
1754e5387b
commit
97e15c7d92
@ -109,6 +109,8 @@
|
|||||||
#define ACR0_FLAG_TRIGEN 0x08
|
#define ACR0_FLAG_TRIGEN 0x08
|
||||||
#define ACR0_FLAG_V20VCLIMIT 0x04
|
#define ACR0_FLAG_V20VCLIMIT 0x04
|
||||||
|
|
||||||
|
#define MAX_TX_QUEUE 20
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
TX_IDLE,
|
TX_IDLE,
|
||||||
@ -193,7 +195,6 @@ void TpUartDataLinkLayer::processRxByte()
|
|||||||
*/
|
*/
|
||||||
if (_rxState == RX_INVALID && (millis() - _rxLastTime) > 2 && !_platform.uartAvailable())
|
if (_rxState == RX_INVALID && (millis() - _rxLastTime) > 2 && !_platform.uartAvailable())
|
||||||
{
|
{
|
||||||
println("Reset RX_INVALID");
|
|
||||||
processRxFrameComplete();
|
processRxFrameComplete();
|
||||||
_rxState = RX_IDLE;
|
_rxState = RX_IDLE;
|
||||||
}
|
}
|
||||||
@ -564,11 +565,6 @@ void TpUartDataLinkLayer::pushTxFrameQueue(TpFrame *tpFrame)
|
|||||||
_txFrameQueue.back = entry;
|
_txFrameQueue.back = entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_txQueueCount > 10)
|
|
||||||
{
|
|
||||||
print("_txQueueCount:");
|
|
||||||
print(_txQueueCount);
|
|
||||||
}
|
|
||||||
_txQueueCount++;
|
_txQueueCount++;
|
||||||
_txFrameCounter++;
|
_txFrameCounter++;
|
||||||
}
|
}
|
||||||
@ -586,8 +582,12 @@ void TpUartDataLinkLayer::setFrameRepetition(uint8_t nack, uint8_t busy)
|
|||||||
|
|
||||||
bool TpUartDataLinkLayer::sendFrame(CemiFrame &cemiFrame)
|
bool TpUartDataLinkLayer::sendFrame(CemiFrame &cemiFrame)
|
||||||
{
|
{
|
||||||
if (!_connected || _monitoring)
|
if (!_connected || _monitoring || _txQueueCount > MAX_TX_QUEUE)
|
||||||
{
|
{
|
||||||
|
if (_txQueueCount > MAX_TX_QUEUE)
|
||||||
|
{
|
||||||
|
println("Ignore frame because transmit queue is full!");
|
||||||
|
}
|
||||||
dataConReceived(cemiFrame, false);
|
dataConReceived(cemiFrame, false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user