diff options
| author | Zixun LI <[email protected]> | 2026-05-07 12:42:42 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-05-07 12:42:42 +0200 |
| commit | d21fdd98f34241f52a01832e3c4133cd03a94d0a (patch) | |
| tree | f1363e85ea47d8cfb1b9b67df55be365ac6f737e /src | |
| parent | 9b1b781c3efb778d7e631d41e44d36c8ee435906 (diff) | |
| parent | 89c7075cdf8e72c6732496453f25fdc7ea82814b (diff) | |
Merge pull request #3614 from HakanL/midi-host-rx-bufsize-default-and-docs
midi host: document drain requirement of RX FIFO
Diffstat (limited to 'src')
| -rw-r--r-- | src/class/midi/midi_host.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/class/midi/midi_host.h b/src/class/midi/midi_host.h index b9ab0130d..8fdfd8966 100644 --- a/src/class/midi/midi_host.h +++ b/src/class/midi/midi_host.h @@ -150,6 +150,13 @@ uint32_t tuh_midi_stream_write(uint8_t idx, uint8_t cable_num, const uint8_t *p_ // Note that this function ignores the CIN field of the MIDI packet // because a number of commercial devices out there do not encode // it properly. +// +// NOTE: this function terminates when it encounters an event whose cable +// number differs from the one being returned. Applications should invoke +// it in a loop until it returns 0 (or until tuh_midi_read_available() +// returns 0) to guarantee the stream FIFO is fully drained per callback. +// Leaving bytes in the FIFO across callbacks can prevent subsequent bulk +// IN transfers from landing. uint32_t tuh_midi_stream_read(uint8_t idx, uint8_t *p_cable_num, uint8_t *p_buffer, uint16_t bufsize); #endif |
