Skip to content

Commit

Permalink
*sync with upstream repo
Browse files Browse the repository at this point in the history
  • Loading branch information
moonglow committed Feb 28, 2022
1 parent b152eef commit 27defcb
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 70 deletions.
20 changes: 11 additions & 9 deletions Marlin/.github/workflows/bump-date.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Bump Distribution Date

on:
schedule:
- cron: '0 0 * * *'
- cron: '0 */6 * * *'

jobs:
bump_date:
Expand All @@ -26,11 +26,13 @@ jobs:
- name: Bump Distribution Date
run: |
# Inline Bump Script
DIST=$( date +"%Y-%m-%d" )
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \
git config user.name "${GITHUB_ACTOR}" && \
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
git add . && \
git commit -m "[cron] Bump distribution date ($DIST)" && \
git push
if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then
DIST=$( date +"%Y-%m-%d" )
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \
git config user.name "${GITHUB_ACTOR}" && \
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
git add . && \
git commit -m "[cron] Bump distribution date ($DIST)" && \
git push
fi
3 changes: 3 additions & 0 deletions Marlin/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"recommendations": [
"marlinfirmware.auto-build",
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
14 changes: 9 additions & 5 deletions Marlin/Marlin/BedLevelingScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,24 @@
"G90\n"\
"M117 Bed leveling started\n"\
"G28\n"\
"G1 X-5.3 Y-71.1 Z10 F3000\n"\
"G1 Z10 F800\n"\
"G1 X-5.3 Y-71.1 F3000\n"\
"G1 Z0 F800\n"\
"M0 Adjust the screw and press to continue\n"\
"G1 X-54.4 Y61.6 Z10 F3000\n"\
"G1 Z10 F800\n"\
"G1 X-54.4 Y61.6 F3000\n"\
"G1 Z0 F800\n"\
"M0 Adjust the screw and press to continue\n"\
"G1 X42.8 Y61.6 Z10 F3000\n"\
"G1 Z10 F800\n"\
"G1 X42.8 Y61.6 F3000\n"\
"G1 Z0 F800\n"\
"M0 Adjust the screw and press to continue\n"\
"G1 X0 Y0 Z10 F3000\n"\
"G1 Z10 F800\n"\
"G1 X0 Y0 F3000\n"\
"G1 Z0 F800\n"\
"M0 Press to finish\n"\
"M117 Leveling done\n"\
"G1 Z10 F420\n"\
"G1 Z10 F800\n"\
"G28 X Y\n"\
"M84"
#endif
11 changes: 6 additions & 5 deletions Marlin/Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2933,12 +2933,13 @@
//#define TOUCH_IDLE_SLEEP 300 // (secs) Turn off the TFT backlight if set (5mn)

#define TOUCH_SCREEN_CALIBRATION
#define XPT2046_X_CALIBRATION 17114
#define XPT2046_Y_CALIBRATION -12430
#define XPT2046_X_OFFSET -24
#define XPT2046_Y_OFFSET 345
//Invoke touchscreen calibration by default
#define TOUCH_CALIBRATION_X 17114
#define TOUCH_CALIBRATION_Y -12430
#define TOUCH_OFFSET_X -24
#define TOUCH_OFFSET_Y 345

//#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
#if BOTH(TOUCH_SCREEN_CALIBRATION, EEPROM_SETTINGS)
#define TOUCH_CALIBRATION_AUTO_SAVE // Auto save successful calibration values to EEPROM
#endif
Expand Down
28 changes: 15 additions & 13 deletions Marlin/Marlin/src/core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,19 +536,9 @@ struct XYZEval {
// Reset all to 0
FI void reset() { LOGICAL_AXIS_GANG(e =, x =, y =, z =, i =, j =, k =) 0; }

// Setters taking struct types and arrays
FI void set(const T px) { x = px; }
FI void set(const T px, const T py) { x = px; y = py; }
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
FI void set(const XYZval<T> pxyz) { set(LINEAR_AXIS_ELEM(pxyz)); }
#if HAS_Z_AXIS
FI void set(LINEAR_AXIS_ARGS(const T)) { LINEAR_AXIS_CODE(a = x, b = y, c = z, u = i, v = j, w = k); }
#endif
#if LOGICAL_AXES > LINEAR_AXES
FI void set(const XYval<T> pxy, const T pe) { set(pxy); e = pe; }
FI void set(const XYZval<T> pxyz, const T pe) { set(pxyz); e = pe; }
FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, u = i, v = j, w = k); }
#endif
// Setters for some number of linear axes, not all
FI void set(const T px) { x = px; }
FI void set(const T px, const T py) { x = px; y = py; }
#if HAS_I_AXIS
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
#endif
Expand All @@ -558,6 +548,18 @@ struct XYZEval {
#if HAS_K_AXIS
FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; }
#endif
// Setters taking struct types and arrays
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
FI void set(const XYZval<T> pxyz) { set(LINEAR_AXIS_ELEM(pxyz)); }
#if HAS_Z_AXIS
FI void set(LINEAR_AXIS_ARGS(const T)) { LINEAR_AXIS_CODE(a = x, b = y, c = z, u = i, v = j, w = k); }
#endif
FI void set(const XYval<T> pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); }
#if LOGICAL_AXES > LINEAR_AXES
FI void set(const XYval<T> pxy, const T pz, const T pe) { set(pxy, pz); e = pe; }
FI void set(const XYZval<T> pxyz, const T pe) { set(pxyz); e = pe; }
FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, u = i, v = j, w = k); }
#endif

// Length reduced to one dimension
FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k)); }
Expand Down
1 change: 1 addition & 0 deletions Marlin/Marlin/src/feature/bedlevel/abl/x_twist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void XATC::print_points() {
float lerp(const_float_t t, const_float_t a, const_float_t b) { return a + t * (b - a); }

float XATC::compensation(const xy_pos_t &raw) {
if (NEAR_ZERO(spacing)) return 0;
float t = (raw.x - start) / spacing;
int i = FLOOR(t);
LIMIT(i, 0, XATC_MAX_POINTS - 2);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/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() {

void GcodeSuite::M852_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(STR_SKEW_FACTOR));
SERIAL_ECHOPAIR_F(" M851 I", planner.skew_factor.xy, 6);
SERIAL_ECHOPAIR_F(" M852 I", planner.skew_factor.xy, 6);
#if ENABLED(SKEW_CORRECTION_FOR_Z)
SERIAL_ECHOPAIR_F(" J", planner.skew_factor.xz, 6);
SERIAL_ECHOPAIR_F(" K", planner.skew_factor.yz, 6);
Expand Down
6 changes: 6 additions & 0 deletions Marlin/Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
* Date: 2021/11/06
*/

#include "../../../inc/MarlinConfigPre.h"

#if ENABLED(DWIN_CREALITY_LCD_ENHANCED)

#include "dwin.h"
#include "dwin_popup.h"

Expand All @@ -53,3 +57,5 @@ void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) {
Draw_Select_Highlight(true);
DWIN_UpdateLCD();
}

#endif // DWIN_CREALITY_LCD_ENHANCED
4 changes: 0 additions & 4 deletions Marlin/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ void tft_lvgl_init() {

watchdog_refresh(); // LVGL init takes time

#if MB(MKS_ROBIN_NANO)
OUT_WRITE(PB0, LOW); // HE1
#endif

// Init TFT first!
SPI_TFT.spi_init(SPI_FULL_SPEED);
SPI_TFT.LCD_init();
Expand Down
28 changes: 14 additions & 14 deletions Marlin/Marlin/src/lcd/marlinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,20 +293,20 @@ class MarlinUI {
static void set_progress(const progress_t p) { progress_override = _MIN(p, 100U * (PROGRESS_SCALE)); }
static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); }
static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); }
#if ENABLED(SHOW_REMAINING_TIME)
static uint32_t _calculated_remaining_time() {
const duration_t elapsed = print_job_timer.duration();
const progress_t progress = _get_progress();
return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
}
#if ENABLED(USE_M73_REMAINING_TIME)
static uint32_t remaining_time;
FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; }
FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time ?: _calculated_remaining_time(); }
FORCE_INLINE static void reset_remaining_time() { set_remaining_time(0); }
#else
FORCE_INLINE static uint32_t get_remaining_time() { return _calculated_remaining_time(); }
#endif
#endif
#if ENABLED(SHOW_REMAINING_TIME)
static uint32_t _calculated_remaining_time() {
const duration_t elapsed = print_job_timer.duration();
const progress_t progress = _get_progress();
return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
}
#if ENABLED(USE_M73_REMAINING_TIME)
static uint32_t remaining_time;
FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; }
FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time ?: _calculated_remaining_time(); }
FORCE_INLINE static void reset_remaining_time() { set_remaining_time(0); }
#else
FORCE_INLINE static uint32_t get_remaining_time() { return _calculated_remaining_time(); }
#endif
#endif
static progress_t _get_progress();
Expand Down
6 changes: 3 additions & 3 deletions Marlin/Marlin/src/module/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ class Probe {

// constexpr helpers used in build-time static_asserts, relying on default probe offsets.
class build_time {
static constexpr xyz_pos_t default_probe_xyz_offset =
static constexpr xyz_pos_t default_probe_xyz_offset = xyz_pos_t(
#if HAS_BED_PROBE
NOZZLE_TO_PROBE_OFFSET
#else
{ 0 }
#endif
;
static constexpr xy_pos_t default_probe_xy_offset = { default_probe_xyz_offset.x, default_probe_xyz_offset.y };
);
static constexpr xy_pos_t default_probe_xy_offset = xy_pos_t({ default_probe_xyz_offset.x, default_probe_xyz_offset.y });

public:
static constexpr bool can_reach(float x, float y) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3603,7 +3603,7 @@ void Temperature::isr() {
OPTARG(HAS_TEMP_REDUNDANT, const bool include_r/*=false*/)
) {
#if HAS_TEMP_HOTEND
print_heater_state(H_E0, degHotend(target_extruder), degTargetHotend(target_extruder) OPTARG(SHOW_TEMP_ADC_VALUES, rawHotendTemp(target_extruder)));
print_heater_state(H_NONE, degHotend(target_extruder), degTargetHotend(target_extruder) OPTARG(SHOW_TEMP_ADC_VALUES, rawHotendTemp(target_extruder)));
#endif
#if HAS_HEATED_BED
print_heater_state(H_BED, degBed(), degTargetBed() OPTARG(SHOW_TEMP_ADC_VALUES, rawBedTemp()));
Expand Down
3 changes: 2 additions & 1 deletion Marlin/Marlin/src/module/temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ typedef enum : int8_t {
H_BOARD = HID_BOARD,
H_CHAMBER = HID_CHAMBER,
H_BED = HID_BED,
H_E0 = HID_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7
H_E0 = HID_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7,
H_NONE = -128
} heater_id_t;

// PID storage
Expand Down
5 changes: 2 additions & 3 deletions Marlin/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
//
// Heaters / Fans
//

// Power outputs EFBF or EFBE
#define MOSFET_D_PIN 7
#define MOSFET_B_PIN 7 // For HEATER_1_PIN ("EEF" or "EEB")
#define FAN_PIN 9

#define FIL_RUNOUT_PIN 2
#if NUM_RUNOUT_SENSORS >= 2
Expand Down
4 changes: 4 additions & 0 deletions Marlin/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@
//#define LED_PIN PB2

#include "pins_MKS_ROBIN_NANO_common.h"

#if HAS_TFT_LVGL_UI && FAN1_PIN != PB0 && HEATER_1_PIN != PB0
#define BOARD_INIT OUT_WRITE(PB0, LOW)
#endif
17 changes: 8 additions & 9 deletions Marlin/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,21 @@
#ifndef HEATER_0_PIN
#define HEATER_0_PIN PC3
#endif
#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
#ifndef FAN1_PIN
#define FAN1_PIN PB0
#endif
#else
#ifndef HEATER_1_PIN
#define HEATER_1_PIN PB0
#endif
#endif
#ifndef FAN_PIN
#define FAN_PIN PB1 // FAN
#endif
#ifndef HEATER_BED_PIN
#define HEATER_BED_PIN PA0
#endif

#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
#ifndef FAN1_PIN
#define FAN1_PIN PB0
#endif
#elif !defined(HEATER_1_PIN)
#define HEATER_1_PIN PB0
#endif

//
// Power Supply Control
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extern "C" {
// Timer Definitions
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
#define TIMER_TONE TIM5
#define TIMER_SERVO TIM7
#define TIMER_SERVO TIM4

// UART Definitions
// Define here Serial instance number to map on Serial generic name
Expand Down
2 changes: 1 addition & 1 deletion Marlin/ini/features.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub
HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster
src_filter=+<src/feature/digipot>
HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
src_filter=+<src/module/TMC26X.cpp>
src_filter=+<src/module/stepper/TMC26X.cpp>
HAS_L64XX = [email protected]
src_filter=+<src/libs/L64XX> +<src/module/stepper/L64xx.cpp> +<src/gcode/feature/L6470> +<src/HAL/shared/HAL_spi_L6470.cpp>
LIB_INTERNAL_MAX31865 = src_filter=+<src/libs/MAX31865.cpp>
Expand Down
3 changes: 3 additions & 0 deletions Marlin/ini/stm32f4.ini
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,14 @@ build_unflags = -DUSBD_USE_CDC
extends = stm32_variant
board = genericSTM32F405RG
board_build.variant = MARLIN_TH3D_EZBOARD_V2
board_build.encrypt = firmware.bin
board_build.offset = 0xC000
board_upload.offset_address = 0x0800C000
build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0
debug_tool = stlink
upload_protocol = stlink
extra_scripts = ${stm32_variant.extra_scripts}
buildroot/share/PlatformIO/scripts/openblt.py

#
# BOARD_MKS_ROBIN_NANO_V1_3_F4
Expand Down

0 comments on commit 27defcb

Please sign in to comment.