Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into mike-config
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mikezs committed Aug 15, 2023
2 parents 6a59308 + 79f6d9b commit d14f793
Show file tree
Hide file tree
Showing 1,284 changed files with 86,478 additions and 38,630 deletions.
12 changes: 8 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ root = true
[{*.patch,syntax_test_*}]
trim_trailing_whitespace = false

[{*.c,*.cpp,*.h,*.ino}]
charset = utf-8

[{*.c,*.cpp,*.h,*.ino,Makefile}]
[{*.c,*.cpp,*.h,*.ino,*.py,Makefile}]
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[{*.c,*.cpp,*.h,*.ino}]
charset = utf-8
indent_style = space
indent_size = 2

[{Makefile}]
indent_style = tab
indent_size = 2

[{*.py}]
indent_style = space
indent_size = 4
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ bdf2u8g.exe
genpages.exe
marlin_config.json
mczip.h
language*.csv
out-csv/
out-language/
*.gen
*.sublime-workspace

Expand Down Expand Up @@ -130,7 +133,9 @@ spi_flash.bin
fs.img

# CMake
buildroot/share/cmake/*
CMakeLists.txt
!buildroot/share/cmake/CMakeLists.txt
src/CMakeLists.txt
CMakeListsPrivate.txt
build/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ help:

tests-single-ci:
export GIT_RESET_HARD=true
$(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET)
$(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) PLATFORMIO_BUILD_FLAGS=-DGITHUB_ACTION
.PHONY: tests-single-ci

tests-single-local:
Expand Down
412 changes: 242 additions & 170 deletions Marlin/Configuration.h

Large diffs are not rendered by default.

313 changes: 182 additions & 131 deletions Marlin/Configuration_adv.h

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions Marlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ HARDWARE_MOTHERBOARD ?= 1020

ifeq ($(OS),Windows_NT)
# Windows
ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
ARDUINO_USER_DIR ?= ${HOME}/Arduino
ARDUINO_INSTALL_DIR ?= ${HOME}/AppData/Local/Arduino
ARDUINO_USER_DIR ?= ${HOME}/Documents/Arduino
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
Expand All @@ -82,11 +82,11 @@ endif

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

# The installed Libraries are in the User folder
ARDUINO_USER_DIR ?= ${HOME}/Arduino
ARDUINO_USER_DIR ?= ${HOME}/Documents/Arduino

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

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

# Old libraries (avr-core 1.6.21 < / Arduino < 1.6.8)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial
# New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/libraries/SPI/src
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/libraries/SoftwareSerial/src
endif

VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src
Expand All @@ -681,17 +681,17 @@ ifeq ($(WIRE), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/utility
# New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src/utility
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src/utility
endif
ifeq ($(NEOPIXEL), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
endif
ifeq ($(U8GLIB), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib-HAL
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib-HAL/src
# VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
# VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/src
endif
ifeq ($(TMC), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src
Expand All @@ -700,9 +700,9 @@ endif

ifeq ($(HARDWARE_VARIANT), arduino)
HARDWARE_SUB_VARIANT ?= mega
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT)
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/$(HARDWARE_SUB_VARIANT)
else ifeq ($(HARDWARE_VARIANT), Sanguino)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/sanguino
else ifeq ($(HARDWARE_VARIANT), archim)
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/libsam
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Include/
Expand All @@ -718,7 +718,7 @@ else ifeq ($(HARDWARE_VARIANT), archim)
LDLIBS = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/libsam_sam3x8e_gcc_rel.a
else
HARDWARE_SUB_VARIANT ?= standard
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT)
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/$(HARDWARE_SUB_VARIANT)
endif

LIB_SRC = wiring.c \
Expand All @@ -733,7 +733,7 @@ endif

ifeq ($(HARDWARE_VARIANT), Teensy)
LIB_SRC = wiring.c
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/teensy/cores/teensy
endif

LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp
Expand Down Expand Up @@ -880,7 +880,7 @@ AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i
ifeq ($(shell uname -s), Linux)
AVRDUDE_CONF = /etc/avrdude/avrdude.conf
else
AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf
AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf
endif
AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \
-p$(PROG_MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2023-04-12"
//#define STRING_DISTRIBUTION_DATE "2023-08-14"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
14 changes: 5 additions & 9 deletions Marlin/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ preheat_1_temp_hotend = 180
bang_max = 255
pidtemp = on
pid_k1 = 0.95
pid_max = BANG_MAX
pid_max = 255
pid_functional_range = 10

default_kp = 22.20
Expand All @@ -69,10 +69,6 @@ x_home_dir = -1
y_home_dir = -1
z_home_dir = -1

use_xmin_plug = on
use_ymin_plug = on
use_zmin_plug = on

x_min_endstop_hit_state = HIGH
y_min_endstop_hit_state = HIGH
z_min_endstop_hit_state = HIGH
Expand Down Expand Up @@ -100,10 +96,10 @@ step_state_x = HIGH
step_state_y = HIGH
step_state_z = HIGH

disable_x = false
disable_y = false
disable_z = false
disable_e = false
disable_x = off
disable_y = off
disable_z = off
disable_e = off

proportional_font_ratio = 1.0
default_nominal_filament_dia = 1.75
Expand Down
33 changes: 25 additions & 8 deletions Marlin/src/HAL/AVR/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,40 @@ void save_reset_reason() {
wdt_disable();
}

#include "registers.h"

MarlinHAL::MarlinHAL() {
TERN_(HAL_AVR_DIRTY_INIT, _ATmega_resetperipherals()); // Clean-wipe the device state.
}

void MarlinHAL::init() {
// Init Servo Pins
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
#if HAS_SERVO_0
INIT_SERVO(0);
OUT_WRITE(SERVO0_PIN, LOW);
#endif
#if HAS_SERVO_1
INIT_SERVO(1);
OUT_WRITE(SERVO1_PIN, LOW);
#endif
#if HAS_SERVO_2
INIT_SERVO(2);
OUT_WRITE(SERVO2_PIN, LOW);
#endif
#if HAS_SERVO_3
INIT_SERVO(3);
OUT_WRITE(SERVO3_PIN, LOW);
#endif

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

#if PIN_EXISTS(BEEPER) && ENABLED(HAL_AVR_DIRTY_INIT) && DISABLED(ATMEGA_NO_BEEPFIX)
// Make sure no alternative is locked onto the BEEPER.
// This fixes the issue where the ATmega is constantly beeping.
// Might disable other peripherals using the pin; to circumvent that please undefine one of the above things!
// The true culprit is the AVR ArduinoCore that enables peripherals redundantly.
// (USART1 on the GeeeTech GT2560)
// https://www.youtube.com/watch?v=jMgCvRXkexk
_ATmega_savePinAlternate(BEEPER_PIN);

OUT_WRITE(BEEPER_PIN, LOW);
#endif
}

void MarlinHAL::reboot() {
Expand Down Expand Up @@ -145,12 +162,12 @@ void MarlinHAL::reboot() {
// Free Memory Accessor
// ------------------------

#if ENABLED(SDSUPPORT)
#if HAS_MEDIA

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

#else // !SDSUPPORT
#else // !HAS_MEDIA

extern "C" {
extern char __bss_end;
Expand All @@ -167,6 +184,6 @@ void MarlinHAL::reboot() {
}
}

#endif // !SDSUPPORT
#endif // !HAS_MEDIA

#endif // __AVR__
8 changes: 4 additions & 4 deletions Marlin/src/HAL/AVR/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ typedef Servo hal_servo_t;
#endif
#define LCD_SERIAL lcdSerial
#if HAS_DGUS_LCD
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
#endif
#endif

//
// ADC
//
#define HAL_ADC_VREF 5.0
#define HAL_ADC_RESOLUTION 10
#define HAL_ADC_VREF_MV 5000
#define HAL_ADC_RESOLUTION 10

//
// Pin Mapping for M42, M43, M226
Expand Down Expand Up @@ -187,7 +187,7 @@ class MarlinHAL {
public:

// Earliest possible init, before setup()
MarlinHAL() {}
MarlinHAL();

// Watchdog
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/AVR/HAL_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void spiBegin() {
// output pin high - like sending 0xFF
WRITE(SD_MOSI_PIN, HIGH);

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

nop; // adjust so SCK is nice
Expand All @@ -225,7 +225,7 @@ void spiBegin() {
void spiSend(uint8_t data) {
// no interrupts during byte send - about 8µs
cli();
LOOP_L_N(i, 8) {
for (uint8_t i = 0; i < 8; ++i) {
WRITE(SD_SCK_PIN, LOW);
WRITE(SD_MOSI_PIN, data & 0x80);
data <<= 1;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
static constexpr bool DROPPED_RX = false;
static constexpr bool RX_FRAMING_ERRORS = false;
static constexpr bool MAX_RX_QUEUED = false;
static constexpr bool RX_OVERRUNS = BOTH(HAS_DGUS_LCD, SERIAL_STATS_RX_BUFFER_OVERRUNS);
static constexpr bool RX_OVERRUNS = ALL(HAS_DGUS_LCD, SERIAL_STATS_RX_BUFFER_OVERRUNS);
};

typedef Serial1Class< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialLCD;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/eeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

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

#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
#if ANY(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)

/**
* PersistentStore for Arduino-style EEPROM interface
Expand Down
Loading

0 comments on commit d14f793

Please sign in to comment.