From 5f1dddf7e40a0a1f2e17eda2aa24cc7ef85e4c5b Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 8 Nov 2023 14:49:45 +0100 Subject: [PATCH] enlarge uart-tx-queue, warn overflow --- src/telegram.cpp | 2 ++ src/telegram.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/telegram.cpp b/src/telegram.cpp index ac9ff25b5..03bdcd3e4 100644 --- a/src/telegram.cpp +++ b/src/telegram.cpp @@ -445,6 +445,7 @@ void TxService::add(const uint8_t operation, // if the queue is full, make room by removing the last one if (tx_telegrams_.size() >= MAX_TX_TELEGRAMS) { + LOG_WARNING("Tx queue overflow, skip one message"); if (tx_telegrams_.front().telegram_->operation == Telegram::Operation::TX_WRITE) { telegram_write_fail_count_++; } else { @@ -528,6 +529,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt // if the queue is full, make room by removing the last one if (tx_telegrams_.size() >= MAX_TX_TELEGRAMS) { + LOG_WARNING("Tx queue overflow, skip one message"); if (tx_telegrams_.front().telegram_->operation == Telegram::Operation::TX_WRITE) { telegram_write_fail_count_++; } else { diff --git a/src/telegram.h b/src/telegram.h index 96f1dd6ab..28e12c630 100644 --- a/src/telegram.h +++ b/src/telegram.h @@ -33,8 +33,8 @@ #include "helpers.h" -#define MAX_RX_TELEGRAMS 10 // size of Rx queue -#define MAX_TX_TELEGRAMS 50 // size of Tx queue +#define MAX_RX_TELEGRAMS 10 // size of Rx queue +#define MAX_TX_TELEGRAMS 100 // size of Tx queue // default values for null values static constexpr uint8_t EMS_VALUE_BOOL = 0xFF; // used to mark that something is a boolean