[riot-notifications] [RIOT-OS/RIOT] cpu/atmega_common: pseudomodule-based pin change interrupt implementation (#11122)

Marian Buschsieweke notifications at github.com
Fri Jul 26 13:48:22 CEST 2019


maribu requested changes on this pull request.

OK, found one more bug (see above).

So this is still needed in order to ACK:

1. Fix the bug above
2. Squash and rebase on top of current master
3. Add PCINT mapping for the ATmega32U4

I'm extremely sorry that this PR was so exhausting. But I'm confident it now is about to get merged :-)

> +        unsigned bank = offset / 8;
+        DEBUG("PCINT enabled for bank %u offset %u\n", bank, (unsigned)offset);
+
+        /* save configuration for pin change interrupt */
+        pcint_config[offset].flank = flank;
+        pcint_config[offset].arg = arg;
+        pcint_config[offset].cb = cb;
+
+        /* init gpio */
+        gpio_init(pin, mode);
+        /* configure pcint */
+        cli();
+        switch (bank) {
+#ifdef PCINT0_IDX
+            case PCINT0_IDX:
+                PCMSK0 |= (1 << pin_num);

Here again a bug: The pin number and the index in the PCINT bank do not match for the ATmega2560. I fixed the issue locally in https://github.com/RIOT-OS/RIOT/pull/11923/commits/8f669ae86f9e87d9a98a7094020a810c014e5433. With that everything works fine :-)

-- 
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/11122#pullrequestreview-267140351
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190726/0ad1b3c7/attachment-0001.htm>


More information about the notifications mailing list