[riot-notifications] [RIOT-OS/RIOT] cpu/atmega: WIP implementation of pin change interrupts (#7610)

Robert Hartung notifications at github.com
Tue Sep 19 14:38:28 CEST 2017


roberthartung commented on this pull request.



> @@ -237,61 +293,114 @@ void gpio_write(gpio_t pin, int value)
     }
 }
 
+static inline void pcint_handler(uint8_t port_num, uint8_t pin_num)
+{
+    int gpio_state = gpio_read( GPIO_PIN(port_num, pin_num) );
+    gpio_flank_t flank = pcint_flank[ port_num * 8 + pin_num ];
+
+    if (flank == GPIO_BOTH || (gpio_state && flank == GPIO_RISING) || (!gpio_state && flank == GPIO_FALLING)) {
+        __enter_isr();
+        pcint[port_num * 8 + pin_num].cb( pcint[port_num * 8 + pin_num].arg );
+        __exit_isr();
+    }
+}
+
+static inline uint8_t pcint_port_pin(volatile uint8_t *reg)

This should be eliminated once we keep track of the state anyway!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/7610#discussion_r139678271
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20170919/795fc43b/attachment.html>


More information about the notifications mailing list