mirror of
https://github.com/esphome/esphome.git
synced 2025-10-10 13:53:49 +01:00
Merge remote-tracking branch 'origin/esp8266_prefs' into memory_api
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#ifdef USE_ESP8266
|
#ifdef USE_ESP8266
|
||||||
|
|
||||||
#include <c_types.h>
|
#include <c_types.h>
|
||||||
|
#include <cinttypes>
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "spi_flash.h"
|
#include "spi_flash.h"
|
||||||
}
|
}
|
||||||
@@ -177,7 +178,7 @@ class ESP8266Preferences : public ESPPreferences {
|
|||||||
ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash) override {
|
ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash) override {
|
||||||
uint32_t length_words = bytes_to_words(length);
|
uint32_t length_words = bytes_to_words(length);
|
||||||
if (length_words > 255) {
|
if (length_words > 255) {
|
||||||
ESP_LOGE(TAG, "Preference too large: %u words > 255", length_words);
|
ESP_LOGE(TAG, "Preference too large: %" PRIu32 " words > 255", length_words);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if (in_flash) {
|
if (in_flash) {
|
||||||
|
Reference in New Issue
Block a user