Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into pr/26441
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Nov 20, 2023
2 parents 1b50124 + f830756 commit 08d4ba5
Show file tree
Hide file tree
Showing 93 changed files with 926 additions and 416 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:

# STM32H7
- BTT_SKR_SE_BX
- STM32H743VI_btt

# STM32F1 (Maple)
- jgaurora_a5s_a1_maple
Expand Down
13 changes: 8 additions & 5 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,9 @@
//#define BED_LIMIT_SWITCHING // Keep the bed temperature within BED_HYSTERESIS of the target
#endif

// Add 'M190 R T' for more gradual M190 R bed cooling.
//#define BED_ANNEALING_GCODE

//===========================================================================
//==================== PID > Chamber Temperature Control ====================
//===========================================================================
Expand Down Expand Up @@ -947,19 +950,19 @@
// Distance between bed and nozzle Z home position
#define DELTA_HEIGHT 250.00 // (mm) Get this value from G33 auto calibrate

#define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } // Get these values from G33 auto calibrate
#define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } // (mm) Get these values from G33 auto calibrate

// Horizontal distance bridged by diagonal push rods when effector is centered.
#define DELTA_RADIUS 124.0 // (mm) Get this value from G33 auto calibrate

// Trim adjustments for individual towers
// tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
// measured in degrees anticlockwise looking from above the printer
#define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } // Get these values from G33 auto calibrate
#define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } // (mm) Get these values from G33 auto calibrate

// Delta radius and diagonal rod adjustments (mm)
//#define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 }
//#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 }
// Delta radius and diagonal rod adjustments
//#define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 } // (mm)
//#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 } // (mm)
#endif

// @section scara
Expand Down
19 changes: 17 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1518,8 +1518,23 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// Add 50/100mm moves to MarlinUI even with a smaller bed
//#define LARGE_MOVE_ITEMS
/**
* MarlinUI "Move Axis" menu distances. Comma-separated list.
* Values are displayed as-defined, so always use plain numbers here.
* Axis moves <= 1/2 the axis length and Extruder moves <= EXTRUDE_MAXLENGTH
* will be shown in the move submenus.
*/
#define MANUAL_MOVE_DISTANCE_MM 10, 1.0, 0.1 // (mm)
//#define MANUAL_MOVE_DISTANCE_MM 100, 50, 10, 1.0, 0.1 // (mm)
//#define MANUAL_MOVE_DISTANCE_MM 500, 100, 50, 10, 1.0, 0.1 // (mm)

// Manual move distances for INCH_MODE_SUPPORT
#define MANUAL_MOVE_DISTANCE_IN 0.100, 0.010, 0.001 // (in)
//#define MANUAL_MOVE_DISTANCE_IN 1.000, 0.500, 0.100, 0.010, 0.001 // (in)
//#define MANUAL_MOVE_DISTANCE_IN 5.000, 1.000, 0.500, 0.100, 0.010, 0.001 // (in)

// Manual move distances for rotational axes
#define MANUAL_MOVE_DISTANCE_DEG 90, 45, 22.5, 5, 1 // (°)

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM
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-11-07"
//#define STRING_DISTRIBUTION_DATE "2023-11-20"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
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 @@ -399,6 +399,7 @@
#define BOARD_SOVOL_V131 5067 // Sovol V1.3.1 (GD32F103RE)
#define BOARD_TRIGORILLA_V006 5068 // Trigorilla V0.0.6 (GD32F103RE)
#define BOARD_KEDI_CONTROLLER_V1_2 5069 // EDUTRONICS Kedi Controller V1.2 (STM32F103RC)
#define BOARD_MD_D301 5070 // Mingda D2 DZ301 V1.0 (STM32F103ZE)

//
// ARM Cortex-M4F
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
// General Flags for some number of states
template<size_t N>
struct Flags {
typedef value_t(N) flagbits_t;
typedef uvalue_t(N) flagbits_t;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; } N8;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1; } N16;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1,
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ void unified_bed_leveling::shift_mesh_height() {
#endif

#ifndef HUGE_VALF
#define HUGE_VALF FLT_MAX
#define HUGE_VALF __FLT_MAX__
#endif

best = do_furthest // Points with valid data or HUGE_VALF are skipped
Expand Down
7 changes: 4 additions & 3 deletions Marlin/src/feature/powerloss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,10 @@ void PrintJobRecovery::resume() {
DEBUG_ECHOLNPGM("zraise: ", info.zraise, " ", info.flag.raised ? "(before)" : "");

#if ENABLED(GCODE_REPEAT_MARKERS)
DEBUG_ECHOLNPGM("repeat index: ", info.stored_repeat.index);
for (uint8_t i = 0; i < info.stored_repeat.index; ++i)
DEBUG_ECHOLNPGM("..... sdpos: ", info.stored_repeat.marker.sdpos, " count: ", info.stored_repeat.marker.counter);
const uint8_t ind = info.stored_repeat.count();
DEBUG_ECHOLNPGM("repeat markers: ", ind);
for (uint8_t i = ind; i--;)
DEBUG_ECHOLNPGM("...", i, " sdpos: ", info.stored_repeat.get_marker_sdpos(i), " count: ", info.stored_repeat.get_marker_counter(i));
#endif

#if HAS_HOME_OFFSET
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/feature/repeat.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class Repeat {
static void add_marker(const uint32_t sdpos, const uint16_t count);
static void loop();
static void cancel();
static uint8_t count() { return index; }
static int16_t get_marker_counter(const uint8_t i) { return marker[i].counter; }
static uint32_t get_marker_sdpos(const uint8_t i) { return marker[i].sdpos; }
};

extern Repeat repeat;
9 changes: 8 additions & 1 deletion Marlin/src/gcode/feature/pause/G27.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@
#include "../../../module/motion.h"

/**
* G27: Park the nozzle
* G27: Park the nozzle according with the given style
*
* P<style> - Parking style:
* 0 = (Default) Relative raise by NOZZLE_PARK_Z_RAISE_MIN (>= NOZZLE_PARK_POINT.z) before XY parking.
* 1 = Absolute move to NOZZLE_PARK_POINT.z before XY parking. (USE WITH CAUTION!)
* 2 = Relative raise by NOZZLE_PARK_POINT.z before XY parking.
* 3 = Relative raise by NOZZLE_PARK_Z_RAISE_MIN, skip XY parking.
* 4 = No Z raise. Just XY parking.
*/
void GcodeSuite::G27() {
// Don't allow nozzle parking without homing first
Expand Down
46 changes: 42 additions & 4 deletions Marlin/src/gcode/temp/M140_M190.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
*
* With PRINTJOB_TIMER_AUTOSTART turning on heaters will start the print job timer
* (used by printingIsActive, etc.) and turning off heaters will stop the timer.
*
* With BED_ANNEALING_GCODE:
*
* M190 Parameters
* T<seconds>: Cooldown time, for more gradual cooling. Use with R parameter.
* M190 R T - Cool the bed down over a given period of time.
*
* Examples
* M190 R70 T600: Cool down to 70°C over a period of ten minutes.
*
*/
void GcodeSuite::M140_M190(const bool isM190) {

Expand Down Expand Up @@ -81,19 +91,47 @@ void GcodeSuite::M140_M190(const bool isM190) {

if (!got_temp) return;

thermalManager.setTargetBed(temp);
thermalManager.isHeatingBed() ? LCD_MESSAGE(MSG_BED_HEATING) : LCD_MESSAGE(MSG_BED_COOLING);
#if ENABLED(BED_ANNEALING_GCODE)
const bool anneal = isM190 && !no_wait_for_cooling && parser.seenval('T');
const millis_t anneal_ms = anneal ? millis() + parser.value_millis_from_seconds() : 0UL;
#else
constexpr bool anneal = false;
#endif

if (!anneal) {
thermalManager.setTargetBed(temp);
thermalManager.isHeatingBed() ? LCD_MESSAGE(MSG_BED_HEATING) : LCD_MESSAGE(MSG_BED_COOLING);
}

// With PRINTJOB_TIMER_AUTOSTART, M190 can start the timer, and M140 can stop it
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(isM190, !isM190));

if (isM190)
if (isM190) {
#if ENABLED(BED_ANNEALING_GCODE)
if (anneal) {
LCD_MESSAGE(MSG_BED_ANNEALING);
// Loop from current temp down to the target
for (celsius_t cool_temp = thermalManager.degBed(); --cool_temp >= temp; ) {
thermalManager.setTargetBed(cool_temp); // Cool by one degree
thermalManager.wait_for_bed(false); // Could this wait forever?
const millis_t ms = millis();
if (PENDING(ms, anneal_ms) && cool_temp > temp) { // Still warmer and waiting?
const millis_t remain = anneal_ms - ms;
dwell(remain / (cool_temp - temp)); // Wait for a fraction of remaining time
}
}
return;
}
#endif

thermalManager.wait_for_bed(no_wait_for_cooling);
else
}
else {
ui.set_status_reset_fn([]{
const celsius_t c = thermalManager.degTargetBed();
return c < 30 || thermalManager.degBedNear(c);
});
}
}

#endif // HAS_HEATED_BED
2 changes: 2 additions & 0 deletions Marlin/src/inc/Changes.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,8 @@
#error "BTT_MINI_12864_V1 is now BTT_MINI_12864."
#elif defined(Z_PROBE_OFFSET_RANGE_MIN) || defined(Z_PROBE_OFFSET_RANGE_MAX)
#error "Z_PROBE_OFFSET_RANGE_(MIN|MAX) is now PROBE_OFFSET_Z(MIN|MAX)."
#elif defined(LARGE_MOVE_ITEMS)
#error "LARGE_MOVE_ITEMS is obsolete. Instead define MANUAL_MOVE_DISTANCE_MM and MANUAL_MOVE_DISTANCE_IN."
#endif

// L64xx stepper drivers have been removed
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1465,8 +1465,8 @@
#undef Z_PROBE_ERROR_TOLERANCE
#undef MULTIPLE_PROBING
#undef EXTRA_PROBING
#undef Z_PROBE_OFFSET_RANGE_MIN
#undef Z_PROBE_OFFSET_RANGE_MAX
#undef PROBE_OFFSET_ZMIN
#undef PROBE_OFFSET_ZMAX
#undef PAUSE_BEFORE_DEPLOY_STOW
#undef PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED
#undef PROBING_HEATERS_OFF
Expand Down
7 changes: 6 additions & 1 deletion Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@
#if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT)
#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1)
#define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
#define LCD_SERIAL_PORT 2
#else
#define LCD_SERIAL_PORT 3
Expand Down Expand Up @@ -1319,3 +1319,8 @@
#if defined(REDUNDANT_PART_COOLING_FAN) && !defined(NUM_REDUNDANT_FANS)
#define NUM_REDUNDANT_FANS 1
#endif

// Clean up if only mm units are used
#if DISABLED(INCH_MODE_SUPPORT)
#undef MANUAL_MOVE_DISTANCE_IN
#endif
2 changes: 2 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@

#if ANY(AXIS4_ROTATES, AXIS5_ROTATES, AXIS6_ROTATES, AXIS7_ROTATES, AXIS8_ROTATES, AXIS9_ROTATES)
#define HAS_ROTATIONAL_AXES 1
#else
#undef MANUAL_MOVE_DISTANCE_DEG
#endif

#if HAS_X_AXIS
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 "2023-11-07"
#define STRING_DISTRIBUTION_DATE "2023-11-20"
#endif

/**
Expand Down
44 changes: 41 additions & 3 deletions Marlin/src/lcd/dogm/marlinui_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,52 @@ bool MarlinUI::detected() { return true; }
#else
const u8g_pgm_uint8_t * const bmp = (u8g_pgm_uint8_t*)pgm_read_ptr(&custom_bootscreen_animation[frame]);
#endif
#elif ANY(COMPACT_CUSTOM_BOOTSCREEN, COMPACT_CUSTOM_BOOTSCREEN_EXT)
#define BMPSIZE (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH * CUSTOM_BOOTSCREEN_BMPHEIGHT)
uint8_t bmp[BMPSIZE];
uint8_t *bmp_rle = (uint8_t*)custom_start_bmp_rle;
#else
const u8g_pgm_uint8_t * const bmp = custom_start_bmp;
#endif

UNUSED(frame);
#if ANY(COMPACT_CUSTOM_BOOTSCREEN, COMPACT_CUSTOM_BOOTSCREEN_EXT)

uint8_t *dst = (uint8_t*)bmp;

auto rle_nybble = [&](const uint16_t i) -> uint8_t {
const uint8_t b = bmp_rle[i / 2];
return (i & 1 ? b & 0xF : b >> 4);
};

uint8_t workbyte = 0, bitstate = rle_nybble(0) << 7;
uint16_t inindex = 1, outindex = 0;
while (outindex < BMPSIZE * 8) {
int16_t c = rle_nybble(inindex++);
if (c == 15) {
const uint8_t d = rle_nybble(inindex++), e = rle_nybble(inindex++);
#if ENABLED(COMPACT_CUSTOM_BOOTSCREEN_EXT)
if (d == 15)
c = 256 + 16 * e + rle_nybble(inindex++) - 1;
else
#endif
c = 16 * d + e + 15; // From 16 to 270
}
while (c-- >= 0) {
const uint8_t bitind = outindex & 7,
bitval = bitstate >> bitind;
workbyte |= bitval;
if (bitind == 7) { *dst++ = workbyte; workbyte = 0; }
outindex++;
}
bitstate ^= 0x80;
}

#endif // COMPACT_CUSTOM_BOOTSCREEN || COMPACT_CUSTOM_BOOTSCREEN_EXT

u8g.drawBitmapP(left, top, CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH, CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp);
u8g.TERN(COMPACT_CUSTOM_BOOTSCREEN, drawBitmap, drawBitmapP)
(left, top, CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH, CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp);

UNUSED(frame);
#if ENABLED(CUSTOM_BOOTSCREEN_INVERTED)
if (frame == 0) {
u8g.setColorIndex(1);
Expand Down Expand Up @@ -423,7 +461,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
int8_t vlen = vstr ? utf8_strlen(vstr) : 0;

bool mv_colon = false;
if (vlen) {
if (vlen && !center) {
// Move the leading colon from the value to the label below
mv_colon = (*vstr == ':');
// Shorter value, wider label
Expand Down
11 changes: 3 additions & 8 deletions Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,9 @@ void ChironTFT::sendFileList(int8_t startindex) {
}

void ChironTFT::selectFile() {
if (panel_type <= AC_panel_new) {
strncpy(selectedfile, panel_command + 4, command_len - 3);
selectedfile[command_len - 4] = '\0';
}
else {
strncpy(selectedfile, panel_command + 4, command_len - 4);
selectedfile[command_len - 5] = '\0';
}
const size_t namelen = command_len - 4 + (panel_type <= AC_panel_new);
strncpy(selectedfile, panel_command + 4, namelen);
selectedfile[namelen] = '\0';
#if ACDEBUG(AC_FILE)
DEBUG_ECHOLNPGM(" Selected File: ", selectedfile);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def deflate(data):
parser.add_argument("-d", "--deflate", action="store_true", help="Packs the data using the deflate algorithm")
args = parser.parse_args()

varname = os.path.splitext(os.path.basename(args.input))[0];
varname = os.path.splitext(os.path.basename(args.input))[0]

with open(args.input, "rb") as in_file:
data = in_file.read()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def write(self):
if len(self.values):
self.blocks.append(self.values)

block_strs = [];
block_strs = []
for b in self.blocks:
data = self.convert_to_4bpp(b)
data = ', '.join(data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def add_bits_to_byte(self, value, size = 1):

def append_rgb565(self, color):
value = ((color[0] & 0xF8) << 8) + ((color[1] & 0xFC) << 3) + ((color[2] & 0xF8) >> 3)
self.values.append((value & 0x00FF) >> 0);
self.values.append((value & 0xFF00) >> 8);
self.values.append((value & 0x00FF) >> 0)
self.values.append((value & 0xFF00) >> 8)

def append_rgb332(self, color):
value = (color[0] & 0xE0) + ((color[1] & 0xE0) >> 3) + ((color[2] & 0xC0) >> 6)
self.values.append(value);
self.values.append(value)

def append_grayscale(self, color, bits):
luminance = int(0.2126 * color[0] + 0.7152 * color[1] + 0.0722 * color[2])
Expand Down Expand Up @@ -99,7 +99,7 @@ def write(self, varname, deflate):
parser.add_argument("-m", "--mode", default="l1", help="Mode, can be l1, l2, l4, l8, rgb332 or rgb565")
args = parser.parse_args()

varname = os.path.splitext(os.path.basename(args.input))[0];
varname = os.path.splitext(os.path.basename(args.input))[0]

writer = WriteSource(args.mode)

Expand Down
Loading

0 comments on commit 08d4ba5

Please sign in to comment.