I wanted to put them in tasks for better performance, but that'n I started getting an error as `uart: uart_get_buffered_data_len(1339): uart driver error `
here is some code:
Code: Select all
Logger mainLog;
CanHandler can;
#ifdef LIN_ENABLED
#include "./LinHandler.h"
LinHandler lin;
#endif
TaskHandle_t Task1, Task2;
void setup() {
#ifdef DEBUG
delay(3000);
#endif
mainLog.init();
can.begin(mainLog);
#ifdef LIN_ENABLED
lin.begin(mainLog, true);
#endif
xTaskCreatePinnedToCore(linTask, "LinTAsk", 5000, NULL, 2, &Task1, 0);
xTaskCreatePinnedToCore(canTask, "canTask", 5000, NULL, 2, &Task2, 1);
// pinMode(YELLOW_LED, OUTPUT);
// digitalWrite(YELLOW_LED, LOW);
}
void linTask(void* parameter) {
for (;;) {
mainLog.writeSerial("Lin Loop\n");
lin.write();
delay(2000);
}
}
void canTask(void* parameter) {
for (;;) {
mainLog.writeSerial("Can Loop\n");
delay(5000);
}
}
Any ideas?