Newer
Older
TaskHandle_t restServerTask;
TaskHandle_t powerProcedureTask;
// Poll port expander to initialize the PINS struct.
PINS.last_triggered = millis();
PINS.stage = "";
PINS.ramping = false;
start = millis();
xTaskCreatePinnedToCore(webInterfaceLoop, "Web Interface", 10000, NULL, 1, &restServerTask, 0);
xTaskCreatePinnedToCore(mainLoop, "PowerProcedure Task", 10000, NULL, 1, &powerProcedureTask,
1);
void serialLoop() {
start = millis();
Serial.print(eth_connected ? "." : "-");
void webInterfaceLoop(void* pvParameters) {
Serial.print("Web loop running on core ");
Serial.println(xPortGetCoreID());
while (true) {
restServer.handleClient();
void mainLoop(void* pvParameters) {
Serial.print("main loop running on core ");
Serial.println(xPortGetCoreID());
while (true) {
isr_check_loop();
snmp.loop();
toggle_status_led();
serialLoop();
if (eth_connected) { // We may be triggered, but disconnected from the network.
powerOffCheckLoop();
}
}
}
void loop() {}