From aaad051724632c85793528950ae81159f3bcd3e1 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Mon, 3 Sep 2012 18:31:50 -0400 Subject: exti.c: Use exti_num enumerators instead of magic values. Signed-off-by: Marti Bolivar --- libmaple/exti.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'libmaple') diff --git a/libmaple/exti.c b/libmaple/exti.c index 91d8551..f8ee8c3 100644 --- a/libmaple/exti.c +++ b/libmaple/exti.c @@ -145,34 +145,34 @@ void exti_attach_callback(exti_num num, /* Enable the interrupt line */ switch(num) { - case 0: + case EXTI0: nvic_irq_enable(NVIC_EXTI0); break; - case 1: + case EXTI1: nvic_irq_enable(NVIC_EXTI1); break; - case 2: + case EXTI2: nvic_irq_enable(NVIC_EXTI2); break; - case 3: + case EXTI3: nvic_irq_enable(NVIC_EXTI3); break; - case 4: + case EXTI4: nvic_irq_enable(NVIC_EXTI4); break; - case 5: - case 6: - case 7: - case 8: - case 9: + case EXTI5: + case EXTI6: + case EXTI7: + case EXTI8: + case EXTI9: nvic_irq_enable(NVIC_EXTI_9_5); break; - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: + case EXTI10: + case EXTI11: + case EXTI12: + case EXTI13: + case EXTI14: + case EXTI15: nvic_irq_enable(NVIC_EXTI_15_10); break; } -- cgit v1.2.3