mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/sam3: Use {} notation for empty while loops
This commit is contained in:
parent
5bfd4a59e9
commit
752d481738
@ -53,7 +53,7 @@ void cpuid_get(void *id)
|
||||
EFC1->EEFC_FCR = EEFC_FCR_FKEY(EFC_KEY) | EFC_FCMD_STUI;
|
||||
|
||||
/* Wait for FRDY bit falls */
|
||||
while (EFC1->EEFC_FSR & EEFC_FSR_FRDY);
|
||||
while (EFC1->EEFC_FSR & EEFC_FSR_FRDY) {}
|
||||
|
||||
/* Read UID */
|
||||
cpuid[0] = *(uint32_t *)IFLASH1_ADDR;
|
||||
@ -65,7 +65,7 @@ void cpuid_get(void *id)
|
||||
EFC1->EEFC_FCR = EEFC_FCR_FKEY(EFC_KEY) | EFC_FCMD_SPUI ;
|
||||
|
||||
/* Wait for FRDY bit rises. */
|
||||
while (0 == (EFC1->EEFC_FSR & EEFC_FSR_FRDY));
|
||||
while (0 == (EFC1->EEFC_FSR & EEFC_FSR_FRDY)) {}
|
||||
|
||||
memcpy(id, (void*)cpuid, CPUID_LEN);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ void hwrng_read(uint8_t *buf, unsigned int num)
|
||||
|
||||
while (count < num) {
|
||||
/* wait until new value is generated -> takes up to 84 cycles */
|
||||
while (!(TRNG->TRNG_ISR & TRNG_ISR_DATRDY));
|
||||
while (!(TRNG->TRNG_ISR & TRNG_ISR_DATRDY)) {}
|
||||
/* read 4 byte of random data */
|
||||
uint32_t tmp = TRNG->TRNG_ODATA;
|
||||
/* extract copy bytes to result */
|
||||
|
@ -75,7 +75,7 @@ void spi_poweroff(spi_t dev)
|
||||
switch (dev) {
|
||||
#if SPI_0_EN
|
||||
case SPI_0:
|
||||
while (!(SPI_0_DEV->SPI_SR & SPI_SR_SPIENS)); /* not busy anymore */
|
||||
while (!(SPI_0_DEV->SPI_SR & SPI_SR_SPIENS)) {} /* not busy anymore */
|
||||
SPI_0_CLKDIS();
|
||||
NVIC_DisableIRQ(SPI_0_IRQ);
|
||||
break;
|
||||
@ -324,11 +324,11 @@ int spi_transfer_byte(spi_t dev, char out, char *in)
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (!(spi_port->SPI_SR & SPI_SR_TDRE));
|
||||
while (!(spi_port->SPI_SR & SPI_SR_TDRE)) {}
|
||||
|
||||
spi_port->SPI_TDR = SPI_TDR_TD(out);
|
||||
|
||||
while (!(spi_port->SPI_SR & SPI_SR_RDRF));
|
||||
while (!(spi_port->SPI_SR & SPI_SR_RDRF)) {}
|
||||
|
||||
*in = spi_port->SPI_RDR & SPI_RDR_RD_Msk;
|
||||
|
||||
|
@ -79,7 +79,7 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
|
||||
Uart *dev = uart_config[uart].dev;
|
||||
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
while (!(dev->UART_SR & UART_SR_TXRDY));
|
||||
while (!(dev->UART_SR & UART_SR_TXRDY)) {}
|
||||
dev->UART_THR = data[i];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user