mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 08:41:59 +00:00
[tm1638] Use member array instead of heap allocation for display buffer (#13504)
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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<KeyListener *> listeners_{};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user