From 3d8e3c3c9a2e955b7075783b8a95c3526b2936a5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 30 Nov 2023 16:25:11 -0600 Subject: [PATCH 01/14] =?UTF-8?q?=F0=9F=90=9B=20Touch=20fixes=20(#26455)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/LPC1768/tft/xpt2046.cpp | 2 +- Marlin/src/HAL/STM32/tft/xpt2046.cpp | 2 +- Marlin/src/HAL/STM32F1/tft/xpt2046.cpp | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 10 ++-- Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp | 10 ++-- .../extui/mks_ui/tft_lvgl_configuration.cpp | 23 +++----- Marlin/src/lcd/tft/touch.cpp | 58 ++++++++++--------- Marlin/src/lcd/tft/touch.h | 10 ++-- Marlin/src/lcd/tft_io/touch_calibration.cpp | 30 +++++----- Marlin/src/lcd/tft_io/touch_calibration.h | 51 ++++++++-------- Marlin/src/lcd/touch/touch_buttons.cpp | 10 +++- 11 files changed, 103 insertions(+), 105 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp b/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp index 6c00a4cae0b2..a737266c6811 100644 --- a/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp +++ b/Marlin/src/HAL/LPC1768/tft/xpt2046.cpp @@ -78,7 +78,7 @@ bool XPT2046::getRawPoint(int16_t * const x, int16_t * const y) { if (isBusy() || !isTouched()) return false; *x = getRawData(XPT2046_X); *y = getRawData(XPT2046_Y); - return true; + return isTouched(); } uint16_t XPT2046::getRawData(const XPTCoordinate coordinate) { diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.cpp b/Marlin/src/HAL/STM32/tft/xpt2046.cpp index 57c50653c9ce..c5645ad79c4a 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32/tft/xpt2046.cpp @@ -123,7 +123,7 @@ bool XPT2046::getRawPoint(int16_t * const x, int16_t * const y) { if (isBusy() || !isTouched()) return false; *x = getRawData(XPT2046_X); *y = getRawData(XPT2046_Y); - return true; + return isTouched(); } uint16_t XPT2046::getRawData(const XPTCoordinate coordinate) { diff --git a/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp b/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp index 3428110c127e..475290de45b2 100644 --- a/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp +++ b/Marlin/src/HAL/STM32F1/tft/xpt2046.cpp @@ -90,7 +90,7 @@ bool XPT2046::getRawPoint(int16_t * const x, int16_t * const y) { if (isBusy() || !isTouched()) return false; *x = getRawData(XPT2046_X); *y = getRawData(XPT2046_Y); - return true; + return isTouched(); } uint16_t XPT2046::getRawData(const XPTCoordinate coordinate) { diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 6e7898a389f9..be8605e3bba0 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -389,9 +389,9 @@ class TextScroller { // Draw value text on if (viewer_print_value) { - xy_uint_t offset { 0, cell_height_px / 2 - 6 }; + const int8_t offset_y = cell_height_px / 2 - 6; if (isnan(bedlevel.z_values[x][y])) { // undefined - dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset.y, F("X")); + dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X")); } else { // has value MString<12> msg; @@ -399,10 +399,10 @@ class TextScroller { msg.set(p_float_t(abs(bedlevel.z_values[x][y]), 2)); else msg.setf(F("%02i"), uint16_t(abs(bedlevel.z_values[x][y] - int16_t(bedlevel.z_values[x][y])) * 100)); - offset.x = cell_width_px / 2 - 3 * msg.length() - 2; + const int8_t offset_x = cell_width_px / 2 - 3 * msg.length() - 2; if (GRID_MAX_POINTS_X >= 10) - dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset.x, start_y_px + offset.y /*+ square / 2 - 6*/, F(".")); - dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset.x, start_y_px + offset.y /*+ square / 2 - 6*/, msg); + dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, F(".")); + dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, msg); } safe_delay(10); LCD_SERIAL.flushTX(); diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index f2fe008667c6..64d145c95dfd 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -247,9 +247,9 @@ bool BedLevelTools::meshValidate() { // Draw value text on const uint8_t fs = DWINUI::fontWidth(meshfont); if (viewer_print_value) { - xy_uint_t offset { 0, cell_height_px / 2 - fs }; + const int8_t offset_y = cell_height_px / 2 - fs; if (isnan(bedlevel.z_values[x][y])) { // undefined - dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset.y, F("X")); + dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X")); } else { // has value MString<12> msg; @@ -257,10 +257,10 @@ bool BedLevelTools::meshValidate() { msg.set(p_float_t(abs(bedlevel.z_values[x][y]), 2)); else msg.setf(F("%02i"), uint16_t(abs(bedlevel.z_values[x][y] - int16_t(bedlevel.z_values[x][y])) * 100)); - offset.x = cell_width_px / 2 - (fs / 2) * msg.length() - 2; + const int8_t offset_x = cell_width_px / 2 - (fs / 2) * msg.length() - 2; if ((GRID_MAX_POINTS_X) >= TERN(TJC_DISPLAY, 8, 10)) - dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset.x, start_y_px + offset.y, F(".")); - dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset.x, start_y_px + offset.y, msg); + dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset_x, start_y_px + offset_y, F(".")); + dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset_x, start_y_px + offset_y, msg); } safe_delay(10); LCD_SERIAL.flushTX(); diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index 7adce94c2fa6..ba898162d1f7 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -305,35 +305,28 @@ uint16_t getTickDiff(const uint16_t curTick, const uint16_t lastTick) { return (TICK_CYCLE) * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick)); } -static bool get_point(xy_int_t &point) { - if (!touch.getRawPoint(&point.x, &point.y)) return false; +static bool get_point(int16_t * const x, int16_t * const y) { + if (!touch.getRawPoint(x, y)) return false; #if ENABLED(TOUCH_SCREEN_CALIBRATION) const calibrationState state = touch_calibration.get_calibration_state(); if (WITHIN(state, CALIBRATION_TOP_LEFT, CALIBRATION_BOTTOM_LEFT)) { - if (touch_calibration.handleTouch(point)) lv_update_touch_calibration_screen(); + if (touch_calibration.handleTouch(*x, *y)) lv_update_touch_calibration_screen(); return false; } #endif - point.x = int16_t((int32_t(point.x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X; - point.y = int16_t((int32_t(point.y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y; + *x = int16_t((int32_t(*x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X; + *y = int16_t((int32_t(*y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y; return true; } bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { static xy_int_t last { 0, 0 }; - if (get_point(last)) { - data->point.x = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_WIDTH - last.x : last.x; - data->point.y = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_HEIGHT - last.y : last.y; - data->state = LV_INDEV_STATE_PR; - } - else { - data->point.x = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_WIDTH - last.x : last.x; - data->point.y = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_HEIGHT - last.y : last.y; - data->state = LV_INDEV_STATE_REL; - } + data->state = get_point(&last.x, &last.y) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; + data->point.x = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_WIDTH - last.x : last.x; + data->point.y = (TFT_ROTATION == TFT_ROTATE_180) ? TFT_HEIGHT - last.y : last.y; return false; // Return `false` since no data is buffering or left to read } diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 8e79e397adea..3c0b21ba8fd3 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -39,7 +39,7 @@ #include "tft.h" bool Touch::enabled = true; -xy_int_t Touch::point; +int16_t Touch::x, Touch::y; touch_control_t Touch::controls[]; touch_control_t *Touch::current_control; uint16_t Touch::controls_count; @@ -67,13 +67,17 @@ void Touch::add_control(TouchControlType type, uint16_t x, uint16_t y, uint16_t if (controls_count == MAX_CONTROLS) return; controls[controls_count].type = type; - controls[controls_count].pos.set(x, y); - controls[controls_count].size.set(width, height); + controls[controls_count].x = x; + controls[controls_count].y = y; + controls[controls_count].width = width; + controls[controls_count].height = height; controls[controls_count].data = data; controls_count++; } void Touch::idle() { + int16_t _x, _y; + if (!enabled) return; // Return if Touch::idle is called within the same millisecond @@ -81,8 +85,7 @@ void Touch::idle() { if (now <= next_touch_ms) return; next_touch_ms = now; - xy_int_t got_point; - if (get_point(got_point)) { + if (get_point(&_x, &_y)) { #if HAS_RESUME_CONTINUE // UI is waiting for a click anywhere? if (wait_for_user) { @@ -106,13 +109,11 @@ void Touch::idle() { if (time_to_hold == 0) time_to_hold = now + MINIMUM_HOLD_TIME; if (PENDING(now, time_to_hold)) return; - if (bool(point)) { + if (x != 0 && y != 0) { if (current_control) { - if ( WITHIN(point.x, current_control->pos.x - FREE_MOVE_RANGE, current_control->pos.x + current_control->size.x + FREE_MOVE_RANGE) - && WITHIN(point.y, current_control->pos.y - FREE_MOVE_RANGE, current_control->pos.y + current_control->size.y + FREE_MOVE_RANGE) - ) { - LIMIT(point.x, current_control->pos.x, current_control->pos.x + current_control->size.x); - LIMIT(point.y, current_control->pos.y, current_control->pos.y + current_control->size.y); + if (WITHIN(x, current_control->x - FREE_MOVE_RANGE, current_control->x + current_control->width + FREE_MOVE_RANGE) && WITHIN(y, current_control->y - FREE_MOVE_RANGE, current_control->y + current_control->height + FREE_MOVE_RANGE)) { + LIMIT(x, current_control->x, current_control->x + current_control->width); + LIMIT(y, current_control->y, current_control->y + current_control->height); touch(current_control); } else @@ -120,10 +121,7 @@ void Touch::idle() { } else { for (uint16_t i = 0; i < controls_count; i++) { - if (TERN0(TOUCH_SCREEN_CALIBRATION, controls[i].type == CALIBRATE) - || ( WITHIN(point.x, controls[i].pos.x, controls[i].pos.x + controls[i].size.x) - && WITHIN(point.y, controls[i].pos.y, controls[i].pos.y + controls[i].size.y)) - ) { + if ((WITHIN(x, controls[i].x, controls[i].x + controls[i].width) && WITHIN(y, controls[i].y, controls[i].y + controls[i].height)) || (TERN(TOUCH_SCREEN_CALIBRATION, controls[i].type == CALIBRATE, false))) { touch_control_type = controls[i].type; touch(&controls[i]); break; @@ -134,10 +132,11 @@ void Touch::idle() { if (!current_control) touch_time = now; } - point = got_point; + x = _x; + y = _y; } else { - point.reset(); + x = y = 0; current_control = nullptr; touch_time = 0; touch_control_type = NONE; @@ -150,7 +149,7 @@ void Touch::touch(touch_control_t *control) { switch (control->type) { #if ENABLED(TOUCH_SCREEN_CALIBRATION) case CALIBRATE: - if (touch_calibration.handleTouch(point)) ui.refresh(); + if (touch_calibration.handleTouch(x, y)) ui.refresh(); break; #endif @@ -177,7 +176,7 @@ void Touch::touch(touch_control_t *control) { ui.encoderPosition = ui.encoderPosition + LCD_HEIGHT < (uint32_t)screen_items ? ui.encoderPosition + LCD_HEIGHT : screen_items; ui.refresh(); break; - case SLIDER: hold(control); ui.encoderPosition = (point.x - control->pos.x) * control->data / control->size.x; break; + case SLIDER: hold(control); ui.encoderPosition = (x - control->x) * control->data / control->width; break; case INCREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff++ : ui.encoderPosition++, ui.encoderPosition++); break; case DECREASE: hold(control, repeat_delay - 5); TERN(AUTO_BED_LEVELING_UBL, ui.external_control ? bedlevel.encoder_diff-- : ui.encoderPosition--, ui.encoderPosition--); break; case HEATER: @@ -263,16 +262,19 @@ void Touch::hold(touch_control_t *control, millis_t delay) { ui.refresh(); } -bool Touch::get_point(xy_int_t &point) { - bool is_touched = false; +bool Touch::get_point(int16_t * const x, int16_t * const y) { #if ANY(TFT_TOUCH_DEVICE_XPT2046, TFT_TOUCH_DEVICE_GT911) - is_touched = (TOUCH_ORIENTATION_NONE != _TOUCH_ORIENTATION) - && (TOUCH_PORTRAIT == _TOUCH_ORIENTATION - ? io.getRawPoint(&point.y, &point.x) - : io.getRawPoint(&point.x, &point.y)); - #if ENABLED(TFT_TOUCH_DEVICE_XPT2046) - point.x = uint16_t((uint32_t(point.x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X; - point.y = uint16_t((uint32_t(point.y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y; + const bool is_touched = TOUCH_PORTRAIT == _TOUCH_ORIENTATION ? io.getRawPoint(y, x) : io.getRawPoint(x, y); + #endif + #if ENABLED(TFT_TOUCH_DEVICE_XPT2046) + #if ENABLED(TOUCH_SCREEN_CALIBRATION) + if (is_touched && TOUCH_ORIENTATION_NONE != _TOUCH_ORIENTATION) { + *x = int16_t((int32_t(*x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X; + *y = int16_t((int32_t(*y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y; + } + #else + *x = uint16_t((uint32_t(*x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X; + *y = uint16_t((uint32_t(*y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y; #endif #endif diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 6c0ff88f4674..93f9327a15b3 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -57,8 +57,10 @@ enum TouchControlType : uint16_t { typedef struct __attribute__((__packed__)) { TouchControlType type; - xy_uint_t pos; - xy_uint_t size; + uint16_t x; + uint16_t y; + uint16_t width; + uint16_t height; intptr_t data; } touch_control_t; @@ -75,7 +77,7 @@ typedef struct __attribute__((__packed__)) { class Touch { private: static TOUCH_DRIVER_CLASS io; - static xy_int_t point; + static int16_t x, y; static bool enabled; static touch_control_t controls[MAX_CONTROLS]; @@ -85,7 +87,7 @@ class Touch { static millis_t next_touch_ms, time_to_hold, repeat_delay, touch_time; static TouchControlType touch_control_type; - static bool get_point(xy_int_t &point); + static bool get_point(int16_t * const x, int16_t * const y); static void touch(touch_control_t *control); static void hold(touch_control_t *control, millis_t delay=0); diff --git a/Marlin/src/lcd/tft_io/touch_calibration.cpp b/Marlin/src/lcd/tft_io/touch_calibration.cpp index b1cdfe6cda94..f76c29eb49f2 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.cpp +++ b/Marlin/src/lcd/tft_io/touch_calibration.cpp @@ -58,18 +58,18 @@ void TouchCalibration::validate_calibration() { #define CP(N) calibration_points[CALIBRATION_##N] if (landscape) { calibration_state = CALIBRATION_SUCCESS; - calibration.x = ((CP(TOP_RIGHT).x - CP(TOP_LEFT).x) << 17) / (CP(BOTTOM_RIGHT).raw.x + CP(TOP_RIGHT).raw.x - CP(BOTTOM_LEFT).raw.x - CP(TOP_LEFT).raw.x); - calibration.y = ((CP(BOTTOM_LEFT).y - CP(TOP_LEFT).y) << 17) / (CP(BOTTOM_RIGHT).raw.y - CP(TOP_RIGHT).raw.y + CP(BOTTOM_LEFT).raw.y - CP(TOP_LEFT).raw.y); - calibration.offset.x = CP(TOP_LEFT).x - int16_t(((CP(TOP_LEFT).raw.x + CP(BOTTOM_LEFT).raw.x) * calibration.x) >> 17); - calibration.offset.y = CP(TOP_LEFT).y - int16_t(((CP(TOP_LEFT).raw.y + CP(TOP_RIGHT).raw.y) * calibration.y) >> 17); + calibration.x = ((CP(TOP_RIGHT).x - CP(TOP_LEFT).x) << 17) / (CP(BOTTOM_RIGHT).raw_x + CP(TOP_RIGHT).raw_x - CP(BOTTOM_LEFT).raw_x - CP(TOP_LEFT).raw_x); + calibration.y = ((CP(BOTTOM_LEFT).y - CP(TOP_LEFT).y) << 17) / (CP(BOTTOM_RIGHT).raw_y - CP(TOP_RIGHT).raw_y + CP(BOTTOM_LEFT).raw_y - CP(TOP_LEFT).raw_y); + calibration.offset_x = CP(TOP_LEFT).x - int16_t(((CP(TOP_LEFT).raw_x + CP(BOTTOM_LEFT).raw_x) * calibration.x) >> 17); + calibration.offset_y = CP(TOP_LEFT).y - int16_t(((CP(TOP_LEFT).raw_y + CP(TOP_RIGHT).raw_y) * calibration.y) >> 17); calibration.orientation = TOUCH_LANDSCAPE; } else if (portrait) { calibration_state = CALIBRATION_SUCCESS; - calibration.x = ((CP(TOP_RIGHT).x - CP(TOP_LEFT).x) << 17) / (CP(BOTTOM_RIGHT).raw.y + CP(TOP_RIGHT).raw.y - CP(BOTTOM_LEFT).raw.y - CP(TOP_LEFT).raw.y); - calibration.y = ((CP(BOTTOM_LEFT).y - CP(TOP_LEFT).y) << 17) / (CP(BOTTOM_RIGHT).raw.x - CP(TOP_RIGHT).raw.x + CP(BOTTOM_LEFT).raw.x - CP(TOP_LEFT).raw.x); - calibration.offset.x = CP(TOP_LEFT).x - int16_t(((CP(TOP_LEFT).raw.y + CP(BOTTOM_LEFT).raw.y) * calibration.x) >> 17); - calibration.offset.y = CP(TOP_LEFT).y - int16_t(((CP(TOP_LEFT).raw.x + CP(TOP_RIGHT).raw.x) * calibration.y) >> 17); + calibration.x = ((CP(TOP_RIGHT).x - CP(TOP_LEFT).x) << 17) / (CP(BOTTOM_RIGHT).raw_y + CP(TOP_RIGHT).raw_y - CP(BOTTOM_LEFT).raw_y - CP(TOP_LEFT).raw_y); + calibration.y = ((CP(BOTTOM_LEFT).y - CP(TOP_LEFT).y) << 17) / (CP(BOTTOM_RIGHT).raw_x - CP(TOP_RIGHT).raw_x + CP(BOTTOM_LEFT).raw_x - CP(TOP_LEFT).raw_x); + calibration.offset_x = CP(TOP_LEFT).x - int16_t(((CP(TOP_LEFT).raw_y + CP(BOTTOM_LEFT).raw_y) * calibration.x) >> 17); + calibration.offset_y = CP(TOP_LEFT).y - int16_t(((CP(TOP_LEFT).raw_x + CP(TOP_RIGHT).raw_x) * calibration.y) >> 17); calibration.orientation = TOUCH_PORTRAIT; } else { @@ -83,23 +83,23 @@ void TouchCalibration::validate_calibration() { SERIAL_ECHOLNPGM("Touch screen calibration completed"); SERIAL_ECHOLN(F("#define TOUCH_"), F("CALIBRATION_X "), calibration.x); SERIAL_ECHOLN(F("#define TOUCH_"), F("CALIBRATION_Y "), calibration.y); - SERIAL_ECHOLN(F("#define TOUCH_"), F("OFFSET_X "), calibration.offset.x); - SERIAL_ECHOLN(F("#define TOUCH_"), F("OFFSET_Y "), calibration.offset.y); + SERIAL_ECHOLN(F("#define TOUCH_"), F("OFFSET_X "), calibration.offset_x); + SERIAL_ECHOLN(F("#define TOUCH_"), F("OFFSET_Y "), calibration.offset_y); SERIAL_ECHO(F("#define TOUCH_")); SERIAL_ECHO_TERNARY(calibration.orientation == TOUCH_LANDSCAPE, "ORIENTATION ", "TOUCH_LANDSCAPE", "TOUCH_PORTRAIT", "\n"); TERN_(TOUCH_CALIBRATION_AUTO_SAVE, settings.save()); } } -bool TouchCalibration::handleTouch(const xy_int_t &point) { +bool TouchCalibration::handleTouch(const uint16_t x, const uint16_t y) { const millis_t now = millis(); + if (next_touch_update_ms && PENDING(now, next_touch_update_ms)) return false; next_touch_update_ms = now + BUTTON_DELAY_MENU; if (calibration_state < CALIBRATION_SUCCESS) { - calibration_points[calibration_state].raw = point; - DEBUG_ECHOLNPGM("TouchCalibration - State: ", calibration_state, - ", x: ", calibration_points[calibration_state].x, ", raw.x: ", point.x, - ", y: ", calibration_points[calibration_state].y, ", raw.y: ", point.y); + calibration_points[calibration_state].raw_x = x; + calibration_points[calibration_state].raw_y = y; + DEBUG_ECHOLNPGM("TouchCalibration - State: ", calibration_state, ", x: ", calibration_points[calibration_state].x, ", raw_x: ", x, ", y: ", calibration_points[calibration_state].y, ", raw_y: ", y); } switch (calibration_state) { diff --git a/Marlin/src/lcd/tft_io/touch_calibration.h b/Marlin/src/lcd/tft_io/touch_calibration.h index be226db224cc..5e15f85cb570 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.h +++ b/Marlin/src/lcd/tft_io/touch_calibration.h @@ -27,8 +27,8 @@ #define _TOUCH_CALIBRATION_X touch_calibration.calibration.x #define _TOUCH_CALIBRATION_Y touch_calibration.calibration.y -#define _TOUCH_OFFSET_X touch_calibration.calibration.offset.x -#define _TOUCH_OFFSET_Y touch_calibration.calibration.offset.y +#define _TOUCH_OFFSET_X touch_calibration.calibration.offset_x +#define _TOUCH_OFFSET_Y touch_calibration.calibration.offset_y #define _TOUCH_ORIENTATION touch_calibration.calibration.orientation #ifndef TOUCH_SCREEN_CALIBRATION_PRECISION @@ -38,22 +38,15 @@ #define TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS 2500 #endif -typedef struct __attribute__((__packed__)) TouchCal : xy_long_t { - xy_int_t offset; +typedef struct __attribute__((__packed__)) { + int32_t x, y; + int16_t offset_x, offset_y; uint8_t orientation; - TouchCal() { set(xy_long_t({ 0, 0 }), xy_int_t({ 0, 0 }), TOUCH_ORIENTATION_NONE); } - void set(const xy_long_t &xy, const xy_int_t &hv, const uint8_t o) { - xy_long_t::set(xy); offset = hv; orientation = o; - } - void reset() { - set(xy_long_t({ TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y }), - xy_int_t({ TOUCH_OFFSET_X, TOUCH_OFFSET_Y }), - TOUCH_ORIENTATION); - } } touch_calibration_t; -typedef struct __attribute__((__packed__)) : xy_uint_t { - xy_int_t raw; +typedef struct __attribute__((__packed__)) { + uint16_t x, y; + int16_t raw_x, raw_y; } touch_calibration_point_t; enum calibrationState : uint8_t { @@ -72,24 +65,28 @@ class TouchCalibration { static touch_calibration_point_t calibration_points[4]; static millis_t next_touch_update_ms; - static bool validate_precision(int32_t a, int32_t b) { return (a > b ? (100 * b) / a : (100 * a) / b) > (TOUCH_SCREEN_CALIBRATION_PRECISION); } - static bool validate_precision_x(uint8_t a, uint8_t b) { return validate_precision(calibration_points[a].raw.x, calibration_points[b].raw.x); } - static bool validate_precision_y(uint8_t a, uint8_t b) { return validate_precision(calibration_points[a].raw.y, calibration_points[b].raw.y); } + static bool validate_precision(int32_t a, int32_t b) { return (a > b ? (100 * b) / a : (100 * a) / b) > TOUCH_SCREEN_CALIBRATION_PRECISION; } + static bool validate_precision_x(uint8_t a, uint8_t b) { return validate_precision(calibration_points[a].raw_x, calibration_points[b].raw_x); } + static bool validate_precision_y(uint8_t a, uint8_t b) { return validate_precision(calibration_points[a].raw_y, calibration_points[b].raw_y); } static void validate_calibration(); static touch_calibration_t calibration; static uint8_t failed_count; - static void calibration_reset() { calibration.set(xy_long_t({ TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y }), xy_int_t({ TOUCH_OFFSET_X, TOUCH_OFFSET_Y }), TOUCH_ORIENTATION); } - static bool need_calibration() { return !(calibration.offset.x || calibration.offset.y || calibration.x || calibration.y); } + static void calibration_reset() { calibration = { TOUCH_CALIBRATION_X, TOUCH_CALIBRATION_Y, TOUCH_OFFSET_X, TOUCH_OFFSET_Y, TOUCH_ORIENTATION }; } + static bool need_calibration() { return !calibration.offset_x && !calibration.offset_y && !calibration.x && !calibration.y; } static calibrationState calibration_start() { next_touch_update_ms = millis() + 750UL; - calibration.reset(); + calibration = { 0, 0, 0, 0, TOUCH_ORIENTATION_NONE }; calibration_state = CALIBRATION_TOP_LEFT; - calibration_points[CALIBRATION_TOP_LEFT].set(30, 30); - calibration_points[CALIBRATION_TOP_RIGHT].set(TFT_WIDTH - 31, 30); - calibration_points[CALIBRATION_BOTTOM_RIGHT].set(TFT_WIDTH - 31, TFT_HEIGHT - 31); - calibration_points[CALIBRATION_BOTTOM_LEFT].set(30, TFT_HEIGHT - 31); + calibration_points[CALIBRATION_TOP_LEFT].x = 30; + calibration_points[CALIBRATION_TOP_LEFT].y = 30; + calibration_points[CALIBRATION_TOP_RIGHT].x = TFT_WIDTH - 31; + calibration_points[CALIBRATION_TOP_RIGHT].y = 30; + calibration_points[CALIBRATION_BOTTOM_RIGHT].x = TFT_WIDTH - 31; + calibration_points[CALIBRATION_BOTTOM_RIGHT].y = TFT_HEIGHT - 31; + calibration_points[CALIBRATION_BOTTOM_LEFT].x = 30; + calibration_points[CALIBRATION_BOTTOM_LEFT].y = TFT_HEIGHT - 31; failed_count = 0; return calibration_state; } @@ -100,12 +97,12 @@ class TouchCalibration { return !need_calibration(); } - static bool handleTouch(const xy_int_t &point); + static bool handleTouch(const uint16_t x, const uint16_t y); }; extern TouchCalibration touch_calibration; -#else // TOUCH_SCREEN_CALIBRATION +#else // !TOUCH_SCREEN_CALIBRATION #define _TOUCH_CALIBRATION_X (TOUCH_CALIBRATION_X) #define _TOUCH_CALIBRATION_Y (TOUCH_CALIBRATION_Y) diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index 636a31dafa41..7d31b21c04a6 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -66,6 +66,7 @@ uint8_t TouchButtons::read_buttons() { int16_t x, y; #if ENABLED(TFT_TOUCH_DEVICE_XPT2046) + const bool is_touched = TOUCH_PORTRAIT == _TOUCH_ORIENTATION ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y); @@ -88,13 +89,16 @@ uint8_t TouchButtons::read_buttons() { #if ENABLED(TOUCH_SCREEN_CALIBRATION) const calibrationState state = touch_calibration.get_calibration_state(); if (WITHIN(state, CALIBRATION_TOP_LEFT, CALIBRATION_BOTTOM_LEFT)) { - if (!no_touch && touch_calibration.handleTouch(xy_int_t({x, y}))) ui.refresh(); + if (!no_touch && touch_calibration.handleTouch(x, y)) ui.refresh(); no_touch = true; return 0; } + x = int16_t((int32_t(x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X; + y = int16_t((int32_t(y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y; + #else + x = uint16_t((uint32_t(x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X; + y = uint16_t((uint32_t(y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y; #endif - x = uint16_t((uint32_t(x) * _TOUCH_CALIBRATION_X) >> 16) + _TOUCH_OFFSET_X; - y = uint16_t((uint32_t(y) * _TOUCH_CALIBRATION_Y) >> 16) + _TOUCH_OFFSET_Y; #elif ENABLED(TFT_TOUCH_DEVICE_GT911) From fe8266b59105c24a6dced92bfd604374e5e9ef8d Mon Sep 17 00:00:00 2001 From: Erkan Ozgur Yilmaz Date: Thu, 30 Nov 2023 22:52:11 +0000 Subject: [PATCH 02/14] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20BLTouch=20HSMode=20d?= =?UTF-8?q?eploy=20(#26311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/probe.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index deeb53942ba3..0bd83bc3ac10 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -596,11 +596,15 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { thermalManager.wait_for_hotend_heating(active_extruder); #endif - // Ensure the BLTouch is deployed. Does nothing if already deployed. - if (TERN0(BLTOUCH, bltouch.deploy())) return true; + #if ENABLED(BLTOUCH) + // Ensure the BLTouch is deployed. (Does nothing if already deployed.) + // Don't deploy with high_speed_mode enabled. The probe already re-deploys itself. + if (TERN(MEASURE_BACKLASH_WHEN_PROBING, true, !bltouch.high_speed_mode) && bltouch.deploy()) + return true; + #endif #if HAS_Z_SERVO_PROBE && (ENABLED(Z_SERVO_INTERMEDIATE_STOW) || defined(Z_SERVO_MEASURE_ANGLE)) - probe_specific_action(true); // Always re-deploy in this case + probe_specific_action(true); // Always re-deploy in this case #endif // Disable stealthChop if used. Enable diag1 pin on driver. From b55678a7d08f75a44993381e056fa5c537c9a4dd Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 1 Dec 2023 00:23:41 +0000 Subject: [PATCH 03/14] [cron] Bump distribution date (2023-12-01) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 07815b01d6fe..96bcec0bbc7c 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -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-30" +//#define STRING_DISTRIBUTION_DATE "2023-12-01" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 3d192cb4740a..a91f9c1e9448 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-11-30" + #define STRING_DISTRIBUTION_DATE "2023-12-01" #endif /** From e393c7fa0e00264308b66c6a332b60f6fca6cb80 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 30 Nov 2023 20:51:55 -0600 Subject: [PATCH 04/14] =?UTF-8?q?=E2=9C=85=20=20Temporarily=20allow=20PR?= =?UTF-8?q?=20against=202.1.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index abb0d44706d3..2b15067f5156 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -12,7 +12,6 @@ on: - 1.0.x - 1.1.x - 2.0.x - - 2.1.x jobs: bad_target: From c53844ff91b65576f60f8060a296d68d1d25c92a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Dec 2023 04:45:55 -0600 Subject: [PATCH 05/14] =?UTF-8?q?=E2=9C=85=20Temporary=20CI=20Tests=20for?= =?UTF-8?q?=202.1.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 057fa8b75f19..7c62b5af6c54 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -9,6 +9,7 @@ on: pull_request: branches: - bugfix-2.1.x + - 2.1.x paths-ignore: - config/** - data/** @@ -17,6 +18,7 @@ on: push: branches: - bugfix-2.1.x + - 2.1.x paths-ignore: - config/** - data/** From b17d3d3e9c68032d4b7e4ad03a7f65fb9f0fd5d0 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 2 Dec 2023 04:25:57 +1300 Subject: [PATCH 06/14] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20More?= =?UTF-8?q?=20num-to-string=20digits=20/=20precisions=20(#26343)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/lcd/menu/menu_advanced.cpp | 8 +- Marlin/src/lcd/menu/menu_item.h | 9 ++ Marlin/src/libs/numtostr.cpp | 210 ++++++++++++++------------ Marlin/src/libs/numtostr.h | 52 +++++-- 4 files changed, 167 insertions(+), 112 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 90a37ed5199c..1d95961f3b7b 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -371,8 +371,8 @@ void menu_backlash(); #define _MPC_EDIT_ITEMS(N) \ MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].mpc; \ - EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_POWER_E, &mpc.heater_power, 1, 200); \ - EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &mpc.block_heat_capacity, 0, 40); \ + EDIT_ITEM_FAST_N(float41, N, MSG_MPC_POWER_E, &mpc.heater_power, 1, 200); \ + EDIT_ITEM_FAST_N(float31, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &mpc.block_heat_capacity, 0, 40); \ EDIT_ITEM_FAST_N(float43, N, MSG_SENSOR_RESPONSIVENESS_E, &mpc.sensor_responsiveness, 0, 1); \ EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_E, &mpc.ambient_xfer_coeff_fan0, 0, 1) @@ -563,7 +563,7 @@ void menu_backlash(); editable.decimal = stepper.get_shaping_frequency(X_AXIS); if (editable.decimal) { ACTION_ITEM_N(X_AXIS, MSG_SHAPING_DISABLE, []{ stepper.set_shaping_frequency(X_AXIS, 0.0f); }); - EDIT_ITEM_FAST_N(float61, X_AXIS, MSG_SHAPING_FREQ, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(X_AXIS, editable.decimal); }); + EDIT_ITEM_FAST_N(float41, X_AXIS, MSG_SHAPING_FREQ, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(X_AXIS, editable.decimal); }); editable.decimal = stepper.get_shaping_damping_ratio(X_AXIS); EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_SHAPING_ZETA, &editable.decimal, 0.0f, 1.0f, []{ stepper.set_shaping_damping_ratio(X_AXIS, editable.decimal); }); } @@ -574,7 +574,7 @@ void menu_backlash(); editable.decimal = stepper.get_shaping_frequency(Y_AXIS); if (editable.decimal) { ACTION_ITEM_N(Y_AXIS, MSG_SHAPING_DISABLE, []{ stepper.set_shaping_frequency(Y_AXIS, 0.0f); }); - EDIT_ITEM_FAST_N(float61, Y_AXIS, MSG_SHAPING_FREQ, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(Y_AXIS, editable.decimal); }); + EDIT_ITEM_FAST_N(float41, Y_AXIS, MSG_SHAPING_FREQ, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(Y_AXIS, editable.decimal); }); editable.decimal = stepper.get_shaping_damping_ratio(Y_AXIS); EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_SHAPING_ZETA, &editable.decimal, 0.0f, 1.0f, []{ stepper.set_shaping_damping_ratio(Y_AXIS, editable.decimal); }); } diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 4d3e33db4c5a..11f78d25d5da 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -150,10 +150,19 @@ DEFINE_MENU_EDIT_ITEM_TYPE(uint16_5 ,uint16_t ,ui16tostr5rj , 0.01f DEFINE_MENU_EDIT_ITEM_TYPE(float3 ,float ,ftostr3rj , 1 ); // 123 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float42_52 ,float ,ftostr42_52 , 100 , + 0.001f ); // _2.34, 12.34, -2.34 or 123.45, -23.45 DEFINE_MENU_EDIT_ITEM_TYPE(float43 ,float ,ftostr43sign ,1000 , + 0.0001f); // -1.234, _1.234, +1.234 +DEFINE_MENU_EDIT_ITEM_TYPE(float53 ,float ,ftostr53sign ,1000 , + 0.0001f); // -12.345, _2.345, +2.345 +DEFINE_MENU_EDIT_ITEM_TYPE(float54 ,float ,ftostr54sign ,10000 , + 0.00001f); // -1.2345, _1.2345, +1.2345 DEFINE_MENU_EDIT_ITEM_TYPE(float4 ,float ,ftostr4sign , 1 ); // 1234 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float5 ,float ,ftostr5rj , 1 ); // 12345 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float5_25 ,float ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment) +DEFINE_MENU_EDIT_ITEM_TYPE(float31 ,float ,ftostr31rj , 10 , + 0.01f ); // 45.6 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float41 ,float ,ftostr41rj , 10 , + 0.01f ); // 345.6 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float51 ,float ,ftostr51rj , 10 , + 0.01f ); // 1234.5 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float61 ,float ,ftostr61rj , 10 , + 0.01f ); // 12345.6 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float32 ,float ,ftostr32rj , 100 , + 0.001f ); // 1.23 +DEFINE_MENU_EDIT_ITEM_TYPE(float42 ,float ,ftostr42rj , 100 , + 0.001f ); // 12.34 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float52 ,float ,ftostr52rj , 100 , + 0.001f ); // 123.45 right-justified +DEFINE_MENU_EDIT_ITEM_TYPE(float62 ,float ,ftostr62rj , 100 , + 0.001f ); // 1234.56 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float72 ,float ,ftostr72rj , 100 , + 0.001f ); // 12345.67 right-justified DEFINE_MENU_EDIT_ITEM_TYPE(float31sign ,float ,ftostr31sign , 10 , + 0.01f ); // +12.3 DEFINE_MENU_EDIT_ITEM_TYPE(float41sign ,float ,ftostr41sign , 10 , + 0.01f ); // +123.4 diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index e27373263556..3efbf68217e6 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -45,7 +45,7 @@ constexpr long UINTFLOAT(const float V, const int N) { char conv[9] = { 0 }; -// Format uint8_t (0-100) as rj string with 123% / _12% / __1% format +// Format uint8_t (0-100) as rj string with __3% / _23% / 123% format const char* pcttostrpctrj(const uint8_t i) { conv[4] = RJDIGIT(i, 100); conv[5] = RJDIGIT(i, 10); @@ -59,7 +59,7 @@ const char* ui8tostr4pctrj(const uint8_t i) { return pcttostrpctrj(ui8_to_percent(i)); } -// Convert unsigned 8bit int to string 123 format +// Convert unsigned 8bit int to string with __3 / _23 / 123 format const char* ui8tostr3rj(const uint8_t i) { conv[5] = RJDIGIT(i, 100); conv[6] = RJDIGIT(i, 10); @@ -74,7 +74,7 @@ const char* ui8tostr2(const uint8_t i) { return &conv[6]; } -// Convert signed 8bit int to rj string with 123 or -12 format +// Convert signed 8bit int to rj string with __3 / _23 / 123 / -_3 / -23 format const char* i8tostr3rj(const int8_t x) { int xx = x; conv[5] = MINUSOR(xx, RJDIGIT(xx, 100)); @@ -105,32 +105,26 @@ const char* i8tostr3rj(const int8_t x) { } #endif -// Convert unsigned 16bit int to string 12345 format -const char* ui16tostr5rj(const uint16_t xx) { - conv[3] = RJDIGIT(xx, 10000); - conv[4] = RJDIGIT(xx, 1000); - conv[5] = RJDIGIT(xx, 100); - conv[6] = RJDIGIT(xx, 10); +// Convert unsigned 16bit int to right-justified string +inline const char* ui16tostrXrj(const uint16_t xx, const int index) { + switch (index) { + case 0 ... 3: conv[3] = RJDIGIT(xx, 10000); + case 4: conv[4] = RJDIGIT(xx, 1000); + case 5: conv[5] = RJDIGIT(xx, 100); + case 6: conv[6] = RJDIGIT(xx, 10); + } conv[7] = DIGIMOD(xx, 1); - return &conv[3]; + return &conv[index]; } -// Convert unsigned 16bit int to string 1234 format -const char* ui16tostr4rj(const uint16_t xx) { - conv[4] = RJDIGIT(xx, 1000); - conv[5] = RJDIGIT(xx, 100); - conv[6] = RJDIGIT(xx, 10); - conv[7] = DIGIMOD(xx, 1); - return &conv[4]; -} +// Convert unsigned 16bit int to string with 12345 format +const char* ui16tostr5rj(const uint16_t xx) { return ui16tostrXrj(xx, 8 - 5); } -// Convert unsigned 16bit int to string 123 format -const char* ui16tostr3rj(const uint16_t xx) { - conv[5] = RJDIGIT(xx, 100); - conv[6] = RJDIGIT(xx, 10); - conv[7] = DIGIMOD(xx, 1); - return &conv[5]; -} +// Convert unsigned 16bit int to string with 1234 format +const char* ui16tostr4rj(const uint16_t xx) { return ui16tostrXrj(xx, 8 - 4); } + +// Convert unsigned 16bit int to string with 123 format +const char* ui16tostr3rj(const uint16_t xx) { return ui16tostrXrj(xx, 8 - 3); } // Convert signed 16bit int to rj string with 123 or -12 format const char* i16tostr3rj(const int16_t x) { @@ -222,7 +216,7 @@ const char* ftostr41ns(const_float_t f) { return &conv[3]; } -// Convert signed float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format +// Convert float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format const char* ftostr42_52(const_float_t f) { if (f <= -10 || f >= 100) return ftostr52(f); // -23.45 / 123.45 long i = INTFLOAT(f, 2); @@ -234,7 +228,7 @@ const char* ftostr42_52(const_float_t f) { return &conv[3]; } -// Convert signed float to fixed-length string with 023.45 / -23.45 format +// Convert float to fixed-length string with 023.45 / -23.45 format const char* ftostr52(const_float_t f) { long i = INTFLOAT(f, 2); conv[2] = MINUSOR(i, DIGIMOD(i, 10000)); @@ -246,7 +240,7 @@ const char* ftostr52(const_float_t f) { return &conv[2]; } -// Convert signed float to fixed-length string with 12.345 / _2.345 / -2.345 or -23.45 / 123.45 format +// Convert float to fixed-length string with 12.345 / _2.345 / -2.345 or -23.45 / 123.45 format const char* ftostr53_63(const_float_t f) { if (f <= -10 || f >= 100) return ftostr63(f); // -23.456 / 123.456 long i = INTFLOAT(f, 3); @@ -259,7 +253,7 @@ const char* ftostr53_63(const_float_t f) { return &conv[2]; } -// Convert signed float to fixed-length string with 023.456 / -23.456 format +// Convert float to fixed-length string with 023.456 / -23.456 format const char* ftostr63(const_float_t f) { long i = INTFLOAT(f, 3); conv[1] = MINUSOR(i, DIGIMOD(i, 100000)); @@ -289,42 +283,58 @@ const char* ftostr63(const_float_t f) { #endif -// Convert float to fixed-length string with +12.3 / -12.3 format -const char* ftostr31sign(const_float_t f) { - int i = INTFLOAT(f, 1); - conv[3] = MINUSOR(i, '+'); - conv[4] = DIGIMOD(i, 100); +// +// Convert float to fixed-length string with +/- and a single decimal place +// +inline const char* ftostrX1sign(const_float_t f, const int index) { + long i = INTFLOAT(f, 1); + conv[index] = MINUSOR(i, '+'); + switch (index + 1) { + case 1: conv[1] = DIGIMOD(i, 100000); + case 2: conv[2] = DIGIMOD(i, 10000); + case 3: conv[3] = DIGIMOD(i, 1000); + case 4: conv[4] = DIGIMOD(i, 100); + } conv[5] = DIGIMOD(i, 10); conv[6] = '.'; conv[7] = DIGIMOD(i, 1); - return &conv[3]; + return &conv[index]; } +// Convert float to fixed-length string with +12.3 / -12.3 format +const char* ftostr31sign(const_float_t f) { return ftostrX1sign(f, 3); } + // Convert float to fixed-length string with +123.4 / -123.4 format -const char* ftostr41sign(const_float_t f) { - int i = INTFLOAT(f, 1); - conv[2] = MINUSOR(i, '+'); - conv[3] = DIGIMOD(i, 1000); - conv[4] = DIGIMOD(i, 100); - conv[5] = DIGIMOD(i, 10); - conv[6] = '.'; - conv[7] = DIGIMOD(i, 1); - return &conv[2]; -} +const char* ftostr41sign(const_float_t f) { return ftostrX1sign(f, 2); } -// Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format -const char* ftostr43sign(const_float_t f, char plus/*=' '*/) { - long i = INTFLOAT(f, 3); - conv[2] = i ? MINUSOR(i, plus) : ' '; +// Convert float to fixed-length string with +1234.5 / +1234.5 format +const char* ftostr51sign(const_float_t f) { return ftostrX1sign(f, 1); } + +// +// Convert float to string with +/ /- and 3 decimal places +// +inline const char* ftostrX3sign(const_float_t f, const int index, char plus/*=' '*/) { + long i = INTFLOAT(f, 1); + conv[index] = i ? MINUSOR(i, plus) : ' '; + switch (index + 1) { + case 1: conv[1] = DIGIMOD(i, 100000); + case 2: conv[2] = DIGIMOD(i, 10000); + } conv[3] = DIGIMOD(i, 1000); conv[4] = '.'; conv[5] = DIGIMOD(i, 100); conv[6] = DIGIMOD(i, 10); conv[7] = DIGIMOD(i, 1); - return &conv[2]; + return &conv[index]; } -// Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format +// Convert float to string (6 chars) with -1.234 / _0.000 / +1.234 format +const char* ftostr43sign(const_float_t f, char plus/*=' '*/) { return ftostrX3sign(f, 2, plus); } + +// Convert float to string (7 chars) with -12.345 / _00.000 / +12.345 format +const char* ftostr53sign(const_float_t f, char plus/*=' '*/) { return ftostrX3sign(f, 1, plus); } + +// Convert float to string (7 chars) with -1.2345 / _0.0000 / +1.2345 format const char* ftostr54sign(const_float_t f, char plus/*=' '*/) { long i = INTFLOAT(f, 4); conv[1] = i ? MINUSOR(i, plus) : ' '; @@ -343,19 +353,6 @@ const char* ftostr5rj(const_float_t f) { return ui16tostr5rj(i); } -// Convert signed float to string with +1234.5 format -const char* ftostr51sign(const_float_t f) { - long i = INTFLOAT(f, 1); - conv[1] = MINUSOR(i, '+'); - conv[2] = DIGIMOD(i, 10000); - conv[3] = DIGIMOD(i, 1000); - conv[4] = DIGIMOD(i, 100); - conv[5] = DIGIMOD(i, 10); - conv[6] = '.'; - conv[7] = DIGIMOD(i, 1); - return &conv[1]; -} - // Convert signed float to string with +123.45 format const char* ftostr52sign(const_float_t f) { long i = INTFLOAT(f, 2); @@ -369,47 +366,66 @@ const char* ftostr52sign(const_float_t f) { return &conv[1]; } -// Convert signed float to string with +12.345 format -const char* ftostr53sign(const_float_t f) { - long i = INTFLOAT(f, 3); - conv[1] = MINUSOR(i, '+'); - conv[2] = DIGIMOD(i, 10000); - conv[3] = DIGIMOD(i, 1000); - conv[4] = '.'; - conv[5] = DIGIMOD(i, 100); - conv[6] = DIGIMOD(i, 10); - conv[7] = DIGIMOD(i, 1); - return &conv[1]; -} - -// Convert unsigned float to string with ____5.6, ___45.6, __345.6, _2345.6, 12345.6 format -const char* ftostr61rj(const_float_t f) { +// Convert unsigned float to string with a single digit precision +inline const char* ftostrX1rj(const_float_t f, const int index=1) { const long i = UINTFLOAT(f, 1); - conv[1] = RJDIGIT(i, 100000); - conv[2] = RJDIGIT(i, 10000); - conv[3] = RJDIGIT(i, 1000); - conv[4] = RJDIGIT(i, 100); + switch (index) { + case 0: conv[0] = RJDIGIT(i, 1000000); + case 1: conv[1] = RJDIGIT(i, 100000); + case 2: conv[2] = RJDIGIT(i, 10000); + case 3: conv[3] = RJDIGIT(i, 1000); + case 4: conv[4] = RJDIGIT(i, 100); + } conv[5] = DIGIMOD(i, 10); conv[6] = '.'; conv[7] = DIGIMOD(i, 1); - return &conv[1]; + return &conv[index]; } -// Convert unsigned float to string with ____5.67, ___45.67, __345.67, _2345.67, 12345.67 format -const char* ftostr72rj(const_float_t f) { +// Convert unsigned float to string with _2.3 / 12.3 format +const char* ftostr31rj(const_float_t f) { return ftostrX1rj(f, 7 - 3); } + +// Convert unsigned float to string with __3.4 / _23.4 / 123.4 format +const char* ftostr41rj(const_float_t f) { return ftostrX1rj(f, 7 - 4); } + +// Convert unsigned float to string with ___4.5 / __34.5 / _234.5 / 1234.5 format +const char* ftostr51rj(const_float_t f) { return ftostrX1rj(f, 7 - 5); } + +// Convert unsigned float to string with ____5.6 / ___45.6 / __345.6 / _2345.6 / 12345.6 format +const char* ftostr61rj(const_float_t f) { return ftostrX1rj(f, 7 - 6); } + +// Convert unsigned float to string with two digit precision +inline const char* ftostrX2rj(const_float_t f, const int index=1) { const long i = UINTFLOAT(f, 2); - conv[0] = RJDIGIT(i, 1000000); - conv[1] = RJDIGIT(i, 100000); - conv[2] = RJDIGIT(i, 10000); - conv[3] = RJDIGIT(i, 1000); - conv[4] = DIGIMOD(i, 100); + switch (index) { + case 0: conv[0] = RJDIGIT(i, 1000000); + case 1: conv[1] = RJDIGIT(i, 100000); + case 2: conv[2] = RJDIGIT(i, 10000); + case 3: conv[3] = RJDIGIT(i, 1000); + case 4: conv[4] = RJDIGIT(i, 100); + } conv[5] = '.'; conv[6] = DIGIMOD(i, 10); conv[7] = DIGIMOD(i, 1); - return conv; + return &conv[index]; } -// Convert signed float to space-padded string with -_23.4_ format +// Convert unsigned float to string with 1.23 format +const char* ftostr32rj(const_float_t f) { return ftostrX2rj(f, 4); } + +// Convert unsigned float to string with _2.34, 12.34 format +const char* ftostr42rj(const_float_t f) { return ftostrX2rj(f, 3); } + +// Convert unsigned float to string with __3.45, _23.45, 123.45 format +const char* ftostr52rj(const_float_t f) { return ftostrX2rj(f, 2); } + +// Convert unsigned float to string with ___4.56, __34.56, _234.56, 1234.56 format +const char* ftostr62rj(const_float_t f) { return ftostrX2rj(f, 1); } + +// Convert unsigned float to string with ____5.67, ___45.67, __345.67, _2345.67, 12345.67 format +const char* ftostr72rj(const_float_t f) { return ftostrX2rj(f, 0); } + +// Convert float to space-padded string with -_23.4_ format const char* ftostr52sp(const_float_t f) { long i = INTFLOAT(f, 2); uint8_t dig; @@ -418,17 +434,17 @@ const char* ftostr52sp(const_float_t f) { conv[3] = RJDIGIT(i, 1000); conv[4] = DIGIMOD(i, 100); - if ((dig = i % 10)) { // second digit after decimal point? + if ((dig = i % 10)) { // Second digit after decimal point? conv[5] = '.'; conv[6] = DIGIMOD(i, 10); conv[7] = DIGIT(dig); } else { - if ((dig = (i / 10) % 10)) { // first digit after decimal point? + if ((dig = (i / 10) % 10)) { // First digit after decimal point? conv[5] = '.'; conv[6] = DIGIT(dig); } - else // nothing after decimal point + else // Nothing after decimal point conv[5] = conv[6] = ' '; conv[7] = ' '; } @@ -440,7 +456,7 @@ const char* utostr3(const uint16_t x) { return i16tostr3left(_MIN(x, 999U)); } -// Convert signed float to space-padded string with 1.23, 12.34, 123.45 format +// Convert float to space-padded string with 1.23, 12.34, 123.45 format const char* ftostr52sprj(const_float_t f) { long i = INTFLOAT(f, 2); LIMIT(i, -99999, 99999); // cap to -999.99 - 999.99 range diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index f8af09ebeeca..fde07e836846 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -40,7 +40,7 @@ const char* ui8tostr3rj(const uint8_t i); const char* i8tostr3rj(const int8_t x); #if HAS_PRINT_PROGRESS_PERMYRIAD - // Convert 16-bit unsigned permyriad value to percent: 100 / 23 / 23.4 / 3.45 + // Convert 16-bit unsigned permyriad value to percent: _100 / __23 / 23.4 / 3.45 const char* permyriadtostr4(const uint16_t xx); #endif @@ -86,22 +86,34 @@ const char* ftostr53_63(const_float_t x); // Convert signed float to fixed-length string with 023.456 / -23.456 format const char* ftostr63(const_float_t x); -// Convert float to fixed-length string with +12.3 / -12.3 format +// Convert signed float to fixed-length string with +12.3 / -12.3 format const char* ftostr31sign(const_float_t x); -// Convert float to fixed-length string with +123.4 / -123.4 format +// Convert signed float to fixed-length string with +123.4 / -123.4 format const char* ftostr41sign(const_float_t x); +// Convert signed float to fixed-length string with +1234.5 / +1234.5 format +const char* ftostr51sign(const_float_t x); + // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format const char* ftostr43sign(const_float_t x, char plus=' '); +// Convert signed float to string (7 chars) with -12.345 / _00.000 / +12.345 format +const char* ftostr53sign(const_float_t x, char plus=' '); + // Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format const char* ftostr54sign(const_float_t x, char plus=' '); // Convert unsigned float to rj string with 12345 format const char* ftostr5rj(const_float_t x); -// Convert signed float to string with +1234.5 format +// Convert signed float to fixed-length string with +12.3 / -12.3 format +const char* ftostr31sign(const_float_t x); + +// Convert signed float to fixed-length string with +123.4 / -123.4 format +const char* ftostr41sign(const_float_t x); + +// Convert signed float to fixed-length string with +1234.5 format const char* ftostr51sign(const_float_t x); // Convert signed float to space-padded string with -_23.4_ format @@ -110,23 +122,41 @@ const char* ftostr52sp(const_float_t x); // Convert signed float to string with +123.45 format const char* ftostr52sign(const_float_t x); -// Convert signed float to string with +12.345 format -const char* ftostr53sign(const_float_t f); +// Convert unsigned float to string with _2.3 / 12.3 format +const char* ftostr31rj(const_float_t x); -// Convert unsigned float to string with 12345.6 format omitting trailing zeros +// Convert unsigned float to string with __3.4 / _23.4 / 123.4 format +const char* ftostr41rj(const_float_t x); + +// Convert unsigned float to string with ___4.5 / __34.5 / _234.5 / 1234.5 format +const char* ftostr51rj(const_float_t x); + +// Convert unsigned float to string with ____5.6 / ___45.6 / __345.6 / _2345.6 / 12345.6 format const char* ftostr61rj(const_float_t x); -// Convert unsigned float to string with 12345.67 format omitting trailing zeros +// Convert unsigned float to string with 1.23 format +const char* ftostr32rj(const_float_t f); + +// Convert unsigned float to string with _2.34, 12.34 format +const char* ftostr42rj(const_float_t f); + +// Convert unsigned float to string with __3.45, _23.45, 123.45 format +const char* ftostr52rj(const_float_t f); + +// Convert unsigned float to string with ___4.56, __34.56, _234.56, 1234.56 format +const char* ftostr62rj(const_float_t f); + +// Convert unsigned float to string with ____5.67, ___45.67, __345.67, _2345.67, 12345.67 format const char* ftostr72rj(const_float_t x); -// Convert float to rj string with 123 or -12 format +// Convert signed float to rj string with 123 or -12 format FORCE_INLINE const char* ftostr3rj(const_float_t x) { return i16tostr3rj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } #if ENABLED(LCD_DECIMAL_SMALL_XY) - // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format + // Convert signed float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format const char* ftostr4sign(const_float_t fx); #else - // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format + // Convert signed float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format FORCE_INLINE const char* ftostr4sign(const_float_t x) { return i16tostr4signrj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } #endif From f265fb59436e91369461efd8b5a6bf92aa0b3a96 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 2 Dec 2023 00:20:23 +0000 Subject: [PATCH 07/14] [cron] Bump distribution date (2023-12-02) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 96bcec0bbc7c..9a6ae222137d 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -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-12-01" +//#define STRING_DISTRIBUTION_DATE "2023-12-02" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a91f9c1e9448..2d0e81227797 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-12-01" + #define STRING_DISTRIBUTION_DATE "2023-12-02" #endif /** From c484228c56f031b2bf44ea2194b0a84b47e2ae98 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Fri, 1 Dec 2023 22:18:24 -0500 Subject: [PATCH 08/14] =?UTF-8?q?=E2=9C=85=20Fix=20some=20action=20labels?= =?UTF-8?q?=20(#26490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Co-authored-by: Scott Lahteine --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/workflows/auto-label.yml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 56060f0a4801..e0ee13af0778 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,7 +1,7 @@ name: 🪲 Report a bug description: Create a bug report to help improve Marlin Firmware title: "[BUG] (bug summary)" -labels: 'Bug: Potential ?' +labels: ["Bug: Potential ?"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index b64383cd48b2..2e8607142ca8 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,7 +1,7 @@ name: ✨ Request a feature description: Request a new Marlin Firmware feature title: "[FR] (feature summary)" -labels: 'T: Feature Request' +labels: ["T: Feature Request"] body: - type: markdown attributes: diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml index f3a752da3d45..2ed486bb8c9c 100644 --- a/.github/workflows/auto-label.yml +++ b/.github/workflows/auto-label.yml @@ -4,6 +4,8 @@ # - Apply the label "Bug: Potential ?" to these issues. # +name: Label Old Bugs + on: schedule: - cron: "30 8 * * *" From bd6eb832500478c9e3be55f1126d0139aa013bb0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 1 Dec 2023 09:19:13 -0600 Subject: [PATCH 09/14] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20some=20minor=20issue?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/HAL.cpp | 2 +- Marlin/src/HAL/SAMD51/HAL.cpp | 59 +++++++++---------- Marlin/src/HAL/STM32F1/HAL.cpp | 4 +- Marlin/src/HAL/STM32F1/HAL.h | 2 - Marlin/src/HAL/STM32F1/onboard_sd.cpp | 3 - Marlin/src/inc/Conditionals_adv.h | 2 +- Marlin/src/inc/Warnings.cpp | 2 +- Marlin/src/lcd/e3v2/common/encoder.h | 2 +- Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp | 2 +- .../dgus_reloaded/dgus_reloaded_extui.cpp | 2 +- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V521.h | 2 +- Marlin/src/pins/stm32f4/pins_TRONXY_V10.h | 2 +- .../sublime/MarlinFirmware.sublime-project | 3 +- ini/stm32f1-maple.ini | 2 - 15 files changed, 42 insertions(+), 49 deletions(-) diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 27f6516f9ae8..4890972b0193 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -175,7 +175,7 @@ uint8_t MarlinHAL::get_reset_source() { return rtc_get_reset_reason(1); } void MarlinHAL::reboot() { ESP.restart(); } -void _delay_ms(int delay_ms) { delay(delay_ms); } +void _delay_ms(const int ms) { delay(ms); } // return free memory between end of heap (or end bss) and whatever is current int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); } diff --git a/Marlin/src/HAL/SAMD51/HAL.cpp b/Marlin/src/HAL/SAMD51/HAL.cpp index beace8126cbf..a3c871ce516a 100644 --- a/Marlin/src/HAL/SAMD51/HAL.cpp +++ b/Marlin/src/HAL/SAMD51/HAL.cpp @@ -47,27 +47,27 @@ #endif #endif -#define GET_TEMP_0_ADC() TERN(HAS_TEMP_ADC_0, PIN_TO_ADC(TEMP_0_PIN), -1) -#define GET_TEMP_1_ADC() TERN(HAS_TEMP_ADC_1, PIN_TO_ADC(TEMP_1_PIN), -1) -#define GET_TEMP_2_ADC() TERN(HAS_TEMP_ADC_2, PIN_TO_ADC(TEMP_2_PIN), -1) -#define GET_TEMP_3_ADC() TERN(HAS_TEMP_ADC_3, PIN_TO_ADC(TEMP_3_PIN), -1) -#define GET_TEMP_4_ADC() TERN(HAS_TEMP_ADC_4, PIN_TO_ADC(TEMP_4_PIN), -1) -#define GET_TEMP_5_ADC() TERN(HAS_TEMP_ADC_5, PIN_TO_ADC(TEMP_5_PIN), -1) -#define GET_TEMP_6_ADC() TERN(HAS_TEMP_ADC_6, PIN_TO_ADC(TEMP_6_PIN), -1) -#define GET_TEMP_7_ADC() TERN(HAS_TEMP_ADC_7, PIN_TO_ADC(TEMP_7_PIN), -1) -#define GET_BED_ADC() TERN(HAS_TEMP_ADC_BED, PIN_TO_ADC(TEMP_BED_PIN), -1) -#define GET_CHAMBER_ADC() TERN(HAS_TEMP_ADC_CHAMBER, PIN_TO_ADC(TEMP_CHAMBER_PIN), -1) -#define GET_PROBE_ADC() TERN(HAS_TEMP_ADC_PROBE, PIN_TO_ADC(TEMP_PROBE_PIN), -1) -#define GET_COOLER_ADC() TERN(HAS_TEMP_ADC_COOLER, PIN_TO_ADC(TEMP_COOLER_PIN), -1) -#define GET_BOARD_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1) -#define GET_SOC_ADC() TERN(HAS_TEMP_ADC_SOC, PIN_TO_ADC(TEMP_SOC_PIN), -1) -#define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1) -#define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1) -#define GET_JOY_ADC_X() TERN(HAS_JOY_ADC_X, PIN_TO_ADC(JOY_X_PIN), -1) -#define GET_JOY_ADC_Y() TERN(HAS_JOY_ADC_Y, PIN_TO_ADC(JOY_Y_PIN), -1) -#define GET_JOY_ADC_Z() TERN(HAS_JOY_ADC_Z, PIN_TO_ADC(JOY_Z_PIN), -1) -#define GET_POWERMON_ADC_CURRENT() TERN(POWER_MONITOR_CURRENT, PIN_TO_ADC(POWER_MONITOR_CURRENT_PIN), -1) -#define GET_POWERMON_ADC_VOLTS() TERN(POWER_MONITOR_VOLTAGE, PIN_TO_ADC(POWER_MONITOR_VOLTAGE_PIN), -1) +#define GET_TEMP_0_ADC() TERN(HAS_TEMP_ADC_0, PIN_TO_ADC(TEMP_0_PIN), -1) +#define GET_TEMP_1_ADC() TERN(HAS_TEMP_ADC_1, PIN_TO_ADC(TEMP_1_PIN), -1) +#define GET_TEMP_2_ADC() TERN(HAS_TEMP_ADC_2, PIN_TO_ADC(TEMP_2_PIN), -1) +#define GET_TEMP_3_ADC() TERN(HAS_TEMP_ADC_3, PIN_TO_ADC(TEMP_3_PIN), -1) +#define GET_TEMP_4_ADC() TERN(HAS_TEMP_ADC_4, PIN_TO_ADC(TEMP_4_PIN), -1) +#define GET_TEMP_5_ADC() TERN(HAS_TEMP_ADC_5, PIN_TO_ADC(TEMP_5_PIN), -1) +#define GET_TEMP_6_ADC() TERN(HAS_TEMP_ADC_6, PIN_TO_ADC(TEMP_6_PIN), -1) +#define GET_TEMP_7_ADC() TERN(HAS_TEMP_ADC_7, PIN_TO_ADC(TEMP_7_PIN), -1) +#define GET_BED_ADC() TERN(HAS_TEMP_ADC_BED, PIN_TO_ADC(TEMP_BED_PIN), -1) +#define GET_CHAMBER_ADC() TERN(HAS_TEMP_ADC_CHAMBER, PIN_TO_ADC(TEMP_CHAMBER_PIN), -1) +#define GET_PROBE_ADC() TERN(HAS_TEMP_ADC_PROBE, PIN_TO_ADC(TEMP_PROBE_PIN), -1) +#define GET_COOLER_ADC() TERN(HAS_TEMP_ADC_COOLER, PIN_TO_ADC(TEMP_COOLER_PIN), -1) +#define GET_BOARD_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1) +#define GET_SOC_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1) +#define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1) +#define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1) +#define GET_JOY_ADC_X() TERN(HAS_JOY_ADC_X, PIN_TO_ADC(JOY_X_PIN), -1) +#define GET_JOY_ADC_Y() TERN(HAS_JOY_ADC_Y, PIN_TO_ADC(JOY_Y_PIN), -1) +#define GET_JOY_ADC_Z() TERN(HAS_JOY_ADC_Z, PIN_TO_ADC(JOY_Z_PIN), -1) +#define GET_POWERMON_ADC_CURRENT() TERN(POWER_MONITOR_CURRENT, PIN_TO_ADC(POWER_MONITOR_CURRENT_PIN), -1) +#define GET_POWERMON_ADC_VOLTS() TERN(POWER_MONITOR_VOLTAGE, PIN_TO_ADC(POWER_MONITOR_VOLTAGE_PIN), -1) #define IS_ADC_REQUIRED(n) ( \ GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n || GET_TEMP_3_ADC() == n \ @@ -162,10 +162,10 @@ enum ADCIndex { POWERMON_CURRENT, #endif #if GET_POWERMON_ADC_VOLTS() == 0 - POWERMON_VOLTS, + POWERMON_VOLTAGE, #endif - // Use later indexes for ADC index 1 + // Indexes for ADC1 after those for ADC0 #if GET_TEMP_0_ADC() == 1 TEMP_0, @@ -228,9 +228,8 @@ enum ADCIndex { POWERMON_CURRENT, #endif #if GET_POWERMON_ADC_VOLTS() == 1 - POWERMON_VOLTS, + POWERMON_VOLTAGE, #endif - ADC_COUNT }; @@ -351,10 +350,10 @@ enum ADCIndex { POWER_MONITOR_CURRENT_PIN, #endif #if GET_POWERMON_ADC_VOLTS() == 0 - POWER_MONITOR_VOLTS_PIN, + POWER_MONITOR_VOLTAGE_PIN, #endif - // ADC1 pins + // Pins for ADC1 after ADC0 #if GET_TEMP_0_ADC() == 1 TEMP_0_PIN, @@ -417,7 +416,7 @@ enum ADCIndex { POWER_MONITOR_CURRENT_PIN, #endif #if GET_POWERMON_ADC_VOLTS() == 1 - POWER_MONITOR_VOLTS_PIN, + POWER_MONITOR_VOLTAGE_PIN, #endif }; @@ -488,7 +487,7 @@ enum ADCIndex { { PIN_TO_INPUTCTRL(POWER_MONITOR_CURRENT_PIN) }, #endif #if GET_POWERMON_ADC_VOLTS() == 0 - { PIN_TO_INPUTCTRL(POWER_MONITOR_VOLTS_PIN) }, + { PIN_TO_INPUTCTRL(POWER_MONITOR_VOLTAGE_PIN) }, #endif }; @@ -560,7 +559,7 @@ enum ADCIndex { { PIN_TO_INPUTCTRL(POWER_MONITOR_CURRENT_PIN) }, #endif #if GET_POWERMON_ADC_VOLTS() == 1 - { PIN_TO_INPUTCTRL(POWER_MONITOR_VOLTS_PIN) }, + { PIN_TO_INPUTCTRL(POWER_MONITOR_VOLTAGE_PIN) }, #endif }; diff --git a/Marlin/src/HAL/STM32F1/HAL.cpp b/Marlin/src/HAL/STM32F1/HAL.cpp index a83c3a23bf7d..376778a2b3b2 100644 --- a/Marlin/src/HAL/STM32F1/HAL.cpp +++ b/Marlin/src/HAL/STM32F1/HAL.cpp @@ -313,7 +313,7 @@ enum ADCIndex : uint8_t { OPTITEM(HAS_JOY_ADC_Y, JOY_Y) OPTITEM(HAS_JOY_ADC_Z, JOY_Z) OPTITEM(POWER_MONITOR_CURRENT, POWERMON_CURRENT) - OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTS) + OPTITEM(POWER_MONITOR_VOLTAGE, POWERMON_VOLTAGE) ADC_COUNT }; @@ -381,7 +381,7 @@ void MarlinHAL::adc_start(const pin_t pin) { _TCASE(FILAMENT_WIDTH_SENSOR, FILWIDTH_PIN, FILWIDTH) _TCASE(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN, ADC_KEY) _TCASE(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN, POWERMON_CURRENT) - _TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTS) + _TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTAGE) } adc_result = (adc_results[(int)pin_index] & 0xFFF) >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits } diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index c4b90db68a19..52d3b805e611 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -221,8 +221,6 @@ void flashFirmware(const int16_t); // Memory related #define __bss_end __bss_end__ -void _delay_ms(const int ms); - extern "C" char* _sbrk(int incr); #pragma GCC diagnostic push diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.cpp b/Marlin/src/HAL/STM32F1/onboard_sd.cpp index df5549217d98..a3d8dcb2d57e 100644 --- a/Marlin/src/HAL/STM32F1/onboard_sd.cpp +++ b/Marlin/src/HAL/STM32F1/onboard_sd.cpp @@ -5,9 +5,6 @@ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] * Copyright (C) 2015, ChaN, all right reserved. * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * * This software is a free software and there is NO WARRANTY. * No restriction on use. You can use, modify and redistribute it for * personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY. diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 634652c9bf99..44a87dbb1a0d 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1256,7 +1256,7 @@ * currently HAL.h must be included ahead of pins.h. */ #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, AQUILA_V101) + #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_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, AQUILA_V101) #define LCD_SERIAL_PORT 1 #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO) #define LCD_SERIAL_PORT 2 diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 26ecfbf533a5..606d308c08cf 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -707,7 +707,7 @@ /** * Maple environment */ -#ifdef __STM32F1__ +#if defined(__STM32F1__) && DISABLED(NO_MAPLE_WARNING) #warning "Maple build environments are deprecated. Please use a non-Maple build environment. Report issues to the Marlin Firmware project." #endif diff --git a/Marlin/src/lcd/e3v2/common/encoder.h b/Marlin/src/lcd/e3v2/common/encoder.h index 72d37108dcf2..ce431c9811b1 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.h +++ b/Marlin/src/lcd/e3v2/common/encoder.h @@ -45,7 +45,7 @@ typedef enum { ENCODER_DIFF_ENTER = 3 // click } EncoderState; -#define ENCODER_WAIT_MS 20 +#define ENCODER_WAIT_MS TERN(DWIN_LCD_PROUI, 10, 20) // Encoder initialization void encoderConfiguration(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index 853da8532e12..7c71b8fc5974 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -127,7 +127,7 @@ void dwinWriteToMem(uint8_t mem, uint16_t addr, uint16_t length, uint8_t *data) dwinWord(i, addr + indx); // start address of the data block ++i; for (uint8_t j = 0; j < i; ++j) { LCD_SERIAL.write(dwinSendBuf[j]); delayMicroseconds(1); } // Buf header - for (uint16_t j = indx; j <= indx + to_send - 1; j++) LCD_SERIAL.write(*(data + j)); delayMicroseconds(1); // write block of data + for (uint16_t j = indx; j <= indx + to_send - 1; j++) { LCD_SERIAL.write(*(data + j)); delayMicroseconds(1); } // write block of data for (uint8_t j = 0; j < 4; ++j) { LCD_SERIAL.write(dwinBufTail[j]); delayMicroseconds(1); } block++; pending -= to_send; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index 3434bdf8c366..68e405776e9d 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -21,7 +21,7 @@ */ /** - * lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp + * lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index f4d5a269af69..9fb9813ee504 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -138,7 +138,7 @@ // void _lcd_level_bed_moving() { if (ui.should_draw()) { - MString<9> msg; + MString<10> msg; msg.setf(F(" %i / %u"), int(manual_probe_index + 1), total_probe_points); MenuItem_static::draw(LCD_HEIGHT / 2, GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), SS_CENTER, msg); } diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V521.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V521.h index d555c0aaa12d..2660b6e50518 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V521.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V521.h @@ -135,7 +135,7 @@ #define FAN0_PIN PB14 // FAN #define FAN1_PIN PB12 // FAN -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // SD Card diff --git a/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h b/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h index e9e069583afe..97580bf618f9 100644 --- a/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h +++ b/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h @@ -157,7 +157,7 @@ #define FAN2_PIN PG9 // FAN2 #define FAN3_PIN PF10 // FAN3 #define CONTROLLER_FAN_PIN PD7 // BOARD FAN -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Laser / Spindle diff --git a/buildroot/share/sublime/MarlinFirmware.sublime-project b/buildroot/share/sublime/MarlinFirmware.sublime-project index 11808dd45df0..62607ac0c6d1 100644 --- a/buildroot/share/sublime/MarlinFirmware.sublime-project +++ b/buildroot/share/sublime/MarlinFirmware.sublime-project @@ -30,6 +30,7 @@ "ensure_newline_at_eof_on_save": true, "tab_size": 2, "translate_tabs_to_spaces": true, - "trim_trailing_white_space_on_save": true + "trim_trailing_white_space_on_save": true, + "uncrustify_config" : "${project_dir}/../extras/uncrustify.cfg" } } diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index 34025a8a38b2..4c4d938fe6df 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -399,8 +399,6 @@ build_flags = ${STM32F1_maple.build_flags} -DTEMP_TIMER_CHAN=4 board_build.address = 0x08007000 board_build.ldscript = sovol.ld board_build.rename = firmware-{date}-{time}.bin -extra_scripts = ${STM32F1_maple.extra_scripts} - buildroot/share/PlatformIO/scripts/custom_board.py debug_tool = jlink upload_protocol = jlink From e695c473afb0a1546951d5759e50d03a595b99a1 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 3 Dec 2023 00:23:05 +0000 Subject: [PATCH 10/14] [cron] Bump distribution date (2023-12-03) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 9a6ae222137d..d39b2ec0acbf 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -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-12-02" +//#define STRING_DISTRIBUTION_DATE "2023-12-03" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 2d0e81227797..8f29b3772622 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-12-02" + #define STRING_DISTRIBUTION_DATE "2023-12-03" #endif /** From 1a42c38e0eefdf62976bf7a5a35224d3c675f9ff Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 2 Dec 2023 22:03:46 -0800 Subject: [PATCH 11/14] =?UTF-8?q?=F0=9F=A9=B9=20Replace=20more=20DEBUG=5FE?= =?UTF-8?q?CHOF=20(#26495)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #25928 --- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/module/endstops.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index ba16c7bbd7e2..dbdbdc5affee 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -263,7 +263,7 @@ void GcodeSuite::G28() { #if ENABLED(DEBUG_LEVELING_FEATURE) auto debug_current = [](FSTR_P const s, const int16_t a, const int16_t b) { - if (DEBUGGING(LEVELING)) { DEBUG_ECHOF(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); } + if (DEBUGGING(LEVELING)) { DEBUG_ECHOLN(s, F(" current: "), a, F(" -> "), b); } }; #else #define debug_current(...) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 0f060f572048..9c6a3c011cca 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -1360,7 +1360,7 @@ void Endstops::update() { #if ENABLED(DEBUG_LEVELING_FEATURE) auto debug_current = [](FSTR_P const s, const int16_t a, const int16_t b) { - if (DEBUGGING(LEVELING)) { DEBUG_ECHOF(s); DEBUG_ECHOLNPGM(" current: ", a, " -> ", b); } + if (DEBUGGING(LEVELING)) { DEBUG_ECHOLN(s, F(" current: "), a, F(" -> "), b); } }; #else #define debug_current(...) From dde878db049357199bd14be1b36564b80244ca8b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Dec 2023 00:32:28 -0600 Subject: [PATCH 12/14] =?UTF-8?q?=E2=9C=85=20Use=20actions/github-script@v?= =?UTF-8?q?7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml index 2ed486bb8c9c..c3cbb3b21028 100644 --- a/.github/workflows/auto-label.yml +++ b/.github/workflows/auto-label.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Auto Label for [BUG] - uses: actions/github-script@v5 + uses: actions/github-script@v7 with: script: | # Get all open issues in this repository From 1c1c4739105790c31424810aedfca8c526bcce12 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Dec 2023 01:22:14 -0600 Subject: [PATCH 13/14] =?UTF-8?q?=E2=9C=85=20Fix=20auto-label=20action=20c?= =?UTF-8?q?omments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-label.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml index c3cbb3b21028..c69e6c4fade9 100644 --- a/.github/workflows/auto-label.yml +++ b/.github/workflows/auto-label.yml @@ -20,21 +20,18 @@ jobs: uses: actions/github-script@v7 with: script: | - # Get all open issues in this repository + // Get all open issues in this repository const issueList = await github.rest.issues.listForRepo({ owner: context.repo.owner, repo: context.repo.repo, state: 'open' }); - # Filter the list of issues to only those that don't have any labels - # and have a title that contains '[BUG]'. Only the first 50 issues. + // Filter issues without labels that have a title containing '[BUG]'. const matchingIssues = issueList.data.filter( issue => issue.title.includes('[BUG]') && issue.labels.length === 0 ); - # Process the first 50 + // Process the first 50 for (const issue of matchingIssues.slice(0, 50)) { - // Run the desired action on the issue - // For example, to add a label: await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, From 0d4f41fb6dfd1a4f5efde4bb2d5a66b3543462de Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 4 Dec 2023 00:22:06 +0000 Subject: [PATCH 14/14] [cron] Bump distribution date (2023-12-04) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index d39b2ec0acbf..67d8329c38a3 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -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-12-03" +//#define STRING_DISTRIBUTION_DATE "2023-12-04" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 8f29b3772622..00848ef9e115 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-12-03" + #define STRING_DISTRIBUTION_DATE "2023-12-04" #endif /**