Skip to content

Commit d4813b0

Browse files
committed
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/20507
2 parents b74ea27 + 777c50a commit d4813b0

42 files changed

Lines changed: 544 additions & 202 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Marlin/Configuration.h

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,33 @@
10061006
// Feedrate (mm/min) for the "accurate" probe of each point
10071007
#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
10081008

1009+
/**
1010+
* Probe Activation Switch
1011+
* A switch indicating proper deployment, or an optical
1012+
* switch triggered when the carriage is near the bed.
1013+
*/
1014+
//#define PROBE_ACTIVATION_SWITCH
1015+
#if ENABLED(PROBE_ACTIVATION_SWITCH)
1016+
#define PROBE_ACTIVATION_SWITCH_STATE LOW // State indicating probe is active
1017+
//#define PROBE_ACTIVATION_SWITCH_PIN PC6 // Override default pin
1018+
#endif
1019+
1020+
/**
1021+
* Tare Probe (determine zero-point) prior to each probe.
1022+
* Useful for a strain gauge or piezo sensor that needs to factor out
1023+
* elements such as cables pulling on the carriage.
1024+
*/
1025+
//#define PROBE_TARE
1026+
#if ENABLED(PROBE_TARE)
1027+
#define PROBE_TARE_TIME 200 // (ms) Time to hold tare pin
1028+
#define PROBE_TARE_DELAY 200 // (ms) Delay after tare before
1029+
#define PROBE_TARE_STATE HIGH // State to write pin for tare
1030+
//#define PROBE_TARE_PIN PA5 // Override default pin
1031+
#if ENABLED(PROBE_ACTIVATION_SWITCH)
1032+
//#define PROBE_TARE_ONLY_WHILE_INACTIVE // Fail to tare/probe if PROBE_ACTIVATION_SWITCH is active
1033+
#endif
1034+
#endif
1035+
10091036
/**
10101037
* Multiple Probing
10111038
*
@@ -1067,6 +1094,13 @@
10671094
//#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing
10681095
//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors
10691096

1097+
// Require minimum nozzle and/or bed temperature for probing.
1098+
//#define PREHEAT_BEFORE_PROBING
1099+
#if ENABLED(PREHEAT_BEFORE_PROBING)
1100+
#define PROBING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time
1101+
#define PROBING_BED_TEMP 50
1102+
#endif
1103+
10701104
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
10711105
// :{ 0:'Low', 1:'High' }
10721106
#define X_ENABLE_ON 0
@@ -1296,7 +1330,7 @@
12961330
*/
12971331
//#define PREHEAT_BEFORE_LEVELING
12981332
#if ENABLED(PREHEAT_BEFORE_LEVELING)
1299-
#define LEVELING_NOZZLE_TEMP 120
1333+
#define LEVELING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time
13001334
#define LEVELING_BED_TEMP 50
13011335
#endif
13021336

@@ -1666,6 +1700,10 @@
16661700
// For a purge/clean station mounted on the X axis
16671701
//#define NOZZLE_CLEAN_NO_Y
16681702

1703+
// Require a minimum hotend temperature for cleaning
1704+
#define NOZZLE_CLEAN_MIN_TEMP 170
1705+
//#define NOZZLE_CLEAN_HEATUP // Heat up the nozzle instead of skipping wipe
1706+
16691707
// Explicit wipe G-code script applies to a G12 with no arguments.
16701708
//#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0"
16711709

Marlin/Configuration_adv.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,22 +2473,22 @@
24732473
* Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers
24742474
* on the same serial port, either here or in your board's pins file.
24752475
*/
2476-
#define X_SLAVE_ADDRESS 0
2477-
#define Y_SLAVE_ADDRESS 0
2478-
#define Z_SLAVE_ADDRESS 0
2479-
#define X2_SLAVE_ADDRESS 0
2480-
#define Y2_SLAVE_ADDRESS 0
2481-
#define Z2_SLAVE_ADDRESS 0
2482-
#define Z3_SLAVE_ADDRESS 0
2483-
#define Z4_SLAVE_ADDRESS 0
2484-
#define E0_SLAVE_ADDRESS 0
2485-
#define E1_SLAVE_ADDRESS 0
2486-
#define E2_SLAVE_ADDRESS 0
2487-
#define E3_SLAVE_ADDRESS 0
2488-
#define E4_SLAVE_ADDRESS 0
2489-
#define E5_SLAVE_ADDRESS 0
2490-
#define E6_SLAVE_ADDRESS 0
2491-
#define E7_SLAVE_ADDRESS 0
2476+
//#define X_SLAVE_ADDRESS 0
2477+
//#define Y_SLAVE_ADDRESS 0
2478+
//#define Z_SLAVE_ADDRESS 0
2479+
//#define X2_SLAVE_ADDRESS 0
2480+
//#define Y2_SLAVE_ADDRESS 0
2481+
//#define Z2_SLAVE_ADDRESS 0
2482+
//#define Z3_SLAVE_ADDRESS 0
2483+
//#define Z4_SLAVE_ADDRESS 0
2484+
//#define E0_SLAVE_ADDRESS 0
2485+
//#define E1_SLAVE_ADDRESS 0
2486+
//#define E2_SLAVE_ADDRESS 0
2487+
//#define E3_SLAVE_ADDRESS 0
2488+
//#define E4_SLAVE_ADDRESS 0
2489+
//#define E5_SLAVE_ADDRESS 0
2490+
//#define E6_SLAVE_ADDRESS 0
2491+
//#define E7_SLAVE_ADDRESS 0
24922492

24932493
/**
24942494
* Software enable

Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ bool PersistentStore::access_start() { eeprom_init(); return true; }
4848
bool PersistentStore::access_finish() { return true; }
4949

5050
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
51+
size_t written = 0;
5152
while (size--) {
5253
uint8_t v = *value;
5354
uint8_t * const p = (uint8_t * const)pos;
5455
// EEPROM has only ~100,000 write cycles,
5556
// so only write bytes that have changed!
5657
if (v != eeprom_read_byte(p)) {
5758
eeprom_write_byte(p, v);
58-
if (size & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
59+
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
5960
if (eeprom_read_byte(p) != v) {
6061
SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
6162
return true;

Marlin/src/core/language.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
#define STR_Z4_MIN "z4_min"
155155
#define STR_Z4_MAX "z4_max"
156156
#define STR_Z_PROBE "z_probe"
157+
#define STR_PROBE_EN "probe_en"
157158
#define STR_FILAMENT_RUNOUT_SENSOR "filament"
158159
#define STR_PROBE_OFFSET "Probe Offset"
159160
#define STR_SKEW_MIN "min_skew_factor: "

Marlin/src/gcode/bedlevel/abl/G29.cpp

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@
3636
#include "../../../module/probe.h"
3737
#include "../../queue.h"
3838

39-
#if EITHER(PROBE_TEMP_COMPENSATION, PREHEAT_BEFORE_LEVELING)
40-
#include "../../../module/temperature.h"
41-
#endif
42-
4339
#if ENABLED(PROBE_TEMP_COMPENSATION)
4440
#include "../../../feature/probe_temp_comp.h"
41+
#include "../../../module/temperature.h"
4542
#endif
4643

4744
#if HAS_DISPLAY
@@ -404,25 +401,13 @@ G29_TYPE GcodeSuite::G29() {
404401
ExtUI::onMeshLevelingStart();
405402
#endif
406403

407-
if (!faux) remember_feedrate_scaling_off();
404+
if (!faux) {
405+
remember_feedrate_scaling_off();
408406

409-
#if ENABLED(PREHEAT_BEFORE_LEVELING)
410-
#ifndef LEVELING_NOZZLE_TEMP
411-
#define LEVELING_NOZZLE_TEMP 0
407+
#if ENABLED(PREHEAT_BEFORE_LEVELING)
408+
if (!dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, LEVELING_BED_TEMP);
412409
#endif
413-
#ifndef LEVELING_BED_TEMP
414-
#define LEVELING_BED_TEMP 0
415-
#endif
416-
if (!dryrun && !faux) {
417-
constexpr uint16_t hotendPreheat = LEVELING_NOZZLE_TEMP, bedPreheat = LEVELING_BED_TEMP;
418-
if (DEBUGGING(LEVELING))
419-
DEBUG_ECHOLNPAIR("Preheating hotend (", hotendPreheat, ") and bed (", bedPreheat, ")");
420-
if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0);
421-
if (bedPreheat) thermalManager.setTargetBed(bedPreheat);
422-
if (hotendPreheat) thermalManager.wait_for_hotend(0);
423-
if (bedPreheat) thermalManager.wait_for_bed_heating();
424-
}
425-
#endif
410+
}
426411

427412
// Disable auto bed leveling during G29.
428413
// Be formal so G29 can be done successively without G28.

Marlin/src/gcode/probe/M401_M402.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
*/
3434
void GcodeSuite::M401() {
3535
probe.deploy();
36+
TERN_(PROBE_TARE, probe.tare());
3637
report_current_position();
3738
}
3839

Marlin/src/inc/Conditionals_LCD.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,22 @@
819819
#define TOTAL_PROBING MULTIPLE_PROBING
820820
#endif
821821
#endif
822+
#if ENABLED(PREHEAT_BEFORE_PROBING)
823+
#ifndef PROBING_NOZZLE_TEMP
824+
#define PROBING_NOZZLE_TEMP 0
825+
#endif
826+
#ifndef PROBING_BED_TEMP
827+
#define PROBING_BED_TEMP 0
828+
#endif
829+
#endif
830+
#if ENABLED(PREHEAT_BEFORE_LEVELING)
831+
#ifndef LEVELING_NOZZLE_TEMP
832+
#define LEVELING_NOZZLE_TEMP 0
833+
#endif
834+
#ifndef LEVELING_BED_TEMP
835+
#define LEVELING_BED_TEMP 0
836+
#endif
837+
#endif
822838
#else
823839
// Clear probe pin settings when no probe is selected
824840
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

Marlin/src/inc/Conditionals_post.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,54 @@
16471647
#ifndef E7_INTERPOLATE
16481648
#define E7_INTERPOLATE INTERPOLATE
16491649
#endif
1650+
#ifndef X_SLAVE_ADDRESS
1651+
#define X_SLAVE_ADDRESS 0
1652+
#endif
1653+
#ifndef Y_SLAVE_ADDRESS
1654+
#define Y_SLAVE_ADDRESS 0
1655+
#endif
1656+
#ifndef Z_SLAVE_ADDRESS
1657+
#define Z_SLAVE_ADDRESS 0
1658+
#endif
1659+
#ifndef X2_SLAVE_ADDRESS
1660+
#define X2_SLAVE_ADDRESS 0
1661+
#endif
1662+
#ifndef Y2_SLAVE_ADDRESS
1663+
#define Y2_SLAVE_ADDRESS 0
1664+
#endif
1665+
#ifndef Z2_SLAVE_ADDRESS
1666+
#define Z2_SLAVE_ADDRESS 0
1667+
#endif
1668+
#ifndef Z3_SLAVE_ADDRESS
1669+
#define Z3_SLAVE_ADDRESS 0
1670+
#endif
1671+
#ifndef Z4_SLAVE_ADDRESS
1672+
#define Z4_SLAVE_ADDRESS 0
1673+
#endif
1674+
#ifndef E0_SLAVE_ADDRESS
1675+
#define E0_SLAVE_ADDRESS 0
1676+
#endif
1677+
#ifndef E1_SLAVE_ADDRESS
1678+
#define E1_SLAVE_ADDRESS 0
1679+
#endif
1680+
#ifndef E2_SLAVE_ADDRESS
1681+
#define E2_SLAVE_ADDRESS 0
1682+
#endif
1683+
#ifndef E3_SLAVE_ADDRESS
1684+
#define E3_SLAVE_ADDRESS 0
1685+
#endif
1686+
#ifndef E4_SLAVE_ADDRESS
1687+
#define E4_SLAVE_ADDRESS 0
1688+
#endif
1689+
#ifndef E5_SLAVE_ADDRESS
1690+
#define E5_SLAVE_ADDRESS 0
1691+
#endif
1692+
#ifndef E6_SLAVE_ADDRESS
1693+
#define E6_SLAVE_ADDRESS 0
1694+
#endif
1695+
#ifndef E7_SLAVE_ADDRESS
1696+
#define E7_SLAVE_ADDRESS 0
1697+
#endif
16501698
#endif
16511699

16521700
#if (HAS_E_DRIVER(TMC2660) \

Marlin/src/inc/SanityCheck.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
14091409
#error "Z_SAFE_HOMING is recommended when homing with a probe. Enable it or comment out this line to continue."
14101410
#endif
14111411

1412+
#if ENABLED(PROBE_ACTIVATION_SWITCH)
1413+
#ifndef PROBE_ACTIVATION_SWITCH_STATE
1414+
#error "PROBE_ACTIVATION_SWITCH_STATE is required for PROBE_ACTIVATION_SWITCH."
1415+
#elif !PIN_EXISTS(PROBE_ACTIVATION_SWITCH)
1416+
#error "A PROBE_ACTIVATION_SWITCH_PIN is required for PROBE_ACTIVATION_SWITCH."
1417+
#endif
1418+
#endif
1419+
14121420
#else
14131421

14141422
/**
@@ -1514,6 +1522,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
15141522
#endif
15151523
#endif
15161524

1525+
#if BOTH(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
1526+
#error "Disable PREHEAT_BEFORE_LEVELING when using PREHEAT_BEFORE_PROBING."
1527+
#endif
1528+
15171529
/**
15181530
* Homing
15191531
*/

Marlin/src/inc/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* version was tagged.
4343
*/
4444
#ifndef STRING_DISTRIBUTION_DATE
45-
#define STRING_DISTRIBUTION_DATE "2020-12-19"
45+
#define STRING_DISTRIBUTION_DATE "2020-12-20"
4646
#endif
4747

4848
/**

0 commit comments

Comments
 (0)