Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/21865
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jul 21, 2021
2 parents 124fb38 + eb3ad3e commit 759d04c
Show file tree
Hide file tree
Showing 81 changed files with 2,224 additions and 1,983 deletions.
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 "2021-07-17"
//#define STRING_DISTRIBUTION_DATE "2021-07-21"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/HAL/DUE/HAL_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
}

// all the others
static uint32_t spiDelayCyclesX4 = 4 * (F_CPU) / 1000000; // 4µs => 125khz
static uint16_t spiDelayNS = 4000; // 4000ns => 125khz

static uint8_t spiTransferX(uint8_t b) { // using Mode 0
int bits = 8;
Expand All @@ -249,12 +249,12 @@
b <<= 1; // little setup time

WRITE(SD_SCK_PIN, HIGH);
DELAY_CYCLES(spiDelayCyclesX4);
DELAY_NS(spiDelayNS);

b |= (READ(SD_MISO_PIN) != 0);

WRITE(SD_SCK_PIN, LOW);
DELAY_CYCLES(spiDelayCyclesX4);
DELAY_NS(spiDelayNS);
} while (--bits);
return b;
}
Expand Down Expand Up @@ -510,7 +510,7 @@
spiRxBlock = (pfnSpiRxBlock)spiRxBlockX;
break;
default:
spiDelayCyclesX4 = ((F_CPU) / 1000000) >> (6 - spiRate) << 2; // spiRate of 2 gives the maximum error with current CPU
spiDelayNS = 4000 >> (6 - spiRate); // spiRate of 2 gives the maximum error with current CPU
spiTransferTx = (pfnSpiTransfer)spiTransferX;
spiTransferRx = (pfnSpiTransfer)spiTransferX;
spiTxBlock = (pfnSpiTxBlock)spiTxBlockX;
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#if HAS_TFT_LVGL_UI
#include "lcd/extui/mks_ui/tft_lvgl_configuration.h"
#include "lcd/extui/mks_ui/draw_ui.h"
#include "lcd/extui/mks_ui/mks_hardware_test.h"
#include "lcd/extui/mks_ui/mks_hardware.h"
#include <lvgl.h>
#endif

Expand Down Expand Up @@ -1276,9 +1276,7 @@ void setup() {
if (mcu & RST_SOFTWARE) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET);
HAL_clear_reset_source();

SERIAL_ECHOPGM_P(GET_TEXT(MSG_MARLIN));
SERIAL_CHAR(' ');
SERIAL_ECHOLNPGM(SHORT_BUILD_VERSION);
SERIAL_ECHOLNPGM("Marlin " SHORT_BUILD_VERSION);
SERIAL_EOL();
#if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR)
SERIAL_ECHO_MSG(
Expand Down
25 changes: 13 additions & 12 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,19 @@
#define BOARD_CCROBOT_MEEB_3DP 4035 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 4036 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CHITU3D_V6 4037 // Chitu3D TronXY X5SA V6 Board
#define BOARD_CREALITY_V4 4038 // Creality v4.x (STM32F103RE)
#define BOARD_CREALITY_V427 4039 // Creality v4.2.7 (STM32F103RE)
#define BOARD_CREALITY_V4210 4040 // Creality v4.2.10 (STM32F103RE) as found in the CR-30
#define BOARD_CREALITY_V431 4041 // Creality v4.3.1 (STM32F103RE)
#define BOARD_CREALITY_V452 4042 // Creality v4.5.2 (STM32F103RE)
#define BOARD_CREALITY_V453 4043 // Creality v4.5.3 (STM32F103RE)
#define BOARD_TRIGORILLA_PRO 4044 // Trigorilla Pro (STM32F103ZET6)
#define BOARD_FLY_MINI 4045 // FLYmaker FLY MINI (STM32F103RCT6)
#define BOARD_FLSUN_HISPEED 4046 // FLSUN HiSpeedV1 (STM32F103VET6)
#define BOARD_BEAST 4047 // STM32F103RET6 Libmaple-based controller
#define BOARD_MINGDA_MPX_ARM_MINI 4048 // STM32F103ZET6 Mingda MD-16
#define BOARD_GTM32_PRO_VD 4049 // STM32F103VET6 controller
#define BOARD_CHITU3D_V9 4038 // Chitu3D TronXY X5SA V9 Board
#define BOARD_CREALITY_V4 4039 // Creality v4.x (STM32F103RE)
#define BOARD_CREALITY_V427 4040 // Creality v4.2.7 (STM32F103RE)
#define BOARD_CREALITY_V4210 4041 // Creality v4.2.10 (STM32F103RE) as found in the CR-30
#define BOARD_CREALITY_V431 4042 // Creality v4.3.1 (STM32F103RE)
#define BOARD_CREALITY_V452 4043 // Creality v4.5.2 (STM32F103RE)
#define BOARD_CREALITY_V453 4044 // Creality v4.5.3 (STM32F103RE)
#define BOARD_TRIGORILLA_PRO 4045 // Trigorilla Pro (STM32F103ZET6)
#define BOARD_FLY_MINI 4046 // FLYmaker FLY MINI (STM32F103RCT6)
#define BOARD_FLSUN_HISPEED 4047 // FLSUN HiSpeedV1 (STM32F103VET6)
#define BOARD_BEAST 4048 // STM32F103RET6 Libmaple-based controller
#define BOARD_MINGDA_MPX_ARM_MINI 4049 // STM32F103ZET6 Mingda MD-16
#define BOARD_GTM32_PRO_VD 4050 // STM32F103VET6 controller

//
// ARM Cortex-M4F
Expand Down
3 changes: 0 additions & 3 deletions Marlin/src/core/multi_language.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,12 @@ typedef const char Language_Str[];
#ifndef LCD_LANGUAGE_2
#define LCD_LANGUAGE_2 LCD_LANGUAGE
#endif

#ifndef LCD_LANGUAGE_3
#define LCD_LANGUAGE_3 LCD_LANGUAGE_2
#endif

#ifndef LCD_LANGUAGE_4
#define LCD_LANGUAGE_4 LCD_LANGUAGE_3
#endif

#ifndef LCD_LANGUAGE_5
#define LCD_LANGUAGE_5 LCD_LANGUAGE_4
#endif
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,11 @@ void set_message_with_feedback(PGM_P const msg_P) {
if (do_ubl_mesh_map) display_map(param.T_map_type); // Show user where we're probing

if (parser.seen_test('B')) {
SERIAL_ECHOPGM_P(GET_TEXT(MSG_UBL_BC_INSERT));
SERIAL_ECHOPGM("Place Shim & Measure");
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
}
else {
SERIAL_ECHOPGM_P(GET_TEXT(MSG_UBL_BC_INSERT2));
SERIAL_ECHOPGM("Measure");
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT2);
}

Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/gcode/bedlevel/mbl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ void GcodeSuite::G29() {
return;
}

int8_t ix, iy = 0;
int8_t ix, iy;
ix = iy = 0;

switch (state) {
case MeshReport:
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/M852.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void GcodeSuite::M852() {

if (!ijk) {
SERIAL_ECHO_START();
SERIAL_ECHOPGM_P(GET_TEXT(MSG_SKEW_FACTOR));
SERIAL_ECHOPGM("Skew Factor");
SERIAL_ECHOPAIR_F(" XY: ", planner.skew_factor.xy, 6);
#if ENABLED(SKEW_CORRECTION_FOR_Z)
SERIAL_ECHOPAIR_F(" XZ: ", planner.skew_factor.xz, 6);
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/gcode/feature/trinamic/M911-M914.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@
#endif

case Z_AXIS:
TERN_(Z_HAS_STEALTCHOP, if (index < 2) TMC_SET_PWMTHRS(Z,Z));
TERN_(Z2_HAS_STEALTCHOP, if (index == 0 || index == 2) TMC_SET_PWMTHRS(Z,Z2));
TERN_(Z3_HAS_STEALTCHOP, if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3));
TERN_(Z4_HAS_STEALTCHOP, if (index == 0 || index == 4) TMC_SET_PWMTHRS(Z,Z4));
TERN_(Z_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Z,Z));
TERN_(Z2_HAS_STEALTHCHOP, if (index == 0 || index == 2) TMC_SET_PWMTHRS(Z,Z2));
TERN_(Z3_HAS_STEALTHCHOP, if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3));
TERN_(Z4_HAS_STEALTHCHOP, if (index == 0 || index == 4) TMC_SET_PWMTHRS(Z,Z4));
break;
#if E_STEPPERS
case E_AXIS: {
Expand Down
15 changes: 9 additions & 6 deletions Marlin/src/gcode/motion/G2_G3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ void plan_arc(
#endif

// Angle of rotation between position and target from the circle center.
float angular_travel;
float angular_travel, abs_angular_travel;

// Do a full circle if starting and ending positions are "identical"
if (NEAR(current_position[p_axis], cart[p_axis]) && NEAR(current_position[q_axis], cart[q_axis])) {
// Preserve direction for circles
angular_travel = clockwise ? -RADIANS(360) : RADIANS(360);
abs_angular_travel = RADIANS(360);
}
else {
// Calculate the angle
Expand All @@ -103,8 +104,10 @@ void plan_arc(
case 2: angular_travel += RADIANS(360); break; // Negative but CCW? Reverse direction.
}

abs_angular_travel = ABS(angular_travel);

#ifdef MIN_ARC_SEGMENTS
min_segments = CEIL(min_segments * ABS(angular_travel) / RADIANS(360));
min_segments = CEIL(min_segments * abs_angular_travel / RADIANS(360));
NOLESS(min_segments, 1U);
#endif
}
Expand All @@ -117,8 +120,8 @@ void plan_arc(
#endif

// If circling around...
if (ENABLED(ARC_P_CIRCLES) && circles) {
const float total_angular = angular_travel + circles * RADIANS(360), // Total rotation with all circles and remainder
if (TERN0(ARC_P_CIRCLES, circles)) {
const float total_angular = abs_angular_travel + circles * RADIANS(360), // Total rotation with all circles and remainder
part_per_circle = RADIANS(360) / total_angular; // Each circle's part of the total

#if HAS_Z_AXIS
Expand All @@ -138,8 +141,8 @@ void plan_arc(
TERN_(HAS_EXTRUDERS, extruder_travel = cart.e - current_position.e);
}

const float flat_mm = radius * angular_travel,
mm_of_travel = TERN_(HAS_Z_AXIS, linear_travel ? HYPOT(flat_mm, linear_travel) :) ABS(flat_mm);
const float flat_mm = radius * abs_angular_travel,
mm_of_travel = TERN_(HAS_Z_AXIS, linear_travel ? HYPOT(flat_mm, linear_travel) :) flat_mm;
if (mm_of_travel < 0.001f) return;

const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
#define LCD_PROGRESS_BAR
#endif
#if ENABLED(TFTGLCD_PANEL_I2C)
#define LCD_I2C_ADDRESS 0x27 // Must be equal to panel's I2C slave addres
#define LCD_I2C_ADDRESS 0x33 // Must be 0x33 for STM32 main boards and equal to panel's I2C slave addres
#endif
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD, used for both I2C and SPI buses (LiquidTWI2 not required)
#define STD_ENCODER_PULSES_PER_STEP 2
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
static_assert(_test_btc_sample_start != 12.3f, "BTC_SAMPLE_START must be a whole number.");
#endif
#ifdef BTC_SAMPLE_RES
constexpr _btc_sample_res = BTC_SAMPLE_RES;
constexpr auto _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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2021-07-17"
#define STRING_DISTRIBUTION_DATE "2021-07-21"
#endif

/**
Expand Down
Loading

0 comments on commit 759d04c

Please sign in to comment.