feat: sequences v2, bridges, and sim-controller
Rework sequences (engine, seqplay, envelope, API, web UI), add bridge support, add the host sim-controller and rig simulation tests, and update docs, presets and project tooling config. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d664026ee5
commit
2543673bd8
68 files changed
+5761
-460
No files matched your search
+4
-5
@@ -4,7 +4,6 @@
|
||||
#include <string.h>
|
||||
#include "esp_check.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_now.h"
|
||||
#include "esp_random.h"
|
||||
#include "esp_timer.h"
|
||||
#include "bench.h"
|
||||
@@ -292,7 +291,7 @@ void rel_set_announce_cb(rel_announce_cb_t cb)
|
||||
s_announce_cb = cb;
|
||||
}
|
||||
|
||||
static void recv_cb(const esp_now_recv_info_t *info, const uint8_t *data, int len)
|
||||
static void recv_cb(const uint8_t *src_mac, const uint8_t *data, int len)
|
||||
{
|
||||
int64_t now = esp_timer_get_time(); // before anything else: echoes are timing measurements
|
||||
if (len < 3 || len > (int)sizeof(((rx_t *)0)->data)) {
|
||||
@@ -311,11 +310,11 @@ static void recv_cb(const esp_now_recv_info_t *info, const uint8_t *data, int le
|
||||
return;
|
||||
}
|
||||
if (reply && data[1] == M_ECHO) {
|
||||
bench_on_echo(info->src_addr, data[2] | (data[3] << 8), now);
|
||||
bench_on_echo(src_mac, data[2] | (data[3] << 8), now);
|
||||
return;
|
||||
}
|
||||
rx_t rx = { .len = len };
|
||||
memcpy(rx.mac, info->src_addr, 6);
|
||||
memcpy(rx.mac, src_mac, 6);
|
||||
memcpy(rx.data, data, len);
|
||||
xQueueSend(s_rx, &rx, 0); // dropping an ack only costs a retransmit
|
||||
}
|
||||
@@ -445,7 +444,7 @@ esp_err_t rel_init(void)
|
||||
ESP_RETURN_ON_FALSE(s_lock && s_rx, ESP_ERR_NO_MEM, TAG, "alloc");
|
||||
s_seq = esp_random() & 0xFFFF; // drivers remember recent (mac, seq); a restart must not reuse them
|
||||
s_ver = (esp_random() % 0x7FFE) + 1; // new epoch per boot, so a rebooted controller never matches stale drivers
|
||||
ESP_RETURN_ON_ERROR(esp_now_register_recv_cb(recv_cb), TAG, "recv cb");
|
||||
ESP_RETURN_ON_ERROR(espnow_tx_set_rx_cb(recv_cb), TAG, "recv cb");
|
||||
xTaskCreate(rel_task, "rel", 4096, NULL, 6, NULL);
|
||||
ESP_LOGI(TAG, "reliable link up, state version %u", s_ver);
|
||||
return ESP_OK;
|
||||
|
||||
Reference in new issue
Block a user