fix(littlefs): Converted core disableWDT functions to bool (#10896)
* fix(littlefs): Converted core disableWDT functions to bool * Missed the returns on core1 * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
parent
15cbb1e857
commit
2fecc482b7
3 changed files with 14 additions and 8 deletions
|
|
@ -156,11 +156,13 @@ void enableCore0WDT() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void disableCore0WDT() {
|
bool disableCore0WDT() {
|
||||||
TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCore(0);
|
TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCore(0);
|
||||||
if (idle_0 == NULL || esp_task_wdt_delete(idle_0) != ESP_OK) {
|
if (idle_0 == NULL || esp_task_wdt_status(idle_0) || esp_task_wdt_delete(idle_0) != ESP_OK) {
|
||||||
log_e("Failed to remove Core 0 IDLE task from WDT");
|
log_e("Failed to remove Core 0 IDLE task from WDT");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_FREERTOS_UNICORE
|
#ifndef CONFIG_FREERTOS_UNICORE
|
||||||
|
|
@ -171,11 +173,13 @@ void enableCore1WDT() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void disableCore1WDT() {
|
bool disableCore1WDT() {
|
||||||
TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCore(1);
|
TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCore(1);
|
||||||
if (idle_1 == NULL || esp_task_wdt_delete(idle_1) != ESP_OK) {
|
if (idle_1 == NULL || esp_task_wdt_status(idle_1) || esp_task_wdt_delete(idle_1) != ESP_OK) {
|
||||||
log_e("Failed to remove Core 1 IDLE task from WDT");
|
log_e("Failed to remove Core 1 IDLE task from WDT");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,11 +121,11 @@ void feedLoopWDT();
|
||||||
|
|
||||||
//enable/disable WDT for the IDLE task on Core 0 (SYSTEM)
|
//enable/disable WDT for the IDLE task on Core 0 (SYSTEM)
|
||||||
void enableCore0WDT();
|
void enableCore0WDT();
|
||||||
void disableCore0WDT();
|
bool disableCore0WDT();
|
||||||
#ifndef CONFIG_FREERTOS_UNICORE
|
#ifndef CONFIG_FREERTOS_UNICORE
|
||||||
//enable/disable WDT for the IDLE task on Core 1 (Arduino)
|
//enable/disable WDT for the IDLE task on Core 1 (Arduino)
|
||||||
void enableCore1WDT();
|
void enableCore1WDT();
|
||||||
void disableCore1WDT();
|
bool disableCore1WDT();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore
|
//if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,11 @@ void LittleFSFS::end() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LittleFSFS::format() {
|
bool LittleFSFS::format() {
|
||||||
disableCore0WDT();
|
bool wdt_active = disableCore0WDT();
|
||||||
esp_err_t err = esp_littlefs_format(partitionLabel_);
|
esp_err_t err = esp_littlefs_format(partitionLabel_);
|
||||||
|
if (wdt_active) {
|
||||||
enableCore0WDT();
|
enableCore0WDT();
|
||||||
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
log_e("Formatting LittleFS failed! Error: %d", err);
|
log_e("Formatting LittleFS failed! Error: %d", err);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue