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

Robert Hartung notifications at github.com
Thu Mar 7 13:47:35 CET 2019


roberthartung 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)

I personally don't like the solution from above. This adds a lot of code specific code to the CPU. In the end, this isn't a problem, because I solved it directly in the code when checking if the bank is enabled: I just check if the mapping exists, if so, the CPU has the bank. Problem solved :)

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


More information about the notifications mailing list