@@ -162,8 +162,6 @@ status_t DSPI_MasterTransferEDMA(SPI_Type *base, dspi_master_edma_handle_t *hand
162
162
163
163
handle -> txBuffIfNull = ((uint32_t )DSPI_DUMMY_DATA << 8 ) | DSPI_DUMMY_DATA ;
164
164
165
- handle -> state = kDSPI_Busy ;
166
-
167
165
dspi_command_data_config_t commandStruct ;
168
166
DSPI_StopTransfer (base );
169
167
DSPI_FlushFifo (base , true, true);
@@ -222,6 +220,8 @@ status_t DSPI_MasterTransferEDMA(SPI_Type *base, dspi_master_edma_handle_t *hand
222
220
return kStatus_InvalidArgument ;
223
221
}
224
222
223
+ handle -> state = kDSPI_Busy ;
224
+
225
225
DSPI_DisableDMA (base , kDSPI_RxDmaEnable | kDSPI_TxDmaEnable );
226
226
227
227
EDMA_SetCallback (handle -> edmaRxRegToRxDataHandle , EDMA_DspiMasterCallback ,
@@ -706,13 +706,13 @@ static void EDMA_DspiMasterCallback(edma_handle_t *edmaHandle,
706
706
707
707
DSPI_DisableDMA ((dspiEdmaPrivateHandle -> base ), kDSPI_RxDmaEnable | kDSPI_TxDmaEnable );
708
708
709
+ dspiEdmaPrivateHandle -> handle -> state = kDSPI_Idle ;
710
+
709
711
if (dspiEdmaPrivateHandle -> handle -> callback )
710
712
{
711
713
dspiEdmaPrivateHandle -> handle -> callback (dspiEdmaPrivateHandle -> base , dspiEdmaPrivateHandle -> handle ,
712
714
kStatus_Success , dspiEdmaPrivateHandle -> handle -> userData );
713
715
}
714
-
715
- dspiEdmaPrivateHandle -> handle -> state = kDSPI_Idle ;
716
716
}
717
717
718
718
void DSPI_MasterTransferAbortEDMA (SPI_Type * base , dspi_master_edma_handle_t * handle )
0 commit comments