diff options
| author | Freey0 <[email protected]> | 2022-05-28 10:01:42 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-28 10:01:42 +0800 |
| commit | 532180dc19eaad13f21235f78ba8f1023356e60e (patch) | |
| tree | d17285f22c7d05b32fc7de9cdedb023b856c0041 | |
| parent | 18116a387923b6f7ccf9f1b89acc0d7688dd6de6 (diff) | |
Fix bug when restarting and getting interrupts that are not processed. (#5997)
Reason: Interrupts were not cleaned up during initialization
| -rw-r--r-- | bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c index 8e13f40ff7..7260bd0160 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c @@ -106,8 +106,11 @@ void rt_hw_interrupt_init(void) { int i; - *((volatile unsigned int *)REG_AIC_INTDIS0) = 0xFFFFFFFF; // disable all interrupt channel - *((volatile unsigned int *)REG_AIC_INTDIS1) = 0xFFFFFFFF; // disable all interrupt channel + outpw(REG_AIC_INTDIS0, 0xFFFFFFFF); // disable all interrupt channel + outpw(REG_AIC_INTDIS1, 0xFFFFFFFF); // disable all interrupt channel + + outpw(REG_AIC_EOIS, 1); // resetand restart AIC's IRQ processing + outpw(REG_AIC_EOFS, 1); // resetand restart AIC's IRQ processing /* init interrupt nest, and context in thread sp */ rt_interrupt_nest = 0; |
