[riot-notifications] [RIOT-OS/RIOT] [WIP] cpu/atmega_common: pin change interrupt implementation (#11114)
notifications at github.com
Wed Mar 6 16:13:42 CET 2019
> Because when we have a module per port, all pins would be enabled, which could result in potential conflicts?
Maybe I'm missing some detail, but I do not see any conflicts. Some "uglyness" will be required to get the offset (`port_num`) of the port in the `pcint_lookup` (the first argument to `pcint_handler`). E.g. if only for port 3 the port changed interrupts are enabled, its offset will be `0`, while it would be `1` if for port 1 and 3 interrupts are enabled.
I'm thinking about something like:
#define PORT0_IDX (0)
#define _COUNTER0 (0)
#define _COUNTER1 (_COUNTER0 + 1)
#define PORT1_IDX _COUNTER1
#define _COUNTER1 _COUNTER0
#define _COUNTER2 (_COUNTER1 + 1)
#define PORT1_IDX _COUNTER2
#define _COUNTER2 _COUNTER1
#define PORT1_IDX (_COUNTER2 + 1)
And then you will be able to use `PORT<X>_IDX` for the index for each port.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications