From 955ce0b6755464920260180e3c87bbf0f8858c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Poczkodi?= Date: Sun, 10 Nov 2024 08:12:30 +0100 Subject: [PATCH] PROGMEM memory read needs special care on 8266 apparently, now it does not crash --- esphome/components/store_yaml/decompressor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/store_yaml/decompressor.cpp b/esphome/components/store_yaml/decompressor.cpp index ef81526b46..a7b94fcc4c 100644 --- a/esphome/components/store_yaml/decompressor.cpp +++ b/esphome/components/store_yaml/decompressor.cpp @@ -31,7 +31,7 @@ uint32_t Decompressor::get_bits_(size_t bits) { } while (this->size_ < bits) { - this->buff_ = (this->buff_ << 8) | this->data_ptr_[this->pos_++]; + this->buff_ = (this->buff_ << 8) | pgm_read_byte(&this->data_ptr_[this->pos_++]); this->size_ += 8; } @@ -106,7 +106,7 @@ bool RowDecompressor::get_row(std::string &row) { return true; } - if (this->is_eof() && this->yaml_.size() > 0) { + if (this->is_eof() && !this->yaml_.empty()) { // no new line at the end of the file row = this->yaml_; this->yaml_.clear();