H7 SPI: disable IRQs only when necessary (#1437)

less irq disable

Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
Adeeb Shihadeh 2023-06-03 15:53:16 -07:00 committed by GitHub
parent e1e9bd048d
commit 17ca4171df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 7 deletions

View File

@ -51,12 +51,9 @@ void llspi_miso_dma(uint8_t *addr, int len) {
// master -> panda DMA finished // master -> panda DMA finished
void DMA2_Stream2_IRQ_Handler(void) { void DMA2_Stream2_IRQ_Handler(void) {
// Clear interrupt flag // Clear interrupt flag
ENTER_CRITICAL();
DMA2->LIFCR = DMA_LIFCR_CTCIF2; DMA2->LIFCR = DMA_LIFCR_CTCIF2;
spi_rx_done(); spi_rx_done();
EXIT_CRITICAL();
} }
// panda -> master DMA finished // panda -> master DMA finished
@ -71,8 +68,6 @@ void DMA2_Stream3_IRQ_Handler(void) {
// panda TX finished // panda TX finished
void SPI4_IRQ_Handler(void) { void SPI4_IRQ_Handler(void) {
ENTER_CRITICAL();
// clear flag // clear flag
SPI4->IFCR |= (0x1FFU << 3U); SPI4->IFCR |= (0x1FFU << 3U);
@ -80,8 +75,6 @@ void SPI4_IRQ_Handler(void) {
spi_tx_dma_done = false; spi_tx_dma_done = false;
spi_tx_done(false); spi_tx_done(false);
} }
EXIT_CRITICAL();
} }