diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-06-10 15:01:49 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-06-17 12:58:33 +0200 |
commit | af69a8693b4f4a7f1ea41d2948c3550a46ae6e17 (patch) | |
tree | 70396dad726a196df3699357ab439390604c0502 /bsps/shared/grlib/uart/apbuart_polled.c | |
parent | grlib: Remove NL -> CR in apbuart_outbyte_polled() (diff) | |
download | rtems-af69a8693b4f4a7f1ea41d2948c3550a46ae6e17.tar.bz2 |
grlib: Add apbuart_outbyte_wait()
Diffstat (limited to 'bsps/shared/grlib/uart/apbuart_polled.c')
-rw-r--r-- | bsps/shared/grlib/uart/apbuart_polled.c | 30 |
1 files changed, 15 insertions, 15 deletions
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) |