diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-09-19 14:34:17 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-09-19 14:34:17 +0000 |
commit | 202f234c3343a159ec01df2a1d9d00235391142d (patch) | |
tree | abbdb2445c46e5084cad2b36bf4cd51779b7fa82 /nuttx/configs/fire-stm32v2/src/up_nsh.c | |
parent | 9a9050f6ddd125fe7686091f3da2dd72c2991cd7 (diff) | |
download | px4-nuttx-202f234c3343a159ec01df2a1d9d00235391142d.tar.gz px4-nuttx-202f234c3343a159ec01df2a1d9d00235391142d.tar.bz2 px4-nuttx-202f234c3343a159ec01df2a1d9d00235391142d.zip |
Add support so that the W25 FLASH can be used with both the Shenzhou and Fire-stm32v2 boards
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5166 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/fire-stm32v2/src/up_nsh.c')
-rw-r--r-- | nuttx/configs/fire-stm32v2/src/up_nsh.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/nuttx/configs/fire-stm32v2/src/up_nsh.c b/nuttx/configs/fire-stm32v2/src/up_nsh.c index f728a227a..ba93d714f 100644 --- a/nuttx/configs/fire-stm32v2/src/up_nsh.c +++ b/nuttx/configs/fire-stm32v2/src/up_nsh.c @@ -57,6 +57,7 @@ #define HAVE_MMCSD 1 #define HAVE_USBDEV 1 +#define HAVE_W25 1 /* Configuration ************************************************************/ /* SPI1 connects to the SD CARD (and to the SPI FLASH) */ @@ -96,6 +97,24 @@ # endif #endif +/* Can't support the W25 device if it SPI1 or W25 support is not enabled */ + +#if !defined(CONFIG_STM32_SPI1) || !defined(CONFIG_MTD_W25) +# undef HAVE_W25 +#endif + +/* Can't support W25 features if mountpoints are disabled */ + +#if defined(CONFIG_DISABLE_MOUNTPOINT) +# undef HAVE_W25 +#endif + +/* Default W25 minor number */ + +#if defined(HAVE_W25) && !defined(CONFIG_NSH_W25MINOR) +# define CONFIG_NSH_W25MINOR 0 +#endif + /* Can't support USB host or device features if the USB peripheral or the USB * device infrastructure is not enabled */ @@ -134,11 +153,25 @@ int nsh_archinitialize(void) { -#ifdef HAVE_MMCSD +#if defined(HAVE_MMCSD) || defined(HAVE_W25) int ret; +#endif + + /* Initialize and register the W25 FLASH file system. */ + +#ifdef HAVE_W25 + ret = stm32_w25initialize(CONFIG_NSH_W25MINOR); + if (ret < 0) + { + message("nsh_archinitialize: Failed to initialize W25 minor %d: %d\n", + CONFIG_NSH_W25MINOR, ret); + return ret; + } +#endif /* Initialize the SDIO-based MMC/SD slot */ +#ifdef HAVE_MMCSD ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR); if (ret < 0) { |