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: (51 commits)
  [cron] Bump distribution date (2023-10-15)
  ✨ Z_PROBE_ERROR_TOLERANCE (expose) (MarlinFirmware#26229)
  [cron] Bump distribution date (2023-10-13)
  🧑‍💻 IA Creality optional code
  [cron] Bump distribution date (2023-10-12)
  🔧 Misc. probe opts
  📝 GCode => G-Code
  🧑‍💻 FxdTiCtrl => FTMotion redux
  🚸 Update FTDI Eve / CocoaPress UI (MarlinFirmware#26233)
  🧑‍💻 FxdTiCtrl => FTMotion
  📝 Macro comments
  [cron] Bump distribution date (2023-10-11)
  ✨ Nonlinear Extrusion Control (M592) (MarlinFirmware#26127)
  [cron] Bump distribution date (2023-10-10)
  🐛 Fix tool-change E prime (MarlinFirmware#26237)
  ✨ FYSETC Cheetah v3.0 (MarlinFirmware#26314)
  🔧 BTT_MINI_12864_V1 => BTT_MINI_12864 (MarlinFirmware#26160)
  🔧 More angles for 2x Servo Switching Nozzle (MarlinFirmware#26303)
  [cron] Bump distribution date (2023-10-09)
  🩹 Patches for MSC SD (MarlinFirmware#26332)
  ...

# Conflicts:
#	.github/workflows/test-builds.yml
  • Loading branch information
mikezs committed Oct 17, 2023
2 parents 3cc1af9 + caca563 commit c2ffe73
Show file tree
Hide file tree
Showing 114 changed files with 2,904 additions and 1,045 deletions.
56 changes: 29 additions & 27 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@
#if ENABLED(SWITCHING_NOZZLE)
#define SWITCHING_NOZZLE_SERVO_NR 0
//#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second
#define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo)
#define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // A pair of angles for { E0, E1 }.
// For Dual Servo use two pairs: { { lower, raise }, { lower, raise } }
#define SWITCHING_NOZZLE_SERVO_DWELL 2500 // Dwell time to wait for servo to make physical move
#endif

Expand Down Expand Up @@ -669,7 +670,7 @@
//#define MPCTEMP // ** EXPERIMENTAL ** See https://marlinfw.org/docs/features/model_predictive_control.html

#define PID_MAX 255 // Limit hotend current while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#define PID_K1 0.95 // Smoothing factor within any PID loop
#define PID_K1 0.95 // Smoothing factor within any PID loop

#if ENABLED(PIDTEMP)
//#define PID_DEBUG // Print PID debug data to the serial port. Use 'M303 D' to toggle activation.
Expand Down Expand Up @@ -1423,6 +1424,15 @@
//#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu)
#endif

/**
* Bed Distance Sensor
*
* Measures the distance from bed to nozzle with accuracy of 0.01mm.
* For information about this sensor https://github.com/markniu/Bed_Distance_sensor
* Uses I2C port, so it requires I2C library markyue/Panda_SoftMasterI2C.
*/
//#define BD_SENSOR

// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
//#define SOLENOID_PROBE

Expand Down Expand Up @@ -1628,16 +1638,17 @@
* 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 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points
#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes
//#define Z_AFTER_PROBING 5 // Z position after probing is done
#define Z_CLEARANCE_DEPLOY_PROBE 10 // (mm) Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points
#define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes
#define Z_PROBE_ERROR_TOLERANCE 3 // (mm) Tolerance for early trigger (<= -probe.offset.z + ZPET)
//#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done

#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping

// For M851 give a range for adjusting the Z probe offset
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20
#define Z_PROBE_OFFSET_RANGE_MIN -20 // (mm)
#define Z_PROBE_OFFSET_RANGE_MAX 20 // (mm)

// Enable the M48 repeatability test to test probe accuracy
#define Z_MIN_PROBE_REPEATABILITY_TEST
Expand Down Expand Up @@ -2001,6 +2012,12 @@
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING

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

/**
* Normally G28 leaves leveling disabled on completion. Enable one of
* these options to restore the prior leveling state or to always enable
Expand All @@ -2018,15 +2035,6 @@
#define LEVELING_BED_TEMP 50
#endif

/**
* Bed Distance Sensor
*
* Measures the distance from bed to nozzle with accuracy of 0.01mm.
* For information about this sensor https://github.com/markniu/Bed_Distance_sensor
* Uses I2C port, so it requires I2C library markyue/Panda_SoftMasterI2C.
*/
//#define BD_SENSOR

/**
* Enable detailed logging of G28, G29, M48, etc.
* Turn on with the command 'M111 S32'.
Expand Down Expand Up @@ -2206,12 +2214,6 @@
#define BED_TRAMMING_LEVELING_ORDER { LF, RF, RB, LB }
#endif

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

// @section homing

// The center of the bed is at (X=0, Y=0)
Expand Down Expand Up @@ -2992,10 +2994,10 @@
//#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight.

//
// BigTreeTech Mini 12864 V1.0 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight.
// https://github.com/bigtreetech/MINI-12864/tree/master/mini12864_v1.0
// BigTreeTech Mini 12864 V1.0 / V2.0 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight.
// https://github.com/bigtreetech/MINI-12864
//
//#define BTT_MINI_12864_V1
//#define BTT_MINI_12864

//
// Factory display for Creality CR-10 / CR-7 / Ender-3
Expand Down
67 changes: 45 additions & 22 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@
* THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
*/
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
#define THERMAL_PROTECTION_PERIOD 40 // (seconds)
#define THERMAL_PROTECTION_HYSTERESIS 4 // (°C)

//#define ADAPTIVE_FAN_SLOWING // Slow down the part-cooling fan if the temperature drops
#if ENABLED(ADAPTIVE_FAN_SLOWING)
Expand All @@ -327,50 +327,50 @@
* and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set
* below 2.
*/
#define WATCH_TEMP_PERIOD 40 // Seconds
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
#define WATCH_TEMP_PERIOD 40 // (seconds)
#define WATCH_TEMP_INCREASE 2 // (°C)
#endif

/**
* Thermal Protection parameters for the bed are just as above for hotends.
*/
#if ENABLED(THERMAL_PROTECTION_BED)
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#define THERMAL_PROTECTION_BED_PERIOD 20 // (seconds)
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // (°C)

/**
* As described above, except for the bed (M140/M190/M303).
*/
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#define WATCH_BED_TEMP_PERIOD 60 // (seconds)
#define WATCH_BED_TEMP_INCREASE 2 // (°C)
#endif

/**
* Thermal Protection parameters for the heated chamber.
*/
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // (seconds)
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // (°C)

/**
* Heated chamber watch settings (M141/M191).
*/
#define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds
#define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius
#define WATCH_CHAMBER_TEMP_PERIOD 60 // (seconds)
#define WATCH_CHAMBER_TEMP_INCREASE 2 // (°C)
#endif

/**
* Thermal Protection parameters for the laser cooler.
*/
#if ENABLED(THERMAL_PROTECTION_COOLER)
#define THERMAL_PROTECTION_COOLER_PERIOD 10 // Seconds
#define THERMAL_PROTECTION_COOLER_HYSTERESIS 3 // Degrees Celsius
#define THERMAL_PROTECTION_COOLER_PERIOD 10 // (seconds)
#define THERMAL_PROTECTION_COOLER_HYSTERESIS 3 // (°C)

/**
* Laser cooling watch settings (M143/M193).
*/
#define WATCH_COOLER_TEMP_PERIOD 60 // Seconds
#define WATCH_COOLER_TEMP_INCREASE 3 // Degrees Celsius
#define WATCH_COOLER_TEMP_PERIOD 60 // (seconds)
#define WATCH_COOLER_TEMP_INCREASE 3 // (°C)
#endif

#if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER)
Expand Down Expand Up @@ -564,6 +564,8 @@
#define TEMP_SENSOR_AD8495_OFFSET 0.0
#define TEMP_SENSOR_AD8495_GAIN 1.0

// @section fans

/**
* Controller Fan
* To cool down the stepper drivers and MOSFETs.
Expand Down Expand Up @@ -667,8 +669,6 @@
//#define NUM_REDUNDANT_FANS 1 // Number of sequential fans to synchronize with Fan 0
#endif

// @section extruder

/**
* Extruder cooling fans
*
Expand Down Expand Up @@ -745,6 +745,7 @@
#define FANMUX2_PIN -1

/**
* @section caselight
* M355 Case Light on-off / brightness
*/
//#define CASE_LIGHT_ENABLE
Expand All @@ -767,7 +768,7 @@
#endif
#endif

// @section homing
// @section endstops

// If you want endstops to stay on (by default) even when not homing
// enable this option. Override at any time with M120, M121.
Expand All @@ -784,6 +785,8 @@
//#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1
#endif

// @section idex

/**
* Dual X Carriage
*
Expand Down Expand Up @@ -833,6 +836,8 @@
//#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X"
#endif

// @section multi stepper

/**
* Multi-Stepper / Multi-Endstop
*
Expand Down Expand Up @@ -904,6 +909,8 @@
//#define INVERT_E1_VS_E0_DIR // E direction signals are opposites
#endif

// @section extruder

// Activate a solenoid on the active extruder with M380. Disable all with M381.
// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid.
//#define EXT_SOLENOID
Expand Down Expand Up @@ -2271,6 +2278,14 @@
//#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz.
#endif

/**
* Nonlinear Extrusion Control
*
* Control extrusion rate based on instantaneous extruder velocity. Can be used to correct for
* underextrusion at high extruder speeds that are otherwise well-behaved (i.e., not skipping).
*/
//#define NONLINEAR_EXTRUSION

// @section leveling

/**
Expand Down Expand Up @@ -2354,6 +2369,8 @@

#endif

// @section probes

/**
* Thermal Probe Compensation
*
Expand Down Expand Up @@ -2416,7 +2433,7 @@

// Height above Z=0.0 to raise the nozzle. Lowering this can help the probe to heat faster.
// Note: The Z=0.0 offset is determined by the probe Z offset (e.g., as set with M851 Z).
#define PTC_PROBE_HEATING_OFFSET 0.5
#define PTC_PROBE_HEATING_OFFSET 0.5 // (mm)
#endif
#endif // PTC_PROBE || PTC_BED || PTC_HOTEND

Expand Down Expand Up @@ -2471,6 +2488,8 @@
#define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move.
#endif

// @section motion

// Moves (or segments) with fewer steps than this will be joined with the next move
#define MIN_STEPS_PER_SEGMENT 6

Expand Down Expand Up @@ -2526,7 +2545,7 @@
//================================= Buffers =================================
//===========================================================================

// @section motion
// @section gcode

// The number of linear moves that can be in the planner at once.
#if ALL(HAS_MEDIA, DIRECT_STEPPING)
Expand Down Expand Up @@ -2614,7 +2633,7 @@
// Therefore some clients abort after 30 seconds in a timeout.
// Some other clients start sending commands while receiving a 'wait'.
// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
//#define NO_TIMEOUTS 1000 // Milliseconds
//#define NO_TIMEOUTS 1000 // (ms)

// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
#define ADVANCED_OK
Expand Down Expand Up @@ -2646,6 +2665,8 @@
*/
//#define EXTRA_FAN_SPEED

// @section gcode

/**
* Firmware-based and LCD-controlled retract
*
Expand Down Expand Up @@ -2680,6 +2701,8 @@
#endif
#endif

// @section tool change

/**
* Universal tool change settings.
* Applies to all types of extruders except where explicitly noted.
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 "2023-08-26"
//#define STRING_DISTRIBUTION_DATE "2023-10-15"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/HAL/STM32/msc_sd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ class Sd2CardUSBMscHandler : public USBMscHandler {
bool done = false;
for (uint16_t rcount = SD_MULTIBLOCK_RETRY_CNT; !done && rcount--;) {
uint8_t *cBuf = pBuf;
sd2card->writeStart(blkAddr);
sd2card->writeStart(blkAddr, blkLen);
bool okay = true; // Assume success
for (uint32 i = blkLen; i--;) {
for (uint32_t i = blkLen; i--;) {
hal.watchdog_refresh();
if (!sd2card->writeData(cBuf)) { // Write. Did it fail?
sd2card->writeStop(); // writeStop for new writeStart
Expand Down Expand Up @@ -103,7 +103,7 @@ class Sd2CardUSBMscHandler : public USBMscHandler {
uint8_t *cBuf = pBuf;
sd2card->readStart(blkAddr);
bool okay = true; // Assume success
for (uint32 i = blkLen; i--;) {
for (uint32_t i = blkLen; i--;) {
hal.watchdog_refresh();
if (!sd2card->readData(cBuf)) { // Read. Did it fail?
sd2card->readStop(); // readStop for new readStart
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/STM32F1/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

// Copied from ~/.platformio/packages/framework-arduinoststm32-maple/STM32F1/system/libmaple/usart_private.h
// Changed to handle Emergency Parser
static inline __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart_reg_map *regs, MSerialT &serial) {
static __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart_reg_map *regs, MSerialT &serial) {
/* Handle RXNEIE and TXEIE interrupts.
* RXNE signifies availability of a byte in DR.
*
Expand Down Expand Up @@ -75,7 +75,7 @@ static inline __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb
}

// Not every MarlinSerial port should handle emergency parsing.
// It would not make sense to parse GCode from TMC responses, for example.
// It would not make sense to parse G-Code from TMC responses, for example.
constexpr bool serial_handles_emergency(int port) {
return (false
#ifdef SERIAL_PORT
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ void idle(const bool no_stepper_sleep/*=false*/) {
TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER());

// Manage Fixed-time Motion Control
TERN_(FT_MOTION, fxdTiCtrl.loop());
TERN_(FT_MOTION, ftMotion.loop());

IDLE_DONE:
TERN_(MARLIN_DEV_MODE, idle_depth--);
Expand Down Expand Up @@ -1632,7 +1632,7 @@ void setup() {
#endif

#if ENABLED(FT_MOTION)
SETUP_RUN(fxdTiCtrl.init());
SETUP_RUN(ftMotion.init());
#endif

marlin_state = MF_RUNNING;
Expand Down
Loading

0 comments on commit c2ffe73

Please sign in to comment.