Commit Graph

75 Commits

Author SHA1 Message Date
hathach b9dc9dbd78
fix most warnings with rp2040 -wconversion 2022-06-27 11:50:17 +07:00
hathach 8b9cf152a0 rhport argument in usbd_ API() is not used (always use the initialized port)
remove the usage of TUD_OPT_RHPORT in class driver
2022-06-02 16:51:17 +07:00
hathach d10326cb4e rename TUSB_OPT_DEVICE_ENABLED to CFG_TUD_ENABLED
TUSB_OPT_DEVICE_ENABLED still usable for backward compatible
2022-02-25 18:35:21 +07:00
Tod Kurt 9f014b059a properly handle Program Change and Channel Aftertouch messages 2021-10-25 00:07:59 -07:00
hathach a7dd5b616c fix -Wnull-dereference in midi_device 2021-10-18 01:11:27 +07:00
hathach 794bbd7177 fix warning 2021-08-02 18:58:27 +07:00
hathach 98e4ba6a12 correct midi available with already stream read 2021-08-02 18:55:12 +07:00
hathach ebd98e1a18 fix midi stream write return value (off by 1) 2021-07-13 21:09:23 +07:00
hathach 9323a9d094 fix issue when calling midi API when not enumerated yet 2021-06-21 00:00:46 +07:00
hathach 9736e54734
include clean up 2021-05-27 17:40:39 +07:00
Reinhard Panhuber a1efd41649 Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer 2021-04-03 09:50:08 +02:00
hathach 48bb96f507 correct midi stream read behavior to read until user buffer is full or no more data from usb fifo 2021-04-02 15:08:36 +07:00
hathach 350eb11277 refactor midi read buffer to stream 2021-04-02 14:52:44 +07:00
hathach da59c4ad44 rename midi write()/read() to stream_write() stream_read()
also add deprecated for warning and rename hint
2021-04-02 14:43:38 +07:00
hathach 99b78e62f2 removed tud_midi_write24() 2021-04-02 14:34:13 +07:00
hathach 08fe16840f refactor midi write into stream 2021-04-02 14:26:55 +07:00
hathach 6b04efd443 refactor midi stream read 2021-04-02 13:55:51 +07:00
hathach 080b14b292 fix midi tx fifo overflow cause data corruption
rename
2021-04-02 13:26:55 +07:00
hathach 949ff791e0 code format 2021-03-31 00:34:09 +07:00
hathach b05084e406 remove tud_midi_read_flush() 2021-03-30 23:56:55 +07:00
hathach c5aa661c89 rename tud_midi_receive/send to tud_midi_packet_read/write 2021-03-30 23:54:17 +07:00
hathach 794083b647 Merge branch 'master' into edpt_ISO_xfer 2021-03-10 17:10:49 +07:00
Reinhard Panhuber 7e56f46957 Extend FIFO mutex to use separate write and read mutexes.
Adjust all USB drivers using FIFO and mutexes.
2021-03-04 13:52:14 +01:00
hathach 33a29c9e4c add midi comment 2021-03-04 19:30:08 +07:00
hathach aa85099171 fix tud_midi_write24 typo
rename jack_id to cable_num in function argument
2021-02-19 10:51:47 +07:00
Ha Thach be1bd74b4b
Merge pull request #618 from homeodor/master
A CDC-like blocking behaviour for MIDI, incl. SysEx
2021-02-06 12:30:28 +07:00
Alexander Golovanov 2a34be2eb0
A CDC-like blocking behaviour 2021-01-30 04:11:08 +03:00
Michael Himing c4f7ea09f1 Fix midi sysex sending bug 2021-01-28 20:31:11 +11:00
hathach 8813f9d3b8 clean up 2020-11-20 15:33:05 +07:00
hathach e2abb089f4 migrate midi device to new control xfer cb 2020-11-20 15:30:36 +07:00
Reinhard Panhuber da1c3c226b Change AUDIO_PROTOCOL_V1 to AUDIO_FUNC_PROTOCOL_CODE_UNDEF in midi.c.
The USB specification does not define any AUDIO_PROTOCOL_V1!
2020-09-28 22:44:09 +02:00
Ha Thach 8b2c822557
Merge pull request #512 from mzero/fix-midi-sysex
Fix a bug in writing SysEx messages.
2020-09-23 11:23:53 +07:00
Mark Lentczner 3b0216d3bf
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).
2020-09-13 15:05:18 -07:00
hathach 801f8b5b38 update claim edpt for hid and midi 2020-09-10 23:32:08 +07:00
hathach 2d8787cdeb fix typo 2020-08-24 15:29:34 +07:00
hathach a1b7e767af improve midi
- fix #436 tud_midi_rx_cb() not invoked
- fix xfer_cb() not handle ep in
- add ZLP if needed
2020-08-24 14:31:46 +07:00
hathach 881025afdc add new name warning to cdc and midi (skip msc, hid warning for now) 2020-07-17 23:01:39 +07:00
hathach fea6fb73a1
add fs & hs config for cdc_msc_freertos, midi_test, msc_dual_lun 2020-07-16 13:04:10 +07:00
hathach 10cd3f24bf initial transfer failed in open() shouldn't cause the driver open to fail. 2020-05-28 13:48:02 +07:00
hathach 8f560bf275
update midi open() 2020-05-28 11:41:37 +07:00
hathach 017c95037f add usbd edpt open
- RTT mode is blocking to prevent log lost
- Improve logging message
2020-04-26 14:51:44 +07:00
hathach c59fa77427 Revert "Merge pull request #359 from versioduo/midi-flow-control"
This reverts commit 1d33aa9b6f, reversing
changes made to 718db7e536.
2020-04-23 23:25:20 +07:00
hathach 3b83813f01 clean up 2020-04-22 00:29:51 +07:00
Kay Sievers a0598ef369 MIDI - Add flow control to incoming packet stream
Larger SysEx transfers get corrupted by incoming packets.

This changes the FIFOs not to overwrite their data. MIDI should not be
a transport that drops packets. A potentially blocking device is easier
to detect and handle than a device that silently corrupts the packet
stream at random overflows, especially when SysEx messages are involved.
2020-04-19 11:44:15 +02:00
Ha Thach f9262007ac
Merge pull request #258 from versioduo/midi-packets
MIDI packet interface
2020-04-19 15:43:07 +07:00
hathach bae570f7c7
tested with midi 2020-04-15 10:30:07 +07:00
Kay Sievers 73228a67ef MIDI: Add packet interface
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.
2020-01-16 10:11:37 +01:00
hathach 05fd02194e correct return value of midid_xfer_cb 2020-01-16 11:12:26 +07:00
Nathan Conrad 25c1bea782 Normalize line endings 2020-01-15 14:47:43 -05:00
Peter Lawrence ff0e7d2bed implement multiple interfaces support 2019-12-28 14:27:32 -06:00