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 10, 2024
2 parents 6b0c224 + 1916d4e commit 7b8fb6a
Show file tree
Hide file tree
Showing 10 changed files with 457 additions and 239 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci-validate-boards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# ci-validate-boards.yml
# Validate boards.h to make sure it's all set up correctly
#

name: CI - Validate boards.h

# We can do the on: section as two items, one for pull requests and one for pushes...
on:
pull_request:
branches:
- 2024-August
#- bugfix-2.1.x
paths:
- 'Marlin/src/core/boards.h'
push:
branches:
- 2024-August
#- bugfix-2.1.x
paths:
- 'Marlin/src/core/boards.h'

jobs:
validate_pins_files:
name: Validate boards.h
if: github.repository == 'classicrocker883/MRiscoCProUI'

runs-on: ubuntu-latest

steps:
- name: Check out the PR
uses: actions/checkout@v4

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Select Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'

- name: Validate core/boards.h
run: |
make validate-boards -j
9 changes: 9 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Marlin-specific settings for Zed
*
* For a full list of overridable settings, and general information on folder-specific settings,
* see the documentation: https://zed.dev/docs/configuring-zed#settings-files
*/
{
"enable_language_servers": false
}
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ UNIT_TEST_CONFIG ?= default

help:
@echo "Tasks for local development:"
@echo "make marlin : Build marlin for the configured board"
@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 validate-boards -j : Validate boards.h and pins.h for standards compliance"
@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 @@ -102,3 +103,11 @@ 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)

BOARDS_FILE := Marlin/src/core/boards.h

.PHONY: validate-boards

validate-boards:
@echo "Validating boards.h file"
@python $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1)
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-09"
//#define STRING_DISTRIBUTION_DATE "2024-09-10"

#define STRING_DISTRIBUTION_DATE __DATE__
#define STRING_DISTRIBUTION_TIME __TIME__
Expand Down
330 changes: 165 additions & 165 deletions Marlin/src/core/boards.h

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions Marlin/src/gcode/calibrate/G425.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,22 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
probe_side(m, uncertainty, TOP);
#endif

TERN_(CALIBRATION_MEASURE_RIGHT, probe_side(m, uncertainty, RIGHT, probe_top_at_edge));
/**
* Allow Y axis to probe and compute values before X axis (or remaining arbitrary axes)
* to assist with centering in calibration object. Lulzbot saw issues with higher uncertainty
* values where the nozzle was catching on the edges of the cube, and this was intended to help
* ensure the probe object remained centered.
*/
TERN_(CALIBRATION_MEASURE_FRONT, probe_side(m, uncertainty, FRONT, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_LEFT, probe_side(m, uncertainty, LEFT, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_BACK, probe_side(m, uncertainty, BACK, probe_top_at_edge));

#if HAS_Y_CENTER
m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2;
m.nozzle_outer_dimension.y = m.obj_side[BACK] - m.obj_side[FRONT] - dimensions.y;
#endif

TERN_(CALIBRATION_MEASURE_LEFT, probe_side(m, uncertainty, LEFT, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_RIGHT, probe_side(m, uncertainty, RIGHT, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_IMIN, probe_side(m, uncertainty, IMINIMUM, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_IMAX, probe_side(m, uncertainty, IMAXIMUM, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_JMIN, probe_side(m, uncertainty, JMINIMUM, probe_top_at_edge));
Expand All @@ -351,7 +363,6 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {

// Compute the measured center of the calibration object.
TERN_(HAS_X_CENTER, m.obj_center.x = (m.obj_side[LEFT] + m.obj_side[RIGHT]) / 2);
TERN_(HAS_Y_CENTER, m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2);
TERN_(HAS_I_CENTER, m.obj_center.i = (m.obj_side[IMINIMUM] + m.obj_side[IMAXIMUM]) / 2);
TERN_(HAS_J_CENTER, m.obj_center.j = (m.obj_side[JMINIMUM] + m.obj_side[JMAXIMUM]) / 2);
TERN_(HAS_K_CENTER, m.obj_center.k = (m.obj_side[KMINIMUM] + m.obj_side[KMAXIMUM]) / 2);
Expand All @@ -362,7 +373,6 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
// Compute the outside diameter of the nozzle at the height
// at which it makes contact with the calibration object
TERN_(HAS_X_CENTER, m.nozzle_outer_dimension.x = m.obj_side[RIGHT] - m.obj_side[LEFT] - dimensions.x);
TERN_(HAS_Y_CENTER, m.nozzle_outer_dimension.y = m.obj_side[BACK] - m.obj_side[FRONT] - dimensions.y);

park_above_object(m, uncertainty);

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-09"
#define STRING_DISTRIBUTION_DATE "2024-09-10"
#endif

/**
Expand Down
22 changes: 11 additions & 11 deletions Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,6 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
}
#endif

TERN_(SWITCHING_NOZZLE_TWO_SERVOS, raise_nozzle(old_tool));

REMEMBER(fr, feedrate_mm_s, XY_PROBE_FEEDRATE_MM_S);

#if HAS_SOFTWARE_ENDSTOPS
Expand Down Expand Up @@ -1290,20 +1288,23 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
magnetic_switching_toolhead_tool_change(new_tool, no_move);
#elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) // Magnetic Switching ToolChanger
em_switching_toolhead_tool_change(new_tool, no_move);
#elif ENABLED(SWITCHING_NOZZLE) && !SWITCHING_NOZZLE_TWO_SERVOS // Switching Nozzle (single servo)
#elif ENABLED(SWITCHING_NOZZLE) // Switching Nozzle
// Raise by a configured distance to avoid workpiece, except with
// SWITCHING_NOZZLE_TWO_SERVOS, as both nozzles will lift instead.
TERN_(SWITCHING_NOZZLE_TWO_SERVOS, raise_nozzle(old_tool));
if (!no_move) {
const float newz = current_position.z + _MAX(-diff.z, 0.0);

// Check if Z has space to compensate at least z_offset, and if not, just abort now
const float maxz = _MIN(TERN(HAS_SOFTWARE_ENDSTOPS, soft_endstop.max.z, Z_MAX_POS), Z_MAX_POS);
if (newz > maxz) return;

current_position.z = _MIN(newz + toolchange_settings.z_raise, maxz);
fast_line_to_current(Z_AXIS);
}
move_nozzle_servo(new_tool);
#if SWITCHING_NOZZLE_TWO_SERVOS // Switching Nozzle with two servos
lower_nozzle(new_tool);
#else
move_nozzle_servo(new_tool);
#endif
#elif ANY(MECHANICAL_SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_NOZZLE)
if (!no_move) {
current_position.z = _MIN(current_position.z + toolchange_settings.z_raise, _MIN(TERN(HAS_SOFTWARE_ENDSTOPS, soft_endstop.max.z, Z_MAX_POS), Z_MAX_POS));
Expand Down Expand Up @@ -1372,7 +1373,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
#if ENABLED(TOOLCHANGE_PARK)
if (toolchange_settings.enable_park) do_blocking_move_to_xy_z(destination, destination.z, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE));
#else
do_blocking_move_to_xy(destination, planner.settings.max_feedrate_mm_s[X_AXIS]);
do_blocking_move_to_xy(destination, planner.settings.max_feedrate_mm_s[X_AXIS]* 0.5f);

// If using MECHANICAL_SWITCHING extruder/nozzle, set HOTEND_OFFSET in Z axis after running EVENT_GCODE_TOOLCHANGE below.
#if NONE(MECHANICAL_SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_NOZZLE)
Expand Down Expand Up @@ -1405,16 +1406,14 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
#endif

TERN_(DUAL_X_CARRIAGE, idex_set_parked(false));
}
} // should_move

#if HAS_SWITCHING_NOZZLE
// Move back down. (Including when the new tool is higher.)
if (!should_move)
do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]);
#endif

TERN_(SWITCHING_NOZZLE_TWO_SERVOS, lower_nozzle(new_tool));

} // (new_tool != old_tool)

planner.synchronize();
Expand Down Expand Up @@ -1510,7 +1509,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
if (TERN1(DUAL_X_CARRIAGE, dual_x_carriage_mode == DXC_AUTO_PARK_MODE))
gcode.process_subcommands_now(F(EVENT_GCODE_AFTER_TOOLCHANGE));
#endif
}

} // !no_move

SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder);

Expand Down
Loading

0 comments on commit 7b8fb6a

Please sign in to comment.