From 4967d4690674e553942b7cfe9465de1fc3287faa Mon Sep 17 00:00:00 2001 From: Drew Barbier Date: Thu, 5 Jul 2018 16:41:42 -0500 Subject: use new cspid instead of msip --- software/clic_vectored/clic_vectored.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'software/clic_vectored') 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; -- cgit v1.2.3