diff options
Diffstat (limited to 'bsps/shared')
-rw-r--r-- | bsps/shared/grlib/uart/apbuart_cons.c | 2 | ||||
-rw-r--r-- | bsps/shared/grlib/uart/apbuart_polled.c | 30 | ||||
-rw-r--r-- | bsps/shared/grlib/uart/apbuart_termios.c | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/bsps/shared/grlib/uart/apbuart_cons.c b/bsps/shared/grlib/uart/apbuart_cons.c index e7dda50565..a0a265ab31 100644 --- a/bsps/shared/grlib/uart/apbuart_cons.c +++ b/bsps/shared/grlib/uart/apbuart_cons.c @@ -641,7 +641,7 @@ static void write_polled( int nwrite = 0; while (nwrite < len) { - apbuart_outbyte_polled(uart->regs, *buf++, 0); + apbuart_outbyte_polled(uart->regs, *buf++); nwrite++; } } diff --git a/bsps/shared/grlib/uart/apbuart_polled.c b/bsps/shared/grlib/uart/apbuart_polled.c index 948e0966b8..8a596808b2 100644 --- a/bsps/shared/grlib/uart/apbuart_polled.c +++ b/bsps/shared/grlib/uart/apbuart_polled.c @@ -9,27 +9,27 @@ #include <grlib/apbuart.h> -void apbuart_outbyte_polled( - struct apbuart_regs *regs, - unsigned char ch, - int wait_sent -) +#include <rtems/score/cpuimpl.h> + +void apbuart_outbyte_wait(const struct apbuart_regs *regs) { while ( (regs->status & APBUART_STATUS_TE) == 0 ) { /* Lower bus utilization while waiting for UART */ - __asm__ volatile ("nop"::); __asm__ volatile ("nop"::); - __asm__ volatile ("nop"::); __asm__ volatile ("nop"::); - __asm__ volatile ("nop"::); __asm__ volatile ("nop"::); - __asm__ volatile ("nop"::); __asm__ volatile ("nop"::); + _CPU_Instruction_no_operation(); + _CPU_Instruction_no_operation(); + _CPU_Instruction_no_operation(); + _CPU_Instruction_no_operation(); + _CPU_Instruction_no_operation(); + _CPU_Instruction_no_operation(); + _CPU_Instruction_no_operation(); + _CPU_Instruction_no_operation(); } +} +void apbuart_outbyte_polled(struct apbuart_regs *regs, char ch) +{ + apbuart_outbyte_wait(regs); regs->data = (unsigned int) ch; - - /* Wait until the character has been sent? */ - if (wait_sent) { - while ((regs->status & APBUART_STATUS_TE) == 0) - ; - } } int apbuart_inbyte_nonblocking(struct apbuart_regs *regs) diff --git a/bsps/shared/grlib/uart/apbuart_termios.c b/bsps/shared/grlib/uart/apbuart_termios.c index 5fb69902fe..9014a1c735 100644 --- a/bsps/shared/grlib/uart/apbuart_termios.c +++ b/bsps/shared/grlib/uart/apbuart_termios.c @@ -78,7 +78,7 @@ static void apbuart_write_polled( size_t nwrite = 0; while (nwrite < len) { - apbuart_outbyte_polled(uart->regs, *buf++, 0); + apbuart_outbyte_polled(uart->regs, *buf++); nwrite++; } } |