From 1cb73496ae2869fcde90d2fd6d0e965938185f65 Mon Sep 17 00:00:00 2001
From: "Israel B. Sant'Anna" <ibsa14@inf.ufpr.br>
Date: Wed, 17 Jun 2015 15:37:19 -0300
Subject: [PATCH] Transmission finally working! \o/

Signed-off-by: Israel B. Sant'Anna <ibsa14@inf.ufpr.br>
---
 cMIPS/tests/uart.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/cMIPS/tests/uart.c b/cMIPS/tests/uart.c
index b136521..3d96284 100644
--- a/cMIPS/tests/uart.c
+++ b/cMIPS/tests/uart.c
@@ -65,14 +65,9 @@ extern UARTDriver Ud;
 volatile Tserial *uart;
 
 int main(){
-    int i;
-    volatile int state;    // tell GCC not to optimize away code
-    volatile Tstatus status;
-    volatile char c;
     uart = (void *)IO_UART_ADDR; // bottom of UART address range
     Tcontrol ctrl;
 
-
     ctrl.ign   = 0;
     ctrl.intTX = 1;
     ctrl.intRX = 1;
@@ -80,12 +75,10 @@ int main(){
     uart->cs.ctl = ctrl;
 
     initUd();
-    char last = EOF;
-    // FIXME: Não tah saindo do while (por causa do ctrl.intTX =1)
-    while(!((c = getc()) == '\n' && c == last)) {
+    volatile char c;
+    
+    while((c = getc()) != '\0') {
         if(c != EOF) {
-            print(c);
-            last = c;
             Putc(c);
         }
     }
@@ -96,7 +89,9 @@ int main(){
         Ud.ntx++;
         enableInterr();
     }
-    while(1);
+
+    int cont;
+    for(cont=0;cont<1000;cont++);  //Wait for the remote uart
     
     // while((c = getc()) != '\0') {
     //     if(c != EOF) {
-- 
GitLab