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

Marian Buschsieweke notifications at github.com
Thu Mar 7 13:59:59 CET 2019


maribu commented on this pull request.



> @@ -59,6 +63,88 @@
 #endif
 
 static gpio_isr_ctx_t config[GPIO_EXT_INT_NUMOF];
+
+/**
+ * @brief detects ammount of possible PCINTs
+ */
+#if defined(MODULE_ATMEGA_PCINT) || defined(MODULE_ATMEGA_PCINT0) || defined(MODULE_ATMEGA_PCINT1) || defined(MODULE_ATMEGA_PCINT2) || defined(MODULE_ATMEGA_PCINT3)
+#include "atmega_pcint.h"
+
+#ifndef ATMEGA_PCINT_MAP_PCINT0
+#error Please define pin change interrupts in atmega_pcint.h
+#endif /* ATMEGA_PCINT_MAP_PCINT0 */
+
+/**
+ * @brief check which pcints should be enabled!
+ */
+#if defined(MODULE_ATMEGA_PCINT) || defined(MODULE_ATMEGA_PCINT0)

OK, I'm convinced. But maybe it would improve debugging when instead of

```C 
#if defined(MODULE_ATMEGA_PCINT1) && defined(ATMEGA_PCINT_MAP_PCINT1)
...
#endif
```

this is used:


```C 
#ifdef MODULE_ATMEGA_PCINT1
#ifndef ATMEGA_PCINT_MAP_PCINT1
#error "Either mapping for pin change interrupt bank 1 is missing or not supported by the MCU"
#endif /* ATMEGA_PCINT_MAP_PCINT1 */
...

#endif /* MODULE_ATMEGA_PCINT1 */
...
#endif
```

(This would indeed require cpu-depend handling of `atmega_pcint`, but uses will now what went wrong when the manually added `atmega_pcint<NUM>`

-- 
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#discussion_r263371047
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190307/024446bc/attachment.html>


More information about the notifications mailing list