From 07eb83d66f2372ddc40d67031493f46d877c236a Mon Sep 17 00:00:00 2001 From: stnolting Date: Sun, 20 Oct 2024 19:43:55 +0200 Subject: [PATCH] [sw/example] adjust XIRQ programs --- sw/example/demo_xirq/main.c | 7 +------ sw/example/processor_check/main.c | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sw/example/demo_xirq/main.c b/sw/example/demo_xirq/main.c index 9349b6517..ce81d3ca7 100644 --- a/sw/example/demo_xirq/main.c +++ b/sw/example/demo_xirq/main.c @@ -155,8 +155,6 @@ int main() { // All incoming XIRQ interrupt requests are "prioritized" in this example. The XIRQ FIRQ handler // reads the ID of the interrupt with the highest priority from the XIRQ controller ("source" register) and calls the according // handler function (installed via neorv32_xirq_install();). - // Non-prioritized handling of interrupts (or custom prioritization) can be implemented by manually reading the - // XIRQ controller's "pending" register. Then it is up to the software to define which pending IRQ should be serviced first. asm volatile ("nop"); asm volatile ("nop"); @@ -165,15 +163,12 @@ int main() { // just as an example: to disable certain XIRQ interrupt channels, we can - // un-install the according handler. this will also clear a pending interrupt for that channel + // un-install the according handler. this will also disable the according channel. neorv32_xirq_uninstall(0); // disable XIRQ channel 0 and remove associated handler neorv32_xirq_uninstall(1); // disable XIRQ channel 1 and remove associated handler neorv32_xirq_uninstall(2); // disable XIRQ channel 2 and remove associated handler neorv32_xirq_uninstall(3); // disable XIRQ channel 3 and remove associated handler - // you can also manually clear pending interrupts - neorv32_xirq_clear_pending(0); // clear pending interrupt of channel 0 - // manually enable and disable XIRQ channels neorv32_xirq_channel_enable(0); // enable channel 0 neorv32_xirq_channel_disable(0); // disable channel 0 diff --git a/sw/example/processor_check/main.c b/sw/example/processor_check/main.c index cb687e899..530ec7185 100644 --- a/sw/example/processor_check/main.c +++ b/sw/example/processor_check/main.c @@ -1324,8 +1324,6 @@ int main() { xirq_err_cnt += neorv32_xirq_install(1, xirq_trap_handler1); // install XIRQ IRQ handler channel 1 neorv32_xirq_setup_trigger(0, XIRQ_TRIGGER_EDGE_RISING); // configure channel 0 as rising-edge trigger neorv32_xirq_setup_trigger(1, XIRQ_TRIGGER_EDGE_RISING); // configure channel 1 as rising-edge trigger - neorv32_xirq_clear_pending(0); // clear any pending request - neorv32_xirq_clear_pending(1); // clear any pending request neorv32_xirq_channel_enable(0); // enable XIRQ channel 0 neorv32_xirq_channel_enable(1); // enable XIRQ channel 1