From ee9e3315b6f73ddd06ea326577fbe68b99e14e9f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 26 Jan 2026 17:21:05 -1000 Subject: [PATCH] [tm1638] Use member array instead of heap allocation for display buffer (#13504) --- esphome/components/tm1638/tm1638.cpp | 3 --- esphome/components/tm1638/tm1638.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/esphome/components/tm1638/tm1638.cpp b/esphome/components/tm1638/tm1638.cpp index 7ba63fe218..8ef546ff32 100644 --- a/esphome/components/tm1638/tm1638.cpp +++ b/esphome/components/tm1638/tm1638.cpp @@ -35,9 +35,6 @@ void TM1638Component::setup() { this->set_intensity(intensity_); this->reset_(); // all LEDs off - - for (uint8_t i = 0; i < 8; i++) // zero fill print buffer - this->buffer_[i] = 0; } void TM1638Component::dump_config() { diff --git a/esphome/components/tm1638/tm1638.h b/esphome/components/tm1638/tm1638.h index f6b2922ecf..27898aa3dc 100644 --- a/esphome/components/tm1638/tm1638.h +++ b/esphome/components/tm1638/tm1638.h @@ -70,7 +70,7 @@ class TM1638Component : public PollingComponent { GPIOPin *clk_pin_; GPIOPin *stb_pin_; GPIOPin *dio_pin_; - uint8_t *buffer_ = new uint8_t[8]; + uint8_t buffer_[8]{}; tm1638_writer_t writer_{}; std::vector listeners_{}; };