diff options
| author | sakumisu <[email protected]> | 2024-05-14 21:34:50 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2024-05-14 21:34:50 +0800 |
| commit | a225ee383bd8de5ff51f86b2f43103355a53a577 (patch) | |
| tree | 2a13f4488584157d5b499987414bb17660935979 | |
| parent | 60747ce43573b86cb127af55bfab2a29f4129474 (diff) | |
update(demo/midi): add read api
| -rw-r--r-- | demo/midi_template.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/demo/midi_template.c b/demo/midi_template.c index e0a5d9e7..d09a9430 100644 --- a/demo/midi_template.c +++ b/demo/midi_template.c @@ -151,6 +151,9 @@ const uint8_t midi_descriptor[] = { 0x00 }; +USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t read_buffer[MIDI_EP_MPS]; +USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t write_buffer[MIDI_EP_MPS]; + static void usbd_event_handler(uint8_t busid, uint8_t event) { switch (event) { @@ -165,6 +168,7 @@ static void usbd_event_handler(uint8_t busid, uint8_t event) case USBD_EVENT_SUSPEND: break; case USBD_EVENT_CONFIGURED: + usbd_ep_start_read(busid, MIDI_OUT_EP, read_buffer, MIDI_EP_MPS); break; case USBD_EVENT_SET_REMOTE_WAKEUP: break; @@ -178,6 +182,7 @@ static void usbd_event_handler(uint8_t busid, uint8_t event) void usbd_midi_bulk_out(uint8_t busid, uint8_t ep, uint32_t nbytes) { + usbd_ep_start_read(busid, MIDI_OUT_EP, read_buffer, MIDI_EP_MPS); } void usbd_midi_bulk_in(uint8_t busid, uint8_t ep, uint32_t nbytes) |
