stmhal: Fix hardfault when configured as a SPI slave

modjni
Dave Hylands 2015-08-04 23:36:01 -07:00 committed by Damien George
parent 5e11d2b349
commit 8a1a5c236d
1 changed files with 3 additions and 1 deletions

View File

@ -546,7 +546,9 @@ STATIC mp_obj_t pyb_spi_recv(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_
if (status == HAL_OK) {
status = spi_wait_dma_finished(self->spi, args[1].u_int);
}
dma_deinit(&tx_dma);
if (self->spi->hdmatx != NULL) {
dma_deinit(&tx_dma);
}
dma_deinit(&rx_dma);
}