Compare commits

...

179 Commits

Author SHA1 Message Date
InsanityAutomation 4894f35e39 Merge branch 'Trex_2.0.x_Devel' of https://github.com/InsanityAutomation/Marlin into Trex_2.0.x_Devel 2024-06-26 10:53:20 -04:00
InsanityAutomation 11ae89e290 Bump to current 2024-04-15 14:16:11 -04:00
thinkyhead 9a570b23a3 [cron] Bump distribution date (2024-04-11) 2024-04-11 12:07:54 +00:00
Andrew 1b091ecb87 ✏️Minor style and typo fixups (#26947)
* tweaks from PR, whitespace, wording in pause.h

* Update Marlin/src/feature/pause.h
2024-04-10 23:13:54 -07:00
thinkyhead a75a5f8b2a [cron] Bump distribution date (2024-04-10) 2024-04-10 06:13:36 +00:00
ellensp 80dd02fbdb 📝 Update RGB565 color picker url (#26951) 2024-04-09 23:02:32 -07:00
Keith Bennett e6755450df 🩹 Fix ESP3D WiFi Support (#26822) 2024-04-09 22:58:13 -07:00
ellensp 9215bf791b 🔨 MarlinSimUI updates (#26955) 2024-04-09 22:50:21 -07:00
thinkyhead 311bfc99f3 [cron] Bump distribution date (2024-04-08) 2024-04-08 00:21:49 +00:00
Keith Bennett a3434de2e6 🩹 Fix MCU check for STM32H7-based BTT Octopus Pro V1 (#26831)
* 🩹 Fix MCU check for STM32H7-based BTT Octopus Pro V1

Co-authored-by: ellensp <530024+ellensp@users.noreply.github.com>

* Update Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h

---------

Co-authored-by: ellensp <530024+ellensp@users.noreply.github.com>
2024-04-07 12:05:35 -07:00
Keith Bennett 2bf56b00d4 🔧 Improve BIQU BX pins, allow Z swap (#26871)
* Add a swap Z & E1 option for BIQU BX

Users can add #define BX_SWAP_ZM_E1M to their config instead of opening their printer up & swapping Z & E1 motor cables. Allows G34 to work correctly on early BX printers since both Z motor wires were installed without a standard procedure in place and wires could be swapped from the factory.

* Add BOARD URL, DIAG pin info, update pin comments

* Add WIFISUPPORT defines for documentation purposes

WIFISUPPORT does not need to be enabled (read: shouldn't be enabled). Simply enable an available SERIAL_PORT*, set it to 4, and connect an ESP-01/ESP-01S flashed with luc-github's ESP3D firmware for basic WiFi functionality.

* Sanity check TOUCH_SCREEN_CALIBRATION on GT911 TFTs (BIQU BX TFT70)

Use a sanity check so it's clear which options are valid for TFT_TOUCH_DEVICE_GT911 / BIQU_BX_TFT70.
2024-04-07 10:49:36 -07:00
Andrew Bortz c31d9e717b 🩹Fix ProUI Z probe offset text (#26832) 2024-04-07 09:37:37 -07:00
narno2202 d9d7820b0d 🩹 Set correct LCD serial port for MKS_MONSTER8_V1 (#26879) 2024-04-07 08:52:35 -07:00
sargonphin 9343247e07 🩹Increase range of G34 accuracy target (#26771)
* Allow G34 accuracy down to 0.001mm, previous minimum was 0.01mm.
2024-04-07 08:48:13 -07:00
ellensp 351a1a1332 🔧 Add UART 5 for SKR Mini E3 V3.0 (#26825) 2024-04-06 23:29:19 -07:00
thinkyhead 7e9868d762 [cron] Bump distribution date (2024-04-07) 2024-04-07 06:05:53 +00:00
ellensp d1cf817660 🐛 Fix CREALITY_ENDER2P_V24S4 pins (#26908) 2024-04-06 22:57:42 -07:00
Vovodroid c91771a51e 🩹Disable nonlinear extrusion on unretract (#26824)
* Fixes disable NLE on unretract #26808, which reported blobs at the start of lines during unretract.
2024-04-06 22:41:01 -07:00
ellensp a337a43bfd 🩹 Fix type mismatch when SEGMENT_LEVELED_MOVES disabled (#26819) 2024-04-06 21:47:40 -07:00
Keith Bennett 77f93e0b8c 🩹 Fix Mini 12864 on BTT Kraken (#26918)
Co-authored-by: ellensp <530024+ellensp@users.noreply.github.com>
2024-04-06 21:22:25 -07:00
Keith Bennett 7dc7195696 🩹 Fix active extruder indicator (#26834)
* 🩹 No active extruder when any of several incompatible features are enabled
2024-04-06 21:17:00 -07:00
ellensp 56773bd80e 🩹 add onSetMinExtrusionTemp to anycubic_viper (#26933) 2024-04-06 21:11:32 -07:00
thinkyhead 1dec9831d3 [cron] Bump distribution date (2024-04-06) 2024-04-06 06:06:36 +00:00
Jason Smith 390f1f7c69 🐛 Don't apply settings during validation (#26935)
Check the `validating` variable before applying settings for several features.
This specifically avoids settings corruption for BACKLASH_PREVENTION, which has side-effects when first applied using incorrect values.
2024-04-05 17:27:30 -07:00
Jason Smith d30fcb8fff 🐛 Fix bool evalution of XYval and similar types (#26936)
Require explicit cast to get T* pointers from XYval and similar types. This prevents the pointer from being implicitly returned and checked for nullptr when trying to evaluate these structs in boolean expressions.
2024-04-05 17:24:58 -07:00
thinkyhead 17dfe8edc9 [cron] Bump distribution date (2024-04-03) 2024-04-03 00:20:46 +00:00
Scott Lahteine 7b6b6e1c3e 🩹 Revert motion change 2024-04-01 22:20:28 -05:00
Sophist 60f2837a98 🔧 Minor INPUT_SHAPING config fixes (#26882)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-04-01 21:30:04 -05:00
thinkyhead ef5fb390ec [cron] Bump distribution date (2024-04-02) 2024-04-02 00:20:47 +00:00
Andrew 87e94f4563 🚸 Update ProUI Plot graph - part 2 (#26563)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-04-01 15:05:11 -05:00
thinkyhead 017a9032f1 [cron] Bump distribution date (2024-04-01) 2024-04-01 00:23:48 +00:00
Scott Lahteine 466282f322 🩹 Misc. changes from ProUI / ExtUI updates (#26928) 2024-03-31 18:20:37 -05:00
thinkyhead 17594298e1 [cron] Bump distribution date (2024-03-28) 2024-03-28 00:20:53 +00:00
Jordan Stocker 0b9f487ab9 🔨 Fix binary upload firmware path (#26909) 2024-03-27 14:44:03 -05:00
Chris d3e1a92b84 🔨 Fix HC32 preflight (#26912) 2024-03-27 14:39:54 -05:00
Holger Mößinger cd357b0278 🔧🚸 Tweaks for (MiniRambo) CNC (#26892)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-03-27 14:38:08 -05:00
thinkyhead d0d229e380 [cron] Bump distribution date (2024-03-25) 2024-03-25 00:21:58 +00:00
Ikko Eltociear Ashimine eb897e65a1 📝 Fix Cutter.md typo (#26901) 2024-03-24 13:49:25 -05:00
thinkyhead 825ebfd5fe [cron] Bump distribution date (2024-03-24) 2024-03-24 00:23:21 +00:00
John Robertson 3ee3964bec 🐛 Fix ESP32 laser M4 exception (#26884) 2024-03-22 19:57:23 -05:00
Sophist aecfb257e9 🚸 Hide auto-run as needed (#26853) 2024-03-22 19:29:06 -05:00
thinkyhead 896a6a93af [cron] Bump distribution date (2024-03-23) 2024-03-23 00:20:15 +00:00
Holger Mößinger 075f96d2bf ✏️ Fix stepper MS pin typos (#26891) 2024-03-22 16:36:42 -05:00
thinkyhead 05896551f1 [cron] Bump distribution date (2024-03-18) 2024-03-18 00:21:39 +00:00
Manuel McLure ea6a891038 MAX7219_REINIT_ON_POWERUP (#26163) 2024-03-17 14:23:12 -05:00
Giuliano Zaro 983aee5718 🌐 Update Italian language (#26837) 2024-03-16 19:46:22 -05:00
thinkyhead c913020dc2 [cron] Bump distribution date (2024-03-17) 2024-03-17 00:22:34 +00:00
Scott Lahteine a50490b11f 👷 Minor signature.py adjustments 2024-03-16 16:39:47 -05:00
Sophist 4b01c901bc 📝 Fix M201 typos (#26854) 2024-03-16 15:00:16 -05:00
Keith Bennett c1be36bc66 🎨 Add MKS TinyBee silkscreen labels (#26777) 2024-03-16 14:58:53 -05:00
Keith Bennett e0222d3e01 🩹 Fix G35 "Probing Failed" output (#26780) 2024-03-16 14:56:33 -05:00
janenen c0264ae787 🐛 Fix DETECT_BROKEN_ENDSTOP on IDEX (#26790)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-03-16 14:52:14 -05:00
Sophist 3a2c50c199 🩹 Thermistor name fixes (#26857) 2024-03-16 14:09:50 -05:00
Scott Lahteine 3b4adac579 🎨 Trailing ws 2024-03-16 13:55:35 -05:00
ellensp d36b3fbf9d 🧑‍💻 Fix RLE script for infille == outfile (#26795) 2024-03-16 13:37:42 -05:00
Keith Bennett bca40e07e3 📝 Remove Flattr Link (#26796) 2024-03-16 13:34:02 -05:00
thinkyhead 9a1c993719 [cron] Bump distribution date (2024-03-10) 2024-03-10 06:05:40 +00:00
InsanityAutomation 504219817c Redundant PSU Control with EDM (#26751) 2024-03-09 21:22:23 -06:00
thinkyhead 4f2b7271bd [cron] Bump distribution date (2024-03-04) 2024-03-04 00:21:13 +00:00
fredycpu ec6f9dd5c8 🔧 MKS_ROBIN_PRO : I2C EEPROM + MKS Wifi (#26823)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-03-03 12:39:50 -06:00
thinkyhead e6cda9932b [cron] Bump distribution date (2024-03-02) 2024-03-02 06:06:49 +00:00
Keith Bennett b9cfbaa8d4 Update Actions versions (#26814) 2024-03-01 22:34:12 -06:00
ellensp 3fd175af8e 🚸 M115 "KINEMATICS:…" (#26806) 2024-03-01 22:31:42 -06:00
Keith Bennett a9e72b2a2c 🔧 Simpler CREALITY_V422 warning (#26826) 2024-03-01 22:09:12 -06:00
ellensp ecde3a3158 🩹 Fix AVR bootscreen RLE decode (#26827) 2024-03-01 21:58:56 -06:00
DerAndere c8d51c2723 🚸 Enable G92.9 with rotational axes (#26174)
- Supporting axes that can rotate forever.
2024-03-01 21:16:39 -06:00
thinkyhead d609bb4671 [cron] Bump distribution date (2024-02-28) 2024-02-28 06:06:10 +00:00
Scott Lahteine 982b425792 🔥 Drop TMC26X support (#26770) 2024-02-27 20:45:34 -06:00
thinkyhead 9e879a5b1f [cron] Bump distribution date (2024-02-11) 2024-02-11 00:22:45 +00:00
ellensp 9974327d33 extend uart checks 2024-02-11 03:28:37 +13:00
thinkyhead 4eba643ae1 [cron] Bump distribution date (2024-02-10) 2024-02-10 06:17:34 +00:00
Scott Lahteine 8d7be79108 👷 Improve BIGTREE_GTR_V1_0 tests 2024-02-09 19:14:15 -06:00
Scott Lahteine 76b5688304 🚸 Optional encoder multipliers 2024-02-09 19:14:15 -06:00
thinkyhead 1e8fbb7bbb [cron] Bump distribution date (2024-02-09) 2024-02-09 00:20:11 +00:00
Scott Lahteine 20c6a6233b 🧑‍💻 HC32 endstop interrupts for X2/Y2/Z4 2024-02-08 16:49:13 -06:00
Scott Lahteine 1d295f7983 🔥 Clean up SCARA/TPARA 2024-02-07 23:45:51 -06:00
Scott Lahteine 669814d0d4 MARLIN_SMALL_BUILD option (#26775) 2024-02-07 23:40:54 -06:00
Scott Lahteine 4aa48beb37 🚸 Adjust encoder multiplier 2024-02-07 19:48:36 -06:00
thinkyhead 371fb5a256 [cron] Bump distribution date (2024-02-08) 2024-02-08 00:20:32 +00:00
Scott Lahteine 0829a511f0 🧑‍💻 "static_warning" 2024-02-07 18:09:36 -06:00
Scott Lahteine a3c78c4510 🎨 Delete old FTDI Eve bootscreen 2024-02-07 14:01:25 -06:00
Scott Lahteine a3211253a0 🩹 Fix FTDI Eve Touch UI M84 2024-02-07 13:58:49 -06:00
thinkyhead 2c8e7bd5a5 [cron] Bump distribution date (2024-02-07) 2024-02-07 12:07:15 +00:00
ellensp 005d6879d9 🔧 Restore probe XY edit defaults, remove arbitrary Z limit (#26774) 2024-02-07 00:33:54 -06:00
thinkyhead 3dd22349a9 [cron] Bump distribution date (2024-02-06) 2024-02-06 06:06:16 +00:00
Scott Mikutsky e61a84a717 🚸 Keep Filament Change near the top (#26172) 2024-02-05 23:37:29 -06:00
thinkyhead d8e73d3036 [cron] Bump distribution date (2024-02-05) 2024-02-05 00:21:40 +00:00
Robherc b12340b1d5 🔧 Fix extraneous DIAG warnings (#26694) 2024-02-04 16:10:11 -06:00
Scott Lahteine ec46a59539 🧑‍💻 Fix uncrustify config 2024-02-04 16:07:27 -06:00
Keith Bennett 5003681414 🩹 Fix HOTEND_IDLE_TIMEOUT with no heated bed (#26746) 2024-02-04 12:14:49 -06:00
Keith Bennett d9396929aa 🩹 Update BTT GTR v1.0 DIAG jumper/pin (#26764) 2024-02-04 12:13:03 -06:00
Scott Lahteine 1dee4d92c6 🔧 TOUCH_IDLE_SLEEP_MINS => DISPLAY_SLEEP_MINUTES
Follow up to #26517
2024-02-04 12:09:48 -06:00
Smokey Pell 9364cbb4b5 🚸 Tronxy V10 w/ TFT_TRONXY_X5SA + MKS_ROBIN_TFT43 (#26747) 2024-02-04 09:37:32 -06:00
Taylor Talkington 755b661c2d 🔧 Fix USE_Z_MIN conditions (#26762) 2024-02-04 09:03:08 -06:00
thinkyhead 7f4792e47c [cron] Bump distribution date (2024-02-04) 2024-02-04 00:22:42 +00:00
Keith Bennett e6837b2b8d 🩹 Fix STM32 HW Serial 6 (#26763)
Followup to #26328
2024-02-03 17:19:19 -06:00
thinkyhead 9e21330d7a [cron] Bump distribution date (2024-02-03) 2024-02-03 00:20:49 +00:00
Davide Rombolà c476e62a6f 🩹 Fix STM32 HW Serial (#26531)
Followup to #26328
2024-02-01 19:31:39 -06:00
thinkyhead 4c5d7831c1 [cron] Bump distribution date (2024-02-02) 2024-02-02 00:20:22 +00:00
Abdullah YILMAZ 9a5cfb3f26 🌐 Turkish language update (#26739) 2024-01-31 20:11:08 -06:00
InsanityAutomation 5a87bea762 🚸 Fix repeating "Power Off" message (#26755) 2024-01-31 19:24:08 -06:00
thinkyhead d62f45bdc1 [cron] Bump distribution date (2024-02-01) 2024-02-01 00:21:39 +00:00
ellensp f9d5ee04b4 🩹 Patch STM32 serial UUID (#26737)
Followup to #26715

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-01-31 12:33:42 -06:00
InsanityAutomation 0e1b62e094 Reduce ram and SPI speed 2022-10-23 12:35:46 -04:00
InsanityAutomation 64ffa0d4f4 Merge branch 'bugfix-2.1.x' into Trex_2.0.x_Devel 2022-10-21 15:29:10 -04:00
InsanityAutomation e6680ddfdf Update menu_advanced.cpp 2022-10-11 11:37:22 -04:00
InsanityAutomation 5c0696b51a updates 2022-10-11 11:36:31 -04:00
InsanityAutomation d438436f0c Merge branch 'bugfix-2.1.x' into Trex_2.0.x_Devel 2022-10-10 16:36:53 -04:00
InsanityAutomation 2f322e8084 Update Configuration.h 2022-04-09 11:22:20 -04:00
InsanityAutomation a3a4da5ff2 Merge branch 'Implement-M591-Configurable-Runout-Sensors' into Trex_2.0.x_Devel 2022-04-05 10:41:19 -04:00
InsanityAutomation bba892e327 Trim output on slim menus 2022-04-03 17:03:52 -04:00
InsanityAutomation 25172b3acf M591Fixes 2022-04-03 14:54:16 -04:00
InsanityAutomation 0b6ecbd553 Merge branch 'bugfix-2.0.x' into Implement-M591-Configurable-Runout-Sensors 2022-04-03 10:33:18 -04:00
InsanityAutomation de6246f826 Merge branch 'Implement-M591-Configurable-Runout-Sensors' of https://github.com/InsanityAutomation/Marlin into Implement-M591-Configurable-Runout-Sensors 2022-04-03 10:32:57 -04:00
Scott Lahteine e813742ae0 Merge branch 'bugfix-2.0.x' into pr/23899 2022-03-29 03:25:51 -05:00
Scott Lahteine 46c8204990 Extend enum 2022-03-27 19:46:47 -05:00
Scott Lahteine bdfe4ca4d1 Simplify menu items, use enum, adjust settings 2022-03-26 21:10:16 -05:00
Scott Lahteine 6741f5182d Simplify menu items, use enum 2022-03-26 18:54:02 -05:00
InsanityAutomation 489b75ae3c Update menu_advanced.cpp 2022-03-15 12:47:14 -04:00
InsanityAutomation 378fc12628 Add runout menu, small fixes 2022-03-15 12:28:19 -04:00
InsanityAutomation 0cedad36d1 Reorganize config options, remove obsolete option. 2022-03-14 09:29:53 -04:00
Scott Lahteine 07b2480d30 glue for CI test 2022-03-14 00:37:41 -05:00
Scott Lahteine dd88eb56ee Allow user to change 2022-03-14 00:37:41 -05:00
Scott Lahteine fc77afd93e misc. cleanup 2022-03-14 00:37:41 -05:00
InsanityAutomation 26af3e70bc Remove obsolete state from tests 2022-03-13 19:51:12 -04:00
InsanityAutomation 0c15e8e751 Fix up pause trigger, adjust config options minor changes 2022-03-13 18:57:24 -04:00
InsanityAutomation 639a2dc0b3 M591 Cleanup and tweaks 2022-03-13 13:48:33 -04:00
InsanityAutomation 91a094d8cb Update Configuration.h 2022-03-12 15:55:57 -05:00
InsanityAutomation 66efa0b09b Initial commit - Flexible Runout Configuration M591 2022-03-12 15:54:07 -05:00
InsanityAutomation 3226adf2a6 Update Configuration.h 2022-03-08 17:54:24 -05:00
InsanityAutomation 29822ee60e Update Configuration_adv.h 2022-03-08 17:54:22 -05:00
InsanityAutomation 442d28485e Merge branch 'bugfix-2.0.x' into Trex_2.0.x_Devel 2022-03-08 17:32:43 -05:00
InsanityAutomation 29f85afe50 Update settings.cpp 2021-10-14 18:48:59 -04:00
InsanityAutomation c653a0f423 Merge branch 'BLTouch-HS-Mode-EEPROM' into Trex_2.0.x_Devel 2021-10-14 18:33:57 -04:00
InsanityAutomation 1fab2ef94f Update menu_tramming.cpp 2021-10-14 14:01:42 -04:00
InsanityAutomation 102c43dcd5 Update G35.cpp 2021-10-14 13:50:56 -04:00
InsanityAutomation 5284f45c62 Update menu_tramming.cpp 2021-10-14 13:41:31 -04:00
InsanityAutomation 9aaa7b1100 Add missing include 2021-10-14 13:34:31 -04:00
Scott Lahteine a6c4c5a3f7 Update motion.cpp 2021-10-12 22:22:15 -05:00
Scott Lahteine 78c57f2847 Update menu_tramming.cpp 2021-10-12 22:21:43 -05:00
Scott Lahteine 90b0be5e12 Merge 'upstream/bugfix-2.0.x' into pr/22916 2021-10-12 21:45:54 -05:00
Scott Lahteine c24456353f Merge 'upstream/bugfix-2.0.x' into pr/22916 2021-10-12 20:20:28 -05:00
InsanityAutomation 9a9a112673 Simplify macro 2021-10-11 22:07:45 -04:00
Scott Lahteine 0977129353 Update planner.cpp 2021-10-11 19:31:52 -04:00
InsanityAutomation ffa8e0ce60 potentially fix multi nozzle duplication as well 2021-10-11 19:31:42 -04:00
InsanityAutomation cbaf1af0fe Followup to IDEX fix 2021-10-10 19:51:56 -04:00
Scott Lahteine ec7a4eb69e clean up and fix 2021-10-09 18:57:38 -05:00
InsanityAutomation 4f62ae9764 Return on mode change without deploying 2021-10-09 14:07:11 -04:00
InsanityAutomation b8dfc53693 Return on mode change without deploying 2021-10-09 14:07:02 -04:00
InsanityAutomation a30ae0aeca BLTouch High Speed EEPROM Control 2021-10-09 13:58:45 -04:00
InsanityAutomation 0cc6955ab7 BLTouch High Speed EEPROM Control 2021-10-09 13:58:25 -04:00
InsanityAutomation 32e8f90271 Fix Delay definitions 2021-10-09 11:58:54 -04:00
InsanityAutomation 8b10b829fd Fix IDEX Mode Positioning 2021-10-09 11:58:45 -04:00
InsanityAutomation eab8ad6b16 Merge branch 'bugfix-2.0.x' into Trex_2.0.x_Devel 2021-10-09 10:58:30 -04:00
InsanityAutomation 35180fedd8 Merge branch 'bugfix-2.0.x' into Trex_2.0.x_Devel 2021-08-28 14:06:37 -04:00
InsanityAutomation 4ddd6d27c1 trim ram 2021-08-08 14:29:24 -04:00
InsanityAutomation 5b6317dd5b Update Configuration_adv.h 2021-08-06 20:11:23 -04:00
InsanityAutomation 125e537dd1 Update Configuration.h 2021-08-06 13:10:05 -04:00
InsanityAutomation 1055cd4efa Merge branch 'bugfix-2.0.x' into Trex_2.0.x_Devel 2021-08-05 22:19:49 -04:00
InsanityAutomation 9b6037515f Update Configuration.h 2021-07-31 14:47:58 -04:00
InsanityAutomation 6bdc99be5f Merge branch 'bugfix-2.0.x' into Trex_2.0.x_Devel 2021-07-31 14:38:43 -04:00
InsanityAutomation d6abfd2523 Fix move directly after G28X 2021-01-01 18:50:47 -05:00
InsanityAutomation 4f0615be7b Merge branch 'bugfix-2.0.x' into Trex_2.0.x_Devel 2021-01-01 18:50:31 -05:00
InsanityAutomation dd345679d3 Add display timings for new supplier 2020-11-21 15:16:47 -05:00
InsanityAutomation b59301894a Merge branch 'bugfix-2.0.x' into Trex_2.0.x_Devel 2020-11-21 15:09:26 -05:00
InsanityAutomation 3165043527 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2020-11-21 14:33:24 -05:00
Luu Lac cd3bf4c766 Fix "autotune" LCD message (#20127) 2020-11-13 18:48:59 -06:00
Scott Lahteine 30162df320 Optimize M360 2020-11-13 18:47:34 -06:00
InsanityAutomation 2d160b8461 force set directions on all blocks in stepper isr 2020-10-22 09:20:37 -04:00
InsanityAutomation aa5a7f5c13 Add SKR12Pro Support 2020-10-22 09:19:44 -04:00
InsanityAutomation e4e9915d84 Update Configuration_adv.h 2020-10-22 09:18:30 -04:00
InsanityAutomation 8fe3650376 Bump to head, fix compile errors 2020-10-22 09:18:30 -04:00
InsanityAutomation 23d024309e Update runout.cpp 2020-10-22 09:18:30 -04:00
InsanityAutomation 62465cdf23 Disable mesh validation pattern for UBL builds to fit 2020-10-22 09:18:00 -04:00
InsanityAutomation 9eb4fc1cfd Update Configuration_adv.h 2020-10-22 09:18:00 -04:00
InsanityAutomation 40de56b58b Bump to head, fix compile errors 2020-10-22 09:18:00 -04:00
InsanityAutomation 4a56689801 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2020-10-22 09:13:59 -04:00
Scott Lahteine 0216e032be Host prompt followup 2020-10-19 04:34:14 -05:00
Scott Lahteine 2d8aa0cea1 Tweak a host prompt call 2020-10-19 04:25:48 -05:00
324 changed files with 10415 additions and 9784 deletions
-40
View File
@@ -1,40 +0,0 @@
#
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
#
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 60
# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: [ 'no-locking' ]
# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false
# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: true
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated
# pulls:
# daysUntilLock: 30
# Repository to extend settings from
# _extends: repo
+2 -2
View File
@@ -19,7 +19,7 @@ jobs:
steps: steps:
- name: Check out bugfix-2.0.x - name: Check out bugfix-2.0.x
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: bugfix-2.0.x ref: bugfix-2.0.x
@@ -39,7 +39,7 @@ jobs:
exit 0 exit 0
- name: Check out bugfix-2.1.x - name: Check out bugfix-2.1.x
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: bugfix-2.1.x ref: bugfix-2.1.x
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
- "Needs: Work" - "Needs: Work"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Remove Labels - name: Remove Labels
uses: actions-ecosystem/action-remove-labels@v1 uses: actions-ecosystem/action-remove-labels@v1
with: with:
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@v8 - uses: actions/stale@v9
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: | stale-issue-message: |
+6 -6
View File
@@ -17,15 +17,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: dessant/lock-threads@v2 - uses: dessant/lock-threads@v5
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
process-only: 'issues' process-only: 'issues'
issue-lock-inactive-days: '60' issue-inactive-days: '60'
issue-exclude-created-before: '' exclude-issue-created-before: ''
issue-exclude-labels: 'no-locking' exclude-any-issue-labels: 'no-locking'
issue-lock-labels: '' add-issue-labels: ''
issue-lock-comment: > issue-comment: >
This issue has been automatically locked since there This issue has been automatically locked since there
has not been any recent activity after it was closed. has not been any recent activity after it was closed.
Please open a new issue for related bugs. Please open a new issue for related bugs.
+3 -3
View File
@@ -152,7 +152,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Cache pip - name: Cache pip
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@@ -160,13 +160,13 @@ jobs:
${{ runner.os }}-pip- ${{ runner.os }}-pip-
- name: Cache PlatformIO - name: Cache PlatformIO
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ~/.platformio path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Select Python 3.9 - name: Select Python 3.9
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: '3.9' python-version: '3.9'
architecture: 'x64' architecture: 'x64'
+396 -131
View File
@@ -1,3 +1,50 @@
// If you have a trex 3, stock is this option plus 2208 on all axis. None in spreadcycle.
#define TREX3
// If you have a trex 3 that was upgraded from a 2+ with the kit, modifies home position and offsets.
//#define TREX3_UPGRADE
//Stock 2+ X is a 4988, all options off defaults to this
//#define X_2208
//#define X_Spreadcycle
//#define X_S109
// Y all options off defaults to 2+ 8825 / 3 2208
//#define Y_2208 // Highly recommended as large prints with high mass can cause layer shifts with stealthchop at high speed
//#define Y_Spreadcycle
//#define Y_4988 // Some machines shipped with 4988 drivers across the board. Set this if you arent sure what you have and all the drivers look identical
//#define Y_S109
//Stock 2+ Z is a 8825, all options off defaults to this
//#define Z_2208 // NOT Recommended! Dual stepper current draw is above the recommended limit for this driver
//#define Z_4988 // Some machines shipped with 4988 drivers across the board. Set this if you arent sure what you have and all the drivers look identical
//#define Z_Spreadcycle
//#define Z_S109
//Stock 2+ Z is a 4988, all options off defaults to this
//#define E_2208 // Not Recommended! Stealthchop mode faults with linear advance
//#define E_Spreadcycle
//#define E_S109
#define BedAC
#define tallVersion
#define ABL_Bilinear
/*
* Enables a filament sensor plugged into the laser pin. Disables the laser
*/
//#define FilamentSensor // Standard older TM3D runout sensor
//#define lerdgeFilSensor // Newer inverted logic TM3D Runout Sensor
//#define filamentEncoder
//#define autoCalibrationKit
//#define SKR12Pro
//////////////////////////////////DO not edit below here unless you know what youre doing! //////////////////////////////////
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
@@ -21,6 +68,22 @@
*/ */
#pragma once #pragma once
// The TREX2+ upgraded to the 3 enables most of the same options, simplify here
#if ENABLED(TREX3_UPGRADE)
#define TREX3
#endif
#if ENABLED(TREX3)
#if DISABLED(X_S109)
#define X_2208
#endif
#if DISABLED(Y_S109)
#define Y_2208
#endif
#define Z_2208
#define E_2208
#endif
/** /**
* Configuration.h * Configuration.h
* *
@@ -61,14 +124,20 @@
// @section info // @section info
// Author info of this build printed to the host during boot and M115 // Author info of this build printed to the host during boot and M115
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define STRING_CONFIG_H_AUTHOR "Tinymachines3D" // Who made the changes.
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) #define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
// @section machine // @section machine
// Choose the name from boards.h that matches your setup // Choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD #ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_RAMPS_14_EFB #if ENABLED(SKR12Pro)
#define MOTHERBOARD BOARD_BTT_SKR_PRO_V1_2
#elif ENABLED(TREX3)
#define MOTHERBOARD BOARD_FORMBOT_TREX3
#else
#define MOTHERBOARD BOARD_FORMBOT_TREX2PLUS
#endif
#endif #endif
/** /**
@@ -79,7 +148,11 @@
* *
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7] * :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
*/ */
#define SERIAL_PORT 0 #if ENABLED(SKR12Pro)
#define SERIAL_PORT -1
#else
#define SERIAL_PORT 0
#endif
/** /**
* Serial Port Baud Rate * Serial Port Baud Rate
@@ -101,7 +174,9 @@
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards. * Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7] * :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
*/ */
//#define SERIAL_PORT_2 -1 #if ENABLED(SKR12Pro)
#define SERIAL_PORT_2 1
#endif
//#define BAUDRATE_2 250000 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE //#define BAUDRATE_2 250000 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE
/** /**
@@ -115,8 +190,15 @@
// Enable the Bluetooth serial interface on AT90USB devices // Enable the Bluetooth serial interface on AT90USB devices
//#define BLUETOOTH //#define BLUETOOTH
// Name displayed in the LCD "Ready" message and Info menu // Optional custom name for your RepStrap or other custom machine
//#define CUSTOM_MACHINE_NAME "3D Printer" // Displayed in the LCD "Ready" message
#if ENABLED(TREX3_UPGRADE)
#define CUSTOM_MACHINE_TIME "T-REX 3(u)"
#elif ENABLED(TREX3)
#define CUSTOM_MACHINE_NAME "T-REX 3"
#else
#define CUSTOM_MACHINE_NAME "T-REX 2+"
#endif
// Printer's unique ID, used by some programs to differentiate between machines. // Printer's unique ID, used by some programs to differentiate between machines.
// Choose your own or use a service like https://www.uuidgenerator.net/version4 // Choose your own or use a service like https://www.uuidgenerator.net/version4
@@ -135,13 +217,69 @@
* Options: A4988, A5984, DRV8825, LV8729, TB6560, TB6600, TMC2100, * Options: A4988, A5984, DRV8825, LV8729, TB6560, TB6600, TMC2100,
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
* TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC2660, TMC2660_STANDALONE, TMC5130, TMC5130_STANDALONE,
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/ */
#define X_DRIVER_TYPE A4988
#define Y_DRIVER_TYPE A4988 #if ENABLED(SKR12Pro)
#define Z_DRIVER_TYPE A4988 #if ENABLED(TMC2209Upgrade)
#define X_DRIVER_TYPE TMC2209
#define X2_DRIVER_TYPE TMC2209
#define Y_DRIVER_TYPE TMC2209
#define Z_DRIVER_TYPE TMC2209
#define E0_DRIVER_TYPE TMC2209
#define E1_DRIVER_TYPE TMC2209
#else
#define X_DRIVER_TYPE TMC2208
#define X2_DRIVER_TYPE TMC2208
#define Y_DRIVER_TYPE TMC2208
#define Z_DRIVER_TYPE TMC2208
#define E0_DRIVER_TYPE TMC2208
#define E1_DRIVER_TYPE TMC2208
#endif
#else
#if ENABLED(X_2208)
#define X_DRIVER_TYPE TMC2208_STANDALONE
#define X2_DRIVER_TYPE TMC2208_STANDALONE
#else
#define X_DRIVER_TYPE A4988
#define X2_DRIVER_TYPE A4988
#endif
#if ENABLED(Y_2208)
#define Y_DRIVER_TYPE TMC2208_STANDALONE
#elif ENABLED(Y_4988)
#define Y_DRIVER_TYPE A4988
#else
#define Y_DRIVER_TYPE DRV8825
#endif
#if ENABLED(Z_2208)
#define Z_DRIVER_TYPE TMC2208_STANDALONE
#elif ENABLED(Z_4988)
#define Z_DRIVER_TYPE A4988
#else
#define Z_DRIVER_TYPE DRV8825
#endif
#if ENABLED(E_2208)
#define E0_DRIVER_TYPE TMC2208_STANDALONE
#define E1_DRIVER_TYPE TMC2208_STANDALONE
#else
#define E0_DRIVER_TYPE DRV8825
#define E1_DRIVER_TYPE DRV8825
#endif
#endif
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
//#define E4_DRIVER_TYPE A4988
//#define E5_DRIVER_TYPE A4988
//#define E6_DRIVER_TYPE A4988
//#define E7_DRIVER_TYPE A4988
//#define X_DRIVER_TYPE A4988
//#define Y_DRIVER_TYPE A4988
//#define Z_DRIVER_TYPE A4988
//#define X2_DRIVER_TYPE A4988 //#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988 //#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988 //#define Z2_DRIVER_TYPE A4988
@@ -153,7 +291,7 @@
//#define U_DRIVER_TYPE A4988 //#define U_DRIVER_TYPE A4988
//#define V_DRIVER_TYPE A4988 //#define V_DRIVER_TYPE A4988
//#define W_DRIVER_TYPE A4988 //#define W_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE A4988 //#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988 //#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988 //#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988
@@ -208,7 +346,7 @@
// This defines the number of extruders // This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8] // :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1 #define EXTRUDERS 2
// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. // Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc.
#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 #define DEFAULT_NOMINAL_FILAMENT_DIA 1.75
@@ -362,7 +500,12 @@
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
// For the other hotends it is their distance from the extruder 0 hotend. // For the other hotends it is their distance from the extruder 0 hotend.
//#define HOTEND_OFFSET_X { 0.0, 20.00 } // (mm) relative X-offset for each nozzle #if ENABLED(TREX3)
#define HOTEND_OFFSET_X {0.0, 438.5} // (mm) relative X-offset for each nozzle
#else
#define HOTEND_OFFSET_X {0.0, 442.0} // (mm) relative X-offset for each nozzle
#endif
//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle //#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle
//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle //#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle
@@ -401,9 +544,18 @@
//#define PS_OFF_SOUND // Beep 1s when power off //#define PS_OFF_SOUND // Beep 1s when power off
#define PSU_ACTIVE_STATE LOW // Set 'LOW' for ATX, 'HIGH' for X-Box #define PSU_ACTIVE_STATE LOW // Set 'LOW' for ATX, 'HIGH' for X-Box
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
//#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power //#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power
//#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay //#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay
//#define PSU_OFF_REDUNDANT // Second pin for redundant power control
//#define PSU_OFF_REDUNDANT_INVERTED // Redundant pin state is the inverse of PSU_ACTIVE_STATE
//#define PS_ON1_PIN 6 // Redundant pin required to enable power in combination with PS_ON_PIN
//#define PS_ON_EDM_PIN 8 // External Device Monitoring pins for external power control relay feedback. Fault on mismatch.
//#define PS_ON1_EDM_PIN 9
#define PS_EDM_RESPONSE 250 // (ms) Time to allow for relay action
//#define POWER_OFF_TIMER // Enable M81 D<seconds> to power off after a delay //#define POWER_OFF_TIMER // Enable M81 D<seconds> to power off after a delay
//#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S to power off only after cooldown //#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S to power off only after cooldown
@@ -544,15 +696,24 @@
* 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below.
* 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below.
*/ */
#define TEMP_SENSOR_0 1 #if ENABLED(TREX3)
#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_0 1047
#define TEMP_SENSOR_1 61
#else
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 1
#endif
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0 #define TEMP_SENSOR_3 0
#define TEMP_SENSOR_4 0 #define TEMP_SENSOR_4 0
#define TEMP_SENSOR_5 0 #define TEMP_SENSOR_5 0
#define TEMP_SENSOR_6 0 #define TEMP_SENSOR_6 0
#define TEMP_SENSOR_7 0 #define TEMP_SENSOR_7 0
#define TEMP_SENSOR_BED 1 #if(ENABLED(BedAC))
#define TEMP_SENSOR_BED 11
#else
#define TEMP_SENSOR_BED 0
#endif
#define TEMP_SENSOR_PROBE 0 #define TEMP_SENSOR_PROBE 0
#define TEMP_SENSOR_CHAMBER 0 #define TEMP_SENSOR_CHAMBER 0
#define TEMP_SENSOR_COOLER 0 #define TEMP_SENSOR_COOLER 0
@@ -579,14 +740,14 @@
#endif #endif
#if HAS_E_TEMP_SENSOR #if HAS_E_TEMP_SENSOR
#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109 #define TEMP_RESIDENCY_TIME 2 // (seconds) Time to wait for hotend to "settle" in M109
#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer #define TEMP_WINDOW 5 // (°C) Temperature proximity for the "temperature reached" timer
#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target #define TEMP_HYSTERESIS 5 // (°C) Temperature proximity considered "close enough" to the target
#endif #endif
#if TEMP_SENSOR_BED #if TEMP_SENSOR_BED
#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190 #define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190
#define TEMP_BED_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer #define TEMP_BED_WINDOW 2 // (°C) Temperature proximity for the "temperature reached" timer
#define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target #define TEMP_BED_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
#endif #endif
@@ -628,8 +789,13 @@
// Above this temperature the heater will be switched off. // Above this temperature the heater will be switched off.
// This can protect components from overheating, but NOT from shorts and failures. // This can protect components from overheating, but NOT from shorts and failures.
// (Use MINTEMP for thermistor short/failure protection.) // (Use MINTEMP for thermistor short/failure protection.)
#define HEATER_0_MAXTEMP 275 #if ENABLED(TREX3)
#define HEATER_1_MAXTEMP 275 #define HEATER_0_MAXTEMP 350
#define HEATER_1_MAXTEMP 350
#else
#define HEATER_0_MAXTEMP 410
#define HEATER_1_MAXTEMP 295
#endif
#define HEATER_2_MAXTEMP 275 #define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275 #define HEATER_3_MAXTEMP 275
#define HEATER_4_MAXTEMP 275 #define HEATER_4_MAXTEMP 275
@@ -670,19 +836,25 @@
#if ENABLED(PIDTEMP) #if ENABLED(PIDTEMP)
//#define PID_DEBUG // Print PID debug data to the serial port. Use 'M303 D' to toggle activation. //#define PID_DEBUG // Print PID debug data to the serial port. Use 'M303 D' to toggle activation.
//#define PID_PARAMS_PER_HOTEND // Use separate PID parameters for each extruder (useful for mismatched extruders) #define PID_PARAMS_PER_HOTEND // Use separate PID parameters for each extruder (useful for mismatched extruders)
// Set/get with G-code: M301 E[extruder number, 0-2] // Set/get with G-code: M301 E[extruder number, 0-2]
#if ENABLED(PID_PARAMS_PER_HOTEND) #if ENABLED(PID_PARAMS_PER_HOTEND)
// Specify up to one value per hotend here, according to your setup. // Specify up to one value per hotend here, according to your setup.
// If there are fewer values, the last one applies to the remaining hotends. // If there are fewer values, the last one applies to the remaining hotends.
#define DEFAULT_Kp_LIST { 22.20, 22.20 } #if ENABLED(TREX3)
#define DEFAULT_Ki_LIST { 1.08, 1.08 } #define DEFAULT_Kp_LIST { 14.64, 14.64 }
#define DEFAULT_Kd_LIST { 114.00, 114.00 } #define DEFAULT_Ki_LIST { 1.08, 1.08 }
#define DEFAULT_Kd_LIST { 53.36, 53.36 }
#else
#define DEFAULT_Kp_LIST { 22.20, 22.20 }
#define DEFAULT_Ki_LIST { 1.08, 1.08 }
#define DEFAULT_Kd_LIST { 114.00, 114.00 }
#endif
#else #else
#define DEFAULT_Kp 22.20 #define DEFAULT_Kp 22.2
#define DEFAULT_Ki 1.08 #define DEFAULT_Ki 1.08
#define DEFAULT_Kd 114.00 #define DEFAULT_Kd 114
#endif #endif
#else #else
#define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current #define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current
@@ -762,7 +934,7 @@
* *
* With this option disabled, bang-bang will be used. BED_LIMIT_SWITCHING enables hysteresis. * With this option disabled, bang-bang will be used. BED_LIMIT_SWITCHING enables hysteresis.
*/ */
//#define PIDTEMPBED #define PIDTEMPBED
#if ENABLED(PIDTEMPBED) #if ENABLED(PIDTEMPBED)
//#define MIN_BED_POWER 0 //#define MIN_BED_POWER 0
@@ -833,8 +1005,8 @@
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash) #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash)
//#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash) #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash)
#endif #endif
// @section safety // @section safety
@@ -1006,9 +1178,6 @@
// Radius around the center where the arm cannot reach // Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm) #define MIDDLE_DEAD_ZONE_R 0 // (mm)
#define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
#define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
#elif ENABLED(MP_SCARA) #elif ENABLED(MP_SCARA)
#define SCARA_OFFSET_THETA1 12 // degrees #define SCARA_OFFSET_THETA1 12 // degrees
@@ -1027,23 +1196,19 @@
#define DEFAULT_SEGMENTS_PER_SECOND 200 #define DEFAULT_SEGMENTS_PER_SECOND 200
// Length of inner and outer support arms. Measure arm lengths precisely. // Length of inner and outer support arms. Measure arm lengths precisely.
#define TPARA_LINKAGE_1 120 // (mm) #define TPARA_LINKAGE_1 120 // (mm)
#define TPARA_LINKAGE_2 120 // (mm) #define TPARA_LINKAGE_2 120 // (mm)
// SCARA tower offset (position of Tower relative to bed zero position) // TPARA tower offset (position of Tower relative to bed zero position)
// This needs to be reasonably accurate as it defines the printbed position in the SCARA space. // This needs to be reasonably accurate as it defines the printbed position in the TPARA space.
#define TPARA_OFFSET_X 0 // (mm) #define TPARA_OFFSET_X 0 // (mm)
#define TPARA_OFFSET_Y 0 // (mm) #define TPARA_OFFSET_Y 0 // (mm)
#define TPARA_OFFSET_Z 0 // (mm) #define TPARA_OFFSET_Z 0 // (mm)
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly #define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
// Radius around the center where the arm cannot reach // Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm) #define MIDDLE_DEAD_ZONE_R 0 // (mm)
// Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
#define THETA_HOMING_OFFSET 0
#define PSI_HOMING_OFFSET 0
#endif #endif
// @section polar // @section polar
@@ -1170,7 +1335,7 @@
*/ */
#define X_MIN_ENDSTOP_HIT_STATE HIGH #define X_MIN_ENDSTOP_HIT_STATE HIGH
#define X_MAX_ENDSTOP_HIT_STATE HIGH #define X_MAX_ENDSTOP_HIT_STATE HIGH
#define Y_MIN_ENDSTOP_HIT_STATE HIGH #define Y_MIN_ENDSTOP_HIT_STATE LOW
#define Y_MAX_ENDSTOP_HIT_STATE HIGH #define Y_MAX_ENDSTOP_HIT_STATE HIGH
#define Z_MIN_ENDSTOP_HIT_STATE HIGH #define Z_MIN_ENDSTOP_HIT_STATE HIGH
#define Z_MAX_ENDSTOP_HIT_STATE HIGH #define Z_MAX_ENDSTOP_HIT_STATE HIGH
@@ -1190,7 +1355,7 @@
// Enable this feature if all enabled endstop pins are interrupt-capable. // Enable this feature if all enabled endstop pins are interrupt-capable.
// This will remove the need to poll the interrupt pins, saving many CPU cycles. // This will remove the need to poll the interrupt pins, saving many CPU cycles.
//#define ENDSTOP_INTERRUPTS_FEATURE #define ENDSTOP_INTERRUPTS_FEATURE
/** /**
* Endstop Noise Threshold * Endstop Noise Threshold
@@ -1227,14 +1392,28 @@
* following movement settings. If fewer factors are given than the * following movement settings. If fewer factors are given than the
* total number of extruders, the last value applies to the rest. * total number of extruders, the last value applies to the rest.
*/ */
//#define DISTINCT_E_FACTORS #define DISTINCT_E_FACTORS
/** /**
* Default Axis Steps Per Unit (linear=steps/mm, rotational=steps/°) * Default Axis Steps Per Unit (linear=steps/mm, rotational=steps/°)
* Override with M92 (when enabled below) * Override with M92 (when enabled below)
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/ */
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 }
#if(ENABLED(Y_2208) || ENABLED(Y_4988) || ENABLED(Y_S109))
#define Y_STEPSMM 80
#else
#define Y_STEPSMM 160
#endif
#if(ENABLED(Z_2208) || ENABLED(Z_4988))
#define Z_STEPSMM 800
#else
#define Z_STEPSMM 1600
#endif
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, Y_STEPSMM, Z_STEPSMM, 93, 93 }
/** /**
* Enable support for M92. Disable to save at least ~530 bytes of flash. * Enable support for M92. Disable to save at least ~530 bytes of flash.
@@ -1246,11 +1425,16 @@
* Override with M203 * Override with M203
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/ */
#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } #if ENABLED(Y_2208) && DISABLED(Y_Spreadcycle)
#define Y_MAXFEED 100
#else
#define Y_MAXFEED 150
#endif
#define DEFAULT_MAX_FEEDRATE { 200, Y_MAXFEED, 8, 75, 75 }
//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 //#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
#if ENABLED(LIMITED_MAX_FR_EDITING) #if ENABLED(LIMITED_MAX_FR_EDITING)
#define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits #define MAX_FEEDRATE_EDIT_VALUES { 300, 200, 15, 150 } // ...or, set your own edit limits
#endif #endif
/** /**
@@ -1259,11 +1443,11 @@
* Override with M201 * Override with M201
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/ */
#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } #define DEFAULT_MAX_ACCELERATION { 750, 500, 400, 3000, 3000 }
//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 //#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
#if ENABLED(LIMITED_MAX_ACCEL_EDITING) #if ENABLED(LIMITED_MAX_ACCEL_EDITING)
#define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits #define MAX_ACCEL_EDIT_VALUES { 1500, 1500, 800, 5000 } // ...or, set your own edit limits
#endif #endif
/** /**
@@ -1274,9 +1458,9 @@
* M204 R Retract Acceleration * M204 R Retract Acceleration
* M204 T Travel Acceleration * M204 T Travel Acceleration
*/ */
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration for printing moves #define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts #define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration for retracts
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves #define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves
/** /**
* Default Jerk limits (mm/s) * Default Jerk limits (mm/s)
@@ -1286,10 +1470,10 @@
* When changing speed and direction, if the difference is less than the * When changing speed and direction, if the difference is less than the
* value set here, it may happen instantaneously. * value set here, it may happen instantaneously.
*/ */
//#define CLASSIC_JERK #define CLASSIC_JERK
#if ENABLED(CLASSIC_JERK) #if ENABLED(CLASSIC_JERK)
#define DEFAULT_XJERK 10.0 #define DEFAULT_XJERK 10.0
#define DEFAULT_YJERK 10.0 #define DEFAULT_YJERK 5.0
#define DEFAULT_ZJERK 0.3 #define DEFAULT_ZJERK 0.3
#define DEFAULT_EJERK 5.0 #define DEFAULT_EJERK 5.0
//#define DEFAULT_IJERK 0.3 //#define DEFAULT_IJERK 0.3
@@ -1303,7 +1487,7 @@
//#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2
#if ENABLED(LIMITED_JERK_EDITING) #if ENABLED(LIMITED_JERK_EDITING)
#define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10, 10 } // ...or, set your own edit limits
#endif #endif
#endif #endif
@@ -1328,7 +1512,7 @@
* *
* See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained
*/ */
//#define S_CURVE_ACCELERATION #define S_CURVE_ACCELERATION
//=========================================================================== //===========================================================================
//============================= Z Probe Options ============================= //============================= Z Probe Options =============================
@@ -1404,7 +1588,7 @@
/** /**
* The BLTouch probe uses a Hall effect sensor and emulates a servo. * The BLTouch probe uses a Hall effect sensor and emulates a servo.
*/ */
//#define BLTOUCH #define BLTOUCH
/** /**
* MagLev V4 probe by MDD * MagLev V4 probe by MDD
@@ -1579,7 +1763,6 @@
* | [-] | * | [-] |
* O-- FRONT --+ * O-- FRONT --+
*/ */
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
// Enable and set to use a specific tool for probing. Disable to allow any tool. // Enable and set to use a specific tool for probing. Disable to allow any tool.
#define PROBING_TOOL 0 #define PROBING_TOOL 0
@@ -1587,6 +1770,11 @@
//#define PROBE_TOOLCHANGE_NO_MOVE // Suppress motion on probe tool-change //#define PROBE_TOOLCHANGE_NO_MOVE // Suppress motion on probe tool-change
#endif #endif
#if ENABLED(TREX3)
#define NOZZLE_TO_PROBE_OFFSET { -3, 31, 0 }
#else
#define NOZZLE_TO_PROBE_OFFSET { -7, 29, 0 }
#endif
// Most probes should stay away from the edges of the bed, but // Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area. // with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define PROBING_MARGIN 10 #define PROBING_MARGIN 10
@@ -1595,7 +1783,7 @@
#define XY_PROBE_FEEDRATE (133*60) #define XY_PROBE_FEEDRATE (133*60)
// Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2) // Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2)
#define Z_PROBE_FEEDRATE_FAST (4*60) #define Z_PROBE_FEEDRATE_FAST (10*60)
// Feedrate (mm/min) for the "accurate" probe of each point // Feedrate (mm/min) for the "accurate" probe of each point
#define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2) #define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2)
@@ -1645,7 +1833,7 @@
* A total of 2 does fast/slow probes with a weighted average. * A total of 2 does fast/slow probes with a weighted average.
* A total of 3 or more adds more slow probes, taking the average. * A total of 3 or more adds more slow probes, taking the average.
*/ */
//#define MULTIPLE_PROBING 2 #define MULTIPLE_PROBING 2
//#define EXTRA_PROBING 1 //#define EXTRA_PROBING 1
/** /**
@@ -1662,21 +1850,27 @@
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
*/ */
#define Z_CLEARANCE_DEPLOY_PROBE 10 // (mm) Z Clearance for Deploy/Stow #if ENABLED(TREX3)
#define NOZZLE_TO_PROBE_OFFSET { -3, 31, 0 }
#else
#define NOZZLE_TO_PROBE_OFFSET { -7, 29, 0 }
#endif
#define Z_CLEARANCE_DEPLOY_PROBE 5 // (mm) Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points #define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points
#define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes #define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes
#define Z_PROBE_ERROR_TOLERANCE 3 // (mm) Tolerance for early trigger (<= -probe.offset.z + ZPET) #define Z_PROBE_ERROR_TOLERANCE 3 // (mm) Tolerance for early trigger (<= -probe.offset.z + ZPET)
//#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done //#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done
#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping #define Z_PROBE_LOW_POINT -3 // (mm) Farthest distance below the trigger-point to go before stopping
// For M851 provide ranges for adjusting the X, Y, and Z probe offsets // For M851 provide ranges for adjusting the X, Y, and Z probe offsets
//#define PROBE_OFFSET_XMIN -50 // (mm) //#define PROBE_OFFSET_XMIN -50 // (mm)
//#define PROBE_OFFSET_XMAX 50 // (mm) //#define PROBE_OFFSET_XMAX 50 // (mm)
//#define PROBE_OFFSET_YMIN -50 // (mm) //#define PROBE_OFFSET_YMIN -50 // (mm)
//#define PROBE_OFFSET_YMAX 50 // (mm) //#define PROBE_OFFSET_YMAX 50 // (mm)
//#define PROBE_OFFSET_ZMIN -20 // (mm) #define PROBE_OFFSET_ZMIN -3 // (mm)
//#define PROBE_OFFSET_ZMAX 20 // (mm) #define PROBE_OFFSET_ZMAX 3 // (mm)
// Enable the M48 repeatability test to test probe accuracy // Enable the M48 repeatability test to test probe accuracy
//#define Z_MIN_PROBE_REPEATABILITY_TEST //#define Z_MIN_PROBE_REPEATABILITY_TEST
@@ -1747,9 +1941,21 @@
// @section motion // @section motion
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR false #if ANY(X_2208, SKR12Pro)
#define INVERT_Y_DIR true #define INVERT_X_DIR true
#define INVERT_Z_DIR false #else
#define INVERT_X_DIR false
#endif
#if ANY(Y_2208, SKR12Pro)
#define INVERT_Y_DIR true
#else
#define INVERT_Y_DIR false
#endif
#if ANY(Z_2208, SKR12Pro)
#define INVERT_Z_DIR false
#else
#define INVERT_Z_DIR true
#endif
//#define INVERT_I_DIR false //#define INVERT_I_DIR false
//#define INVERT_J_DIR false //#define INVERT_J_DIR false
//#define INVERT_K_DIR false //#define INVERT_K_DIR false
@@ -1760,8 +1966,13 @@
// @section extruder // @section extruder
// For direct drive extruder v9 set to true, for geared extruder set to false. // For direct drive extruder v9 set to true, for geared extruder set to false.
#define INVERT_E0_DIR false #if ANY(E_2208, SKR12Pro) && DISABLED(TREX3)
#define INVERT_E1_DIR false #define INVERT_E0_DIR true
#define INVERT_E1_DIR false
#else
#define INVERT_E0_DIR false
#define INVERT_E1_DIR true
#endif
#define INVERT_E2_DIR false #define INVERT_E2_DIR false
#define INVERT_E3_DIR false #define INVERT_E3_DIR false
#define INVERT_E4_DIR false #define INVERT_E4_DIR false
@@ -1792,7 +2003,7 @@
// Direction of endstops when homing; 1=MAX, -1=MIN // Direction of endstops when homing; 1=MAX, -1=MIN
// :[-1,1] // :[-1,1]
#define X_HOME_DIR -1 #define X_HOME_DIR -1
#define Y_HOME_DIR -1 #define Y_HOME_DIR 1
#define Z_HOME_DIR -1 #define Z_HOME_DIR -1
//#define I_HOME_DIR -1 //#define I_HOME_DIR -1
//#define J_HOME_DIR -1 //#define J_HOME_DIR -1
@@ -1818,17 +2029,29 @@
// @section geometry // @section geometry
// The size of the printable area // The size of the print bed
#define X_BED_SIZE 200 #define X_BED_SIZE 400
#define Y_BED_SIZE 200 #define Y_BED_SIZE 400
// Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions. // Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions.
#define X_MIN_POS 0 #if DISABLED(TREX3) || ENABLED(TREX3_UPGRADE)
#define Y_MIN_POS 0 #define X_MIN_POS -42
#define Z_MIN_POS 0 #define Y_MIN_POS 0
#define X_MAX_POS X_BED_SIZE #define Z_MIN_POS -3
#define Y_MAX_POS Y_BED_SIZE #define X_MAX_POS 450
#define Z_MAX_POS 200 #define Y_MAX_POS Y_BED_SIZE
#else
#define X_MIN_POS -47
#define Y_MIN_POS 0
#define Z_MIN_POS -3
#define X_MAX_POS 460
#define Y_MAX_POS Y_BED_SIZE
#endif
#if(ENABLED(tallVersion))
#define Z_MAX_POS 700
#else
#define Z_MAX_POS 500
#endif
//#define I_MIN_POS 0 //#define I_MIN_POS 0
//#define I_MAX_POS 50 //#define I_MAX_POS 50
//#define J_MIN_POS 0 //#define J_MIN_POS 0
@@ -1880,7 +2103,7 @@
#endif #endif
#if ANY(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS) #if ANY(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
//#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD #define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD
#endif #endif
/** /**
@@ -1891,15 +2114,19 @@
* Marlin knows a print job is running when: * Marlin knows a print job is running when:
* 1. Running a print job from media started with M24. * 1. Running a print job from media started with M24.
* 2. The Print Job Timer has been started with M75. * 2. The Print Job Timer has been started with M75.
* 3. The heaters were turned on and PRINTJOB_TIMER_AUTOSTART is enabled. * 3. The heaters were turned on with a wait command (M109) and PRINTJOB_TIMER_AUTOSTART is enabled.
* *
* RAMPS-based boards use SERVO3_PIN for the first runout sensor. * RAMPS-based boards use SERVO3_PIN for the first runout sensor.
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
*/ */
//#define FILAMENT_RUNOUT_SENSOR #define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500. #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #if ENABLED(TREX3)
#define NUM_RUNOUT_SENSORS 2
#else
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
#endif
#define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present. #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
@@ -1942,13 +2169,17 @@
// Commands to execute on filament runout. // Commands to execute on filament runout.
// With multiple runout sensors use the %c placeholder for the current tool in commands (e.g., "M600 T%c") // With multiple runout sensors use the %c placeholder for the current tool in commands (e.g., "M600 T%c")
// NOTE: After 'M412 H1' the host handles filament runout and this script does not apply. // NOTE: After 'M591 H1' the host handles filament runout and this script does not apply.
#define FILAMENT_RUNOUT_SCRIPT "M600" #define FILAMENT_RUNOUT_SCRIPT "M600 %c"
// After a runout is detected, continue printing this length of filament // After a runout is detected, continue printing this length of filament
// before executing the runout script. Useful for a sensor at the end of // before executing the runout script. Useful for a sensor at the end of
// a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
//#define FILAMENT_RUNOUT_DISTANCE_MM 25 #if ENABLED(TREX3)
// #define FIL_RUNOUT_DISTANCE_MM { 15, 15 }
#else
// #define FIL_RUNOUT_DISTANCE_MM { 15 }
#endif
#ifdef FILAMENT_RUNOUT_DISTANCE_MM #ifdef FILAMENT_RUNOUT_DISTANCE_MM
// Enable this option to use an encoder disc that toggles the runout pin // Enable this option to use an encoder disc that toggles the runout pin
@@ -1997,6 +2228,34 @@
#endif #endif
#endif #endif
#endif #endif
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
// Override individually if the runout sensors vary
//#define FIL_RUNOUT1_PULLUP
//#define FIL_RUNOUT1_PULLDOWN
//#define FIL_RUNOUT2_PULLUP
//#define FIL_RUNOUT2_PULLDOWN
//#define FIL_RUNOUT3_PULLUP
//#define FIL_RUNOUT3_PULLDOWN
//#define FIL_RUNOUT4_PULLUP
//#define FIL_RUNOUT4_PULLDOWN
//#define FIL_RUNOUT5_PULLUP
//#define FIL_RUNOUT5_PULLDOWN
//#define FIL_RUNOUT6_PULLUP
//#define FIL_RUNOUT6_PULLDOWN
//#define FIL_RUNOUT7_PULLUP
//#define FIL_RUNOUT7_PULLDOWN
//#define FIL_RUNOUT8_PULLUP
//#define FIL_RUNOUT8_PULLDOWN
#endif #endif
//=========================================================================== //===========================================================================
@@ -2039,8 +2298,11 @@
*/ */
//#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR //#define AUTO_BED_LEVELING_LINEAR
//#define AUTO_BED_LEVELING_BILINEAR #if ENABLED(ABL_Bilinear)
//#define AUTO_BED_LEVELING_UBL #define AUTO_BED_LEVELING_BILINEAR
#else
#define AUTO_BED_LEVELING_UBL
#endif
//#define MESH_BED_LEVELING //#define MESH_BED_LEVELING
/** /**
@@ -2054,7 +2316,7 @@
* these options to restore the prior leveling state or to always enable * these options to restore the prior leveling state or to always enable
* leveling immediately after G28. * leveling immediately after G28.
*/ */
//#define RESTORE_LEVELING_AFTER_G28 #define RESTORE_LEVELING_AFTER_G28
//#define ENABLE_LEVELING_AFTER_G28 //#define ENABLE_LEVELING_AFTER_G28
/** /**
@@ -2086,7 +2348,7 @@
*/ */
#define ENABLE_LEVELING_FADE_HEIGHT #define ENABLE_LEVELING_FADE_HEIGHT
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
#define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height. #define DEFAULT_LEVELING_FADE_HEIGHT 0.0 // (mm) Default fade height.
#endif #endif
/** /**
@@ -2100,7 +2362,9 @@
/** /**
* Enable the G26 Mesh Validation Pattern tool. * Enable the G26 Mesh Validation Pattern tool.
*/ */
//#define G26_MESH_VALIDATION #if ENABLED(ABL_Bilinear)
#define G26_MESH_VALIDATION
#endif
#if ENABLED(G26_MESH_VALIDATION) #if ENABLED(G26_MESH_VALIDATION)
#define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle.
#define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for G26. #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for G26.
@@ -2116,7 +2380,7 @@
#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) #if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 11
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Probe along the Y axis, advancing X after each column // Probe along the Y axis, advancing X after each column
@@ -2146,13 +2410,13 @@
//========================= Unified Bed Leveling ============================ //========================= Unified Bed Leveling ============================
//=========================================================================== //===========================================================================
//#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh #define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh
#define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed #define MESH_INSET 3 // Set Mesh bounds as an inset region of the bed
#define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_X 15 // Don't use more than 15 points per axis, implementation limited.
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define UBL_HILBERT_CURVE // Use Hilbert distribution for less travel when probing multiple points #define UBL_HILBERT_CURVE // Use Hilbert distribution for less travel when probing multiple points
//#define UBL_TILT_ON_MESH_POINTS // Use nearest mesh points with G29 J for better Z reference //#define UBL_TILT_ON_MESH_POINTS // Use nearest mesh points with G29 J for better Z reference
//#define UBL_TILT_ON_MESH_POINTS_3POINT // Use nearest mesh points with G29 J0 (3-point) //#define UBL_TILT_ON_MESH_POINTS_3POINT // Use nearest mesh points with G29 J0 (3-point)
@@ -2160,7 +2424,7 @@
#define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle
#define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500
//#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used #define UBL_Z_RAISE_WHEN_OFF_MESH 0.0 // When the nozzle is off the mesh, this value is used
// as the Z-Height correction value. // as the Z-Height correction value.
//#define UBL_MESH_WIZARD // Run several commands in a row to get a complete mesh //#define UBL_MESH_WIZARD // Run several commands in a row to get a complete mesh
@@ -2254,7 +2518,7 @@
// For DELTA this is the top-center of the Cartesian print volume. // For DELTA this is the top-center of the Cartesian print volume.
//#define MANUAL_X_HOME_POS 0 //#define MANUAL_X_HOME_POS 0
//#define MANUAL_Y_HOME_POS 0 //#define MANUAL_Y_HOME_POS 0
//#define MANUAL_Z_HOME_POS 0 #define MANUAL_Z_HOME_POS 0
//#define MANUAL_I_HOME_POS 0 //#define MANUAL_I_HOME_POS 0
//#define MANUAL_J_HOME_POS 0 //#define MANUAL_J_HOME_POS 0
//#define MANUAL_K_HOME_POS 0 //#define MANUAL_K_HOME_POS 0
@@ -2269,7 +2533,7 @@
* - Allows Z homing only when XY positions are known and trusted. * - Allows Z homing only when XY positions are known and trusted.
* - If stepper drivers sleep, XY homing may be required again before Z homing. * - If stepper drivers sleep, XY homing may be required again before Z homing.
*/ */
//#define Z_SAFE_HOMING #define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING) #if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT X_CENTER // (mm) X point for Z homing #define Z_SAFE_HOMING_X_POINT X_CENTER // (mm) X point for Z homing
@@ -2356,13 +2620,13 @@
* M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes)
* M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
*/ */
//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 #define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release! //#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save flash. #define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save flash.
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
#if ENABLED(EEPROM_SETTINGS) #if ENABLED(EEPROM_SETTINGS)
//#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
//#define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build. #define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build.
#endif #endif
// @section host // @section host
@@ -2419,11 +2683,11 @@
* P1 Raise the nozzle always to Z-park height. * P1 Raise the nozzle always to Z-park height.
* P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS.
*/ */
//#define NOZZLE_PARK_FEATURE #define NOZZLE_PARK_FEATURE
#if ENABLED(NOZZLE_PARK_FEATURE) #if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z_raise } // Specify a park position as { X, Y, Z_raise }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_POINT { 150, (Y_MIN_POS + 10), 10 }
#define NOZZLE_PARK_MOVE 0 // Park motion: 0 = XY Move, 1 = X Only, 2 = Y Only, 3 = X before Y, 4 = Y before X #define NOZZLE_PARK_MOVE 0 // Park motion: 0 = XY Move, 1 = X Only, 2 = Y Only, 3 = X before Y, 4 = Y before X
#define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance #define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance
#define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis)
@@ -2466,7 +2730,7 @@
* *
* Caveats: The ending Z should be the same as starting Z. * Caveats: The ending Z should be the same as starting Z.
*/ */
//#define NOZZLE_CLEAN_FEATURE #define NOZZLE_CLEAN_FEATURE
#if ENABLED(NOZZLE_CLEAN_FEATURE) #if ENABLED(NOZZLE_CLEAN_FEATURE)
#define NOZZLE_CLEAN_PATTERN_LINE // Provide 'G12 P0' - a simple linear cleaning pattern #define NOZZLE_CLEAN_PATTERN_LINE // Provide 'G12 P0' - a simple linear cleaning pattern
@@ -2476,7 +2740,7 @@
// Default pattern to use when 'P' is not provided to G12. One of the enabled options above. // Default pattern to use when 'P' is not provided to G12. One of the enabled options above.
#define NOZZLE_CLEAN_DEFAULT_PATTERN 0 #define NOZZLE_CLEAN_DEFAULT_PATTERN 0
#define NOZZLE_CLEAN_STROKES 12 // Default number of pattern repetitions #define NOZZLE_CLEAN_STROKES 4 // Default number of pattern repetitions
#if ENABLED(NOZZLE_CLEAN_PATTERN_ZIGZAG) #if ENABLED(NOZZLE_CLEAN_PATTERN_ZIGZAG)
#define NOZZLE_CLEAN_TRIANGLES 3 // Default number of triangles #define NOZZLE_CLEAN_TRIANGLES 3 // Default number of triangles
@@ -2484,8 +2748,8 @@
// Specify positions for each tool as { { X, Y, Z }, { X, Y, Z } } // Specify positions for each tool as { { X, Y, Z }, { X, Y, Z } }
// Dual hotend system may use { { -20, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }, { 420, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }} // Dual hotend system may use { { -20, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }, { 420, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }}
#define NOZZLE_CLEAN_START_POINT { { 30, 30, (Z_MIN_POS + 1) } } #define NOZZLE_CLEAN_START_POINT { { -20, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }, { 420, (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }}
#define NOZZLE_CLEAN_END_POINT { { 100, 60, (Z_MIN_POS + 1) } } #define NOZZLE_CLEAN_END_POINT { { (-30), (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }, { (430), (Y_BED_SIZE / 2), (Z_MIN_POS + 1) }}
#if ENABLED(NOZZLE_CLEAN_PATTERN_CIRCLE) #if ENABLED(NOZZLE_CLEAN_PATTERN_CIRCLE)
#define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 // (mm) Circular pattern radius #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 // (mm) Circular pattern radius
@@ -2496,11 +2760,11 @@
// Move the nozzle to the initial position after cleaning // Move the nozzle to the initial position after cleaning
#define NOZZLE_CLEAN_GOBACK #define NOZZLE_CLEAN_GOBACK
// For a purge/clean station that's always at the gantry height (thus no Z move) // Enable for a purge/clean station that's always at the gantry height (thus no Z move)
//#define NOZZLE_CLEAN_NO_Z #define NOZZLE_CLEAN_NO_Z
// For a purge/clean station mounted on the X axis // For a purge/clean station mounted on the X axis
//#define NOZZLE_CLEAN_NO_Y #define NOZZLE_CLEAN_NO_Y
// Require a minimum hotend temperature for cleaning // Require a minimum hotend temperature for cleaning
#define NOZZLE_CLEAN_MIN_TEMP 170 #define NOZZLE_CLEAN_MIN_TEMP 170
@@ -2634,9 +2898,9 @@
#define DISPLAY_CHARSET_HD44780 JAPANESE #define DISPLAY_CHARSET_HD44780 JAPANESE
/** /**
* Info Screen Style (0:Classic, 1:Průša) * Info Screen Style (0:Classic, 1:Průša, 2:CNC)
* *
* :[0:'Classic', 1:'Průša'] * :[0:'Classic', 1:'Průša', 2:'CNC']
*/ */
#define LCD_INFO_SCREEN_STYLE 0 #define LCD_INFO_SCREEN_STYLE 0
@@ -2646,7 +2910,8 @@
* SD Card support is disabled by default. If your controller has an SD slot, * SD Card support is disabled by default. If your controller has an SD slot,
* you must uncomment the following option or it won't work. * you must uncomment the following option or it won't work.
*/ */
//#define SDSUPPORT #define SD_SPI_SPEED SPI_HALF_SPEED
#define SDSUPPORT
/** /**
* SD CARD: ENABLE CRC * SD CARD: ENABLE CRC
@@ -2726,8 +2991,8 @@
// //
// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. // Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
// //
//#define INDIVIDUAL_AXIS_HOMING_MENU #define INDIVIDUAL_AXIS_HOMING_MENU
//#define INDIVIDUAL_AXIS_HOMING_SUBMENU #define INDIVIDUAL_AXIS_HOMING_SUBMENU
// //
// SPEAKER/BUZZER // SPEAKER/BUZZER
@@ -2929,7 +3194,7 @@
// RepRapDiscount FULL GRAPHIC Smart Controller // RepRapDiscount FULL GRAPHIC Smart Controller
// https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller // https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
// //
//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
// //
// K.3D Full Graphic Smart Controller // K.3D Full Graphic Smart Controller
@@ -3414,7 +3679,6 @@
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
//#define DISABLE_ENCODER // Disable the click encoder, if any //#define DISABLE_ENCODER // Disable the click encoder, if any
//#define TOUCH_IDLE_SLEEP_MINS 5 // (minutes) Display Sleep after a period of inactivity. Set with M255 S.
#define TOUCH_SCREEN_CALIBRATION #define TOUCH_SCREEN_CALIBRATION
@@ -3458,8 +3722,9 @@
// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
// which is not as annoying as with the hardware PWM. On the other hand, if this frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency
// is too low, you should also increment SOFT_PWM_SCALE. // is too low, you should also increment SOFT_PWM_SCALE.
//#define FAN_SOFT_PWM #if ENABLED(TREX3) && DISABLED(SKR12Pro)
#define FAN_SOFT_PWM
#endif
// Incrementing this by 1 will double the software PWM frequency, // Incrementing this by 1 will double the software PWM frequency,
// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. // affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
// However, control resolution will be halved for each increment; // However, control resolution will be halved for each increment;
+185 -158
View File
@@ -304,14 +304,14 @@
* THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
*/ */
#if ENABLED(THERMAL_PROTECTION_HOTENDS) #if ENABLED(THERMAL_PROTECTION_HOTENDS)
#define THERMAL_PROTECTION_PERIOD 40 // (seconds) #define THERMAL_PROTECTION_PERIOD 60 // (seconds)
#define THERMAL_PROTECTION_HYSTERESIS 4 // (°C) #define THERMAL_PROTECTION_HYSTERESIS 15 // (°C)
//#define ADAPTIVE_FAN_SLOWING // Slow down the part-cooling fan if the temperature drops #define ADAPTIVE_FAN_SLOWING // Slow down the part-cooling fan if the temperature drops
#if ENABLED(ADAPTIVE_FAN_SLOWING) #if ENABLED(ADAPTIVE_FAN_SLOWING)
//#define REPORT_ADAPTIVE_FAN_SLOWING // Report fan slowing activity to the console //#define REPORT_ADAPTIVE_FAN_SLOWING // Report fan slowing activity to the console
#if ANY(MPCTEMP, PIDTEMP) #if ANY(MPCTEMP, PIDTEMP)
//#define TEMP_TUNING_MAINTAIN_FAN // Don't slow down the fan speed during M303 or M306 T #define TEMP_TUNING_MAINTAIN_FAN // Don't slow down the fan speed during M303 or M306 T
#endif #endif
#endif #endif
@@ -327,7 +327,7 @@
* and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set
* below 2. * below 2.
*/ */
#define WATCH_TEMP_PERIOD 40 // (seconds) #define WATCH_TEMP_PERIOD 60 // (seconds)
#define WATCH_TEMP_INCREASE 2 // (°C) #define WATCH_TEMP_INCREASE 2 // (°C)
#endif #endif
@@ -335,13 +335,13 @@
* Thermal Protection parameters for the bed are just as above for hotends. * Thermal Protection parameters for the bed are just as above for hotends.
*/ */
#if ENABLED(THERMAL_PROTECTION_BED) #if ENABLED(THERMAL_PROTECTION_BED)
#define THERMAL_PROTECTION_BED_PERIOD 20 // (seconds) #define THERMAL_PROTECTION_BED_PERIOD 120 // (seconds)
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // (°C) #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // (°C)
/** /**
* As described above, except for the bed (M140/M190/M303). * As described above, except for the bed (M140/M190/M303).
*/ */
#define WATCH_BED_TEMP_PERIOD 60 // (seconds) #define WATCH_BED_TEMP_PERIOD 120 // (seconds)
#define WATCH_BED_TEMP_INCREASE 2 // (°C) #define WATCH_BED_TEMP_INCREASE 2 // (°C)
#endif #endif
@@ -547,9 +547,9 @@
* Hotend Idle Timeout * Hotend Idle Timeout
* Prevent filament in the nozzle from charring and causing a critical jam. * Prevent filament in the nozzle from charring and causing a critical jam.
*/ */
//#define HOTEND_IDLE_TIMEOUT #define HOTEND_IDLE_TIMEOUT
#if ENABLED(HOTEND_IDLE_TIMEOUT) #if ENABLED(HOTEND_IDLE_TIMEOUT)
#define HOTEND_IDLE_TIMEOUT_SEC (5*60) // (seconds) Time without extruder movement to trigger protection #define HOTEND_IDLE_TIMEOUT_SEC (15*60) // (seconds) Time without extruder movement to trigger protection
#define HOTEND_IDLE_MIN_TRIGGER 180 // (°C) Minimum temperature to enable hotend protection #define HOTEND_IDLE_MIN_TRIGGER 180 // (°C) Minimum temperature to enable hotend protection
#define HOTEND_IDLE_NOZZLE_TARGET 0 // (°C) Safe temperature for the nozzle after timeout #define HOTEND_IDLE_NOZZLE_TARGET 0 // (°C) Safe temperature for the nozzle after timeout
#define HOTEND_IDLE_BED_TARGET 0 // (°C) Safe temperature for the bed after timeout #define HOTEND_IDLE_BED_TARGET 0 // (°C) Safe temperature for the bed after timeout
@@ -602,7 +602,7 @@
* gets it spinning reliably for a short time before setting the requested speed. * gets it spinning reliably for a short time before setting the requested speed.
* (Does not work on Sanguinololu with FAN_SOFT_PWM.) * (Does not work on Sanguinololu with FAN_SOFT_PWM.)
*/ */
//#define FAN_KICKSTART_TIME 100 // (ms) #define FAN_KICKSTART_TIME 100 // (ms)
//#define FAN_KICKSTART_POWER 180 // 64-255 //#define FAN_KICKSTART_POWER 180 // 64-255
// Some coolers may require a non-zero "off" state. // Some coolers may require a non-zero "off" state.
@@ -681,8 +681,17 @@
* Multiple extruders can be assigned to the same pin in which case * Multiple extruders can be assigned to the same pin in which case
* the fan will turn on when any selected extruder is above the threshold. * the fan will turn on when any selected extruder is above the threshold.
*/ */
#define E0_AUTO_FAN_PIN -1 #if ENABLED(SKR12Pro, TREX3)
#define E1_AUTO_FAN_PIN -1 #define E0_AUTO_FAN_PIN FAN2_PIN
#define E1_AUTO_FAN_PIN FAN2_PIN
#elif ENABLED(TREX3)
#define E0_AUTO_FAN_PIN 6
#define E1_AUTO_FAN_PIN 45
#else
#define E0_AUTO_FAN_PIN -1
#define E1_AUTO_FAN_PIN -1
#endif
#define E2_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1
#define E3_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1
#define E4_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1
@@ -748,15 +757,17 @@
* @section caselight * @section caselight
* M355 Case Light on-off / brightness * M355 Case Light on-off / brightness
*/ */
//#define CASE_LIGHT_ENABLE #define CASE_LIGHT_ENABLE
#if ENABLED(CASE_LIGHT_ENABLE) #if ENABLED(CASE_LIGHT_ENABLE)
//#define CASE_LIGHT_PIN 4 // Override the default pin if needed #if ENABLED(SKR12Pro)
#define CASE_LIGHT_PIN HEATER_2_PIN // Override the default pin if needed
#endif
#define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW
#define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on
#define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) #define CASE_LIGHT_DEFAULT_BRIGHTNESS 255 // Set default power-up brightness (0-255, requires PWM pin)
//#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting. //#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting.
//#define CASE_LIGHT_MAX_PWM 128 // Limit PWM duty cycle (0-255) //#define CASE_LIGHT_MAX_PWM 128 // Limit PWM duty cycle (0-255)
//#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu #define CASE_LIGHT_MENU // Add Case Light options to the LCD menu
#if ENABLED(NEOPIXEL_LED) #if ENABLED(NEOPIXEL_LED)
//#define CASE_LIGHT_USE_NEOPIXEL // Use NeoPixel LED as case light //#define CASE_LIGHT_USE_NEOPIXEL // Use NeoPixel LED as case light
#endif #endif
@@ -815,22 +826,26 @@
* Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and * Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and
* follow with M605 S3 to initiate mirrored movement. * follow with M605 S3 to initiate mirrored movement.
*/ */
//#define DUAL_X_CARRIAGE #define DUAL_X_CARRIAGE
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)
#define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS #define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS
#define X1_MAX_POS X_BED_SIZE // A max coordinate so the X1 carriage can't hit the parked X2 carriage #define X1_MAX_POS X_BED_SIZE // A max coordinate so the X1 carriage can't hit the parked X2 carriage
#define X2_MIN_POS 80 // A min coordinate so the X2 carriage can't hit the parked X1 carriage #define X2_MIN_POS 0 // A min coordinate so the X2 carriage can't hit the parked X1 carriage
#define X2_MAX_POS 353 // The max position of the X2 carriage, typically also the home position #if DISABLED(TREX3) || ENABLED(TREX3_UPGRADE)
#define X2_MAX_POS 442 // The max position of the X2 carriage, typically also the home position
#else
#define X2_MAX_POS 446 // The max position of the X2 carriage, typically also the home position
#endif
#define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS. #define X2_HOME_POS X2_MAX_POS // Default X2 home position. Set to X2_MAX_POS.
// NOTE: For Dual X Carriage use M218 T1 Xn to override the X2_HOME_POS. // NOTE: For Dual X Carriage use M218 T1 Xn to override the X2_HOME_POS.
// This allows recalibration of endstops distance without a rebuild. // This allows recalibration of endstops distance without a rebuild.
// Remember to set the second extruder's X-offset to 0 in your slicer. // Remember to set the second extruder's X-offset to 0 in your slicer.
// This is the default power-up mode which can be changed later using M605 S<mode>. // This is the default power-up mode which can be later using M605.
#define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE
// Default x offset in duplication mode (typically set to half print bed width) // Default x offset in duplication mode (typically set to half print bed width)
#define DEFAULT_DUPLICATION_X_OFFSET 100 #define DEFAULT_DUPLICATION_X_OFFSET 200
// Default action to execute following M605 mode change commands. Typically G28X to apply new mode. // Default action to execute following M605 mode change commands. Typically G28X to apply new mode.
//#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X" //#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X"
@@ -931,7 +946,7 @@
//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing //#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing
//#define XY_COUNTERPART_BACKOFF_MM 0 // (mm) Backoff X after homing Y, and vice-versa //#define XY_COUNTERPART_BACKOFF_MM 0 // (mm) Backoff X after homing Y, and vice-versa
//#define QUICK_HOME // If G28 contains XY do a diagonal move first #define QUICK_HOME // If G28 contains XY do a diagonal move first
//#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X //#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X
//#define HOME_Z_FIRST // Home Z first. Requires a real endstop (not a probe). //#define HOME_Z_FIRST // Home Z first. Requires a real endstop (not a probe).
//#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first //#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first
@@ -1003,7 +1018,7 @@
* *
* Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset. * Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset.
*/ */
//#define BLTOUCH_HS_MODE true #define BLTOUCH_HS_MODE true
#ifdef BLTOUCH_HS_MODE #ifdef BLTOUCH_HS_MODE
// The probe Z offset (M851 Z) is the height at which the probe triggers. // The probe Z offset (M851 Z) is the height at which the probe triggers.
@@ -1204,14 +1219,14 @@
//#define INPUT_SHAPING_Y //#define INPUT_SHAPING_Y
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y) #if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#if ENABLED(INPUT_SHAPING_X) #if ENABLED(INPUT_SHAPING_X)
#define SHAPING_FREQ_X 40 // (Hz) The default dominant resonant frequency on the X axis. #define SHAPING_FREQ_X 40.0 // (Hz) The default dominant resonant frequency on the X axis.
#define SHAPING_ZETA_X 0.15f // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping). #define SHAPING_ZETA_X 0.15 // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif #endif
#if ENABLED(INPUT_SHAPING_Y) #if ENABLED(INPUT_SHAPING_Y)
#define SHAPING_FREQ_Y 40 // (Hz) The default dominant resonant frequency on the Y axis. #define SHAPING_FREQ_Y 40.0 // (Hz) The default dominant resonant frequency on the Y axis.
#define SHAPING_ZETA_Y 0.15f // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping). #define SHAPING_ZETA_Y 0.15 // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif #endif
//#define SHAPING_MIN_FREQ 20 // By default the minimum of the shaping frequencies. Override to affect SRAM usage. //#define SHAPING_MIN_FREQ 20.0 // (Hz) By default the minimum of the shaping frequencies. Override to affect SRAM usage.
//#define SHAPING_MAX_STEPRATE 10000 // By default the maximum total step rate of the shaped axes. Override to affect SRAM usage. //#define SHAPING_MAX_STEPRATE 10000 // By default the maximum total step rate of the shaped axes. Override to affect SRAM usage.
//#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters. //#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters.
#endif #endif
@@ -1263,30 +1278,34 @@
// Increase the slowdown divisor for larger buffer sizes. // Increase the slowdown divisor for larger buffer sizes.
#define SLOWDOWN #define SLOWDOWN
#if ENABLED(SLOWDOWN) #if ENABLED(SLOWDOWN)
#define SLOWDOWN_DIVISOR 2 #if ENABLED(SKR12Pro)
#define SLOWDOWN_DIVISOR 6
#else
#define SLOWDOWN_DIVISOR 2
#endif
#endif #endif
/** /**
* XY Frequency limit * XY Frequency limit
* Reduce resonance by limiting the frequency of small zigzag infill moves. * Reduce resonance by limiting the frequency of small zigzag infill moves.
* See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html * See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html
* Use M201 F<freq> G<min%> to change limits at runtime. * Use M201 F<freq> S<min%> to change limits at runtime.
*/ */
//#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F<hertz>. //#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F<hertz>.
#ifdef XY_FREQUENCY_LIMIT #ifdef XY_FREQUENCY_LIMIT
#define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 G<min%>. #define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 S<min%>.
#endif #endif
// //
// Backlash Compensation // Backlash Compensation
// Adds extra movement to axes on direction-changes to account for backlash. // Adds extra movement to axes on direction-changes to account for backlash.
// //
//#define BACKLASH_COMPENSATION #define BACKLASH_COMPENSATION
#if ENABLED(BACKLASH_COMPENSATION) #if ENABLED(BACKLASH_COMPENSATION)
// Define values for backlash distance and correction. // Define values for backlash distance and correction.
// If BACKLASH_GCODE is enabled these values are the defaults. // If BACKLASH_GCODE is enabled these values are the defaults.
#define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (linear=mm, rotational=°) One value for each linear axis #define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (linear=mm, rotational=°) One value for each linear axis
#define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction #define BACKLASH_CORRECTION 0.5 // 0.0 = no correction; 1.0 = full correction
// Add steps for motor direction changes on CORE kinematics // Add steps for motor direction changes on CORE kinematics
//#define CORE_BACKLASH //#define CORE_BACKLASH
@@ -1296,11 +1315,11 @@
//#define BACKLASH_SMOOTHING_MM 3 // (mm) //#define BACKLASH_SMOOTHING_MM 3 // (mm)
// Add runtime configuration and tuning of backlash values (M425) // Add runtime configuration and tuning of backlash values (M425)
//#define BACKLASH_GCODE #define BACKLASH_GCODE
#if ENABLED(BACKLASH_GCODE) #if ENABLED(BACKLASH_GCODE)
// Measure the Z backlash when probing (G29) and set with "M425 Z" // Measure the Z backlash when probing (G29) and set with "M425 Z"
#define MEASURE_BACKLASH_WHEN_PROBING //#define MEASURE_BACKLASH_WHEN_PROBING
#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
// When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT
@@ -1326,7 +1345,9 @@
* Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within * Note: HOTEND_OFFSET and CALIBRATION_OBJECT_CENTER must be set to within
* ±5mm of true values for G425 to succeed. * ±5mm of true values for G425 to succeed.
*/ */
//#define CALIBRATION_GCODE #if ENABLED(autoCalibrationKit)
#define CALIBRATION_GCODE
#endif
#if ENABLED(CALIBRATION_GCODE) #if ENABLED(CALIBRATION_GCODE)
//#define CALIBRATION_SCRIPT_PRE "M117 Starting Auto-Calibration\nT0\nG28\nG12\nM117 Calibrating..." //#define CALIBRATION_SCRIPT_PRE "M117 Starting Auto-Calibration\nT0\nG28\nG12\nM117 Calibrating..."
@@ -1343,11 +1364,13 @@
#define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm
// Uncomment to enable reporting (required for "G425 V", but consumes flash). // Uncomment to enable reporting (required for "G425 V", but consumes flash).
//#define CALIBRATION_REPORTING #if ENABLED(SKR12Pro)
#define CALIBRATION_REPORTING
#endif
// The true location and dimension the cube/bolt/washer on the bed. // The true location and dimension the cube/bolt/washer on the bed.
#define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm #define CALIBRATION_OBJECT_CENTER { 264.0, 25.0, 12.5 } // mm
#define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm #define CALIBRATION_OBJECT_DIMENSIONS { 12.55, 12.55, 4.0 } // mm
// Comment out any sides which are unreachable by the probe. For best // Comment out any sides which are unreachable by the probe. For best
// auto-calibration results, all sides must be reachable. // auto-calibration results, all sides must be reachable.
@@ -1371,12 +1394,16 @@
// Probing at the exact top center only works if the center is flat. If // Probing at the exact top center only works if the center is flat. If
// probing on a screw head or hollow washer, probe near the edges. // probing on a screw head or hollow washer, probe near the edges.
//#define CALIBRATION_MEASURE_AT_TOP_EDGES #define CALIBRATION_MEASURE_AT_TOP_EDGES
// Define the pin to read during calibration // Define the pin to read during calibration
#ifndef CALIBRATION_PIN #ifndef CALIBRATION_PIN
//#define CALIBRATION_PIN -1 // Define here to override the default pin #if ENABLED(SKR12Pro)
#define CALIBRATION_PIN_INVERTING false // Set to true to invert the custom pin #define CALIBRATION_PIN Z_MAX
#else
#define CALIBRATION_PIN 58 // Override in pins.h or set to -1 to use your Z endstop
#endif
#define CALIBRATION_PIN_INVERTING true // Set to true to invert the pin
//#define CALIBRATION_PIN_PULLDOWN //#define CALIBRATION_PIN_PULLDOWN
#define CALIBRATION_PIN_PULLUP #define CALIBRATION_PIN_PULLUP
#endif #endif
@@ -1529,7 +1556,7 @@
#endif #endif
// Include a page of printer information in the LCD Main Menu // Include a page of printer information in the LCD Main Menu
//#define LCD_INFO_MENU #define LCD_INFO_MENU
#if ENABLED(LCD_INFO_MENU) #if ENABLED(LCD_INFO_MENU)
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages //#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif #endif
@@ -1656,7 +1683,7 @@
#endif #endif
// Add 'M73' to set print job progress, overrides Marlin's built-in estimate // Add 'M73' to set print job progress, overrides Marlin's built-in estimate
//#define SET_PROGRESS_MANUALLY #define SET_PROGRESS_MANUALLY
#if ENABLED(SET_PROGRESS_MANUALLY) #if ENABLED(SET_PROGRESS_MANUALLY)
#define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done #define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done
#define SET_REMAINING_TIME // Add 'R' parameter to set remaining time #define SET_REMAINING_TIME // Add 'R' parameter to set remaining time
@@ -1813,13 +1840,13 @@
// Allow international symbols in long filenames. To display correctly, the // Allow international symbols in long filenames. To display correctly, the
// LCD's font must contain the characters. Check your selected LCD language. // LCD's font must contain the characters. Check your selected LCD language.
//#define UTF_FILENAME_SUPPORT #define UTF_FILENAME_SUPPORT
//#define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 <dosname>' and list long filenames with 'M20 L' #define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 <dosname>' and list long filenames with 'M20 L'
//#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol //#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol
//#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands //#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands
//#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu #define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu
//#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!) //#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!)
@@ -1920,7 +1947,9 @@
* *
* :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ]
*/ */
//#define SDCARD_CONNECTION LCD #if ENABLED(SKR12Pro)
#define SDCARD_CONNECTION ONBOARD
#endif
// Enable if SD detect is rendered useless (e.g., by using an SD extender) // Enable if SD detect is rendered useless (e.g., by using an SD extender)
//#define NO_SD_DETECT //#define NO_SD_DETECT
@@ -1970,17 +1999,6 @@
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
//#define USE_SMALL_INFOFONT //#define USE_SMALL_INFOFONT
/**
* Graphical Display Sleep
*
* The U8G library provides sleep / wake functions for SH1106, SSD1306,
* SSD1309, and some other DOGM displays.
* Enable this option to save energy and prevent OLED pixel burn-in.
* Adds the menu item Configuration > LCD Timeout (m) to set a wait period
* from 0 (disabled) to 99 minutes.
*/
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen. Set with M255 S.
/** /**
* ST7920-based LCDs can emulate a 16 x 4 character display using * ST7920-based LCDs can emulate a 16 x 4 character display using
* the ST7920 character-generator for very fast screen updates. * the ST7920 character-generator for very fast screen updates.
@@ -2229,13 +2247,20 @@
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
#endif #endif
// /**
// LCD Backlight Timeout * Display Sleep
// Requires a display with a controllable backlight * Enable this option to save energy and prevent OLED pixel burn-in.
// */
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen
/**
* LCD Backlight Timeout
* Requires a display with a controllable backlight
*/
//#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight //#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight
#if defined(DISPLAY_SLEEP_MINUTES) || defined(LCD_BACKLIGHT_TIMEOUT_MINS) #if defined(DISPLAY_SLEEP_MINUTES) || defined(LCD_BACKLIGHT_TIMEOUT_MINS)
#define EDITABLE_DISPLAY_TIMEOUT // Edit timeout with M255 S<minutes> and a menu item #define EDITABLE_DISPLAY_TIMEOUT // Edit sleep / backlight timeout with M255 S<minutes> and a menu item
#endif #endif
// //
@@ -2270,18 +2295,18 @@
* *
* Warning: Does not respect endstops! * Warning: Does not respect endstops!
*/ */
//#define BABYSTEPPING #define BABYSTEPPING
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
//#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support //#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support
//#define BABYSTEP_WITHOUT_HOMING //#define BABYSTEP_WITHOUT_HOMING
//#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement) #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement)
//#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA!
//#define BABYSTEP_INVERT_Z // Enable if Z babysteps should go the other way //#define BABYSTEP_INVERT_Z // Enable if Z babysteps should go the other way
//#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps //#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
#define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep #define BABYSTEP_MULTIPLICATOR_Z 20 // (steps or mm) Steps or millimeter distance for each Z babystep
#define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep #define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep
//#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)
#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
// Note: Extra time may be added to mitigate controller latency. // Note: Extra time may be added to mitigate controller latency.
@@ -2293,10 +2318,10 @@
//#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping #define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets #define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
//#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor #define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
#endif #endif
#endif #endif
@@ -2317,12 +2342,12 @@
* *
* See https://marlinfw.org/docs/features/lin_advance.html for full instructions. * See https://marlinfw.org/docs/features/lin_advance.html for full instructions.
*/ */
//#define LIN_ADVANCE #define LIN_ADVANCE
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
#if ENABLED(DISTINCT_E_FACTORS) #if ENABLED(DISTINCT_E_FACTORS)
#define ADVANCE_K { 0.22 } // (mm) Compression length per 1mm/s extruder speed, per extruder #define ADVANCE_K { 0.0 } // (mm) Compression length per 1mm/s extruder speed, per extruder
#else #else
#define ADVANCE_K 0.22 // (mm) Compression length applying to all extruders #define ADVANCE_K 0.0 // (mm) Compression length applying to all extruders
#endif #endif
//#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L. //#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L.
//#define LA_DEBUG // Print debug information to serial during operation. Disable for production use. //#define LA_DEBUG // Print debug information to serial during operation. Disable for production use.
@@ -2392,10 +2417,10 @@
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) #if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
// Override the mesh area if the automatic (max) area is too large // Override the mesh area if the automatic (max) area is too large
//#define MESH_MIN_X MESH_INSET #define MESH_MIN_X X_MIN_POS + MESH_INSET
//#define MESH_MIN_Y MESH_INSET #define MESH_MIN_Y Y_MIN_POS + MESH_INSET
//#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) #define MESH_MAX_X X_MAX_POS - MESH_INSET
//#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) #define MESH_MAX_Y Y_MAX_POS - MESH_INSET
#endif #endif
#if ALL(AUTO_BED_LEVELING_UBL, EEPROM_SETTINGS) #if ALL(AUTO_BED_LEVELING_UBL, EEPROM_SETTINGS)
@@ -2604,14 +2629,18 @@
#elif HAS_MEDIA #elif HAS_MEDIA
#define BLOCK_BUFFER_SIZE 16 #define BLOCK_BUFFER_SIZE 16
#else #else
#define BLOCK_BUFFER_SIZE 16 #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
#endif #endif
// @section serial // @section serial
// The ASCII buffer for serial input // The ASCII buffer for serial input
#define MAX_CMD_SIZE 96 #define MAX_CMD_SIZE 96
#define BUFSIZE 4 #if ENABLED(SKR12Pro)
#define BUFSIZE 16
#else
#define BUFSIZE 4
#endif
// Transmission to Host Buffer Size // Transmission to Host Buffer Size
// To save 386 bytes of flash (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. // To save 386 bytes of flash (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
@@ -2658,7 +2687,7 @@
* Currently handles M108, M112, M410, M876 * Currently handles M108, M112, M410, M876
* NOTE: Not yet implemented for all platforms. * NOTE: Not yet implemented for all platforms.
*/ */
//#define EMERGENCY_PARSER #define EMERGENCY_PARSER
/** /**
* Realtime Reporting (requires EMERGENCY_PARSER) * Realtime Reporting (requires EMERGENCY_PARSER)
@@ -2689,7 +2718,7 @@
//#define NO_TIMEOUTS 1000 // (ms) //#define NO_TIMEOUTS 1000 // (ms)
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
//#define ADVANCED_OK #define ADVANCED_OK
// Printrun may have trouble receiving long strings all at once. // Printrun may have trouble receiving long strings all at once.
// This option inserts short delays between lines of serial output. // This option inserts short delays between lines of serial output.
@@ -2743,7 +2772,9 @@
* *
* Note that M207 / M208 / M209 settings are saved to EEPROM. * Note that M207 / M208 / M209 settings are saved to EEPROM.
*/ */
//#define FWRETRACT #if ANY(ABL_Bilinear, SKR12Pro)
#define FWRETRACT
#endif
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)
#define FWRETRACT_AUTORETRACT // Override slicer retractions #define FWRETRACT_AUTORETRACT // Override slicer retractions
#if ENABLED(FWRETRACT_AUTORETRACT) #if ENABLED(FWRETRACT_AUTORETRACT)
@@ -2773,9 +2804,9 @@
// Z raise distance for tool-change, as needed for some extruders // Z raise distance for tool-change, as needed for some extruders
#define TOOLCHANGE_ZRAISE 2 // (mm) #define TOOLCHANGE_ZRAISE 2 // (mm)
//#define TOOLCHANGE_ZRAISE_BEFORE_RETRACT // Apply raise before swap retraction (if enabled) //#define TOOLCHANGE_ZRAISE_BEFORE_RETRACT // Apply raise before swap retraction (if enabled)
//#define TOOLCHANGE_NO_RETURN // Never return to previous position on tool-change #define TOOLCHANGE_NO_RETURN // Never return to previous position on tool-change
#if ENABLED(TOOLCHANGE_NO_RETURN) #if ENABLED(TOOLCHANGE_NO_RETURN)
//#define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // Extra G-code to run after tool-change #define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // Extra G-code to run after tool-change
#endif #endif
/** /**
@@ -2804,11 +2835,11 @@
* Retract and prime filament on tool-change to reduce * Retract and prime filament on tool-change to reduce
* ooze and stringing and to get cleaner transitions. * ooze and stringing and to get cleaner transitions.
*/ */
//#define TOOLCHANGE_FILAMENT_SWAP #define TOOLCHANGE_FILAMENT_SWAP
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP) #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
// Load / Unload // Load / Unload
#define TOOLCHANGE_FS_LENGTH 12 // (mm) Load / Unload length #define TOOLCHANGE_FS_LENGTH 4 // (mm) Load / Unload length
#define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 0 // (mm) Extra length for better restart. Adjust with LCD or M217 B. #define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 2 // (mm) Extra length for better restart. Adjust with LCD or M217 B.
#define TOOLCHANGE_FS_RETRACT_SPEED (50*60) // (mm/min) (Unloading) #define TOOLCHANGE_FS_RETRACT_SPEED (50*60) // (mm/min) (Unloading)
#define TOOLCHANGE_FS_UNRETRACT_SPEED (25*60) // (mm/min) (On SINGLENOZZLE or Bowden loading must be slowed down) #define TOOLCHANGE_FS_UNRETRACT_SPEED (25*60) // (mm/min) (On SINGLENOZZLE or Bowden loading must be slowed down)
@@ -2891,51 +2922,51 @@
* *
* Enable PARK_HEAD_ON_PAUSE to add the G-code M125 Pause and Park. * Enable PARK_HEAD_ON_PAUSE to add the G-code M125 Pause and Park.
*/ */
//#define ADVANCED_PAUSE_FEATURE #define ADVANCED_PAUSE_FEATURE
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
#define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. #define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle. // This short retract is done immediately, before parking the nozzle.
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 41 // (mm/s) Unload filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. #define FILAMENT_CHANGE_UNLOAD_LENGTH 70 // (mm) The length of filament for a complete unload.
// For Bowden, the full length of the tube and nozzle. // For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle. // For direct drive, the full length of the nozzle.
// Set to 0 for manual unloading. // Set to 0 for manual unloading.
#define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load.
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material.
// 0 to disable start loading and skip to fast load only // 0 to disable start loading and skip to fast load only
#define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 50 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle. // For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle. // For direct drive, the full length of the nozzle.
//#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted.
#define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate.
#define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. #define ADVANCED_PAUSE_PURGE_LENGTH 20 // (mm) Length to extrude after loading.
// Set to 0 for manual extrusion. // Set to 0 for manual extrusion.
// Filament can be extruded repeatedly from the Filament Change menu // Filament can be extruded repeatedly from the Filament Change menu
// until extrusion is consistent, and to purge old filament. // until extrusion is consistent, and to purge old filament.
#define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park. #define ADVANCED_PAUSE_RESUME_PRIME 2 // (mm) Extra distance to prime nozzle after returning from park.
//#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused. #define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.
// Filament Unload does a Retract, Delay, and Purge first: // Filament Unload does a Retract, Delay, and Purge first:
#define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length. #define FILAMENT_UNLOAD_PURGE_RETRACT 4 // (mm) Unload initial retract length.
#define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract. #define FILAMENT_UNLOAD_PURGE_DELAY 2000 // (ms) Delay for the filament to cool after retract.
#define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.
#define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload #define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload
#define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety.
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. #define FILAMENT_CHANGE_ALERT_BEEPS 1 // Number of alert beeps to play when a response is needed.
#define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change.
//#define FILAMENT_CHANGE_RESUME_ON_INSERT // Automatically continue / load filament when runout sensor is triggered again. //#define FILAMENT_CHANGE_RESUME_ON_INSERT // Automatically continue / load filament when runout sensor is triggered again.
//#define PAUSE_REHEAT_FAST_RESUME // Reduce number of waits by not prompting again post-timeout before continuing. //#define PAUSE_REHEAT_FAST_RESUME // Reduce number of waits by not prompting again post-timeout before continuing.
//#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change.
//#define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before parking for filament change #define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before parking for filament change
//#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. #define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) #define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
#define CONFIGURE_FILAMENT_CHANGE // Add M603 G-code and menu items. Requires ~1.3K bytes of flash. #define CONFIGURE_FILAMENT_CHANGE // Add M603 G-code and menu items. Requires ~1.3K bytes of flash.
#endif #endif
@@ -2957,15 +2988,12 @@
* Some boards have simple jumper connections! See your board's documentation. * Some boards have simple jumper connections! See your board's documentation.
* - These drivers can also be used with Hardware Serial. * - These drivers can also be used with Hardware Serial.
* *
* The TMC26XStepper library is required for TMC26X stepper drivers.
* https://github.com/MarlinFirmware/TMC26XStepper
*
* The TMCStepper library is required for other TMC stepper drivers. * The TMCStepper library is required for other TMC stepper drivers.
* https://github.com/teemuatlut/TMCStepper * https://github.com/teemuatlut/TMCStepper
* *
* @section tmc/config * @section tmc/config
*/ */
#if HAS_TRINAMIC_CONFIG || HAS_TMC26X #if HAS_TRINAMIC_CONFIG
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
@@ -2979,7 +3007,7 @@
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing
#define X_MICROSTEPS 16 // 0..256 #define X_MICROSTEPS 16 // 0..256
#define X_RSENSE 0.11 // Multiplied x1000 for TMC26X #define X_RSENSE 0.11
#define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ... #define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ...
//#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis //#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis
//#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis //#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis
@@ -3307,7 +3335,7 @@
* Define your own with: * Define your own with:
* { <off_time[1..15]>, <hysteresis_end[-3..12]>, hysteresis_start[1..8] } * { <off_time[1..15]>, <hysteresis_end[-3..12]>, hysteresis_start[1..8] }
*/ */
#define CHOPPER_TIMING CHOPPER_DEFAULT_12V // All axes (override below) #define CHOPPER_TIMING CHOPPER_DEFAULT_24V // All axes (override below)
//#define CHOPPER_TIMING_X CHOPPER_TIMING // For X Axes (override below) //#define CHOPPER_TIMING_X CHOPPER_TIMING // For X Axes (override below)
//#define CHOPPER_TIMING_X2 CHOPPER_TIMING_X //#define CHOPPER_TIMING_X2 CHOPPER_TIMING_X
//#define CHOPPER_TIMING_Y CHOPPER_TIMING // For Y Axes (override below) //#define CHOPPER_TIMING_Y CHOPPER_TIMING // For Y Axes (override below)
@@ -3344,7 +3372,7 @@
* M912 - Clear stepper driver overtemperature pre-warn condition flag. * M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 - Report driver parameters (Requires TMC_DEBUG) * M122 - Report driver parameters (Requires TMC_DEBUG)
*/ */
//#define MONITOR_DRIVER_STATUS #define MONITOR_DRIVER_STATUS
#if ENABLED(MONITOR_DRIVER_STATUS) #if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA] #define CURRENT_STEP_DOWN 50 // [mA]
@@ -3361,7 +3389,7 @@
* STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD. * STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD.
* M913 X/Y/Z/E to live tune the setting * M913 X/Y/Z/E to live tune the setting
*/ */
//#define HYBRID_THRESHOLD #define HYBRID_THRESHOLD
#define X_HYBRID_THRESHOLD 100 // [mm/s] #define X_HYBRID_THRESHOLD 100 // [mm/s]
#define X2_HYBRID_THRESHOLD 100 #define X2_HYBRID_THRESHOLD 100
@@ -3451,7 +3479,7 @@
/** /**
* Step on both rising and falling edge signals (as with a square wave). * Step on both rising and falling edge signals (as with a square wave).
*/ */
//#define EDGE_STEPPING #define EDGE_STEPPING
/** /**
* Enable M122 debugging command for TMC stepper drivers. * Enable M122 debugging command for TMC stepper drivers.
@@ -3472,7 +3500,7 @@
*/ */
#define TMC_ADV() { } #define TMC_ADV() { }
#endif // HAS_TRINAMIC_CONFIG || HAS_TMC26X #endif // HAS_TRINAMIC_CONFIG
// @section i2cbus // @section i2cbus
@@ -3565,7 +3593,7 @@
* Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and
* to set spindle speed, spindle direction, and laser power. * to set spindle speed, spindle direction, and laser power.
* *
* SuperPid is a router/spindle speed controller used in the CNC milling community. * SuperPID is a router/spindle speed controller used in the CNC milling community.
* Marlin can be used to turn the spindle on and off. It can also be used to set * Marlin can be used to turn the spindle on and off. It can also be used to set
* the spindle speed from 5,000 to 30,000 RPM. * the spindle speed from 5,000 to 30,000 RPM.
* *
@@ -3579,7 +3607,10 @@
#if ANY(SPINDLE_FEATURE, LASER_FEATURE) #if ANY(SPINDLE_FEATURE, LASER_FEATURE)
#define SPINDLE_LASER_ACTIVE_STATE LOW // Set to "HIGH" if SPINDLE_LASER_ENA_PIN is active HIGH #define SPINDLE_LASER_ACTIVE_STATE LOW // Set to "HIGH" if SPINDLE_LASER_ENA_PIN is active HIGH
#define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power #if ENABLED(SKR12Pro)
#define SPINDLE_LASER_ENA_PIN PE4
#endif
//#define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power
#if ENABLED(SPINDLE_LASER_USE_PWM) #if ENABLED(SPINDLE_LASER_USE_PWM)
#define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower
#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32, and LPC) #define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32, and LPC)
@@ -3630,8 +3661,8 @@
#define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction
#define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed
#define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERUP_DELAY 1 // (ms) Delay to allow the spindle/laser to come up to speed/power
#define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop #define SPINDLE_LASER_POWERDOWN_DELAY 1 // (ms) Delay to allow the spindle to stop
/** /**
* M3/M4 Power Equation * M3/M4 Power Equation
@@ -4010,33 +4041,41 @@
// @section custom main menu // @section custom main menu
// Custom Menu: Main Menu // Custom Menu: Main Menu
//#define CUSTOM_MENU_MAIN #define CUSTOM_MENU_MAIN
#if ENABLED(CUSTOM_MENU_MAIN) #if ENABLED(CUSTOM_MENU_MAIN)
//#define CUSTOM_MENU_MAIN_TITLE "Custom Commands" //#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done"
#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done" #define CUSTOM_MENU_MAIN_TITLE "Setup"
#define CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK #define CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK
//#define CUSTOM_MENU_MAIN_SCRIPT_RETURN // Return to status screen after a script #define CUSTOM_MENU_MAIN_SCRIPT_RETURN // Return to status screen after a script
#define CUSTOM_MENU_MAIN_ONLY_IDLE // Only show custom menu when the machine is idle #define CUSTOM_MENU_MAIN_ONLY_IDLE // Only show custom menu when the machine is idle
#define MAIN_MENU_ITEM_1_DESC "Home & UBL Info" #if ENABLED(TREX3)
#define MAIN_MENU_ITEM_1_GCODE "G28\nG29 W" #define COMMFANNSPEED " "
//#define MAIN_MENU_ITEM_1_CONFIRM // Show a confirmation dialog before this action #else
#define COMMFANNSPEED "M106 S128 \n"
#endif
#define MAIN_MENU_ITEM_2_DESC "Preheat for " PREHEAT_1_LABEL #define MAIN_MENU_ITEM_1_DESC "Mesh Setup"
#define MAIN_MENU_ITEM_2_GCODE "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) #define MAIN_MENU_ITEM_1_CONFIRM
//#define MAIN_MENU_ITEM_2_CONFIRM #define MAIN_MENU_ITEM_3_DESC "Prep for Z Adjust"
#if ENABLED(ABL_Bilinear)
#define MAIN_MENU_ITEM_1_GCODE "M502 \n M500 \n M501 \n M190 S75 \n G28 \n G29 \n M500 \n G28 \n M420 S1 \n " COMMFANNSPEED " M109 S225 \n G1 X100 Y 100 \n G1 Z0 \n M77 \n M117 Set Z Offset"
#define MAIN_MENU_ITEM_3_GCODE "M190 S75 \n " COMMFANNSPEED " M104 235 \n G28 \n M420 S1 \n G1 X100 Y 100 \n G1 Z0"
#else
#define MAIN_MENU_ITEM_1_GCODE "M502 \n M500 \n M501 \n M190 S75 \n G28 \n G29 P1 \n G29 S1 \n G29 S0 \n G29 F 10.0 \n G29 A \n M500 \n G28 \n G29 L1 \n " COMMFANNSPEED " M109 S225 \n G1 X150 Y 150 \n G1 Z0 \n M77 \n M117 Set Z Offset"
#define MAIN_MENU_ITEM_3_GCODE "M190 S75 \n " COMMFANNSPEED " M104 235 \n G28 \n G29 L1 \n G1 X100 Y 100 \n G1 Z0"
#endif
//#define MAIN_MENU_ITEM_3_DESC "Preheat for " PREHEAT_2_LABEL #define MAIN_MENU_ITEM_4_DESC "Fill Mesh Points"
//#define MAIN_MENU_ITEM_3_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) #define MAIN_MENU_ITEM_4_GCODE "G29 P3 \n G29 P3 \n G29 P3 \n G29 T"
//#define MAIN_MENU_ITEM_3_CONFIRM
//#define MAIN_MENU_ITEM_4_DESC "Heat Bed/Home/Level" #define MAIN_MENU_ITEM_2_DESC "PID Bed"
//#define MAIN_MENU_ITEM_4_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" #define MAIN_MENU_ITEM_2_GCODE "M303 C4 S75 E-1 U \n M500 \n M117 PID Tune Done"
//#define MAIN_MENU_ITEM_4_CONFIRM #define MAIN_MENU_ITEM_2_CONFIRM
//#define MAIN_MENU_ITEM_5_DESC "Home & Info" #define MAIN_MENU_ITEM_5_DESC "Run Mesh Validation"
//#define MAIN_MENU_ITEM_5_GCODE "G28\nM503" #define MAIN_MENU_ITEM_5_GCODE "G26"
//#define MAIN_MENU_ITEM_5_CONFIRM #define MAIN_MENU_ITEM_5_CONFIRM
#endif #endif
// @section custom config menu // @section custom config menu
@@ -4086,22 +4125,6 @@
#define BUTTON1_GCODE "G28" #define BUTTON1_GCODE "G28"
#define BUTTON1_DESC "Homing" // Optional string to set the LCD status #define BUTTON1_DESC "Homing" // Optional string to set the LCD status
#endif #endif
//#define BUTTON2_PIN -1
#if PIN_EXISTS(BUTTON2)
#define BUTTON2_HIT_STATE LOW
#define BUTTON2_WHEN_PRINTING false
#define BUTTON2_GCODE "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define BUTTON2_DESC "Preheat for " PREHEAT_1_LABEL
#endif
//#define BUTTON3_PIN -1
#if PIN_EXISTS(BUTTON3)
#define BUTTON3_HIT_STATE LOW
#define BUTTON3_WHEN_PRINTING false
#define BUTTON3_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define BUTTON3_DESC "Preheat for " PREHEAT_2_LABEL
#endif
#endif #endif
// @section host // @section host
@@ -4120,14 +4143,14 @@
* Host Prompt Support enables Marlin to use the host for user prompts so * Host Prompt Support enables Marlin to use the host for user prompts so
* filament runout and other processes can be managed from the host side. * filament runout and other processes can be managed from the host side.
*/ */
//#define HOST_ACTION_COMMANDS #define HOST_ACTION_COMMANDS
#if ENABLED(HOST_ACTION_COMMANDS) #if ENABLED(HOST_ACTION_COMMANDS)
//#define HOST_PAUSE_M76 // Tell the host to pause in response to M76 //#define HOST_PAUSE_M76 // Tell the host to pause in response to M76
//#define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback #define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)
//#define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications #define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications
#endif #endif
//#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start #define HOST_START_MENU_ITEM // Add a menu item that tells the host to start
//#define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down //#define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down
#endif #endif
@@ -4315,6 +4338,7 @@
// See class CodeProfiler. // See class CodeProfiler.
//#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multi-stepping 1 to 128 on this LED matrix row. //#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multi-stepping 1 to 128 on this LED matrix row.
//#define MAX7219_DEBUG_SLOWDOWN 6 // Count (mod 16) how many times SLOWDOWN has reduced print speed. //#define MAX7219_DEBUG_SLOWDOWN 6 // Count (mod 16) how many times SLOWDOWN has reduced print speed.
//#define MAX7219_REINIT_ON_POWERUP // Re-initialize MAX7129 when power supply turns on
#endif #endif
/** /**
@@ -4348,7 +4372,7 @@
* Extras for an ESP32-based motherboard with WIFISUPPORT * Extras for an ESP32-based motherboard with WIFISUPPORT
* These options don't apply to add-on WiFi modules based on ESP32 WiFi101. * These options don't apply to add-on WiFi modules based on ESP32 WiFi101.
*/ */
#if ENABLED(WIFISUPPORT) #if ANY(WIFISUPPORT, ESP3D_WIFISUPPORT)
//#define WEBSUPPORT // Start a webserver (which may include auto-discovery) using SPIFFS //#define WEBSUPPORT // Start a webserver (which may include auto-discovery) using SPIFFS
//#define OTASUPPORT // Support over-the-air firmware updates //#define OTASUPPORT // Support over-the-air firmware updates
//#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host //#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host
@@ -4531,3 +4555,6 @@
// Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR. // Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR.
//#define OPTIBOOT_RESET_REASON //#define OPTIBOOT_RESET_REASON
// Shrink the build for smaller boards by sacrificing some serial feedback
//#define MARLIN_SMALL_BUILD
+6 -6
View File
@@ -28,25 +28,25 @@
/** /**
* Marlin release version identifier * Marlin release version identifier
*/ */
//#define SHORT_BUILD_VERSION "bugfix-2.1.x" #define SHORT_BUILD_VERSION "2.1.x-TR1"
/** /**
* Verbose version identifier which should contain a reference to the location * Verbose version identifier which should contain a reference to the location
* from where the binary was downloaded or the source code was compiled. * from where the binary was downloaded or the source code was compiled.
*/ */
//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " TM3D"
/** /**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built, * The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
//#define STRING_DISTRIBUTION_DATE "2024-01-31" //#define STRING_DISTRIBUTION_DATE "2024-04-11"
/** /**
* Defines a generic printer name to be output to the LCD after booting Marlin. * Defines a generic printer name to be output to the LCD after booting Marlin.
*/ */
//#define MACHINE_NAME "3D Printer" #define MACHINE_NAME "TM3D Trex"
/** /**
* The SOURCE_CODE_URL is the location where users will find the Marlin Source * The SOURCE_CODE_URL is the location where users will find the Marlin Source
@@ -54,7 +54,7 @@
* has a distinct Github fork— the Source Code URL should just be the main * has a distinct Github fork— the Source Code URL should just be the main
* Marlin repository. * Marlin repository.
*/ */
//#define SOURCE_CODE_URL "github.com/MarlinFirmware/Marlin" #define SOURCE_CODE_URL "https://github.com/InsanityAutomation/Marlin/tree/TM_Trex2+_2.0.x"
/** /**
* Default generic printer UUID. * Default generic printer UUID.
@@ -65,7 +65,7 @@
* The WEBSITE_URL is the location where users can get more information such as * The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release. * documentation about a specific Marlin release.
*/ */
//#define WEBSITE_URL "marlinfw.org" #define WEBSITE_URL "tinymachines3d.com"
/** /**
* Set the vendor info the serial USB interface, if changable * Set the vendor info the serial USB interface, if changable
+93
View File
@@ -0,0 +1,93 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
*
*/
/**
* Custom Bitmap for splashscreen
*
* You may use one of the following tools to generate the C++ bitmap array from
* a black and white image:
*
* - http://www.marlinfw.org/tools/u8glib/converter.html
* - http://www.digole.com/tools/PicturetoC_Hex_converter.php
*/
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
#define CUSTOM_BOOTSCREEN_BMPWIDTH 128
#define CUSTOM_BOOTSCREEN_INVERTED
const unsigned char custom_start_bmp[] PROGMEM = {
B11111101,B01010101,B01010101,B01010101,B01010101,B01010101,B01011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111101,B00000000,B00000000,B00000111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111110,B00000111,B11000000,B00000101,B01010101,B01010101,B01010101,B01010101,B01010101,B01011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111100,B00001010,B00100000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111110,B00010100,B00010000,B00000101,B00000000,B00000000,B00000111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111100,B00101000,B00001000,B00000110,B00000111,B11000000,B00000101,B01010101,B01010101,B01010101,B01010101,B01010101,B01011111,B11111111,B11111111,B11111111,
B11111110,B01010100,B00000100,B00000100,B00001010,B00100000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111111,B11111111,
B11111100,B01100000,B00000100,B00000110,B00010100,B00010000,B00000101,B00000000,B00000000,B00000111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111110,B01010000,B00000100,B00000100,B00101000,B00001000,B00000110,B00000111,B11000000,B00000101,B01010101,B01010101,B01010101,B01010101,B01010101,B01011111,
B11111100,B01100000,B00000100,B00000110,B01010100,B00000100,B00000100,B00001010,B00100000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,
B11111110,B01010100,B00000100,B00011100,B01100000,B00000100,B00000110,B00010100,B00010000,B00000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,
B11111100,B00101000,B00001000,B00101110,B01010000,B00000100,B00000100,B00101000,B00001000,B00000110,B00000111,B11000000,B00000000,B00000001,B11110000,B00111111,
B11111110,B00010100,B00010000,B01010100,B01100000,B00000100,B00000110,B01010100,B00000100,B00000100,B00001010,B00100000,B00000000,B00000010,B00001000,B00011111,
B11111100,B00001010,B00100000,B01100110,B01010100,B00000100,B00011100,B01100000,B00000100,B00000110,B00010100,B00010000,B00000000,B00000101,B00000100,B00111111,
B11111110,B00000111,B11000000,B01010100,B00101000,B00001000,B00101110,B01010000,B00000100,B00000100,B00101000,B00001000,B00000000,B00001010,B00000010,B00011111,
B11111100,B00000000,B00000000,B00101110,B00010100,B00010000,B01010100,B01100000,B00000100,B00000110,B01010100,B00000100,B00000000,B00010101,B00000001,B00111111,
B11111110,B00000000,B00000000,B00011100,B00001010,B00100000,B01100110,B01010100,B00000100,B00011100,B01100000,B00000100,B00000000,B00011000,B00000001,B00011111,
B11111100,B00000000,B00000000,B00000110,B00000111,B11000000,B01010100,B00101000,B00001000,B00101110,B01010000,B00000100,B00000000,B00010100,B00000001,B00111111,
B11111110,B00000000,B00000000,B00000100,B00000000,B00000000,B00101110,B00010100,B00010000,B01010100,B01100000,B00000100,B00000000,B00011000,B00000001,B00011111,
B11111100,B11111111,B11111111,B11111110,B00000000,B00000000,B00011100,B00001010,B00100000,B01100110,B01010100,B00000100,B00011100,B00010101,B00000001,B00111111,
B11111110,B11010101,B01010101,B01010100,B00000000,B00000000,B00000110,B00000111,B11000000,B01010100,B00101000,B00001000,B00101010,B00001010,B00000010,B00011111,
B11111100,B10000100,B00010000,B01000110,B00000000,B00000000,B00000100,B00000000,B00000000,B00101110,B00010100,B00010000,B01010001,B00000101,B00000100,B00111111,
B11111110,B11000100,B00010000,B01000100,B11111111,B11111111,B11111110,B00000000,B00000000,B00011100,B00001010,B00100000,B01100001,B00000010,B10001000,B00011111,
B11111100,B10000100,B00010000,B01000110,B11010101,B01010101,B01010100,B00000000,B00000000,B00000110,B00000111,B11000000,B01010001,B00000001,B11110000,B00111111,
B11111110,B10000100,B00010000,B01000100,B10000100,B00010000,B01000110,B00000000,B00000000,B00000100,B00000000,B00000000,B00101010,B00000000,B00000000,B00011111,
B11111100,B11000100,B00010000,B01000110,B11000100,B00010000,B01000100,B11111111,B11111111,B11111110,B00000000,B00000000,B00011100,B00000000,B00000000,B00111111,
B11111110,B10000100,B00010000,B01000100,B10000100,B00010000,B01000110,B11010101,B01010101,B01010100,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,
B11111100,B11010101,B01010101,B01010110,B10000100,B00010000,B01000100,B10000100,B00010000,B01000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,
B11111100,B11111111,B11111111,B11111100,B11000100,B00010000,B01000110,B11000100,B00010000,B01000100,B11111111,B11111111,B11111111,B11111111,B11111111,B10011111,
B11111110,B00000000,B00000000,B00000110,B10000100,B00010000,B01000100,B10000100,B00010000,B01000110,B11010101,B01010101,B01010101,B01010101,B01010101,B10111111,
B11111101,B01010101,B01010101,B01010100,B11010101,B01010101,B01010110,B10000100,B00010000,B01000100,B10000100,B00010000,B01000001,B00000100,B00010000,B10011111,
B11111111,B11111111,B11111111,B11111100,B11111111,B11111111,B11111100,B11000100,B00010000,B01000110,B11000100,B00010000,B01000001,B00000100,B00010001,B10111111,
B11111111,B11111111,B11111111,B11111110,B00000000,B00000000,B00000110,B10000100,B00010000,B01000100,B10000100,B00010000,B01000001,B00000100,B00010000,B10011111,
B11111111,B11111111,B11111111,B11111101,B01010101,B01010101,B01010100,B11010101,B01010101,B01010110,B10000100,B00010000,B01000001,B00000100,B00010000,B10011111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100,B11111111,B11111111,B11111100,B11000100,B00010000,B01000001,B00000100,B00010001,B10111111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110,B00000000,B00000000,B00000110,B10000100,B00010000,B01000001,B00000100,B00010000,B10011111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111101,B01010101,B01010101,B01010100,B11010101,B01010101,B01010101,B01010101,B01010101,B10111111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111100,B11111111,B11111111,B11111111,B11111111,B11111111,B10011111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111101,B01010101,B01010101,B01010101,B01010101,B01010101,B01011111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,
B11100000,B00101110,B11111011,B01111101,B11111011,B11111011,B11001111,B11000001,B11011111,B10111011,B00111110,B11000000,B11100001,B11111110,B00111100,B00011111,
B11111101,B11101110,B01111011,B00111001,B11111001,B11110011,B11001111,B10011110,B11011111,B10111011,B00111110,B11011111,B11011110,B11111100,B11011101,B11100111,
B11111101,B11101110,B00111011,B10111011,B11111001,B11101011,B11010111,B10111111,B01011111,B10111011,B01011110,B11011111,B11011110,B11111101,B11101101,B11110111,
B11111101,B11101110,B10111011,B11010011,B11111010,B11101011,B10110111,B00111111,B11011111,B10111011,B01001110,B11011111,B11011111,B11111111,B11001101,B11110011,
B11111101,B11101110,B11011011,B11000111,B11111010,B11101011,B10111011,B01111111,B11000000,B00111011,B01101110,B11000000,B11100011,B11111111,B00011101,B11110011,
B11111101,B11101110,B11001011,B11101111,B11111010,B11011011,B10111011,B01111111,B11011111,B10111011,B01100110,B11011111,B11111000,B11111111,B11001101,B11110011,
B11111101,B11101110,B11101011,B11101111,B11111011,B01011011,B00000011,B00111111,B01011111,B10111011,B01110110,B11011111,B11111110,B01111111,B11101101,B11110011,
B11111101,B11101110,B11110011,B11101111,B11111011,B01011011,B01111001,B10111110,B11011111,B10111011,B01111010,B11011111,B11011110,B01111101,B11101101,B11110111,
B11111101,B11101110,B11110011,B11101111,B11111011,B10111010,B11111101,B10011110,B11011111,B10111011,B01111100,B11011111,B11011110,B11111101,B11001101,B11100111,
B11111101,B11101110,B11111011,B11101111,B11111011,B10111010,B11111101,B11000001,B11011111,B10111011,B01111110,B11000000,B11100000,B11111110,B00011100,B00011111
};
+74
View File
@@ -0,0 +1,74 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
*
*/
/**
* Custom Status Screen bitmap
*
* Place this file in the root with your configuration files
* and enable CUSTOM_STATUS_SCREEN_IMAGE in Configuration.h.
*
* Use the Marlin Bitmap Converter to make your own:
* http://marlinfw.org/tools/u8glib/converter.html
*/
//
// Status Screen Logo bitmap
//
#define STATUS_LOGO_Y 3
#define STATUS_LOGO_WIDTH 24
const unsigned char status_logo_bmp[] PROGMEM = {
B11111111,B11111111,B11111111,
B10000000,B00000000,B00000001,
B10001110,B00000000,B11100001,
B10011111,B00000001,B11110001,
B10010011,B10000001,B00111001,
B10011111,B10000001,B11111001,
B10011111,B10000001,B11111001,
B10011111,B10111001,B11111001,
B10001111,B00101000,B11110001,
B10000000,B00111000,B00000001,
B10000000,B00000000,B00000001,
B10011111,B11111111,B11111001,
B10010001,B01110100,B10011001,
B10011011,B00000110,B10101001,
B10011011,B01010100,B10101001,
B10011011,B01010110,B10101001,
B10011011,B01010100,B10011001,
B10011111,B11111111,B11111001,
B11111111,B11111111,B11111111
};
//
// Use default bitmaps
//
#define STATUS_HOTEND_ANIM
#define STATUS_BED_ANIM
#if HOTENDS < 2
#define STATUS_LOGO_X 8
#define STATUS_HEATERS_X 40
#define STATUS_BED_X 72
#else
#define STATUS_LOGO_X 0
#define STATUS_HEATERS_X 32
#define STATUS_BED_X 80
#endif
+19 -1
View File
@@ -40,9 +40,15 @@ void endstopIRQHandler() {
CHECK(X_MAX); CHECK(X_MAX);
CHECK(X_MIN); CHECK(X_MIN);
CHECK(X2_MAX);
CHECK(X2_MIN);
CHECK(Y_MAX); CHECK(Y_MAX);
CHECK(Y_MIN); CHECK(Y_MIN);
CHECK(Y2_MAX);
CHECK(Y2_MIN);
CHECK(Z_MAX); CHECK(Z_MAX);
CHECK(Z_MIN); CHECK(Z_MIN);
@@ -52,6 +58,9 @@ void endstopIRQHandler() {
CHECK(Z3_MAX); CHECK(Z3_MAX);
CHECK(Z3_MIN); CHECK(Z3_MIN);
CHECK(Z4_MAX);
CHECK(Z4_MIN);
CHECK(Z_MIN_PROBE); CHECK(Z_MIN_PROBE);
// Update endstops // Update endstops
@@ -69,9 +78,15 @@ void setup_endstop_interrupts() {
SETUP(X_MAX); SETUP(X_MAX);
SETUP(X_MIN); SETUP(X_MIN);
SETUP(X2_MAX);
SETUP(X2_MIN);
SETUP(Y_MAX); SETUP(Y_MAX);
SETUP(Y_MIN); SETUP(Y_MIN);
SETUP(Y2_MAX);
SETUP(Y2_MIN);
SETUP(Z_MAX); SETUP(Z_MAX);
SETUP(Z_MIN); SETUP(Z_MIN);
@@ -81,6 +96,9 @@ void setup_endstop_interrupts() {
SETUP(Z3_MAX); SETUP(Z3_MAX);
SETUP(Z3_MIN); SETUP(Z3_MIN);
SETUP(Z4_MAX);
SETUP(Z4_MIN);
SETUP(Z_MIN_PROBE); SETUP(Z_MIN_PROBE);
#undef SETUP #undef SETUP
@@ -88,7 +106,7 @@ void setup_endstop_interrupts() {
// Ensure 1 - 10 IRQs are registered // Ensure 1 - 10 IRQs are registered
// Disable some endstops if you encounter this error // Disable some endstops if you encounter this error
#define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_Y_MAX, USE_Y_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z_MIN_PROBE) #define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_X2_MAX, USE_X2_MIN, USE_Y_MAX, USE_Y_MIN, USE_Y2_MAX, USE_Y2_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z4_MAX, USE_Z4_MIN, USE_Z_MIN_PROBE)
#if ENDSTOPS_INTERRUPTS_COUNT > 10 #if ENDSTOPS_INTERRUPTS_COUNT > 10
#error "Too many endstop interrupts! HC32F460 only supports 10 endstop interrupts." #error "Too many endstop interrupts! HC32F460 only supports 10 endstop interrupts."
#elif ENDSTOPS_INTERRUPTS_COUNT == 0 #elif ENDSTOPS_INTERRUPTS_COUNT == 0
+4 -4
View File
@@ -126,7 +126,7 @@
void serialEvent2() __attribute__((weak)); void serialEvent2() __attribute__((weak));
#endif #endif
#ifdef USING_HW_SERIAL3 #ifdef USING_HW_SERIAL3
HAL_HardwareSerial Serial3(USART3); HAL_HardwareSerial HSerial3(USART3);
void serialEvent3() __attribute__((weak)); void serialEvent3() __attribute__((weak));
#endif #endif
#ifdef USING_HW_SERIAL4 #ifdef USING_HW_SERIAL4
@@ -147,11 +147,11 @@
#endif #endif
#ifdef USING_HW_SERIAL6 #ifdef USING_HW_SERIAL6
#ifdef USART6 #ifdef USART6
HAL_HardwareSerial HSerial5(USART6); HAL_HardwareSerial HSerial6(USART6);
#else #else
HAL_HardwareSerial HSerial5(UART6); HAL_HardwareSerial HSerial6(UART6);
#endif #endif
void serialEvent5() __attribute__((weak)); void serialEvent6() __attribute__((weak));
#endif #endif
// Constructors //////////////////////////////////////////////////////////////// // Constructors ////////////////////////////////////////////////////////////////
+3 -2
View File
@@ -58,8 +58,9 @@
* Check for common serial pin conflicts * Check for common serial pin conflicts
*/ */
#define _CHECK_SERIAL_PIN(N) (( \ #define _CHECK_SERIAL_PIN(N) (( \
BTN_EN1 == N || DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \ BTN_EN1 == N || BTN_EN2 == N ||DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \
SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N \ SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N || \
Y_STEP_PIN == N || Y_ENABLE_PIN == N || E0_ENABLE_PIN == N || POWER_LOSS_PIN == N \
)) ))
#define CHECK_SERIAL_PIN(T,N) defined(UART##N##_##T##_PIN) && _CHECK_SERIAL_PIN(UART##N##_##T##_PIN) #define CHECK_SERIAL_PIN(T,N) defined(UART##N##_##T##_PIN) && _CHECK_SERIAL_PIN(UART##N##_##T##_PIN)
#if SERIAL_IN_USE(1) #if SERIAL_IN_USE(1)
+71 -65
View File
@@ -37,50 +37,61 @@ LCD_CONTROLLER_TypeDef *TFT_FSMC::LCD;
void TFT_FSMC::init() { void TFT_FSMC::init() {
uint32_t controllerAddress; uint32_t controllerAddress;
FSMC_NORSRAM_TimingTypeDef timing, extTiming; FMC_OR_FSMC(NORSRAM_TimingTypeDef) timing, extTiming;
uint32_t nsBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), pinMap_FSMC_CS); uint32_t nsBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), pinMap_FSMC_CS);
// Perform the SRAM1 memory initialization sequence // Perform the SRAM1 memory initialization sequence
SRAMx.Instance = FSMC_NORSRAM_DEVICE; SRAMx.Instance = FMC_OR_FSMC(NORSRAM_DEVICE);
SRAMx.Extended = FSMC_NORSRAM_EXTENDED_DEVICE; SRAMx.Extended = FMC_OR_FSMC(NORSRAM_EXTENDED_DEVICE);
// SRAMx.Init // SRAMx.Init
SRAMx.Init.NSBank = nsBank; SRAMx.Init.NSBank = nsBank;
SRAMx.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE; SRAMx.Init.DataAddressMux = FMC_OR_FSMC(DATA_ADDRESS_MUX_DISABLE);
SRAMx.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM; SRAMx.Init.MemoryType = FMC_OR_FSMC(MEMORY_TYPE_SRAM);
SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FSMC_8BIT, FSMC_NORSRAM_MEM_BUS_WIDTH_8, FSMC_NORSRAM_MEM_BUS_WIDTH_16); #ifdef STM32F446xx
SRAMx.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE; SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FMC_8BIT, FMC_NORSRAM_MEM_BUS_WIDTH_8, FMC_NORSRAM_MEM_BUS_WIDTH_16);
SRAMx.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW; #else
SRAMx.Init.WrapMode = FSMC_WRAP_MODE_DISABLE; SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FSMC_8BIT, FSMC_NORSRAM_MEM_BUS_WIDTH_8, FSMC_NORSRAM_MEM_BUS_WIDTH_16);
SRAMx.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS;
SRAMx.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE;
SRAMx.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE;
SRAMx.Init.ExtendedMode = FSMC_EXTENDED_MODE_ENABLE;
SRAMx.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE;
SRAMx.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
#ifdef STM32F4xx
SRAMx.Init.PageSize = FSMC_PAGE_SIZE_NONE;
#endif #endif
SRAMx.Init.BurstAccessMode = FMC_OR_FSMC(BURST_ACCESS_MODE_DISABLE);
SRAMx.Init.WaitSignalPolarity = FMC_OR_FSMC(WAIT_SIGNAL_POLARITY_LOW);
SRAMx.Init.WrapMode = FMC_OR_FSMC(WRAP_MODE_DISABLE);
SRAMx.Init.WaitSignalActive = FMC_OR_FSMC(WAIT_TIMING_BEFORE_WS);
SRAMx.Init.WriteOperation = FMC_OR_FSMC(WRITE_OPERATION_ENABLE);
SRAMx.Init.WaitSignal = FMC_OR_FSMC(WAIT_SIGNAL_DISABLE);
SRAMx.Init.ExtendedMode = FMC_OR_FSMC(EXTENDED_MODE_ENABLE);
SRAMx.Init.AsynchronousWait = FMC_OR_FSMC(ASYNCHRONOUS_WAIT_DISABLE);
SRAMx.Init.WriteBurst = FMC_OR_FSMC(WRITE_BURST_DISABLE);
#if defined(STM32F446xx) || defined(STM32F4xx)
SRAMx.Init.PageSize = FMC_OR_FSMC(PAGE_SIZE_NONE);
#endif
// Read Timing - relatively slow to ensure ID information is correctly read from TFT controller // Read Timing - relatively slow to ensure ID information is correctly read from TFT controller
// Can be decreases from 15-15-24 to 4-4-8 with risk of stability loss // Can be decreased from 15-15-24 to 4-4-8 with risk of stability loss
timing.AddressSetupTime = 15; timing.AddressSetupTime = 15;
timing.AddressHoldTime = 15; timing.AddressHoldTime = 15;
timing.DataSetupTime = 24; timing.DataSetupTime = 24;
timing.BusTurnAroundDuration = 0; timing.BusTurnAroundDuration = 0;
timing.CLKDivision = 16; timing.CLKDivision = 16;
timing.DataLatency = 17; timing.DataLatency = 17;
timing.AccessMode = FSMC_ACCESS_MODE_A; timing.AccessMode = FMC_OR_FSMC(ACCESS_MODE_A);
// Write Timing // Write Timing
// Can be decreased from 8-15-8 to 0-0-1 with risk of stability loss // Can be decreased from 8-15-8 to 0-0-1 with risk of stability loss
extTiming.AddressSetupTime = 8; extTiming.AddressSetupTime = 8;
extTiming.AddressHoldTime = 15; extTiming.AddressHoldTime = 15;
extTiming.DataSetupTime = 8; extTiming.DataSetupTime = 8;
extTiming.BusTurnAroundDuration = 0; extTiming.BusTurnAroundDuration = 0;
extTiming.CLKDivision = 16; extTiming.CLKDivision = 16;
extTiming.DataLatency = 17; extTiming.DataLatency = 17;
extTiming.AccessMode = FSMC_ACCESS_MODE_A; extTiming.AccessMode = FMC_OR_FSMC(ACCESS_MODE_A);
__HAL_RCC_FSMC_CLK_ENABLE(); #ifdef STM32F446xx
__HAL_RCC_FMC_CLK_ENABLE();
#else
__HAL_RCC_FSMC_CLK_ENABLE();
#endif
for (uint16_t i = 0; pinMap_FSMC[i].pin != NC; i++) for (uint16_t i = 0; pinMap_FSMC[i].pin != NC; i++)
pinmap_pinout(pinMap_FSMC[i].pin, pinMap_FSMC); pinmap_pinout(pinMap_FSMC[i].pin, pinMap_FSMC);
@@ -90,9 +101,9 @@ void TFT_FSMC::init() {
controllerAddress = FSMC_BANK1_1; controllerAddress = FSMC_BANK1_1;
#ifdef PF0 #ifdef PF0
switch (nsBank) { switch (nsBank) {
case FSMC_NORSRAM_BANK2: controllerAddress = FSMC_BANK1_2 ; break; case FMC_OR_FSMC(NORSRAM_BANK2): controllerAddress = FSMC_BANK1_2; break;
case FSMC_NORSRAM_BANK3: controllerAddress = FSMC_BANK1_3 ; break; case FMC_OR_FSMC(NORSRAM_BANK3): controllerAddress = FSMC_BANK1_3; break;
case FSMC_NORSRAM_BANK4: controllerAddress = FSMC_BANK1_4 ; break; case FMC_OR_FSMC(NORSRAM_BANK4): controllerAddress = FSMC_BANK1_4; break;
} }
#endif #endif
@@ -100,49 +111,44 @@ void TFT_FSMC::init() {
HAL_SRAM_Init(&SRAMx, &timing, &extTiming); HAL_SRAM_Init(&SRAMx, &timing, &extTiming);
__HAL_RCC_DMA2_CLK_ENABLE();
#ifdef STM32F1xx #ifdef STM32F1xx
__HAL_RCC_DMA1_CLK_ENABLE(); DMAtx.Instance = DMA2_Channel1;
DMAtx.Instance = DMA1_Channel1;
#elif defined(STM32F4xx) #elif defined(STM32F4xx)
__HAL_RCC_DMA2_CLK_ENABLE(); DMAtx.Instance = DMA2_Stream0;
DMAtx.Instance = DMA2_Stream0; DMAtx.Init.Channel = DMA_CHANNEL_0;
DMAtx.Init.Channel = DMA_CHANNEL_0; DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE;
DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; DMAtx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
DMAtx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; DMAtx.Init.MemBurst = DMA_MBURST_SINGLE;
DMAtx.Init.MemBurst = DMA_MBURST_SINGLE; DMAtx.Init.PeriphBurst = DMA_PBURST_SINGLE;
DMAtx.Init.PeriphBurst = DMA_PBURST_SINGLE;
#endif #endif
DMAtx.Init.Direction = DMA_MEMORY_TO_MEMORY; DMAtx.Init.Direction = DMA_MEMORY_TO_MEMORY;
DMAtx.Init.MemInc = DMA_MINC_DISABLE; DMAtx.Init.MemInc = DMA_MINC_DISABLE;
DMAtx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; DMAtx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
DMAtx.Init.Mode = DMA_NORMAL; DMAtx.Init.Mode = DMA_NORMAL;
DMAtx.Init.Priority = DMA_PRIORITY_HIGH; DMAtx.Init.Priority = DMA_PRIORITY_HIGH;
LCD = (LCD_CONTROLLER_TypeDef *)controllerAddress; LCD = (LCD_CONTROLLER_TypeDef *)controllerAddress;
} }
uint32_t TFT_FSMC::getID() { uint32_t TFT_FSMC::getID() {
uint32_t id;
writeReg(0); writeReg(0);
id = LCD->RAM; uint32_t id = LCD->RAM;
if (id == 0) id = readID(LCD_READ_ID);
if (id == 0) if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) id = readID(LCD_READ_ID4);
id = readID(LCD_READ_ID);
if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF)
id = readID(LCD_READ_ID4);
return id; return id;
} }
uint32_t TFT_FSMC::readID(const tft_data_t inReg) { uint32_t TFT_FSMC::readID(tft_data_t inReg) {
uint32_t id;
writeReg(inReg); writeReg(inReg);
id = LCD->RAM; // dummy read uint32_t id = LCD->RAM; // dummy read
id = inReg << 24; id = inReg << 24;
id |= (LCD->RAM & 0x00FF) << 16; id |= (LCD->RAM & 0x00FF) << 16;
id |= (LCD->RAM & 0x00FF) << 8; id |= (LCD->RAM & 0x00FF) << 8;
id |= LCD->RAM & 0x00FF; id |= (LCD->RAM & 0x00FF);
return id; return id;
} }
@@ -155,7 +161,9 @@ bool TFT_FSMC::isBusy() {
#define __IS_DMA_CONFIGURED(__HANDLE__) ((__HANDLE__)->Instance->PAR != 0) #define __IS_DMA_CONFIGURED(__HANDLE__) ((__HANDLE__)->Instance->PAR != 0)
#endif #endif
if (!__IS_DMA_CONFIGURED(&DMAtx)) return false; #ifdef __IS_DMA_CONFIGURED
if (!__IS_DMA_CONFIGURED(&DMAtx)) return false;
#endif
// Check if DMA transfer error or transfer complete flags are set // Check if DMA transfer error or transfer complete flags are set
if ((__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) == 0) && (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) == 0)) return true; if ((__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) == 0) && (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) == 0)) return true;
@@ -174,8 +182,6 @@ void TFT_FSMC::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t cou
DMAtx.Init.PeriphInc = memoryIncrease; DMAtx.Init.PeriphInc = memoryIncrease;
HAL_DMA_Init(&DMAtx); HAL_DMA_Init(&DMAtx);
HAL_DMA_Start(&DMAtx, (uint32_t)data, (uint32_t)&(LCD->RAM), count); HAL_DMA_Start(&DMAtx, (uint32_t)data, (uint32_t)&(LCD->RAM), count);
TERN_(TFT_SHARED_IO, while (isBusy()));
} }
void TFT_FSMC::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) { void TFT_FSMC::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) {
+35 -29
View File
@@ -28,11 +28,7 @@
#elif defined(STM32F4xx) #elif defined(STM32F4xx)
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"
#else #else
#error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware." #error "FSMC/FMC TFT is currently only supported on STM32F1 and STM32F4 hardware."
#endif
#ifndef HAL_SRAM_MODULE_ENABLED
#error "SRAM module disabled for the STM32 framework (HAL_SRAM_MODULE_ENABLED)! Please consult the development team."
#endif #endif
#ifndef LCD_READ_ID #ifndef LCD_READ_ID
@@ -55,6 +51,12 @@ typedef struct {
__IO tft_data_t RAM; __IO tft_data_t RAM;
} LCD_CONTROLLER_TypeDef; } LCD_CONTROLLER_TypeDef;
#ifdef STM32F446xx
#define FMC_OR_FSMC(N) _CAT(FMC_, N)
#else
#define FMC_OR_FSMC(N) _CAT(FSMC_, N)
#endif
class TFT_FSMC { class TFT_FSMC {
private: private:
static SRAM_HandleTypeDef SRAMx; static SRAM_HandleTypeDef SRAMx;
@@ -62,7 +64,7 @@ class TFT_FSMC {
static LCD_CONTROLLER_TypeDef *LCD; static LCD_CONTROLLER_TypeDef *LCD;
static uint32_t readID(const tft_data_t reg); static uint32_t readID(tft_data_t inReg);
static void transmit(tft_data_t data) { LCD->RAM = data; __DSB(); } static void transmit(tft_data_t data) { LCD->RAM = data; __DSB(); }
static void transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count); static void transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count);
static void transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t count); static void transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t count);
@@ -94,7 +96,11 @@ class TFT_FSMC {
#ifdef STM32F1xx #ifdef STM32F1xx
#define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE) #define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE)
#elif defined(STM32F4xx) #elif defined(STM32F4xx)
#define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FSMC) #ifdef STM32F446xx
#define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FMC)
#else
#define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FSMC)
#endif
#define FSMC_BANK1_1 0x60000000U #define FSMC_BANK1_1 0x60000000U
#define FSMC_BANK1_2 0x64000000U #define FSMC_BANK1_2 0x64000000U
#define FSMC_BANK1_3 0x68000000U #define FSMC_BANK1_3 0x68000000U
@@ -104,35 +110,35 @@ class TFT_FSMC {
#endif #endif
const PinMap pinMap_FSMC[] = { const PinMap pinMap_FSMC[] = {
{PD_14, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D00 {PD_14, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D00
{PD_15, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D01 {PD_15, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D01
{PD_0, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D02 {PD_0, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D02
{PD_1, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D03 {PD_1, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D03
{PE_7, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D04 {PE_7, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D04
{PE_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D05 {PE_8, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D05
{PE_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D06 {PE_9, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D06
{PE_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D07 {PE_10, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D07
#if DISABLED(TFT_INTERFACE_FSMC_8BIT) #if DISABLED(TFT_INTERFACE_FSMC_8BIT)
{PE_11, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D08 {PE_11, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D08
{PE_12, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D09 {PE_12, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D09
{PE_13, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D10 {PE_13, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D10
{PE_14, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D11 {PE_14, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D11
{PE_15, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D12 {PE_15, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D12
{PD_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D13 {PD_8, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D13
{PD_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D14 {PD_9, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D14
{PD_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D15 {PD_10, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D15
#endif #endif
{PD_4, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_NOE {PD_4, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_NOE
{PD_5, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_NWE {PD_5, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_NWE
{NC, NP, 0} {NC, NP, 0}
}; };
const PinMap pinMap_FSMC_CS[] = { const PinMap pinMap_FSMC_CS[] = {
{PD_7, (void *)FSMC_NORSRAM_BANK1, FSMC_PIN_DATA}, // FSMC_NE1 {PD_7, (void *)FMC_OR_FSMC(NORSRAM_BANK1), FSMC_PIN_DATA}, // FSMC_NE1
#ifdef PF0 #ifdef PF0
{PG_9, (void *)FSMC_NORSRAM_BANK2, FSMC_PIN_DATA}, // FSMC_NE2 {PG_9, (void *)FMC_OR_FSMC(NORSRAM_BANK2), FSMC_PIN_DATA}, // FSMC_NE2
{PG_10, (void *)FSMC_NORSRAM_BANK3, FSMC_PIN_DATA}, // FSMC_NE3 {PG_10, (void *)FMC_OR_FSMC(NORSRAM_BANK3), FSMC_PIN_DATA}, // FSMC_NE3
{PG_12, (void *)FSMC_NORSRAM_BANK4, FSMC_PIN_DATA}, // FSMC_NE4 {PG_12, (void *)FMC_OR_FSMC(NORSRAM_BANK4), FSMC_PIN_DATA}, // FSMC_NE4
#endif #endif
{NC, NP, 0} {NC, NP, 0}
}; };
+8 -4
View File
@@ -77,8 +77,6 @@
#include "lcd/e3v2/common/encoder.h" #include "lcd/e3v2/common/encoder.h"
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
#include "lcd/e3v2/creality/dwin.h" #include "lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "lcd/e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "lcd/e3v2/jyersui/dwin.h" #include "lcd/e3v2/jyersui/dwin.h"
#endif #endif
@@ -671,6 +669,12 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check()); TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check());
#if ANY(PSU_CONTROL, AUTO_POWER_CONTROL) && PIN_EXISTS(PS_ON_EDM)
if ( ELAPSED(ms, powerManager.last_state_change_ms + PS_EDM_RESPONSE)
&& (READ(PS_ON_PIN) != READ(PS_ON_EDM_PIN) || TERN0(PSU_OFF_REDUNDANT, extDigitalRead(PS_ON1_PIN) != extDigitalRead(PS_ON1_EDM_PIN)))
) kill(GET_TEXT_F(MSG_POWER_EDM_FAULT));
#endif
#if ENABLED(EXTRUDER_RUNOUT_PREVENT) #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
if (thermalManager.degHotend(active_extruder) > (EXTRUDER_RUNOUT_MINTEMP) if (thermalManager.degHotend(active_extruder) > (EXTRUDER_RUNOUT_MINTEMP)
&& ELAPSED(ms, gcode.previous_move_ms + SEC_TO_MS(EXTRUDER_RUNOUT_SECONDS)) && ELAPSED(ms, gcode.previous_move_ms + SEC_TO_MS(EXTRUDER_RUNOUT_SECONDS))
@@ -1588,11 +1592,11 @@ void setup() {
SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n"); SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n");
#endif #endif
#if HAS_DWIN_E3V2_BASIC #if ENABLED(DWIN_CREALITY_LCD)
SETUP_RUN(dwinInitScreen()); SETUP_RUN(dwinInitScreen());
#endif #endif
#if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)
SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status
#endif #endif
+1 -1
View File
@@ -459,7 +459,7 @@
#define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG) #define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG) #define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE) #define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 5245 // TRONXY V10 (STM32F446ZE) #define BOARD_TRONXY_CXY_446_V10 5245 // TRONXY CXY-446-V10-220413/CXY-V6-191121 (STM32F446ZE)
#define BOARD_CREALITY_F401RE 5246 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1 #define BOARD_CREALITY_F401RE 5246 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
#define BOARD_BLACKPILL_CUSTOM 5247 // Custom board based on STM32F401CDU6. #define BOARD_BLACKPILL_CUSTOM 5247 // Custom board based on STM32F401CDU6.
#define BOARD_I3DBEEZ9_V1 5248 // I3DBEEZ9 V1 (STM32F407ZG) #define BOARD_I3DBEEZ9_V1 5248 // I3DBEEZ9 V1 (STM32F407ZG)
+9 -13
View File
@@ -41,8 +41,6 @@
#define _TMC2208_STANDALONE 0x2208B #define _TMC2208_STANDALONE 0x2208B
#define _TMC2209 0x2209A #define _TMC2209 0x2209A
#define _TMC2209_STANDALONE 0x2209B #define _TMC2209_STANDALONE 0x2209B
#define _TMC26X 0x2600A
#define _TMC26X_STANDALONE 0x2600B
#define _TMC2660 0x2660A #define _TMC2660 0x2660A
#define _TMC2660_STANDALONE 0x2660B #define _TMC2660_STANDALONE 0x2660B
#define _TMC5130 0x5130A #define _TMC5130 0x5130A
@@ -107,8 +105,8 @@
#if ( HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2160_STANDALONE) \ #if ( HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2160_STANDALONE) \
|| HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC2209_STANDALONE) \ || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC2209_STANDALONE) \
|| HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \ || HAS_DRIVER(TMC2660_STANDALONE) || HAS_DRIVER(TMC5130_STANDALONE) \
|| HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) ) || HAS_DRIVER(TMC5160_STANDALONE) )
#define HAS_TRINAMIC_STANDALONE 1 #define HAS_TRINAMIC_STANDALONE 1
#endif #endif
@@ -125,13 +123,13 @@
|| AXIS_DRIVER_TYPE(A,TMC2660) \ || AXIS_DRIVER_TYPE(A,TMC2660) \
|| AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) ) || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) )
#define AXIS_IS_TMC_CONFIG(A) ( AXIS_IS_TMC(A) || AXIS_DRIVER_TYPE(A,TMC26X) ) #define AXIS_IS_TMC_CONFIG AXIS_IS_TMC
// Test for a driver that uses SPI - this allows checking whether a _CS_ pin // Test for a driver that uses SPI - this allows checking whether a _CS_ pin
// is considered sensitive // is considered sensitive
#define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \ #define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \
|| AXIS_DRIVER_TYPE(A,TMC26X) || AXIS_DRIVER_TYPE(A,TMC2660) \ || AXIS_DRIVER_TYPE(A,TMC2660) || AXIS_DRIVER_TYPE(A,TMC5130) \
|| AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) ) || AXIS_DRIVER_TYPE(A,TMC5160) )
#define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) ) #define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) )
@@ -184,10 +182,8 @@
#if ANY_AXIS_HAS(SPI) #if ANY_AXIS_HAS(SPI)
#define HAS_TMC_SPI 1 #define HAS_TMC_SPI 1
#endif #endif
#if HAS_STALLGUARD || HAS_DRIVER(TMC2160_STANDALONE) || HAS_DRIVER(TMC2130_STANDALONE) \
// || HAS_DRIVER(TMC2209_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \
// TMC26XX Stepper Drivers || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE)
// #define HAS_DIAG_PINS 1
#if HAS_DRIVER(TMC26X)
#define HAS_TMC26X 1
#endif #endif
+3 -3
View File
@@ -449,7 +449,7 @@ struct XYval {
// Length reduced to one dimension // Length reduced to one dimension
FI constexpr T magnitude() const { return (T)sqrtf(x*x + y*y); } FI constexpr T magnitude() const { return (T)sqrtf(x*x + y*y); }
// Pointer to the data as a simple array // Pointer to the data as a simple array
FI operator T* () { return pos; } explicit FI operator T* () { return pos; }
// If any element is true then it's true // If any element is true then it's true
FI constexpr operator bool() const { return x || y; } FI constexpr operator bool() const { return x || y; }
// Smallest element // Smallest element
@@ -599,7 +599,7 @@ struct XYZval {
// Length reduced to one dimension // Length reduced to one dimension
FI constexpr T magnitude() const { return (T)TERN(HAS_X_AXIS, sqrtf(NUM_AXIS_GANG(x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)), 0); } FI constexpr T magnitude() const { return (T)TERN(HAS_X_AXIS, sqrtf(NUM_AXIS_GANG(x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)), 0); }
// Pointer to the data as a simple array // Pointer to the data as a simple array
FI operator T* () { return pos; } explicit FI operator T* () { return pos; }
// If any element is true then it's true // If any element is true then it's true
FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); } FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element // Smallest element
@@ -747,7 +747,7 @@ struct XYZEval {
// Length reduced to one dimension // Length reduced to one dimension
FI constexpr T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); } FI constexpr T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); }
// Pointer to the data as a simple array // Pointer to the data as a simple array
FI operator T* () { return pos; } explicit FI operator T* () { return pos; }
// If any element is true then it's true // If any element is true then it's true
FI constexpr operator bool() const { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); } FI constexpr operator bool() const { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element // Smallest element
+3 -9
View File
@@ -25,10 +25,6 @@
#include "../MarlinCore.h" #include "../MarlinCore.h"
#include "../module/temperature.h" #include "../module/temperature.h"
#if ENABLED(MARLIN_DEV_MODE)
MarlinError marlin_error_number; // Error Number - Marlin can beep X times periodically, display, and emit...
#endif
void safe_delay(millis_t ms) { void safe_delay(millis_t ms) {
while (ms > 50) { while (ms > 50) {
ms -= 50; ms -= 50;
@@ -80,8 +76,6 @@ void safe_delay(millis_t ms) {
TERN_(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY") TERN_(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY")
TERN_(SOLENOID_PROBE, "SOLENOID_PROBE") TERN_(SOLENOID_PROBE, "SOLENOID_PROBE")
TERN_(MAGLEV4, "MAGLEV4") TERN_(MAGLEV4, "MAGLEV4")
TERN_(BIQU_MICROPROBE_V1, "BIQU_MICROPROBE_V1")
TERN_(BIQU_MICROPROBE_V2, "BIQU_MICROPROBE_V2")
IF_DISABLED(PROBE_SELECTED, "NONE") IF_DISABLED(PROBE_SELECTED, "NONE")
); );
@@ -101,9 +95,9 @@ void safe_delay(millis_t ms) {
SERIAL_ECHOPGM(" (Aligned With"); SERIAL_ECHOPGM(" (Aligned With");
if (probe.offset_xy.y > 0) if (probe.offset_xy.y > 0)
SERIAL_ECHO(F(TERN(IS_SCARA, "-Distal", "-Back"))); SERIAL_ECHOPGM(TERN(IS_SCARA, "-Distal", "-Back"));
else if (probe.offset_xy.y < 0) else if (probe.offset_xy.y < 0)
SERIAL_ECHO(F(TERN(IS_SCARA, "-Proximal", "-Front"))); SERIAL_ECHOPGM(TERN(IS_SCARA, "-Proximal", "-Front"));
else if (probe.offset_xy.x != 0) else if (probe.offset_xy.x != 0)
SERIAL_ECHOPGM("-Center"); SERIAL_ECHOPGM("-Center");
@@ -111,7 +105,7 @@ void safe_delay(millis_t ms) {
#endif #endif
SERIAL_ECHO(probe.offset.z < 0 ? F("Below") : probe.offset.z > 0 ? F("Above") : F("Same Z as")); SERIAL_ECHOF(probe.offset.z < 0 ? F("Below") : probe.offset.z > 0 ? F("Above") : F("Same Z as"));
SERIAL_ECHOLNPGM(" Nozzle)"); SERIAL_ECHOLNPGM(" Nozzle)");
#endif #endif
@@ -63,7 +63,7 @@
*/ */
void mesh_bed_leveling::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) { void mesh_bed_leveling::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
// Get current and destination cells for this line // Get current and destination cells for this line
xy_int8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination); xy_uint8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination);
NOMORE(scel.x, GRID_MAX_CELLS_X - 1); NOMORE(scel.x, GRID_MAX_CELLS_X - 1);
NOMORE(scel.y, GRID_MAX_CELLS_Y - 1); NOMORE(scel.y, GRID_MAX_CELLS_Y - 1);
NOMORE(ecel.x, GRID_MAX_CELLS_X - 1); NOMORE(ecel.x, GRID_MAX_CELLS_X - 1);
@@ -80,7 +80,7 @@
float normalized_dist; float normalized_dist;
xyze_pos_t dest; xyze_pos_t dest;
const int8_t gcx = _MAX(scel.x, ecel.x), gcy = _MAX(scel.y, ecel.y); const uint8_t gcx = _MAX(scel.x, ecel.x), gcy = _MAX(scel.y, ecel.y);
// Crosses on the X and not already split on this X? // Crosses on the X and not already split on this X?
// The x_splits flags are insurance against rounding errors. // The x_splits flags are insurance against rounding errors.
+1 -1
View File
@@ -95,7 +95,7 @@ public:
static void report_current_mesh(); static void report_current_mesh();
static void report_state(); static void report_state();
static void save_ubl_active_state_and_disable(); static void save_ubl_active_state_and_disable();
static void restore_ubl_active_state_and_leave(); static void restore_ubl_active_state(const bool is_done=true);
static void display_map(const uint8_t) __O0; static void display_map(const uint8_t) __O0;
static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0; static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0;
static mesh_index_pair find_furthest_invalid_mesh_point() __O0; static mesh_index_pair find_furthest_invalid_mesh_point() __O0;
+14 -19
View File
@@ -309,7 +309,7 @@ void unified_bed_leveling::G29() {
#if ALL(DWIN_LCD_PROUI, ZHOME_BEFORE_LEVELING) #if ALL(DWIN_LCD_PROUI, ZHOME_BEFORE_LEVELING)
save_ubl_active_state_and_disable(); save_ubl_active_state_and_disable();
gcode.process_subcommands_now(F("G28Z")); gcode.process_subcommands_now(F("G28Z"));
restore_ubl_active_state_and_leave(); restore_ubl_active_state(false); // ...without telling ExtUI "done"
#else #else
// Send 'N' to force homing before G29 (internal only) // Send 'N' to force homing before G29 (internal only)
if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes(); if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes();
@@ -425,7 +425,7 @@ void unified_bed_leveling::G29() {
if (parser.seen_test('J')) { if (parser.seen_test('J')) {
save_ubl_active_state_and_disable(); save_ubl_active_state_and_disable();
tilt_mesh_based_on_probed_grid(param.J_grid_size == 0); // Zero size does 3-Point tilt_mesh_based_on_probed_grid(param.J_grid_size == 0); // Zero size does 3-Point
restore_ubl_active_state_and_leave(); restore_ubl_active_state();
#if ENABLED(UBL_G29_J_RECENTER) #if ENABLED(UBL_G29_J_RECENTER)
do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y))); do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y)));
#endif #endif
@@ -754,7 +754,6 @@ void unified_bed_leveling::shift_mesh_height() {
TERN_(HAS_MARLINUI_MENU, ui.capture()); TERN_(HAS_MARLINUI_MENU, ui.capture());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
grid_count_t count = GRID_MAX_POINTS; grid_count_t count = GRID_MAX_POINTS;
@@ -768,7 +767,6 @@ void unified_bed_leveling::shift_mesh_height() {
SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, "."); SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS))); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout()); TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout());
TERN_(DWIN_LCD_PROUI, dwinRedrawScreen());
#if HAS_MARLINUI_MENU #if HAS_MARLINUI_MENU
if (ui.button_pressed()) { if (ui.button_pressed()) {
@@ -778,8 +776,7 @@ void unified_bed_leveling::shift_mesh_height() {
ui.quick_feedback(); ui.quick_feedback();
ui.release(); ui.release();
probe.stow(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW probe.stow(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); return restore_ubl_active_state();
return restore_ubl_active_state_and_leave();
} }
#endif #endif
@@ -815,15 +812,12 @@ void unified_bed_leveling::shift_mesh_height() {
probe.move_z_after_probing(); probe.move_z_after_probing();
restore_ubl_active_state_and_leave();
do_blocking_move_to_xy( do_blocking_move_to_xy(
constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X),
constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y)
); );
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); restore_ubl_active_state();
TERN_(DWIN_LCD_PROUI, dwinLevelingDone());
} }
#endif // HAS_BED_PROBE #endif // HAS_BED_PROBE
@@ -932,7 +926,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
if (param.V_verbosity > 1) if (param.V_verbosity > 1)
SERIAL_ECHOLNPGM("Business Card is ", p_float_t(thickness, 4), "mm thick."); SERIAL_ECHOLNPGM("Business Card is ", p_float_t(thickness, 4), "mm thick.");
restore_ubl_active_state_and_leave(); restore_ubl_active_state();
return thickness; return thickness;
} }
@@ -987,7 +981,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
if (_click_and_hold([]{ if (_click_and_hold([]{
SERIAL_ECHOLNPGM("\nMesh only partially populated."); SERIAL_ECHOLNPGM("\nMesh only partially populated.");
do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE);
})) return restore_ubl_active_state_and_leave(); })) return restore_ubl_active_state();
// Store the Z position minus the shim height // Store the Z position minus the shim height
z_values[lpos.x][lpos.y] = current_position.z - thick; z_values[lpos.x][lpos.y] = current_position.z - thick;
@@ -1002,10 +996,8 @@ void set_message_with_feedback(FSTR_P const fstr) {
if (do_ubl_mesh_map) display_map(param.T_map_type); // show user where we're probing if (do_ubl_mesh_map) display_map(param.T_map_type); // show user where we're probing
restore_ubl_active_state_and_leave(); restore_ubl_active_state();
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE); do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE);
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
} }
/** /**
@@ -1111,7 +1103,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
} while (lpos.x >= 0 && --param.R_repetition > 0); } while (lpos.x >= 0 && --param.R_repetition > 0);
if (do_ubl_mesh_map) display_map(param.T_map_type); if (do_ubl_mesh_map) display_map(param.T_map_type);
restore_ubl_active_state_and_leave(); restore_ubl_active_state();
do_blocking_move_to_xy_z(pos, Z_TWEEN_SAFE_CLEARANCE); do_blocking_move_to_xy_z(pos, Z_TWEEN_SAFE_CLEARANCE);
@@ -1263,17 +1255,20 @@ void unified_bed_leveling::save_ubl_active_state_and_disable() {
set_bed_leveling_enabled(false); set_bed_leveling_enabled(false);
} }
void unified_bed_leveling::restore_ubl_active_state_and_leave() { void unified_bed_leveling::restore_ubl_active_state(const bool is_done/*=true*/) {
TERN_(HAS_MARLINUI_MENU, ui.release()); TERN_(HAS_MARLINUI_MENU, ui.release());
#if ENABLED(UBL_DEVEL_DEBUGGING) #if ENABLED(UBL_DEVEL_DEBUGGING)
if (--ubl_state_recursion_chk) { if (--ubl_state_recursion_chk) {
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); SERIAL_ECHOLNPGM("restore_ubl_active_state() called too many times.");
set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR)); set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR));
return; return;
} }
#endif #endif
set_bed_leveling_enabled(ubl_state_at_invocation); set_bed_leveling_enabled(ubl_state_at_invocation);
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
if (is_done) {
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
}
} }
mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() {
+6
View File
@@ -212,6 +212,8 @@ void FWRetract::M207() {
} }
void FWRetract::M207_report() { void FWRetract::M207_report() {
TERN_(MARLIN_SMALL_BUILD, return);
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length) PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length)
, PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length) , PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length)
@@ -237,6 +239,8 @@ void FWRetract::M208() {
} }
void FWRetract::M208_report() { void FWRetract::M208_report() {
TERN_(MARLIN_SMALL_BUILD, return);
SERIAL_ECHOLNPGM( SERIAL_ECHOLNPGM(
" M208 S", LINEAR_UNIT(settings.retract_recover_extra) " M208 S", LINEAR_UNIT(settings.retract_recover_extra)
, " W", LINEAR_UNIT(settings.swap_retract_recover_extra) , " W", LINEAR_UNIT(settings.swap_retract_recover_extra)
@@ -258,6 +262,8 @@ void FWRetract::M208_report() {
} }
void FWRetract::M209_report() { void FWRetract::M209_report() {
TERN_(MARLIN_SMALL_BUILD, return);
SERIAL_ECHOLNPGM(" M209 S", AS_DIGIT(autoretract_enabled)); SERIAL_ECHOLNPGM(" M209 S", AS_DIGIT(autoretract_enabled));
} }
+3 -3
View File
@@ -186,18 +186,18 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
switch (response) { switch (response) {
case 0: // "Purge More" button case 0: // "Purge More" button
#if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE) #if ENABLED(M600_PURGE_MORE_RESUMABLE)
pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more) pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more)
#endif #endif
break; break;
case 1: // "Continue" / "Disable Runout" button case 1: // "Continue" / "Disable Runout" button
#if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE) #if ENABLED(M600_PURGE_MORE_RESUMABLE)
pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection
#endif #endif
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
if (runout.filament_ran_out) { // Disable a triggered sensor if (runout.filament_ran_out) { // Disable a triggered sensor
runout.enabled = false; runout.enabled[active_extruder] = false;
runout.reset(); runout.reset();
} }
#endif #endif
+3 -1
View File
@@ -32,7 +32,9 @@ typedef struct {
timeout = HOTEND_IDLE_TIMEOUT_SEC; timeout = HOTEND_IDLE_TIMEOUT_SEC;
trigger = HOTEND_IDLE_MIN_TRIGGER; trigger = HOTEND_IDLE_MIN_TRIGGER;
nozzle_target = HOTEND_IDLE_NOZZLE_TARGET; nozzle_target = HOTEND_IDLE_NOZZLE_TARGET;
bed_target = HOTEND_IDLE_BED_TARGET; #if HAS_HEATED_BED
bed_target = HOTEND_IDLE_BED_TARGET;
#endif
} }
} hotend_idle_settings_t; } hotend_idle_settings_t;
+1 -1
View File
@@ -56,7 +56,7 @@ public:
#if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER #if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER
static void onHeatingDone() { leds.set_white(); } static void onHeatingDone() { leds.set_white(); }
static void onPidTuningDone(LEDColor c) { leds.set_color(c); } static void onPIDTuningDone(LEDColor c) { leds.set_color(c); }
#endif #endif
#if HAS_MEDIA #if HAS_MEDIA
+43 -5
View File
@@ -72,6 +72,26 @@
uint16_t CodeProfiler::call_count = 0; uint16_t CodeProfiler::call_count = 0;
#endif #endif
#if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF;
#else
#ifdef MAX7219_DEBUG_PLANNER_HEAD
static int16_t last_head_cnt = 0x1;
#endif
#ifdef MAX7219_DEBUG_PLANNER_TAIL
static int16_t last_tail_cnt = 0x1;
#endif
#endif
#ifdef MAX7219_DEBUG_PLANNER_QUEUE
static int16_t last_depth = 0;
#endif
#ifdef MAX7219_DEBUG_PROFILE
static uint8_t last_time_fraction = 0;
#endif
#ifdef MAX7219_DEBUG_MULTISTEPPING
static uint8_t last_multistepping = 0;
#endif
Max7219 max7219; Max7219 max7219;
uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 };
@@ -550,6 +570,29 @@ void Max7219::init() {
#if MAX7219_INIT_TEST #if MAX7219_INIT_TEST
start_test_pattern(); start_test_pattern();
#endif #endif
#ifdef MAX7219_REINIT_ON_POWERUP
#if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
last_head_cnt = 0xF;
last_tail_cnt = 0xF;
#else
#ifdef MAX7219_DEBUG_PLANNER_HEAD
last_head_cnt = 0x1;
#endif
#ifdef MAX7219_DEBUG_PLANNER_TAIL
last_tail_cnt = 0x1;
#endif
#endif
#ifdef MAX7219_DEBUG_PLANNER_QUEUE
last_depth = 0;
#endif
#ifdef MAX7219_DEBUG_PROFILE
last_time_fraction = 0;
#endif
#ifdef MAX7219_DEBUG_MULTISTEPPING
last_multistepping = 0;
#endif
#endif
} }
/** /**
@@ -676,8 +719,6 @@ void Max7219::idle_tasks() {
#if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF;
if (last_head_cnt != head || last_tail_cnt != tail) { if (last_head_cnt != head || last_tail_cnt != tail) {
range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head, &row_change_mask); range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head, &row_change_mask);
last_head_cnt = head; last_head_cnt = head;
@@ -687,7 +728,6 @@ void Max7219::idle_tasks() {
#else #else
#ifdef MAX7219_DEBUG_PLANNER_HEAD #ifdef MAX7219_DEBUG_PLANNER_HEAD
static int16_t last_head_cnt = 0x1;
if (last_head_cnt != head) { if (last_head_cnt != head) {
mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head, &row_change_mask); mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head, &row_change_mask);
last_head_cnt = head; last_head_cnt = head;
@@ -695,7 +735,6 @@ void Max7219::idle_tasks() {
#endif #endif
#ifdef MAX7219_DEBUG_PLANNER_TAIL #ifdef MAX7219_DEBUG_PLANNER_TAIL
static int16_t last_tail_cnt = 0x1;
if (last_tail_cnt != tail) { if (last_tail_cnt != tail) {
mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail, &row_change_mask); mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail, &row_change_mask);
last_tail_cnt = tail; last_tail_cnt = tail;
@@ -714,7 +753,6 @@ void Max7219::idle_tasks() {
#endif #endif
#ifdef MAX7219_DEBUG_PROFILE #ifdef MAX7219_DEBUG_PROFILE
static uint8_t last_time_fraction = 0;
const uint8_t current_time_fraction = (uint16_t(CodeProfiler::get_time_fraction()) * MAX7219_NUMBER_UNITS + 8) / 16; const uint8_t current_time_fraction = (uint16_t(CodeProfiler::get_time_fraction()) * MAX7219_NUMBER_UNITS + 8) / 16;
if (current_time_fraction != last_time_fraction) { if (current_time_fraction != last_time_fraction) {
quantity(MAX7219_DEBUG_PROFILE, last_time_fraction, current_time_fraction, &row_change_mask); quantity(MAX7219_DEBUG_PROFILE, last_time_fraction, current_time_fraction, &row_change_mask);
+97 -98
View File
@@ -76,7 +76,7 @@ MMU2 mmu2;
#define MMU2_NO_TOOL 99 #define MMU2_NO_TOOL 99
#define MMU_BAUD 115200 #define MMU_BAUD 115200
bool MMU2::_enabled, MMU2::ready; bool MMU2::_enabled, MMU2::ready, MMU2::mmu_print_saved;
#if HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2S
bool MMU2::mmu2s_triggered; bool MMU2::mmu2s_triggered;
#endif #endif
@@ -84,6 +84,7 @@ uint8_t MMU2::cmd, MMU2::cmd_arg, MMU2::last_cmd, MMU2::extruder;
int8_t MMU2::state = 0; int8_t MMU2::state = 0;
volatile int8_t MMU2::finda = 1; volatile int8_t MMU2::finda = 1;
volatile bool MMU2::finda_runout_valid; volatile bool MMU2::finda_runout_valid;
int16_t MMU2::version = -1, MMU2::buildnr = -1;
millis_t MMU2::prev_request, MMU2::prev_P0_request; millis_t MMU2::prev_request, MMU2::prev_P0_request;
char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE]; char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE];
@@ -92,11 +93,14 @@ struct E_Step {
feedRate_t feedRate; //!< feed rate in mm/s feedRate_t feedRate; //!< feed rate in mm/s
}; };
inline void unscaled_mmu2_e_move(const float &dist, const feedRate_t fr_mm_s, const bool sync=true) { static constexpr E_Step
current_position.e += dist / planner.e_factor[active_extruder]; ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE }
line_to_current_position(fr_mm_s); , load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE }
if (sync) planner.synchronize(); #if HAS_PRUSA_MMU2S
} , can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE }
, can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE }
#endif
;
MMU2::MMU2() { MMU2::MMU2() {
rx_buffer[0] = '\0'; rx_buffer[0] = '\0';
@@ -132,12 +136,12 @@ void MMU2::reset() {
#endif #endif
} }
int8_t MMU2::get_current_tool() { return extruder == MMU2_NO_TOOL ? -1 : extruder; } uint8_t MMU2::get_current_tool() {
return extruder == MMU2_NO_TOOL ? -1 : extruder;
}
#if ANY(HAS_PRUSA_MMU2S, MMU_EXTRUDER_SENSOR) #if EITHER(HAS_PRUSA_MMU2S, MMU_EXTRUDER_SENSOR)
#define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE) #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != runout.out_state())
#else
#define FILAMENT_PRESENT() true
#endif #endif
void mmu2_attn_buzz(const bool two=false) { void mmu2_attn_buzz(const bool two=false) {
@@ -145,7 +149,6 @@ void mmu2_attn_buzz(const bool two=false) {
if (two) { BUZZ(10, 0); BUZZ(200, 404); } if (two) { BUZZ(10, 0); BUZZ(200, 404); }
} }
// Avoiding sscanf significantly reduces build size
void MMU2::mmu_loop() { void MMU2::mmu_loop() {
switch (state) { switch (state) {
@@ -160,7 +163,7 @@ void MMU2::mmu_loop() {
MMU2_SEND("S1"); // Read Version MMU2_SEND("S1"); // Read Version
state = -2; state = -2;
} }
else if (ELAPSED(millis(), prev_request + 30000)) { // 30sec after reset disable MMU else if (millis() > 30000) { // 30sec after reset disable MMU
SERIAL_ECHOLNPGM("MMU not responding - DISABLED"); SERIAL_ECHOLNPGM("MMU not responding - DISABLED");
state = 0; state = 0;
} }
@@ -168,7 +171,7 @@ void MMU2::mmu_loop() {
case -2: case -2:
if (rx_ok()) { if (rx_ok()) {
const uint16_t version = uint16_t(strtoul(rx_buffer, nullptr, 10)); sscanf(rx_buffer, "%huok\n", &version);
DEBUG_ECHOLNPGM("MMU => ", version, "\nMMU <= 'S2'"); DEBUG_ECHOLNPGM("MMU => ", version, "\nMMU <= 'S2'");
MMU2_SEND("S2"); // Read Build Number MMU2_SEND("S2"); // Read Build Number
state = -3; state = -3;
@@ -177,15 +180,17 @@ void MMU2::mmu_loop() {
case -3: case -3:
if (rx_ok()) { if (rx_ok()) {
const uint16_t buildnr = uint16_t(strtoul(rx_buffer, nullptr, 10)); sscanf(rx_buffer, "%huok\n", &buildnr);
DEBUG_ECHOLNPGM("MMU => ", buildnr); DEBUG_ECHOLNPGM("MMU => ", buildnr);
check_version(buildnr); check_version();
#if ENABLED(MMU2_MODE_12V) #if ENABLED(MMU2_MODE_12V)
DEBUG_ECHOLNPGM("MMU <= 'M1'"); DEBUG_ECHOLNPGM("MMU <= 'M1'");
MMU2_SEND("M1"); // Stealth Mode MMU2_SEND("M1"); // Stealth Mode
state = -5; state = -5;
#else #else
DEBUG_ECHOLNPGM("MMU <= 'P0'"); DEBUG_ECHOLNPGM("MMU <= 'P0'");
MMU2_SEND("P0"); // Read FINDA MMU2_SEND("P0"); // Read FINDA
@@ -195,21 +200,20 @@ void MMU2::mmu_loop() {
break; break;
#if ENABLED(MMU2_MODE_12V) #if ENABLED(MMU2_MODE_12V)
case -5: case -5:
// response to M1 // response to M1
if (rx_ok()) { if (rx_ok()) {
DEBUG_ECHOLNPGM("MMU => ok"); DEBUG_ECHOLNPGM("MMU => ok");
DEBUG_ECHOLNPGM("MMU <= 'P0'"); DEBUG_ECHOLNPGM("MMU <= 'P0'");
MMU2_SEND("P0"); // Read FINDA MMU2_SEND("P0"); // Read FINDA
state = -4; state = -4;
} }
break; break;
#endif #endif
case -4: case -4:
if (rx_ok()) { if (rx_ok()) {
const uint8_t findex = uint8_t(rx_buffer[0] - '0'); sscanf(rx_buffer, "%hhuok\n", &finda);
if (findex <= 1) finda = findex;
DEBUG_ECHOLNPGM("MMU => ", finda, "\nMMU - ENABLED"); DEBUG_ECHOLNPGM("MMU => ", finda, "\nMMU - ENABLED");
@@ -282,11 +286,10 @@ void MMU2::mmu_loop() {
case 2: // response to command P0 case 2: // response to command P0
if (rx_ok()) { if (rx_ok()) {
const uint8_t findex = uint8_t(rx_buffer[0] - '0'); sscanf(rx_buffer, "%hhuok\n", &finda);
if (findex <= 1) finda = findex;
// This is super annoying. Only activate if necessary // This is super annoying. Only activate if necessary
//if (finda_runout_valid) DEBUG_ECHOLNPGM("MMU <= 'P0'\nMMU => ", p_float_t(finda, 6)); // if (finda_runout_valid) DEBUG_ECHOLNPAIR_F("MMU <= 'P0'\nMMU => ", finda, 6);
if (!finda && finda_runout_valid) filament_runout(); if (!finda && finda_runout_valid) filament_runout();
if (cmd == MMU_CMD_NONE) ready = true; if (cmd == MMU_CMD_NONE) ready = true;
@@ -403,7 +406,7 @@ void MMU2::tx_str(FSTR_P fstr) {
void MMU2::tx_printf(FSTR_P format, int argument = -1) { void MMU2::tx_printf(FSTR_P format, int argument = -1) {
clear_rx_buffer(); clear_rx_buffer();
const uint8_t len = sprintf_P(tx_buffer, FTOP(format), argument); const uint8_t len = sprintf_P(tx_buffer, FTOP(format), argument);
for (uint8_t i = 0; i < len; ++i) MMU2_SERIAL.write(tx_buffer[i]); LOOP_L_N(i, len) MMU2_SERIAL.write(tx_buffer[i]);
prev_request = millis(); prev_request = millis();
} }
@@ -413,7 +416,7 @@ void MMU2::tx_printf(FSTR_P format, int argument = -1) {
void MMU2::tx_printf(FSTR_P format, int argument1, int argument2) { void MMU2::tx_printf(FSTR_P format, int argument1, int argument2) {
clear_rx_buffer(); clear_rx_buffer();
const uint8_t len = sprintf_P(tx_buffer, FTOP(format), argument1, argument2); const uint8_t len = sprintf_P(tx_buffer, FTOP(format), argument1, argument2);
for (uint8_t i = 0; i < len; ++i) MMU2_SERIAL.write(tx_buffer[i]); LOOP_L_N(i, len) MMU2_SERIAL.write(tx_buffer[i]);
prev_request = millis(); prev_request = millis();
} }
@@ -439,7 +442,7 @@ bool MMU2::rx_ok() {
/** /**
* Check if MMU has compatible firmware * Check if MMU has compatible firmware
*/ */
void MMU2::check_version(const uint16_t buildnr) { void MMU2::check_version() {
if (buildnr < MMU_REQUIRED_FW_BUILDNR) { if (buildnr < MMU_REQUIRED_FW_BUILDNR) {
SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required."); SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required.");
kill(GET_TEXT_F(MSG_KILL_MMU2_FIRMWARE)); kill(GET_TEXT_F(MSG_KILL_MMU2_FIRMWARE));
@@ -455,19 +458,12 @@ static void mmu2_not_responding() {
BUZZ(100, 659); BUZZ(100, 659);
} }
inline void beep_bad_cmd() { BUZZ(400, 40); }
#if HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2S
/**
* Load filament until the sensor at the gears is triggered
* and give up after a number of attempts set with MMU2_C0_RETRY.
* Each try has a timeout before returning a fail state.
*/
bool MMU2::load_to_gears() { bool MMU2::load_to_gears() {
command(MMU_CMD_C0); command(MMU_CMD_C0);
manage_response(true, true); manage_response(true, true);
for (uint8_t i = 0; i < MMU2_C0_RETRY; ++i) { // Keep loading until filament reaches gears LOOP_L_N(i, MMU2_C0_RETRY) { // Keep loading until filament reaches gears
if (mmu2s_triggered) break; if (mmu2s_triggered) break;
command(MMU_CMD_C0); command(MMU_CMD_C0);
manage_response(true, true); manage_response(true, true);
@@ -488,11 +484,6 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
set_runout_valid(false); set_runout_valid(false);
if (index != extruder) { if (index != extruder) {
if (ENABLED(MMU_IR_UNLOAD_MOVE) && FILAMENT_PRESENT()) {
DEBUG_ECHOLNPGM("Unloading\n");
while (FILAMENT_PRESENT()) // Filament present? Keep unloading.
unscaled_mmu2_e_move(-0.25, MMM_TO_MMS(120)); // 0.25mm is a guessed value. Adjust to preference.
}
stepper.disable_extruder(); stepper.disable_extruder();
ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
@@ -529,9 +520,9 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
#if ENABLED(MMU2_MENUS) #if ENABLED(MMU2_MENUS)
const uint8_t index = mmu2_choose_filament(); const uint8_t index = mmu2_choose_filament();
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_to_nozzle(index); load_filament_to_nozzle(index);
#else #else
beep_bad_cmd(); ERR_BUZZ();
#endif #endif
} break; } break;
@@ -550,13 +541,13 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
active_extruder = 0; active_extruder = 0;
} }
#else #else
beep_bad_cmd(); ERR_BUZZ();
#endif #endif
} break; } break;
case 'c': { case 'c': {
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_to_nozzle_sequence(); load_to_nozzle();
} break; } break;
} }
@@ -617,9 +608,9 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
#if ENABLED(MMU2_MENUS) #if ENABLED(MMU2_MENUS)
uint8_t index = mmu2_choose_filament(); uint8_t index = mmu2_choose_filament();
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_to_nozzle(index); load_filament_to_nozzle(index);
#else #else
beep_bad_cmd(); ERR_BUZZ();
#endif #endif
} break; } break;
@@ -639,14 +630,14 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
extruder = index; extruder = index;
active_extruder = 0; active_extruder = 0;
#else #else
beep_bad_cmd(); ERR_BUZZ();
#endif #endif
} break; } break;
case 'c': { case 'c': {
DEBUG_ECHOLNPGM("case c\n"); DEBUG_ECHOLNPGM("case c\n");
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_to_nozzle_sequence(); execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence));
} break; } break;
} }
@@ -732,9 +723,9 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
#if ENABLED(MMU2_MENUS) #if ENABLED(MMU2_MENUS)
uint8_t index = mmu2_choose_filament(); uint8_t index = mmu2_choose_filament();
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_to_nozzle(index); load_filament_to_nozzle(index);
#else #else
beep_bad_cmd(); ERR_BUZZ();
#endif #endif
} break; } break;
@@ -753,14 +744,14 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
extruder = index; extruder = index;
active_extruder = 0; active_extruder = 0;
#else #else
beep_bad_cmd(); ERR_BUZZ();
#endif #endif
} break; } break;
case 'c': { case 'c': {
DEBUG_ECHOLNPGM("case c\n"); DEBUG_ECHOLNPGM("case c\n");
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_to_nozzle_sequence(); execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence));
} break; } break;
} }
@@ -801,7 +792,8 @@ bool MMU2::get_response() {
void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) { void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
constexpr xyz_pos_t park_point = NOZZLE_PARK_POINT; constexpr xyz_pos_t park_point = NOZZLE_PARK_POINT;
bool response = false, mmu_print_saved = false; bool response = false;
mmu_print_saved = false;
xyz_pos_t resume_position; xyz_pos_t resume_position;
celsius_t resume_hotend_temp = thermalManager.degTargetHotend(active_extruder); celsius_t resume_hotend_temp = thermalManager.degTargetHotend(active_extruder);
@@ -823,7 +815,8 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
resume_hotend_temp = thermalManager.degTargetHotend(active_extruder); resume_hotend_temp = thermalManager.degTargetHotend(active_extruder);
resume_position = current_position; resume_position = current_position;
if (move_axes && all_axes_homed()) nozzle.park(0, park_point); if (move_axes && all_axes_homed())
nozzle.park(0, park_point /*= NOZZLE_PARK_POINT*/);
if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder); if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder);
@@ -831,12 +824,13 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
} }
} }
else if (mmu_print_saved) { else if (mmu_print_saved) {
SERIAL_ECHOLNPGM("\nMMU starts responding"); SERIAL_ECHOLNPGM("MMU starts responding\n");
if (turn_off_nozzle && resume_hotend_temp) { if (turn_off_nozzle && resume_hotend_temp) {
thermalManager.setTargetHotend(resume_hotend_temp, active_extruder); thermalManager.setTargetHotend(resume_hotend_temp, active_extruder);
LCD_MESSAGE(MSG_HEATING); LCD_MESSAGE(MSG_HEATING);
ERR_BUZZ(); ERR_BUZZ();
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(1000); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(1000);
} }
@@ -849,6 +843,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
if (move_axes && all_axes_homed()) { if (move_axes && all_axes_homed()) {
// Move XY to starting position, then Z // Move XY to starting position, then Z
do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE)); do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE));
// Move Z_AXIS to saved position // Move Z_AXIS to saved position
do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
} }
@@ -883,24 +878,23 @@ void MMU2::filament_runout() {
} }
// Slowly spin the extruder during C0 // Slowly spin the extruder during C0
else { else {
while (planner.movesplanned() < 3) while (planner.movesplanned() < 3) {
unscaled_mmu2_e_move(0.25, MMM_TO_MMS(120), false); current_position.e += 0.25;
line_to_current_position(MMM_TO_MMS(120));
}
} }
} }
mmu2s_triggered = present; mmu2s_triggered = present;
} }
bool MMU2::can_load() { bool MMU2::can_load() {
static const E_Step can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE }, execute_extruder_sequence((const E_Step *)can_load_sequence, COUNT(can_load_sequence));
can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE };
execute_extruder_sequence(can_load_sequence, COUNT(can_load_sequence));
int filament_detected_count = 0; int filament_detected_count = 0;
const int steps = (MMU2_CAN_LOAD_RETRACT) / (MMU2_CAN_LOAD_INCREMENT); const int steps = (MMU2_CAN_LOAD_RETRACT) / (MMU2_CAN_LOAD_INCREMENT);
DEBUG_ECHOLNPGM("MMU can_load:"); DEBUG_ECHOLNPGM("MMU can_load:");
for (uint8_t i = 0; i < steps; ++i) { LOOP_L_N(i, steps) {
execute_extruder_sequence(can_load_increment_sequence, COUNT(can_load_increment_sequence)); execute_extruder_sequence((const E_Step *)can_load_increment_sequence, COUNT(can_load_increment_sequence));
check_filament(); // Don't trust the idle function check_filament(); // Don't trust the idle function
DEBUG_CHAR(mmu2s_triggered ? 'O' : 'o'); DEBUG_CHAR(mmu2s_triggered ? 'O' : 'o');
if (mmu2s_triggered) ++filament_detected_count; if (mmu2s_triggered) ++filament_detected_count;
@@ -918,7 +912,7 @@ void MMU2::filament_runout() {
#endif #endif
// Load filament into MMU2 // Load filament into MMU2
void MMU2::load_to_feeder(const uint8_t index) { void MMU2::load_filament(const uint8_t index) {
if (!_enabled) return; if (!_enabled) return;
command(MMU_CMD_L0 + index); command(MMU_CMD_L0 + index);
@@ -929,7 +923,8 @@ void MMU2::load_to_feeder(const uint8_t index) {
/** /**
* Switch material and load to nozzle * Switch material and load to nozzle
*/ */
bool MMU2::load_to_nozzle(const uint8_t index) { bool MMU2::load_filament_to_nozzle(const uint8_t index) {
if (!_enabled) return false; if (!_enabled) return false;
if (thermalManager.tooColdToExtrude(active_extruder)) { if (thermalManager.tooColdToExtrude(active_extruder)) {
@@ -938,13 +933,6 @@ bool MMU2::load_to_nozzle(const uint8_t index) {
return false; return false;
} }
if (TERN0(MMU_IR_UNLOAD_MOVE, index != extruder) && FILAMENT_PRESENT()) {
DEBUG_ECHOLNPGM("Unloading\n");
ramming_sequence(); // Unloading instructions from printer side when operating LCD
while (FILAMENT_PRESENT()) // Filament present? Keep unloading.
unscaled_mmu2_e_move(-0.25, MMM_TO_MMS(120)); // 0.25mm is a guessed value. Adjust to preference.
}
stepper.disable_extruder(); stepper.disable_extruder();
command(MMU_CMD_T0 + index); command(MMU_CMD_T0 + index);
manage_response(true, true); manage_response(true, true);
@@ -954,12 +942,23 @@ bool MMU2::load_to_nozzle(const uint8_t index) {
mmu_loop(); mmu_loop();
extruder = index; extruder = index;
active_extruder = 0; active_extruder = 0;
load_to_nozzle_sequence(); load_to_nozzle();
mmu2_attn_buzz(); mmu2_attn_buzz();
} }
return success; return success;
} }
/**
* Load filament to nozzle of multimaterial printer
*
* This function is used only after T? (user select filament) and M600 (change filament).
* It is not used after T0 .. T4 command (select filament), in such case, G-code is responsible for loading
* filament to nozzle.
*/
void MMU2::load_to_nozzle() {
execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence));
}
bool MMU2::eject_filament(const uint8_t index, const bool recover) { bool MMU2::eject_filament(const uint8_t index, const bool recover) {
if (!_enabled) return false; if (!_enabled) return false;
@@ -972,17 +971,20 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
LCD_MESSAGE(MSG_MMU2_EJECTING_FILAMENT); LCD_MESSAGE(MSG_MMU2_EJECTING_FILAMENT);
unscaled_mmu2_e_move(-(MMU2_FILAMENTCHANGE_EJECT_FEED), MMM_TO_MMS(2500)); stepper.enable_extruder();
current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED;
line_to_current_position(MMM_TO_MMS(2500));
planner.synchronize();
command(MMU_CMD_E0 + index); command(MMU_CMD_E0 + index);
manage_response(false, false); manage_response(false, false);
if (recover) { if (recover) {
LCD_MESSAGE(MSG_MMU2_REMOVE_AND_CLICK); LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
mmu2_attn_buzz(); mmu2_attn_buzz();
TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(GET_TEXT_F(MSG_MMU2_EJECT_RECOVER))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, F("MMU2 Eject Recover"), FPSTR(CONTINUE_STR)));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_MMU2_EJECT_RECOVER))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("MMU2 Eject Recover")));
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
mmu2_attn_buzz(); mmu2_attn_buzz(true);
command(MMU_CMD_R0); command(MMU_CMD_R0);
manage_response(false, false); manage_response(false, false);
@@ -1016,7 +1018,7 @@ bool MMU2::unload() {
} }
// Unload sequence to optimize shape of the tip of the unloaded filament // Unload sequence to optimize shape of the tip of the unloaded filament
ramming_sequence(); execute_extruder_sequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step));
command(MMU_CMD_U0); command(MMU_CMD_U0);
manage_response(false, true); manage_response(false, true);
@@ -1031,26 +1033,23 @@ bool MMU2::unload() {
return true; return true;
} }
void MMU2::ramming_sequence() {
static const E_Step sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE };
execute_extruder_sequence(sequence, COUNT(sequence));
}
void MMU2::load_to_nozzle_sequence() {
static const E_Step sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE };
execute_extruder_sequence(sequence, COUNT(sequence));
}
void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) { void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) {
planner.synchronize(); planner.synchronize();
stepper.enable_extruder();
const E_Step *step = sequence; const E_Step* step = sequence;
for (uint8_t i = 0; i < steps; ++i) { LOOP_L_N(i, steps) {
const float es = pgm_read_float(&(step->extrude)); const float es = pgm_read_float(&(step->extrude));
const feedRate_t fr_mm_m = pgm_read_float(&(step->feedRate)); const feedRate_t fr_mm_m = pgm_read_float(&(step->feedRate));
DEBUG_ECHO_MSG("E step ", es, "/", fr_mm_m); DEBUG_ECHO_MSG("E step ", es, "/", fr_mm_m);
unscaled_mmu2_e_move(es, MMM_TO_MMS(fr_mm_m));
current_position.e += es;
line_to_current_position(MMM_TO_MMS(fr_mm_m));
planner.synchronize();
step++; step++;
} }
+50 -42
View File
@@ -89,11 +89,9 @@ static xyze_pos_t resume_position;
PauseMode pause_mode = PAUSE_MODE_PAUSE_PRINT; PauseMode pause_mode = PAUSE_MODE_PAUSE_PRINT;
#endif #endif
#if ENABLED(CONFIGURE_FILAMENT_CHANGE) fil_change_settings_t fc_settings[EXTRUDERS];
fil_change_settings_t fc_settings[EXTRUDERS];
#endif
#if HAS_MEDIA #if ENABLED(SDSUPPORT)
#include "../sd/cardreader.h" #include "../sd/cardreader.h"
#endif #endif
@@ -203,7 +201,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = true; // LCD click or M108 will clear this wait_for_user = true; // LCD click or M108 will clear this
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENTLOAD))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(F("Load Filament")));
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)
const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder); const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder);
@@ -212,14 +210,23 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
while (wait_for_user) { while (wait_for_user) {
impatient_beep(max_beep_count); impatient_beep(max_beep_count);
#if ALL(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR) #if BOTH(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR)
#if MULTI_FILAMENT_SENSOR #if MULTI_FILAMENT_SENSOR
#define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break; LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) {
switch (active_extruder) { pin_t pin;
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED) switch (i) {
default: continue;
#define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; break;
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_RUNOUT)
#undef _CASE_RUNOUT
}
const RunoutMode rm = runout.mode[i - 1];
if (rm != RM_NONE && rm != RM_MOTION_SENSOR && extDigitalRead(pin) != runout.out_state(i - 1))
wait_for_user = false;
} }
#else #else
if (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) wait_for_user = false; if (READ(FIL_RUNOUT_PIN) != runout.out_state(active_extruder))
wait_for_user = false;
#endif #endif
#endif #endif
idle_no_sleep(); idle_no_sleep();
@@ -236,8 +243,6 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
TERN_(BELTPRINTER, do_blocking_move_to_xy(0.00, 50.00)); TERN_(BELTPRINTER, do_blocking_move_to_xy(0.00, 50.00));
TERN_(MPCTEMP, MPC::e_paused = true);
// Slow Load filament // Slow Load filament
if (slow_load_length) unscaled_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE); if (slow_load_length) unscaled_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);
@@ -264,7 +269,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE); if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)));
TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE), FPSTR(CONTINUE_STR)));
wait_for_user = true; // A click or M108 breaks the purge_length loop wait_for_user = true; // A click or M108 breaks the purge_length loop
for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
@@ -288,7 +293,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
// Show "Purge More" / "Resume" menu and wait for reply // Show "Purge More" / "Resume" menu and wait for reply
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = false; wait_for_user = false;
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) #if EITHER(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
#else #else
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
@@ -301,9 +306,6 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
} while (TERN0(M600_PURGE_MORE_RESUMABLE, pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE)); } while (TERN0(M600_PURGE_MORE_RESUMABLE, pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE));
#endif #endif
TERN_(MPCTEMP, MPC::e_paused = false);
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_end()); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_end());
return true; return true;
@@ -333,18 +335,18 @@ inline void disable_active_extruder() {
*/ */
bool unload_filament(const_float_t unload_length, const bool show_lcd/*=false*/, bool unload_filament(const_float_t unload_length, const bool show_lcd/*=false*/,
const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/ const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/
#if ALL(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) #if BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER)
, const_float_t mix_multiplier/*=1.0*/ , const_float_t mix_multiplier/*=1.0*/
#endif #endif
) { ) {
DEBUG_SECTION(uf, "unload_filament", true); DEBUG_SECTION(uf, "unload_filament", true);
DEBUG_ECHOLNPGM("... unloadlen:", unload_length, " showlcd:", show_lcd, " mode:", mode DEBUG_ECHOLNPGM("... unloadlen:", unload_length, " showlcd:", show_lcd, " mode:", mode
#if ALL(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) #if BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER)
, " mixmult:", mix_multiplier , " mixmult:", mix_multiplier
#endif #endif
); );
#if !ALL(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) #if !BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER)
constexpr float mix_multiplier = 1.0f; constexpr float mix_multiplier = 1.0f;
#endif #endif
@@ -404,6 +406,8 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
DEBUG_SECTION(pp, "pause_print", true); DEBUG_SECTION(pp, "pause_print", true);
DEBUG_ECHOLNPGM("... park.x:", park_point.x, " y:", park_point.y, " z:", park_point.z, " unloadlen:", unload_length, " showlcd:", show_lcd DXC_SAY); DEBUG_ECHOLNPGM("... park.x:", park_point.x, " y:", park_point.y, " z:", park_point.z, " unloadlen:", unload_length, " showlcd:", show_lcd DXC_SAY);
UNUSED(show_lcd);
if (did_pause_print) return false; // already paused if (did_pause_print) return false; // already paused
#if ENABLED(HOST_ACTION_COMMANDS) #if ENABLED(HOST_ACTION_COMMANDS)
@@ -415,12 +419,13 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
#endif #endif
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause());
// Indicate that the printer is paused // Indicate that the printer is paused
++did_pause_print; ++did_pause_print;
// Pause the print job and timer // Pause the print job and timer
#if HAS_MEDIA #if ENABLED(SDSUPPORT)
const bool was_sd_printing = IS_SD_PRINTING(); const bool was_sd_printing = IS_SD_PRINTING();
if (was_sd_printing) { if (was_sd_printing) {
card.pauseSDPrint(); card.pauseSDPrint();
@@ -445,7 +450,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
// Wait for buffered blocks to complete // Wait for buffered blocks to complete
planner.synchronize(); planner.synchronize();
#if ALL(ADVANCED_PAUSE_FANS_PAUSE, HAS_FAN) #if ENABLED(ADVANCED_PAUSE_FANS_PAUSE) && HAS_FAN
thermalManager.set_fans_paused(true); thermalManager.set_fans_paused(true);
#endif #endif
@@ -465,7 +470,6 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
// If axes don't need to home then the nozzle can park // If axes don't need to home then the nozzle can park
if (do_park) nozzle.park(0, park_point); // Park the nozzle by doing a Minimum Z Raise followed by an XY Move if (do_park) nozzle.park(0, park_point); // Park the nozzle by doing a Minimum Z Raise followed by an XY Move
if (!do_park) LCD_MESSAGE(MSG_PARK_FAILED);
#if ENABLED(DUAL_X_CARRIAGE) #if ENABLED(DUAL_X_CARRIAGE)
const int8_t saved_ext = active_extruder; const int8_t saved_ext = active_extruder;
@@ -477,7 +481,9 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
if (unload_length) if (unload_length)
unload_filament(unload_length, show_lcd, PAUSE_MODE_CHANGE_FILAMENT); unload_filament(unload_length, show_lcd, PAUSE_MODE_CHANGE_FILAMENT);
TERN_(DUAL_X_CARRIAGE, set_duplication_enabled(saved_ext_dup_mode, saved_ext)); #if ENABLED(DUAL_X_CARRIAGE)
set_duplication_enabled(saved_ext_dup_mode, saved_ext);
#endif
// Disable the Extruder for manual change // Disable the Extruder for manual change
disable_active_extruder(); disable_active_extruder();
@@ -504,7 +510,7 @@ void show_continue_prompt(const bool is_reload) {
ui.pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING); ui.pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING);
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHO(is_reload ? F(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : F(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n")); SERIAL_ECHOF(is_reload ? F(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : F(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n"));
} }
void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) { void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) {
@@ -530,7 +536,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
// Wait for filament insert by user and press button // Wait for filament insert by user and press button
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(GET_TEXT_F(MSG_NOZZLE_PARKED))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_NOZZLE_PARKED), FPSTR(CONTINUE_STR)));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_NOZZLE_PARKED))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_NOZZLE_PARKED)));
wait_for_user = true; // LCD click or M108 will clear this wait_for_user = true; // LCD click or M108 will clear this
while (wait_for_user) { while (wait_for_user) {
@@ -548,17 +554,15 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
#if ENABLED(TOUCH_UI_FTDI_EVE) TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_HEATER_TIMEOUT)));
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FTDI_HEATER_TIMEOUT));
#elif ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_HEATER_TIMEOUT));
#endif
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(0, true)); // Wait for LCD click or M108 TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(0, true)); // Wait for LCD click or M108
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_INFO, GET_TEXT_F(MSG_REHEATING)));
LCD_MESSAGE(MSG_REHEATING); TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(GET_TEXT_F(MSG_REHEATING)));
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATING));
// Re-enable the heaters if they timed out // Re-enable the heaters if they timed out
HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e); HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);
@@ -574,12 +578,9 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout); HOTEND_LOOP() thermalManager.heater_idle[e].start(nozzle_timeout);
TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(GET_TEXT_F(MSG_REHEATDONE))); TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_REHEATDONE), FPSTR(CONTINUE_STR)));
#if ENABLED(EXTENSIBLE_UI) TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE)));
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_REHEATDONE)); TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_REHEATDONE));
#else
LCD_MESSAGE(MSG_REHEATDONE);
#endif
IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true); IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true);
@@ -588,7 +589,9 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
} }
idle_no_sleep(); idle_no_sleep();
} }
TERN_(DUAL_X_CARRIAGE, set_duplication_enabled(saved_ext_dup_mode, saved_ext)); #if ENABLED(DUAL_X_CARRIAGE)
set_duplication_enabled(saved_ext_dup_mode, saved_ext);
#endif
} }
/** /**
@@ -705,7 +708,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
// Resume the print job timer if it was running // Resume the print job timer if it was running
if (print_job_timer.isPaused()) print_job_timer.start(); if (print_job_timer.isPaused()) print_job_timer.start();
#if HAS_MEDIA #if ENABLED(SDSUPPORT)
if (did_pause_print) { if (did_pause_print) {
--did_pause_print; --did_pause_print;
card.startOrResumeFilePrinting(); card.startOrResumeFilePrinting();
@@ -720,8 +723,13 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
TERN_(HAS_FILAMENT_SENSOR, runout.reset()); TERN_(HAS_FILAMENT_SENSOR, runout.reset());
ui.reset_status(); #if ENABLED(DWIN_LCD_PROUI)
ui.return_to_status(); DWIN_Print_Resume();
HMI_ReturnScreen();
#else
ui.reset_status();
ui.return_to_status();
#endif
} }
#endif // ADVANCED_PAUSE_FEATURE #endif // ADVANCED_PAUSE_FEATURE
+5 -3
View File
@@ -52,10 +52,12 @@ enum PauseMessage : char {
PAUSE_MESSAGE_RESUME, PAUSE_MESSAGE_RESUME,
PAUSE_MESSAGE_HEAT, PAUSE_MESSAGE_HEAT,
PAUSE_MESSAGE_HEATING, PAUSE_MESSAGE_HEATING,
PAUSE_MESSAGE_STATUS PAUSE_MESSAGE_STATUS,
PAUSE_MESSAGE_COUNT
}; };
#if M600_PURGE_MORE_RESUMABLE #if M600_PURGE_MORE_RESUMABLE
// Input methods can Purge More, Resume, or request input
enum PauseMenuResponse : char { enum PauseMenuResponse : char {
PAUSE_RESPONSE_WAIT_FOR, PAUSE_RESPONSE_WAIT_FOR,
PAUSE_RESPONSE_EXTRUDE_MORE, PAUSE_RESPONSE_EXTRUDE_MORE,
@@ -105,7 +107,7 @@ void wait_for_confirmation(
void resume_print( void resume_print(
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
const_float_t extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
const int8_t max_beep_count=0, // Beep alert for attention const int8_t max_beep_count=0, // Beep alert for attention
const celsius_t targetTemp=0 // (°C) A target temperature for the hotend const celsius_t targetTemp=0 // (°C) A target temperature for the hotend
DXC_PARAMS // Dual-X-Carriage extruder index DXC_PARAMS // Dual-X-Carriage extruder index
@@ -114,7 +116,7 @@ void resume_print(
bool load_filament( bool load_filament(
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
const_float_t extrude_length=0, // (mm) Purge length const_float_t purge_length=0, // (mm) Purge length
const int8_t max_beep_count=0, // Beep alert for attention const int8_t max_beep_count=0, // Beep alert for attention
const bool show_lcd=false, // Set LCD status messages? const bool show_lcd=false, // Set LCD status messages?
const bool pause_for_user=false, // Pause for user before returning? const bool pause_for_user=false, // Pause for user before returning?
+24 -2
View File
@@ -34,6 +34,10 @@
#include "../module/temperature.h" #include "../module/temperature.h"
#include "../MarlinCore.h" #include "../MarlinCore.h"
#if ENABLED(MAX7219_REINIT_ON_POWERUP)
#include "max7219.h"
#endif
#if ENABLED(PS_OFF_SOUND) #if ENABLED(PS_OFF_SOUND)
#include "../libs/buzzer.h" #include "../libs/buzzer.h"
#endif #endif
@@ -60,6 +64,10 @@ bool Power::psu_on;
millis_t Power::lastPowerOn; millis_t Power::lastPowerOn;
#endif #endif
#if PSU_TRACK_STATE_MS
millis_t Power::last_state_change_ms = 0;
#endif
/** /**
* Initialize pins & state for the power manager. * Initialize pins & state for the power manager.
* *
@@ -87,9 +95,18 @@ void Power::power_on() {
#endif #endif
OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE); OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE);
#if ENABLED(PSU_OFF_REDUNDANT)
OUT_WRITE(PS_ON1_PIN, TERN_(PSU_OFF_REDUNDANT_INVERTED, !)PSU_ACTIVE_STATE);
#endif
TERN_(PSU_TRACK_STATE_MS, last_state_change_ms = millis());
psu_on = true; psu_on = true;
safe_delay(PSU_POWERUP_DELAY); safe_delay(PSU_POWERUP_DELAY);
restore_stepper_drivers(); restore_stepper_drivers();
TERN_(MAX7219_REINIT_ON_POWERUP, max7219.init());
TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY)); TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY));
#ifdef PSU_POWERUP_GCODE #ifdef PSU_POWERUP_GCODE
@@ -102,12 +119,12 @@ void Power::power_on() {
* Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled. * Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled.
*/ */
void Power::power_off() { void Power::power_off() {
SERIAL_ECHOLNPGM(STR_POWEROFF);
TERN_(HAS_SUICIDE, suicide()); TERN_(HAS_SUICIDE, suicide());
if (!psu_on) return; if (!psu_on) return;
SERIAL_ECHOLNPGM(STR_POWEROFF);
#ifdef PSU_POWEROFF_GCODE #ifdef PSU_POWEROFF_GCODE
gcode.process_subcommands_now(F(PSU_POWEROFF_GCODE)); gcode.process_subcommands_now(F(PSU_POWEROFF_GCODE));
#endif #endif
@@ -117,6 +134,11 @@ void Power::power_off() {
#endif #endif
OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE); OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE);
#if ENABLED(PSU_OFF_REDUNDANT)
OUT_WRITE(PS_ON1_PIN, IF_DISABLED(PSU_OFF_REDUNDANT_INVERTED, !)PSU_ACTIVE_STATE);
#endif
TERN_(PSU_TRACK_STATE_MS, last_state_change_ms = millis());
psu_on = false; psu_on = false;
#if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) #if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN)
+8 -1
View File
@@ -24,8 +24,11 @@
/** /**
* power.h - power control * power.h - power control
*/ */
#if PIN_EXISTS(PS_ON_EDM) || (PIN_EXISTS(PS_ON1_EDM) && ENABLED(PSU_OFF_REDUNDANT))
#define PSU_TRACK_STATE_MS 1
#endif
#if ANY(AUTO_POWER_CONTROL, POWER_OFF_TIMER) #if ANY(AUTO_POWER_CONTROL, POWER_OFF_TIMER, PSU_TRACK_STATE_MS)
#include "../core/millis_t.h" #include "../core/millis_t.h"
#endif #endif
@@ -37,6 +40,10 @@ class Power {
static void power_on(); static void power_on();
static void power_off(); static void power_off();
#if PSU_TRACK_STATE_MS
static millis_t last_state_change_ms;
#endif
#if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) #if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN)
#if ENABLED(POWER_OFF_TIMER) #if ENABLED(POWER_OFF_TIMER)
static millis_t power_off_time; static millis_t power_off_time;
+2 -2
View File
@@ -48,8 +48,8 @@ uint8_t PrintJobRecovery::queue_index_r;
uint32_t PrintJobRecovery::cmd_sdpos, // = 0 uint32_t PrintJobRecovery::cmd_sdpos, // = 0
PrintJobRecovery::sdpos[BUFSIZE]; PrintJobRecovery::sdpos[BUFSIZE];
#if HAS_DWIN_E3V2_BASIC #if HAS_PLR_UI_FLAG
bool PrintJobRecovery::dwin_flag; // = false bool PrintJobRecovery::ui_flag_resume; // = false
#endif #endif
#include "../sd/cardreader.h" #include "../sd/cardreader.h"
+2 -2
View File
@@ -151,8 +151,8 @@ class PrintJobRecovery {
static uint32_t cmd_sdpos, //!< SD position of the next command static uint32_t cmd_sdpos, //!< SD position of the next command
sdpos[BUFSIZE]; //!< SD positions of queued commands sdpos[BUFSIZE]; //!< SD positions of queued commands
#if HAS_DWIN_E3V2_BASIC #if HAS_PLR_UI_FLAG
static bool dwin_flag; static bool ui_flag_resume; //!< Flag the UI to show a dialog to Resume (M1000) or Cancel (M1000C)
#endif #endif
static void init(); static void init();
+27 -39
View File
@@ -32,28 +32,23 @@
FilamentMonitor runout; FilamentMonitor runout;
bool FilamentMonitorBase::enabled = true, bool FilamentMonitorBase::enabled[NUM_RUNOUT_SENSORS], // Initialized by settings.load
FilamentMonitorBase::filament_ran_out; // = false FilamentMonitorBase::filament_ran_out; // = false
RunoutMode FilamentMonitorBase::mode[NUM_RUNOUT_SENSORS]; // Initialized by settings.load
#if ENABLED(HOST_ACTION_COMMANDS) #if ENABLED(HOST_ACTION_COMMANDS)
bool FilamentMonitorBase::host_handling; // = false bool FilamentMonitorBase::host_handling; // = false
#endif #endif
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE
#include "../module/tool_change.h" #include "../module/tool_change.h"
#define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
#include "../core/debug_out.h" #include "../core/debug_out.h"
#endif #endif
#if HAS_FILAMENT_RUNOUT_DISTANCE float RunoutResponseDelayed::runout_distance_mm[NUM_RUNOUT_SENSORS]; // Initialized by settings.load
float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM; volatile float RunoutResponseDelayed::runout_mm_countdown[NUM_RUNOUT_SENSORS];
countdown_t RunoutResponseDelayed::mm_countdown; uint8_t FilamentSensorCore::motion_detected;
#if ENABLED(FILAMENT_MOTION_SENSOR)
uint8_t FilamentSensorEncoder::motion_detected;
#endif
#else
int8_t RunoutResponseDebounced::runout_count[NUM_RUNOUT_SENSORS]; // = 0
#endif
// //
// Filament Runout event handler // Filament Runout event handler
@@ -88,7 +83,7 @@ void event_filament_runout(const uint8_t extruder) {
#endif #endif
TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder))); TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder)));
TERN_(DWIN_LCD_PROUI, dwinFilamentRunout(extruder)); TERN_(DWIN_LCD_PROUI, DWIN_FilamentRunout(extruder));
#if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR) #if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR)
const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder); const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder);
@@ -102,16 +97,12 @@ void event_filament_runout(const uint8_t extruder) {
const bool run_runout_script = !runout.host_handling; const bool run_runout_script = !runout.host_handling;
#if ENABLED(HOST_ACTION_COMMANDS) #if ENABLED(HOST_ACTION_COMMANDS)
if (run_runout_script
const bool park_or_pause = (false && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
#ifdef FILAMENT_RUNOUT_SCRIPT
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M125") || strstr(FILAMENT_RUNOUT_SCRIPT, "M125")
|| TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25")) || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
#endif )
); ) {
if (run_runout_script && park_or_pause) {
hostui.paused(false); hostui.paused(false);
} }
else { else {
@@ -128,27 +119,24 @@ void event_filament_runout(const uint8_t extruder) {
SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " "); SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " ");
SERIAL_CHAR(tool); SERIAL_CHAR(tool);
SERIAL_EOL(); SERIAL_EOL();
#endif // HOST_ACTION_COMMANDS #endif // HOST_ACTION_COMMANDS
#ifdef FILAMENT_RUNOUT_SCRIPT if (run_runout_script) {
if (run_runout_script) { #if MULTI_FILAMENT_SENSOR
#if MULTI_FILAMENT_SENSOR char script[strlen(FILAMENT_RUNOUT_SCRIPT) + 1];
MString<strlen(FILAMENT_RUNOUT_SCRIPT)> script; sprintf_P(script, PSTR(FILAMENT_RUNOUT_SCRIPT), tool);
script.setf(F(FILAMENT_RUNOUT_SCRIPT), C(tool)); #if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG) SERIAL_ECHOLNPGM("Runout Command: ", script);
SERIAL_ECHOLNPGM("Runout Command: ", &script);
#endif
queue.inject(&script);
#else
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
SERIAL_ECHOPGM("Runout Command: ");
SERIAL_ECHOLNPGM(FILAMENT_RUNOUT_SCRIPT);
#endif
queue.inject(F(FILAMENT_RUNOUT_SCRIPT));
#endif #endif
} queue.inject(script);
#endif #else
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
SERIAL_ECHOPGM("Runout Command: ");
SERIAL_ECHOLNPGM(FILAMENT_RUNOUT_SCRIPT);
#endif
queue.inject(F(FILAMENT_RUNOUT_SCRIPT));
#endif
}
} }
#endif // HAS_FILAMENT_SENSOR #endif // HAS_FILAMENT_SENSOR
+163 -304
View File
@@ -30,8 +30,7 @@
#include "../module/planner.h" #include "../module/planner.h"
#include "../module/stepper.h" // for block_t #include "../module/stepper.h" // for block_t
#include "../gcode/queue.h" #include "../gcode/queue.h"
#include "../feature/pause.h" // for did_pause_print #include "../feature/pause.h"
#include "../MarlinCore.h" // for printingIsActive()
#include "../inc/MarlinConfig.h" #include "../inc/MarlinConfig.h"
@@ -44,44 +43,41 @@
#define FILAMENT_RUNOUT_THRESHOLD 5 #define FILAMENT_RUNOUT_THRESHOLD 5
#endif #endif
#if ENABLED(FILAMENT_MOTION_SENSOR)
#define HAS_FILAMENT_MOTION 1
#endif
#if DISABLED(FILAMENT_MOTION_SENSOR) || ENABLED(FILAMENT_SWITCH_AND_MOTION)
#define HAS_FILAMENT_SWITCH 1
#endif
typedef Flags<
#if NUM_MOTION_SENSORS > NUM_RUNOUT_SENSORS
NUM_MOTION_SENSORS
#else
NUM_RUNOUT_SENSORS
#endif
> runout_flags_t;
void event_filament_runout(const uint8_t extruder); void event_filament_runout(const uint8_t extruder);
inline bool should_monitor_runout() { return did_pause_print || printingIsActive(); }
template<class RESPONSE_T, class SENSOR_T> template<class RESPONSE_T, class SENSOR_T>
class TFilamentMonitor; class TFilamentMonitor;
class FilamentSensor; class FilamentSensorCore;
class RunoutResponseDelayed; class RunoutResponseDelayed;
class RunoutResponseDebounced;
/********************************* TEMPLATE SPECIALIZATION *********************************/ /********************************* TEMPLATE SPECIALIZATION *********************************/
typedef TFilamentMonitor< typedef TFilamentMonitor<
TERN(HAS_FILAMENT_RUNOUT_DISTANCE, RunoutResponseDelayed, RunoutResponseDebounced), RunoutResponseDelayed,
FilamentSensor FilamentSensorCore
> FilamentMonitor; > FilamentMonitor;
extern FilamentMonitor runout; extern FilamentMonitor runout;
/*******************************************************************************************/ /*******************************************************************************************/
enum RunoutMode : uint8_t {
RM_NONE,
RM_OUT_ON_LOW,
RM_OUT_ON_HIGH,
RM_RESERVED3,
RM_RESERVED4,
RM_RESERVED5,
RM_RESERVED6,
RM_MOTION_SENSOR
};
class FilamentMonitorBase { class FilamentMonitorBase {
public: public:
static bool enabled, filament_ran_out; static bool enabled[NUM_RUNOUT_SENSORS], filament_ran_out;
static RunoutMode mode[NUM_RUNOUT_SENSORS];
static uint8_t out_state(const uint8_t e=0) { return mode[e] == RM_OUT_ON_HIGH ? HIGH : LOW; }
#if ENABLED(HOST_ACTION_COMMANDS) #if ENABLED(HOST_ACTION_COMMANDS)
static bool host_handling; static bool host_handling;
@@ -111,24 +107,14 @@ class TFilamentMonitor : public FilamentMonitorBase {
// Call this method when filament is present, // Call this method when filament is present,
// so the response can reset its counter. // so the response can reset its counter.
static void filament_present(const uint8_t extruder) { static void filament_present(const uint8_t e) { response.filament_present(e); }
response.filament_present(extruder); static float& runout_distance(const uint8_t e=0) { return response.runout_distance_mm[e]; }
} static void set_runout_distance(const_float_t mm, const uint8_t e=0) { response.runout_distance_mm[e] = mm; }
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
static void filament_motion_present(const uint8_t extruder) {
response.filament_motion_present(extruder);
}
#endif
#if HAS_FILAMENT_RUNOUT_DISTANCE
static float& runout_distance() { return response.runout_distance_mm; }
static void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; }
#endif
// Handle a block completion. RunoutResponseDelayed uses this to // Handle a block completion. RunoutResponseDelayed uses this to
// add up the length of filament moved while the filament is out. // add up the length of filament moved while the filament is out.
static void block_completed(const block_t * const b) { static void block_completed(const block_t * const b) {
if (enabled) { if (enabled[active_extruder]) {
response.block_completed(b); response.block_completed(b);
sensor.block_completed(b); sensor.block_completed(b);
} }
@@ -136,33 +122,43 @@ class TFilamentMonitor : public FilamentMonitorBase {
// Give the response a chance to update its counter. // Give the response a chance to update its counter.
static void run() { static void run() {
if (enabled && !filament_ran_out && should_monitor_runout()) { if (enabled[active_extruder] && mode[active_extruder] != RM_NONE && !filament_ran_out && (printingIsActive() || did_pause_print)) {
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here cli(); // Prevent RunoutResponseDelayed::block_completed from accumulating here
response.run(); response.run();
sensor.run(); sensor.run();
const runout_flags_t runout_flags = response.has_run_out(); const uint8_t runout_flags = response.has_run_out();
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, sei()); sei();
#if MULTI_FILAMENT_SENSOR #if MULTI_FILAMENT_SENSOR
#if ENABLED(WATCH_ALL_RUNOUT_SENSORS) #if ENABLED(WATCH_ALL_RUNOUT_SENSORS)
const bool ran_out = bool(runout_flags); // any sensor triggers const bool ran_out = !!runout_flags; // any sensor triggers
uint8_t extruder = 0; uint8_t extruder = 0;
if (ran_out) while (!runout_flags.test(extruder)) extruder++; if (ran_out) {
uint8_t bitmask = runout_flags;
while (!(bitmask & 1)) {
bitmask >>= 1;
extruder++;
}
}
#else #else
const bool ran_out = runout_flags[active_extruder]; // suppress non active extruders const bool ran_out = TEST(runout_flags, active_extruder); // suppress non active extruders
uint8_t extruder = active_extruder; uint8_t extruder = active_extruder;
#endif #endif
#else #else
const bool ran_out = bool(runout_flags); const bool ran_out = !!runout_flags;
uint8_t extruder = active_extruder; uint8_t extruder = active_extruder;
#endif #endif
if (ran_out) { #if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG) if (runout_flags) {
SERIAL_ECHOPGM("Runout Sensors: "); SERIAL_ECHOPGM("Runout Sensors: ");
for (uint8_t i = 0; i < 8; ++i) SERIAL_CHAR('0' + char(runout_flags[i])); LOOP_L_N(i, 8) SERIAL_ECHO('0' + TEST(runout_flags, i));
SERIAL_ECHOLNPGM(" -> ", extruder, " RUN OUT"); SERIAL_ECHOPGM(" -> ", extruder);
#endif if (ran_out) SERIAL_ECHOPGM(" RUN OUT");
SERIAL_EOL();
}
#endif
if (ran_out) {
filament_ran_out = true; filament_ran_out = true;
event_filament_runout(extruder); event_filament_runout(extruder);
planner.synchronize(); planner.synchronize();
@@ -182,27 +178,40 @@ class FilamentSensorBase {
static void filament_present(const uint8_t extruder) { static void filament_present(const uint8_t extruder) {
runout.filament_present(extruder); // ...which calls response.filament_present(extruder) runout.filament_present(extruder); // ...which calls response.filament_present(extruder)
} }
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
static void filament_motion_present(const uint8_t extruder) {
runout.filament_motion_present(extruder); // ...which calls response.filament_motion_present(extruder)
}
#endif
public: public:
static void setup() { static void setup() {
#define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0); #define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0)
#define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN); #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN)
REPEAT_1(NUM_RUNOUT_SENSORS, INIT_RUNOUT_PIN) #if NUM_RUNOUT_SENSORS >= 1
#undef INIT_RUNOUT_PIN INIT_RUNOUT_PIN(1);
#endif
#if ENABLED(FILAMENT_SWITCH_AND_MOTION) #if NUM_RUNOUT_SENSORS >= 2
#define INIT_MOTION_PIN(N) _INIT_RUNOUT_PIN(FIL_MOTION##N##_PIN, FIL_MOTION##N##_STATE, FIL_MOTION##N##_PULLUP, FIL_MOTION##N##_PULLDOWN); INIT_RUNOUT_PIN(2);
REPEAT_1(NUM_MOTION_SENSORS, INIT_MOTION_PIN) #endif
#undef INIT_MOTION_PIN #if NUM_RUNOUT_SENSORS >= 3
INIT_RUNOUT_PIN(3);
#endif
#if NUM_RUNOUT_SENSORS >= 4
INIT_RUNOUT_PIN(4);
#endif
#if NUM_RUNOUT_SENSORS >= 5
INIT_RUNOUT_PIN(5);
#endif
#if NUM_RUNOUT_SENSORS >= 6
INIT_RUNOUT_PIN(6);
#endif
#if NUM_RUNOUT_SENSORS >= 7
INIT_RUNOUT_PIN(7);
#endif
#if NUM_RUNOUT_SENSORS >= 8
INIT_RUNOUT_PIN(8);
#endif #endif
#undef _INIT_RUNOUT_PIN #undef _INIT_RUNOUT_PIN
#undef INIT_RUNOUT_PIN
} }
// Return a bitmask of runout pin states // Return a bitmask of runout pin states
static uint8_t poll_runout_pins() { static uint8_t poll_runout_pins() {
#define _OR_RUNOUT(N) | (READ(FIL_RUNOUT##N##_PIN) ? _BV((N) - 1) : 0) #define _OR_RUNOUT(N) | (READ(FIL_RUNOUT##N##_PIN) ? _BV((N) - 1) : 0)
@@ -212,275 +221,125 @@ class FilamentSensorBase {
// Return a bitmask of runout flag states (1 bits always indicates runout) // Return a bitmask of runout flag states (1 bits always indicates runout)
static uint8_t poll_runout_states() { static uint8_t poll_runout_states() {
#define _INVERT_BIT(N) | (FIL_RUNOUT##N##_STATE ? 0 : _BV(N - 1)) #define _OR_INVERT(N) | (runout.out_state(N-1) ? 0 : _BV(N-1))
return poll_runout_pins() ^ uint8_t(0 REPEAT_1(NUM_RUNOUT_SENSORS, _INVERT_BIT)); return poll_runout_pins() ^ uint8_t(0 REPEAT_1(NUM_RUNOUT_SENSORS, _OR_INVERT));
#undef _INVERT_BIT #undef _OR_INVERT
} }
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
// Return a bitmask of motion pin states
static uint8_t poll_motion_pins() {
#define _OR_MOTION(N) | (READ(FIL_MOTION##N##_PIN) ? _BV((N) - 1) : 0)
return (0 REPEAT_1(NUM_MOTION_SENSORS, _OR_MOTION));
#undef _OR_MOTION
}
// Return a bitmask of motion flag states (1 bits always indicates runout)
static uint8_t poll_motion_states() {
#define _OR_MOTION(N) | (FIL_MOTION##N##_STATE ? 0 : _BV(N - 1))
return poll_motion_pins() ^ uint8_t(0 REPEAT_1(NUM_MOTION_SENSORS, _OR_MOTION));
#undef _OR_MOTION
}
#endif
}; };
#if HAS_FILAMENT_MOTION class FilamentSensorCore : public FilamentSensorBase {
private:
static uint8_t motion_detected;
/** static bool poll_runout_state(const uint8_t extruder) {
* This sensor uses a magnetic encoder disc and a Hall effect const uint8_t runout_states = poll_runout_states();
* sensor (or a slotted disc and optical sensor). The state #if MULTI_FILAMENT_SENSOR
* will toggle between 0 and 1 on filament movement. It can detect if ( !TERN0(DUAL_X_CARRIAGE, idex_is_duplicating())
* filament runout and stripouts or jams. && !TERN0(MULTI_NOZZLE_DUPLICATION, extruder_duplication_enabled)
*/ ) return TEST(runout_states, extruder); // A specific extruder ran out
class FilamentSensorEncoder : public FilamentSensorBase { #else
private: UNUSED(extruder);
static uint8_t motion_detected; #endif
return !!runout_states; // Any extruder ran out
}
static void poll_motion_sensor() { static void poll_motion_sensor() {
static uint8_t old_state; static uint8_t old_state;
const uint8_t new_state = TERN(FILAMENT_SWITCH_AND_MOTION, poll_motion_pins, poll_runout_pins)(), const uint8_t new_state = poll_runout_pins(),
change = old_state ^ new_state; change = old_state ^ new_state;
old_state = new_state; old_state = new_state;
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG) #if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
if (change) { if (change) {
SERIAL_ECHOPGM("Motion detected:"); SERIAL_ECHOPGM("Motion detected:");
for (uint8_t e = 0; e < TERN(FILAMENT_SWITCH_AND_MOTION, NUM_MOTION_SENSORS, NUM_RUNOUT_SENSORS); ++e) LOOP_L_N(e, NUM_RUNOUT_SENSORS)
if (TEST(change, e)) SERIAL_CHAR(' ', '0' + e); if (TEST(change, e)) SERIAL_CHAR(' ', '0' + e);
SERIAL_EOL(); SERIAL_EOL();
} }
#endif #endif
motion_detected |= change; motion_detected |= change;
}
public:
static void block_completed(const block_t * const b) {
if (runout.mode[active_extruder] != RM_MOTION_SENSOR) return;
// If the sensor wheel has moved since the last call to
// this method reset the runout counter for the extruder.
if (TEST(motion_detected, b->extruder))
filament_present(b->extruder);
// Clear motion triggers for next block
motion_detected = 0;
}
static void run() {
if (runout.mode[active_extruder] == RM_MOTION_SENSOR) {
poll_motion_sensor();
} }
else if (runout.mode[active_extruder] != RM_NONE) {
public: LOOP_L_N(s, NUM_RUNOUT_SENSORS) {
static void block_completed(const block_t * const b) {
// If the sensor wheel has moved since the last call to
// this method reset the runout counter for the extruder.
if (TEST(motion_detected, b->extruder))
TERN(FILAMENT_SWITCH_AND_MOTION, filament_motion_present, filament_present)(b->extruder);
// Clear motion triggers for next block
motion_detected = 0;
}
static void run() { poll_motion_sensor(); }
};
#endif // HAS_FILAMENT_MOTION
#if HAS_FILAMENT_SWITCH
/**
* This is a simple endstop switch in the path of the filament.
* It can detect filament runout, but not stripouts or jams.
*/
class FilamentSensorSwitch : public FilamentSensorBase {
private:
static bool poll_runout_state(const uint8_t extruder) {
const uint8_t runout_states = poll_runout_states();
#if MULTI_FILAMENT_SENSOR
if ( !TERN0(DUAL_X_CARRIAGE, idex_is_duplicating())
&& !TERN0(MULTI_NOZZLE_DUPLICATION, extruder_duplication_enabled)
) return TEST(runout_states, extruder); // A specific extruder ran out
#else
UNUSED(extruder);
#endif
return !!runout_states; // Any extruder ran out
}
public:
static void block_completed(const block_t * const) {}
static void run() {
for (uint8_t s = 0; s < NUM_RUNOUT_SENSORS; ++s) {
const bool out = poll_runout_state(s); const bool out = poll_runout_state(s);
if (!out) filament_present(s); if (!out) filament_present(s);
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG) #if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
static uint8_t was_out; // = 0 static uint8_t was_out; // = 0
if (out != TEST(was_out, s)) { if (out != TEST(was_out, s)) {
TBI(was_out, s); TBI(was_out, s);
SERIAL_ECHOLN(F("Filament Sensor "), AS_DIGIT(s), out ? F(" OUT") : F(" IN")); SERIAL_ECHOLNF(F("Filament Sensor "), AS_DIGIT(s), out ? F(" OUT") : F(" IN"));
} }
#endif #endif
} }
} }
}; }
};
#endif // HAS_FILAMENT_SWITCH
/**
* This is a simple endstop switch in the path of the filament.
* It can detect filament runout, but not stripouts or jams.
*/
class FilamentSensor : public FilamentSensorBase {
private:
TERN_(HAS_FILAMENT_MOTION, static FilamentSensorEncoder encoder_sensor);
TERN_(HAS_FILAMENT_SWITCH, static FilamentSensorSwitch switch_sensor);
public:
static void block_completed(const block_t * const b) {
TERN_(HAS_FILAMENT_MOTION, encoder_sensor.block_completed(b));
TERN_(HAS_FILAMENT_SWITCH, switch_sensor.block_completed(b));
}
static void run() {
TERN_(HAS_FILAMENT_MOTION, encoder_sensor.run());
TERN_(HAS_FILAMENT_SWITCH, switch_sensor.run());
}
};
/********************************* RESPONSE TYPE *********************************/ /********************************* RESPONSE TYPE *********************************/
#if HAS_FILAMENT_RUNOUT_DISTANCE // RunoutResponseDelayed triggers a runout event only if the length
// of filament specified by FIL_RUNOUT_DISTANCE_MM has been fed
// during a runout condition.
class RunoutResponseDelayed {
private:
static volatile float runout_mm_countdown[NUM_RUNOUT_SENSORS];
typedef struct { public:
float runout[NUM_RUNOUT_SENSORS]; static float runout_distance_mm[NUM_RUNOUT_SENSORS];
Flags<NUM_RUNOUT_SENSORS> runout_reset; // Reset runout later
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
float motion[NUM_MOTION_SENSORS];
Flags<NUM_MOTION_SENSORS> motion_reset; // Reset motion later
#endif
} countdown_t;
// RunoutResponseDelayed triggers a runout event only if the length static void reset() {
// of filament specified by FILAMENT_RUNOUT_DISTANCE_MM has been fed LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
// during a runout condition. }
class RunoutResponseDelayed {
private:
static countdown_t mm_countdown;
public: static void run() {
static float runout_distance_mm; #if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
static millis_t t = 0;
static void reset() { const millis_t ms = millis();
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i) filament_present(i); if (ELAPSED(ms, t)) {
#if ENABLED(FILAMENT_SWITCH_AND_MOTION) t = millis() + 1000UL;
for (uint8_t i = 0; i < NUM_MOTION_SENSORS; ++i) filament_motion_present(i); LOOP_L_N(i, NUM_RUNOUT_SENSORS)
#endif SERIAL_ECHOF(i ? F(", ") : F("Remaining mm: "), runout_mm_countdown[i]);
} SERIAL_EOL();
static void run() {
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
static millis_t t = 0;
const millis_t ms = millis();
if (ELAPSED(ms, t)) {
t = millis() + 1000UL;
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i)
SERIAL_ECHO(i ? F(", ") : F("Runout remaining mm: "), mm_countdown.runout[i]);
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
for (uint8_t i = 0; i < NUM_MOTION_SENSORS; ++i)
SERIAL_ECHO(i ? F(", ") : F("Motion remaining mm: "), mm_countdown.motion[i]);
#endif
SERIAL_EOL();
}
#endif
}
static runout_flags_t has_run_out() {
runout_flags_t runout_flags{0};
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i) if (mm_countdown.runout[i] < 0) runout_flags.set(i);
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
for (uint8_t i = 0; i < NUM_MOTION_SENSORS; ++i) if (mm_countdown.motion[i] < 0) runout_flags.set(i);
#endif
return runout_flags;
}
static void filament_present(const uint8_t extruder) {
if (mm_countdown.runout[extruder] < runout_distance_mm || did_pause_print) {
// Reset runout only if it is smaller than runout_distance or printing is paused.
// On Bowden systems retract may be larger than runout_distance_mm, so if retract
// was added leave it in place, or the following unretract will cause runout event.
mm_countdown.runout[extruder] = runout_distance_mm;
mm_countdown.runout_reset.clear(extruder);
}
else {
// If runout is larger than runout distance, we cannot reset right now, as Bowden and retract
// distance larger than runout_distance_mm leads to negative runout right after unretract.
// But we cannot ignore filament_present event. After unretract, runout will become smaller
// than runout_distance_mm and should be reset after that. So activate delayed reset.
mm_countdown.runout_reset.set(extruder);
}
}
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
static void filament_motion_present(const uint8_t extruder) {
// Same logic as filament_present
if (mm_countdown.motion[extruder] < runout_distance_mm || did_pause_print) {
mm_countdown.motion[extruder] = runout_distance_mm;
mm_countdown.motion_reset.clear(extruder);
}
else
mm_countdown.motion_reset.set(extruder);
} }
#endif #endif
}
static void block_completed(const block_t * const b) { static uint8_t has_run_out() {
const int32_t esteps = b->steps.e; uint8_t runout_flags = 0;
if (!esteps) return; LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i);
return runout_flags;
}
// No calculation unless paused or printing static void filament_present(const uint8_t extruder) {
if (!should_monitor_runout()) return; runout_mm_countdown[extruder] = runout_distance_mm[extruder];
}
// No need to ignore retract/unretract movement since they complement each other static void block_completed(const block_t * const b) {
if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state
// Only trigger on extrusion with XYZ movement to allow filament change and retract/recover.
const uint8_t e = b->extruder; const uint8_t e = b->extruder;
const float mm = (b->direction_bits.e ? esteps : -esteps) * planner.mm_per_step[E_AXIS_N(e)]; const int32_t steps = b->steps.e;
runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.mm_per_step[E_AXIS_N(e)];
if (e < NUM_RUNOUT_SENSORS) {
mm_countdown.runout[e] -= mm;
if (mm_countdown.runout_reset[e]) filament_present(e); // Reset pending. Try to reset.
}
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
if (e < NUM_MOTION_SENSORS) {
mm_countdown.motion[e] -= mm;
if (mm_countdown.motion_reset[e]) filament_motion_present(e); // Reset pending. Try to reset.
}
#endif
} }
}; }
};
#else // !HAS_FILAMENT_RUNOUT_DISTANCE
// RunoutResponseDebounced triggers a runout event after a runout
// condition has been detected runout_threshold times in a row.
class RunoutResponseDebounced {
private:
static constexpr int8_t runout_threshold = FILAMENT_RUNOUT_THRESHOLD;
static int8_t runout_count[NUM_RUNOUT_SENSORS];
public:
static void reset() {
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i) filament_present(i);
}
static void run() {
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i) if (runout_count[i] >= 0) runout_count[i]--;
}
static runout_flags_t has_run_out() {
runout_flags_t runout_flags{0};
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i) if (runout_count[i] < 0) runout_flags.set(i);
return runout_flags;
}
static void block_completed(const block_t * const) { }
static void filament_present(const uint8_t extruder) {
runout_count[extruder] = runout_threshold;
}
};
#endif // !HAS_FILAMENT_RUNOUT_DISTANCE
+1 -1
View File
@@ -763,7 +763,7 @@
SERIAL_CHAR('\t'); SERIAL_CHAR('\t');
st.printLabel(); st.printLabel();
SERIAL_CHAR('\t'); SERIAL_CHAR('\t');
print_hex_long(drv_status, ':'); print_hex_long(drv_status, ':', true);
if (drv_status == 0xFFFFFFFF || drv_status == 0) SERIAL_ECHOPGM("\t Bad response!"); if (drv_status == 0xFFFFFFFF || drv_status == 0) SERIAL_ECHOPGM("\t Bad response!");
SERIAL_EOL(); SERIAL_EOL();
break; break;
+18 -26
View File
@@ -144,15 +144,13 @@ class TMCMarlin : public TMC, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
#endif #endif
#endif #endif
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) void refresh_stepper_current() { rms_current(this->val_mA); }
void refresh_stepper_current() { rms_current(this->val_mA); }
#if ENABLED(HYBRID_THRESHOLD) #if ENABLED(HYBRID_THRESHOLD)
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
#endif #endif
#if USE_SENSORLESS #if USE_SENSORLESS
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
#endif
#endif #endif
static constexpr int8_t sgt_min = -64, static constexpr int8_t sgt_min = -64,
@@ -207,12 +205,10 @@ class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
} }
#endif #endif
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) void refresh_stepper_current() { rms_current(this->val_mA); }
void refresh_stepper_current() { rms_current(this->val_mA); }
#if ENABLED(HYBRID_THRESHOLD) #if ENABLED(HYBRID_THRESHOLD)
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
#endif
#endif #endif
}; };
@@ -269,15 +265,13 @@ class TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
} }
#endif #endif
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) void refresh_stepper_current() { rms_current(this->val_mA); }
void refresh_stepper_current() { rms_current(this->val_mA); }
#if ENABLED(HYBRID_THRESHOLD) #if ENABLED(HYBRID_THRESHOLD)
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
#endif #endif
#if USE_SENSORLESS #if USE_SENSORLESS
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
#endif
#endif #endif
static constexpr uint8_t sgt_min = 0, static constexpr uint8_t sgt_min = 0,
@@ -315,12 +309,10 @@ class TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC266
} }
#endif #endif
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) void refresh_stepper_current() { rms_current(this->val_mA); }
void refresh_stepper_current() { rms_current(this->val_mA); }
#if USE_SENSORLESS #if USE_SENSORLESS
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
#endif
#endif #endif
static constexpr int8_t sgt_min = -64, static constexpr int8_t sgt_min = -64,
+12 -12
View File
@@ -532,7 +532,7 @@ void GcodeSuite::G26() {
if (bedtemp) { if (bedtemp) {
if (!WITHIN(bedtemp, 40, BED_MAX_TARGET)) { if (!WITHIN(bedtemp, 40, BED_MAX_TARGET)) {
SERIAL_ECHOLNPGM("?Specified bed temperature not plausible (40-", BED_MAX_TARGET, "C)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified bed temperature not plausible (40-", BED_MAX_TARGET, "C)."));
return; return;
} }
g26.bed_temp = bedtemp; g26.bed_temp = bedtemp;
@@ -543,7 +543,7 @@ void GcodeSuite::G26() {
if (parser.seenval('L')) { if (parser.seenval('L')) {
g26.layer_height = parser.value_linear_units(); g26.layer_height = parser.value_linear_units();
if (!WITHIN(g26.layer_height, 0.0, 2.0)) { if (!WITHIN(g26.layer_height, 0.0, 2.0)) {
SERIAL_ECHOLNPGM("?Specified layer height not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified layer height not plausible."));
return; return;
} }
} }
@@ -552,12 +552,12 @@ void GcodeSuite::G26() {
if (parser.has_value()) { if (parser.has_value()) {
g26.retraction_multiplier = parser.value_float(); g26.retraction_multiplier = parser.value_float();
if (!WITHIN(g26.retraction_multiplier, 0.05, 15.0)) { if (!WITHIN(g26.retraction_multiplier, 0.05, 15.0)) {
SERIAL_ECHOLNPGM("?Specified Retraction Multiplier not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified Retraction Multiplier not plausible."));
return; return;
} }
} }
else { else {
SERIAL_ECHOLNPGM("?Retraction Multiplier must be specified."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Retraction Multiplier must be specified."));
return; return;
} }
} }
@@ -565,7 +565,7 @@ void GcodeSuite::G26() {
if (parser.seenval('S')) { if (parser.seenval('S')) {
g26.nozzle = parser.value_float(); g26.nozzle = parser.value_float();
if (!WITHIN(g26.nozzle, 0.1, 2.0)) { if (!WITHIN(g26.nozzle, 0.1, 2.0)) {
SERIAL_ECHOLNPGM("?Specified nozzle size not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified nozzle size not plausible."));
return; return;
} }
} }
@@ -575,7 +575,7 @@ void GcodeSuite::G26() {
#if HAS_MARLINUI_MENU #if HAS_MARLINUI_MENU
g26.prime_flag = -1; g26.prime_flag = -1;
#else #else
SERIAL_ECHOLNPGM("?Prime length must be specified when not using an LCD."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Prime length must be specified when not using an LCD."));
return; return;
#endif #endif
} }
@@ -583,7 +583,7 @@ void GcodeSuite::G26() {
g26.prime_flag++; g26.prime_flag++;
g26.prime_length = parser.value_linear_units(); g26.prime_length = parser.value_linear_units();
if (!WITHIN(g26.prime_length, 0.0, 25.0)) { if (!WITHIN(g26.prime_length, 0.0, 25.0)) {
SERIAL_ECHOLNPGM("?Specified prime length not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified prime length not plausible."));
return; return;
} }
} }
@@ -592,7 +592,7 @@ void GcodeSuite::G26() {
if (parser.seenval('F')) { if (parser.seenval('F')) {
g26.filament_diameter = parser.value_linear_units(); g26.filament_diameter = parser.value_linear_units();
if (!WITHIN(g26.filament_diameter, 1.0, 4.0)) { if (!WITHIN(g26.filament_diameter, 1.0, 4.0)) {
SERIAL_ECHOLNPGM("?Specified filament size not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified filament size not plausible."));
return; return;
} }
} }
@@ -616,7 +616,7 @@ void GcodeSuite::G26() {
// If any preset or temperature was specified // If any preset or temperature was specified
if (noztemp) { if (noztemp) {
if (!WITHIN(noztemp, 165, thermalManager.hotend_max_target(active_extruder))) { if (!WITHIN(noztemp, 165, thermalManager.hotend_max_target(active_extruder))) {
SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified nozzle temperature not plausible."));
return; return;
} }
g26.hotend_temp = noztemp; g26.hotend_temp = noztemp;
@@ -637,12 +637,12 @@ void GcodeSuite::G26() {
if (parser.seen('R')) if (parser.seen('R'))
g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1; g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1;
else { else {
SERIAL_ECHOLNPGM("?(R)epeat must be specified when not using an LCD."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(R)epeat must be specified when not using an LCD."));
return; return;
} }
#endif #endif
if (g26_repeats < 1) { if (g26_repeats < 1) {
SERIAL_ECHOLNPGM("?(R)epeat value not plausible; must be at least 1."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(R)epeat value not plausible; must be at least 1."));
return; return;
} }
@@ -650,7 +650,7 @@ void GcodeSuite::G26() {
g26.xy_pos.set(parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x, g26.xy_pos.set(parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x,
parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y); parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y);
if (!position_is_reachable(g26.xy_pos)) { if (!position_is_reachable(g26.xy_pos)) {
SERIAL_ECHOLNPGM("?Specified X,Y coordinate out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified X,Y coordinate out of bounds."));
return; return;
} }
+6 -4
View File
@@ -64,7 +64,7 @@ void GcodeSuite::G35() {
const uint8_t screw_thread = parser.byteval('S', TRAMMING_SCREW_THREAD); const uint8_t screw_thread = parser.byteval('S', TRAMMING_SCREW_THREAD);
if (!WITHIN(screw_thread, 30, 51) || screw_thread % 10 > 1) { if (!WITHIN(screw_thread, 30, 51) || screw_thread % 10 > 1) {
SERIAL_ECHOLNPGM("?(S)crew thread must be 30, 31, 40, 41, 50, or 51."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S)crew thread must be 30, 31, 40, 41, 50, or 51."));
return; return;
} }
@@ -95,9 +95,11 @@ void GcodeSuite::G35() {
for (uint8_t i = 0; i < G35_PROBE_COUNT; ++i) { for (uint8_t i = 0; i < G35_PROBE_COUNT; ++i) {
const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE); const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE);
if (isnan(z_probed_height)) { if (isnan(z_probed_height)) {
SERIAL_ECHO( SERIAL_ECHOLN(
F("G35 failed at point "), i + 1, F(" ("), FPSTR(pgm_read_ptr(&tramming_point_name[i])), C(')'), F("G35 failed at point "), i + 1,
FPSTR(SP_X_STR), tramming_points[i].x, FPSTR(SP_Y_STR), tramming_points[i].y F(" ("), FPSTR(pgm_read_ptr(&tramming_point_name[i])), C(')'),
FPSTR(SP_X_STR), tramming_points[i].x,
FPSTR(SP_Y_STR), tramming_points[i].y
); );
err_break = true; err_break = true;
break; break;
+5 -4
View File
@@ -105,13 +105,12 @@ void GcodeSuite::M420() {
const int16_t a = settings.calc_num_meshes(); const int16_t a = settings.calc_num_meshes();
if (!a) { if (!a) {
SERIAL_ECHOLNPGM("?EEPROM storage not available."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("EEPROM storage not available."));
return; return;
} }
if (!WITHIN(storage_slot, 0, a - 1)) { if (!WITHIN(storage_slot, 0, a - 1)) {
SERIAL_ECHOLNPGM("?Invalid storage slot."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Invalid storage slot. Use 0 to ", a - 1));
SERIAL_ECHOLNPGM("?Use 0 to ", a - 1);
return; return;
} }
@@ -120,7 +119,7 @@ void GcodeSuite::M420() {
#else #else
SERIAL_ECHOLNPGM("?EEPROM storage not available."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("EEPROM storage not available."));
return; return;
#endif #endif
@@ -245,6 +244,8 @@ void GcodeSuite::M420() {
} }
void GcodeSuite::M420_report(const bool forReplay/*=true*/) { void GcodeSuite::M420_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F( report_heading_etc(forReplay, F(
TERN(MESH_BED_LEVELING, "Mesh Bed Leveling", TERN(AUTO_BED_LEVELING_UBL, "Unified Bed Leveling", "Auto Bed Leveling")) TERN(MESH_BED_LEVELING, "Mesh Bed Leveling", TERN(AUTO_BED_LEVELING_UBL, "Unified Bed Leveling", "Auto Bed Leveling"))
)); ));
+6 -14
View File
@@ -51,8 +51,6 @@
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD) #elif ENABLED(DWIN_CREALITY_LCD)
#include "../../../lcd/e3v2/creality/dwin.h" #include "../../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@@ -77,7 +75,7 @@ static void pre_g29_return(const bool retry, const bool did) {
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false));
} }
if (did) { if (did) {
TERN_(HAS_DWIN_E3V2_BASIC, dwinLevelingDone()); TERN_(DWIN_CREALITY_LCD, dwinLevelingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
} }
} }
@@ -344,7 +342,7 @@ G29_TYPE GcodeSuite::G29() {
abl.verbose_level = parser.intval('V'); abl.verbose_level = parser.intval('V');
if (!WITHIN(abl.verbose_level, 0, 4)) { if (!WITHIN(abl.verbose_level, 0, 4)) {
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-4)."));
G29_RETURN(false, false); G29_RETURN(false, false);
} }
@@ -365,11 +363,11 @@ G29_TYPE GcodeSuite::G29() {
if (parser.seenval('P')) abl.grid_points.x = abl.grid_points.y = parser.value_int(); if (parser.seenval('P')) abl.grid_points.x = abl.grid_points.y = parser.value_int();
if (!WITHIN(abl.grid_points.x, 2, GRID_MAX_POINTS_X)) { if (!WITHIN(abl.grid_points.x, 2, GRID_MAX_POINTS_X)) {
SERIAL_ECHOLNPGM("?Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."));
G29_RETURN(false, false); G29_RETURN(false, false);
} }
if (!WITHIN(abl.grid_points.y, 2, GRID_MAX_POINTS_Y)) { if (!WITHIN(abl.grid_points.y, 2, GRID_MAX_POINTS_Y)) {
SERIAL_ECHOLNPGM("?Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."));
G29_RETURN(false, false); G29_RETURN(false, false);
} }
@@ -404,7 +402,7 @@ G29_TYPE GcodeSuite::G29() {
DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x, DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x,
" F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y); " F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y);
} }
SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG(" (L,R,F,B) out of bounds."));
G29_RETURN(false, false); G29_RETURN(false, false);
} }
@@ -425,8 +423,6 @@ G29_TYPE GcodeSuite::G29() {
#if ENABLED(AUTO_BED_LEVELING_3POINT) #if ENABLED(AUTO_BED_LEVELING_3POINT)
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling");
points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
#endif #endif
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
@@ -436,11 +432,7 @@ G29_TYPE GcodeSuite::G29() {
#if ENABLED(PREHEAT_BEFORE_LEVELING) #if ENABLED(PREHEAT_BEFORE_LEVELING)
if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP,
#if ALL(DWIN_LCD_PROUI, HAS_HEATED_BED) TERN(EXTENSIBLE_UI, ExtUI::getLevelingBedTemp(), LEVELING_BED_TEMP)
hmiData.bedLevT
#else
LEVELING_BED_TEMP
#endif
); );
#endif #endif
} }
-5
View File
@@ -40,8 +40,6 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@@ -144,7 +142,6 @@ void GcodeSuite::G29() {
queue.inject(F("G29S2")); queue.inject(F("G29S2"));
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
return; return;
} }
@@ -170,7 +167,6 @@ void GcodeSuite::G29() {
// Save Z for the previous mesh position // Save Z for the previous mesh position
bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z); bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z);
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z)); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z));
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z));
SET_SOFT_ENDSTOP_LOOSE(false); SET_SOFT_ENDSTOP_LOOSE(false);
} }
// If there's another point to sample, move there with optional lift. // If there's another point to sample, move there with optional lift.
@@ -237,7 +233,6 @@ void GcodeSuite::G29() {
if (parser.seenval('Z')) { if (parser.seenval('Z')) {
bedlevel.z_values[ix][iy] = parser.value_linear_units(); bedlevel.z_values[ix][iy] = parser.value_linear_units();
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy])); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
} }
else else
return echo_not_entered('Z'); return echo_not_entered('Z');
-3
View File
@@ -33,8 +33,6 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
/** /**
@@ -69,7 +67,6 @@ void GcodeSuite::M421() {
float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point
zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ij.x, ij.y, zval));
} }
} }
+2 -4
View File
@@ -52,8 +52,6 @@
#include "../../lcd/extui/ui_api.h" #include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD) #elif ENABLED(DWIN_CREALITY_LCD)
#include "../../lcd/e3v2/creality/dwin.h" #include "../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
#if ENABLED(LASER_FEATURE) #if ENABLED(LASER_FEATURE)
@@ -223,7 +221,7 @@ void GcodeSuite::G28() {
set_and_report_grblstate(M_HOMING); set_and_report_grblstate(M_HOMING);
#endif #endif
TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingStart()); TERN_(DWIN_CREALITY_LCD, dwinHomingStart());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
planner.synchronize(); // Wait for planner moves to finish! planner.synchronize(); // Wait for planner moves to finish!
@@ -652,7 +650,7 @@ void GcodeSuite::G28() {
ui.refresh(); ui.refresh();
TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingDone()); TERN_(DWIN_CREALITY_LCD, dwinHomingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone());
report_current_position(); report_current_position();
+4 -4
View File
@@ -390,7 +390,7 @@ void GcodeSuite::G33() {
const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS);
if (!WITHIN(probe_points, 0, 10)) { if (!WITHIN(probe_points, 0, 10)) {
SERIAL_ECHOLNPGM("?(P)oints implausible (0-10)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(P)oints implausible (0-10)."));
return; return;
} }
@@ -409,19 +409,19 @@ void GcodeSuite::G33() {
const float calibration_precision = parser.floatval('C', 0.0f); const float calibration_precision = parser.floatval('C', 0.0f);
if (calibration_precision < 0) { if (calibration_precision < 0) {
SERIAL_ECHOLNPGM("?(C)alibration precision implausible (>=0)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(C)alibration precision implausible (>=0)."));
return; return;
} }
const int8_t force_iterations = parser.intval('F', 0); const int8_t force_iterations = parser.intval('F', 0);
if (!WITHIN(force_iterations, 0, 30)) { if (!WITHIN(force_iterations, 0, 30)) {
SERIAL_ECHOLNPGM("?(F)orce iteration implausible (0-30)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(F)orce iteration implausible (0-30)."));
return; return;
} }
const int8_t verbose_level = parser.byteval('V', 1); const int8_t verbose_level = parser.byteval('V', 1);
if (!WITHIN(verbose_level, 0, 3)) { if (!WITHIN(verbose_level, 0, 3)) {
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-3)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-3)."));
return; return;
} }
+10 -8
View File
@@ -110,19 +110,19 @@ void GcodeSuite::G34() {
const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS); const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS);
if (!WITHIN(z_auto_align_iterations, 1, 30)) { if (!WITHIN(z_auto_align_iterations, 1, 30)) {
SERIAL_ECHOLNPGM("?(I)teration out of bounds (1-30)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(I)teration out of bounds (1-30)."));
break; break;
} }
const float z_auto_align_accuracy = parser.floatval('T', Z_STEPPER_ALIGN_ACC); const float z_auto_align_accuracy = parser.floatval('T', Z_STEPPER_ALIGN_ACC);
if (!WITHIN(z_auto_align_accuracy, 0.01f, 1.0f)) { if (!WITHIN(z_auto_align_accuracy, 0.001f, 1.0f)) {
SERIAL_ECHOLNPGM("?(T)arget accuracy out of bounds (0.01-1.0)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(T)arget accuracy out of bounds (0.001-1.0)."));
break; break;
} }
const float z_auto_align_amplification = TERN(HAS_Z_STEPPER_ALIGN_STEPPER_XY, Z_STEPPER_ALIGN_AMP, parser.floatval('A', Z_STEPPER_ALIGN_AMP)); const float z_auto_align_amplification = TERN(HAS_Z_STEPPER_ALIGN_STEPPER_XY, Z_STEPPER_ALIGN_AMP, parser.floatval('A', Z_STEPPER_ALIGN_AMP));
if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) {
SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(A)mplification out of bounds (0.5-2.0)."));
break; break;
} }
@@ -450,7 +450,7 @@ void GcodeSuite::M422() {
const bool is_probe_point = parser.seen_test('S'); const bool is_probe_point = parser.seen_test('S');
if (TERN0(HAS_Z_STEPPER_ALIGN_STEPPER_XY, is_probe_point && parser.seen_test('W'))) { if (TERN0(HAS_Z_STEPPER_ALIGN_STEPPER_XY, is_probe_point && parser.seen_test('W'))) {
SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S) and (W) may not be combined."));
return; return;
} }
@@ -460,7 +460,7 @@ void GcodeSuite::M422() {
); );
if (!is_probe_point && TERN1(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !parser.seen_test('W'))) { if (!is_probe_point && TERN1(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !parser.seen_test('W'))) {
SERIAL_ECHOLNPGM("?(S)" TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, " or (W)") " is required."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S)" TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, " or (W)") " is required."));
return; return;
} }
@@ -490,11 +490,11 @@ void GcodeSuite::M422() {
if (is_probe_point) { if (is_probe_point) {
if (!probe.can_reach(pos.x, Y_CENTER)) { if (!probe.can_reach(pos.x, Y_CENTER)) {
SERIAL_ECHOLNPGM("?(X) out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(X) out of bounds."));
return; return;
} }
if (!probe.can_reach(pos)) { if (!probe.can_reach(pos)) {
SERIAL_ECHOLNPGM("?(Y) out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(Y) out of bounds."));
return; return;
} }
} }
@@ -503,6 +503,8 @@ void GcodeSuite::M422() {
} }
void GcodeSuite::M422_report(const bool forReplay/*=true*/) { void GcodeSuite::M422_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_Z_AUTO_ALIGN)); report_heading(forReplay, F(STR_Z_AUTO_ALIGN));
for (uint8_t i = 0; i < NUM_Z_STEPPERS; ++i) { for (uint8_t i = 0; i < NUM_Z_STEPPERS; ++i) {
report_echo_start(forReplay); report_echo_start(forReplay);
+2
View File
@@ -106,6 +106,8 @@ void GcodeSuite::M425() {
} }
void GcodeSuite::M425_report(const bool forReplay/*=true*/) { void GcodeSuite::M425_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_BACKLASH_COMPENSATION)); report_heading_etc(forReplay, F(STR_BACKLASH_COMPENSATION));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M425 F"), backlash.get_correction() PSTR(" M425 F"), backlash.get_correction()
+4 -4
View File
@@ -62,13 +62,13 @@ void GcodeSuite::M48() {
const int8_t verbose_level = parser.byteval('V', 1); const int8_t verbose_level = parser.byteval('V', 1);
if (!WITHIN(verbose_level, 0, 4)) { if (!WITHIN(verbose_level, 0, 4)) {
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-4)."));
return; return;
} }
const int8_t n_samples = parser.byteval('P', 10); const int8_t n_samples = parser.byteval('P', 10);
if (!WITHIN(n_samples, 4, 50)) { if (!WITHIN(n_samples, 4, 50)) {
SERIAL_ECHOLNPGM("?Sample size not plausible (4-50)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Sample size not plausible (4-50)."));
return; return;
} }
@@ -82,7 +82,7 @@ void GcodeSuite::M48() {
if (!probe.can_reach(test_position)) { if (!probe.can_reach(test_position)) {
LCD_MESSAGE_MAX(MSG_M48_OUT_OF_BOUNDS); LCD_MESSAGE_MAX(MSG_M48_OUT_OF_BOUNDS);
SERIAL_ECHOLNPGM("? (X,Y) out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG(" (X,Y) out of bounds."));
return; return;
} }
@@ -90,7 +90,7 @@ void GcodeSuite::M48() {
bool seen_L = parser.seen('L'); bool seen_L = parser.seen('L');
uint8_t n_legs = seen_L ? parser.value_byte() : 0; uint8_t n_legs = seen_L ? parser.value_byte() : 0;
if (n_legs > 15) { if (n_legs > 15) {
SERIAL_ECHOLNPGM("?Legs of movement implausible (0-15)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Legs of movement implausible (0-15)."));
return; return;
} }
if (n_legs == 1) n_legs = 2; if (n_legs == 1) n_legs = 2;
+8 -1
View File
@@ -62,6 +62,8 @@
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_DELTA_SETTINGS)); report_heading_etc(forReplay, F(STR_DELTA_SETTINGS));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod) PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod)
@@ -132,6 +134,8 @@
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_SCARA_SETTINGS " (" STR_S_SEG_PER_SEC TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")")); report_heading_etc(forReplay, F(STR_SCARA_SETTINGS " (" STR_S_SEG_PER_SEC TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")"));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M665 S"), segments_per_second PSTR(" M665 S"), segments_per_second
@@ -170,6 +174,8 @@
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_POLARGRAPH_SETTINGS)); report_heading_etc(forReplay, F(STR_POLARGRAPH_SETTINGS));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M665 S"), LINEAR_UNIT(segments_per_second), PSTR(" M665 S"), LINEAR_UNIT(segments_per_second),
@@ -196,10 +202,11 @@
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_POLAR_SETTINGS)); report_heading_etc(forReplay, F(STR_POLAR_SETTINGS));
SERIAL_ECHOLNPGM_P(PSTR(" M665 S"), segments_per_second); SERIAL_ECHOLNPGM_P(PSTR(" M665 S"), segments_per_second);
} }
#endif #endif // POLAR
#endif // IS_KINEMATIC #endif // IS_KINEMATIC
+5 -1
View File
@@ -56,11 +56,13 @@
} }
} }
} }
if (is_err) SERIAL_ECHOLNPGM("?M666 offsets must be <= 0"); if (is_err) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("M666 offsets must be <= 0"));
if (!is_set) M666_report(); if (!is_set) M666_report();
} }
void GcodeSuite::M666_report(const bool forReplay/*=true*/) { void GcodeSuite::M666_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT)); report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a) PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a)
@@ -105,6 +107,8 @@
} }
void GcodeSuite::M666_report(const bool forReplay/*=true*/) { void GcodeSuite::M666_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT)); report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT));
SERIAL_ECHOPGM(" M666"); SERIAL_ECHOPGM(" M666");
#if ENABLED(X_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS)
+2
View File
@@ -92,6 +92,8 @@ void GcodeSuite::M852() {
} }
void GcodeSuite::M852_report(const bool forReplay/*=true*/) { void GcodeSuite::M852_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_SKEW_FACTOR)); report_heading_etc(forReplay, F(STR_SKEW_FACTOR));
SERIAL_ECHOPGM(" M852 I", p_float_t(planner.skew_factor.xy, 6)); SERIAL_ECHOPGM(" M852 I", p_float_t(planner.skew_factor.xy, 6));
#if ENABLED(SKEW_CORRECTION_FOR_Z) #if ENABLED(SKEW_CORRECTION_FOR_Z)
+11 -1
View File
@@ -67,7 +67,7 @@
if (WITHIN(lval, 0, VOLUMETRIC_EXTRUDER_LIMIT_MAX)) if (WITHIN(lval, 0, VOLUMETRIC_EXTRUDER_LIMIT_MAX))
planner.set_volumetric_extruder_limit(target_extruder, lval); planner.set_volumetric_extruder_limit(target_extruder, lval);
else else
SERIAL_ECHOLNPGM("?L value out of range (0-" STRINGIFY(VOLUMETRIC_EXTRUDER_LIMIT_MAX) ")."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("L value out of range (0-" STRINGIFY(VOLUMETRIC_EXTRUDER_LIMIT_MAX) ")."));
} }
#endif #endif
@@ -75,6 +75,8 @@
} }
void GcodeSuite::M200_report(const bool forReplay/*=true*/) { void GcodeSuite::M200_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
if (!forReplay) { if (!forReplay) {
report_heading(forReplay, F(STR_FILAMENT_SETTINGS), false); report_heading(forReplay, F(STR_FILAMENT_SETTINGS), false);
if (!parser.volumetric_enabled) SERIAL_ECHOPGM(" (Disabled):"); if (!parser.volumetric_enabled) SERIAL_ECHOPGM(" (Disabled):");
@@ -142,6 +144,8 @@ void GcodeSuite::M201() {
} }
void GcodeSuite::M201_report(const bool forReplay/*=true*/) { void GcodeSuite::M201_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_MAX_ACCELERATION)); report_heading_etc(forReplay, F(STR_MAX_ACCELERATION));
#if NUM_AXES #if NUM_AXES
SERIAL_ECHOPGM_P( SERIAL_ECHOPGM_P(
@@ -198,6 +202,8 @@ void GcodeSuite::M203() {
} }
void GcodeSuite::M203_report(const bool forReplay/*=true*/) { void GcodeSuite::M203_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_MAX_FEEDRATES)); report_heading_etc(forReplay, F(STR_MAX_FEEDRATES));
#if NUM_AXES #if NUM_AXES
SERIAL_ECHOPGM_P( SERIAL_ECHOPGM_P(
@@ -255,6 +261,8 @@ void GcodeSuite::M204() {
} }
void GcodeSuite::M204_report(const bool forReplay/*=true*/) { void GcodeSuite::M204_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_ACCELERATION_P_R_T)); report_heading_etc(forReplay, F(STR_ACCELERATION_P_R_T));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M204 P"), LINEAR_UNIT(planner.settings.acceleration) PSTR(" M204 P"), LINEAR_UNIT(planner.settings.acceleration)
@@ -329,6 +337,8 @@ void GcodeSuite::M205() {
} }
void GcodeSuite::M205_report(const bool forReplay/*=true*/) { void GcodeSuite::M205_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F( report_heading_etc(forReplay, F(
"Advanced (" M205_MIN_SEG_TIME_STR "<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>" "Advanced (" M205_MIN_SEG_TIME_STR "<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>") TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
+2
View File
@@ -164,6 +164,8 @@ void GcodeSuite::M217() {
} }
void GcodeSuite::M217_report(const bool forReplay/*=true*/) { void GcodeSuite::M217_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_TOOL_CHANGING)); report_heading_etc(forReplay, F(STR_TOOL_CHANGING));
SERIAL_ECHOPGM(" M217"); SERIAL_ECHOPGM(" M217");
+2
View File
@@ -63,6 +63,8 @@ void GcodeSuite::M218() {
} }
void GcodeSuite::M218_report(const bool forReplay/*=true*/) { void GcodeSuite::M218_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_HOTEND_OFFSETS)); report_heading_etc(forReplay, F(STR_HOTEND_OFFSETS));
for (uint8_t e = 1; e < HOTENDS; ++e) { for (uint8_t e = 1; e < HOTENDS; ++e) {
report_echo_start(forReplay); report_echo_start(forReplay);
+2
View File
@@ -55,6 +55,8 @@ void GcodeSuite::M281() {
} }
void GcodeSuite::M281_report(const bool forReplay/*=true*/) { void GcodeSuite::M281_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_SERVO_ANGLES)); report_heading_etc(forReplay, F(STR_SERVO_ANGLES));
for (uint8_t i = 0; i < NUM_SERVOS; ++i) { for (uint8_t i = 0; i < NUM_SERVOS; ++i) {
switch (i) { switch (i) {
+2
View File
@@ -78,6 +78,8 @@ void GcodeSuite::M301() {
} }
void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t eindex/*=-1*/)) { void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t eindex/*=-1*/)) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_HOTEND_PID)); report_heading(forReplay, F(STR_HOTEND_PID));
IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr int8_t eindex = -1); IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr int8_t eindex = -1);
HOTEND_LOOP() { HOTEND_LOOP() {
+10 -8
View File
@@ -25,12 +25,13 @@
#if ENABLED(PREVENT_COLD_EXTRUSION) #if ENABLED(PREVENT_COLD_EXTRUSION)
#include "../gcode.h" #include "../gcode.h"
#include "../../module/temperature.h"
#if ENABLED(DWIN_LCD_PROUI) #if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/e3v2/proui/dwin.h" #include "../../lcd/extui/ui_api.h"
#endif #endif
#include "../../module/temperature.h"
/** /**
* M302: Allow cold extrudes, or set the minimum extrude temperature * M302: Allow cold extrudes, or set the minimum extrude temperature
* *
@@ -50,13 +51,14 @@ void GcodeSuite::M302() {
const bool seen_S = parser.seen('S'); const bool seen_S = parser.seen('S');
if (seen_S) { if (seen_S) {
thermalManager.extrude_min_temp = parser.value_celsius(); thermalManager.extrude_min_temp = parser.value_celsius();
thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); TERN_(EXTENSIBLE_UI, ExtUI::onSetMinExtrusionTemp(thermalManager.extrude_min_temp));
TERN_(DWIN_LCD_PROUI, hmiData.extMinT = thermalManager.extrude_min_temp);
} }
if (parser.seen('P')) const bool seen_P = parser.seen('P');
thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || parser.value_bool(); if (seen_P || seen_S) {
else if (!seen_S) { thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || (seen_P && parser.value_bool());
}
else {
// Report current state // Report current state
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOLN(F("Cold extrudes are "), thermalManager.allow_cold_extrude ? F("en") : F("dis"), F("abled (min temp "), thermalManager.extrude_min_temp, F("C)")); SERIAL_ECHOLN(F("Cold extrudes are "), thermalManager.allow_cold_extrude ? F("en") : F("dis"), F("abled (min temp "), thermalManager.extrude_min_temp, F("C)"));
+2
View File
@@ -42,6 +42,8 @@ void GcodeSuite::M304() {
} }
void GcodeSuite::M304_report(const bool forReplay/*=true*/) { void GcodeSuite::M304_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_BED_PID)); report_heading_etc(forReplay, F(STR_BED_PID));
SERIAL_ECHOLNPGM(" M304" SERIAL_ECHOLNPGM(" M304"
" P", thermalManager.temp_bed.pid.p() " P", thermalManager.temp_bed.pid.p()
+2
View File
@@ -42,6 +42,8 @@ void GcodeSuite::M309() {
} }
void GcodeSuite::M309_report(const bool forReplay/*=true*/) { void GcodeSuite::M309_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_CHAMBER_PID)); report_heading_etc(forReplay, F(STR_CHAMBER_PID));
SERIAL_ECHOLNPGM(" M309" SERIAL_ECHOLNPGM(" M309"
" P", thermalManager.temp_chamber.pid.p() " P", thermalManager.temp_chamber.pid.p()
+2
View File
@@ -96,6 +96,8 @@ void GcodeSuite::M92() {
} }
void GcodeSuite::M92_report(const bool forReplay/*=true*/, const int8_t e/*=-1*/) { void GcodeSuite::M92_report(const bool forReplay/*=true*/, const int8_t e/*=-1*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_STEPS_PER_UNIT)); report_heading_etc(forReplay, F(STR_STEPS_PER_UNIT));
#if NUM_AXES #if NUM_AXES
#define PRINT_EOL #define PRINT_EOL
+2
View File
@@ -40,6 +40,8 @@ void GcodeSuite::M211() {
} }
void GcodeSuite::M211_report(const bool forReplay/*=true*/) { void GcodeSuite::M211_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_SOFT_ENDSTOPS)); report_heading_etc(forReplay, F(STR_SOFT_ENDSTOPS));
SERIAL_ECHOPGM(" M211 S", AS_DIGIT(soft_endstop._enabled), " ; "); SERIAL_ECHOPGM(" M211 S", AS_DIGIT(soft_endstop._enabled), " ; ");
serialprintln_onoff(soft_endstop._enabled); serialprintln_onoff(soft_endstop._enabled);
+2 -2
View File
@@ -79,7 +79,7 @@ void GcodeSuite::M42() {
#ifdef OUTPUT_OPEN_DRAIN #ifdef OUTPUT_OPEN_DRAIN
case 5: pinMode(pin, OUTPUT_OPEN_DRAIN); break; case 5: pinMode(pin, OUTPUT_OPEN_DRAIN); break;
#endif #endif
default: SERIAL_ECHOLNPGM("Invalid Pin Mode"); return; default: SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Invalid Pin Mode")); return;
} }
} }
@@ -94,7 +94,7 @@ void GcodeSuite::M42() {
#endif #endif
if (avoidWrite) { if (avoidWrite) {
SERIAL_ECHOLNPGM("?Cannot write to INPUT"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Cannot write to INPUT"));
return; return;
} }
+6 -1
View File
@@ -32,11 +32,16 @@ void GcodeSuite::M85() {
const millis_t ms = parser.value_millis_from_seconds(); const millis_t ms = parser.value_millis_from_seconds();
#if LASER_SAFETY_TIMEOUT_MS > 0 #if LASER_SAFETY_TIMEOUT_MS > 0
if (ms && ms <= LASER_SAFETY_TIMEOUT_MS) { if (ms && ms <= LASER_SAFETY_TIMEOUT_MS) {
SERIAL_ECHO_MSG("M85 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety."); SERIAL_ECHO_MSG(GCODE_ERR_MSG("M85 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety."));
return; return;
} }
#endif #endif
max_inactive_time = ms; max_inactive_time = ms;
} }
else {
#if DISABLED(MARLIN_SMALL_BUILD)
SERIAL_ECHOLNPGM("Inactivity timeout ", MS_TO_SEC(max_inactive_time), " s.");
#endif
}
} }
+3 -3
View File
@@ -24,8 +24,8 @@
#if ENABLED(PLATFORM_M997_SUPPORT) #if ENABLED(PLATFORM_M997_SUPPORT)
#if ENABLED(DWIN_LCD_PROUI) #if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/e3v2/proui/dwin.h" #include "../../lcd/extui/ui_api.h"
#endif #endif
/** /**
@@ -33,7 +33,7 @@
*/ */
void GcodeSuite::M997() { void GcodeSuite::M997() {
TERN_(DWIN_LCD_PROUI, dwinRebootScreen()); TERN_(EXTENSIBLE_UI, ExtUI::onFirmwareFlash());
flashFirmware(parser.intval('S')); flashFirmware(parser.intval('S'));
@@ -141,6 +141,8 @@ void GcodeSuite::M900() {
} }
void GcodeSuite::M900_report(const bool forReplay/*=true*/) { void GcodeSuite::M900_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_LINEAR_ADVANCE)); report_heading(forReplay, F(STR_LINEAR_ADVANCE));
#if DISTINCT_E < 2 #if DISTINCT_E < 2
report_echo_start(forReplay); report_echo_start(forReplay);
@@ -67,6 +67,8 @@ void GcodeSuite::M710() {
} }
void GcodeSuite::M710_report(const bool forReplay/*=true*/) { void GcodeSuite::M710_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_CONTROLLER_FAN)); report_heading_etc(forReplay, F(STR_CONTROLLER_FAN));
SERIAL_ECHOLNPGM(" M710" SERIAL_ECHOLNPGM(" M710"
" S", int(controllerFan.settings.active_speed), " S", int(controllerFan.settings.active_speed),
@@ -126,12 +126,16 @@ void GcodeSuite::M907() {
#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM
void GcodeSuite::M907_report(const bool forReplay/*=true*/) { void GcodeSuite::M907_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_STEPPER_MOTOR_CURRENTS)); report_heading_etc(forReplay, F(STR_STEPPER_MOTOR_CURRENTS));
#if HAS_MOTOR_CURRENT_PWM #if HAS_MOTOR_CURRENT_PWM
SERIAL_ECHOLNPGM_P( // PWM-based has 3 values: SERIAL_ECHOLNPGM_P( // PWM-based has 3 values:
PSTR(" M907 X"), stepper.motor_current_setting[0] // X, Y, (I, J, K, U, V, W) PSTR(" M907 X"), stepper.motor_current_setting[0] // X, Y, (I, J, K, U, V, W)
, SP_Z_STR, stepper.motor_current_setting[1] // Z , SP_Z_STR, stepper.motor_current_setting[1] // Z
, SP_E_STR, stepper.motor_current_setting[2] // E #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
, SP_E_STR, stepper.motor_current_setting[2] // E
#endif
); );
#elif HAS_MOTOR_CURRENT_SPI #elif HAS_MOTOR_CURRENT_SPI
SERIAL_ECHOPGM(" M907"); // SPI-based has 5 values: SERIAL_ECHOPGM(" M907"); // SPI-based has 5 values:
@@ -104,6 +104,8 @@ void say_shaping() {
} }
void GcodeSuite::M493_report(const bool forReplay/*=true*/) { void GcodeSuite::M493_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_FT_MOTION)); report_heading_etc(forReplay, F(STR_FT_MOTION));
const ft_config_t &c = ftMotion.cfg; const ft_config_t &c = ftMotion.cfg;
SERIAL_ECHOPGM(" M493 S", c.mode); SERIAL_ECHOPGM(" M493 S", c.mode);
@@ -38,6 +38,8 @@
void GcodeSuite::M207() { fwretract.M207(); } void GcodeSuite::M207() { fwretract.M207(); }
void GcodeSuite::M207_report(const bool forReplay/*=true*/) { void GcodeSuite::M207_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_RETRACT_S_F_Z)); report_heading_etc(forReplay, F(STR_RETRACT_S_F_Z));
fwretract.M207_report(); fwretract.M207_report();
} }
@@ -53,6 +55,8 @@ void GcodeSuite::M207_report(const bool forReplay/*=true*/) {
void GcodeSuite::M208() { fwretract.M208(); } void GcodeSuite::M208() { fwretract.M208(); }
void GcodeSuite::M208_report(const bool forReplay/*=true*/) { void GcodeSuite::M208_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_RECOVER_S_F)); report_heading_etc(forReplay, F(STR_RECOVER_S_F));
fwretract.M208_report(); fwretract.M208_report();
} }
@@ -68,6 +72,8 @@ void GcodeSuite::M208_report(const bool forReplay/*=true*/) {
void GcodeSuite::M209() { fwretract.M209(); } void GcodeSuite::M209() { fwretract.M209(); }
void GcodeSuite::M209_report(const bool forReplay/*=true*/) { void GcodeSuite::M209_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_AUTO_RETRACT_S)); report_heading_etc(forReplay, F(STR_AUTO_RETRACT_S));
fwretract.M209_report(); fwretract.M209_report();
} }
@@ -28,6 +28,8 @@
#include "../../../module/stepper.h" #include "../../../module/stepper.h"
void GcodeSuite::M593_report(const bool forReplay/*=true*/) { void GcodeSuite::M593_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F("Input Shaping")); report_heading_etc(forReplay, F("Input Shaping"));
#if ENABLED(INPUT_SHAPING_X) #if ENABLED(INPUT_SHAPING_X)
SERIAL_ECHOLNPGM(" M593 X" SERIAL_ECHOLNPGM(" M593 X"
@@ -78,7 +80,7 @@ void GcodeSuite::M593() {
if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq); if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq);
} }
else else
SERIAL_ECHOLNPGM("?Frequency (F) must be greater than ", min_freq, " or 0 to disable"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Frequency (F) must be greater than ", min_freq, " or 0 to disable"));
} }
} }
@@ -97,6 +97,7 @@ void GcodeSuite::M552() {
} }
void GcodeSuite::M552_report() { void GcodeSuite::M552_report() {
TERN_(MARLIN_SMALL_BUILD, return);
ip_report(552, F("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip); ip_report(552, F("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip);
} }
@@ -111,6 +112,7 @@ void GcodeSuite::M553() {
} }
void GcodeSuite::M553_report() { void GcodeSuite::M553_report() {
TERN_(MARLIN_SMALL_BUILD, return);
ip_report(553, F("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet); ip_report(553, F("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet);
} }
@@ -125,6 +127,7 @@ void GcodeSuite::M554() {
} }
void GcodeSuite::M554_report() { void GcodeSuite::M554_report() {
TERN_(MARLIN_SMALL_BUILD, return);
ip_report(554, F("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway); ip_report(554, F("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway);
} }
@@ -28,6 +28,7 @@
#include "../../../module/stepper.h" #include "../../../module/stepper.h"
void GcodeSuite::M592_report(const bool forReplay/*=true*/) { void GcodeSuite::M592_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_NONLINEAR_EXTRUSION)); report_heading(forReplay, F(STR_NONLINEAR_EXTRUSION));
SERIAL_ECHOLNPGM(" M592 A", stepper.ne.A, " B", stepper.ne.B, " C", stepper.ne.C); SERIAL_ECHOLNPGM(" M592 A", stepper.ne.A, " B", stepper.ne.B, " C", stepper.ne.C);
} }
+1 -1
View File
@@ -94,7 +94,7 @@ void GcodeSuite::M600() {
// In this case, for duplicating modes set DXC_ext to the extruder that ran out. // In this case, for duplicating modes set DXC_ext to the extruder that ran out.
#if MULTI_FILAMENT_SENSOR #if MULTI_FILAMENT_SENSOR
if (idex_is_duplicating()) if (idex_is_duplicating())
DXC_ext = (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT2_STATE) ? 1 : 0; DXC_ext = (READ(FIL_RUNOUT2_PIN) == runout.out_state(1)) ? 1 : 0;
#else #else
DXC_ext = active_extruder; DXC_ext = active_extruder;
#endif #endif
+2
View File
@@ -61,6 +61,8 @@ void GcodeSuite::M603() {
} }
void GcodeSuite::M603_report(const bool forReplay/*=true*/) { void GcodeSuite::M603_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_FILAMENT_LOAD_UNLOAD)); report_heading(forReplay, F(STR_FILAMENT_LOAD_UNLOAD));
#if EXTRUDERS == 1 #if EXTRUDERS == 1
+4 -6
View File
@@ -37,8 +37,6 @@
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD) #elif ENABLED(DWIN_CREALITY_LCD)
#include "../../../lcd/e3v2/creality/dwin.h" #include "../../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented #include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented
#endif #endif
@@ -76,12 +74,12 @@ void GcodeSuite::M1000() {
if (!force_resume && parser.seen_test('S')) { if (!force_resume && parser.seen_test('S')) {
#if HAS_MARLINUI_MENU #if HAS_MARLINUI_MENU
ui.goto_screen(menu_job_recovery); ui.goto_screen(menu_job_recovery);
#elif HAS_DWIN_E3V2_BASIC
recovery.dwin_flag = true;
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) // Temporary fix until it can be better implemented
jyersDWIN.popupHandler(Popup_Resume);
#elif ENABLED(EXTENSIBLE_UI) #elif ENABLED(EXTENSIBLE_UI)
ExtUI::onPowerLossResume(); ExtUI::onPowerLossResume();
#elif HAS_PLR_UI_FLAG
recovery.ui_flag_resume = true;
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) // Temporary fix until it can be better implemented
jyersDWIN.popupHandler(Popup_Resume);
#else #else
SERIAL_ECHO_MSG("Resume requires LCD."); SERIAL_ECHO_MSG("Resume requires LCD.");
#endif #endif
@@ -64,6 +64,8 @@ void GcodeSuite::M413() {
} }
void GcodeSuite::M413_report(const bool forReplay/*=true*/) { void GcodeSuite::M413_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_POWER_LOSS_RECOVERY)); report_heading_etc(forReplay, F(STR_POWER_LOSS_RECOVERY));
SERIAL_ECHOPGM(" M413 S", AS_DIGIT(recovery.enabled) SERIAL_ECHOPGM(" M413 S", AS_DIGIT(recovery.enabled)
#if HAS_PLR_BED_THRESHOLD #if HAS_PLR_BED_THRESHOLD
-81
View File
@@ -1,81 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_FILAMENT_SENSOR
#include "../../gcode.h"
#include "../../../feature/runout.h"
/**
* M412: Enable / Disable filament runout detection
*
* Parameters
* R : Reset the runout sensor
* S<bool> : Reset and enable/disable the runout sensor
* H<bool> : Enable/disable host handling of filament runout
* D<linear> : Extra distance to continue after runout is triggered
*/
void GcodeSuite::M412() {
if (parser.seen("RS"
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, "D")
TERN_(HOST_ACTION_COMMANDS, "H")
)) {
#if ENABLED(HOST_ACTION_COMMANDS)
if (parser.seen('H')) runout.host_handling = parser.value_bool();
#endif
const bool seenR = parser.seen_test('R'), seenS = parser.seen('S');
if (seenR || seenS) runout.reset();
if (seenS) runout.enabled = parser.value_bool();
#if HAS_FILAMENT_RUNOUT_DISTANCE
if (parser.seenval('D')) runout.set_runout_distance(parser.value_linear_units());
#endif
}
else {
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Filament runout ");
serialprint_onoff(runout.enabled);
#if HAS_FILAMENT_RUNOUT_DISTANCE
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(), "mm");
#endif
#if ENABLED(HOST_ACTION_COMMANDS)
SERIAL_ECHOPGM(" ; Host handling ");
serialprint_onoff(runout.host_handling);
#endif
SERIAL_EOL();
}
}
void GcodeSuite::M412_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(STR_FILAMENT_RUNOUT_SENSOR));
SERIAL_ECHOPGM(
" M412 S", runout.enabled
#if HAS_FILAMENT_RUNOUT_DISTANCE
, " D", LINEAR_UNIT(runout.runout_distance())
#endif
, " ; Sensor "
);
serialprintln_onoff(runout.enabled);
}
#endif // HAS_FILAMENT_SENSOR
+97
View File
@@ -0,0 +1,97 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_FILAMENT_SENSOR
#include "../../gcode.h"
#include "../../../feature/runout.h"
/**
* M591: Configure filament runout detection
*
* Parameters
* R : Reset the runout sensor
* S<bool> : Reset and enable/disable the runout sensor
* H<bool> : Enable/disable host handling of filament runout
* L<linear> : Extra distance to continue after runout is triggered or motion interval
* D<linear> : Alias for L
* P<index> : Mode 0 = NONE
* 1 = Switch NO (HIGH = filament present)
* 2 = Switch NC (LOW = filament present)
* 3 = Encoder / Motion Sensor
*/
void GcodeSuite::M591() {
if (parser.seen("RSDP" TERN_(HOST_ACTION_COMMANDS, "H"))) {
#if ENABLED(HOST_ACTION_COMMANDS)
if (parser.seen('H')) runout.host_handling = parser.value_bool();
#endif
const bool seenR = parser.seen_test('R'), seenS = parser.seen('S');
if (seenR || seenS) runout.reset();
const uint8_t tool = TERN0(MULTI_FILAMENT_SENSOR, parser.ushortval('E', active_extruder));
if (seenS) runout.enabled[tool] = parser.value_bool();
if (parser.seen('D') || parser.seen('L')) runout.set_runout_distance(parser.value_linear_units(), tool);
if (parser.seen('P')) {
const RunoutMode tmp_mode = (RunoutMode)parser.value_int();
switch (tmp_mode) {
case RM_NONE ... RM_OUT_ON_HIGH:
case RM_MOTION_SENSOR:
runout.mode[tool] = tmp_mode;
runout.setup();
default: break;
}
}
}
else {
#if DISABLED(SLIM_LCD_MENUS)
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Filament runout ");
serialprint_onoff(runout.enabled[active_extruder]);
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(active_extruder), "mm");
SERIAL_ECHOPGM(" ; Mode ", runout.mode[active_extruder]);
#if ENABLED(HOST_ACTION_COMMANDS)
SERIAL_ECHOPGM(" ; Host handling ");
serialprint_onoff(runout.host_handling);
#endif
SERIAL_EOL();
#else
M591_report(false);
#endif
}
}
void GcodeSuite::M591_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(STR_FILAMENT_RUNOUT_SENSOR));
LOOP_S_L_N(e, 1, NUM_RUNOUT_SENSORS)
SERIAL_ECHOLNPGM(
" M591"
#if MULTI_FILAMENT_SENSOR
" E", e,
#endif
" S", runout.enabled[e]
, " D", LINEAR_UNIT(runout.runout_distance(e))
, " P", runout.mode[e]
);
}
#endif // HAS_FILAMENT_SENSOR
@@ -155,6 +155,8 @@ void GcodeSuite::M569() {
} }
void GcodeSuite::M569_report(const bool forReplay/*=true*/) { void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_DRIVER_STEPPING_MODE)); report_heading(forReplay, F(STR_DRIVER_STEPPING_MODE));
auto say_M569 = [](const bool forReplay, FSTR_P const etc=nullptr, const bool eol=false) { auto say_M569 = [](const bool forReplay, FSTR_P const etc=nullptr, const bool eol=false) {
@@ -231,6 +231,8 @@ void GcodeSuite::M906() {
} }
void GcodeSuite::M906_report(const bool forReplay/*=true*/) { void GcodeSuite::M906_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_STEPPER_DRIVER_CURRENT)); report_heading(forReplay, F(STR_STEPPER_DRIVER_CURRENT));
auto say_M906 = [](const bool forReplay) { auto say_M906 = [](const bool forReplay) {
@@ -378,6 +378,8 @@
} }
void GcodeSuite::M913_report(const bool forReplay/*=true*/) { void GcodeSuite::M913_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_HYBRID_THRESHOLD)); report_heading(forReplay, F(STR_HYBRID_THRESHOLD));
auto say_M913 = [](const bool forReplay) { auto say_M913 = [](const bool forReplay) {
@@ -565,6 +567,8 @@
} }
void GcodeSuite::M914_report(const bool forReplay/*=true*/) { void GcodeSuite::M914_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_STALLGUARD_THRESHOLD)); report_heading(forReplay, F(STR_STALLGUARD_THRESHOLD));
auto say_M914 = [](const bool forReplay) { auto say_M914 = [](const bool forReplay) {
+4 -4
View File
@@ -64,7 +64,7 @@ void GcodeSuite::M919() {
if (WITHIN(toff, 1, 15)) if (WITHIN(toff, 1, 15))
DEBUG_ECHOLNPGM(".toff: ", toff); DEBUG_ECHOLNPGM(".toff: ", toff);
else { else {
SERIAL_ECHOLNPGM("?O out of range (1..15)"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("O out of range (1..15)"));
err = true; err = true;
} }
} }
@@ -74,7 +74,7 @@ void GcodeSuite::M919() {
if (WITHIN(hend, -3, 12)) if (WITHIN(hend, -3, 12))
DEBUG_ECHOLNPGM(".hend: ", hend); DEBUG_ECHOLNPGM(".hend: ", hend);
else { else {
SERIAL_ECHOLNPGM("?P out of range (-3..12)"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("P out of range (-3..12)"));
err = true; err = true;
} }
} }
@@ -84,7 +84,7 @@ void GcodeSuite::M919() {
if (WITHIN(hstrt, 1, 8)) if (WITHIN(hstrt, 1, 8))
DEBUG_ECHOLNPGM(".hstrt: ", hstrt); DEBUG_ECHOLNPGM(".hstrt: ", hstrt);
else { else {
SERIAL_ECHOLNPGM("?S out of range (1..8)"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("S out of range (1..8)"));
err = true; err = true;
} }
} }
@@ -118,7 +118,7 @@ void GcodeSuite::M919() {
// Get the chopper timing for the specified axis and index // Get the chopper timing for the specified axis and index
switch (i) { switch (i) {
default: // A specified axis isn't Trinamic default: // A specified axis isn't Trinamic
SERIAL_ECHOLNPGM("?Axis ", C(AXIS_CHAR(i)), " has no TMC drivers."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Axis ", C(AXIS_CHAR(i)), " has no TMC drivers."));
break; break;
#if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2)
+60 -80
View File
@@ -75,14 +75,26 @@ GcodeSuite gcode;
millis_t GcodeSuite::previous_move_ms = 0, millis_t GcodeSuite::previous_move_ms = 0,
GcodeSuite::max_inactive_time = 0; GcodeSuite::max_inactive_time = 0;
#if HAS_DISABLE_IDLE_AXES #if HAS_DISABLE_INACTIVE_AXIS
millis_t GcodeSuite::stepper_inactive_time = SEC_TO_MS(DEFAULT_STEPPER_TIMEOUT_SEC); millis_t GcodeSuite::stepper_inactive_time = SEC_TO_MS(DEFAULT_STEPPER_DEACTIVE_TIME);
#endif #endif
// Relative motion mode for each logical axis // Relative motion mode for each logical axis
relative_t GcodeSuite::axis_relative; // Init in constructor static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES;
axis_bits_t GcodeSuite::axis_relative = 0 LOGICAL_AXIS_GANG(
| (ar_init.e << REL_E),
| (ar_init.x << REL_X),
| (ar_init.y << REL_Y),
| (ar_init.z << REL_Z),
| (ar_init.i << REL_I),
| (ar_init.j << REL_J),
| (ar_init.k << REL_K),
| (ar_init.u << REL_U),
| (ar_init.v << REL_V),
| (ar_init.w << REL_W)
);
#if ANY(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE) #if EITHER(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE)
bool GcodeSuite::autoreport_paused; // = false bool GcodeSuite::autoreport_paused; // = false
#endif #endif
@@ -105,7 +117,8 @@ void GcodeSuite::report_heading(const bool forReplay, FSTR_P const fstr, const b
if (forReplay) return; if (forReplay) return;
if (fstr) { if (fstr) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHO(F("; "), fstr); SERIAL_ECHOPGM("; ");
SERIAL_ECHOF(fstr);
} }
if (eol) { SERIAL_CHAR(':'); SERIAL_EOL(); } if (eol) { SERIAL_CHAR(':'); SERIAL_EOL(); }
} }
@@ -122,16 +135,14 @@ void GcodeSuite::say_units() {
* Return -1 if the T parameter is out of range * Return -1 if the T parameter is out of range
*/ */
int8_t GcodeSuite::get_target_extruder_from_command() { int8_t GcodeSuite::get_target_extruder_from_command() {
#if HAS_TOOLCHANGE if (parser.seenval('T')) {
if (parser.seenval('T')) { const int8_t e = parser.value_byte();
const int8_t e = parser.value_byte(); if (e < EXTRUDERS) return e;
if (e < EXTRUDERS) return e; SERIAL_ECHO_START();
SERIAL_ECHO_START(); SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum);
SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); SERIAL_ECHOLNPGM(" " STR_INVALID_EXTRUDER " ", e);
SERIAL_ECHOLNPGM(" " STR_INVALID_EXTRUDER " ", e); return -1;
return -1; }
}
#endif
return active_extruder; return active_extruder;
} }
@@ -155,7 +166,7 @@ int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) {
} }
/** /**
* Set XYZ...E destination and feedrate from the current G-Code command * Set XYZ...E destination and feedrate from the current GCode command
* *
* - Set destination from included axis codes * - Set destination from included axis codes
* - Set to current for missing axis codes * - Set to current for missing axis codes
@@ -205,13 +216,13 @@ void GcodeSuite::get_destination_from_command() {
TERN_(LASER_FEATURE, cutter.feedrate_mm_m = MMS_TO_MMM(feedrate_mm_s)); TERN_(LASER_FEATURE, cutter.feedrate_mm_m = MMS_TO_MMM(feedrate_mm_s));
} }
#if ALL(PRINTCOUNTER, HAS_EXTRUDERS) #if BOTH(PRINTCOUNTER, HAS_EXTRUDERS)
if (!DEBUGGING(DRYRUN) && !skip_move) if (!DEBUGGING(DRYRUN) && !skip_move)
print_job_timer.incFilamentUsed(destination.e - current_position.e); print_job_timer.incFilamentUsed(destination.e - current_position.e);
#endif #endif
// Get ABCDHI mixing factors // Get ABCDHI mixing factors
#if ALL(MIXING_EXTRUDER, DIRECT_MIXING_IN_G1) #if BOTH(MIXING_EXTRUDER, DIRECT_MIXING_IN_G1)
M165(); M165();
#endif #endif
@@ -443,7 +454,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 61: G61(); break; // G61: Apply/restore saved coordinates. case 61: G61(); break; // G61: Apply/restore saved coordinates.
#endif #endif
#if ALL(PTC_PROBE, PTC_BED) #if BOTH(PTC_PROBE, PTC_BED)
case 76: G76(); break; // G76: Calibrate first layer compensation values case 76: G76(); break; // G76: Calibrate first layer compensation values
#endif #endif
@@ -461,7 +472,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#endif #endif
#if ENABLED(DEBUG_GCODE_PARSER) #if ENABLED(DEBUG_GCODE_PARSER)
case 800: parser.debug(); break; // G800: G-Code Parser Test for G case 800: parser.debug(); break; // G800: GCode Parser Test for G
#endif #endif
default: parser.unknown_command_warning(); break; default: parser.unknown_command_warning(); break;
@@ -485,11 +496,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 7: M7(); break; // M7: Coolant Mist ON case 7: M7(); break; // M7: Coolant Mist ON
#endif #endif
#if ANY(AIR_ASSIST, COOLANT_FLOOD) #if EITHER(AIR_ASSIST, COOLANT_FLOOD)
case 8: M8(); break; // M8: Air Assist / Coolant Flood ON case 8: M8(); break; // M8: Air Assist / Coolant Flood ON
#endif #endif
#if ANY(AIR_ASSIST, COOLANT_CONTROL) #if EITHER(AIR_ASSIST, COOLANT_CONTROL)
case 9: M9(); break; // M9: Air Assist / Coolant OFF case 9: M9(); break; // M9: Air Assist / Coolant OFF
#endif #endif
@@ -508,7 +519,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 17: M17(); break; // M17: Enable all stepper motors case 17: M17(); break; // M17: Enable all stepper motors
#if HAS_MEDIA #if ENABLED(SDSUPPORT)
case 20: M20(); break; // M20: List SD card case 20: M20(); break; // M20: List SD card
case 21: M21(); break; // M21: Init SD card case 21: M21(); break; // M21: Init SD card
case 22: M22(); break; // M22: Release SD card case 22: M22(); break; // M22: Release SD card
@@ -529,12 +540,12 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 33: M33(); break; // M33: Get the long full path to a file or folder case 33: M33(); break; // M33: Get the long full path to a file or folder
#endif #endif
#if ALL(SDCARD_SORT_ALPHA, SDSORT_GCODE) #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
case 34: M34(); break; // M34: Set SD card sorting options case 34: M34(); break; // M34: Set SD card sorting options
#endif #endif
case 928: M928(); break; // M928: Start SD write case 928: M928(); break; // M928: Start SD write
#endif // HAS_MEDIA #endif // SDSUPPORT
case 31: M31(); break; // M31: Report time since the start of SD print or last M109 case 31: M31(); break; // M31: Report time since the start of SD print or last M109
@@ -570,7 +581,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 102: M102(); break; // M102: Configure Bed Distance Sensor case 102: M102(); break; // M102: Configure Bed Distance Sensor
#endif #endif
#if HAS_HOTEND #if HAS_EXTRUDERS
case 104: M104(); break; // M104: Set hot end temperature case 104: M104(); break; // M104: Set hot end temperature
case 109: M109(); break; // M109: Wait for hotend temperature to reach target case 109: M109(); break; // M109: Wait for hotend temperature to reach target
#endif #endif
@@ -629,7 +640,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 154: M154(); break; // M154: Set position auto-report interval case 154: M154(); break; // M154: Set position auto-report interval
#endif #endif
#if ALL(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR) #if BOTH(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR)
case 155: M155(); break; // M155: Set temperature auto-report interval case 155: M155(); break; // M155: Set temperature auto-report interval
#endif #endif
@@ -660,24 +671,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 82: M82(); break; // M82: Set E axis normal mode (same as other axes) case 82: M82(); break; // M82: Set E axis normal mode (same as other axes)
case 83: M83(); break; // M83: Set E axis relative mode case 83: M83(); break; // M83: Set E axis relative mode
#endif #endif
case 18: case 84: M18_M84(); break; // M18/M84: Disable Steppers / Set Timeout case 18: case 84: M18_M84(); break; // M18/M84: Disable Steppers / Set Timeout
case 85: M85(); break; // M85: Set inactivity stepper shutdown timeout case 85: M85(); break; // M85: Set inactivity stepper shutdown timeout
case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes
#if ENABLED(HOTEND_IDLE_TIMEOUT)
case 86: M86(); break; // M86: Set Hotend Idle Timeout
case 87: M87(); break; // M87: Cancel Hotend Idle Timeout
#endif
#if ENABLED(EDITABLE_STEPS_PER_UNIT)
case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes
#endif
case 114: M114(); break; // M114: Report current position case 114: M114(); break; // M114: Report current position
case 115: M115(); break; // M115: Report capabilities
#if ENABLED(CAPABILITIES_REPORT)
case 115: M115(); break; // M115: Report capabilities
#endif
case 117: TERN_(HAS_STATUS_MESSAGE, M117()); break; // M117: Set LCD message text, if possible case 117: TERN_(HAS_STATUS_MESSAGE, M117()); break; // M117: Set LCD message text, if possible
@@ -723,7 +721,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 204: M204(); break; // M204: Set acceleration case 204: M204(); break; // M204: Set acceleration
case 205: M205(); break; // M205: Set advanced settings case 205: M205(); break; // M205: Set advanced settings
#if HAS_HOME_OFFSET #if HAS_M206_COMMAND
case 206: M206(); break; // M206: Set home offsets case 206: M206(); break; // M206: Set home offsets
#endif #endif
@@ -771,10 +769,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
case 290: M290(); break; // M290: Babystepping case 290: M290(); break; // M290: Babystepping
#if ENABLED(EP_BABYSTEPPING)
case 293: IF_DISABLED(EMERGENCY_PARSER, M293()); break; // M293: Babystep up
case 294: IF_DISABLED(EMERGENCY_PARSER, M294()); break; // M294: Babystep down
#endif
#endif #endif
#if HAS_SOUND #if HAS_SOUND
@@ -801,7 +795,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 250: M250(); break; // M250: Set LCD contrast case 250: M250(); break; // M250: Set LCD contrast
#endif #endif
#if ENABLED(EDITABLE_DISPLAY_TIMEOUT) #if HAS_GCODE_M255
case 255: M255(); break; // M255: Set LCD Sleep/Backlight Timeout (Minutes) case 255: M255(); break; // M255: Set LCD Sleep/Backlight Timeout (Minutes)
#endif #endif
@@ -842,7 +836,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 364: if (M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta) case 364: if (M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta)
#endif #endif
#if ANY(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL) #if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL)
case 380: M380(); break; // M380: Activate solenoid on active (or specified) extruder case 380: M380(); break; // M380: Activate solenoid on active (or specified) extruder
case 381: M381(); break; // M381: Disable all solenoids or, if MANUAL_SOLENOID_CONTROL, active (or specified) solenoid case 381: M381(); break; // M381: Disable all solenoids or, if MANUAL_SOLENOID_CONTROL, active (or specified) solenoid
#endif #endif
@@ -865,10 +859,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 407: M407(); break; // M407: Display measured filament diameter case 407: M407(); break; // M407: Display measured filament diameter
#endif #endif
#if HAS_FILAMENT_SENSOR
case 412: M412(); break; // M412: Enable/Disable filament runout detection
#endif
#if HAS_MULTI_LANGUAGE #if HAS_MULTI_LANGUAGE
case 414: M414(); break; // M414: Select multi language menu case 414: M414(); break; // M414: Select multi language menu
#endif #endif
@@ -889,7 +879,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 425: M425(); break; // M425: Tune backlash compensation case 425: M425(); break; // M425: Tune backlash compensation
#endif #endif
#if HAS_HOME_OFFSET #if HAS_M206_COMMAND
case 428: M428(); break; // M428: Apply current_position to home_offset case 428: M428(); break; // M428: Apply current_position to home_offset
#endif #endif
@@ -901,10 +891,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 486: M486(); break; // M486: Identify and cancel objects case 486: M486(); break; // M486: Identify and cancel objects
#endif #endif
#if ENABLED(FT_MOTION)
case 493: M493(); break; // M493: Fixed-Time Motion control
#endif
case 500: M500(); break; // M500: Store settings in EEPROM case 500: M500(); break; // M500: Store settings in EEPROM
case 501: M501(); break; // M501: Read settings from EEPROM case 501: M501(); break; // M501: Read settings from EEPROM
case 502: M502(); break; // M502: Revert to default settings case 502: M502(); break; // M502: Revert to default settings
@@ -925,7 +911,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#endif #endif
#endif #endif
#if HAS_MEDIA #if ENABLED(SDSUPPORT)
case 524: M524(); break; // M524: Abort the current SD print job case 524: M524(); break; // M524: Abort the current SD print job
#endif #endif
@@ -943,19 +929,14 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 575: M575(); break; // M575: Set serial baudrate case 575: M575(); break; // M575: Set serial baudrate
#endif #endif
#if ENABLED(NONLINEAR_EXTRUSION) #if HAS_FILAMENT_SENSOR
case 592: M592(); break; // M592: Nonlinear Extrusion control case 412: M412(); break; // Alias to M591
#endif case 591: M591(); break; // M591 Configure filament runout detection
#if HAS_ZV_SHAPING
case 593: M593(); break; // M593: Input Shaping control
#endif #endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
case 600: M600(); break; // M600: Pause for Filament Change case 600: M600(); break; // M600: Pause for Filament Change
#if ENABLED(CONFIGURE_FILAMENT_CHANGE) case 603: M603(); break; // M603: Configure Filament Change
case 603: M603(); break; // M603: Configure Filament Change
#endif
#endif #endif
#if HAS_DUPLICATION_MODE #if HAS_DUPLICATION_MODE
@@ -966,7 +947,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 665: M665(); break; // M665: Set Kinematics parameters case 665: M665(); break; // M665: Set Kinematics parameters
#endif #endif
#if ANY(DELTA, HAS_EXTRA_ENDSTOPS) #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS
case 666: M666(); break; // M666: Set delta or multiple endstop adjustment case 666: M666(); break; // M666: Set delta or multiple endstop adjustment
#endif #endif
@@ -1007,7 +988,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#if ANY(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_PWM, HAS_MOTOR_CURRENT_I2C, HAS_MOTOR_CURRENT_DAC) #if ANY(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_PWM, HAS_MOTOR_CURRENT_I2C, HAS_MOTOR_CURRENT_DAC)
case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes. case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes.
#if ANY(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC) #if EITHER(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC)
case 908: M908(); break; // M908: Control digital trimpot directly. case 908: M908(); break; // M908: Control digital trimpot directly.
#if HAS_MOTOR_CURRENT_DAC #if HAS_MOTOR_CURRENT_DAC
case 909: M909(); break; // M909: Print digipot/DAC current value case 909: M909(); break; // M909: Print digipot/DAC current value
@@ -1045,7 +1026,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#endif #endif
#if ENABLED(DEBUG_GCODE_PARSER) #if ENABLED(DEBUG_GCODE_PARSER)
case 800: parser.debug(); break; // M800: G-Code Parser Test for M case 800: parser.debug(); break; // M800: GCode Parser Test for M
#endif #endif
#if ENABLED(GCODE_REPEAT_MARKERS) #if ENABLED(GCODE_REPEAT_MARKERS)
@@ -1073,11 +1054,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe
#endif #endif
#if ENABLED(OTA_FIRMWARE_UPDATE) #if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
case 936: M936(); break; // M936: OTA update firmware.
#endif
#if SPI_FLASH_BACKUP
case 993: M993(); break; // M993: Backup SPI Flash to SD case 993: M993(); break; // M993: Backup SPI Flash to SD
case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash
#endif #endif
@@ -1097,11 +1074,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 1000: M1000(); break; // M1000: [INTERNAL] Resume from power-loss case 1000: M1000(); break; // M1000: [INTERNAL] Resume from power-loss
#endif #endif
#if HAS_MEDIA #if ENABLED(SDSUPPORT)
case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion
#endif #endif
#if DGUS_LCD_UI_MKS #if ENABLED(DGUS_LCD_UI_MKS)
case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move
#endif #endif
@@ -1140,7 +1117,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
if (!no_ok) queue.ok_to_send(); if (!no_ok) queue.ok_to_send();
SERIAL_IMPL.msgDone(); // Call the msgDone serial hook to signal command processing done SERIAL_OUT(msgDone); // Call the msgDone serial hook to signal command processing done
} }
#if ENABLED(M100_FREE_MEMORY_DUMPER) #if ENABLED(M100_FREE_MEMORY_DUMPER)
@@ -1187,7 +1164,10 @@ void GcodeSuite::process_subcommands_now(FSTR_P fgcode) {
for (;;) { for (;;) {
PGM_P const delim = strchr_P(pgcode, '\n'); // Get address of next newline PGM_P const delim = strchr_P(pgcode, '\n'); // Get address of next newline
const size_t len = delim ? delim - pgcode : strlen_P(pgcode); // Get the command length const size_t len = delim ? delim - pgcode : strlen_P(pgcode); // Get the command length
parser.parse(MString<MAX_CMD_SIZE>().setn_P(pgcode, len)); // Parse the command char cmd[len + 1]; // Allocate a stack buffer
strncpy_P(cmd, pgcode, len); // Copy the command to the stack
cmd[len] = '\0'; // End with a nul
parser.parse(cmd); // Parse the command
process_parsed_command(true); // Process it (no "ok") process_parsed_command(true); // Process it (no "ok")
if (!delim) break; // Last command? if (!delim) break; // Last command?
pgcode = delim + 1; // Get the next command pgcode = delim + 1; // Get the next command
+10 -3
View File
@@ -234,7 +234,6 @@
* M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR) * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
* M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR) * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
* M410 - Quickstop. Abort all planned moves. * M410 - Quickstop. Abort all planned moves.
* M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
* M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY) * M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY)
* M414 - Set language by index. (Requires LCD_LANGUAGE_2...) * M414 - Set language by index. (Requires LCD_LANGUAGE_2...)
* M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL) * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
@@ -261,6 +260,7 @@
* M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE) * M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE)
* M592 - Get or set nonlinear extrusion parameters. (Requires NONLINEAR_EXTRUSION) * M592 - Get or set nonlinear extrusion parameters. (Requires NONLINEAR_EXTRUSION)
* M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY]) * M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY])
* M591 - Configure Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
* M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE) * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
* M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE) * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
* M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE) * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
@@ -341,6 +341,12 @@
#define HAS_FAST_MOVES 1 #define HAS_FAST_MOVES 1
#endif #endif
#if ENABLED(MARLIN_SMALL_BUILD)
#define GCODE_ERR_MSG(V...) "?"
#else
#define GCODE_ERR_MSG(V...) "?" V
#endif
enum AxisRelative : uint8_t { enum AxisRelative : uint8_t {
LOGICAL_AXIS_LIST(REL_E, REL_X, REL_Y, REL_Z, REL_I, REL_J, REL_K, REL_U, REL_V, REL_W) LOGICAL_AXIS_LIST(REL_E, REL_X, REL_Y, REL_Z, REL_I, REL_J, REL_K, REL_U, REL_V, REL_W)
#if HAS_EXTRUDERS #if HAS_EXTRUDERS
@@ -1029,8 +1035,9 @@ private:
#endif #endif
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
static void M412(); static void M412() { M591(); }
static void M412_report(const bool forReplay=true); static void M591();
static void M591_report(const bool forReplay=true);
#endif #endif
#if HAS_MULTI_LANGUAGE #if HAS_MULTI_LANGUAGE
+2 -2
View File
@@ -42,7 +42,7 @@
* G92 : Modify Workspace Offsets so the reported position shows the given X [Y [Z [A [B [C [U [V [W ]]]]]]]] [E]. * G92 : Modify Workspace Offsets so the reported position shows the given X [Y [Z [A [B [C [U [V [W ]]]]]]]] [E].
* G92.1 : Zero XYZ Workspace Offsets (so the reported position = the native position). * G92.1 : Zero XYZ Workspace Offsets (so the reported position = the native position).
* *
* With POWER_LOSS_RECOVERY: * With POWER_LOSS_RECOVERY or with AXISn_ROTATES:
* G92.9 : Set NATIVE Current Position to the given X [Y [Z [A [B [C [U [V [W ]]]]]]]] [E]. * G92.9 : Set NATIVE Current Position to the given X [Y [Z [A [B [C [U [V [W ]]]]]]]] [E].
*/ */
void GcodeSuite::G92() { void GcodeSuite::G92() {
@@ -67,7 +67,7 @@ void GcodeSuite::G92() {
break; break;
#endif #endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ANY(POWER_LOSS_RECOVERY, HAS_ROTATIONAL_AXES)
case 9: // G92.9 - Set Current Position directly (like Marlin 1.0) case 9: // G92.9 - Set Current Position directly (like Marlin 1.0)
LOOP_LOGICAL_AXES(i) { LOOP_LOGICAL_AXES(i) {
if (parser.seenval(AXIS_CHAR(i))) { if (parser.seenval(AXIS_CHAR(i))) {
+2
View File
@@ -48,6 +48,8 @@ void GcodeSuite::M206() {
} }
void GcodeSuite::M206_report(const bool forReplay/*=true*/) { void GcodeSuite::M206_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_HOME_OFFSET)); report_heading_etc(forReplay, F(STR_HOME_OFFSET));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
#if IS_CARTESIAN #if IS_CARTESIAN
+23 -8
View File
@@ -63,11 +63,25 @@
*/ */
void GcodeSuite::M115() { void GcodeSuite::M115() {
// Hosts should match one of these
#define MACHINE_KINEMATICS "" \
TERN_(COREXY, "COREXY") TERN_(COREYX, "COREYX") \
TERN_(COREXZ, "COREXZ") TERN_(COREZX, "COREZX") \
TERN_(COREYZ, "COREYZ") TERN_(COREZY, "COREZY") \
TERN_(MARKFORGED_XY, "MARKFORGED_XY") TERN_(MARKFORGED_YX, "MARKFORGED_YX") \
TERN_(POLARGRAPH, "POLARGRAPH") \
TERN_(POLAR, "POLAR") \
TERN_(DELTA, "DELTA") \
TERN_(IS_SCARA, "SCARA") \
TERN_(IS_CARTESIAN, "Cartesian") \
TERN_(BELTPRINTER, " BELTPRINTER")
SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin" SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin"
" " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ")" " " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ")"
" SOURCE_CODE_URL:" SOURCE_CODE_URL " SOURCE_CODE_URL:" SOURCE_CODE_URL
" PROTOCOL_VERSION:" PROTOCOL_VERSION " PROTOCOL_VERSION:" PROTOCOL_VERSION
" MACHINE_TYPE:" MACHINE_NAME " MACHINE_TYPE:" MACHINE_NAME
" KINEMATICS:" MACHINE_KINEMATICS
" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)
#if NUM_AXES != XYZ #if NUM_AXES != XYZ
" AXIS_COUNT:" STRINGIFY(NUM_AXES) " AXIS_COUNT:" STRINGIFY(NUM_AXES)
@@ -88,14 +102,15 @@ void GcodeSuite::M115() {
* This code should work on all STM32-based boards. * This code should work on all STM32-based boards.
*/ */
#if ENABLED(STM32_UID_SHORT_FORM) #if ENABLED(STM32_UID_SHORT_FORM)
uint32_t * const UID = (uint32_t*)UID_BASE; const uint32_t * const UID = (uint32_t*)UID_BASE;
SERIAL_ECHO(hex_long(UID[0]), hex_long(UID[1]), hex_long(UID[2])); for (uint8_t i = 0; i < 3; i++) print_hex_long(UID[i]);
#else #else
uint16_t * const UID = (uint16_t*)UID_BASE; const uint16_t * const UID = (uint16_t*)UID_BASE; // Little-endian!
SERIAL_ECHO( SERIAL_ECHO(F("CEDE2A2F-"));
F("CEDE2A2F-"), hex_word(UID[0]), C('-'), hex_word(UID[1]), C('-'), hex_word(UID[2]), C('-'), for (uint8_t i = 1; i <= 6; i++) {
hex_word(UID[3]), hex_word(UID[4]), hex_word(UID[5]) print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444
); if (i <= 3) SERIAL_ECHO(C('-'));
}
#endif #endif
#endif #endif
@@ -139,7 +154,7 @@ void GcodeSuite::M115() {
// AUTOLEVEL (G29) // AUTOLEVEL (G29)
cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL)); cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
// RUNOUT (M412, M600) // RUNOUT (M591, M600)
cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR)); cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
// Z_PROBE (G30) // Z_PROBE (G30)
+9 -8
View File
@@ -35,9 +35,6 @@
#include "../../lcd/marlinui.h" #include "../../lcd/marlinui.h"
#elif ENABLED(EXTENSIBLE_UI) #elif ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h" #include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin_popup.h"
#include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)
@@ -66,16 +63,20 @@ void GcodeSuite::M0_M1() {
#endif #endif
} }
#elif ENABLED(DWIN_LCD_PROUI) // ExtUI with icon, string, button title
if (parser.string_arg)
ExtUI::onUserConfirmRequired(ICON_Continue_1, parser.string_arg, GET_TEXT_F(MSG_USERWAIT));
else
ExtUI::onUserConfirmRequired(ICON_Stop_1, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT));
#elif ENABLED(EXTENSIBLE_UI) #elif ENABLED(EXTENSIBLE_UI)
if (parser.string_arg) if (parser.string_arg)
ExtUI::onUserConfirmRequired(parser.string_arg); // String in an SRAM buffer ExtUI::onUserConfirmRequired(parser.string_arg); // String in an SRAM buffer
else else
ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT)); ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT));
#elif ENABLED(DWIN_LCD_PROUI)
if (parser.string_arg)
dwinPopupConfirm(ICON_BLTouch, parser.string_arg, GET_TEXT_F(MSG_USERWAIT));
else
dwinPopupConfirm(ICON_BLTouch, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT));
#else #else
if (parser.string_arg) { if (parser.string_arg) {
+2
View File
@@ -61,6 +61,8 @@ void GcodeSuite::M145() {
} }
void GcodeSuite::M145_report(const bool forReplay/*=true*/) { void GcodeSuite::M145_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_MATERIAL_HEATUP)); report_heading(forReplay, F(STR_MATERIAL_HEATUP));
for (uint8_t i = 0; i < PREHEAT_COUNT; ++i) { for (uint8_t i = 0; i < PREHEAT_COUNT; ++i) {
report_echo_start(forReplay); report_echo_start(forReplay);
+1
View File
@@ -38,6 +38,7 @@ void GcodeSuite::M250() {
} }
void GcodeSuite::M250_report(const bool forReplay/*=true*/) { void GcodeSuite::M250_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_LCD_CONTRAST)); report_heading_etc(forReplay, F(STR_LCD_CONTRAST));
SERIAL_ECHOLNPGM(" M250 C", ui.contrast); SERIAL_ECHOLNPGM(" M250 C", ui.contrast);
} }
+1
View File
@@ -44,6 +44,7 @@ void GcodeSuite::M255() {
} }
void GcodeSuite::M255_report(const bool forReplay/*=true*/) { void GcodeSuite::M255_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP)); report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP));
SERIAL_ECHOLNPGM(" M255 S", SERIAL_ECHOLNPGM(" M255 S",
TERN(HAS_DISPLAY_SLEEP, ui.sleep_timeout_minutes, ui.backlight_timeout_minutes), TERN(HAS_DISPLAY_SLEEP, ui.sleep_timeout_minutes, ui.backlight_timeout_minutes),
+1
View File
@@ -37,6 +37,7 @@ void GcodeSuite::M256() {
} }
void GcodeSuite::M256_report(const bool forReplay/*=true*/) { void GcodeSuite::M256_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_LCD_BRIGHTNESS)); report_heading_etc(forReplay, F(STR_LCD_BRIGHTNESS));
SERIAL_ECHOLNPGM(" M256 B", ui.brightness); SERIAL_ECHOLNPGM(" M256 B", ui.brightness);
} }
+1
View File
@@ -44,6 +44,7 @@ void GcodeSuite::M414() {
} }
void GcodeSuite::M414_report(const bool forReplay/*=true*/) { void GcodeSuite::M414_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_UI_LANGUAGE)); report_heading_etc(forReplay, F(STR_UI_LANGUAGE));
SERIAL_ECHOLNPGM(" M414 S", ui.language); SERIAL_ECHOLNPGM(" M414 S", ui.language);
} }
-4
View File
@@ -29,10 +29,6 @@
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
#include "../../libs/numtostr.h" #include "../../libs/numtostr.h"
#if ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif
/** /**
* M73: Set percentage complete (for display on LCD) * M73: Set percentage complete (for display on LCD)
* *
+6 -6
View File
@@ -34,6 +34,10 @@
#include "../../feature/probe_temp_comp.h" #include "../../feature/probe_temp_comp.h"
#endif #endif
#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#define VERBOSE_SINGLE_PROBE
#endif
/** /**
* G30: Do a single Z probe at the given XY (default: current) * G30: Do a single Z probe at the given XY (default: current)
* *
@@ -66,9 +70,7 @@ void GcodeSuite::G30() {
remember_feedrate_scaling_off(); remember_feedrate_scaling_off();
#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) TERN_(VERBOSE_SINGLE_PROBE, process_subcommands_now(F("G28O")));
process_subcommands_now(F("G28O"));
#endif
const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
@@ -83,9 +85,7 @@ void GcodeSuite::G30() {
F( " Z:"), p_float_t(measured_z, 3) F( " Z:"), p_float_t(measured_z, 3)
); );
msg.echoln(); msg.echoln();
#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) TERN_(VERBOSE_SINGLE_PROBE, ui.set_status(msg));
ui.set_status(msg);
#endif
} }
restore_feedrate_and_scaling(); restore_feedrate_and_scaling();
+4 -2
View File
@@ -72,12 +72,12 @@ void GcodeSuite::M423() {
do_report = false; do_report = false;
const int8_t x = parser.value_int(); const int8_t x = parser.value_int();
if (!WITHIN(x, 0, XATC_MAX_POINTS - 1)) if (!WITHIN(x, 0, XATC_MAX_POINTS - 1))
SERIAL_ECHOLNPGM("?(X) out of range (0..", XATC_MAX_POINTS - 1, ")."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(X) out of range (0..", XATC_MAX_POINTS - 1, ")."));
else { else {
if (parser.seenval('Z')) if (parser.seenval('Z'))
xatc.z_offset[x] = parser.value_linear_units(); xatc.z_offset[x] = parser.value_linear_units();
else else
SERIAL_ECHOLNPGM("?(Z) required."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(Z) required."));
} }
} }
@@ -86,6 +86,8 @@ void GcodeSuite::M423() {
} }
void GcodeSuite::M423_report(const bool forReplay/*=true*/) { void GcodeSuite::M423_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F("X-Twist Correction")); report_heading(forReplay, F("X-Twist Correction"));
SERIAL_ECHOLNPGM(" M423 A", xatc.start, " I", xatc.spacing); SERIAL_ECHOLNPGM(" M423 A", xatc.start, " I", xatc.spacing);
for (uint8_t x = 0; x < XATC_MAX_POINTS; ++x) { for (uint8_t x = 0; x < XATC_MAX_POINTS; ++x) {
+7 -5
View File
@@ -47,11 +47,11 @@ void GcodeSuite::M851() {
if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX)) if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX))
offs.x = x; offs.x = x;
else { else {
SERIAL_ECHOLNPGM("?X out of range (", PROBE_OFFSET_XMIN, " to ", PROBE_OFFSET_XMAX, ")"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("X out of range (", PROBE_OFFSET_XMIN, " to ", PROBE_OFFSET_XMAX, ")"));
ok = false; ok = false;
} }
#else #else
if (x) SERIAL_ECHOLNPGM("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true if (x) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("X must be 0 (NOZZLE_AS_PROBE).")); // ...but let 'ok' stay true
#endif #endif
} }
@@ -61,11 +61,11 @@ void GcodeSuite::M851() {
if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX)) if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX))
offs.y = y; offs.y = y;
else { else {
SERIAL_ECHOLNPGM("?Y out of range (", PROBE_OFFSET_YMIN, " to ", PROBE_OFFSET_YMAX, ")"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Y out of range (", PROBE_OFFSET_YMIN, " to ", PROBE_OFFSET_YMAX, ")"));
ok = false; ok = false;
} }
#else #else
if (y) SERIAL_ECHOLNPGM("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true if (y) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Y must be 0 (NOZZLE_AS_PROBE).")); // ...but let 'ok' stay true
#endif #endif
} }
@@ -74,7 +74,7 @@ void GcodeSuite::M851() {
if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX))
offs.z = z; offs.z = z;
else { else {
SERIAL_ECHOLNPGM("?Z out of range (", PROBE_OFFSET_ZMIN, " to ", PROBE_OFFSET_ZMAX, ")"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Z out of range (", PROBE_OFFSET_ZMIN, " to ", PROBE_OFFSET_ZMAX, ")"));
ok = false; ok = false;
} }
} }
@@ -84,6 +84,8 @@ void GcodeSuite::M851() {
} }
void GcodeSuite::M851_report(const bool forReplay/*=true*/) { void GcodeSuite::M851_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_Z_PROBE_OFFSET)); report_heading_etc(forReplay, F(STR_Z_PROBE_OFFSET));
SERIAL_ECHOPGM_P( SERIAL_ECHOPGM_P(
#if HAS_PROBE_XY_OFFSET #if HAS_PROBE_XY_OFFSET

Some files were not shown because too many files have changed in this diff Show More