Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x

This commit is contained in:
InsanityAutomation
2021-07-05 13:06:44 -04:00
34 changed files with 1209 additions and 1156 deletions
+8 -10
View File
@@ -35,7 +35,7 @@
*
* Advanced settings can be found in Configuration_adv.h
*/
#define CONFIGURATION_H_VERSION 02000900
#define CONFIGURATION_H_VERSION 02000901
//===========================================================================
//============================= Getting Started =============================
@@ -1700,15 +1700,13 @@
//#define MANUAL_J_HOME_POS 0
//#define MANUAL_K_HOME_POS 0
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
//
// With this feature enabled:
//
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
// - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
// - Prevent Z homing when the Z probe is outside bed area.
//
/**
* Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
*
* - Moves the Z probe (or nozzle) to a defined XY point before Z homing.
* - Allows Z homing only when XY positions are known and trusted.
* - If stepper drivers sleep, XY homing may be required again before Z homing.
*/
//#define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING)
+1 -1
View File
@@ -30,7 +30,7 @@
*
* Basic settings can be found in Configuration.h
*/
#define CONFIGURATION_ADV_H_VERSION 02000900
#define CONFIGURATION_ADV_H_VERSION 02000901
//===========================================================================
//============================= Thermal Settings ============================
+1 -1
View File
@@ -617,7 +617,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
TERN_(USE_CONTROLLER_FAN, controllerFan.update()); // Check if fan should be turned on to cool stepper drivers down
TERN_(AUTO_POWER_CONTROL, powerManager.check());
TERN_(AUTO_POWER_CONTROL, powerManager.check(!ui.on_status_screen() || printJobOngoing() || printingIsPaused()));
TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check());
+5 -1
View File
@@ -91,7 +91,11 @@ extern bool wait_for_heatup;
#define PSU_OFF_SOON() powerManager.power_off_soon()
#else
#define PSU_ON() PSU_PIN_ON()
#define PSU_OFF() PSU_PIN_OFF()
#if ENABLED(PS_OFF_SOUND)
#define PSU_OFF() do{ BUZZ(1000, 659); PSU_PIN_OFF(); }while(0)
#else
#define PSU_OFF() PSU_PIN_OFF()
#endif
#define PSU_OFF_SOON PSU_OFF
#endif
#endif
+16 -3
View File
@@ -50,6 +50,9 @@ Power powerManager;
millis_t Power::lastPowerOn;
bool Power::is_power_needed() {
if (printJobOngoing() || printingIsPaused()) return true;
#if ENABLED(AUTO_POWER_FANS)
FANS_LOOP(i) if (thermalManager.fan_speed[i]) return true;
#endif
@@ -110,9 +113,17 @@ bool Power::is_power_needed() {
#define POWER_TIMEOUT 0
#endif
void Power::check() {
void Power::check(const bool pause) {
static bool _pause = false;
static millis_t nextPowerCheck = 0;
millis_t now = millis();
const millis_t now = millis();
#if POWER_TIMEOUT > 0
if (pause != _pause) {
lastPowerOn = now + !now;
_pause = pause;
}
if (pause) return;
#endif
if (ELAPSED(now, nextPowerCheck)) {
nextPowerCheck = now + 2500UL;
if (is_power_needed())
@@ -123,7 +134,8 @@ void Power::check() {
}
void Power::power_on() {
lastPowerOn = millis();
const millis_t now = millis();
lastPowerOn = now + !now;
if (!powersupply_on) {
PSU_PIN_ON();
safe_delay(PSU_POWERUP_DELAY);
@@ -152,6 +164,7 @@ void Power::power_off() {
void Power::power_off_soon() {
#if POWER_OFF_DELAY
lastPowerOn = millis() - SEC_TO_MS(POWER_TIMEOUT) + SEC_TO_MS(POWER_OFF_DELAY);
//if (!lastPowerOn) ++lastPowerOn;
#else
power_off();
#endif
+1 -1
View File
@@ -29,7 +29,7 @@
class Power {
public:
static void check();
static void check(const bool pause);
static void power_on();
static void power_off();
static void power_off_soon();
+22 -10
View File
@@ -593,24 +593,29 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#endif
#ifdef PTC_SAMPLE_START
constexpr int _ptc_sample_start = PTC_SAMPLE_START;
static_assert(_test_ptc_sample_start != PTC_SAMPLE_START, "PTC_SAMPLE_START must be a whole number.");
constexpr auto _ptc_sample_start = PTC_SAMPLE_START;
constexpr decltype(_ptc_sample_start) _test_ptc_sample_start = 12.3f;
static_assert(_test_ptc_sample_start != 12.3f, "PTC_SAMPLE_START must be a whole number.");
#endif
#ifdef PTC_SAMPLE_RES
constexpr int _ptc_sample_res = PTC_SAMPLE_END;
static_assert(_test_ptc_sample_res != PTC_SAMPLE_END, "PTC_SAMPLE_RES must be a whole number.");
constexpr auto _ptc_sample_res = PTC_SAMPLE_RES;
constexpr decltype(_ptc_sample_res) _test_ptc_sample_res = 12.3f;
static_assert(_test_ptc_sample_res != 12.3f, "PTC_SAMPLE_RES must be a whole number.");
#endif
#ifdef BTC_SAMPLE_START
constexpr int _btc_sample_start = BTC_SAMPLE_START;
static_assert(_test_btc_sample_start != BTC_SAMPLE_START, "BTC_SAMPLE_START must be a whole number.");
constexpr auto _btc_sample_start = BTC_SAMPLE_START;
constexpr decltype(_btc_sample_start) _test_btc_sample_start = 12.3f;
static_assert(_test_btc_sample_start != 12.3f, "BTC_SAMPLE_START must be a whole number.");
#endif
#ifdef BTC_SAMPLE_RES
constexpr int _btc_sample_res = BTC_SAMPLE_END;
static_assert(_test_btc_sample_res != BTC_SAMPLE_END, "BTC_SAMPLE_RES must be a whole number.");
constexpr _btc_sample_res = BTC_SAMPLE_RES;
constexpr decltype(_btc_sample_res) _test_btc_sample_res = 12.3f;
static_assert(_test_btc_sample_res != 12.3f, "BTC_SAMPLE_RES must be a whole number.");
#endif
#ifdef BTC_PROBE_TEMP
constexpr int _btc_probe_temp = BTC_PROBE_TEMP;
static_assert(_test_btc_probe_temp != BTC_PROBE_TEMP, "BTC_PROBE_TEMP must be a whole number.");
constexpr auto _btc_probe_temp = BTC_PROBE_TEMP;
constexpr decltype(_btc_probe_temp) _test_btc_probe_temp = 12.3f;
static_assert(_test_btc_probe_temp != 12.3f, "BTC_PROBE_TEMP must be a whole number.");
#endif
#endif
@@ -3583,6 +3588,13 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#error "Either enable MEATPACK_ON_SERIAL_PORT_* or BINARY_FILE_TRANSFER, not both."
#endif
/**
* Sanity Check for Slim LCD Menus and Probe Offset Wizard
*/
#if BOTH(SLIM_LCD_MENUS, PROBE_OFFSET_WIZARD)
#error "SLIM_LCD_MENUS disables \"Advanced Settings > Probe Offsets > PROBE_OFFSET_WIZARD.\""
#endif
/**
* Sanity check for unique start and stop values in NOZZLE_CLEAN_FEATURE
*/
+2 -2
View File
@@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2021-06-28"
#define STRING_DISTRIBUTION_DATE "2021-07-05"
#endif
/**
@@ -52,7 +52,7 @@
* to alert users to major changes.
*/
#define MARLIN_HEX_VERSION 02000900
#define MARLIN_HEX_VERSION 02000901
#ifndef REQUIRED_CONFIGURATION_H_VERSION
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
#endif
@@ -20,7 +20,7 @@
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../compat.h"
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE)
@@ -20,7 +20,7 @@
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../compat.h"
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE)
#include "media_file_reader.h"
@@ -21,6 +21,10 @@
#pragma once
// Configure this display with options in Configuration_adv.h
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(TOUCH_UI_FTDI_EVE)
#include "compat.h"
// Configure this display with options in Configuration_adv.h
#endif
@@ -22,7 +22,7 @@
#pragma once
#include "compat.h"
#include "config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE)
@@ -20,7 +20,7 @@
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../compat.h"
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE)
+1071 -1071
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -529,10 +529,13 @@ public:
static void draw_select_screen_prompt(PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr);
#elif HAS_WIRED_LCD
#else
static constexpr bool on_status_screen() { return true; }
FORCE_INLINE static void run_current_screen() { status_screen(); }
#if HAS_WIRED_LCD
FORCE_INLINE static void run_current_screen() { status_screen(); }
#endif
#endif
+13 -4
View File
@@ -106,10 +106,11 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
* "Change Filament" submenu
*/
#if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
bool printingIsPaused();
#endif
void menu_change_filament() {
void menu_change_filament() {
#if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
// Say "filament change" when no print is active
editable.int8 = printingIsPaused() ? PAUSE_MODE_PAUSE_PRINT : PAUSE_MODE_CHANGE_FILAMENT;
@@ -204,8 +205,16 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
#endif
END_MENU();
}
#endif
#else
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
queue.inject_P(PSTR("M600B0"));
else
_menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0);
#endif
}
static uint8_t hotend_status_extruder = 0;
+5 -5
View File
@@ -77,7 +77,6 @@ void menu_configuration();
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
void _menu_temp_filament_op(const PauseMode, const int8_t);
void menu_change_filament();
#endif
@@ -365,10 +364,11 @@ void menu_main() {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
GCODES_ITEM(MSG_FILAMENTCHANGE, PSTR("M600 B0"));
else
SUBMENU(MSG_FILAMENTCHANGE, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
CONFIRM_ITEM(MSG_FILAMENTCHANGE,
MSG_YES, MSG_NO,
menu_change_filament, ui.goto_previous_screen,
GET_TEXT(MSG_FILAMENTCHANGE), (const char *)nullptr, PSTR("?")
);
#else
SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
#endif
@@ -201,7 +201,15 @@
#define EXP1_09_PIN P0_16
#define EXP1_10_PIN P2_08
#if HAS_WIRED_LCD
#if ENABLED(DWIN_CREALITY_LCD)
#error "DWIN_CREALITY_LCD requires a custom cable with TX = P0_15, RX = P0_16, and LCD_SERIAL_PORT 1. Comment out this line to continue."
#define BEEPER_PIN EXP1_10_PIN
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_04_PIN
#define BTN_ENC EXP1_06_PIN
#elif HAS_WIRED_LCD
#if ENABLED(CR10_STOCKDISPLAY)
@@ -48,7 +48,7 @@
"upload": {
"disable_flushing": false,
"maximum_ram_size": 131072,
"maximum_size": 514288,
"maximum_size": 524288,
"protocol": "stlink",
"protocols": [
"stlink",
@@ -1,6 +1,9 @@
#
# buildroot/share/PlatformIO/scripts/custom_board.py
#
# - For build.address replace VECT_TAB_ADDR to relocate the firmware
# - For build.ldscript use one of the linker scripts in buildroot/share/PlatformIO/ldscripts
#
import marlin
board = marlin.env.BoardConfig()
@@ -67,11 +67,3 @@ def encrypt_mks(source, target, env, new_name):
def add_post_action(action):
env.AddPostAction(join("$BUILD_DIR", "${PROGNAME}.bin"), action);
# Apply customizations for a MKS Robin
def prepare_robin(address, ldname, fwname):
def encrypt(source, target, env):
encrypt_mks(source, target, env, fwname)
relocate_firmware(address)
custom_ld_script(ldname)
add_post_action(encrypt);
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin.ld", "Robin.bin")
import robin
robin.prepare("0x08007000", "mks_robin.ld", "Robin.bin")
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_e3.py
#
import marlin
marlin.prepare_robin("0x08005000", "mks_robin_e3.ld", "Robin_e3.bin")
import robin
robin.prepare("0x08005000", "mks_robin_e3.ld", "Robin_e3.bin")
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_e3p.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_e3p.ld", "Robin_e3p.bin")
import robin
robin.prepare("0x08007000", "mks_robin_e3p.ld", "Robin_e3p.bin")
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_lite.py
#
import marlin
marlin.prepare_robin("0x08005000", "mks_robin_lite.ld", "mksLite.bin")
import robin
robin.prepare("0x08005000", "mks_robin_lite.ld", "mksLite.bin")
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_lite3.py
#
import marlin
marlin.prepare_robin("0x08005000", "mks_robin_lite.ld", "mksLite3.bin")
import robin
robin.prepare("0x08005000", "mks_robin_lite.ld", "mksLite3.bin")
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_mini.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_mini.ld", "Robin_mini.bin")
import robin
robin.prepare("0x08007000", "mks_robin_mini.ld", "Robin_mini.bin")
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_nano.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin")
import robin
robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano.bin")
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_nano35.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_nano.ld", "Robin_nano35.bin")
import robin
robin.prepare("0x08007000", "mks_robin_nano.ld", "Robin_nano35.bin")
@@ -1,5 +1,5 @@
#
# buildroot/share/PlatformIO/scripts/mks_robin_pro.py
#
import marlin
marlin.prepare_robin("0x08007000", "mks_robin_pro.ld", "Robin_pro.bin")
import robin
robin.prepare("0x08007000", "mks_robin_pro.ld", "Robin_pro.bin")
@@ -0,0 +1,12 @@
#
# buildroot/share/PlatformIO/scripts/robin.py
#
import marlin
# Apply customizations for a MKS Robin
def prepare(address, ldname, fwname):
def encrypt(source, target, env):
marlin.encrypt_mks(source, target, env, fwname)
marlin.relocate_firmware(address)
marlin.custom_ld_script(ldname)
marlin.add_post_action(encrypt);
@@ -1,6 +1,13 @@
#
# stm32_bootloader.py
#
# - If 'build.offset' is provided, either by JSON or by the environment...
# - Set linker flag LD_FLASH_OFFSET and relocate the VTAB based on 'build.offset'.
# - Set linker flag LD_MAX_DATA_SIZE based on 'build.maximum_ram_size'.
# - Define STM32_FLASH_SIZE from 'upload.maximum_size' for use by Flash-based EEPROM emulation.
#
# - For 'board_build.rename' add a post-action to rename the firmware file.
#
import os,sys,marlin
Import("env")
-7
View File
@@ -41,7 +41,6 @@ board = genericSTM32F103RC
monitor_speed = 115200
board_build.core = stm32
board_build.variant = MARLIN_F103Rx
board_build.ldscript = ldscript.ld
extra_scripts = ${common_stm32.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
buildroot/share/PlatformIO/scripts/stm32_bootloader.py
@@ -108,7 +107,6 @@ extends = common_stm32
board = genericSTM32F103ZE
board_build.core = stm32
board_build.variant = MARLIN_F103Zx
board_build.ldscript = ldscript.ld
board_build.offset = 0x7000
board_build.encrypt = Robin.bin
build_flags = ${common_stm32.build_flags}
@@ -150,7 +148,6 @@ monitor_speed = 115200
board_build.core = stm32
board_build.variant = MARLIN_F103Rx
board_build.offset = 0x7000
board_build.ldscript = ldscript.ld
board_upload.offset_address = 0x08007000
build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
extra_scripts = ${common.extra_scripts}
@@ -175,7 +172,6 @@ monitor_speed = 115200
board_build.core = stm32
board_build.variant = MARLIN_F103Rx
board_build.offset = 0x7000
board_build.ldscript = ldscript.ld
board_upload.offset_address = 0x08007000
build_unflags = ${common_stm32.build_unflags}
extra_scripts = ${common.extra_scripts}
@@ -207,7 +203,6 @@ build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=
board = genericSTM32F103VE
board_build.core = stm32
board_build.variant = MARLIN_F103Vx
board_build.ldscript = ldscript.ld
board_build.offset = 0x7000
board_build.encrypt = Robin_mini.bin
board_upload.offset_address = 0x08007000
@@ -227,7 +222,6 @@ build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=
board = genericSTM32F103VE
board_build.core = stm32
board_build.variant = MARLIN_F103Vx
board_build.ldscript = ldscript.ld
board_build.offset = 0x7000
board_build.encrypt = Robin_nano35.bin
board_upload.offset_address = 0x08007000
@@ -248,7 +242,6 @@ extends = common_stm32
board = genericSTM32F103ZE
board_build.core = stm32
board_build.variant = MARLIN_F103Zx
board_build.ldscript = ldscript.ld
board_build.offset = 0x10000
build_flags = ${common_stm32.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
-5
View File
@@ -112,7 +112,6 @@ build_flags = ${common_stm32.build_flags} -DHAL_SD_MODULE_ENABLED -DHAL
board = marlin_STM32F407VGT6_CCM
board_build.core = stm32
board_build.variant = MARLIN_F4x7Vx
board_build.ldscript = ldscript.ld
board_build.encrypt = firmware.srec
# Just openblt.py (not stm32_bootloader.py) generates the file
board_build.offset = 0x10000
@@ -222,7 +221,6 @@ extends = common_stm32
board = marlin_STM32F407VGT6_CCM
board_build.core = stm32
board_build.variant = MARLIN_F4x7Vx
board_build.ldscript = ldscript.ld
board_build.offset = 0x8000
board_upload.offset_address = 0x08008000
extra_scripts = ${common.extra_scripts}
@@ -344,7 +342,6 @@ upload_protocol = dfu
monitor_speed = 500000
board_build.core = stm32
board_build.variant = MARLIN_F446VE
board_build.ldscript = ldscript.ld
board_build.offset = 0x0000
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
@@ -361,7 +358,6 @@ build_flags = ${stm_flash_drive.build_flags}
board = genericSTM32F407VET6
board_build.core = stm32
board_build.variant = MARLIN_F4x7Vx
board_build.ldscript = ldscript.ld
board_build.offset = 0x0000
board_upload.offset_address = 0x08000000
build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
@@ -387,7 +383,6 @@ build_flags = ${common_stm32.build_flags} ${stm32f4_I2C1.build_flags} -
board = marlin_STM32F407VGT6_CCM
board_build.core = stm32
board_build.variant = MARLIN_F4x7Vx
board_build.ldscript = ldscript.ld
board_build.rename = Robin_nano_v3.bin
board_build.offset = 0xC000
board_upload.offset_address = 0x0800C000