* arduinoststm32's USB receive buffer is not well behaved when the buffer overflows * * This can happen when the host programs (such as Pronterface) automatically * send M105 temperature requests. */
| 308 | * send M105 temperature requests. |
| 309 | */ |
| 310 | void GCodeQueue::flush_rx() { |
| 311 | // Flush receive buffer |
| 312 | for (uint8_t p = 0; p < NUM_SERIAL; ++p) { |
| 313 | if (!serial_data_available(p)) continue; // No data for this port? Skip. |
| 314 | while (SERIAL_IMPL.available(p)) (void)read_serial(p); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | #endif // (ARDUINO_ARCH_STM32F4 || ARDUINO_ARCH_STM32) && USBCON |
| 319 |
no test coverage detected