You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2023/01/08 07:42:47 UTC

[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org