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:
jimmyandClaude Haiku 5.5 committed 2026-11-21 01:18:55 +13:00
1 parent 12a8e225ad
commit c9838d1cbe
18 files changed
+268 -31

No files matched your search

+7 -1
View File
@@ -17,6 +17,7 @@
#include "esp_timer.h"
#include "esp_wifi.h"
#include "freertos/FreeRTOS.h"
#include "sdkconfig.h"
#include "freertos/queue.h"
#include "freertos/task.h"
@@ -384,8 +385,11 @@ void link_pass(TickType_t wait)
void link_task(void *arg)
{
(void)arg;
// pdMS_TO_TICKS(5) is 0 at CONFIG_FREERTOS_HZ=100: the pass would never block or yield, and the idle task
// would starve (task watchdog reset). Wait at least one tick.
constexpr TickType_t kWait = pdMS_TO_TICKS(5) > 0 ? pdMS_TO_TICKS(5) : 1;
for (;;) {
link_pass(pdMS_TO_TICKS(5));
link_pass(kWait);
}
}
@@ -398,10 +402,12 @@ esp_err_t espnow_link_start(void)
}
net_cfg_t n;
settings_load_net(&n);
#if !CONFIG_LED_ESPNOW_ONLY // the bare build is ESP-NOW whatever the setting says
if (!n.espnow_enabled) {
ESP_LOGI(TAG, "ESP-NOW is off in settings");
return ESP_OK;
}
#endif
ctrl_init();
// ESP-NOW uses the radio's channel: the access point's, or the router's when the client is joined.
// It is not set here, since changing the channel while the client connects breaks the association.