We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba34680 commit 1aa3465Copy full SHA for 1aa3465
Firmware/RTK_Everywhere/RTK_Everywhere.ino
@@ -895,6 +895,8 @@ typedef struct {
895
updateSemaphore = xSemaphoreCreateMutex();
896
if (xSemaphoreTake(updateSemaphore, 10 / portTICK_PERIOD_MS) == pdPASS)
897
{
898
+ // The semaphore prevents the race condition where timer is updated after
899
+ // millis() is read but before the subtraction. It prevents retVal from underflowing
900
retVal = millis() - timer;
901
xSemaphoreGive(updateSemaphore);
902
}
0 commit comments