Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] bugfix-2.1.x from MarlinFirmware:bugfix-2.1.x #517

Merged
merged 13 commits into from
Sep 9, 2024
Merged
27 changes: 0 additions & 27 deletions .github/workflows/update-base-configs.yml

This file was deleted.

7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ help:
@echo "make marlin : Build marlin for the configured board"
@echo "make format-pins -j : Reformat all pins files (-j for parallel execution)"
@echo "make validate-pins -j : Validate all pins files, fails if any require reformatting"
@echo "make base-configs : Regenerate the base configs in Marlin/src/inc"
@echo "make tests-single-ci : Run a single test from inside the CI"
@echo "make tests-single-local : Run a single test locally"
@echo "make tests-single-local-docker : Run a single test locally, using docker"
Expand Down Expand Up @@ -103,9 +102,3 @@ format-pins: $(PINS)
validate-pins: format-pins
@echo "Validating pins files"
@git diff --exit-code || (git status && echo "\nError: Pins files are not formatted correctly. Run \"make format-pins\" to fix.\n" && exit 1)

base-configs:
@echo "Generating base configs"
@python $(SCRIPTS_DIR)/makeBaseConfigs.py 2>/dev/null \
&& git add Marlin/src/inc/BaseConfiguration.h Marlin/src/inc/BaseConfiguration_adv.h \
&& git commit -m "[cron] Update Base Configurations"
4 changes: 2 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1679,8 +1679,8 @@
* probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
* Example: 'M851 Z-5' with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: 'M851 Z+1' with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 10 // (mm) Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points
Expand Down
44 changes: 30 additions & 14 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,11 @@
#define HOME_AFTER_G34
#endif

//
// Add the G35 command to read bed corners to help adjust screws. Requires a bed probe.
//
/**
* Assisted Tramming
*
* Add the G35 command to measure bed corners and help adjust screws. Requires a bed probe.
*/
//#define ASSISTED_TRAMMING
#if ENABLED(ASSISTED_TRAMMING)

Expand All @@ -1105,19 +1107,22 @@
//#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment

/**
* Screw thread:
* M3: 30 = Clockwise, 31 = Counter-Clockwise
* M4: 40 = Clockwise, 41 = Counter-Clockwise
* M5: 50 = Clockwise, 51 = Counter-Clockwise
* Screw Thread. Use one of the following defines:
*
* M3_CW = M3 Clockwise, M3_CCW = M3 Counter-Clockwise
* M4_CW = M3 Clockwise, M4_CCW = M4 Counter-Clockwise
* M5_CW = M3 Clockwise, M5_CCW = M5 Counter-Clockwise
*
* :{'M3_CW':'M3 Clockwise','M3_CCW':'M3 Counter-Clockwise','M4_CW':'M4 Clockwise','M4_CCW':'M4 Counter-Clockwise','M5_CW':'M5 Clockwise','M5_CCW':'M5 Counter-Clockwise'}
*/
#define TRAMMING_SCREW_THREAD 30
#define TRAMMING_SCREW_THREAD M3_CW

#endif

// @section motion control

/**
* Fixed-time-based Motion Control -- EXPERIMENTAL
* Fixed-time-based Motion Control -- BETA FEATURE
* Enable/disable and set parameters with G-code M493.
* See ft_types.h for named values used by FTM options.
*/
Expand Down Expand Up @@ -1181,7 +1186,7 @@
#endif

/**
* Input Shaping -- EXPERIMENTAL
* Input Shaping
*
* Zero Vibration (ZV) Input Shaping for X and/or Y movements.
*
Expand Down Expand Up @@ -1490,8 +1495,17 @@
#define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
#endif

/**
* Probe Offset Wizard
* Add a Probe Z Offset calibration option to the LCD menu.
* Use this helper to get a perfect 'M851 Z' probe offset.
* When launched this powerful wizard:
* - Measures the bed height at the configured position with the probe.
* - Moves the nozzle to the same position for a "paper" measurement.
* - The difference is used to set the probe Z offset.
*/
#if HAS_BED_PROBE && ANY(HAS_MARLINUI_MENU, HAS_TFT_LVGL_UI)
//#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu
//#define PROBE_OFFSET_WIZARD
#if ENABLED(PROBE_OFFSET_WIZARD)
/**
* Enable to init the Probe Z-Offset when starting the Wizard.
Expand All @@ -1508,6 +1522,10 @@
#if HAS_MARLINUI_MENU

#if HAS_BED_PROBE

// Show Deploy / Stow Probe options in the Motion menu.
#define PROBE_DEPLOY_STOW_MENU

// Add calibration in the Probe Offsets menu to compensate for X-axis twist.
//#define X_AXIS_TWIST_COMPENSATION
#if ENABLED(X_AXIS_TWIST_COMPENSATION)
Expand All @@ -1522,8 +1540,6 @@
#define XATC_Z_OFFSETS { 0, 0, 0 } // Z offsets for X axis sample points
#endif

// Show Deploy / Stow Probe options in the Motion menu.
#define PROBE_DEPLOY_STOW_MENU
#endif

// Include a page of printer information in the LCD Main Menu
Expand Down Expand Up @@ -2708,7 +2724,7 @@

/**
* Set the number of proportional font spaces required to fill up a typical character space.
* This can help to better align the output of commands like `G29 O` Mesh Output.
* This can help to better align the output of commands like 'G29 O' Mesh Output.
*
* For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0.
* Otherwise, adjust according to your client and font.
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 "2024-09-04"
//#define STRING_DISTRIBUTION_DATE "2024-09-08"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/sdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) {
hdma_sdio.Init.MemInc = DMA_MINC_ENABLE;
hdma_sdio.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_sdio.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
hdma_sdio.Init.Priority = DMA_PRIORITY_LOW;
hdma_sdio.Init.Priority = DMA_PRIORITY_MEDIUM;
__HAL_LINKDMA(&hsd, hdmarx, hdma_sdio);
__HAL_LINKDMA(&hsd, hdmatx, hdma_sdio);

Expand Down
7 changes: 4 additions & 3 deletions Marlin/src/HAL/STM32/tft/tft_fsmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ void TFT_FSMC::init() {

HAL_SRAM_Init(&SRAMx, &timing, &extTiming);

__HAL_RCC_DMA2_CLK_ENABLE();

#ifdef STM32F1xx
DMAtx.Instance = DMA2_Channel1;
__HAL_RCC_DMA1_CLK_ENABLE();
DMAtx.Instance = DMA1_Channel1;
#elif defined(STM32F4xx)
__HAL_RCC_DMA2_CLK_ENABLE();
DMAtx.Instance = DMA2_Stream0;
DMAtx.Init.Channel = DMA_CHANNEL_0;
DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE;
Expand Down Expand Up @@ -182,6 +182,7 @@ void TFT_FSMC::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t cou
DMAtx.Init.PeriphInc = memoryIncrease;
HAL_DMA_Init(&DMAtx);
HAL_DMA_Start(&DMAtx, (uint32_t)data, (uint32_t)&(LCD->RAM), count);
TERN_(TFT_SHARED_IO, while (isBusy()));
}

void TFT_FSMC::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/tft/tft_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void TFT_SPI::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t coun
SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); // Enable Tx DMA Request
#endif

TERN_(TFT_SHARED_IO, while (isBusy()) { /* nada */ });
TERN_(TFT_SHARED_IO, while (isBusy()));
}

void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) {
Expand Down
13 changes: 10 additions & 3 deletions Marlin/src/feature/tramming.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@
#include "../inc/MarlinConfig.h"
#include "../module/probe.h"

#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1
#error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51."
#endif
enum TrammingThread : uint8_t {
M3_CW = 30, M3_CCW = 31,
M4_CW = 40, M4_CCW = 41,
M5_CW = 50, M5_CCW = 51
};

static_assert(
TRAMMING_SCREW_THREAD < 60 && TRAMMING_SCREW_THREAD % 10 < 2,
"TRAMMING_SCREW_THREAD must be M3_CW, M3_CCW, M4_CW, M4_CCW, M5_CW, or M5_CCW."
);

constexpr xy_pos_t tramming_points[] = TRAMMING_POINT_XY;

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ void GcodeSuite::G28() {
bool with_probe = ENABLED(HOMING_Z_WITH_PROBE);
// Raise above the current Z (which should be synced in the planner)
// The "height" for Z is a coordinate. But if Z is not trusted/homed make it relative.
if (seenR || !TERN(HOME_AFTER_DEACTIVATE, axis_is_trusted, axis_was_homed)(Z_AXIS)) {
if (seenR || !(z_min_trusted || axis_should_home(Z_AXIS))) {
z_homing_height += current_position.z;
with_probe = false;
}
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/inc/Conditionals-3-etc.h
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,9 @@
#if DISABLED(DELTA)
#undef DELTA_HOME_TO_SAFE_ZONE
#endif
#if ANY(DELTA, AXEL_TPARA)
#define Z_CAN_FALL_DOWN
#endif

/**
* This setting is also used by M109 when trying to calculate
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-09-04"
#define STRING_DISTRIBUTION_DATE "2024-09-08"
#endif

/**
Expand Down
5 changes: 5 additions & 0 deletions Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
// Relative Mode. Enable with G91, disable with G90.
bool relative_mode; // = false

#if HAS_Z_AXIS
// If Z has been powered on trust that the real Z is >= current_position.z
bool z_min_trusted; // = false
#endif

/**
* Cartesian Current Position
* Used to track the native machine position as moves are queued.
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/module/motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ void restore_feedrate_and_scaling();
typedef bits_t(NUM_AXES) main_axes_bits_t;
constexpr main_axes_bits_t main_axes_mask = _BV(NUM_AXES) - 1;

#if HAS_Z_AXIS
extern bool z_min_trusted; // If Z has been powered on trust that the real Z is >= current_position.z
#endif

void set_axis_is_at_home(const AxisEnum axis);

#if HAS_ENDSTOPS
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ bool Stepper::disable_axis(const AxisEnum axis) {
// and keep a count of how many times each ENA pin has been set.

// If all the axes that share the enabled bit are disabled
// toggle the ENA state that they all share.
const bool can_disable = can_axis_disable(axis);
if (can_disable) {
#define _CASE_DISABLE(N) case N##_AXIS: DISABLE_AXIS_##N(); break;
Expand Down
10 changes: 10 additions & 0 deletions Marlin/src/module/stepper.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "../inc/MarlinConfig.h"

#include "planner.h"
#include "motion.h"
#include "stepper/indirection.h"
#include "stepper/cycles.h"
#ifdef __AVR__
Expand Down Expand Up @@ -633,9 +634,18 @@ class Stepper {
}
static void mark_axis_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) {
SBI(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex));
TERN_(HAS_Z_AXIS, if (axis == Z_AXIS) z_min_trusted = true);
// TODO: DELTA should have "Z" state affect all (ABC) motors and treat "XY" on/off as meaningless
}
static void mark_axis_disabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) {
CBI(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex));
#if HAS_Z_AXIS
if (TERN0(Z_CAN_FALL_DOWN, axis == Z_AXIS)) {
z_min_trusted = false;
current_position.z = 0;
}
#endif
// TODO: DELTA should have "Z" state affect all (ABC) motors and treat "XY" on/off as meaningless
}
static bool can_axis_disable(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) {
return !any_enable_overlap() || !(axis_enabled.bits & enable_overlap[INDEX_OF_AXIS(axis, eindex)]);
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/pins/mega/pins_CNCONTROLS_11.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@
#if HAS_MARLINUI_U8GLIB
#define DOGLCD_A0 26
#define DOGLCD_CS 24
//#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals-5-post.h
//#define DOGLCD_SCK -1
#endif
#endif

Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/pins/stm32f1/pins_CHITU3D_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@
#define TFT_RESET_PIN PF11
#define TFT_BACKLIGHT_PIN PD13

#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
#define LCD_USE_DMA_FSMC
#define FSMC_CS_PIN PD7
#define FSMC_RS_PIN PD11

#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN
#endif
Expand Down
9 changes: 3 additions & 6 deletions Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,20 +291,17 @@
* ILI9488 is not supported
* Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
*
* If the screen stays white, disable 'LCD_RESET_PIN'
* to let the bootloader init the screen.
* If the screen stays white, disable 'TFT_RESET_PIN' to let the bootloader init the screen.
*
* Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
* Setting a 'TFT_RESET_PIN' may cause a flicker when switching menus
* because Marlin uses the reset as a failsafe to revive a glitchy LCD.
*/
//#define TFT_RESET_PIN PC6 // FSMC_RST
#define TFT_BACKLIGHT_PIN PD13

#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT

#define LCD_USE_DMA_FSMC
#define FSMC_CS_PIN PD7 // NE4
#define FSMC_RS_PIN PD11 // A0

#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN

Expand Down
7 changes: 3 additions & 4 deletions Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,13 @@
// TFT with FSMC interface
//
#if HAS_FSMC_TFT
#define LCD_BACKLIGHT_PIN PF11
#define LCD_USE_DMA_FSMC
#define FSMC_CS_PIN PD7
#define FSMC_RS_PIN PG0

#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT

#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN

#define LCD_BACKLIGHT_PIN PF11
#endif

//
Expand Down
6 changes: 1 addition & 5 deletions Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,16 @@
// TFT with FSMC interface
//
#if HAS_FSMC_TFT
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
#define LCD_USE_DMA_FSMC
#define FSMC_CS_PIN PD7 // FSMC_NE1
#define FSMC_RS_PIN PD11 // A16 Register. Only one address needed

#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN

#define TFT_RESET_PIN PC4
#define TFT_BACKLIGHT_PIN PD12
#define TFT_BACKLIGHT_PWM 150 // Brightness with alt. TIM4 chan 1 (1-255)

//#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals-5-post.h
//#define DOGLCD_SCK -1

// Buffer for Color UI
#define TFT_BUFFER_WORDS 3200
#endif
Expand Down
Loading
Loading