From 9da144b40dbc866ddffcd4837279a7ecde3b42f5 Mon Sep 17 00:00:00 2001 From: Davy39 Date: Thu, 29 Feb 2024 09:29:08 +0100 Subject: [PATCH 1/4] esp32S3 tinyusb midi --- edrumulus.ino | 11 ++++++++++- platformio.ini | 12 +++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/edrumulus.ino b/edrumulus.ino index 564fdd9..f84a716 100644 --- a/edrumulus.ino +++ b/edrumulus.ino @@ -35,7 +35,13 @@ const int number_pads4 = 8; // example: do not use tom3 and shrink number of pad #ifdef USE_MIDI # ifdef ESP_PLATFORM # include -MIDI_CREATE_DEFAULT_INSTANCE(); +# ifdef USE_TINYUSB +# include + Adafruit_USBD_MIDI usb_midi; + MIDI_CREATE_INSTANCE(Adafruit_USBD_MIDI, usb_midi, MIDI); +# else + MIDI_CREATE_DEFAULT_INSTANCE(); +# endif # define MYMIDI MIDI # define MIDI_CONTROL_CHANGE_TYPE midi::ControlChange # define MIDI_SEND_AFTER_TOUCH sendAfterTouch @@ -76,6 +82,9 @@ void setup() number_pads = min ( number_pads, 7 ); // only max. 7 pads are supported for ESP32 serial debug plotting #endif #ifdef USE_MIDI +# ifdef USE_TINYUSB + TinyUSBDevice.setProductDescriptor("Edrumulus"); +# endif MYMIDI.begin(); #endif #ifdef MIDI_SERIAL diff --git a/platformio.ini b/platformio.ini index 600d8ce..33a94c3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -46,5 +46,15 @@ platform = espressif32 board = az-delivery-devkit-v4 [env:esp32-s3-devkitc-1] -platform = espressif32 +platform = espressif32@^6.4.0 board = esp32-s3-devkitc-1 +build_unflags = -DARDUINO_USB_MODE=1 +build_flags = + -DUSE_TINYUSB=1 + -DARDUINO_USB_MODE=0 + -DARDUINO_USB_CDC_ON_BOOT=1 + '-DCFG_TUSB_CONFIG_FILE="~/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/arduino_tinyusb/include/tusb_config.h"' +lib_archive = no +lib_deps = + fortyseveneffects/MIDI Library@^5.0.2 + adafruit/Adafruit TinyUSB Library@3.1.0 From 395d90e3f00a3216fac27ed0626770cd31c48b17 Mon Sep 17 00:00:00 2001 From: Davy39 Date: Thu, 29 Feb 2024 13:50:56 +0100 Subject: [PATCH 2/4] generic CFG_TUSB_CONFIG_FILE path --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 33a94c3..f2e8ff8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -53,8 +53,8 @@ build_flags = -DUSE_TINYUSB=1 -DARDUINO_USB_MODE=0 -DARDUINO_USB_CDC_ON_BOOT=1 - '-DCFG_TUSB_CONFIG_FILE="~/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/arduino_tinyusb/include/tusb_config.h"' + '-DCFG_TUSB_CONFIG_FILE="${platformio.core_dir}/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/arduino_tinyusb/include/tusb_config.h"' lib_archive = no lib_deps = - fortyseveneffects/MIDI Library@^5.0.2 - adafruit/Adafruit TinyUSB Library@3.1.0 + fortyseveneffects/MIDI Library@^5.0.2 + adafruit/Adafruit TinyUSB Library@3.1.0 From 47e969935f9ccc22de6331afbedd29efa974145e Mon Sep 17 00:00:00 2001 From: Davy Date: Sun, 3 Mar 2024 20:33:04 +0100 Subject: [PATCH 3/4] espressif32 version 6.5.0 --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index f2e8ff8..287f33c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -46,7 +46,7 @@ platform = espressif32 board = az-delivery-devkit-v4 [env:esp32-s3-devkitc-1] -platform = espressif32@^6.4.0 +platform = espressif32@^6.5.0 board = esp32-s3-devkitc-1 build_unflags = -DARDUINO_USB_MODE=1 build_flags = @@ -56,5 +56,5 @@ build_flags = '-DCFG_TUSB_CONFIG_FILE="${platformio.core_dir}/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/arduino_tinyusb/include/tusb_config.h"' lib_archive = no lib_deps = - fortyseveneffects/MIDI Library@^5.0.2 - adafruit/Adafruit TinyUSB Library@3.1.0 + fortyseveneffects/MIDI Library@^5.0.2 + adafruit/Adafruit TinyUSB Library@^3.1.0 From 6fa5d4c7717f2c03cf638594482976f2ce3aed6a Mon Sep 17 00:00:00 2001 From: Davy Date: Wed, 6 Mar 2024 08:49:24 +0100 Subject: [PATCH 4/4] Use latest realeases --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 287f33c..e4665b5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -46,7 +46,7 @@ platform = espressif32 board = az-delivery-devkit-v4 [env:esp32-s3-devkitc-1] -platform = espressif32@^6.5.0 +platform = espressif32 board = esp32-s3-devkitc-1 build_unflags = -DARDUINO_USB_MODE=1 build_flags = @@ -56,5 +56,5 @@ build_flags = '-DCFG_TUSB_CONFIG_FILE="${platformio.core_dir}/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/arduino_tinyusb/include/tusb_config.h"' lib_archive = no lib_deps = - fortyseveneffects/MIDI Library@^5.0.2 - adafruit/Adafruit TinyUSB Library@^3.1.0 + fortyseveneffects/MIDI Library + adafruit/Adafruit TinyUSB Library