aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/io/io.dox2
-rw-r--r--os/io/mmc_spi.c9
-rw-r--r--os/io/spi.c6
3 files changed, 14 insertions, 3 deletions
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);