mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-02 09:14:06 +00:00
set leds on/off
This commit is contained in:
@@ -38,6 +38,7 @@ LOG_MODULE_REGISTER(zephcore_observer_main, CONFIG_ZEPHCORE_MAIN_LOG_LEVEL);
|
||||
#include <ZephyrWiFiStation.h>
|
||||
#include <ZephyrMQTTPublisher.h>
|
||||
#include "observer_creds.h"
|
||||
#include <helpers/led_gate.h>
|
||||
|
||||
/* ========== LED (optional) ========== */
|
||||
|
||||
@@ -357,6 +358,15 @@ int main(void)
|
||||
data_store.savePrefs(*prefs);
|
||||
}
|
||||
|
||||
/* Apply the persisted LED master switch. The observer has no CLI of its own
|
||||
* to change it, but a unit reflashed from a repeater build keeps the setting
|
||||
* — and it still drives lora-tx-led on TX-capable boards. */
|
||||
{
|
||||
bool leds_off = prefs->leds_disabled != 0;
|
||||
zephcore_leds_set_disabled(leds_off);
|
||||
LOG_INF("LEDs: %s (from prefs)", leds_off ? "disabled" : "enabled");
|
||||
}
|
||||
|
||||
/* Initialize USB serial for CLI */
|
||||
#if ZEPHCORE_USB_STACK && DT_HAS_COMPAT_STATUS_OKAY(zephyr_cdc_acm_uart)
|
||||
usb_dev = DEVICE_DT_GET_ONE(zephyr_cdc_acm_uart);
|
||||
|
||||
Reference in New Issue
Block a user