remove some debug output.

adds a tx queue size limit with warning.
This commit is contained in:
Marco Scholl 2024-04-10 14:36:19 +02:00
parent 1754e5387b
commit 97e15c7d92
No known key found for this signature in database

View File

@ -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;
} }