From e56b1895230f18a16360b08c6bb03cbf57760f57 Mon Sep 17 00:00:00 2001 From: Pebblebed Date: Fri, 23 Feb 2024 19:16:13 +0000 Subject: [PATCH] Corrected buffer size and made consistant --- esphome/components/external_eeprom/external_eeprom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/external_eeprom/external_eeprom.cpp b/esphome/components/external_eeprom/external_eeprom.cpp index 367f55e059..26d0a15f66 100644 --- a/esphome/components/external_eeprom/external_eeprom.cpp +++ b/esphome/components/external_eeprom/external_eeprom.cpp @@ -88,7 +88,7 @@ double ExtEepromComponent::read_double(uint32_t memaddr) { /// @param buffer_size is the size of the buffer and also the number of bytes to be read void ExtEepromComponent::read(uint32_t memaddr, uint8_t *buff, uint16_t buffer_size) { ESP_LOGVV(TAG, "Read %d bytes from address %d", buffer_size, memaddr); - uint32_t size = buffer_size; + uint16_t size = buffer_size; uint8_t *p = buff; i2c::ErrorCode ret; while (size >= 1) { @@ -203,7 +203,7 @@ void ExtEepromComponent::write_double(uint32_t memaddr, double value) { /// @param buffer_size is the size of the buffer and also the number of bytes to be written void ExtEepromComponent::write(uint32_t memaddr, uint8_t *data_to_write, uint16_t buffer_size) { ESP_LOGVV(TAG, "Write %d bytes to address %d", buffer_size, memaddr); - uint32_t size = buffer_size; + uint16_t size = buffer_size; uint8_t *p = data_to_write; // Check to make sure write is inside device range if (memaddr + buffer_size >= this->memory_size_bytes_) {