aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-04 15:41:07 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-04 15:41:07 +0000
commit6fd3079b30076770c96098929b58818fce2aedc1 (patch)
tree46874de592137abd74d46fc90bb4e03036113980
parent2d4aff80dcd0db460c00d0efa398a06e9bf522eb (diff)
downloadChibiOS-6fd3079b30076770c96098929b58818fce2aedc1.tar.gz
ChibiOS-6fd3079b30076770c96098929b58818fce2aedc1.tar.bz2
ChibiOS-6fd3079b30076770c96098929b58818fce2aedc1.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3026 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--demos/ARMCM3-STM32F103ZG-FATFS/main.c17
-rw-r--r--os/hal/platforms/STM32/sdc_lld.h1
2 files changed, 16 insertions, 2 deletions
diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c
index 374cf7c4a..f8608ffeb 100644
--- a/demos/ARMCM3-STM32F103ZG-FATFS/main.c
+++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c
@@ -51,9 +51,22 @@ static EventSource inserted_event, removed_event;
*
* @notapi
*/
-static bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
+bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
- return TRUE;
+ return !palReadPad(GPIOF, GPIOF_SD_DETECT);
+}
+
+/**
+ * @brief Protection detection.
+ * @note Not supported.
+ *
+ * @param[in] sdcp pointer to the @p SDCDriver object
+ *
+ * @notapi
+ */
+bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
+
+ return FALSE;
}
/**
diff --git a/os/hal/platforms/STM32/sdc_lld.h b/os/hal/platforms/STM32/sdc_lld.h
index a856fbf2b..5466eacad 100644
--- a/os/hal/platforms/STM32/sdc_lld.h
+++ b/os/hal/platforms/STM32/sdc_lld.h
@@ -190,6 +190,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_is_card_inserted(SDCDriver *sdcp);
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp);
#ifdef __cplusplus
}