- 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>
17 lines
589 B
C++
17 lines
589 B
C++
/*
|
|
* 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);
|