caf: modules: leds: fix support GPIO-based LED devicetree definitions #19703
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When CONFIG_CAF_LEDS_GPIO was chosen over CONFIG_CAF_LEDS_PWM, an assertion fails that checks whether a gpio-leds compatible node has either 1 or 3 child nodes to define multi-color LEDs. However, most Nordic development boards have 4 leds, which the CAF leds module does not support and hence breaks these builds. This commit adds support for up to a combination of 4 leds in what could be analogous to an RGBW LED. The changes are made as such that as little application code as possible is affected by the change. If user code wants to take full advantage of the full channel color support it will have to redefine the OFF, ON, ON_GO_OFF, BLINK, BLINK2, BREATH, and CLOCK effects since LED_NOCOLOR is only defined for 3 channels.