mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
Update midi_device.c
Fix a bug in writing SysEx messages. At the start of a new USB packet (4 bytes), while in the middle of a SysEx, the code mistakenly set the buffer length to 4, not the target length. As a consequence, the 3rd and 4th bytes from the last packet were included, after every byte of the SysEx after the first packet of three. The fix is simple, as it was just a typo, as can bee seen from the other branches in the same section of if/else statements: At the start of a new packet, the code should set up the target length... the buffer length should be left at 2 (as set on line 180).
This commit is contained in:
parent
3d393df2d0
commit
3b0216d3bf
@ -183,7 +183,7 @@ uint32_t tud_midi_n_write(uint8_t itf, uint8_t jack_id, uint8_t const* buffer, u
|
||||
if (data == 0xf7) {
|
||||
midi->write_buffer[0] = 0x5;
|
||||
} else {
|
||||
midi->write_buffer_length = 4;
|
||||
midi->write_target_length = 4;
|
||||
}
|
||||
} else if ((msg >= 0x8 && msg <= 0xB) || msg == 0xE) {
|
||||
midi->write_buffer[0] = jack_id << 4 | msg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user