You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/01/31 01:06:38 UTC

[incubator-nuttx] 03/04: arch/mips/pic32mz/pic32mz-lowconsole.c: Wait for transfer complete.

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 73bdb433bbdfde7962732e657219281f2a780221
Author: Ouss4 <ab...@gmail.com>
AuthorDate: Fri Jan 31 00:52:38 2020 +0000

    arch/mips/pic32mz/pic32mz-lowconsole.c: Wait for transfer complete.
    
    Wait for the transfer to complete when using up_lowputc.
---
 arch/mips/src/pic32mz/pic32mz-lowconsole.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/mips/src/pic32mz/pic32mz-lowconsole.c b/arch/mips/src/pic32mz/pic32mz-lowconsole.c
index 21b8125..6c3fa90 100644
--- a/arch/mips/src/pic32mz/pic32mz-lowconsole.c
+++ b/arch/mips/src/pic32mz/pic32mz-lowconsole.c
@@ -493,5 +493,8 @@ void up_lowputc(char ch)
 
   pic32mz_putreg(PIC32MZ_CONSOLE_BASE, PIC32MZ_UART_TXREG_OFFSET,
                  (uint32_t)ch);
+
+  while ((pic32mz_getreg(PIC32MZ_CONSOLE_BASE, PIC32MZ_UART_STA_OFFSET) &
+          UART_STA_UTRMT) == 0);
 #endif
 }