Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into pr/26088
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 7, 2023
2 parents 69ed0fe + 1dd3c9e commit 50b166f
Show file tree
Hide file tree
Showing 187 changed files with 13,891 additions and 1,532 deletions.
32 changes: 25 additions & 7 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,12 @@

//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
#if ENABLED(AUTO_POWER_CONTROL)
#define AUTO_POWER_FANS // Turn on PSU if fans need power
#define AUTO_POWER_E_FANS
#define AUTO_POWER_CONTROLLERFAN
#define AUTO_POWER_CHAMBER_FAN
#define AUTO_POWER_COOLER_FAN
#define AUTO_POWER_FANS // Turn on PSU for fans
#define AUTO_POWER_E_FANS // Turn on PSU for E Fans
#define AUTO_POWER_CONTROLLERFAN // Turn on PSU for Controller Fan
#define AUTO_POWER_CHAMBER_FAN // Turn on PSU for Chamber Fan
#define AUTO_POWER_COOLER_FAN // Turn on PSU for Cooler Fan
#define AUTO_POWER_SPINDLE_LASER // Turn on PSU for Spindle/Laser
#define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration
//#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time.
#endif
Expand Down Expand Up @@ -1513,7 +1514,7 @@
*
* Tune and Adjust
* - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc.
* - PROBE_OFFSET_WIZARD (configuration_adv.h) can be used for setting the Z offset.
* - PROBE_OFFSET_WIZARD (Configuration_adv.h) can be used for setting the Z offset.
*
* Assuming the typical work area orientation:
* - Probe to RIGHT of the Nozzle has a Positive X offset
Expand Down Expand Up @@ -1751,6 +1752,21 @@
//#define V_HOME_DIR -1
//#define W_HOME_DIR -1

/**
* Safety Stops
* If an axis has endstops on both ends the one specified above is used for
* homing, while the other can be used for things like SD_ABORT_ON_ENDSTOP_HIT.
*/
//#define X_SAFETY_STOP
//#define Y_SAFETY_STOP
//#define Z_SAFETY_STOP
//#define I_SAFETY_STOP
//#define J_SAFETY_STOP
//#define K_SAFETY_STOP
//#define U_SAFETY_STOP
//#define V_SAFETY_STOP
//#define W_SAFETY_STOP

// @section geometry

// The size of the printable area
Expand Down Expand Up @@ -3108,7 +3124,7 @@
* - Download https://github.com/InsanityAutomation/Marlin/raw/CrealityDwin_2.0/TM3D_Combined480272_Landscape_V7.7z
* - Copy the downloaded DWIN_SET folder to the SD card.
*
* E3S1PRO (T5UID1)
* E3S1PRO (T5L)
* - Download https://github.com/CrealityOfficial/Ender-3S1/archive/3S1_Plus_Screen.zip
* - Copy the downloaded DWIN_SET folder to the SD card.
*
Expand Down Expand Up @@ -3313,6 +3329,8 @@
#define TFT_THEME BLACK_MARLIN

//#define TFT_SHARED_IO // I/O is shared between TFT display and other devices. Disable async data transfer.

#define COMPACT_MARLIN_BOOT_LOGO // Use compressed data to save Flash space
#endif

#if ENABLED(TFT_LVGL_UI)
Expand Down
20 changes: 13 additions & 7 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,10 @@
//#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap
//#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames

// Only one STATUS_HEAT_* option can be enabled
//#define STATUS_HEAT_PERCENT // Show heating in a progress bar
//#define STATUS_HEAT_POWER // Show heater output power as a vertical bar

// Frivolous Game Options
//#define MARLIN_BRICKOUT
Expand Down Expand Up @@ -2206,7 +2209,6 @@
*/
//#define BABYSTEPPING
#if ENABLED(BABYSTEPPING)
//#define INTEGRATED_BABYSTEPPING // Integration of babystepping into the Stepper ISR
//#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support
//#define BABYSTEP_WITHOUT_HOMING
//#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement)
Expand Down Expand Up @@ -3803,7 +3805,8 @@
* Use 'M200 [T<extruder>] L<limit>' to override and 'M502' to reset.
* A non-zero value activates Volume-based Extrusion Limiting.
*/
#define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 // (mm^3/sec)
#define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 // (mm^3/sec)
#define VOLUMETRIC_EXTRUDER_LIMIT_MAX 20 // (mm^3/sec)
#endif
#endif

Expand Down Expand Up @@ -3836,14 +3839,17 @@
//#define REPETIER_GCODE_M360 // Add commands originally from Repetier FW

/**
* Enable this option for a leaner build of Marlin that removes all
* workspace offsets, simplifying coordinate transformations, leveling, etc.
*
* - M206 and M428 are disabled.
* - G92 will revert to its behavior from Marlin 1.0.
* Enable this option for a leaner build of Marlin that removes
* workspace offsets to slightly optimize performance.
* G92 will revert to its behavior from Marlin 1.0.
*/
//#define NO_WORKSPACE_OFFSETS

/**
* Disable M206 and M428 if you don't need home offsets.
*/
//#define NO_HOME_OFFSETS

/**
* CNC G-code options
* Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc.
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-07-17"
//#define STRING_DISTRIBUTION_DATE "2023-08-06"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
27 changes: 22 additions & 5 deletions Marlin/src/HAL/AVR/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,40 @@ void save_reset_reason() {
wdt_disable();
}

#include "registers.h"

MarlinHAL::MarlinHAL() {
TERN_(HAL_AVR_DIRTY_INIT, _ATmega_resetperipherals()); // Clean-wipe the device state.
}

void MarlinHAL::init() {
// Init Servo Pins
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
#if HAS_SERVO_0
INIT_SERVO(0);
OUT_WRITE(SERVO0_PIN, LOW);
#endif
#if HAS_SERVO_1
INIT_SERVO(1);
OUT_WRITE(SERVO1_PIN, LOW);
#endif
#if HAS_SERVO_2
INIT_SERVO(2);
OUT_WRITE(SERVO2_PIN, LOW);
#endif
#if HAS_SERVO_3
INIT_SERVO(3);
OUT_WRITE(SERVO3_PIN, LOW);
#endif

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

#if PIN_EXISTS(BEEPER) && ENABLED(HAL_AVR_DIRTY_INIT) && DISABLED(ATMEGA_NO_BEEPFIX)
// Make sure no alternative is locked onto the BEEPER.
// This fixes the issue where the ATmega is constantly beeping.
// Might disable other peripherals using the pin; to circumvent that please undefine one of the above things!
// The true culprit is the AVR ArduinoCore that enables peripherals redundantly.
// (USART1 on the GeeeTech GT2560)
// https://www.youtube.com/watch?v=jMgCvRXkexk
_ATmega_savePinAlternate(BEEPER_PIN);

OUT_WRITE(BEEPER_PIN, LOW);
#endif
}

void MarlinHAL::reboot() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class MarlinHAL {
public:

// Earliest possible init, before setup()
MarlinHAL() {}
MarlinHAL();

// Watchdog
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/endstop_interrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void setup_endstop_interrupts() {
pciSetup(Z_MAX_PIN);
#endif
#endif
#if HAS_Z_MIN_PIN
#if USE_Z_MIN
#if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT)
_ATTACH(Z_MIN_PIN);
#else
Expand Down
14 changes: 7 additions & 7 deletions Marlin/src/HAL/AVR/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
* Check for common serial pin conflicts
*/
#define CHECK_SERIAL_PIN(N) ( \
X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \
|| X_MIN_PIN == N || Y_MIN_PIN == N || Z_MIN_PIN == N \
|| X_MAX_PIN == N || Y_MAX_PIN == N || Z_MAX_PIN == N \
|| X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \
|| X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \
|| X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
|| BTN_EN1 == N || BTN_EN2 == N \
X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \
|| X_MIN_PIN == N || Y_MIN_PIN == N || Z_MIN_PIN == N \
|| X_MAX_PIN == N || Y_MAX_PIN == N || Z_MAX_PIN == N \
|| X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \
|| X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \
|| X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
|| BTN_EN1 == N || BTN_EN2 == N || LCD_PINS_EN == N \
)
#if SERIAL_IN_USE(0)
// D0-D1. No known conflicts.
Expand Down
Loading

0 comments on commit 50b166f

Please sign in to comment.