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: (37 commits)
  [cron] Bump distribution date (2024-01-16)
  πŸ§‘β€πŸ’» Tweak limit_and_warn
  πŸ§‘β€πŸ’» Tweak planner debug
  [cron] Bump distribution date (2024-01-15)
  πŸ”¨ Make / pins-format patches
  [cron] Bump distribution date (2024-01-14)
  πŸ”§ Fix SD connection defaults (MarlinFirmware#26666)
  [cron] Bump distribution date (2024-01-13)
  πŸ› Fix PLR pos/sdpos (MarlinFirmware#26365)
  [cron] Bump distribution date (2024-01-12)
  βͺ️ Revert encoder changes
  [cron] Bump distribution date (2024-01-11)
  🎨 Misc. style adjustments
  ✨ EDITABLE_STEPS_PER_UNIT (MarlinFirmware#26618)
  ✨ PLR_BED_THRESHOLD (MarlinFirmware#26649)
  🩹 Clarify servo ¡s min/max
  🩹 Fix some temp constraints
  🩹 Fix PID / MPC tune background tasks (MarlinFirmware#26652)
  🎨 Minor temp / UI refactor
  [cron] Bump distribution date (2024-01-10)
  ...
  • Loading branch information
mikezs committed Jan 16, 2024
2 parents 5071fc0 + 76dce41 commit 43c3058
Show file tree
Hide file tree
Showing 128 changed files with 1,561 additions and 1,268 deletions.
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)
9 changes: 7 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1236,11 +1236,16 @@

/**
* Default Axis Steps Per Unit (linear=steps/mm, rotational=steps/Β°)
* Override with M92
* Override with M92 (when enabled below)
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_AXIS_STEPS_PER_UNIT { 100, 100, 400, 94.75 }

/**
* Enable support for M92. Disable to save at least ~530 bytes of flash.
*/
#define EDITABLE_STEPS_PER_UNIT

/**
* Default Max Feed Rate (linear=mm/s, rotational=Β°/s)
* Override with M203
Expand Down Expand Up @@ -2037,7 +2042,7 @@
* Commands to execute at the end of G29 probing.
* Useful to retract or move the Z probe out of the way.
*/
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
//#define EVENT_GCODE_AFTER_G29 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"

/**
* Normally G28 leaves leveling disabled on completion. Enable one of
Expand Down
102 changes: 51 additions & 51 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1743,19 +1743,20 @@
*/
//#define POWER_LOSS_RECOVERY
#if ENABLED(POWER_LOSS_RECOVERY)
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define PLR_BED_THRESHOLD BED_MAXTEMP // (Β°C) Skip user confirmation at or above this bed temperature (0 to disable)
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
//#define POWER_LOSS_PULLDOWN
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.

// Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card,
// especially with "vase mode" printing. Set too high and vases cannot be continued.
#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data

// Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled!
//#define POWER_LOSS_RECOVER_ZHOME
Expand Down Expand Up @@ -3839,38 +3840,6 @@
*/
//#define CNC_COORDINATE_SYSTEMS

// @section reporting

/**
* Auto-report fan speed with M123 S<seconds>
* Requires fans with tachometer pins
*/
//#define AUTO_REPORT_FANS

/**
* Auto-report temperatures with M155 S<seconds>
*/
#define AUTO_REPORT_TEMPERATURES
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
#endif

/**
* Auto-report position with M154 S<seconds>
*/
//#define AUTO_REPORT_POSITION
#if ENABLED(AUTO_REPORT_POSITION)
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
#endif

/**
* Include capabilities in M115 output
*/
#define EXTENDED_CAPABILITIES_REPORT
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
//#define M115_GEOMETRY_REPORT
#endif

// @section security

/**
Expand Down Expand Up @@ -3913,13 +3882,50 @@

// @section reporting

// Extra options for the M114 "Current Position" report
/**
* Extra options for the M114 "Current Position" report
*/
//#define M114_DETAIL // Use 'M114` for details to check planner calculations
//#define M114_REALTIME // Real current position based on forward kinematics
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.

/**
* Auto-report fan speed with M123 S<seconds>
* Requires fans with tachometer pins
*/
//#define AUTO_REPORT_FANS

//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)

/**
* Auto-report temperatures with M155 S<seconds>
*/
#define AUTO_REPORT_TEMPERATURES
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
#endif

/**
* Auto-report position with M154 S<seconds>
*/
//#define AUTO_REPORT_POSITION
#if ENABLED(AUTO_REPORT_POSITION)
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
#endif

/**
* M115 - Report capabilites. Disable to save ~1150 bytes of flash.
* Some hosts (and serial TFT displays) rely on this feature.
*/
#define CAPABILITIES_REPORT
#if ENABLED(CAPABILITIES_REPORT)
// Include capabilities in M115 output
#define EXTENDED_CAPABILITIES_REPORT
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
//#define M115_GEOMETRY_REPORT
#endif
#endif

// @section gcode

/**
Expand All @@ -3931,7 +3937,9 @@
//#define GCODE_QUOTED_STRINGS // Support for quoted string parameters
#endif

// Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
/**
* Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
*/
//#define MEATPACK_ON_SERIAL_PORT_1
//#define MEATPACK_ON_SERIAL_PORT_2

Expand All @@ -3945,12 +3953,6 @@
*/
#define DEBUG_FLAGS_GCODE

/**
* M115 - Report capabilites. Disable to save ~1150 bytes of flash.
* Some hosts (and serial TFT displays) rely on this feature.
*/
#define REPORT_CAPABILITIES_GCODE

/**
* Enable this option for a leaner build of Marlin that removes
* workspace offsets to slightly optimize performance.
Expand Down Expand Up @@ -3978,8 +3980,6 @@
//#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
#endif

// @section gcode

/**
* Startup commands
*
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-01-04"
//#define STRING_DISTRIBUTION_DATE "2024-01-16"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/HAL/AVR/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ void MarlinHAL::init() {
#if HAS_SERVO_3
OUT_WRITE(SERVO3_PIN, LOW);
#endif
#if HAS_SERVO_4
OUT_WRITE(SERVO4_PIN, LOW);
#endif
#if HAS_SERVO_5
OUT_WRITE(SERVO5_PIN, LOW);
#endif

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

Expand Down
58 changes: 38 additions & 20 deletions Marlin/src/HAL/ESP32/i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#include <freertos/queue.h>
#include "../../module/stepper.h"

#if ENABLED(FT_MOTION)
#include "../../module/ft_motion.h"
#endif

#define DMA_BUF_COUNT 8 // number of DMA buffers to store data
#define DMA_BUF_LEN 4092 // maximum size in bytes
#define I2S_SAMPLE_SIZE 4 // 4 bytes, 32 bits per sample
Expand Down Expand Up @@ -134,8 +138,8 @@ static void IRAM_ATTR i2s_intr_handler_default(void *arg) {

if (high_priority_task_awoken == pdTRUE) portYIELD_FROM_ISR();

// clear interrupt
I2S0.int_clr.val = I2S0.int_st.val; //clear pending interrupt
// Clear pending interrupt
I2S0.int_clr.val = I2S0.int_st.val;
}

void stepperTask(void *parameter) {
Expand All @@ -148,29 +152,43 @@ void stepperTask(void *parameter) {
xQueueReceive(dma.queue, &dma.current, portMAX_DELAY);
dma.rw_pos = 0;

const bool using_ftMotion = TERN0(FT_MOTION, ftMotion.cfg.mode);

while (dma.rw_pos < DMA_SAMPLE_COUNT) {
if (!nextMainISR) {
Stepper::pulse_phase_isr();
nextMainISR = Stepper::block_phase_isr();
}
#if ENABLED(LIN_ADVANCE)
else if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
}
#endif
else
i2s_push_sample();

nextMainISR--;
#if ENABLED(FT_MOTION)

#if ENABLED(LIN_ADVANCE)
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;
if (using_ftMotion) {
if (!nextMainISR) stepper.ftMotion_stepper();
nextMainISR = 0;
}

if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
nextAdvanceISR--;
#endif

if (!using_ftMotion) {
if (!nextMainISR) {
Stepper::pulse_phase_isr();
nextMainISR = Stepper::block_phase_isr();
}
#if ENABLED(LIN_ADVANCE)
else if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
}
#endif
else
i2s_push_sample();

nextMainISR--;

#if ENABLED(LIN_ADVANCE)
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;

if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
nextAdvanceISR--;
#endif
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/HAL/LPC1768/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ void MarlinHAL::init() {
#if HAS_SERVO_3
INIT_SERVO(3);
#endif
#if HAS_SERVO_4
INIT_SERVO(4);
#endif
#if HAS_SERVO_5
INIT_SERVO(5);
#endif

//debug_frmwrk_init();
//_DBG("\n\nDebug running\n");
Expand Down
Loading

0 comments on commit 43c3058

Please sign in to comment.