Skip to content
Snippets Groups Projects
Commit 92f26f25 authored by Roberto Hexsel's avatar Roberto Hexsel
Browse files

two fixes to UART experiments

parent 1ba27cc9
Branches
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@
.bss
.align 2
.set noreorder
.global _counter_val # accumulate number of interrupts
.comm _counter_val 4
.comm _counter_saves 8*4 # area to save up to 8 registers
......@@ -31,7 +32,8 @@ extCounter:
#----------------------------------
# save additional registers
# la $k1, _counter_saves
# lui $k1, %hi(_counter_saves)
# ori $k1, $k1, %lo(_counter_saves)
# sw $a0, 0*4($k1)
# sw $a1, 1*4($k1)
#----------------------------------
......@@ -48,8 +50,9 @@ extCounter:
sw $k1,0($k0)
#----------------------------------
# and then restore same registers
# la $k1, _counter_saves
# and then restore those same registers
# lui $k1, %hi(_counter_saves)
# ori $k1, $k1, %lo(_counter_saves)
# lw $a0, 0*4($k1)
# lw $a1, 1*4($k1)
#----------------------------------
......@@ -69,6 +72,7 @@ extCounter:
.bss
.align 2
.set noreorder
.global rx_queue,rx_hd,rx_tl # reception queue and pointers
.comm rx_queue 16
.comm rx_hd 4
......@@ -201,4 +205,3 @@ cmips_delay:
nop
.end cmips_delay
#----------------------------------------------------------------
\ No newline at end of file
......@@ -14,13 +14,12 @@ void main(void) {
int i, increased, new, old, newValue;
newValue = CNT_VALUE;
startCounter(newValue, 0); // no interrupts
for (i=0; i < N; i++) { // repeat N rounds
print(i); // print number of round
newValue = CNT_VALUE + (i<<3);
startCounter(newValue, 0); // num cycles increases with i
startCounter(newValue, 0); // num cycles increases with i, no interrupts
increased = TRUE;
old = 0;
......
......@@ -44,7 +44,7 @@ typedef struct serial {
#define LONG_STRING 1
#if LONG_STRING
char *dog = "\n\tthe quick brown fox jumps over the lazy dog\n";
char *dog = "\tthe quick brown fox jumps over the lazy dog";
char s[32];
#else
char s[32]; // = "123";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment