Skip to content
Snippets Groups Projects
Commit 396c2994 authored by Strozzi's avatar Strozzi
Browse files

organize

parent f7177d35
Branches
Tags
No related merge requests found
Pipeline #
...@@ -37,6 +37,7 @@ int Putc (char c) { ...@@ -37,6 +37,7 @@ int Putc (char c) {
else { // Sending smthng else { // Sending smthng
disableInterr(); disableInterr();
ud.ntx--; ud.ntx--;
// STORE AND THEN INCREMENTS
Ud.tx_q[Ud.tx_tl] = c; Ud.tx_q[Ud.tx_tl] = c;
Ud.tx_tl = (Ud.tx_tl + 1)&0xF; // modulo 16 Ud.tx_tl = (Ud.tx_tl + 1)&0xF; // modulo 16
enableInterr(); enableInterr();
......
...@@ -10,13 +10,14 @@ ...@@ -10,13 +10,14 @@
sw $a3, 8*4($k0) sw $a3, 8*4($k0)
sw $v0, 9*4($k0) sw $v0, 9*4($k0)
di jal disableInterr #$v0 = status
nop
andi $a1, $k1, UART_rx_irq # Is this reception? andi $a1, $k1, UART_rx_irq # Is this reception?
beq $a1, $zero, UARTrxinter # no, maybe transmission? beq $a1, $zero, UARTrxinter # no, maybe transmission?
nop nop
andi $a1, $k1, UART_tx_irq # Is this reception? andi $a1, $k1, UART_tx_irq # Is this transmission?
bne $a1, $zero, UARTret # no, maybe transmission? bne $a1, $zero, UARTret # no, it was nothing
nop nop
lui $a2, %hi(ntx) lui $a2, %hi(ntx)
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
addi $a1, $a1, 1 addi $a1, $a1, 1
sw $a1, 0($a2) # update ntx, one more free space sw $a1, 0($a2) # update ntx, one more free space
# STORE AND THEN INCREMENTS
lui $a2, %hi(tx_q) lui $a2, %hi(tx_q)
ori $a2, $a2, %lo(tx_q) ori $a2, $a2, %lo(tx_q)
...@@ -49,11 +51,12 @@ ...@@ -49,11 +51,12 @@
endHU: endHU:
jal enableInterr
nop
lw $v0, 9*4($k0) lw $v0, 9*4($k0)
lw $a3, 8*4($k0) lw $a3, 8*4($k0)
lw $a2, 7*4($k0)
b UARTret b UARTret
ei lw $a2, 7*4($k0)
UARTrxinter: UARTrxinter:
#handle reception #handle reception
...@@ -69,6 +72,7 @@ UARTrxinter: ...@@ -69,6 +72,7 @@ UARTrxinter:
lui $5, %hi(nrx) lui $5, %hi(nrx)
ori $5, $5, %lo(nrx) ori $5, $5, %lo(nrx)
lw $7, 0($5) lw $7, 0($5)
nop
slti $6, $7, 16 slti $6, $7, 16
beq $6, $zero, overrun beq $6, $zero, overrun
nop nop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment