aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/sdc_lld.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-05-02 19:49:35 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-05-02 19:49:35 +0000
commitf6ed2f2a8427129c0d24dee81536dbcedaf2d793 (patch)
treefafc7709771520163186d980bb1b29c406f186ad /os/hal/platforms/STM32/sdc_lld.c
parent31456cb4fea72d79b9c1af9a5b0cc7e3fed1ed6e (diff)
downloadChibiOS-f6ed2f2a8427129c0d24dee81536dbcedaf2d793.tar.gz
ChibiOS-f6ed2f2a8427129c0d24dee81536dbcedaf2d793.tar.bz2
ChibiOS-f6ed2f2a8427129c0d24dee81536dbcedaf2d793.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2916 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/sdc_lld.c')
-rw-r--r--os/hal/platforms/STM32/sdc_lld.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c
index b289da8ba..43493d8dd 100644
--- a/os/hal/platforms/STM32/sdc_lld.c
+++ b/os/hal/platforms/STM32/sdc_lld.c
@@ -75,6 +75,7 @@ CH_IRQ_HANDLER(SDIO_IRQHandler) {
void sdc_lld_init(void) {
sdcObjectInit(&SDCD1);
+ SDCD1.thread = NULL;
}
/**
@@ -315,8 +316,16 @@ bool_t sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
* @notapi
*/
bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) {
-
- return TRUE;
+ msg_t msg;
+
+ chSysLock();
+ chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL");
+ sdcp->thread = chThdSelf();
+ chSchGoSleepS(THD_STATE_SUSPENDED);
+ chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #2", "not NULL");
+ msg = chThdSelf()->p_u.rdymsg;
+ chSysUnlock();
+ return msg != RDY_OK;
}
/**