|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!usb_configuration) return 0; |
|
|
if (!usb_configuration) return 0; |
|
|
while (size > 0) { |
|
|
while (size > 0) { |
|
|
|
|
|
tx_noautoflush = 1; |
|
|
transfer_t *xfer = tx_transfer + tx_head; |
|
|
transfer_t *xfer = tx_transfer + tx_head; |
|
|
int waiting=0; |
|
|
int waiting=0; |
|
|
uint32_t wait_begin_at=0; |
|
|
uint32_t wait_begin_at=0; |
|
|
|
|
|
|
|
|
transmit_previous_timeout = 0; |
|
|
transmit_previous_timeout = 0; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
tx_noautoflush = 0; |
|
|
if (!waiting) { |
|
|
if (!waiting) { |
|
|
wait_begin_at = systick_millis_count; |
|
|
wait_begin_at = systick_millis_count; |
|
|
waiting = 1; |
|
|
waiting = 1; |
|
|
|
|
|
|
|
|
size = 0; |
|
|
size = 0; |
|
|
timer_start_oneshot(); |
|
|
timer_start_oneshot(); |
|
|
} |
|
|
} |
|
|
|
|
|
tx_noautoflush = 0; |
|
|
} |
|
|
} |
|
|
return sent; |
|
|
return sent; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
tx_noautoflush = 1; |
|
|
tx_noautoflush = 1; |
|
|
tx_zero_pad(); |
|
|
tx_zero_pad(); |
|
|
tx_queue_transfer(); |
|
|
tx_queue_transfer(); |
|
|
|
|
|
timer_stop(); |
|
|
tx_noautoflush = 0; |
|
|
tx_noautoflush = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|