From 5f84b30ea1f8bfc4351c0784782075ae806dbf1c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 20 Nov 2009 15:51:19 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1316 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/io/mmc_spi.c | 7 +++++-- os/io/pal.h | 9 +++++++-- os/io/platforms/STM32/pal_lld.c | 1 + readme.txt | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/os/io/mmc_spi.c b/os/io/mmc_spi.c index 4013f45f5..4f6adaf7d 100644 --- a/os/io/mmc_spi.c +++ b/os/io/mmc_spi.c @@ -488,7 +488,7 @@ bool_t mmcStartSequentialWrite(MMCDriver *mmcp, uint32_t startblk) { if (recvr1(mmcp) != 0x00) { spiUnselect(mmcp->mmc_spip); chSysLock(); - if (mmcp->mmc_state == MMC_READING) + if (mmcp->mmc_state == MMC_WRITING) mmcp->mmc_state = MMC_READY; chSysUnlock(); return TRUE; @@ -560,8 +560,11 @@ bool_t mmcStopSequentialWrite(MMCDriver *mmcp) { spiUnselect(mmcp->mmc_spip); chSysLock(); - if (mmcp->mmc_state == MMC_WRITING) + if (mmcp->mmc_state == MMC_WRITING) { mmcp->mmc_state = MMC_READY; + chSysUnlock(); + return FALSE; + } chSysUnlock(); return TRUE; } diff --git a/os/io/pal.h b/os/io/pal.h index 2a1cbaf63..67bc424b1 100644 --- a/os/io/pal.h +++ b/os/io/pal.h @@ -66,15 +66,20 @@ */ #define PAL_MODE_INPUT_PULLDOWN 4 +/** + * @brief Analog input mode. + */ +#define PAL_MODE_INPUT_ANALOG 5 + /** * @brief Push-pull output pad. */ -#define PAL_MODE_OUTPUT_PUSHPULL 5 +#define PAL_MODE_OUTPUT_PUSHPULL 6 /** * @brief Open-drain output pad. */ -#define PAL_MODE_OUTPUT_OPENDRAIN 6 +#define PAL_MODE_OUTPUT_OPENDRAIN 7 #ifndef _PAL_LLD_H_ #include "pal_lld.h" diff --git a/os/io/platforms/STM32/pal_lld.c b/os/io/platforms/STM32/pal_lld.c index 83428e8e1..83b51f014 100644 --- a/os/io/platforms/STM32/pal_lld.c +++ b/os/io/platforms/STM32/pal_lld.c @@ -124,6 +124,7 @@ void _pal_lld_setgroupmode(ioportid_t port, 4, /* PAL_MODE_INPUT */ 8, /* PAL_MODE_INPUT_PULLUP */ 8, /* PAL_MODE_INPUT_PULLDOWN */ + 0, /* PAL_MODE_INPUT_ANALOG */ 3, /* PAL_MODE_OUTPUT_PUSHPULL, 50MHz.*/ 7, /* PAL_MODE_OUTPUT_OPENDRAIN, 50MHz.*/ }; diff --git a/readme.txt b/readme.txt index 9342e152f..825150e6d 100644 --- a/readme.txt +++ b/readme.txt @@ -3,6 +3,7 @@ ***************************************************************************** *** 1.3.5 *** +- FIX: Fixed some problems in the MMC_SPI driver (bugs 2901084 and 2901172). - NEW: STM32 ADC driver implementation with DMA support. - CHANGE: In the STM32 drivers now the DMA errors are handled by hook macros rather than by events. The default action is to halt the system but users