Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into bugfix-2.1.…
Browse files Browse the repository at this point in the history
…x-redo
  • Loading branch information
classicrocker883 committed Jan 10, 2024
2 parents d0abcd5 + 854f331 commit de66cd9
Show file tree
Hide file tree
Showing 93 changed files with 1,286 additions and 965 deletions.
9 changes: 7 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1231,11 +1231,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 { 80, 80, 400, 500 }

/**
* 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 @@ -2032,7 +2037,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
19 changes: 10 additions & 9 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
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-06"
//#define STRING_DISTRIBUTION_DATE "2024-01-10"

/**
* 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 de66cd9

Please sign in to comment.