Skip to content

Commit

Permalink
Move network tasks to other core, if present
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Jan 6, 2024
1 parent 465b433 commit 69bcd77
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sensor/src/sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,15 @@ void setPixel(uint8_t color) {
#endif
}

void backgroundLoop();

void backgroundTask(void *pvParameters) {
while(true) {
backgroundLoop();
// vTaskDelay(pdMS_TO_TICKS(200)); // Delay for 200 milliseconds
}
}

boolean isConnected = false;
void setup() {
Serial.begin(115200);
Expand Down Expand Up @@ -637,13 +646,6 @@ void backgroundLoop() {
}
}

void backgroundTask(void *pvParameters) {
while(true) {
backgroundLoop();
// vTaskDelay(pdMS_TO_TICKS(200)); // Delay for 200 milliseconds
}
}

void loop() {
bool panelSelect = digitalRead(PIN_5_PIN_DEF); // LOW when we are meant to read data
readSerial(panelSelect);
Expand Down

0 comments on commit 69bcd77

Please sign in to comment.