Skip to content

Commit 2854b57

Browse files
committed
[M2351] Remove dead code with '#if 0' in SPI
1 parent d3c6478 commit 2854b57

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/spi_api.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,8 @@ void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx,
450450
* To fix it, we don't enable SPI TX/RX threshold interrupts but keep SPI vector handler set to be called
451451
* in PDMA TX/RX transfer done interrupt handlers (spi_dma_handler_tx/spi_dma_handler_rx).
452452
*/
453-
#if 0
454-
spi_enable_vector_interrupt(obj, handler, 1);
455-
#else
456453
NVIC_SetVector(modinit->irq_n, handler);
457-
#endif
454+
458455
/* Order to enable PDMA TX/RX functions
459456
*
460457
* H/W spec: In SPI Master mode with full duplex transfer, if both TX and RX PDMA functions are
@@ -465,17 +462,9 @@ void spi_master_transfer(spi_t *obj, const void *tx, size_t tx_length, void *rx,
465462
*
466463
* With the above conflicts, we enable PDMA TX/RX functions simultaneously.
467464
*/
468-
#if 0
469-
SPI_TRIGGER_RX_PDMA(((SPI_T *) NU_MODBASE(obj->spi.spi)));
470-
SPI_TRIGGER_TX_PDMA(((SPI_T *) NU_MODBASE(obj->spi.spi)));
471-
#else
472465
spi_base->PDMACTL |= (SPI_PDMACTL_TXPDMAEN_Msk | SPI_PDMACTL_RXPDMAEN_Msk);
473-
#endif
474466

475467
/* Don't enable SPI TX/RX threshold interrupts as commented above */
476-
#if 0
477-
spi_master_enable_interrupt(obj, 1);
478-
#endif
479468
}
480469
}
481470

0 commit comments

Comments
 (0)