Browse Source

Don't allow seremu auto flush while adding to transmit buffer

teensy4-core
PaulStoffregen 4 years ago
parent
commit
c5814d9c00
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      teensy4/usb_seremu.c

+ 4
- 0
teensy4/usb_seremu.c View File



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;
} }



Loading…
Cancel
Save