How do I extend the CAF LED module?

I am currently using the CAF LED modules. This works fine with a mono-color LED or a tri-color RGB LED.

question 1:
My problem is that unfortunatly my hardware board has only Bi-color LED e.g. red+green.
Is there any (hidden) configuration settings in CAF to disable the "blue" color in the LED module.

without hitting the assert in function leds_init at line 186

   __ASSERT_NO_MSG((led->color_count == 1) || (led->color_count == 3));

Question2:
An small architectural question:
How can I overload or inherit the CAF LED module correctly, without copy-paste the code to my custom sdk (as extended library to zephyr)

Any idea / hint / tip how to fix this correctly.

Thx.

Parents
  • Hi,

    It is unfortunately not possible to "disable" one of the colors. I have asked one of the developers whether this is something we can add support for. I have not tested this myself, but have you tried implementing it as 2 monochromatic LEDs?

    For your second question, what are you trying to do exactly? What is the issue you are trying to solve? What do you mean by "custom SDK"?

  • I did made a "custom SDK" this is a typical so called zephyr extended library contains re-usable modulair flexible components.

    The components are my (custom) building blocks for several applications I made in different (client) projects.
    Each component has a kconfig and cmakelist.txt next to source code file and header file.

    Depending on the board configuration and the build configuration in the project
    the components will be enable or disabled based upon the multiple boards definition in the project.

    I do like run / test my application on multiple vendor boards (stm32F411 nucleo / nordic 52840DK and a nxp board. ;-)

    So what i try to solve is the limitations of the CAF LED module in a correct manor without adapting the source code of the CAF LED module (and button module) each time Nordic release a new ncs version.

  • Hi,

    Is the bi-color feature implemented in CAF led module?

    Thanks

Reply Children
Related