Adding new Kconfig options and updating LEDManager code for conditional debug LED and external error mirroring

This commit is contained in:
PhosphorosVR
2025-09-07 12:59:18 +02:00
parent 909a2779ac
commit 6f926306b5
8 changed files with 635 additions and 48 deletions

View File

@@ -109,6 +109,14 @@ endmenu
menu "OpenIris: LED Configuration"
config LED_DEBUG_ENABLE
bool "Enable debug/status LED"
default y
help
When disabled the firmware will not drive the dedicated debug/status GPIO.
Useful on boards without a discrete status LED. Error/state patterns can
optionally be mirrored onto the external IR LED if LED_EXTERNAL_AS_DEBUG is set.
config LED_DEBUG_GPIO
int "Debug LED GPIO number"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
@@ -130,6 +138,17 @@ menu "OpenIris: LED Configuration"
help
Enable this if your board can control external IR LEDs.
config LED_EXTERNAL_AS_DEBUG
bool "Mirror error pattern on external LED"
depends on LED_EXTERNAL_CONTROL
default n
help
When enabled and an error LED pattern is active, the external IR LED PWM output
will blink (0% / 50% duty) to replicate the debug/status LED pattern. If
LED_DEBUG_ENABLE is disabled this provides visual error feedback using only
the external LED. Normal configured PWM brightness is restored when leaving
the error pattern.
config LED_EXTERNAL_PWM_FREQ
int "External LED PWM frequency (Hz)"
default 5000

View File

@@ -28,7 +28,12 @@
#include <UVCStream.hpp>
#endif
#ifdef CONFIG_LED_DEBUG_ENABLE
#define BLINK_GPIO (gpio_num_t) CONFIG_LED_DEBUG_GPIO
#else
// Use an invalid / unused GPIO when debug LED disabled to avoid accidental toggles
#define BLINK_GPIO (gpio_num_t) -1
#endif
#define CONFIG_LED_C_PIN_GPIO (gpio_num_t) CONFIG_LED_EXTERNAL_GPIO
TaskHandle_t serialManagerHandle;