pkarashchenko commented on code in PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#discussion_r1064096312
##########
boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c:
##########
@@ -351,14 +349,30 @@ int board_sdcard_initialize(void)
#endif
#ifdef CONFIG_MMCSD_HAVE_CARDDETECT
+ /* Configure Interrupt pin with internal pull-up */
+
+ cxd56_pin_config(PINCONF_SDIO_CD_GPIO);
+
/* Initialize Card insert status */
- g_sdhci.inserted = false;
+ g_sdhci.inserted = board_sdcard_inserted(0);
- /* Configure Interrupt pin with internal pull-up */
+ /* Enable SDC if card is inserted */
+
+ if (g_sdhci.inserted)
+ {
+ /* Card Detect = Present, Write Protect = disable */
+
+ putreg32(0, CXD56_TOPREG_IOFIX_APP);
+
+ board_sdcard_enable(NULL);
+ }
Review Comment:
Maybe it is better just to call `board_sdcard_detect_int` instead.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]