diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-05-10 17:32:30 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-05-10 17:32:30 +0000 |
commit | 1ae88ebc04851174eae446506f09463b5656ebdd (patch) | |
tree | 9bb3103a163e0e2b8bb83f3cfcf14f67dce13bef | |
parent | 7e815ba913fb19597eddd708aaef789e3674093d (diff) | |
download | ChibiOS-1ae88ebc04851174eae446506f09463b5656ebdd.tar.gz ChibiOS-1ae88ebc04851174eae446506f09463b5656ebdd.tar.bz2 ChibiOS-1ae88ebc04851174eae446506f09463b5656ebdd.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4184 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/platforms/STM32/sdc_lld.c | 18 | ||||
-rw-r--r-- | os/hal/platforms/STM32/sdc_lld.h | 1 | ||||
-rw-r--r-- | os/hal/src/sdc.c | 6 |
3 files changed, 22 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index ebed7cfa2..854a1b1e8 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -775,6 +775,24 @@ bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk, return sdc_lld_write_aligned(sdcp, startblk, buf, n);
}
+/**
+ * @brief Waits for card idle condition.
+ *
+ * @param[in] sdcp pointer to the @p SDCDriver object
+ *
+ * @return The operation status.
+ * @retval CH_SUCCESS the operation succeeded.
+ * @retval CH_FAILED the operation failed.
+ *
+ * @api
+ */
+bool_t sdc_lld_sync(SDCDriver *sdcp) {
+
+ /* TODO: Implement.*/
+ (void)sdcp;
+ return CH_SUCCESS;
+}
+
#endif /* HAL_USE_SDC */
/** @} */
diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h index b89ad2586..292688e40 100644 --- a/os/hal/platforms/STM32/sdc_lld.h +++ b/os/hal/platforms/STM32/sdc_lld.h @@ -314,6 +314,7 @@ extern "C" { uint8_t *buf, uint32_t n);
bool_t sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
const uint8_t *buf, uint32_t n);
+ bool_t sdc_lld_sync(SDCDriver *sdcp);
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp);
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp);
#ifdef __cplusplus
diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index 7722a0eb7..653819bb3 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -443,8 +443,10 @@ sdcflags_t sdcGetAndClearErrors(SDCDriver *sdcp) { chDbgCheck(sdcp != NULL, "sdcGetAndClearErrors");
+ chSysLock();
sdcflags_t flags = sdcp->errors;
sdcp->errors = SDC_NO_ERROR;
+ chSysUnlock();
return flags;
}
@@ -470,9 +472,7 @@ bool_t sdcSync(SDCDriver *sdcp) { }
chSysUnlock();
- /* TODO: implement.*/
-
- return CH_SUCCESS;
+ return sdc_lld_sync(sdcp);
}
/**
|