Skip to content
Snippets Groups Projects
Commit 954c0f55 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Implementada parte de recepção do handler (incompleto)

parent 711cef3e
No related branches found
No related tags found
No related merge requests found
......@@ -8,11 +8,25 @@ RX:
lui $a0, %hi(HW_uart_addr)
ori $a0, $a0, %lo(HW_uart_addr)
lw $a1, 4($a0) # Read data
nop # and store it to UART's buffer
sw $a1, 4($k0) # and return from interrupt
addiu $a1, $zero, 1
sw $a1, 8($k0) # Signal new arrival
# TODO: Read data, store it to buffer and decrement nrx (we're reading a char)
lui $a0, %hi(rx_queue)
ori $a0, $a0, %lo(rx_queue)
sw $a1, 0($a0) # Put data on RX_queue
lui $a0, %hi(rx_tl)
ori $a0, $a0, %lo(rx_tl)
lw $a1, 0($a0) # Read rx_tl
nop
addiu $a1, $a1, 1 # Increment rx_tl (shouldn't it be (rx_tl+1)%16 ?)
sw $a1, 0($a0) # Save rx_tl
lui $a0, %hi(nrx)
ori $a0, $a0, %lo(nrx)
lw $a1, 0($a0) # Read nrx
nop
addiu $a1, $a1, 1 # Increment nrx
sw $a1, 0($a0) # Save incremented nrx
TX:
andi $a0, $k1, UART_tx_irq # Is this transmission?
beq $a0, $zero, END # no, end handler
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment