jarivanewijk opened a new pull request #4635:
URL: https://github.com/apache/incubator-nuttx/pull/4635


   ## Summary
   The include/nuttx/leds/userled.h interface already defines the 
ULEDIOC_GETALL command for retrieving the current state of the LEDs. The 
current implementation directly returns the state as it was previously set.
   
   However, this does not necessarily reflect the actual state of the LEDs. 
Hardware may be broken or there might be a wrong configuration in software. We 
would like to change this command so it reads the actual pin state of the pins 
that control the LEDs, which is a more accurate representation of the LED 
state. This would require an additional board_userled_getall() function to be 
defined.
   
   This is still open for discussion. We want a way to check the actual LED 
state to verify that the LED on our board is correctly controlled and that the 
LED is mounted without short circuits. This needs to be done from user board 
logic or a user application. The existing ULEDIOC_GETALL command seems like a 
good fit, but only provides the state to which the LED should have been set, 
not its actual state. If the original functionality needs to be preserved, 
maybe the proposed functionality can be implemented as a separate command. We 
would just like to hear the opinion of the community. We are also open to other 
suggestions to implement this kind of functionality.
   
   FYI @cisvanmierlo
   
   ## Impact
   Boards and applications that previously used the generic userled driver 
implementation would need to implement a board_userled_getall() function. This 
then needs to read the logic level of the pins that control the LEDs. Exact 
implementation might vary between MCUs and boards.
   
   ## Testing
   I will test on S32K144EVB as soon as possible. I just wanted to start the 
discussion already.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to