Skip to content

Commit d14f793

Browse files
committed
Merge branch 'bugfix-2.1.x' into mike-config
* bugfix-2.1.x: (427 commits) [cron] Bump distribution date (2023-08-14) 🔧 Configurable SD card retry/timeout (MarlinFirmware#25340) [cron] Bump distribution date (2023-08-08) 🐛 Fix MKS Robin Mini servo timer (MarlinFirmware#26150) 🚸 Adjust ColorUI chamber bmp (MarlinFirmware#26149) 🚸 UI Sound off/on with M300 E<0|1> (MarlinFirmware#26142) 🐛 Fix UBL probe_entire_mesh skips points (MarlinFirmware#26141) 🔨 Fix USB FD env names (MarlinFirmware#26131) 🩹 PROBING_TOOL followup (MarlinFirmware#26122) 🔧 Clarify WIFISUPPORT (MarlinFirmware#26097) 🩹 Fix M3 `uninitialized` warning (MarlinFirmware#26091) 🚸 FT_MOTION menu updates (MarlinFirmware#26083) [cron] Bump distribution date (2023-08-07) 🚸 BD Sensor Z axis stop height (MarlinFirmware#26015) ⚡️ SAMD21 LCD uses HW SPI with media (MarlinFirmware#26012) 🚸 Update LCD Manual Leveling display (MarlinFirmware#26088) 📝 STM32G0B0 SKR Mini E3 V3.0 / Manta M4P (MarlinFirmware#26087) 📝 Update a config comment [cron] Bump distribution date (2023-08-06) ✨ MM-JOKER (ESP32) board (MarlinFirmware#25897) ... # Conflicts: # .github/workflows/bump-date.yml # .github/workflows/clean-closed.yml # .github/workflows/test-builds.yml # Marlin/Configuration.h # Marlin/Configuration_adv.h # Marlin/src/pins/pins.h
2 parents 6a59308 + 79f6d9b commit d14f793

File tree

1,284 files changed

+86478
-38630
lines changed

Some content is hidden

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

1,284 files changed

+86478
-38630
lines changed

.editorconfig

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ root = true
44
[{*.patch,syntax_test_*}]
55
trim_trailing_whitespace = false
66

7-
[{*.c,*.cpp,*.h,*.ino}]
8-
charset = utf-8
9-
10-
[{*.c,*.cpp,*.h,*.ino,Makefile}]
7+
[{*.c,*.cpp,*.h,*.ino,*.py,Makefile}]
118
trim_trailing_whitespace = true
129
insert_final_newline = true
1310
end_of_line = lf
11+
12+
[{*.c,*.cpp,*.h,*.ino}]
13+
charset = utf-8
1414
indent_style = space
1515
indent_size = 2
1616

17+
[{Makefile}]
18+
indent_style = tab
19+
indent_size = 2
20+
1721
[{*.py}]
1822
indent_style = space
1923
indent_size = 4

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ bdf2u8g.exe
2525
genpages.exe
2626
marlin_config.json
2727
mczip.h
28+
language*.csv
29+
out-csv/
30+
out-language/
2831
*.gen
2932
*.sublime-workspace
3033

@@ -130,7 +133,9 @@ spi_flash.bin
130133
fs.img
131134

132135
# CMake
136+
buildroot/share/cmake/*
133137
CMakeLists.txt
138+
!buildroot/share/cmake/CMakeLists.txt
134139
src/CMakeLists.txt
135140
CMakeListsPrivate.txt
136141
build/

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ help:
2727

2828
tests-single-ci:
2929
export GIT_RESET_HARD=true
30-
$(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET)
30+
$(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) PLATFORMIO_BUILD_FLAGS=-DGITHUB_ACTION
3131
.PHONY: tests-single-ci
3232

3333
tests-single-local:

Marlin/Configuration.h

+242-170
Large diffs are not rendered by default.

Marlin/Configuration_adv.h

+182-131
Large diffs are not rendered by default.

Marlin/Makefile

+20-20
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ HARDWARE_MOTHERBOARD ?= 1020
6363

6464
ifeq ($(OS),Windows_NT)
6565
# Windows
66-
ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
67-
ARDUINO_USER_DIR ?= ${HOME}/Arduino
66+
ARDUINO_INSTALL_DIR ?= ${HOME}/AppData/Local/Arduino
67+
ARDUINO_USER_DIR ?= ${HOME}/Documents/Arduino
6868
else
6969
UNAME_S := $(shell uname -s)
7070
ifeq ($(UNAME_S),Linux)
@@ -82,11 +82,11 @@ endif
8282

8383
# Arduino source install directory, and version number
8484
# On most linuxes this will be /usr/share/arduino
85-
ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
86-
ARDUINO_VERSION ?= 106
85+
ARDUINO_INSTALL_DIR ?= ${HOME}/AppData/Local/Arduino # C:/Users/${USERNAME}/AppData/Local/Arduino
86+
ARDUINO_VERSION ?= 10819
8787

8888
# The installed Libraries are in the User folder
89-
ARDUINO_USER_DIR ?= ${HOME}/Arduino
89+
ARDUINO_USER_DIR ?= ${HOME}/Documents/Arduino
9090

9191
# You can optionally set a path to the avr-gcc tools.
9292
# Requires a trailing slash. For example, /usr/local/avr-gcc/bin/
@@ -656,18 +656,18 @@ ifeq ($(HARDWARE_VARIANT), $(filter $(HARDWARE_VARIANT),arduino Teensy Sanguino)
656656
# Old libraries (avr-core 1.6.21 < / Arduino < 1.6.8)
657657
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
658658
# New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
659-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
659+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/libraries/SPI/src
660660
endif
661661

662662
ifeq ($(IS_MCU),1)
663-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino
663+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/cores/arduino
664664

665665
# Old libraries (avr-core 1.6.21 < / Arduino < 1.6.8)
666666
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
667667
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial
668668
# New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
669-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
670-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src
669+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/libraries/SPI/src
670+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/libraries/SoftwareSerial/src
671671
endif
672672

673673
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src
@@ -681,17 +681,17 @@ ifeq ($(WIRE), 1)
681681
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire
682682
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/utility
683683
# New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
684-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src
685-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src/utility
684+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src
685+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src/utility
686686
endif
687687
ifeq ($(NEOPIXEL), 1)
688688
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
689689
endif
690690
ifeq ($(U8GLIB), 1)
691-
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
692-
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc
693-
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc
694-
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc
691+
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib-HAL
692+
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib-HAL/src
693+
# VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
694+
# VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/src
695695
endif
696696
ifeq ($(TMC), 1)
697697
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src
@@ -700,9 +700,9 @@ endif
700700

701701
ifeq ($(HARDWARE_VARIANT), arduino)
702702
HARDWARE_SUB_VARIANT ?= mega
703-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT)
703+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/$(HARDWARE_SUB_VARIANT)
704704
else ifeq ($(HARDWARE_VARIANT), Sanguino)
705-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino
705+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/sanguino
706706
else ifeq ($(HARDWARE_VARIANT), archim)
707707
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/libsam
708708
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Include/
@@ -718,7 +718,7 @@ else ifeq ($(HARDWARE_VARIANT), archim)
718718
LDLIBS = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/libsam_sam3x8e_gcc_rel.a
719719
else
720720
HARDWARE_SUB_VARIANT ?= standard
721-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT)
721+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/$(HARDWARE_SUB_VARIANT)
722722
endif
723723

724724
LIB_SRC = wiring.c \
@@ -733,7 +733,7 @@ endif
733733

734734
ifeq ($(HARDWARE_VARIANT), Teensy)
735735
LIB_SRC = wiring.c
736-
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
736+
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/teensy/cores/teensy
737737
endif
738738

739739
LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp
@@ -880,7 +880,7 @@ AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i
880880
ifeq ($(shell uname -s), Linux)
881881
AVRDUDE_CONF = /etc/avrdude/avrdude.conf
882882
else
883-
AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf
883+
AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf
884884
endif
885885
AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \
886886
-p$(PROG_MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \

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 "2023-04-12"
44+
//#define STRING_DISTRIBUTION_DATE "2023-08-14"
4545

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

Marlin/config.ini

+5-9
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ preheat_1_temp_hotend = 180
4242
bang_max = 255
4343
pidtemp = on
4444
pid_k1 = 0.95
45-
pid_max = BANG_MAX
45+
pid_max = 255
4646
pid_functional_range = 10
4747

4848
default_kp = 22.20
@@ -69,10 +69,6 @@ x_home_dir = -1
6969
y_home_dir = -1
7070
z_home_dir = -1
7171

72-
use_xmin_plug = on
73-
use_ymin_plug = on
74-
use_zmin_plug = on
75-
7672
x_min_endstop_hit_state = HIGH
7773
y_min_endstop_hit_state = HIGH
7874
z_min_endstop_hit_state = HIGH
@@ -100,10 +96,10 @@ step_state_x = HIGH
10096
step_state_y = HIGH
10197
step_state_z = HIGH
10298

103-
disable_x = false
104-
disable_y = false
105-
disable_z = false
106-
disable_e = false
99+
disable_x = off
100+
disable_y = off
101+
disable_z = off
102+
disable_e = off
107103

108104
proportional_font_ratio = 1.0
109105
default_nominal_filament_dia = 1.75

Marlin/src/HAL/AVR/HAL.cpp

+25-8
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,40 @@ void save_reset_reason() {
6161
wdt_disable();
6262
}
6363

64+
#include "registers.h"
65+
66+
MarlinHAL::MarlinHAL() {
67+
TERN_(HAL_AVR_DIRTY_INIT, _ATmega_resetperipherals()); // Clean-wipe the device state.
68+
}
69+
6470
void MarlinHAL::init() {
6571
// Init Servo Pins
66-
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
6772
#if HAS_SERVO_0
68-
INIT_SERVO(0);
73+
OUT_WRITE(SERVO0_PIN, LOW);
6974
#endif
7075
#if HAS_SERVO_1
71-
INIT_SERVO(1);
76+
OUT_WRITE(SERVO1_PIN, LOW);
7277
#endif
7378
#if HAS_SERVO_2
74-
INIT_SERVO(2);
79+
OUT_WRITE(SERVO2_PIN, LOW);
7580
#endif
7681
#if HAS_SERVO_3
77-
INIT_SERVO(3);
82+
OUT_WRITE(SERVO3_PIN, LOW);
7883
#endif
7984

8085
init_pwm_timers(); // Init user timers to default frequency - 1000HZ
86+
87+
#if PIN_EXISTS(BEEPER) && ENABLED(HAL_AVR_DIRTY_INIT) && DISABLED(ATMEGA_NO_BEEPFIX)
88+
// Make sure no alternative is locked onto the BEEPER.
89+
// This fixes the issue where the ATmega is constantly beeping.
90+
// Might disable other peripherals using the pin; to circumvent that please undefine one of the above things!
91+
// The true culprit is the AVR ArduinoCore that enables peripherals redundantly.
92+
// (USART1 on the GeeeTech GT2560)
93+
// https://www.youtube.com/watch?v=jMgCvRXkexk
94+
_ATmega_savePinAlternate(BEEPER_PIN);
95+
96+
OUT_WRITE(BEEPER_PIN, LOW);
97+
#endif
8198
}
8299

83100
void MarlinHAL::reboot() {
@@ -145,12 +162,12 @@ void MarlinHAL::reboot() {
145162
// Free Memory Accessor
146163
// ------------------------
147164

148-
#if ENABLED(SDSUPPORT)
165+
#if HAS_MEDIA
149166

150167
#include "../../sd/SdFatUtil.h"
151168
int freeMemory() { return SdFatUtil::FreeRam(); }
152169

153-
#else // !SDSUPPORT
170+
#else // !HAS_MEDIA
154171

155172
extern "C" {
156173
extern char __bss_end;
@@ -167,6 +184,6 @@ void MarlinHAL::reboot() {
167184
}
168185
}
169186

170-
#endif // !SDSUPPORT
187+
#endif // !HAS_MEDIA
171188

172189
#endif // __AVR__

Marlin/src/HAL/AVR/HAL.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ typedef Servo hal_servo_t;
140140
#endif
141141
#define LCD_SERIAL lcdSerial
142142
#if HAS_DGUS_LCD
143-
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
143+
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
144144
#endif
145145
#endif
146146

147147
//
148148
// ADC
149149
//
150-
#define HAL_ADC_VREF 5.0
151-
#define HAL_ADC_RESOLUTION 10
150+
#define HAL_ADC_VREF_MV 5000
151+
#define HAL_ADC_RESOLUTION 10
152152

153153
//
154154
// Pin Mapping for M42, M43, M226
@@ -187,7 +187,7 @@ class MarlinHAL {
187187
public:
188188

189189
// Earliest possible init, before setup()
190-
MarlinHAL() {}
190+
MarlinHAL();
191191

192192
// Watchdog
193193
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});

Marlin/src/HAL/AVR/HAL_SPI.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void spiBegin() {
198198
// output pin high - like sending 0xFF
199199
WRITE(SD_MOSI_PIN, HIGH);
200200

201-
LOOP_L_N(i, 8) {
201+
for (uint8_t i = 0; i < 8; ++i) {
202202
WRITE(SD_SCK_PIN, HIGH);
203203

204204
nop; // adjust so SCK is nice
@@ -225,7 +225,7 @@ void spiBegin() {
225225
void spiSend(uint8_t data) {
226226
// no interrupts during byte send - about 8µs
227227
cli();
228-
LOOP_L_N(i, 8) {
228+
for (uint8_t i = 0; i < 8; ++i) {
229229
WRITE(SD_SCK_PIN, LOW);
230230
WRITE(SD_MOSI_PIN, data & 0x80);
231231
data <<= 1;

Marlin/src/HAL/AVR/MarlinSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
static constexpr bool DROPPED_RX = false;
281281
static constexpr bool RX_FRAMING_ERRORS = false;
282282
static constexpr bool MAX_RX_QUEUED = false;
283-
static constexpr bool RX_OVERRUNS = BOTH(HAS_DGUS_LCD, SERIAL_STATS_RX_BUFFER_OVERRUNS);
283+
static constexpr bool RX_OVERRUNS = ALL(HAS_DGUS_LCD, SERIAL_STATS_RX_BUFFER_OVERRUNS);
284284
};
285285

286286
typedef Serial1Class< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialLCD;

Marlin/src/HAL/AVR/eeprom.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include "../../inc/MarlinConfig.h"
2525

26-
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
26+
#if ANY(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
2727

2828
/**
2929
* PersistentStore for Arduino-style EEPROM interface

0 commit comments

Comments
 (0)