|
@@ -462,12 +462,12 @@ int Temperature::getHeaterPower(int heater) {
|
462
|
462
|
AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 : 3
|
463
|
463
|
};
|
464
|
464
|
uint8_t fanState = 0;
|
465
|
|
-
|
|
465
|
+
|
466
|
466
|
HOTEND_LOOP() {
|
467
|
467
|
if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE)
|
468
|
468
|
SBI(fanState, fanBit[e]);
|
469
|
469
|
}
|
470
|
|
-
|
|
470
|
+
|
471
|
471
|
uint8_t fanDone = 0;
|
472
|
472
|
for (uint8_t f = 0; f < COUNT(fanPin); f++) {
|
473
|
473
|
int8_t pin = fanPin[f];
|
|
@@ -1393,6 +1393,87 @@ void Temperature::set_current_temp_raw() {
|
1393
|
1393
|
temp_meas_ready = true;
|
1394
|
1394
|
}
|
1395
|
1395
|
|
|
1396
|
+#if ENABLED(PINS_DEBUGGING)
|
|
1397
|
+ /**
|
|
1398
|
+ * monitors endstops & Z probe for changes
|
|
1399
|
+ *
|
|
1400
|
+ * If a change is detected then the LED is toggled and
|
|
1401
|
+ * a message is sent out the serial port
|
|
1402
|
+ *
|
|
1403
|
+ * Yes, we could miss a rapid back & forth change but
|
|
1404
|
+ * that won't matter because this is all manual.
|
|
1405
|
+ *
|
|
1406
|
+ */
|
|
1407
|
+ void endstop_monitor() {
|
|
1408
|
+ static uint16_t old_endstop_bits_local = 0;
|
|
1409
|
+ static uint8_t local_LED_status = 0;
|
|
1410
|
+ uint16_t current_endstop_bits_local = 0;
|
|
1411
|
+ #if HAS_X_MIN
|
|
1412
|
+ if (READ(X_MIN_PIN)) SBI(current_endstop_bits_local, X_MIN);
|
|
1413
|
+ #endif
|
|
1414
|
+ #if HAS_X_MAX
|
|
1415
|
+ if (READ(X_MAX_PIN)) SBI(current_endstop_bits_local, X_MAX);
|
|
1416
|
+ #endif
|
|
1417
|
+ #if HAS_Y_MIN
|
|
1418
|
+ if (READ(Y_MIN_PIN)) SBI(current_endstop_bits_local, Y_MIN);
|
|
1419
|
+ #endif
|
|
1420
|
+ #if HAS_Y_MAX
|
|
1421
|
+ if (READ(Y_MAX_PIN)) SBI(current_endstop_bits_local, Y_MAX);
|
|
1422
|
+ #endif
|
|
1423
|
+ #if HAS_Z_MIN
|
|
1424
|
+ if (READ(Z_MIN_PIN)) SBI(current_endstop_bits_local, Z_MIN);
|
|
1425
|
+ #endif
|
|
1426
|
+ #if HAS_Z_MAX
|
|
1427
|
+ if (READ(Z_MAX_PIN)) SBI(current_endstop_bits_local, Z_MAX);
|
|
1428
|
+ #endif
|
|
1429
|
+ #if HAS_Z_MIN_PROBE_PIN
|
|
1430
|
+ if (READ(Z_MIN_PROBE_PIN)) SBI(current_endstop_bits_local, Z_MIN_PROBE);
|
|
1431
|
+ #endif
|
|
1432
|
+ #if HAS_Z2_MIN
|
|
1433
|
+ if (READ(Z2_MIN_PIN)) SBI(current_endstop_bits_local, Z2_MIN);
|
|
1434
|
+ #endif
|
|
1435
|
+ #if HAS_Z2_MAX
|
|
1436
|
+ if (READ(Z2_MAX_PIN)) SBI(current_endstop_bits_local, Z2_MAX);
|
|
1437
|
+ #endif
|
|
1438
|
+
|
|
1439
|
+ uint16_t endstop_change = current_endstop_bits_local ^ old_endstop_bits_local;
|
|
1440
|
+
|
|
1441
|
+ if (endstop_change) {
|
|
1442
|
+ #if HAS_X_MIN
|
|
1443
|
+ if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR("X_MIN:", !!TEST(current_endstop_bits_local, X_MIN));
|
|
1444
|
+ #endif
|
|
1445
|
+ #if HAS_X_MAX
|
|
1446
|
+ if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", !!TEST(current_endstop_bits_local, X_MAX));
|
|
1447
|
+ #endif
|
|
1448
|
+ #if HAS_Y_MIN
|
|
1449
|
+ if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", !!TEST(current_endstop_bits_local, Y_MIN));
|
|
1450
|
+ #endif
|
|
1451
|
+ #if HAS_Y_MAX
|
|
1452
|
+ if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", !!TEST(current_endstop_bits_local, Y_MAX));
|
|
1453
|
+ #endif
|
|
1454
|
+ #if HAS_Z_MIN
|
|
1455
|
+ if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", !!TEST(current_endstop_bits_local, Z_MIN));
|
|
1456
|
+ #endif
|
|
1457
|
+ #if HAS_Z_MAX
|
|
1458
|
+ if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", !!TEST(current_endstop_bits_local, Z_MAX));
|
|
1459
|
+ #endif
|
|
1460
|
+ #if HAS_Z_MIN_PROBE_PIN
|
|
1461
|
+ if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", !!TEST(current_endstop_bits_local, Z_MIN_PROBE));
|
|
1462
|
+ #endif
|
|
1463
|
+ #if HAS_Z2_MIN
|
|
1464
|
+ if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", !!TEST(current_endstop_bits_local, Z2_MIN));
|
|
1465
|
+ #endif
|
|
1466
|
+ #if HAS_Z2_MAX
|
|
1467
|
+ if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", !!TEST(current_endstop_bits_local, Z2_MAX));
|
|
1468
|
+ #endif
|
|
1469
|
+ SERIAL_PROTOCOLPGM("\n\n");
|
|
1470
|
+ analogWrite(LED_PIN, local_LED_status);
|
|
1471
|
+ local_LED_status ^= 255;
|
|
1472
|
+ old_endstop_bits_local = current_endstop_bits_local;
|
|
1473
|
+ }
|
|
1474
|
+ }
|
|
1475
|
+#endif // PINS_DEBUGGING
|
|
1476
|
+
|
1396
|
1477
|
/**
|
1397
|
1478
|
* Timer 0 is shared with millies so don't change the prescaler.
|
1398
|
1479
|
*
|
|
@@ -1848,4 +1929,15 @@ void Temperature::isr() {
|
1848
|
1929
|
}
|
1849
|
1930
|
}
|
1850
|
1931
|
#endif //BABYSTEPPING
|
|
1932
|
+
|
|
1933
|
+ #if ENABLED(PINS_DEBUGGING)
|
|
1934
|
+ extern bool endstop_monitor_flag;
|
|
1935
|
+ // run the endstop monitor at 15Hz
|
|
1936
|
+ static uint8_t endstop_monitor_count = 16; // offset this check from the others
|
|
1937
|
+ if (endstop_monitor_flag) {
|
|
1938
|
+ endstop_monitor_count += _BV(1); // 15 Hz
|
|
1939
|
+ endstop_monitor_count &= 0x7F;
|
|
1940
|
+ if (!endstop_monitor_count) endstop_monitor(); // report changes in endstop status
|
|
1941
|
+ }
|
|
1942
|
+ #endif
|
1851
|
1943
|
}
|