aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-04-20 09:58:32 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-04-20 09:58:32 +0000
commit78d9d84ae6b955d246005b91d97a59b283cf31d3 (patch)
tree451f9479850329192a6b0a50134a2ad9ad08da4d /os
parent8707270773e56c4c27c4f68533d71b41fbef79e5 (diff)
downloadChibiOS-78d9d84ae6b955d246005b91d97a59b283cf31d3.tar.gz
ChibiOS-78d9d84ae6b955d246005b91d97a59b283cf31d3.tar.bz2
ChibiOS-78d9d84ae6b955d246005b91d97a59b283cf31d3.zip
SDC driver accepts a NULL configuration again.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7911 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/STM32/LLD/sdc_lld.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/LLD/sdc_lld.c b/os/hal/ports/STM32/LLD/sdc_lld.c
index a923b498c..3e53b2b0f 100644
--- a/os/hal/ports/STM32/LLD/sdc_lld.c
+++ b/os/hal/ports/STM32/LLD/sdc_lld.c
@@ -22,10 +22,6 @@
* @{
*/
-/*
- TODO: Try preerase blocks before writing (ACMD23).
- */
-
#include <string.h>
#include "hal.h"
@@ -61,6 +57,15 @@ static union {
} u;
#endif /* STM32_SDC_SDIO_UNALIGNED_SUPPORT */
+
+/**
+ * @brief SDIO default configuration.
+ */
+static const SDCConfig sdc_default_cfg = {
+ NULL,
+ SDC_MODE_4BIT
+};
+
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
@@ -407,6 +412,11 @@ void sdc_lld_init(void) {
*/
void sdc_lld_start(SDCDriver *sdcp) {
+ /* Checking configuration, using a default if NULL has been passed.*/
+ if (sdcp->config == NULL) {
+ sdcp->config = &sdc_default_cfg;
+ }
+
sdcp->dmamode = STM32_DMA_CR_CHSEL(DMA_CHANNEL) |
STM32_DMA_CR_PL(STM32_SDC_SDIO_DMA_PRIORITY) |
STM32_DMA_CR_PSIZE_WORD |