| Age | Commit message (Collapse) | Author |
|
* license: use SPDX identifiers for src/ headers
Replace the full ~20-line MIT license boilerplate on every src/ file with a
two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following
the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500
lines of duplicated boilerplate.
|
|
for clarity and flexibility
|
|
The existing tud_midi_n_stream_read() accepts a cable_num parameter but
ignores it — all cables share a single FIFO and stream parser state, so
data from different virtual cables is silently mixed together.
Add tud_midi_n_demux_stream_read() which returns the cable number of the
data that was actually read. It peeks at each USB-MIDI event packet
header before consuming it and stops when the next packet belongs to a
different cable, allowing callers to dispatch per-cable without losing
data.
Implementation details:
- Mirrors the host-side tuh_midi_stream_read() approach: tu_edpt_stream_peek
for cable inspection, CIN-based byte count (USB MIDI 1.0 Table 4-1),
leftover handling via existing midi_driver_stream_t
- *p_cable_num initialized to 0xff sentinel so callers can detect
"no data" even when return value is 0
- Cable-change check (total_read > 0 guard) covers both leftover-originated
reads and freshly consumed packets
- TU_VERIFY uses explicit != NULL comparisons, consistent with codebase style
- Note: shares stream->buffer with tud_midi_n_stream_read(); do not mix
calls on the same interface
- Adds single-interface convenience wrapper tud_midi_demux_stream_read()
Closes #1838
|
|
also add tud_midi_n_packet_write/read_n()
|
|
fix compiling with nuc family
|
|
Signed-off-by: HiFiPhile <[email protected]>
|
|
|
|
temporarily disable codespell
|
|
|
|
also add deprecated for warning and rename hint
|
|
|
|
rename
|
|
|
|
|
|
rename jack_id to cable_num in function argument
|
|
|
|
- fix #436 tud_midi_rx_cb() not invoked
- fix xfer_cb() not handle ep in
- add ZLP if needed
|
|
|
|
|
|
|
|
This changes the internal buffering to the raw 4-byte messages. The
conversion of the messages to a byte-stream moved to the read/write
methods.
It adds a raw packet interface to send and retrieve the raw 4-byte
USB MIDI message:
static inline bool tud_midi_receive (uint8_t packet[4]);
static inline bool tud_midi_send (uint8_t const packet[4]);
MIDI USB packets carry virtual cable/wire/plug data in the packet header,
which cannot be exported in the byte-stream interface. The raw packet
interface allows to send and and receive the complete USB message.
|
|
|
|
|
|
control_complete
|
|
|
|
tud_midi_mounted()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It also introduces a txbuffer which copies data into it but passes
the buffer straight to the USB rather than another copy.
|