提交 02595193 编写于 作者: S SummerGift

[components][driver]: spi sd card, remove the extra reinitialization code

上级 63a6f6c4
......@@ -1249,16 +1249,6 @@ static rt_size_t rt_msd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz
goto _exit;
}
/* config spi to high speed */
{
struct rt_spi_configuration cfg;
cfg.data_width = 8;
cfg.mode = RT_SPI_MODE_0 | RT_SPI_MSB; /* SPI Compatible Modes 0 */
cfg.max_hz = msd->max_clock;
rt_spi_configure(msd->spi_device, &cfg);
} /* config spi */
/* SINGLE_BLOCK? */
if (size == 1)
{
......@@ -1335,16 +1325,6 @@ static rt_size_t rt_msd_sdhc_read(rt_device_t dev, rt_off_t pos, void *buffer, r
goto _exit;
}
/* config spi to high speed */
{
struct rt_spi_configuration cfg;
cfg.data_width = 8;
cfg.mode = RT_SPI_MODE_0 | RT_SPI_MSB; /* SPI Compatible Modes 0 */
cfg.max_hz = msd->max_clock;
rt_spi_configure(msd->spi_device, &cfg);
} /* config spi */
/* SINGLE_BLOCK? */
if (size == 1)
{
......@@ -1422,15 +1402,6 @@ static rt_size_t rt_msd_write(rt_device_t dev, rt_off_t pos, const void *buffer,
goto _exit;
}
/* config spi to high speed */
{
struct rt_spi_configuration cfg;
cfg.data_width = 8;
cfg.mode = RT_SPI_MODE_0 | RT_SPI_MSB; /* SPI Compatible Modes 0 */
cfg.max_hz = msd->max_clock;
rt_spi_configure(msd->spi_device, &cfg);
} /* config spi */
/* SINGLE_BLOCK? */
if (size == 1)
......@@ -1550,16 +1521,6 @@ static rt_size_t rt_msd_sdhc_write(rt_device_t dev, rt_off_t pos, const void *bu
goto _exit;
}
/* config spi to high speed */
{
struct rt_spi_configuration cfg;
cfg.data_width = 8;
cfg.mode = RT_SPI_MODE_0 | RT_SPI_MSB; /* SPI Compatible Modes 0 */
cfg.max_hz = msd->max_clock;
rt_spi_configure(msd->spi_device, &cfg);
} /* config spi */
/* SINGLE_BLOCK? */
if (size == 1)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册