From e6099fd83f47415cf001080f4493d13a93121dcb Mon Sep 17 00:00:00 2001 From: Vovodroid Date: Tue, 12 Nov 2024 22:43:36 +0200 Subject: [PATCH 01/22] =?UTF-8?q?=F0=9F=9A=B8=20Set=20hybrid=20edit=20rang?= =?UTF-8?q?e=20to=20999=20(#27473)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/core/drivers.h | 13 +++++++++++++ Marlin/src/feature/tmc_util.h | 4 ++-- Marlin/src/lcd/menu/menu_tmc.cpp | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index c4417aab75..c54e42c8fe 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -188,3 +188,16 @@ || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) #define HAS_DIAG_PINS 1 #endif + +// Hybrid Threshold ranges +#define THRS_TMC2100 65535 +#define THRS_TMC2130 65535 +#define THRS_TMC2160 255 +#define THRS_TMC2208 255 +#define THRS_TMC2209 255 +#define THRS_TMC2660 65535 +#define THRS_TMC5130 65535 +#define THRS_TMC5160 65535 + +#define _DRIVER_THRS(V) CAT(THRS_, V) +#define STEPPER_MAX_THRS(S) _DRIVER_THRS(S##_DRIVER_TYPE) diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 12f3a38d30..0c4b78e435 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -77,8 +77,8 @@ class TMCStorage { struct { OPTCODE(HAS_STEALTHCHOP, bool stealthChop_enabled = false) - OPTCODE(HYBRID_THRESHOLD, uint8_t hybrid_thrs = 0) - OPTCODE(USE_SENSORLESS, int16_t homing_thrs = 0) + OPTCODE(HYBRID_THRESHOLD, uint16_t hybrid_thrs = 0) + OPTCODE(USE_SENSORLESS, int16_t homing_thrs = 0) } stored; }; diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index c3503ede41..c708bb5fa2 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -90,7 +90,7 @@ void menu_tmc_current() { #if ENABLED(HYBRID_THRESHOLD) - #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_F(uint8, F(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); + #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_F(uint16_3, F(STR), &stepper##ST.stored.hybrid_thrs, 0, STEPPER_MAX_THRS(ST), []{ stepper##ST.refresh_hybrid_thrs(); }); void menu_tmc_hybrid_thrs() { START_MENU(); From f6c58c59c3fd2b3b317bc75b9216473ab560c0c7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Nov 2024 14:47:04 -0600 Subject: [PATCH 02/22] =?UTF-8?q?=F0=9F=94=A7=20*=5FENABLE=5FON=20is=20LOW?= =?UTF-8?q?/HIGH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 08db0ba9df..c45c75a39d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1771,17 +1771,17 @@ // @section stepper drivers // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 -// :{ 0:'Low', 1:'High' } -#define X_ENABLE_ON 0 -#define Y_ENABLE_ON 0 -#define Z_ENABLE_ON 0 -#define E_ENABLE_ON 0 // For all extruders -//#define I_ENABLE_ON 0 -//#define J_ENABLE_ON 0 -//#define K_ENABLE_ON 0 -//#define U_ENABLE_ON 0 -//#define V_ENABLE_ON 0 -//#define W_ENABLE_ON 0 +// :['LOW', 'HIGH'] +#define X_ENABLE_ON LOW +#define Y_ENABLE_ON LOW +#define Z_ENABLE_ON LOW +#define E_ENABLE_ON LOW // For all extruders +//#define I_ENABLE_ON LOW +//#define J_ENABLE_ON LOW +//#define K_ENABLE_ON LOW +//#define U_ENABLE_ON LOW +//#define V_ENABLE_ON LOW +//#define W_ENABLE_ON LOW // Disable axis steppers immediately when they're not being stepped. // WARNING: When motors turn off there is a chance of losing position accuracy! From 472f1ece2aa0a654e37a35e4f3a6443a7d6dc611 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:22:50 +1300 Subject: [PATCH 03/22] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20G61=20with=20no=20ex?= =?UTF-8?q?truders=20(#27521)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/pause/G61.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index 08b4a99b7d..7f2a45bc93 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -75,7 +75,9 @@ void GcodeSuite::G61(int8_t slot/*=-1*/) { // No XYZ...E parameters, move to stored position - float epos = stored_position[slot].e; + #if HAS_EXTRUDERS + float epos = stored_position[slot].e; + #endif if (!parser.seen_axis()) { DEBUG_ECHOLNPGM(STR_RESTORING_POSITION, slot, " (all axes)"); // Move to the saved position, all axes except E From 70c30607697b260552b1fd8c99dea5220be86a33 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:22:42 +1300 Subject: [PATCH 04/22] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20menu=20homing=20feed?= =?UTF-8?q?rate=20display=20(#27518)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_configuration.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index d7eeab3cb3..632c75629d 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -410,17 +410,17 @@ void menu_advanced_settings(); #if ENABLED(MENUS_ALLOW_INCH_UNITS) #define _EDIT_HOMING_FR(A) do{ \ + const float minfr = MMS_TO_MMM(planner.settings.min_feedrate_mm_s); \ const float maxfr = MMS_TO_MMM(planner.settings.max_feedrate_mm_s[_AXIS(A)]); \ editable.decimal = A##_AXIS_UNIT(homing_feedrate_mm_m.A); \ - EDIT_ITEM(float5, MSG_HOMING_FEEDRATE_N, &editable.decimal, \ - A##_AXIS_UNIT(10), A##_AXIS_UNIT(maxfr), []{ \ + EDIT_ITEM_FAST_N(float5, _AXIS(A), MSG_HOMING_FEEDRATE_N, &editable.decimal, \ + A##_AXIS_UNIT(minfr), A##_AXIS_UNIT(maxfr), []{ \ homing_feedrate_mm_m.A = parser.axis_value_to_mm(_AXIS(A), editable.decimal); \ }); \ }while(0); #else - #define _EDIT_HOMING_FR(A) do{ \ - EDIT_ITEM(float5, MSG_HOMING_FEEDRATE_N, &homing_feedrate_mm_m.A, 10, MMS_TO_MMM(planner.settings.max_feedrate_mm_s[_AXIS(A)])); \ - }while(0); + #define _EDIT_HOMING_FR(A) \ + EDIT_ITEM_FAST_N(float5, _AXIS(A), MSG_HOMING_FEEDRATE_N, &homing_feedrate_mm_m.A, MMS_TO_MMM(planner.settings.min_feedrate_mm_s), MMS_TO_MMM(planner.settings.max_feedrate_mm_s[_AXIS(A)])); #endif MAIN_AXIS_MAP(_EDIT_HOMING_FR); From 4b6109f4e79504d3a562136644c53a9c3fe93d9d Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:54:06 -0500 Subject: [PATCH 05/22] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20E3V2=20types,=20othe?= =?UTF-8?q?r=20warnings=20(#27507)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/powerloss.cpp | 2 +- Marlin/src/lcd/e3v2/common/limits.h | 4 ++-- Marlin/src/lcd/e3v2/proui/dwin.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 745260e3f5..a97887773c 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -99,7 +99,7 @@ PrintJobRecovery recovery; /** * Clear the recovery info */ -void PrintJobRecovery::init() { memset(&info, 0, sizeof(info)); } +void PrintJobRecovery::init() { info = {}; } /** * Enable or disable then call changed() diff --git a/Marlin/src/lcd/e3v2/common/limits.h b/Marlin/src/lcd/e3v2/common/limits.h index 409b735dc8..560c8735a7 100644 --- a/Marlin/src/lcd/e3v2/common/limits.h +++ b/Marlin/src/lcd/e3v2/common/limits.h @@ -115,9 +115,9 @@ constexpr xyze_float_t max_steps_edit_values = constexpr xyz_uint_t min_homing_edit_values = NUM_AXIS_ARRAY_1(MIN_HOMING_EDIT_VALUE); #ifdef DEFAULT_MAX_MULTIPLIER - constexpr xyz_uint_t default_homing = HOMING_FEEDRATE_MM_M; + constexpr xyz_long_t default_homing = HOMING_FEEDRATE_MM_M; #endif - constexpr xyz_uint_t max_homing_edit_values = + constexpr xyz_long_t max_homing_edit_values = #ifdef DEFAULT_MAX_MULTIPLIER default_homing * DEFAULT_MAX_MULTIPLIER #else diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index e483d4a5ce..f4b5ba5339 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -2672,7 +2672,7 @@ void applyMaxAccel() { planner.set_max_acceleration(hmiValue.axis, menuData.valu default: break; } } - void applyHomingFR() { updateHomingFR(HMI_value.axis, MenuData.Value); } + void applyHomingFR() { updateHomingFR(hmiValue.axis, menuData.value); } #if HAS_X_AXIS void setHomingX() { hmiValue.axis = X_AXIS; setIntOnClick(min_homing_edit_values.x, max_homing_edit_values.x, homing_feedrate_mm_m.x, applyHomingFR); } #endif @@ -3799,15 +3799,15 @@ void drawMaxAccelMenu() { if (SET_MENU(homingFRMenu, MSG_HOMING_FEEDRATE, 4)) { BACK_ITEM(drawMotionMenu); #if HAS_X_AXIS - static uint16_t xhome = static_cast(homing_feedrate_mm_m.x); + uint16_t xhome = static_cast(homing_feedrate_mm_m.x); EDIT_ITEM(ICON_MaxSpeedJerkX, MSG_HOMING_FEEDRATE_X, onDrawPIntMenu, setHomingX, &xhome); #endif #if HAS_Y_AXIS - static uint16_t yhome = static_cast(homing_feedrate_mm_m.y); + uint16_t yhome = static_cast(homing_feedrate_mm_m.y); EDIT_ITEM(ICON_MaxSpeedJerkY, MSG_HOMING_FEEDRATE_Y, onDrawPIntMenu, setHomingY, &yhome); #endif #if HAS_Z_AXIS - static uint16_t zhome = static_cast(homing_feedrate_mm_m.z); + uint16_t zhome = static_cast(homing_feedrate_mm_m.z); EDIT_ITEM(ICON_MaxSpeedJerkZ, MSG_HOMING_FEEDRATE_Z, onDrawPIntMenu, setHomingZ, &zhome); #endif } From aa80cb0620f4c2393de76f8d78b2465e1e0e837a Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:17:49 -0800 Subject: [PATCH 06/22] =?UTF-8?q?=F0=9F=94=A7=20Direct=20Stepping=20sanity?= =?UTF-8?q?=20checks=20(#27522)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 4c598a991e..9ec17b2808 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4329,6 +4329,17 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #error "SDSUPPORT, BINARY_FILE_TRANSFER, and CUSTOM_FIRMWARE_UPLOAD are required for custom upload." #endif +/** + * Direct Stepping requirements + */ +#if ENABLED(DIRECT_STEPPING) + #if ENABLED(CPU_32_BIT) + #error "Direct Stepping is not supported on 32-bit boards." + #elif !IS_FULL_CARTESIAN + #error "Direct Stepping is incompatible with enabled kinematics." + #endif +#endif + /** * Input Shaping requirements */ From 1df97254cb1a6f6e3cd7fdbfad8f925452c80bb3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Nov 2024 17:44:34 -0600 Subject: [PATCH 07/22] =?UTF-8?q?=F0=9F=94=A8=20Fix=20path=20handling=20fo?= =?UTF-8?q?r=20generic=20variant=20(#27528)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/PlatformIO/scripts/generic_create_variant.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/generic_create_variant.py b/buildroot/share/PlatformIO/scripts/generic_create_variant.py index 60c36c7f24..cfab812e15 100644 --- a/buildroot/share/PlatformIO/scripts/generic_create_variant.py +++ b/buildroot/share/PlatformIO/scripts/generic_create_variant.py @@ -51,6 +51,8 @@ if pioutil.is_pio_build(): # Make sure the local variant sub-folder exists if marlin_variant_pattern.match(str(variant).lower()): - source_dir = Path("buildroot/share/PlatformIO/variants", variant) + here = Path.cwd() + variants_dir = here / 'buildroot' / 'share' / 'PlatformIO' / 'variants' + source_dir = variants_dir / variant assert source_dir.is_dir() - board.update("build.variants_dir", "buildroot/share/PlatformIO/variants"); + board.update("build.variants_dir", str(variants_dir)); From 81bad7b124b26ef8ac5bb3c46437ba461fe00497 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 13 Nov 2024 00:27:04 +0000 Subject: [PATCH 08/22] [cron] Bump distribution date (2024-11-13) --- 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 604bac0ba4..d973fcfdf7 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 "2024-11-04" +//#define STRING_DISTRIBUTION_DATE "2024-11-13" /** * The protocol for communication to the host. Protocol indicates communication diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index cc3a7060a2..359f6daecd 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 "2024-11-04" + #define STRING_DISTRIBUTION_DATE "2024-11-13" #endif /** From 92efc33acee6206fa3fb90ce06de21ec4eff5adb Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:10:07 -0500 Subject: [PATCH 09/22] =?UTF-8?q?=F0=9F=90=9B=20G34=20fail=20safely=20(#27?= =?UTF-8?q?516)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/G34_M422.cpp | 40 +++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 7a27a61b9d..17d576679f 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -212,7 +212,28 @@ void GcodeSuite::G34() { // Probe a Z height for each stepper. // Probing sanity check is disabled, as it would trigger even in normal cases because // current_position.z has been manually altered in the "dirty trick" above. - const float z_probed_height = probe.probe_at_point(DIFF_TERN(HAS_HOME_OFFSET, ppos, xy_pos_t(home_offset)), raise_after, 0, true, false, (Z_PROBE_LOW_POINT) - z_probe * 0.5f, z_probe * 0.5f); + + if (DEBUGGING(LEVELING)) + DEBUG_ECHOLNPGM( + "Z_PROBE_LOW_POINT: ", p_float_t(Z_PROBE_LOW_POINT, 2), + "z_probe: ", p_float_t(z_probe, 2), + "Probe Tgt: ", p_float_t((Z_PROBE_LOW_POINT) - z_probe * 0.5f, 2) + ); + + const float z_probed_height = probe.probe_at_point( + DIFF_TERN(HAS_HOME_OFFSET, ppos, xy_pos_t(home_offset)), // xy + raise_after, // raise_after + (DEBUGGING(LEVELING) || DEBUGGING(INFO)) ? 3 : 0, // verbose_level + true, false, // probe_relative, sanity_check + (Z_PROBE_LOW_POINT) - (z_probe * 0.5f), // z_min_point + Z_TWEEN_SAFE_CLEARANCE // z_clearance + ); + + if (DEBUGGING(LEVELING)) { + DEBUG_ECHOLNPGM_P(PSTR("Probing X"), ppos.x, SP_Y_STR, ppos.y); + DEBUG_ECHOLNPGM("Height = ", z_probed_height); + } + if (isnan(z_probed_height)) { SERIAL_ECHOLNPGM(STR_ERR_PROBING_FAILED); LCD_MESSAGE(MSG_LCD_PROBING_FAILED); @@ -236,7 +257,12 @@ void GcodeSuite::G34() { // Adapt the next probe clearance height based on the new measurements. // Safe_height = lowest distance to bed (= highest measurement) plus highest measured misalignment. z_maxdiff = z_measured_max - z_measured_min; - z_probe = (Z_TWEEN_SAFE_CLEARANCE + zoffs) + z_measured_max + z_maxdiff; //Not sure we need z_maxdiff, but leaving it in for safety. + + // The intent of the line below seems to be to clamp the probe depth on successive iterations of G34, but in reality if the amplification + // factor is not completely accurate, this was causing probing to fail as the probe stopped fractions of a mm from the trigger point + // on the second iteration very reliably. This may be restored with an uncertainty factor at some point, however its usefulness after + // all probe points have seen a successful probe is questionable. + //z_probe = (Z_TWEEN_SAFE_CLEARANCE + zoffs) + z_measured_max + z_maxdiff; // Not sure we need z_maxdiff, but leaving it in for safety. #if HAS_Z_STEPPER_ALIGN_STEPPER_XY // Replace the initial values in z_measured with calculated heights at @@ -401,7 +427,15 @@ void GcodeSuite::G34() { // Use the probed height from the last iteration to determine the Z height. // z_measured_min is used, because all steppers are aligned to z_measured_min. // Ideally, this would be equal to the 'z_probe * 0.5f' which was added earlier. - current_position.z -= z_measured_min - (Z_TWEEN_SAFE_CLEARANCE + zoffs); //we shouldn't want to subtract the clearance from here right? (Depends if we added it further up) + if (DEBUGGING(LEVELING)) + DEBUG_ECHOLNPGM( + "z_measured_min: ", p_float_t(z_measured_min, 2), + "Z_TWEEN_SAFE_CLEARANCE: ", p_float_t(Z_TWEEN_SAFE_CLEARANCE, 2), + "zoffs: ", p_float_t(zoffs, 2) + ); + + if (!err_break) + current_position.z -= z_measured_min - (Z_TWEEN_SAFE_CLEARANCE + zoffs); // We shouldn't want to subtract the clearance from here right? (Depends if we added it further up) sync_plan_position(); #endif From 9e96b8985677ae10d9b6185fdd84f887b2fba900 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 14 Nov 2024 06:08:46 +0000 Subject: [PATCH 10/22] [cron] Bump distribution date (2024-11-14) --- 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 d973fcfdf7..cb9185d725 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 "2024-11-13" +//#define STRING_DISTRIBUTION_DATE "2024-11-14" /** * The protocol for communication to the host. Protocol indicates communication diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 359f6daecd..c31f029cbe 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 "2024-11-13" + #define STRING_DISTRIBUTION_DATE "2024-11-14" #endif /** From 25b9bb35ab8f5dd3d584f42f8f3eeafc225283fc Mon Sep 17 00:00:00 2001 From: d Date: Thu, 14 Nov 2024 11:07:49 +0200 Subject: [PATCH 11/22] =?UTF-8?q?=F0=9F=90=9B=20Fix=20BLTouch,=20Runout=20?= =?UTF-8?q?pins=20for=20Ender=202P=20v2.4=20S4=20(#27520)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h b/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h index 1d142d87cc..2dde4bc5f7 100644 --- a/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h +++ b/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h @@ -75,7 +75,7 @@ // Servos // #ifndef SERVO0_PIN - #define SERVO0_PIN PB0 // BLTouch OUT * + #define SERVO0_PIN PB1 #endif // @@ -83,17 +83,17 @@ // #define X_STOP_PIN PA5 #define Y_STOP_PIN PA6 -#define Z_STOP_PIN PB0 // BLTOUCH * +#define Z_STOP_PIN PB0 #ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PB1 // BLTouch IN * + #define Z_MIN_PROBE_PIN PB2 #endif // // Filament Runout Sensor // #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PC15 // "Pulled-high" * + #define FIL_RUNOUT_PIN PA4 // "Pulled-high" * #endif // From 09a290cc612f2aa013ee4ef4fe912ea1bbc4281c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 15 Nov 2024 00:29:01 +0000 Subject: [PATCH 12/22] [cron] Bump distribution date (2024-11-15) --- 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 cb9185d725..4c3390c6af 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 "2024-11-14" +//#define STRING_DISTRIBUTION_DATE "2024-11-15" /** * The protocol for communication to the host. Protocol indicates communication diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index c31f029cbe..10b1676439 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 "2024-11-14" + #define STRING_DISTRIBUTION_DATE "2024-11-15" #endif /** From 284d07d4d8b93458f29fb1c95e319ac7c1f79bbd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Nov 2024 17:35:20 -0600 Subject: [PATCH 13/22] =?UTF-8?q?=F0=9F=93=9D=20Describe=20more=20codes=20?= =?UTF-8?q?in=20gcode.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/gcode.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index c6b4a40d9f..589cd2bc48 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -128,6 +128,8 @@ * M84 - Disable steppers until next move, or use S to specify an idle * duration after which steppers should turn off. S0 disables the timeout. * M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) + * M86 - Set / Report Hotend Idle Timeout. (Requires HOTEND_IDLE_TIMEOUT) + * M87 - Cancel Hotend Idle Timeout (by setting the timeout period to 0). (Requires HOTEND_IDLE_TIMEOUT) * M92 - Set planner.settings.axis_steps_per_mm for one or more axes. (Requires EDITABLE_STEPS_PER_UNIT) * * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER) @@ -213,6 +215,8 @@ * M281 - Set servo min|max position: "M281 P L U". (Requires EDITABLE_SERVO_ANGLES) * M282 - Detach servo: "M282 P". (Requires SERVO_DETACH_GCODE) * M290 - Babystepping (Requires BABYSTEPPING) + * M293 - Babystep Z UP (Requires EP_BABYSTEPPING) + * M294 - Babystep Z DOWN (Requires EP_BABYSTEPPING) * M300 - Play beep sound S P * M301 - Set PID parameters P I and D. (Requires PIDTEMP) * M302 - Allow cold extrudes, or set the minimum extrude S. (Requires PREVENT_COLD_EXTRUSION) @@ -246,6 +250,7 @@ * M430 - Read the system current, voltage, and power (Requires POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE, or POWER_MONITOR_FIXED_VOLTAGE) * M485 - Send RS485 packets (Requires RS485_SERIAL_PORT) * M486 - Identify and cancel objects. (Requires CANCEL_OBJECTS) + * M493 - Get or set input FT Motion / Shaping parameters. (Requires FT_MOTION) * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS) * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS) * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! ** @@ -261,7 +266,7 @@ * M554 - Get or set IP gateway. (Requires enabled Ethernet port) * M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160) * M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE) - * M592 - Get or set nonlinear extrusion parameters. (Requires NONLINEAR_EXTRUSION) + * M592 - Get or set Nonlinear Extrusion parameters. (Requires NONLINEAR_EXTRUSION) * M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY]) * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) @@ -274,15 +279,17 @@ * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * - * M704 - Preload to MMU (Requires PRUSA_MMU3) - * M705 - Eject filament (Requires PRUSA_MMU3) - * M706 - Cut filament (Requires PRUSA_MMU3) - * M707 - Read from MMU register (Requires PRUSA_MMU3) - * M708 - Write to MMU register (Requires PRUSA_MMU3) - * M709 - MMU power & reset (Requires PRUSA_MMU3) + *** PRUSA_MMU3 *** + * M704 - Preload to MMU + * M705 - Eject filament + * M706 - Cut filament + * M707 - Read from MMU register + * M708 - Write to MMU register + * M709 - MMU power & reset * * M808 - Set or Goto a Repeat Marker (Requires GCODE_REPEAT_MARKERS) * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS) + * M820 - Report all defined M810-M819 G-code macros (Requires GCODE_MACROS) * M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below) * M852 - Set skew factors: "M852 [I] [J] [K]". (Requires SKEW_CORRECTION_GCODE, plus SKEW_CORRECTION_FOR_Z for IJ) * From 72603b627acdeae36c75932319f60e0ac3727f7e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 16 Nov 2024 00:28:18 +0000 Subject: [PATCH 14/22] [cron] Bump distribution date (2024-11-16) --- 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 4c3390c6af..5789691396 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 "2024-11-15" +//#define STRING_DISTRIBUTION_DATE "2024-11-16" /** * The protocol for communication to the host. Protocol indicates communication diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 10b1676439..8be19d05ef 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 "2024-11-15" + #define STRING_DISTRIBUTION_DATE "2024-11-16" #endif /** From bf98c16a00f2f8aa6767f675de2b485e2b8a05be Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Nov 2024 18:04:08 -0600 Subject: [PATCH 15/22] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Impro?= =?UTF-8?q?ve=20scripts=20to=20build=20examples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/build_all_examples | 12 +++-- buildroot/bin/build_example | 84 ++++++++++++++++++-------------- 2 files changed, 56 insertions(+), 40 deletions(-) diff --git a/buildroot/bin/build_all_examples b/buildroot/bin/build_all_examples index 31957caa84..0c4a0ee394 100755 --- a/buildroot/bin/build_all_examples +++ b/buildroot/bin/build_all_examples @@ -151,8 +151,10 @@ fi echo -e "=====================\nProceed with builds...\n=====================" shopt -s nullglob +export PAUSE=1 + # Get a list of all folders that contain a file matching "Configuration*.h" -find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Configuration_adv.h' -print0 | while IFS= read -r -d '' CONF; do +find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Configuration_adv.h' -print0 | while IFS= read -r -d $'\0' CONF; do # Remove the file name and slash from the end of the path CONF=${CONF%/*} @@ -198,10 +200,14 @@ find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Conf fi echo - ((--LIMIT)) || { echo "Specified limit reached" ; PAUSE=1 ; break ; } + ((--LIMIT)) || { echo "Specified limit reached" ; break ; } echo + export PAUSE=0 + done +echo "Exiting" + # Delete the build state if not paused early -[[ $PAUSE ]] || rm -f "$STAT_FILE" +((PAUSE)) || rm -f "$STAT_FILE" diff --git a/buildroot/bin/build_example b/buildroot/bin/build_example index b9be61dbf1..9814058c0e 100755 --- a/buildroot/bin/build_example +++ b/buildroot/bin/build_example @@ -37,6 +37,7 @@ PATH="$HERE:$PATH" . mfutil annc() { echo -e "\033[0;32m$1\033[0m" ; } +alrt() { echo -e "\033[0;31m$1\033[0m" ; } # Get arguments BUILD=./.pio/build @@ -153,8 +154,7 @@ ENAME=("-name" "marlin_config.json" \ "-o" "-name" "schema.yml") # Possible built firmware names (in the build folder) -BNAME=("-type" "f" \ - "-name" 'firmware*.hex' \ +BNAME=("-name" 'firmware*.hex' \ "-o" "-name" "firmware*.bin" \ "-o" "-name" "project*.bin" \ "-o" "-name" "Robin*.bin" \ @@ -176,44 +176,54 @@ set +e echo "Building example $CONFIG ..." mftest -s -a -n1 ; ERR=$? -((ERR)) && echo "Failed" || echo "Success" +((ERR)) && alrt "Failed ($ERR)" || annc "Success" set -e -# Copy exports back to the configs -if [[ -n $EXPNUM ]]; then - annc "Exporting $EXPNUM" - [[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; } - find "$BUILD" "${ENAME[@]}" -exec cp "{}" "$ARCSUB" \; +if [[ $ERR -gt 0 ]]; then + + # Error? For --nofail simply log. Otherwise return the error. + if [[ -n $NOFAIL ]]; then + date +"%F %T [FAIL] $CONFIG" >>./.pio/error-log.txt + else + exit $ERR + fi + +else + + # Copy exports back to the configs + if [[ -n $EXPNUM ]]; then + annc "Exporting $EXPNUM" + [[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; } + find "$BUILD" \( "${ENAME[@]}" \) -exec cp "{}" "$ARCSUB" \; + fi + + # Copy potential firmware files into the config folder + # TODO: Consider firmware that needs an STM32F4_UPDATE folder. + # Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality + if ((ARCHIVE)); then + annc "Archiving" + rm -f "$ARCSUB"/*.bin.tar.gz "$ARCSUB"/*.hex.tar.gz + find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c ' + ARCSUB="$1" + CONFIG="$2" + shift 2 + for FILE in "$@"; do + cd "${FILE%/*}" + NAME=${FILE##*/} + SHRT=${NAME%.*} + SHASUM=$(sha256sum "$NAME" | cut -d" " -f1) + tar -czf "$ARCSUB/$SHRT.tar.gz" "$NAME" + echo "$CONFIG\n$SHASUM" > "$ARCSUB/$NAME.sha256.txt" + rm "$NAME" + cd - >/dev/null + done + ' sh "$ARCSUB" "$CONFIG" {} + + fi + + # Reveal the configs after the build, if requested + ((REVEAL)) && { annc "Revealing $ARCSUB" ; open "$ARCSUB" ; } + fi -# Copy potential firmware files into the config folder -# TODO: Consider firmware that needs an STM32F4_UPDATE folder. -# Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality -if ((ARCHIVE)); then - annc "Archiving" - rm -f "$ARCSUB"/*.bin.tar.gz "$ARCSUB"/*.hex.tar.gz - find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c ' - ARCSUB="$1" - CONFIG="$2" - shift 2 - for FILE in "$@"; do - cd "${FILE%/*}" - BASE=${FILE##*/} - SHRT=${BASE%.*} - SHASUM=$(sha256sum "$BASE" | cut -d" " -f1) - tar -czf "$ARCSUB/$SHRT.tar.gz" "$BASE" - echo "$CONFIG\n$SHASUM" > "$ARCSUB/$BASE.sha256.txt" - rm "$BASE" - cd - >/dev/null - done - ' sh "$ARCSUB" "$CONFIG" {} + -fi - -# Exit with error unless --nofail is set -[[ $ERR -gt 0 && -z $NOFAIL ]] && exit $ERR - -# Reveal the configs after the build, if requested -((REVEAL)) && { annc "Revealing $ARCSUB" ; open "$ARCSUB" ; } - exit 0 From fa55caed1f65973e0e8a26e0111d0cbf2625b861 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 18 Nov 2024 19:16:22 -0600 Subject: [PATCH 16/22] =?UTF-8?q?=F0=9F=A9=B9=20Daily=20cleanup=20Nov=2018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/DUE/eeprom_flash.cpp | 2 +- Marlin/src/gcode/bedlevel/G35.cpp | 2 +- Marlin/src/gcode/bedlevel/G42.cpp | 62 ++++++++++++------------- Marlin/src/gcode/host/M115.cpp | 2 +- Marlin/src/gcode/motion/G5.cpp | 29 ++++++------ Marlin/src/pins/mega/pins_MINITRONICS.h | 6 +-- 6 files changed, 51 insertions(+), 52 deletions(-) diff --git a/Marlin/src/HAL/DUE/eeprom_flash.cpp b/Marlin/src/HAL/DUE/eeprom_flash.cpp index a5c7ab836d..55206a0f9d 100644 --- a/Marlin/src/HAL/DUE/eeprom_flash.cpp +++ b/Marlin/src/HAL/DUE/eeprom_flash.cpp @@ -291,7 +291,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) { uint32_t *p1 = (uint32_t*)addrflash; uint32_t *p2 = (uint32_t*)data; int count = 0; - for (i =0; i> 2; i++) { + for (i = 0; i < PageSize >> 2; i++) { if (p1[i] != p2[i]) { uint32_t delta = p1[i] ^ p2[i]; while (delta) { diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index c1a329fb8a..b3c56b49b3 100644 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -53,7 +53,7 @@ * 41 - Counter-Clockwise M4 * 50 - Clockwise M5 * 51 - Counter-Clockwise M5 - **/ + */ void GcodeSuite::G35() { DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING)); diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp index f55f149616..44f5ceada8 100644 --- a/Marlin/src/gcode/bedlevel/G42.cpp +++ b/Marlin/src/gcode/bedlevel/G42.cpp @@ -43,40 +43,40 @@ * P : Flag to put the probe at the given point */ void GcodeSuite::G42() { - if (MOTION_CONDITIONS) { - const bool hasI = parser.seenval('I'); - const int8_t ix = hasI ? parser.value_int() : 0; - const bool hasJ = parser.seenval('J'); - const int8_t iy = hasJ ? parser.value_int() : 0; + if (!MOTION_CONDITIONS) return; - if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) { - SERIAL_ECHOLNPGM(STR_ERR_MESH_XY); - return; - } + const bool hasI = parser.seenval('I'); + const int8_t ix = hasI ? parser.value_int() : 0; + const bool hasJ = parser.seenval('J'); + const int8_t iy = hasJ ? parser.value_int() : 0; - // Move to current_position, as modified by I, J, P parameters - destination = current_position; - - if (hasI) destination.x = bedlevel.get_mesh_x(ix); - if (hasJ) destination.y = bedlevel.get_mesh_y(iy); - - #if HAS_PROBE_XY_OFFSET - if (parser.seen_test('P')) { - if (hasI) destination.x -= probe.offset_xy.x; - if (hasJ) destination.y -= probe.offset_xy.y; - } - #endif - - const feedRate_t fval = parser.linearval('F'), - fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f); - - // SCARA kinematic has "safe" XY raw moves - #if IS_SCARA - prepare_internal_fast_move_to_destination(fr_mm_s); - #else - prepare_internal_move_to_destination(fr_mm_s); - #endif + if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) { + SERIAL_ECHOLNPGM(STR_ERR_MESH_XY); + return; } + + // Move to current_position, as modified by I, J, P parameters + destination = current_position; + + if (hasI) destination.x = bedlevel.get_mesh_x(ix); + if (hasJ) destination.y = bedlevel.get_mesh_y(iy); + + #if HAS_PROBE_XY_OFFSET + if (parser.seen_test('P')) { + if (hasI) destination.x -= probe.offset_xy.x; + if (hasJ) destination.y -= probe.offset_xy.y; + } + #endif + + const feedRate_t fval = parser.linearval('F'), + fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f); + + // SCARA kinematic has "safe" XY raw moves + #if IS_SCARA + prepare_internal_fast_move_to_destination(fr_mm_s); + #else + prepare_internal_move_to_destination(fr_mm_s); + #endif } #endif // HAS_MESH diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 0d38d3147b..f867aadb05 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -109,7 +109,7 @@ void GcodeSuite::M115() { SERIAL_ECHO(F("CEDE2A2F-")); for (uint8_t i = 1; i <= 6; i++) { print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444 - if (i <= 3) SERIAL_ECHO(C('-')); + if (i <= 3) SERIAL_CHAR('-'); } #endif #endif diff --git a/Marlin/src/gcode/motion/G5.cpp b/Marlin/src/gcode/motion/G5.cpp index c47f443d41..fe1e664f13 100644 --- a/Marlin/src/gcode/motion/G5.cpp +++ b/Marlin/src/gcode/motion/G5.cpp @@ -45,25 +45,24 @@ * G5: Cubic B-spline */ void GcodeSuite::G5() { - if (MOTION_CONDITIONS) { + if (!MOTION_CONDITIONS) return; - #if ENABLED(CNC_WORKSPACE_PLANES) - if (workspace_plane != PLANE_XY) { - SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE); - return; - } - #endif + #if ENABLED(CNC_WORKSPACE_PLANES) + if (workspace_plane != PLANE_XY) { + SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE); + return; + } + #endif - get_destination_from_command(); + get_destination_from_command(); - const xy_pos_t offsets[2] = { - { parser.linearval('I'), parser.linearval('J') }, - { parser.linearval('P'), parser.linearval('Q') } - }; + const xy_pos_t offsets[2] = { + { parser.linearval('I'), parser.linearval('J') }, + { parser.linearval('P'), parser.linearval('Q') } + }; - cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder); - current_position = destination; - } + cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder); + current_position = destination; } #endif // BEZIER_CURVE_SUPPORT diff --git a/Marlin/src/pins/mega/pins_MINITRONICS.h b/Marlin/src/pins/mega/pins_MINITRONICS.h index c547c9f223..d3a012dd4b 100644 --- a/Marlin/src/pins/mega/pins_MINITRONICS.h +++ b/Marlin/src/pins/mega/pins_MINITRONICS.h @@ -44,9 +44,9 @@ // // Limit Switches // -#define X_MIN_PIN 5 -#define Y_MIN_PIN 2 -#define Z_MIN_PIN 6 +#define X_STOP_PIN 5 +#define Y_STOP_PIN 2 +#define Z_STOP_PIN 6 // // Steppers From 0f0e239264937d3e25b0b44e557e8064ed820c89 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 18 Nov 2024 19:18:18 -0600 Subject: [PATCH 17/22] =?UTF-8?q?=E2=9C=85=20Use=20Marlin-maintained=20TMC?= =?UTF-8?q?Stepper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/features.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ini/features.ini b/ini/features.ini index c6a657e305..b2e9d6884e 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -20,7 +20,7 @@ MARLIN_TEST_BUILD = build_src_filter=+ POSTMORTEM_DEBUGGING = build_src_filter=+ + build_flags=-funwind-tables MKS_WIFI_MODULE = QRCode=https://github.com/makerbase-mks/QRCode/archive/261c5a696a.zip -HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.3 +HAS_TRINAMIC_CONFIG = TMCStepper=https://github.com/MarlinFirmware/TMCStepper/archive/marlin-2.1.3.x.zip build_src_filter=+ + + + + HAS_T(RINAMIC_CONFIG|MC_SPI) = build_src_filter=+ SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/6f53c19a8a.zip From a531c01889c408fc40bdf1e2e5867355bfacd49f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 18 Nov 2024 19:48:21 -0600 Subject: [PATCH 18/22] =?UTF-8?q?=F0=9F=A9=B9=20Update=20RP2040=20pins=20d?= =?UTF-8?q?ebugging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/RP2040/pinsDebug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/HAL/RP2040/pinsDebug.h b/Marlin/src/HAL/RP2040/pinsDebug.h index 50d7391f92..964fb71086 100644 --- a/Marlin/src/HAL/RP2040/pinsDebug.h +++ b/Marlin/src/HAL/RP2040/pinsDebug.h @@ -112,7 +112,7 @@ uint8_t get_pin_mode(const pin_t Ard_num) { } -bool GET_PINMODE(const pin_t Ard_num) { +bool getValidPinMode(const pin_t Ard_num) { const uint8_t pin_mode = get_pin_mode(Ard_num); return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM } @@ -122,7 +122,7 @@ int8_t digital_pin_to_analog_pin(pin_t Ard_num) { return (Ard_num >= 0 && Ard_num < NUM_ANALOG_INPUTS) ? Ard_num : -1; } -bool IS_ANALOG(const pin_t Ard_num) { +bool isAnalogPin(const pin_t Ard_num) { return digital_pin_to_analog_pin(Ard_num) != -1; } @@ -131,7 +131,7 @@ bool is_digital(const pin_t x) { return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT; } -void print_port(const pin_t Ard_num) { +void printPinPort(const pin_t Ard_num) { SERIAL_ECHOPGM("Pin: "); SERIAL_ECHO(Ard_num); } @@ -140,7 +140,7 @@ bool pwm_status(const pin_t Ard_num) { return get_pin_mode(Ard_num) == MODE_PIN_ALT; } -void pwm_details(const pin_t Ard_num) { +void printPinPWM(const pin_t Ard_num) { if (PWM_PIN(Ard_num)) { } } From c6bbed7cdb8f55ad8ce6952e2408bc5fe9eac7ae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 18 Nov 2024 23:58:07 -0600 Subject: [PATCH 19/22] =?UTF-8?q?=F0=9F=94=A5=20Drop=20support=20for=20Dev?= =?UTF-8?q?IoT,=20Atom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #15347 --- .../auto_build_sublime_menu/000_read_me.txt | 40 - .../auto_build_sublime_menu/Main.sublime-menu | 66 - buildroot/share/vscode/auto_build.py | 1283 ----------------- .../create_custom_upload_command_CDC.py | 143 -- .../create_custom_upload_command_DFU.py | 41 - process-palette.json | 357 ----- 6 files changed, 1930 deletions(-) delete mode 100644 buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt delete mode 100644 buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu delete mode 100644 buildroot/share/vscode/auto_build.py delete mode 100644 buildroot/share/vscode/create_custom_upload_command_CDC.py delete mode 100644 buildroot/share/vscode/create_custom_upload_command_DFU.py delete mode 100644 process-palette.json diff --git a/buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt b/buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt deleted file mode 100644 index 5853977911..0000000000 --- a/buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt +++ /dev/null @@ -1,40 +0,0 @@ -Overview: -1) Install Sublime -2) Install Deviot (?optional?) -3) Install WebDevShell (this will execute the auto-build script) -4) Copy the menu configuration to the proper Sublime directory -5) Add platformio to your path (usually not needed) - - -Sublime with autobuild - Tools - Install Package Control - Tools - Command Palette - Package Control: Install Package - type in deviot and click on it - Tools - Command Palette - Package Control: Install Package - type in WebDevShell and click on it - - in Sublime, open Marlin directory with "platformio.ini" in it - - starting in the top level directory, go to the folder "Buildroot/shared/Sublime" - copy the folder "auto_build_sublime_menu" and contents to: - Windows - \Users\your_user_name\AppData\Roaming\Sublime Text 3\Packages - Linux - /home/your_user_name/.config/sublime-text-3/Packages/User - macOS (Click on the Finder's 'Go' menu and hold down Option to open...) - ~/Library/Application Support/Sublime Text 3/Packages/User - -The menu should now be visible - -If you get an error message that says "file not found" and "subprocess.Popen(['platformio' ... " -then you'll need to add platformio to your path. - macOS - sudo nano /etc/paths - add these to the bottom - /Users/bob/.platformio - /Users/bob/.platformio/penv/bin diff --git a/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu b/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu deleted file mode 100644 index 60939d12e7..0000000000 --- a/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu +++ /dev/null @@ -1,66 +0,0 @@ -[ - - { - "caption": "Auto Build", - "children": [ - { - "caption": "PIO Build", - "command": "webdevshell", - "args": { - "command": "python buildroot/share/vscode/auto_build.py build" - } - }, - { - "caption": "PIO Clean", - "command": "webdevshell", - "args": { - "command": "python buildroot/share/vscode/auto_build.py clean" - } - }, - { - "caption": "PIO Upload", - "command": "webdevshell", - "args": { - "command": "python buildroot/share/vscode/auto_build.py upload" - } - }, - { - "caption": "PIO Upload (traceback)", - "command": "webdevshell", - "args": { - "command": "python buildroot/share/vscode/auto_build.py traceback" - } - }, - { - "caption": "PIO Upload using Programmer", - "command": "webdevshell", - "args": { - "command": "python buildroot/share/vscode/auto_build.py program" - } - }, - { - "caption": "PIO Test", - "command": "webdevshell", - "args": { - "command": "python buildroot/share/vscode/auto_build.py test" - } - }, - { - "caption": "PIO Debug", - "command": "webdevshell", - "args": { - "command": "python buildroot/share/vscode/auto_build.py debug" - } - }, - { - "caption": "PIO Remote", - "command": "webdevshell", - "args": { - "command": "python buildroot/share/vscode/auto_build.py remote" - } - } - ], - "id": "AutoBuild", - "mnemonic": "A" - } -] diff --git a/buildroot/share/vscode/auto_build.py b/buildroot/share/vscode/auto_build.py deleted file mode 100644 index dcbf119d49..0000000000 --- a/buildroot/share/vscode/auto_build.py +++ /dev/null @@ -1,1283 +0,0 @@ -#!/usr/bin/env python -####################################### -# -# Marlin 3D Printer Firmware -# Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] -# -# Based on Sprinter and grbl. -# Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -####################################### - -####################################### -# -# Revision: 2.1.0 -# -# Description: script to automate PlatformIO builds -# CLI: python auto_build.py build_option -# build_option (required) -# build executes -> platformio run -e target_env -# clean executes -> platformio run --target clean -e target_env -# upload executes -> platformio run --target upload -e target_env -# traceback executes -> platformio run --target upload -e target_env -# program executes -> platformio run --target program -e target_env -# test executes -> platformio test upload -e target_env -# remote executes -> platformio remote run --target upload -e target_env -# debug executes -> platformio debug -e target_env -# -# 'traceback' just uses the debug variant of the target environment if one exists -# -####################################### - -####################################### -# -# General program flow -# -# 1. Scans Configuration.h for the motherboard name and Marlin version. -# 2. Scans pins.h for the motherboard. -# returns the CPU(s) and platformio environment(s) used by the motherboard -# 3. If further info is needed then a popup gets it from the user. -# 4. The OUTPUT_WINDOW class creates a window to display the output of the PlatformIO program. -# 5. A thread is created by the OUTPUT_WINDOW class in order to execute the RUN_PIO function. -# 6. The RUN_PIO function uses a subprocess to run the CLI version of PlatformIO. -# 7. The "iter(pio_subprocess.stdout.readline, '')" function is used to stream the output of -# PlatformIO back to the RUN_PIO function. -# 8. Each line returned from PlatformIO is formatted to match the color coding seen in the -# PlatformIO GUI. -# 9. If there is a color change within a line then the line is broken at each color change -# and sent separately. -# 10. Each formatted segment (could be a full line or a split line) is put into the queue -# IO_queue as it arrives from the platformio subprocess. -# 11. The OUTPUT_WINDOW class periodically samples IO_queue. If data is available then it -# is written to the window. -# 12. The window stays open until the user closes it. -# 13. The OUTPUT_WINDOW class continues to execute as long as the window is open. This allows -# copying, saving, scrolling of the window. A right click popup is available. -# -####################################### - -from __future__ import print_function -from __future__ import division - -import sys, os, re - -pwd = os.getcwd() # make sure we're executing from the correct directory level -pwd = pwd.replace('\\', '/') -if 0 <= pwd.find('buildroot/share/vscode'): - pwd = pwd[:pwd.find('buildroot/share/vscode')] - os.chdir(pwd) -print('pwd: ', pwd) - -num_args = len(sys.argv) -if num_args > 1: - build_type = str(sys.argv[1]) -else: - print('Please specify build type') - exit() - -print('build_type: ', build_type) - -print('\nWorking\n') - -python_ver = sys.version_info[0] # major version - 2 or 3 - -print("python version " + str(sys.version_info[0]) + "." + str(sys.version_info[1]) + "." + str(sys.version_info[2])) - -import platform -current_OS = platform.system() - -#globals -target_env = '' -board_name = '' - -from datetime import datetime - -######### -# Python 2 error messages: -# Can't find a usable init.tcl in the following directories ... -# error "invalid command name "tcl_findLibrary"" -# -# Fix for the above errors on my Win10 system: -# search all init.tcl files for the line "package require -exact Tcl" that has the highest 8.5.x number -# copy it into the first directory listed in the error messages -# set the environmental variables TCLLIBPATH and TCL_LIBRARY to the directory where you found the init.tcl file -# reboot -######### - -########################################################################################## -# -# popup to get input from user -# -########################################################################################## - -def get_answer(board_name, question_txt, options, default_value=1): - - if python_ver == 2: - import Tkinter as tk - else: - import tkinter as tk - - def CPU_exit_3(): # forward declare functions - CPU_exit_3_() - - def got_answer(): - got_answer_() - - def kill_session(): - kill_session_() - - root_get_answer = tk.Tk() - root_get_answer.title('') - #root_get_answer.withdraw() - #root_get_answer.deiconify() - root_get_answer.attributes("-topmost", True) - - def disable_event(): - pass - - root_get_answer.protocol("WM_DELETE_WINDOW", disable_event) - root_get_answer.resizable(False, False) - - global get_answer_val - get_answer_val = default_value # return get_answer_val, set default to match radio_state default - - radio_state = tk.IntVar() - radio_state.set(get_answer_val) - - l1 = tk.Label(text=board_name, fg="light green", bg="dark green", - font="default 14 bold").grid(row=0, columnspan=2, sticky='EW', ipadx=2, ipady=2) - - l2 = tk.Label(text=question_txt).grid(row=1, pady=4, columnspan=2, sticky='EW') - - buttons = [] - - for index, val in enumerate(options): - buttons.append( - tk.Radiobutton( - text=val, - fg="black", - bg="lightgray", - relief=tk.SUNKEN, - selectcolor="green", - variable=radio_state, - value=index + 1, - indicatoron=0, - command=CPU_exit_3 - ).grid(row=index + 2, pady=1, ipady=2, ipadx=10, columnspan=2)) - - b6 = tk.Button(text="Cancel", fg="red", command=kill_session).grid(row=(2 + len(options)), column=0, padx=4, pady=4, ipadx=2, ipady=2) - - b7 = tk.Button(text="Continue", fg="green", command=got_answer).grid(row=(2 + len(options)), column=1, padx=4, pady=4, ipadx=2, ipady=2) - - def got_answer_(): - root_get_answer.destroy() - - def CPU_exit_3_(): - global get_answer_val - get_answer_val = radio_state.get() - - def kill_session_(): - raise SystemExit(0) # kill everything - - root_get_answer.mainloop() - -# end - get answer - - -# -# move custom board definitions from project folder to PlatformIO -# -def resolve_path(path): - import os - - # turn the selection into a partial path - - if 0 <= path.find('"'): - path = path[path.find('"'):] - if 0 <= path.find(', line '): - path = path.replace(', line ', ':') - path = path.replace('"', '') - - # get line and column numbers - line_num = 1 - column_num = 1 - line_start = path.find(':', 2) # use 2 here so don't eat Windows full path - column_start = path.find(':', line_start + 1) - if column_start == -1: - column_start = len(path) - column_end = path.find(':', column_start + 1) - if column_end == -1: - column_end = len(path) - if 0 <= line_start: - line_num = path[line_start + 1:column_start] - if line_num == '': - line_num = 1 - if column_start != column_end: - column_num = path[column_start + 1:column_end] - if column_num == '': - column_num = 0 - - index_end = path.find(',') - if 0 <= index_end: - path = path[:index_end] # delete comma and anything after - index_end = path.find(':', 2) - if 0 <= index_end: - path = path[:path.find(':', 2)] # delete the line number and anything after - - path = path.replace('\\', '/') - - if 1 == path.find(':') and current_OS == 'Windows': - return path, line_num, column_num # found a full path - no need for further processing - elif 0 == path.find('/') and (current_OS == 'Linux' or current_OS == 'Darwin'): - return path, line_num, column_num # found a full path - no need for further processing - - else: - - # resolve as many '../' as we can - while 0 <= path.find('../'): - end = path.find('../') - 1 - start = path.find('/') - while 0 <= path.find('/', start) < end: - start = path.find('/', start) + 1 - path = path[0:start] + path[end + 4:] - - # this is an alternative to the above - it just deletes the '../' section - # start_temp = path.find('../') - # while 0 <= path.find('../',start_temp): - # start = path.find('../',start_temp) - # start_temp = start + 1 - # if 0 <= start: - # path = path[start + 2 : ] - - start = path.find('/') - if start != 0: # make sure path starts with '/' - while 0 == path.find(' '): # eat any spaces at the beginning - path = path[1:] - path = '/' + path - - if current_OS == 'Windows': - search_path = path.replace('/', '\\') # os.walk uses '\' in Windows - else: - search_path = path - - start_path = os.path.abspath('') - - # search project directory for the selection - found = False - full_path = '' - for root, directories, filenames in os.walk(start_path): - for filename in filenames: - if 0 <= root.find('.git'): # don't bother looking in this directory - break - full_path = os.path.join(root, filename) - if 0 <= full_path.find(search_path): - found = True - break - if found: - break - - return full_path, line_num, column_num - -# end - resolve_path - - -# -# Open the file in the preferred editor at the line & column number -# If the preferred editor isn't already running then it tries the next. -# If none are open then the system default is used. -# -# Editor order: -# 1. Notepad++ (Windows only) -# 2. Sublime Text -# 3. Atom -# 4. System default (opens at line 1, column 1 only) -# -def open_file(path): - import subprocess - file_path, line_num, column_num = resolve_path(path) - - if file_path == '': - return - - if current_OS == 'Windows': - - editor_note = subprocess.check_output('wmic process where "name=' + "'notepad++.exe'" + '" get ExecutablePath') - editor_sublime = subprocess.check_output('wmic process where "name=' + "'sublime_text.exe'" + '" get ExecutablePath') - editor_atom = subprocess.check_output('wmic process where "name=' + "'atom.exe'" + '" get ExecutablePath') - - if 0 <= editor_note.find('notepad++.exe'): - start = editor_note.find('\n') + 1 - end = editor_note.find('\n', start + 5) - 4 - editor_note = editor_note[start:end] - command = file_path, ' -n' + str(line_num), ' -c' + str(column_num) - subprocess.Popen([editor_note, command]) - - elif 0 <= editor_sublime.find('sublime_text.exe'): - start = editor_sublime.find('\n') + 1 - end = editor_sublime.find('\n', start + 5) - 4 - editor_sublime = editor_sublime[start:end] - command = file_path + ':' + line_num + ':' + column_num - subprocess.Popen([editor_sublime, command]) - - elif 0 <= editor_atom.find('atom.exe'): - start = editor_atom.find('\n') + 1 - end = editor_atom.find('\n', start + 5) - 4 - editor_atom = editor_atom[start:end] - command = file_path + ':' + str(line_num) + ':' + str(column_num) - subprocess.Popen([editor_atom, command]) - - else: - os.startfile(resolve_path(path)) # open file with default app - - elif current_OS == 'Linux': - - command = file_path + ':' + str(line_num) + ':' + str(column_num) - index_end = command.find(',') - if 0 <= index_end: - command = command[:index_end] # sometimes a comma magically appears, don't want it - running_apps = subprocess.Popen('ps ax -o cmd', stdout=subprocess.PIPE, shell=True) - (output, err) = running_apps.communicate() - temp = output.split('\n') - - def find_editor_linux(name, search_obj): - for line in search_obj: - if 0 <= line.find(name): - path = line - return True, path - return False, '' - - (success_sublime, editor_path_sublime) = find_editor_linux('sublime_text', temp) - (success_atom, editor_path_atom) = find_editor_linux('atom', temp) - - if success_sublime: - subprocess.Popen([editor_path_sublime, command]) - - elif success_atom: - subprocess.Popen([editor_path_atom, command]) - - else: - os.system('xdg-open ' + file_path) - - elif current_OS == 'Darwin': # MAC - - command = file_path + ':' + str(line_num) + ':' + str(column_num) - index_end = command.find(',') - if 0 <= index_end: - command = command[:index_end] # sometimes a comma magically appears, don't want it - running_apps = subprocess.Popen('ps axwww -o command', stdout=subprocess.PIPE, shell=True) - (output, err) = running_apps.communicate() - temp = output.split('\n') - - def find_editor_mac(name, search_obj): - for line in search_obj: - if 0 <= line.find(name): - path = line - if 0 <= path.find('-psn'): - path = path[:path.find('-psn') - 1] - return True, path - return False, '' - - (success_sublime, editor_path_sublime) = find_editor_mac('Sublime', temp) - (success_atom, editor_path_atom) = find_editor_mac('Atom', temp) - - if success_sublime: - subprocess.Popen([editor_path_sublime, command]) - - elif success_atom: - subprocess.Popen([editor_path_atom, command]) - - else: - os.system('open ' + file_path) - -# end - open_file - - -# Get the last build environment -def get_build_last(): - env_last = '' - DIR_PWD = os.listdir('.') - if '.pio' in DIR_PWD: - date_last = 0.0 - DIR__pioenvs = os.listdir('.pio') - for name in DIR__pioenvs: - if 0 <= name.find('.') or 0 <= name.find('-'): # skip files in listing - continue - DIR_temp = os.listdir('.pio/build/' + name) - for names_temp in DIR_temp: - - if 0 == names_temp.find('firmware.'): - date_temp = os.path.getmtime('.pio/build/' + name + '/' + names_temp) - if date_temp > date_last: - date_last = date_temp - env_last = name - return env_last - - -# Get the board being built from the Configuration.h file -# return: board name, major version of Marlin being used (1 or 2) -def get_board_name(): - board_name = '' - # get board name - - with open('Marlin/Configuration.h', 'r') as myfile: - Configuration_h = myfile.read() - - Configuration_h = Configuration_h.split('\n') - Marlin_ver = 0 # set version to invalid number - for lines in Configuration_h: - if 0 == lines.find('#define CONFIGURATION_H_VERSION 01'): - Marlin_ver = 1 - if 0 == lines.find('#define CONFIGURATION_H_VERSION 02'): - Marlin_ver = 2 - board = lines.find(' BOARD_') + 1 - motherboard = lines.find(' MOTHERBOARD ') + 1 - define = lines.find('#define ') - comment = lines.find('//') - if (comment == -1 or comment > board) and \ - board > motherboard and \ - motherboard > define and \ - define >= 0 : - spaces = lines.find(' ', board) # find the end of the board substring - if spaces == -1: - board_name = lines[board:] - else: - board_name = lines[board:spaces] - break - - return board_name, Marlin_ver - - -# extract first environment name found after the start position -# return: environment name and position to start the next search from -def get_env_from_line(line, start_position): - env = '' - next_position = -1 - env_position = line.find('env:', start_position) - if 0 < env_position: - next_position = line.find(' ', env_position + 4) - if 0 < next_position: - env = line[env_position + 4:next_position] - else: - env = line[env_position + 4:] # at the end of the line - return env, next_position - - -def invalid_board(): - print('ERROR - invalid board') - print(board_name) - raise SystemExit(0) # quit if unable to find board - -# scan pins.h for board name and return the environment(s) found -def get_starting_env(board_name_full, version): - # get environment starting point - - if version == 1: - path = 'Marlin/pins.h' - if version == 2: - path = 'Marlin/src/pins/pins.h' - with open(path, 'r') as myfile: - pins_h = myfile.read() - - board_name = board_name_full[6:] # only use the part after "BOARD_" since we're searching the pins.h file - pins_h = pins_h.split('\n') - list_start_found = False - possible_envs = None - for i, line in enumerate(pins_h): - if 0 < line.find("Unknown MOTHERBOARD value set in Configuration.h"): - invalid_board() - if list_start_found == False and 0 < line.find('1280'): - list_start_found = True - elif list_start_found == False: # skip lines until find start of CPU list - continue - - # Use a regex to find the board. Make sure it is surrounded by separators so the full boardname - # will be matched, even if multiple exist in a single MB macro. This avoids problems with boards - # such as MALYAN_M200 and MALYAN_M200_V2 where one board is a substring of the other. - if re.search(r'MB.*[\(, ]' + board_name + r'[, \)]', line): - # need to look at the next line for environment info - possible_envs = re.findall(r'env:([^ ]+)', pins_h[i + 1]) - break - return possible_envs - - -# get environment to be used for the build -# return: environment -def get_env(board_name, ver_Marlin): - - def no_environment(): - print('ERROR - no environment for this board') - print(board_name) - raise SystemExit(0) # no environment so quit - - possible_envs = get_starting_env(board_name, ver_Marlin) - - if not possible_envs: - no_environment() - - # Proceed to ask questions based on the available environments to filter down to a smaller list. - # If more then one remains after this filtering the user will be prompted to choose between - # all remaining options. - - # Filter selection based on CPU choice - CPU_questions = [ - {'options':['1280', '2560'], 'text':'1280 or 2560 CPU?', 'default':2}, - {'options':['644', '1284'], 'text':'644 or 1284 CPU?', 'default':2}, - {'options':['STM32F103RC', 'STM32F103RE'], 'text':'MCU Type?', 'default':1}] - - for question in CPU_questions: - if any(question['options'][0] in env for env in possible_envs) and any(question['options'][1] in env for env in possible_envs): - get_answer(board_name, question['text'], [question['options'][0], question['options'][1]], question['default']) - possible_envs = [env for env in possible_envs if question['options'][get_answer_val - 1] in env] - - # Choose which STM32 framework to use, if both are available - if [env for env in possible_envs if '_maple' in env] and [env for env in possible_envs if '_maple' not in env]: - get_answer(board_name, 'Which STM32 Framework should be used?', ['ST STM32 (Preferred)', 'Maple (Deprecated)']) - if 1 == get_answer_val: - possible_envs = [env for env in possible_envs if '_maple' not in env] - else: - possible_envs = [env for env in possible_envs if '_maple' in env] - - # Both USB and non-USB STM32 options exist, filter based on these - if any('STM32F103R' in env for env in possible_envs) and any('_USB' in env for env in possible_envs) and any('_USB' not in env for env in possible_envs): - get_answer(board_name, 'USB Support?', ['USB', 'No USB']) - if 1 == get_answer_val: - possible_envs = [env for env in possible_envs if '_USB' in env] - else: - possible_envs = [env for env in possible_envs if '_USB' not in env] - - if not possible_envs: - no_environment() - if len(possible_envs) == 1: - return possible_envs[0] # only one environment so finished - - target_env = None - - # A few environments require special behavior - if 'LPC1768' in possible_envs: - if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'LPC1768_debug_and_upload'): - target_env = 'LPC1768_debug_and_upload' - else: - target_env = 'LPC1768' - elif 'DUE' in possible_envs: - target_env = 'DUE' - if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'DUE_debug'): - target_env = 'DUE_debug' - elif 'DUE_USB' in possible_envs: - get_answer(board_name, 'DUE Download Port?', ['(Native) USB port', 'Programming port']) - if 1 == get_answer_val: - target_env = 'DUE_USB' - else: - target_env = 'DUE' - else: - options = possible_envs - # Perform some substitutions for environment names which follow a consistent - # naming pattern and are very commonly used. This is fragile code, and replacements - # should only be made here for stable environments unlikely to change often. - for i, option in enumerate(options): - if 'melzi' in option: - options[i] = 'Melzi' - elif 'sanguino1284p' in option: - options[i] = 'sanguino1284p' - if 'optiboot' in option: - options[i] = options[i] + ' (Optiboot Bootloader)' - if 'optimized' in option: - options[i] = options[i] + ' (Optimized for Size)' - get_answer(board_name, 'Which environment?', options) - target_env = possible_envs[get_answer_val - 1] - - if build_type == 'traceback' and target_env != 'LPC1768_debug_and_upload' and target_env != 'DUE_debug' and Marlin_ver == 2: - print("ERROR - this board isn't setup for traceback") - print('board_name: ', board_name) - print('target_env: ', target_env) - raise SystemExit(0) - - return target_env - -# end - get_env - - -# puts screen text into queue so that the parent thread can fetch the data from this thread -if python_ver == 2: - import Queue as queue -else: - import queue as queue -IO_queue = queue.Queue() - - -#PIO_queue = queue.Queue() not used! -def write_to_screen_queue(text, format_tag='normal'): - double_in = [text, format_tag] - IO_queue.put(double_in, block=False) - - -# -# send one line to the terminal screen with syntax highlighting -# -# input: unformatted text, flags from previous run -# return: formatted text ready to go to the terminal, flags from this run -# -# This routine remembers the status from call to call because previous -# lines can affect how the current line is highlighted -# - -# 'static' variables - init here and then keep updating them from within print_line -warning = False -warning_FROM = False -error = False -standard = True -prev_line_COM = False -next_line_warning = False -warning_continue = False -line_counter = 0 - - -def line_print(line_input): - - global warning - global warning_FROM - global error - global standard - global prev_line_COM - global next_line_warning - global warning_continue - global line_counter - - # all '0' elements must precede all '1' elements or they'll be skipped - platformio_highlights = [ - ['Environment', 0, 'highlight_blue'], ['[SKIP]', 1, 'warning'], ['[IGNORED]', 1, 'warning'], ['[ERROR]', 1, 'error'], - ['[FAILED]', 1, 'error'], ['[SUCCESS]', 1, 'highlight_green'] - ] - - def write_to_screen_with_replace(text, highlights): # search for highlights & split line accordingly - did_something = False - for highlight in highlights: - found = text.find(highlight[0]) - if did_something == True: - break - if found >= 0: - did_something = True - if 0 == highlight[1]: - found_1 = text.find(' ') - found_tab = text.find('\t') - if not (0 <= found_1 <= found_tab): - found_1 = found_tab - write_to_screen_queue(text[:found_1 + 1]) - for highlight_2 in highlights: - if highlight[0] == highlight_2[0]: - continue - found = text.find(highlight_2[0]) - if found >= 0: - found_space = text.find(' ', found_1 + 1) - found_tab = text.find('\t', found_1 + 1) - if not (0 <= found_space <= found_tab): - found_space = found_tab - found_right = text.find(']', found + 1) - write_to_screen_queue(text[found_1 + 1:found_space + 1], highlight[2]) - write_to_screen_queue(text[found_space + 1:found + 1]) - write_to_screen_queue(text[found + 1:found_right], highlight_2[2]) - write_to_screen_queue(text[found_right:] + '\n') - break - break - if 1 == highlight[1]: - found_right = text.find(']', found + 1) - write_to_screen_queue(text[:found + 1]) - write_to_screen_queue(text[found + 1:found_right], highlight[2]) - write_to_screen_queue(text[found_right:] + '\n' + '\n') - break - if did_something == False: - r_loc = text.find('\r') + 1 - if 0 < r_loc < len(text): # need to split this line - text = text.split('\r') - for line in text: - if line != '': - write_to_screen_queue(line + '\n') - else: - write_to_screen_queue(text + '\n') - - # end - write_to_screen_with_replace - -# scan the line - line_counter = line_counter + 1 - max_search = len(line_input) - if max_search > 3: - max_search = 3 - beginning = line_input[:max_search] - - # set flags - if 0 < line_input.find(': warning: '): # start of warning block - warning = True - warning_FROM = False - error = False - standard = False - prev_line_COM = False - prev_line_COM = False - warning_continue = True - if 0 < line_input.find('Thank you') or 0 < line_input.find('SUMMARY'): - warning = False #standard line found - warning_FROM = False - error = False - standard = True - prev_line_COM = False - warning_continue = False - elif beginning == 'War' or \ - beginning == '#er' or \ - beginning == 'In ' or \ - (beginning != 'Com' and prev_line_COM == True and not(beginning == 'Arc' or beginning == 'Lin' or beginning == 'Ind') or \ - next_line_warning == True): - warning = True #warning found - warning_FROM = False - error = False - standard = False - prev_line_COM = False - elif beginning == 'Com' or \ - beginning == 'Ver' or \ - beginning == ' [E' or \ - beginning == 'Rem' or \ - beginning == 'Bui' or \ - beginning == 'Ind' or \ - beginning == 'PLA': - warning = False #standard line found - warning_FROM = False - error = False - standard = True - prev_line_COM = False - warning_continue = False - elif beginning == '***': - warning = False # error found - warning_FROM = False - error = True - standard = False - prev_line_COM = False - elif 0 < line_input.find(': error:') or \ - 0 < line_input.find(': fatal error:'): # start of warning /error block - warning = False # error found - warning_FROM = False - error = True - standard = False - prev_line_COM = False - warning_continue = True - elif beginning == 'fro' and warning == True or \ - beginning == '.pi' : # start of warning /error block - warning_FROM = True - prev_line_COM = False - warning_continue = True - elif warning_continue == True: - warning = True - warning_FROM = False # keep the warning status going until find a standard line or an error - error = False - standard = False - prev_line_COM = False - warning_continue = True - - else: - warning = False # unknown so assume standard line - warning_FROM = False - error = False - standard = True - prev_line_COM = False - warning_continue = False - - if beginning == 'Com': - prev_line_COM = True - -# print based on flags - if standard == True: - write_to_screen_with_replace(line_input, platformio_highlights) #print white on black with substitutions - if warning == True: - write_to_screen_queue(line_input + '\n', 'warning') - if error == True: - write_to_screen_queue(line_input + '\n', 'error') - -# end - line_print - - -########################################################################## -# # -# run Platformio # -# # -########################################################################## - -# build platformio run -e target_env -# clean platformio run --target clean -e target_env -# upload platformio run --target upload -e target_env -# traceback platformio run --target upload -e target_env -# program platformio run --target program -e target_env -# test platformio test upload -e target_env -# remote platformio remote run --target upload -e target_env -# debug platformio debug -e target_env - - -def sys_PIO(): - - ########################################################################## - # # - # run Platformio inside the same shell as this Python script # - # # - ########################################################################## - - global build_type - global target_env - - import os - - print('build_type: ', build_type) - print('starting platformio') - - if build_type == 'build': - # pio_result = os.system("echo -en '\033c'") - pio_result = os.system('platformio run -e ' + target_env) - elif build_type == 'clean': - pio_result = os.system('platformio run --target clean -e ' + target_env) - elif build_type == 'upload': - pio_result = os.system('platformio run --target upload -e ' + target_env) - elif build_type == 'traceback': - pio_result = os.system('platformio run --target upload -e ' + target_env) - elif build_type == 'program': - pio_result = os.system('platformio run --target program -e ' + target_env) - elif build_type == 'test': - pio_result = os.system('platformio test upload -e ' + target_env) - elif build_type == 'remote': - pio_result = os.system('platformio remote run --target program -e ' + target_env) - elif build_type == 'debug': - pio_result = os.system('platformio debug -e ' + target_env) - else: - print('ERROR - unknown build type: ', build_type) - raise SystemExit(0) # kill everything - - # stream output from subprocess and split it into lines - #for line in iter(pio_subprocess.stdout.readline, ''): - # line_print(line.replace('\n', '')) - - # append info used to run PlatformIO - # write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen - # write_to_screen_queue('Build type: ' + build_type + '\n') - # write_to_screen_queue('Environment used: ' + target_env + '\n') - # write_to_screen_queue(str(datetime.now()) + '\n') - -# end - sys_PIO - - -def run_PIO(dummy): - - global build_type - global target_env - global board_name - print('build_type: ', build_type) - - import subprocess - - print('starting platformio') - - if build_type == 'build': - # platformio run -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen( - ['platformio', 'run', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - - elif build_type == 'clean': - # platformio run --target clean -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen( - ['platformio', 'run', '--target', 'clean', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - - elif build_type == 'upload': - # platformio run --target upload -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen( - ['platformio', 'run', '--target', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - - elif build_type == 'traceback': - # platformio run --target upload -e target_env - select the debug environment if there is one - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen( - ['platformio', 'run', '--target', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - - elif build_type == 'program': - # platformio run --target program -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen( - ['platformio', 'run', '--target', 'program', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - - elif build_type == 'test': - #platformio test upload -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen( - ['platformio', 'test', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - - elif build_type == 'remote': - # platformio remote run --target upload -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen( - ['platformio', 'remote', 'run', '--target', 'program', '-e', target_env], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT - ) - - elif build_type == 'debug': - # platformio debug -e target_env - # combine stdout & stderr so all compile messages are included - pio_subprocess = subprocess.Popen( - ['platformio', 'debug', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - - else: - print('ERROR - unknown build type: ', build_type) - raise SystemExit(0) # kill everything - -# stream output from subprocess and split it into lines - if python_ver == 2: - for line in iter(pio_subprocess.stdout.readline, ''): - line_print(line.replace('\n', '')) - else: - for line in iter(pio_subprocess.stdout.readline, b''): - line = line.decode('utf-8') - line_print(line.replace('\n', '')) - -# append info used to run PlatformIO - write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen - write_to_screen_queue('Build type: ' + build_type + '\n') - write_to_screen_queue('Environment used: ' + target_env + '\n') - write_to_screen_queue(str(datetime.now()) + '\n') - -# end - run_PIO - -######################################################################## - -import threading -if python_ver == 2: - import Tkinter as tk - import Queue as queue - import ttk - from Tkinter import Tk, Frame, Text, Scrollbar, Menu - #from tkMessageBox import askokcancel this is not used: removed - import tkFileDialog as fileDialog -else: - import tkinter as tk - import queue as queue - from tkinter import ttk, Tk, Frame, Text, Menu -import sys -que = queue.Queue() -#IO_queue = queue.Queue() - - -class output_window(Text): - # based on Super Text - global continue_updates - continue_updates = True - - global search_position - search_position = '' # start with invalid search position - - global error_found - error_found = False # are there any errors? - - def __init__(self): - - self.root = tk.Tk() - self.root.attributes("-topmost", True) - self.frame = tk.Frame(self.root) - self.frame.pack(fill='both', expand=True) - - # text widget - #self.text = tk.Text(self.frame, borderwidth=3, relief="sunken") - Text.__init__(self, self.frame, borderwidth=3, relief="sunken") - self.config(tabs=(400, )) # configure Text widget tab stops - self.config(background='black', foreground='white', font=("consolas", 12), wrap='word', undo='True') - #self.config(background = 'black', foreground = 'white', font= ("consolas", 12), wrap = 'none', undo = 'True') - self.config(height=24, width=100) - self.config(insertbackground='pale green') # keyboard insertion point - self.pack(side='left', fill='both', expand=True) - - self.tag_config('normal', foreground='white') - self.tag_config('warning', foreground='yellow') - self.tag_config('error', foreground='red') - self.tag_config('highlight_green', foreground='green') - self.tag_config('highlight_blue', foreground='cyan') - self.tag_config('error_highlight_inactive', background='dim gray') - self.tag_config('error_highlight_active', background='light grey') - - self.bind_class("Text", "", self.select_all) # required in windows, works in others - self.bind_all("", self.scroll_errors) - self.bind_class("", self.rebuild) - - # scrollbar - - scrb = tk.Scrollbar(self.frame, orient='vertical', command=self.yview) - self.config(yscrollcommand=scrb.set) - scrb.pack(side='right', fill='y') - - #self.scrb_Y = tk.Scrollbar(self.frame, orient='vertical', command=self.yview) - #self.scrb_Y.config(yscrollcommand=self.scrb_Y.set) - #self.scrb_Y.pack(side='right', fill='y') - - #self.scrb_X = tk.Scrollbar(self.frame, orient='horizontal', command=self.xview) - #self.scrb_X.config(xscrollcommand=self.scrb_X.set) - #self.scrb_X.pack(side='bottom', fill='x') - - #scrb_X = tk.Scrollbar(self, orient=tk.HORIZONTAL, command=self.xview) # tk.HORIZONTAL now have a horizsontal scroll bar BUT... shrinks it to a postage stamp and hides far right behind the vertical scroll bar - #self.config(xscrollcommand=scrb_X.set) - #scrb_X.pack(side='bottom', fill='x') - - #scrb= tk.Scrollbar(self, orient='vertical', command=self.yview) - #self.config(yscrollcommand=scrb.set) - #scrb.pack(side='right', fill='y') - - #self.config(height = 240, width = 1000) # didn't get the size baCK TO NORMAL - #self.pack(side='left', fill='both', expand=True) # didn't get the size baCK TO NORMAL - - # pop-up menu - self.popup = tk.Menu(self, tearoff=0) - - self.popup.add_command(label='Copy', command=self._copy) - self.popup.add_command(label='Paste', command=self._paste) - self.popup.add_separator() - self.popup.add_command(label='Cut', command=self._cut) - self.popup.add_separator() - self.popup.add_command(label='Select All', command=self._select_all) - self.popup.add_command(label='Clear All', command=self._clear_all) - self.popup.add_separator() - self.popup.add_command(label='Save As', command=self._file_save_as) - self.popup.add_separator() - #self.popup.add_command(label='Repeat Build(CTL-shift-r)', command=self._rebuild) - self.popup.add_command(label='Repeat Build', command=self._rebuild) - self.popup.add_separator() - self.popup.add_command(label='Scroll Errors (CTL-shift-e)', command=self._scroll_errors) - self.popup.add_separator() - self.popup.add_command(label='Open File at Cursor', command=self._open_selected_file) - - if current_OS == 'Darwin': # MAC - self.bind('', self._show_popup) # macOS only - else: - self.bind('', self._show_popup) # Windows & Linux - -# threading & subprocess section - - def start_thread(self, ): - global continue_updates - # create then start a secondary thread to run an arbitrary function - # must have at least one argument - self.secondary_thread = threading.Thread(target=lambda q, arg1: q.put(run_PIO(arg1)), args=(que, '')) - self.secondary_thread.start() - continue_updates = True - # check the Queue in 50ms - self.root.after(50, self.check_thread) - self.root.after(50, self.update) - - def check_thread(self): # wait for user to kill the window - global continue_updates - if continue_updates == True: - self.root.after(10, self.check_thread) - - def update(self): - global continue_updates - if continue_updates == True: - self.root.after(10, self.update) #method is called every 50ms - temp_text = ['0', '0'] - if IO_queue.empty(): - if not (self.secondary_thread.is_alive()): - continue_updates = False # queue is exhausted and thread is dead so no need for further updates - else: - try: - temp_text = IO_queue.get(block=False) - except queue.Empty: - continue_updates = False # queue is exhausted so no need for further updates - else: - self.insert('end', temp_text[0], temp_text[1]) - self.see("end") # make the last line visible (scroll text off the top) - -# text editing section - - def _scroll_errors(self): - global search_position - global error_found - if search_position == '': # first time so highlight all errors - countVar = tk.IntVar() - search_position = '1.0' - search_count = 0 - while search_position != '' and search_count < 100: - search_position = self.search("error", search_position, stopindex="end", count=countVar, nocase=1) - search_count = search_count + 1 - if search_position != '': - error_found = True - end_pos = '{}+{}c'.format(search_position, 5) - self.tag_add("error_highlight_inactive", search_position, end_pos) - search_position = '{}+{}c'.format(search_position, 1) # point to the next character for new search - else: - break - - if error_found: - if search_position == '': - search_position = self.search("error", '1.0', stopindex="end", nocase=1) # new search - else: # remove active highlight - end_pos = '{}+{}c'.format(search_position, 5) - start_pos = '{}+{}c'.format(search_position, -1) - self.tag_remove("error_highlight_active", start_pos, end_pos) - search_position = self.search( - "error", search_position, stopindex="end", nocase=1 - ) # finds first occurrence AGAIN on the first time through - if search_position == "": # wrap around - search_position = self.search("error", '1.0', stopindex="end", nocase=1) - end_pos = '{}+{}c'.format(search_position, 5) - self.tag_add("error_highlight_active", search_position, end_pos) # add active highlight - self.see(search_position) - search_position = '{}+{}c'.format(search_position, 1) # point to the next character for new search - - def scroll_errors(self, event): - self._scroll_errors() - - def _rebuild(self): - #global board_name - #global Marlin_ver - #global target_env - #board_name, Marlin_ver = get_board_name() - #target_env = get_env(board_name, Marlin_ver) - self.start_thread() - - def rebuild(self, event): - print("event happened") - self._rebuild() - - def _open_selected_file(self): - current_line = self.index('insert') - line_start = current_line[:current_line.find('.')] + '.0' - line_end = current_line[:current_line.find('.')] + '.200' - self.mark_set("path_start", line_start) - self.mark_set("path_end", line_end) - path = self.get("path_start", "path_end") - from_loc = path.find('from ') - colon_loc = path.find(': ') - if 0 <= from_loc and ((colon_loc == -1) or (from_loc < colon_loc)): - path = path[from_loc + 5:] - if 0 <= colon_loc: - path = path[:colon_loc] - if 0 <= path.find('\\') or 0 <= path.find('/'): # make sure it really contains a path - open_file(path) - - def _file_save_as(self): - self.filename = fileDialog.asksaveasfilename(defaultextension='.txt') - f = open(self.filename, 'w') - f.write(self.get('1.0', 'end')) - f.close() - - def copy(self, event): - try: - selection = self.get(*self.tag_ranges('sel')) - self.clipboard_clear() - self.clipboard_append(selection) - except TypeError: - pass - - def cut(self, event): - try: - selection = self.get(*self.tag_ranges('sel')) - self.clipboard_clear() - self.clipboard_append(selection) - self.delete(*self.tag_ranges('sel')) - except TypeError: - pass - - def _show_popup(self, event): - '''right-click popup menu''' - - if self.root.focus_get() != self: - self.root.focus_set() - - try: - self.popup.tk_popup(event.x_root, event.y_root, 0) - finally: - self.popup.grab_release() - - def _cut(self): - try: - selection = self.get(*self.tag_ranges('sel')) - self.clipboard_clear() - self.clipboard_append(selection) - self.delete(*self.tag_ranges('sel')) - except TypeError: - pass - - def cut(self, event): - self._cut() - - def _copy(self): - - try: - selection = self.get(*self.tag_ranges('sel')) - self.clipboard_clear() - self.clipboard_append(selection) - except TypeError: - pass - - def copy(self, event): - self._copy() - - def _paste(self): - self.insert('insert', self.selection_get(selection='CLIPBOARD')) - - def _select_all(self): - self.tag_add('sel', '1.0', 'end') - - def select_all(self, event): - self.tag_add('sel', '1.0', 'end') - - def _clear_all(self): - #'''erases all text''' - # - #isok = askokcancel('Clear All', 'Erase all text?', frame=self, - # default='ok') - #if isok: - # self.delete('1.0', 'end') - self.delete('1.0', 'end') - -# end - output_window - - -def main(): - - ########################################################################## - # # - # main program # - # # - ########################################################################## - - global build_type - global target_env - global board_name - global Marlin_ver - - board_name, Marlin_ver = get_board_name() - - target_env = get_env(board_name, Marlin_ver) - - # Re-use the VSCode terminal, if possible - if os.environ.get('PLATFORMIO_CALLER', '') == 'vscode': - sys_PIO() - else: - auto_build = output_window() - auto_build.start_thread() # executes the "run_PIO" function - - auto_build.root.mainloop() - - -if __name__ == '__main__': - - main() diff --git a/buildroot/share/vscode/create_custom_upload_command_CDC.py b/buildroot/share/vscode/create_custom_upload_command_CDC.py deleted file mode 100644 index b2d4d5715a..0000000000 --- a/buildroot/share/vscode/create_custom_upload_command_CDC.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env python -# -# Builds custom upload command -# 1) Run platformio as a subprocess to find a COM port -# 2) Build the upload command -# 3) Exit and let upload tool do the work -# -# This script runs between completion of the library/dependencies installation and compilation. -# -# Will continue on if a COM port isn't found so that the compilation can be done. -# - -from __future__ import print_function -from __future__ import division - -import subprocess, os, platform -from SCons.Script import DefaultEnvironment - -current_OS = platform.system() - -env = DefaultEnvironment() - -build_type = os.environ.get("BUILD_TYPE", 'Not Set') - - -if not(build_type == 'upload' or build_type == 'traceback' or build_type == 'Not Set') : - env.Replace(UPLOAD_PROTOCOL = 'teensy-gui') # run normal Teensy2 scripts -else: - com_first = '' - com_last = '' - com_CDC = '' - description_first = '' - description_last = '' - description_CDC = '' - - # - # grab the first com port that pops up unless we find one we know for sure - # is a CDC device - # - def get_com_port(com_search_text, descr_search_text, start): - - global com_first - global com_last - global com_CDC - global description_first - global description_last - global description_CDC - - - print('\nLooking for Serial Port\n') - - # stream output from subprocess and split it into lines - pio_subprocess = subprocess.Popen(['platformio', 'device', 'list'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - - looking_for_description = False - for line in iter(pio_subprocess.stdout.readline, ''): - if 0 <= line.find(com_search_text): - looking_for_description = True - com_last = line.replace('\n', '') - if com_first == '': - com_first = com_last - if 0 <= line.find(descr_search_text) and looking_for_description: - looking_for_description = False - description_last = line[ start : ] - if description_first == '': - description_first = description_last - if 0 <= description_last.find('CDC'): - com_CDC = com_last - description_CDC = description_last - - if com_CDC == '' and com_first != '': - com_CDC = com_first - description_CDC = description_first - elif com_CDC == '': - com_CDC = 'COM_PORT_NOT_FOUND' - - while 0 <= com_CDC.find('\n'): - com_CDC = com_CDC.replace('\n', '') - while 0 <= com_CDC.find('\r'): - com_CDC = com_CDC.replace('\r', '') - - if com_CDC == 'COM_PORT_NOT_FOUND': - print(com_CDC, '\n') - else: - print('FOUND: ', com_CDC) - print('DESCRIPTION: ', description_CDC, '\n') - - if current_OS == 'Windows': - - get_com_port('COM', 'Hardware ID:', 13) - - # avrdude_conf_path = env.get("PIOHOME_DIR") + '\\packages\\toolchain-atmelavr\\etc\\avrdude.conf' - avrdude_conf_path = 'buildroot\\share\\vscode\\avrdude.conf' - - avrdude_exe_path = 'buildroot\\share\\vscode\\avrdude_5.10.exe' - - # source_path = env.get("PROJECTBUILD_DIR") + '\\' + env.get("PIOENV") + '\\firmware.hex' - source_path = '.pio\\build\\' + env.get("PIOENV") + '\\firmware.hex' - - upload_string = avrdude_exe_path + ' -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i' - - - if current_OS == 'Darwin': # MAC - - get_com_port('usbmodem', 'Description:', 13) - -# avrdude_conf_path = env.get("PIOHOME_DIR") + '/packages/toolchain-atmelavr/etc/avrdude.conf' - avrdude_conf_path = 'buildroot/share/vscode/avrdude_macOS.conf' - - - avrdude_exe_path = 'buildroot/share/vscode/avrdude_5.10_macOS' - -# source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex' - source_path = '.pio/build/' + env.get("PIOENV") + '/firmware.hex' - - -# upload_string = 'avrdude -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i' - upload_string = avrdude_exe_path + ' -p usb1286 -c avr109 -P ' + com_CDC + ' -C ' + avrdude_conf_path + ' -U flash:w:' + source_path + ':i' - print('upload_string: ', upload_string) - - - - if current_OS == 'Linux': - - get_com_port('/dev/tty', 'Description:', 13) - -# avrdude_conf_path = env.get("PIOHOME_DIR") + '/packages/toolchain-atmelavr/etc/avrdude.conf' - avrdude_conf_path = 'buildroot/share/vscode/avrdude_linux.conf' - - - avrdude_exe_path = 'buildroot/share/vscode/avrdude_5.10_linux' -# source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex' - source_path = '.pio/build/' + env.get("PIOENV") + '/firmware.hex' - -# upload_string = 'avrdude -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i' - upload_string = avrdude_exe_path + ' -p usb1286 -c avr109 -P ' + com_CDC + ' -C ' + avrdude_conf_path + ' -U flash:w:' + source_path + ':i' - - - env.Replace( - UPLOADCMD = upload_string, - MAXIMUM_RAM_SIZE = 8192, - MAXIMUM_SIZE = 130048 - ) diff --git a/buildroot/share/vscode/create_custom_upload_command_DFU.py b/buildroot/share/vscode/create_custom_upload_command_DFU.py deleted file mode 100644 index 22809e177f..0000000000 --- a/buildroot/share/vscode/create_custom_upload_command_DFU.py +++ /dev/null @@ -1,41 +0,0 @@ -# -# Builds custom upload command -# 1) Run platformio as a subprocess to find a COM port -# 2) Build the upload command -# 3) Exit and let upload tool do the work -# -# This script runs between completion of the library/dependencies installation and compilation. -# -# Will continue on if a COM port isn't found so that the compilation can be done. -# - -import os, platform -from SCons.Script import DefaultEnvironment - -current_OS = platform.system() - -env = DefaultEnvironment() - -build_type = os.environ.get("BUILD_TYPE", 'Not Set') -if not(build_type == 'upload' or build_type == 'traceback' or build_type == 'Not Set') : - env.Replace(UPLOAD_PROTOCOL = 'teensy-gui') # run normal Teensy2 scripts -else: - - if current_OS == 'Windows': - avrdude_conf_path = env.get("PIOHOME_DIR") + '\\packages\\toolchain-atmelavr\\etc\\avrdude.conf' - - source_path = env.get("PROJECTBUILD_DIR") + '\\' + env.get("PIOENV") + '\\firmware.hex' - - upload_string = 'avrdude -p usb1286 -c flip1 -C ' + avrdude_conf_path + ' -U flash:w:' + source_path + ':i' - - else: - source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex' - - upload_string = 'avrdude -p usb1286 -c flip1 -U flash:w:' + source_path + ':i' - - - env.Replace( - UPLOADCMD = upload_string, - MAXIMUM_RAM_SIZE = 8192, - MAXIMUM_SIZE = 130048 - ) diff --git a/process-palette.json b/process-palette.json deleted file mode 100644 index b3b05b99a7..0000000000 --- a/process-palette.json +++ /dev/null @@ -1,357 +0,0 @@ -{ - "patterns": { - "P1": { - "expression": "(path):(line)" - }, - "P2": { - "expression": "(path)\\s+(line)", - "path": "(?:\\/[\\w\\.\\-]+)+" - } - }, - "commands": [ - { - "namespace": "process-palette", - "action": "PIO Build", - "command": "python buildroot/share/vscode/auto_build.py build", - "arguments": [], - "cwd": "{projectPath}", - "inputDialogs": [], - "env": {}, - "keystroke": null, - "stream": true, - "outputTarget": "panel", - "outputBufferSize": 80000, - "maxCompleted": 3, - "autoShowOutput": true, - "autoHideOutput": false, - "scrollLockEnabled": false, - "singular": true, - "promptToSave": true, - "saveOption": "none", - "patterns": [ - "default" - ], - "successOutput": "{stdout}", - "errorOutput": "{stdout}\n{stderr}", - "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "startMessage": "", - "successMessage": "Executed : {fullCommand}", - "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}", - "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "menus": [ - "Auto Build" - ], - "startScript": null, - "successScript": null, - "errorScript": null, - "scriptOnStart": false, - "scriptOnSuccess": false, - "scriptOnError": false, - "notifyOnStart": false, - "notifyOnSuccess": true, - "notifyOnError": true, - "input": null - }, - { - "namespace": "process-palette", - "action": "PIO Clean", - "command": "python buildroot/share/vscode/auto_build.py clean", - "arguments": [], - "cwd": "{projectPath}", - "inputDialogs": [], - "env": {}, - "keystroke": null, - "stream": true, - "outputTarget": "panel", - "outputBufferSize": 80000, - "maxCompleted": 3, - "autoShowOutput": true, - "autoHideOutput": false, - "scrollLockEnabled": false, - "singular": false, - "promptToSave": true, - "saveOption": "none", - "patterns": [ - "default" - ], - "successOutput": "{stdout}", - "errorOutput": "{stdout}\n{stderr}", - "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "startMessage": null, - "successMessage": "Executed : {fullCommand}", - "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}", - "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "menus": [ - "Auto Build" - ], - "startScript": null, - "successScript": null, - "errorScript": null, - "scriptOnStart": false, - "scriptOnSuccess": false, - "scriptOnError": false, - "notifyOnStart": false, - "notifyOnSuccess": true, - "notifyOnError": true, - "input": null - }, - { - "namespace": "process-palette", - "action": "PIO Upload", - "command": "python buildroot/share/vscode/auto_build.py upload", - "arguments": [], - "cwd": "{projectPath}", - "inputDialogs": [], - "env": {}, - "keystroke": null, - "stream": true, - "outputTarget": "panel", - "outputBufferSize": 80000, - "maxCompleted": 3, - "autoShowOutput": true, - "autoHideOutput": false, - "scrollLockEnabled": false, - "singular": false, - "promptToSave": true, - "saveOption": "none", - "patterns": [ - "default" - ], - "successOutput": "{stdout}", - "errorOutput": "{stdout}\n{stderr}", - "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "startMessage": null, - "successMessage": "Executed : {fullCommand}", - "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}", - "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "menus": [ - "Auto Build" - ], - "startScript": null, - "successScript": null, - "errorScript": null, - "scriptOnStart": false, - "scriptOnSuccess": false, - "scriptOnError": false, - "notifyOnStart": false, - "notifyOnSuccess": true, - "notifyOnError": true, - "input": null - }, - { - "namespace": "process-palette", - "action": "PIO Upload (traceback)", - "command": "python buildroot/share/vscode/auto_build.py traceback", - "arguments": [], - "cwd": "{projectPath}", - "inputDialogs": [], - "env": {}, - "keystroke": null, - "stream": true, - "outputTarget": "panel", - "outputBufferSize": 80000, - "maxCompleted": 3, - "autoShowOutput": true, - "autoHideOutput": false, - "scrollLockEnabled": false, - "singular": false, - "promptToSave": true, - "saveOption": "none", - "patterns": [ - "default" - ], - "successOutput": "{stdout}", - "errorOutput": "{stdout}\n{stderr}", - "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "startMessage": null, - "successMessage": "Executed : {fullCommand}", - "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}", - "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "menus": [ - "Auto Build" - ], - "startScript": null, - "successScript": null, - "errorScript": null, - "scriptOnStart": false, - "scriptOnSuccess": false, - "scriptOnError": false, - "notifyOnStart": false, - "notifyOnSuccess": true, - "notifyOnError": true, - "input": null - }, - { - "namespace": "process-palette", - "action": "PIO Upload using Programmer", - "command": "python buildroot/share/vscode/auto_build.py program", - "arguments": [], - "cwd": "{projectPath}", - "inputDialogs": [], - "env": {}, - "keystroke": null, - "stream": true, - "outputTarget": "panel", - "outputBufferSize": 80000, - "maxCompleted": 3, - "autoShowOutput": true, - "autoHideOutput": false, - "scrollLockEnabled": false, - "singular": false, - "promptToSave": true, - "saveOption": "none", - "patterns": [ - "default" - ], - "successOutput": "{stdout}", - "errorOutput": "{stdout}\n{stderr}", - "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "startMessage": null, - "successMessage": "Executed : {fullCommand}", - "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}", - "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "menus": [ - "Auto Build" - ], - "startScript": null, - "successScript": null, - "errorScript": null, - "scriptOnStart": false, - "scriptOnSuccess": false, - "scriptOnError": false, - "notifyOnStart": false, - "notifyOnSuccess": true, - "notifyOnError": true, - "input": null - }, - { - "namespace": "process-palette", - "action": "PIO Test", - "command": "python buildroot/share/vscode/auto_build.py test", - "arguments": [], - "cwd": "{projectPath}", - "inputDialogs": [], - "env": {}, - "keystroke": null, - "stream": true, - "outputTarget": "panel", - "outputBufferSize": 80000, - "maxCompleted": 3, - "autoShowOutput": true, - "autoHideOutput": false, - "scrollLockEnabled": false, - "singular": false, - "promptToSave": true, - "saveOption": "none", - "patterns": [ - "default" - ], - "successOutput": "{stdout}", - "errorOutput": "{stdout}\n{stderr}", - "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "startMessage": null, - "successMessage": "Executed : {fullCommand}", - "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}", - "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "menus": [ - "Auto Build" - ], - "startScript": null, - "successScript": null, - "errorScript": null, - "scriptOnStart": false, - "scriptOnSuccess": false, - "scriptOnError": false, - "notifyOnStart": false, - "notifyOnSuccess": true, - "notifyOnError": true, - "input": null - }, - { - "namespace": "process-palette", - "action": "PIO Debug", - "command": "python buildroot/share/vscode/auto_build.py debug", - "arguments": [], - "cwd": "{projectPath}", - "inputDialogs": [], - "env": {}, - "keystroke": null, - "stream": true, - "outputTarget": "panel", - "outputBufferSize": 80000, - "maxCompleted": 3, - "autoShowOutput": true, - "autoHideOutput": false, - "scrollLockEnabled": false, - "singular": false, - "promptToSave": true, - "saveOption": "none", - "patterns": [ - "default" - ], - "successOutput": "{stdout}", - "errorOutput": "{stdout}\n{stderr}", - "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "startMessage": null, - "successMessage": "Executed : {fullCommand}", - "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}", - "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "menus": [ - "Auto Build" - ], - "startScript": null, - "successScript": null, - "errorScript": null, - "scriptOnStart": false, - "scriptOnSuccess": false, - "scriptOnError": false, - "notifyOnStart": false, - "notifyOnSuccess": true, - "notifyOnError": true, - "input": null - }, - { - "namespace": "process-palette", - "action": "PIO Remote", - "command": "python buildroot/share/vscode/auto_build.py remote", - "arguments": [], - "cwd": "{projectPath}", - "inputDialogs": [], - "env": {}, - "keystroke": null, - "stream": true, - "outputTarget": "panel", - "outputBufferSize": 80000, - "maxCompleted": 3, - "autoShowOutput": true, - "autoHideOutput": false, - "scrollLockEnabled": false, - "singular": false, - "promptToSave": true, - "saveOption": "none", - "patterns": [ - "default" - ], - "successOutput": "{stdout}", - "errorOutput": "{stdout}\n{stderr}", - "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "startMessage": null, - "successMessage": "Executed : {fullCommand}", - "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}", - "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}", - "menus": [ - "Auto Build" - ], - "startScript": null, - "successScript": null, - "errorScript": null, - "scriptOnStart": false, - "scriptOnSuccess": false, - "scriptOnError": false, - "notifyOnStart": false, - "notifyOnSuccess": true, - "notifyOnError": true, - "input": null - } - ] -} From d4c34205b5de9be56bc97d5a88de6613916c9d30 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 19 Nov 2024 06:08:59 +0000 Subject: [PATCH 20/22] [cron] Bump distribution date (2024-11-19) --- 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 5789691396..a81caf0826 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 "2024-11-16" +//#define STRING_DISTRIBUTION_DATE "2024-11-19" /** * The protocol for communication to the host. Protocol indicates communication diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 8be19d05ef..244173175f 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 "2024-11-16" + #define STRING_DISTRIBUTION_DATE "2024-11-19" #endif /** From 5951e646d0b90b7ffe6ec0b71473c98b72cb7389 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 20 Nov 2024 22:10:53 -0600 Subject: [PATCH 21/22] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fix?= =?UTF-8?q?=20archive=20clean=20for=20build=5Fexample?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/build_example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/bin/build_example b/buildroot/bin/build_example index 9814058c0e..259fb46872 100755 --- a/buildroot/bin/build_example +++ b/buildroot/bin/build_example @@ -203,7 +203,7 @@ else # Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality if ((ARCHIVE)); then annc "Archiving" - rm -f "$ARCSUB"/*.bin.tar.gz "$ARCSUB"/*.hex.tar.gz + rm -f "$ARCSUB"/*.tar.gz "$ARCSUB"/*.sha256.txt find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c ' ARCSUB="$1" CONFIG="$2" From 3810986dba7c9d685b3eb809482e891f5a9f5b20 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 21 Nov 2024 06:08:46 +0000 Subject: [PATCH 22/22] [cron] Bump distribution date (2024-11-21) --- 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 a81caf0826..fd04347b50 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 "2024-11-19" +//#define STRING_DISTRIBUTION_DATE "2024-11-21" /** * The protocol for communication to the host. Protocol indicates communication diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 244173175f..6d8cdbd2e1 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 "2024-11-19" + #define STRING_DISTRIBUTION_DATE "2024-11-21" #endif /**