Skip to content

Commit 2a3d6d4

Browse files
amqadbridge
authored andcommitted
Make gpio interrupts faster by offloading expected state check to user
1 parent aa05e88 commit 2a3d6d4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/gpio_irq_api.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,11 @@ static void handle_interrupt_in(uint8_t pin)
6161
return;
6262
}
6363

64-
//we are storing two ports in each uint8, so we must aquire the one we want.
65-
// If pin is odd, the port is encoded in the 4 most significant bits. If pin is even, the port is encoded in the 4 least significant bits
66-
uint8_t isRise = GPIO_PinInGet((pin & 0x1) ? channel_ports[(pin>>1) & 0x7] >> 4 & 0xF : channel_ports[(pin>>1) & 0x7] & 0xF, pin);
67-
6864
// Get trigger event
6965
gpio_irq_event event = IRQ_NONE;
70-
if ((GPIO->EXTIFALL & (1 << pin)) && !isRise) {
66+
if (GPIO->EXTIFALL & (1 << pin)) {
7167
event = IRQ_FALL;
72-
} else if ((GPIO->EXTIRISE & (1 << pin)) && isRise) {
68+
} else if (GPIO->EXTIRISE & (1 << pin)) {
7369
event = IRQ_RISE;
7470
}
7571
GPIO_IntClear(pin);

0 commit comments

Comments
 (0)