From f943eb9a27ffaa43857dbb5cfafa405d807f27fc Mon Sep 17 00:00:00 2001 From: Joakim Gebart Date: Tue, 28 Oct 2014 14:42:36 +0100 Subject: [PATCH] rf230bb: Handle all IRQ flags in one ISR call. Modified the if/elseif/elseif/.../else block in ISR into multiple if blocks in order to handle multiple interrupts happening simultaneously. Signed-off-by: Joakim Gebart --- cpu/avr/radio/rf230bb/halbb.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cpu/avr/radio/rf230bb/halbb.c b/cpu/avr/radio/rf230bb/halbb.c index 53deb1c8a..122f05b3a 100644 --- a/cpu/avr/radio/rf230bb/halbb.c +++ b/cpu/avr/radio/rf230bb/halbb.c @@ -751,7 +751,8 @@ HAL_RF230_ISR() #endif #endif - } else if (interrupt_source & HAL_TRX_END_MASK){ + } + if (interrupt_source & HAL_TRX_END_MASK){ INTERRUPTDEBUG(11); state = hal_subregister_read(SR_TRX_STATUS); @@ -778,16 +779,20 @@ HAL_RF230_ISR() } - } else if (interrupt_source & HAL_TRX_UR_MASK){ + } + if (interrupt_source & HAL_TRX_UR_MASK){ INTERRUPTDEBUG(13); ; - } else if (interrupt_source & HAL_PLL_UNLOCK_MASK){ + } + if (interrupt_source & HAL_PLL_UNLOCK_MASK){ INTERRUPTDEBUG(14); ; - } else if (interrupt_source & HAL_PLL_LOCK_MASK){ + } + if (interrupt_source & HAL_PLL_LOCK_MASK){ INTERRUPTDEBUG(15); ; - } else if (interrupt_source & HAL_BAT_LOW_MASK){ + } + if (interrupt_source & HAL_BAT_LOW_MASK){ /* Disable BAT_LOW interrupt to prevent endless interrupts. The interrupt */ /* will continously be asserted while the supply voltage is less than the */ /* user-defined voltage threshold. */ @@ -796,9 +801,6 @@ HAL_RF230_ISR() hal_register_write(RG_IRQ_MASK, trx_isr_mask); INTERRUPTDEBUG(16); ; - } else { - INTERRUPTDEBUG(99); - ; } } #endif /* defined(__AVR_ATmega128RFA1__) */