Skip to content

Commit 0f85516

Browse files
committed
Reformat targets/TARGET_STM/stm_spi_api.c file with astyle
1 parent 536f998 commit 0f85516

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

targets/TARGET_STM/stm_spi_api.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,8 @@ static const uint32_t baudrate_prescaler_table[] = {SPI_BAUDRATEPRESCALER_2,
606606
SPI_BAUDRATEPRESCALER_256
607607
};
608608

609-
static uint8_t spi_get_baudrate_prescaler_rank(uint32_t value) {
609+
static uint8_t spi_get_baudrate_prescaler_rank(uint32_t value)
610+
{
610611
#if TARGET_STM32H7
611612
return value >> 28 & 0x07;
612613
#else /* TARGET_STM32H7 */
@@ -802,7 +803,8 @@ static inline int datasize_to_transfer_bitshift(uint32_t DataSize)
802803
/**
803804
* Check if SPI is busy in master mode.
804805
*/
805-
static inline int msp_busy(spi_t *obj) {
806+
static inline int msp_busy(spi_t *obj)
807+
{
806808
int status;
807809
struct spi_s *spiobj = SPI_S(obj);
808810
SPI_HandleTypeDef *handle = &(spiobj->handle);
@@ -1317,7 +1319,8 @@ void spi_abort_asynch(spi_t *obj)
13171319
HAL_SPI_Init(handle);
13181320
/* Cleanup overrun as it isn't done by HAL_SPI_Init */
13191321
__HAL_SPI_CLEAR_OVRFLAG(handle);
1320-
if (handle->Init.Direction == SPI_DIRECTION_2LINES) {
1322+
/* SPI should be disabled in 1 line mode in idle state. */
1323+
if (handle->Init.Direction != SPI_DIRECTION_1LINE) {
13211324
LL_SPI_Enable(SPI_INST(obj));
13221325
}
13231326
}

0 commit comments

Comments
 (0)