提交 cd74a4be 编写于 作者: wuyangyong's avatar wuyangyong

[drivers] move tf/sd card driver to spi/spi/spi_msd.c, and update Kconfig script.

上级 19433e0c
...@@ -18,7 +18,6 @@ if GetDepend('RT_USING_LWIP'): ...@@ -18,7 +18,6 @@ if GetDepend('RT_USING_LWIP'):
if GetDepend('RT_USING_SPI'): if GetDepend('RT_USING_SPI'):
src += ['rt_stm32f10x_spi.c'] src += ['rt_stm32f10x_spi.c']
src += ['msd.c']
CPPPATH = [cwd] CPPPATH = [cwd]
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#ifdef RT_USING_SPI #ifdef RT_USING_SPI
#include "rt_stm32f10x_spi.h" #include "rt_stm32f10x_spi.h"
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT) #if defined(RT_USING_DFS) && defined(RT_USING_SPI_MSD)
#include "msd.h" #include "spi_msd.h"
#endif /* RT_USING_DFS */ #endif /* RT_USING_DFS */
/* /*
...@@ -70,7 +70,7 @@ void rt_platform_init(void) ...@@ -70,7 +70,7 @@ void rt_platform_init(void)
#ifdef RT_USING_SPI #ifdef RT_USING_SPI
rt_hw_spi_init(); rt_hw_spi_init();
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT) #if defined(RT_USING_DFS) && defined(RT_USING_SPI_MSD)
/* init sdcard driver */ /* init sdcard driver */
{ {
extern void rt_hw_msd_init(void); extern void rt_hw_msd_init(void);
...@@ -90,7 +90,7 @@ void rt_platform_init(void) ...@@ -90,7 +90,7 @@ void rt_platform_init(void)
msd_init("sd0", "spi10"); msd_init("sd0", "spi10");
} }
#endif /* RT_USING_DFS && RT_USING_DFS_ELMFAT */ #endif /* RT_USING_DFS && RT_USING_SPI_MSD */
#endif // RT_USING_SPI #endif // RT_USING_SPI
......
...@@ -87,6 +87,11 @@ config RT_USING_SPI ...@@ -87,6 +87,11 @@ config RT_USING_SPI
default n default n
if RT_USING_SPI if RT_USING_SPI
config RT_USING_SPI_MSD
bool "Using SD/TF card driver with spi"
select RT_USING_DFS
default n
config RT_USING_SFUD config RT_USING_SFUD
bool "Using Serial Flash Universal Driver" bool "Using Serial Flash Universal Driver"
default n default n
......
...@@ -28,7 +28,10 @@ if GetDepend('RT_USING_SST25VFXX'): ...@@ -28,7 +28,10 @@ if GetDepend('RT_USING_SST25VFXX'):
if GetDepend('RT_USING_GD'): if GetDepend('RT_USING_GD'):
src_device += ['spi_flash_gd.c'] src_device += ['spi_flash_gd.c']
if GetDepend('RT_USING_SPI_MSD'):
src_device += ['spi_msd.c']
if GetDepend('RT_USING_SFUD'): if GetDepend('RT_USING_SFUD'):
src_device += ['spi_flash_sfud.c', 'sfud/src/sfud.c'] src_device += ['spi_flash_sfud.c', 'sfud/src/sfud.c']
CPPPATH += [cwd + '/sfud/inc'] CPPPATH += [cwd + '/sfud/inc']
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include <string.h> #include <string.h>
#include "msd.h" #include "spi_msd.h"
//#define MSD_TRACE //#define MSD_TRACE
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#define DUMMY 0xFF #define DUMMY 0xFF
#define CARD_NCR_MAX 8 #define CARD_NCR_MAX 9
#define CARD_NRC 1 #define CARD_NRC 1
#define CARD_NCR 1 #define CARD_NCR 1
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* 2009-04-17 Bernard first version. * 2009-04-17 Bernard first version.
*/ */
#ifndef MSD_H_INCLUDED #ifndef SPI_MSD_H_INCLUDED
#define MSD_H_INCLUDED #define SPI_MSD_H_INCLUDED
#include <stdint.h> #include <stdint.h>
#include <drivers/spi.h> #include <drivers/spi.h>
...@@ -129,4 +129,4 @@ struct msd_device ...@@ -129,4 +129,4 @@ struct msd_device
extern rt_err_t msd_init(const char * sd_device_name, const char * spi_device_name); extern rt_err_t msd_init(const char * sd_device_name, const char * spi_device_name);
#endif // MSD_H_INCLUDED #endif // SPI_MSD_H_INCLUDED
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册