Fix spi_handle_data_dma

pull/107/head
xiangbingj 2019-11-08 13:36:21 +08:00
parent 5d96164352
commit 1e5f460dfd
2 changed files with 6 additions and 6 deletions

View File

@ -33,7 +33,7 @@ extern "C" {
#define KENDRYTE_MIN(a, b) ((a) > (b) ? (b) : (a))
#define KENDRYTE_MAX(a, b) ((a) > (b) ? (a) : (b))
#define FIX_CACHE 0
#define FIX_CACHE 1
#ifdef __ASSEMBLY__
#define KENDRYTE_CAST(type, ptr) ptr

View File

@ -1467,7 +1467,7 @@ void spi_handle_data_dma(spi_device_num_t spi_num, spi_chip_select_t chip_select
DMAC_MSIZE_1, DMAC_TRANS_WIDTH_32, data.rx_len);
spi_handle->ser = 1U << chip_select;
if(!cb)
dmac_wait_idle(data.rx_channel);
dmac_wait_done(data.rx_channel);
break;
case SPI_TMOD_TRANS:
spi_set_tmod(spi_num, SPI_TMOD_TRANS);
@ -1489,7 +1489,7 @@ void spi_handle_data_dma(spi_device_num_t spi_num, spi_chip_select_t chip_select
spi_handle->ser = 1U << chip_select;
if(!cb)
{
dmac_wait_idle(data.tx_channel);
dmac_wait_done(data.tx_channel);
while((spi_handle->sr & 0x05) != 0x04)
;
}
@ -1518,7 +1518,7 @@ void spi_handle_data_dma(spi_device_num_t spi_num, spi_chip_select_t chip_select
DMAC_MSIZE_1, DMAC_TRANS_WIDTH_32, data.rx_len);
spi_handle->ser = 1U << chip_select;
if(!cb)
dmac_wait_idle(data.rx_channel);
dmac_wait_done(data.rx_channel);
break;
case SPI_TMOD_TRANS_RECV:
spi_set_tmod(spi_num, SPI_TMOD_TRANS_RECV);
@ -1553,8 +1553,8 @@ void spi_handle_data_dma(spi_device_num_t spi_num, spi_chip_select_t chip_select
spi_handle->ser = 1U << chip_select;
if(!cb)
{
dmac_wait_idle(data.tx_channel);
dmac_wait_idle(data.rx_channel);
dmac_wait_done(data.tx_channel);
dmac_wait_done(data.rx_channel);
}
break;
}