Skip to content

Commit 43c3058

Browse files
committed
Merge branch 'bugfix-2.1.x' into mike-config
* bugfix-2.1.x: (37 commits) [cron] Bump distribution date (2024-01-16) πŸ§‘β€πŸ’» Tweak limit_and_warn πŸ§‘β€πŸ’» Tweak planner debug [cron] Bump distribution date (2024-01-15) πŸ”¨ Make / pins-format patches [cron] Bump distribution date (2024-01-14) πŸ”§ Fix SD connection defaults (MarlinFirmware#26666) [cron] Bump distribution date (2024-01-13) πŸ› Fix PLR pos/sdpos (MarlinFirmware#26365) [cron] Bump distribution date (2024-01-12) βͺ️ Revert encoder changes [cron] Bump distribution date (2024-01-11) 🎨 Misc. style adjustments ✨ EDITABLE_STEPS_PER_UNIT (MarlinFirmware#26618) ✨ PLR_BED_THRESHOLD (MarlinFirmware#26649) 🩹 Clarify servo Β΅s min/max 🩹 Fix some temp constraints 🩹 Fix PID / MPC tune background tasks (MarlinFirmware#26652) 🎨 Minor temp / UI refactor [cron] Bump distribution date (2024-01-10) ...
2 parents 5071fc0 + 76dce41 commit 43c3058

File tree

128 files changed

+1561
-1268
lines changed

Some content is hidden

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

128 files changed

+1561
-1268
lines changed

β€ŽMakefile

+13-17
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ CONTAINER_IMAGE := marlin-dev
55

66
help:
77
@echo "Tasks for local development:"
8-
@echo "* format-pins: Reformat all pins files"
9-
@echo "* tests-single-ci: Run a single test from inside the CI"
10-
@echo "* tests-single-local: Run a single test locally"
11-
@echo "* tests-single-local-docker: Run a single test locally, using docker"
12-
@echo "* tests-all-local: Run all tests locally"
13-
@echo "* tests-all-local-docker: Run all tests locally, using docker"
14-
@echo "* setup-local-docker: Build the local docker image"
8+
@echo "make marlin : Build marlin for the configured board"
9+
@echo "make format-pins : Reformat all pins files"
10+
@echo "make tests-single-ci : Run a single test from inside the CI"
11+
@echo "make tests-single-local : Run a single test locally"
12+
@echo "make tests-single-local-docker : Run a single test locally, using docker"
13+
@echo "make tests-all-local : Run all tests locally"
14+
@echo "make tests-all-local-docker : Run all tests locally, using docker"
15+
@echo "make setup-local-docker : Build the local docker image"
1516
@echo ""
1617
@echo "Options for testing:"
1718
@echo " TEST_TARGET Set when running tests-single-*, to select the"
@@ -24,46 +25,41 @@ help:
2425
@echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value"
2526
@echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
2627
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
27-
.PHONY: help
28+
29+
marlin:
30+
./buildroot/bin/mftest -a
31+
.PHONY: marlin
2832

2933
tests-single-ci:
3034
export GIT_RESET_HARD=true
3135
$(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) PLATFORMIO_BUILD_FLAGS=-DGITHUB_ACTION
32-
.PHONY: tests-single-ci
3336

3437
tests-single-local:
3538
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi
3639
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
3740
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
3841
&& run_tests . $(TEST_TARGET) "$(ONLY_TEST)"
39-
.PHONY: tests-single-local
4042

4143
tests-single-local-docker:
4244
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
4345
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
4446
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
45-
.PHONY: tests-single-local-docker
4647

4748
tests-all-local:
4849
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
4950
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
5051
&& for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
51-
.PHONY: tests-all-local
5252

5353
tests-all-local-docker:
5454
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
5555
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
56-
.PHONY: tests-all-local-docker
5756

5857
setup-local-docker:
5958
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
60-
.PHONY: setup-local-docker
6159

6260
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
6361

64-
.PHONY: $(PINS)
65-
6662
$(PINS): %:
67-
@echo "Formatting $@" && node buildroot/share/scripts/pinsformat.js $@
63+
@echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@
6864

6965
format-pins: $(PINS)

β€ŽMarlin/Configuration.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -1236,11 +1236,16 @@
12361236

12371237
/**
12381238
* Default Axis Steps Per Unit (linear=steps/mm, rotational=steps/Β°)
1239-
* Override with M92
1239+
* Override with M92 (when enabled below)
12401240
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
12411241
*/
12421242
#define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 94.75 }
12431243

1244+
/**
1245+
* Enable support for M92. Disable to save at least ~530 bytes of flash.
1246+
*/
1247+
#define EDITABLE_STEPS_PER_UNIT
1248+
12441249
/**
12451250
* Default Max Feed Rate (linear=mm/s, rotational=Β°/s)
12461251
* Override with M203
@@ -2037,7 +2042,7 @@
20372042
* Commands to execute at the end of G29 probing.
20382043
* Useful to retract or move the Z probe out of the way.
20392044
*/
2040-
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
2045+
//#define EVENT_GCODE_AFTER_G29 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
20412046

20422047
/**
20432048
* Normally G28 leaves leveling disabled on completion. Enable one of

β€ŽMarlin/Configuration_adv.h

+51-51
Original file line numberDiff line numberDiff line change
@@ -1743,19 +1743,20 @@
17431743
*/
17441744
//#define POWER_LOSS_RECOVERY
17451745
#if ENABLED(POWER_LOSS_RECOVERY)
1746-
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
1747-
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
1748-
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
1749-
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
1750-
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
1751-
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
1746+
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
1747+
//#define PLR_BED_THRESHOLD BED_MAXTEMP // (Β°C) Skip user confirmation at or above this bed temperature (0 to disable)
1748+
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
1749+
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
1750+
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
1751+
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
1752+
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
17521753
//#define POWER_LOSS_PULLDOWN
1753-
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
1754-
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
1754+
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
1755+
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
17551756

17561757
// Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card,
17571758
// especially with "vase mode" printing. Set too high and vases cannot be continued.
1758-
#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
1759+
#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
17591760

17601761
// Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled!
17611762
//#define POWER_LOSS_RECOVER_ZHOME
@@ -3839,38 +3840,6 @@
38393840
*/
38403841
//#define CNC_COORDINATE_SYSTEMS
38413842

3842-
// @section reporting
3843-
3844-
/**
3845-
* Auto-report fan speed with M123 S<seconds>
3846-
* Requires fans with tachometer pins
3847-
*/
3848-
//#define AUTO_REPORT_FANS
3849-
3850-
/**
3851-
* Auto-report temperatures with M155 S<seconds>
3852-
*/
3853-
#define AUTO_REPORT_TEMPERATURES
3854-
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
3855-
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
3856-
#endif
3857-
3858-
/**
3859-
* Auto-report position with M154 S<seconds>
3860-
*/
3861-
//#define AUTO_REPORT_POSITION
3862-
#if ENABLED(AUTO_REPORT_POSITION)
3863-
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
3864-
#endif
3865-
3866-
/**
3867-
* Include capabilities in M115 output
3868-
*/
3869-
#define EXTENDED_CAPABILITIES_REPORT
3870-
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
3871-
//#define M115_GEOMETRY_REPORT
3872-
#endif
3873-
38743843
// @section security
38753844

38763845
/**
@@ -3913,13 +3882,50 @@
39133882

39143883
// @section reporting
39153884

3916-
// Extra options for the M114 "Current Position" report
3885+
/**
3886+
* Extra options for the M114 "Current Position" report
3887+
*/
39173888
//#define M114_DETAIL // Use 'M114` for details to check planner calculations
39183889
//#define M114_REALTIME // Real current position based on forward kinematics
39193890
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
39203891

3892+
/**
3893+
* Auto-report fan speed with M123 S<seconds>
3894+
* Requires fans with tachometer pins
3895+
*/
3896+
//#define AUTO_REPORT_FANS
3897+
39213898
//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)
39223899

3900+
/**
3901+
* Auto-report temperatures with M155 S<seconds>
3902+
*/
3903+
#define AUTO_REPORT_TEMPERATURES
3904+
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
3905+
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
3906+
#endif
3907+
3908+
/**
3909+
* Auto-report position with M154 S<seconds>
3910+
*/
3911+
//#define AUTO_REPORT_POSITION
3912+
#if ENABLED(AUTO_REPORT_POSITION)
3913+
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
3914+
#endif
3915+
3916+
/**
3917+
* M115 - Report capabilites. Disable to save ~1150 bytes of flash.
3918+
* Some hosts (and serial TFT displays) rely on this feature.
3919+
*/
3920+
#define CAPABILITIES_REPORT
3921+
#if ENABLED(CAPABILITIES_REPORT)
3922+
// Include capabilities in M115 output
3923+
#define EXTENDED_CAPABILITIES_REPORT
3924+
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
3925+
//#define M115_GEOMETRY_REPORT
3926+
#endif
3927+
#endif
3928+
39233929
// @section gcode
39243930

39253931
/**
@@ -3931,7 +3937,9 @@
39313937
//#define GCODE_QUOTED_STRINGS // Support for quoted string parameters
39323938
#endif
39333939

3934-
// Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
3940+
/**
3941+
* Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
3942+
*/
39353943
//#define MEATPACK_ON_SERIAL_PORT_1
39363944
//#define MEATPACK_ON_SERIAL_PORT_2
39373945

@@ -3945,12 +3953,6 @@
39453953
*/
39463954
#define DEBUG_FLAGS_GCODE
39473955

3948-
/**
3949-
* M115 - Report capabilites. Disable to save ~1150 bytes of flash.
3950-
* Some hosts (and serial TFT displays) rely on this feature.
3951-
*/
3952-
#define REPORT_CAPABILITIES_GCODE
3953-
39543956
/**
39553957
* Enable this option for a leaner build of Marlin that removes
39563958
* workspace offsets to slightly optimize performance.
@@ -3978,8 +3980,6 @@
39783980
//#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
39793981
#endif
39803982

3981-
// @section gcode
3982-
39833983
/**
39843984
* Startup commands
39853985
*

β€ŽMarlin/Version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* here we define this default string as the date where the latest release
4242
* version was tagged.
4343
*/
44-
//#define STRING_DISTRIBUTION_DATE "2024-01-04"
44+
//#define STRING_DISTRIBUTION_DATE "2024-01-16"
4545

4646
/**
4747
* Defines a generic printer name to be output to the LCD after booting Marlin.

β€ŽMarlin/src/HAL/AVR/HAL.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ void MarlinHAL::init() {
8181
#if HAS_SERVO_3
8282
OUT_WRITE(SERVO3_PIN, LOW);
8383
#endif
84+
#if HAS_SERVO_4
85+
OUT_WRITE(SERVO4_PIN, LOW);
86+
#endif
87+
#if HAS_SERVO_5
88+
OUT_WRITE(SERVO5_PIN, LOW);
89+
#endif
8490

8591
init_pwm_timers(); // Init user timers to default frequency - 1000HZ
8692

β€ŽMarlin/src/HAL/ESP32/i2s.cpp

+38-20
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#include <freertos/queue.h>
3535
#include "../../module/stepper.h"
3636

37+
#if ENABLED(FT_MOTION)
38+
#include "../../module/ft_motion.h"
39+
#endif
40+
3741
#define DMA_BUF_COUNT 8 // number of DMA buffers to store data
3842
#define DMA_BUF_LEN 4092 // maximum size in bytes
3943
#define I2S_SAMPLE_SIZE 4 // 4 bytes, 32 bits per sample
@@ -134,8 +138,8 @@ static void IRAM_ATTR i2s_intr_handler_default(void *arg) {
134138

135139
if (high_priority_task_awoken == pdTRUE) portYIELD_FROM_ISR();
136140

137-
// clear interrupt
138-
I2S0.int_clr.val = I2S0.int_st.val; //clear pending interrupt
141+
// Clear pending interrupt
142+
I2S0.int_clr.val = I2S0.int_st.val;
139143
}
140144

141145
void stepperTask(void *parameter) {
@@ -148,29 +152,43 @@ void stepperTask(void *parameter) {
148152
xQueueReceive(dma.queue, &dma.current, portMAX_DELAY);
149153
dma.rw_pos = 0;
150154

155+
const bool using_ftMotion = TERN0(FT_MOTION, ftMotion.cfg.mode);
156+
151157
while (dma.rw_pos < DMA_SAMPLE_COUNT) {
152-
if (!nextMainISR) {
153-
Stepper::pulse_phase_isr();
154-
nextMainISR = Stepper::block_phase_isr();
155-
}
156-
#if ENABLED(LIN_ADVANCE)
157-
else if (!nextAdvanceISR) {
158-
Stepper::advance_isr();
159-
nextAdvanceISR = Stepper::la_interval;
160-
}
161-
#endif
162-
else
163-
i2s_push_sample();
164158

165-
nextMainISR--;
159+
#if ENABLED(FT_MOTION)
166160

167-
#if ENABLED(LIN_ADVANCE)
168-
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
169-
nextAdvanceISR = Stepper::la_interval;
161+
if (using_ftMotion) {
162+
if (!nextMainISR) stepper.ftMotion_stepper();
163+
nextMainISR = 0;
164+
}
170165

171-
if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
172-
nextAdvanceISR--;
173166
#endif
167+
168+
if (!using_ftMotion) {
169+
if (!nextMainISR) {
170+
Stepper::pulse_phase_isr();
171+
nextMainISR = Stepper::block_phase_isr();
172+
}
173+
#if ENABLED(LIN_ADVANCE)
174+
else if (!nextAdvanceISR) {
175+
Stepper::advance_isr();
176+
nextAdvanceISR = Stepper::la_interval;
177+
}
178+
#endif
179+
else
180+
i2s_push_sample();
181+
182+
nextMainISR--;
183+
184+
#if ENABLED(LIN_ADVANCE)
185+
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
186+
nextAdvanceISR = Stepper::la_interval;
187+
188+
if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
189+
nextAdvanceISR--;
190+
#endif
191+
}
174192
}
175193
}
176194
}

β€ŽMarlin/src/HAL/LPC1768/HAL.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ void MarlinHAL::init() {
111111
#if HAS_SERVO_3
112112
INIT_SERVO(3);
113113
#endif
114+
#if HAS_SERVO_4
115+
INIT_SERVO(4);
116+
#endif
117+
#if HAS_SERVO_5
118+
INIT_SERVO(5);
119+
#endif
114120

115121
//debug_frmwrk_init();
116122
//_DBG("\n\nDebug running\n");

0 commit comments

Comments
Β (0)