Commit Graph

81 Commits

Author SHA1 Message Date
hathach
d132044b75 add tuh_midi_mount_cb_t struct for tuh_midi_mount_cb()
change tuh_midi_rx/tx_cb() to have xferred_bytes
rename tuh_midi_get_num_rx/tx_cables() to tuh_midi_get_rx/tx_cable_count()
use default empty callback instead of weak null to be compatible with keil compiler
2025-02-24 16:05:31 +07:00
hathach
31a2696de7 - change signature of tuh_midi_mount/umount_cb()
- rename midi_stream_t to midi_driver_stream_t and move to midi.h (common for device and host)
2025-02-14 11:25:50 +07:00
hathach
85247e50dd clean up 2025-02-12 11:34:32 +07:00
hathach
87adc63226 Merge branch 'master' into fork/atoktoto/midihost
# Conflicts:
#	hw/bsp/rp2040/family.cmake
#	src/class/midi/midi.h
#	src/class/midi/midi_device.c
#	src/device/usbd_control.c
#	src/host/hcd.h
#	src/host/usbh.c
#	src/host/usbh.h
2025-02-12 11:28:16 +07:00
hathach
c09eedaf24 try to fix circleci with kinetis 2024-11-25 17:45:54 +07:00
hathach
85e54b0fc3 use TUD_EPBUF_DEF to declare buffer memory for midi 2024-11-21 19:36:15 +07:00
hathach
dbdc5a239c - move freertos_hooks to board.c
- add device/midi_test_freertos example
- update bth/dfu/midi device for cache line size
2024-11-21 17:49:38 +07:00
hathach
c3c0648456 add class driver deinit 2024-04-08 22:07:56 +07:00
hathach
ef49b93532 rename CFG_TUSB_MEM_SECTION to CFG_TUD_MEM_SECTION in device stack
CFG_TUD_MEM_SECTION is default to CFG_TUSB_MEM_SECTION
2023-07-24 15:46:21 +07:00
hathach
3623ba1884 fix trailing space and new line
temporarily disable codespell
2023-03-17 16:12:49 +07:00
Ha Thach
65ac519715 Merge pull request #1852 from silvergasp/mem_s
fix: Replace device calls to memcpy with tu_memcpy_s
2023-02-27 10:22:53 +07:00
hathach
e34aeb5cf6 minor clean up 2023-02-27 09:11:35 +07:00
rppicomidi
fde7577117 Fix issue 1909 2023-02-15 20:02:12 -08:00
Nathaniel Brough
2e47210c1a fix: Replace device calls to memcpy with tu_memcpy_s
Introduces a new function tu_memcpy_s, which is effectively
a backport of memcpy_s. The change also refactors calls
to memcpy over to the more secure tu_memcpy_s.
2023-01-13 15:20:32 -08:00
rppicomidi
3325e2613d Make USB MIDI device code allow a device with no Audio Control interface 2022-11-13 14:29:16 +01:00
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
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