mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-12 06:57:57 +04:00
The led init script already knows how to drive a multicolor LED: it reads multi_index and writes one intensity per color to multi_intensity, taken from color_<name> options of the led section. Nothing fills those options in, though - generate_led only passes name, sysfs, trigger and default on to uci, so the intensities stay at zero and the LED remains dark whatever trigger is set. No board has been able to use it so far. Pass any color_* key of a board.json led object through to the led section, and add ucidef_set_led_colors() to set them from board.d: ucidef_set_led_default "led1" "LED1" "nbg7815:led1" "1" ucidef_set_led_colors "led1" red 255 green 255 blue 255 The colors are not restricted to RGB - the keys are matched against whatever the LED reports in multi_index. Signed-off-by: André Valentin <avalentin@marcant.net>