v01d commented on pull request #1788:
URL: https://github.com/apache/incubator-nuttx/pull/1788#issuecomment-692804974
> 2. The pin to peripheral mapping (iomux in other chips). This problem
here is that the peripheral struct requires all the pins to to supplied. I
cannot have MISO for SPI0 and not for SPI1. So unless we create unique
functions for SPI0 and SPI1 I don't see how at compile time we could do this.
Plus you still need to configure the pin mapping on the peripheral to be
disconnected.
Do you mean this part of the struct initialization for each spi instance?
<pre>
.miso_pin = BOARD_SPI0_MISO_PIN,
</pre>
If so, it is not required to initialize all variables of a struct. You
condition that on <pre>#ifdef BOARD_SPI0_MISO_PIN</pre> the same as the code
expecting this pin to be 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]