void empty_sendbuf() { do { serial_check(); } while (!serial_send_buffer_empty(USB_COMM)); }
void rob_wait_serial_send_buffer_empty_usb_comm () { vTaskSuspendAll(); { while (!serial_send_buffer_empty (USB_COMM)) { } } xTaskResumeAll(); }
void wait_for_sending_to_finish() { int32_t timeout = SERIAL_SEND_TIMEOUT; // need to have a timer here that can timeout // this helps in the case the serial port is not connected and // we could hang here until reset. while(!serial_send_buffer_empty(USB_COMM) && ( 0 < timeout-- ) ) { serial_check(); // USB_COMM port is always in SERIAL_CHECK mode } }
// wait_for_sending_to_finish: Waits for the bytes in the send buffer to // finish transmitting on USB_COMM. We must call this before modifying // send_buffer or trying to send more bytes, because otherwise we could // corrupt an existing transmission. void wait_for_sending_to_finish() { while(!serial_send_buffer_empty(USB_COMM)) serial_check(); // USB_COMM port is always in SERIAL_CHECK mode }