From c09278987ad49ce8d2a4cb345659a6d5ea10903d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 12 Jun 2026 09:59:01 +0000 Subject: midi: document that midi2_ump_word_count() must never return 0 The midi2_device/midi2_host tx packing loops advance by this count and no longer carry an explicit == 0 guard (removed in a749fe0). --- src/class/midi/midi.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/class/midi/midi.h b/src/class/midi/midi.h index 8121ec016..22e8e746f 100644 --- a/src/class/midi/midi.h +++ b/src/class/midi/midi.h @@ -189,7 +189,9 @@ TU_VERIFY_STATIC(sizeof(midi_desc_cs_endpoint_1jack_t) == 4+1, "size is not corr // MIDI 2.0 UMP Helpers //--------------------------------------------------------------------+ -// Return the number of 32-bit words for a UMP message given its Message Type +// Return the number of 32-bit words for a UMP message given its Message Type. +// Must never return 0: the tx packing loops in midi2_device/midi2_host advance +// by this count and would spin forever on a zero (they have no == 0 guard). static inline uint8_t midi2_ump_word_count(uint8_t mt) { switch (mt) { case 0x0: case 0x1: case 0x2: case 0x6: case 0x7: -- cgit v1.3.1