void serialEventRun(void) { if (Serial.available()) serialEvent(); if (Serial1.available()) serialEvent1(); if (Serial2.available()) serialEvent2(); if (Serial3.available()) serialEvent3(); if (Serial4.available()) serialEvent4(); if (Serial5.available()) serialEvent5(); if (Serial6.available()) serialEvent6(); if (Serial7.available()) serialEvent7(); }
void yield(void) { static uint8_t running=0; if (running) return; // TODO: does this need to be atomic? running = 1; if (Serial.available()) serialEvent(); if (Serial1.available()) serialEvent1(); if (Serial2.available()) serialEvent2(); if (Serial3.available()) serialEvent3(); #ifdef HAS_KINETISK_UART3 if (Serial4.available()) serialEvent4(); #endif #ifdef HAS_KINETISK_UART4 if (Serial5.available()) serialEvent5(); #endif #if defined(HAS_KINETISK_UART5) || defined (HAS_KINETISK_LPUART0) if (Serial6.available()) serialEvent6(); #endif running = 0; };