led-driver: channel default 11, bare ESP-NOW build, settings and USB config updates
Default ESP-NOW channel is now 11. Adds the bare ESP-NOW-only build option (CONFIG_LED_ESPNOW_ONLY) with its sdkconfig fragments, a default hostname from the Wi-Fi MAC, and the related net, link, web and settings changes. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
12a8e225ad
commit
c9838d1cbe
18 files changed
+268
-31
No files matched your search
+20
-4
@@ -107,6 +107,8 @@ static uint32_t s_ddp_shown; // frames shown
|
||||
static uint8_t s_max_brightness = 255;
|
||||
static uint8_t s_global = 255;
|
||||
static uint8_t s_master = 255;
|
||||
static bool s_dimmer_out; // dimmer mode: colours unscaled; the scale is read as the dimmer level
|
||||
static volatile uint8_t s_out_level = 255; // the scale of the last output (device x master x ceiling)
|
||||
static uint32_t s_fade_t0;
|
||||
static uint32_t s_fade_ms;
|
||||
|
||||
@@ -223,6 +225,18 @@ uint8_t patterns_get_master(void)
|
||||
return v;
|
||||
}
|
||||
|
||||
void patterns_set_dimmer_out(bool on)
|
||||
{
|
||||
xSemaphoreTake(s_lock, portMAX_DELAY);
|
||||
s_dimmer_out = on;
|
||||
xSemaphoreGive(s_lock);
|
||||
}
|
||||
|
||||
uint8_t patterns_output_level(void)
|
||||
{
|
||||
return s_out_level;
|
||||
}
|
||||
|
||||
void patterns_get(preset_t *out)
|
||||
{
|
||||
xSemaphoreTake(s_lock, portMAX_DELAY);
|
||||
@@ -248,6 +262,11 @@ static void output(uint32_t now, bool full_brightness)
|
||||
// Pattern output: device brightness x master scale, under the max brightness ceiling. DDP frames
|
||||
// skip the device and master brightness (the sender sets the colours) but still respect the ceiling.
|
||||
int s_scale = full_brightness ? s_max_brightness : s_global * s_master / 255 * s_max_brightness / 255;
|
||||
s_out_level = (uint8_t)s_scale;
|
||||
// Dimmer mode: the scale goes to the fixture's dimmer channel instead, so the colours are not scaled
|
||||
if (s_dimmer_out) {
|
||||
s_scale = 255;
|
||||
}
|
||||
int k = -1;
|
||||
if (s_fading) {
|
||||
uint32_t el = now - s_fade_t0;
|
||||
@@ -413,10 +432,7 @@ void patterns_start(const hw_cfg_t &hw)
|
||||
s_lock = xSemaphoreCreateMutex();
|
||||
preset_defaults(&s_cur, 0);
|
||||
preset_defaults(&s_run, 0);
|
||||
s_cur.pattern = patterns_index("chase");
|
||||
s_cur.delay = 1000;
|
||||
s_cur.brightness = 16;
|
||||
s_cur.col[0][0] = 255;
|
||||
s_cur.pattern = patterns_index("off"); // LEDs stay dark until a startup preset or a controller selects one
|
||||
s_reset_pending = true;
|
||||
|
||||
int n = clamp_leds(hw.num_leds);
|
||||
|
||||
Reference in new issue
Block a user