forked from Akcelerometry_drgania_WMT/PI_mikrokontroler
Fix IDLE0 starvation with vTaskDelay(1)
This commit is contained in:
@@ -60,28 +60,35 @@ void UploadManager::processPendingUploads() {
|
||||
File dir = SD.open(path);
|
||||
if (!dir || !dir.isDirectory()) {
|
||||
if(dir) dir.close();
|
||||
vTaskDelay(1); // yield do IDLE0 między katalogami
|
||||
continue;
|
||||
}
|
||||
|
||||
for (File f = dir.openNextFile(); f; f = dir.openNextFile()) {
|
||||
vTaskDelay(1); // yield do IDLE0 przy każdym pliku — zapobiega głodzeniu WDT
|
||||
if (f.isDirectory()) { f.close(); continue; }
|
||||
String childPath = String(f.name());
|
||||
if (!childPath.startsWith("/")) {
|
||||
childPath = path + "/" + childPath;
|
||||
}
|
||||
|
||||
if (childPath.endsWith(".wmt")) {
|
||||
if (childPath == capture_.getCurrentCapturePath()) continue;
|
||||
ESP_LOGI(TAG_UPLOAD, "Found pending file: %s", childPath.c_str());
|
||||
uploadFile(childPath);
|
||||
delay(1000);
|
||||
}
|
||||
f.close();
|
||||
|
||||
// Pomijamy pliki .upl (już wgrane) i inne rozszerzenia
|
||||
if (!childPath.endsWith(".wmt")) continue;
|
||||
|
||||
// Pomijamy plik aktualnie zapisywany przez pomiar
|
||||
if (childPath == capture_.getCurrentCapturePath()) continue;
|
||||
|
||||
Watchdog::feed();
|
||||
if (WiFi.status() != WL_CONNECTED) {
|
||||
dir.close();
|
||||
return;
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG_UPLOAD, "Found pending file: %s", childPath.c_str());
|
||||
uploadFile(childPath);
|
||||
// Krótka przerwa po uploaderze — pozwala IDLE0 na reset WDT
|
||||
vTaskDelay(pdMS_TO_TICKS(200));
|
||||
}
|
||||
dir.close();
|
||||
}
|
||||
|
||||
@@ -60,28 +60,35 @@ void UploadManager::processPendingUploads() {
|
||||
File dir = SD.open(path);
|
||||
if (!dir || !dir.isDirectory()) {
|
||||
if(dir) dir.close();
|
||||
vTaskDelay(1); // yield do IDLE0 między katalogami
|
||||
continue;
|
||||
}
|
||||
|
||||
for (File f = dir.openNextFile(); f; f = dir.openNextFile()) {
|
||||
vTaskDelay(1); // yield do IDLE0 przy każdym pliku — zapobiega głodzeniu WDT
|
||||
if (f.isDirectory()) { f.close(); continue; }
|
||||
String childPath = String(f.name());
|
||||
if (!childPath.startsWith("/")) {
|
||||
childPath = path + "/" + childPath;
|
||||
}
|
||||
|
||||
if (childPath.endsWith(".wmt")) {
|
||||
if (childPath == capture_.getCurrentCapturePath()) continue;
|
||||
ESP_LOGI(TAG_UPLOAD, "Found pending file: %s", childPath.c_str());
|
||||
uploadFile(childPath);
|
||||
delay(1000);
|
||||
}
|
||||
f.close();
|
||||
|
||||
// Pomijamy pliki .upl (już wgrane) i inne rozszerzenia
|
||||
if (!childPath.endsWith(".wmt")) continue;
|
||||
|
||||
// Pomijamy plik aktualnie zapisywany przez pomiar
|
||||
if (childPath == capture_.getCurrentCapturePath()) continue;
|
||||
|
||||
Watchdog::feed();
|
||||
if (WiFi.status() != WL_CONNECTED) {
|
||||
dir.close();
|
||||
return;
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG_UPLOAD, "Found pending file: %s", childPath.c_str());
|
||||
uploadFile(childPath);
|
||||
// Krótka przerwa po uploaderze — pozwala IDLE0 na reset WDT
|
||||
vTaskDelay(pdMS_TO_TICKS(200));
|
||||
}
|
||||
dir.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user