|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
-
-
- #include <Arduino.h>
- #include "EventResponder.h"
-
- void yield(void) __attribute__ ((weak));
- void yield(void)
- {
- static uint8_t running=0;
-
- if (running) return;
- running = 1;
- if (Serial.available()) serialEvent();
- #if defined(USB_DUAL_SERIAL) || defined(USB_TRIPLE_SERIAL)
- if (SerialA.available()) serialEventA();
- #endif
- #ifdef USB_TRIPLE_SERIAL
- if (SerialB.available()) serialEventB();
- #endif
- 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;
- EventResponder::runFromYield();
- };
|