Register / Login | Desktop view |
// tasks to run on core 1
taskManager.scheduleFixedRate(FAST_UPDATE_INTERVAL, [] {
updateRelays();
}, TIME_MILLIS);
taskManager.scheduleFixedRate(ANALOG_ALARM_UPDATE_INTERVAL, [] {
processAnalogAlarms();
}, TIME_MILLIS);
taskManager.scheduleFixedRate(LED_UPDATE_INTERVAL, [] {
updateLEDs();
}, TIME_MILLIS);
// Task to run on core 0
taskManager.scheduleFixedRate(100, [] {
if (MySUI.checkForUser(0)) {
/* Now we keep handling the serial user's
** requests until they exit or timeout.
*/
if (MySUI.userPresent()) {
// actually respond to requests, using
for(int i=1; i <=100; i++){
MySUI.handleRequests();
}
}
} /* end if we had a user on the serial line */
}, TIME_MILLIS);
TaskManager taskManagerThread2;
void myThreadProc() {
while(systemIsRunning) {
taskManagerThread2.runLoop();
}
}
taskManagerThread2.scheduleFixedRate(1000, [] {
if(needToSignalOtherTaskManager) {
taskManager.execute(taskToRunOnOtherTaskManager);
});