From ec8c50d4231a5a82c11d184f1706f337733d2d8f Mon Sep 17 00:00:00 2001 From: TheMichalcinOfficial <73078661+TheMichalcinOfficial@users.noreply.github.com> Date: Tue, 19 Oct 2021 20:08:22 +0200 Subject: [PATCH] Update from original upstream (#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * πŸ› Fix some board names * 🎨 NULL => nullptr * πŸ› Fix delta calibrate manual move scale (#22430) * πŸ› Fix Longer3D SDSS / SD_SS (#22444) * πŸ› Fix SKR Pro bad directive (#22438) * πŸ› Fix LCD Menu MBL Z-Offset Adjustment (#22450) * πŸ› Reset workDirDepth in cdroot() (#22441) * πŸ“Ί Fix and optimize FTDI Eve Touch Interface (#22427) * 🎨 abs => ABS * ⚑️ Larger FYSETC S6 I2C EEPROM size (#22424) * πŸ› SAV_3DGLCD conditionals (#22447) * πŸ“Ί MKS MINI12864 V3 for Robin E3P, etc. (#22453) * πŸ”§ HAS_CUSTOM_PROBE_PIN => USES_Z_MIN_PROBE_PIN * πŸ”¨ Fix: BIGTREE_E3_RRF doesn't use user RX/TX sizes (#22475) Fixes #22466. Regression from #22377. * πŸ› Fix DGUS displays compile (#22464) * βœ… Custom logging for MBL * πŸ› Fix custom menus on TFT LVGL Fixes #21423. Regression from #18177. * πŸ› Fix custom menus on MKS UI (#22470) * πŸ”¨ Update Longer and Chitu envs (#22467) * 🎨 Adjust settings.cpp indent * πŸ› Fix sprintf_P compile error (Maple) (#22479) * πŸ› Fix extra E move in toolchange with ..._NO_RETURN (#22504) * πŸ› Allow SKR Pro CONTROLLER_FAN_PIN override Followup to #22411 * πŸ”§ Sanity-check Mixing plus Disable Inactive Extruder See #22166 * πŸ”§ Sanity-check DEFAULT_EJERK with LIN_ADVANCE See #20649 * πŸ’š Fix tests for new sanity-checks * 🎨 Fix "'EEPROM' unused" warning (#22511) * πŸ› Fix report_a_position ABC criteria * πŸ› Fix Longer3D STM32 boot, add Maple test (#22473) * πŸ› Prevent ABL G29 setting a funky feedrate See #22472 * 🚸 Prevent M42 unintended pin change to output (#22493) * 🚸 Fix BLTouch spelling * πŸ”¨ Offset/encrypt/rename for Maple STM32F1 (#22477) * ✨ M256 LCD brightness (#22478) * πŸ› Fix G38 with probe on Z_MIN (#22452) * πŸ› Followup to 6 linear axes (#22482) * πŸ› Fix up endstop flags (#22487, #22525) * ✨ MKS Monster8 board (#22455) * πŸ› Fix MKS 'USB Flash MSC' environments (#22515) * πŸ“Œ MKS pins for PSU_CONTROL (#22528) * ✨ Simulator HAL and build targets (#22418) * πŸ› Fix some Simulator on Windows issues (#22516) * πŸ—οΈ Define HAL_STM32 for HAL/STM32 (#22537) * πŸ› Fix fan index for Singlenozzle, chamber fan Fixes #22512 Followup to #19152, #19519 * 🎨 Add DWIN_StatusChanged_P * 🎨 Misc. Cleanup * πŸ”¨ Fix FYSETC S6 envs (#22421) Co-authored-by: Scott Lahteine * 🌐 Level Corners => Bed Tramming * πŸš‘οΈ Init FastIO before anything else (#22508) * ✨ Zonestar ZM3E2, ZM3E4 V1, ZM3E4 V2 (#22498) * πŸ› Fix and improve FTDI Eve Touch UI (#22361, #22439, #22459, #22468, #22500, #22530) * πŸ› Fix CoreXY plus extra axes See #22490 * πŸ› Use delete [] for new [] * 🚸 Set M122 interval only with S0 or Pn * 🎨 Update HAL/STM32 wrappers Followup to #22537 * πŸ“ Document DGUS display options (#22443) * πŸ”¨ Fix: BIGTREE_E3_RRF doesn't use user RX/TX sizes Fixes #22466. Regression from #22377. * 🚚 Relocate and adjust DWIN E3V2 (#22471) * πŸ› Fix Ender-3 v2 language init (#22550) * πŸ”¨ Fix (RRF E3) RX/TX buffer size override (#22475) * πŸ› Spellcheck comments (#22496) codespell -q 3 --builtin=clear,rare,informal,code -S ./Marlin/src/lcd/language -L alo,amin,endcode,stdio,uint * 🚸 Better error for MOTHERBOARD not defined (#22551) * 🎨 Tweak M73 condition * πŸ› Fix M575 port index output (#22553) * πŸ”¨ Use zip link for MarlinSimUI * πŸ› Fix some BTT SKR2 pins (#22558) * 🚸 Fewer CRs in settings report (#22560) * πŸ› Fix LCD_COL_X_RJ Followup to #22471 * πŸ’š Update STM32F103RET6_creality test path * βͺ️ Revert ABL G29 feedrate (#22574) Reverts 9130f58 * ⚑️ Simplify PROBING_STEPPERS_OFF (#22581) * πŸ› Fix Longer3D PWM/timer pins (#22583) * πŸ› Fix STM32 delay, double reset in FSMC TFT init (#22584) * πŸ“Œ Disregard TMCStepper 0.7.2 * ♻️ Clean up CrealityUI and MarlinUI (#22586) * ✨ Mixer Presets (#21562) * ✨ Power-off confirm / beep options (#22191) * ♻️ Consolidate PSU_CONTROL (#22304) * ✨ Add TEMP_SENSOR_BOARD (#22279, #22342, #22343, #22344, #22350) * ✨ D576 Buffer Monitoring (#19674) * ✨ M76 Host Pause Feature (#21738) * 🎨 Update MKSPWC, some other pins (#22557) * ✨ MKS MINI12864 V3 for MKS Robin Nano V2/3 (#22285) * 🎨 Fix some formatting, F() versus PSTR() * πŸ› Show bed size as 'work:' in M115 Fixes #22598 * 🌐 Update menu titles, add more IJK (#22605) Followup to #19112 * πŸ› Update H-bot / Core for 6-axis (#22600) Followup to #19112 * ⬆️ TMCStepper 0.7.3 (#22608) * 🎨 Tweak TMC software serial pins * 🎨 Misc code and spacing cleanup * ✨ BOARD_RUMBA32_BTT (#22607) * ✨ MarlinUI for Ender 3 v2 DWIN LCD (#22594) Co-Authored-By: Taylor Talkington * πŸ› Fix LPC176x M43 Pins Debugging (#22611) * 🎨 Define FYSETC S6 and TH3D EZBoard EXP1/2 pins * ✨ New board TH3D_EZBOARD_LITE_V2 (#22621) * 🎨 EXP1/2 headers and pins cleanup (#22628) * πŸ› Fix Multi-Endstop stepping (#22625) * 🩹 Use in MAX31865 lib (#22618) * πŸ”¨ Melzi with OptiBoot build (#22630) * 🩹 Tweak startup message (#22633) * πŸ”¨ Set Longer3D timers in variant (#22632) * πŸ“ AlephObjects => LulzBot * 🎨 EXP headers, ST7920 delays (#22641) * 🎨 Update more EXP Headers * 🩹 Sensorless homing tweak * ⚑️ Improve G2/G3 arc handling (#22599) * πŸ› Fix SDSUPPORT for SKR CR-6 (#22668) Co-authored-by: Sebastiaan Dammann * ⚑️ Enhance and fix FTDI Eve Touch UI file select (#22651) * ⚑️ Fix, enhance FTDI Eve Touch UI (#22619) * πŸ”¨ Three columns in mftest menu * 🌐 MSG_PROBING_MESH => MSG_PROBING_POINT * 🎨 screws_tilt_adjust_pos => tramming_points * πŸ”¨ Fix HAL/STM32 F103Zx builds (#22610) * 🌐 Update Italian language (#22645) * 🌐 Update Hungarian language (#22678) * 🩹 Fix LPC176x M43 formatting (#22680) * βͺ️ Revert MAX31865 recent changes (#22660) * 🚸 Improve Tramming Wizard usability (#22672) * 🩹 Clean up BTT_SKR_CR6 Fixes #22665 * πŸ”§ Set Z_PROBE_OFFSET_RANGE_MIN/MAX for MBL (#22663) * ⚑️ Add PROBE_PT_LAST_STOW * πŸ› Followup to CrealityUI cleanup Followup to #22586 * 🌐 Tweak language selection * βͺ️ Clean up Info Menu * 🎨 Tweak pins, comment formatting * ✨ Creality3D CR-30 PrintMill * ✨ GT2560 V4.x A20 (#22664) * πŸ› BTT Octopus X MAX pin for IDEX (#22654) * 🩹 Allow M42 S0/1 analogWrite on PWM pins (STM32) (#22631) * πŸ”¨ Enhance Lerdge pins, TFTs, and variants (#22658) * 🚸 MKS UI extrusion speed/steps config (#22656) * πŸ› Fix Mixing code typos (#22697) * πŸ“ Update PID_PARAMS_PER_HOTEND comment (#22694) Co-authored-by: Scott Lahteine * ✨ Homing submenu option (#22692) * 🩹 Fix 'ms' warning * 🌐 Update "Homing" for some languages (#22706) * ✨ Index Pick-and-Place board Rev.3 (#22647) Co-authored-by: GonΓ§alo Pereira Co-authored-by: Scott Lahteine * ✨ Protoneer CNC-Shield 3.00 (#22715) * 🎨 Use largest default ST9720 delays (#22713) Co-authored-by: Scott Lahteine * πŸ”§ Sanity checks for Ender 3 V2 * 🎨 MarlinUI for E3V2 tweaks * 🚸 Per-hotend Watch items * 🎨 Misc. Spindle/Laser (etc.) cleanup * 🎨 Misc. code cleanup * 🚸 Show ExtUI message for PID_STARTED * ✨Add DGUS_LCD_UI_RELOADED (#21931) * ✨ Ender-3 V2 with Jyers UI (#22422) * ✨ Ender-3 V2 CrealityUI Enhanced (#21942, #22728, #22733) Co-authored-by: Scott Lahteine * πŸ› Followup to JyersUI * πŸ› Fix JyersUI for LPC176x (#22745) Co-authored-by: Scott Lahteine * 🎨 Standardize G-code reporting * 🎨 Fewer serial macros * 🩹 Fix TOUCH_UI_FTDI_EVE warnings * 🚸 Enhance FTDI Eve Touch UI file select dialog (#22742) * πŸ› Fix LPC1768 SD-based EEPROM debug Fixes #22746 * 🩹 Warn about user feedback requirement * πŸ› No probe enum for DELTA + SENSORLESS_PROBING Fix #22729 * 🎨 Apply more HAS_DELTA_SENSORLESS_PROBING * πŸ› Fix Trigorilla Pro HAL/STM32 build offset (#22761) * 🚸 G33 R and O options (#22707) * πŸ“Œ Creality 4.3.1 board variants (#22704) Co-authored-by: Chico * 🎨 Tweak custom menu item code * ✨ MKS Robin Nano V1.3 (STM32F407VET6) (#22749) * πŸ› Fix ENABLED => EITHER typo (#22756) * πŸ› Fix CUSTOM_MENU_MAIN_SCRIPT_DONE Fix #22762 * πŸ”§ SPINDLE_LASER_PWM => SPINDLE_LASER_USE_PWM * πŸ› Fix old spindle/laser options * 🌐 Update Slovak language (#22752) * 🎨 Use ExtUI API where applicable * πŸ”– Configurations version 02000902 * ✨ TFT Screen/Backlight Sleep (#22617) * ✨ M282 - Detach Servo (#22760) * 🩹 Fix DWIN Enhanced Tune menu during homing (#22773) Co-authored-by: Scott Lahteine * πŸ› Fix MKS Monster8 EEPROM issue (serial timer) (#22777) * ✏️ Fix TFT field names (#22776) * 🎨 Consolidate Ender-3 V2 DWIN common code (#22778) * πŸ› E3V2 Brightness followup (#22821) Co-authored-by: Scott Lahteine * 🎨 Handle more pre-defined pins in pins_postprocess (#22771) * πŸ”§ Add MANUAL_FEEDRATE sanity-check * ✨ Improve pause/filament change for ExtUI (#22655) * πŸ’‘ Adjust headers, formatting * 🚸 Fix and improve MKS LVGL UI (#22783) Co-authored-by: makerbase <4164049@qq.com> Co-authored-by: MKS-Sean <56996910+MKS-Sean@users.noreply.github.com> Co-authored-by: Scott Lahteine * πŸ’¬ Add non-translated STR_DONE * 🚸 Better bed position * 🚸 Move fade item up * πŸ› STM32 ADC Resolution = 12 bit (or ADC_RESOLUTION) (#22789) * πŸ“ Update some pins comments * 🎨 Replace some infrequently-used macros * 🚸 Wake up TFT for some events (#22788) * πŸ› STM32 ADC followup (#22798) * 🌐 Reduce language file sizes * πŸ”¨ Case-insensitive tests list * πŸ”¨ Improve pins_set script * 🌐 Skip non-essential translations * 🌐 Update Greek language (#22799) * ✨ Polargraph / Makelangelo kinematics (#22790) * 🩹 Remove extra #include, misc. style * 🎨 Fix L64xx enable, clean up conditionals * 🎨 Less use of undef for RAMPS pins * 🩹 Add MarlinSPI to more HALs * πŸ› Fix anycubic_i3mega_lcd debug macros (#22820) * ⚑️ Improve LVGL touch driver (#22817) * 🎨 Various multi-axis patches (#22823) * πŸ› Fix reset_hotend_offsets * πŸ› Fix M420 / M851 reports (#22829) Followup to 79c72ed821 * πŸ› Add 'static' to fix 'duplicates' (#22826) * 🎨 Updated string macros * 🩹 Fix M412_report formatting (#22834) * πŸ”§ Sanity-check BLTOUCH_SET_5V_MODE on 5V pins (#22840) Co-authored-by: Scott Lahteine * 🚸 TFT backlight PWM / brightness (#22841) * 🎨 steps_to_mm => mm_per_step (#22847) * 🚸 Fix MKS LVGL UI temperature set interface (#22848, #22842) * ✨ E3V2 (Enhanced) Mesh Viewer (#22844) * ⚑️ Handle shared enable pins (#22824) * 🎨 Condense reverse-protection code * πŸ› E3V2 Mesh Viewer followup (#22850) * πŸš‘οΈ Fix DWIN_CompletedLeveling (#22851) Co-authored-by: Scott Lahteine * 🎨 FTDI Eve Touch UI spinner enqueue string * 🎨 Power-off tone followup (#22222) * MKS Robin pins updates * Marlin 2.0.9.2 * πŸ› Fix Arduino IDE compile error (#22877) * πŸ› Fix ExtUI Pause messages (#22874) * 🩹 Fix EXTRUDER 0 compile warning (#22868) * πŸ”¨ Add 'opt_find' to find matching options * πŸ› Fix SKR Mini E3 V2 I2C-based EEPROM (#22919) Followup to #20609 * πŸ› Fix FYSETC Cheetah v2.0 build (#22926) * πŸ”§ Remove obsolete G34 sanity check (#22929) * πŸ› Fix MKS Robin Pro 1.0 LCD reset pin (#22937) * πŸ”¨ Port libsdl2_net required for macOS simulator * 🎨 Rename MarlinUI::zoffset_overlay * ✨ ESP32 Panda_ZHU and Panda_M4 (#22644) * 🎨 Tweak FORCE_INLINE * 🎨 Define Octopus allocated endstop pins (#22882) Co-authored-by: Scott Lahteine * 🩹 Adjust GTR 1.0 ST7920 display delay (#22904) * ✨ MKS Eagle (STM32F407VET6) board (#22897) * πŸ› Fix G33 homing current (#22909) * ✨ Add option EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN (#22960) * πŸ’‘ Update old gnu.org links * πŸ”§ Safety feature warnings * πŸ”¨ Improve 'mftest' error message * Fix Tool Change Park (#22968) * Fix JyersUI ZOffset Multiplication (#22975) * βœ… Warn about dummy thermistors * πŸ”¨ Use pull_request_target for check-pr * πŸ”¨ Update 'pio vscode init' detection * πŸ”¨ Delete after encrypt. Lerdge encrypt only once * πŸ’‘ Sub-include pins labels * 🎨 Fix pinsDebug_list warnings * πŸ”¨ Fix older GCC CXXFLAGS warning Co-authored-by: Scott Lahteine Co-authored-by: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Co-authored-by: Tanguy Pruvot Co-authored-by: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Co-authored-by: borland1 Co-authored-by: vyacheslav-shubin Co-authored-by: Marcio T Co-authored-by: George Fu Co-authored-by: ellensp Co-authored-by: mks-viva <1224833100@qq.com> Co-authored-by: Malderin <52313714+Malderin@users.noreply.github.com> Co-authored-by: Bob Anthony <42719046+bob-anthony@users.noreply.github.com> Co-authored-by: Scott Lahteine Co-authored-by: Grayson Co-authored-by: DerAndere <26200979+DerAndere1@users.noreply.github.com> Co-authored-by: ellensp <530024+ellensp@users.noreply.github.com> Co-authored-by: Chris Pepper Co-authored-by: Jason Smith Co-authored-by: Miguel Risco-Castillo Co-authored-by: ldursw <37294448+ldursw@users.noreply.github.com> Co-authored-by: luzpaz Co-authored-by: BigTreeTech <38851044+bigtreetech@users.noreply.github.com> Co-authored-by: Vert <45634861+Vertabreak@users.noreply.github.com> Co-authored-by: Cytown Co-authored-by: Katelyn Schiesser Co-authored-by: chendo Co-authored-by: charlespick <17918019+charlespick@users.noreply.github.com> Co-authored-by: Fjederhaek Co-authored-by: Taylor Talkington Co-authored-by: Ryan V1 <55478432+V1EngineeringInc@users.noreply.github.com> Co-authored-by: Jin <3448324+jinhong-@users.noreply.github.com> Co-authored-by: Sebastiaan Dammann Co-authored-by: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Co-authored-by: Zs.Antal <45710979+AntoszHUN@users.noreply.github.com> Co-authored-by: Christian Schuster Co-authored-by: DvoraNoob <62312359+DvoraNoob@users.noreply.github.com> Co-authored-by: Elliott Indiran Co-authored-by: Thomas White Co-authored-by: Justin Nesselrotte Co-authored-by: GonΓ§alo Pereira Co-authored-by: Dan Co-authored-by: dotdash32 Co-authored-by: mrv96 Co-authored-by: Jyers <76993396+Jyers@users.noreply.github.com> Co-authored-by: tome9111991 <57866234+tome9111991@users.noreply.github.com> Co-authored-by: Luc Van Daele Co-authored-by: Chico Co-authored-by: Roman Moravčík Co-authored-by: Desuuuu Co-authored-by: Dakkaron Co-authored-by: Sola <42537573+solawc@users.noreply.github.com> Co-authored-by: makerbase <4164049@qq.com> Co-authored-by: MKS-Sean <56996910+MKS-Sean@users.noreply.github.com> Co-authored-by: Steven Haigh Co-authored-by: Lefteris Garyfalakis <46350667+lefterisgar@users.noreply.github.com> Co-authored-by: Dan Royer Co-authored-by: Manuel McLure Co-authored-by: Steve Wills Co-authored-by: espr14 Co-authored-by: Sebastien Andrivet Co-authored-by: Mark Co-authored-by: Minims --- .../pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h | 2 +- Marlin/src/pins/pinsDebug_list.h | 298 ++++++++++-------- Marlin/src/pins/ramps/pins_AZTEEG_X3.h | 2 +- Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h | 2 +- Marlin/src/pins/ramps/pins_K8200.h | 2 +- Marlin/src/pins/ramps/pins_K8400.h | 2 +- Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h | 2 +- Marlin/src/pins/ramps/pins_MKS_BASE_10.h | 2 +- Marlin/src/pins/ramps/pins_MKS_BASE_14.h | 2 +- Marlin/src/pins/ramps/pins_MKS_BASE_15.h | 2 +- Marlin/src/pins/ramps/pins_MKS_BASE_16.h | 2 +- Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h | 2 +- Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h | 2 +- Marlin/src/pins/ramps/pins_TRIGORILLA_13.h | 2 +- Marlin/src/pins/ramps/pins_ZRIB_V20.h | 2 +- Marlin/src/pins/ramps/pins_ZRIB_V52.h | 2 +- Marlin/src/pins/sanguino/pins_AZTEEG_X1.h | 2 +- Marlin/src/pins/sanguino/pins_MELZI.h | 2 +- .../src/pins/sanguino/pins_MELZI_CREALITY.h | 2 +- Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h | 2 +- Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h | 2 +- Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h | 2 +- Marlin/src/pins/sanguino/pins_MELZI_V2.h | 2 +- Marlin/src/pins/sanguino/pins_STB_11.h | 2 +- .../pins/stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h | 2 +- .../pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h | 2 +- .../src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h | 2 +- .../PlatformIO/scripts/common-cxxflags.py | 9 +- .../PlatformIO/scripts/common-dependencies.py | 9 +- .../PlatformIO/scripts/download_mks_assets.py | 15 +- buildroot/share/PlatformIO/scripts/lerdge.py | 47 ++- buildroot/share/PlatformIO/scripts/marlin.py | 16 +- buildroot/share/PlatformIO/scripts/pioutil.py | 8 + .../PlatformIO/scripts/preflight-checks.py | 11 +- ini/stm32f4.ini | 4 +- 35 files changed, 267 insertions(+), 202 deletions(-) create mode 100644 buildroot/share/PlatformIO/scripts/pioutil.py diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h index 2b847d339fdc..7f428fc91881 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h @@ -31,4 +31,4 @@ // Include SKR 1.4 pins // #define REQUIRE_LPC1769 -#include "../lpc1768/pins_BTT_SKR_V1_4.h" +#include "../lpc1768/pins_BTT_SKR_V1_4.h" // ... BTT_SKR_common diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index fe670cca2988..8a4350d90e25 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -26,9 +26,9 @@ // If the new pin name is over 28 characters long then pinsDebug.h will need to be modified. #if TARGET_LPC1768 - #define ANALOG_OK(PN) ((PN) == P0_02 || (PN) == P0_03 || (PN) == P0_23 || (PN) == P0_24 || (PN) == P0_25 || (PN) == P0_26 || (PN) == P1_30 || (PN) == P1_31) + #define ANALOG_OK(PN) (WITHIN(PN, P0_02, P0_03) || WITHIN(PN, P0_23, P0_26) || WITHIN(PN, P1_30, P1_31)) #else - #define ANALOG_OK(PN) ((PN) >= 0 && (PN) < NUM_ANALOG_INPUTS) + #define ANALOG_OK(PN) WITHIN(PN, 0, NUM_ANALOG_INPUTS - 1) #endif #line 35 // set __LINE__ to a known value for both passes @@ -37,86 +37,130 @@ // Analog Pin Assignments // -#if defined(EXT_AUX_A0) && ANALOG_OK(EXT_AUX_A0) +#define _EXISTS(PN,V...) (defined(PN##V) && PN##V >= 0) + +#if _EXISTS(EXT_AUX_A0) + #if ANALOG_OK(EXT_AUX_A0) REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) #endif -#if defined(EXT_AUX_A1) && ANALOG_OK(EXT_AUX_A0) - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A1) #endif -#if defined(EXT_AUX_A2) && ANALOG_OK(EXT_AUX_A0) - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A2) +#if _EXISTS(EXT_AUX_A1) + #if ANALOG_OK(EXT_AUX_A0) + REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) + #endif #endif -#if defined(EXT_AUX_A3) && ANALOG_OK(EXT_AUX_A0) - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A3) +#if _EXISTS(EXT_AUX_A2) + #if ANALOG_OK(EXT_AUX_A0) + REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) + #endif +#endif +#if _EXISTS(EXT_AUX_A3) + #if ANALOG_OK(EXT_AUX_A0) + REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) + #endif #endif -#if defined(EXT_AUX_A4) && ANALOG_OK(EXT_AUX_A0) - REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A4) +#if _EXISTS(EXT_AUX_A4) + #if ANALOG_OK(EXT_AUX_A0) + REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0) + #endif #endif -#if PIN_EXISTS(FILWIDTH) && ANALOG_OK(FILWIDTH_PIN) - REPORT_NAME_ANALOG(__LINE__, FILWIDTH_PIN) +#if PIN_EXISTS(FILWIDTH) + #if ANALOG_OK(FILWIDTH_PIN) + REPORT_NAME_ANALOG(__LINE__, FILWIDTH_PIN) + #endif #endif -#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) && ANALOG_OK(MAIN_VOLTAGE_MEASURE_PIN) - REPORT_NAME_ANALOG(__LINE__, MAIN_VOLTAGE_MEASURE_PIN) +#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) + #if ANALOG_OK(MAIN_VOLTAGE_MEASURE_PIN) + REPORT_NAME_ANALOG(__LINE__, MAIN_VOLTAGE_MEASURE_PIN) + #endif #endif #if !defined(ARDUINO_ARCH_SAM) && !defined(ARDUINO_ARCH_SAMD) // TC1 & TC2 are macros in the SAM/SAMD tool chain - #if defined(TC1) && ANALOG_OK(TC1) + #if _EXISTS(TC1) + #if ANALOG_OK(TC1) REPORT_NAME_ANALOG(__LINE__, TC1) #endif - #if defined(TC2) && ANALOG_OK(TC1) - REPORT_NAME_ANALOG(__LINE__, TC2) + #endif + #if _EXISTS(TC2) + #if ANALOG_OK(TC1) + REPORT_NAME_ANALOG(__LINE__, TC1) + #endif #endif #endif -#if PIN_EXISTS(TEMP_0) && ANALOG_OK(TEMP_0_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_0_PIN) +#if PIN_EXISTS(TEMP_0) + #if ANALOG_OK(TEMP_0_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_0_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_1) && ANALOG_OK(TEMP_1_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_1_PIN) +#if PIN_EXISTS(TEMP_1) + #if ANALOG_OK(TEMP_1_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_1_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_2) && ANALOG_OK(TEMP_2_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_2_PIN) +#if PIN_EXISTS(TEMP_2) + #if ANALOG_OK(TEMP_2_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_2_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_3) && ANALOG_OK(TEMP_3_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_3_PIN) +#if PIN_EXISTS(TEMP_3) + #if ANALOG_OK(TEMP_3_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_3_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_4) && ANALOG_OK(TEMP_4_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_4_PIN) +#if PIN_EXISTS(TEMP_4) + #if ANALOG_OK(TEMP_4_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_4_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_5) && ANALOG_OK(TEMP_5_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_5_PIN) +#if PIN_EXISTS(TEMP_5) + #if ANALOG_OK(TEMP_5_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_5_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_6) && ANALOG_OK(TEMP_6_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_6_PIN) +#if PIN_EXISTS(TEMP_6) + #if ANALOG_OK(TEMP_6_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_6_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_7) && ANALOG_OK(TEMP_7_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_7_PIN) +#if PIN_EXISTS(TEMP_7) + #if ANALOG_OK(TEMP_7_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_7_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_BED) && ANALOG_OK(TEMP_BED_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN) +#if PIN_EXISTS(TEMP_BED) + #if ANALOG_OK(TEMP_BED_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_CHAMBER) && ANALOG_OK(TEMP_CHAMBER_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN) +#if PIN_EXISTS(TEMP_CHAMBER) + #if ANALOG_OK(TEMP_CHAMBER_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN) + #endif #endif -#if PIN_EXISTS(TEMP_COOLER) && ANALOG_OK(TEMP_COOLER_PIN) - REPORT_NAME_ANALOG(__LINE__, TEMP_COOLER_PIN) +#if PIN_EXISTS(TEMP_COOLER) + #if ANALOG_OK(TEMP_COOLER_PIN) + REPORT_NAME_ANALOG(__LINE__, TEMP_COOLER_PIN) + #endif #endif -#if PIN_EXISTS(ADC_KEYPAD) && ANALOG_OK(ADC_KEYPAD_PIN) - REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN) +#if PIN_EXISTS(ADC_KEYPAD) + #if ANALOG_OK(ADC_KEYPAD_PIN) + REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN) + #endif #endif // // Digital Pin Assignments // -#if defined(__FD) && __FD >= 0 +#if _EXISTS(__FD) REPORT_NAME_DIGITAL(__LINE__, __FD) #endif -#if defined(__FS) && __FS >= 0 +#if _EXISTS(__FS) REPORT_NAME_DIGITAL(__LINE__, __FS) #endif -#if defined(__GD) && __GD >= 0 +#if _EXISTS(__GD) REPORT_NAME_DIGITAL(__LINE__, __GD) #endif -#if defined(__GS) && __GS >= 0 +#if _EXISTS(__GS) REPORT_NAME_DIGITAL(__LINE__, __GS) #endif #if PIN_EXISTS(AVR_MISO) @@ -137,46 +181,46 @@ #if PIN_EXISTS(BEEPER) REPORT_NAME_DIGITAL(__LINE__, BEEPER_PIN) #endif -#if defined(BTN_BACK) && BTN_BACK >= 0 +#if _EXISTS(BTN_BACK) REPORT_NAME_DIGITAL(__LINE__, BTN_BACK) #endif -#if defined(BTN_CENTER) && BTN_CENTER >= 0 +#if _EXISTS(BTN_CENTER) REPORT_NAME_DIGITAL(__LINE__, BTN_CENTER) #endif -#if defined(BTN_DOWN) && BTN_DOWN >= 0 +#if _EXISTS(BTN_DOWN) REPORT_NAME_DIGITAL(__LINE__, BTN_DOWN) #endif -#if defined(BTN_DWN) && BTN_DWN >= 0 +#if _EXISTS(BTN_DWN) REPORT_NAME_DIGITAL(__LINE__, BTN_DWN) #endif -#if defined(BTN_EN1) && BTN_EN1 >= 0 +#if _EXISTS(BTN_EN1) REPORT_NAME_DIGITAL(__LINE__, BTN_EN1) #endif -#if defined(BTN_EN2) && BTN_EN2 >= 0 +#if _EXISTS(BTN_EN2) REPORT_NAME_DIGITAL(__LINE__, BTN_EN2) #endif -#if defined(BTN_ENC_EN) && BTN_ENC_EN >= 0 +#if _EXISTS(BTN_ENC_EN) REPORT_NAME_DIGITAL(__LINE__, BTN_ENC_EN) #endif -#if defined(BTN_ENC) && BTN_ENC >= 0 +#if _EXISTS(BTN_ENC) REPORT_NAME_DIGITAL(__LINE__, BTN_ENC) #endif -#if defined(BTN_HOME) && BTN_HOME >= 0 +#if _EXISTS(BTN_HOME) REPORT_NAME_DIGITAL(__LINE__, BTN_HOME) #endif -#if defined(BTN_LEFT) && BTN_LEFT >= 0 +#if _EXISTS(BTN_LEFT) REPORT_NAME_DIGITAL(__LINE__, BTN_LEFT) #endif -#if defined(BTN_LFT) && BTN_LFT >= 0 +#if _EXISTS(BTN_LFT) REPORT_NAME_DIGITAL(__LINE__, BTN_LFT) #endif -#if defined(BTN_RIGHT) && BTN_RIGHT >= 0 +#if _EXISTS(BTN_RIGHT) REPORT_NAME_DIGITAL(__LINE__, BTN_RIGHT) #endif -#if defined(BTN_RT) && BTN_RT >= 0 +#if _EXISTS(BTN_RT) REPORT_NAME_DIGITAL(__LINE__, BTN_RT) #endif -#if defined(BTN_UP) && BTN_UP >= 0 +#if _EXISTS(BTN_UP) REPORT_NAME_DIGITAL(__LINE__, BTN_UP) #endif #if PIN_EXISTS(JOY_X) @@ -287,10 +331,10 @@ #if PIN_EXISTS(CUTOFF_TEST) REPORT_NAME_DIGITAL(__LINE__, CUTOFF_TEST_PIN) #endif -#if defined(D57) && D57 >= 0 +#if _EXISTS(D57) REPORT_NAME_DIGITAL(__LINE__, D57) #endif -#if defined(D58) && D58 >= 0 +#if _EXISTS(D58) REPORT_NAME_DIGITAL(__LINE__, D58) #endif #if PIN_EXISTS(DAC_DISABLE) @@ -305,49 +349,49 @@ #if PIN_EXISTS(DEBUG) REPORT_NAME_DIGITAL(__LINE__, DEBUG_PIN) #endif -#if defined(DIGIPOTS_I2C_SCL) && DIGIPOTS_I2C_SCL >= 0 +#if _EXISTS(DIGIPOTS_I2C_SCL) REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SCL) #endif -#if defined(DIGIPOTS_I2C_SDA_E0) && DIGIPOTS_I2C_SDA_E0 >= 0 +#if _EXISTS(DIGIPOTS_I2C_SDA_E0) REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E0) #endif -#if defined(DIGIPOTS_I2C_SDA_E1) && DIGIPOTS_I2C_SDA_E1 >= 0 +#if _EXISTS(DIGIPOTS_I2C_SDA_E1) REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_E1) #endif -#if defined(DIGIPOTS_I2C_SDA_X) && DIGIPOTS_I2C_SDA_X >= 0 +#if _EXISTS(DIGIPOTS_I2C_SDA_X) REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_X) #endif -#if defined(DIGIPOTS_I2C_SDA_Y) && DIGIPOTS_I2C_SDA_Y >= 0 +#if _EXISTS(DIGIPOTS_I2C_SDA_Y) REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Y) #endif -#if defined(DIGIPOTS_I2C_SDA_Z) && DIGIPOTS_I2C_SDA_Z >= 0 +#if _EXISTS(DIGIPOTS_I2C_SDA_Z) REPORT_NAME_DIGITAL(__LINE__, DIGIPOTS_I2C_SDA_Z) #endif #if PIN_EXISTS(DIGIPOTSS) REPORT_NAME_DIGITAL(__LINE__, DIGIPOTSS_PIN) #endif -#if defined(DOGLCD_A0) && DOGLCD_A0 >= 0 +#if _EXISTS(DOGLCD_A0) REPORT_NAME_DIGITAL(__LINE__, DOGLCD_A0) #endif -#if defined(DOGLCD_CS) && DOGLCD_CS >= 0 +#if _EXISTS(DOGLCD_CS) REPORT_NAME_DIGITAL(__LINE__, DOGLCD_CS) #endif -#if defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 +#if _EXISTS(DOGLCD_MOSI) REPORT_NAME_DIGITAL(__LINE__, DOGLCD_MOSI) #endif -#if defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 +#if _EXISTS(DOGLCD_SCK) REPORT_NAME_DIGITAL(__LINE__, DOGLCD_SCK) #endif -#if defined(TMC_SW_MISO) && TMC_SW_MISO >= 0 +#if _EXISTS(TMC_SW_MISO) REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MISO) #endif -#if defined(TMC_SW_MOSI) && TMC_SW_MOSI >= 0 +#if _EXISTS(TMC_SW_MOSI) REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MOSI) #endif -#if defined(TMC_SW_SCK) && TMC_SW_SCK >= 0 +#if _EXISTS(TMC_SW_SCK) REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK) #endif -#if defined(TFTGLCD_CS) && TFTGLCD_CS >= 0 +#if _EXISTS(TFTGLCD_CS) REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_CS) #endif #if PIN_EXISTS(E_MUX0) @@ -557,71 +601,71 @@ #if PIN_EXISTS(E7_STEP) REPORT_NAME_DIGITAL(__LINE__, E7_STEP_PIN) #endif -#if defined(ENET_CRS) && ENET_CRS >= 0 +#if _EXISTS(ENET_CRS) REPORT_NAME_DIGITAL(__LINE__, ENET_CRS) #endif -#if defined(ENET_MDIO) && ENET_MDIO >= 0 +#if _EXISTS(ENET_MDIO) REPORT_NAME_DIGITAL(__LINE__, ENET_MDIO) #endif -#if defined(ENET_MOC) && ENET_MOC >= 0 +#if _EXISTS(ENET_MOC) REPORT_NAME_DIGITAL(__LINE__, ENET_MOC) #endif -#if defined(ENET_RX_ER) && ENET_RX_ER >= 0 +#if _EXISTS(ENET_RX_ER) REPORT_NAME_DIGITAL(__LINE__, ENET_RX_ER) #endif -#if defined(ENET_RXD0) && ENET_RXD0 >= 0 +#if _EXISTS(ENET_RXD0) REPORT_NAME_DIGITAL(__LINE__, ENET_RXD0) #endif -#if defined(ENET_RXD1) && ENET_RXD1 >= 0 +#if _EXISTS(ENET_RXD1) REPORT_NAME_DIGITAL(__LINE__, ENET_RXD1) #endif -#if defined(ENET_TX_EN) && ENET_TX_EN >= 0 +#if _EXISTS(ENET_TX_EN) REPORT_NAME_DIGITAL(__LINE__, ENET_TX_EN) #endif -#if defined(ENET_TXD0) && ENET_TXD0 >= 0 +#if _EXISTS(ENET_TXD0) REPORT_NAME_DIGITAL(__LINE__, ENET_TXD0) #endif -#if defined(ENET_TXD1) && ENET_TXD1 >= 0 +#if _EXISTS(ENET_TXD1) REPORT_NAME_DIGITAL(__LINE__, ENET_TXD1) #endif #if PIN_EXISTS(EXP_VOLTAGE_LEVEL) REPORT_NAME_DIGITAL(__LINE__, EXP_VOLTAGE_LEVEL_PIN) #endif -#if defined(EXT_AUX_A0_IO) && EXT_AUX_A0_IO >= 0 +#if _EXISTS(EXT_AUX_A0_IO) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A0_IO) #endif -#if defined(EXT_AUX_A1_IO) && EXT_AUX_A1_IO >= 0 +#if _EXISTS(EXT_AUX_A1_IO) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A1_IO) #endif -#if defined(EXT_AUX_A2_IO) && EXT_AUX_A2_IO >= 0 +#if _EXISTS(EXT_AUX_A2_IO) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A2_IO) #endif -#if defined(EXT_AUX_A3_IO) && EXT_AUX_A3_IO >= 0 +#if _EXISTS(EXT_AUX_A3_IO) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A3_IO) #endif -#if defined(EXT_AUX_A4_IO) && EXT_AUX_A4_IO >= 0 +#if _EXISTS(EXT_AUX_A4_IO) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_A4_IO) #endif -#if defined(EXT_AUX_PWM_D24) && EXT_AUX_PWM_D24 >= 0 +#if _EXISTS(EXT_AUX_PWM_D24) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_PWM_D24) #endif -#if defined(EXT_AUX_RX1_D2) && EXT_AUX_RX1_D2 >= 0 +#if _EXISTS(EXT_AUX_RX1_D2) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_RX1_D2) #endif -#if defined(EXT_AUX_SCL_D0) && EXT_AUX_SCL_D0 >= 0 +#if _EXISTS(EXT_AUX_SCL_D0) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SCL_D0) #endif -#if defined(EXT_AUX_SDA_D1) && EXT_AUX_SDA_D1 >= 0 +#if _EXISTS(EXT_AUX_SDA_D1) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_SDA_D1) #endif -#if defined(EXT_AUX_TX1_D3) && EXT_AUX_TX1_D3 >= 0 +#if _EXISTS(EXT_AUX_TX1_D3) REPORT_NAME_DIGITAL(__LINE__, EXT_AUX_TX1_D3) #endif -#if defined(EXTRUDER_0_AUTO_FAN) && EXTRUDER_0_AUTO_FAN >= 0 +#if _EXISTS(EXTRUDER_0_AUTO_FAN) REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_0_AUTO_FAN) #endif -#if defined(EXTRUDER_1_AUTO_FAN) && EXTRUDER_1_AUTO_FAN >= 0 +#if _EXISTS(EXTRUDER_1_AUTO_FAN) REPORT_NAME_DIGITAL(__LINE__, EXTRUDER_1_AUTO_FAN) #endif #if PIN_EXISTS(FAN) @@ -735,25 +779,25 @@ #if PIN_EXISTS(LCD_BACKLIGHT) REPORT_NAME_DIGITAL(__LINE__, LCD_BACKLIGHT_PIN) #endif -#if defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0 +#if _EXISTS(LCD_PINS_D4) REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D4) #endif -#if defined(LCD_PINS_D5) && LCD_PINS_D5 >= 0 +#if _EXISTS(LCD_PINS_D5) REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D5) #endif -#if defined(LCD_PINS_D6) && LCD_PINS_D6 >= 0 +#if _EXISTS(LCD_PINS_D6) REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D6) #endif -#if defined(LCD_PINS_D7) && LCD_PINS_D7 >= 0 +#if _EXISTS(LCD_PINS_D7) REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_D7) #endif -#if defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0 +#if _EXISTS(LCD_PINS_ENABLE) REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_ENABLE) #endif -#if defined(LCD_PINS_RS) && LCD_PINS_RS >= 0 +#if _EXISTS(LCD_PINS_RS) REPORT_NAME_DIGITAL(__LINE__, LCD_PINS_RS) #endif -#if defined(LCD_SDSS) && LCD_SDSS >= 0 +#if _EXISTS(LCD_SDSS) REPORT_NAME_DIGITAL(__LINE__, LCD_SDSS) #endif #if PIN_EXISTS(LED_GREEN) @@ -799,9 +843,9 @@ REPORT_NAME_DIGITAL(__LINE__, MAX7219_LOAD_PIN) #endif -// #if defined(MISO) && MISO >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MISO) -// #endif +//#if _EXISTS(MISO) +// REPORT_NAME_DIGITAL(__LINE__, MISO) +//#endif #if PIN_EXISTS(MISO) REPORT_NAME_DIGITAL(__LINE__, SD_MISO_PIN) #endif @@ -817,9 +861,9 @@ #if PIN_EXISTS(MOSFET_D) REPORT_NAME_DIGITAL(__LINE__, MOSFET_D_PIN) #endif -// #if defined(MOSI) && MOSI >= 0 -// REPORT_NAME_DIGITAL(__LINE__, MOSI) -// #endif +//#if _EXISTS(MOSI) +// REPORT_NAME_DIGITAL(__LINE__, MOSI) +//#endif #if PIN_EXISTS(MOSI) REPORT_NAME_DIGITAL(__LINE__, SD_MOSI_PIN) #endif @@ -862,7 +906,7 @@ #if PIN_EXISTS(PWM_2) REPORT_NAME_DIGITAL(__LINE__, PWM_2_PIN) #endif -#if defined(REF_CLK) && REF_CLK >= 0 +#if _EXISTS(REF_CLK) REPORT_NAME_DIGITAL(__LINE__, REF_CLK) #endif #if PIN_EXISTS(RAMPS_D10) @@ -898,28 +942,28 @@ #if PIN_EXISTS(SAFETY_TRIGGERED) REPORT_NAME_DIGITAL(__LINE__, SAFETY_TRIGGERED_PIN) #endif -// #if defined(SCK) && SCK >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCK) -// #endif +//#if _EXISTS(SCK) +// REPORT_NAME_DIGITAL(__LINE__, SCK) +//#endif #if PIN_EXISTS(SCK) REPORT_NAME_DIGITAL(__LINE__, SD_SCK_PIN) #endif -// #if defined(SCL) && SCL >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SCL) -// #endif +//#if _EXISTS(SCL) +// REPORT_NAME_DIGITAL(__LINE__, SCL) +//#endif #if PIN_EXISTS(SD_DETECT) REPORT_NAME_DIGITAL(__LINE__, SD_DETECT_PIN) #endif -// #if defined(SDA) && SDA >= 0 -// REPORT_NAME_DIGITAL(__LINE__, SDA) -// #endif +//#if _EXISTS(SDA) +// REPORT_NAME_DIGITAL(__LINE__, SDA) +//#endif #if PIN_EXISTS(SDPOWER) REPORT_NAME_DIGITAL(__LINE__, SDPOWER_PIN) #endif -#if defined(SDSS) && SDSS >= 0 +#if _EXISTS(SDSS) REPORT_NAME_DIGITAL(__LINE__, SDSS) #endif -#if defined(SERVO0) && SERVO0 >= 0 +#if _EXISTS(SERVO0) REPORT_NAME_DIGITAL(__LINE__, SERVO0) #endif #if PIN_EXISTS(SERVO0) @@ -976,7 +1020,7 @@ #if PIN_EXISTS(SOL7) REPORT_NAME_DIGITAL(__LINE__, SOL7_PIN) #endif -#if defined(SPARE_IO) && SPARE_IO >= 0 +#if _EXISTS(SPARE_IO) REPORT_NAME_DIGITAL(__LINE__, SPARE_IO) #endif #if PIN_EXISTS(SPI_EEPROM1_CS) @@ -1015,7 +1059,7 @@ #if PIN_EXISTS(STAT_LED_BLUE) REPORT_NAME_DIGITAL(__LINE__, STAT_LED_BLUE_PIN) #endif -#if defined(STAT_LED_RED_LED) && STAT_LED_RED_LED >= 0 +#if _EXISTS(STAT_LED_RED_LED) REPORT_NAME_DIGITAL(__LINE__, STAT_LED_RED_LED) #endif #if PIN_EXISTS(STAT_LED_RED) @@ -1069,13 +1113,13 @@ #if PIN_EXISTS(TX_ENABLE) REPORT_NAME_DIGITAL(__LINE__, TX_ENABLE_PIN) #endif -#if defined(UI1) && UI1 >= 0 +#if _EXISTS(UI1) REPORT_NAME_DIGITAL(__LINE__, UI1) #endif -#if defined(UI2) && UI2 >= 0 +#if _EXISTS(UI2) REPORT_NAME_DIGITAL(__LINE__, UI2) #endif -#if defined(UNUSED_PWM) && UNUSED_PWM >= 0 +#if _EXISTS(UNUSED_PWM) REPORT_NAME_DIGITAL(__LINE__, UNUSED_PWM) #endif #if PIN_EXISTS(X_ATT) diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h index 07af61e69381..ee8cafa89766 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h @@ -43,7 +43,7 @@ #define SERVO0_PIN 44 // SERVO1 port #define SERVO1_PIN 55 // SERVO2 port -#include "pins_RAMPS_13.h" +#include "pins_RAMPS_13.h" // ... RAMPS // // LCD / Controller diff --git a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h index 7715eca7eb2d..4d7c67fc39ba 100644 --- a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h @@ -115,7 +115,7 @@ // // Import RAMPS 1.3 pins // -#include "pins_RAMPS_13.h" +#include "pins_RAMPS_13.h" // ... RAMPS // // Used by the Hephestos 2 heated bed upgrade kit diff --git a/Marlin/src/pins/ramps/pins_K8200.h b/Marlin/src/pins/ramps/pins_K8200.h index df685e0f0c20..395e1ccca50e 100644 --- a/Marlin/src/pins/ramps/pins_K8200.h +++ b/Marlin/src/pins/ramps/pins_K8200.h @@ -30,4 +30,4 @@ #define DEFAULT_MACHINE_NAME "K8200" #define DEFAULT_SOURCE_CODE_URL "github.com/CONSULitAS/Marlin-K8200" -#include "pins_3DRAG.h" +#include "pins_3DRAG.h" // ... RAMPS diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h index bed22381620d..36c438aca2de 100644 --- a/Marlin/src/pins/ramps/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -50,7 +50,7 @@ #define X_STOP_PIN 3 #define Y_STOP_PIN 14 -#include "pins_3DRAG.h" +#include "pins_3DRAG.h" // ... RAMPS // // Heaters / Fans diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h index ccf7ab679387..6b48e3cbd678 100644 --- a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h +++ b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h @@ -117,4 +117,4 @@ // Other RAMPS 1.3 pins // #define IS_RAMPS_EFB // Override autodetection. Bed will be undefined. -#include "pins_RAMPS_13.h" +#include "pins_RAMPS_13.h" // ... RAMPS diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h index 0be58653aadf..c40cabe32515 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h @@ -34,4 +34,4 @@ #define BOARD_INFO_NAME "MKS BASE 1.0" #define MKS_BASE_VERSION 10 -#include "pins_MKS_BASE_common.h" +#include "pins_MKS_BASE_common.h" // ... RAMPS diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h index 3612f9b894c6..992ab92ee9c2 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h @@ -58,7 +58,7 @@ #define CASE_LIGHT_PIN 11 // PB5 ** Pin24 ** PWM11 #endif -#include "pins_MKS_BASE_common.h" +#include "pins_MKS_BASE_common.h" // ... RAMPS /* Available connectors on MKS BASE v1.4 diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h index 9e670d1bbdc8..2b0c2bb88300 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h @@ -32,4 +32,4 @@ #define BOARD_INFO_NAME "MKS BASE 1.5" #define MKS_BASE_VERSION 15 -#include "pins_MKS_BASE_common.h" +#include "pins_MKS_BASE_common.h" // ... RAMPS diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index a4dfca21b465..31a8fdab8d3a 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -56,4 +56,4 @@ #define PS_ON_PIN -1 #endif -#include "pins_MKS_BASE_common.h" +#include "pins_MKS_BASE_common.h" // ... RAMPS diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h b/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h index 3ce138b9751e..973f924e7c16 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h @@ -25,7 +25,7 @@ * MKS BASE with Heroic HR4982 stepper drivers */ -#include "pins_MKS_BASE_15.h" +#include "pins_MKS_BASE_15.h" // ... MKS_BASE_common ... RAMPS /** * Some new boards use HR4982 (Heroic) instead of the A4982 (Allegro) stepper drivers. diff --git a/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h index 5a6bba3c0842..8242f1a77294 100644 --- a/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h +++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h @@ -27,7 +27,7 @@ #define BOARD_INFO_NAME "RigidBoard V2" -#include "pins_RIGIDBOARD.h" +#include "pins_RIGIDBOARD.h" // ... RAMPS // // Steppers diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h index ce9e4e546661..eee0dcd3d26f 100644 --- a/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h @@ -41,4 +41,4 @@ #define E0_AUTO_FAN_PIN 9 #endif -#include "pins_RAMPS_13.h" +#include "pins_RAMPS_13.h" // ... RAMPS diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V20.h b/Marlin/src/pins/ramps/pins_ZRIB_V20.h index 6c4b28d0b874..e9328ca7bae9 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V20.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V20.h @@ -26,7 +26,7 @@ * V2 and V3 Boards only differ in USB controller, nothing affecting the pins. */ -#include "pins_MKS_GEN_13.h" +#include "pins_MKS_GEN_13.h" // ... RAMPS #define ZRIB_V20_D6_PIN 6 // Fan #define ZRIB_V20_D9_PIN 9 // Fan2 diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V52.h b/Marlin/src/pins/ramps/pins_ZRIB_V52.h index f4db07ef8d4e..a6e9175b621b 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V52.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V52.h @@ -48,7 +48,7 @@ #define E2_ENABLE_PIN 22 #define HEATER_1_PIN 7 -#include "pins_MKS_BASE_common.h" +#include "pins_MKS_BASE_common.h" // ... RAMPS /* Available connectors on MKS BASE v1.4 (Basically same as ZRIB V5.2) diff --git a/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h index c3c38eb6f308..3edb14ec413f 100644 --- a/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h +++ b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h @@ -27,4 +27,4 @@ #define BOARD_INFO_NAME "Azteeg X1" -#include "pins_SANGUINOLOLU_12.h" +#include "pins_SANGUINOLOLU_12.h" // ... SANGUINOLOLU_11 diff --git a/Marlin/src/pins/sanguino/pins_MELZI.h b/Marlin/src/pins/sanguino/pins_MELZI.h index 31583fd10955..37b28c008965 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI.h +++ b/Marlin/src/pins/sanguino/pins_MELZI.h @@ -44,4 +44,4 @@ #endif #endif -#include "pins_SANGUINOLOLU_12.h" +#include "pins_SANGUINOLOLU_12.h" // ... SANGUINOLOLU_11 diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index 3c6dd901c044..cb7ecdbe1ff2 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -42,7 +42,7 @@ #define BOARD_ST7920_DELAY_3 125 #endif -#include "pins_MELZI.h" +#include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11 // // For the stock CR-10 enable CR10_STOCKDISPLAY in Configuration.h diff --git a/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h b/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h index 0e09c1f00558..447eca7e3cec 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MAKR3D.h @@ -26,4 +26,4 @@ */ #define BOARD_INFO_NAME "Melzi (ATmega1284)" -#include "pins_MELZI.h" +#include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11 diff --git a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h index 3bf8f804570b..a0421dcf5cc6 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h @@ -27,7 +27,7 @@ #define BOARD_INFO_NAME "Melzi (Malyan)" -#include "pins_MELZI.h" +#include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11 #undef LCD_SDSS #undef LCD_PINS_RS diff --git a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h index 8abed5c30c2e..19a75c2b321e 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h @@ -34,7 +34,7 @@ #define BOARD_ST7920_DELAY_3 0 #endif -#include "pins_MELZI.h" +#include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11 #undef Z_ENABLE_PIN #undef LCD_PINS_RS diff --git a/Marlin/src/pins/sanguino/pins_MELZI_V2.h b/Marlin/src/pins/sanguino/pins_MELZI_V2.h index c3133432e092..48b3c5f913c1 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_V2.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_V2.h @@ -34,4 +34,4 @@ #define BOARD_ST7920_DELAY_3 0 #endif -#include "pins_MELZI.h" +#include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11 diff --git a/Marlin/src/pins/sanguino/pins_STB_11.h b/Marlin/src/pins/sanguino/pins_STB_11.h index b10a09840aaa..ea36211f3bc9 100644 --- a/Marlin/src/pins/sanguino/pins_STB_11.h +++ b/Marlin/src/pins/sanguino/pins_STB_11.h @@ -27,4 +27,4 @@ #define BOARD_INFO_NAME "STB V1.1" -#include "pins_SANGUINOLOLU_12.h" +#include "pins_SANGUINOLOLU_12.h" // ... SANGUINOLOLU_11 diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h index 96420cf32263..81339552247d 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h @@ -23,4 +23,4 @@ #define BOARD_INFO_NAME "BTT SKR Mini MZ V1.0" -#include "pins_BTT_SKR_MINI_E3_V2_0.h" +#include "pins_BTT_SKR_MINI_E3_V2_0.h" // ... BTT_SKR_MINI_E3_common diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h index 0d927cf7cb6a..718f9dc27a1a 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h @@ -64,4 +64,4 @@ #endif #endif -#include "pins_MKS_ROBIN_E3_V1_1_common.h" +#include "pins_MKS_ROBIN_E3_V1_1_common.h" // ... MKS_ROBIN_E3_common diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h index 002c35fe54c1..30720e0c7f0e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h @@ -33,4 +33,4 @@ #define BOARD_INFO_NAME "MKS Robin E3 V1.1" #endif -#include "pins_MKS_ROBIN_E3_V1_1_common.h" +#include "pins_MKS_ROBIN_E3_V1_1_common.h" // ... MKS_ROBIN_E3_common diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index 856a246fba76..26bff515a6d2 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -3,13 +3,16 @@ # Convenience script to apply customizations to CPP flags # Import("env") -env.Append(CXXFLAGS=[ - "-Wno-register" + +cxxflags = [ #"-Wno-incompatible-pointer-types", #"-Wno-unused-const-variable", #"-Wno-maybe-uninitialized", #"-Wno-sign-compare" -]) +] +if "teensy" not in env['PIOENV']: + cxxflags += ["-Wno-register"] +env.Append(CXXFLAGS=cxxflags) # # Add CPU frequency as a compile time constant instead of a runtime variable diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.py b/buildroot/share/PlatformIO/scripts/common-dependencies.py index 83dfeca879ec..f523b1206985 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.py @@ -2,7 +2,12 @@ # common-dependencies.py # Convenience script to check dependencies and add libs and sources for Marlin Enabled Features # -import subprocess,os,re +import subprocess,os,re,pioutil +Import("env") + +# Detect that 'vscode init' is running +if pioutil.is_vscode_init(): + env.Exit(0) PIO_VERSION_MIN = (5, 0, 3) try: @@ -31,8 +36,6 @@ from platformio.package.meta import PackageSpec from platformio.project.config import ProjectConfig -Import("env") - #print(env.Dump()) try: diff --git a/buildroot/share/PlatformIO/scripts/download_mks_assets.py b/buildroot/share/PlatformIO/scripts/download_mks_assets.py index e922fed2be11..251a74a4ccb5 100644 --- a/buildroot/share/PlatformIO/scripts/download_mks_assets.py +++ b/buildroot/share/PlatformIO/scripts/download_mks_assets.py @@ -3,10 +3,15 @@ # Added by HAS_TFT_LVGL_UI to download assets from Makerbase repo # Import("env") -import os,requests,zipfile,tempfile,shutil +import os,requests,zipfile,tempfile,shutil,pioutil -url = "https://github.com/makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware/archive/master.zip" -zip_path = os.path.join(env.Dictionary("PROJECT_LIBDEPS_DIR"), "mks-assets.zip") +# Detect that 'vscode init' is running +if pioutil.is_vscode_init(): + env.Exit(0) + +url = "https://github.com/makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware/archive/0263cdaccf.zip" +deps_path = env.Dictionary("PROJECT_LIBDEPS_DIR") +zip_path = os.path.join(deps_path, "mks-assets.zip") assets_path = os.path.join(env.Dictionary("PROJECT_BUILD_DIR"), env.Dictionary("PIOENV"), "assets") def download_mks_assets(): @@ -14,8 +19,8 @@ def download_mks_assets(): r = requests.get(url, stream=True) # the user may have a very clean workspace, # so create the PROJECT_LIBDEPS_DIR directory if not exits - if os.path.exists(env.Dictionary("PROJECT_LIBDEPS_DIR")) == False: - os.mkdir(env.Dictionary("PROJECT_LIBDEPS_DIR")) + if os.path.exists(deps_path) == False: + os.mkdir(deps_path) with open(zip_path, 'wb') as fd: for chunk in r.iter_content(chunk_size=128): fd.write(chunk) diff --git a/buildroot/share/PlatformIO/scripts/lerdge.py b/buildroot/share/PlatformIO/scripts/lerdge.py index 654f0ad4df92..144ab64a9a23 100644 --- a/buildroot/share/PlatformIO/scripts/lerdge.py +++ b/buildroot/share/PlatformIO/scripts/lerdge.py @@ -12,37 +12,36 @@ board = DefaultEnvironment().BoardConfig() def encryptByte(byte): - byte = 0xFF & ((byte << 6) | (byte >> 2)) - i = 0x58 + byte - j = 0x05 + byte + (i >> 8) - byte = (0xF8 & i) | (0x07 & j) - return byte + byte = 0xFF & ((byte << 6) | (byte >> 2)) + i = 0x58 + byte + j = 0x05 + byte + (i >> 8) + byte = (0xF8 & i) | (0x07 & j) + return byte def encrypt_file(input, output_file, file_length): - input_file = bytearray(input.read()) - for i in range(len(input_file)): - result = encryptByte(input_file[i]) - input_file[i] = result - - output_file.write(input_file) - return + input_file = bytearray(input.read()) + for i in range(len(input_file)): + input_file[i] = encryptByte(input_file[i]) + output_file.write(input_file) # Encrypt ${PROGNAME}.bin and save it with the name given in build.encrypt def encrypt(source, target, env): - fwname = board.get("build.encrypt") - print("Encrypting %s to %s" % (target[0].path, fwname)) - firmware = open(target[0].path, "rb") - renamed = open(target[0].dir.path + "/" + fwname, "wb") - length = os.path.getsize(target[0].path) + fwpath = target[0].path + enname = board.get("build.encrypt") + print("Encrypting %s to %s" % (fwpath, enname)) + fwfile = open(fwpath, "rb") + enfile = open(target[0].dir.path + "/" + enname, "wb") + length = os.path.getsize(fwpath) - encrypt_file(firmware, renamed, length) + encrypt_file(fwfile, enfile, length) - firmware.close() - renamed.close() + fwfile.close() + enfile.close() + os.remove(fwpath) if 'encrypt' in board.get("build").keys(): - if board.get("build.encrypt") != "": - marlin.add_post_action(encrypt) + if board.get("build.encrypt") != "": + marlin.add_post_action(encrypt) else: - print("LERDGE builds require output file via board_build.encrypt = 'filename' parameter") - exit(1) + print("LERDGE builds require output file via board_build.encrypt = 'filename' parameter") + exit(1) diff --git a/buildroot/share/PlatformIO/scripts/marlin.py b/buildroot/share/PlatformIO/scripts/marlin.py index 3949037904bb..caa0c89749c1 100644 --- a/buildroot/share/PlatformIO/scripts/marlin.py +++ b/buildroot/share/PlatformIO/scripts/marlin.py @@ -48,22 +48,24 @@ def encrypt_mks(source, target, env, new_name): key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] - firmware = open(target[0].path, "rb") - renamed = open(target[0].dir.path + "/" + new_name, "wb") - length = os.path.getsize(target[0].path) + fwpath = target[0].path + fwfile = open(fwpath, "rb") + enfile = open(target[0].dir.path + "/" + new_name, "wb") + length = os.path.getsize(fwpath) position = 0 try: while position < length: - byte = firmware.read(1) + byte = fwfile.read(1) if position >= 320 and position < 31040: byte = chr(ord(byte) ^ key[position & 31]) if sys.version_info[0] > 2: byte = bytes(byte, 'latin1') - renamed.write(byte) + enfile.write(byte) position += 1 finally: - firmware.close() - renamed.close() + fwfile.close() + enfile.close() + os.remove(fwpath) def add_post_action(action): env.AddPostAction(join("$BUILD_DIR", "${PROGNAME}.bin"), action); diff --git a/buildroot/share/PlatformIO/scripts/pioutil.py b/buildroot/share/PlatformIO/scripts/pioutil.py new file mode 100644 index 000000000000..f0c021fca73e --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/pioutil.py @@ -0,0 +1,8 @@ +# +# buildroot/share/PlatformIO/scripts/pioutil.py +# + +# Detect that 'vscode init' is running +def is_vscode_init(): + from SCons.Script import COMMAND_LINE_TARGETS + return "idedata" in COMMAND_LINE_TARGETS or "_idedata" in COMMAND_LINE_TARGETS diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index b949df97c8c6..0dab3e4b1fbd 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -2,9 +2,13 @@ # preflight-checks.py # Check for common issues prior to compiling # -import os,re,sys +import os,re,sys,pioutil Import("env") +# Detect that 'vscode init' is running +if pioutil.is_vscode_init(): + env.Exit(0) + def get_envs_for_board(board): with open(os.path.join("Marlin", "src", "pins", "pins.h"), "r") as file: @@ -94,7 +98,4 @@ def sanity_check_target(): err = "ERROR: Old files fell into your Marlin folder. Remove %s and try again" % ", ".join(mixedin) raise SystemExit(err) -# Detect that 'vscode init' is running -from SCons.Script import COMMAND_LINE_TARGETS -if "idedata" not in COMMAND_LINE_TARGETS: - sanity_check_target() +sanity_check_target() diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 4544bf56a040..6d55ac37b90d 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -263,13 +263,13 @@ platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_LERDGE -board_build.encrypt = firmware.bin board_build.offset = 0x10000 build_flags = ${stm32_variant.build_flags} -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DLERDGE_TFT35 build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -extra_scripts = ${stm32_variant.extra_scripts} +extra_scripts = ${common_stm32.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/lerdge.py #