|
@@ -39,7 +39,7 @@
|
39
|
39
|
#include "stepper.h"
|
40
|
40
|
#endif
|
41
|
41
|
|
42
|
|
-#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
|
|
42
|
+#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) || ENABLED(PINS_DEBUGGING)
|
43
|
43
|
#include "endstops.h"
|
44
|
44
|
#endif
|
45
|
45
|
|
|
@@ -1561,87 +1561,6 @@ void Temperature::set_current_temp_raw() {
|
1561
|
1561
|
temp_meas_ready = true;
|
1562
|
1562
|
}
|
1563
|
1563
|
|
1564
|
|
-#if ENABLED(PINS_DEBUGGING)
|
1565
|
|
- /**
|
1566
|
|
- * monitors endstops & Z probe for changes
|
1567
|
|
- *
|
1568
|
|
- * If a change is detected then the LED is toggled and
|
1569
|
|
- * a message is sent out the serial port
|
1570
|
|
- *
|
1571
|
|
- * Yes, we could miss a rapid back & forth change but
|
1572
|
|
- * that won't matter because this is all manual.
|
1573
|
|
- *
|
1574
|
|
- */
|
1575
|
|
- void endstop_monitor() {
|
1576
|
|
- static uint16_t old_endstop_bits_local = 0;
|
1577
|
|
- static uint8_t local_LED_status = 0;
|
1578
|
|
- uint16_t current_endstop_bits_local = 0;
|
1579
|
|
- #if HAS_X_MIN
|
1580
|
|
- if (READ(X_MIN_PIN)) SBI(current_endstop_bits_local, X_MIN);
|
1581
|
|
- #endif
|
1582
|
|
- #if HAS_X_MAX
|
1583
|
|
- if (READ(X_MAX_PIN)) SBI(current_endstop_bits_local, X_MAX);
|
1584
|
|
- #endif
|
1585
|
|
- #if HAS_Y_MIN
|
1586
|
|
- if (READ(Y_MIN_PIN)) SBI(current_endstop_bits_local, Y_MIN);
|
1587
|
|
- #endif
|
1588
|
|
- #if HAS_Y_MAX
|
1589
|
|
- if (READ(Y_MAX_PIN)) SBI(current_endstop_bits_local, Y_MAX);
|
1590
|
|
- #endif
|
1591
|
|
- #if HAS_Z_MIN
|
1592
|
|
- if (READ(Z_MIN_PIN)) SBI(current_endstop_bits_local, Z_MIN);
|
1593
|
|
- #endif
|
1594
|
|
- #if HAS_Z_MAX
|
1595
|
|
- if (READ(Z_MAX_PIN)) SBI(current_endstop_bits_local, Z_MAX);
|
1596
|
|
- #endif
|
1597
|
|
- #if HAS_Z_MIN_PROBE_PIN
|
1598
|
|
- if (READ(Z_MIN_PROBE_PIN)) SBI(current_endstop_bits_local, Z_MIN_PROBE);
|
1599
|
|
- #endif
|
1600
|
|
- #if HAS_Z2_MIN
|
1601
|
|
- if (READ(Z2_MIN_PIN)) SBI(current_endstop_bits_local, Z2_MIN);
|
1602
|
|
- #endif
|
1603
|
|
- #if HAS_Z2_MAX
|
1604
|
|
- if (READ(Z2_MAX_PIN)) SBI(current_endstop_bits_local, Z2_MAX);
|
1605
|
|
- #endif
|
1606
|
|
-
|
1607
|
|
- uint16_t endstop_change = current_endstop_bits_local ^ old_endstop_bits_local;
|
1608
|
|
-
|
1609
|
|
- if (endstop_change) {
|
1610
|
|
- #if HAS_X_MIN
|
1611
|
|
- if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", !!TEST(current_endstop_bits_local, X_MIN));
|
1612
|
|
- #endif
|
1613
|
|
- #if HAS_X_MAX
|
1614
|
|
- if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", !!TEST(current_endstop_bits_local, X_MAX));
|
1615
|
|
- #endif
|
1616
|
|
- #if HAS_Y_MIN
|
1617
|
|
- if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", !!TEST(current_endstop_bits_local, Y_MIN));
|
1618
|
|
- #endif
|
1619
|
|
- #if HAS_Y_MAX
|
1620
|
|
- if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", !!TEST(current_endstop_bits_local, Y_MAX));
|
1621
|
|
- #endif
|
1622
|
|
- #if HAS_Z_MIN
|
1623
|
|
- if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", !!TEST(current_endstop_bits_local, Z_MIN));
|
1624
|
|
- #endif
|
1625
|
|
- #if HAS_Z_MAX
|
1626
|
|
- if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", !!TEST(current_endstop_bits_local, Z_MAX));
|
1627
|
|
- #endif
|
1628
|
|
- #if HAS_Z_MIN_PROBE_PIN
|
1629
|
|
- if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", !!TEST(current_endstop_bits_local, Z_MIN_PROBE));
|
1630
|
|
- #endif
|
1631
|
|
- #if HAS_Z2_MIN
|
1632
|
|
- if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", !!TEST(current_endstop_bits_local, Z2_MIN));
|
1633
|
|
- #endif
|
1634
|
|
- #if HAS_Z2_MAX
|
1635
|
|
- if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", !!TEST(current_endstop_bits_local, Z2_MAX));
|
1636
|
|
- #endif
|
1637
|
|
- SERIAL_PROTOCOLPGM("\n\n");
|
1638
|
|
- analogWrite(LED_PIN, local_LED_status);
|
1639
|
|
- local_LED_status ^= 255;
|
1640
|
|
- old_endstop_bits_local = current_endstop_bits_local;
|
1641
|
|
- }
|
1642
|
|
- }
|
1643
|
|
-#endif // PINS_DEBUGGING
|
1644
|
|
-
|
1645
|
1564
|
/**
|
1646
|
1565
|
* Timer 0 is shared with millies so don't change the prescaler.
|
1647
|
1566
|
*
|
|
@@ -2157,14 +2076,7 @@ void Temperature::isr() {
|
2157
|
2076
|
#endif // BABYSTEPPING
|
2158
|
2077
|
|
2159
|
2078
|
#if ENABLED(PINS_DEBUGGING)
|
2160
|
|
- extern bool endstop_monitor_flag;
|
2161
|
|
- // run the endstop monitor at 15Hz
|
2162
|
|
- static uint8_t endstop_monitor_count = 16; // offset this check from the others
|
2163
|
|
- if (endstop_monitor_flag) {
|
2164
|
|
- endstop_monitor_count += _BV(1); // 15 Hz
|
2165
|
|
- endstop_monitor_count &= 0x7F;
|
2166
|
|
- if (!endstop_monitor_count) endstop_monitor(); // report changes in endstop status
|
2167
|
|
- }
|
|
2079
|
+ endstops.run_monitor(); // report changes in endstop status
|
2168
|
2080
|
#endif
|
2169
|
2081
|
|
2170
|
2082
|
#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
|