diff options
| author | hathach <[email protected]> | 2024-11-21 17:49:38 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-11-21 17:49:38 +0700 |
| commit | dbdc5a239c42e96eeeb8759a121798fa9b3f39c3 (patch) | |
| tree | 0e5dadec079b5509ba5f9a5770092001b87f76b6 /src/class/midi | |
| parent | 5d77faa835ab7faf73a9981905e57e8d79920d2d (diff) | |
- move freertos_hooks to board.c
- add device/midi_test_freertos example
- update bth/dfu/midi device for cache line size
Diffstat (limited to 'src/class/midi')
| -rw-r--r-- | src/class/midi/midi_device.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/class/midi/midi_device.c b/src/class/midi/midi_device.c index 42905ab0d..7e30e5ea4 100644 --- a/src/class/midi/midi_device.c +++ b/src/class/midi/midi_device.c @@ -40,15 +40,13 @@ // MACRO CONSTANT TYPEDEF //--------------------------------------------------------------------+ -typedef struct -{ +typedef struct { uint8_t buffer[4]; uint8_t index; uint8_t total; -}midid_stream_t; +} midid_stream_t; -typedef struct -{ +typedef struct { uint8_t itf_num; uint8_t ep_in; uint8_t ep_out; @@ -72,9 +70,14 @@ typedef struct #endif // Endpoint Transfer buffer - CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_MIDI_EP_BUFSIZE]; - CFG_TUSB_MEM_ALIGN uint8_t epin_buf[CFG_TUD_MIDI_EP_BUFSIZE]; - + union { + CFG_TUD_MEM_ALIGN uint8_t epout_buf[CFG_TUD_MIDI_EP_BUFSIZE]; + TUD_DCACHE_PADDING; + }; + union { + CFG_TUD_MEM_ALIGN uint8_t epin_buf[CFG_TUD_MIDI_EP_BUFSIZE]; + TUD_DCACHE_PADDING; + }; } midid_interface_t; #define ITF_MEM_RESET_SIZE offsetof(midid_interface_t, rx_ff) @@ -84,8 +87,7 @@ typedef struct //--------------------------------------------------------------------+ CFG_TUD_MEM_SECTION midid_interface_t _midid_itf[CFG_TUD_MIDI]; -bool tud_midi_n_mounted (uint8_t itf) -{ +bool tud_midi_n_mounted (uint8_t itf) { midid_interface_t* midi = &_midid_itf[itf]; return midi->ep_in && midi->ep_out; } |
