diff options
author | Drew Barbier <dbarbi1@gmail.com> | 2018-07-02 16:04:45 -0500 |
---|---|---|
committer | Drew Barbier <dbarbi1@gmail.com> | 2018-07-02 16:04:45 -0500 |
commit | 835b33318a3b350051ef153d382a5980efe19ed6 (patch) | |
tree | 668b29dc58a7aa46d135081efa05776537dcb3ca | |
parent | 264c905f62394221215cd367b638e90c60d70808 (diff) |
update description
-rw-r--r-- | bsp/env/coreip-e2-arty/platform.h | 2 | ||||
-rw-r--r-- | software/clic_vectored/clic_vectored.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/bsp/env/coreip-e2-arty/platform.h b/bsp/env/coreip-e2-arty/platform.h index 8ee0a83..6bf2121 100644 --- a/bsp/env/coreip-e2-arty/platform.h +++ b/bsp/env/coreip-e2-arty/platform.h @@ -79,7 +79,7 @@ #define NUM_GPIO 16 #define CLIC_NUM_INTERRUPTS 28 + 16 -#define CLIC_NUM_CONFIG_BITS 4 //2 for E20 +#define CLIC_CONFIG_BITS 0x1E //2 for E20 #define HAS_BOARD_BUTTONS diff --git a/software/clic_vectored/clic_vectored.c b/software/clic_vectored/clic_vectored.c index 38a564e..a20b1f2 100644 --- a/software/clic_vectored/clic_vectored.c +++ b/software/clic_vectored/clic_vectored.c @@ -31,6 +31,9 @@ const char * instructions_msg = " \ E21 Core IP Eval Kit 'clic_vectored' demo.\n\ This demo uses buttons 0, 1, and 2 on the\n\ Arty board to trigger vectored clic interrupts.\n\ + The higher the button number, the higher the\n\ + interupt priority. Hold two buttons down at\n\ + the same time to see priorities in action.\n\ \n\ \n"; @@ -59,6 +62,7 @@ void button_0_isr(void) { void button_0_setup(void) { clic_install_handler(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_0), button_0_isr); + clic_set_intcfg(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_0), 1<<4); clic_enable_interrupt(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_0)); } @@ -74,6 +78,7 @@ void button_1_isr(void) { void button_1_setup(void) { clic_install_handler(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_1), button_1_isr); + clic_set_intcfg(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_1), 2<<4); clic_enable_interrupt(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_1)); } @@ -89,6 +94,7 @@ void button_2_isr(void) { void button_2_setup(void) { clic_install_handler(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_2), button_2_isr); + clic_set_intcfg(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_2), 3<<4); clic_enable_interrupt(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_2)); } @@ -110,7 +116,10 @@ int main(int argc, char **argv) (interrupt_function_ptr_t*)localISR, default_handler, CLIC_NUM_INTERRUPTS, - CLIC_NUM_CONFIG_BITS); + CLIC_CONFIG_BITS); + + //use all 4 config bits for levels + clic_set_cliccfg(&clic, CLIC_CONFIG_BITS); //initialize gpio and buttons. //each button registers an interrupt handler |