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"?

  • Hello Oivind

    When I run the sample, after I adapt the board configuration with a Red + green pwm led output)

    The debugger hits the assert in the code at line 186  (it looks as intended by design to support 1 or 3 colors only :-)

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

    Hence my question to proper adapt the Nordic module without  migrate each time Nordic release a new ncs version.

    kind regards,
       nRF5xFanBoy
Reply
  • Hello Oivind

    When I run the sample, after I adapt the board configuration with a Red + green pwm led output)

    The debugger hits the assert in the code at line 186  (it looks as intended by design to support 1 or 3 colors only :-)

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

    Hence my question to proper adapt the Nordic module without  migrate each time Nordic release a new ncs version.

    kind regards,
       nRF5xFanBoy
Children
Related