File tree 3 files changed +10
-8
lines changed
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -156,11 +156,13 @@ void enableCore0WDT() {
156
156
}
157
157
}
158
158
159
- void disableCore0WDT () {
159
+ bool disableCore0WDT () {
160
160
TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCore (0 );
161
- if (idle_0 == NULL || esp_task_wdt_delete (idle_0 ) != ESP_OK ) {
161
+ if (idle_0 == NULL || esp_task_wdt_status ( idle_0 ) || esp_task_wdt_delete (idle_0 ) != ESP_OK ) {
162
162
log_e ("Failed to remove Core 0 IDLE task from WDT" );
163
+ return false;
163
164
}
165
+ return true;
164
166
}
165
167
166
168
#ifndef CONFIG_FREERTOS_UNICORE
@@ -171,9 +173,9 @@ void enableCore1WDT() {
171
173
}
172
174
}
173
175
174
- void disableCore1WDT () {
176
+ bool disableCore1WDT () {
175
177
TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCore (1 );
176
- if (idle_1 == NULL || esp_task_wdt_delete (idle_1 ) != ESP_OK ) {
178
+ if (idle_1 == NULL || esp_task_wdt_status ( idle_1 ) || esp_task_wdt_delete (idle_1 ) != ESP_OK ) {
177
179
log_e ("Failed to remove Core 1 IDLE task from WDT" );
178
180
}
179
181
}
Original file line number Diff line number Diff line change @@ -121,11 +121,11 @@ void feedLoopWDT();
121
121
122
122
//enable/disable WDT for the IDLE task on Core 0 (SYSTEM)
123
123
void enableCore0WDT ();
124
- void disableCore0WDT ();
124
+ bool disableCore0WDT ();
125
125
#ifndef CONFIG_FREERTOS_UNICORE
126
126
//enable/disable WDT for the IDLE task on Core 1 (Arduino)
127
127
void enableCore1WDT ();
128
- void disableCore1WDT ();
128
+ bool disableCore1WDT ();
129
129
#endif
130
130
131
131
//if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore
Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ void LittleFSFS::end() {
95
95
}
96
96
97
97
bool LittleFSFS::format () {
98
- disableCore0WDT ();
98
+ bool wdt_active = disableCore0WDT ();
99
99
esp_err_t err = esp_littlefs_format (partitionLabel_);
100
- enableCore0WDT ();
100
+ if (wdt_active) enableCore0WDT ();
101
101
if (err) {
102
102
log_e (" Formatting LittleFS failed! Error: %d" , err);
103
103
return false ;
You can’t perform that action at this time.
0 commit comments