blue 4b432c6123 Phase 2: I2C control bus (S3 hub master <-> B/C slaves)
Wired control path so the S3 hub can set delay/volume on the source boards
and read their status, over an I2C bus (separate from the audio I2S bus).

- src/hub_proto.h: shared protocol — addresses (JBL 0x10, Cardo 0x11),
  commands SET_DELAY (u16), SET_VOLUME (u8), GET_STATUS (4-byte payload:
  connected, delay LE, volume).
- board_source.cpp (B/C): I2C slave on GPIO32/33 (addr via -DHUB_I2C_ADDR).
  Light onReceive/onRequest callbacks stash requests; loop() applies them
  (reuses set_delay; adds current_volume -> source.set_volume, NVS-persisted).
  Relay/FIFO/touch untouched.
- hub_s3.cpp: I2C master on Wire1 (GPIO15/16) — peripheral 1, since the
  CST816S touch owns peripheral 0. Polls both boards ~1Hz; LovyanGFX UI shows
  each speaker's connect/delay/volume with touch +/- zones that send commands.
- platformio.ini: -DHUB_I2C_ADDR per source env.

Written by two parallel sub-agents (one per side) against hub_proto.h; fixed
the Wire->Wire1 peripheral conflict. All three envs build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 10:44:45 -04:00
..