Browse Source

Use actual received length when receiving MIDI data

main
PaulStoffregen 7 years ago
parent
commit
9e50acd012
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      midi.cpp

+ 1
- 1
midi.cpp View File

print_hexbytes(transfer->buffer, rx_size); print_hexbytes(transfer->buffer, rx_size);
uint32_t head = rx_head; uint32_t head = rx_head;
uint32_t tail = rx_tail; uint32_t tail = rx_tail;
uint32_t len = rx_size >> 2; // TODO: use actual received length
uint32_t len = (transfer->length - ((transfer->qtd.token >> 16) & 0x7FFF)) >> 2;
for (uint32_t i=0; i < len; i++) { for (uint32_t i=0; i < len; i++) {
uint32_t msg = rx_buffer[i]; uint32_t msg = rx_buffer[i];
if (msg) { if (msg) {

Loading…
Cancel
Save