From 025951939ae1f665a7e0dd276c94bdfb4051bd25 Mon Sep 17 00:00:00 2001 From: SummerGift Date: Thu, 22 Nov 2018 13:57:28 +0800 Subject: [PATCH] [components][driver]: spi sd card, remove the extra reinitialization code --- components/drivers/spi/spi_msd.c | 39 -------------------------------- 1 file changed, 39 deletions(-) diff --git a/components/drivers/spi/spi_msd.c b/components/drivers/spi/spi_msd.c index ed121e184d..86969f3180 100644 --- a/components/drivers/spi/spi_msd.c +++ b/components/drivers/spi/spi_msd.c @@ -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) { -- GitLab