From 727ba84c9b99c7a1e06bf344b58c55f24472e5ba Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 9 Nov 2009 20:47:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1278 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/io/io.dox | 2 ++ os/io/mmc_spi.c | 9 ++++++++- os/io/spi.c | 6 ++++-- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'os') diff --git a/os/io/io.dox b/os/io/io.dox index 402c2e4ad..fa6a4e989 100644 --- a/os/io/io.dox +++ b/os/io/io.dox @@ -156,7 +156,9 @@ ready -> stop [label="spiStop()"]; stop -> stop [label="spiStop()"]; ready -> active [label="spiSelect()"]; + active -> active [label="spiSelect()"]; active -> ready [label="spiUnselect()"]; + ready -> ready [label="spiUnselect()"]; active -> active [label="spiExchange()\nspiSend()\nspiReceive()"]; } * @enddot diff --git a/os/io/mmc_spi.c b/os/io/mmc_spi.c index 20d7162ec..009085ec8 100644 --- a/os/io/mmc_spi.c +++ b/os/io/mmc_spi.c @@ -184,7 +184,14 @@ void mmcInit(void) { /** * @brief Initializes an instance. * - * @param[in] mmcp pointer to the @p MMCDriver object + * @param[in] mmcp pointer to the @p MMCDriver object + * @param[in] spip pointer to the SPI driver to be used as interface + * @param[in] lscfg low speed configuration for the SPI driver + * @param[in] hscfg high speed configuration for the SPI driver + * @param[in] is_protected function that returns the card write protection + * setting + * @param[in] is_inserted function that returns the card insertion sensor + * status */ void mmcObjectInit(MMCDriver *mmcp, SPIDriver *spip, const SPIConfig *lscfg, const SPIConfig *hscfg, diff --git a/os/io/spi.c b/os/io/spi.c index 11247f24a..5ece51b77 100644 --- a/os/io/spi.c +++ b/os/io/spi.c @@ -99,7 +99,8 @@ void spiSelect(SPIDriver *spip) { chDbgCheck(spip != NULL, "spiSelect"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_READY, + chDbgAssert((spip->spd_state == SPI_READY) || + (spip->spd_state == SPI_ACTIVE), "spiSelect(), #1", "not idle"); spi_lld_select(spip); @@ -118,7 +119,8 @@ void spiUnselect(SPIDriver *spip) { chDbgCheck(spip != NULL, "spiUnselect"); chSysLock(); - chDbgAssert(spip->spd_state == SPI_ACTIVE, + chDbgAssert((spip->spd_state == SPI_READY) || + (spip->spd_state == SPI_ACTIVE), "spiUnselect(), #1", "not locked"); spi_lld_unselect(spip); -- cgit v1.2.3