You've already forked torvalds-GuitarPedal
mirror of
https://github.com/torvalds/GuitarPedal.git
synced 2026-06-07 20:55:36 +00:00
.. and also make pot changes generate MIDI messages in USB device mode too, not just in USB host mode. That way you get bidirectional updates, so that the host can also see the device pot changes. And since the host would also want to see what the initial values are, add a STATE_DUMP_CC MIDI message, so that when you connect the two together they can synchronize from known state rather than having to always start from scratch. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
#include "pico.h"
|
|
|
|
#if defined(USB_MODE_HOST)
|
|
|
|
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_HOST
|
|
#define CFG_TUH_ENABLED 1
|
|
#define CFG_TUH_MIDI 1
|
|
#define CFG_TUH_DEVICE_MAX 1
|
|
#define CFG_TUH_ENUMERATION_BUFSIZE 512
|
|
|
|
#else // USB_MODE_DEVICE
|
|
|
|
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
|
|
#define CFG_TUD_ENABLED 1
|
|
#define CFG_TUD_AUDIO 1
|
|
#define CFG_TUD_MIDI 1
|
|
#define CFG_TUD_ENDPOINT0_SIZE 64
|
|
#define CFG_TUD_MIDI_RX_BUFSIZE 64
|
|
#define CFG_TUD_MIDI_TX_BUFSIZE 1024
|
|
#define CFG_TUD_MIDI_EP_BUFSIZE 64
|
|
|
|
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX (48 * 4 * 2)
|
|
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ (48 * 4 * 2 * 2)
|
|
#define CFG_TUD_AUDIO_ENABLE_EP_IN (1)
|
|
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX (4)
|
|
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_TX (32)
|
|
|
|
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SZ_MAX (48 * 4 * 2)
|
|
#define CFG_TUD_AUDIO_FUNC_1_EP_OUT_SW_BUF_SZ (48 * 4 * 2 * 2)
|
|
#define CFG_TUD_AUDIO_ENABLE_EP_OUT (1)
|
|
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_RX (4)
|
|
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX (32)
|
|
|
|
#endif // USB_MODE_xyz
|