Added invalidation to the main loop

This commit is contained in:
Kevin Townsend authored and GitHub committed 2017-08-01 15:31:53 +02:00
1 parent c9d0359d65
commit f41b2b59e4
1 file changed
+22 -1
@@ -649,6 +649,27 @@ void loop()
{
/* Toggle red LED every second */
digitalToggle(LED_RED);
/* Invalidate old results once per second in addition
* to the invalidation in the callback handler. */
/* ToDo: Update to use a mutex or semaphore since this
* can lead to list corruption as-is if the scann results
* callback is fired in the middle of the invalidation
* function. */
if (invalidateRecords())
{
/* The list was updated, print the new values */
printRecordList();
Serial.println("");
/* Display the device list on the TFT if available */
#if ENABLE_TFT
renderResultsToTFT();
#endif
/* Display the device list on the OLED if available */
#if ENABLE_OLED
renderResultsToOLED();
#endif
}
delay(1000);
}