|
@@ -1,26 +1,26 @@
|
1
|
|
-// Search pins uasable for endstop-interupts
|
2
|
|
-// Compile with the same settings you'd use with Marlin.
|
|
1
|
+// Search pins usable for endstop-interrupts
|
|
2
|
+// Compile with the same build settings you'd use for Marlin.
|
3
|
3
|
|
4
|
4
|
#if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA)
|
5
|
5
|
#undef digitalPinToPCICR
|
6
|
|
- #define digitalPinToPCICR(p) ( (((p) >= 10) && ((p) <= 15)) || \
|
7
|
|
- (((p) >= 50) && ((p) <= 53)) || \
|
8
|
|
- (((p) >= 62) && ((p) <= 69)) ? (&PCICR) : ((uint8_t *)0) )
|
|
6
|
+ #define digitalPinToPCICR(p) ( ((p) >= 10 && (p) <= 15) || \
|
|
7
|
+ ((p) >= 50 && (p) <= 53) || \
|
|
8
|
+ ((p) >= 62 && (p) <= 69) ? &PCICR : (uint8_t *)0)
|
9
|
9
|
#endif
|
10
|
10
|
|
11
|
11
|
void setup() {
|
12
|
12
|
Serial.begin(9600);
|
13
|
13
|
Serial.println("PINs causing interrups are:");
|
14
|
|
- for(int i=2; i<NUM_DIGITAL_PINS; i++){
|
15
|
|
- if( digitalPinToPCICR(i) != NULL || (int)digitalPinToInterrupt(i) != -1 ) {
|
16
|
|
- for (int j= 0; j<NUM_ANALOG_INPUTS; j++){
|
17
|
|
- if(analogInputToDigitalPin(j) == i) {
|
18
|
|
- Serial.print("A");
|
|
14
|
+ for (int i = 2; i < NUM_DIGITAL_PINS; i++) {
|
|
15
|
+ if (digitalPinToPCICR(i) || (int)digitalPinToInterrupt(i) != -1) {
|
|
16
|
+ for (int j = 0; j < NUM_ANALOG_INPUTS; j++) {
|
|
17
|
+ if (analogInputToDigitalPin(j) == i) {
|
|
18
|
+ Serial.print('A');
|
19
|
19
|
Serial.print(j);
|
20
|
20
|
Serial.print(" = ");
|
21
|
21
|
}
|
22
|
22
|
}
|
23
|
|
- Serial.print("D");
|
|
23
|
+ Serial.print('D');
|
24
|
24
|
Serial.println(i);
|
25
|
25
|
}
|
26
|
26
|
}
|