diff options
author | Drew Barbier <dbarbi1@gmail.com> | 2018-07-05 16:41:42 -0500 |
---|---|---|
committer | Drew Barbier <dbarbi1@gmail.com> | 2018-07-05 16:41:42 -0500 |
commit | 4967d4690674e553942b7cfe9465de1fc3287faa (patch) | |
tree | 302f1f3e9a6d26791bb9998b23101af19a44ecff /software/clic_vectored | |
parent | 24010b53cdc225cea7de8662d0b54425f86f8b61 (diff) |
use new cspid instead of msip
Diffstat (limited to 'software/clic_vectored')
-rw-r--r-- | software/clic_vectored/clic_vectored.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/software/clic_vectored/clic_vectored.c b/software/clic_vectored/clic_vectored.c index 3f632df..6f19fa3 100644 --- a/software/clic_vectored/clic_vectored.c +++ b/software/clic_vectored/clic_vectored.c @@ -100,17 +100,17 @@ void button_2_setup(void) { /*Entry Point for Machine Software Interrupt Handler*/ uint32_t COUNT; -void msi_isr()__attribute((interrupt)); -void msi_isr() { +void csip_isr()__attribute((interrupt)); +void csip_isr() { //clear the SW interrupt - CLINT_REG(CLINT_MSIP) = 0; + clic_clear_pending(&clic, CSIPID); COUNT++; } -void msi_setup(void) { - clic_install_handler(&clic, MSIPID, msi_isr); - clic_set_int_level(&clic, MSIPID, 1); - clic_enable_interrupt(&clic, MSIPID); +void csip_setup(void) { + clic_install_handler(&clic, CSIPID, csip_isr); + clic_set_int_level(&clic, CSIPID, 1); + clic_enable_interrupt(&clic, CSIPID); } void config_gpio() { @@ -142,7 +142,7 @@ int main(int argc, char **argv) button_0_setup(); button_1_setup(); button_2_setup(); - msi_setup(); + csip_setup(); // Enable all global interrupts set_csr(mstatus, MSTATUS_MIE); @@ -152,7 +152,7 @@ int main(int argc, char **argv) wait_ms(10000); printf("Count=%d\n", COUNT); //Trigger a SW interrupt - CLINT_REG(CLINT_MSIP) = 1; + clic_set_pending(&clic, CSIPID); } return 0; |