Skip to content

Commit

Permalink
Simplify spi_abort_asynch()
Browse files Browse the repository at this point in the history
  • Loading branch information
multiplemonomials committed Aug 30, 2023
1 parent 9fda7c3 commit 6907f40
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions targets/TARGET_STM/stm_spi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,16 +1839,8 @@ void spi_abort_asynch(spi_t *obj)
// clean-up
LL_SPI_Disable(SPI_INST(obj));
HAL_SPI_DeInit(handle);
handle->Init.TIMode = SPI_TIMODE_DISABLE; // This will have gotten clobbered by store_spis_pointer()
HAL_SPI_Init(handle);
store_spis_pointer(handle, spiobj);

// cleanup input buffer
spi_flush_rx(obj);
// enable SPI back if it isn't 3-wire mode
if (handle->Init.Direction != SPI_DIRECTION_1LINE) {
LL_SPI_Enable(SPI_INST(obj));
}
init_spi(obj);
}

#endif //DEVICE_SPI_ASYNCH
Expand Down

0 comments on commit 6907f40

Please sign in to comment.