Browse Source

⚡️ Add'l PCINTs for Mega Extended (#23019)

ellensp 2 years ago
parent
commit
930cb7c317
No account linked to committer's email address

+ 11
- 5
buildroot/share/PlatformIO/variants/MARLIN_MEGA_EXTENDED/pins_arduino.h View File

@@ -85,19 +85,23 @@ static const uint8_t A15 = PIN_A15;
85 85
 // A majority of the pins are NOT PCINTs, SO BE WARNED (i.e. you cannot use them as receive pins)
86 86
 // Only pins available for RECEIVE (TRANSMIT can be on any pin):
87 87
 // (I've deliberately left out pin mapping to the Hardware USARTs - seems senseless to me)
88
-// Pins: 10, 11, 12, 13,  50, 51, 52, 53,  62, 63, 64, 65, 66, 67, 68, 69
88
+// Pins: 10, 11, 12, 13,  50, 51, 52, 53,  62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 75, 76, 77
89 89
 
90 90
 #define digitalPinToPCICR(p)    ( (((p) >= 10) && ((p) <= 13)) || \
91 91
                                   (((p) >= 50) && ((p) <= 53)) || \
92
-                                  (((p) >= 62) && ((p) <= 69)) ? (&PCICR) : nullptr )
92
+                                  (((p) >= 62) && ((p) <= 69)) || \
93
+                                  (((p) >= 72) && ((p) <= 73)) || \
94
+                                  (((p) >= 75) && ((p) <= 77)) ? (&PCICR) : nullptr )
93 95
 
94 96
 #define digitalPinToPCICRbit(p) ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? 0 : \
95 97
                                 ( (((p) >= 62) && ((p) <= 69)) ? 2 : \
96
-                                0 ) )
98
+                                ( (((p) >= 72) && ((p) <= 73)) || (((p) >= 75) && ((p) <= 77)) ? 1 : \
99
+                                0 ) ) )
97 100
 
98 101
 #define digitalPinToPCMSK(p)    ( (((p) >= 10) && ((p) <= 13)) || (((p) >= 50) && ((p) <= 53)) ? (&PCMSK0) : \
99 102
                                 ( (((p) >= 62) && ((p) <= 69)) ? (&PCMSK2) : \
100
-                                nullptr ) )
103
+                                ( (((p) >= 72) && ((p) <= 73)) || (((p) >= 75) && ((p) <= 77)) ? (&PCMSK1) : \
104
+                                nullptr ) ) )
101 105
 
102 106
 #define digitalPinToPCMSKbit(p) ( (((p) >= 10) && ((p) <= 13)) ? ((p) - 6) : \
103 107
                                 ( ((p) == 50) ? 3 : \
@@ -105,7 +109,9 @@ static const uint8_t A15 = PIN_A15;
105 109
                                 ( ((p) == 52) ? 1 : \
106 110
                                 ( ((p) == 53) ? 0 : \
107 111
                                 ( (((p) >= 62) && ((p) <= 69)) ? ((p) - 62) : \
108
-                                0 ) ) ) ) ) )
112
+                                ( (((p) >= 72) && ((p) <= 73)) ? ((p) - 69) : \
113
+                                ( (((p) >= 75) && ((p) <= 77)) ? ((p) - 70) : \
114
+                                0 ) ) ) ) ) ) ) )
109 115
 
110 116
 #define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : ((p) >= 18 && (p) <= 21 ? 23 - (p) : NOT_AN_INTERRUPT)))
111 117
 

Loading…
Cancel
Save