From 86c06364b1d39389902ea68bc1f27202f9396afb Mon Sep 17 00:00:00 2001 From: endym Date: Thu, 10 Oct 2024 21:32:16 +0200 Subject: [PATCH] [max6921] improve comments about LOAD pin usage --- esphome/components/max6921/max6921.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/max6921/max6921.cpp b/esphome/components/max6921/max6921.cpp index d925db9c47..b1777416cb 100644 --- a/esphome/components/max6921/max6921.cpp +++ b/esphome/components/max6921/max6921.cpp @@ -37,7 +37,7 @@ void MAX6921Component::dump_config() { this->display_->dump_config(); } -/** +/* * @brief Clocks data into MAX6921 via SPI (MSB first). * Data must contain 3 bytes with following format: * bit | 23 | 22 | 21 | 20 | 19 | 18 | ... | 1 | 0 @@ -49,13 +49,13 @@ void HOT MAX6921Component::write_data(uint8_t *ptr, size_t length) { static bool first_call_logged = false; assert(length == 3); - this->disable_load_(); // set LOAD to low memcpy(data, ptr, sizeof(data)); // make copy of data, because transfer buffer will be overwritten with SPI answer if (!first_call_logged) ESP_LOGVV(TAG, "SPI(%u): 0x%02x%02x%02x", length, data[0], data[1], data[2]); first_call_logged = true; + this->disable_load_(); // set LOAD to low to disable update of output latch during data transfer this->transfer_array(data, sizeof(data)); - this->enable_load_(); // set LOAD to high to update output latch + this->enable_load_(); // set LOAD to high to update the output latch (transparent to the shift register) } void MAX6921Component::update() {