acassis commented on a change in pull request #5697:
URL: https://github.com/apache/incubator-nuttx/pull/5697#discussion_r822196777



##########
File path: boards/arm/stm32/nucleo-f429zi/src/stm32_spi.c
##########
@@ -217,35 +248,41 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, 
uint32_t devid)
 
 #ifdef CONFIG_STM32F4_SPI2
 void stm32_spi2select(FAR struct spi_dev_s *dev,
-                      uint32_t devid,
-                      bool selected)
+                      uint32_t devid, bool selected)
 {
+  uint32_t index = SPIDEVID_INDEX(devid) + 4;
+

Review comment:
       @pkarashchenko instead of using this fixed "+ 4" offset to skip the 4 
SPI1 chip select, it is better to create an array for each SPI port: 
g_spi1gpio[], g_spi2gpio[], g_spi3gpio[], etc. This way the users could add 
more than 4 Chip Select without doing this fixed skip.




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