Commit Graph
12 Commits
Author SHA1 Message Date
ash 9ba48b3f9c Roll back to 2d3a5a9 + CONFIG_BT_ENABLED + double-init patch 2026-07-01 07:06:45 +00:00
ash 01eaf9ce80 Fix enable-after-Arduino-init: always try to enable
Arduino framework inits BT controller but does NOT enable it.
Previous patch skipped both init AND enable when init returned
ESP_ERR_INVALID_STATE, leaving controller in init'd-but-not-enabled
state. Now we always try to enable regardless of init outcome.
2026-07-01 07:01:39 +00:00
ash c26116a7ef Set CONFIG_BT_ENABLED + re-add double-init patch
Without CONFIG_BT_ENABLED in sdkconfig.h, NimBLEDevice.cpp lines
are excluded by #if defined(CONFIG_BT_ENABLED) preprocessor guard,
making NimBLEDevice::init() a no-op. No BT controller init ever
occurs -> no RF calibration -> invisible BLE advertising.

With CONFIG_BT_ENABLED: Arduino framework pre-inits BT controller,
then NimBLEDevice::init() double-inits -> ESP_ERROR_CHECK abort.
Fix: patch NimBLEDevice.cpp to check return code and skip init if
already running.
2026-07-01 06:57:19 +00:00
ash 762500e227 Fix BLE crash: move all NimBLE calls to Core 0
Root cause: Arduino Core 3.x breaks cross-core NimBLE API calls.
Calling BLEMidiServer.controlChange() from loop() on Core 1 while
NimBLE host runs on Core 0 causes immediate crash.

Fix:
- Move ble_midi_transport.begin() to ble_init_task on Core 0
- All BLE MIDI sends use queue_cc() (cross-core safe flag setter)
- ble_midi_transport.update() processes queued sends on Core 0
- Pin NimBLE-Arduino to v1.4.3 (stable LTS for BLE MIDI)
- Keep CONFIG_BT_ENABLED out of sdkconfig.h (causes double-init)
2026-07-01 06:46:15 +00:00
ash 62d1e430d5 Switch from NimBLE-Arduino to ESP32-BLE-MIDI library
Replace direct NimBLE-Arduino dependency with max22/ESP32-BLE-MIDI
wrapper library (v0.3.2). Rewrite ble_midi_transport to use
BLEMidiServer API instead of raw NimBLEDevice calls.

Removes patch_nimble_device() from pre_build.py — no longer needed
since BT controller init is managed by the library internally.

The library uses NimBLE v1.4.1 internally and configures advertising
without setScanResponse() or setName(), which may resolve the invisible
BLE advertising issue on ESP32-S3.
2026-07-01 06:34:36 +00:00
ash 1517eda13e add CONFIG_BT_ENABLED to sdkconfig.h for proper BT RF calibration; patch NimBLEDevice.cpp to skip controller init if already done by Arduino framework 2026-07-01 06:11:28 +00:00
ash 8515963e07 pre_build.py: remove CONFIG_BT_ENABLED from sdkconfig patching (fixes BT pre-init conflict with USB) 2026-06-30 12:34:00 +00:00
ash 6a737bcee2 fix: patch nimconfig.h with #ifndef guards for ROLE defines to eliminate redefinition warnings 2026-06-30 07:15:14 +00:00
ash 323bc072ee fix: remove redundant ROLE defines from pre_build.py, suppress -Wno-macro-redefined 2026-06-30 07:09:15 +00:00
ash 2db09b76bf Add BT controller diagnostics, init BLE before USB MIDI 2026-06-30 06:43:58 +00:00
ash 1c1fc4d372 Remove heartbeat, relabel USB to JOC Midi 2026-06-30 03:46:31 +00:00
ash c02121cd09 Add pre-build script to patch core's pins_arduino.h with Launchpad X VID/PID
- pre_build.py patches framework-arduinoespressif32/variants/esp32s3_devkitc/pins_arduino.h
- Replaces USB_VID 0x303a -> 0x1235, USB_PID 0x1001 -> 0x0103
- Adds USB_MANUFACTURER/PRODUCT
2026-06-25 22:21:51 +00:00