Skip to content

Commit

Permalink
⛙ Merge w/HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Jan 16, 2024
2 parents 164f22b + c2ac167 commit ffdbf20
Show file tree
Hide file tree
Showing 96 changed files with 790 additions and 681 deletions.
323 changes: 199 additions & 124 deletions .github/workflows/compile-configs.yml

Large diffs are not rendered by default.

120 changes: 60 additions & 60 deletions .github/workflows/compile-configs_Ender.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/lock-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Lock Closed Issues

on:
schedule:
- cron: '0 1 * 1/2 *'
- cron: '0 1 1 */2 *'

jobs:
lock:
Expand Down
30 changes: 13 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ CONTAINER_IMAGE := marlin-dev

help:
@echo "Tasks for local development:"
@echo "* format-pins: Reformat all pins files"
@echo "* tests-single-ci: Run a single test from inside the CI"
@echo "* tests-single-local: Run a single test locally"
@echo "* tests-single-local-docker: Run a single test locally, using docker"
@echo "* tests-all-local: Run all tests locally"
@echo "* tests-all-local-docker: Run all tests locally, using docker"
@echo "* setup-local-docker: Build the local docker image"
@echo "make marlin : Build marlin for the configured board"
@echo "make format-pins : Reformat all pins files"
@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"
@echo "make tests-all-local : Run all tests locally"
@echo "make tests-all-local-docker : Run all tests locally, using docker"
@echo "make setup-local-docker : Build the local docker image"
@echo ""
@echo "Options for testing:"
@echo " TEST_TARGET Set when running tests-single-*, to select the"
Expand All @@ -24,46 +25,41 @@ help:
@echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value"
@echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
.PHONY: help

marlin:
./buildroot/bin/mftest -a
.PHONY: marlin

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

tests-single-local:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& run_tests . $(TEST_TARGET) "$(ONLY_TEST)"
.PHONY: tests-single-local

tests-single-local-docker:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
.PHONY: tests-single-local-docker

tests-all-local:
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
.PHONY: tests-all-local

tests-all-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
.PHONY: tests-all-local-docker

setup-local-docker:
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
.PHONY: setup-local-docker

PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')

.PHONY: $(PINS)

$(PINS): %:
@echo "Formatting $@" && node buildroot/share/scripts/pinsformat.js $@
@echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@

format-pins: $(PINS)
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-01-09"
//#define STRING_DISTRIBUTION_DATE "2024-01-16"

#define STRING_DISTRIBUTION_DATE __DATE__
#define STRING_DISTRIBUTION_TIME __TIME__
Expand Down
10 changes: 6 additions & 4 deletions Marlin/src/feature/powerloss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ void PrintJobRecovery::write() {
* Resume the saved print job
*/
void PrintJobRecovery::resume() {
const uint32_t resume_sdpos = info.sdpos; // Get here before the stepper ISR overwrites it
// Get these fields before any moves because stepper.cpp overwrites them
const xyze_pos_t resume_pos = info.current_position;
const uint32_t resume_sdpos = info.sdpos;

// Apply the dry-run flag if enabled
if (info.flag.dryrun) marlin_debug_flags |= MARLIN_DEBUG_DRYRUN;
Expand Down Expand Up @@ -417,7 +419,7 @@ void PrintJobRecovery::resume() {
#endif

// Interpret the saved Z according to flags
const float z_print = info.current_position.z,
const float z_print = resume_pos.z,
z_raised = z_print + info.zraise;

//
Expand Down Expand Up @@ -569,7 +571,7 @@ void PrintJobRecovery::resume() {

// Move back over to the saved XY
PROCESS_SUBCOMMANDS_NOW(TS(
F("G1F3000X"), p_float_t(info.current_position.x, 3), 'Y', p_float_t(info.current_position.y, 3)
F("G1F3000X"), p_float_t(resume_pos.x, 3), 'Y', p_float_t(resume_pos.y, 3)
));
DEBUG_ECHOLNPGM("Move XY : ",cmd);

Expand All @@ -582,7 +584,7 @@ void PrintJobRecovery::resume() {
DEBUG_ECHOLNPGM("Feedrate: ",cmd);

// Restore E position with G92.9
PROCESS_SUBCOMMANDS_NOW(TS(F("G92.9E"), p_float_t(info.current_position.e, 3)));
PROCESS_SUBCOMMANDS_NOW(TS(F("G92.9E"), p_float_t(resume_pos.e, 3)));
DEBUG_ECHOLNPGM("Extruder : ",cmd);

TERN_(GCODE_REPEAT_MARKERS, repeat = info.stored_repeat);
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/gcode/feature/powerloss/M1000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ inline void plr_error(FSTR_P const prefix) {
* M1000: Resume from power-loss (undocumented)
* - With 'S' go to the Resume/Cancel menu
* ...unless the bed temperature is already above a configured minimum temperature.
* - With 'C' execute a cancel selection
* - With no parameters, run recovery commands
*/
void GcodeSuite::M1000() {
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/gcode/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ PGM_P GCodeQueue::injected_commands_P; // = nullptr
*/
char GCodeQueue::injected_commands[64]; // = { 0 }

/**
* Commit the accumulated G-code command to the ring buffer,
* also setting its origin info.
*/
void GCodeQueue::RingBuffer::commit_command(const bool skip_ok
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind/*=-1*/)
) {
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ class GCodeQueue {
void advance_pos(uint8_t &p, const int inc) { if (++p >= BUFSIZE) p = 0; length += inc; }

void commit_command(const bool skip_ok
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind = serial_index_t())
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind=serial_index_t())
);

bool enqueue(const char *cmd, const bool skip_ok=true
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind = serial_index_t())
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind=serial_index_t())
);

void ok_to_send();
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@
#elif ENABLED(CR10_STOCKDISPLAY)

#define IS_RRD_FG_SC 1
#define NO_LCD_SDCARD
#define LCD_ST7920_DELAY_1 125
#define LCD_ST7920_DELAY_2 125
#define LCD_ST7920_DELAY_3 125
Expand Down Expand Up @@ -1680,6 +1681,7 @@
#define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
#define TFT_RES_480x320
#define TFT_INTERFACE_SPI
#define NO_LCD_SDCARD
#elif ANY(LERDGE_TFT35, ANET_ET5_TFT35) // ST7796
#define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
#define TFT_RES_480x320
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2723,8 +2723,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_2), "zh_CN") == 0, "LCD_LANGUAGE_2 must be set to zh_CN for ANYCUBIC_LCD_VYPER.");
#endif

#if ANY(MKS_TS35_V2_0, BTT_TFT35_SPI_V1_0) && SD_CONNECTION_IS(LCD)
#error "SDCARD_CONNECTION cannot be set to LCD for the enabled TFT. No available SD card reader."
#if ENABLED(NO_LCD_SDCARD) && SD_CONNECTION_IS(LCD)
#error "SDCARD_CONNECTION cannot be set to LCD for the enabled display. No available SD card reader."
#endif

/**
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-01-09"
#define STRING_DISTRIBUTION_DATE "2024-01-16"
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/common/dwin_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void DWIN_Draw_String(bool bShow, uint8_t size, uint16_t color, uint16_t bColor,
DWIN_Byte(i, 0x11);
// Bit 7: widthAdjust
// Bit 6: bShow
// Bit 5-4: Unused (0)
// Bit 5-4: unused (0)
// Bit 3-0: size
DWIN_Byte(i, (widthAdjust * 0x80) | (bShow * 0x40) | size);
DWIN_Word(i, color);
Expand Down
42 changes: 16 additions & 26 deletions Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@

BedLevelToolsClass bedLevelTools;

#if USE_GRID_MESHVIEWER
bool BedLevelToolsClass::view_mesh = false;
#endif
bool BedLevelToolsClass::goto_mesh_value = false;
uint8_t BedLevelToolsClass::mesh_x = 0;
uint8_t BedLevelToolsClass::mesh_y = 0;
Expand All @@ -52,14 +49,6 @@ bool drawing_mesh = false;

#if ENABLED(AUTO_BED_LEVELING_UBL)

void BedLevelToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool undefined/*=false*/) {
MString<MAX_CMD_SIZE> cmd;
cmd.set(F("M421 I"), mesh_x, 'J', mesh_y, 'Z', p_float_t(current_position.z, 3));
if (undefined) cmd += F(" N");
gcode.process_subcommands_now(cmd);
planner.synchronize();
}

bool BedLevelToolsClass::create_plane_from_mesh() {
struct linear_fit_data lsf_results;
incremental_LSF_reset(&lsf_results);
Expand Down Expand Up @@ -99,17 +88,18 @@ bool drawing_mesh = false;
return false;
}

#else

void BedLevelToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y) {
gcode.process_subcommands_now(
TS(F("G29 I"), mesh_x, 'J', mesh_y, 'Z', p_float_t(current_position.z, 3))
);
planner.synchronize();
}

#endif

void BedLevelToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool reset/*=false*/) {
float zval;
if (reset) { zval = 0; }
else { zval = current_position.z; }
gcode.process_subcommands_now(
TS(F(TERN(AUTO_BED_LEVELING_UBL, "M421 I", "G29 I")), mesh_x, 'J', mesh_y, 'Z', p_float_t(zval, 3))
);
planner.synchronize();
}

void BedLevelToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove/*=false*/) {
gcode.process_subcommands_now(F("G28O"));
if (zmove) {
Expand Down Expand Up @@ -187,8 +177,8 @@ bool BedLevelToolsClass::meshValidate() {
}

#if USE_GRID_MESHVIEWER

constexpr uint8_t meshfont = TERN(TJC_DISPLAY, font8x16, font6x12);
#include "meshviewer.h"
bool BedLevelToolsClass::view_mesh = false;

void BedLevelToolsClass::Draw_Bed_Mesh(int16_t selected/*=-1*/, uint8_t gridline_width/*=1*/, uint16_t padding_x/*=8*/, uint16_t padding_y_top/*=(40 + 53 - 7)*/) {
drawing_mesh = true;
Expand Down Expand Up @@ -224,10 +214,10 @@ bool BedLevelToolsClass::meshValidate() {
LCD_SERIAL.flushTX();

// Draw value text on
const uint8_t fs = DWINUI::fontWidth(meshfont);
const uint8_t fs = DWINUI::fontWidth(MeshViewer.meshfont);
const int8_t offset_y = cell_height_px / 2 - fs;
if (isnan(z)) { // undefined
DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X"));
DWIN_Draw_String(false, MeshViewer.meshfont, DWINUI::textcolor, DWINUI::backcolor, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X"));
}
else { // has value
MString<12> msg;
Expand All @@ -237,8 +227,8 @@ bool BedLevelToolsClass::meshValidate() {
msg.set(p_float_t(abs(z), 2));
const int8_t offset_x = cell_width_px / 2 - (fs / 2) * msg.length() - 2;
if ((GRID_MAX_POINTS_X) >= TERN(TJC_DISPLAY, 8, 10))
DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, start_x_px - 2 + offset_x, start_y_px + offset_y, F("."));
DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, start_x_px + 1 + offset_x, start_y_px + offset_y, msg);
DWIN_Draw_String(false, MeshViewer.meshfont, DWINUI::textcolor, DWINUI::backcolor, start_x_px - 2 + offset_x, start_y_px + offset_y, F("."));
DWIN_Draw_String(false, MeshViewer.meshfont, DWINUI::textcolor, DWINUI::backcolor, start_x_px + 1 + offset_x, start_y_px + offset_y, msg);
}
safe_delay(10);
LCD_SERIAL.flushTX();
Expand Down
8 changes: 2 additions & 6 deletions Marlin/src/lcd/e3v2/proui/bedlevel_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,15 @@

class BedLevelToolsClass {
public:
#if USE_GRID_MESHVIEWER
static bool view_mesh;
#endif
static bool goto_mesh_value;
static uint8_t mesh_x;
static uint8_t mesh_y;
static uint8_t tilt_grid;

#if ENABLED(AUTO_BED_LEVELING_UBL)
static void manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool undefined=false);
static bool create_plane_from_mesh();
#else
static void manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y);
#endif
static void manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool reset=false);
static void manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove=false);
static void MoveToXYZ();
static void MoveToXY();
Expand All @@ -51,6 +46,7 @@ class BedLevelToolsClass {
static float get_min_value();
static bool meshValidate();
#if USE_GRID_MESHVIEWER
static bool view_mesh;
static void Draw_Bed_Mesh(int16_t selected=-1, uint8_t gridline_width=1, uint16_t padding_x=8, uint16_t padding_y_top=(40 + 53 - 7));
static void Set_Mesh_Viewer_Status();
#endif
Expand Down
Loading

0 comments on commit ffdbf20

Please sign in to comment.