Skip to content

Commit 8f7203a

Browse files
⛙ Merge w/Marlin
2 parents 1598979 + 5e1a1ff commit 8f7203a

File tree

120 files changed

+613
-384
lines changed

Some content is hidden

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

120 files changed

+613
-384
lines changed

Makefile

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@ CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio
44
CONTAINER_IMAGE := marlin-dev
55
UNIT_TEST_CONFIG ?= default
66

7+
# Find a Python 3 interpreter
8+
ifeq ($(OS),Windows_NT)
9+
# Windows: use `where` – fall back through the three common names
10+
PYTHON := $(shell where python 2>nul || where python3 2>nul || where py 2>nul)
11+
# Windows: Use cmd tools to find pins files
12+
PINS_RAW := $(shell cmd //c "dir /s /b Marlin\src\pins\*.h 2>nul | findstr /r ".*Marlin\\\\src\\\\pins\\\\.*\\\\pins_.*\.h"")
13+
PINS := $(subst \,/,$(PINS_RAW))
14+
else
15+
# POSIX: use `command -v` – prefer python3 over python
16+
PYTHON := $(shell command -v python3 2>/dev/null || command -v python 2>/dev/null)
17+
# Unix/Linux: Use find command
18+
PINS := $(shell find Marlin/src/pins -mindepth 2 -name 'pins_*.h')
19+
endif
20+
21+
# Check that the found interpreter is Python 3
22+
# Error if there's no Python 3 available
23+
ifneq ($(strip $(PYTHON)),)
24+
PYTHON_VERSION := $(shell $(PYTHON) -c "import sys; print(sys.version_info[0])" 2>/dev/null)
25+
ifneq ($(PYTHON_VERSION),3)
26+
$(error $(PYTHON) is not Python 3 – install a Python‑3.x interpreter or adjust your PATH)
27+
endif
28+
else
29+
$(error No Python executable found – install Python 3.x and make sure it is in your PATH)
30+
endif
31+
732
help:
833
@echo "Tasks for local development:"
934
@echo "make marlin : Build Marlin for the configured board"
@@ -20,7 +45,7 @@ help:
2045
@echo "make unit-test-single-local-docker : Run unit tests for a single config locally, using docker"
2146
@echo "make unit-test-all-local : Run all code tests locally"
2247
@echo "make unit-test-all-local-docker : Run all code tests locally, using docker"
23-
@echo "make setup-local-docker : Setup local docker using buildx"
48+
@echo "make setup-local-docker : Setup local docker"
2449
@echo ""
2550
@echo "Options for testing:"
2651
@echo " TEST_TARGET Set when running tests-single-*, to select the"
@@ -57,10 +82,10 @@ tests-single-local-docker:
5782
$(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)"
5883

5984
tests-all-local:
60-
@python -c "import yaml" 2>/dev/null || (echo 'pyyaml module is not installed. Install it with "python -m pip install pyyaml"' && exit 1)
85+
@$(PYTHON) -c "import yaml" 2>/dev/null || (echo 'pyyaml module is not installed. Install it with "$(PYTHON) -m pip install pyyaml"' && exit 1)
6186
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
6287
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
63-
&& for TEST_TARGET in $$(python $(SCRIPTS_DIR)/get_test_targets.py) ; do \
88+
&& for TEST_TARGET in $$($(PYTHON) $(SCRIPTS_DIR)/get_test_targets.py) ; do \
6489
if [ "$$TEST_TARGET" = "linux_native" ] && [ "$$(uname)" = "Darwin" ]; then \
6590
echo "Skipping tests for $$TEST_TARGET on macOS" ; \
6691
continue ; \
@@ -88,18 +113,36 @@ unit-test-all-local-docker:
88113
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
89114
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-all-local
90115

116+
USERNAME := $(shell whoami)
117+
USER_ID := $(shell id -u)
118+
GROUP_ID := $(shell id -g)
119+
120+
.PHONY: setup-local-docker setup-local-docker-old
121+
91122
setup-local-docker:
123+
@echo "Building marlin-dev Docker image..."
124+
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) \
125+
--build-arg USERNAME=$(USERNAME) \
126+
--build-arg USER_ID=$(USER_ID) \
127+
--build-arg GROUP_ID=$(GROUP_ID) \
128+
-f docker/Dockerfile .
129+
@echo
130+
@echo "To run all tests in Docker:"
131+
@echo " make tests-all-local-docker"
132+
@echo "To run a single test in Docker:"
133+
@echo " make tests-single-local-docker TEST_TARGET=mega2560"
134+
135+
setup-local-docker-old:
92136
$(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
93137

94-
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
95-
96138
.PHONY: $(PINS) format-pins validate-pins
97139

98140
$(PINS): %:
99141
@echo "Formatting pins $@"
100-
@python $(SCRIPTS_DIR)/pinsformat.py $< $@
142+
@$(PYTHON) $(SCRIPTS_DIR)/pinsformat.py $< $@
101143

102144
format-pins: $(PINS)
145+
@echo "Processed $(words $(PINS)) pins files"
103146

104147
validate-pins: format-pins
105148
@echo "Validating pins files"
@@ -109,8 +152,8 @@ validate-pins: format-pins
109152

110153
format-lines:
111154
@echo "Formatting all sources"
112-
@python $(SCRIPTS_DIR)/linesformat.py buildroot
113-
@python $(SCRIPTS_DIR)/linesformat.py Marlin
155+
@$(PYTHON) $(SCRIPTS_DIR)/linesformat.py buildroot
156+
@$(PYTHON) $(SCRIPTS_DIR)/linesformat.py Marlin
114157

115158
validate-lines:
116159
@echo "Validating text formatting"
@@ -122,4 +165,4 @@ BOARDS_FILE := Marlin/src/core/boards.h
122165

123166
validate-boards:
124167
@echo "Validating boards.h file"
125-
@python $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1)
168+
@$(PYTHON) $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1)

Marlin/Configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@
950950
* protect against a broken or disconnected thermistor wire.
951951
*
952952
* The issue: If a thermistor falls out, it will report the much lower
953-
* temperature of the air in the room, and the the firmware will keep
953+
* temperature of the air in the room, and the firmware will keep
954954
* the heater on.
955955
*
956956
* If you get "Thermal Runaway" or "Heating failed" errors the

Marlin/Configuration_adv.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
* protect against a broken or disconnected thermistor wire.
304304
*
305305
* The issue: If a thermistor falls out, it will report the much lower
306-
* temperature of the air in the room, and the the firmware will keep
306+
* temperature of the air in the room, and the firmware will keep
307307
* the heater on.
308308
*
309309
* The solution: Once the temperature reaches the target, start observing.
@@ -784,7 +784,7 @@
784784

785785
// @section endstops
786786

787-
// If you want endstops to stay on (by default) even when not homing
787+
// If you want endstops to stay on (by default) even when not homing,
788788
// enable this option. Override at any time with M120, M121.
789789
//#define ENDSTOPS_ALWAYS_ON_DEFAULT
790790

@@ -1180,7 +1180,7 @@
11801180
#define FTM_SHAPING_V_TOL_Z 0.05f // Vibration tolerance used by EI input shapers for Z axis
11811181

11821182
//#define FTM_SHAPER_E // Include E shaping support
1183-
// Required to synchronise extruder with XYZ (better quality)
1183+
// Required to synchronize extruder with XYZ (better quality)
11841184
#define FTM_DEFAULT_SHAPER_E ftMotionShaper_NONE // Default shaper mode on Extruder axis
11851185
#define FTM_SHAPING_DEFAULT_FREQ_E 21.0f // (Hz) Default peak frequency used by input shapers
11861186
#define FTM_SHAPING_ZETA_E 0.03f // Zeta used by input shapers for E axis
@@ -4298,7 +4298,7 @@
42984298
//#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper
42994299
// steps per full revolution (motor steps/rev * microstepping)
43004300
//#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel.
4301-
#define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction.
4301+
#define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error correction.
43024302
#define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the
43034303
// printer will attempt to correct the error; errors
43044304
// smaller than this are ignored to minimize effects of

Marlin/Version.h

Lines changed: 1 addition & 1 deletion
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 "2025-10-07"
44+
//#define STRING_DISTRIBUTION_DATE "2025-10-09"
4545

4646
#define STRING_DISTRIBUTION_DATE __DATE__
4747
#define STRING_DISTRIBUTION_TIME __TIME__

Marlin/src/HAL/HC32/Servo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class MarlinServo {
3737
MarlinServo();
3838

3939
/**
40-
* @brief attach the pin to the servo, set pin mode, return channel number
41-
* @param pin pin to attach to
42-
* @return channel number, -1 if failed
40+
* @brief attach the pin to the servo, set pin mode, return channel number
41+
* @param pin pin to attach to
42+
* @return channel number, -1 if failed
4343
*/
4444
int8_t attach(const pin_t apin);
4545

Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* Couldn't just call exact copies because the overhead killed the LCD update speed
2929
* With an intermediate level the softspi was running in the 10-20kHz range which
30-
* resulted in using about about 25% of the CPU's time.
30+
* resulted in using about 25% of the CPU's time.
3131
*/
3232

3333
#ifdef __PLAT_NATIVE_SIM__

Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* Couldn't just call exact copies because the overhead killed the LCD update speed
3030
* With an intermediate level the softspi was running in the 10-20kHz range which
31-
* resulted in using about about 25% of the CPU's time.
31+
* resulted in using about 25% of the CPU's time.
3232
*/
3333

3434
#ifdef __cplusplus

Marlin/src/HAL/SAMD21/u8g/LCD_pin_routines.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*
3333
* Couldn't just call exact copies because the overhead killed the LCD update speed
3434
* With an intermediate level the softspi was running in the 10-20kHz range which
35-
* resulted in using about about 25% of the CPU's time.
35+
* resulted in using about 25% of the CPU's time.
3636
*/
3737

3838
#ifdef __SAMD21__

Marlin/src/HAL/SAMD21/u8g/LCD_pin_routines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*
3434
* Couldn't just call exact copies because the overhead killed the LCD update speed
3535
* With an intermediate level the softspi was running in the 10-20kHz range which
36-
* resulted in using about about 25% of the CPU's time.
36+
* resulted in using about 25% of the CPU's time.
3737
*/
3838

3939
void u8g_SetPinOutput(uint8_t internal_pin_number);

Marlin/src/HAL/STM32/Servo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ static_assert(COUNT(servoDelay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM
3939
static uint32_t servo_interrupt_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), TIM_IRQ_PRIO, TIM_IRQ_SUBPRIO);
4040

4141
// This must be called after the STM32 Servo class has initialized the timer.
42-
// It may only be needed after the first call to attach(), but it is possible
43-
// that is is necessary after every detach() call. To be safe this is currently
42+
// It may only be needed after the first call to attach(), but it's possible
43+
// that this is needed after every detach() call. To be safe this is currently
4444
// called after every call to attach().
4545
static void fixServoTimerInterruptPriority() {
4646
NVIC_SetPriority(getTimerUpIrq(TIMER_SERVO), servo_interrupt_priority);

0 commit comments

Comments
 (0)