cpu/lpc2387: Use {} notation for empty while loops

This commit is contained in:
Joakim Nohlgård 2016-01-27 09:57:15 +01:00
parent f7ddeb243e
commit 6a52296a35
5 changed files with 19 additions and 22 deletions

View File

@ -92,7 +92,7 @@ __attribute__((naked,noreturn)) void arm_reset(void)
WDMOD = 0x03;
WDFEED= 0xAA;
WDFEED= 0x55;
while(1);
while(1) {}
}
/** @} */

View File

@ -164,8 +164,7 @@ bool i2c_stop(uint8_t i2c_interface)
I20CONCLR = I2CONCLR_SIC; /* Clear SI flag */
/*--- Wait for STOP detected ---*/
while (I20CONSET & I2CONSET_STO)
;
while (I20CONSET & I2CONSET_STO) {}
break;
@ -175,8 +174,7 @@ bool i2c_stop(uint8_t i2c_interface)
I21CONCLR = I2CONCLR_SIC; /* Clear SI flag */
/*--- Wait for STOP detected ---*/
while (I21CONSET & I2CONSET_STO)
;
while (I21CONSET & I2CONSET_STO) {}
break;
@ -185,8 +183,7 @@ bool i2c_stop(uint8_t i2c_interface)
I22CONCLR = I2CONCLR_SIC; /* Clear SI flag */
/*--- Wait for STOP detected ---*/
while (I22CONSET & I2CONSET_STO)
;
while (I22CONSET & I2CONSET_STO) {}
}
// puts("...i2c_stop ended\n");

View File

@ -555,9 +555,10 @@ DSTATUS MCI_initialize(void)
/* The card can work at vdd range of 2.7-3.6V */
DEBUG("SDC Ver. 2\n");
do { /* Wait while card is busy state (use ACMD41 with HCS bit) */
do {
/* Wait while card is busy state (use ACMD41 with HCS bit) */
/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
if (xtimer_now() > start + 1000000/*!Timer[0]*/) {
if (xtimer_now() > start + 1000000/* !Timer[0] */) {
DEBUG("%s, %d: Timeout #1\n", RIOT_FILE_RELATIVE, __LINE__);
goto di_fail;
}
@ -578,11 +579,12 @@ DSTATUS MCI_initialize(void)
cmd = CMD1; /* ACMD41 is rejected -> MMC */
}
do { /* Wait while card is busy state (use ACMD41 or CMD1) */
do {
/* Wait while card is busy state (use ACMD41 or CMD1) */
DEBUG("%s, %d: %lX\n", RIOT_FILE_RELATIVE, __LINE__, resp[0]);
/* This loop will take a time. Insert wai_tsk(1) here for multitask envilonment. */
if (xtimer_now() > start + 1000000/*!Timer[0]*/) {
if (xtimer_now() > start + 1000000/* !Timer[0] */) {
DEBUG("now: %lu, started at: %lu\n", xtimer_now(), start);
DEBUG("%s, %d: Timeout #2\n", RIOT_FILE_RELATIVE, __LINE__);
goto di_fail;
@ -745,8 +747,7 @@ DRESULT MCI_read(unsigned char *buff, unsigned long sector, unsigned char count)
}
buff += 512; /* Next user buffer address */
}
while (--count);
} while (--count);
if (cmd == CMD18) { /* Terminate to read (MB) */
send_cmd(CMD12, 0, 1, &resp);
@ -846,10 +847,10 @@ DRESULT MCI_write(const unsigned char *buff, unsigned long sector, unsigned char
}
count--;
buff += 512; /* Next user buffer address */
buff += 512; /* Next user buffer address */
}
while (!(XferStat & 0xC)); /* Wait for all blocks sent (block underrun) */
while (!(XferStat & 0xC)) {} /* Wait for all blocks sent (block underrun) */
if (XferStat & 0x8) {
count = 1; /* Abort if any MCI error has occured */
@ -996,7 +997,7 @@ DRESULT MCI_ioctl(
if (send_cmd(ACMD13, 0, 1, resp) /* Start to read */
&& !(resp[0] & 0xC0580000)) {
while ((XferWp == 0) && !(XferStat & 0xC));
while ((XferWp == 0) && !(XferStat & 0xC)) {}
if (!(XferStat & 0xC)) {
Copy_al2un((unsigned char *)buff, DmaBuff[0], 64);

View File

@ -172,10 +172,10 @@ int spi_release(spi_t dev)
int spi_transfer_byte(spi_t dev, char out, char *in)
{
(void) dev;
while (!SPI_TX_EMPTY);
while (!SPI_TX_EMPTY) {}
SSP0DR = out;
while (SPI_BUSY);
while (!SPI_RX_AVAIL);
while (SPI_BUSY) {}
while (!SPI_RX_AVAIL) {}
char tmp = (char)SSP0DR;

View File

@ -73,7 +73,7 @@ void uart_write(uart_t uart, const uint8_t *data, size_t len)
{
(void) uart;
for (size_t i = 0; i < len; i++) {
while (!(U0LSR & BIT5));
while (!(U0LSR & BIT5)) {}
U0THR = data[i];
}
}
@ -86,8 +86,7 @@ void UART0_IRQHandler(void)
do {
char c = (char)U0RBR;
_rx_cb(_cb_arg, c);
}
while (U0LSR & ULSR_RDR);
} while (U0LSR & ULSR_RDR);
break;
default: