This cut down some timings in yield.main
@@ -181,6 +181,7 @@ public: | |||
void enableSerialEvents(); | |||
void disableSerialEvents(); | |||
static void processSerialEvents(); | |||
static uint8_t serial_event_handlers_active; | |||
using Print::write; | |||
// Only overwrite some of the virtualWrite functions if we are going to optimize them over Print version | |||
@@ -236,7 +237,6 @@ private: | |||
#else | |||
static SerialEventCheckingFunctionPointer serial_event_handler_checks[7]; | |||
#endif | |||
static uint8_t serial_event_handlers_active; | |||
@@ -39,12 +39,14 @@ void yield(void) | |||
if (running) return; // TODO: does this need to be atomic? | |||
running = 1; | |||
// USB Serail - Add hack to minimize impact... | |||
if (usb_enable_serial_event_processing && Serial.available()) serialEvent(); | |||
// Current workaround until integrate with EventResponder. | |||
HardwareSerial::processSerialEvents(); | |||
if (HardwareSerial::serial_event_handlers_active) HardwareSerial::processSerialEvents(); | |||
running = 0; | |||
EventResponder::runFromYield(); | |||
}; |