Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into bugfix-2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemerryguy authored Oct 18, 2022
2 parents 6ea123f + 81976c4 commit 48273f9
Show file tree
Hide file tree
Showing 60 changed files with 3,238 additions and 888 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -3059,7 +3059,7 @@
//#define MKS_ROBIN_TFT_V1_1R

//
// 480x320, 3.5", FSMC Stock Display from TronxXY
// 480x320, 3.5", FSMC Stock Display from Tronxy
//
//#define TFT_TRONXY_X5SA

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-10-16"
//#define STRING_DISTRIBUTION_DATE "2022-10-18"

/**
* 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/AVR/fastio.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t {

#if HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
#elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z)
#else
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1)
#endif
#else
#define PWM_CHK_MOTOR_CURRENT(P) false
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/HAL/AVR/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@
|| X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
|| BTN_EN1 == N || BTN_EN2 == N \
)
#if CONF_SERIAL_IS(0)
#if SERIAL_IN_USE(0)
// D0-D1. No known conflicts.
#endif
#if NOT_TARGET(__AVR_ATmega644P__, __AVR_ATmega1284P__)
#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
#if SERIAL_IN_USE(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
#error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
#endif
#else
#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(10) || CHECK_SERIAL_PIN(11))
#if SERIAL_IN_USE(1) && (CHECK_SERIAL_PIN(10) || CHECK_SERIAL_PIN(11))
#error "Serial Port 1 pin D10 and/or D11 conflicts with another pin on the board."
#endif
#endif
#if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
#if SERIAL_IN_USE(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
#error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
#endif
#if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
#if SERIAL_IN_USE(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
#error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
#endif
#undef CHECK_SERIAL_PIN
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/HAL/DUE/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
|| X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \
|| X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
)
#if CONF_SERIAL_IS(0) // D0-D1. No known conflicts.
#if SERIAL_IN_USE(0) // D0-D1. No known conflicts.
#endif
#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
#if SERIAL_IN_USE(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
#error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
#endif
#if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
#if SERIAL_IN_USE(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
#error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
#endif
#if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
#if SERIAL_IN_USE(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
#error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
#endif
#undef CHECK_SERIAL_PIN
Expand Down
18 changes: 10 additions & 8 deletions Marlin/src/HAL/STM32/eeprom_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
static_assert(IS_FLASH_SECTOR(FLASH_SECTOR), "FLASH_SECTOR is invalid");
static_assert(IS_POWER_OF_2(FLASH_UNIT_SIZE), "FLASH_UNIT_SIZE should be a power of 2, please check your chip's spec sheet");

#endif
#endif // FLASH_EEPROM_LEVELING

static bool eeprom_data_written = false;

Expand Down Expand Up @@ -189,15 +189,15 @@ bool PersistentStore::access_finish() {

UNLOCK_FLASH();

uint32_t offset = 0;
uint32_t address = SLOT_ADDRESS(current_slot);
uint32_t address_end = address + MARLIN_EEPROM_SIZE;
uint32_t data = 0;
uint32_t offset = 0,
address = SLOT_ADDRESS(current_slot),
address_end = address + MARLIN_EEPROM_SIZE,
data = 0;

bool success = true;

while (address < address_end) {
memcpy(&data, ram_eeprom + offset, sizeof(uint32_t));
memcpy(&data, ram_eeprom + offset, sizeof(data));
status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, address, data);
if (status == HAL_OK) {
address += sizeof(uint32_t);
Expand All @@ -221,7 +221,8 @@ bool PersistentStore::access_finish() {

return success;

#else
#else !FLASH_EEPROM_LEVELING

// The following was written for the STM32F4 but may work with other MCUs as well.
// Most STM32F4 flash does not allow reading from flash during erase operations.
// This takes about a second on a STM32F407 with a 128kB sector used as EEPROM.
Expand All @@ -235,7 +236,8 @@ bool PersistentStore::access_finish() {
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());

eeprom_data_written = false;
#endif

#endif // !FLASH_EEPROM_LEVELING
}

return true;
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@
#define BOARD_OPULO_LUMEN_REV4 4241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 4242 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 4243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 4244 // TRONXY V10 (STM32F446ZE)

//
// ARM Cortex M7
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/control/M993_M994.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "../../inc/MarlinConfig.h"

#if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)

#include "../gcode.h"
#include "../../sd/cardreader.h"
Expand Down Expand Up @@ -85,4 +85,4 @@ void GcodeSuite::M994() {
card.closefile();
}

#endif // HAS_SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE
#endif // SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE
8 changes: 6 additions & 2 deletions Marlin/src/gcode/feature/trinamic/M569.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
if (chop_x2 || chop_y2 || chop_z2) {
say_M569(forReplay, F("I1"));
if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
#if HAS_Y_AXIS
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
#endif
#if HAS_Z_AXIS
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
#endif
SERIAL_EOL();
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe
#endif

#if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
case 993: M993(); break; // M993: Backup SPI Flash to SD
case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ class GcodeSuite {
static void M995();
#endif

#if BOTH(HAS_SPI_FLASH, SDSUPPORT)
#if BOTH(SPI_FLASH, SDSUPPORT)
static void M993();
static void M994();
#endif
Expand Down
33 changes: 25 additions & 8 deletions Marlin/src/gcode/host/M115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,24 +222,41 @@ void GcodeSuite::M115() {

// Machine Geometry
#if ENABLED(M115_GEOMETRY_REPORT)
const xyz_pos_t bmin = { 0, 0, 0 },
bmax = { X_BED_SIZE , Y_BED_SIZE, Z_MAX_POS },
dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
constexpr xyz_pos_t bmin{0},
bmax = ARRAY_N(NUM_AXES, X_BED_SIZE, Y_BED_SIZE, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS),
dmin = ARRAY_N(NUM_AXES, X_MIN_POS, Y_MIN_POS, Z_MIN_POS, I_MIN_POS, J_MIN_POS, K_MIN_POS, U_MIN_POS, V_MIN_POS, W_MIN_POS),
dmax = ARRAY_N(NUM_AXES, X_MAX_POS, Y_MAX_POS, Z_MAX_POS, I_MAX_POS, J_MAX_POS, K_MAX_POS, U_MAX_POS, V_MAX_POS, W_MAX_POS);
xyz_pos_t cmin = bmin, cmax = bmax;
apply_motion_limits(cmin);
apply_motion_limits(cmax);
const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
wmin = cmin.asLogical(), wmax = cmax.asLogical();

SERIAL_ECHOLNPGM(
"area:{"
"full:{"
"min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z, "},"
"max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z, "}"
LIST_N(DOUBLE(NUM_AXES),
"min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z,
",i:", lmin.i, ",j:", lmin.j, ",k:", lmin.k,
",u:", lmin.u, ",v:", lmin.v, ",w:", lmin.w
),
LIST_N(DOUBLE(NUM_AXES),
"max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z,
",i:", lmax.i, ",j:", lmax.j, ",k:", lmax.k,
",u:", lmax.u, ",v:", lmax.v, ",w:", lmax.w
),
"},"
"work:{"
"min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "},"
"max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z, "}",
LIST_N(DOUBLE(NUM_AXES),
"min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z,
",i:", wmin.i, ",j:", wmin.j, ",k:", wmin.k,
",u:", wmin.u, ",v:", wmin.v, ",w:", wmin.w
),
LIST_N(DOUBLE(NUM_AXES),
"max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z,
",i:", wmax.i, ",j:", wmax.j, ",k:", wmax.k,
",u:", wmax.u, ",v:", wmax.v, ",w:", wmax.w
),
"}"
"}"
);
Expand Down
94 changes: 55 additions & 39 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1204,45 +1204,61 @@
#elif X_HOME_DIR < 0
#define X_HOME_TO_MIN 1
#endif
#if Y_HOME_DIR > 0
#define Y_HOME_TO_MAX 1
#elif Y_HOME_DIR < 0
#define Y_HOME_TO_MIN 1
#endif
#if Z_HOME_DIR > 0
#define Z_HOME_TO_MAX 1
#elif Z_HOME_DIR < 0
#define Z_HOME_TO_MIN 1
#endif
#if I_HOME_DIR > 0
#define I_HOME_TO_MAX 1
#elif I_HOME_DIR < 0
#define I_HOME_TO_MIN 1
#endif
#if J_HOME_DIR > 0
#define J_HOME_TO_MAX 1
#elif J_HOME_DIR < 0
#define J_HOME_TO_MIN 1
#endif
#if K_HOME_DIR > 0
#define K_HOME_TO_MAX 1
#elif K_HOME_DIR < 0
#define K_HOME_TO_MIN 1
#endif
#if U_HOME_DIR > 0
#define U_HOME_TO_MAX 1
#elif U_HOME_DIR < 0
#define U_HOME_TO_MIN 1
#endif
#if V_HOME_DIR > 0
#define V_HOME_TO_MAX 1
#elif V_HOME_DIR < 0
#define V_HOME_TO_MIN 1
#endif
#if W_HOME_DIR > 0
#define W_HOME_TO_MAX 1
#elif W_HOME_DIR < 0
#define W_HOME_TO_MIN 1
#if HAS_Y_AXIS
#if Y_HOME_DIR > 0
#define Y_HOME_TO_MAX 1
#elif Y_HOME_DIR < 0
#define Y_HOME_TO_MIN 1
#endif
#endif
#if HAS_Z_AXIS
#if Z_HOME_DIR > 0
#define Z_HOME_TO_MAX 1
#elif Z_HOME_DIR < 0
#define Z_HOME_TO_MIN 1
#endif
#endif
#if HAS_I_AXIS
#if I_HOME_DIR > 0
#define I_HOME_TO_MAX 1
#elif I_HOME_DIR < 0
#define I_HOME_TO_MIN 1
#endif
#endif
#if HAS_J_AXIS
#if J_HOME_DIR > 0
#define J_HOME_TO_MAX 1
#elif J_HOME_DIR < 0
#define J_HOME_TO_MIN 1
#endif
#endif
#if HAS_K_AXIS
#if K_HOME_DIR > 0
#define K_HOME_TO_MAX 1
#elif K_HOME_DIR < 0
#define K_HOME_TO_MIN 1
#endif
#endif
#if HAS_U_AXIS
#if U_HOME_DIR > 0
#define U_HOME_TO_MAX 1
#elif U_HOME_DIR < 0
#define U_HOME_TO_MIN 1
#endif
#endif
#if HAS_V_AXIS
#if V_HOME_DIR > 0
#define V_HOME_TO_MAX 1
#elif V_HOME_DIR < 0
#define V_HOME_TO_MIN 1
#endif
#endif
#if HAS_W_AXIS
#if W_HOME_DIR > 0
#define W_HOME_TO_MAX 1
#elif W_HOME_DIR < 0
#define W_HOME_TO_MIN 1
#endif
#endif

/**
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -2446,15 +2446,15 @@
//

// Flag the indexed hardware serial ports in use
#define CONF_SERIAL_IS(N) ( (defined(SERIAL_PORT) && SERIAL_PORT == N) \
#define SERIAL_IN_USE(N) ( (defined(SERIAL_PORT) && SERIAL_PORT == N) \
|| (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == N) \
|| (defined(SERIAL_PORT_3) && SERIAL_PORT_3 == N) \
|| (defined(MMU2_SERIAL_PORT) && MMU2_SERIAL_PORT == N) \
|| (defined(LCD_SERIAL_PORT) && LCD_SERIAL_PORT == N) )

// Flag the named hardware serial ports in use
#define TMC_UART_IS(A,N) (defined(A##_HARDWARE_SERIAL) && (CAT(HW_,A##_HARDWARE_SERIAL) == HW_Serial##N || CAT(HW_,A##_HARDWARE_SERIAL) == HW_MSerial##N))
#define ANY_SERIAL_IS(N) ( CONF_SERIAL_IS(N) \
#define ANY_SERIAL_IS(N) ( SERIAL_IN_USE(N) \
|| TMC_UART_IS(X, N) || TMC_UART_IS(Y , N) || TMC_UART_IS(Z , N) \
|| TMC_UART_IS(I, N) || TMC_UART_IS(J , N) || TMC_UART_IS(K , N) \
|| TMC_UART_IS(U, N) || TMC_UART_IS(V , N) || TMC_UART_IS(W , N) \
Expand All @@ -2481,7 +2481,7 @@
#define HW_MSerial9 518
#define HW_MSerial10 519

#if CONF_SERIAL_IS(-1)
#if SERIAL_IN_USE(-1)
#define USING_HW_SERIALUSB 1
#endif
#if ANY_SERIAL_IS(0)
Expand Down
Loading

0 comments on commit 48273f9

Please sign in to comment.