MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / flush_rx

Method flush_rx

Marlin/src/gcode/queue.cpp:310–316  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

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

Callers 1

M303Method · 0.45

Calls 3

serial_data_availableFunction · 0.85
read_serialFunction · 0.85
availableMethod · 0.45

Tested by

no test coverage detected