Skip to content

Commit 6d04c5a

Browse files
committed
Implement a shorter feedWdt()
1 parent 87312ff commit 6d04c5a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Firmware/RTK_Surveyor/Tasks.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,17 @@ void btReadTask(void *e)
7878
if (settings.enableTaskReports == true)
7979
systemPrintf("SerialWriteTask High watermark: %d\r\n", uxTaskGetStackHighWaterMark(nullptr));
8080

81-
delay(1); // Poor man's way of feeding WDT. Required to prevent Priority 1 tasks from causing WDT reset
81+
feedWdt();
8282
taskYIELD();
8383
} // End while(true)
8484
}
8585

86+
// Normally a delay(1) will feed the WDT but if we don't want to wait that long, this feeds the WDT without delay
87+
void feedWdt()
88+
{
89+
vTaskDelay(1);
90+
}
91+
8692
//----------------------------------------------------------------------
8793
// The ESP32<->ZED-F9P serial connection is default 230,400bps to facilitate
8894
// 10Hz fix rate with PPP Logging Defaults (NMEAx5 + RXMx2) messages enabled.
@@ -181,7 +187,7 @@ void gnssReadTask(void *e)
181187
}
182188
}
183189

184-
delay(1);
190+
feedWdt();
185191
taskYIELD();
186192
}
187193
}

0 commit comments

Comments
 (0)