aboutsummaryrefslogtreecommitdiffstats
path: root/os/io
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-20 15:51:19 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-20 15:51:19 +0000
commit5f84b30ea1f8bfc4351c0784782075ae806dbf1c (patch)
tree95834c3650270b2f272e085f785c9ff5ccd18c36 /os/io
parent2ab27d3c01ce51a26587e6aaafcef23b2dda4afe (diff)
downloadChibiOS-5f84b30ea1f8bfc4351c0784782075ae806dbf1c.tar.gz
ChibiOS-5f84b30ea1f8bfc4351c0784782075ae806dbf1c.tar.bz2
ChibiOS-5f84b30ea1f8bfc4351c0784782075ae806dbf1c.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1316 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io')
-rw-r--r--os/io/mmc_spi.c7
-rw-r--r--os/io/pal.h9
-rw-r--r--os/io/platforms/STM32/pal_lld.c1
3 files changed, 13 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
@@ -67,14 +67,19 @@
#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.*/
};