You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/06/07 04:13:00 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #1200: Remove "undef __KERNEL__" from userled and button low half driver implmentation

xiaoxiang781216 commented on pull request #1200:
URL: https://github.com/apache/incubator-nuttx/pull/1200#issuecomment-640154153


   > The change looks good, however having an init function return a value (other than an error code) seems weird. I skimmed the code base to find a similar case but couldn't find any, do you have one in mind?
   
   Initially, I use int as the returned value, but change to uint32_t later, because:
   1.The original prototype is void which mean nobody take care the error
   2.It require all caller add the code to check the error code
   3.The new prototype follow this function:
   ```
   uint32_t board_buttons(void)
   ```
   4.board_button_initialize can return zero to indicate the error case.
   
   > At the same time I don't know if introducing a new function is any better.
   
   I also consider this approach but I finally select the current method because I want to keep the change as small as possible.


----------------------------------------------------------------
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.

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