mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 04:51:37 +08:00
Corrections for SD card on Shenzhou board
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5183 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -230,7 +230,7 @@
|
||||
* PN NAME SIGNAL NOTES
|
||||
* -- ---- -------------- -------------------------------------------------------------------
|
||||
* 53 PB14 SD_CD Active low: Pulled high
|
||||
* 58 PD11 SD_CS
|
||||
* 58 PD11 SD_CS Active low: Pulled high
|
||||
*/
|
||||
|
||||
#define GPIO_SD_CD (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_EXTI|GPIO_PORTB|GPIO_PIN14)
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
/* Can't support MMC/SD features if mountpoints are disabled */
|
||||
|
||||
#ifndef CONFIG_DISABLE_MOUNTPOINT
|
||||
#ifdef CONFIG_DISABLE_MOUNTPOINT
|
||||
# undef HAVE_MMCSD
|
||||
#endif
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
|
||||
/* Can't support W25 features if mountpoints are disabled */
|
||||
|
||||
#if defined(CONFIG_DISABLE_MOUNTPOINT)
|
||||
#ifdef CONFIG_DISABLE_MOUNTPOINT
|
||||
# undef HAVE_W25
|
||||
#endif
|
||||
|
||||
@@ -194,7 +194,7 @@ int nsh_archinitialize(void)
|
||||
/* Initialize the SPI-based MMC/SD slot */
|
||||
|
||||
#ifdef HAVE_MMCSD
|
||||
ret = stm32_sdinitialze(CONFIG_NSH_MMCSDMINOR);
|
||||
ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("nsh_archinitialize: Failed to initialize MMC/SD slot %d: %d\n",
|
||||
|
||||
@@ -60,18 +60,18 @@
|
||||
|
||||
/* Enables debug output from this file (needs CONFIG_DEBUG too) */
|
||||
|
||||
#undef SPI_DEBUG /* Define to enable debug */
|
||||
#undef SPI_VERBOSE /* Define to enable verbose debug */
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_SPI
|
||||
#endif
|
||||
|
||||
#ifdef SPI_DEBUG
|
||||
#ifdef CONFIG_DEBUG_SPI
|
||||
# define spidbg lldbg
|
||||
# ifdef SPI_VERBOSE
|
||||
# ifdef CONFIG_DEBUG_VERBOSE
|
||||
# define spivdbg lldbg
|
||||
# else
|
||||
# define spivdbg(x...)
|
||||
# endif
|
||||
#else
|
||||
# undef SPI_VERBOSE
|
||||
# define spidbg(x...)
|
||||
# define spivdbg(x...)
|
||||
#endif
|
||||
@@ -103,15 +103,16 @@ void weak_function stm32_spiinitialize(void)
|
||||
/* SPI1 connects to the SD CARD and to the SPI FLASH */
|
||||
|
||||
#ifdef CONFIG_STM32_SPI1
|
||||
stm32_configgpio(GPIO_SD_CS);
|
||||
stm32_configgpio(GPIO_FLASH_CS);
|
||||
stm32_configgpio(GPIO_SD_CS); /* SD card chip select */
|
||||
stm32_configgpio(GPIO_SD_CD); /* SD card detect */
|
||||
stm32_configgpio(GPIO_FLASH_CS); /* FLASH chip select */
|
||||
#endif
|
||||
|
||||
/* SPI3 connects to TFT LCD and the RF24L01 2.4G wireless module */
|
||||
|
||||
#ifdef CONFIG_STM32_SPI3
|
||||
stm32_configgpio(GPIO_LCD_CS);
|
||||
stm32_configgpio(GPIO_WIRELESS_CS);
|
||||
stm32_configgpio(GPIO_LCD_CS); /* LCD chip select */
|
||||
stm32_configgpio(GPIO_WIRELESS_CS); /* Wireless chip select */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user