mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
Corrected buffer size and made consistant
This commit is contained in:
parent
9e6b5470a4
commit
e56b189523
1 changed files with 2 additions and 2 deletions
|
@ -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_) {
|
||||
|
|
Loading…
Reference in a new issue