git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14462 27425a3e-05d8-49a3-a47f-9c15f0e5edd8

This commit is contained in:
Giovanni Di Sirio 2021-06-03 19:09:45 +00:00
parent c03d38f78f
commit b5438748ef
2 changed files with 10 additions and 7 deletions

View File

@ -198,7 +198,7 @@
* @brief Enables the WSPI subsystem. * @brief Enables the WSPI subsystem.
*/ */
#if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__) #if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__)
#define HAL_USE_WSPI TRUE #define HAL_USE_WSPI FALSE
#endif #endif
/*===========================================================================*/ /*===========================================================================*/

View File

@ -73,7 +73,8 @@ static void wspi_lld_serve_mdma_interrupt(WSPIDriver *wspip, uint32_t flags) {
(void)wspip; (void)wspip;
(void)flags; (void)flags;
if (wspip->state == WSPI_RECEIVE) { if (((flags & STM32_MDMA_CISR_CTCIF) != 0U) &&
(wspip->state == WSPI_RECEIVE)) {
/* Portable WSPI ISR code defined in the high level driver, note, it is /* Portable WSPI ISR code defined in the high level driver, note, it is
a macro.*/ a macro.*/
_wspi_isr_code(wspip); _wspi_isr_code(wspip);
@ -82,7 +83,7 @@ static void wspi_lld_serve_mdma_interrupt(WSPIDriver *wspip, uint32_t flags) {
} }
/* DMA errors handling.*/ /* DMA errors handling.*/
#if defined(STM32_WSPI_MDMA_ERROR_HOOK) #if defined(STM32_WSPI_MDMA_ERROR_HOOK)
if ((flags & STM32_MDMA_CISR_TEIF) != 0) { else if ((flags & STM32_MDMA_CISR_TEIF) != 0) {
STM32_WSPI_MDMA_ERROR_HOOK(wspip); STM32_WSPI_MDMA_ERROR_HOOK(wspip);
} }
#endif #endif
@ -233,7 +234,6 @@ void wspi_lld_send(WSPIDriver *wspip, const wspi_command_t *cmdp,
STM32_MDMA_CTCR_DINC_FIXED | /* Destination fixed. */ STM32_MDMA_CTCR_DINC_FIXED | /* Destination fixed. */
STM32_MDMA_CTCR_SINC_INC; /* Source incremented. */ STM32_MDMA_CTCR_SINC_INC; /* Source incremented. */
uint32_t ccr = STM32_MDMA_CCR_PL(STM32_WSPI_QUADSPI1_MDMA_PRIORITY) | uint32_t ccr = STM32_MDMA_CCR_PL(STM32_WSPI_QUADSPI1_MDMA_PRIORITY) |
STM32_MDMA_CCR_CTCIE | /* On transfer complete.*/
STM32_MDMA_CCR_TEIE; /* On transfer error. */ STM32_MDMA_CCR_TEIE; /* On transfer error. */
/* MDMA initializations.*/ /* MDMA initializations.*/
@ -361,17 +361,20 @@ void wspi_lld_unmap_flash(WSPIDriver *wspip) {
* @param[in] wspip pointer to the @p WSPIDriver object * @param[in] wspip pointer to the @p WSPIDriver object
*/ */
void wspi_lld_serve_interrupt(WSPIDriver *wspip) { void wspi_lld_serve_interrupt(WSPIDriver *wspip) {
uint32_t sr;
wspip->qspi->FCR = QUADSPI_FCR_CTEF | QUADSPI_FCR_CTCF | sr = wspip->qspi->SR;
QUADSPI_FCR_CSMF | QUADSPI_FCR_CTOF; wspip->qspi->FCR = sr;
if (wspip->state == WSPI_SEND) { if (((sr & QUADSPI_FCR_CTCF) != 0U) && (wspip->state == WSPI_SEND)) {
/* Portable WSPI ISR code defined in the high level driver, note, it is /* Portable WSPI ISR code defined in the high level driver, note, it is
a macro.*/ a macro.*/
_wspi_isr_code(wspip); _wspi_isr_code(wspip);
mdmaChannelDisableX(wspip->mdma); mdmaChannelDisableX(wspip->mdma);
} }
/* TODO errors handling.*/
} }
#endif /* HAL_USE_WSPI */ #endif /* HAL_USE_WSPI */