Channel 11 defaults, ESP-NOW driver config and rig/desktop updates
Moves the controller, bridge and led-driver default ESP-NOW channel to 11 and updates the led-driver and led-tool submodule pointers. Includes the rest of the working tree: web UI, desktop and sim-controller changes, API and bridge code, graphify output, and the .gitea and fixture-driver folders. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
35207a868a
commit
edf35e9c71
280 files changed
+24043
-1756
No files matched your search
@@ -9,6 +9,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "esp_log.h"
|
||||
#include "esp_timer.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "freertos/task.h"
|
||||
@@ -49,7 +50,7 @@ static int s_nwant;
|
||||
static bool s_want_changed;
|
||||
static int s_art_fd = -1, s_art_port = ARTNET_PORT;
|
||||
static char s_art_error[64], s_art_from[16];
|
||||
static uint32_t s_art_packets, s_art_polls;
|
||||
static uint32_t s_art_packets, s_art_polls, s_local_packets;
|
||||
|
||||
static int udp_bind(uint16_t port, char *err, size_t errn)
|
||||
{
|
||||
@@ -275,7 +276,7 @@ static void net_task(void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
static uint8_t buf[1500];
|
||||
TickType_t last = xTaskGetTickCount();
|
||||
int64_t last = esp_timer_get_time(); // not xTaskGetTickCount: the desktop build's FreeRTOS has none
|
||||
for (;;) {
|
||||
sync_ddp();
|
||||
fd_set rd;
|
||||
@@ -316,8 +317,8 @@ static void net_task(void *arg)
|
||||
} else {
|
||||
vTaskDelay(1); // let the other tasks in (select blocks the host thread, not the scheduler)
|
||||
}
|
||||
TickType_t now = xTaskGetTickCount();
|
||||
if (now - last >= pdMS_TO_TICKS(TICK_MS)) {
|
||||
int64_t now = esp_timer_get_time();
|
||||
if (now - last >= TICK_MS * 1000) {
|
||||
last = now;
|
||||
flush();
|
||||
}
|
||||
@@ -355,6 +356,22 @@ void sim_net_start(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sim_net_put_universe(int uni, const uint8_t data[512])
|
||||
{
|
||||
if (!s_mu || uni < 0 || uni > 32767) {
|
||||
return;
|
||||
}
|
||||
xSemaphoreTake(s_mu, portMAX_DELAY);
|
||||
universe_t *u = universe_slot(uni);
|
||||
if (u) {
|
||||
memcpy(u->data, data, 512);
|
||||
u->dirty = true;
|
||||
u->packets++;
|
||||
}
|
||||
s_local_packets++;
|
||||
xSemaphoreGive(s_mu);
|
||||
}
|
||||
|
||||
void sim_net_set_ddp_ports(const uint16_t *ports, int n)
|
||||
{
|
||||
if (!s_mu) {
|
||||
@@ -405,6 +422,7 @@ cJSON *sim_net_status(bool with_data)
|
||||
}
|
||||
cJSON_AddNumberToObject(a, "packets", s_art_packets);
|
||||
cJSON_AddNumberToObject(a, "polls", s_art_polls);
|
||||
cJSON_AddNumberToObject(a, "local_packets", s_local_packets); // from the controller's DMX bridges
|
||||
cJSON_AddStringToObject(a, "last_from", s_art_from);
|
||||
cJSON *us = cJSON_AddObjectToObject(a, "universes");
|
||||
for (int i = 0; i < MAX_UNIVERSES; i++) {
|
||||
|
||||
@@ -21,10 +21,14 @@
|
||||
// Start the receiver task (once)
|
||||
void sim_net_start(void);
|
||||
|
||||
// A universe from inside the controller (a DMX bridge's Simulator output), as if it arrived over Art-Net.
|
||||
// Does nothing before sim_net_start.
|
||||
void sim_net_put_universe(int uni, const uint8_t data[512]);
|
||||
|
||||
// The DDP ports the active room uses (duplicates and 0 are ignored); sockets follow on the next tick
|
||||
void sim_net_set_ddp_ports(const uint16_t *ports, int n);
|
||||
|
||||
// {artnet: {port, error, packets, polls, last_from, universes: {"0": {packets, data?: hex}}},
|
||||
// {artnet: {port, error, packets, polls, local_packets, last_from, universes: {"0": {packets, data?: hex}}},
|
||||
// ddp: {"4048": {packets, pixels, error, last_from, data?: hex}}}; data only when with_data
|
||||
cJSON *sim_net_status(bool with_data);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
CONFIG_IDF_TARGET="linux"
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
CONFIG_ESPNOW_CHANNEL=5
|
||||
CONFIG_ESPNOW_CHANNEL=11
|
||||
CONFIG_HTTPD_WS_SUPPORT=y
|
||||
CONFIG_HTTPD_WS_POST_HANDSHAKE_CB_SUPPORT=y
|
||||
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
|
||||
|
||||
Reference in new issue
Block a user