mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 05:06:32 +00:00
Fix safeboot logging flood
This commit is contained in:
parent
2f59523416
commit
9314032f69
@ -70,6 +70,15 @@ size_t getArduinoLoopTaskStackSize(void) {
|
|||||||
|
|
||||||
#include <nvs.h>
|
#include <nvs.h>
|
||||||
|
|
||||||
|
bool NvmExists(const char *sNvsName) {
|
||||||
|
nvs_handle_t handle;
|
||||||
|
if (nvs_open(sNvsName, NVS_READONLY, &handle) != ESP_OK) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
nvs_close(handle);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool NvmLoad(const char *sNvsName, const char *sName, void *pSettings, unsigned nSettingsLen) {
|
bool NvmLoad(const char *sNvsName, const char *sName, void *pSettings, unsigned nSettingsLen) {
|
||||||
nvs_handle_t handle;
|
nvs_handle_t handle;
|
||||||
esp_err_t result = nvs_open(sNvsName, NVS_READONLY, &handle);
|
esp_err_t result = nvs_open(sNvsName, NVS_READONLY, &handle);
|
||||||
@ -178,7 +187,11 @@ void QPCWrite(const void *pSettings, unsigned nSettingsLen) {
|
|||||||
|
|
||||||
bool OtaFactoryRead(void) {
|
bool OtaFactoryRead(void) {
|
||||||
uint32_t pOtaLoader = 0;
|
uint32_t pOtaLoader = 0;
|
||||||
|
if (NvmExists("otal")) {
|
||||||
NvmLoad("otal", "otal", &pOtaLoader, sizeof(pOtaLoader));
|
NvmLoad("otal", "otal", &pOtaLoader, sizeof(pOtaLoader));
|
||||||
|
} else {
|
||||||
|
OtaFactoryWrite(pOtaLoader);
|
||||||
|
}
|
||||||
return pOtaLoader;
|
return pOtaLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user