Skip to content

Commit

Permalink
Remove a test from the bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
robotman2412 committed Jan 14, 2024
1 parent 6456b08 commit 1dd0b90
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions prog/bootloader/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ void p_speed() {
}

// Wait for UART to finish sending.
while (UART0.status.tx_busy || UART0.status.rx_hasdat);
while (UART0.status.tx_busy || UART0.status.rx_hasdat)
;
// Configure new frequency.
UART0.clk_div = divider;
}
Expand Down Expand Up @@ -298,32 +299,11 @@ void main() {
mtime = 0;
GPIO.oe = 1 << 8;
GPIO.port = 1 << 8;
while (mtime < 100000);
while (mtime < 100000) continue;
GPIO.oe = 0;
GPIO.port = 0;
}

// AMO test.
uint32_t register tmp;
uint32_t volatile storage = 0xffff0000;
asm volatile("lr.w.aq %0, (%1)" : "=r"(tmp) : "r"(&storage));
asm volatile("c.nop");
asm volatile("c.nop");
asm volatile("c.nop 4");
asm volatile("c.nop");
asm volatile("c.nop");
asm volatile("c.nop");
asm volatile("c.nop 8");
asm volatile("c.nop");
asm volatile("c.nop");
asm volatile("c.nop");
asm volatile("c.nop 12");
asm volatile("c.nop");
asm volatile("c.nop");
asm volatile("c.nop");
asm volatile("sc.w.rl %0, %1, (%2)" : "=r"(tmp) : "r"(19), "r"(&storage));
halt();

while (1) {
if (UART0.status.rx_hasdat) {
handle_rx(UART0.fifo);
Expand Down

0 comments on commit 1dd0b90

Please sign in to comment.