aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/QUADSPIv1
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/QUADSPIv1')
-rw-r--r--os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c
index 5ef7b7f62..66b5696d6 100644
--- a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c
+++ b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_wspi_lld.c
@@ -52,6 +52,15 @@ WSPIDriver WSPID1;
/*===========================================================================*/
/**
+ * @brief Waits for completion of previous operation.
+ */
+static inline void wspi_lld_sync(WSPIDriver *wspip) {
+
+ while ((wspip->qspi->SR & QUADSPI_SR_BUSY) != 0U) {
+ }
+}
+
+/**
* @brief Shared service routine.
*
* @param[in] wspip pointer to the @p WSPIDriver object
@@ -232,6 +241,9 @@ void wspi_lld_command(WSPIDriver *wspip, const wspi_command_t *cmdp) {
if ((cmdp->cfg & WSPI_CFG_ADDR_MODE_MASK) != WSPI_CFG_ADDR_MODE_NONE) {
wspip->qspi->AR = cmdp->addr;
}
+
+ /* Waiting for the previous operation to complete.*/
+ wspi_lld_sync(wspip);
}
/**