PoC: Remove IRQ30 from fw/irqpoc_led_toggle

Removing IRQ30 since it us no longer exist
This commit is contained in:
Mikael Ågren 2024-12-17 13:09:24 +01:00
parent 7f718b298b
commit 38b029f1c4
No known key found for this signature in database
GPG Key ID: E02DA3D397792C46

View File

@ -3,16 +3,15 @@
* SPDX-License-Identifier: GPL-2.0-only * SPDX-License-Identifier: GPL-2.0-only
*/ */
// Triggers both interrupts, one after the other, in an endless loop. The // Example firmware demonstrating setting the LED from the interrupt handler.
// interrupt handler updates the LED color depending on which interrupt
// was triggered.
// The LED color will alterate between blue and green. // The LED color will alterate between blue and green.
// The color will be RED if an interrupt is triggered by an unexpected source.
// //
// | IRQ number | Color | // | Color | Execution context |
// |------------|-------| // |-------|-------------------|
// | 30 | Blue | // | Blue | Firmware loop |
// | 31 | Green | // | Green | IRQ31 |
// | Unexpected | Red | // | Red | Unexpected IRQ |
// //
#include "custom_ops.S" // PicoRV32 custom instructions #include "custom_ops.S" // PicoRV32 custom instructions
@ -27,14 +26,6 @@ _start:
irq_handler: irq_handler:
// PicoRV32 stores the IRQ bitmask in x4. // PicoRV32 stores the IRQ bitmask in x4.
// If bit 31 is 1: IRQ31 was triggered. // If bit 31 is 1: IRQ31 was triggered.
// If bit 30 is 1: IRQ30 was triggered.
irq30_check:
li t4, (1 << 30)
bne x4, t4, irq31_check
call led_blue
call delay
j irq_source_check_done
irq31_check:
li t4, (1 << 31) li t4, (1 << 31)
bne x4, t4, unexpected_irq bne x4, t4, unexpected_irq
call led_green call led_green
@ -48,17 +39,17 @@ irq_source_check_done:
init: init:
li t0, 0x3fffffff // IRQ31 & IRQ30 mask li t0, 0x7fffffff // IRQ31 mask
picorv32_maskirq_insn(zero, t0) // Enable IRQs picorv32_maskirq_insn(zero, t0) // Enable IRQs
irq_trigger_loop: irq_trigger_loop:
call led_blue
call delay
li t0, 0xe1000000 // IRQ31 trigger address li t0, 0xe1000000 // IRQ31 trigger address
sw zero, 0(t0) // Raise IRQ by writing to interrupt trigger address. sw zero, 0(t0) // Raise IRQ by writing to interrupt trigger address.
// Writing any data triggers an interrupt. // Writing any data triggers an interrupt.
li t0, 0xe0000000 // IRQ30 trigger address
sw zero, 0(t0) // Raise IRQ by writing to interrupt trigger address.
// Writing any data triggers an interrupt.
j irq_trigger_loop j irq_trigger_loop
led_red: led_red: