btashton commented on pull request #1788:
URL: https://github.com/apache/incubator-nuttx/pull/1788#issuecomment-692823771


   > With the same macro?
   > Having the variable undefined is not problem if you know it will not be 
read. This is standard across many drivers were struct fields depend on 
configuration values.
   > I don't know, without fully understanding which is the problematic code I 
don't have much else to add. Maybe @raiden00pl has a clearer idea.
   
   How can you use a `SPIM#` specific macro inside of `static int 
nrf52_spi_init(FAR struct nrf52_spidev_s *priv)`
   You need to set `regval` here to point at the pin or explicitly set it as 
disconnected `nrf52_spi_putreg(priv, NRF52_SPIM_PSELMOSI_OFFSET, regval);`
   
   See my comment on your code suggestion here 
https://github.com/apache/incubator-nuttx/pull/1788#discussion_r488279394
   
   If I did not define `BOARD_SPI1_MISO_PIN`  then **both** SPI0 and SPI1 would 
have the pins disconnected even if `BOARD_SPI1_MISO_PIN` was defined.


----------------------------------------------------------------
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:
[email protected]


Reply via email to