Skip to content

Commit

Permalink
[STM32F4 HAL] Avoid SPI spurious interrupt
Browse files Browse the repository at this point in the history
If SPI TXE is not disabled at the end of transfer, MBED application
callback that is registered for transfer completion might be called twice
  • Loading branch information
Laurent MEUNIER committed Sep 20, 2016
1 parent 00086a6 commit 04fe4d2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,7 @@ static void SPI_TxISR_8BIT(struct __SPI_HandleTypeDef *hspi)
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
}
#endif /* USE_SPI_CRC */
__HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE));
SPI_CloseTx_ISR(hspi);
}
}
Expand All @@ -2476,6 +2477,7 @@ static void SPI_TxISR_16BIT(struct __SPI_HandleTypeDef *hspi)
SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT);
}
#endif /* USE_SPI_CRC */
__HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE));
SPI_CloseTx_ISR(hspi);
}
}
Expand Down

0 comments on commit 04fe4d2

Please sign in to comment.