From 6fd3079b30076770c96098929b58818fce2aedc1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 4 Jun 2011 15:41:07 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3026 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103ZG-FATFS/main.c | 17 +++++++++++++++-- os/hal/platforms/STM32/sdc_lld.h | 1 + 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 } -- cgit v1.2.3