From 46f01b07238f25e500a24e28bb351e61c2c8cee2 Mon Sep 17 00:00:00 2001 From: Michael Geramb Date: Fri, 16 Jan 2026 22:48:27 +0100 Subject: [PATCH 1/2] Fix Serial LED Manager to support less then 3 serial LEDs --- src/OpenKNX/Led/Serial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenKNX/Led/Serial.cpp b/src/OpenKNX/Led/Serial.cpp index e1dbf191..d559ef4e 100644 --- a/src/OpenKNX/Led/Serial.cpp +++ b/src/OpenKNX/Led/Serial.cpp @@ -167,7 +167,7 @@ namespace OpenKNX void SerialLedManager::init(uint8_t ledCount) { - logInfo("SerialLedManager", "init"); + logInfo("SerialLedManager", "init %d serial leds", (int) ledCount); // LED-Todo: check max led count based on platform @@ -182,7 +182,7 @@ namespace OpenKNX .gpio_num = (gpio_num_t)_ledPin, .clk_src = RMT_CLK_SRC_DEFAULT, // select source clock .resolution_hz = RMT_LED_STRIP_RESOLUTION_HZ, - .mem_block_symbols = (size_t)(ledCount * BITS_PER_LED_CMD), // increase the block size can make the LED less flickering + .mem_block_symbols = (size_t) max(64 /* required minimum */, ledCount * BITS_PER_LED_CMD), // increase the block size can make the LED less flickering .trans_queue_depth = 1, // set the number of transactions that can be pending in the background }; rmt_new_tx_channel(&tx_chan_config, &_led_chan); From 1c419aa10266282f28f555ca781bb4b99d53856c Mon Sep 17 00:00:00 2001 From: Marco Scholl Date: Sat, 17 Jan 2026 11:06:17 +0100 Subject: [PATCH 2/2] codeformatter + use %u instead of %d --- src/OpenKNX/Led/Serial.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenKNX/Led/Serial.cpp b/src/OpenKNX/Led/Serial.cpp index d559ef4e..2420f1fd 100644 --- a/src/OpenKNX/Led/Serial.cpp +++ b/src/OpenKNX/Led/Serial.cpp @@ -167,7 +167,7 @@ namespace OpenKNX void SerialLedManager::init(uint8_t ledCount) { - logInfo("SerialLedManager", "init %d serial leds", (int) ledCount); + logInfo("SerialLedManager", "init %u serial leds", ledCount); // LED-Todo: check max led count based on platform @@ -182,8 +182,8 @@ namespace OpenKNX .gpio_num = (gpio_num_t)_ledPin, .clk_src = RMT_CLK_SRC_DEFAULT, // select source clock .resolution_hz = RMT_LED_STRIP_RESOLUTION_HZ, - .mem_block_symbols = (size_t) max(64 /* required minimum */, ledCount * BITS_PER_LED_CMD), // increase the block size can make the LED less flickering - .trans_queue_depth = 1, // set the number of transactions that can be pending in the background + .mem_block_symbols = (size_t)max(64 /* required minimum */, ledCount * BITS_PER_LED_CMD), // increase the block size can make the LED less flickering + .trans_queue_depth = 1, // set the number of transactions that can be pending in the background }; rmt_new_tx_channel(&tx_chan_config, &_led_chan); _simple_encoder = NULL;