Skip to content

Commit

Permalink
Merge 'bugfix-2.0.x' into pr/23422
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 13, 2022
2 parents 2a422ba + 2f6a6f3 commit 0d580af
Show file tree
Hide file tree
Showing 269 changed files with 5,596 additions and 3,548 deletions.
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"recommendations": [
"marlinfirmware.auto-build",
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
8 changes: 4 additions & 4 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@
* 61 : 100kΩ Formbot/Vivedino 350°C Thermistor - beta 3950
* 66 : 4.7MΩ Dyze Design High Temperature Thermistor
* 67 : 500kΩ SliceEngineering 450°C Thermistor
* 68 : PT100 amplifier board from Dyze Design
* 70 : 100kΩ bq Hephestos 2
* 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32
* 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor
Expand Down Expand Up @@ -1913,8 +1914,7 @@
#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z_raise }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
//#define NOZZLE_PARK_X_ONLY // X move only is required to park
//#define NOZZLE_PARK_Y_ONLY // Y move only is required to park
#define NOZZLE_PARK_MOVE 0 // Park motion: 0 = XY Move, 1 = X Only, 2 = Y Only, 3 = X before Y, 4 = Y before X
#define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance
#define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis)
#define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers)
Expand Down Expand Up @@ -2807,7 +2807,7 @@
// Ender-3 v2 OEM display. A DWIN display with Rotary Encoder.
//
//#define DWIN_CREALITY_LCD // Creality UI
//#define DWIN_CREALITY_LCD_ENHANCED // Enhanced UI
//#define DWIN_LCD_PROUI // Pro UI by MRiscoC
//#define DWIN_CREALITY_LCD_JYERSUI // Jyers UI by Jacob Myers
//#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation)
//#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation)
Expand All @@ -2820,7 +2820,7 @@
#define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus

//#define TOUCH_IDLE_SLEEP 300 // (secs) Turn off the TFT backlight if set (5mn)
//#define TOUCH_IDLE_SLEEP 300 // (s) Turn off the TFT backlight if set (5mn)

#define TOUCH_SCREEN_CALIBRATION
Expand Down
71 changes: 43 additions & 28 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@
#endif

#if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER)
#define THERMAL_PROTECTION_VARIANCE_MONITOR // Detect a sensor malfunction preventing temperature updates
/**
* Thermal Protection Variance Monitor - EXPERIMENTAL.
* Kill the machine on a stuck temperature sensor. Disable if you get false positives.
*/
//#define THERMAL_PROTECTION_VARIANCE_MONITOR // Detect a sensor malfunction preventing temperature updates
#endif

#if ENABLED(PIDTEMP)
Expand Down Expand Up @@ -959,15 +963,17 @@
//#define Z_STEPPERS_ORIENTATION 0
#endif

// Provide Z stepper positions for more rapid convergence in bed alignment.
// Requires triple stepper drivers (i.e., set NUM_Z_STEPPER_DRIVERS to 3)
//#define Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS
#if ENABLED(Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS)
// Define Stepper XY positions for Z1, Z2, Z3 corresponding to
// the Z screw positions in the bed carriage.
// Define one position per Z stepper in stepper driver order.
#define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } }
#else
/**
* Z Stepper positions for more rapid convergence in bed alignment.
* Requires NUM_Z_STEPPER_DRIVERS to be 3 or 4.
*
* Define Stepper XY positions for Z1, Z2, Z3... corresponding to the screw
* positions in the bed carriage, with one position per Z stepper in stepper
* driver order.
*/
//#define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } }

#ifndef Z_STEPPER_ALIGN_STEPPER_XY
// Amplification factor. Used to scale the correction step up or down in case
// the stepper (spindle) position is farther out than the test point.
#define Z_STEPPER_ALIGN_AMP 1.0 // Use a value > 1.0 NOTE: This may cause instability!
Expand Down Expand Up @@ -1277,6 +1283,11 @@
#define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
#endif

//
// LCD Backlight Timeout
//
//#define LCD_BACKLIGHT_TIMEOUT 30 // (s) Timeout before turning off the backlight

#if HAS_BED_PROBE && EITHER(HAS_MARLINUI_MENU, HAS_TFT_LVGL_UI)
//#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu
#if ENABLED(PROBE_OFFSET_WIZARD)
Expand All @@ -1294,7 +1305,7 @@

#if HAS_MARLINUI_MENU

#if BOTH(HAS_BED_PROBE, AUTO_BED_LEVELING_BILINEAR)
#if HAS_BED_PROBE
// Add calibration in the Probe Offsets menu to compensate for X-axis twist.
//#define X_AXIS_TWIST_COMPENSATION
#if ENABLED(X_AXIS_TWIST_COMPENSATION)
Expand All @@ -1306,6 +1317,7 @@
#define XATC_START_Z 0.0
#define XATC_MAX_POINTS 3 // Number of points to probe in the wizard
#define XATC_Y_POSITION Y_CENTER // (mm) Y position to probe
#define XATC_Z_OFFSETS { 0, 0, 0 } // Z offsets for X axis sample points
#endif
#endif

Expand All @@ -1323,11 +1335,11 @@

#endif // HAS_MARLINUI_MENU

#if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI)
#if ANY(HAS_DISPLAY, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
//#define SOUND_MENU_ITEM // Add a mute option to the LCD menu
#endif

#if EITHER(HAS_DISPLAY, DWIN_CREALITY_LCD_ENHANCED)
#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
// The timeout (in ms) to return to the status screen from sub-menus
//#define LCD_TIMEOUT_TO_STATUS 15000

Expand Down Expand Up @@ -1626,7 +1638,10 @@
// Enable if SD detect is rendered useless (e.g., by using an SD extender)
//#define NO_SD_DETECT

// Multiple volume support - EXPERIMENTAL.
/**
* Multiple volume support - EXPERIMENTAL.
* Adds 'M21 Pm' / 'M21 S' / 'M21 U' to mount SD Card / USB Drive.
*/
//#define MULTI_VOLUME
#if ENABLED(MULTI_VOLUME)
#define VOLUME_SD_ONBOARD
Expand Down Expand Up @@ -2337,6 +2352,15 @@
// For serial echo, the number of digits after the decimal point
//#define SERIAL_FLOAT_PRECISION 4

/**
* Set the number of proportional font spaces required to fill up a typical character space.
* This can help to better align the output of commands like `G29 O` Mesh Output.
*
* For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0.
* Otherwise, adjust according to your client and font.
*/
#define PROPORTIONAL_FONT_RATIO 1.0

// @section extras

/**
Expand Down Expand Up @@ -2417,7 +2441,7 @@
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
// Load / Unload
#define TOOLCHANGE_FS_LENGTH 12 // (mm) Load / Unload length
#define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 0 // (mm) Extra length for better restart, fine tune by LCD/Gcode)
#define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 0 // (mm) Extra length for better restart. Adjust with LCD or M217 B.
#define TOOLCHANGE_FS_RETRACT_SPEED (50*60) // (mm/min) (Unloading)
#define TOOLCHANGE_FS_UNRETRACT_SPEED (25*60) // (mm/min) (On SINGLENOZZLE or Bowden loading must be slowed down)

Expand All @@ -2431,12 +2455,12 @@
#define TOOLCHANGE_FS_FAN_SPEED 255 // 0-255
#define TOOLCHANGE_FS_FAN_TIME 10 // (seconds)

// Swap uninitialized extruder with TOOLCHANGE_FS_PRIME_SPEED for all lengths (recover + prime)
// Swap uninitialized extruder (using TOOLCHANGE_FS_PRIME_SPEED feedrate)
// (May break filament if not retracted beforehand.)
//#define TOOLCHANGE_FS_INIT_BEFORE_SWAP

// Prime on the first T0 (If other, TOOLCHANGE_FS_INIT_BEFORE_SWAP applied)
// Enable it (M217 V[0/1]) before printing, to avoid unwanted priming on host connect
// Prime on the first T0 (For other tools use TOOLCHANGE_FS_INIT_BEFORE_SWAP)
// Enable with M217 V1 before printing to avoid unwanted priming on host connect
//#define TOOLCHANGE_FS_PRIME_FIRST_USED

/**
Expand Down Expand Up @@ -3431,7 +3455,7 @@
* You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V
* hardware PWM pin for the speed control and a pin for the rotation direction.
*
* See https://marlinfw.org/docs/configuration/laser_spindle.html for more config details.
* See https://marlinfw.org/docs/configuration/2.0.9/laser_spindle.html for more config details.
*/
//#define SPINDLE_FEATURE
//#define LASER_FEATURE
Expand Down Expand Up @@ -3780,15 +3804,6 @@

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

/**
* Set the number of proportional font spaces required to fill up a typical character space.
* This can help to better align the output of commands like `G29 O` Mesh Output.
*
* For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0.
* Otherwise, adjust according to your client and font.
*/
#define PROPORTIONAL_FONT_RATIO 1.0

/**
* Spend 28 bytes of SRAM to optimize the G-code parser
*/
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 "2022-02-08"
//#define STRING_DISTRIBUTION_DATE "2022-03-12"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
40 changes: 20 additions & 20 deletions Marlin/src/HAL/AVR/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// ------------------------

// Don't initialize/override variable (which would happen in .init4)
uint8_t reset_reason __attribute__((section(".noinit")));
uint8_t MarlinHAL::reset_reason __attribute__((section(".noinit")));

// ------------------------
// Public functions
Expand All @@ -45,22 +45,22 @@ uint8_t reset_reason __attribute__((section(".noinit")));
__attribute__((naked)) // Don't output function pro- and epilogue
__attribute__((used)) // Output the function, even if "not used"
__attribute__((section(".init3"))) // Put in an early user definable section
void HAL_save_reset_reason() {
void save_reset_reason() {
#if ENABLED(OPTIBOOT_RESET_REASON)
__asm__ __volatile__(
A("STS %0, r2")
: "=m"(reset_reason)
: "=m"(hal.reset_reason)
);
#else
reset_reason = MCUSR;
hal.reset_reason = MCUSR;
#endif

// Clear within 16ms since WDRF bit enables a 16ms watchdog timer -> Boot loop
MCUSR = 0;
hal.clear_reset_source();
wdt_disable();
}

void HAL_init() {
void MarlinHAL::init() {
// Init Servo Pins
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
#if HAS_SERVO_0
Expand All @@ -79,7 +79,7 @@ void HAL_init() {
init_pwm_timers(); // Init user timers to default frequency - 1000HZ
}

void HAL_reboot() {
void MarlinHAL::reboot() {
#if ENABLED(USE_WATCHDOG)
while (1) { /* run out the watchdog */ }
#else
Expand All @@ -95,20 +95,20 @@ void HAL_reboot() {

#else // !SDSUPPORT

extern "C" {
extern char __bss_end;
extern char __heap_start;
extern void* __brkval;

int freeMemory() {
int free_memory;
if ((int)__brkval == 0)
free_memory = ((int)&free_memory) - ((int)&__bss_end);
else
free_memory = ((int)&free_memory) - ((int)__brkval);
return free_memory;
extern "C" {
extern char __bss_end;
extern char __heap_start;
extern void* __brkval;

int freeMemory() {
int free_memory;
if ((int)__brkval == 0)
free_memory = ((int)&free_memory) - ((int)&__bss_end);
else
free_memory = ((int)&free_memory) - ((int)__brkval);
return free_memory;
}
}
}

#endif // !SDSUPPORT

Expand Down
Loading

0 comments on commit 0d580af

Please sign in to comment.