rcsim commented on PR #15861:
URL: https://github.com/apache/nuttx/pull/15861#issuecomment-2670070887

   > Hi! Regarding the use of
   > 
   > ```c
   > #if BOARD_NGPIOINT > 0
   > #endif
   > ```
   > 
   > It's a personal preference, but, I suggest the to use something like
   > 
   > ```c
   > #ifdef BOARD_NGPIOINT
   > #endif
   > ```
   > 
   > If one or more gpio is needed, use
   > 
   > ```c
   > #define BOARD_NGPIOINT number
   > ```
   > 
   > else do not define BOARD_NGPIOINT at all.
   > 
   > Current implementation assumes that BOARD_NGPIOINT should always be 
defined and numeric value, Which arguably may introduce undefined behavior.
   > 
   > But, it's just my suggestion.
   
   Thanks for your suggestion @LuchianMihai , but if BOARD_NGPIOINT is defined 
as 0 (maybe by mistake), we will also have some problems. So I will keep this 
way. But once again, thanks for the suggestion.
   
   ```
   rcsim@rcsim-p52:~/nuttxspace/nuttx$ git grep "BOARD_NGPIOINT 0"
   boards/arm64/bcm2711/raspberrypi-4b/include/board.h:#define BOARD_NGPIOINT 0
   rcsim@rcsim-p52:~/nuttxspace/nuttx$ git grep "BOARD_NGPIOINT  0"
   boards/arm/at32/at32f437-mini/src/at32f437-mini.h:#define BOARD_NGPIOINT  0
   boards/arm/imxrt/imxrt1050-evk/src/imxrt1050-evk.h:#define BOARD_NGPIOINT  0 
/* Amount of GPIO Input w/ Interruption pins */
   boards/arm/imxrt/imxrt1060-evk/src/imxrt1060-evk.h:#define BOARD_NGPIOINT  0 
/* Amount of GPIO Input w/ Interruption pins */
   boards/arm/imxrt/imxrt1064-evk/src/imxrt1064-evk.h:#define BOARD_NGPIOINT  0 
/* Amount of GPIO Input w/ Interruption pins */
   boards/arm/imxrt/imxrt1170-evk/src/imxrt1170-evk.h:#define BOARD_NGPIOINT  0 
 /* Amount of GPIO Input w/ Interruption pins */
   ```
   


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