feat: browser simulator served by the controller, desktop build, browser bridge
- led-simulator: the rig runs the C++ led-driver as WebAssembly (sim-driver/), one single-threaded worker per bar, no cross-origin isolation needed. Rooms (one JSON per room) with an on-page editor, and a pattern gallery. The Python server, Pyodide boot and ring buffer are removed. - sim-controller sim_rig.c: serves /sim/ from an embedded pack, the page's WebSocket and the rooms/flash API. The desktop build embeds it too. - bridge.c: a "browser" bridge kind that carries ESP-NOW frames to the page; devices announced through it are marked sim. - UI: Simulator in the Menu, split view with resize and pop-out, swipe between controller and rig on phones; SIM/REAL badges in Devices. - Fades: preset pushes and Wi-Fi driver bodies always carry fade and beat_time, so "off" no longer inherits an earlier fade. - Also the sequences-v2 work in progress: desktop port, bridge firmware, serial bridge, Wi-Fi drivers, sequence timeline, audio and API changes. - led-driver: ESP-NOW link, beat sync, control messages, sim hooks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
698c1463c0
commit
581b751904
506 files changed
+42336
-3599
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/* Desktop port: the FreeRTOS subset the firmware uses, on POSIX threads (desktop/port/src/freertos.c). */
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "portmacro.h"
|
||||
|
||||
typedef int BaseType_t;
|
||||
typedef unsigned int UBaseType_t;
|
||||
typedef uint32_t TickType_t;
|
||||
|
||||
#define pdTRUE ((BaseType_t)1)
|
||||
#define pdFALSE ((BaseType_t)0)
|
||||
#define pdPASS pdTRUE
|
||||
#define pdFAIL pdFALSE
|
||||
#define portMAX_DELAY ((TickType_t)0xFFFFFFFFUL)
|
||||
#define pdMS_TO_TICKS(ms) ((TickType_t)(ms)) /* a tick is 1 ms */
|
||||
#define portTICK_PERIOD_MS ((TickType_t)1)
|
||||
#define configTICK_RATE_HZ 1000
|
||||
|
||||
#define portYIELD_FROM_ISR(x) ((void)(x))
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
typedef struct desk_events *EventGroupHandle_t;
|
||||
typedef uint32_t EventBits_t;
|
||||
|
||||
EventGroupHandle_t xEventGroupCreate(void);
|
||||
void vEventGroupDelete(EventGroupHandle_t g);
|
||||
EventBits_t xEventGroupSetBits(EventGroupHandle_t g, EventBits_t bits);
|
||||
EventBits_t xEventGroupClearBits(EventGroupHandle_t g, EventBits_t bits);
|
||||
EventBits_t xEventGroupWaitBits(EventGroupHandle_t g, EventBits_t bits, BaseType_t clear_on_exit,
|
||||
BaseType_t wait_all, TickType_t ticks);
|
||||
@@ -0,0 +1,16 @@
|
||||
/* Desktop port: critical sections are one process-wide recursive lock (desktop/port/src/freertos.c). */
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
int unused;
|
||||
} portMUX_TYPE;
|
||||
#define portMUX_INITIALIZER_UNLOCKED {0}
|
||||
|
||||
void desk_critical_enter(void);
|
||||
void desk_critical_exit(void);
|
||||
#define portENTER_CRITICAL(mux) ((void)(mux), desk_critical_enter())
|
||||
#define portEXIT_CRITICAL(mux) ((void)(mux), desk_critical_exit())
|
||||
#define taskENTER_CRITICAL() desk_critical_enter()
|
||||
#define taskEXIT_CRITICAL() desk_critical_exit()
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
typedef struct desk_queue *QueueHandle_t;
|
||||
|
||||
QueueHandle_t xQueueCreate(UBaseType_t length, UBaseType_t item_size);
|
||||
void vQueueDelete(QueueHandle_t q);
|
||||
BaseType_t xQueueSend(QueueHandle_t q, const void *item, TickType_t ticks);
|
||||
BaseType_t xQueueSendToBack(QueueHandle_t q, const void *item, TickType_t ticks);
|
||||
BaseType_t xQueueReceive(QueueHandle_t q, void *item, TickType_t ticks);
|
||||
UBaseType_t uxQueueMessagesWaiting(QueueHandle_t q);
|
||||
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
typedef struct desk_sem *SemaphoreHandle_t;
|
||||
|
||||
SemaphoreHandle_t xSemaphoreCreateMutex(void);
|
||||
SemaphoreHandle_t xSemaphoreCreateRecursiveMutex(void);
|
||||
SemaphoreHandle_t xSemaphoreCreateBinary(void);
|
||||
SemaphoreHandle_t xSemaphoreCreateCounting(UBaseType_t max, UBaseType_t initial);
|
||||
void vSemaphoreDelete(SemaphoreHandle_t s);
|
||||
BaseType_t xSemaphoreTake(SemaphoreHandle_t s, TickType_t ticks);
|
||||
BaseType_t xSemaphoreTakeRecursive(SemaphoreHandle_t s, TickType_t ticks);
|
||||
BaseType_t xSemaphoreGive(SemaphoreHandle_t s);
|
||||
BaseType_t xSemaphoreGiveRecursive(SemaphoreHandle_t s);
|
||||
BaseType_t xSemaphoreGiveFromISR(SemaphoreHandle_t s, BaseType_t *woken);
|
||||
|
||||
#define xSemaphoreTakeFromISR(s, w) xSemaphoreTake((s), 0)
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
typedef struct desk_stream *StreamBufferHandle_t;
|
||||
|
||||
StreamBufferHandle_t xStreamBufferCreate(size_t size, size_t trigger_level);
|
||||
void vStreamBufferDelete(StreamBufferHandle_t sb);
|
||||
size_t xStreamBufferSend(StreamBufferHandle_t sb, const void *data, size_t len, TickType_t ticks);
|
||||
size_t xStreamBufferReceive(StreamBufferHandle_t sb, void *data, size_t len, TickType_t ticks);
|
||||
BaseType_t xStreamBufferReset(StreamBufferHandle_t sb);
|
||||
size_t xStreamBufferBytesAvailable(StreamBufferHandle_t sb);
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
#define tskIDLE_PRIORITY ((UBaseType_t)0)
|
||||
#define tskNO_AFFINITY 0x7FFFFFFF
|
||||
|
||||
typedef struct desk_task *TaskHandle_t;
|
||||
typedef void (*TaskFunction_t)(void *);
|
||||
|
||||
BaseType_t xTaskCreate(TaskFunction_t fn, const char *name, uint32_t stack_words, void *arg, UBaseType_t prio,
|
||||
TaskHandle_t *handle);
|
||||
void vTaskDelete(TaskHandle_t task);
|
||||
void vTaskDelay(TickType_t ticks);
|
||||
TaskHandle_t xTaskGetCurrentTaskHandle(void);
|
||||
Reference in new issue
Block a user