feat: ESP-NOW link, beat sync and control messages in the C++ driver

- espnow_link, ctrl_msg and beat_sync: the reliable link, envelopes and
  beat-synced timing.
- ctrl_msg: accept an envelope with the trailing save byte.
- patterns_frame() and espnow_link_poll() split out of their tasks, so the
  WebAssembly simulator can drive one frame and one link pass from a timer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-11-16 19:32:36 +13:00
1 parent 94e300f6ad
commit 24dd5ffb15
30 files changed
+2159 -158

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Beat frames from led-controller (ESP-NOW [4C][25][flags][idx u16][period u16][fire_in]). Only the tempo
* is used: beat-timed presets (tb) take their quarter-beat durations from it.
*/
#pragma once
#include <cstddef>
#include <cstdint>
/** @brief Note a received frame. Called from the ESP-NOW receive callback, so it does no more than store the values. */
void beat_on_frame(const uint8_t *data, size_t len);
/** @brief The controller's beat period in ms while beats are arriving, else 500 (120 BPM). */
uint32_t beat_period_ms(void);