Restructure BikeAudio for PlatformIO while preserving the original
build specs from the .ino header:
- platform espressif32 @ ~6.6.0 -> ESP32 Arduino core 2.0.17
- board esp32dev (ESP32 DevKitC v4)
- board_build.partitions = huge_app.csv (Huge APP, required for BT stack)
- monitor_speed = 115200
Changes:
- BikeAudio.ino -> src/main.cpp (+ #include <Arduino.h>, print_status()
forward declaration; PlatformIO compiles .cpp directly and does not
auto-generate prototypes like the Arduino IDE).
- Add platformio.ini with pschatzmann ESP32-A2DP + arduino-audio-tools
pinned to exact commits (ESP32-A2DP 1.8.11, audio-tools 1.2.4) for
reproducible builds.
- Adapt three spots to the current library API (behavior preserved):
* RingBuffer<uint8_t>::read() -> bool read(T&)
* connection-state callbacks: drop esp_bd_addr_t arg
-> (esp_a2d_connection_state_t, void*)
* BluetoothA2DPSource::start(name, bool) -> start(name)
(auto-reconnect already configured via set_auto_reconnect(true))
Verified: pio run -e esp32dev succeeds.
RAM 14.5% (47.6 KB), Flash 42.0% (1.32 MB / 3 MB).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28 lines
1.1 KiB
INI
28 lines
1.1 KiB
INI
; PlatformIO project configuration for BikeAudio
|
|
; Converted from Arduino IDE sketch (BikeAudio.ino).
|
|
;
|
|
; Board: ESP32 Dev Module (DevKitC v4) -> esp32dev
|
|
; ESP32 Arduino core: 2.0.17 (provided by platform espressif32 @ ~6.6.0)
|
|
; Do NOT move to core 3.x — BT stack regression.
|
|
; Partition scheme: Huge APP (3MB No OTA / 1MB SPIFFS) -> huge_app.csv
|
|
; Serial monitor: 115200 baud
|
|
|
|
[env:esp32dev]
|
|
platform = espressif32 @ ~6.6.0
|
|
board = esp32dev
|
|
framework = arduino
|
|
|
|
; Huge APP partition table — required for the Bluetooth stack size.
|
|
board_build.partitions = huge_app.csv
|
|
|
|
monitor_speed = 115200
|
|
|
|
; Phil Schatzmann's libraries (referenced by git URL, as in the .ino header —
|
|
; not published in the PlatformIO registry under these names).
|
|
; ESP32-A2DP depends on arduino-audio-tools. Pinned to exact commits for
|
|
; reproducible builds (ESP32-A2DP 1.8.11, audio-tools 1.2.4); src/main.cpp
|
|
; was adapted to match this API surface.
|
|
lib_deps =
|
|
https://github.com/pschatzmann/ESP32-A2DP#42601717cd70d5300c9b519f3c2bf1d64d77ea2b
|
|
https://github.com/pschatzmann/arduino-audio-tools#64b64dcb9bde18a0a17766eeb6529c3a53d920a8
|