From 24010b53cdc225cea7de8662d0b54425f86f8b61 Mon Sep 17 00:00:00 2001 From: Drew Barbier Date: Thu, 5 Jul 2018 14:14:04 -0500 Subject: fix level calculation --- software/clic_vectored/clic_vectored.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'software/clic_vectored') diff --git a/software/clic_vectored/clic_vectored.c b/software/clic_vectored/clic_vectored.c index 872aba3..3f632df 100644 --- a/software/clic_vectored/clic_vectored.c +++ b/software/clic_vectored/clic_vectored.c @@ -57,7 +57,6 @@ void button_0_isr(void) { printf("Button 0 was pressed, interrupt level %d. Toggle Red.\n", level); GPIO_REG(GPIO_OUTPUT_VAL) = GPIO_REG(GPIO_OUTPUT_VAL) ^ (0x1 << RED_LED_OFFSET); wait_ms(500); - clic_enable_interrupt(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_0)); GPIO_REG(GPIO_OUTPUT_VAL) = GPIO_REG(GPIO_OUTPUT_VAL) ^ (0x1 << RED_LED_OFFSET); } @@ -74,7 +73,6 @@ void button_1_isr(void) { printf("Button 1 was pressed, interrupt level %d. Toggle Blue.\n", level); GPIO_REG(GPIO_OUTPUT_VAL) = GPIO_REG(GPIO_OUTPUT_VAL) ^ (0x1 << BLUE_LED_OFFSET); wait_ms(500); - clic_enable_interrupt(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_1)); GPIO_REG(GPIO_OUTPUT_VAL) = GPIO_REG(GPIO_OUTPUT_VAL) ^ (0x1 << BLUE_LED_OFFSET); } @@ -91,7 +89,6 @@ void button_2_isr(void) { printf("Button 2 was pressed, interrupt level %d. Toggle Green.\n", level); GPIO_REG(GPIO_OUTPUT_VAL) = GPIO_REG(GPIO_OUTPUT_VAL) ^ (0x1 << GREEN_LED_OFFSET); wait_ms(500); - clic_enable_interrupt(&clic, (LOCALINTIDBASE + LOCAL_INT_BTN_2)); GPIO_REG(GPIO_OUTPUT_VAL) = GPIO_REG(GPIO_OUTPUT_VAL) ^ (0x1 << GREEN_LED_OFFSET); } @@ -137,7 +134,7 @@ int main(int argc, char **argv) CLIC_CONFIG_BITS); //use all 4 config bits for levels, no shv - clic_set_cliccfg(&clic, ((CLIC_CONFIG_BITS<<1)|0)); + clic_set_cliccfg(&clic, (CLIC_CONFIG_BITS<<1)); //initialize gpio and buttons. //each button registers an interrupt handler -- cgit v1.2.3