Skip to content

Commit

Permalink
⛙ Merge w/Marlin
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Sep 9, 2024
2 parents 40a3e47 + b94a0d0 commit 1485e78
Show file tree
Hide file tree
Showing 86 changed files with 868 additions and 701 deletions.
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 @@ -1699,8 +1699,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 @@ -1088,9 +1088,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 @@ -1111,19 +1113,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 40
#define TRAMMING_SCREW_THREAD M4_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 @@ -1187,7 +1192,7 @@
#endif

/**
* Input Shaping -- EXPERIMENTAL
* Input Shaping
*
* Zero Vibration (ZV) Input Shaping for X and/or Y movements.
*
Expand Down Expand Up @@ -1502,8 +1507,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 @@ -1520,6 +1534,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 @@ -1534,8 +1552,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 @@ -2730,7 +2746,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
5 changes: 4 additions & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-09-03"
//#define STRING_DISTRIBUTION_DATE "2024-09-09"

#define STRING_DISTRIBUTION_DATE __DATE__
#define STRING_DISTRIBUTION_TIME __TIME__

/**
* 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/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ G29_TYPE GcodeSuite::G29() {

#endif // AUTO_BED_LEVELING_3POINT

TERN_(HAS_STATUS_MESSAGE, ui.reset_status());
ui.reset_status();

// Stow the probe. No raise for FIX_MOUNTED_PROBE.
if (probe.stow()) {
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 @@ -375,7 +375,7 @@ void GcodeSuite::G28() {
else {
// 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;
}

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 @@ -650,6 +650,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-03"
#define STRING_DISTRIBUTION_DATE "2024-09-09"
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ void menu_move() {

bool show_state = c.active;
EDIT_ITEM(bool, MSG_FIXED_TIME_MOTION, &show_state, []{
c.active ^= true;
ftMotion.cfg.active ^= true;
ftMotion.update_shaping_params();
});

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 @@ -439,6 +439,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
9 changes: 5 additions & 4 deletions Marlin/src/module/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {

FSTR_P const ds_fstr = deploy ? GET_TEXT_F(MSG_MANUAL_DEPLOY) : GET_TEXT_F(MSG_MANUAL_STOW);
ui.return_to_status(); // To display the new status message
ui.set_max_status(ds_fstr);
ui.set_max_status(ds_fstr); // Set a status message that won't be overwritten by the host
SERIAL_ECHOLN(deploy ? GET_EN_TEXT_F(MSG_MANUAL_DEPLOY) : GET_EN_TEXT_F(MSG_MANUAL_STOW));

OKAY_BUZZ();
Expand All @@ -380,7 +380,8 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
TERN_(DWIN_LCD_PROUI, DWIN_Popup_Continue(ICON_BLTouch, ds_fstr, F("")));
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());

ui.reset_status();
ui.reset_alert_level();
//ui.reset_status();

#endif // PAUSE_BEFORE_DEPLOY_STOW

Expand Down Expand Up @@ -1024,7 +1025,7 @@ float Probe::probe_at_point(
const bool sanity_check, // = true
const_float_t z_min_point, // = Z_PROBE_LOW_POINT
const_float_t z_clearance, // = Z_TWEEN_SAFE_CLEARANCE
const bool raise_after_is_relative // = false
const bool raise_after_is_rel // = false
) {
DEBUG_SECTION(log_probe, "Probe::probe_at_point", DEBUGGING(LEVELING));

Expand Down Expand Up @@ -1088,7 +1089,7 @@ float Probe::probe_at_point(
switch (raise_after) {
default: break;
case PROBE_PT_RAISE:
if (raise_after_is_relative)
if (raise_after_is_rel)
do_z_clearance_by(z_clearance);
else
do_z_clearance(z_clearance);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class Probe {
const_float_t z_clearance = Z_TWEEN_SAFE_CLEARANCE,
const bool raise_after_is_rel = false
) {
return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check, z_min_point, z_clearance, raise_after_is_relative);
return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check, z_min_point, z_clearance, raise_after_is_rel);
}

#else // !HAS_BED_PROBE
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 @@ -585,6 +585,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 @@ -634,9 +635,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
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
Loading

0 comments on commit 1485e78

Please sign in to comment.