From aa3ef774d063244c0fa295849b9f0ba63c6126ef Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Thu, 3 Dec 2015 17:41:21 +0100 Subject: [PATCH] cpu stm32f1 periph spi: simplify condition --- boards/spark-core/system_stm32f1.c | 2 +- cpu/stm32f1/periph/spi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/boards/spark-core/system_stm32f1.c b/boards/spark-core/system_stm32f1.c index c6e081e0dc..3efb60b82f 100644 --- a/boards/spark-core/system_stm32f1.c +++ b/boards/spark-core/system_stm32f1.c @@ -41,7 +41,7 @@ static void set_system_clock(void) } while ((HSE_status == 0) && (startup_counter != HSE_STARTUP_TIMEOUT)); - if ((RCC->CR & RCC_CR_HSERDY) != RESET) { + if (!(RCC->CR & RCC_CR_HSERDY)) { HSE_status = (uint32_t)0x01; } else { diff --git a/cpu/stm32f1/periph/spi.c b/cpu/stm32f1/periph/spi.c index f33d24e4c3..e410099c30 100644 --- a/cpu/stm32f1/periph/spi.c +++ b/cpu/stm32f1/periph/spi.c @@ -207,11 +207,11 @@ int spi_transfer_byte(spi_t dev, char out, char *in) return -1; } - while ((spi->SR & SPI_SR_TXE) == RESET); + while (!(spi->SR & SPI_SR_TXE)); spi->DR = out; transferred++; - while ((spi->SR & SPI_SR_RXNE) == RESET); + while (!(spi->SR & SPI_SR_RXNE)); if (in != NULL) { *in = spi->DR; transferred++;