From adf7072fa846312d473a993ffc62ec3082b37c46 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 12 Oct 2021 18:26:42 -0700 Subject: [PATCH 01/25] =?UTF-8?q?=F0=9F=90=9B=20Fix=20SKR=20Mini=20E3=20V2?= =?UTF-8?q?=20I2C-based=20EEPROM=20(#22919)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #20609 --- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h index 9dc02c495b..c22409923b 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h @@ -28,7 +28,10 @@ // Onboard I2C EEPROM #if NO_EEPROM_SELECTED #define I2C_EEPROM + #define SOFT_I2C_EEPROM #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define I2C_SDA_PIN SDA + #define I2C_SCL_PIN SCL #undef NO_EEPROM_SELECTED #endif From 995230f5971995e41b97d14273f2dd3693ead6be Mon Sep 17 00:00:00 2001 From: George Fu Date: Wed, 13 Oct 2021 09:32:54 +0800 Subject: [PATCH 02/25] =?UTF-8?q?=F0=9F=90=9B=20Fix=20FYSETC=20Cheetah=20v?= =?UTF-8?q?2.0=20build=20(#22926)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V20.json | 3 +-- .../PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld | 2 +- ini/stm32f4.ini | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V20.json b/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V20.json index e7b0d28afe..6c2e093c3b 100644 --- a/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V20.json +++ b/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V20.json @@ -14,7 +14,6 @@ "0x3748" ] ], - "ldscript": "stm32f401rc.ld", "mcu": "stm32f401rct6", "variant": "MARLIN_FYSETC_CHEETAH_V20" }, @@ -56,7 +55,7 @@ "dfu", "jlink" ], - "offset_address": "0x800C000", + "offset_address": "0x8008000", "require_upload_port": true, "use_1200bps_touch": false, "wait_for_upload_port": false diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld index 9565cd89c6..eaaff196cd 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/ldscript.ld @@ -61,7 +61,7 @@ _Min_Stack_Size = 0x400;; /* required amount of stack */ /* Specify the memory areas */ MEMORY { -FLASH (rx) : ORIGIN = 0x800C000, LENGTH = 256K +FLASH (rx) : ORIGIN = 0x8008000, LENGTH = 256K - 32K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K } diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 7ff0443df6..09313b020f 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -48,7 +48,7 @@ build_flags = ${stm32_variant.build_flags} platform = ${common_stm32.platform} extends = stm32_variant board = marlin_FYSETC_CHEETAH_V20 -board_build.offset = 0xC000 +board_build.offset = 0x8000 build_flags = ${stm32_variant.build_flags} -DSTM32F401xC # From 975089a954460b10279bdbf60f08c9604c4f7d08 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 12 Oct 2021 19:05:37 -0700 Subject: [PATCH 03/25] =?UTF-8?q?=F0=9F=94=A7=20Remove=20obsolete=20G34=20?= =?UTF-8?q?sanity=20check=20(#22929)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 58c02e7ebd..f5324c7d39 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3431,10 +3431,6 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #endif #endif -#if BOTH(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) - #error "You cannot use Z_STEPPER_AUTO_ALIGN and MECHANICAL_GANTRY_CALIBRATION at the same time." -#endif - #if ENABLED(PRINTCOUNTER) && DISABLED(EEPROM_SETTINGS) #error "PRINTCOUNTER requires EEPROM_SETTINGS." #endif From f47ece0725d93cde7fde52b66d14b5ec551c46c2 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 12 Oct 2021 19:06:39 -0700 Subject: [PATCH 04/25] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MKS=20Robin=20Pro=20?= =?UTF-8?q?1.0=20LCD=20reset=20pin=20(#22937)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index fdee796692..8b67781b60 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -237,7 +237,7 @@ #define TFT_CS_PIN FSMC_CS_PIN #define TFT_RS_PIN FSMC_RS_PIN - #define LCD_RESET_PIN PF6 + #define LCD_RESET_PIN PC6 #define LCD_BACKLIGHT_PIN PD13 #define TFT_BUFFER_SIZE 14400 From 99d51af90facd02365d0ae91091303d7879f304d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 5 Oct 2021 21:35:31 -0500 Subject: [PATCH 05/25] =?UTF-8?q?=F0=9F=94=A8=20Port=20libsdl2=5Fnet=20req?= =?UTF-8?q?uired=20for=20macOS=20simulator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/native.ini | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ini/native.ini b/ini/native.ini index 2f38e715ed..981e93f996 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -70,13 +70,16 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags} # # Simulator for macOS (MacPorts) # -# sudo port install gcc10 gdb glm libsdl2 freetype +# sudo port install gcc10 gdb glm libsdl2 libsdl2_net freetype # sudo port install ld64 @3_3 +ld64_xcode -# sudo port uninstall ld64 ld64-latest +# # cd /opt/local/bin # sudo rm -f gcc g++ cc -# sudo ln gcc-mp-10 gcc ; sudo ln g++-mp-10 g++ ; sudo ln g++ cc -# cd - +# sudo ln -s gcc-mp-10 gcc ; sudo ln -s g++-mp-10 g++ ; sudo ln -s g++ cc +# This step may be obsolete: +# sudo port uninstall ld64 ld64-latest +# +# cd - # # Use 'sudo port install mesa' to get a if no Xcode is installed. # If Xcode is installed be sure to run `xcode-select --install` first. From b8c32e24d86fff280621ab3f274511dd30669b93 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Oct 2021 02:33:14 -0500 Subject: [PATCH 06/25] =?UTF-8?q?=F0=9F=8E=A8=20Rename=20MarlinUI::zoffset?= =?UTF-8?q?=5Foverlay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 10 +++++++--- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 10 +--------- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 14 +++----------- Marlin/src/lcd/marlinui.cpp | 14 ++++++++++++++ Marlin/src/lcd/marlinui.h | 5 +++++ Marlin/src/lcd/menu/menu.cpp | 5 +---- Marlin/src/lcd/menu/menu.h | 4 ---- Marlin/src/lcd/menu/menu_ubl.cpp | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f5324c7d39..ed5a345744 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -900,7 +900,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination" #elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE #error "BABYSTEP_ZPROBE_OFFSET requires a probe." - #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && !HAS_MARLINUI_U8GLIB + #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI) #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD." #elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET) #error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET." @@ -1762,8 +1762,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if ENABLED(MESH_EDIT_GFX_OVERLAY) && !(ENABLED(AUTO_BED_LEVELING_UBL) && EITHER(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)) - #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL and a Graphical LCD." +#if ENABLED(MESH_EDIT_GFX_OVERLAY) + #if DISABLED(AUTO_BED_LEVELING_UBL) + #error "MESH_EDIT_GFX_OVERLAY requires AUTO_BED_LEVELING_UBL." + #elif NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI) + #error "MESH_EDIT_GFX_OVERLAY requires a Graphical LCD." + #endif #endif #if ENABLED(G29_RETRY_AND_RECOVER) && NONE(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index f1c5eebbb5..4a7e26ae83 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -715,15 +715,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop B00001100,B00000000 }; - void _lcd_zoffset_overlay_gfx(const_float_t zvalue) { - // Determine whether the user is raising or lowering the nozzle. - static int8_t dir; - static float old_zvalue; - if (zvalue != old_zvalue) { - dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0; - old_zvalue = zvalue; - } - + void MarlinUI::zoffset_overlay(const int8_t dir) { const unsigned char *rot_up = TERN(OVERLAY_GFX_REVERSE, ccw_bmp, cw_bmp), *rot_down = TERN(OVERLAY_GFX_REVERSE, cw_bmp, ccw_bmp); diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 09458401be..9ad258b3ac 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -562,19 +562,11 @@ void MarlinUI::draw_status_message(const bool blink) { #endif // AUTO_BED_LEVELING_UBL - #if ANY(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY, BABYSTEP_GFX_OVERLAY) - - void _lcd_zoffset_overlay_gfx(const float zvalue) { - // Determine whether the user is raising or lowering the nozzle. - static int8_t dir; - static float old_zvalue; - if (zvalue != old_zvalue) { - dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0; - old_zvalue = zvalue; - } + #if ANY(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + void MarlinUI::zoffset_overlay(const int8_t dir) { const int rot_up = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCCW, ICON_RotateCW), - rot_down = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCW, ICON_RotateCCW); + rot_down = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCW, ICON_RotateCCW); const int nozzle = (LCD_PIXEL_WIDTH / 2) - 20; diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index c194d43438..5c8298cf52 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1714,6 +1714,20 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; if (touch_calibration.need_calibration()) ui.goto_screen(touch_screen_calibration); #endif } + + #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + void MarlinUI::zoffset_overlay(const_float_t zvalue) { + // Determine whether the user is raising or lowering the nozzle. + static int8_t dir; + static float old_zvalue; + if (zvalue != old_zvalue) { + dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0; + old_zvalue = zvalue; + } + zoffset_overlay(dir); + } + #endif + #endif #if BOTH(EXTENSIBLE_UI, ADVANCED_PAUSE_FEATURE) diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 270ee3afce..02d5bf06bd 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -474,6 +474,11 @@ public: static bool did_first_redraw; #endif + #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + static void zoffset_overlay(const int8_t dir); + static void zoffset_overlay(const_float_t zvalue); + #endif + static void draw_kill_screen(); #else // No LCD diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 76cdd51cd5..61a1a16c6a 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -257,9 +257,6 @@ void MarlinUI::synchronize(PGM_P const msg/*=nullptr*/) { * * encoderLine is the position based on the encoder * encoderTopLine is the top menu line to display - * _lcdLineNr is the index of the LCD line (e.g., 0-3) - * _menuLineNr is the menu item to draw and process - * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM * screen_items is the total number of items in the menu (after one call) */ void scroll_screen(const uint8_t limit, const bool is_menu) { @@ -336,7 +333,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { if (ui.should_draw()) { if (do_probe) { MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z)); - TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, _lcd_zoffset_overlay_gfx(probe.offset.z)); + TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z)); } else { #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index ad2cf72000..50842dcaf8 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -39,10 +39,6 @@ typedef void (*selectFunc_t)(); #define SS_INVERT 0x02 #define SS_DEFAULT SS_CENTER -#if EITHER(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI) && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) - void _lcd_zoffset_overlay_gfx(const_float_t zvalue); -#endif - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) && Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9 #define BABYSTEP_TO_STR(N) ftostr43sign(N) #elif ENABLED(BABYSTEPPING) diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 03aec39c83..8dea7d943d 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -83,7 +83,7 @@ void _lcd_mesh_fine_tune(PGM_P const msg) { if (ui.should_draw()) { const float rounded_f = rounded_mesh_value(); MenuEditItemBase::draw_edit_screen(msg, ftostr43sign(rounded_f)); - TERN_(MESH_EDIT_GFX_OVERLAY, _lcd_zoffset_overlay_gfx(rounded_f)); + TERN_(MESH_EDIT_GFX_OVERLAY, ui.zoffset_overlay(rounded_f)); TERN_(HAS_GRAPHICAL_TFT, ui.refresh(LCDVIEW_NONE)); } } From 66048a5f27aa3ad9ecb2b407ada13fb87e86ebe9 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 5 Oct 2021 12:23:02 +0800 Subject: [PATCH 07/25] =?UTF-8?q?=E2=9C=A8=20ESP32=20Panda=5FZHU=20and=20P?= =?UTF-8?q?anda=5FM4=20(#22644)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL_SPI.cpp | 4 +- Marlin/src/HAL/ESP32/HAL.cpp | 28 ++++++- Marlin/src/HAL/ESP32/HAL.h | 4 + Marlin/src/HAL/ESP32/HAL_SPI.cpp | 6 +- Marlin/src/HAL/ESP32/esp32.csv | 6 ++ Marlin/src/HAL/ESP32/fastio.h | 20 +++-- Marlin/src/HAL/ESP32/i2s.cpp | 3 + Marlin/src/HAL/ESP32/watchdog.h | 2 +- Marlin/src/HAL/STM32/HAL_SPI.cpp | 4 +- Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp | 5 +- Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp | 5 +- Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp | 7 +- Marlin/src/core/boards.h | 2 + Marlin/src/gcode/sd/M1001.cpp | 1 + Marlin/src/inc/SanityCheck.h | 4 +- Marlin/src/pins/esp32/pins_PANDA_M4.h | 38 +++++++++ Marlin/src/pins/esp32/pins_PANDA_ZHU.h | 61 ++++++++++++++ Marlin/src/pins/esp32/pins_PANDA_common.h | 98 +++++++++++++++++++++++ Marlin/src/pins/pins.h | 4 + ini/esp32.ini | 10 +++ ini/stm32f1-maple.ini | 6 +- 21 files changed, 286 insertions(+), 32 deletions(-) create mode 100644 Marlin/src/HAL/ESP32/esp32.csv create mode 100644 Marlin/src/pins/esp32/pins_PANDA_M4.h create mode 100644 Marlin/src/pins/esp32/pins_PANDA_ZHU.h create mode 100644 Marlin/src/pins/esp32/pins_PANDA_common.h diff --git a/Marlin/src/HAL/AVR/HAL_SPI.cpp b/Marlin/src/HAL/AVR/HAL_SPI.cpp index 319d64c8f6..8784bb07b3 100644 --- a/Marlin/src/HAL/AVR/HAL_SPI.cpp +++ b/Marlin/src/HAL/AVR/HAL_SPI.cpp @@ -34,7 +34,9 @@ #include "../../inc/MarlinConfig.h" void spiBegin() { - OUT_WRITE(SD_SS_PIN, HIGH); + #if PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); + #endif SET_OUTPUT(SD_SCK_PIN); SET_INPUT(SD_MISO_PIN); SET_OUTPUT(SD_MOSI_PIN); diff --git a/Marlin/src/HAL/ESP32/HAL.cpp b/Marlin/src/HAL/ESP32/HAL.cpp index 7818dbdd87..6a66d519b3 100644 --- a/Marlin/src/HAL/ESP32/HAL.cpp +++ b/Marlin/src/HAL/ESP32/HAL.cpp @@ -28,6 +28,10 @@ #include #include +#if ENABLED(USE_ESP32_TASK_WDT) + #include +#endif + #if ENABLED(WIFISUPPORT) #include #include "wifi.h" @@ -90,8 +94,24 @@ volatile int numPWMUsed = 0, #endif -void HAL_init_board() { +#if ENABLED(USE_ESP32_EXIO) + HardwareSerial YSerial2(2); + + void Write_EXIO(uint8_t IO, uint8_t v) { + if (ISRS_ENABLED()) { + DISABLE_ISRS(); + YSerial2.write(0x80 | (((char)v) << 5) | (IO - 100)); + ENABLE_ISRS(); + } + else + YSerial2.write(0x80 | (((char)v) << 5) | (IO - 100)); + } +#endif +void HAL_init_board() { + #if ENABLED(USE_ESP32_TASK_WDT) + esp_task_wdt_init(10, true); + #endif #if ENABLED(ESP3D_WIFISUPPORT) esp3dlib.init(); #elif ENABLED(WIFISUPPORT) @@ -127,7 +147,11 @@ void HAL_init_board() { // Initialize the i2s peripheral only if the I2S stepper stream is enabled. // The following initialization is performed after Serial1 and Serial2 are defined as // their native pins might conflict with the i2s stream even when they are remapped. - TERN_(I2S_STEPPER_STREAM, i2s_init()); + #if ENABLED(USE_ESP32_EXIO) + YSerial2.begin(460800 * 3, SERIAL_8N1, 16, 17); + #elif ENABLED(I2S_STEPPER_STREAM) + i2s_init(); + #endif } void HAL_idletask() { diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index 0f92052030..bc0ce4e037 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -142,6 +142,10 @@ void HAL_idletask(); inline void HAL_init() {} void HAL_init_board(); +#if ENABLED(USE_ESP32_EXIO) + void Write_EXIO(uint8_t IO, uint8_t v); +#endif + // // Delay in cycles (used by DELAY_NS / DELAY_US) // diff --git a/Marlin/src/HAL/ESP32/HAL_SPI.cpp b/Marlin/src/HAL/ESP32/HAL_SPI.cpp index 8743ac5be2..868ab1b671 100644 --- a/Marlin/src/HAL/ESP32/HAL_SPI.cpp +++ b/Marlin/src/HAL/ESP32/HAL_SPI.cpp @@ -53,11 +53,9 @@ static SPISettings spiConfig; // ------------------------ void spiBegin() { - #if !PIN_EXISTS(SD_SS) - #error "SD_SS_PIN not defined!" + #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); #endif - - OUT_WRITE(SD_SS_PIN, HIGH); } void spiInit(uint8_t spiRate) { diff --git a/Marlin/src/HAL/ESP32/esp32.csv b/Marlin/src/HAL/ESP32/esp32.csv new file mode 100644 index 0000000000..8f6e101f02 --- /dev/null +++ b/Marlin/src/HAL/ESP32/esp32.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x180000, +app1, app, ota_1, 0x190000, 0x180000, +spiffs, data, spiffs, 0x310000, 0xF0000, diff --git a/Marlin/src/HAL/ESP32/fastio.h b/Marlin/src/HAL/ESP32/fastio.h index 8db89dca12..c8e3f7e343 100644 --- a/Marlin/src/HAL/ESP32/fastio.h +++ b/Marlin/src/HAL/ESP32/fastio.h @@ -40,13 +40,19 @@ // Set pin as input with pullup mode #define _PULLUP(IO, v) pinMode(IO, v ? INPUT_PULLUP : INPUT) -// Read a pin wrapper -#define READ(IO) (IS_I2S_EXPANDER_PIN(IO) ? i2s_state(I2S_EXPANDER_PIN_INDEX(IO)) : digitalRead(IO)) - -// Write to a pin wrapper -#define WRITE(IO, v) (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v)) - -// Set pin as input wrapper +#if ENABLED(USE_ESP32_EXIO) + // Read a pin wrapper + #define READ(IO) digitalRead(IO) + // Write to a pin wrapper + #define WRITE(IO, v) (IO >= 100 ? Write_EXIO(IO, v) : digitalWrite(IO, v)) +#else + // Read a pin wrapper + #define READ(IO) (IS_I2S_EXPANDER_PIN(IO) ? i2s_state(I2S_EXPANDER_PIN_INDEX(IO)) : digitalRead(IO)) + // Write to a pin wrapper + #define WRITE(IO, v) (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v)) +#endif + +// Set pin as input wrapper (0x80 | (v << 5) | (IO - 100)) #define SET_INPUT(IO) _SET_INPUT(IO) // Set pin as input with pullup wrapper diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index c28c008793..557ea319e6 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -23,6 +23,8 @@ #include "../../inc/MarlinConfigPre.h" +#if DISABLED(USE_ESP32_EXIO) + #include "i2s.h" #include "../shared/Marduino.h" @@ -340,4 +342,5 @@ void i2s_push_sample() { dma.current[dma.rw_pos++] = i2s_port_data; } +#endif // !USE_ESP32_EXIO #endif // ARDUINO_ARCH_ESP32 diff --git a/Marlin/src/HAL/ESP32/watchdog.h b/Marlin/src/HAL/ESP32/watchdog.h index b6c169e347..43db813076 100644 --- a/Marlin/src/HAL/ESP32/watchdog.h +++ b/Marlin/src/HAL/ESP32/watchdog.h @@ -25,7 +25,7 @@ extern "C" { #endif - esp_err_t esp_task_wdt_reset(); + esp_err_t esp_task_wdt_reset(); #ifdef __cplusplus } diff --git a/Marlin/src/HAL/STM32/HAL_SPI.cpp b/Marlin/src/HAL/STM32/HAL_SPI.cpp index 85a5238b54..8ee4761647 100644 --- a/Marlin/src/HAL/STM32/HAL_SPI.cpp +++ b/Marlin/src/HAL/STM32/HAL_SPI.cpp @@ -47,7 +47,9 @@ static SPISettings spiConfig; #include "../shared/Delay.h" void spiBegin(void) { - OUT_WRITE(SD_SS_PIN, HIGH); + #if PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); + #endif OUT_WRITE(SD_SCK_PIN, HIGH); SET_INPUT(SD_MISO_PIN); OUT_WRITE(SD_MOSI_PIN, HIGH); diff --git a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp index ff84e91f79..415c692229 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp @@ -36,10 +36,9 @@ static SPISettings spiConfig; // Initialize SPI bus void spiBegin() { - #if !PIN_EXISTS(SD_SS) - #error "SD_SS_PIN not defined!" + #if PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); #endif - OUT_WRITE(SD_SS_PIN, HIGH); SET_OUTPUT(SD_SCK_PIN); SET_INPUT(SD_MISO_PIN); SET_OUTPUT(SD_MOSI_PIN); diff --git a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp index e63ab1c0e3..d80f57b2c4 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY35_36/HAL_SPI.cpp @@ -36,10 +36,9 @@ static SPISettings spiConfig; void spiBegin() { - #if !PIN_EXISTS(SD_SS) - #error "SD_SS_PIN not defined!" + #if PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); #endif - OUT_WRITE(SD_SS_PIN, HIGH); SET_OUTPUT(SD_SCK_PIN); SET_INPUT(SD_MISO_PIN); SET_OUTPUT(SD_MOSI_PIN); diff --git a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp index 610765ad49..9dcb812faf 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY40_41/HAL_SPI.cpp @@ -51,12 +51,9 @@ static SPISettings spiConfig; // ------------------------ void spiBegin() { - #ifndef SD_SS_PIN - #error "SD_SS_PIN is not defined!" + #if PIN_EXISTS(SD_SS) + OUT_WRITE(SD_SS_PIN, HIGH); #endif - - OUT_WRITE(SD_SS_PIN, HIGH); - //SET_OUTPUT(SD_SCK_PIN); //SET_INPUT(SD_MISO_PIN); //SET_OUTPUT(SD_MOSI_PIN); diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 46b2e5cf0c..bc29ab5dec 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -422,6 +422,8 @@ #define BOARD_MRR_ESPE 6002 // MRR ESPE based on ESP32 (with I2S stepper stream) #define BOARD_E4D_BOX 6003 // E4d@BOX #define BOARD_FYSETC_E4 6004 // FYSETC E4 +#define BOARD_PANDA_ZHU 6005 // Panda_ZHU +#define BOARD_PANDA_M4 6006 // Panda_M4 // // SAMD51 ARM Cortex M4 diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index f5ee6a94d1..032ec1f198 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -27,6 +27,7 @@ #include "../gcode.h" #include "../../module/planner.h" #include "../../module/printcounter.h" +#include "../../module/temperature.h" #include "../../sd/cardreader.h" #ifdef SD_FINISHED_RELEASECOMMAND diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index ed5a345744..cb3314b25f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -597,9 +597,9 @@ #error "SPINDLE_LASER_PWM (true) is now set with SPINDLE_LASER_USE_PWM (enabled)." #endif -#if MOTHERBOARD == BOARD_DUE3DOM_MINI && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) +#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) #warning "Onboard temperature sensor for BOARD_DUE3DOM_MINI has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)." -#elif MOTHERBOARD == BOARD_BTT_SKR_E3_TURBO && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) +#elif MB(BTT_SKR_E3_TURBO) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD) #warning "Onboard temperature sensor for BOARD_BTT_SKR_E3_TURBO has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)." #endif diff --git a/Marlin/src/pins/esp32/pins_PANDA_M4.h b/Marlin/src/pins/esp32/pins_PANDA_M4.h new file mode 100644 index 0000000000..5e2e72af05 --- /dev/null +++ b/Marlin/src/pins/esp32/pins_PANDA_M4.h @@ -0,0 +1,38 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 . + * + */ +#pragma once + +/** + * Panda M4 pin assignments + */ + +#define BOARD_INFO_NAME "Panda_M4" + +#include "pins_PANDA_common.h" + +// +// Steppers +// +#define X_ENABLE_PIN 115 +#define Y_ENABLE_PIN 114 +#define Z_ENABLE_PIN 113 +#define E0_ENABLE_PIN 112 diff --git a/Marlin/src/pins/esp32/pins_PANDA_ZHU.h b/Marlin/src/pins/esp32/pins_PANDA_ZHU.h new file mode 100644 index 0000000000..4750057897 --- /dev/null +++ b/Marlin/src/pins/esp32/pins_PANDA_ZHU.h @@ -0,0 +1,61 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 . + * + */ +#pragma once + +/** + * Panda ZHU pin assignments + */ + +#define BOARD_INFO_NAME "Panda_ZHU" + +#include "pins_PANDA_common.h" + +// +// Steppers +// +#define X_ENABLE_PIN 128 // Shared with all steppers +#define Y_ENABLE_PIN X_ENABLE_PIN +#define Z_ENABLE_PIN X_ENABLE_PIN +#define E0_ENABLE_PIN X_ENABLE_PIN + +//#define X_CS_PIN 0 +//#define Y_CS_PIN 13 +//#define Z_CS_PIN 5 // SS_PIN +//#define E0_CS_PIN 21 + +#define E1_STEP_PIN 115 +#define E1_DIR_PIN 114 +#define E1_ENABLE_PIN X_ENABLE_PIN + +#define E2_STEP_PIN 112 +#define E2_DIR_PIN 113 +#define E2_ENABLE_PIN X_ENABLE_PIN + +#define E3_STEP_PIN 110 +#define E3_DIR_PIN 111 +#define E3_ENABLE_PIN X_ENABLE_PIN + +#define E4_STEP_PIN 121 +#define E4_DIR_PIN 122 +#define E4_ENABLE_PIN X_ENABLE_PIN + +#define HEATER_1_PIN 123 diff --git a/Marlin/src/pins/esp32/pins_PANDA_common.h b/Marlin/src/pins/esp32/pins_PANDA_common.h new file mode 100644 index 0000000000..81862fbd55 --- /dev/null +++ b/Marlin/src/pins/esp32/pins_PANDA_common.h @@ -0,0 +1,98 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 . + * + */ +#pragma once + +/** + * Panda common pin assignments + */ + +#include "env_validate.h" + +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// +// Servos +// +#define SERVO0_PIN 0 + +// +// Limit Switches +// +#define X_STOP_PIN 4 +#define Y_STOP_PIN 35 +#define Z_STOP_PIN 21 + +// +// Steppers +// +#define X_STEP_PIN 101 +#define X_DIR_PIN 100 + +#define Y_STEP_PIN 103 +#define Y_DIR_PIN 102 + +#define Z_STEP_PIN 105 +#define Z_DIR_PIN 104 + +#define E0_STEP_PIN 107 +#define E0_DIR_PIN 106 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 39 // Analog Input +#define TEMP_BED_PIN 36 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 108 +#define HEATER_BED_PIN 109 +#define FAN_PIN 118 // FAN0 +#define FAN1_PIN 119 // FAN1 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 120 // FAN2 +#endif + +// +// SD card +// +#if ENABLED(SDSUPPORT) + #define SD_MOSI_PIN 23 + #define SD_MISO_PIN 19 + #define SD_SCK_PIN 18 + #define SDSS 5 + #define SD_DETECT_PIN 2 +#endif + +#if HAS_WIRED_LCD + #define BEEPER_PIN 129 + #define BTN_ENC 12 + + #define BTN_EN1 33 + #define BTN_EN2 32 + + #define LCD_PINS_RS 27 + #define LCD_PINS_ENABLE 26 + #define LCD_PINS_D4 14 +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 0293da1dba..58f3850389 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -681,6 +681,10 @@ #include "esp32/pins_E4D.h" // ESP32 env:esp32 #elif MB(FYSETC_E4) #include "esp32/pins_FYSETC_E4.h" // ESP32 env:FYSETC_E4 +#elif MB(PANDA_ZHU) + #include "esp32/pins_PANDA_ZHU.h" // ESP32 env:PANDA +#elif MB(PANDA_M4) + #include "esp32/pins_PANDA_M4.h" // ESP32 env:PANDA // // Adafruit Grand Central M4 (SAMD51 ARM Cortex-M4) diff --git a/ini/esp32.ini b/ini/esp32.ini index fcfa829608..9c0c44db67 100644 --- a/ini/esp32.ini +++ b/ini/esp32.ini @@ -27,3 +27,13 @@ monitor_speed = 250000 platform = espressif32@2.1.0 extends = env:esp32 board_build.partitions = default_16MB.csv + +[env:PANDA] +platform = espressif32@2.1.0 +extends = env:esp32 +build_flags = ${env:esp32.build_flags} -DUSE_ESP32_EXIO -DUSE_ESP32_TASK_WDT +lib_deps = ${common.lib_deps} + SoftwareSerialEsp32 +board_build.partitions = Marlin/src/HAL/ESP32/esp32.csv +upload_speed = 115200 +monitor_speed = 115200 diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index 00ba93aa63..e11aa03560 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -65,8 +65,7 @@ build_flags = ${common_stm32f1.build_flags} extra_scripts = ${common_stm32f1.extra_scripts} pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py -lib_deps = ${common.lib_deps} - SoftwareSerialM +lib_deps = ${common_stm32f1.lib_deps} USBComposite for STM32F1@0.91 custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ccccmagicboy/Adafruit_NeoPixel#meeb_3dp_use debug_tool = stlink @@ -377,7 +376,8 @@ extra_scripts = ${common.extra_scripts} buildroot/share/PlatformIO/scripts/offset_and_rename.py build_flags = ${common_stm32f1.build_flags} -D__STM32F1__=1 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -DSERIAL_USB -lib_deps = USBComposite for STM32F1@0.91 +lib_deps = ${common_stm32f1.lib_deps} + USBComposite for STM32F1@0.91 lib_ignore = Adafruit NeoPixel, SPI, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster, TMCStepper [env:STM32F103RC_ZM3E2_USB_maple] From d137f307ebea8c8832ecbef239ed08e188c5369b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 4 Oct 2021 22:19:05 -0500 Subject: [PATCH 08/25] =?UTF-8?q?=F0=9F=8E=A8=20Tweak=20FORCE=5FINLINE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/shared/Marduino.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/shared/Marduino.h b/Marlin/src/HAL/shared/Marduino.h index 56be8d7211..ddc3451fbe 100644 --- a/Marlin/src/HAL/shared/Marduino.h +++ b/Marlin/src/HAL/shared/Marduino.h @@ -83,7 +83,7 @@ #endif #ifndef FORCE_INLINE - #define FORCE_INLINE inline __attribute__((always_inline)) + #define FORCE_INLINE __attribute__((always_inline)) inline #endif #include "progmem.h" From 036f763eaaff571f07c7829e0f5a61b645e86269 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 7 Oct 2021 09:42:59 +1300 Subject: [PATCH 09/25] =?UTF-8?q?=F0=9F=8E=A8=20Define=20Octopus=20allocat?= =?UTF-8?q?ed=20endstop=20pins=20(#22882)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- .../pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index ab0a7dd962..4a667bbc20 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -37,6 +37,7 @@ // // Servos +// #define SERVO0_PIN PB6 // @@ -56,12 +57,30 @@ #define E2_DIAG_PIN PG14 // E2DET #define E3_DIAG_PIN PG15 // E3DET +// // Z Probe (when not Z_MIN_PIN) // #ifndef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN PB7 #endif +// +// Check for additional used endstop pins +// +#if HAS_EXTRA_ENDSTOPS + #define _ENDSTOP_IS_ANY(ES) X2_USE_ENDSTOP == ES || Y2_USE_ENDSTOP == ES || Z2_USE_ENDSTOP == ES || Z3_USE_ENDSTOP == ES || Z4_USE_ENDSTOP == ES + #if _ENDSTOP_IS_ANY(_XMIN_) || _ENDSTOP_IS_ANY(_XMAX_) + #define NEEDS_X_MINMAX 1 + #endif + #if _ENDSTOP_IS_ANY(_YMIN_) || _ENDSTOP_IS_ANY(_YMAX_) + #define NEEDS_Y_MINMAX 1 + #endif + #if _ENDSTOP_IS_ANY(_ZMIN_) || _ENDSTOP_IS_ANY(_ZMAX_) + #define NEEDS_Z_MINMAX 1 + #endif + #undef _ENDSTOP_IS_ANY +#endif + // // Limit Switches // @@ -72,7 +91,7 @@ #else #define X_MIN_PIN E0_DIAG_PIN // E0DET #endif -#elif EITHER(X_DUAL_ENDSTOPS, DUAL_X_CARRIAGE) +#elif EITHER(DUAL_X_CARRIAGE, NEEDS_X_MINMAX) #ifndef X_MIN_PIN #define X_MIN_PIN X_DIAG_PIN // X-STOP #endif @@ -90,7 +109,7 @@ #else #define Y_MIN_PIN E1_DIAG_PIN // E1DET #endif -#elif ENABLED(Y_DUAL_ENDSTOPS) +#elif NEEDS_Y_MINMAX #ifndef Y_MIN_PIN #define Y_MIN_PIN Y_DIAG_PIN // Y-STOP #endif @@ -108,7 +127,7 @@ #else #define Z_MIN_PIN E2_DIAG_PIN // PWRDET #endif -#elif ENABLED(Z_MULTI_ENDSTOPS) +#elif NEEDS_Z_MINMAX #ifndef Z_MIN_PIN #define Z_MIN_PIN Z_DIAG_PIN // Z-STOP #endif @@ -119,6 +138,10 @@ #define Z_STOP_PIN Z_DIAG_PIN // Z-STOP #endif +#undef NEEDS_X_MINMAX +#undef NEEDS_Y_MINMAX +#undef NEEDS_Z_MINMAX + // // Filament Runout Sensor // From 031f17b4f3dfca4a66384d40ce48b7d33315c75a Mon Sep 17 00:00:00 2001 From: Minims Date: Sun, 10 Oct 2021 01:10:21 +0200 Subject: [PATCH 10/25] =?UTF-8?q?=F0=9F=A9=B9=20Adjust=20GTR=201.0=20ST792?= =?UTF-8?q?0=20display=20delay=20(#22904)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index 68948f7de9..95f74efe84 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -483,9 +483,9 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) - #define BOARD_ST7920_DELAY_1 96 - #define BOARD_ST7920_DELAY_2 48 + #if IS_U8GLIB_ST7920 + #define BOARD_ST7920_DELAY_1 125 + #define BOARD_ST7920_DELAY_2 90 #define BOARD_ST7920_DELAY_3 600 #endif From 0f519ebf854cdb0fd3d00828ca7a4b4d09c8d610 Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Tue, 12 Oct 2021 20:01:18 -0500 Subject: [PATCH 11/25] =?UTF-8?q?=E2=9C=A8=20MKS=20Eagle=20(STM32F407VET6)?= =?UTF-8?q?=20board=20(#22897)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h | 35 ++ .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 343 +--------------- .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 375 ++++++++++++++++++ ini/stm32f4.ini | 44 ++ 6 files changed, 458 insertions(+), 342 deletions(-) create mode 100644 Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h create mode 100644 Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index bc29ab5dec..dd08f6a1b4 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -402,6 +402,7 @@ #define BOARD_TH3D_EZBOARD_LITE_V2 4232 // TH3D EZBoard Lite v2.0 #define BOARD_INDEX_REV03 4233 // Index PnP Controller REV03 (STM32F407VET6/VGT6) #define BOARD_MKS_ROBIN_NANO_V1_3_F4 4234 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VET6) +#define BOARD_MKS_EAGLE 4235 // MKS Eagle (STM32F407VET6) // // ARM Cortex M7 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 58f3850389..14a13219dd 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -651,6 +651,8 @@ #include "stm32f4/pins_INDEX_REV03.h" // STM32F4 env:Index_Mobo_Rev03 #elif MB(MKS_ROBIN_NANO_V1_3_F4) #include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4 env:mks_robin_nano_v1_3_f4 +#elif MB(MKS_EAGLE) + #include "stm32f4/pins_MKS_EAGLE.h" // STM32F4 env:mks_eagle // // ARM Cortex M7 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h b/Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h new file mode 100644 index 0000000000..50f06b7e81 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h @@ -0,0 +1,35 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 . + * + */ +#pragma once + +#define ALLOW_STM32DUINO +#include "env_validate.h" + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "MKS Eagle supports up to 2 hotends / E-steppers." +#elif HAS_FSMC_TFT + #error "MKS Eagle doesn't support FSMC-based TFT displays." +#endif + +#define BOARD_INFO_NAME "MKS Eagle" + +#include "pins_MKS_ROBIN_NANO_V3_common.h" diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h index c9762a6914..4dc73e0312 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -32,80 +32,22 @@ #define BOARD_INFO_NAME "MKS Robin Nano V3" -// USB Flash Drive support -#define HAS_OTG_USB_HOST_SUPPORT - -// Avoid conflict with TIMER_TONE -#define STEP_TIMER 10 - -// Use one of these or SDCard-based Emulation will be used -//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation -//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation -#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) - #define I2C_EEPROM - #define MARLIN_EEPROM_SIZE 0x1000 // 4KB - #define I2C_SCL_PIN PB6 - #define I2C_SDA_PIN PB7 -#endif - -// -// Release PB4 (Z_DIR_PIN) from JTAG NRST role -// -//#define DISABLE_DEBUG - -// -// Servos -// -#define SERVO0_PIN PA8 // Enable BLTOUCH - -// -// Limit Switches -// -#define X_DIAG_PIN PA15 -#define Y_DIAG_PIN PD2 -#define Z_DIAG_PIN PC8 -#define E0_DIAG_PIN PC4 -#define E1_DIAG_PIN PE7 - -#define X_STOP_PIN X_DIAG_PIN -#define Y_STOP_PIN Y_DIAG_PIN -#define Z_MIN_PIN Z_DIAG_PIN -#define Z_MAX_PIN E0_DIAG_PIN - -// -// Steppers -// -#define X_ENABLE_PIN PE4 -#define X_STEP_PIN PE3 -#define X_DIR_PIN PE2 #ifndef X_CS_PIN #define X_CS_PIN PD5 #endif -#define Y_ENABLE_PIN PE1 -#define Y_STEP_PIN PE0 -#define Y_DIR_PIN PB9 #ifndef Y_CS_PIN #define Y_CS_PIN PD7 #endif -#define Z_ENABLE_PIN PB8 -#define Z_STEP_PIN PB5 -#define Z_DIR_PIN PB4 #ifndef Z_CS_PIN #define Z_CS_PIN PD4 #endif -#define E0_ENABLE_PIN PB3 -#define E0_STEP_PIN PD6 -#define E0_DIR_PIN PD3 #ifndef E0_CS_PIN #define E0_CS_PIN PD9 #endif -#define E1_ENABLE_PIN PA3 -#define E1_STEP_PIN PD15 -#define E1_DIR_PIN PA1 #ifndef E1_CS_PIN #define E1_CS_PIN PD8 #endif @@ -129,287 +71,4 @@ #endif #endif -#if HAS_TMC_UART - // - // Software serial - // No Hardware serial for steppers - // - #define X_SERIAL_TX_PIN PD5 - #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN - - #define Y_SERIAL_TX_PIN PD7 - #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN - - #define Z_SERIAL_TX_PIN PD4 - #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN - - #define E0_SERIAL_TX_PIN PD9 - #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN - - #define E1_SERIAL_TX_PIN PD8 - #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN - - // Reduce baud rate to improve software serial reliability - #define TMC_BAUD_RATE 19200 -#endif - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC1 // TH1 -#define TEMP_1_PIN PA2 // TH2 -#define TEMP_BED_PIN PC0 // TB1 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PE5 // HEATER1 -#define HEATER_1_PIN PB0 // HEATER2 -#define HEATER_BED_PIN PA0 // HOT BED - -#define FAN_PIN PC14 // FAN -#define FAN1_PIN PB1 // FAN1 - -// -// Thermocouples -// -//#define TEMP_0_CS_PIN HEATER_0_PIN // TC1 - CS1 -//#define TEMP_0_CS_PIN HEATER_1_PIN // TC2 - CS2 - -// -// Misc. Functions -// -#if HAS_TFT_LVGL_UI - #define MT_DET_1_PIN PA4 // MT_DET - #define MT_DET_2_PIN PE6 - #define MT_DET_PIN_STATE LOW -#endif - -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN MT_DET_1_PIN -#endif -#ifndef FIL_RUNOUT2_PIN - #define FIL_RUNOUT2_PIN MT_DET_2_PIN -#endif - -#ifndef POWER_LOSS_PIN - #define POWER_LOSS_PIN PA13 // PW_DET -#endif - -//#define SUICIDE_PIN PB2 -//#define LED_PIN PB2 -//#define KILL_PIN PA2 -//#define KILL_PIN_STATE LOW - -// -// Power Supply Control -// -#if ENABLED(MKS_PWC) - #if ENABLED(TFT_LVGL_UI) - #undef PSU_CONTROL - #undef MKS_PWC - #define SUICIDE_PIN PB2 - #define SUICIDE_PIN_STATE LOW - #else - #define PS_ON_PIN PB2 // PW_OFF - #endif - #define KILL_PIN PA13 // PW_DET - #define KILL_PIN_STATE HIGH -#endif - -// Random Info -#define USB_SERIAL -1 // USB Serial -#define WIFI_SERIAL 3 // USART3 -#define MKS_WIFI_MODULE_SERIAL 1 // USART1 -#define MKS_WIFI_MODULE_SPI 2 // SPI2 - -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -// MKS WIFI MODULE -#if ENABLED(MKS_WIFI_MODULE) - #define WIFI_IO0_PIN PC13 - #define WIFI_IO1_PIN PC7 - #define WIFI_RESET_PIN PE9 -#endif - -// MKS TEST -#if ENABLED(MKS_TEST) - #define MKS_TEST_POWER_LOSS_PIN PA13 // PW_DET - #define MKS_TEST_PS_ON_PIN PB2 // PW_OFF -#endif - -// -// Onboard SD card -// -// detect pin doesn't work when ONBOARD and NO_SD_HOST_DRIVE disabled -#if SD_CONNECTION_IS(ONBOARD) - #define ENABLE_SPI3 - #define SD_SS_PIN -1 - #define SDSS PC9 - #define SD_SCK_PIN PC10 - #define SD_MISO_PIN PC11 - #define SD_MOSI_PIN PC12 - #define SD_DETECT_PIN PD12 -#endif - -#define SPI_FLASH -#if ENABLED(SPI_FLASH) - #define HAS_SPI_FLASH 1 - #define SPI_DEVICE 2 - #define SPI_FLASH_SIZE 0x1000000 - #define SPI_FLASH_CS_PIN PB12 - #define SPI_FLASH_MOSI_PIN PC3 - #define SPI_FLASH_MISO_PIN PC2 - #define SPI_FLASH_SCK_PIN PB13 -#endif - -/** - * ------ ------ - * (BEEPER) PC5 |10 9 | PE13 (BTN_ENC) (SPI1 MISO) PA6 |10 9 | PA5 (SPI1 SCK) - * (LCD_EN) PD13 | 8 7 | PC6 (LCD_RS) (BTN_EN1) PE8 | 8 7 | PE10 (SPI1 CS) - * (LCD_D4) PE14 6 5 | PE15 (LCD_D5) (BTN_EN2) PE11 6 5 | PA7 (SPI1 MOSI) - * (LCD_D6) PD11 | 4 3 | PD10 (LCD_D7) (SPI1_RS) PE12 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 3.3V - * ------ ------ - * EXP1 EXP2 - */ -#define EXP1_03_PIN PD10 -#define EXP1_04_PIN PD11 -#define EXP1_05_PIN PE15 -#define EXP1_06_PIN PE14 -#define EXP1_07_PIN PC6 -#define EXP1_08_PIN PD13 -#define EXP1_09_PIN PE13 -#define EXP1_10_PIN PC5 - -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PE12 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PE11 -#define EXP2_07_PIN PE10 -#define EXP2_08_PIN PE8 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 - -// -// SPI SD Card -// -#if SD_CONNECTION_IS(LCD) - #define ENABLE_SPI1 - #define SDSS EXP2_07_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_DETECT_PIN EXP2_04_PIN -#endif - -// -// LCD / Controller -// -#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN - #define TFT_DC_PIN EXP1_03_PIN - #define TFT_RST_PIN EXP1_07_PIN - #define TFT_A0_PIN TFT_DC_PIN - - #define TFT_RESET_PIN EXP1_07_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN - - #define TOUCH_BUTTONS_HW_SPI - #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - - #define LCD_BACKLIGHT_PIN EXP1_08_PIN - #ifndef TFT_WIDTH - #define TFT_WIDTH 480 - #endif - #ifndef TFT_HEIGHT - #define TFT_HEIGHT 320 - #endif - - #define TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS - #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK - #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO - #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI - - #define LCD_READ_ID 0xD3 - #define LCD_USE_DMA_SPI - - #define TFT_BUFFER_SIZE 14400 - - #ifndef TOUCH_CALIBRATION_X - #define TOUCH_CALIBRATION_X -17253 - #endif - #ifndef TOUCH_CALIBRATION_Y - #define TOUCH_CALIBRATION_Y 11579 - #endif - #ifndef TOUCH_OFFSET_X - #define TOUCH_OFFSET_X 514 - #endif - #ifndef TOUCH_OFFSET_Y - #define TOUCH_OFFSET_Y -24 - #endif - #ifndef TOUCH_ORIENTATION - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE - #endif - -#elif HAS_WIRED_LCD - - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_BACKLIGHT_PIN -1 - - // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) - #if ENABLED(MKS_MINI_12864) - //#define LCD_BACKLIGHT_PIN -1 - //#define LCD_RESET_PIN -1 - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - //#define DOGLCD_SCK EXP2_09_PIN - //#define DOGLCD_MOSI EXP2_05_PIN - - // Required for MKS_MINI_12864 with this board - //#define MKS_LCD12864B - //#undef SHOW_BOOTSCREEN - - #elif ENABLED(MKS_MINI_12864_V3) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define LCD_PINS_DC DOGLCD_A0 - #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN - #define NEOPIXEL_PIN EXP1_05_PIN - #define DOGLCD_MOSI EXP2_05_PIN - #define DOGLCD_SCK EXP2_09_PIN - #if SD_CONNECTION_IS(ONBOARD) - #define FORCE_SOFT_SPI - #endif - //#define LCD_SCREEN_ROT_180 - - #else // !MKS_MINI_12864 - - #define LCD_PINS_D4 EXP1_06_PIN - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN - #endif - - #define BOARD_ST7920_DELAY_1 96 - #define BOARD_ST7920_DELAY_2 48 - #define BOARD_ST7920_DELAY_3 600 - - #endif // !MKS_MINI_12864 - -#endif // HAS_WIRED_LCD - -#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD) - #define BEEPER_PIN EXP1_10_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN -#endif +#include "pins_MKS_ROBIN_NANO_V3_common.h" diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h new file mode 100644 index 0000000000..c3e3963b55 --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -0,0 +1,375 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 . + * + */ + +#pragma once + +// +// MKS Robin Nano V3, MKS Eagle pinmap +// + +// USB Flash Drive support +#define HAS_OTG_USB_HOST_SUPPORT + +// Avoid conflict with TIMER_TONE +#define STEP_TIMER 10 + +// Use one of these or SDCard-based Emulation will be used +//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation +//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM) + #define I2C_EEPROM + #define MARLIN_EEPROM_SIZE 0x1000 // 4KB + #define I2C_SCL_PIN PB6 + #define I2C_SDA_PIN PB7 +#endif + +// +// Release PB4 (Z_DIR_PIN) from JTAG NRST role +// +//#define DISABLE_DEBUG + +// +// Servos +// +#define SERVO0_PIN PA8 // Enable BLTOUCH + +// +// Limit Switches +// +#define X_DIAG_PIN PA15 +#define Y_DIAG_PIN PD2 +#define Z_DIAG_PIN PC8 +#define E0_DIAG_PIN PC4 +#define E1_DIAG_PIN PE7 + +#define X_STOP_PIN X_DIAG_PIN +#define Y_STOP_PIN Y_DIAG_PIN +#define Z_MIN_PIN Z_DIAG_PIN +#define Z_MAX_PIN E0_DIAG_PIN + +// +// Steppers +// +#define X_ENABLE_PIN PE4 +#define X_STEP_PIN PE3 +#define X_DIR_PIN PE2 + +#define Y_ENABLE_PIN PE1 +#define Y_STEP_PIN PE0 +#define Y_DIR_PIN PB9 + +#define Z_ENABLE_PIN PB8 +#define Z_STEP_PIN PB5 +#define Z_DIR_PIN PB4 + +#define E0_ENABLE_PIN PB3 +#define E0_STEP_PIN PD6 +#define E0_DIR_PIN PD3 + +#define E1_ENABLE_PIN PA3 +#define E1_STEP_PIN PD15 +#define E1_DIR_PIN PA1 + +#if HAS_TMC_UART + // + // Software serial + // No Hardware serial for steppers + // + #define X_SERIAL_TX_PIN PD5 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + + #define Y_SERIAL_TX_PIN PD7 + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + + #define Z_SERIAL_TX_PIN PD4 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + + #define E0_SERIAL_TX_PIN PD9 + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + + #define E1_SERIAL_TX_PIN PD8 + #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // TH1 +#define TEMP_1_PIN PA2 // TH2 +#define TEMP_BED_PIN PC0 // TB1 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PE5 // HEATER1 +#define HEATER_1_PIN PB0 // HEATER2 +#define HEATER_BED_PIN PA0 // HOT BED + +#define FAN_PIN PC14 // FAN +#define FAN1_PIN PB1 // FAN1 + +// +// Thermocouples +// +//#define TEMP_0_CS_PIN HEATER_0_PIN // TC1 - CS1 +//#define TEMP_0_CS_PIN HEATER_1_PIN // TC2 - CS2 + +// +// Misc. Functions +// +#if HAS_TFT_LVGL_UI + #define MT_DET_1_PIN PA4 // MT_DET + #define MT_DET_2_PIN PE6 + #define MT_DET_PIN_STATE LOW +#endif + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN MT_DET_1_PIN +#endif +#ifndef FIL_RUNOUT2_PIN + #define FIL_RUNOUT2_PIN MT_DET_2_PIN +#endif + +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN PA13 // PW_DET +#endif + +//#define SUICIDE_PIN PB2 +//#define LED_PIN PB2 +//#define KILL_PIN PA2 +//#define KILL_PIN_STATE LOW + +// +// Power Supply Control +// +#if ENABLED(MKS_PWC) + #if ENABLED(TFT_LVGL_UI) + #undef PSU_CONTROL + #undef MKS_PWC + #define SUICIDE_PIN PB2 + #define SUICIDE_PIN_STATE LOW + #else + #define PS_ON_PIN PB2 // PW_OFF + #endif + #define KILL_PIN PA13 // PW_DET + #define KILL_PIN_STATE HIGH +#endif + +// Random Info +#define USB_SERIAL -1 // USB Serial +#define WIFI_SERIAL 3 // USART3 +#define MKS_WIFI_MODULE_SERIAL 1 // USART1 +#define MKS_WIFI_MODULE_SPI 2 // SPI2 + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +// MKS WIFI MODULE +#if ENABLED(MKS_WIFI_MODULE) + #define WIFI_IO0_PIN PC13 + #define WIFI_IO1_PIN PC7 + #define WIFI_RESET_PIN PE9 +#endif + +// MKS TEST +#if ENABLED(MKS_TEST) + #define MKS_TEST_POWER_LOSS_PIN PA13 // PW_DET + #define MKS_TEST_PS_ON_PIN PB2 // PW_OFF +#endif + +// +// Onboard SD card +// +// detect pin doesn't work when ONBOARD and NO_SD_HOST_DRIVE disabled +#if SD_CONNECTION_IS(ONBOARD) + #define ENABLE_SPI3 + #define SD_SS_PIN -1 + #define SDSS PC9 + #define SD_SCK_PIN PC10 + #define SD_MISO_PIN PC11 + #define SD_MOSI_PIN PC12 + #define SD_DETECT_PIN PD12 +#endif + +#define SPI_FLASH +#if ENABLED(SPI_FLASH) + #define HAS_SPI_FLASH 1 + #define SPI_DEVICE 2 + #define SPI_FLASH_SIZE 0x1000000 + #define SPI_FLASH_CS_PIN PB12 + #define SPI_FLASH_MOSI_PIN PC3 + #define SPI_FLASH_MISO_PIN PC2 + #define SPI_FLASH_SCK_PIN PB13 +#endif + +/** + * ------ ------ + * (BEEPER) PC5 |10 9 | PE13 (BTN_ENC) (SPI1 MISO) PA6 |10 9 | PA5 (SPI1 SCK) + * (LCD_EN) PD13 | 8 7 | PC6 (LCD_RS) (BTN_EN1) PE8 | 8 7 | PE10 (SPI1 CS) + * (LCD_D4) PE14 6 5 | PE15 (LCD_D5) (BTN_EN2) PE11 6 5 | PA7 (SPI1 MOSI) + * (LCD_D6) PD11 | 4 3 | PD10 (LCD_D7) (SPI1_RS) PE12 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | 3.3V + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN PD10 +#define EXP1_04_PIN PD11 +#define EXP1_05_PIN PE15 +#define EXP1_06_PIN PE14 +#define EXP1_07_PIN PC6 +#define EXP1_08_PIN PD13 +#define EXP1_09_PIN PE13 +#define EXP1_10_PIN PC5 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN PE12 +#define EXP2_05_PIN PA7 +#define EXP2_06_PIN PE11 +#define EXP2_07_PIN PE10 +#define EXP2_08_PIN PE8 +#define EXP2_09_PIN PA5 +#define EXP2_10_PIN PA6 + +// +// SPI SD Card +// +#if SD_CONNECTION_IS(LCD) + #define ENABLE_SPI1 + #define SDSS EXP2_07_PIN + #define SD_SCK_PIN EXP2_09_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_MOSI_PIN EXP2_05_PIN + #define SD_DETECT_PIN EXP2_04_PIN +#endif + +// +// LCD / Controller +// +#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) + #define TFT_CS_PIN EXP1_04_PIN + #define TFT_SCK_PIN EXP2_09_PIN + #define TFT_MISO_PIN EXP2_10_PIN + #define TFT_MOSI_PIN EXP2_05_PIN + #define TFT_DC_PIN EXP1_03_PIN + #define TFT_RST_PIN EXP1_07_PIN + #define TFT_A0_PIN TFT_DC_PIN + + #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_BACKLIGHT_PIN EXP1_08_PIN + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 + + #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #ifndef TFT_WIDTH + #define TFT_WIDTH 480 + #endif + #ifndef TFT_HEIGHT + #define TFT_HEIGHT 320 + #endif + + #define TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI + + #define LCD_READ_ID 0xD3 + #define LCD_USE_DMA_SPI + + #define TFT_BUFFER_SIZE 14400 + + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17253 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11579 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 514 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -24 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + +#elif HAS_WIRED_LCD + + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_BACKLIGHT_PIN -1 + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + //#define LCD_BACKLIGHT_PIN -1 + //#define LCD_RESET_PIN -1 + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + //#define DOGLCD_SCK EXP2_09_PIN + //#define DOGLCD_MOSI EXP2_05_PIN + + // Required for MKS_MINI_12864 with this board + //#define MKS_LCD12864B + //#undef SHOW_BOOTSCREEN + + #elif ENABLED(MKS_MINI_12864_V3) + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define LCD_PINS_DC DOGLCD_A0 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXP1_06_PIN + #define NEOPIXEL_PIN EXP1_05_PIN + #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_SCK EXP2_09_PIN + #if SD_CONNECTION_IS(ONBOARD) + #define FORCE_SOFT_SPI + #endif + //#define LCD_SCREEN_ROT_180 + + #else // !MKS_MINI_12864 + + #define LCD_PINS_D4 EXP1_06_PIN + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + #endif + + #define BOARD_ST7920_DELAY_1 96 + #define BOARD_ST7920_DELAY_2 48 + #define BOARD_ST7920_DELAY_3 600 + + #endif // !MKS_MINI_12864 + +#endif // HAS_WIRED_LCD + +#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD) + #define BEEPER_PIN EXP1_10_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN +#endif diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 09313b020f..4544bf56a0 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -404,6 +404,49 @@ build_flags = ${env:mks_robin_nano_v3_usb_flash_drive.build_flags} -DUSBD_USE_CDC_MSC build_unflags = -DUSBD_USE_CDC +# +# MKS Eagle +# 5 TMC2209 uart mode on board +# +[env:mks_eagle] +platform = ${common_stm32.platform} +extends = stm32_variant +board = marlin_STM32F407VGT6_CCM +board_build.variant = MARLIN_F4x7Vx +board_build.offset = 0xC000 +board_upload.offset_address = 0x0800C000 +board_build.rename = mks_eagle.bin +build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags} + -DHAL_PCD_MODULE_ENABLED + -DSTM32_FLASH_SIZE=512 +debug_tool = jlink +upload_protocol = jlink + +# +# MKS Eagle with USB Flash Drive Support +# Currently, using a STM32duino fork, until USB Host get merged +# +[env:mks_eagle_usb_flash_drive] +platform = ${common_stm32.platform} +extends = env:mks_eagle +platform_packages = ${stm_flash_drive.platform_packages} +build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} + -DUSE_USBHOST_HS + -DUSBD_IRQ_PRIO=5 + -DUSBD_IRQ_SUBPRIO=6 + -DUSE_USB_HS_IN_FS + +# +# MKS Eagle with USB Flash Drive Support and Shared Media +# Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged +# +[env:mks_eagle_usb_flash_drive_msc] +platform = ${common_stm32.platform} +extends = env:mks_eagle_usb_flash_drive +build_flags = ${env:mks_eagle_usb_flash_drive.build_flags} + -DUSBD_USE_CDC_MSC +build_unflags = -DUSBD_USE_CDC + # # This I2C1(PB8:I2C1_SCL PB9:I2C1_SDA) is used by MKS Monster8 # @@ -423,6 +466,7 @@ board_upload.offset_address = 0x0800C000 board_build.rename = mks_monster8.bin build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1_CAN.build_flags} -DHAL_PCD_MODULE_ENABLED -DTIMER_SERIAL=TIM4 + -DSTM32_FLASH_SIZE=512 debug_tool = jlink upload_protocol = jlink From b18aa933d14f9761d74b19be79db64e21356c563 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 13 Oct 2021 14:28:45 +1300 Subject: [PATCH 12/25] =?UTF-8?q?=F0=9F=90=9B=20Fix=20G33=20homing=20curre?= =?UTF-8?q?nt=20(#22909)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/calibrate/G33.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 8867c168d2..24a985299f 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -73,9 +73,9 @@ float dcr; void ac_home() { endstops.enable(true); - TERN_(SENSORLESS_HOMING, probe.set_homing_current(true)); + TERN_(HAS_DELTA_SENSORLESS_PROBING, probe.set_homing_current(true)); home_delta(); - TERN_(SENSORLESS_HOMING, probe.set_homing_current(false)); + TERN_(HAS_DELTA_SENSORLESS_PROBING, probe.set_homing_current(false)); endstops.not_homing(); } From d10e20d6d2faaea04df81dca682290a2aa081fee Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Fri, 15 Oct 2021 15:56:59 -0400 Subject: [PATCH 13/25] =?UTF-8?q?=E2=9C=A8=20Add=20option=20EVENT=5FGCODE?= =?UTF-8?q?=5FTOOLCHANGE=5FALWAYS=5FRUN=20(#22960)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 1 + Marlin/src/module/tool_change.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6e44f009ed..86a7372ebd 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2313,6 +2313,7 @@ */ //#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0 //#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1 + //#define EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN // Always execute above G-code sequences. Use with caution! /** * Tool Sensors detect when tools have been picked up or dropped. diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index cb551647d7..62889b6d5f 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -1307,7 +1307,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { TERN_(HAS_FANMUX, fanmux_switch(active_extruder)); - if (!no_move) { + if (ENABLED(EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN) || !no_move) { #ifdef EVENT_GCODE_TOOLCHANGE_T0 if (new_tool == 0) gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_TOOLCHANGE_T0)); From 641bae625b659cc5eba13c20c174de5fff7caa98 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Oct 2021 15:07:47 -0500 Subject: [PATCH 14/25] =?UTF-8?q?=F0=9F=92=A1=20Update=20old=20gnu.org=20l?= =?UTF-8?q?inks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp | 2 +- Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h | 2 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 2 +- Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Control.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Data.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Screen.h | 2 +- .../lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp | 2 +- .../lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.h | 2 +- .../src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp | 2 +- .../src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VP.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp | 2 +- Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h | 2 +- Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h | 2 +- Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp b/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp index 069272f6c1..8892f1a004 100644 --- a/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/lcdprint_dwin.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h b/Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h index de87c30b6b..a91cd19f6e 100644 --- a/Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h +++ b/Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 9ad258b3ac..ca8e6c177f 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp index 0e2f3a3d4c..703db2ee45 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp index 4fce364f81..1d97902c71 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h index 2a679648d1..1869f79404 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index 8567e5c0e7..baae2538a0 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h index 593b2e3bb8..c2e6e4308e 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 6316f1194b..02cc3d6836 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index 402d8d3d38..0c5e066212 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp index 0d94751fc2..48bea1cdc0 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h index 20cd48c986..9e3866467f 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index 6c14745904..3fc48d2ebb 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h index a034b92ece..94632fe385 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h index 00cdecb689..4207119c87 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h index 4047a6d6dc..9b275fb2f5 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Control.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Control.h index 92d2f5ece2..650e1e3a1d 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Control.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Control.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Data.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Data.h index 886109054c..e1c1bf557f 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Data.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Data.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Screen.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Screen.h index b3d2ad6d3c..0a738223ce 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Screen.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Screen.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp index 95e6444956..1627d44c84 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.h b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.h index af05c46d28..1e481ef3cc 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenAddrList.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp index 213e430334..13319edd05 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.h b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.h index 3b9208e5ec..93df5ad90a 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_ScreenSetup.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VP.h b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VP.h index b1b6792224..30b3f9ddba 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VP.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VP.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp index 486f00f6ed..27b6d9036c 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.h b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.h index d481fbab5c..1a4f36882c 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index 4d57fbd7e2..26f2dcbde9 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h index d4f77d5f84..ba948bc479 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h index daacd0c124..093821bbd2 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h index e0b2f6adfc..e19413aa5e 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h @@ -16,7 +16,7 @@ * 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 . + * along with this program. If not, see . * */ #pragma once From 522cdd52727383e9a2e4f0295b85ae6e2d94aacf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Oct 2021 16:56:01 -0500 Subject: [PATCH 15/25] =?UTF-8?q?=F0=9F=94=A7=20Safety=20feature=20warning?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Warnings.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index aba3d94366..4fdb7a84df 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -35,6 +35,23 @@ #warning "WARNING! Disable MARLIN_DEV_MODE for the final build!" #endif +// Safety Features +#if DISABLED(USE_WATCHDOG) + #warning "Safety Alert! Enable USE_WATCHDOG for the final build!" +#endif +#if HAS_HOTEND && DISABLED(THERMAL_PROTECTION_HOTENDS) + #warning "Safety Alert! Enable THERMAL_PROTECTION_HOTENDS for the final build!" +#endif +#if HAS_HEATED_BED && DISABLED(THERMAL_PROTECTION_BED) + #warning "Safety Alert! Enable THERMAL_PROTECTION_BED for the final build!" +#endif +#if HAS_HEATED_CHAMBER && DISABLED(THERMAL_PROTECTION_CHAMBER) + #warning "Safety Alert! Enable THERMAL_PROTECTION_CHAMBER for the final build!" +#endif +#if HAS_COOLER && DISABLED(THERMAL_PROTECTION_COOLER) + #warning "Safety Alert! Enable THERMAL_PROTECTION_COOLER for the final build!" +#endif + #if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT) #warning "Your Configuration provides no method to acquire user feedback!" #endif From 61b574f2cea9f23603a3c0250b6bd11934fa3d60 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Oct 2021 19:26:31 -0500 Subject: [PATCH 16/25] =?UTF-8?q?=F0=9F=94=A8=20Improve=20'mftest'=20error?= =?UTF-8?q?=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/mftest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/bin/mftest b/buildroot/bin/mftest index 4ed1b9d951..9a58ba9cfc 100755 --- a/buildroot/bin/mftest +++ b/buildroot/bin/mftest @@ -155,7 +155,7 @@ if ((AUTO_BUILD)); then BLINE=$( grep -E "define\s+BOARD_$MB\b" Marlin/src/core/boards.h ) BNUM=$( $SED -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" ) BDESC=$( $SED -E 's/^.+\/\/ *(.+)$/\1/' <<<"$BLINE" ) - [[ -z $BNUM ]] && { echo "Error - Can't find $MB in boards list." ; exit 1 ; } + [[ -z $BNUM ]] && { echo "Error - Can't find BOARD_$MB in core/boards.h." ; exit 1 ; } ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+(env|$SYS):[^ ]+" | grep -oE "(env|$SYS):[^ ]+" | $SED -E "s/(env|$SYS)://" ) ) [[ -z $ENVS ]] && { errout "Error - Can't find target(s) for $MB ($BNUM)." ; exit 1 ; } ECOUNT=${#ENVS[*]} From 1112d66fefedafacf32027fd7b44f11b1546306d Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 18 Oct 2021 02:01:28 -0400 Subject: [PATCH 17/25] Fix Tool Change Park (#22968) --- Marlin/src/module/tool_change.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 62889b6d5f..8f419205f3 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -954,7 +954,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. #if ENABLED(TOOLCHANGE_NO_RETURN) const float temp = destination.z; destination = current_position; - destination.z = temp.z; + destination.z = temp; #endif prepare_internal_move_to_destination(TERN(TOOLCHANGE_NO_RETURN, planner.settings.max_feedrate_mm_s[Z_AXIS], MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE))); } From 5bfc5c10103c9f6067d8e1969d8a9c1f1384b9cd Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 18 Oct 2021 02:03:01 -0400 Subject: [PATCH 18/25] Fix JyersUI ZOffset Multiplication (#22975) --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 6d4f8b0a3a..e53ca4f3ff 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -419,7 +419,7 @@ void CrealityDWINClass::Draw_Float(float value, uint8_t row, bool selected/*=fal if (isnan(value)) DWIN_Draw_String(true, DWIN_FONT_MENU, Color_White, bColor, xpos - 8, MBASE(row), F(" NaN")); else { - DWIN_Draw_FloatValue(true, true, 0, DWIN_FONT_MENU, Color_White, bColor, digits - log10(minunit) + 1, log10(minunit), xpos, MBASE(row), (value < 0 ? -value : value) * minunit); + DWIN_Draw_FloatValue(true, true, 0, DWIN_FONT_MENU, Color_White, bColor, digits - log10(minunit) + 1, log10(minunit), xpos, MBASE(row), (value < 0 ? -value : value)); DWIN_Draw_String(true, DWIN_FONT_MENU, Color_White, bColor, xpos - 8, MBASE(row), value < 0 ? F("-") : F(" ")); } } @@ -855,7 +855,7 @@ void CrealityDWINClass::Draw_Status_Area(bool icons/*=false*/) { } if (zoffsetvalue != offset) { offset = zoffsetvalue; - DWIN_Draw_FloatValue(true, true, 0, DWIN_FONT_STAT, GetColor(eeprom_settings.status_area_text, Color_White), Color_Bg_Black, 2, 2, 207, 417, (zoffsetvalue < 0 ? -zoffsetvalue : zoffsetvalue) * 100); + DWIN_Draw_FloatValue(true, true, 0, DWIN_FONT_STAT, GetColor(eeprom_settings.status_area_text, Color_White), Color_Bg_Black, 2, 2, 207, 417, (zoffsetvalue < 0 ? -zoffsetvalue : zoffsetvalue)); DWIN_Draw_String(true, DWIN_FONT_MENU, GetColor(eeprom_settings.status_area_text, Color_White), Color_Bg_Black, 205, 419, zoffsetvalue < 0 ? F("-") : F(" ")); } #endif From c3a4e6b3c8b581ac458618507177eb81dfedd7a1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 18 Oct 2021 01:49:35 -0500 Subject: [PATCH 19/25] =?UTF-8?q?=E2=9C=85=20Warn=20about=20dummy=20thermi?= =?UTF-8?q?stors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_adv.h | 16 +++-- Marlin/src/inc/SanityCheck.h | 70 +++------------------- Marlin/src/inc/Warnings.cpp | 3 + Marlin/src/module/temperature.cpp | 16 ++--- Marlin/src/module/thermistor/thermistors.h | 12 ---- 5 files changed, 25 insertions(+), 92 deletions(-) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 94332c9268..775f6a04f0 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -132,17 +132,15 @@ #define HID_E6 6 #define HID_E7 7 -#define ANY_TEMP_SENSOR_IS(n) (n == TEMP_SENSOR_0 || n == TEMP_SENSOR_1 || n == TEMP_SENSOR_2 || n == TEMP_SENSOR_3 \ - || n == TEMP_SENSOR_4 || n == TEMP_SENSOR_5 || n == TEMP_SENSOR_6 || n == TEMP_SENSOR_7 \ - || n == TEMP_SENSOR_BED \ - || n == TEMP_SENSOR_PROBE \ - || n == TEMP_SENSOR_CHAMBER \ - || n == TEMP_SENSOR_COOLER \ - || n == TEMP_SENSOR_REDUNDANT ) -#if ANY_TEMP_SENSOR_IS(1000) +#define _SENSOR_IS(I,N) || (TEMP_SENSOR_##N == I) +#define _E_SENSOR_IS(I,N) _SENSOR_IS(N,I) +#define ANY_THERMISTOR_IS(N) (0 REPEAT2(HOTENDS, _E_SENSOR_IS, N) \ + _SENSOR_IS(N,BED) _SENSOR_IS(N,PROBE) _SENSOR_IS(N,CHAMBER) \ + _SENSOR_IS(N,COOLER) _SENSOR_IS(N,BOARD) _SENSOR_IS(N,REDUNDANT) ) + +#if ANY_THERMISTOR_IS(1000) #define HAS_USER_THERMISTORS 1 #endif -#undef ANY_TEMP_SENSOR_IS #if TEMP_SENSOR_REDUNDANT #define _HEATER_ID(M) HID_##M diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index cb3314b25f..abc38c0a5a 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2193,68 +2193,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif !PIN_EXISTS(TEMP_7) && !TEMP_SENSOR_7_IS_DUMMY #error "TEMP_7_PIN not defined for this board." #endif - #elif TEMP_SENSOR_7 != 0 - #error "TEMP_SENSOR_7 shouldn't be set with only 7 HOTENDS." - #endif - #elif TEMP_SENSOR_6 != 0 - #error "TEMP_SENSOR_6 shouldn't be set with only 6 HOTENDS." - #elif TEMP_SENSOR_7 != 0 - #error "TEMP_SENSOR_7 shouldn't be set with only 6 HOTENDS." - #endif - #elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS." - #elif TEMP_SENSOR_6 != 0 - #error "TEMP_SENSOR_6 shouldn't be set with only 5 HOTENDS." - #elif TEMP_SENSOR_7 != 0 - #error "TEMP_SENSOR_7 shouldn't be set with only 5 HOTENDS." - #endif - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS." - #elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS." - #elif TEMP_SENSOR_6 != 0 - #error "TEMP_SENSOR_6 shouldn't be set with only 4 HOTENDS." - #elif TEMP_SENSOR_7 != 0 - #error "TEMP_SENSOR_7 shouldn't be set with only 4 HOTENDS." - #endif - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS." - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS." - #elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS." - #elif TEMP_SENSOR_6 != 0 - #error "TEMP_SENSOR_6 shouldn't be set with only 3 HOTENDS." - #elif TEMP_SENSOR_7 != 0 - #error "TEMP_SENSOR_7 shouldn't be set with only 3 HOTENDS." - #endif - #elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_6 != 0 - #error "TEMP_SENSOR_6 shouldn't be set with only 2 HOTENDS." - #elif TEMP_SENSOR_7 != 0 - #error "TEMP_SENSOR_7 shouldn't be set with only 2 HOTENDS." - #endif -#elif TEMP_SENSOR_1 != 0 - #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_2 != 0 - #error "TEMP_SENSOR_2 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_3 != 0 - #error "TEMP_SENSOR_3 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_4 != 0 - #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_5 != 0 - #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_6 != 0 - #error "TEMP_SENSOR_6 shouldn't be set with only 1 HOTEND." -#elif TEMP_SENSOR_7 != 0 - #error "TEMP_SENSOR_7 shouldn't be set with only 1 HOTEND." + #endif // HOTENDS > 7 + #endif // HOTENDS > 6 + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 #endif // HAS_MULTI_HOTEND /** @@ -3288,7 +3232,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if HAS_MOTOR_CURRENT_I2C #if BOTH(DIGIPOT_MCP4018, DIGIPOT_MCP4451) #error "Enable only one of DIGIPOT_MCP4018 or DIGIPOT_MCP4451." -#elif !MB(MKS_SBASE, AZTEEG_X5_GT, AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) \ + #elif !MB(MKS_SBASE, AZTEEG_X5_GT, AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) \ && (!defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)) #error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined." #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 4fdb7a84df..5e7aba3421 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -51,6 +51,9 @@ #if HAS_COOLER && DISABLED(THERMAL_PROTECTION_COOLER) #warning "Safety Alert! Enable THERMAL_PROTECTION_COOLER for the final build!" #endif +#if ANY_THERMISTOR_IS(998) || ANY_THERMISTOR_IS(999) + #warning "Warning! Don't use dummy thermistors (998/999) for final build!" +#endif #if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT) #warning "Your Configuration provides no method to acquire user feedback!" diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index d59ebe5695..0f6395b127 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -2207,22 +2207,22 @@ void Temperature::init() { // Thermistor activation by MCU pin #if PIN_EXISTS(TEMP_0_TR_ENABLE) - OUT_WRITE(TEMP_0_TR_ENABLE_PIN, + OUT_WRITE(TEMP_0_TR_ENABLE_PIN, ( #if TEMP_SENSOR_IS_ANY_MAX_TC(0) - 1 + HIGH #else - 0 + LOW #endif - ); + )); #endif #if PIN_EXISTS(TEMP_1_TR_ENABLE) - OUT_WRITE(TEMP_1_TR_ENABLE_PIN, + OUT_WRITE(TEMP_1_TR_ENABLE_PIN, ( #if TEMP_SENSOR_IS_ANY_MAX_TC(1) - 1 + HIGH #else - 0 + LOW #endif - ); + )); #endif #if HAS_HEATER_0 diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 28a1e2f90f..85f4449636 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -42,18 +42,6 @@ #define OV_SCALE(N) (N) #define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE)) -#define TEMP_SENSOR_IS(n,H) (n == TEMP_SENSOR_##H) -#define ANY_THERMISTOR_IS(n) ( TEMP_SENSOR_IS(n, 0) || TEMP_SENSOR_IS(n, 1) \ - || TEMP_SENSOR_IS(n, 2) || TEMP_SENSOR_IS(n, 3) \ - || TEMP_SENSOR_IS(n, 4) || TEMP_SENSOR_IS(n, 5) \ - || TEMP_SENSOR_IS(n, 6) || TEMP_SENSOR_IS(n, 7) \ - || TEMP_SENSOR_IS(n, BED) \ - || TEMP_SENSOR_IS(n, CHAMBER) \ - || TEMP_SENSOR_IS(n, COOLER) \ - || TEMP_SENSOR_IS(n, PROBE) \ - || TEMP_SENSOR_IS(n, BOARD) \ - || TEMP_SENSOR_IS(n, REDUNDANT) ) - typedef struct { int16_t value; celsius_t celsius; } temp_entry_t; // Pt1000 and Pt100 handling From fed72e4607b864d8048ae87b08063f0ac6f1eaed Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Oct 2021 11:17:36 -0500 Subject: [PATCH 20/25] =?UTF-8?q?=F0=9F=94=A8=20Use=20pull=5Frequest=5Ftar?= =?UTF-8?q?get=20for=20check-pr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index b30513f7cc..93a110f270 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -6,7 +6,8 @@ name: PR Bad Target on: - pull_request: + pull_request_target: + types: [opened] branches: - 1.0.x - 1.1.x From 2c6fe45847e0ada1b873bbc302cce2c51325902b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Oct 2021 02:49:35 -0500 Subject: [PATCH 21/25] =?UTF-8?q?=F0=9F=94=A8=20Update=20'pio=20vscode=20i?= =?UTF-8?q?nit'=20detection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformIO/scripts/common-dependencies.py | 9 ++++++--- .../PlatformIO/scripts/download_mks_assets.py | 15 ++++++++++----- buildroot/share/PlatformIO/scripts/pioutil.py | 8 ++++++++ .../share/PlatformIO/scripts/preflight-checks.py | 11 ++++++----- 4 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 buildroot/share/PlatformIO/scripts/pioutil.py diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.py b/buildroot/share/PlatformIO/scripts/common-dependencies.py index 83dfeca879..f523b12069 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 @@ except: 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 e922fed2be..251a74a4cc 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/pioutil.py b/buildroot/share/PlatformIO/scripts/pioutil.py new file mode 100644 index 0000000000..f0c021fca7 --- /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 b949df97c8..0dab3e4b1f 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() From b4904cc53e3a8a97fe8047ebe918bc8ea474e120 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Oct 2021 02:56:44 -0500 Subject: [PATCH 22/25] =?UTF-8?q?=F0=9F=94=A8=20Delete=20after=20encrypt.?= =?UTF-8?q?=20Lerdge=20encrypt=20only=20once?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/lerdge.py | 47 ++++++++++---------- buildroot/share/PlatformIO/scripts/marlin.py | 16 ++++--- ini/stm32f4.ini | 4 +- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/lerdge.py b/buildroot/share/PlatformIO/scripts/lerdge.py index 654f0ad4df..144ab64a9a 100644 --- a/buildroot/share/PlatformIO/scripts/lerdge.py +++ b/buildroot/share/PlatformIO/scripts/lerdge.py @@ -12,37 +12,36 @@ from SCons.Script import DefaultEnvironment 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 3949037904..caa0c89749 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/ini/stm32f4.ini b/ini/stm32f4.ini index 4544bf56a0..6d55ac37b9 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 # From b108741a8e2ba426f006a4c4bb562aa126eb400d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Oct 2021 04:03:03 -0500 Subject: [PATCH 23/25] =?UTF-8?q?=F0=9F=92=A1=20Sub-include=20pins=20label?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h | 2 +- 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 +- Marlin/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 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h | 2 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_V1_1.h | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) 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 2b847d339f..7f428fc918 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/ramps/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h index 07af61e693..ee8cafa897 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 7715eca7eb..4d7c67fc39 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 df685e0f0c..395e1ccca5 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 bed2238162..36c438aca2 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 ccf7ab6793..6b48e3cbd6 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 0be58653aa..c40cabe325 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 3612f9b894..992ab92ee9 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 9e670d1bbd..2b0c2bb883 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 a4dfca21b4..31a8fdab8d 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 3ce138b975..973f924e7c 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 5a6bba3c08..8242f1a772 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 ce9e4e5466..eee0dcd3d2 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 6c4b28d0b8..e9328ca7ba 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 f4db07ef8d..a6e9175b62 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 c3c38eb6f3..3edb14ec41 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 31583fd109..37b28c0089 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 3c6dd901c0..cb7ecdbe1f 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 0e09c1f005..447eca7e3c 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 3bf8f80457..a0421dcf5c 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 8abed5c30c..19a75c2b32 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 c3133432e0..48b3c5f913 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 b10a09840a..ea36211f3b 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 96420cf322..8133955224 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 0d927cf7cb..718f9dc27a 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 002c35fe54..30720e0c7f 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 From 5f6d9e9f42d0cf5126f763e8a8f4f617cb8fcc8f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Oct 2021 05:51:49 -0500 Subject: [PATCH 24/25] =?UTF-8?q?=F0=9F=8E=A8=20Fix=20pinsDebug=5Flist=20w?= =?UTF-8?q?arnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/pinsDebug_list.h | 298 ++++++++++++++++++------------- 1 file changed, 171 insertions(+), 127 deletions(-) diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index fe670cca29..8a4350d90e 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) From 30158424e993919b9a4d8fe4b14793df3affe7ff Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 19 Oct 2021 05:53:34 -0500 Subject: [PATCH 25/25] =?UTF-8?q?=F0=9F=94=A8=20Fix=20older=20GCC=20CXXFLA?= =?UTF-8?q?GS=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/common-cxxflags.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index 856a246fba..26bff515a6 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