From 1248da288ff84b375c4cde34fb4fa884df24dbd5 Mon Sep 17 00:00:00 2001 From: Roberto Hexsel <roberto@inf.ufpr.br> Date: Thu, 28 May 2015 22:40:31 -0300 Subject: [PATCH] UART data structure Ud --- cMIPS/include/handlers.s | 14 ++++++-------- cMIPS/tests/uart_irx.c | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/cMIPS/include/handlers.s b/cMIPS/include/handlers.s index e39b4c2..2ecddca 100644 --- a/cMIPS/include/handlers.s +++ b/cMIPS/include/handlers.s @@ -73,18 +73,16 @@ extCounter: .bss .align 2 .set noreorder - .global rx_queue,rx_hd,rx_tl # reception queue and pointers - .comm rx_queue 16 + .global Ud +Ud: .comm rx_queue 16 # reception queue and pointers .comm rx_hd 4 .comm rx_tl 4 - .global tx_queue,tx_hd,tx_tl # transmission queue and pointers - .comm tx_queue 16 + .comm tx_queue 16 # transmission queue and pointers .comm tx_hd 4 .comm tx_tl 4 - .global nrx,ntx - .comm nrx 4 # characters in RX_queue - .comm ntx 4 # spaces left in TX_queue - .comm _uart_buff 16*4 # up to 16 registers to be saved here + .comm nrx 4 # characters in RX_queue + .comm ntx 4 # spaces left in TX_queue + .comm _uart_buff 16*4 # up to 16 registers to be saved here .set UART_rx_irq,0x08 .set UART_tx_irq,0x10 diff --git a/cMIPS/tests/uart_irx.c b/cMIPS/tests/uart_irx.c index 966c836..1641f47 100644 --- a/cMIPS/tests/uart_irx.c +++ b/cMIPS/tests/uart_irx.c @@ -35,8 +35,8 @@ typedef union data { // data registers on same address } Tdata; typedef struct serial { - TctlStat cs; - Tdata d; + TctlStat cs; // @ (int *)IO_UART_ADDR + Tdata d; // @ (int *)(IO_UART_ADDR+1) } Tserial; @@ -56,7 +56,7 @@ int main(void) { // receive a string through the UART serial interface ctrl.speed = 1; // operate at 1/2 of the highest data rate uart->cs.ctl = ctrl; - // handler sets flag=bfr[2] to 1 after new character is read; + // handler sets flag=bfr[2] to 1 after new character is received; // this program resets the flag on fetching a new character from buffer c = (char)bfr[2]; // interrupt handler's flag -- GitLab