Compare commits

...

522 Commits

Author SHA1 Message Date
InsanityAutomation 01479cab84 Final binaries 2023-03-02 20:48:41 -05:00
InsanityAutomation 401f5cf1ca Tenlog Shipped Envs 2023-02-28 18:18:00 -05:00
InsanityAutomation ab427804ac Add debug message, reduce ram usage to avoid comm corruption from stack 2023-02-26 15:22:37 -05:00
InsanityAutomation 3a4d705308 Update Configuration.h 2023-02-25 13:31:13 -05:00
InsanityAutomation 56ee00f354 Minor tweak, fix fan speed input 2023-02-24 15:34:06 -05:00
InsanityAutomation f434f368ac Merge branch 'CrealityDwin2.0_Bleeding' of https://github.com/InsanityAutomation/Marlin into CrealityDwin2.0_Bleeding 2023-02-22 19:13:58 -05:00
InsanityAutomation 1d9cf20d4b Merge pull request #295 from bob-anthony/DGUS_DISPLAY_FIXES
Fix compiling errors for DGUS displays
2023-02-22 19:13:58 -05:00
Tom Brazier 313014515c MIN_ISR_LOOP_CYCLES already includes ISR_[XY]_STEPPER_CYCLES and more, it should not be counted 2023-02-22 19:13:58 -05:00
Tom Brazier 11d9bb4a66 Don't include MIN_ISR_LOOP_CYCLES in calculation for ISR_SHAPING_LOOP_CYCLES if input shaping is disabled 2023-02-22 19:13:58 -05:00
Tom Brazier 7591c8661f Also implement 2 cycle saving in MultiU24X32toH16() 2023-02-22 19:13:58 -05:00
Tom Brazier 456b0a4011 Fixed rounding of fractional part of multiplication results (a bug inherited from Sprinter). Cleaned up comments and function naming. Minor optimisation of MultiU8X16toH16(). 2023-02-22 19:13:58 -05:00
InsanityAutomation 67d6f2f877 circle around as upstream never merged 2023-02-19 17:53:32 -05:00
InsanityAutomation 5e10f6d8d1 Slightly more robust pause resume and faster serial event handling 2023-02-19 15:23:27 -05:00
InsanityAutomation 8a30019a18 Update README.md 2023-02-17 17:25:17 -05:00
InsanityAutomation 686fe6fe74 Patch version string 2023-02-15 19:17:03 -05:00
InsanityAutomation 8ece5bcbee Update Version.h 2023-02-14 23:29:30 -05:00
InsanityAutomation ae9fe880f8 Recompress ScreenICL 2023-02-14 23:21:29 -05:00
InsanityAutomation 9c48d93a36 Binaries now identify machine and options in version info 2023-02-13 10:29:11 -05:00
InsanityAutomation fad005fdc2 Readme and Version info 2023-02-12 12:56:09 -05:00
InsanityAutomation 0cf916ce13 Updated binaries 2023-02-11 13:35:20 -05:00
InsanityAutomation 0a54b35981 Updated screen configs, added low res/high res envs 2023-02-11 12:45:28 -05:00
InsanityAutomation 47c0dc631c Make high res screen default, add high res dwin fileset 2023-02-05 13:39:17 -05:00
InsanityAutomation 5c39469b94 Config tweaks and updated TFT files for low res screens 2023-02-04 11:57:05 -05:00
InsanityAutomation 8ea02e3ede add casting for handler 2023-02-03 17:40:47 -05:00
InsanityAutomation a33f7ddc8c Merge branch 'CrealityDwin2.0_Bleeding' into Tenlog_DWIN 2023-02-03 15:35:23 -05:00
InsanityAutomation 462b586c76 Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2023-02-03 15:31:34 -05:00
InsanityAutomation af85a271a5 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-02-03 15:20:56 -05:00
InsanityAutomation 1bab76a98a Revert "Fix for Nema23 CNC driver on D6"
This reverts commit c43d064122.
2023-02-03 15:20:11 -05:00
InsanityAutomation 25de1facb5 more work on dint type for offsets 2023-02-03 15:20:03 -05:00
InsanityAutomation c43d064122 Fix for Nema23 CNC driver on D6 2023-02-03 15:19:40 -05:00
InsanityAutomation 5a9736bfa3 add endian swap 2023-02-03 15:19:40 -05:00
InsanityAutomation 359258701f Move writevariables to class with other serial sends 2023-02-03 15:19:40 -05:00
InsanityAutomation 04f5a42c60 Idex offsets to uint32 4 byte 2023-02-03 15:19:40 -05:00
InsanityAutomation 6dc27f6fc0 more work on dint type for offsets 2023-02-03 15:19:08 -05:00
InsanityAutomation b010d0782f Fix for Nema23 CNC driver on D6 2023-02-03 15:18:42 -05:00
InsanityAutomation 6fd0c3f6a8 add endian swap 2023-01-24 20:38:53 -05:00
InsanityAutomation 8f7735655e Move writevariables to class with other serial sends 2023-01-24 20:28:35 -05:00
InsanityAutomation 5f431c140f Idex offsets to uint32 4 byte 2023-01-24 20:21:08 -05:00
InsanityAutomation 23f580bd03 Idex offsets to uint32 4 byte 2023-01-24 20:20:31 -05:00
MarkMan0 a7eacbcc49 🐛 Fix, Refactor PID scaling (#25096) 2022-12-17 23:48:33 -06:00
Scott Lahteine 05e2e059e3 🐛 Fix M593 F 2022-12-17 23:04:49 -06:00
InsanityAutomation 2752234e14 large rom enable IS 2022-12-04 14:21:12 -05:00
ellensp c87943cff1 better 2022-12-04 12:24:05 -05:00
ellensp 661abff6e6 use uint32_t not int
fixes issue https://github.com/MarlinFirmware/Marlin/issues/25018
2022-12-04 12:24:05 -05:00
kisslorand 7e0478c97d Fix commit 3ba9387 2022-12-04 12:23:04 -05:00
Tom Brazier a0ed4d51bc Input shaping buffer size metaprogramming for disctict E axes 2022-12-04 12:22:35 -05:00
Tom Brazier 005019b82d Better error message 2022-12-04 12:22:35 -05:00
Tom Brazier 55d943e9d2 Make it possible to override the shaping buffer size calculations in confg.
Also potential SRAM reduction when not using ADAPTIVE_STEP_SMOOTHING on 32 bit MCUs.
2022-12-04 12:22:35 -05:00
InsanityAutomation f3e8919552 Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-12-04 11:46:46 -05:00
InsanityAutomation 2bd9bcf61b Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-11-28 15:01:14 -05:00
InsanityAutomation 3ec124f417 Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-10-29 19:42:55 -04:00
InsanityAutomation c5263830d8 Update planner.cpp 2022-10-18 16:51:02 -04:00
InsanityAutomation 050e0db3a3 Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-10-18 16:42:19 -04:00
InsanityAutomation f8f918590c Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-10-16 15:05:28 -04:00
InsanityAutomation 5d56a71423 Update Creality_DWIN.cpp 2022-10-10 14:38:29 -04:00
InsanityAutomation 93b664182e Final tweaks and add binaries 2022-09-17 16:10:08 -04:00
InsanityAutomation e0990f1b65 Merge branch 'CrealityDwin2.0_Bleeding' into Tenlog_DWIN 2022-09-17 12:12:13 -04:00
InsanityAutomation 0a55425552 Revert "️ Minor planner optimization (#24737)"
This reverts commit d5cf0b3348.
2022-09-17 12:03:16 -04:00
InsanityAutomation 47c0c7072a Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-09-15 11:21:48 -04:00
InsanityAutomation beb163a183 Update stm32f1-maple.ini 2022-09-15 10:40:31 -04:00
InsanityAutomation cd67b87f22 Update Configuration_adv.h 2022-09-01 14:35:45 -04:00
InsanityAutomation e5f087bd98 adjust envs 2022-08-23 19:29:00 -04:00
InsanityAutomation 1fcad0b87c platform tweaking 2022-08-23 19:28:48 -04:00
InsanityAutomation bf698efc93 Remove no longer needed silent builds 2022-08-20 15:18:03 -04:00
InsanityAutomation f0e950db72 Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-08-20 15:17:46 -04:00
InsanityAutomation 200a3957d9 idex updates 2022-07-29 09:33:17 -04:00
InsanityAutomation b243c67de2 Update Configuration.h 2022-07-23 17:19:51 -04:00
InsanityAutomation 20d107adf2 Update Creality_DWIN.cpp 2022-07-23 17:19:48 -04:00
InsanityAutomation 5e3c15bd39 Update Creality_DWIN.h 2022-07-19 22:32:04 -04:00
InsanityAutomation 05cbeef2c6 Update pins_TENLOG_D3_HERO.h 2022-07-19 13:49:17 -04:00
InsanityAutomation 2ab4b9bd13 Update Creality_DWIN.cpp 2022-07-19 13:49:10 -04:00
InsanityAutomation 1cc33f318c Delete binaries 2022-07-19 13:48:59 -04:00
InsanityAutomation 78e3a829ba Merge branch 'CrealityDwin2.0_Bleeding' into Tenlog_DWIN 2022-07-18 18:55:53 -04:00
InsanityAutomation 60dc55c3bf Use raw positions for G34 probing to honor M206 offsets 2022-07-17 21:02:39 -04:00
thisiskeithb ef12aa5a6c Fix ProUI with Leveling 2022-07-17 21:01:31 -04:00
Tom Brazier b8f90b2d71 Give correct hints to the planner when drawing arcs 2022-07-17 21:01:01 -04:00
Tom Brazier ee91c915ee Return FLOOR() on the offchance that a float rounding error results in a slightly negative decelerate_steps_float 2022-07-17 21:01:01 -04:00
InsanityAutomation e7fac26f2b Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-07-17 20:58:41 -04:00
InsanityAutomation e66a2fdbf4 Update Configuration.h 2022-07-17 20:43:31 -04:00
InsanityAutomation f96a4a53ef IDEX Support initial commit 2022-07-17 20:43:12 -04:00
InsanityAutomation 096c146f16 Start adding more SKR boards, starting with SKRMiniV3 2022-07-17 20:42:52 -04:00
InsanityAutomation 5111e8d3a3 Update rev number and upstream merge revisions 2022-07-17 20:40:27 -04:00
InsanityAutomation 775850a245 Merge branch 'bugfix-2.1.x' into CrealityDwin2.0_Bleeding 2022-07-15 10:37:36 -04:00
InsanityAutomation 8401c6d267 Allow Portrait display with no leveling 2022-06-02 09:17:06 -04:00
InsanityAutomation bdeceae5b4 Update temp calls to honor active tool 2022-05-21 13:37:51 -04:00
InsanityAutomation c6ace0d4a5 tweaks 2022-05-21 13:19:16 -04:00
InsanityAutomation e9c9f07b8b Initial config import from luxuri and first pass sweep for issues 2022-05-21 12:55:02 -04:00
InsanityAutomation 8386ae0f4d generalize, and prep 2022-05-17 21:13:04 -04:00
InsanityAutomation 1c194d4e16 Update CR6E3 Touchscreen 2022-05-16 17:41:37 -04:00
InsanityAutomation fb5ee94263 New bins 2022-05-15 19:35:20 -04:00
InsanityAutomation 7bfcba1cf7 Update Configuration.h 2022-05-15 11:00:11 -04:00
InsanityAutomation 147cda7c1d Add E3S1_F4 2022-05-14 20:10:09 -04:00
InsanityAutomation 6016ef7ba1 Update Configuration_adv.h 2022-05-13 20:52:28 -04:00
InsanityAutomation a82e3147fd Adjust startup delay for fast machines with higher res displays 2022-05-13 19:54:23 -04:00
Scott Lahteine fa73edd76a Add BOARD_CREALITY_V24S1_301F4
Co-Authored-By: Miguel Risco-Castillo <mriscoc@users.noreply.github.com>
2022-05-13 11:11:41 -04:00
InsanityAutomation 591a42cdd0 Update G29.cpp 2022-05-08 18:01:38 -04:00
InsanityAutomation 6b74e0f142 Update pins_CREALITY_V25S1.h 2022-05-08 18:01:34 -04:00
InsanityAutomation 4cdec14648 Update Configuration_adv.h 2022-05-08 18:01:23 -04:00
InsanityAutomation e4e9f01bf0 More smart pro tweaks 2022-05-08 17:33:13 -04:00
InsanityAutomation 01ef9afdd0 CR10Smart Pro Configs 2022-05-08 14:41:54 -04:00
InsanityAutomation 21f8741982 Add Creality CR10SmartPro Support 2022-05-08 14:41:27 -04:00
InsanityAutomation fa80adf92c Update cr10 max builds to 470mm 2022-05-07 11:45:43 -04:00
InsanityAutomation 9e4cce23d4 Update Configuration.h 2022-05-04 15:07:04 -04:00
InsanityAutomation 868967d08c Updated bins compressed 2022-05-01 14:53:00 -04:00
InsanityAutomation 48dc25407e Update Creality_DWIN.cpp 2022-05-01 12:35:05 -04:00
InsanityAutomation b88833a1cd More pause tweaks 2022-04-30 21:29:39 -04:00
InsanityAutomation 391a07b2bf Pause improvements 2022-04-30 16:33:19 -04:00
InsanityAutomation c8faaca998 Update Creality_DWIN.cpp 2022-04-30 12:02:26 -04:00
InsanityAutomation 01ab324a12 advanced pause improvements 2022-04-30 10:22:52 -04:00
InsanityAutomation 00152be921 bin revision 2022-04-28 08:14:04 -04:00
InsanityAutomation be5078f8ab Update Configuration.h 2022-04-26 23:49:21 -04:00
InsanityAutomation cacdb2d818 update startup logo 2022-04-26 23:26:51 -04:00
InsanityAutomation 3553ef4c00 Set default runout mode to lerge and sprite to dd retraction 2022-04-26 23:24:16 -04:00
InsanityAutomation 64cf8316e1 Update dgus_creality_lcd.cpp 2022-04-26 22:58:30 -04:00
InsanityAutomation b6ad2db3a9 Add binary relocate function to avoid random pio purging 2022-04-26 14:18:13 -04:00
InsanityAutomation 47222bcdde Update platformio.ini 2022-04-25 11:10:49 -04:00
InsanityAutomation 22f2a8baa7 Add updated binaries 2022-04-25 11:07:52 -04:00
InsanityAutomation 08b92c3d1c Bump version, tweak accels 2022-04-23 10:48:43 -04:00
InsanityAutomation 474111f1c9 Minor touchups from last rebase 2022-04-22 09:11:22 -04:00
InsanityAutomation b35125e1a2 Update Configuration_adv.h 2022-04-20 17:33:48 -04:00
InsanityAutomation 3a1646b2e8 Update Configuration_adv.h 2022-04-18 14:50:05 -04:00
InsanityAutomation b99b6250ee Update Configuration.h 2022-04-18 14:48:31 -04:00
InsanityAutomation 947ee4560e E2Pro no runout stock 2022-04-15 16:09:23 -04:00
InsanityAutomation 11a0186b35 Update for extui recent changes 2022-04-15 16:08:29 -04:00
InsanityAutomation db74ac3ce1 Disable 100x multiplier for dwin marlinui 2022-04-15 13:13:46 -04:00
InsanityAutomation 2b46761060 minor tweaks 2022-04-15 13:03:32 -04:00
InsanityAutomation 97e1768ffe Remove extra screen refreshes and obsolete box 2022-04-09 17:16:56 -04:00
InsanityAutomation 8e83784656 Update dwin.cpp 2022-04-08 20:05:10 -04:00
InsanityAutomation 73b0c506e4 Update Configuration.h 2022-04-06 12:48:03 -04:00
InsanityAutomation 4678bb49b9 Update Creality_DWIN.cpp 2022-04-03 14:54:03 -04:00
InsanityAutomation f581502cc4 M591Fixes 2022-04-03 14:53:59 -04:00
InsanityAutomation dfc3007326 Merge branch 'Implement-M591-Configurable-Runout-Sensors' into CrealityDwin2.0_Bleeding 2022-04-03 13:24:30 -04:00
InsanityAutomation 7f691fc5c1 Bump version 2022-04-03 11:33:31 -04:00
InsanityAutomation 01e7a5cb76 Add Ender 2 Pro 2022-04-03 11:28:20 -04:00
InsanityAutomation fa72415812 Add CR10SmartPro First draft
Guess on BLTouch pins as HW not available atm
2022-04-03 10:57:55 -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
InsanityAutomation adabc63617 V2 tweaks 2022-03-26 20:08:37 -04:00
Scott Lahteine 6741f5182d Simplify menu items, use enum 2022-03-26 18:54:02 -05:00
InsanityAutomation d8508c5110 Update Configuration.h 2022-03-26 19:46:50 -04:00
InsanityAutomation dae60f4b29 V2 S1 UI Change 2022-03-26 19:46:26 -04:00
InsanityAutomation e16655a011 Fix char overlap V2S1 2022-03-26 19:46:14 -04:00
InsanityAutomation 0d576bb529 Fix marlinui status scroll 2022-03-25 21:53:36 -04:00
InsanityAutomation 61c3d122c9 Fix marlinUI V2 display bootscreen reloading cached BG 2022-03-25 16:39:46 -04:00
InsanityAutomation 123086d14c Fix non probe z offset adjustment 2022-03-25 14:05:55 -04:00
InsanityAutomation 10fd6df83d Update Configuration.h 2022-03-23 09:48:01 -04:00
InsanityAutomation d40750cde8 Non-BLT CR5 2022-03-19 11:49:40 -04: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 e1c5f8418d Update Configuration.h 2022-03-06 18:12:11 -05:00
InsanityAutomation 4a0769ec1b allows z offset to work for babystep total on machines without probe 2022-03-06 18:11:43 -05:00
InsanityAutomation 991f21c74c Faster lcd buffer processing 2022-03-04 21:40:55 -05:00
InsanityAutomation 9ebf358b8a Default livemove to true 2022-03-04 21:40:38 -05:00
InsanityAutomation 70c26fd4ca S1 and E3 Touch Updates 2022-03-02 12:37:18 -05:00
InsanityAutomation 9e66a87122 Update .gitignore 2022-02-28 08:49:44 -05:00
InsanityAutomation f177bd32eb Variant and Version Info 2022-02-27 21:07:56 -05:00
InsanityAutomation 8df38008ef Add S1 screen support 2022-02-27 21:02:21 -05:00
InsanityAutomation ec5d623c93 Update README.md 2022-02-27 21:00:27 -05:00
InsanityAutomation aca3184ce4 Add S1 Support 2022-02-27 21:00:23 -05:00
InsanityAutomation 7cda9dbf84 Add Blank BG screen to E3V2 for S1 screen compat 2022-02-27 21:00:04 -05:00
InsanityAutomation 24e8499ef6 Create firmware_Ender7_BLT_DW7.4.5.bin.zip 2022-02-26 18:43:32 -05:00
InsanityAutomation 2abf5f0ad8 Add CR5Pro 2022-02-26 16:00:13 -05:00
InsanityAutomation f6a48f82aa Update README.md 2022-02-25 10:30:31 -05:00
InsanityAutomation c0f0964329 Update README.md 2022-02-25 10:17:42 -05:00
InsanityAutomation 0322dfd76e Update README.md 2022-02-25 10:08:34 -05:00
InsanityAutomation bd967ba7a2 Add smart binary 2022-02-23 11:21:57 -05:00
InsanityAutomation cc1a4f5f70 Update binaries 2022-02-19 19:15:25 -05:00
InsanityAutomation d43c557404 Readme and DWIN updates 2022-02-19 12:23:30 -05:00
InsanityAutomation c4ba4600dc Update Configuration_adv.h 2022-02-18 15:13:37 -05:00
InsanityAutomation 0bbc122475 Trim out processing page to save space 2022-02-15 09:51:13 -05:00
InsanityAutomation 1868db82aa Cleanup 2022-02-13 14:57:45 -05:00
InsanityAutomation 23091e566b fix overlapping platforms 2022-02-12 13:37:07 -05:00
InsanityAutomation 0ac94f6a2f Platform tweaks 2022-02-11 22:11:56 -05:00
InsanityAutomation 3d804bd314 Block LCD Reinit for ExtUI 2022-02-11 22:11:31 -05:00
InsanityAutomation e0de16f3a8 UpdateVersion 2022-02-06 12:01:38 -05:00
InsanityAutomation 7421731eed ReviseENVsToRC 2022-02-06 12:01:28 -05:00
InsanityAutomation 43bc8c3865 AddToggles 2022-02-06 12:01:08 -05:00
InsanityAutomation c13d290934 FixMapleHalCompileErrors 2022-02-06 12:00:42 -05:00
InsanityAutomation 49eb72816e AddGenericMapleRC_ENV 2022-02-06 12:00:17 -05:00
InsanityAutomation ec0c72e2f0 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2022-02-05 11:04:35 -05:00
InsanityAutomation ff221cdacd Update Creality_DWIN.h 2022-02-05 10:25:04 -05:00
InsanityAutomation af177e719e Add PLR to ext_ui 2022-01-13 17:53:02 -05:00
InsanityAutomation c713b14143 CR30 and Smart improvements 2022-01-13 08:34:53 -05:00
InsanityAutomation 44c21f477e Update Creality_DWIN.cpp 2022-01-08 16:32:53 -05:00
InsanityAutomation 9f2e0238df Add ENV 2022-01-08 16:32:53 -05:00
InsanityAutomation fd72d771e6 Update Configuration.h 2022-01-08 16:32:53 -05:00
InsanityAutomation dc1a4080db Update Creality_DWIN.cpp 2022-01-03 11:40:33 -05:00
InsanityAutomation 1e3cd5ca8b Add ENV 2022-01-03 11:05:57 -05:00
InsanityAutomation 09f1c97c6e move to maple again 2022-01-03 10:50:14 -05:00
InsanityAutomation 13b16b4062 Add CR10Smart, CR6 fix 2022-01-03 10:47:11 -05:00
InsanityAutomation 92a7943d4e Update README.md 2021-11-26 13:27:30 -05:00
InsanityAutomation 448abd5de2 Fix stale screen build 2021-11-22 11:22:43 -05:00
InsanityAutomation 37f4924ac1 Fixed binaries 2021-11-21 15:31:30 -05:00
InsanityAutomation 1c269eda1e Merge branch 'CrealityDwin2.0_Bleeding' of https://github.com/InsanityAutomation/Marlin into CrealityDwin2.0_Bleeding 2021-11-21 15:28:50 -05:00
InsanityAutomation d8573b97eb Update Creality_DWIN.cpp 2021-11-21 15:27:08 -05:00
InsanityAutomation 5a94a8e1c0 Update Configuration.h 2021-11-20 12:55:37 -05:00
InsanityAutomation e067dc4713 Updated binaries 2021-11-17 16:41:08 -05:00
InsanityAutomation 1f6da0c1b4 Add ender 5 32b envs 2021-11-17 09:04:14 -05:00
InsanityAutomation 8bb4484af5 clear old binaries, add 32 bit filament runout envs 2021-11-17 08:59:33 -05:00
InsanityAutomation 6cc524dd50 Update Ender3V2_Dwin_TM3DV2.7z 2021-11-14 14:20:50 -05:00
InsanityAutomation 728539bb23 Revert "Revert "v2 jyers update""
This reverts commit a67b346523.
2021-11-14 14:11:29 -05:00
InsanityAutomation a67b346523 Revert "v2 jyers update"
This reverts commit a3e960c251.
2021-11-14 12:15:11 -05:00
InsanityAutomation 4b767d7623 bump version 2021-11-14 12:15:02 -05:00
InsanityAutomation 7e149b2532 Build script indentation fixes 2021-11-13 09:45:02 -05:00
InsanityAutomation 3b7b4b48d8 tm3d progress bar location 2021-11-13 09:44:49 -05:00
InsanityAutomation 49fd9bdb77 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-11-11 21:23:58 -05:00
InsanityAutomation 5bcf64f17c Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-11-11 21:17:23 -05:00
InsanityAutomation a3e960c251 v2 jyers update 2021-11-11 21:17:16 -05:00
InsanityAutomation a7696f32fd Tweak accel multipliers, move to stm32 common lib 2021-11-07 10:29:11 -05:00
tome9111991 b4d3f03a26 🐛 Fix SHOW_REMAINING_TIME option for JyersUI (#22999) 2021-11-04 17:28:53 -04:00
ellensp 42c6324f68 🐛 Fix E3V2 width/height defines (#22994) 2021-11-04 17:28:04 -04:00
Dennis 4d15eb94e4 🐛 Fix JyersUI current positions (scaling) (#23005) 2021-11-04 17:27:16 -04:00
InsanityAutomation 3d688fc324 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-11-04 17:25:43 -04:00
InsanityAutomation 58e54f6746 Ender 7 tuning, sermoon fixes, jyersui fixes, finish jerk/accel dwin 2021-11-04 17:25:36 -04:00
InsanityAutomation bf7a48ed31 Update Creality_DWIN.cpp 2021-10-30 10:40:52 -04:00
InsanityAutomation dc52c64424 Update Configuration.h 2021-10-30 10:40:49 -04:00
InsanityAutomation 0e29cd8cc5 Update Configuration.h 2021-10-26 18:38:35 -04:00
InsanityAutomation 844fe9b24d Start jerk/accel/travel support 2021-10-25 19:21:18 -04:00
Keith Bennett 2b19dc3232 Octopus Pro V1.0 with STM32F429ZGT6 (#23008) 2021-10-25 01:14:02 -05:00
ellensp f41c78d178 🐛 Fix børken E_DUAL_STEPPER_DRIVERS (#23017) 2021-10-25 01:12:07 -05:00
Miguel Risco-Castillo 6270df927e 🐛 Fix Emder-3 V2 Enhanced SetFlow (#23016) 2021-10-25 01:08:15 -05:00
InsanityAutomation cbcc1bc084 DWINos4 changes 2021-10-23 17:43:40 -04:00
InsanityAutomation ab1d124bf9 Ender 7 preliminary support 2021-10-23 17:43:12 -04:00
InsanityAutomation 5b7215df43 Ender 7 Mainboard Support 2021-10-23 17:42:12 -04:00
InsanityAutomation 44aaa4f042 Update README.md 2021-10-23 08:53:36 -04:00
InsanityAutomation afef0b9dec Update Configuration.h 2021-10-20 10:04:58 -04:00
InsanityAutomation f7767be8a5 Updated binaries 2021-10-18 18:11:03 -04:00
InsanityAutomation 2f5e28dd66 Update Configuration.h 2021-10-18 09:14:29 -04:00
InsanityAutomation 0397d384d2 Fix JyersUI ZOffset Multiplication 2021-10-17 20:02:13 -04:00
InsanityAutomation 212dfb4050 Update platformio.ini 2021-10-17 18:38:11 -04:00
InsanityAutomation 59ff070dba V2 Display Standalone 2021-10-16 19:44:55 -04:00
InsanityAutomation c7af93b39f Update Configuration.h 2021-10-16 18:30:28 -04:00
InsanityAutomation 794ea13ae8 Update Configuration_adv.h 2021-10-16 18:29:14 -04:00
InsanityAutomation 227f014fb5 Update PageHandlers.cpp 2021-10-16 18:29:11 -04:00
InsanityAutomation e22408f3f9 Update DGUSScreenHandler.cpp 2021-10-16 18:29:09 -04:00
InsanityAutomation 9e8e1c1113 CR30 Tweaks 2021-10-16 15:38:32 -04:00
InsanityAutomation 1427290e84 Message fixes, V2 UI Positioning 2021-10-16 12:00:30 -04:00
InsanityAutomation 1c7b232d05 Fix Tool Change Park 2021-10-16 10:44:59 -04:00
InsanityAutomation 005dad193a Updated screen archives 2021-10-15 11:24:18 -04:00
InsanityAutomation 88f502cac5 Bump revision, Add CR30 2021-10-15 10:53:09 -04:00
InsanityAutomation 0cc286757b Update Configuration.h 2021-10-15 09:48:58 -04:00
InsanityAutomation d843e2be2b Merge branch 'BLTouch-HS-Mode-EEPROM' into CrealityDwin2.0_Bleeding 2021-10-15 08:58:45 -04:00
Scott Lahteine cede5b22c9 Use BLTOUCH_HS_MODE for default + editable 2021-10-14 20:35:36 -05:00
Scott Lahteine 43f996d68a Rename bltouch_last_written_mode 2021-10-14 20:04:42 -05:00
Scott Lahteine bd426d40cd Tweak M401 2021-10-14 19:28:39 -05:00
Scott Lahteine 099c329238 Fix LEVEL_CORNERS_USE_PROBE 2021-10-14 19:28:39 -05:00
Scott Lahteine 3db4452d28 settings tweak 2021-10-14 19:28:00 -05:00
InsanityAutomation 385bab2f36 Update settings.cpp 2021-10-14 18:49:12 -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
InsanityAutomation ef661cd295 Update Creality_DWIN.cpp 2021-10-14 13:24:08 -04:00
InsanityAutomation d068769f2c Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-10-13 17:47:30 -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
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 0cc6955ab7 BLTouch High Speed EEPROM Control 2021-10-09 13:58:25 -04:00
InsanityAutomation 86d2d5d0a8 Update dwin.cpp 2021-10-09 13:09:28 -04:00
InsanityAutomation 5a994f0c9a Update dwin.cpp 2021-10-09 12:15:10 -04:00
InsanityAutomation 39ee694856 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-10-09 12:13:17 -04:00
InsanityAutomation 10a16c8c75 Sermoon updates 2021-10-08 14:06:57 -04:00
InsanityAutomation aa2763442e Fix E3V2 M600 resume 2021-09-28 09:25:29 -04:00
InsanityAutomation f44a11f5ff Add SermoonD1 preliminary 2021-09-22 17:02:47 -04:00
InsanityAutomation 7748fa84dd Catchup debug messages 2021-09-15 22:44:33 -04:00
InsanityAutomation cb506ec639 Update Configuration.h 2021-09-15 08:08:15 -04:00
InsanityAutomation 5e4f7516c1 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-09-14 10:25:27 -04:00
InsanityAutomation 6443790c6f Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-09-10 10:41:08 -04:00
InsanityAutomation 9a238fa7f9 Add e3 options for CR6 touch 2021-08-22 19:37:55 -04:00
InsanityAutomation 723fc88e78 Updates to support ExtUI advanced pause messaging 2021-08-21 14:17:34 -04:00
InsanityAutomation 4b4a4ba163 AdvancedPauseExtUIMessaging 2021-08-21 14:17:19 -04:00
InsanityAutomation 57250c8340 Updates for CR6 Screen resume function 2021-08-13 13:32:46 -04:00
InsanityAutomation 6bf069d1ab Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-07-21 18:39:25 -04:00
InsanityAutomation 1921015d1f Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-07-21 18:30:14 -04:00
InsanityAutomation 24f3400c46 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-07-19 15:35:57 -04:00
InsanityAutomation b8c9e823ca Update Configuration.h 2021-07-19 12:18:10 -04:00
InsanityAutomation 6f4b2ce4a2 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-07-13 17:01:45 -04:00
InsanityAutomation ef85eeed2a Minor tweaks 2021-07-13 16:50:08 -04:00
Katelyn Schiesser cd98d0cf5c 🐛 Followup to TEMP_SENSOR_BOARD (#22344)
Followup to #22279
2021-07-12 22:57:01 -05:00
InsanityAutomation 6f57a7311c Update marlinui.cpp 2021-07-08 09:57:59 -04:00
InsanityAutomation dc19c60a0e Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-07-07 17:50:24 -04:00
InsanityAutomation 38c79a4585 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-07-07 10:15:40 -04:00
InsanityAutomation 541e074f97 Merge branch 'CrealityDwin_2.0' into CrealityDwin2.0_Bleeding 2021-07-07 10:12:11 -04:00
InsanityAutomation 2a01b8ea62 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-07-05 13:06:44 -04:00
InsanityAutomation 38fd3782f9 Ender6 BLT Fix 2021-07-03 14:43:04 -04:00
InsanityAutomation f5cfc65c1d Ender6 BLTouch Fix 2021-07-03 12:51:14 -04:00
InsanityAutomation 00f3397cad Create Creality_CR6DWIN_DW74.7z 2021-07-01 11:15:20 -04:00
InsanityAutomation 8e6f5f90c5 Update TM3D_DWINCombinedScreens_V4.7z 2021-06-30 09:54:46 -04:00
InsanityAutomation db0b14d97e fix 2021-06-28 18:45:23 -04:00
Katelyn Schiesser 84158b912b 🐛 Use setTargetHotend in menus (#22247) 2021-06-28 00:30:11 -05:00
InsanityAutomation 21f8c8d7f8 Fix precompiled bins 2021-06-27 22:56:19 -04:00
InsanityAutomation e2363dc64c Update hex files for screen rotate 2021-06-25 19:06:23 -04:00
InsanityAutomation 1f439cd89a Update Configuration.h 2021-06-25 12:04:47 -04:00
InsanityAutomation f3ddc1f8b6 Add screen rotate PB 2021-06-25 12:03:59 -04:00
InsanityAutomation 223971c47f Update Configuration.h 2021-06-25 12:03:40 -04:00
InsanityAutomation c2eeda01de Add screen rotate PB 2021-06-25 11:49:28 -04:00
InsanityAutomation 5ea4241ea3 Simplify conditions and reorder 2021-06-23 20:22:25 -04:00
InsanityAutomation 04845c80e9 Simplify conditions and reorder 2021-06-23 20:22:17 -04:00
InsanityAutomation 8194b7f5fc Merge branch 'CrealityDwin2.0_Bleeding' into CrealityDwin_2.0 2021-06-23 19:20:14 -04:00
InsanityAutomation e735948969 Update TM3D_DWINCombinedScreens_V4.7z 2021-06-23 19:09:59 -04:00
InsanityAutomation 634ddeef7e Update 32 bit bins 2021-06-21 17:08:49 -04:00
Scott Lahteine ea78c6bf61 🐛 Fix compact sensitive pins array (#22184) 2021-06-21 16:11:51 -04:00
InsanityAutomation b52168e37c Binaries, Readme 2021-06-21 16:10:42 -04:00
InsanityAutomation ba7368ce3a Repack screen files, update readme 2021-06-20 22:20:28 -04:00
InsanityAutomation 69d06dd872 Update README.md 2021-06-20 20:12:22 -04:00
InsanityAutomation a92b627d00 remove stale files 2021-06-20 18:17:36 -04:00
InsanityAutomation b9aa338c19 Update platformio.ini 2021-06-20 17:43:09 -04:00
InsanityAutomation 27e105b890 Add toggle option for probe pin on 422/427 2021-06-20 17:27:15 -04:00
InsanityAutomation 494a9a90bb Cleanup and limit adjustment 2021-06-20 17:15:33 -04:00
InsanityAutomation d876e6b80a Add combined screen files 2021-06-20 10:46:59 -04:00
InsanityAutomation 97da6e97b9 add zig to mesh update 2021-06-19 15:02:20 -04:00
InsanityAutomation 671ab75bce Updates for mesh edit 2021-06-19 14:04:42 -04:00
InsanityAutomation 6a98f4e1be Add CR10V3 description, eliminate crx display, minor additions 2021-06-19 10:32:54 -04:00
InsanityAutomation dd86d60a32 Catchup to head 2021-06-18 19:15:34 -04:00
InsanityAutomation 706260d39f Update pause.cpp 2021-06-18 00:12:37 -04:00
InsanityAutomation bae9d18ee9 Update Creality_DWIN.cpp 2021-06-18 00:10:59 -04:00
InsanityAutomation df31aa486e Add Pause State to ExtUI 2021-06-18 00:10:55 -04:00
InsanityAutomation 9a4d0fec6c Fixes from last rebase 2021-06-17 22:13:41 -04:00
InsanityAutomation b1f96cf4f7 Rebase fixes 2021-06-17 00:19:22 -04:00
InsanityAutomation 916aaa4881 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-06-16 17:04:50 -04:00
InsanityAutomation 4a4820d84f Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-06-16 17:00:36 -04:00
InsanityAutomation 8eeea354cd Update Configuration.h 2021-06-16 17:00:23 -04:00
InsanityAutomation b26e53156f Update Configuration.h 2021-06-16 16:17:40 -04:00
InsanityAutomation ce46fafd92 Update serial.h 2021-06-15 22:14:10 -04:00
InsanityAutomation 7d9ee39285 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-06-15 01:21:18 -04:00
InsanityAutomation bf8074c108 definerename 2021-06-14 23:46:40 -04:00
Marcio T dd82d2d217 🐛 Fix FTDI Eve Touch UI, add screens (#22132) 2021-06-14 02:46:50 -05:00
Scott Lahteine 1ee599a2ba 🚨 Suppress pin sign-change warning 2021-06-14 02:43:24 -05:00
InsanityAutomation 8adb58c266 Finish screen config controls 2021-06-14 01:21:19 -04:00
InsanityAutomation 173b0f8bd1 EEPROM settings for volume and brightness 2021-06-13 16:46:37 -04:00
InsanityAutomation e77f6d855b Update EXTUI on MBL 2021-06-12 15:41:43 -04:00
InsanityAutomation 23ce68436a Last bit of Ender 6 manual mesh debug 2021-06-12 15:41:33 -04:00
InsanityAutomation 6e15859ce2 Misc fixes 2021-06-12 14:56:43 -04:00
InsanityAutomation e76f769690 Minor debugging and platform changes 2021-06-12 10:21:41 -04:00
InsanityAutomation 0a2ba2fadf Add EXTUi Click function 2021-06-12 08:54:39 -04:00
InsanityAutomation 37d5f55396 Add cr6 screen files 2021-06-12 08:54:23 -04:00
InsanityAutomation eca2080a3f Add manual mesh to leveling screens 2021-06-12 08:21:17 -04:00
InsanityAutomation d2fc1daf50 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-06-11 15:42:13 -04:00
InsanityAutomation 782fe78ea0 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-06-11 15:40:38 -04:00
InsanityAutomation 084c45a6ee Update Configuration.h 2021-06-11 11:04:07 -04:00
InsanityAutomation 94d8fc8e8a CR6Max 2021-06-11 11:02:13 -04:00
InsanityAutomation 491d82f93e Add CR6 definitions 2021-06-11 10:55:43 -04:00
InsanityAutomation 49fd0950ee Update Configuration_adv.h 2021-06-11 09:14:32 -04:00
InsanityAutomation 06425bf4b7 Ender6 First Pass 2021-06-07 09:54:54 -04:00
InsanityAutomation e9660aeed7 Rebase fixes 2021-06-06 13:20:25 -04:00
InsanityAutomation 6480f0939d Add Ender3 Max 2021-06-06 12:27:14 -04:00
InsanityAutomation d0e9c21aff Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-06-06 12:03:26 -04:00
InsanityAutomation 63d1ae1021 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-06-06 11:53:30 -04:00
InsanityAutomation 5a4b2ba5c5 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-06-05 16:51:34 -04:00
InsanityAutomation a80c371340 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-05-25 09:22:13 -04:00
InsanityAutomation 6d39a6fc55 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-05-23 15:06:33 -04:00
InsanityAutomation 02fe3a6818 Update Ender3V2_Dwin_TM3D.7z 2021-05-16 15:58:17 -04:00
InsanityAutomation be44105ae9 Update Ender3V2_Dwin_TM3D.7z 2021-05-16 15:57:41 -04:00
InsanityAutomation 10e5d92dec Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-05-16 14:18:43 -04:00
InsanityAutomation 2e11485da4 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-05-06 11:55:25 -04:00
InsanityAutomation d305f0a14b Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-05-05 09:46:59 -04:00
Scott Lahteine 5f30e9fe1c Add MKS_LCD12864B 2021-05-05 08:04:04 -05:00
Scott Lahteine 80c8218d94 Add MKS_LCD12864B 2021-05-05 07:23:52 -05:00
Scott Lahteine bed2bfdc24 Misc comments 2021-05-05 07:18:05 -05:00
Scott Lahteine 6f2967a8dc Cleanup, hex formatting 2021-05-05 06:34:02 -05:00
InsanityAutomation 6496cedc17 Update README.md 2021-05-04 14:42:49 -04:00
InsanityAutomation 7b01993bbc Fix link 2021-05-04 14:42:33 -04:00
InsanityAutomation 07a1b00a25 Version bump for rebase to head 2021-05-04 11:56:18 -04:00
InsanityAutomation 7325d66de5 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-05-04 11:08:03 -04:00
InsanityAutomation 865737345f Update Configuration.h 2021-05-04 10:58:53 -04:00
InsanityAutomation dfa6c2f4f1 Update Configuration.h 2021-04-30 21:20:51 -04:00
InsanityAutomation 0a2f0cca93 Thermistor priority issue 2021-04-30 21:20:07 -04:00
InsanityAutomation dbbdf11d75 Merge branch 'CrealityDwin2.0_Bleeding' into CrealityDwin_2.0 2021-04-30 14:06:57 -04:00
InsanityAutomation 6430489e21 zip er up 2021-04-30 12:25:48 -04:00
InsanityAutomation 04d4fca75d Next batch 2021-04-30 09:02:05 -04:00
InsanityAutomation 486cf92c5c Set3 2021-04-30 00:39:59 -04:00
InsanityAutomation 820aff4e7c Merge branch 'CrealityDwin2.0_Bleeding' of https://github.com/InsanityAutomation/Marlin into CrealityDwin2.0_Bleeding 2021-04-29 23:16:15 -04:00
InsanityAutomation 120da68133 Batch 2 hex files 2021-04-29 23:11:16 -04:00
InsanityAutomation 747e21ee3e First batch 731 hex files 2021-04-29 23:10:41 -04:00
InsanityAutomation 53e8c005b7 Update Configuration_adv.h 2021-04-29 10:02:01 -04:00
InsanityAutomation ef01aecd47 Update screen file 2021-04-28 19:40:11 -04:00
InsanityAutomation 6ff92f3215 dw7.3.1 changes 2021-04-28 19:25:30 -04:00
InsanityAutomation ba5bab1a3a Update README.md 2021-04-28 10:53:41 -04:00
InsanityAutomation af0b39982b resolve bad merge 2021-04-28 10:39:32 -04:00
InsanityAutomation 680135583a Update ui_api.cpp 2021-04-28 10:36:40 -04:00
InsanityAutomation bdc256c048 Merge pull request #180 from oliof/patch-1
Update README.md
2021-04-26 23:32:24 -04:00
InsanityAutomation 0948c589d6 Merge branch 'CrealityDwin_2.0' into patch-1 2021-04-26 23:32:07 -04:00
InsanityAutomation fbf069ebe0 Remove leftover stale files 2021-04-26 10:34:33 -04:00
InsanityAutomation 160f8ef0bc Update platformio.ini 2021-04-26 08:25:12 -04:00
InsanityAutomation 93ecbfa88c Merge branch 'CrealityDwin2.0_Bleeding' into CrealityDwin_2.0 2021-04-26 08:24:22 -04:00
InsanityAutomation 19d004b342 Update README.md 2021-04-25 12:44:58 -04:00
InsanityAutomation 8b67e72afc Update README.md 2021-04-25 12:20:41 -04:00
InsanityAutomation 9c863b1c67 Update README.md 2021-04-25 12:12:24 -04:00
InsanityAutomation e4c4acbcc5 Add hex Remainder 2021-04-25 00:23:56 -04:00
InsanityAutomation 7dd2fe3f6c Add first bundle HEX 2021-04-24 19:29:09 -04:00
InsanityAutomation a399028c77 Update platformio.ini 2021-04-24 17:36:29 -04:00
InsanityAutomation 840beb78be Update README.md 2021-04-24 12:37:43 -04:00
InsanityAutomation 1181724b2b Update screen archives and remove stale hexs 2021-04-24 12:27:09 -04:00
InsanityAutomation 227aac34a2 Update Creality_DWIN.cpp 2021-04-22 16:49:31 -04:00
InsanityAutomation ecb6e215c5 Update Creality_DWIN.cpp 2021-04-22 16:07:32 -04:00
InsanityAutomation 8f09db27bd file browse page display 2021-04-22 14:49:26 -04:00
InsanityAutomation 39e4ae2d7a Working 2021-04-21 19:08:16 -04:00
InsanityAutomation 8c181685d2 First sweep 2021-04-20 11:23:25 -04:00
InsanityAutomation 4f2730b6f8 Update Creality_DWIN.h 2021-04-19 22:52:18 -04:00
InsanityAutomation bc12ada74d 422 and 427 adjustments 2021-04-19 17:50:31 -04:00
InsanityAutomation 7e97639e38 Update Version.h 2021-04-18 17:00:19 -04:00
InsanityAutomation c217fd3e66 Update Creality_DWIN.cpp 2021-04-18 16:16:30 -04:00
InsanityAutomation 6f69a30435 Reduce ram usage, convert to PSTRs, move serial to LCDSERIAL base 2021-04-18 13:15:00 -04:00
InsanityAutomation 96d880e745 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-04-18 12:06:36 -04:00
InsanityAutomation d768f875ac Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2021-04-18 12:06:26 -04:00
InsanityAutomation 02d54b9ce7 Update Configuration.h 2021-04-18 12:05:26 -04:00
Scott Lahteine 7070628ef9 Misc. formatting, serial out 2021-04-13 21:34:21 -05:00
InsanityAutomation 1a89a43532 Update platformio.ini 2021-04-12 21:04:46 -04:00
InsanityAutomation 25faa304ee fix ret6 builds 2021-04-11 19:36:37 -04:00
InsanityAutomation 18a0f68ac0 Add hex files 2021-04-09 12:13:42 -04:00
InsanityAutomation 7262ad3fc4 Add CRXPro autobuilds 2021-04-09 12:06:38 -04:00
InsanityAutomation b456959b97 Add CRXPro autobuilds 2021-04-09 10:47:54 -04:00
InsanityAutomation d20182aa91 Some catch up and a look at SKRe3T E3V2 support 2021-04-08 10:50:06 -04:00
InsanityAutomation dc86dd9fae Update platformio.ini 2021-04-07 11:56:28 -04:00
InsanityAutomation e887033c0d Per AJ/Chris add home and Z0 post G29 measuring button 2021-04-07 11:26:38 -04:00
Scott Lahteine d786ba1773 Reimplement reverted PR from testing 2021-04-07 11:18:37 -04:00
InsanityAutomation 3f0a4cfe25 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-04-07 11:12:35 -04:00
InsanityAutomation 442327d92e Leftovers 2021-04-03 15:01:38 -04:00
InsanityAutomation 345ac6e8fe Revert "Optimized string-to-number functions (#21484)"
This reverts commit 20d2061f22.
2021-04-03 13:53:44 -04:00
InsanityAutomation 1b47fe8c64 Fix extui build issues, block hotend idle while paused for user, revert type change 2021-04-03 13:35:43 -04:00
InsanityAutomation 67e9ee7bf2 Fix extui build issues, block hotend idle while paused for user, revert type change 2021-04-03 13:35:07 -04:00
InsanityAutomation 7aecff2ba6 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-04-03 12:43:14 -04:00
InsanityAutomation 2e6d7308f6 Add SKRE3Turbo 2021-04-03 12:33:42 -04:00
InsanityAutomation 9c5ee355e8 Merge branch 'CrealityDwin2.0_Bleeding' into CrealityDwin_2.0 2021-04-03 11:11:01 -04:00
InsanityAutomation 656946a0ff Merge branch 'CrealityDwin2.0_Bleeding' of https://github.com/InsanityAutomation/Marlin into CrealityDwin2.0_Bleeding 2021-02-24 09:09:47 -05:00
InsanityAutomation 48e02a3210 Update Creality_DWIN.h 2021-02-24 09:09:13 -05:00
InsanityAutomation 6891ef5d00 Update Configuration.h 2021-02-23 18:41:46 -05:00
InsanityAutomation c392e6bf07 Minor tweaks 2021-02-23 14:28:20 -05:00
InsanityAutomation de564f9b0a add 7.2 hex files 2021-02-19 23:11:46 -05:00
InsanityAutomation c9aab13192 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-02-19 10:17:09 -05:00
Harald Wagener 9ba9f654c4 Update README.md
Add explanation for LR configuration.
2021-02-17 11:29:44 +01:00
InsanityAutomation a13ebba41a Merge pull request #168 from DrDMoney/patch-1
Update Configuration.h
2021-02-11 15:51:21 -05:00
InsanityAutomation b1153cff1e Merge pull request #176 from x13-me/CrealityDwin_2.0
Added Ender 3 to Readme.md
2021-02-11 15:48:59 -05:00
InsanityAutomation 9aa0004de6 Disable broken feature until I can trace it down 2021-02-10 07:39:53 -05:00
InsanityAutomation 3a9f043c58 Update temperature.cpp 2021-02-10 07:26:20 -05:00
InsanityAutomation 80123bfdf2 fix platform 2021-02-10 07:24:51 -05:00
InsanityAutomation 923ce8e1d8 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-02-10 07:09:49 -05:00
InsanityAutomation c72fc3eaec Update platformio.ini 2021-02-06 11:04:09 -05:00
InsanityAutomation 3aa0763f26 Update Creality_DWIN.cpp 2021-02-02 11:17:12 -05:00
InsanityAutomation 96bee60be9 Update dwin.cpp 2021-02-02 09:33:22 -05:00
InsanityAutomation b5df47bdf7 Add missing extui functions 2021-01-31 17:18:06 -05:00
InsanityAutomation c27474f396 Update Version.h 2021-01-31 15:37:45 -05:00
InsanityAutomation 6af2c36c50 Add E3V2 427 Env 2021-01-31 15:31:38 -05:00
InsanityAutomation 577ebc6ba4 Reimplement live move 2021-01-31 15:27:46 -05:00
InsanityAutomation 4b0135c022 Merge branch 'bugfix-2.0.x' into CrealityDwin2.0_Bleeding 2021-01-31 13:27:55 -05:00
x13.me 27e95f2aab Added Ender 3 to Readme.md 2021-01-25 02:18:13 +00:00
InsanityAutomation 247385e94e Update platformio.ini 2021-01-06 19:05:44 -05:00
Daniel Mooney aafa3af088 Update Configuration.h
PSU_ACTIVE_HIGH should be PSU_ACTIVE_STATE

PSU_ACTIVE_STATE set from false to low.
2020-12-12 14:23:00 -06:00
InsanityAutomation 12e230ca30 Update Configuration.h 2020-12-08 21:29:09 -05:00
InsanityAutomation 225a89004b Poweroff kit 2020-12-05 19:36:09 -05:00
InsanityAutomation 0b6aa3cb2d Update Creality_DWIN.cpp 2020-11-10 09:04:21 -05:00
InsanityAutomation e7d3e67dc4 Merge branch 'CrealityDwin2.0_Bleeding' of https://github.com/InsanityAutomation/Marlin into CrealityDwin2.0_Bleeding 2020-11-08 14:14:53 -05:00
InsanityAutomation 8fd37402a3 Bump rev, invert flag 2020-11-08 14:14:07 -05:00
InsanityAutomation 7cf72d5867 Rebase and catchup
add 2130 option for SKR

Update platformio.ini

Add SKRMini and DDX

Rebase and catchup

add 2130 option for SKR

Update platformio.ini

Minor adjustments following github issues

Update Creality_DWIN.cpp

Update Configuration_adv.h

Update platformio.ini

Rebase and catchup

add 2130 option for SKR

Update platformio.ini

Add SKRMini and DDX

Rebase and catchup

add 2130 option for SKR

Update platformio.ini

Minor adjustments following github issues

Update Creality_DWIN.cpp

Update Configuration_adv.h

Clean up rebase

Update platformio.ini

Update platformio.ini

Add Ender3V2

Update Configuration.h

tweaks for e3v2

Fixes

Add 32 bit Ender3's

eparser and display fixes

MachineEnder3Pro420 -> MachineEnder3Pro422

force silent board for all v4 pcb's

Update Configuration.h

Implement fix from https://github.com/cosmoderp/Marlin/commit/5c8e1e7d4af37e25fb9040dcbf690bbb089948e6

Live axis move and z offset

Update dwin.cpp

Fix info menu screens

borders etc e3v2

Ender 5 SKRMini Tweaks

Update Version.h

Add layer shift rapid correction logic and creality stm32f01 environments for E3V2

changes for melzi to fit

Update Configuration.h

Add DW7 Hex Files

Support 10SPro display on Ender3 422 and 427 boards

Update dwin.cpp

Update Configuration_adv.h

Update Configuration.h
2020-11-08 13:47:02 -05:00
InsanityAutomation a348c3caa9 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2020-11-06 09:30:48 -05:00
InsanityAutomation 6f5430f00a Update Configuration.h 2020-10-26 10:44:44 -04:00
InsanityAutomation 63821d87f9 Update Configuration_adv.h 2020-10-23 14:57:19 -04:00
InsanityAutomation b5f447f144 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2020-10-23 14:32:10 -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
InsanityAutomation 50f10fc57f Update dwin.cpp 2020-10-08 15:56:54 -04:00
InsanityAutomation 12180f20e5 Support 10SPro display on Ender3 422 and 427 boards 2020-10-01 21:20:50 -04:00
InsanityAutomation f5dc8d73ee Add DW7 Hex Files 2020-09-26 10:51:50 -04:00
InsanityAutomation 00e3806613 Update Configuration.h 2020-09-24 12:54:05 -04:00
InsanityAutomation 7296538849 changes for melzi to fit 2020-09-24 09:53:13 -04:00
InsanityAutomation 6c4e3e9215 Add layer shift rapid correction logic and creality stm32f01 environments for E3V2 2020-09-21 10:13:07 -04:00
InsanityAutomation 4f050e8dc9 Update Version.h 2020-09-15 16:53:04 -04:00
InsanityAutomation e50e446676 Ender 5 SKRMini Tweaks 2020-09-14 21:38:07 -04:00
InsanityAutomation b795860c5a borders etc e3v2 2020-09-13 22:35:56 -04:00
InsanityAutomation b97b2b9df8 Fix info menu screens 2020-09-13 11:20:52 -04:00
InsanityAutomation c6bdb2cd95 Update dwin.cpp 2020-09-08 07:48:53 -04:00
InsanityAutomation f409cf8c87 Live axis move and z offset 2020-09-07 19:20:22 -04:00
InsanityAutomation fbb75f41c2 Implement fix from https://github.com/cosmoderp/Marlin/commit/5c8e1e7d4af37e25fb9040dcbf690bbb089948e6 2020-09-05 15:13:10 -04:00
InsanityAutomation d560a493b2 Update Configuration.h 2020-09-03 13:31:32 -04:00
InsanityAutomation 0395b7563e force silent board for all v4 pcb's 2020-09-03 13:19:53 -04:00
InsanityAutomation ebd414b3d5 MachineEnder3Pro420 -> MachineEnder3Pro422 2020-09-03 12:37:58 -04:00
InsanityAutomation 0c8bafba38 eparser and display fixes 2020-09-03 12:33:39 -04:00
InsanityAutomation 65d5c57957 Add 32 bit Ender3's 2020-09-03 12:30:06 -04:00
InsanityAutomation b1d667c04a Fixes 2020-09-03 12:03:20 -04:00
InsanityAutomation ee8ea7a0b5 tweaks for e3v2 2020-09-03 12:03:20 -04:00
InsanityAutomation 89ac692bcc Update Configuration.h 2020-09-03 12:03:20 -04:00
InsanityAutomation 88410b3cfe Add Ender3V2 2020-09-03 12:03:20 -04:00
InsanityAutomation 60eb467bfe Update platformio.ini 2020-09-03 12:03:03 -04:00
InsanityAutomation 1c3407ed62 Update platformio.ini 2020-09-03 12:03:03 -04:00
InsanityAutomation 82064d2341 Clean up rebase 2020-09-03 12:03:03 -04:00
InsanityAutomation 16b7cffe0f Update Configuration_adv.h 2020-09-03 12:03:03 -04:00
InsanityAutomation 638bac84cf Update Creality_DWIN.cpp 2020-09-03 12:03:03 -04:00
InsanityAutomation 9d3ad76d50 Minor adjustments following github issues 2020-09-03 12:03:03 -04:00
InsanityAutomation 6edb31f58c Update platformio.ini 2020-09-03 12:02:49 -04:00
InsanityAutomation 01297cab24 add 2130 option for SKR 2020-09-03 12:02:49 -04:00
InsanityAutomation 80fa195db3 Rebase and catchup 2020-09-03 12:02:49 -04:00
InsanityAutomation 052b4387d3 Add SKRMini and DDX 2020-09-03 12:02:34 -04:00
InsanityAutomation dd5481b001 Update platformio.ini 2020-09-03 12:02:14 -04:00
InsanityAutomation 59e1371f89 add 2130 option for SKR 2020-09-03 12:02:13 -04:00
InsanityAutomation 4fdcae6677 Rebase and catchup 2020-09-03 12:02:13 -04:00
InsanityAutomation 1c3dcae659 Update platformio.ini 2020-09-03 12:01:58 -04:00
InsanityAutomation ec425de694 Update Configuration_adv.h 2020-09-03 12:01:58 -04:00
InsanityAutomation 29899e6fe8 Update Creality_DWIN.cpp 2020-09-03 12:01:58 -04:00
InsanityAutomation f7eaa32bc9 Minor adjustments following github issues 2020-09-03 12:01:58 -04:00
InsanityAutomation 508dc26394 Update platformio.ini 2020-09-03 12:01:33 -04:00
InsanityAutomation 600d5922da add 2130 option for SKR 2020-09-03 12:01:33 -04:00
InsanityAutomation a2efee8b7b Rebase and catchup 2020-09-03 12:01:32 -04:00
InsanityAutomation 239e4737a8 Add SKRMini and DDX 2020-09-03 12:01:00 -04:00
InsanityAutomation c8577bc673 Update platformio.ini 2020-09-03 12:00:22 -04:00
InsanityAutomation 3bd2ed7310 add 2130 option for SKR 2020-09-03 12:00:22 -04:00
InsanityAutomation 79414a1398 Rebase and catchup 2020-09-03 12:00:22 -04:00
312 changed files with 11762 additions and 915 deletions
+2 -1
View File
@@ -111,7 +111,7 @@ tags
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
@@ -170,3 +170,4 @@ __pycache__
# IOLogger logs
*_log.csv
.vscode/extensions.json
Binary file not shown.
Binary file not shown.
+312 -198
View File
@@ -1,3 +1,14 @@
#define INSANITYAUTOMATION_DWIN
#if ENABLED(VULCAN)
#define VULCAN_OFFSET 4
#else
#define VULCAN_OFFSET 0
#endif
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
@@ -60,8 +71,8 @@
// @section info
// 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 CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
#define STRING_CONFIG_H_AUTHOR "InsanityAutomation" // Who made the changes.
#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
/**
* *** VENDORS PLEASE READ ***
@@ -75,7 +86,7 @@
*/
// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
#define SHOW_BOOTSCREEN
//#define SHOW_BOOTSCREEN
// Show the bitmap in Marlin/_Bootscreen.h on startup.
//#define SHOW_CUSTOM_BOOTSCREEN
@@ -86,10 +97,15 @@
// @section machine
// Choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_RAMPS_14_EFB
#endif
#ifndef MOTHERBOARD
#if ENABLED(BTTSKRPRO)
#define MOTHERBOARD BOARD_BTT_SKR_PRO_V1_2
#elif ENABLED(OCTOPUS)
#define MOTHERBOARD BOARD_BTT_OCTOPUS_V1_0
#else
#define MOTHERBOARD BOARD_TENLOG_D3_HERO
#endif
#endif
/**
* Select the serial port on the board to use for communication with the host.
* This allows the connection of wireless adapters (for instance) to non-default port pins.
@@ -98,7 +114,21 @@
*
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
*/
#define SERIAL_PORT 0
#if ENABLED(BTTSKRPRO)
#define SERIAL_PORT -1
#define LCD_SERIAL_PORT 1
#define BAUDRATE_2 115200
#elif ENABLED(OCTOPUS)
#define SERIAL_PORT -1
#define LCD_SERIAL_PORT 1
#define SERIAL_PORT_2 2
#define BAUDRATE_2 115200
#else
#define SERIAL_PORT 0
#define LCD_SERIAL_PORT 2
#define BAUDRATE_2 115200
#endif
/**
* Serial Port Baud Rate
@@ -112,7 +142,6 @@
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
*/
#define BAUDRATE 250000
//#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate
/**
@@ -135,7 +164,7 @@
//#define BLUETOOTH
// Name displayed in the LCD "Ready" message and Info menu
//#define CUSTOM_MACHINE_NAME "3D Printer"
//#define CUSTOM_MACHINE_NAME "Tenlog D3"
// 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
@@ -149,21 +178,36 @@
* These settings allow Marlin to tune stepper driver timing and enable advanced options for
* stepper drivers that support them. You may also override timing options in Configuration_adv.h.
*
* A4988 is assumed for unspecified drivers.
*
* Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers.
*
* Options: A4988, A5984, DRV8825, LV8729, TB6560, TB6600, TMC2100,
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
* 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', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', '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']
*/
#define X_DRIVER_TYPE A4988
#define Y_DRIVER_TYPE A4988
#define Z_DRIVER_TYPE A4988
//#define X2_DRIVER_TYPE A4988
#if ENABLED(Driver2208)
#define DRIVER TMC2208_STANDALONE
#elif ENABLED(Driver2208_UART)
#define DRIVER TMC2208
#elif ENABLED(Driver2209)
#define DRIVER TMC2209_STANDALONE
#elif ENABLED(Driver2209_UART)
#define DRIVER TMC2209
#else
#define DRIVER A4988
#endif
#define X_DRIVER_TYPE DRIVER
#define Y_DRIVER_TYPE DRIVER
#define Z_DRIVER_TYPE DRIVER
#define X2_DRIVER_TYPE DRIVER
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
#define Z2_DRIVER_TYPE DRIVER
//#define Z3_DRIVER_TYPE A4988
//#define Z4_DRIVER_TYPE A4988
//#define I_DRIVER_TYPE A4988
@@ -172,8 +216,8 @@
//#define U_DRIVER_TYPE A4988
//#define V_DRIVER_TYPE A4988
//#define W_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE DRIVER
#define E1_DRIVER_TYPE DRIVER
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
//#define E4_DRIVER_TYPE A4988
@@ -227,7 +271,7 @@
// This defines the number of extruders
// :[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.
#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75
@@ -401,26 +445,26 @@
* Enable and connect the power supply to the PS_ON_PIN.
* Specify whether the power supply is active HIGH or active LOW.
*/
//#define PSU_CONTROL
#define PSU_CONTROL
//#define PSU_NAME "Power Supply"
#if ENABLED(PSU_CONTROL)
//#define MKS_PWC // Using the MKS PWC add-on
//#define PS_OFF_CONFIRM // Confirm dialog 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 HIGH // Set 'LOW' for ATX, 'HIGH' for X-Box
//#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 LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of 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_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 PSU_POWERUP_GCODE "M355 S1" // G-code to run after power-on (e.g., case light on)
//#define PSU_POWEROFF_GCODE "M355 S0" // G-code to run before power-off (e.g., case light off)
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
#if ENABLED(AUTO_POWER_CONTROL)
#define AUTO_POWER_FANS // Turn on PSU if fans need power
#define AUTO_POWER_E_FANS
@@ -431,7 +475,7 @@
//#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time.
#endif
#if EITHER(AUTO_POWER_CONTROL, POWER_OFF_WAIT_FOR_COOLDOWN)
//#define AUTO_POWER_E_TEMP 50 // (°C) PSU on if any extruder is over this temperature
#define AUTO_POWER_E_TEMP 50 // (°C) PSU on if any extruder is over this temperature
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) PSU on if the chamber is over this temperature
//#define AUTO_POWER_COOLER_TEMP 26 // (°C) PSU on if the cooler is over this temperature
#endif
@@ -537,14 +581,18 @@
*
*/
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_1 1
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_4 0
#define TEMP_SENSOR_5 0
#define TEMP_SENSOR_6 0
#define TEMP_SENSOR_7 0
#define TEMP_SENSOR_BED 0
#if ENABLED(ACBed)
#define TEMP_SENSOR_BED 11
#else
#define TEMP_SENSOR_BED 1
#endif
#define TEMP_SENSOR_PROBE 0
#define TEMP_SENSOR_CHAMBER 0
#define TEMP_SENSOR_COOLER 0
@@ -569,23 +617,17 @@
#define MAX31865_CALIBRATION_OHMS_2 430
#endif
#if HAS_E_TEMP_SENSOR
#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109
#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
#endif
#define TEMP_RESIDENCY_TIME 5 // (seconds) Time to wait for hotend to "settle" in M109
#define TEMP_WINDOW 3 // (°C) Temperature proximity for the "temperature reached" timer
#define TEMP_HYSTERESIS 5 // (°C) Temperature proximity considered "close enough" to the target
#if TEMP_SENSOR_BED
#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_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
#endif
#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) Time to wait for bed to "settle" in M190
#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
#if TEMP_SENSOR_CHAMBER
#define TEMP_CHAMBER_RESIDENCY_TIME 10 // (seconds) Time to wait for chamber to "settle" in M191
#define TEMP_CHAMBER_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
#define TEMP_CHAMBER_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
#endif
#define TEMP_CHAMBER_RESIDENCY_TIME 10 // (seconds) Time to wait for chamber to "settle" in M191
#define TEMP_CHAMBER_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
#define TEMP_CHAMBER_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
/**
* Redundant Temperature Sensor (TEMP_SENSOR_REDUNDANT)
@@ -619,8 +661,8 @@
// Above this temperature the heater will be switched off.
// This can protect components from overheating, but NOT from shorts and failures.
// (Use MINTEMP for thermistor short/failure protection.)
#define HEATER_0_MAXTEMP 275
#define HEATER_1_MAXTEMP 275
#define HEATER_0_MAXTEMP 315
#define HEATER_1_MAXTEMP 315
#define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
#define HEATER_4_MAXTEMP 275
@@ -656,16 +698,17 @@
#define PID_K1 0.95 // Smoothing factor within any PID loop
#if ENABLED(PIDTEMP)
//#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)
// Set/get with G-code: M301 E[extruder number, 0-2]
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
//#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
// Set/get with gcode: M301 E[extruder number, 0-2]
#if ENABLED(PID_PARAMS_PER_HOTEND)
// 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.
#define DEFAULT_Kp_LIST { 22.20, 22.20 }
#define DEFAULT_Ki_LIST { 1.08, 1.08 }
#define DEFAULT_Kd_LIST { 114.00, 114.00 }
#define DEFAULT_Kp_LIST { 16.80, 16.80 }
#define DEFAULT_Ki_LIST { 1.32, 1.32 }
#define DEFAULT_Kd_LIST { 53.34, 53.34 }
#else
#define DEFAULT_Kp 22.20
#define DEFAULT_Ki 1.08
@@ -734,7 +777,7 @@
* the issues involved, don't use bed PID until someone else verifies that your hardware works.
* @section bed temp
*/
//#define PIDTEMPBED
#define PIDTEMPBED
//#define BED_LIMIT_SWITCHING
@@ -752,9 +795,9 @@
// 120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
// from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00
#define DEFAULT_bedKi .023
#define DEFAULT_bedKd 305.4
#define DEFAULT_bedKp 154.01
#define DEFAULT_bedKi 17.73
#define DEFAULT_bedKd 892.09
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#endif // PIDTEMPBED
@@ -1095,7 +1138,7 @@
//#define USE_UMIN_PLUG
//#define USE_VMIN_PLUG
//#define USE_WMIN_PLUG
//#define USE_XMAX_PLUG
#define USE_XMAX_PLUG
//#define USE_YMAX_PLUG
//#define USE_ZMAX_PLUG
//#define USE_IMAX_PLUG
@@ -1156,18 +1199,26 @@
#endif
// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#if ENABLED(OpticalY)
#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#else
#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#endif
#if ENABLED(BL_Touch)
#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#else
#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#endif
#define I_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define J_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define K_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define U_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define V_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define W_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define I_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define J_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define K_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
@@ -1215,21 +1266,32 @@
* following movement settings. If fewer factors are given than the
* 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/°)
* Override with M92
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 }
#if ENABLED(TitanExtruder)
#define ESTEPS 382.17
#elif ANY(BMGExtruderV2, BMGExtruderV3)
#define ESTEPS 413
#elif ENABLED(BondtechLGX)
#define ESTEPS 400
#elif ENABLED(H2Extruder)
#define ESTEPS 932
#else
#define ESTEPS 92.6
#endif
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 800, ESTEPS, ESTEPS }
/**
* Default Max Feed Rate (linear=mm/s, rotational=°/s)
* Override with M203
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 }
#define DEFAULT_MAX_FEEDRATE { 200.00, 200.00, 10, 50, 50 }
//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
#if ENABLED(LIMITED_MAX_FR_EDITING)
@@ -1242,7 +1304,7 @@
* Override with M201
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 }
#define DEFAULT_MAX_ACCELERATION {800, 800, 100, 1000, 1000}
//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
#if ENABLED(LIMITED_MAX_ACCEL_EDITING)
@@ -1257,9 +1319,9 @@
* M204 R Retract Acceleration
* M204 T Travel Acceleration
*/
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration for printing moves
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves
#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves
#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts
#define DEFAULT_TRAVEL_ACCELERATION 750 // X, Y, Z acceleration for travel (non printing) moves
/**
* Default Jerk limits (mm/s)
@@ -1269,11 +1331,11 @@
* When changing speed and direction, if the difference is less than the
* value set here, it may happen instantaneously.
*/
//#define CLASSIC_JERK
#define CLASSIC_JERK
#if ENABLED(CLASSIC_JERK)
#define DEFAULT_XJERK 10.0
#define DEFAULT_YJERK 10.0
#define DEFAULT_ZJERK 0.3
#define DEFAULT_XJERK 20.0
#define DEFAULT_YJERK 5.0
#define DEFAULT_ZJERK 0.2
//#define DEFAULT_IJERK 0.3
//#define DEFAULT_JJERK 0.3
//#define DEFAULT_KJERK 0.3
@@ -1312,7 +1374,7 @@
*
* See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained
*/
//#define S_CURVE_ACCELERATION
#define S_CURVE_ACCELERATION
//===========================================================================
//============================= Z Probe Options =============================
@@ -1362,8 +1424,9 @@
* Use G29 repeatedly, adjusting the Z height at each point with movement commands
* or (with LCD_BED_LEVELING) the LCD controller.
*/
//#define PROBE_MANUALLY
#if DISABLED(BL_Touch)
#define PROBE_MANUALLY
#endif
/**
* A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
* (e.g., an inductive probe or a nozzle-based probe-switch.)
@@ -1385,7 +1448,9 @@
/**
* The BLTouch probe uses a Hall effect sensor and emulates a servo.
*/
//#define BLTOUCH
#if ENABLED(BL_Touch)
#define BLTOUCH
#endif
/**
* MagLev V4 probe by MDD
@@ -1537,17 +1602,27 @@
* | [-] |
* O-- FRONT --+
*/
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
#if ENABLED(BMGExtruderV2)
#define NOZZLE_TO_PROBE_OFFSET { 7, -47, -1.34 }
#elif ENABLED(BMGExtruderV3)
#define NOZZLE_TO_PROBE_OFFSET { -43.0, -4.0, -1 }
#elif ENABLED(TitanExtruder)
#define NOZZLE_TO_PROBE_OFFSET { 7, -47, -1.34 }
#elif ENABLED(H2Extruder)
#define NOZZLE_TO_PROBE_OFFSET { -34.5, -3, -1.34 }
#else
#define NOZZLE_TO_PROBE_OFFSET { -43.0, -4.0, -1 }
#endif
// 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.
#define PROBING_MARGIN 10
#define PROBING_MARGIN 15
// X and Y axis travel speed (mm/min) between probes
#define XY_PROBE_FEEDRATE (133*60)
// 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 (8*60)
// Feedrate (mm/min) for the "accurate" probe of each point
#define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2)
@@ -1597,7 +1672,7 @@
* 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.
*/
//#define MULTIPLE_PROBING 2
#define MULTIPLE_PROBING 2
//#define EXTRA_PROBING 1
/**
@@ -1614,16 +1689,16 @@
* 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.
*/
#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_DEPLOY_PROBE 7 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points
#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes
//#define Z_AFTER_PROBING 5 // Z position after probing is done
#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
#define Z_PROBE_LOW_POINT -4 // Farthest distance below the trigger-point to go before stopping
// For M851 give a range for adjusting the Z probe offset
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20
#define Z_PROBE_OFFSET_RANGE_MIN -9
#define Z_PROBE_OFFSET_RANGE_MAX 9
// Enable the M48 repeatability test to test probe accuracy
//#define Z_MIN_PROBE_REPEATABILITY_TEST
@@ -1694,9 +1769,16 @@
// @section motion
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR false
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false
#if ENABLED(DriverA4988)
#define INVERT_X_DIR false
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false
#else
#define INVERT_X_DIR false
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false
#endif
//#define INVERT_I_DIR false
//#define INVERT_J_DIR false
//#define INVERT_K_DIR false
@@ -1707,8 +1789,13 @@
// @section extruder
// For direct drive extruder v9 set to true, for geared extruder set to false.
#define INVERT_E0_DIR false
#define INVERT_E1_DIR false
#if COUNT_ENABLED(DriverA4988, TitanExtruder) == 1
#define INVERT_E0_DIR false
#define INVERT_E1_DIR true
#else
#define INVERT_E0_DIR true
#define INVERT_E1_DIR false
#endif
#define INVERT_E2_DIR false
#define INVERT_E3_DIR false
#define INVERT_E4_DIR false
@@ -1748,16 +1835,56 @@
// @section geometry
// The size of the printable area
#define X_BED_SIZE 200
#define Y_BED_SIZE 200
#if ANY(TitanExtruder, H2Extruder)
#define Y_OFFSET -2 TERN_(OpticalY, - 8)
#define X_OFFSET -3
#elif ANY(BMGExtruderV2, BMGExtruderV3)
#define Y_OFFSET 0 TERN_(OpticalY, - 8)
#define X_OFFSET 0
#else
#define Y_OFFSET -4 TERN_(OpticalY, - 8)
#define X_OFFSET -1
#endif
#if ENABLED(MachineTLD3P)
#define X_BED_SIZE 310 - VULCAN_OFFSET
#define Y_BED_SIZE 310
#define Y_MAX_POS 333 + Y_OFFSET
#define Z_MAX_POS 350
#elif ENABLED(MachineTLD4)
#define X_BED_SIZE 405 - VULCAN_OFFSET
#define Y_BED_SIZE 420
#define Y_MAX_POS 433 + Y_OFFSET
#define Z_MAX_POS 410
#elif ENABLED(MachineTLD5)
#define X_BED_SIZE 505 - VULCAN_OFFSET
#define Y_BED_SIZE 520
#define Y_MAX_POS 533 + Y_OFFSET
#define Z_MAX_POS 610
#elif ENABLED(MachineTLD6)
#define X_BED_SIZE 605 - VULCAN_OFFSET
#define Y_BED_SIZE 620
#define Y_MAX_POS 633 + Y_OFFSET
#define Z_MAX_POS 610
#elif ENABLED(MachineTLD2P)
#define X_BED_SIZE 220 - VULCAN_OFFSET
#define Y_BED_SIZE 225
#define Y_MAX_POS 238 + Y_OFFSET
#define Z_MAX_POS 260
#elif ENABLED(MachineTLH2P)
#define X_BED_SIZE 235 - VULCAN_OFFSET
#define Y_BED_SIZE 240
#define Y_MAX_POS 253 + Y_OFFSET
#define Z_MAX_POS 260
#endif
// Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define X_MIN_POS -50 + X_OFFSET + VULCAN_OFFSET
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 200
#define X_MAX_POS X_BED_SIZE + VULCAN_OFFSET
//#define Y_MAX_POS Y_BED_SIZE
//#define Z_MAX_POS 200
//#define I_MIN_POS 0
//#define I_MAX_POS 50
//#define J_MIN_POS 0
@@ -1825,66 +1952,52 @@
* 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.
*/
//#define FILAMENT_RUNOUT_SENSOR
#define 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 NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
#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_PULLDOWN // Use internal pulldown for filament runout pins.
//#define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder.
// This is automatically enabled for MIXING_EXTRUDERs.
// Override individually if the runout sensors vary
//#define FIL_RUNOUT1_STATE LOW
//#define FIL_RUNOUT1_PULLUP
//#define FIL_RUNOUT1_PULLDOWN
//#define FIL_RUNOUT2_STATE LOW
//#define FIL_RUNOUT2_PULLUP
//#define FIL_RUNOUT2_PULLDOWN
//#define FIL_RUNOUT3_STATE LOW
//#define FIL_RUNOUT3_PULLUP
//#define FIL_RUNOUT3_PULLDOWN
//#define FIL_RUNOUT4_STATE LOW
//#define FIL_RUNOUT4_PULLUP
//#define FIL_RUNOUT4_PULLDOWN
//#define FIL_RUNOUT5_STATE LOW
//#define FIL_RUNOUT5_PULLUP
//#define FIL_RUNOUT5_PULLDOWN
//#define FIL_RUNOUT6_STATE LOW
//#define FIL_RUNOUT6_PULLUP
//#define FIL_RUNOUT6_PULLDOWN
//#define FIL_RUNOUT7_STATE LOW
//#define FIL_RUNOUT7_PULLUP
//#define FIL_RUNOUT7_PULLDOWN
//#define FIL_RUNOUT8_STATE LOW
//#define FIL_RUNOUT8_PULLUP
//#define FIL_RUNOUT8_PULLDOWN
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
#define FIL_RUNOUT_ENABLED { true } // Default enabled state for sensors E0[, E1[, E2[, E3...]]]. Override with M591EnnSn followed by M500.
#define FIL_RUNOUT_MODE { 1 } // Default mode for sensors E0[, E1[, E2[, E3...]]]. 0:NONE 1:Switch NO 2:Switch NC 7:Motion Sensor Override with M591EnPnn
//#define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder.
// This is automatically enabled for MIXING_EXTRUDERs.
// 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")
// 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"
// After a runout is detected, continue printing this length of filament
// 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.
//#define FILAMENT_RUNOUT_DISTANCE_MM 25
// In Mode 1 or 2, continue printing this length of filament after a run out occurs before executing the
// runout script. Useful for a sensor at the end of a feed tube or debounce on a flakey sensor.
// In Mode 7, extrusion distance to expect a change of state.
// Override with M591EnLnn
#define FIL_RUNOUT_DISTANCE_MM { 10 }
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
// Enable this option to use an encoder disc that toggles the runout pin
// as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
// large enough to avoid false positives.)
//#define FILAMENT_MOTION_SENSOR
#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
//===========================================================================
@@ -1929,14 +2042,18 @@
//#define AUTO_BED_LEVELING_LINEAR
//#define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING
#if ENABLED(BL_Touch)
#define AUTO_BED_LEVELING_BILINEAR
#else
#define MESH_BED_LEVELING
#endif
/**
* Normally G28 leaves leveling disabled on completion. Enable one of
* these options to restore the prior leveling state or to always enable
* leveling immediately after G28.
*/
//#define RESTORE_LEVELING_AFTER_G28
#define RESTORE_LEVELING_AFTER_G28
//#define ENABLE_LEVELING_AFTER_G28
/**
@@ -1970,28 +2087,24 @@
#endif
#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL)
/**
* Gradually reduce leveling correction until a set height is reached,
* at which point movement will be level to the machine's XY plane.
* The height can be set with M420 Z<height>
*/
#define ENABLE_LEVELING_FADE_HEIGHT
// Gradually reduce leveling correction until a set height is reached,
// at which point movement will be level to the machine's XY plane.
// The height can be set with M420 Z<height>
//#define 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 00.0 // (mm) Default fade height.
#endif
/**
* For Cartesian machines, instead of dividing moves on mesh boundaries,
* split up moves into short segments like a Delta. This follows the
* contours of the bed more closely than edge-to-edge straight moves.
*/
// For Cartesian machines, instead of dividing moves on mesh boundaries,
// split up moves into short segments like a Delta. This follows the
// contours of the bed more closely than edge-to-edge straight moves.
#define SEGMENT_LEVELED_MOVES
#define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one)
/**
* Enable the G26 Mesh Validation Pattern tool.
*/
//#define G26_MESH_VALIDATION
#define G26_MESH_VALIDATION
#if ENABLED(G26_MESH_VALIDATION)
#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.
@@ -2007,7 +2120,7 @@
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension.
#define GRID_MAX_POINTS_X 3
#define GRID_MAX_POINTS_X 5
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Probe along the Y axis, advancing X after each column
@@ -2017,7 +2130,7 @@
// Beyond the probed grid, continue the implied tilt?
// Default is to maintain the height of the nearest edge.
//#define EXTRAPOLATE_BEYOND_GRID
#define EXTRAPOLATE_BEYOND_GRID
//
// Subdivision of the grid by Catmull-Rom method.
@@ -2060,7 +2173,7 @@
//===========================================================================
#define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed
#define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited.
#define GRID_MAX_POINTS_X 5 // Don't use more than 7 points per axis, implementation limited.
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
//#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS
@@ -2082,8 +2195,12 @@
// Add a menu item to move between bed corners for manual bed adjustment
//#define LCD_BED_TRAMMING
#define BED_TRAMMING_INSET_LFRB { 22, 22, 22, 22 } // (mm) Left, Front, Right, Back insets
#define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points
#define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points
#if ENABLED(LCD_BED_TRAMMING)
#define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets
#define BED_TRAMMING_INSET_LFRB { 22, 22, 22, 22 } // (mm) Left, Front, Right, Back insets
#define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points
#define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points
//#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner
@@ -2144,8 +2261,9 @@
* - Allows Z homing only when XY positions are known and trusted.
* - If stepper drivers sleep, XY homing may be required again before Z homing.
*/
//#define Z_SAFE_HOMING
#if ENABLED(BL_Touch)
#define Z_SAFE_HOMING
#endif
#if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
#define Z_SAFE_HOMING_Y_POINT Y_CENTER // Y point for Z homing
@@ -2230,12 +2348,12 @@
* M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes)
* M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
*/
//#define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
#define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
#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)
//#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.
#endif
@@ -2251,8 +2369,6 @@
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating
// @section units
//
// G20/G21 Inch mode support
//
@@ -2293,11 +2409,11 @@
* P1 Raise the nozzle always to Z-park height.
* 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)
// 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 { (X_BED_SIZE / 3), (Y_MIN_POS + 10), 5 }
#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_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis)
@@ -2340,19 +2456,19 @@
*
* Caveats: The ending Z should be the same as starting Z.
*/
//#define NOZZLE_CLEAN_FEATURE
#define NOZZLE_CLEAN_FEATURE
#if ENABLED(NOZZLE_CLEAN_FEATURE)
// Default number of pattern repetitions
#define NOZZLE_CLEAN_STROKES 12
#define NOZZLE_CLEAN_STROKES 6
// Default number of triangles
#define NOZZLE_CLEAN_TRIANGLES 3
// 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) }}
#define NOZZLE_CLEAN_START_POINT { { 30, 30, (Z_MIN_POS + 1) } }
#define NOZZLE_CLEAN_END_POINT { { 100, 60, (Z_MIN_POS + 1) } }
#define NOZZLE_CLEAN_START_POINT { { X_MIN_POS + 5 }, { X2_MAX_POS - 5 } }
#define NOZZLE_CLEAN_END_POINT { { X_MIN_POS + 35 }, { X2_MAX_POS - 35 } }
// Circular pattern radius
#define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5
@@ -2365,10 +2481,10 @@
#define NOZZLE_CLEAN_GOBACK
// 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
//#define NOZZLE_CLEAN_NO_Y
#define NOZZLE_CLEAN_NO_Y
// Require a minimum hotend temperature for cleaning
#define NOZZLE_CLEAN_MIN_TEMP 170
@@ -2407,8 +2523,6 @@
*/
#define PRINTJOB_TIMER_AUTOSTART
// @section stats
/**
* Print Counter
*
@@ -2423,7 +2537,7 @@
*/
//#define PRINTCOUNTER
#if ENABLED(PRINTCOUNTER)
#define PRINTCOUNTER_SAVE_INTERVAL 60 // (minutes) EEPROM save interval during print. A value of 0 will save stats at end of print.
#define PRINTCOUNTER_SAVE_INTERVAL 60 // (minutes) EEPROM save interval during print
#endif
// @section security
@@ -2514,7 +2628,7 @@
* 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.
*/
//#define SDSUPPORT
#define SDSUPPORT
/**
* SD CARD: ENABLE CRC
@@ -2696,7 +2810,6 @@
//======================== LCD / Controller Selection =========================
//===================== (I2C and Shift-Register LCDs) =====================
//=============================================================================
//
// CONTROLLER TYPE: I2C
//
@@ -3061,7 +3174,9 @@
// Third-party or vendor-customized controller interfaces.
// Sources should be installed in 'src/lcd/extui'.
//
//#define EXTENSIBLE_UI
#if ENABLED(INSANITYAUTOMATION_DWIN)
#define EXTENSIBLE_UI
#endif
#if ENABLED(EXTENSIBLE_UI)
//#define EXTUI_LOCAL_BEEPER // Enables use of local Beeper pin with external display
@@ -3358,15 +3473,14 @@
// Support for Adafruit NeoPixel LED driver
//#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW, NEO_RGBW, NEO_GRB, NEO_RBG, etc.
// See https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.h
//#define NEOPIXEL_PIN 4 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#define NEOPIXEL_TYPE NEO_RGB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
//#define NEOPIXEL_PIN 4 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
// Support for second Adafruit NeoPixel LED driver controlled with M150 S1 ...
//#define NEOPIXEL2_SEPARATE
+156 -98
View File
@@ -300,12 +300,12 @@
* THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
*/
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
#define THERMAL_PROTECTION_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 15 // Degrees Celsius
//#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
#if ENABLED(ADAPTIVE_FAN_SLOWING) && EITHER(MPCTEMP, PIDTEMP)
//#define TEMP_TUNING_MAINTAIN_FAN // Don't slow fan speed during M303 or M306 T
#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
#if ENABLED(ADAPTIVE_FAN_SLOWING) && EITHER(MPCTEMP, PIDTEMP)
#define TEMP_TUNING_MAINTAIN_FAN // Don't slow fan speed during M303 or M306 T
#endif
/**
@@ -320,7 +320,7 @@
* and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set
* below 2.
*/
#define WATCH_TEMP_PERIOD 40 // Seconds
#define WATCH_TEMP_PERIOD 30 // Seconds
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
#endif
@@ -328,13 +328,22 @@
* Thermal Protection parameters for the bed are just as above for hotends.
*/
#if ENABLED(THERMAL_PROTECTION_BED)
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#if ENABLED(MachineTLD6)
#define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
#else
#define THERMAL_PROTECTION_BED_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius
#endif
/**
* As described above, except for the bed (M140/M190/M303).
*/
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
#if ENABLED(MachineTLD6)
#define WATCH_BED_TEMP_PERIOD 240 // Seconds
#else
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
#endif
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#endif
@@ -515,10 +524,10 @@
* Hotend Idle Timeout
* 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)
#define HOTEND_IDLE_TIMEOUT_SEC (5*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_TIMEOUT_SEC (20*60) // (seconds) Time without extruder movement to trigger protection
#define HOTEND_IDLE_MIN_TRIGGER 140 // (°C) Minimum temperature to enable hotend protection
#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
#endif
@@ -539,9 +548,11 @@
* The fan turns on automatically whenever any driver is enabled and turns
* off (or reduces to idle speed) shortly after drivers are turned off.
*/
//#define USE_CONTROLLER_FAN
#if ENABLED(BTTSKRPRO)
#define USE_CONTROLLER_FAN
#endif
#if ENABLED(USE_CONTROLLER_FAN)
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
#define CONTROLLER_FAN_PIN FAN3_PIN // Set a custom pin for the controller fan
//#define CONTROLLER_FAN2_PIN -1 // Set a custom pin for second controller fan
//#define CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered
//#define CONTROLLER_FAN_IGNORE_Z // Ignore Z stepper. Useful when stepper timeout is disabled.
@@ -553,7 +564,7 @@
// Use TEMP_SENSOR_BOARD as a trigger for enabling the controller fan
//#define CONTROLLER_FAN_MIN_BOARD_TEMP 40 // (°C) Turn on the fan if the board reaches this temperature
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
#if ENABLED(CONTROLLER_FAN_EDITABLE)
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu
#endif
@@ -565,7 +576,7 @@
* gets it spinning reliably for a short time before setting the requested speed.
* (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
// Some coolers may require a non-zero "off" state.
@@ -643,8 +654,13 @@
* 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.
*/
#define E0_AUTO_FAN_PIN -1
#define E1_AUTO_FAN_PIN -1
#if ENABLED(OCTOPUS)
#define E0_AUTO_FAN_PIN PA8
#define E1_AUTO_FAN_PIN PE5
#else
#define E0_AUTO_FAN_PIN FAN2_PIN
#define E1_AUTO_FAN_PIN FAN2_PIN
#endif
#define E2_AUTO_FAN_PIN -1
#define E3_AUTO_FAN_PIN -1
#define E4_AUTO_FAN_PIN -1
@@ -702,9 +718,15 @@
* The multiplexer is automatically switched at tool-change.
* Set FANMUX[012]_PINs below for up to 2, 4, or 8 multiplexed fans.
*/
#define FANMUX0_PIN -1
#define FANMUX1_PIN -1
#define FANMUX2_PIN -1
#if ENABLED(OCTOPUS)
#define FANMUX0_PIN PD12
#define FANMUX1_PIN PD13
#define FANMUX2_PIN -1
#else
#define FANMUX0_PIN -1
#define FANMUX1_PIN -1
#define FANMUX2_PIN -1
#endif
/**
* M355 Case Light on-off / brightness
@@ -774,13 +796,32 @@
* Set the initial X offset and temperature differential with M605 S2 X[offs] R[deg] and
* follow with M605 S3 to initiate mirrored movement.
*/
//#define DUAL_X_CARRIAGE
#define DUAL_X_CARRIAGE
#if ENABLED(DUAL_X_CARRIAGE)
#define X1_MIN_POS X_MIN_POS // Set to X_MIN_POS
#define X1_MIN_POS -50 // 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 X2_MIN_POS 80 // 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
#define X2_HOME_DIR 1 // Set to 1. The X2 carriage always homes to the max endstop position
#define X2_MIN_POS 15 // A min coordinate so the X2 carriage can't hit the parked X1 carriage
#if ANY(TitanExtruder, H2Extruder)
#define X2_OFFSET 12
#elif ANY(BMGExtruderV2, BMGExtruderV3)
#define X2_OFFSET 0
#else
#define X2_OFFSET -3
#endif
#if ENABLED(MachineTLD3P)
#define X2_MAX_POS 359 + X2_OFFSET - VULCAN_OFFSET // The max position of the X2 carriage, typically also the home position
#elif ENABLED(MachineTLD4)
#define X2_MAX_POS 454 + X2_OFFSET - VULCAN_OFFSET
#elif ENABLED(MachineTLD5)
#define X2_MAX_POS 554 + X2_OFFSET - VULCAN_OFFSET
#elif ENABLED(MachineTLD6)
#define X2_MAX_POS 654 + X2_OFFSET - VULCAN_OFFSET
#elif ENABLED(MachineTLD2P)
#define X2_MAX_POS 264 + X2_OFFSET - VULCAN_OFFSET
#elif ENABLED(MachineTLH2P)
#define X2_MAX_POS 279 + X2_OFFSET - VULCAN_OFFSET
#endif
#define X2_HOME_DIR 1 // Set to 1. The X2 carriage always homes to the max endstop position
#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.
// This allows recalibration of endstops distance without a rebuild.
@@ -790,7 +831,7 @@
#define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE
// Default x offset in duplication mode (typically set to half print bed width)
#define DEFAULT_DUPLICATION_X_OFFSET 100
#define DEFAULT_DUPLICATION_X_OFFSET X_CENTER
// Default action to execute following M605 mode change commands. Typically G28X to apply new mode.
//#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X"
@@ -820,7 +861,7 @@
//#define INVERT_X2_VS_X_DIR // X2 direction signal is the opposite of X
//#define X_DUAL_ENDSTOPS // X2 has its own endstop
#if ENABLED(X_DUAL_ENDSTOPS)
#define X2_USE_ENDSTOP _XMAX_ // X2 endstop board plug. Don't forget to enable USE_*_PLUG.
//#define X2_USE_ENDSTOP _XMAX_ // X2 endstop board plug. Don't forget to enable USE_*_PLUG.
#define X2_ENDSTOP_ADJUSTMENT 0 // X2 offset relative to X endstop
#endif
#endif
@@ -840,9 +881,11 @@
#ifdef Z2_DRIVER_TYPE
//#define INVERT_Z2_VS_Z_DIR // Z2 direction signal is the opposite of Z
//#define Z_MULTI_ENDSTOPS // Other Z axes have their own endstops
#if DISABLED(BLTOUCH)
#define Z_MULTI_ENDSTOPS // Other Z axes have their own endstops
#endif
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z2_USE_ENDSTOP _ZMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Z endstop
#endif
#ifdef Z3_DRIVER_TYPE
@@ -884,10 +927,10 @@
#define HOMING_BUMP_MM { 5, 5, 2 } // (linear=mm, rotational=°) Backoff from endstops after first bump
#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing
//#define HOMING_BACKOFF_POST_MM { 8, 8, 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 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_Z_FIRST // Home Z first. Requires a Z-MIN endstop (not a probe).
//#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first
@@ -956,7 +999,7 @@
*
* 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
// Safety: Enable voltage mode settings in the LCD menu.
//#define BLTOUCH_LCD_VOLTAGE_MENU
@@ -969,7 +1012,9 @@
* Z Steppers Auto-Alignment
* Add the G34 command to align multiple Z steppers using a bed probe.
*/
//#define Z_STEPPER_AUTO_ALIGN
#if ENABLED(BL_Touch)
#define Z_STEPPER_AUTO_ALIGN
#endif
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
/**
* Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
@@ -1015,13 +1060,13 @@
#ifndef Z_STEPPER_ALIGN_STEPPER_XY
// Amplification factor. Used to scale the correction step up or down in case
// the stepper (spindle) position is farther out than the test point.
#define Z_STEPPER_ALIGN_AMP 1.0 // Use a value > 1.0 NOTE: This may cause instability!
#define Z_STEPPER_ALIGN_AMP 0.5 // Use a value > 1.0 NOTE: This may cause instability!
#endif
// On a 300mm bed a 5% grade would give a misalignment of ~1.5cm
#define G34_MAX_GRADE 5 // (%) Maximum incline that G34 will handle
#define Z_STEPPER_ALIGN_ITERATIONS 5 // Number of iterations to apply during alignment
#define Z_STEPPER_ALIGN_ACC 0.02 // Stop iterating early if the accuracy is better than this
#define Z_STEPPER_ALIGN_ITERATIONS 9 // Number of iterations to apply during alignment
#define Z_STEPPER_ALIGN_ACC 0.01 // Stop iterating early if the accuracy is better than this
#define RESTORE_LEVELING_AFTER_G34 // Restore leveling after G34 is done?
// After G34, re-home Z (G28 Z) or just calculate it from the last probe heights?
// Re-homing might be more precise in reproducing the actual 'G28 Z' homing height, especially on an uneven bed.
@@ -1083,8 +1128,10 @@
* X<1> Set the given parameters only for the X axis.
* Y<1> Set the given parameters only for the Y axis.
*/
//#define INPUT_SHAPING_X
//#define INPUT_SHAPING_Y
#if ENABLED(MachineLargeROM)
#define INPUT_SHAPING_X
#define INPUT_SHAPING_Y
#endif
#if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#if ENABLED(INPUT_SHAPING_X)
#define SHAPING_FREQ_X 40 // (Hz) The default dominant resonant frequency on the X axis.
@@ -1135,7 +1182,7 @@
// Default Minimum Feedrates for printing and travel moves
#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum feedrate. Set with M205 S.
#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum travel feedrate. Set with M205 T.
#define DEFAULT_MINTRAVELFEEDRATE 10.0 // (mm/s. °/s for rotational-only moves) Minimum travel feedrate. Set with M205 T.
// Minimum time that a segment needs to take as the buffer gets emptied
#define DEFAULT_MINSEGMENTTIME 20000 // (µs) Set with M205 B.
@@ -1172,7 +1219,7 @@
// Define values for backlash distance and correction.
// 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_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction
#define BACKLASH_CORRECTION 0.3 // 0.0 = no correction; 1.0 = full correction
// Add steps for motor direction changes on CORE kinematics
//#define CORE_BACKLASH
@@ -1182,11 +1229,11 @@
//#define BACKLASH_SMOOTHING_MM 3 // (mm)
// Add runtime configuration and tuning of backlash values (M425)
//#define BACKLASH_GCODE
#define BACKLASH_GCODE
#if ENABLED(BACKLASH_GCODE)
// 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)
// When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT
@@ -1469,7 +1516,7 @@
#define LED_USER_PRESET_BLUE 0 // User defined BLUE value
#define LED_USER_PRESET_WHITE 255 // User defined WHITE value
#define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity
//#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
#endif
#if ENABLED(NEO2_COLOR_PRESETS)
#define NEO2_USER_PRESET_RED 255 // User defined RED value
@@ -1484,7 +1531,7 @@
#endif // HAS_DISPLAY
// 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)
#define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done
#define SET_REMAINING_TIME // Add 'R' parameter to set remaining time
@@ -1499,7 +1546,7 @@
#if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
#define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar)
#define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E')
//#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R')
#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R')
#if ENABLED(SET_INTERACTION_TIME)
#define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change)
#endif
@@ -1556,7 +1603,7 @@
//#define MEDIA_MENU_AT_TOP // Force the media menu to be listed on the top of the main menu
#define EVENT_GCODE_SD_ABORT "G28XY" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27")
#define EVENT_GCODE_SD_ABORT "G91\nG1Z5\nG90\nM84\nM104S0\nM140S0" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27")
#if ENABLED(PRINTER_EVENT_LEDS)
#define PE_LEDS_COMPLETED_TIME (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination
@@ -1570,13 +1617,13 @@
* an option on the LCD screen to continue the print from the last-known
* point in the file.
*/
//#define POWER_LOSS_RECOVERY
#define POWER_LOSS_RECOVERY
#if ENABLED(POWER_LOSS_RECOVERY)
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
#define POWER_LOSS_PIN 32 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
//#define POWER_LOSS_PULLDOWN
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
@@ -1635,7 +1682,7 @@
// LCD's font must contain the characters. Check your selected LCD language.
//#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 M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands
@@ -1655,7 +1702,7 @@
//#define SD_REPRINT_LAST_SELECTED_FILE // On print completion open the LCD Menu and select the same file
//#define AUTO_REPORT_SD_STATUS // Auto-report media status with 'M27 S<seconds>'
#define AUTO_REPORT_SD_STATUS // Auto-report media status with 'M27 S<seconds>'
/**
* Support for USB thumb drives using an Arduino USB Host Shield or
@@ -1842,7 +1889,7 @@
//#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames
//#define STATUS_HEAT_PERCENT // Show heating in a progress bar
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash.
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of PROGMEM.
// Frivolous Game Options
//#define MARLIN_BRICKOUT
@@ -1860,7 +1907,10 @@
//
// Additional options for DGUS / DWIN displays
//
#define DGUS_RX_BUFFER_SIZE 128
#define DGUS_TX_BUFFER_SIZE 48
#if HAS_DGUS_LCD
#define LCD_SERIAL_PORT 3
#define LCD_BAUDRATE 115200
#define DGUS_RX_BUFFER_SIZE 128
@@ -2063,15 +2113,15 @@
*
* Warning: Does not respect endstops!
*/
//#define BABYSTEPPING
#define BABYSTEPPING
#if ENABLED(BABYSTEPPING)
//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
//#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_INVERT_Z false // Change 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_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep
#define BABYSTEP_MULTIPLICATOR_Z 40 // (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 DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
@@ -2084,11 +2134,13 @@
#endif
#endif
//#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#if DISABLED(BL_Touch)
#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28
#else
#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#endif
#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_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
#endif
#endif
@@ -2110,16 +2162,16 @@
*
* See https://marlinfw.org/docs/features/lin_advance.html for full instructions.
*/
//#define LIN_ADVANCE
#define LIN_ADVANCE
#if ENABLED(LIN_ADVANCE)
#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
#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
//#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 ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
//#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz.
#endif
@@ -2356,8 +2408,9 @@
*
* Override the default value based on the driver type set in Configuration.h.
*/
//#define MINIMUM_STEPPER_PULSE 2
#if ENABLED(MachineTLD6)
#define MINIMUM_STEPPER_PULSE 5
#endif
/**
* Maximum stepping rate (in Hz) the stepper driver allows
* If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE)
@@ -2406,7 +2459,7 @@
// For debug-echo: 128 bytes for the optimal speed.
// Other output doesn't need to be that speedy.
// :[0, 2, 4, 8, 16, 32, 64, 128, 256]
#define TX_BUFFER_SIZE 0
#define TX_BUFFER_SIZE 64
// Host Receive Buffer Size
// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough.
@@ -2444,7 +2497,7 @@
* Currently handles M108, M112, M410, M876
* NOTE: Not yet implemented for all platforms.
*/
//#define EMERGENCY_PARSER
#define EMERGENCY_PARSER
/**
* Realtime Reporting (requires EMERGENCY_PARSER)
@@ -2473,7 +2526,7 @@
//#define NO_TIMEOUTS 1000 // Milliseconds
// 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.
// This option inserts short delays between lines of serial output.
@@ -2544,9 +2597,9 @@
// Z raise distance for tool-change, as needed for some extruders
#define TOOLCHANGE_ZRAISE 2 // (mm)
//#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)
//#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
/**
@@ -2567,12 +2620,12 @@
* Retract and prime filament on tool-change to reduce
* ooze and stringing and to get cleaner transitions.
*/
//#define TOOLCHANGE_FILAMENT_SWAP
#define TOOLCHANGE_FILAMENT_SWAP
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
// Load / Unload
#define TOOLCHANGE_FS_LENGTH 12 // (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_RETRACT_SPEED (50*60) // (mm/min) (Unloading)
#define TOOLCHANGE_FS_LENGTH 6 // (mm) Load / Unload length
#define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 1 // (mm) Extra length for better restart. Adjust with LCD or M217 B.
#define TOOLCHANGE_FS_RETRACT_SPEED (25*60) // (mm/min) (Unloading)
#define TOOLCHANGE_FS_UNRETRACT_SPEED (25*60) // (mm/min) (On SINGLENOZZLE or Bowden loading must be slowed down)
// Longer prime to clean out a SINGLENOZZLE
@@ -2637,7 +2690,7 @@
*
* 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)
#define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract.
@@ -2651,9 +2704,9 @@
#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.
// 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_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 75 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
//#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted.
@@ -2672,16 +2725,16 @@
#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 FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
#define FILAMENT_CHANGE_ALERT_BEEPS 2 // 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 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 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 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 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_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)
#endif
// @section tmc_smart
@@ -3052,7 +3105,7 @@
* Define your own with:
* { <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_X2 CHOPPER_TIMING_X
//#define CHOPPER_TIMING_Y CHOPPER_TIMING // For Y Axes (override below)
@@ -3089,7 +3142,7 @@
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define MONITOR_DRIVER_STATUS
#define MONITOR_DRIVER_STATUS
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
@@ -3106,14 +3159,14 @@
* STEALTHCHOP_(XY|Z|E) must be enabled to use HYBRID_THRESHOLD.
* M913 X/Y/Z/E to live tune the setting
*/
//#define HYBRID_THRESHOLD
#define HYBRID_THRESHOLD
#define X_HYBRID_THRESHOLD 100 // [mm/s]
#define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100
#define X_HYBRID_THRESHOLD 70 // [mm/s]
#define X2_HYBRID_THRESHOLD 70
#define Y_HYBRID_THRESHOLD 50
#define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define Z_HYBRID_THRESHOLD 8
#define Z2_HYBRID_THRESHOLD 8
#define Z3_HYBRID_THRESHOLD 3
#define Z4_HYBRID_THRESHOLD 3
#define I_HYBRID_THRESHOLD 3 // [linear=mm/s, rotational=°/s]
@@ -3197,13 +3250,13 @@
* Beta feature!
* Create a 50/50 square wave step pulse optimal for stepper drivers.
*/
//#define SQUARE_WAVE_STEPPING
#define SQUARE_WAVE_STEPPING
/**
* Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continuous reporting.
*/
//#define TMC_DEBUG
#define TMC_DEBUG
/**
* You can set your own advanced settings by filling in predefined functions.
@@ -3736,9 +3789,14 @@
* Up to 25 may be defined, but the actual number is LCD-dependent.
*/
// @section custom main menu
// Custom Menu: Main Menu
#if ENABLED(BLTOUCH)
#define DualZComm "\nG34I8"
#else
#define DualZComm ""
#endif
#define MAIN_MENU_ITEM_1_GCODE "M190S55\nG28" DualZComm "\nG29\nM400\nM104S215\nG28\nM109S215\nM420S1\nG1X100Y100F5000\nG1Z0\nM500\nM117 Set Z Offset"
//#define CUSTOM_MENU_MAIN
#if ENABLED(CUSTOM_MENU_MAIN)
//#define CUSTOM_MENU_MAIN_TITLE "Custom Commands"
@@ -3849,12 +3907,12 @@
* 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.
*/
//#define HOST_ACTION_COMMANDS
#define HOST_ACTION_COMMANDS
#if ENABLED(HOST_ACTION_COMMANDS)
//#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)
//#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
//#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
+58 -10
View File
@@ -16,7 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
@@ -28,25 +28,73 @@
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "bugfix-2.1.x"
#define SHORT_BUILD_VERSION "2.1.2_Beta1"
/**
* Verbose version identifier which should contain a reference to the location
* from where the binary was downloaded or the source code was compiled.
*/
//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION
#if(ENABLED(DriverA4988))
#define VerChar1 "A"
#elif(ENABLED(Driver2209))
#define VerChar1 "T"
#endif
#if(ENABLED(BL_Touch))
#define VerChar2 "B"
#else
#define VerChar2 "E"
#endif
#if(ENABLED(LOWRES_DWIN))
#define VerChar3 "L"
#else
#define VerChar3 "H"
#endif
#if(ENABLED(ACBed))
#define VerChar4 "A"
#else
#define VerChar4 "D"
#endif
#if(ENABLED(OpticalY))
#define VerChar5 "O"
#else
#define VerChar5 "M"
#endif
#if(ENABLED(TitanExtruder))
#define VerChar6 "T"
#elif ANY(BMGExtruderV2, BMGExtruderV3)
#define VerChar6 "B"
#elif ENABLED(BondtechLGX)
#define VerChar6 "L"
#else
#define VerChar6 "S"
#endif
#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION "_" VerChar1 VerChar2 VerChar3 VerChar4 VerChar5 VerChar6
/**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2023-02-03"
#define STRING_DISTRIBUTION_DATE "2023-02-03"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
*/
//#define MACHINE_NAME "3D Printer"
#if(ENABLED(MachineTLD3P))
#define CUSTOM_MACHINE_NAME "TL D3P"
#elif(ENABLED(MachineTLD5))
#define CUSTOM_MACHINE_NAME "TL D5"
#elif(ENABLED(MachineTLD6))
#define CUSTOM_MACHINE_NAME "TL D6"
#endif
/**
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
@@ -54,7 +102,7 @@
* has a distinct Github fork— the Source Code URL should just be the main
* Marlin repository.
*/
//#define SOURCE_CODE_URL "github.com/MarlinFirmware/Marlin"
#define SOURCE_CODE_URL "https://github.com/InsanityAutomation/Marlin/tree/Tenlog_DWIN"
/**
* Default generic printer UUID.
@@ -65,12 +113,12 @@
* The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release.
*/
//#define WEBSITE_URL "marlinfw.org"
#define WEBSITE_URL "http://www.lnl3d.com "
/**
* Set the vendor info the serial USB interface, if changable
* Currently only supported by DUE platform
*/
//#define USB_DEVICE_VENDOR_ID 0x0000
//#define USB_DEVICE_PRODUCT_ID 0x0000
//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
//#define USB_DEVICE_VENDOR_ID 0x0000
//#define USB_DEVICE_PRODUCT_ID 0x0000
//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
+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
+1 -1
View File
@@ -139,7 +139,7 @@ typedef Servo hal_servo_t;
#error "LCD_SERIAL_PORT must be from 0 to 3."
#endif
#define LCD_SERIAL lcdSerial
#if HAS_DGUS_LCD
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
#endif
#endif
+1 -1
View File
@@ -629,7 +629,7 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
#if HAS_DGUS_LCD
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
template<typename Cfg>
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
+1 -1
View File
@@ -212,7 +212,7 @@
static ring_buffer_pos_t available();
static void write(const uint8_t c);
static void flushTX();
#if HAS_DGUS_LCD
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
static ring_buffer_pos_t get_tx_buffer_free();
#endif
+21 -19
View File
@@ -27,13 +27,14 @@
// intRes = longIn1 * longIn2 >> 24
// uses:
// A[tmp] to store 0
// B[tmp] to store bits 16-23 of the 48bit result. The top bit is used to round the two byte result.
// note that the lower two bytes and the upper byte of the 48bit result are not calculated.
// this can cause the result to be out by one as the lower bytes may cause carries into the upper ones.
// B A are bits 24-39 and are the returned value
// C B A is longIn1
// D C B A is longIn2
// r1, r0 for the result of mul.
// [tmp1] to store 0.
// [tmp2] to store bits 16-23 of the 56 bit result. The top bit of [tmp2] is used for rounding.
// Note that the lower two bytes and the upper two bytes of the 56 bit result are not calculated.
// This can cause the result to be out by one as the lower bytes may cause carries into the upper ones.
// [intRes] (A B) is bits 24-39 and is the returned value.
// [longIn1] (C B A) is a 24 bit parameter.
// [longIn2] (D C B A) is a 32 bit parameter.
//
FORCE_INLINE static uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2) {
uint8_t tmp1;
@@ -66,11 +67,9 @@ FORCE_INLINE static uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2
A("add %[tmp2], r1")
A("adc %A[intRes], %[tmp1]")
A("adc %B[intRes], %[tmp1]")
A("lsr %[tmp2]")
A("adc %A[intRes], %[tmp1]")
A("adc %B[intRes], %[tmp1]")
A("mul %D[longIn2], %A[longIn1]")
A("add %A[intRes], r0")
A("lsl %[tmp2]")
A("adc %A[intRes], r0")
A("adc %B[intRes], r1")
A("mul %D[longIn2], %B[longIn1]")
A("add %B[intRes], r0")
@@ -85,11 +84,16 @@ FORCE_INLINE static uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2
return intRes;
}
// intRes = intIn1 * intIn2 >> 16
// intRes = intIn1 * intIn2 >> 8
// uses:
// r26 to store 0
// r27 to store the byte 1 of the 24 bit result
FORCE_INLINE static uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) {
// r1, r0 for the result of mul. After the second mul, r0 holds bits 0-7 of the 24 bit result and
// the top bit of r0 is used for rounding.
// [tmp] to store 0.
// [intRes] (A B) is bits 8-15 and is the returned value.
// [charIn1] is an 8 bit parameter.
// [intIn2] (B A) is a 16 bit parameter.
//
FORCE_INLINE static uint16_t MultiU8X16toH16(uint8_t charIn1, uint16_t intIn2) {
uint8_t tmp;
uint16_t intRes;
__asm__ __volatile__ (
@@ -97,10 +101,8 @@ FORCE_INLINE static uint16_t MultiU16X8toH16(uint8_t charIn1, uint16_t intIn2) {
A("mul %[charIn1], %B[intIn2]")
A("movw %A[intRes], r0")
A("mul %[charIn1], %A[intIn2]")
A("add %A[intRes], r1")
A("adc %B[intRes], %[tmp]")
A("lsr r0")
A("adc %A[intRes], %[tmp]")
A("lsl r0")
A("adc %A[intRes], r1")
A("adc %B[intRes], %[tmp]")
A("clr r1")
: [intRes] "=&r" (intRes),
+1 -1
View File
@@ -112,7 +112,7 @@
#else
#error "LCD_SERIAL_PORT must be from 1 to 6, or -1 for Native USB."
#endif
#if HAS_DGUS_LCD
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif
#endif
+1 -1
View File
@@ -139,7 +139,7 @@
#define LCD_SERIAL MSERIAL(1) // dummy port
static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.")
#endif
#if HAS_DGUS_LCD
#if HAS_DGUS_LCD || ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif
#endif
+2 -2
View File
@@ -95,9 +95,9 @@ void safe_delay(millis_t ms) {
SERIAL_ECHOPGM(" (Aligned With");
if (probe.offset_xy.y > 0)
SERIAL_ECHOF(F(TERN(IS_SCARA, "-Distal", "-Back")));
SERIAL_ECHOPGM(TERN(IS_SCARA, "-Distal", "-Back"));
else if (probe.offset_xy.y < 0)
SERIAL_ECHOF(F(TERN(IS_SCARA, "-Proximal", "-Front")));
SERIAL_ECHOPGM(TERN(IS_SCARA, "-Proximal", "-Front"));
else if (probe.offset_xy.x != 0)
SERIAL_ECHOPGM("-Center");
+1 -1
View File
@@ -198,7 +198,7 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
#endif
#if HAS_FILAMENT_SENSOR
if (runout.filament_ran_out) { // Disable a triggered sensor
runout.enabled = false;
runout.enabled[active_extruder] = false;
runout.reset();
}
#endif
+1 -1
View File
@@ -141,7 +141,7 @@ uint8_t MMU2::get_current_tool() {
}
#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())
#endif
void mmu2_attn_buzz(const bool two=false) {
+16 -7
View File
@@ -212,12 +212,21 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
impatient_beep(max_beep_count);
#if BOTH(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_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;
switch (active_extruder) {
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED)
LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) {
pin_t pin;
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
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
idle_no_sleep();
@@ -284,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
KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = false;
#if EITHER(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, EXTENSIBLE_UI)
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
#else
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
@@ -670,7 +679,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
#endif
// If resume_position is negative
if (resume_position.e < 0) unscaled_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
//if (resume_position.e < 0) unscaled_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
#ifdef ADVANCED_PAUSE_RESUME_PRIME
if (ADVANCED_PAUSE_RESUME_PRIME != 0)
unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
@@ -679,7 +688,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
// Now all extrusion positions are resumed and ready to be confirmed
// Set extruder to saved position
planner.set_e_position_mm((destination.e = current_position.e = resume_position.e));
sync_plan_position_e();
ui.pause_show_message(PAUSE_MESSAGE_STATUS);
#ifdef ACTION_ON_RESUMED
+6 -12
View File
@@ -32,9 +32,9 @@
FilamentMonitor runout;
bool FilamentMonitorBase::enabled = true,
FilamentMonitorBase::filament_ran_out; // = false
bool FilamentMonitorBase::enabled[NUM_RUNOUT_SENSORS], // Initialized by settings.load
FilamentMonitorBase::filament_ran_out; // = false
RunoutMode FilamentMonitorBase::mode[NUM_RUNOUT_SENSORS]; // Initialized by settings.load
#if ENABLED(HOST_ACTION_COMMANDS)
bool FilamentMonitorBase::host_handling; // = false
#endif
@@ -45,15 +45,9 @@ bool FilamentMonitorBase::enabled = true,
#include "../core/debug_out.h"
#endif
#if HAS_FILAMENT_RUNOUT_DISTANCE
float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM;
volatile float RunoutResponseDelayed::runout_mm_countdown[NUM_RUNOUT_SENSORS];
#if ENABLED(FILAMENT_MOTION_SENSOR)
uint8_t FilamentSensorEncoder::motion_detected;
#endif
#else
int8_t RunoutResponseDebounced::runout_count[NUM_RUNOUT_SENSORS]; // = 0
#endif
float RunoutResponseDelayed::runout_distance_mm[NUM_RUNOUT_SENSORS]; // Initialized by settings.load
volatile float RunoutResponseDelayed::runout_mm_countdown[NUM_RUNOUT_SENSORS];
uint8_t FilamentSensorCore::motion_detected;
//
// Filament Runout event handler
+119 -187
View File
@@ -47,25 +47,37 @@ void event_filament_runout(const uint8_t extruder);
template<class RESPONSE_T, class SENSOR_T>
class TFilamentMonitor;
class FilamentSensorEncoder;
class FilamentSensorSwitch;
class FilamentSensorCore;
class RunoutResponseDelayed;
class RunoutResponseDebounced;
/********************************* TEMPLATE SPECIALIZATION *********************************/
typedef TFilamentMonitor<
TERN(HAS_FILAMENT_RUNOUT_DISTANCE, RunoutResponseDelayed, RunoutResponseDebounced),
TERN(FILAMENT_MOTION_SENSOR, FilamentSensorEncoder, FilamentSensorSwitch)
RunoutResponseDelayed,
FilamentSensorCore
> FilamentMonitor;
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 {
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)
static bool host_handling;
@@ -95,19 +107,14 @@ class TFilamentMonitor : public FilamentMonitorBase {
// Call this method when filament is present,
// so the response can reset its counter.
static void filament_present(const uint8_t extruder) {
response.filament_present(extruder);
}
#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
static void filament_present(const uint8_t e) { response.filament_present(e); }
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; }
// Handle a block completion. RunoutResponseDelayed uses this to
// add up the length of filament moved while the filament is out.
static void block_completed(const block_t * const b) {
if (enabled) {
if (enabled[active_extruder]) {
response.block_completed(b);
sensor.block_completed(b);
}
@@ -115,12 +122,12 @@ class TFilamentMonitor : public FilamentMonitorBase {
// Give the response a chance to update its counter.
static void run() {
if (enabled && !filament_ran_out && (printingIsActive() || did_pause_print)) {
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here
if (enabled[active_extruder] && mode[active_extruder] != RM_NONE && !filament_ran_out && (printingIsActive() || did_pause_print)) {
cli(); // Prevent RunoutResponseDelayed::block_completed from accumulating here
response.run();
sensor.run();
const uint8_t runout_flags = response.has_run_out();
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, sei());
sei();
#if MULTI_FILAMENT_SENSOR
#if ENABLED(WATCH_ALL_RUNOUT_SENSORS)
const bool ran_out = !!runout_flags; // any sensor triggers
@@ -203,6 +210,7 @@ class FilamentSensorBase {
#undef _INIT_RUNOUT_PIN
#undef INIT_RUNOUT_PIN
}
// Return a bitmask of runout pin states
static uint8_t poll_runout_pins() {
@@ -213,103 +221,64 @@ class FilamentSensorBase {
// Return a bitmask of runout flag states (1 bits always indicates runout)
static uint8_t poll_runout_states() {
return poll_runout_pins() ^ uint8_t(0
#if NUM_RUNOUT_SENSORS >= 1
| (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 2
| (FIL_RUNOUT2_STATE ? 0 : _BV(2 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 3
| (FIL_RUNOUT3_STATE ? 0 : _BV(3 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 4
| (FIL_RUNOUT4_STATE ? 0 : _BV(4 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 5
| (FIL_RUNOUT5_STATE ? 0 : _BV(5 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 6
| (FIL_RUNOUT6_STATE ? 0 : _BV(6 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 7
| (FIL_RUNOUT7_STATE ? 0 : _BV(7 - 1))
#endif
#if NUM_RUNOUT_SENSORS >= 8
| (FIL_RUNOUT8_STATE ? 0 : _BV(8 - 1))
#endif
);
#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, _OR_INVERT));
#undef _OR_INVERT
}
};
#if ENABLED(FILAMENT_MOTION_SENSOR)
class FilamentSensorCore : public FilamentSensorBase {
private:
static uint8_t motion_detected;
/**
* This sensor uses a magnetic encoder disc and a Hall effect
* sensor (or a slotted disc and optical sensor). The state
* will toggle between 0 and 1 on filament movement. It can detect
* filament runout and stripouts or jams.
*/
class FilamentSensorEncoder : public FilamentSensorBase {
private:
static uint8_t motion_detected;
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
}
static void poll_motion_sensor() {
static uint8_t old_state;
const uint8_t new_state = poll_runout_pins(),
change = old_state ^ new_state;
old_state = new_state;
static void poll_motion_sensor() {
static uint8_t old_state;
const uint8_t new_state = poll_runout_pins(),
change = old_state ^ new_state;
old_state = new_state;
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
if (change) {
SERIAL_ECHOPGM("Motion detected:");
LOOP_L_N(e, NUM_RUNOUT_SENSORS)
if (TEST(change, e)) SERIAL_CHAR(' ', '0' + e);
SERIAL_EOL();
}
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
if (change) {
SERIAL_ECHOPGM("Motion detected:");
LOOP_L_N(e, NUM_RUNOUT_SENSORS)
if (TEST(change, e)) SERIAL_CHAR(' ', '0' + e);
SERIAL_EOL();
}
#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();
}
public:
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))
filament_present(b->extruder);
// Clear motion triggers for next block
motion_detected = 0;
}
static void run() { poll_motion_sensor(); }
};
#else
/**
* 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() {
else if (runout.mode[active_extruder] != RM_NONE) {
LOOP_L_N(s, NUM_RUNOUT_SENSORS) {
const bool out = poll_runout_state(s);
if (!out) filament_present(s);
@@ -322,92 +291,55 @@ class FilamentSensorBase {
#endif
}
}
};
}
};
#endif // !FILAMENT_MOTION_SENSOR
/********************************* 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];
// RunoutResponseDelayed triggers a runout event only if the length
// of filament specified by FILAMENT_RUNOUT_DISTANCE_MM has been fed
// during a runout condition.
class RunoutResponseDelayed {
private:
static volatile float runout_mm_countdown[NUM_RUNOUT_SENSORS];
public:
static float runout_distance_mm[NUM_RUNOUT_SENSORS];
public:
static float runout_distance_mm;
static void reset() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
}
static void reset() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
}
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;
LOOP_L_N(i, NUM_RUNOUT_SENSORS)
SERIAL_ECHOF(i ? F(", ") : F("Remaining mm: "), runout_mm_countdown[i]);
SERIAL_EOL();
}
#endif
}
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i);
return runout_flags;
}
static void filament_present(const uint8_t extruder) {
runout_mm_countdown[extruder] = runout_distance_mm;
}
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 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)];
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;
LOOP_L_N(i, NUM_RUNOUT_SENSORS)
SERIAL_ECHOF(i ? F(", ") : F("Remaining mm: "), runout_mm_countdown[i]);
SERIAL_EOL();
}
#endif
}
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i);
return runout_flags;
}
static void filament_present(const uint8_t extruder) {
runout_mm_countdown[extruder] = runout_distance_mm[extruder];
}
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 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)];
}
};
#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() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
}
static void run() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] >= 0) runout_count[i]--;
}
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] < 0) SBI(runout_flags, 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
}
};
+2
View File
@@ -949,6 +949,8 @@ G29_TYPE GcodeSuite::G29() {
process_subcommands_now(F(Z_PROBE_END_SCRIPT));
#endif
TERN_(HAS_DWIN_E3V2_BASIC, DWIN_LevelingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
TERN_(HAS_MULTI_HOTEND, if (abl.tool_index != 0) tool_change(abl.tool_index));
report_current_position();
+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.
#if MULTI_FILAMENT_SENSOR
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
DXC_ext = active_extruder;
#endif
@@ -28,36 +28,46 @@
#include "../../../feature/runout.h"
/**
* M412: Enable / Disable filament runout detection
* 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
* D<linear> : Extra distance to continue after runout is triggered
* 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::M412() {
if (parser.seen("RS"
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, "D")
TERN_(HOST_ACTION_COMMANDS, "H")
)) {
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();
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
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 {
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Filament runout ");
serialprint_onoff(runout.enabled);
#if HAS_FILAMENT_RUNOUT_DISTANCE
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(), "mm");
#endif
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);
@@ -66,16 +76,18 @@ void GcodeSuite::M412() {
}
}
void GcodeSuite::M412_report(const bool forReplay/*=true*/) {
void GcodeSuite::M591_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);
LOOP_S_L_N(e, 0, 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
+5 -4
View File
@@ -859,10 +859,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 407: M407(); break; // M407: Display measured filament diameter
#endif
#if HAS_FILAMENT_SENSOR
case 412: M412(); break; // M412: Enable/Disable filament runout detection
#endif
#if HAS_MULTI_LANGUAGE
case 414: M414(); break; // M414: Select multi language menu
#endif
@@ -933,6 +929,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 575: M575(); break; // M575: Set serial baudrate
#endif
#if HAS_FILAMENT_SENSOR
case 412: M412(); break; // Alias to M591
case 591: M591(); break; // M591 Configure filament runout detection
#endif
#if HAS_SHAPING
case 593: M593(); break; // M593: Set Input Shaping parameters
#endif
+4 -3
View File
@@ -234,7 +234,6 @@
* M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
* M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
* 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)
* 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)
@@ -259,6 +258,7 @@
* M554 - Get or set IP gateway. (Requires enabled Ethernet port)
* M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160)
* M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE)
* M591 - Configure Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
* M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY])
* 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)
@@ -1003,8 +1003,9 @@ private:
#endif
#if HAS_FILAMENT_SENSOR
static void M412();
static void M412_report(const bool forReplay=true);
static void M412() { M591(); }
static void M591();
static void M591_report(const bool forReplay=true);
#endif
#if HAS_MULTI_LANGUAGE
+1 -1
View File
@@ -132,7 +132,7 @@ void GcodeSuite::M115() {
// AUTOLEVEL (G29)
cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
// RUNOUT (M412, M600)
// RUNOUT (M591, M600)
cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
// Z_PROBE (G30)
+2
View File
@@ -356,6 +356,8 @@ void plan_arc(
planner.apply_leveling(raw);
#endif
hints.curve_radius = i > 1 ? radius : 0;
// calculate safe speed for stopping by the end of the arc
arc_mm_remaining -= segment_mm;
hints.safe_exit_speed_sqr = _MIN(limiting_speed_sqr, 2 * limiting_accel * arc_mm_remaining);
+34 -25
View File
@@ -485,7 +485,7 @@
#endif
// Extensible UI serial touch screens. (See src/lcd/extui)
#if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT)
#if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, DGUS_LCD_UI_CREALITY_TOUCH)
#define IS_EXTUI 1
#define EXTENSIBLE_UI
#endif
@@ -1102,10 +1102,14 @@
* Fill in undefined Filament Sensor options
*/
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define HAS_FILAMENT_SENSOR 1
#ifndef NUM_RUNOUT_SENSORS
#define NUM_RUNOUT_SENSORS E_STEPPERS
#endif
#if ENABLED(MIXING_EXTRUDER)
#define WATCH_ALL_RUNOUT_SENSORS
#endif
#if NUM_RUNOUT_SENSORS >= 1
#ifndef FIL_RUNOUT1_STATE
#define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT1_PULLUP
#define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP
#endif
@@ -1114,9 +1118,7 @@
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 2
#ifndef FIL_RUNOUT2_STATE
#define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE
#endif
#define MULTI_FILAMENT_SENSOR 1
#ifndef FIL_RUNOUT2_PULLUP
#define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP
#endif
@@ -1125,9 +1127,6 @@
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 3
#ifndef FIL_RUNOUT3_STATE
#define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT3_PULLUP
#define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP
#endif
@@ -1136,9 +1135,6 @@
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 4
#ifndef FIL_RUNOUT4_STATE
#define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT4_PULLUP
#define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP
#endif
@@ -1147,9 +1143,6 @@
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 5
#ifndef FIL_RUNOUT5_STATE
#define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT5_PULLUP
#define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP
#endif
@@ -1158,9 +1151,6 @@
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 6
#ifndef FIL_RUNOUT6_STATE
#define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT6_PULLUP
#define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP
#endif
@@ -1169,9 +1159,6 @@
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 7
#ifndef FIL_RUNOUT7_STATE
#define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT7_PULLUP
#define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP
#endif
@@ -1180,9 +1167,6 @@
#endif
#endif
#if NUM_RUNOUT_SENSORS >= 8
#ifndef FIL_RUNOUT8_STATE
#define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE
#endif
#ifndef FIL_RUNOUT8_PULLUP
#define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP
#endif
@@ -1670,3 +1654,28 @@
#if defined(NEOPIXEL_BKGD_INDEX_FIRST) && !defined(NEOPIXEL_BKGD_INDEX_LAST)
#define NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_INDEX_FIRST
#endif
/*** TEMPORARY COMPATIBILITY ***/
#if HAS_FILAMENT_SENSOR
#ifndef FIL_RUNOUT_ENABLED
#if FIL_RUNOUT_ENABLED_DEFAULT
#define FIL_RUNOUT_ENABLED ARRAY_N_1(NUM_RUNOUT_SENSORS, true)
#else
#define FIL_RUNOUT_ENABLED ARRAY_N_1(NUM_RUNOUT_SENSORS, false)
#endif
#endif
#ifndef FIL_RUNOUT_MODE
#if FIL_RUNOUT_STATE
#define FIL_RUNOUT_MODE ARRAY_N_1(NUM_RUNOUT_SENSORS, 1)
#else
#define FIL_RUNOUT_MODE ARRAY_N_1(NUM_RUNOUT_SENSORS, 2)
#endif
#endif
#ifndef FIL_RUNOUT_DISTANCE_MM
#define FIL_RUNOUT_DISTANCE_MM ARRAY_N_1(NUM_RUNOUT_SENSORS, 10)
#endif
#undef FIL_RUNOUT_ENABLED_DEFAULT
#undef FIL_RUNOUT_STATE
#undef FILAMENT_RUNOUT_DISTANCE_MM
#endif
+5
View File
@@ -124,8 +124,13 @@
#undef AUTOTEMP
#undef PID_EXTRUSION_SCALING
#undef LIN_ADVANCE
#undef FILAMENT_RUNOUT_SENSOR
#undef FIL_RUNOUT_ENABLED
#undef FIL_RUNOUT_MODE
#undef FIL_RUNOUT_DISTANCE_MM
#undef ADVANCED_PAUSE_FEATURE
#undef FILAMENT_LOAD_UNLOAD_GCODES
#undef DISABLE_INACTIVE_EXTRUDER
#undef EXTRUDER_RUNOUT_PREVENT
#undef THERMAL_PROTECTION_PERIOD
#undef WATCH_TEMP_PERIOD
+23 -1
View File
@@ -2256,6 +2256,28 @@
#endif
#if _HAS_STOP(X,MAX)
#define HAS_X_MAX 1
#else
#if !PIN_EXISTS(X_MAX)
#error "X_MAX Pin Doesnt Exist."
#endif
#if IS_PROBE_PIN(X,MAX)
#error "X_MAX Pin Used for Probe."
#endif
#if IS_X2_ENDSTOP(X,MAX)
#error "X_MAX Pin Used for X2 ES."
#endif
#if IS_Y2_ENDSTOP(X,MAX)
#error "X_MAX Pin Used for Y2 ES."
#endif
#if IS_Z2_ENDSTOP(X,MAX)
#error "X_MAX Pin Used for Z2 ES."
#endif
#if IS_Z3_ENDSTOP(X,MAX)
#error "X_MAX Pin Used for Z3 ES."
#endif
#if IS_Z4_ENDSTOP(X,MAX)
#error "X_MAX Pin Used for Z4 ES."
#endif
#endif
#if _HAS_STOP(Y,MIN)
#define HAS_Y_MIN 1
@@ -2943,7 +2965,7 @@
#define HAS_TEMPERATURE 1
#endif
#if HAS_TEMPERATURE && ANY(HAS_MARLINUI_MENU, HAS_DWIN_E3V2, HAS_DGUS_LCD_CLASSIC)
#if HAS_TEMPERATURE && ANY(HAS_MARLINUI_MENU, HAS_DWIN_E3V2, HAS_DGUS_LCD_CLASSIC, DGUS_LCD_UI_CREALITY_TOUCH)
#ifdef PREHEAT_10_LABEL
#define PREHEAT_COUNT 10
#elif defined(PREHEAT_9_LABEL)
+66 -7
View File
@@ -572,9 +572,9 @@
#error "SHORT_MANUAL_Z_MOVE is now FINE_MANUAL_MOVE, applying to Z on most printers."
#elif defined(FIL_RUNOUT_INVERTING)
#if FIL_RUNOUT_INVERTING
#error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_STATE HIGH."
#error "FIL_RUNOUT_INVERTING true is now FIL_RUNOUT_MODE {HIGH}."
#else
#error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_STATE LOW."
#error "FIL_RUNOUT_INVERTING false is now FIL_RUNOUT_MODE {LOW}."
#endif
#elif defined(ASSISTED_TRAMMING_MENU_ITEM)
#error "ASSISTED_TRAMMING_MENU_ITEM is deprecated and should be removed."
@@ -1102,10 +1102,71 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "You can't enable FIL_RUNOUT7_PULLUP and FIL_RUNOUT7_PULLDOWN at the same time."
#elif BOTH(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
#error "You can't enable FIL_RUNOUT8_PULLUP and FIL_RUNOUT8_PULLDOWN at the same time."
#elif FILAMENT_RUNOUT_DISTANCE_MM < 0
#error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero."
#elif DISABLED(ADVANCED_PAUSE_FEATURE)
static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR.");
#elif defined(FIL_RUNOUT_ENABLED_DEFAULT)
#error "FIL_RUNOUT_ENABLED_DEFAULT is now set with the FILAMENT_RUNOUT_ENABLED array."
#elif defined(FILAMENT_RUNOUT_DISTANCE_MM)
#error "FILAMENT_RUNOUT_DISTANCE_MM is now set with the FIL_RUNOUT_DISTANCE_MM array."
#elif defined(FIL_RUNOUT_STATE) || defined(FIL_RUNOUT2_STATE) || defined(FIL_RUNOUT3_STATE) || defined(FIL_RUNOUT4_STATE) || defined(FIL_RUNOUT5_STATE) || defined(FIL_RUNOUT6_STATE) || defined(FIL_RUNOUT7_STATE) || defined(FIL_RUNOUT8_STATE)
#ifdef FIL_RUNOUT_STATE
#if FIL_RUNOUT_STATE
#error "FIL_RUNOUT_STATE HIGH is now set with FIL_RUNOUT_MODE { 2 ... }."
#else
#error "FIL_RUNOUT_STATE LOW is now set with FIL_RUNOUT_MODE { 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT2_STATE
#if FIL_RUNOUT2_STATE
#error "FIL_RUNOUT2_STATE HIGH is now set with FIL_RUNOUT_MODE { n, 2 ... }."
#else
#error "FIL_RUNOUT2_STATE LOW is now set with FIL_RUNOUT_MODE { n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT3_STATE
#if FIL_RUNOUT3_STATE
#error "FIL_RUNOUT3_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, 2 ... }."
#else
#error "FIL_RUNOUT3_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT4_STATE
#if FIL_RUNOUT4_STATE
#error "FIL_RUNOUT4_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT4_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT5_STATE
#if FIL_RUNOUT5_STATE
#error "FIL_RUNOUT5_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT5_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT6_STATE
#if FIL_RUNOUT6_STATE
#error "FIL_RUNOUT6_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT6_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT7_STATE
#if FIL_RUNOUT7_STATE
#error "FIL_RUNOUT7_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT7_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, n, n, n, 1 ... }."
#endif
#endif
#ifdef FIL_RUNOUT8_STATE
#if FIL_RUNOUT8_STATE
#error "FIL_RUNOUT8_STATE HIGH is now set with FIL_RUNOUT_MODE { n, n, n, n, n, n, n, 2 ... }."
#else
#error "FIL_RUNOUT8_STATE LOW is now set with FIL_RUNOUT_MODE { n, n, n, n, n, n, n, 1 ... }."
#endif
#endif
#elif ENABLED(FILAMENT_MOTION_SENSOR)
#error "FILAMENT_MOTION_SENSOR is now set with FIL_RUNOUT_MODE { 7 ... }."
#endif
#endif
@@ -1345,8 +1406,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE."
#elif ENABLED(DISABLE_INACTIVE_EXTRUDER)
#error "MIXING_EXTRUDER is incompatible with DISABLE_INACTIVE_EXTRUDER."
#elif HAS_FILAMENT_RUNOUT_DISTANCE
#error "MIXING_EXTRUDER is incompatible with FILAMENT_RUNOUT_DISTANCE_MM."
#endif
#endif
@@ -3049,7 +3108,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
+ COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
+ DGUS_UI_IS(ORIGIN) + DGUS_UI_IS(FYSETC) + DGUS_UI_IS(HIPRECY) + DGUS_UI_IS(MKS) + DGUS_UI_IS(RELOADED) + DGUS_UI_IS(IA_CREALITY) \
+ COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \
+ COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \
+ COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE, DGUS_LCD_UI_CREALITY_TOUCH) \
+ COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_GENERIC_12864_1_1) \
+ COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
+ COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
+4 -2
View File
@@ -133,8 +133,10 @@ EncoderState Encoder_ReceiveAnalyze() {
// Note that the rate is always calculated between two passes through the
// loop and that the abs of the temp_diff value is tracked.
const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
#if defined(ENCODER_100X_STEPS_PER_SEC)
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
#endif
if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
#if ENCODER_5X_STEPS_PER_SEC
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#endif
+7 -3
View File
@@ -2944,7 +2944,11 @@ void HMI_Control() {
void HMI_Leveling() {
Popup_Window_Leveling();
DWIN_UpdateLCD();
queue.inject(F("G28O\nG29"));
#if defined(MAIN_MENU_ITEM_1_GCODE)
queue.inject(F(MAIN_MENU_ITEM_1_GCODE));
#else
queue.inject(F("G28O\nG29\nG28\nG1Z0"));
#endif
}
#endif
@@ -4055,8 +4059,8 @@ void HMI_Init() {
HMI_SDCardInit();
for (uint16_t t = 0; t <= 100; t += 2) {
DWIN_ICON_Show(ICON, ICON_Bar, 15, 260);
DWIN_Draw_Rectangle(1, Color_Bg_Black, 15 + t * 242 / 100, 260, 257, 280);
DWIN_ICON_Show(ICON, ICON_Bar, 15, 450);
DWIN_Draw_Rectangle(1, Color_Bg_Black, 15 + t * 242 / 100, 450, 257, 470);
DWIN_UpdateLCD();
delay(20);
}
@@ -48,6 +48,7 @@ void DWIN_Startup() {
DWIN_Frame_Clear(Color_Bg_Black); // MarlinUI handles the bootscreen so just clear here
DWIN_JPG_ShowAndCache(3);
DWIN_UpdateLCD();
DWIN_JPG_ShowAndCache(3);
}
/*---------------------------------------- Picture related functions ----------------------------------------*/
+2 -2
View File
@@ -109,8 +109,8 @@ void MarlinUI::clear_lcd() {
#define INFO_CENTER ((LCD_PIXEL_WIDTH) - 200 / 2)
#define VERSION_Y 84
#endif
DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length * 10) / 2, VERSION_Y, S(dwin_string.string()));
DWIN_JPG_ShowAndCache(0); // Ensure DACAI stays on boot screen
DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length * 10) / 2, 230, S(dwin_string.string()));
TERN_(SHOW_CUSTOM_BOOTSCREEN, safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT));
clear_lcd();
+5 -5
View File
@@ -2225,12 +2225,12 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS
#if HAS_FILAMENT_SENSOR
void SetRunoutEnable() {
runout.reset();
Toggle_Chkb_Line(runout.enabled);
runout.enabled[0] = !runout.enabled[0];
Draw_Chkb_Line(CurrentMenu->line(), runout.enabled[0]);
DWIN_UpdateLCD();
}
#if HAS_FILAMENT_RUNOUT_DISTANCE
void ApplyRunoutDistance() { runout.set_runout_distance(MenuData.Value / MINUNITMULT); }
void SetRunoutDistance() { SetFloatOnClick(0, 999, UNITFDIGITS, runout.runout_distance(), ApplyRunoutDistance); }
#endif
void ApplyRunoutDistance() { runout.set_runout_distance(MenuData.Value / MINUNITMULT); }
void SetRunoutDistance() { SetFloatOnClick(0, 999, UNITFDIGITS, runout.runout_distance(), ApplyRunoutDistance); }
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
+1 -1
View File
@@ -100,7 +100,7 @@ void ESDiagClass::Update() {
ES_REPORT(Z_MIN);
#endif
#if HAS_FILAMENT_SENSOR
draw_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE);
draw_es_state(READ(FIL_RUNOUT1_PIN) != runout.out_state());
#endif
DWIN_UpdateLCD();
}
@@ -90,7 +90,7 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) {
void DGUSScreenHandlerMKS::DGUSLCD_SendBabyStepToDisplay(DGUS_VP_Variable &var) {
float value = current_position.z;
DEBUG_ECHOLNPAIR_F(" >> ", value, 6);
DEBUG_ECHOLNPGM(" >> ", value, 6);
value *= cpow(10, 2);
dgusdisplay.WriteVariable(VP_SD_Print_Baby, (uint16_t)value);
}
@@ -300,6 +300,7 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
// Special handling for popup is to return to previous menu
if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb();
setPauseMenuResponse(PAUSE_RESPONSE_RESUME_PRINT);
PopToOldScreen();
return;
}
@@ -0,0 +1,357 @@
/**
* 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/>.
*
*/
/* DGUS implementation written by coldtobi in 2019 for Marlin */
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#define DEBUG_ECHOLNPAIR DEBUG_ECHOLNPGM
#if HOTENDS > 2
#error "More than 2 hotends not implemented on the Display UI design."
#endif
#include "../ui_api.h"
#include "../../../MarlinCore.h"
#include "../../../module/temperature.h"
#include "../../../module/motion.h"
#include "../../../gcode/queue.h"
#include "../../../module/planner.h"
#include "../../../sd/cardreader.h"
#include "../../../libs/duration_t.h"
#include "../../../module/printcounter.h"
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../../feature/powerloss.h"
#endif
#include "DGUSDisplay.h"
#include "DGUSVPVariable.h"
#include "DGUSDisplayDef.h"
// Preamble... 2 Bytes, usually 0x5A 0xA5, but configurable
constexpr uint8_t DGUS_HEADER1 = 0x5A;
constexpr uint8_t DGUS_HEADER2 = 0xA5;
constexpr uint8_t DGUS_CMD_WRITEVAR = 0x82;
constexpr uint8_t DGUS_CMD_READVAR = 0x83;
#if ENABLED(DEBUG_DGUSLCD)
bool dguslcd_local_debug; // = false;
#endif
#define dgusserial LCD_SERIAL
void DGUSDisplay::InitDisplay() {
dgusserial.begin(LCD_BAUDRATE);
/*delay(500); // Attempt to fix possible handshake error
ResetDisplay(); // Reset for firmware update
delay(500); // Attempt to fix possible handshake error
*/
if (true
#if ENABLED(POWER_LOSS_RECOVERY)
&& !recovery.valid()
#endif
)
RequestScreen(
#if ENABLED(SHOW_BOOTSCREEN)
DGUSLCD_SCREEN_BOOT
#else
DGUSLCD_SCREEN_MAIN
#endif
);
}
void DGUSDisplay::ResetDisplay() {
SERIAL_ECHOLN("ResetDisplay");
const unsigned char resetCommand[] = { 0x55, 0xAA, 0x5A, 0xA5 };
WriteVariable(0x04, resetCommand, sizeof(resetCommand));
}
void DGUSDisplay::ReadVariable(uint16_t adr) {
WriteHeader(adr, DGUS_CMD_READVAR, sizeof(uint8_t));
// Specify to read one byte
dgusserial.write(static_cast<uint8_t>(1));
}
void DGUSDisplay::WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr, char fillChar) {
const char* myvalues = static_cast<const char*>(values);
bool strend = !myvalues;
WriteHeader(adr, DGUS_CMD_WRITEVAR, valueslen);
while (valueslen--) {
char x;
if (!strend) x = *myvalues++;
if ((isstr && !x) || strend) {
strend = true;
x = fillChar;
}
dgusserial.write(x);
}
}
void DGUSDisplay::WriteVariable(uint16_t adr, uint16_t value) {
value = (value & 0xffU) << 8U | (value >> 8U);
WriteVariable(adr, static_cast<const void*>(&value), sizeof(uint16_t));
}
void DGUSDisplay::WriteVariable(uint16_t adr, int16_t value) {
union { int16_t l; char lb[2]; } endian;
char tmp[2];
endian.l = value;
tmp[0] = endian.lb[1];
tmp[1] = endian.lb[0];
WriteVariable(adr, static_cast<const void*>(&tmp), sizeof(int16_t));
}
void DGUSDisplay::WriteVariable(uint16_t adr, uint8_t value) {
WriteVariable(adr, static_cast<const void*>(&value), sizeof(uint8_t));
}
void DGUSDisplay::WriteVariable(uint16_t adr, int8_t value) {
WriteVariable(adr, static_cast<const void*>(&value), sizeof(int8_t));
}
void DGUSDisplay::WriteVariable(uint16_t adr, long value) {
union { long l; char lb[4]; } endian;
char tmp[4];
endian.l = value;
tmp[0] = endian.lb[3];
tmp[1] = endian.lb[2];
tmp[2] = endian.lb[1];
tmp[3] = endian.lb[0];
WriteVariable(adr, static_cast<const void*>(&tmp), sizeof(long));
}
void DGUSDisplay::WriteVariable(uint16_t adr, float value) {
static_assert(sizeof(float) == 4);
union { float l; char lb[4]; } endian;
char tmp[4];
endian.l = value;
tmp[0] = endian.lb[3];
tmp[1] = endian.lb[2];
tmp[2] = endian.lb[1];
tmp[3] = endian.lb[0];
WriteVariable(adr, static_cast<const void*>(&tmp), sizeof(float));
}
void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr, char fillChar) {
const char* myvalues = static_cast<const char*>(values);
bool strend = !myvalues;
WriteHeader(adr, DGUS_CMD_WRITEVAR, valueslen);
while (valueslen--) {
char x;
if (!strend) x = pgm_read_byte(myvalues++);
if ((isstr && !x) || strend) {
strend = true;
x = fillChar;
}
dgusserial.write(x);
}
}
void DGUSDisplay::SetVariableDisplayColor(uint16_t sp, uint16_t color) {
WriteVariable(sp + 0x03, color);
}
void DGUSDisplay::ProcessRx() {
#if ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS)
if (!dgusserial.available() && dgusserial.buffer_overruns()) {
// Overrun, but reset the flag only when the buffer is empty
// We want to extract as many as valid datagrams possible...
DEBUG_ECHOPGM("OVFL");
rx_datagram_state = DGUS_IDLE;
//dgusserial.reset_rx_overun();
dgusserial.flush();
}
#endif
uint8_t receivedbyte;
while (dgusserial.available()) {
switch (rx_datagram_state) {
case DGUS_IDLE: // Waiting for the first header byte
receivedbyte = dgusserial.read();
//DEBUGLCDCOMM_ECHOPAIR("< ",receivedbyte);
if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN;
break;
case DGUS_HEADER1_SEEN: // Waiting for the second header byte
receivedbyte = dgusserial.read();
//DEBUGLCDCOMM_ECHOPAIR(" ", receivedbyte);
rx_datagram_state = (DGUS_HEADER2 == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE;
break;
case DGUS_HEADER2_SEEN: // Waiting for the length byte
rx_datagram_len = dgusserial.read();
//DEBUGLCDCOMM_ECHOPAIR(" (", rx_datagram_len, ") ");
// Telegram min len is 3 (command and one word of payload)
rx_datagram_state = WITHIN(rx_datagram_len, 3, DGUS_RX_BUFFER_SIZE) ? DGUS_WAIT_TELEGRAM : DGUS_IDLE;
break;
case DGUS_WAIT_TELEGRAM: // wait for complete datagram to arrive.
if (dgusserial.available() < rx_datagram_len) return;
Initialized = true; // We've talked to it, so we defined it as initialized.
uint8_t command = dgusserial.read();
// DEBUGLCDCOMM_ECHOPAIR("# ", command);
uint8_t readlen = rx_datagram_len - 1; // command is part of len.
unsigned char tmp[rx_datagram_len - 1];
unsigned char *ptmp = tmp;
while (readlen--) {
receivedbyte = dgusserial.read();
//DEBUGLCDCOMM_ECHOPAIR(" ", receivedbyte);
*ptmp++ = receivedbyte;
}
//DEBUGLCDCOMM_ECHOPGM(" # ");
// mostly we'll get this: 5A A5 03 82 4F 4B -- ACK on 0x82, so discard it.
if (command == DGUS_CMD_WRITEVAR && 'O' == tmp[0] && 'K' == tmp[1]) {
//DEBUG_ECHOLNPGM(">");
rx_datagram_state = DGUS_IDLE;
break;
}
/* AutoUpload, (and answer to) Command 0x83 :
| tmp[0 1 2 3 4 ... ]
| Example 5A A5 06 83 20 01 01 78 01
| / / | | \ / | \ \
| Header | | | | \_____\_ DATA (Words!)
| DatagramLen / VPAdr |
| Command DataLen (in Words) */
if (command == DGUS_CMD_READVAR) {
const uint16_t vp = tmp[0] << 8 | tmp[1];
//const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words)
//DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen);
DGUS_VP_Variable ramcopy;
DEBUG_ECHOLNPAIR("VP received: ", vp , " - val ", tmp[3]);
if (populate_VPVar(vp, &ramcopy)) {
if (ramcopy.set_by_display_handler)
ramcopy.set_by_display_handler(ramcopy, &tmp[3]);
else
DEBUG_ECHOLNPGM(" VPVar found, no handler.");
}
else
DEBUG_ECHOLNPAIR(" VPVar not found:", vp);
rx_datagram_state = DGUS_IDLE;
break;
}
// discard anything else
rx_datagram_state = DGUS_IDLE;
}
}
}
size_t DGUSDisplay::GetFreeTxBuffer() { return SERIAL_GET_TX_BUFFER_FREE(); }
void DGUSDisplay::WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen) {
dgusserial.write(DGUS_HEADER1);
dgusserial.write(DGUS_HEADER2);
dgusserial.write(payloadlen + 3);
dgusserial.write(cmd);
dgusserial.write(adr >> 8);
dgusserial.write(adr & 0xFF);
}
void DGUSDisplay::WritePGM(const char str[], uint8_t len) {
while (len--) dgusserial.write(pgm_read_byte(str++));
}
void DGUSDisplay::loop() {
// protect against recursion… ProcessRx() may indirectly call idle() when injecting gcode commands.
if (!no_reentrance) {
no_reentrance = true;
ProcessRx();
//Because crappy VPHELPER macros cant take calcs or functions, process updated value here. If we handle only in button handler code, we will miss changes over M290
dgusdisplay.WriteVariable(VP_Z_OFFSET, (int16_t)(100*ExtUI::getZOffset_mm()));
no_reentrance = false;
}
}
void DGUSDisplay::RequestScreen(DGUSLCD_Screens screen) {
displayRequest = screen;
DEBUG_ECHOLNPAIR("GotoScreen ", screen);
const unsigned char gotoscreen[] = { 0x5A, 0x01, (unsigned char) (screen >> 8U), (unsigned char) (screen & 0xFFU) };
WriteVariable(0x84, gotoscreen, sizeof(gotoscreen));
}
void DGUSDisplay::SetTouchScreenConfiguration(bool enable_standby, bool enable_sound, uint8_t standby_brightness, uint8_t brightness, uint16_t standbyTimeSeconds) {
// Main configuration (System_Config)
unsigned char cfg_bits = 0x0;
cfg_bits |= 1UL << 5; // 5: load 22 touch file
cfg_bits |= 1UL << 4; // 4: auto-upload should always be enabled
if (enable_sound) cfg_bits |= 1UL << 3; // 3: audio
if (enable_standby) cfg_bits |= 1UL << 2; // 2: backlight on standby
cfg_bits |= 1UL << 1; // 1 & 0: 270 degrees orientation of display
cfg_bits |= 1UL << 0;
DEBUG_ECHOLNPAIR("Update touch screen config - standby ", enable_standby);
DEBUG_ECHOLNPAIR("Update touch screen config - sound ", enable_sound);
const unsigned char config_set[] = { 0x5A, 0x00, (unsigned char) (cfg_bits >> 8U), (unsigned char) (cfg_bits & 0xFFU) };
WriteVariable(0x80 /*System_Config*/, config_set, sizeof(config_set));
// Standby brightness (LED_Config)
uint16_t dwinStandbyTimeSeconds = 100 * standbyTimeSeconds; /* milliseconds, but divided by 10 (not 5 like the docs say) */
const unsigned char brightness_set[] = {
brightness /*% active*/,
standby_brightness /*% standby*/,
static_cast<uint8_t>(dwinStandbyTimeSeconds >> 8),
static_cast<uint8_t>(dwinStandbyTimeSeconds)
};
WriteVariable(0x82 /*LED_Config*/, brightness_set, sizeof(brightness_set));
}
rx_datagram_state_t DGUSDisplay::rx_datagram_state = DGUS_IDLE;
uint8_t DGUSDisplay::rx_datagram_len = 0;
bool DGUSDisplay::Initialized = false;
bool DGUSDisplay::no_reentrance = false;
DGUSLCD_Screens DGUSDisplay::displayRequest = DGUSLCD_SCREEN_BOOT;
// A SW memory barrier, to ensure GCC does not overoptimize loops
#define sw_barrier() asm volatile("": : :"memory");
bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy) {
//DEBUG_ECHOLNPAIR("populate_VPVar ", VP);
const DGUS_VP_Variable *pvp = DGUSLCD_FindVPVar(VP);
// DEBUG_ECHOLNPAIR(" pvp ", (uint16_t )pvp);
if (!pvp) return false;
memcpy_P(ramcopy, pvp, sizeof(DGUS_VP_Variable));
return true;
}
#endif // HAS_DGUS_LCD
@@ -0,0 +1,136 @@
/**
* 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/>.
*
*/
#pragma once
//#define DEBUG_DGUSLCD
//#define DEBUG_DGUSLCD_OUTGOING_COMM
/* Creality DGUS implementation written by Sebastiaan Dammann in 2020 for Marlin */
#include "../../../inc/MarlinConfigPre.h"
#include "../../../MarlinCore.h"
#if HAS_BED_PROBE
#include "../../../module/probe.h"
#endif
#include "DGUSVPVariable.h"
enum DGUSLCD_Screens : uint8_t;
#ifndef DEBUG_OUT
#define DEBUG_OUT ENABLED(DEBUG_DGUSLCD)
#endif
#include "../../../core/debug_out.h"
typedef enum : uint8_t {
DGUS_IDLE, //< waiting for DGUS_HEADER1.
DGUS_HEADER1_SEEN, //< DGUS_HEADER1 received
DGUS_HEADER2_SEEN, //< DGUS_HEADER2 received
DGUS_WAIT_TELEGRAM, //< LEN received, Waiting for to receive all bytes.
} rx_datagram_state_t;
typedef void (*UPDATE_CURRENT_SCREEN_CALLBACK)(DGUSLCD_Screens screen);
// Low-Level access to the display.
class DGUSDisplay {
public:
DGUSDisplay() = default;
static void InitDisplay();
static void ResetDisplay();
// Variable access.
static void WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false, char fillChar = ' ');
static void WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false, char fillChar = ' ');
static void WriteVariable(uint16_t adr, int16_t value);
static void WriteVariable(uint16_t adr, uint16_t value);
static void WriteVariable(uint16_t adr, uint8_t value);
static void WriteVariable(uint16_t adr, int8_t value);
static void WriteVariable(uint16_t adr, long value);
static void WriteVariable(uint16_t adr, float value);
static void SetVariableDisplayColor(uint16_t sp, uint16_t color);
static void ReadVariable(uint16_t adr);
// Utility functions for bridging ui_api and dgus
template<typename T, float(*Getter)(const T), T selector, typename WireType=uint16_t>
static void SetVariable(DGUS_VP_Variable &var) {
WriteVariable(var.VP, (WireType)Getter(selector));
}
template<typename T, void(*Setter)(const float V, const T), T selector>
static void GetVariable(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t newvalue = swap16(*(uint16_t*)val_ptr);
Setter(newvalue, selector);
}
// Force display into another screen.
// (And trigger update of containing VPs)
// (to implement a pop up message, which may not be nested)
static void RequestScreen(DGUSLCD_Screens screen);
static void SetTouchScreenConfiguration(bool enable_standby, bool enable_sound, uint8_t standby_brightness, uint8_t active_brightness, uint16_t standbyTimeSeconds);
// Periodic tasks, eg. Rx-Queue handling.
static void loop();
public:
// Helper for users of this class to estimate if an interaction would be blocking.
static size_t GetFreeTxBuffer();
// Checks two things: Can we confirm the presence of the display and has we initiliazed it.
// (both boils down that the display answered to our chatting)
static inline bool isInitialized() { return Initialized; }
private:
static void WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen);
static void WritePGM(const char str[], uint8_t len);
static void ProcessRx();
static inline uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); }
static rx_datagram_state_t rx_datagram_state;
static uint8_t rx_datagram_len;
static bool Initialized, no_reentrance;
static DGUSLCD_Screens displayRequest;
};
#define GET_VARIABLE(f, t, V...) (&DGUSDisplay::GetVariable<decltype(t), f, t, ##V>)
#define SET_VARIABLE(f, t, V...) (&DGUSDisplay::SetVariable<decltype(t), f, t, ##V>)
extern DGUSDisplay dgusdisplay;
// compile-time x^y
template<typename T>
constexpr T cpow(const T x, const int y) { return y == 0 ? 1.0 : x * cpow(x, y - 1); }
/// Find the flash address of a DGUS_VP_Variable for the VP.
const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp);
/// Helper to populate a DGUS_VP_Variable for a given VP. Return false if not found.
bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy);
@@ -0,0 +1,53 @@
/**
* 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/>.
*
*/
#pragma once
/* DGUS implementation written by Sebastiaan Dammann in 2020 for Marlin */
#include "DGUSVPVariable.h"
#include <stdint.h>
// This file defines the interaction between Marlin and the display firmware.
// information on which screen which VP is displayed
// As this is a sparse table, two arrays are needed:
// one to list the VPs of one screen and one to map screens to the lists.
// (Strictly this would not be necessary, but allows to only send data the display needs and reducing load on Marlin)
struct VPMapping {
const uint8_t screen;
const uint16_t *VPList; // The list is null-terminated.
};
extern const struct VPMapping VPMap[];
// List of VPs handled by Marlin / The Display.
extern const struct DGUS_VP_Variable ListOfVP[];
#define DWIN_DEFAULT_FILLER_CHAR ' '
#define DWIN_SCROLLER_FILLER_CHAR 0x0
#include "../../../inc/MarlinConfig.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#include "creality_touch/DGUSDisplayDef.h"
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,469 @@
/**
* 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/>.
*
*/
#pragma once
#include "DGUSDisplay.h"
#include "DGUSVPVariable.h"
#include "../../../inc/MarlinConfig.h"
#if HAS_COLOR_LEDS
#include "../../../feature/leds/leds.h"
#if ENABLED(PRINTER_EVENT_LEDS)
#define HAS_COLOR_LEDS_PREFERENCES 1
#endif
#endif
#include "../../../module/motion.h"
enum DGUSLCD_Screens : uint8_t;
struct creality_dwin_settings_t {
size_t settings_size;
uint8_t settings_version;
bool led_state;
bool display_standby;
bool display_sound;
int16_t standby_screen_brightness;
int16_t screen_brightness;
int16_t standby_time_seconds;
#if HAS_COLOR_LEDS_PREFERENCES
LEDColor LastLEDColor;
#endif
};
class DGUSScreenHandler {
public:
DGUSScreenHandler() = default;
static bool loop();
static void Init();
static void DefaultSettings();
static void LoadSettings(const char* buff);
static void StoreSettings(char* buff);
static void SetTouchScreenConfiguration();
static void KillScreenCalled();
static void OnPowerlossResume();
static void RequestSaveSettings();
// Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen
// The bools specifying whether the strings are in RAM or FLASH.
static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash);
}
static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) {
sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash);
}
static void HandleUserConfirmationPopUp(uint16_t ConfirmVP, const char* line1, const char* line2, const char* line3, const char* line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash);
static void HandleDevelopmentTestButton(DGUS_VP_Variable &var, void *val_ptr);
/// "M117" Message -- msg is a RAM ptr.
static void setstatusmessage(const char* msg);
/// The same for messages from Flash
static void setstatusmessagePGM(PGM_P const msg);
// Callback for VP "Display wants to change screen on idle printer"
static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr);
// Callback for VP "Screen has been changed"
static void ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr);
// Callback for VP "All Heaters Off"
static void HandleAllHeatersOff(DGUS_VP_Variable &var, void *val_ptr);
// Hook for "Change this temperature"
static void HandleTemperatureChanged(DGUS_VP_Variable &var, void *val_ptr);
static void HandleFanSpeedChanged(DGUS_VP_Variable &var, void *val_ptr);
// Hook for "Change Flowrate"
static void HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_ptr);
// Hook for manual extrude.
static void HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr);
// Hook for motor lock and unlook
static void HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr);
#if ENABLED(POWER_LOSS_RECOVERY)
static void TogglePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr);
// Hook for power loss recovery.
static void HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr);
#endif
// Version sanity check
static void HandleScreenVersion(DGUS_VP_Variable &var, void *val_ptr);
// Hook for settings
static void HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr);
static void HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr);
static void HandleFadeHeight(DGUS_VP_Variable &var, void *val_ptr);
// Hook for move to position
static void HandlePositionChange(DGUS_VP_Variable &var, void *val_ptr);
static void HandleToggleTouchScreenMute(DGUS_VP_Variable &var, void *val_ptr);
static void HandleToggleTouchScreenStandbySetting(DGUS_VP_Variable &var, void *val_ptr);
static void HandleTouchScreenBrightnessSetting(DGUS_VP_Variable &var, void *val_ptr);
static void HandleTouchScreenStandbyBrightnessSetting(DGUS_VP_Variable &var, void *val_ptr);
static void HandleTouchScreenStandbyTimeSetting(DGUS_VP_Variable &var, void *val_ptr);
#if HAS_PROBE_SETTINGS
static void HandleToggleProbeHeaters(DGUS_VP_Variable &var, void *val_ptr);
static void HandleToggleProbeTemperatureStabilization(DGUS_VP_Variable &var, void *val_ptr);
static void HandleToggleProbePreheatTemp(DGUS_VP_Variable &var, void *val_ptr);
#endif
#if HAS_PID_HEATING
// Hook for "Change this temperature PID para"
static void HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr);
// Hook for PID autotune
static void HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr);
#endif
static void HandleZoffsetChange(DGUS_VP_Variable &var, void *val_ptr);
#if HAS_MESH
// Hook for "Change probe offset z"
static void OnMeshLevelingStart();
static void OnMeshLevelingUpdate(const int8_t x, const int8_t y, const float z);
static void InitMeshValues();
static void ResetMeshValues();
static void UpdateMeshValue(const int8_t x, const int8_t y, const float z);
static void HandleMeshPoint(DGUS_VP_Variable &var, void *val_ptr);
#endif
// LED
#if HAS_COLOR_LEDS
static void HandleLED(DGUS_VP_Variable &var, void *val_ptr);
static void SendLEDToDisplay(DGUS_VP_Variable &var);
#endif
// Hook for live z adjust action
static void HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr);
// Hook for heater control
static void HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr);
#if ENABLED(DGUS_PREHEAT_UI)
// Hook for preheat
static void HandlePreheat(DGUS_VP_Variable &var, void *val_ptr);
#endif
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
// Hook for filament load and unload filament option
static void HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr);
// Hook for filament load and unload
static void HandleFilamentLoadUnload(DGUS_VP_Variable &var);
#endif
#if ENABLED(SDSUPPORT)
// Callback for VP "Display wants to change screen when there is a SD card"
static void ScreenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr);
/// Scroll buttons on the file listing screen.
static void DGUSLCD_SD_ScrollFilelist(DGUS_VP_Variable &var, void *val_ptr);
/// File touched.
static void DGUSLCD_SD_FileSelected(DGUS_VP_Variable &var, void *val_ptr);
/// start print after confirmation received.
static void DGUSLCD_SD_StartPrint(DGUS_VP_Variable &var, void *val_ptr);
/// Send a single filename to the display.
static void DGUSLCD_SD_SendFilename(DGUS_VP_Variable &var);
/// Marlin informed us that a new SD has been inserted.
static void SDCardInserted();
/// Marlin informed us that the SD Card has been removed().
static void SDCardRemoved();
/// Marlin informed us about a bad SD Card.
static void SDCardError();
static void SetPrintingFromHost();
#endif
static void HandleLEDToggle();
static void HandleFanToggle();
static void FilamentRunout();
static void OnFactoryReset();
#if HAS_BUZZER || ENABLED(SPEAKER)
static void Buzzer(const uint16_t frequency, const uint16_t duration);
#endif
static void OnHomingStart();
static void OnHomingComplete();
static void OnPrintFinished();
// OK Button the Confirm screen.
static void ScreenConfirmedOK(DGUS_VP_Variable &var, void *val_ptr);
// Update data after went to new screen (by display or by GotoScreen)
// remember: store the last-displayed screen, so it can get returned to.
// (e.g for pop up messages)
static void UpdateNewScreen(DGUSLCD_Screens newscreen, bool save_current_screen=true);
// Recall the remembered screen.
static void PopToOldScreen();
static void OnBackButton(DGUS_VP_Variable &var, void *val_ptr);
// Make the display show the screen and update all VPs in it.
static void GotoScreen(DGUSLCD_Screens screen, bool save_current_screen = true);
static void UpdateScreenVPData();
// Helpers to convert and transfer data to the display.
static void DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendStringToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendScrollingStringToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var);
static void DGUSLCD_SendScrollingStringToDisplayPGM(DGUS_VP_Variable &var);
static void DGUSLCD_SendTemperaturePID(DGUS_VP_Variable &var);
static void DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendPrintTimeWithRemainingToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendPrintTimeRemainingToDisplay(DGUS_VP_Variable &var);
#if ENABLED(PRINTCOUNTER)
static void DGUSLCD_SendPrintAccTimeToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendPrintsTotalToDisplay(DGUS_VP_Variable &var);
#endif
#if HAS_FAN
static void DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var);
static void DGUSLCD_SendFanSpeedToDisplay(DGUS_VP_Variable &var);
#endif
static void DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var);
#if ENABLED(DGUS_UI_WAITING)
static void DGUSLCD_SendWaitingStatusToDisplay(DGUS_VP_Variable &var);
#endif
static void DGUSLCD_SendAboutFirmwareWebsite(DGUS_VP_Variable &var);
static void DGUSLCD_SendAboutFirmwareVersion(DGUS_VP_Variable &var);
static void DGUSLCD_SendAboutPrintSize(DGUS_VP_Variable &var);
/// Send a value from 0..100 to a variable with a range from 0..255
static void DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr);
template<typename T>
static void DGUSLCD_SetValueDirectly(DGUS_VP_Variable &var, void *val_ptr) {
if (!var.memadr) return;
union { unsigned char tmp[sizeof(T)]; T t; } x;
unsigned char *ptr = (unsigned char*)val_ptr;
LOOP_L_N(i, sizeof(T)) x.tmp[i] = ptr[sizeof(T) - i - 1];
*(T*)var.memadr = x.t;
}
template<DGUSLCD_Screens TPage>
static void DGUSLCD_NavigateToPage(DGUS_VP_Variable &var, void *val_ptr) {
GotoScreen(TPage);
}
template<DGUSLCD_Screens TPage, typename Handler>
static void DGUSLCD_NavigateToPage(DGUS_VP_Variable &var, void *val_ptr) {
GotoScreen(TPage);
Handler::Init();
}
/// Send a float value to the display.
/// Display will get a 4-byte integer scaled to the number of digits:
/// Tell the display the number of digits and it cheats by displaying a dot between...
template<unsigned int decimals>
static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
double d = static_cast<double>(*(float *)var.memadr);
d *= cpow(10, decimals);
// Round - truncated values look like skipped numbers
static_assert(sizeof(long) == 4, "Assuming long is 4 bytes");
long roundedValue = static_cast<long>(round(d));
dgusdisplay.WriteVariable(var.VP, roundedValue);
}
}
// Receive a float from the display - Display will send a 2-byte integer scaled to the number of digits
template<unsigned int decimals>
static void DGUSLCD_SetFloatAsIntFromDisplay(DGUS_VP_Variable &var, void *val_ptr) {
if (var.memadr) {
uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
float value = static_cast<float>(static_cast<double>(value_raw) /cpow(10, decimals));
*(float *)var.memadr = value;
}
}
// Receive a float from the display - Display will send a 4-byte integer scaled to the number of digits
template<unsigned int decimals>
static void DGUSLCD_SetFloatAsLongFromDisplay(DGUS_VP_Variable &var, void *val_ptr) {
if (var.memadr) {
uint32_t value_raw = uInt32Value(*(uint32_t*)val_ptr);
float value = static_cast<float>(static_cast<double>(value_raw) /cpow(10, decimals));
*(float *)var.memadr = value;
}
}
static void DGUSLCD_SendULongToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
// Round - truncated values look like skipped numbers
long roundedValue = *(uint32_t *) var.memadr;
dgusdisplay.WriteVariable(var.VP, roundedValue);
}
}
static void DGUSLCD_ReceiveULongFromDisplay(DGUS_VP_Variable &var, void* val_ptr) {
if (var.memadr) {
// Round - truncated values look like skipped numbers
uint32_t incomingValue = *(uint32_t *) val_ptr;
*(uint32_t*)var.memadr = uInt32Value(incomingValue);
}
}
// Toggle a boolean at the specified memory address
static void DGUSLCD_ToggleBoolean(DGUS_VP_Variable &var, void *val_ptr) {
if (var.memadr) {
SERIAL_ECHOLNPGM("Toggle boolean - ", var.VP);
bool* val = (bool *)var.memadr;
*val = !*val;
}
}
// Send an icon to the display, depending on whether it is true or false
template<unsigned int value_if_true, unsigned int value_if_false>
static void DGUSLCD_SendIconValue(DGUS_VP_Variable &var) {
if (var.memadr) {
bool value = *(bool *)var.memadr;
uint16_t valueToSend = value ? value_if_true : value_if_false;
dgusdisplay.WriteVariable(var.VP, valueToSend);
}
}
/// Send a float value to the display.
/// Display will get a 2-byte integer scaled to the number of digits:
/// Tell the display the number of digits and it cheats by displaying a dot between...
template<unsigned int decimals>
static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
double d = static_cast<double>(*(float *)var.memadr);
d *= cpow(10, decimals);
// Round - truncated values look like skipped numbers
int16_t roundedValue = static_cast<int16_t>(round(d));
dgusdisplay.WriteVariable(var.VP, roundedValue);
}
}
template<AxisEnum Axis>
static void SendAxisTrustValue(DGUS_VP_Variable &var) {
bool trust = axis_is_trusted(Axis);
uint16_t color = trust ? 0xFFFF /*White*/ : 0XF800 /*Red*/;
dgusdisplay.SetVariableDisplayColor(var.VP, color);
}
/// Force an update of all VP on the current screen.
static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; }
/// Has all VPs sent to the screen
static inline bool IsScreenComplete() { return ScreenComplete; }
static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; }
static bool HandlePendingUserConfirmation();
static void SetSynchronousOperationStart();
static void SetSynchronousOperationFinish();
static bool HasCurrentSynchronousOperation() { return HasSynchronousOperation; }
static void SendBusyState(DGUS_VP_Variable &var);
static void SetViewMeshLevelState();
static bool fwretract_available;
private:
static void HandleScreenVersionMismatchLEDFlash();
static DGUSLCD_Screens current_screen; ///< currently on screen
static constexpr uint8_t NUM_PAST_SCREENS = 4;
static DGUSLCD_Screens past_screens[NUM_PAST_SCREENS]; ///< LIFO with past screens for the "back" button.
static uint8_t update_ptr; ///< Last sent entry in the VPList for the actual screen.
static uint16_t skipVP; ///< When updating the screen data, skip this one, because the user is interacting with it.
static bool ScreenComplete; ///< All VPs sent to screen?
static uint16_t ConfirmVP; ///< context for confirm screen (VP that will be emulated-sent on "OK").
static uint8_t MeshLevelIndex;
static uint8_t MeshLevelIconIndex;
static bool SaveSettingsRequested;
static bool HasScreenVersionMismatch;
static bool HasSynchronousOperation;
#if ENABLED(SDSUPPORT)
static int16_t top_file; ///< file on top of file chooser
static int16_t file_to_print; ///< touched file to be confirmed
#endif
private:
FORCE_INLINE static DGUSLCD_Screens GetPreviousScreen() {
return past_screens[0];
}
public: // Needed for VP auto-upload
static bool HasRGBSettings;
static creality_dwin_settings_t Settings;
};
extern DGUSScreenHandler ScreenHandler;
struct DGUSSynchronousOperation {
private:
bool is_running;
public:
DGUSSynchronousOperation() : is_running(false) {}
// Don't allow this to be created on the stack
void* operator new (std::size_t size) = delete;
void start() {
is_running = true;
ScreenHandler.SetSynchronousOperationStart();
}
void done() {
is_running = false;
ScreenHandler.SetSynchronousOperationFinish();
}
~DGUSSynchronousOperation() {
if (is_running) {
ScreenHandler.SetSynchronousOperationFinish();
}
}
};
@@ -0,0 +1,67 @@
/**
* 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/>.
*
*/
#pragma once
#include <stdint.h>
/**
* DGUSVPVariable.h
*
* Created on: Feb 9, 2019
* Author: tobi
*/
struct DGUS_VP_Variable {
uint16_t VP;
void* memadr; // If nullptr, the value cannot be uploaded to the display.
uint8_t size;
// Callback that will be called if the display modified the value.
// nullptr makes it readonly for the display.
void (*set_by_display_handler)(DGUS_VP_Variable &var, void *val_ptr);
void (*send_to_display_handler)(DGUS_VP_Variable &var);
template<typename T>
DGUS_VP_Variable& operator =(T &o) {
*(T*)memadr = o; // warning this is not typesafe.
// TODO: Call out the display or mark as dirty for the next update.
return *this;
}
};
// endianness swap
FORCE_INLINE uint16_t swap16(const uint16_t value) { return (value & 0xffU) << 8U | (value >> 8U); }
FORCE_INLINE int16_t swap16(const int16_t value) {
union { int16_t l; char lb[2]; } endian;
endian.l = value;
char tmp = endian.lb[1];
endian.lb[1] = endian.lb[0];
endian.lb[0] = tmp;
return endian.l;
}
FORCE_INLINE uint32_t uInt32Value(const uint32_t value) { return ((value>>24)&0xff) | ((value<<8)&0xff0000) | ((value>>8)&0xff00) | ((value<<24)&0xff000000); }
FORCE_INLINE uint16_t uInt16Value(void *val_ptr) { return swap16(*static_cast<uint16_t*>(val_ptr)); }
@@ -0,0 +1,230 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#include "../DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
#include "../DGUSScreenHandler.h"
#include "EstepsHandler.h"
#include "AxisSettingsHandler.h"
#include "../../ui_api.h"
#include "../../../marlinui.h"
#include "../../../../module/temperature.h"
#include "../../../../module/settings.h"
#include "../../../../module/planner.h"
#include "../../../../gcode/gcode.h"
#if HAS_TRINAMIC_CONFIG
#include "../../../../feature/tmc_util.h"
#include "../../../../module/stepper/indirection.h"
#endif
AxisEnum AxisSettingsHandler::current_axis;
uint16_t AxisSettingsHandler::axis_settings_title_icon = ICON_AXIS_SETTINGS_TITLE_X;
float AxisSettingsHandler::axis_steps_mm;
uint16_t AxisSettingsHandler::max_acceleration_mm_per_s2;
float AxisSettingsHandler::jerk;
feedRate_t AxisSettingsHandler::max_feedrate;
#if HAS_TRINAMIC_CONFIG
bool AxisSettingsHandler::has_tmc_settings = true;
#else
bool AxisSettingsHandler::has_tmc_settings = false;
#endif
uint16_t AxisSettingsHandler::tmc_current;
bool AxisSettingsHandler::stealthchop;
uint32_t AxisSettingsHandler::hybrid_threshold;
void AxisSettingsHandler::HandleNavigation(DGUS_VP_Variable &var, void *val_ptr) {
switch (uInt16Value(val_ptr)) {
case AXIS_SETTINGS_NAV_BUTTON_VAL_X:
current_axis = X_AXIS;
axis_settings_title_icon = ICON_AXIS_SETTINGS_TITLE_X;
break;
case AXIS_SETTINGS_NAV_BUTTON_VAL_Y:
current_axis = Y_AXIS;
axis_settings_title_icon = ICON_AXIS_SETTINGS_TITLE_Y;
break;
case AXIS_SETTINGS_NAV_BUTTON_VAL_Z:
current_axis = Z_AXIS;
axis_settings_title_icon = ICON_AXIS_SETTINGS_TITLE_Z;
break;
case AXIS_SETTINGS_NAV_BUTTON_VAL_E:
current_axis = E_AXIS;
axis_settings_title_icon = ICON_AXIS_SETTINGS_TITLE_E;
break;
}
// Load settings for axis
axis_steps_mm = planner.settings.axis_steps_per_mm[current_axis];
max_acceleration_mm_per_s2 = static_cast<uint16_t>(planner.settings.max_acceleration_mm_per_s2[current_axis]);
IF_ENABLED(CLASSIC_JERK, jerk = planner.max_jerk[current_axis]);
max_feedrate = planner.settings.max_feedrate_mm_s[current_axis];
#if HAS_TRINAMIC_CONFIG
switch (current_axis){
#if AXIS_IS_TMC(X)
case X_AXIS:
tmc_current = stepperX.getMilliamps();
#if AXIS_HAS_STEALTHCHOP(X)
stealthchop = stepperX.get_stored_stealthChop();
#if ENABLED(HYBRID_THRESHOLD)
hybrid_threshold = static_cast<uint32_t>(stepperX.get_pwm_thrs());
#endif
#endif
break;
#endif
#if AXIS_IS_TMC(Y)
case Y_AXIS:
tmc_current = stepperY.getMilliamps();
#if AXIS_HAS_STEALTHCHOP(Y)
stealthchop = stepperY.get_stored_stealthChop();
#if ENABLED(HYBRID_THRESHOLD)
hybrid_threshold = static_cast<uint32_t>(stepperY.get_pwm_thrs());
#endif
#endif
break;
#endif
#if AXIS_IS_TMC(Z)
case Z_AXIS:
tmc_current = stepperZ.getMilliamps();
#if AXIS_HAS_STEALTHCHOP(Z)
stealthchop = stepperZ.get_stored_stealthChop();
#if ENABLED(HYBRID_THRESHOLD)
hybrid_threshold = static_cast<uint32_t>(stepperZ.get_pwm_thrs());
#endif
#endif
break;
#endif
#if AXIS_IS_TMC(E0)
case E_AXIS:
tmc_current = stepperE0.getMilliamps();
#if AXIS_HAS_STEALTHCHOP(E0)
stealthchop = stepperE0.get_stored_stealthChop();
#if ENABLED(HYBRID_THRESHOLD)
hybrid_threshold = static_cast<uint32_t>(stepperE0.get_pwm_thrs());
#endif
#endif
break;
#endif
default:
// Too bad
break;
}
#endif
// Nav
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_AXIS_SETTINGS_AXIS);
}
void AxisSettingsHandler::HandleBackNavigation(DGUS_VP_Variable &var, void *val_ptr) {
// Save settings for axis
planner.settings.axis_steps_per_mm[current_axis] = axis_steps_mm;
planner.settings.max_acceleration_mm_per_s2[current_axis] = max_acceleration_mm_per_s2;
IF_ENABLED(CLASSIC_JERK, planner.max_jerk[current_axis] = jerk);
planner.settings.max_feedrate_mm_s[current_axis] = max_feedrate;
// If we're handling the E-axis, the back button might end on that screen. Show that we didn't forget the settings.
if (current_axis == E_AXIS) {
EstepsHandler::set_esteps = axis_steps_mm;
EstepsHandler::calculated_esteps = axis_steps_mm;
}
#if HAS_TRINAMIC_CONFIG
switch (current_axis){
#if AXIS_IS_TMC(X)
case X_AXIS:
stepperX.rms_current(tmc_current);
#if AXIS_HAS_STEALTHCHOP(X)
stepperX.set_stealthChop(stealthchop);
#if ENABLED(HYBRID_THRESHOLD)
stepperX.set_pwm_thrs(hybrid_threshold);
#endif
#endif
break;
#endif
#if AXIS_IS_TMC(Y)
case Y_AXIS:
stepperY.rms_current(tmc_current);
#if AXIS_HAS_STEALTHCHOP(Y)
stepperY.set_stealthChop(stealthchop);
#if ENABLED(HYBRID_THRESHOLD)
stepperY.set_pwm_thrs(hybrid_threshold);
#endif
#endif
break;
#endif
#if AXIS_IS_TMC(Z)
case Z_AXIS:
stepperZ.rms_current(tmc_current);
#if AXIS_HAS_STEALTHCHOP(Z)
stepperZ.set_stealthChop(stealthchop);
#if ENABLED(HYBRID_THRESHOLD)
stepperZ.set_pwm_thrs(hybrid_threshold);
#endif
#endif
break;
#endif
#if AXIS_IS_TMC(E0)
case E_AXIS:
stepperE0.rms_current(tmc_current);
#if AXIS_HAS_STEALTHCHOP(E0)
stepperE0.set_stealthChop(stealthchop);
#if ENABLED(HYBRID_THRESHOLD)
stepperE0.set_pwm_thrs(hybrid_threshold);
#endif
#endif
break;
#endif
default:
// Too bad
break;
}
#endif
// Save and pop
ScreenHandler.PopToOldScreen();
settings.save();
}
void AxisSettingsHandler::HandleTMCNavigation(DGUS_VP_Variable &var, void *val_ptr) {
#if HAS_TRINAMIC_CONFIG
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_AXIS_SETTINGS_TMC);
#endif
}
#endif
@@ -0,0 +1,26 @@
#include <cstdint>
class AxisSettingsHandler {
private:
static AxisEnum current_axis;
public:
static uint16_t axis_settings_title_icon;
static float axis_steps_mm;
static uint16_t max_acceleration_mm_per_s2;
static float jerk;
static feedRate_t max_feedrate;
static bool has_tmc_settings;
static uint16_t tmc_current;
static bool stealthchop;
static uint32_t hybrid_threshold;
public:
static void HandleNavigation(DGUS_VP_Variable &var, void *val_ptr);
static void HandleBackNavigation(DGUS_VP_Variable &var, void *val_ptr);
static void HandleTMCNavigation(DGUS_VP_Variable &var, void *val_ptr);
};
@@ -0,0 +1,796 @@
/**
* 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/>.
*
*/
/* DGUS implementation written by Sebastiaan Dammann in 2020 for Marlin */
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#include "../DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
#include "../DGUSScreenHandler.h"
#include "AxisSettingsHandler.h"
#include "EstepsHandler.h"
#include "FilamentLoadUnloadHandler.h"
#include "PIDHandler.h"
#include "MeshValidationHandler.h"
#include "../../../../module/temperature.h"
#include "../../../../module/motion.h"
#include "../../../../module/planner.h"
#include "../../../../feature/caselight.h"
#if ENABLED(BABYSTEPPING)
#include "../../../../feature/babystep.h"
#endif
#if ENABLED(FWRETRACT)
#include "../../../../feature/fwretract.h"
#endif
#if HAS_COLOR_LEDS
#include "../../../../feature/leds/leds.h"
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../../../feature/powerloss.h"
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#include "../../../../feature/runout.h"
#endif
#include "../../ui_api.h"
#include "../../../marlinui.h"
#include "PageHandlers.h"
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
uint16_t distanceToMove = 10;
#endif
using namespace ExtUI;
const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION;
// ----- Common var lists
#if HOTENDS >= 1
#define VPList_HeatHotend VP_T_E0_Is, VP_T_E0_Set,
#else
#define VPList_HeatHotend
#endif
#if HAS_HEATED_BED
#define VPList_HeatBed VP_T_Bed_Is, VP_T_Bed_Set,
#else
#define VPList_HeatBed
#endif
#define VPList_Common VP_BACK_BUTTON_STATE, VP_Z_OFFSET, VP_BUTTON_BEDLEVELKEY
#define VPList_CommonWithStatus VPList_HeatHotend VPList_HeatBed VP_Z_OFFSET, VP_Feedrate_Percentage, VP_BACK_BUTTON_STATE
#define VPList_CommonWithHeatOnly VPList_HeatHotend VPList_HeatBed VP_BACK_BUTTON_STATE, VP_Z_OFFSET
// ----- Which variables to auto-update on which screens
const uint16_t VPList_None[] PROGMEM = {
VPList_Common,
0x0000
};
const uint16_t VPList_DialogStop[] PROGMEM = {
VPList_Common,
0x0000
};
const uint16_t VPList_Main[] PROGMEM = {
VPList_CommonWithStatus,
0x0000
};
const uint16_t VPList_SDFileList[] PROGMEM = {
VPList_CommonWithStatus,
VP_SD_FileName0,
VP_SD_FileName1,
VP_SD_FileName2,
VP_SD_FileName3,
VP_SD_FileName4,
VP_SD_FileName5,
0x0000
};
const uint16_t VPList_Control[] PROGMEM = {
VPList_CommonWithStatus,
VP_LED_TOGGLE,
VP_MUTE_ICON,
0x0000
};
const uint16_t VPList_Feed[] PROGMEM = {
VPList_CommonWithStatus,
VP_FILCHANGE_NOZZLE_TEMP,
VP_FILCHANGE_LENGTH,
0x0000
};
const uint16_t VPList_Temp[] PROGMEM = {
VPList_CommonWithStatus,
VP_FAN_TOGGLE,
0x0000
};
const uint16_t VPList_PreheatPLASettings[] PROGMEM = {
VPList_CommonWithStatus,
VP_PREHEAT_PLA_HOTEND_TEMP,
VP_PREHEAT_PLA_BED_TEMP,
0x0000
};
const uint16_t VPList_PreheatABSSettings[] PROGMEM = {
VPList_CommonWithStatus,
VP_PREHEAT_ABS_HOTEND_TEMP,
VP_PREHEAT_ABS_BED_TEMP,
0x0000
};
const uint16_t VPList_PrintPausingError[] PROGMEM = {
VPList_CommonWithStatus,
VP_X_POSITION,
VP_Y_POSITION,
VP_Z_POSITION_PRECISION,
VP_Z_OFFSET,
VP_Fan0_Percentage,
VP_Feedrate_Percentage,
VP_PrintProgress_Percentage,
VP_PrintTimeProgressBar,
VP_PrintTime,
VP_PrintTimeWithRemainingVisible,
VP_PrintTimeRemaining,
VP_LINEAR_ADVANCE_FACTOR,
0x0000
};
const uint16_t VPList_PrintScreen[] PROGMEM = {
VPList_CommonWithStatus,
VP_X_POSITION, VP_Y_POSITION, VP_Z_POSITION, VP_Z_POSITION_PRECISION,
SP_X_POSITION, SP_Y_POSITION, SP_Z_POSITION,
VP_Flowrate_E0,
VP_Fan0_Percentage,
VP_PrintProgress_Percentage,
VP_PrintTimeProgressBar,
VP_PrintTime,
VP_PrintTimeWithRemainingVisible,
VP_PrintTimeRemaining,
VP_LINEAR_ADVANCE_FACTOR,
VP_FWRETRACT_INDICATOR_ICON,
0x0000
};
const uint16_t VPList_Leveling[] PROGMEM = {
VPList_CommonWithStatus,
VP_MESH_LEVEL_TEMP,
0x0000
};
const uint16_t VPList_ZOffsetLevel[] PROGMEM = {
VPList_CommonWithStatus,
0x0000
};
const uint16_t VPList_TuneScreen[] PROGMEM = {
VPList_CommonWithStatus,
VP_PrintTime,
VP_Flowrate_E0,
VP_LED_TOGGLE,
VP_FAN_TOGGLE,
VP_Fan0_Percentage,
0x0000
};
const uint16_t VPList_TuneExtraScreen[] PROGMEM = {
VPList_CommonWithStatus,
VP_LINEAR_ADVANCE_FACTOR,
VP_RGB_NAV_BUTTON_ICON,
0x0000
};
const uint16_t VPList_Prepare[] PROGMEM = {
VPList_CommonWithStatus,
VP_PrintTime,
0x0000
};
const uint16_t VPList_Info[] PROGMEM = {
VPList_CommonWithStatus,
VP_PrintTime,
VP_PRINTER_BEDSIZE,
VP_MARLIN_WEBSITE,
VP_MARLIN_VERSION,
0x0000
};
const uint16_t VPList_EstepsCalibration[] PROGMEM = {
VPList_CommonWithHeatOnly,
VP_ESTEPS_CURRENT,
VP_ESTEPS_CALIBRATION_TEMP,
VP_ESTEPS_CALIBRATION_LENGTH,
VP_ESTEPS_CALIBRATION_LEFTOVER_LENGTH,
VP_ESTEPS_CALIBRATION_MARK_LENGTH,
VP_ESTEPS_CALCULATED_ESTEPS,
0x0000
};
const uint16_t VPList_PidTune[] PROGMEM = {
VPList_CommonWithHeatOnly,
VP_PIDTUNE_TARGET_TEMP,
VP_PIDTUNE_FAN_TOGGLE_ICON,
VP_PIDTUNE_CYCLES,
0x0000
};
const uint16_t VPList_FWRetractTune[] PROGMEM = {
VPList_CommonWithStatus,
VP_FWRETRACT_RETRACT_LENGTH,
VP_FWRETRACT_RETRACT_FEEDRATE,
VP_FWRETRACT_RETRACT_ZHOP,
VP_FWRETRACT_RESTART_LENGTH,
VP_FWRETRACT_RESTART_FEEDRATE,
VP_FWRETRACT_TOGGLE_BUTTON_ICON,
0x0000
};
const uint16_t VPList_LevelingSettings[] PROGMEM = {
VPList_CommonWithStatus,
VP_TOGGLE_PROBING_HEATERS_OFF_ONOFF_ICON,
VP_TOGGLE_PROBE_PREHEAT_HOTEND_TEMP,
VP_TOGGLE_PROBE_PREHEAT_BED_TEMP,
VP_TOGGLE_POST_PROBING_TEMPERATURE_STABILIZATION_ICON,
VP_LEVELING_FADE_HEIGHT,
0x0000
};
const uint16_t VPList_AxisSettingsNav[] PROGMEM = {
VPList_CommonWithStatus,
0x0000
};
const uint16_t VPList_AxisSettingsAxis[] PROGMEM = {
VPList_CommonWithHeatOnly,
VP_AXIS_SETTINGS_TITLE_ICON,
VP_AXIS_SETTINGS_AXIS_STEPSMM,
VP_AXIS_SETTINGS_AXIS_MAX_ACCEL,
VP_AXIS_SETTINGS_AXIS_JERK,
VP_AXIS_SETTINGS_AXIS_FEEDRATE,
VP_AXIS_TMC_NAV_ICON,
0x0000
};
const uint16_t VPList_AxisSettingsTMC[] PROGMEM = {
VPList_CommonWithHeatOnly,
VP_AXIS_SETTINGS_AXIS_TMCCURRENT,
VP_AXIS_SETTINGS_AXIS_TMCSTEALTHCHOP_ICON,
VP_AXIS_SETTINGS_AXIS_TMCHYBRIDTHRESHOLD,
0x0000
};
const uint16_t VPList_AdvMovementSettings[] PROGMEM = {
VPList_CommonWithHeatOnly,
VP_MOV_MINIMUM_SEGMENT_TIME,
VP_MOV_MINIMUM_FEEDRATE,
VP_MOV_NORMAL_ACCELERATION,
VP_MOV_RETRACT_ACCELERATION,
VP_MOV_MINIMUM_TRAVEL_FEEDRATE,
VP_MOV_MINIMUM_TRAVEL_ACCELERATION,
0x0000
};
const uint16_t VPList_MiscSettings[] PROGMEM = {
VPList_CommonWithHeatOnly,
VP_FILAMENTRUNOUT_SENSOR_TOGGLE_ICON,
VP_PLR_TOGGLE_ICON,
VP_STANDBY_BACKLIGHT_ICON,
VP_SCREEN_BACKLIGHT_STANDBY,
VP_SCREEN_BACKLIGHT,
VP_SCREEN_STANDBY_TIME,
VP_RGB_NAV_BUTTON_ICON,
0x0000
};
const uint16_t VPList_MeshValidation[] PROGMEM = {
VPList_CommonWithHeatOnly,
VP_MESHPATTERN_NOZZLE_TEMP,
VP_MESHPATTERN_BED_TEMP,
VP_MESHPATTERN_BUTTON_ICON,
0x0000
};
const uint16_t VPList_Calibrate[] PROGMEM = {
VPList_CommonWithStatus,
0x0000
};
const uint16_t VPList_RGB[] PROGMEM = {
VPList_CommonWithHeatOnly,
VP_RGB_CONTROL_R,
VP_RGB_CONTROL_G,
VP_RGB_CONTROL_B,
VP_RGB_CONTROL_W,
VP_RGB_CONTROL_I,
0x0000
};
// -- Mapping from screen to variable list
const struct VPMapping VPMap[] PROGMEM = {
{ DGUSLCD_SCREEN_BOOT, VPList_None },
{ DGUSLCD_SCREEN_MAIN, VPList_Main },
{ DGUSLCD_SCREEN_SDFILELIST, VPList_SDFileList },
{ DGUSLCD_SCREEN_FILAMENTRUNOUT1, VPList_PrintPausingError },
{ DGUSLCD_SCREEN_FILAMENTRUNOUT2, VPList_PrintPausingError },
{ DGUSLCD_SCREEN_PRINT_FINISH, VPList_PrintScreen },
{ DGUSLCD_SCREEN_PRINT_RUNNING, VPList_PrintScreen },
{ DGUSLCD_SCREEN_PRINT_PAUSED, VPList_PrintScreen },
{ DGUSLCD_SCREEN_TUNING, VPList_TuneScreen },
{ DGUSLCD_SCREEN_TUNING_EXTRA, VPList_TuneExtraScreen },
{ DGUSLCD_SCREEN_PREPARE, VPList_Prepare },
{ DGUSLCD_SCREEN_INFO, VPList_Info },
{ DGUSLCD_SCREEN_MOVE1MM, VPList_PrintScreen },
{ DGUSLCD_SCREEN_MOVE10MM, VPList_PrintScreen },
{ DGUSLCD_SCREEN_MOVE01MM, VPList_PrintScreen },
{ DGUSLCD_SCREEN_FEED, VPList_Feed },
{ DGUSLCD_SCREEN_SETUP, VPList_Control },
{ DGUSLCD_SCREEN_TEMP, VPList_Temp },
{ DGUSLCD_SCREEN_TEMP_PLA, VPList_PreheatPLASettings },
{ DGUSLCD_SCREEN_TEMP_ABS, VPList_PreheatABSSettings },
{ DGUSLCD_SCREEN_INFO, VPList_PrintScreen },
{ DGUSLCD_SCREEN_ZOFFSET_LEVEL, VPList_ZOffsetLevel },
{ DGUSLCD_SCREEN_LEVELING, VPList_Leveling },
{ DGUSLCD_SCREEN_POWER_LOSS, VPList_None },
{ DGUSLCD_SCREEN_THERMAL_RUNAWAY, VPList_None },
{ DGUSLCD_SCREEN_HEATING_FAILED, VPList_None },
{ DGUSLCD_SCREEN_THERMISTOR_ERROR, VPList_None },
{ DGUSLCD_SCREEN_AUTOHOME, VPList_PrintScreen },
{ DGUSLCD_SCREEN_DIALOG_PAUSE, VPList_None },
{ DGUSLCD_SCREEN_DIALOG_STOP, VPList_DialogStop },
{ DGUSLCD_SCREEN_CONFIRM, VPList_None },
{ DGUSLCD_SCREEN_POPUP, VPList_None },
{ DGUSLCD_SCREEN_ESTEPS_CALIBRATION, VPList_EstepsCalibration },
{ DGUSLCD_SCREEN_PIDTUNE_CALIBRATION, VPList_PidTune },
{ DGUSLCD_SCREEN_TUNEFWRETRACT, VPList_FWRetractTune },
{ DGUSLCD_SCREEN_ESTEPS_CALIBRATION_RESULTS, VPList_EstepsCalibration },
{ DGUSLCD_SCREEN_LEVELING_SETTINGS, VPList_LevelingSettings },
{ DGUSLCD_SCREEN_AXIS_SETTINGS_NAV, VPList_AxisSettingsNav },
{ DGUSLCD_SCREEN_AXIS_SETTINGS_AXIS , VPList_AxisSettingsAxis },
{ DGUSLCD_SCREEN_AXIS_SETTINGS_TMC, VPList_AxisSettingsTMC },
{ DGUSLCD_SCREEN_ADV_MOV_SETTINGS, VPList_AdvMovementSettings },
{ DGUSLCD_SCREEN_MISC_SETTINGS, VPList_MiscSettings },
{ DGUSLCD_SCREEN_MESH_VALIDATION, VPList_MeshValidation },
{ DGUSLCD_SCREEN_CALIBRATE, VPList_Calibrate },
{ DGUSLCD_SCREEN_RGB, VPList_RGB},
{ 0 , nullptr } // List is terminated with an nullptr as table entry.
};
// Helper to define a DGUS_VP_Variable for common use cases.
#define VPHELPER(VPADR, VPADRVAR, RXFPTR, TXFPTR ) { .VP=VPADR, .memadr=VPADRVAR, .size=sizeof(VPADRVAR), \
.set_by_display_handler = RXFPTR, .send_to_display_handler = TXFPTR }
// Helper to define a DGUS_VP_Variable when the sizeo of the var cannot be determined automaticalyl (eg. a string)
#define VPHELPER_STR(VPADR, VPADRVAR, STRLEN, RXFPTR, TXFPTR ) { .VP=VPADR, .memadr=VPADRVAR, .size=STRLEN, \
.set_by_display_handler = RXFPTR, .send_to_display_handler = TXFPTR }
const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
// Back button state
VPHELPER(VP_BACK_BUTTON_STATE, nullptr, nullptr, ScreenHandler.SendBusyState),
// Screen version
VPHELPER(VP_UI_VERSION_MAJOR, nullptr, ScreenHandler.HandleScreenVersion, nullptr),
#if HOTENDS >= 1
VPHELPER(VP_Flowrate_E0, &planner.flow_percentage[ExtUI::extruder_t::E0], ScreenHandler.HandleFlowRateChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
#endif
#if HAS_HEATED_BED
VPHELPER(VP_T_Bed_Is, &thermalManager.temp_bed.celsius, nullptr, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<0>),
VPHELPER(VP_T_Bed_Set, &thermalManager.temp_bed.target, ScreenHandler.HandleTemperatureChanged, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
#endif
VPHELPER(VP_MESH_LEVEL_TEMP, &thermalManager.temp_hotend[0].target, nullptr, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
// Feedrate
VPHELPER(VP_Feedrate_Percentage, &feedrate_percentage, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_PrintProgress_Percentage, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay),
VPHELPER(VP_PrintTimeProgressBar, nullptr, nullptr, ScreenHandler.DGUSLCD_SendPrintProgressToDisplay),
// Calibration
// ... e-steps
VPHELPER(VP_ESTEPS_CURRENT, &EstepsHandler::set_esteps, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_ESTEPS_CALIBRATION_TEMP, &EstepsHandler::calibration_temperature, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_ESTEPS_CALIBRATION_LENGTH, &EstepsHandler::filament_to_extrude, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_ESTEPS_CALIBRATION_MARK_LENGTH, &EstepsHandler::mark_filament_mm, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_ESTEPS_CALIBRATION_LEFTOVER_LENGTH, &EstepsHandler::remaining_filament, EstepsHandler::HandleRemainingFilament, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_ESTEPS_CALCULATED_ESTEPS, &EstepsHandler::calculated_esteps, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_ESTEPS_CALIBRATESTART_BUTTON, nullptr, EstepsHandler::HandleStartButton, nullptr),
VPHELPER(VP_ESTEPS_APPLY_BUTTON, nullptr, EstepsHandler::HandleApplyButton, nullptr),
VPHELPER(VP_ESTEPS_BACK_BUTTON, nullptr, EstepsHandler::HandleBackButton, nullptr),
VPHELPER(VP_ESTEP_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_ESTEPS_CALIBRATION, EstepsHandler>), nullptr),
// ... PID
VPHELPER(VP_PIDTUNE_TARGET_TEMP, &PIDHandler::calibration_temperature, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_PIDTUNE_CYCLES, &PIDHandler::cycles, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_PIDTUNE_FAN_TOGGLE, &PIDHandler::fan_on, ScreenHandler.DGUSLCD_ToggleBoolean, nullptr),
VPHELPER(VP_PIDTUNE_FAN_TOGGLE_ICON, &PIDHandler::fan_on, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_TOGGLE_ON, ICON_TOGGLE_OFF>)),
VPHELPER(VP_PIDTUNE_START_BUTTON, nullptr, PIDHandler::HandleStartButton, nullptr),
VPHELPER(VP_PIDTUNE_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_PIDTUNE_CALIBRATION, PIDHandler>), nullptr),
VPHELPER(VP_GENERIC_BACK_BUTTON, nullptr, ScreenHandler.OnBackButton, nullptr),
#if HAS_MESH
// ... Mesh validation
VPHELPER(VP_MESHPATTERN_NOZZLE_TEMP, &MeshValidationHandler::nozzle_temperature, MeshValidationHandler::HandleTemperature, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_MESHPATTERN_BED_TEMP, &MeshValidationHandler::bed_temperature, MeshValidationHandler::HandleTemperature, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_MESHPATTERN_BUTTON_ICON, &MeshValidationHandler::is_running, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<MESHPATTERN_BUTTON_CANCEL, MESHPATTERN_BUTTON_START>)),
VPHELPER(VP_MESHPATTERN_START_BUTTON, nullptr, MeshValidationHandler::HandleStartOrCancelButton, nullptr),
VPHELPER(VP_MESHPATTERN_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_MESH_VALIDATION, MeshValidationHandler>), nullptr),
#endif
// Axis settings
VPHELPER(VP_AXIS_SETTINGS_NAV_BUTTON, nullptr, AxisSettingsHandler::HandleNavigation, nullptr),
VPHELPER(VP_AXIS_SETTINGS_TITLE_ICON, &AxisSettingsHandler::axis_settings_title_icon, nullptr, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_AXIS_SETTINGS_AXIS_STEPSMM, &AxisSettingsHandler::axis_steps_mm, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_AXIS_SETTINGS_AXIS_MAX_ACCEL, &AxisSettingsHandler::max_acceleration_mm_per_s2, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_AXIS_SETTINGS_AXIS_JERK, &AxisSettingsHandler::jerk, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_AXIS_SETTINGS_AXIS_FEEDRATE, &AxisSettingsHandler::max_feedrate, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_AXIS_SETTINGS_AXIS_TMCCURRENT, &AxisSettingsHandler::tmc_current, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_AXIS_SETTINGS_AXIS_TMCSTEALTHCHOP_BUTTON, &AxisSettingsHandler::stealthchop, ScreenHandler.DGUSLCD_ToggleBoolean, nullptr),
VPHELPER(VP_AXIS_SETTINGS_AXIS_TMCSTEALTHCHOP_ICON, &AxisSettingsHandler::stealthchop, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_TOGGLE_ON, ICON_TOGGLE_OFF>)),
VPHELPER(VP_AXIS_SETTINGS_AXIS_TMCHYBRIDTHRESHOLD, &AxisSettingsHandler::hybrid_threshold, ScreenHandler.DGUSLCD_ReceiveULongFromDisplay, ScreenHandler.DGUSLCD_SendULongToDisplay),
VPHELPER(VP_AXIS_TMC_NAV_ICON, &AxisSettingsHandler::has_tmc_settings, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<AXIS_TMC_NAV_ICON_SHOWING, AXIS_TMC_NAV_ICON_HIDING>)),
VPHELPER(VP_AXIS_SETTINGS_NAV_BACKBUTTON, nullptr, AxisSettingsHandler::HandleBackNavigation, nullptr),
VPHELPER(VP_AXIS_TUNING_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_AXIS_SETTINGS_NAV>), nullptr),
VPHELPER(VP_AXIS_TMC_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_AXIS_SETTINGS_TMC>), nullptr),
// Advanced movement settings
VPHELPER(VP_MOV_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_ADV_MOV_SETTINGS>), nullptr),
VPHELPER(VP_MOV_MINIMUM_SEGMENT_TIME, &planner.settings.min_segment_time_us, ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_MOV_MINIMUM_FEEDRATE, &planner.settings.min_feedrate_mm_s, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_MOV_NORMAL_ACCELERATION, &planner.settings.acceleration, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_MOV_RETRACT_ACCELERATION, &planner.settings.retract_acceleration, ScreenHandler.DGUSLCD_SetFloatAsLongFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<1>),
VPHELPER(VP_MOV_MINIMUM_TRAVEL_FEEDRATE, &planner.settings.min_travel_feedrate_mm_s, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_MOV_MINIMUM_TRAVEL_ACCELERATION, &planner.settings.travel_acceleration, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
// Misc settings
VPHELPER(VP_MISCSETTINGS_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_MISC_SETTINGS>), nullptr),
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
VPHELPER(VP_FILAMENTRUNOUT_SENSOR_TOGGLE_BUTTON, &runout.enabled, ScreenHandler.DGUSLCD_ToggleBoolean, nullptr),
VPHELPER(VP_FILAMENTRUNOUT_SENSOR_TOGGLE_ICON, &runout.enabled, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_TOGGLE_ON, ICON_TOGGLE_OFF>)),
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
VPHELPER(VP_PLR_TOGGLE_BUTTON, nullptr, ScreenHandler.TogglePowerLossRecovery, nullptr),
VPHELPER(VP_PLR_TOGGLE_ICON, &PrintJobRecovery::enabled, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_TOGGLE_ON, ICON_TOGGLE_OFF>)),
#endif
// Preheat settings
#ifdef PREHEAT_1_LABEL
VPHELPER(VP_PREHEAT_PLA_HOTEND_TEMP, &ui.material_preset[0].hotend_temp, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_PREHEAT_PLA_BED_TEMP, &ui.material_preset[0].bed_temp, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
#endif
#ifdef PREHEAT_2_LABEL
VPHELPER(VP_PREHEAT_ABS_HOTEND_TEMP, &ui.material_preset[1].hotend_temp, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_PREHEAT_ABS_BED_TEMP, &ui.material_preset[1].bed_temp, ScreenHandler.DGUSLCD_SetValueDirectly<int16_t>, &ScreenHandler.DGUSLCD_SendWordValueToDisplay),
#endif
// About info
VPHELPER_STR(VP_MARLIN_WEBSITE, nullptr, VP_MARLIN_WEBSITE_LEN, nullptr, ScreenHandler.DGUSLCD_SendAboutFirmwareWebsite),
VPHELPER_STR(VP_MARLIN_VERSION, nullptr, VP_MARLIN_VERSION_LEN, nullptr, ScreenHandler.DGUSLCD_SendAboutFirmwareVersion),
VPHELPER_STR(VP_PRINTER_BEDSIZE, nullptr, VP_PRINTER_BEDSIZE_LEN, nullptr, ScreenHandler.DGUSLCD_SendAboutPrintSize),
// Position Data
VPHELPER(VP_X_POSITION, &current_position.x, ScreenHandler.HandlePositionChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_Y_POSITION, &current_position.y, ScreenHandler.HandlePositionChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_Z_POSITION, &current_position.z, ScreenHandler.HandlePositionChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_Z_POSITION_PRECISION, &current_position.z, nullptr, ScreenHandler.DGUSLCD_SendFloatAsLongValueToDisplay<2>),
VPHELPER(SP_X_POSITION, nullptr, nullptr, ScreenHandler.SendAxisTrustValue<X_AXIS>),
VPHELPER(SP_Y_POSITION, nullptr, nullptr, ScreenHandler.SendAxisTrustValue<Y_AXIS>),
VPHELPER(SP_Z_POSITION, nullptr, nullptr, ScreenHandler.SendAxisTrustValue<Z_AXIS>),
#if HAS_BED_PROBE
VPHELPER(VP_Z_OFFSET, &probe.offset.z, ScreenHandler.HandleZoffsetChange, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<2>),
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
VPHELPER(VP_Z_OFFSET, nullptr, ScreenHandler.HandleZoffsetChange, nullptr),
#endif
VPHELPER(VP_FAN_TOGGLE, &thermalManager.fan_speed[0], nullptr, ScreenHandler.DGUSLCD_SendFanStatusToDisplay),
VPHELPER(VP_Fan0_Percentage, &thermalManager.fan_speed[0], ScreenHandler.HandleFanSpeedChanged, ScreenHandler.DGUSLCD_SendFanSpeedToDisplay),
#if ENABLED(POWER_LOSS_RECOVERY)
VPHELPER(VP_POWER_LOSS_RECOVERY, nullptr, &ScreenHandler.HandlePowerLossRecovery, nullptr),
#endif
VPHELPER_STR(VP_PrintTime, nullptr, VP_PrintTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeToDisplay),
VPHELPER_STR(VP_PrintTimeWithRemainingVisible, nullptr, VP_PrintTime_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeWithRemainingToDisplay),
VPHELPER_STR(VP_PrintTimeRemaining, nullptr, VP_PrintTimeRemaining_LEN, nullptr, ScreenHandler.DGUSLCD_SendPrintTimeRemainingToDisplay),
VPHELPER(VP_SCREENCHANGE, nullptr, ScreenHandler.ScreenChangeHook, nullptr),
VPHELPER(VP_CONFIRMED, nullptr, ScreenHandler.ScreenConfirmedOK, nullptr),
#if HAS_PROBE_SETTINGS
VPHELPER(VP_TOGGLE_PROBING_HEATERS_OFF_ONOFF_BUTTON, nullptr, ScreenHandler.HandleToggleProbeHeaters, nullptr),
VPHELPER(VP_TOGGLE_PROBING_HEATERS_OFF_ONOFF_ICON, &probe.settings.turn_heaters_off, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_ACCURACY_TOGGLE_ON, ICON_ACCURACY_TOGGLE_OFF>)),
VPHELPER(VP_TOGGLE_POST_PROBING_TEMPERATURE_STABILIZATION_BUTTON, nullptr, ScreenHandler.HandleToggleProbeTemperatureStabilization, nullptr),
VPHELPER(VP_TOGGLE_POST_PROBING_TEMPERATURE_STABILIZATION_ICON, &probe.settings.stabilize_temperatures_after_probing, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_POST_PROBE_TEMP_STABILIZATION_TOGGLE_ON, ICON_POST_PROBE_TEMP_STABILIZATION_TOGGLE_OFF>)),
VPHELPER(VP_TOGGLE_PROBE_PREHEAT_HOTEND_TEMP, &probe.settings.preheat_hotend_temp, ScreenHandler.HandleToggleProbePreheatTemp, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_TOGGLE_PROBE_PREHEAT_BED_TEMP, &probe.settings.preheat_bed_temp, ScreenHandler.HandleToggleProbePreheatTemp, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
#endif
#if HAS_MESH
VPHELPER(VP_LEVELING_FADE_HEIGHT, &planner.z_fade_height, ScreenHandler.HandleFadeHeight, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
#endif
VPHELPER(VP_LEVELING_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_ZOFFSET_LEVEL>), nullptr),
VPHELPER(VP_LEVELING_EDIT_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_LEVELING>), nullptr),
VPHELPER(VP_TOGGLE_PROBE_SETTINGS_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_LEVELING_SETTINGS>), nullptr),
// Creality has the same button ID mapped all over the place, so let the generic handler figure it out
VPHELPER(VP_BUTTON_MAINENTERKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_ADJUSTENTERKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_PREPAREENTERKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_RESUMEPRINTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_SELECTFILEKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_STARTPRINTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_STOPPRINTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_PAUSEPRINTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_COOLDOWN, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_TEMPCONTROL, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_BEDLEVELKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_HEATLOADSTARTKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
VPHELPER(VP_BUTTON_MOVEKEY, nullptr, DGUSCrealityDisplay_HandleReturnKeyEvent, nullptr),
// File listing
VPHELPER(VP_SD_ScrollEvent, nullptr, ScreenHandler.DGUSLCD_SD_ScrollFilelist, nullptr),
VPHELPER(VP_SD_FileSelected, nullptr, ScreenHandler.DGUSLCD_SD_FileSelected, nullptr),
VPHELPER(VP_SD_FileSelectConfirm, nullptr, ScreenHandler.DGUSLCD_SD_StartPrint, nullptr),
VPHELPER_STR(VP_SD_FileName0, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
VPHELPER_STR(VP_SD_FileName1, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
VPHELPER_STR(VP_SD_FileName2, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
VPHELPER_STR(VP_SD_FileName3, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
VPHELPER_STR(VP_SD_FileName4, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
VPHELPER_STR(VP_SD_FileName5, nullptr, VP_SD_FileName_LEN, nullptr, ScreenHandler.DGUSLCD_SD_SendFilename),
// Firmware retract
VPHELPER(VP_FWRETRACT_NAV_BUTTON, nullptr, ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_TUNEFWRETRACT>, nullptr),
VPHELPER(VP_FWRETRACT_RETRACT_LENGTH, &fwretract.settings.retract_length, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_FWRETRACT_RETRACT_FEEDRATE, &fwretract.settings.retract_feedrate_mm_s, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_FWRETRACT_RETRACT_ZHOP, &fwretract.settings.retract_zraise, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_FWRETRACT_RESTART_LENGTH, &fwretract.settings.retract_recover_extra, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_FWRETRACT_RESTART_FEEDRATE, &fwretract.settings.retract_recover_feedrate_mm_s, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_FWRETRACT_INDICATOR_ICON, &fwretract.autoretract_enabled, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_FWRETRACT_AUTO_ENGAGED, ICON_FWRETRACT_AUTO_DISENGAGED>)),
VPHELPER(VP_FWRETRACT_TOGGLE_BUTTON_ICON, &fwretract.autoretract_enabled, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_FWRETRACT_AUTO_TOGGLE_ON, ICON_FWRETRACT_AUTO_TOGGLE_OFF>)),
VPHELPER(VP_FWRETRACT_TOGGLE_BUTTON, &fwretract.autoretract_enabled, ScreenHandler.DGUSLCD_ToggleBoolean, nullptr),
// Other tuning
#if ENABLED(LIN_ADVANCE)
VPHELPER(VP_LINEAR_ADVANCE_FACTOR, &planner.extruder_advance_K[0], ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<2>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<2>),
#endif
VPHELPER(VP_OTHER_TUNE_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_TUNING_EXTRA>), nullptr),
// Additional buttons
VPHELPER(VP_MUTE_TOGGLE, nullptr, ScreenHandler.HandleToggleTouchScreenMute, nullptr),
VPHELPER(VP_STANDBY_BACKLIGHT_TOGGLE, nullptr, ScreenHandler.HandleToggleTouchScreenStandbySetting, nullptr),
// Additional settings
VPHELPER(VP_SCREEN_BACKLIGHT_STANDBY, &ScreenHandler.Settings.standby_screen_brightness, ScreenHandler.HandleTouchScreenStandbyBrightnessSetting, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_SCREEN_BACKLIGHT, &ScreenHandler.Settings.screen_brightness, ScreenHandler.HandleTouchScreenBrightnessSetting, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_SCREEN_STANDBY_TIME, &ScreenHandler.Settings.standby_time_seconds, ScreenHandler.HandleTouchScreenStandbyTimeSetting, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
// RGB
VPHELPER(VP_RGB_NAV_BUTTON_ICON, &ScreenHandler.HasRGBSettings, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_RGB_SETTINGS_AVAILABLE, ICON_RGB_SETTINGS_UNAVAILABLE>)),
#if HAS_COLOR_LEDS
VPHELPER(VP_RGB_NAV_BUTTON, nullptr, ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_RGB>, nullptr),
VPHELPER(VP_RGB_CONTROL_R, &leds.color.r, ScreenHandler.HandleLED, ScreenHandler.SendLEDToDisplay),
VPHELPER(VP_RGB_CONTROL_G, &leds.color.g, ScreenHandler.HandleLED, ScreenHandler.SendLEDToDisplay),
VPHELPER(VP_RGB_CONTROL_B, &leds.color.b, ScreenHandler.HandleLED, ScreenHandler.SendLEDToDisplay),
#if EITHER(RGBW_LED, NEOPIXEL_LED)
VPHELPER(VP_RGB_CONTROL_W, &leds.color.w, ScreenHandler.HandleLED, ScreenHandler.SendLEDToDisplay),
#if ENABLED(NEOPIXEL_LED)
VPHELPER(VP_RGB_CONTROL_I, &leds.color.i, ScreenHandler.HandleLED, ScreenHandler.SendLEDToDisplay),
#endif
#endif
#endif
// Filament load/unload
VPHELPER(VP_FILCHANGE_NAV_BUTTON, nullptr, (ScreenHandler.DGUSLCD_NavigateToPage<DGUSLCD_SCREEN_FEED, FilamentLoadUnloadHandler>), nullptr),
VPHELPER(VP_FILCHANGE_LENGTH, &FilamentLoadUnloadHandler::length, ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>, ScreenHandler.DGUSLCD_SendFloatAsIntValueToDisplay<1>),
VPHELPER(VP_FILCHANGE_NOZZLE_TEMP, &FilamentLoadUnloadHandler::nozzle_temperature, FilamentLoadUnloadHandler::HandleTemperature, ScreenHandler.DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_FILCHANGE_ACTION_BUTTON, nullptr, FilamentLoadUnloadHandler::HandleLoadUnloadButton, nullptr),
// Icons
#if ENABLED(CASE_LIGHT_ENABLE)
VPHELPER(VP_LED_TOGGLE, &caselight.on, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_LED_TOGGLE_ON, ICON_LED_TOGGLE_OFF>)),
#endif
VPHELPER(VP_STANDBY_BACKLIGHT_ICON, &ScreenHandler.Settings.display_standby, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_TOGGLE_ON, ICON_TOGGLE_OFF>)),
VPHELPER(VP_MUTE_ICON, &ScreenHandler.Settings.display_sound, nullptr, (ScreenHandler.DGUSLCD_SendIconValue<ICON_SOUND_TOGGLE_ON, ICON_SOUND_TOGGLE_OFF>)),
// Development test button
VPHELPER(VP_DEVELOPMENT_HELPER_BUTTON, nullptr, ScreenHandler.HandleDevelopmentTestButton, nullptr),
// Mesh override input
#if MESH_INPUT_SUPPORTED_SIZE == GRID_MAX_POINTS && HAS_MESH
//#define _VPHELPER_GP(N) VPHELPER((VP_MESH_INPUT_X0_Y0 + ( ##N## * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
//REPEAT(MESH_INPUT_SUPPORTED_SIZE, _VPHELPER_GP)
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 0 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 1 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 2 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 3 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 4 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 5 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 6 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 7 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 8 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 9 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 10 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 11 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 12 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 13 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 14 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
VPHELPER((VP_MESH_INPUT_X0_Y0 + ( 15 * MESH_INPUT_DATA_SIZE)), nullptr, ScreenHandler.HandleMeshPoint, nullptr),
#endif
// M117 LCD String (We don't need the string in memory but "just" push it to the display on demand, hence the nullptr
{ .VP = VP_M117, .memadr = nullptr, .size = VP_M117_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.DGUSLCD_SendStringToDisplay },
{ .VP = VP_M117_STATIC, .memadr = nullptr, .size = VP_M117_STATIC_LEN, .set_by_display_handler = nullptr, .send_to_display_handler =&ScreenHandler.DGUSLCD_SendStringToDisplay },
// Messages for the User, shared by the popup and the kill screen. They cant be autouploaded as we do not buffer content.
{ .VP = VP_MSGSTR1, .memadr = nullptr, .size = VP_MSGSTR1_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM },
{ .VP = VP_MSGSTR2, .memadr = nullptr, .size = VP_MSGSTR2_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM },
{ .VP = VP_MSGSTR3, .memadr = nullptr, .size = VP_MSGSTR3_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM },
//{ .VP = VP_MSGSTR4, .memadr = nullptr, .size = VP_MSGSTR4_LEN, .set_by_display_handler = nullptr, .send_to_display_handler = &ScreenHandler.DGUSLCD_SendStringToDisplayPGM },
VPHELPER(0, 0, 0, 0) // must be last entry.
};
#endif // DGUS_LCD_UI_ORIGIN
@@ -0,0 +1,562 @@
/**
* 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/>.
*
*/
#pragma once
enum DGUSLCD_Screens : uint8_t {
DGUSLCD_SCREEN_BOOT = 0,
DGUSLCD_SCREEN_MAIN = 28,
DGUSLCD_SCREEN_CONFIRM = 66,
DGUSLCD_SCREEN_SDPRINTMANIPULATION = 37 ,
DGUSLCD_SCREEN_SDPRINTTUNE = 41,
DGUSLCD_SCREEN_SDFILELIST = 67,
DGUSLCD_SCREEN_FILAMENTRUNOUT1 = 34, // DWINTouchPage::ERR_FILAMENTRUNOUT_HOTEND_COLD
DGUSLCD_SCREEN_FILAMENTRUNOUT2 = 35, // DWINTouchPage::ERR_FILAMENTRUNOUT_FILAMENT_LOADED
DGUSLCD_SCREEN_PRINT_FINISH = 36, // DWINTouchPage::PRINT_FINISHED
DGUSLCD_SCREEN_PRINT_RUNNING = 37, // DWINTouchPage::PRINT_PROGRESS_RUNNING
DGUSLCD_SCREEN_PRINT_PAUSED = 39, // DWINTouchPage::PRINT_PROGRESS_PAUSED
DGUSLCD_SCREEN_DIALOG_PAUSE = 38, // DWINTouchPage::DIALOG_PAUSE_PRINTING
DGUSLCD_SCREEN_DIALOG_STOP = 40, // DWINTouchPage::DIALOG_STOP_PRINTING
DGUSLCD_SCREEN_TUNING = 41, // DWINTouchPage::MENU_TUNING
DGUSLCD_SCREEN_TUNING_EXTRA = 79, // (this is a new page)
DGUSLCD_SCREEN_PREPARE = 42, // DWINTouchPage::MENU_PREPARE
DGUSLCD_SCREEN_MOVE10MM = 43, // DWINTouchPage::MOVE_1MM
DGUSLCD_SCREEN_MOVE1MM = 44, // DWINTouchPage::MOVE_10MM
DGUSLCD_SCREEN_MOVE01MM = 45, // DWINTouchPage::MOVE_01MM
DGUSLCD_SCREEN_FEED = 46, // DWINTouchPage::FEED
DGUSLCD_SCREEN_SETUP = 47, // DWINTouchPage::MENU_CONTROL
DGUSLCD_SCREEN_TEMP = 48, // DWINTouchPage::MENU_TEMP
DGUSLCD_SCREEN_TEMP_PLA = 49, // DWINTouchPage::MENU_PLA_TEMP
DGUSLCD_SCREEN_TEMP_ABS = 50, // DWINTouchPage::MENU_ABS_TEMP
DGUSLCD_SCREEN_INFO = 51, // DWINTouchPage::MENU_ABOUT
DGUSLCD_SCREEN_ZOFFSET_LEVEL = 52, // DWINTouchPage::MENU_ZOFFSET_LEVELING
DGUSLCD_SCREEN_LEVELING = 53, // DWINTouchPage::LEVELING
DGUSLCD_SCREEN_POWER_LOSS = 54, // DWINTouchPage::DIALOG_POWER_FAILURE
DGUSLCD_SCREEN_THERMAL_RUNAWAY = 57, // DWINTouchPage::ERR_THERMAL_RUNAWAY
DGUSLCD_SCREEN_HEATING_FAILED = 58, // DWINTouchPage::ERR_HEATING_FAILED
DGUSLCD_SCREEN_THERMISTOR_ERROR = 59, // DWINTouchPage::ERR_THERMISTOR
DGUSLCD_SCREEN_AUTOHOME = 61, // DWINTouchPage::AUTOHOME_IN_PROGRESS
DGUSLCD_SCREEN_POPUP = 63, // NEW - does not exist in original display
DGUSLCD_SCREEN_KILL = 64, // NEW - does not exist in original display
DGUSLCD_SCREEN_PIDTUNE_CALIBRATION = 68,
DGUSLCD_SCREEN_ESTEPS_CALIBRATION = 69,
DGUSLCD_SCREEN_TUNEFWRETRACT = 70,
DGUSLCD_SCREEN_ESTEPS_CALIBRATION_RESULTS = 71,
DGUSLCD_SCREEN_LEVELING_SETTINGS = 72,
DGUSLCD_SCREEN_AXIS_SETTINGS_NAV = 73,
DGUSLCD_SCREEN_AXIS_SETTINGS_AXIS = 74,
DGUSLCD_SCREEN_AXIS_SETTINGS_TMC = 75,
DGUSLCD_SCREEN_ADV_MOV_SETTINGS = 76,
DGUSLCD_SCREEN_MISC_SETTINGS = 77,
DGUSLCD_SCREEN_MESH_VALIDATION = 78,
DGUSLCD_SCREEN_CALIBRATE = 80,
DGUSLCD_SCREEN_RGB = 81
};
// Version checks
constexpr uint16_t VP_UI_VERSION_MAJOR = 0xFFFA;
constexpr uint16_t EXPECTED_UI_VERSION_MAJOR = 61;
constexpr uint16_t VERSION_MISMATCH_BUZZ_AMOUNT = 5;
constexpr uint16_t VERSION_MISMATCH_LED_FLASH_DELAY = 1000;
#define VP_STARTPROGRESSBAR 0x1000
// // Storage space for the Killscreen messages. Reused for the popup.
constexpr uint16_t VP_MSGSTR1 = 0x2010;
constexpr uint8_t VP_MSGSTR1_LEN = 0x20; // might be more place for it...
constexpr uint16_t VP_MSGSTR2 = 0x2030;
constexpr uint8_t VP_MSGSTR2_LEN = 0x40;
constexpr uint16_t VP_MSGSTR3 = 0x2070;
constexpr uint8_t VP_MSGSTR3_LEN = 0x40;
constexpr uint16_t VP_MSGSTR4 = 0x2080;
constexpr uint8_t VP_MSGSTR4_LEN = 0x20;
// // Screenchange request for screens that only make sense when printer is idle.
// // e.g movement is only allowed if printer is not printing.
// // Marlin must confirm by setting the screen manually.
// constexpr uint16_t VP_SCREENCHANGE_ASK = 0x2000;
constexpr uint16_t VP_SCREENCHANGE = 0x219f; // Key-Return button to new menu pressed. Data contains target screen in low byte and info in high byte.
// constexpr uint16_t VP_TEMP_ALL_OFF = 0x2002; // Turn all heaters off. Value arbitrary ;)=
// constexpr uint16_t VP_SCREENCHANGE_WHENSD = 0x2003; // "Print" Button touched -- go only there if there is an SD Card.
constexpr uint16_t VP_CONFIRMED = 0x219E; // OK on confirm screen.
// // Buttons on the SD-Card File listing.
// constexpr uint16_t VP_SD_ScrollEvent = 0x2020; // Data: 0 for "up a directory", numbers are the amount to scroll, e.g -1 one up, 1 one down
// constexpr uint16_t VP_SD_FileSelected = 0x2022; // Number of file field selected.
constexpr uint16_t VP_SD_FileSelectConfirm = 0x2024; // (This is a virtual VP and emulated by the Confirm Screen when a file has been confirmed)
// constexpr uint16_t VP_SD_ResumePauseAbort = 0x2026; // Resume(Data=0), Pause(Data=1), Abort(Data=2) SD Card prints
constexpr uint16_t VP_SD_AbortPrintConfirmed = 0x2028; // Abort print confirmation (virtual, will be injected by the confirm dialog)
// constexpr uint16_t VP_SD_Print_Setting = 0x2040;
// constexpr uint16_t VP_SD_Print_LiveAdjustZ = 0x2050; // Data: 0 down, 1 up
// // Controls for movement (we can't use the incremental / decremental feature of the display at this feature works only with 16 bit values
// // (which would limit us to 655.35mm, which is likely not a problem for common setups, but i don't want to rule out hangprinters support)
// // A word about the coding: The VP will be per axis and the return code will be an signed 16 bit value in 0.01 mm resolution, telling us
// // the relative travel amount t he user wants to do. So eg. if the display sends us VP=2100 with value 100, the user wants us to move X by +1 mm.
constexpr uint16_t VP_MOVE_X = 0x2100;
constexpr uint16_t VP_MOVE_Y = 0x2102;
constexpr uint16_t VP_MOVE_Z = 0x2104;
constexpr uint16_t VP_MOVE_E0 = 0x2110;
// constexpr uint16_t VP_MOVE_E1 = 0x2112;
// //constexpr uint16_t VP_MOVE_E2 = 0x2114;
// //constexpr uint16_t VP_MOVE_E3 = 0x2116;
// //constexpr uint16_t VP_MOVE_E4 = 0x2118;
// //constexpr uint16_t VP_MOVE_E5 = 0x211A;
constexpr uint16_t VP_HOME_ALL = 0x2120;
// constexpr uint16_t VP_MOTOR_LOCK_UNLOK = 0x2130;
// // Power loss recovery
// constexpr uint16_t VP_POWER_LOSS_RECOVERY = 0x2180;
// // Fan Control Buttons , switch between "off" and "on"
// constexpr uint16_t VP_FAN0_CONTROL = 0x2200;
// constexpr uint16_t VP_FAN1_CONTROL = 0x2202;
// //constexpr uint16_t VP_FAN2_CONTROL = 0x2204;
// //constexpr uint16_t VP_FAN3_CONTROL = 0x2206;
// // Heater Control Buttons , triged between "cool down" and "heat PLA" state
constexpr uint16_t VP_E0_CONTROL = 0x2210;
// constexpr uint16_t VP_E1_CONTROL = 0x2212;
// //constexpr uint16_t VP_E2_CONTROL = 0x2214;
// //constexpr uint16_t VP_E3_CONTROL = 0x2216;
// //constexpr uint16_t VP_E4_CONTROL = 0x2218;
// //constexpr uint16_t VP_E5_CONTROL = 0x221A;
constexpr uint16_t VP_BED_CONTROL = 0x221C;
// // Preheat
// constexpr uint16_t VP_E0_BED_PREHEAT = 0x2220;
// constexpr uint16_t VP_E1_BED_CONTROL = 0x2222;
// //constexpr uint16_t VP_E2_BED_CONTROL = 0x2224;
// //constexpr uint16_t VP_E3_BED_CONTROL = 0x2226;
// //constexpr uint16_t VP_E4_BED_CONTROL = 0x2228;
// //constexpr uint16_t VP_E5_BED_CONTROL = 0x222A;
// // Filament load and unload
// constexpr uint16_t VP_E0_FILAMENT_LOAD_UNLOAD = 0x2300;
// constexpr uint16_t VP_E1_FILAMENT_LOAD_UNLOAD = 0x2302;
// // Settings store , reset
// constexpr uint16_t VP_SETTINGS = 0x2400;
// // PID autotune
constexpr uint16_t VP_PID_AUTOTUNE_E0 = 0x2410;
// //constexpr uint16_t VP_PID_AUTOTUNE_E1 = 0x2412;
// //constexpr uint16_t VP_PID_AUTOTUNE_E2 = 0x2414;
// //constexpr uint16_t VP_PID_AUTOTUNE_E3 = 0x2416;
// //constexpr uint16_t VP_PID_AUTOTUNE_E4 = 0x2418;
// //constexpr uint16_t VP_PID_AUTOTUNE_E5 = 0x241A;
constexpr uint16_t VP_PID_AUTOTUNE_BED = 0x2420;
// // Firmware version on the boot screen.
constexpr uint16_t VP_PRINTER_BEDSIZE = 0x1074;
constexpr uint16_t VP_PRINTER_BEDSIZE_LEN = 12;
constexpr uint16_t VP_MARLIN_VERSION = 0x2222;
constexpr uint8_t VP_MARLIN_VERSION_LEN = 32;
constexpr uint16_t VP_MARLIN_WEBSITE = 0x2242;
constexpr uint8_t VP_MARLIN_WEBSITE_LEN = 32;
constexpr uint16_t VP_STANDBY_BACKLIGHT_ICON = 0x2280;
constexpr uint16_t VP_STANDBY_BACKLIGHT_TOGGLE = 0x2282;
constexpr uint16_t VP_MUTE_ICON = 0x2284;
constexpr uint16_t VP_MUTE_TOGGLE = 0x2286;
constexpr uint16_t VP_SCREEN_BACKLIGHT_STANDBY = 0x228D;
constexpr uint16_t VP_SCREEN_BACKLIGHT = 0x2384;
constexpr uint16_t VP_SCREEN_STANDBY_TIME = 0x2386;
// Material preheat settings
constexpr uint16_t VP_PREHEAT_PLA_HOTEND_TEMP = 0x1102;
constexpr uint16_t VP_PREHEAT_PLA_BED_TEMP = 0x1104;
constexpr uint16_t VP_PREHEAT_ABS_HOTEND_TEMP = 0x1108;
constexpr uint16_t VP_PREHEAT_ABS_BED_TEMP = 0x110a;
// Place for status messages.
// ... We have memory space for scrolling messages
constexpr uint16_t VP_M117 = 0x3000 + (3 * 1); // Text Variable Pointer. First three VP must be reserved [a VP is two bytes red.]. Text is saved after the 3rd VP and ended with 0x00 or 0x0F.
constexpr uint8_t VP_M117_LEN = 100;
// ... And memory space for static (short) messages. Note this VPAddr is also the VP of the 5 beta and alpha 4 touch screens.
constexpr uint8_t M117_STATIC_DISPLAY_LEN = 28; // Fits "TFT flashed incorrectly v0" exactly
constexpr uint16_t VP_M117_STATIC = 0x21B3;
constexpr uint8_t VP_M117_STATIC_LEN = 70;
// // Temperatures.
constexpr uint16_t VP_T_E0_Is = 0x1036; // 4 Byte Integer - HEAD_CURRENT_TEMP_VP
constexpr uint16_t VP_T_E0_Set = 0x1034; // 2 Byte Integer - HEAD_SET_TEMP_VP
constexpr uint16_t VP_T_Bed_Is = 0x103c; // 4 Byte Integer - BED_SET_TEMP_VP
constexpr uint16_t VP_T_Bed_Set = 0x103A; // 2 Byte Integer - BED_CURRENT_TEMP_VP
constexpr uint16_t VP_Flowrate_E0 = 0x228A; // 2 Byte Integer
constexpr uint16_t VP_Fan0_Percentage = 0x228F; // 2 Byte Integer (0..100)
constexpr uint16_t VP_Feedrate_Percentage = 0x1006; // 2 Byte Integer (0..100) - PRINT_SPEED_RATE_VP
constexpr uint16_t VP_PrintProgress_Percentage = 0x1016; // 2 Byte Integer (0..100)
constexpr uint16_t VP_PrintTimeProgressBar = 0x100E;
constexpr uint16_t VP_PrintTime = 0x21a0;
constexpr uint16_t VP_PrintTimeWithRemainingVisible = 0x2335;
constexpr uint16_t VP_PrintTime_LEN = 19;
constexpr uint16_t VP_PrintTimeRemaining = 0x231f;
constexpr uint16_t VP_PrintTimeRemaining_LEN = 21;
constexpr uint16_t VP_HideRemainingTime_Ico = 0x2380;
constexpr uint16_t ICON_REMAINING_VISIBLE = 26;
constexpr uint16_t ICON_REMAINING_HIDDEN = 27;
constexpr uint16_t VP_Z_OFFSET = 0x1026;
// // SDCard File Listing
constexpr uint16_t VP_SD_ScrollEvent = 0x20D4; // Data: 0 for "up a directory", numbers are the amount to scroll, e.g -1 one up, 1 one down
constexpr uint16_t VP_SD_FileSelected = 0x2200; // Number of file field selected.
constexpr uint16_t VP_SD_FileName_LEN = 21; // LEN is shared for all entries.
constexpr uint16_t VP_SD_FileName_CNT = 5; // LEN is shared for all entries.
constexpr uint16_t DGUS_SD_FILESPERSCREEN = VP_SD_FileName_CNT; // FIXME move that info to the display and read it from there.
constexpr uint16_t VP_SD_FileName0 = 0x20D5;
constexpr uint16_t VP_SD_FileName1 = VP_SD_FileName0 + VP_SD_FileName_LEN;
constexpr uint16_t VP_SD_FileName2 = VP_SD_FileName1 + VP_SD_FileName_LEN;
constexpr uint16_t VP_SD_FileName3 = VP_SD_FileName2 + VP_SD_FileName_LEN;
constexpr uint16_t VP_SD_FileName4 = VP_SD_FileName3 + VP_SD_FileName_LEN;
constexpr uint16_t VP_SD_FileName5 = VP_SD_FileName4 + VP_SD_FileName_LEN;
constexpr uint16_t VP_SD_Print_ProbeOffsetZ = 0x32A0; //
constexpr uint16_t VP_SD_Print_Filename = 0x2000; //
constexpr uint16_t VP_ICON_OVERLAY_CLEAR = 10;
constexpr uint16_t VP_ICON_OVERLAY_SELECTED = 6;
// // Step per mm
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600;
constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604;
constexpr uint16_t VP_Z_STEP_PER_MM = 0x3608;
constexpr uint16_t VP_E0_STEP_PER_MM = 0x3610;
// // PIDs
constexpr uint16_t VP_E0_PID_P = 0x3700;
constexpr uint16_t VP_E0_PID_I = 0x3702;
constexpr uint16_t VP_E0_PID_D = 0x3704;
constexpr uint16_t VP_BED_PID_P = 0x3710;
constexpr uint16_t VP_BED_PID_I = 0x3712;
constexpr uint16_t VP_BED_PID_D = 0x3714;
// Power loss recovery
constexpr uint16_t VP_POWER_LOSS_RECOVERY = 0x105F;
// Buttons defined by Creality - Don't worry if you're confused by the naming, so am I
constexpr uint16_t VP_BUTTON_MAINENTERKEY = 0x1002;
constexpr uint16_t VP_BUTTON_ADJUSTENTERKEY = 0x1004;
constexpr uint16_t VP_BUTTON_PAUSEPRINTKEY = 0x100A;
constexpr uint16_t VP_BUTTON_TEMPCONTROL = 0x1030;
constexpr uint16_t VP_BUTTON_COOLDOWN = 0x1032;
constexpr uint16_t VP_BUTTON_PREPAREENTERKEY = 0x103E;
constexpr uint16_t VP_BUTTON_SELECTFILEKEY = 0x20D3;
constexpr uint16_t VP_BUTTON_STARTPRINTKEY = 0x20D2;
constexpr uint16_t VP_BUTTON_STOPPRINTKEY = 0x1008;
constexpr uint16_t VP_BUTTON_RESUMEPRINTKEY = 0x100C;
constexpr uint16_t VP_BUTTON_BEDLEVELKEY = 0x1044;
constexpr uint16_t VP_BUTTON_HEATLOADSTARTKEY = 0x1056;
// Additional stuff defined by Creality
constexpr uint16_t VP_FAN_TOGGLE = 0x101E;
constexpr uint16_t VP_LED_TOGGLE = 0x101F;
// Axis settings
constexpr uint16_t VP_AXIS_SETTINGS_NAV_BUTTON = 0x22D9;
constexpr uint16_t AXIS_SETTINGS_NAV_BUTTON_VAL_X = 1;
constexpr uint16_t AXIS_SETTINGS_NAV_BUTTON_VAL_Y = 2;
constexpr uint16_t AXIS_SETTINGS_NAV_BUTTON_VAL_Z = 3;
constexpr uint16_t AXIS_SETTINGS_NAV_BUTTON_VAL_E = 4;
constexpr uint16_t VP_AXIS_SETTINGS_TITLE_ICON = 0x22DB;
constexpr uint16_t ICON_AXIS_SETTINGS_TITLE_X = 20;
constexpr uint16_t ICON_AXIS_SETTINGS_TITLE_Y = 21;
constexpr uint16_t ICON_AXIS_SETTINGS_TITLE_Z = 22;
constexpr uint16_t ICON_AXIS_SETTINGS_TITLE_E = 23;
constexpr uint16_t VP_AXIS_SETTINGS_NAV_BACKBUTTON = 0x22DD;
constexpr uint16_t VP_AXIS_SETTINGS_AXIS_STEPSMM = 0x22DF; // 2-byte
constexpr uint16_t VP_AXIS_SETTINGS_AXIS_MAX_ACCEL = 0x22E1; // 4-byte (!)
constexpr uint16_t VP_AXIS_SETTINGS_AXIS_JERK = 0x22E5; // 2-byte
constexpr uint16_t VP_AXIS_SETTINGS_AXIS_FEEDRATE = 0x22E7; // 2-byte
constexpr uint16_t VP_AXIS_SETTINGS_AXIS_TMCCURRENT = 0x22E9; // 2-byte
constexpr uint16_t VP_AXIS_SETTINGS_AXIS_TMCSTEALTHCHOP_BUTTON = 0x22EB; // 2-byte
constexpr uint16_t VP_AXIS_SETTINGS_AXIS_TMCSTEALTHCHOP_ICON = 0x22ED; // 2-byte
constexpr uint16_t VP_AXIS_SETTINGS_AXIS_TMCHYBRIDTHRESHOLD = 0x22EF; // 4-byte (!)
constexpr uint16_t VP_AXIS_TUNING_NAV_BUTTON = 0x22F5;
constexpr uint16_t VP_AXIS_TMC_NAV_BUTTON = 0x22F7;
constexpr uint16_t VP_AXIS_TMC_NAV_ICON = 0x22F3; // 2-byte
constexpr uint16_t AXIS_TMC_NAV_ICON_SHOWING = 10;
constexpr uint16_t AXIS_TMC_NAV_ICON_HIDING = 11;
// ... Advanced movement settings
constexpr uint16_t VP_MOV_NAV_BUTTON = 0x2305;
constexpr uint16_t VP_MOV_MINIMUM_SEGMENT_TIME = 0x22F9; // uint 2-byte
constexpr uint16_t VP_MOV_MINIMUM_FEEDRATE = 0x22FB; // float 2-byte
constexpr uint16_t VP_MOV_NORMAL_ACCELERATION = 0x22FD; // float 2-byte
constexpr uint16_t VP_MOV_MINIMUM_TRAVEL_FEEDRATE = 0x2301; // float 2-byte
constexpr uint16_t VP_MOV_MINIMUM_TRAVEL_ACCELERATION = 0x2303; // float 2-byte
constexpr uint16_t VP_MOV_RETRACT_ACCELERATION = 0x2307; // float 4-byte
// Misc settings
constexpr uint16_t VP_MISCSETTINGS_NAV_BUTTON = 0x2311;
constexpr uint16_t VP_FILAMENTRUNOUT_SENSOR_TOGGLE_BUTTON = 0x2309;
constexpr uint16_t VP_FILAMENTRUNOUT_SENSOR_TOGGLE_ICON = 0x230b;
constexpr uint16_t VP_PLR_TOGGLE_BUTTON = 0x230d;
constexpr uint16_t VP_PLR_TOGGLE_ICON = 0x230F;
// Mesh leveling
constexpr uint16_t VP_LEVELING_NAV_BUTTON = 0x238a;
constexpr uint16_t VP_LEVELING_EDIT_NAV_BUTTON = 0x23A8;
constexpr uint16_t VP_MESH_SCREEN_MESSAGE_ICON = 0x22cb;
constexpr uint16_t MESH_SCREEN_MESSAGE_ICON_LEVELING = 5;
constexpr uint16_t MESH_SCREEN_MESSAGE_ICON_VIEWING = 6;
constexpr uint16_t VP_MESH_LEVEL_TEMP = 0x108A;
constexpr uint16_t VP_MESH_LEVEL_STATUS = 0x108D;
constexpr uint8_t DGUS_GRID_VISUALIZATION_START_ID = GRID_MAX_POINTS > (4*4) ? 30 : 1;
static_assert(
(GRID_MAX_POINTS == 16 && DGUS_GRID_VISUALIZATION_START_ID == 1)|| // CR-6 SE
(GRID_MAX_POINTS == 49 && DGUS_GRID_VISUALIZATION_START_ID == 30) || // CR-6 MAX
(GRID_MAX_POINTS != 16 && GRID_MAX_POINTS != 49), // Custom Leveling
"Incorrect offset selected for leveling config"
);
static_assert(GRID_MAX_POINTS_X == GRID_MAX_POINTS_Y, "Assuming bed leveling points is square");
constexpr uint16_t VP_MESH_LEVEL_X0_Y0 = 0x1350;
constexpr uint16_t SP_MESH_LEVEL_X0_Y0 = 0x5000;
constexpr uint16_t MESH_LEVEL_EDGE_MAX_POINTS = 4;
constexpr uint16_t MESH_LEVEL_VP_SIZE = 0x4; // 4-byte native float
constexpr uint16_t MESH_LEVEL_SP_SIZE = 0x10; // 0x10 distance
constexpr uint16_t MESH_LEVEL_VP_EDGE_SIZE = MESH_LEVEL_VP_SIZE * MESH_LEVEL_EDGE_MAX_POINTS;
constexpr uint16_t MESH_LEVEL_SP_EDGE_SIZE = MESH_LEVEL_SP_SIZE * MESH_LEVEL_EDGE_MAX_POINTS;
constexpr uint16_t MESH_LEVEL_MAX_POINTS = MESH_LEVEL_EDGE_MAX_POINTS * MESH_LEVEL_EDGE_MAX_POINTS;
// Mesh inputs
constexpr uint16_t VP_MESH_INPUT_X0_Y0 = 0x2360;
#define MESH_INPUT_SUPPORTED_X_SIZE 4
#define MESH_INPUT_SUPPORTED_Y_SIZE 4
#define MESH_INPUT_SUPPORTED_SIZE 16
#define MESH_INPUT_DATA_SIZE 2 // 2 byte integer
// Color table: https://stackoverflow.com/q/13720937/646215
// Color picker: https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html
// Colors below were picked on bed leveling visualizer defaults
constexpr uint16_t MESH_COLOR_BELOW_ZERO = 0x899B; // Blue
constexpr uint16_t MESH_COLOR_NEAR_ZERO = 0x1C80; // Green
constexpr uint16_t MESH_COLOR_ABOVE_ZERO = 0xB800; // Purple
constexpr uint16_t MESH_COLOR_NOT_MEASURED = 0xFFFF; // White (becomes invisible on white background)
constexpr float MESH_NEAR_ZERO = 0.020;
constexpr float MESH_UNSET_EPSILON = 0.001;
// Mesh validation pattern
constexpr uint16_t VP_MESHPATTERN_NOZZLE_TEMP = 0x2313;
constexpr uint16_t VP_MESHPATTERN_BED_TEMP = 0x2315;
constexpr uint16_t VP_MESHPATTERN_START_BUTTON = 0x2317;
constexpr uint16_t VP_MESHPATTERN_BUTTON_ICON = 0x2319;
constexpr uint16_t VP_MESHPATTERN_NAV_BUTTON = 0x231B;
constexpr uint16_t MESHPATTERN_BUTTON_START = 24; // This icon does not exist, and will therefore not show
constexpr uint16_t MESHPATTERN_BUTTON_CANCEL = 25;
// Movement screen
constexpr uint16_t VP_X_POSITION = 0x1048;
constexpr uint16_t SP_X_POSITION = 0x4000;
constexpr uint16_t VP_Y_POSITION = 0x104A;
constexpr uint16_t SP_Y_POSITION = 0x4030;
constexpr uint16_t VP_Z_POSITION = 0x104C;
constexpr uint16_t VP_Z_POSITION_PRECISION = 0x108F;
constexpr uint16_t SP_Z_POSITION = 0x4060;
constexpr uint16_t VP_BUTTON_MOVEKEY = 0x1046;
// Buttons
constexpr uint16_t VP_ESTEP_NAV_BUTTON = 0x2291;
constexpr uint16_t VP_PIDTUNE_NAV_BUTTON = 0x2293;
constexpr uint16_t VP_GENERIC_BACK_BUTTON = 0x2295; // Generic button for popping back to the old display
constexpr uint16_t GENERIC_BACK_BUTTON_NEED_SAVE = 0x1;
// PID tuning
constexpr uint16_t VP_PIDTUNE_TARGET_TEMP = 0x2297;
constexpr uint16_t VP_PIDTUNE_CYCLES = 0x2299;
constexpr uint16_t VP_PIDTUNE_FAN_TOGGLE = 0x238C;
constexpr uint16_t VP_PIDTUNE_FAN_TOGGLE_ICON = 0x238E;
constexpr uint16_t VP_PIDTUNE_START_BUTTON = 0x229B;
// FWRetract
constexpr uint16_t VP_FWRETRACT_NAV_BUTTON = 0x22AD;
constexpr uint16_t VP_FWRETRACT_RETRACT_LENGTH = 0x22B1;
constexpr uint16_t VP_FWRETRACT_RETRACT_FEEDRATE = 0x22B3;
constexpr uint16_t VP_FWRETRACT_RETRACT_ZHOP = 0x22B5;
constexpr uint16_t VP_FWRETRACT_RESTART_LENGTH = 0x22B7;
constexpr uint16_t VP_FWRETRACT_RESTART_FEEDRATE = 0x22B9;
constexpr uint16_t VP_FWRETRACT_TOGGLE_BUTTON = 0x22BB;
constexpr uint16_t VP_FWRETRACT_TOGGLE_BUTTON_ICON = 0x22BD;
constexpr uint16_t VP_FWRETRACT_INDICATOR_ICON = 0x22BF;
// Other tuning
constexpr uint16_t VP_LINEAR_ADVANCE_FACTOR = 0x22AF;
constexpr uint16_t VP_OTHER_TUNE_NAV_BUTTON = 0x2382;
// Leveling settings
constexpr uint16_t VP_TOGGLE_PROBING_HEATERS_OFF_ONOFF_BUTTON = 0x22C1;
constexpr uint16_t VP_TOGGLE_PROBING_HEATERS_OFF_ONOFF_ICON = 0x22C3;
constexpr uint16_t VP_TOGGLE_PROBE_PREHEAT_HOTEND_TEMP = 0x22C5;
constexpr uint16_t VP_TOGGLE_PROBE_PREHEAT_BED_TEMP = 0x22C7;
constexpr uint16_t VP_TOGGLE_PROBE_SETTINGS_NAV_BUTTON = 0x22C9;
constexpr uint16_t VP_TOGGLE_POST_PROBING_TEMPERATURE_STABILIZATION_ICON = 0x22CD;
constexpr uint16_t VP_TOGGLE_POST_PROBING_TEMPERATURE_STABILIZATION_BUTTON = 0x22CF;
constexpr uint16_t VP_LEVELING_FADE_HEIGHT = 0x231D;
// E-steps calibration
constexpr uint16_t VP_ESTEPS_CURRENT = 0x229d;
constexpr uint16_t VP_ESTEPS_CALIBRATION_TEMP = 0x229f;
constexpr uint16_t VP_ESTEPS_CALIBRATION_LENGTH = 0x22a1;
constexpr uint16_t VP_ESTEPS_CALIBRATION_MARK_LENGTH = 0x22ab;
constexpr uint16_t VP_ESTEPS_CALIBRATION_LEFTOVER_LENGTH = 0x22a3;
constexpr uint16_t VP_ESTEPS_CALCULATED_ESTEPS = 0x22a5;
constexpr uint16_t VP_ESTEPS_CALIBRATESTART_BUTTON = 0x22a7;
constexpr uint16_t VP_ESTEPS_APPLY_BUTTON = 0x22a9;
constexpr uint16_t VP_ESTEPS_BACK_BUTTON = 0x22D7;
// RGB
constexpr uint16_t VP_RGB_NAV_BUTTON = 0x2390;
constexpr uint16_t VP_RGB_CONTROL_R = 0x2392;
constexpr uint16_t VP_RGB_CONTROL_G = 0x2394;
constexpr uint16_t VP_RGB_CONTROL_B = 0x2396;
constexpr uint16_t VP_RGB_CONTROL_W = 0x2398;
constexpr uint16_t VP_RGB_CONTROL_I = 0x239A; // brightness
constexpr uint16_t VP_RGB_NAV_BUTTON_ICON = 0x239E;
constexpr uint16_t ICON_RGB_SETTINGS_AVAILABLE = 28;
constexpr uint16_t ICON_RGB_SETTINGS_UNAVAILABLE = 29;
// Filament load/unload
constexpr uint16_t VP_FILCHANGE_NAV_BUTTON = 0x23a6;
constexpr uint16_t VP_FILCHANGE_NOZZLE_TEMP = 0x23a0;
constexpr uint16_t VP_FILCHANGE_LENGTH = 0x23a2;
constexpr uint16_t VP_FILCHANGE_ACTION_BUTTON = 0x23a4;
constexpr uint16_t FILCHANGE_ACTION_UNLOAD_BUTTON = 1;
constexpr uint16_t FILCHANGE_ACTION_LOAD_BUTTON = 2;
// Icons
constexpr uint16_t ICON_TOGGLE_ON = 1;
constexpr uint16_t ICON_TOGGLE_OFF = 2;
constexpr uint16_t ICON_BACK_BUTTON_ENABLED = 7;
constexpr uint16_t ICON_BACK_BUTTON_DISABLED = 8;
constexpr uint16_t ICON_THROBBER_ANIM_OFF = 0;
constexpr uint16_t ICON_THROBBER_ANIM_ON = 1;
// Allow to visually disable/enable the back button
constexpr uint16_t VP_BACK_BUTTON_STATE = 0x22D1;
// Throbber animation
constexpr uint16_t VP_BUSY_ANIM_STATE = 0x22D3;
// Toggles
constexpr uint16_t ICON_FAN_TOGGLE_ON = 1;
constexpr uint16_t ICON_FAN_TOGGLE_OFF = 2;
constexpr uint16_t ICON_LED_TOGGLE_ON = 3;
constexpr uint16_t ICON_LED_TOGGLE_OFF = 4;
constexpr uint16_t ICON_SOUND_TOGGLE_ON = 5;
constexpr uint16_t ICON_SOUND_TOGGLE_OFF = 6;
constexpr uint16_t ICON_FWRETRACT_AUTO_TOGGLE_ON = 9;
constexpr uint16_t ICON_FWRETRACT_AUTO_TOGGLE_OFF = 10;
constexpr uint16_t ICON_ACCURACY_TOGGLE_ON = 11;
constexpr uint16_t ICON_ACCURACY_TOGGLE_OFF = 12;
constexpr uint16_t ICON_POST_PROBE_TEMP_STABILIZATION_TOGGLE_ON = 13;
constexpr uint16_t ICON_POST_PROBE_TEMP_STABILIZATION_TOGGLE_OFF = 14;
constexpr uint16_t ICON_FWRETRACT_AUTO_DISENGAGED = 4; // This icon deliberately does not exist
constexpr uint16_t ICON_FWRETRACT_AUTO_ENGAGED = 3;
// Development helper
constexpr uint16_t VP_DEVELOPMENT_HELPER_BUTTON = 0x22D5;
constexpr uint16_t VP_DEVELOPMENT_HELPER_BUTTON_ACTION_FIRMWARE_UPDATE = 2;
constexpr uint16_t VP_DEVELOPMENT_HELPER_BUTTON_ACTION_TO_MAIN_MENU = 4;
constexpr uint16_t VP_DEVELOPMENT_HELPER_BUTTON_ACTION_RESET_DISPLAY = 8;
@@ -0,0 +1,188 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#include "../DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
#include "../DGUSScreenHandler.h"
#include "EstepsHandler.h"
#include "../../ui_api.h"
#include "../../../marlinui.h"
#include "../../../../module/temperature.h"
#include "../../../../module/settings.h"
#include "../../../../module/planner.h"
#include "../../../../gcode/gcode.h"
// Storage init
float EstepsHandler::set_esteps = 0;
float EstepsHandler::calculated_esteps = 0;
float EstepsHandler::remaining_filament = 0;
float EstepsHandler::mark_filament_mm = 0;
float EstepsHandler::filament_to_extrude = 0;
celsius_t EstepsHandler::calibration_temperature = 0;
void EstepsHandler::Init() {
// Use steps
set_esteps = ExtUI::getAxisSteps_per_mm(ExtUI::E0);
calculated_esteps = 0;
// Reset
filament_to_extrude = 100;
mark_filament_mm = 120;
remaining_filament = 0;
// Use configured PLA temps + 10 degrees
calibration_temperature = ui.material_preset[0].hotend_temp + 10;
// Welcome message
SetStatusMessage(PSTR("Ready"));
}
void EstepsHandler::HandleStartButton(DGUS_VP_Variable &var, void *val_ptr) {
//static_assert(ADVANCED_PAUSE_PURGE_LENGTH == 0, "Assuming PURGE_LENGTH is 0 so we can use M701");
// Validate
if (calibration_temperature < EXTRUDE_MINTEMP) {
SetStatusMessage(PSTR("Invalid temperature set"));
return;
}
if (filament_to_extrude < 10) {
SetStatusMessage(PSTR("Invalid extrusion length set"));
return;
}
if (mark_filament_mm < filament_to_extrude) {
SetStatusMessage(PSTR("Invalid mark length set"));
return;
}
// Synchronous operation - disable back button
DGUSSynchronousOperation syncOperation;
syncOperation.start();
// Prepare
bool zAxisWasRelative = GcodeSuite::axis_is_relative(Z_AXIS);
bool eAxisWasRelative = GcodeSuite::axis_is_relative(E_AXIS);
#if ENABLED(LIN_ADVANCE)
float kFactor = planner.extruder_advance_K[0];
#endif
GcodeSuite::set_e_relative();
GcodeSuite::set_relative_mode(true);
#if ENABLED(LIN_ADVANCE)
planner.extruder_advance_K[0] = 0;
#endif
ExtUI::injectCommands_P("G0 Z5 F150");
queue.advance();
// Heat up if necessary
if (abs(ExtUI::getActualTemp_celsius(ExtUI::E0) - calibration_temperature) > 2) {
thermalManager.setTargetHotend(calibration_temperature, ExtUI::H0);
SetStatusMessage(PSTR("Heating up..."));
thermalManager.wait_for_hotend(ExtUI::H0, false);
}
planner.synchronize();
// Set-up command
SetStatusMessage(PSTR("Extruding..."));
char cmd[64];
sprintf_P(cmd, PSTR("G1 E%f F50"), filament_to_extrude);
ExtUI::injectCommands(cmd);
queue.advance();
planner.synchronize();
// Restore position
ExtUI::injectCommands_P("G0 Z-5 F150");
queue.advance();
planner.synchronize();
// Restore defaults
if (!zAxisWasRelative) GcodeSuite::set_relative_mode(false);
if (!eAxisWasRelative) GcodeSuite::set_e_absolute();
#if ENABLED(LIN_ADVANCE)
planner.extruder_advance_K[0] = kFactor;
#endif
// Done
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_ESTEPS_CALIBRATION_RESULTS, false);
ScreenHandler.Buzzer(0, 250);
syncOperation.done();
SetStatusMessage(PSTR("Measure remaining filament"));
}
void EstepsHandler::HandleApplyButton(DGUS_VP_Variable &var, void *val_ptr) {
if (abs(calculated_esteps) < 1) {
// User intented to set e-steps directly
ExtUI::setAxisSteps_per_mm(set_esteps, ExtUI::E0);
} else {
ExtUI::setAxisSteps_per_mm(calculated_esteps, ExtUI::E0);
}
SaveSettingsAndReturn(true);
}
void EstepsHandler::HandleBackButton(DGUS_VP_Variable &var, void *val_ptr) {
// User intented to set e-steps directly
ExtUI::setAxisSteps_per_mm(set_esteps, ExtUI::E0);
SaveSettingsAndReturn(false);
}
void EstepsHandler::SaveSettingsAndReturn(bool fullConfirm) {
// Save & reset
settings.save();
if (fullConfirm) ScreenHandler.Buzzer(0, 250);
ScreenHandler.PopToOldScreen();
if (fullConfirm) ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN, false);
SetStatusMessage(PSTR("New e-steps value saved"));
}
void EstepsHandler::HandleRemainingFilament(DGUS_VP_Variable &var, void *val_ptr) {
ScreenHandler.DGUSLCD_SetFloatAsIntFromDisplay<1>(var, val_ptr);
// Calculate
constexpr float precision = 0.01;
float actualExtrusion = mark_filament_mm - remaining_filament;
if (actualExtrusion < (-precision)) {
SetStatusMessage(PSTR("Mark filament further"));
return;
}
if (actualExtrusion < precision) {
SetStatusMessage(PSTR("E-steps are correct"));
calculated_esteps = set_esteps;
return;
}
float current_steps = ExtUI::getAxisSteps_per_mm(ExtUI::E0);
SERIAL_ECHOLNPGM("Current steps: ", current_steps);
SERIAL_ECHOLNPGM("Actual extrusion: ", actualExtrusion);
float new_steps = (current_steps * filament_to_extrude) / actualExtrusion;
SERIAL_ECHOLNPGM("New steps: ", new_steps);
calculated_esteps = new_steps;
// Status update
SetStatusMessage(PSTR("Calculated new e-steps"));
}
void EstepsHandler::SetStatusMessage(PGM_P statusMessage) {
ScreenHandler.setstatusmessagePGM(statusMessage);
}
#endif
@@ -0,0 +1,29 @@
#pragma once
#include <cstdint>
class EstepsHandler {
public:
static void Init();
static void HandleStartButton(DGUS_VP_Variable &var, void *val_ptr);
static void HandleApplyButton(DGUS_VP_Variable &var, void *val_ptr);
static void HandleBackButton(DGUS_VP_Variable &var, void *val_ptr);
static void HandleRemainingFilament(DGUS_VP_Variable &var, void *val_ptr);
public:
static float set_esteps;
static float calculated_esteps;
static float mark_filament_mm;
static float remaining_filament;
static float filament_to_extrude;
static celsius_t calibration_temperature;
private:
static void SaveSettingsAndReturn(bool fullConfirm);
static void SetStatusMessage(PGM_P statusMessage);
};
@@ -0,0 +1,106 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#include "../DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
#include "../DGUSScreenHandler.h"
#include "FilamentLoadUnloadHandler.h"
#include "../../ui_api.h"
#include "../../../marlinui.h"
#include "../../../../module/temperature.h"
#include "../../../../module/settings.h"
#include "../../../../module/planner.h"
#include "../../../../gcode/gcode.h"
celsius_t FilamentLoadUnloadHandler::nozzle_temperature = 0;
float FilamentLoadUnloadHandler::length = 0;
void FilamentLoadUnloadHandler::Init() {
nozzle_temperature = ui.material_preset[0].hotend_temp;
length = 150;
if (ExtUI::isPrinting()) {
nozzle_temperature = ExtUI::getTargetTemp_celsius(ExtUI::extruder_t::E0);
}
}
void FilamentLoadUnloadHandler::HandleTemperature(DGUS_VP_Variable &var, void *val_ptr) {
ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>(var, val_ptr);
ValidateTemperatures();
}
void FilamentLoadUnloadHandler::HandleLoadUnloadButton(DGUS_VP_Variable &var, void *val_ptr) {
// Common for load/unload -> determine minimum temperature
if (length < 0.1) {
SetStatusMessage("Invalid feed length");
return;
}
if (ExtUI::isPrinting() && !ExtUI::isPrintingPaused()) {
SetStatusMessage(PSTR("Finish Printing First"));
return;
}
DGUSSynchronousOperation syncOperation;
uint16_t button_value = uInt16Value(val_ptr);
switch (button_value) {
case FILCHANGE_ACTION_LOAD_BUTTON:
syncOperation.start();
ChangeFilamentWithTemperature(PSTR("M701 L%f P0"));
syncOperation.done();
break;
case FILCHANGE_ACTION_UNLOAD_BUTTON:
syncOperation.start();
ChangeFilamentWithTemperature(PSTR("M702 U%f"));
syncOperation.done();
break;
}
}
void FilamentLoadUnloadHandler::ValidateTemperatures() {
LIMIT(nozzle_temperature, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT);
}
void FilamentLoadUnloadHandler::ChangeFilamentWithTemperature(PGM_P command) {
// Heat if necessary
if (ExtUI::getActualTemp_celsius(ExtUI::E0) < nozzle_temperature && abs(ExtUI::getActualTemp_celsius(ExtUI::E0) - nozzle_temperature) > THERMAL_PROTECTION_HYSTERESIS) {
SetStatusMessage(PSTR("Heating up..."));
uint16_t target_celsius = nozzle_temperature;
NOMORE(target_celsius, thermalManager.hotend_max_target(0));
thermalManager.setTargetHotend(target_celsius, ExtUI::H0);
thermalManager.wait_for_hotend(ExtUI::H0, false);
}
// Inject load filament command
SetStatusMessage(PSTR("Filament load/unload..."));
char cmd[64];
sprintf_P(cmd, command, length);
// Handle commands
SERIAL_ECHOPGM("Injecting command: ", cmd);
GcodeSuite::process_subcommands_now(cmd);
SERIAL_ECHOPGM_P("- done");
if (ScreenHandler.Settings.display_sound) ScreenHandler.Buzzer(500, 100);
SetStatusMessage(PSTR("Filament load/unload complete"));
}
void FilamentLoadUnloadHandler::SetStatusMessage(PGM_P statusMessage) {
ScreenHandler.setstatusmessagePGM(statusMessage);
}
#endif
@@ -0,0 +1,22 @@
#pragma once
#include <cstdint>
class FilamentLoadUnloadHandler {
public:
static void Init();
static void HandleTemperature(DGUS_VP_Variable &var, void *val_ptr);
static void HandleLoadUnloadButton(DGUS_VP_Variable &var, void *val_ptr);
public:
static celsius_t nozzle_temperature;
static float length;
private:
static void ValidateTemperatures();
static void ChangeFilamentWithTemperature(PGM_P command);
static void SetStatusMessage(PGM_P statusMessage);
};
@@ -0,0 +1,150 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH) && HAS_MESH
#include "../DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
#include "../DGUSScreenHandler.h"
#include "MeshValidationHandler.h"
#include "../../ui_api.h"
#include "../../../marlinui.h"
#include "../../../../module/temperature.h"
#include "../../../../module/settings.h"
#include "../../../../module/planner.h"
#include "../../../../gcode/gcode.h"
celsius_t MeshValidationHandler::nozzle_temperature;
celsius_t MeshValidationHandler::bed_temperature;
bool MeshValidationHandler::is_running;
bool MeshValidationHandler::started_from_screen;
bool MeshValidationHandler::is_cancelling;
feedRate_t MeshValidationHandler::prev_feedrate;
void MeshValidationHandler::Init() {
// Set to PLA pre-heat temps by default
nozzle_temperature = ui.material_preset[0].hotend_temp;
bed_temperature = ui.material_preset[0].bed_temp;
ValidateTemperatures();
}
void MeshValidationHandler::HandleTemperature(DGUS_VP_Variable &var, void *val_ptr) {
ScreenHandler.DGUSLCD_SetValueDirectly<uint16_t>(var, val_ptr);
ValidateTemperatures();
}
void MeshValidationHandler::HandleStartOrCancelButton(DGUS_VP_Variable &var, void *val_ptr) {
if (!is_running) {
Start();
} else {
Cancel();
}
}
void MeshValidationHandler::Start() {
if (is_running) return;
// Validate
if (!ExtUI::getMeshValid()) {
SetStatusMessage("Please level bed first");
return;
}
// Block
ScreenHandler.SetSynchronousOperationStart();
is_running = true;
started_from_screen = true;
// Home if necessary - do this synchronously
if (!all_axes_trusted()) {
queue.inject_P("G28 U0");
queue.advance();
}
// Home X and Y so we droop at the side of the bed.
// G26 with temperature and set for full bed, full pattern, retract 4mm, prime 5mm
char gcodeBuffer[128] = {0};
sprintf_P(gcodeBuffer, PSTR("G90\nG0 X0\nG26 B%d H%d R Q4 P2 X0 Y0"), bed_temperature, nozzle_temperature);
queue.inject(gcodeBuffer);
queue.advance();
// Set feedrate
prev_feedrate = ExtUI::getFeedrate_mm_s();
ExtUI::setFeedrate_mm_s(MESH_VALIDATION_PATTERN_FEEDRATE);
SetStatusMessage("Starting...");
}
void MeshValidationHandler::Cancel() {
if (is_cancelling) return;
is_cancelling = true;
ExtUI::simulateUserClick();
SetStatusMessage("Cancelling...");
}
void MeshValidationHandler::OnMeshValidationStart() {
// Note: can also be called when manually invoking G26
if (ScreenHandler.getCurrentScreen() != DGUSLCD_SCREEN_MESH_VALIDATION) {
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MESH_VALIDATION);
}
// Set state
ScreenHandler.SetSynchronousOperationStart();
is_running = true;
}
void MeshValidationHandler::OnMeshValidationFinish() {
// If invoked externally, pop back
if (!started_from_screen) {
ScreenHandler.PopToOldScreen();
}
if (started_from_screen) {
ExtUI::setFeedrate_mm_s(prev_feedrate);
char gcodeBuffer[128] = {0};
if (!is_cancelling) {
// Present
// - Set absolute mode
// - Present bed, high Z
// - Disable stepper
strcpy_P(gcodeBuffer, PSTR("M84"));
SetStatusMessage("Mesh validation pattern printed");
} else {
// Park and disable steppers
strcpy_P(gcodeBuffer, PSTR("G0 X5 F2000\nG27\nM84"));
SetStatusMessage("Canceled mesh validation pattern");
}
// Enqueue
gcode.process_subcommands_now(gcodeBuffer);
}
// Reset state
is_running = false;
started_from_screen = false;
is_cancelling = false;
ScreenHandler.SetSynchronousOperationFinish();
ExtUI::simulateUserClick();
}
void MeshValidationHandler::ValidateTemperatures() {
LIMIT(nozzle_temperature, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - HOTEND_OVERSHOOT);
LIMIT(bed_temperature, 40 /*Hardcoded minimum for G26, apparently*/, BED_MAXTEMP - BED_OVERSHOOT);
}
void MeshValidationHandler::SetStatusMessage(PGM_P statusMessage) {
ScreenHandler.setstatusmessagePGM(statusMessage);
}
#endif
@@ -0,0 +1,33 @@
#include <cstdint>
#if HAS_MESH
class MeshValidationHandler {
public:
static void Init();
static void HandleTemperature(DGUS_VP_Variable &var, void *val_ptr);
static void HandleStartOrCancelButton(DGUS_VP_Variable &var, void *val_ptr);
static void OnMeshValidationStart();
static void OnMeshValidationFinish();
public:
static celsius_t nozzle_temperature;
static celsius_t bed_temperature;
static feedRate_t prev_feedrate;
static bool is_cancelling;
static bool is_running;
static bool started_from_screen;
private:
static void Start();
static void Cancel();
static void ValidateTemperatures();
static void SetStatusMessage(PGM_P statusMessage);
};
constexpr feedRate_t MESH_VALIDATION_PATTERN_FEEDRATE = G26_XY_FEEDRATE;
#endif
@@ -0,0 +1,91 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#include "../DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
#include "../DGUSScreenHandler.h"
#include "PIDHandler.h"
#include "../../ui_api.h"
#include "../../../marlinui.h"
#include "../../../../module/temperature.h"
#include "../../../../module/settings.h"
#include "../../../../module/planner.h"
#include "../../../../gcode/gcode.h"
// Storage init
uint16_t PIDHandler::cycles = 0;
celsius_t PIDHandler::calibration_temperature = 0;
bool PIDHandler::fan_on = false;
PGM_P PIDHandler::result_message = nullptr;
void PIDHandler::Init() {
// Reset
cycles = 3;
fan_on = ExtUI::getTargetFan_percent(ExtUI::fan_t::FAN0) > 10;
// Use configured PLA temps + 10 degrees
calibration_temperature = ui.material_preset[0].hotend_temp + 15;
// Welcome message
SetStatusMessage(PSTR("Ready"));
}
void PIDHandler::HandleStartButton(DGUS_VP_Variable &var, void *val_ptr) {
//static_assert(ADVANCED_PAUSE_PURGE_LENGTH == 0, "Assuming PURGE_LENGTH is 0 so we can use M701");
// Validate
if (calibration_temperature < EXTRUDE_MINTEMP) {
SetStatusMessage(PSTR("Invalid temperature set"));
return;
}
if (calibration_temperature > HEATER_0_MAXTEMP) {
SetStatusMessage(PSTR("Invalid temperature set"));
return;
}
if (cycles < 1) {
SetStatusMessage(PSTR("Invalid number of cycles"));
return;
}
// Synchronous operation - disable back button
DGUSSynchronousOperation syncOperation;
syncOperation.start();
// Fan
const auto prev_fan_percentage = ExtUI::getActualFan_percent(ExtUI::fan_t::FAN0);
const uint8_t fan_speed = fan_on ? 255 : 0;
// Set-up command
SetStatusMessage(PSTR("PID tuning. Please wait..."));
char cmd[64]; // Add a G4 to allow the fan speed to take effect
sprintf_P(cmd, PSTR("M106 S%d\nG4 S2\nM303 S%d C%d U1"), fan_speed, calibration_temperature, cycles);
SERIAL_ECHOLNPGM("Executing: ", cmd);
ExtUI::injectCommands(cmd);
while (queue.has_commands_queued()) queue.advance();
// Done
ExtUI::setTargetFan_percent(prev_fan_percentage, ExtUI::fan_t::FAN0);
ScreenHandler.Buzzer(0, 250);
settings.save();
syncOperation.done();
SetStatusMessage(result_message);
}
void PIDHandler::SetStatusMessage(PGM_P statusMessage) {
ScreenHandler.setstatusmessagePGM(statusMessage);
}
#endif
@@ -0,0 +1,21 @@
#pragma once
#include <cstdint>
class PIDHandler {
public:
static void Init();
static void HandleStartButton(DGUS_VP_Variable &var, void *val_ptr);
public:
static uint16_t cycles;
static celsius_t calibration_temperature;
static bool fan_on;
static PGM_P result_message;
private:
static void SetStatusMessage(PGM_P statusMessage);
};
@@ -0,0 +1,470 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#include "../DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
#include "../DGUSScreenHandler.h"
#include "../../../../module/temperature.h"
#include "../../../../module/motion.h"
#include "../../../../module/planner.h"
#include "../../../../feature/pause.h"
#include "../../../../gcode/gcode.h"
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#include "../../../../feature/runout.h"
#endif
#include "../../../../module/settings.h"
#include "../../ui_api.h"
#include "../../../marlinui.h"
#include "PageHandlers.h"
// Definitions of page handlers
void MainMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_MAINENTERKEY:
switch (buttonValue) {
case 1:
// Try to mount an unmounted card (BTT SKR board has especially some trouble sometimes)
card.mount();
ScreenHandler.SDCardInserted();
break;
case 2:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PREPARE);
break;
case 3:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SETUP);
break;
case 4:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_CALIBRATE);
break;
}
break;
}
}
void SetupMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_PREPAREENTERKEY:
switch(buttonValue) {
case 5: // About
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_INFO);
break;
case 7: // Reset to factory settings
settings.reset();
settings.save();
ExtUI::injectCommands_P(PSTR("M300"));
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN, false);
ScreenHandler.setstatusmessagePGM(PSTR("Restored default settings. Please turn your printer off and then on to complete the reset"));
break;
}
break;
case VP_BUTTON_TEMPCONTROL:
if (buttonValue == 2) ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TEMP);
break;
case VP_BUTTON_ADJUSTENTERKEY:
ScreenHandler.HandleLEDToggle();
break;
}
}
#if HAS_MESH
void LevelingModeHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_BEDLEVELKEY:
switch (buttonValue) {
case 1:
queue.enqueue_one("G28 U0");
queue.enqueue_one("G0 Z0");
break;
case 2:
// Increase Z-offset
ExtUI::smartAdjustAxis_steps(ExtUI::mmToWholeSteps(0.01, ExtUI::axis_t::Z), ExtUI::axis_t::Z, true);;
ScreenHandler.ForceCompleteUpdate();
ScreenHandler.RequestSaveSettings();
break;
case 3:
// Decrease Z-offset
ExtUI::smartAdjustAxis_steps(ExtUI::mmToWholeSteps(-0.01, ExtUI::axis_t::Z), ExtUI::axis_t::Z, true);;
ScreenHandler.ForceCompleteUpdate();
ScreenHandler.RequestSaveSettings();
break;
}
break;
case VP_BUTTON_PREPAREENTERKEY:
if (buttonValue == 9) {
#if DISABLED(HOTEND_IDLE_TIMEOUT)
thermalManager.disable_all_heaters();
#endif
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN, false);
}
if (buttonValue == 1) {
// TODO: set state for "view leveling mesh"
ScreenHandler.SetViewMeshLevelState();
ScreenHandler.InitMeshValues();
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_LEVELING);
}
break;
case VP_BUTTON_MAINENTERKEY:
// Go to leveling screen
ExtUI::injectCommands_P("G28 U0\nG29 U0");
ScreenHandler.ResetMeshValues();
dgusdisplay.WriteVariable(VP_MESH_SCREEN_MESSAGE_ICON, static_cast<uint16_t>(MESH_SCREEN_MESSAGE_ICON_LEVELING));
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_LEVELING);
break;
}
}
void LevelingHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_BEDLEVELKEY:
const bool busy = TERN0(HOST_KEEPALIVE_FEATURE, ((ExtUI::getHostKeepaliveState() == GcodeSuite::MarlinBusyState::IN_PROCESS) || (ExtUI::getHostKeepaliveState() == GcodeSuite::MarlinBusyState::IN_HANDLER)));
if (!busy) {
ScreenHandler.PopToOldScreen();
} else {
ScreenHandler.setstatusmessagePGM("Wait for leveling completion...");
}
break;
}
}
#endif
void TempMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_ADJUSTENTERKEY:
switch (buttonValue) {
case 3:
ScreenHandler.HandleFanToggle();
break;
}
break;
case VP_BUTTON_TEMPCONTROL:
switch (buttonValue){
case 3:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TEMP_PLA);
break;
case 4:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TEMP_ABS);
break;
}
break;
}
}
void PrepareMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_PREPAREENTERKEY:
switch (buttonValue){
case 3:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MOVE10MM);
break;
case 6:
// Disable steppers
ScreenHandler.HandleMotorLockUnlock(var, &buttonValue);
break;
}
break;
case VP_BUTTON_HEATLOADSTARTKEY:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_FEED);
break;
case VP_BUTTON_COOLDOWN:
ScreenHandler.HandleAllHeatersOff(var, &buttonValue);
break;
case VP_BUTTON_TEMPCONTROL:
switch (buttonValue) {
case 5:
thermalManager.setTargetHotend(ui.material_preset[0].hotend_temp, 0);
thermalManager.setTargetBed(ui.material_preset[0].bed_temp);
break;
case 6:
thermalManager.setTargetHotend(ui.material_preset[1].hotend_temp, 0);
thermalManager.setTargetBed(ui.material_preset[1].bed_temp);
break;
}
break;
}
ScreenHandler.ForceCompleteUpdate();
}
void TuneMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_BEDLEVELKEY:
switch (buttonValue) {
case 2:
// Increase Z-offset
ExtUI::smartAdjustAxis_steps(ExtUI::mmToWholeSteps(0.01, ExtUI::axis_t::Z), ExtUI::axis_t::Z, true);;
ScreenHandler.ForceCompleteUpdate();
ScreenHandler.RequestSaveSettings();
break;
case 3:
// Decrease Z-offset
ExtUI::smartAdjustAxis_steps(ExtUI::mmToWholeSteps(-0.01, ExtUI::axis_t::Z), ExtUI::axis_t::Z, true);;
ScreenHandler.ForceCompleteUpdate();
ScreenHandler.RequestSaveSettings();
break;
}
break;
case VP_BUTTON_ADJUSTENTERKEY:
switch (buttonValue) {
case 2:
ScreenHandler.GotoScreen(ExtUI::isPrintingPaused() ? DGUSLCD_SCREEN_PRINT_PAUSED : DGUSLCD_SCREEN_PRINT_RUNNING, false);
break;
case 3:
ScreenHandler.HandleFanToggle();
break;
case 4:
ScreenHandler.HandleLEDToggle();
break;
}
}
}
void PrintRunningMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_ADJUSTENTERKEY:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TUNING);
break;
case VP_BUTTON_PAUSEPRINTKEY:
if (!ScreenHandler.HandlePendingUserConfirmation() && ExtUI::isPrintingPaused()) {
ExtUI::resumePrint();
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
} else
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_DIALOG_PAUSE);
break;
case VP_BUTTON_STOPPRINTKEY:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_DIALOG_STOP);
break;
}
}
void PrintPausedMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP) {
case VP_BUTTON_RESUMEPRINTKEY:
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
runout.reset();
#endif
if (!ScreenHandler.HandlePendingUserConfirmation()) {
ExtUI::resumePrint();
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
}
break;
case VP_BUTTON_ADJUSTENTERKEY:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_TUNING);
break;
case VP_BUTTON_STOPPRINTKEY:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_DIALOG_STOP);
break;
}
}
void PrintPauseDialogHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP){
case VP_BUTTON_PAUSEPRINTKEY:
switch (buttonValue) {
case 2:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
ScreenHandler.setstatusmessagePGM(PSTR("Pausing print - please wait..."));
ExtUI::pausePrint();
break;
case 3:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
break;
}
break;
}
}
void PrintFinishMenuHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP){
case VP_BUTTON_MAINENTERKEY:
switch (buttonValue) {
case 5:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
break;
}
break;
}
}
void FilamentRunoutHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP){
case VP_BUTTON_RESUMEPRINTKEY:
ExtUI::resumePrint();
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
break;
case VP_BUTTON_STOPPRINTKEY:
ExtUI::stopPrint();
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
break;
}
}
void StopConfirmScreenHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP){
case VP_BUTTON_STOPPRINTKEY:
switch (buttonValue) {
case 2:
ExtUI::stopPrint();
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
break;
case 3:
ScreenHandler.GotoScreen(ExtUI::isPrintingPaused() ? DGUSLCD_SCREEN_PRINT_PAUSED : DGUSLCD_SCREEN_PRINT_RUNNING);
break;
}
break;
}
}
void PreheatSettingsScreenHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
switch (var.VP){
case VP_BUTTON_PREPAREENTERKEY:
// Save button, save settings and go back
ScreenHandler.RequestSaveSettings();
ScreenHandler.PopToOldScreen();
break;
case VP_BUTTON_COOLDOWN: // You can't make this up
// Back button, discard settings
settings.load();
ScreenHandler.PopToOldScreen();
break;
}
}
void MoveHandler(DGUS_VP_Variable &var, unsigned short buttonValue) {
if (var.VP == VP_BUTTON_MOVEKEY) {
switch (buttonValue) {
case 1:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MOVE10MM, false);
break;
case 2:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MOVE1MM, false);
break;
case 3:
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MOVE01MM, false);
break;
case 4:
// Temporary copy probe settings so we home without preheating, then restore setings afterward
//This machine should never home Z cold...
//auto prev_probe_settings = probe.settings;
//probe.settings.preheat_bed_temp = 0;
//probe.settings.preheat_hotend_temp = 0;
//probe.settings.stabilize_temperatures_after_probing = false;
ExtUI::injectCommands_P("G28");
while (queue.has_commands_queued()) queue.advance();
// ... Restore settings
//probe.settings = prev_probe_settings;
break;
}
}
}
// Register the page handlers
#define PAGE_HANDLER(SCRID, HDLRPTR) { .ScreenID=SCRID, .Handler=HDLRPTR },
const struct PageHandler PageHandlers[] PROGMEM = {
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_MAIN, MainMenuHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_SETUP, SetupMenuHandler)
#if HAS_MESH
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_ZOFFSET_LEVEL, LevelingModeHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_LEVELING, LevelingHandler)
#endif
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_TEMP, TempMenuHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_TEMP_PLA, PreheatSettingsScreenHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_TEMP_ABS, PreheatSettingsScreenHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_TUNING, TuneMenuHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_MOVE01MM, MoveHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_MOVE1MM, MoveHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_MOVE10MM, MoveHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_FILAMENTRUNOUT1, FilamentRunoutHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_FILAMENTRUNOUT2, FilamentRunoutHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_DIALOG_STOP, StopConfirmScreenHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_PRINT_RUNNING, PrintRunningMenuHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_PRINT_PAUSED, PrintPausedMenuHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_PRINT_FINISH, PrintFinishMenuHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_DIALOG_PAUSE, PrintPauseDialogHandler)
PAGE_HANDLER(DGUSLCD_Screens::DGUSLCD_SCREEN_PREPARE, PrepareMenuHandler)
// Terminating
PAGE_HANDLER(static_cast<DGUSLCD_Screens>(0) ,0)
};
void DGUSCrealityDisplay_HandleReturnKeyEvent(DGUS_VP_Variable &var, void *val_ptr) {
const struct PageHandler *map = PageHandlers;
const uint16_t *ret;
const DGUSLCD_Screens current_screen = DGUSScreenHandler::getCurrentScreen();
while ((ret = (uint16_t*) pgm_read_ptr(&(map->Handler)))) {
if ((map->ScreenID) == current_screen) {
uint16_t button_value = uInt16Value(val_ptr);
SERIAL_ECHOLNPGM("Invoking handler for screen ", current_screen);
SERIAL_ECHOLNPGM("with VP=", var.VP, " value=", button_value);
map->Handler(var, button_value);
return;
}
map++;
}
}
#endif
@@ -0,0 +1,11 @@
#pragma once
// Mapping of handlers per page. This construction is necessary because the CR-6 touch screen re-uses the same button IDs all over the place.
typedef void (*DGUS_CREALITY_SCREEN_BUTTON_HANDLER)(DGUS_VP_Variable &var, unsigned short buttonValue);
struct PageHandler {
DGUSLCD_Screens ScreenID;
DGUS_CREALITY_SCREEN_BUTTON_HANDLER Handler;
};
void DGUSCrealityDisplay_HandleReturnKeyEvent(DGUS_VP_Variable &var, void *val_ptr);
+267
View File
@@ -0,0 +1,267 @@
/**
* 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/>.
*
*/
/**
* dgus_creality_lcd.cpp
*
* DGUS implementation written by coldtobi in 2019 for Marlin
*/
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_CREALITY_TOUCH)
#include "ui_api.h"
#include "../marlinui.h"
#include "./dgus_creality/DGUSDisplay.h"
#include "./dgus_creality/DGUSDisplayDef.h"
#include "./dgus_creality/DGUSScreenHandler.h"
#include "./dgus_creality/creality_touch/PIDHandler.h"
#include "./dgus_creality/creality_touch/MeshValidationHandler.h"
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../feature/powerloss.h"
#endif
extern const char NUL_STR[];
namespace ExtUI {
void onStartup() {
ScreenHandler.Init();
ScreenHandler.UpdateScreenVPData();
}
void onIdle() { ScreenHandler.loop(); }
void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
ScreenHandler.sendinfoscreen(GET_TEXT_F(MSG_HALTED), error, GET_TEXT_F(MSG_PLEASE_RESET), GET_TEXT_F(MSG_PLEASE_RESET), true, true, true, true);
if (error == GET_TEXT_F(MSG_ERR_MAXTEMP) || error == GET_TEXT_F(MSG_THERMAL_RUNAWAY)) {
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_THERMAL_RUNAWAY);
} else if ( error == GET_TEXT_F(MSG_HEATING_FAILED_LCD)) {
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_HEATING_FAILED);
}else if (error == GET_TEXT_F(MSG_ERR_MINTEMP)) {
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_THERMISTOR_ERROR);
} else {
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL);
}
ScreenHandler.KillScreenCalled();
while (!ScreenHandler.loop()); // Wait while anything is left to be sent
}
void onMediaInserted() { TERN_(SDSUPPORT, ScreenHandler.SDCardInserted()); }
void onMediaError() { TERN_(SDSUPPORT, ScreenHandler.SDCardError()); }
void onMediaRemoved() { TERN_(SDSUPPORT, ScreenHandler.SDCardRemoved()); }
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_FEED) {
// We're in the feed (load filament) workflow - no beep - there is no confirmation
return;
}
ScreenHandler.Buzzer(frequency, duration);
}
bool hasPrintTimer = false;
void onPrintTimerStarted() {
hasPrintTimer = true;
if (!IS_SD_FILE_OPEN() && !(PrintJobRecovery::valid() && PrintJobRecovery::exists())) {
ScreenHandler.SetPrintingFromHost();
}
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
ui.progress_reset();
#endif
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_RUNNING);
}
void onPrintTimerPaused() {
// Handle M28 Pause SD print - But only if we're not waiting on a user
if (ExtUI::isPrintingFromMediaPaused() && ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_PRINT_RUNNING && !ExtUI::awaitingUserConfirm()) {
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_PAUSED);
}
}
void onPrintTimerStopped() {
hasPrintTimer = false;
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_FINISH);
}
void onFilamentRunout(const extruder_t extruder) {
// Only navigate to filament runout screen when we don't use M600 for changing the filament - otherwise it gets confusing for the user
#ifndef FILAMENT_RUNOUT_SCRIPT
#define FILAMENT_RUNOUT_SCRIPT "M25"
#endif
if (strcmp_P(FILAMENT_RUNOUT_SCRIPT, PSTR("M600")) != 0) {
ScreenHandler.FilamentRunout();
}
}
void onUserConfirmed() {
SERIAL_ECHOLN("User confirmation invoked");
setPauseMenuResponse(PAUSE_RESPONSE_RESUME_PRINT);
ExtUI::setUserConfirmed();
}
void onUserConfirmRequired(const char * const msg) {
//if (msg) {
SERIAL_ECHOLNPGM("User confirmation requested: ", msg);
if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_FEED) {
// We're in the feed (load filament) workflow - immediately assume confirmed
onUserConfirmed();
return;
}
ScreenHandler.setstatusmessagePGM(msg);
ScreenHandler.sendinfoscreen("Confirmation required", msg, NUL_STR, "Ok", true, true, false, true);
if (ExtUI::isPrinting()) {
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_PRINT_PAUSED);
} else {
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POPUP);
}
//}
//else if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_POPUP) {
// DEBUG_ECHOLNPAIR("User confirmation canceled");
// ScreenHandler.setstatusmessagePGM(nullptr);
// ScreenHandler.PopToOldScreen();
//}
}
void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); }
void onFactoryReset() {
ScreenHandler.OnFactoryReset();
}
void onHomingStart() {
ScreenHandler.OnHomingStart();
}
void onHomingDone() {
ScreenHandler.OnHomingComplete();
}
void onPrintDone() {
ScreenHandler.OnPrintFinished();
}
void onStoreSettings(char *buff) {
ScreenHandler.StoreSettings(buff);
}
void onLoadSettings(const char *buff) {
ScreenHandler.LoadSettings(buff);
}
void onPostprocessSettings() {
// Called after loading or resetting stored settings
}
void onSettingsStored(bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}
void onSettingsLoaded(bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
#if HAS_MESH
void onLevelingStart() {
#if HAS_BED_PROBE
ScreenHandler.OnMeshLevelingStart();
#endif
}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
ScreenHandler.OnMeshLevelingUpdate(xpos, ypos, zval);
}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {
ScreenHandler.OnMeshLevelingUpdate(xpos, ypos, 0);
}
void onLevelingDone() {
}
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLossResume() {
// Called on resume from power-loss
ScreenHandler.OnPowerlossResume();
}
#endif
#if HAS_PID_HEATING
void onPidTuning(const result_t rst) {
// Called for temperature PID tuning result
switch (rst) {
case PID_BAD_HEATER_ID:
PIDHandler::result_message = GET_TEXT(MSG_PID_BAD_HEATER_ID);
ScreenHandler.setstatusmessagePGM(PIDHandler::result_message);
break;
case PID_TEMP_TOO_HIGH:
PIDHandler::result_message = GET_TEXT(MSG_PID_TEMP_TOO_HIGH);
ScreenHandler.setstatusmessagePGM(PIDHandler::result_message);
break;
case PID_TUNING_TIMEOUT:
PIDHandler::result_message = GET_TEXT(MSG_PID_TIMEOUT);
ScreenHandler.setstatusmessagePGM(PIDHandler::result_message);
break;
case PID_DONE:
PIDHandler::result_message = GET_TEXT(MSG_PID_AUTOTUNE_DONE);
ScreenHandler.setstatusmessagePGM(PIDHandler::result_message);
break;
default:
break;
}
}
#endif
void onSteppersDisabled() {
}
void onSteppersEnabled() {
}
#if HAS_MESH
void onMeshValidationStarting() {
MeshValidationHandler::OnMeshValidationStart();
}
void onMeshValidationFinished() {
MeshValidationHandler::OnMeshValidationFinish();
}
#endif
}
#endif // HAS_DGUS_LCD
@@ -34,14 +34,13 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) {
w.heading( GET_TEXT_F(MSG_FILAMENT));
w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled());
#if HAS_FILAMENT_RUNOUT_DISTANCE
w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM));
w.units(GET_TEXT_F(MSG_UNITS_MM));
w.precision(0);
w.color(e_axis);
w.adjuster( 10, FPSTR(NUL_STR), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled());
w.increments();
#endif
w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM));
w.units(GET_TEXT_F(MSG_UNITS_MM));
w.precision(0);
w.color(e_axis);
w.adjuster( 10, FPSTR(NUL_STR), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled());
w.increments();
}
bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) {
@@ -49,10 +48,8 @@ bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) {
const float increment = getIncrement();
switch (tag) {
case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break;
#if HAS_FILAMENT_RUNOUT_DISTANCE
case 10: UI_DECREMENT(FilamentRunoutDistance_mm); break;
case 11: UI_INCREMENT(FilamentRunoutDistance_mm); break;
#endif
case 10: UI_DECREMENT(FilamentRunoutDistance_mm); break;
case 11: UI_INCREMENT(FilamentRunoutDistance_mm); break;
default:
return false;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,294 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/* ****************************************
* lcd/extui/lib/Creality/Creality_DWIN.h
* ****************************************
* Extensible_UI implementation for Creality DWIN
* 10SPro, Max, CRX, and others
* Based original Creality release, ported to ExtUI for Marlin 2.0
* Written by Insanity Automation, sponsored by Tiny Machines 3D
*
* ***************************************/
#pragma once
#include "string.h"
#include <Arduino.h>
#include "../ui_api.h"
#if ENABLED(EXTENSIBLE_UI)
namespace ExtUI {
/*********************************/
#define FHONE (0x5A)
#define FHTWO (0xA5)
#define FHLENG (0x06)
#define TEXTBYTELEN 18
#define MaxFileNumber 20// 16
#define CEIconGrap 12
#define FileNum MaxFileNumber
#define FileNameLen TEXTBYTELEN
#define SizeofDatabuf 46
/*************Register and Variable addr*****************/
#define RegAddr_W 0x80
#define RegAddr_R 0x81
#define VarAddr_W 0x82
#define VarAddr_R 0x83
#define ExchangePageBase (unsigned long)0x5A010000 //the first page ID. other page = first page ID + relevant num;
#define StartSoundSet ((unsigned long)0x060480A0) // 06,start-music; 04, 4 musics; 80, the volume value; 04, return value about music number.
#define FONT_EEPROM 90
#define AutoLeve_EEPROM 100
#define FanOn 255
#define FanOff 0
/*variable addr*/
#define ExchangepageAddr 0x0084
#define SoundAddr 0x00A0
#define StartIcon 0x1000
#define FeedrateDisplay 0x1006 // Speed
#define Stopprint 0x1008
#define Pauseprint 0x100A
#define Resumeprint 0x100C
#define PrintscheduleIcon 0x100E
#define Timehour 0x1010
#define Timemin 0x1012
#define IconPrintstatus 0x1014
#define Percentage 0x1016
#define FanKeyIcon 0x101E
#define Flowrate 0x1300
#define RunoutToggle 0x1018
#define PowerLossToggle 0x101A
#define LedToggle 0x101C
#define StepMM_X 0x1242
#define StepMM_Y 0x1246
#define StepMM_Z 0x124A
#define StepMM_E 0x124E
#define ProbeOffset_X 0x1236
#define ProbeOffset_Y 0x123A
#define ProbeOffset_Z 0x1026
#define T2Offset_X 0x1090
#define T2Offset_Y 0x1094
#define T2Offset_Z 0x1098
#define T2StepMM_E 0x109C
#define ActiveToolVP 0x1014
#define HotendPID_AutoTmp 0x1252
#define BedPID_AutoTmp 0x1254
#define HotendPID_P 0x1256
#define HotendPID_I 0x125A
#define HotendPID_D 0x125E
#define BedPID_P 0x1262
#define BedPID_I 0x1266
#define BedPID_D 0x126A
#define Jerk_X 0x1270
#define Jerk_Y 0x1272
#define Jerk_Z 0x1274
#define Jerk_E 0x1276
#define Feed_X 0x1278
#define Feed_Y 0x127A
#define Feed_Z 0x127C
#define Feed_E 0x127E
#define Accel_X 0x1280
#define Accel_Y 0x1282
#define Accel_Z 0x1284
#define Accel_E 0x1286
#define HeatPercentIcon 0x1024
#define NzBdSet 0x1032 // cooldown Hotend and Bed
#define NozzlePreheat 0x1034 // setpoint
#define NozzleTemp 0x1036 // Actual
#define BedPreheat 0x103A // Setpoint
#define Bedtemp 0x103C // Actual
#define e2Temp 0x1050
#define e2Preheat 0x104E
#define AutoZeroIcon 0x1042
#define AutoLevelIcon 0x1045
#define AutoZero 0x1046
#define DisplayXaxis 0x1048
#define DisplayYaxis 0x104A
#define DisplayZaxis 0x104C
#define FilementUnit1 0x1054
#define Exchfilement 0x1056
#define FilementUnit2 0x1058
#define MacVersion 0x1060
#define SoftVersion 0x106A
#define PrinterSize 0x1074
#define CorpWebsite 0x107E
#define VolumeIcon 0x108A
#define SoundIcon 0x108C
#define AutolevelIcon 0x108D
#define ExchFlmntIcon 0x108E
#define AutolevelVal 0x1100
#define FilenameIcon 0x1200
#define FilenameIcon1 0x1220
#define Printfilename 0x2000
#define FilesCurentPage 0x1310
#define FilesMaxPage 0x1312
#define SDFILE_ADDR 0x200A
#define FilenamePlay 0x20D2
#define FilenameChs 0x20D3
#define Choosefilename 0x20D4
#define FilenameCount 0x20DE
#define FilenameNature 0x6003
#define VolumeDisplay 0x1140
#define DisplayBrightness 0x1142
#define DisplayStandbyBrightness 0x1144
#define DisplayStandbyEnableIndicator 0x1146
#define DisplayStandbySeconds 0x1148
#define StatusMessageString 0x2064
#if defined(TARGET_STM32F4)
#define DWIN_SERIAL Serial1
#else
#define DWIN_SERIAL LCD_SERIAL
#endif
/************struct**************/
typedef enum : uint8_t {
DGUS_IDLE, //< waiting for DGUS_HEADER1.
DGUS_HEADER1_SEEN, //< DGUS_HEADER1 received
DGUS_HEADER2_SEEN, //< DGUS_HEADER2 received
DGUS_WAIT_TELEGRAM, //< LEN received, Waiting for to receive all bytes.
} rx_datagram_state_t;
typedef struct DataBuf
{
unsigned char len;
unsigned char head[2];
unsigned char command;
unsigned long addr;
unsigned long bytelen;
unsigned short data[32];
unsigned char reserv[4];
} DB;
struct creality_dwin_settings_t {
size_t settings_size;
uint8_t settings_version;
bool display_standby;
bool display_sound;
int8_t screen_rotation;
int16_t display_volume;
uint8_t standby_screen_brightness;
uint8_t screen_brightness;
int16_t standby_time_seconds;
};
void SetTouchScreenConfiguration();
class RTSSHOW {
public:
RTSSHOW();
int RTS_RecData();
void RTS_SDCardInit(void);
void RTS_SDCardUpate(bool, bool);
int RTS_CheckFilement(int);
void RTS_SndData(void);
void RTS_SndData(const String &, unsigned long, unsigned char = VarAddr_W);
void RTS_SndData(const char[], unsigned long, unsigned char = VarAddr_W);
void RTS_SndData(char, unsigned long, unsigned char = VarAddr_W);
void RTS_SndData(unsigned char*, unsigned long, unsigned char = VarAddr_W);
void RTS_SndData(int, unsigned long, unsigned char = VarAddr_W);
void RTS_SndData(float, unsigned long, unsigned char = VarAddr_W);
void RTS_SndData(unsigned int,unsigned long, unsigned char = VarAddr_W);
void RTS_SndData(long,unsigned long, unsigned char = VarAddr_W);
void RTS_SndData(unsigned long,unsigned long, unsigned char = VarAddr_W);
void WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false, char fillChar = ' ');
void WriteVariable(uint16_t adr, long);
void RTS_SDcard_Stop();
void RTS_HandleData();
void RTS_Init();
DB recdat;
DB snddat;
unsigned char databuf[SizeofDatabuf];
static rx_datagram_state_t rx_datagram_state;
static uint8_t rx_datagram_len;
static bool Initialized;
};
static RTSSHOW rtscheck;
#define Addvalue 3
#define PrintChoice_Value (0+Addvalue)
#define Zoffset_Value (3+Addvalue)
#define Setting_Value (8+Addvalue)
#define XYZEaxis_Value (12+Addvalue)
#define Filement_Value (15+Addvalue)
#define Language_Value (18+Addvalue)
#define Filename_Value (22+Addvalue)
#define Idex_Settings_Value (26+Addvalue)
enum PROC_COM {Printfile=0,Ajust,Feedrate,PrintChoice=PrintChoice_Value,Zoffset=Zoffset_Value,TempControl,ManualSetTemp,Setting=Setting_Value,
ReturnBack,Bedlevel,Autohome,XYZEaxis=XYZEaxis_Value,Filement=Filement_Value,LanguageChoice=Language_Value,No_Filement,PwrOffNoF,Volume,Filename=Filename_Value,Idex_Settings=Idex_Settings_Value};
const unsigned long Addrbuf[] = {0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1026, 0x1030, 0x1032, 0x1034, 0x103A,
0x103E, 0x1040, 0x1044, 0x1046, 0x1048, 0x104A, 0x104C, 0x1054, 0x1056, 0x1058,
0x105C, 0x105E, 0x105F, 0x1088, 0};
void RTSUpdate();
void RTSInit();
}
#ifndef MAIN_MENU_ITEM_1_GCODE
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
#define MEASURING_GCODE "M190S55\nG28O\nG34\nG29\nM400\nM104S215\nG28\nM109S215\nM420S1\nG1X100Y100F5000\nG1Z0\nM500\nM117 Set Z Offset"
#elif ENABLED(AUTO_BED_LEVELING_UBL)
#define MEASURING_GCODE "M190S55\nG28O\nG34\nG29P1\nG29P3\nG29S1\nG29S0\nG29F0.0\nG29A\nM104S215\nG28\nM109S215\nG1X150Y150F5000\nG1Z0\nM500\nM400\nM117 Set Z Offset"
#else
#define MEASURING_GCODE "G28"
#endif
#else
#define MEASURING_GCODE MAIN_MENU_ITEM_1_GCODE
#endif
#endif
@@ -0,0 +1,189 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/* ****************************************
* lcd/extui/lib/Creality/FileNavigator.cpp
* ****************************************
* Extensible_UI implementation for Creality DWIN
* 10SPro, Max, CR10V2
* Based on implementations for Anycubic Chiron and Nextion by Nick Wells and Skorpi08
* Written by Insanity Automation
* ***************************************/
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(EXTENSIBLE_UI)
#include "FileNavigator.h"
using namespace ExtUI;
#define DEBUG_OUT NEXDEBUGLEVEL
#include "../../../core/debug_out.h"
FileList FileNavigator::filelist; // Instance of the Marlin file API
char FileNavigator::currentfoldername[MAX_PATH_LEN]; // Current folder path
uint16_t FileNavigator::lastindex;
uint8_t FileNavigator::folderdepth;
uint16_t FileNavigator::currentindex; // override the panel request
FileNavigator filenavigator;
FileNavigator::FileNavigator() { reset(); }
void FileNavigator::reset() {
currentfoldername[0] = '\0';
folderdepth = 0;
currentindex = 0;
lastindex = 0;
// Start at root folder
while (!filelist.isAtRootDir()) filelist.upDir();
refresh();
}
void FileNavigator::refresh() { filelist.refresh(); }
bool FileNavigator::getIndexisDir(uint16_t index){
filelist.seek(index);
return filelist.isDir();
}
const char *FileNavigator::getIndexName(uint16_t index){
filelist.seek(index);
return filelist.shortFilename();
}
uint16_t FileNavigator::maxFiles() {
return filelist.count();
}
void FileNavigator::getFiles(uint16_t index) {
uint16_t files = DISPLAY_FILES, fcnt = 0;
if (index == 0)
currentindex = 0;
else {
// Each time we change folder we reset the file index to 0 and keep track
// of the current position as the TFT panel isn't aware of folder trees.
--currentindex; // go back a file to take account of the .. added to the root.
if (index > lastindex)
currentindex += files + 1;
else if (currentindex >= files)
currentindex -= files - 1;
else
currentindex = 0;
}
lastindex = index;
// Clear currently drawn screen
for (int i = 0; i < DISPLAY_FILES; i++)
{
for (int j = 0; j < 20; j++)
rtscheck.RTS_SndData(0, SDFILE_ADDR + (i * 20) + j);
}
for (int j = 0; j < 10; j++)
{
rtscheck.RTS_SndData(0, Printfilename + j); //clean screen.
rtscheck.RTS_SndData(0, Choosefilename + j); //clean filename
}
for (int j = 0; j < 8; j++)
rtscheck.RTS_SndData(0, FilenameCount + j);
for (int j = 1; j <= DISPLAY_FILES; j++)
{
rtscheck.RTS_SndData(10, FilenameIcon + j);
rtscheck.RTS_SndData(10, FilenameIcon1 + j);
}
DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex, "folderdepth=", folderdepth);
if (currentindex == 0 && folderdepth > 0) { // Add a link to go up a folder
files--;
rtscheck.RTS_SndData("Up Directory", SDFILE_ADDR);
fcnt++;
}
else if(currentindex == DISPLAY_FILES && folderdepth > 0)
currentindex--;
for (uint16_t seek = currentindex; seek < currentindex + files; seek++) {
if (filelist.seek(seek)) {
const int filelen = strlen(filelist.filename());
if(filelen > 20)
{
char *buf = (char *)filelist.filename();
//char buf[filelen];
//strcpy(&buf[filelen], filelist.filename());
buf[18] = '\0'; // cutoff at screen edge
rtscheck.RTS_SndData(buf, (SDFILE_ADDR + (fcnt * 20)));
}
else
rtscheck.RTS_SndData(filelist.filename(), (SDFILE_ADDR + (fcnt * 20)));
if (filelist.isDir())
{
rtscheck.RTS_SndData((uint8_t)4, FilenameIcon + (fcnt+1));
rtscheck.RTS_SndData((unsigned long)0x041F, (FilenameNature + ((1+fcnt) * 16))); // Change BG of selected line to Blue
}
else
{
rtscheck.RTS_SndData((uint8_t)0, FilenameIcon + (fcnt+1));
rtscheck.RTS_SndData((unsigned long)0xFFFF, (FilenameNature + ((1+fcnt) * 16))); // white
}
SERIAL_ECHOLNPGM("-", seek, " '", filelist.filename(), "' '", currentfoldername, "", filelist.shortFilename(), "'\n");
fcnt++;
}
}
}
void FileNavigator::changeDIR(char *folder) {
DEBUG_ECHOLNPGM("currentfolder: ", currentfoldername, " New: ", folder);
if (folderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth
strcat(currentfoldername, folder);
strcat(currentfoldername, "/");
filelist.changeDir(folder);
refresh();
folderdepth++;
currentindex = 0;
}
void FileNavigator::upDIR() {
filelist.upDir();
refresh();
folderdepth--;
currentindex = 0;
// Remove the last child folder from the stored path
if (folderdepth == 0) {
currentfoldername[0] = '\0';
reset();
}
else {
char *pos = nullptr;
for (uint8_t f = 0; f < folderdepth; f++)
pos = strchr(currentfoldername, '/');
pos[1] = '\0';
}
DEBUG_ECHOLNPGM("depth: ", folderdepth, " currentfoldername: ", currentfoldername);
}
char* FileNavigator::getCurrentFolderName() { return currentfoldername; }
#endif
@@ -0,0 +1,63 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
/* ****************************************
* lcd/extui/lib/Creality/FileNavigator.h
* ****************************************
* Extensible_UI implementation for Creality DWIN
* 10SPro, Max, CRX and others
* Based on implementations for Anycubic Chiron and Nextion by Nick Wells and Skorpi08
* Written by Insanity Automation
* ***************************************/
#include "../ui_api.h"
#include "Creality_DWIN.h"
#define MAX_FOLDER_DEPTH 4 // Limit folder depth TFT has a limit for the file path
#define MAX_CMND_LEN 16 * MAX_FOLDER_DEPTH // Maximum Length for a Panel command
#define MAX_PATH_LEN 16 * MAX_FOLDER_DEPTH // Maximum number of characters in a SD file path
#define DISPLAY_FILES 4
using namespace ExtUI;
class FileNavigator {
public:
FileNavigator();
static void reset();
static void getFiles(uint16_t);
static void upDIR();
static void changeDIR(char *);
static void refresh();
static char* getCurrentFolderName();
static uint8_t folderdepth;
static uint16_t currentindex;
static bool getIndexisDir(uint16_t);
const char *getIndexName(uint16_t);
static uint16_t maxFiles();
private:
static FileList filelist;
static char currentfoldername[MAX_PATH_LEN];
static uint16_t lastindex;
};
extern FileNavigator filenavigator;
+5 -8
View File
@@ -683,15 +683,12 @@ namespace ExtUI {
}
#if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled() { return runout.enabled; }
void setFilamentRunoutEnabled(const bool value) { runout.enabled = value; }
bool getFilamentRunoutEnabled(const extruder_t extruder/*=E0*/) { return runout.enabled[extruder]; }
void setFilamentRunoutEnabled(const bool value, const extruder_t extruder/*=E0*/) { runout.enabled[extruder] = value; }
bool getFilamentRunoutState() { return runout.filament_ran_out; }
void setFilamentRunoutState(const bool value) { runout.filament_ran_out = value; }
#if HAS_FILAMENT_RUNOUT_DISTANCE
float getFilamentRunoutDistance_mm() { return runout.runout_distance(); }
void setFilamentRunoutDistance_mm(const_float_t value) { runout.set_runout_distance(constrain(value, 0, 999)); }
#endif
float getFilamentRunoutDistance_mm() { return runout.runout_distance(); }
void setFilamentRunoutDistance_mm(const_float_t value) { runout.set_runout_distance(constrain(value, 0, 999)); }
#endif
#if ENABLED(CASE_LIGHT_ENABLE)
@@ -1098,7 +1095,7 @@ namespace ExtUI {
return isPrinting() && (isPrintingFromMediaPaused() || print_job_timer.isPaused());
}
bool isMediaInserted() { return TERN0(SDSUPPORT, IS_SD_INSERTED()); }
bool isMediaInserted() { return TERN0(SDSUPPORT, IS_SD_INSERTED() || card.isMounted()); }
void pausePrint() { ui.pause_print(); }
void resumePrint() { ui.resume_print(); }
+4 -7
View File
@@ -300,15 +300,12 @@ namespace ExtUI {
#endif
#if HAS_FILAMENT_SENSOR
bool getFilamentRunoutEnabled();
void setFilamentRunoutEnabled(const bool);
bool getFilamentRunoutEnabled(const extruder_t extruder=E0);
void setFilamentRunoutEnabled(const bool, const extruder_t extruder=E0);
bool getFilamentRunoutState();
void setFilamentRunoutState(const bool);
#if HAS_FILAMENT_RUNOUT_DISTANCE
float getFilamentRunoutDistance_mm();
void setFilamentRunoutDistance_mm(const_float_t);
#endif
float getFilamentRunoutDistance_mm();
void setFilamentRunoutDistance_mm(const_float_t);
#endif
#if ENABLED(CASE_LIGHT_ENABLE)
+5
View File
@@ -722,6 +722,11 @@ namespace Language_en {
LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozzle: ");
LSTR MSG_RUNOUT_SENSOR = _UxGT("Runout Sensor");
LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout Dist mm");
LSTR MSG_RUNOUT_MODE = _UxGT("Runout Mode");
LSTR MSG_RUNOUT_MODE_HIGH = _UxGT("Sensor High");
LSTR MSG_RUNOUT_MODE_LOW = _UxGT("Sensor Low");
LSTR MSG_RUNOUT_MODE_MOTION = _UxGT("Motion Encoder");
LSTR MSG_RUNOUT_MODE_NONE = _UxGT("No Sensor");
LSTR MSG_RUNOUT_ENABLE = _UxGT("Enable Runout");
LSTR MSG_RUNOUT_ACTIVE = _UxGT("Runout Active");
LSTR MSG_INVERT_EXTRUDER = _UxGT("Invert Extruder");
+5 -3
View File
@@ -1054,8 +1054,10 @@ void MarlinUI::init() {
// loop and that the abs of the encoderDiff value is tracked.
const float encoderStepRate = encoderMovementSteps / float(ms - lastEncoderMovementMillis) * 1000;
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
#if defined(ENCODER_100X_STEPS_PER_SEC)
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
#endif
if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
// Enable to output the encoder steps per second value
//#define ENCODER_RATE_MULTIPLIER_DEBUG
@@ -1847,12 +1849,12 @@ void MarlinUI::init() {
#endif
#if BOTH(EXTENSIBLE_UI, ADVANCED_PAUSE_FEATURE)
void MarlinUI::pause_show_message(
const PauseMessage message,
const PauseMode mode/*=PAUSE_MODE_SAME*/,
const uint8_t extruder/*=active_extruder*/
) {
SERIAL_ECHOLNPGM("PauseMsg=", message);
pause_mode = mode;
ExtUI::pauseModeStatus = message;
switch (message) {
+51 -6
View File
@@ -45,7 +45,7 @@
#include "../../module/temperature.h"
#endif
#if HAS_FILAMENT_RUNOUT_DISTANCE
#if HAS_FILAMENT_SENSOR
#include "../../feature/runout.h"
#endif
@@ -99,6 +99,54 @@ void menu_backlash();
#endif
#if HAS_FILAMENT_SENSOR
void set_runout_mode_none(const uint8_t e) { runout.mode[e] = RM_NONE; runout.setup(); }
void set_runout_mode_high(const uint8_t e) { runout.mode[e] = RM_OUT_ON_HIGH; runout.setup(); }
void set_runout_mode_low(const uint8_t e) { runout.mode[e] = RM_OUT_ON_LOW; runout.setup(); }
void set_runout_mode_motion(const uint8_t e) { runout.mode[e] = RM_MOTION_SENSOR; runout.setup(); }
#define RUNOUT_EDIT_ITEMS(F) do{ \
EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled[F]); \
ACTION_ITEM(MSG_RUNOUT_MODE_NONE, []{ set_runout_mode_none(F); }); \
ACTION_ITEM(MSG_RUNOUT_MODE_HIGH, []{ set_runout_mode_high(F); }); \
ACTION_ITEM(MSG_RUNOUT_MODE_LOW, []{ set_runout_mode_low(F); }); \
ACTION_ITEM(MSG_RUNOUT_MODE_MOTION, []{ set_runout_mode_motion(F); }); \
editable.decimal = runout.runout_distance(F); \
EDIT_ITEM_FAST(float3, MSG_RUNOUT_DISTANCE_MM, &editable.decimal, 1, 999, \
[]{ runout.set_runout_distance(editable.decimal, F); }, true \
); \
}while(0)
void menu_runout_config() {
START_MENU();
BACK_ITEM(MSG_CONFIGURATION);
RUNOUT_EDIT_ITEMS(0);
#if NUM_RUNOUT_SENSORS > 1
RUNOUT_EDIT_ITEMS(1);
#endif
#if NUM_RUNOUT_SENSORS > 2
RUNOUT_EDIT_ITEMS(2);
#endif
#if NUM_RUNOUT_SENSORS > 3
RUNOUT_EDIT_ITEMS(3);
#endif
#if NUM_RUNOUT_SENSORS > 4
RUNOUT_EDIT_ITEMS(4);
#endif
#if NUM_RUNOUT_SENSORS > 5
RUNOUT_EDIT_ITEMS(5);
#endif
#if NUM_RUNOUT_SENSORS > 6
RUNOUT_EDIT_ITEMS(6);
#endif
#if NUM_RUNOUT_SENSORS > 7
RUNOUT_EDIT_ITEMS(7);
#endif
END_MENU();
}
#endif
#if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE)
//
// Advanced Settings > Filament
@@ -152,11 +200,8 @@ void menu_backlash();
#endif
#endif
#if HAS_FILAMENT_RUNOUT_DISTANCE
editable.decimal = runout.runout_distance();
EDIT_ITEM_FAST(float3, MSG_RUNOUT_DISTANCE_MM, &editable.decimal, 1, 999,
[]{ runout.set_runout_distance(editable.decimal); }, true
);
#if HAS_FILAMENT_SENSOR
SUBMENU(MSG_RUNOUT_MODE, menu_runout_config);
#endif
END_MENU();
+1 -1
View File
@@ -559,7 +559,7 @@ void menu_configuration() {
#endif
#if HAS_FILAMENT_SENSOR
EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset);
EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled[active_extruder], runout.reset);
#endif
#if HAS_FANCHECK
+1 -1
View File
@@ -259,7 +259,7 @@ void menu_pause_option() {
#if HAS_FILAMENT_SENSOR
const bool still_out = runout.filament_ran_out;
if (still_out)
EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled, runout.reset);
EDIT_ITEM(bool, MSG_RUNOUT_SENSOR, &runout.enabled[active_extruder], runout.reset);
#else
constexpr bool still_out = false;
#endif
+19 -7
View File
@@ -50,6 +50,10 @@
#include "../feature/joystick.h"
#endif
#if HAS_FILAMENT_SENSOR
#include "../feature/runout.h"
#endif
#if HAS_BED_PROBE
#include "probe.h"
#endif
@@ -668,22 +672,30 @@ void __O2 Endstops::report_states() {
#if USES_Z_MIN_PROBE_PIN
print_es_state(PROBE_TRIGGERED(), F(STR_Z_PROBE));
#endif
#if MULTI_FILAMENT_SENSOR
#define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; state = FIL_RUNOUT##N##_STATE; break;
#if HAS_FILAMENT_SENSOR
LOOP_S_LE_N(i, 1, NUM_RUNOUT_SENSORS) {
pin_t pin;
uint8_t state;
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];
const uint8_t outval = runout.out_state(i - 1);
SERIAL_ECHOPGM(STR_FILAMENT);
if (i > 1) SERIAL_CHAR(' ', '0' + i);
print_es_state(extDigitalRead(pin) != state);
SERIAL_ECHOPGM(": ");
if (rm == RM_NONE)
SERIAL_ECHOLNPGM(STR_OFF);
else if (rm == RM_MOTION_SENSOR) {
SERIAL_ECHOPGM("MOTION : ");
print_es_state(extDigitalRead(pin) == outval);
}
else
SERIAL_ECHOLNPGM_P(extDigitalRead(pin) == outval ? PSTR("OUT") : PSTR("PRESENT"));
}
#undef _CASE_RUNOUT
#elif HAS_FILAMENT_SENSOR
print_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE, F(STR_FILAMENT));
#endif
TERN_(BLTOUCH, bltouch._reset_SW_mode());
+43 -40
View File
@@ -113,9 +113,6 @@
#if HAS_FILAMENT_SENSOR
#include "../feature/runout.h"
#ifndef FIL_RUNOUT_ENABLED_DEFAULT
#define FIL_RUNOUT_ENABLED_DEFAULT true
#endif
#endif
#if ENABLED(ADVANCE_K_EXTRA)
@@ -237,8 +234,11 @@ typedef struct SettingsDataStruct {
//
// FILAMENT_RUNOUT_SENSOR
//
bool runout_sensor_enabled; // M412 S
float runout_distance_mm; // M412 D
#if HAS_FILAMENT_SENSOR
bool runout_enabled[NUM_RUNOUT_SENSORS]; // M591 S
float runout_distance_mm[NUM_RUNOUT_SENSORS]; // M591 D
uint8_t runout_mode[NUM_RUNOUT_SENSORS]; // M591 P
#endif
//
// ENABLE_LEVELING_FADE_HEIGHT
@@ -829,33 +829,23 @@ void MarlinSettings::postprocess() {
//
// Hotend Offsets, if any
//
{
#if HAS_HOTEND_OFFSET
// Skip hotend 0 which must be 0
LOOP_S_L_N(e, 1, HOTENDS)
EEPROM_WRITE(hotend_offset[e]);
#endif
}
#if HAS_HOTEND_OFFSET
// Skip hotend 0 which must be 0
LOOP_S_L_N(e, 1, HOTENDS)
EEPROM_WRITE(hotend_offset[e]);
#endif
//
// Filament Runout Sensor
//
#if HAS_FILAMENT_SENSOR
{
#if HAS_FILAMENT_SENSOR
const bool &runout_sensor_enabled = runout.enabled;
#else
constexpr int8_t runout_sensor_enabled = -1;
#endif
_FIELD_TEST(runout_sensor_enabled);
EEPROM_WRITE(runout_sensor_enabled);
#if HAS_FILAMENT_RUNOUT_DISTANCE
const float &runout_distance_mm = runout.runout_distance();
#else
constexpr float runout_distance_mm = 0;
#endif
EEPROM_WRITE(runout_distance_mm);
_FIELD_TEST(runout_enabled);
LOOP_L_N(e, NUM_RUNOUT_SENSORS) EEPROM_WRITE(runout.enabled[e]);
LOOP_L_N(e, NUM_RUNOUT_SENSORS) EEPROM_WRITE(runout.runout_distance(e));
LOOP_L_N(e, NUM_RUNOUT_SENSORS) EEPROM_WRITE(runout.mode[e]);
}
#endif
//
// Global Leveling
@@ -1802,22 +1792,28 @@ void MarlinSettings::postprocess() {
//
// Filament Runout Sensor
//
#if HAS_FILAMENT_SENSOR
{
int8_t runout_sensor_enabled;
_FIELD_TEST(runout_sensor_enabled);
EEPROM_READ(runout_sensor_enabled);
#if HAS_FILAMENT_SENSOR
runout.enabled = runout_sensor_enabled < 0 ? FIL_RUNOUT_ENABLED_DEFAULT : runout_sensor_enabled;
#endif
_FIELD_TEST(runout_enabled);
TERN_(HAS_FILAMENT_SENSOR, if (runout.enabled) runout.reset());
bool runout_enabled[NUM_RUNOUT_SENSORS];
float runout_distance_mm[NUM_RUNOUT_SENSORS];
RunoutMode runout_mode[NUM_RUNOUT_SENSORS];
float runout_distance_mm;
EEPROM_READ(runout_enabled);
EEPROM_READ(runout_distance_mm);
#if HAS_FILAMENT_RUNOUT_DISTANCE
if (!validating) runout.set_runout_distance(runout_distance_mm);
#endif
EEPROM_READ(runout_mode);
if (!validating) {
LOOP_S_L_N(e, 0, NUM_RUNOUT_SENSORS) {
runout.enabled[e] = runout_enabled[e];
runout.set_runout_distance(runout_distance_mm[e], e);
runout.mode[e] = runout_mode[e];
}
runout.reset();
}
}
#endif
//
// Global Leveling
@@ -2951,9 +2947,16 @@ void MarlinSettings::reset() {
//
#if HAS_FILAMENT_SENSOR
runout.enabled = FIL_RUNOUT_ENABLED_DEFAULT;
constexpr bool fred[] = FIL_RUNOUT_ENABLED;
constexpr uint8_t frm[] = FIL_RUNOUT_MODE;
constexpr float frd[] = FIL_RUNOUT_DISTANCE_MM;
static_assert(COUNT(fred) == NUM_RUNOUT_SENSORS, "FIL_RUNOUT_ENABLED must have NUM_RUNOUT_SENSORS values.");
static_assert(COUNT(frm) == NUM_RUNOUT_SENSORS, "FIL_RUNOUT_MODE must have NUM_RUNOUT_SENSORS values.");
static_assert(COUNT(frd) == NUM_RUNOUT_SENSORS, "FIL_RUNOUT_DISTANCE_MM must have NUM_RUNOUT_SENSORS values.");
COPY(runout.enabled, fred);
COPY(runout.mode, frm);
LOOP_L_N(e, NUM_RUNOUT_SENSORS) runout.set_runout_distance(frd[e], e);
runout.reset();
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, runout.set_runout_distance(FILAMENT_RUNOUT_DISTANCE_MM));
#endif
//
@@ -3722,7 +3725,7 @@ void MarlinSettings::reset() {
//
// Filament Runout Sensor
//
TERN_(HAS_FILAMENT_SENSOR, gcode.M412_report(forReplay));
TERN_(HAS_FILAMENT_SENSOR, gcode.M591_report(forReplay));
#if HAS_ETHERNET
CONFIG_ECHO_HEADING("Ethernet");
+3 -3
View File
@@ -117,7 +117,7 @@ Stepper stepper; // Singleton
#include "../feature/mixing.h"
#endif
#if HAS_FILAMENT_RUNOUT_DISTANCE
#if HAS_FILAMENT_SENSOR
#include "../feature/runout.h"
#endif
@@ -2062,7 +2062,7 @@ uint32_t Stepper::calc_timer_interval(uint32_t step_rate) {
const uint8_t rate_mod_256 = (step_rate & 0x00FF);
const uintptr_t table_address = uintptr_t(&speed_lookuptable_fast[uint8_t(step_rate >> 8)][0]),
gain = uint16_t(pgm_read_word(table_address + 2));
return uint16_t(pgm_read_word(table_address)) - MultiU16X8toH16(rate_mod_256, gain);
return uint16_t(pgm_read_word(table_address)) - MultiU8X16toH16(rate_mod_256, gain);
}
else { // lower step rates
uintptr_t table_address = uintptr_t(&speed_lookuptable_slow[0][0]);
@@ -2136,7 +2136,7 @@ uint32_t Stepper::block_phase_isr() {
PAGE_SEGMENT_UPDATE_POS(E);
}
#endif
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, runout.block_completed(current_block));
TERN_(HAS_FILAMENT_SENSOR, runout.block_completed(current_block));
discard_current_block();
}
else {
+3 -3
View File
@@ -114,11 +114,11 @@
#define TIMER_READ_ADD_AND_STORE_CYCLES 13UL
// The base ISR
#define ISR_BASE_CYCLES 1000UL
#define ISR_BASE_CYCLES 996UL
// Linear advance base time is 32 cycles
#if ENABLED(LIN_ADVANCE)
#define ISR_LA_BASE_CYCLES 32UL
#define ISR_LA_BASE_CYCLES 30UL
#else
#define ISR_LA_BASE_CYCLES 0UL
#endif
@@ -220,7 +220,7 @@
#define ISR_LOOP_CYCLES(R) ((ISR_LOOP_BASE_CYCLES + MIN_ISR_LOOP_CYCLES + MIN_STEPPER_PULSE_CYCLES) * (R - 1) + _MAX(MIN_ISR_LOOP_CYCLES, MIN_STEPPER_PULSE_CYCLES))
// Model input shaping as an extra loop call
#define ISR_SHAPING_LOOP_CYCLES(R) ((TERN0(HAS_SHAPING, ISR_LOOP_BASE_CYCLES) + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) * (R) + (MIN_ISR_LOOP_CYCLES) * (R - 1))
#define ISR_SHAPING_LOOP_CYCLES(R) TERN0(HAS_SHAPING, ((ISR_LOOP_BASE_CYCLES) + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) * (R))
// If linear advance is enabled, then it is handled separately
#if ENABLED(LIN_ADVANCE)
+25 -34
View File
@@ -35,14 +35,6 @@
#define BOARD_INFO_NAME "Tenlog D3 Hero"
#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME
//
// Servos
//
#define SERVO0_PIN 11
#define SERVO1_PIN 6
#define SERVO2_PIN -1 // Original pin 5 used for hotend fans
#define SERVO3_PIN 4
//
// Limit Switches
//
@@ -51,15 +43,13 @@
#define Y_MIN_PIN 14
//#define Y_MAX_PIN 15 // Connected to "DJ" plug on extruder heads
#define Z_MIN_PIN 18
#define Z_MAX_PIN 19
//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 15 // Ramps is normally 32
#if ENABLED(BLTOUCH)
#define SERVO0_PIN 19
#else
#define Z_MAX_PIN 19
#endif
//
// Steppers
//
@@ -98,16 +88,17 @@
//#define Z2_CS_PIN 40
//#endif
#define E0_STEP_PIN 26
#define E0_DIR_PIN 28
#define E0_ENABLE_PIN 24
#define E0_STEP_PIN 57
#define E0_DIR_PIN 58
#define E0_ENABLE_PIN 59
//#ifndef E0_CS_PIN
//define E0_CS_PIN 42
//#endif
#define E1_STEP_PIN 57
#define E1_DIR_PIN 58
#define E1_ENABLE_PIN 59
#define E1_STEP_PIN 26
#define E1_DIR_PIN 28
#define E1_ENABLE_PIN 24
//#ifndef E1_CS_PIN
//define E1_CS_PIN 44
//#endif
@@ -119,32 +110,32 @@
//
// Temperature Sensors
//
#define TEMP_0_PIN 13 // Analog Input
#define TEMP_1_PIN 15 // Analog Input
#define TEMP_0_PIN 15 // Analog Input
#define TEMP_1_PIN 13 // Analog Input
#define TEMP_BED_PIN 14 // Analog Input
// SPI for MAX Thermocouple
#if DISABLED(SDSUPPORT)
#define TEMP_0_CS_PIN -1 // Don't use 53 if using Display/SD card
#else
#define TEMP_0_CS_PIN -1 // Don't use 49 (SD_DETECT_PIN)
#endif
//
// Heaters / Fans
//
#define HEATER_0_PIN 10
#define HEATER_1_PIN 11
#define HEATER_0_PIN 11
#define HEATER_1_PIN 10
#define HEATER_BED_PIN 8
#define FAN_PIN 9
#define FAN1_PIN 5 // Normally this would be a servo pin
#define FAN2_PIN 5 // Normally this would be a servo pin
// XXX Runout support unknown?
//#define NUM_RUNOUT_SENSORS 0
//#define FIL_RUNOUT_PIN 22
#define FIL_RUNOUT_PIN 15
//#define FIL_RUNOUT2_PIN 21
//
// PSU and Powerloss Recovery
//
#ifdef PSU_CONTROL
#define PS_ON_PIN 40
#endif
//
// Misc. Functions
//
+9 -1
View File
@@ -177,7 +177,15 @@
#define CASE_LIGHT_PIN PA13
#ifndef NEOPIXEL_PIN
#define NEOPIXEL_PIN PA8
#define NEOPIXEL_PIN PA8
#endif
#define CASE_LIGHT_PIN LED_CONTROL_PIN
#define SUICIDE_PIN PC13
#ifndef SUICIDE_PIN_INVERTING
#define SUICIDE_PIN_INVERTING false
#endif
#define SUICIDE_PIN PC13
+10 -2
View File
@@ -64,8 +64,14 @@
//
// Probe
//
#ifndef PROBE_TARE_PIN
#define PROBE_TARE_PIN PA5
#if ENABLED(NOZZLE_AS_PROBE)
#ifndef PROBE_TARE_PIN
#define PROBE_TARE_PIN PA5
#endif
#else
#ifndef SERVO0_PIN
#define SERVO0_PIN PA5
#endif
#endif
//
@@ -112,3 +118,5 @@
// Misc. Functions
//
#define CASE_LIGHT_PIN PA6
#define LED_PIN PA6
+5
View File
@@ -38,6 +38,10 @@
#include "../lcd/e3v2/proui/dwin.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h"
#endif
#include "../module/planner.h" // for synchronize
#include "../module/printcounter.h"
#include "../gcode/queue.h"
@@ -460,6 +464,7 @@ void CardReader::mount() {
else {
flag.mounted = true;
SERIAL_ECHO_MSG(STR_SD_CARD_OK);
TERN_(EXTENSIBLE_UI, ExtUI::onMediaInserted()); // ExtUI response
}
if (flag.mounted)
+168 -143
View File
@@ -1,153 +1,178 @@
## Dwin Touch/TFT Screen supported firmware
- Info screen Version Code Reference
- - Char 1 - Driver (A-4988, T-TMC220X)
- - Char 2 - Z Stop(B-BLTouch, E-Endstop)
- - Char 3 - Screen(L-LowRes, H-THighRes)
- - Char 4 - Bed (A-AC, D-DC)
- - Char 5 - Endstop(O-Optical Y, M-Mechanical Y)
- - Char 6 - Extruder (T-Titan, B-BMG, L-LGX, S-Basic)
## Support
This firmware is provided to the public as-is with no warranty or guarantee. It's based on a large open source project and there is no entitlement to support. That said, LNL Solutions customers may obtain support through their normal support queue. I will provide support to Patreons as I am able. Aside from this, we are active on many discord channels and typically help anyone we can when we come across them.
We have now created a dedicated Discord server to handle support and archive relevant guides and instructions. Patreon supporters will get priority assistance.
## We will NOT handle any support requests for any built compiled from upstream code. The display library from here was taken and submitted upstream without consultation or properly tagging authorship of changes. It was kept off the upstream repo as it was explicitly designed as a drop in library before the Extensible UI API methodology was butchered by hybrid applications with direct includes being repeatedly duplicated. We will not now or ever spend the time to chase bugs caused by changes to the API data types made without concern for backwards compatability.
Extensible UI was designed to allow UI code to live standalone long term. If the API was managed and either versioned or functions overloaded, not changed, UI's no longer being actively maintained would not require maintenance by the Marlin team. The intention was any UI set would drop into the Lib folder and just work. This UI has been maintained under that mindset despite the upstream implementations being full of macros requiring direct pointer access to processed variables, making them fundamentally incompatible with the API, however still relying on its event trigger mechanism.
As another reason this was not placed upstream was to eliminate the nead to develop around merge conflicts following previous code theft issues which have cuased most development to now proceed in the dark, the merge upstream was caught by exactly that, merge issues while adding IDEX functionality.
Due to the blatent disregard to intentions and correct attribution, all support Marlin links have been removed from this repo and open PRs closed, and as long as the situation remains, no further work will be submitted upstream.
Shout out to Tom Brazier, as nearly all notable improvements to the Marlin core code since the last release have come from him.
Insanity Automation Discord - https://discord.gg/TKmJ85PyG4
## Primary Notes for DW7.4.7
- Added IDEX screens
- Added Branch / support for Tenlog IDEX machines with LNL Solutions
- Fan adjustment now numeric instead of simple on/off
- Tap Z offset on adjustment screen to type numeric value
- Sync to 2.1.2 with LA now on for all builds, Silent specific builds eliminated
- TODO note prior to building release batches - Primary outstanding bug is upstream issue causing M600 to fail to resume, verified on both DWIN and Standard full graphics displays.
## Primary Notes for DW7.4.6
- Added Support for the Ender 2 Pro
- Added support for the Ender 3 S1 thanks to F1rst Layer providing a machine!
- Added support for the new DACAI screens being used on current production E3V2 and S1 machines
- Added support for runtime configurable runout sensors matching RRF M591 including type and polarity
- Moved E3V2/S1 machines to Marlin Display
- - Due to the ongoing fued between developers and GPL violations involved with both the Pro/Enahnced UI and the Jyers UI, we have decided to support neither and stay away from the conflict as much as possible. The Marlin UI has more configuration functionality and the menus are more adaptive to the configuration of the machine. This is based off of the default Marlin menu system and will be the most stable long term going forward as well. The cosmetics and graphical icons may not be as nice as with the other UI's however we belive the added functionality more than makes up for it.
- Removed non-touchscreen 8 bit UBL builds due to RAM constraints
- Removed Pre-Built Melzi / Sanguino files. These are legacy and no longer actively supported. Its recommended to purchase replacement 32bit motherboards for any machine still using it from https://amzn.to/3KdqyI8
## Primary Notes for DW7.4.5
- Added support for CR10 Smart - Thanks to Tinymachines for providing the machine
- Revised file size issues causing corrupted screens on DWINOS3/4 displays (Sermoon, E6/7 etc)
- Added support for enabling / disabling filament runout and power loss recovery on the touchscreen
- Added LED control for equiped machines
- Resolved issue redirecting some users to chinese language displays instead of manual move screens
- Update to upstream current as of 2022-02-04
- CR6 / E3 Portrait Touchscreen files have an added NextGen dwin set. This supports the new DWIN OS 4 screens that began shipping in december. There are a few cosmetic issues left to resolve, but we decided to add them now anyway so that users who haver that hardware and will require it are not stuck.
## Primary Notes for DW7.4.4
- Added Feedrate / Accel / Jerk Screens
- Touchscreen DGUS tools bumped to 8.2
- - All Portrait displays operate with the same build
- - Older screens (10S Pro) audio file selection is a bit off, havnt found a way to properly enforce wav file used yet
- Ender 7 support
- Sermoon D1 Support
- - Some users have reported Z clicking that the scripts run in the Leveling screen resolves, so if you hear clicking from the Z stepper when printing, run measuring from the leveling screen after powerup before printing.
- E3V2 Screens Icon issue fixed thanks to note from Jyers on icon file size limit
## Primary Notes for DW7.4.3
- PID Messaging Fixed
- M600 / Advanced pause messaging improved
- Volume / Brightness numeric entry fixed
- Bump base to 2.0.9.2
-- Includes improved UI for the E3V2 with expanded menus submitted by Jyers
- Add Gcode configuration to disable BLTouch High Speed Mode to allow runtime config to support CRTouch
-- This one is pending upstream https://github.com/MarlinFirmware/Marlin/pull/22916
- Untested preliminary support for the Sermoon D1
-- Preliminary reports say it works aside from the LCD
-- I do not own one of these, however a local community member has offered to bring his down when im done with the Ender 7
- CR30 Support Added
## Primary Notes for DW7.4
- Added Screen Calibration Options
-- Standby Brightness
-- Volume
-- Both now saved in EEPROM
-- Screen configuration code based loosely on the work from the CR6 community modified for this screen model
-- Automatic Screen rotation for the Ender 6 (Default is upside-down)
- Manual Mesh Controls for no Probe machines
-- CRX and Ender 6 with no Probe can now use all mesh controls
-- All machines now use the same screen files except for Ender 3 V2 Rotary Dial machines and CR6
- Home button added to 5 point adjustment screen
- Tap mesh values to manually type in a new value - allows for manual adjustment of mesh values
- Additional functions, messaging on pause / filament runout
-- No will no longer cancel print
-- Depending on state, if only option is continue (eg Reheat, Load filament) Any response continues
-- On final Confirm Continue, No will purge more filament and Yes will resume
- Most places temperatures are shown, can now tap them to type in a value to set the temerature
- Updated to Marlin 2.0.9 Base
- CR6 Branches merged in
-- Support for this machine is primarily based on the fork by the [CR6 Community](https://github.com/CR6Community)
## Primary notes for DW7.3
- File browser rewritten to support paging as well as subdirectories
-- New file browser has a limit of a 66 character directory depth. This can be expanded at the cost of more RAM if users find this more limiting.
-- Due to the above, the current recommendation is to try and limit folder depth to 3 subdirectories and keep names short if possible.
- Base bumped to Marlin Bugfix as of 20210418
# Changes for DW7.3.1
- Added SD file refresh button for users with damaged SD Detect Pins
- Modified print finish button action to raise z by 5mm and disable steppers rather than rehome XY
- Solve rounding issue with babystepping below step precision by forcing always round up caused by recent upstream change
- Modified babystepping resolution for fine adjustment to .02mm from .01mm
- Force file pages to reset paging value on entry to screen to prevent incorrect scrolling
- Additional string length buffer safeties
The default build button is now a batch Build All! If you want to build a custom stock 2560 environment, use the env:megaatmega2560 environment.
For SKR 1.3/1.4 boards use the LPC1768/9 environments as usual. For SKR Mini or Creality STM32F1 boards use the standard STM32 environments per vendor.
## About Our Branches
The firmware branches maintained here are made possible by the support of [Tiny Machines 3D](https://www.tinymachines3d.com/?rfsn=3419592.cc302fe) as well as our customer base through our 3D printing Services.
Maintaining and developing these branches takes a significant investment, made up of time and machines. To support continued development, please consider your next 3D Printer related purchase from Tiny Machines 3D
and thank them for supporting open source development. Or, consider us for printing services outside of your machines capabilities. Print service requests can be sent to d.menzel@insanityautomation.com and we will
respond typically within 1 working day. If you do not need anything printed or a 3D Printer but still want to contribute, you can support us through [Patreon](https://www.patreon.com/InsanityAutomation).
## Setup
All configuration options intended to be adjusted by end users have been placed in the top section of Configuration.h and have been documented there. There is typically a break line to segregate the standard
configuration below. Anything aside from the upper options is intended for advanced users only.
Please keep in mind when flashing the Creality 32 bit boards with the binary files (.bin) that occasionally they will not accept particular filenames. This is most common with reflashing after an aborted flash. The machine stores the filename it was last flashed with, so renaming the file to something such as firmware.bin or firmware1.bin (anything different than what it is now) will typically resolve any issue with file names.
## Known Issues
- While auto leveling (measuring) is in progress pressing other buttons on the screen can abort portions of the script depending where it is
- - The process includes heating the bed before probing, probing then heating the nozzle before moving to Z0.
- Thanks to Jarrett Wendt for finding that if you are experiencing distorted sounds, and use a Mac, the default Archive Utility on MacOS has been found to be corrupting the files. If you're on a Mac, try unzipping with The Unarchiver or Keka instead.
## Future Goals
For this branch, we still have some active goals open that we plan to continue working on provided there is continued interest in the project.
- CR10 Smart Power controls and network reset pin output to web interface device
- Screens for IS and LA adjustment
## Creality Firmware Branches
- Most Creality machines [CrealityDwin_2.0](https://github.com/InsanityAutomation/Marlin/tree/CrealityDwin_2.0)
- CR6 modified from [CR-6 Community](https://github.com/CR6Community) - [Creality CR6](https://github.com/InsanityAutomation/Marlin/tree/CR-6Devel)
## Formbot / Vivedino Firmware Branches
- Raptor 1/2 Firmware [Raptor_2.0.X](https://github.com/InsanityAutomation/Marlin/tree/Raptor_2.0.X)
- Trex 2+/3 Firmware [TM_Trex2+_2.0.x](https://github.com/InsanityAutomation/Marlin/tree/TM_Trex2+_2.0.x)
## Mamorubot / HieHa Firmware Branches
- SX4/SX2 Firmware [TM_SX4_2.0](https://github.com/InsanityAutomation/Marlin/tree/TM_SX4_2.0)
## Other Firmware
- Raise 3D N2+ (Dual) 2.0 [Raise3D-N2+-Dual](https://github.com/InsanityAutomation/Marlin/tree/Raise3D-N2+-Dual)
- Evnovo Artillery Sidewinder X1 2.0 [Evnovo X1](https://github.com/InsanityAutomation/Marlin/tree/ArtilleryX1_2.0_Devel)
- [Anet E16](https://github.com/InsanityAutomation/Marlin/tree/AnetE16V2.0.5.2)
- Lulzbot with Universal Tools options [Lulzbot](https://github.com/InsanityAutomation/Marlin/tree/LulzbotTestBase)
- Funmat HT with Graphical Display [Funmat HT](https://github.com/InsanityAutomation/Marlin/tree/FunmatHT)
- [Modix Big60](https://github.com/InsanityAutomation/Marlin/tree/ModixBig60)
- Tronxy Chithu Machines [Tronxy](https://github.com/InsanityAutomation/Marlin/tree/TronxyX5SA)
[Marlin Commit History](https://github.com/MarlinFirmware/Marlin/pulls?q=is%3Apr+is%3Aclosed+author%3AInsanityAutomation)
## Marlin
This is just one of many forks of Marlin. We don't try to bury that behind fancy marketting or anything else.
<p align="center"><img src="buildroot/share/pixmaps/logo/marlin-outrun-nf-500.png" height="250" alt="MarlinFirmware's logo" /></p>
<h1 align="center">Marlin 3D Printer Firmware</h1>
<p align="center">
<a href="/LICENSE"><img alt="GPL-V3.0 License" src="https://img.shields.io/github/license/marlinfirmware/marlin.svg"></a>
<a href="https://github.com/MarlinFirmware/Marlin/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/marlinfirmware/marlin.svg"></a>
<a href="https://github.com/MarlinFirmware/Marlin/releases"><img alt="Last Release Date" src="https://img.shields.io/github/release-date/MarlinFirmware/Marlin"></a>
<a href="https://github.com/MarlinFirmware/Marlin/actions"><img alt="CI Status" src="https://github.com/MarlinFirmware/Marlin/actions/workflows/test-builds.yml/badge.svg"></a>
<a href="https://github.com/sponsors/thinkyhead"><img alt="GitHub Sponsors" src="https://img.shields.io/github/sponsors/thinkyhead?color=db61a2"></a>
<br />
<a href="https://fosstodon.org/@marlinfirmware"><img alt="Follow MarlinFirmware on Mastodon" src="https://img.shields.io/mastodon/follow/109450200866020466?domain=https%3A%2F%2Ffosstodon.org&logoColor=%2300B&style=social"></a>
</p>
Additional documentation can be found at the [Marlin Home Page](https://marlinfw.org/).
Please test this firmware and let us know if it misbehaves in any way. Volunteers are standing by!
## Marlin 2.1 Bugfix Branch
__Not for production use. Use with caution!__
Marlin 2.1 takes this popular RepRap firmware to the next level by adding support for much faster 32-bit and ARM-based boards while improving support for 8-bit AVR boards. Read about Marlin's decision to use a "Hardware Abstraction Layer" below.
This branch is for patches to the latest 2.1.x release version. Periodically this branch will form the basis for the next minor 2.1.x release.
Download earlier versions of Marlin on the [Releases page](https://github.com/MarlinFirmware/Marlin/releases).
## Example Configurations
Before you can build Marlin for your machine you'll need a configuration for your specific hardware. Upon request, your vendor will be happy to provide you with the complete source code and configurations for your machine, but you'll need to get updated configuration files if you want to install a newer version of Marlin. Fortunately, Marlin users have contributed dozens of tested configurations to get you started. Visit the [MarlinFirmware/Configurations](https://github.com/MarlinFirmware/Configurations) repository to find the right configuration for your hardware.
## Building Marlin 2.1
To build and upload Marlin you will use one of these tools:
- The free [Visual Studio Code](https://code.visualstudio.com/download) using the [Auto Build Marlin](https://marlinfw.org/docs/basics/auto_build_marlin.html) extension.
- The free [Arduino IDE](https://www.arduino.cc/en/main/software) : See [Building Marlin with Arduino](https://marlinfw.org/docs/basics/install_arduino.html)
Marlin is optimized to build with the **PlatformIO IDE** extension for **Visual Studio Code**. You can still build Marlin with **Arduino IDE**, and we hope to improve the Arduino build experience, but at this time PlatformIO is the better choice.
## Hardware Abstraction Layer (HAL)
Marlin includes an abstraction layer to provide a common API for all the platforms it targets. This allows Marlin code to address the details of motion and user interface tasks at the lowest and highest levels with no system overhead, tying all events directly to the hardware clock.
Every new HAL opens up a world of hardware. At this time we need HALs for RP2040 and the Duet3D family of boards. A HAL that wraps an RTOS is an interesting concept we would can explore. Did you know that Marlin includes a Simulator that can run on Windows, macOS, and Linux? Join the Discord to help move these sub-projects forward!
## 8-Bit AVR Boards
A core tenet of this project is to keep supporting 8-bit AVR boards while also maintaining a single codebase that applies equally to all machines. We want casual hobbyists to benefit from the community's innovations as much as possible just as much as those with fancier machines. Plus, those old AVR-based machines are often the best for your testing and feedback!
### Supported Platforms
Platform|MCU|Example Boards
--------|---|-------
[Arduino AVR](https://www.arduino.cc/)|ATmega|RAMPS, Melzi, RAMBo
[Teensy++ 2.0](https://www.microchip.com/en-us/product/AT90USB1286)|AT90USB1286|Printrboard
[Arduino Due](https://www.arduino.cc/en/Guide/ArduinoDue)|SAM3X8E|RAMPS-FD, RADDS, RAMPS4DUE
[ESP32](https://github.com/espressif/arduino-esp32)|ESP32|FYSETC E4, E4d@BOX, MRR
[LPC1768](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1768FBD100)|ARM® Cortex-M3|MKS SBASE, Re-ARM, Selena Compact
[LPC1769](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1769FBD100)|ARM® Cortex-M3|Smoothieboard, Azteeg X5 mini, TH3D EZBoard
[STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html)|ARM® Cortex-M3|Malyan M200, GTM32 Pro, MKS Robin, BTT SKR Mini
[STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)|ARM® Cortex-M4|ARMED, Rumba32, SKR Pro, Lerdge, FYSETC S6, Artillery Ruby
[STM32F7x6](https://www.st.com/en/microcontrollers-microprocessors/stm32f7x6.html)|ARM® Cortex-M7|The Borg, RemRam V1
[STM32G0B1RET6](https://www.st.com/en/microcontrollers-microprocessors/stm32g0x1.html)|ARM® Cortex-M0+|BigTreeTech SKR mini E3 V3.0
[STM32H743xIT6](https://www.st.com/en/microcontrollers-microprocessors/stm32h743-753.html)|ARM® Cortex-M7|BigTreeTech SKR V3.0, SKR EZ V3.0, SKR SE BX V2.0/V3.0
[SAMD51P20A](https://www.adafruit.com/product/4064)|ARM® Cortex-M4|Adafruit Grand Central M4
[Teensy 3.5](https://www.pjrc.com/store/teensy35.html)|ARM® Cortex-M4|
[Teensy 3.6](https://www.pjrc.com/store/teensy36.html)|ARM® Cortex-M4|
[Teensy 4.0](https://www.pjrc.com/store/teensy40.html)|ARM® Cortex-M7|
[Teensy 4.1](https://www.pjrc.com/store/teensy41.html)|ARM® Cortex-M7|
Linux Native|x86/ARM/etc.|Raspberry Pi
## Submitting Patches
Proposed patches should be submitted as a Pull Request against the ([bugfix-2.1.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.1.x)) branch.
- This branch is for fixing bugs and integrating any new features for the duration of the Marlin 2.1.x life-cycle.
- Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers.
- Please submit Feature Requests and Bug Reports to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues/new/choose). Support resources are also listed there.
- Whenever you add new features, be sure to add tests to `buildroot/tests` and then run your tests locally, if possible.
- It's optional: Running all the tests on Windows might take a long time, and they will run anyway on GitHub.
- If you're running the tests on Linux (or on WSL with the code on a Linux volume) the speed is much faster.
- You can use `make tests-all-local` or `make tests-single-local TEST_TARGET=...`.
- If you prefer Docker you can use `make tests-all-local-docker` or `make tests-all-local-docker TEST_TARGET=...`.
## Marlin Support
The Issue Queue is reserved for Bug Reports and Feature Requests. To get help with configuration and troubleshooting, please use the following resources:
- [Marlin Documentation](https://marlinfw.org) - Official Marlin documentation
- [Marlin Discord](https://discord.gg/n5NJ59y) - Discuss issues with Marlin users and developers
- Facebook Group ["Marlin Firmware"](https://www.facebook.com/groups/1049718498464482/)
- RepRap.org [Marlin Forum](https://forums.reprap.org/list.php?415)
- Facebook Group ["Marlin Firmware for 3D Printers"](https://www.facebook.com/groups/3Dtechtalk/)
- [Marlin Configuration](https://www.youtube.com/results?search_query=marlin+configuration) on YouTube
## Contributors
Marlin is constantly improving thanks to a huge number of contributors from all over the world bringing their specialties and talents. Huge thanks are due to [all the contributors](https://github.com/MarlinFirmware/Marlin/graphs/contributors) who regularly patch up bugs, help direct traffic, and basically keep Marlin from falling apart. Marlin's continued existence would not be possible without them.
## Administration
Regular users can open and close their own issues, but only the administrators can do project-related things like add labels, merge changes, set milestones, and kick trolls. The current Marlin admin team consists of:
<table align="center">
<tr><td>Project Maintainer</td></tr>
<tr><td>
🇺🇸 **Scott Lahteine**
[@thinkyhead](https://github.com/thinkyhead)
[<kbd>Donate 💸 </kbd>](https://www.thinkyhead.com/donate-to-marlin)
</td><td>
🇺🇸 **Roxanne Neufeld**
[@Roxy-3D](https://github.com/Roxy-3D)
🇺🇸 **Keith Bennett**
[@thisiskeithb](https://github.com/thisiskeithb)
[<kbd>Donate 💸 </kbd>](https://github.com/sponsors/thisiskeithb)
🇺🇸 **Jason Smith**
[@sjasonsmith](https://github.com/sjasonsmith)
</td><td>
🇧🇷 **Victor Oliveira**
[@rhapsodyv](https://github.com/rhapsodyv)
🇬🇧 **Chris Pepper**
[@p3p](https://github.com/p3p)
🇳🇿 **Peter Ellens**
[@ellensp](https://github.com/ellensp)
[<kbd>Donate 💸 </kbd>](https://ko-fi.com/ellensp)
</td><td>
🇺🇸 **Bob Kuhn**
[@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn)
🇳🇱 **Erik van der Zalm**
[@ErikZalm](https://github.com/ErikZalm)
[<kbd>Donate 💸 </kbd>](https://flattr.com/submit/auto?user_id=ErikZalm&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software)
</td></tr>
</table>
## License
Marlin is published under the [GPL license](/LICENSE) because we believe in open development. The GPL comes with both rights and obligations. Whether you use Marlin firmware as the driver for your open or closed-source product, you must keep Marlin open, and you must provide your compatible Marlin source code to end users upon request. The most straightforward way to comply with the Marlin license is to make a fork of Marlin on Github, perform your modifications, and direct users to your modified fork.
While we can't prevent the use of this code in products (3D printers, CNC, etc.) that are closed source or crippled by a patent, we would prefer that you choose another firmware or, better yet, make your own.
While we can't prevent the use of this code in products (3D printers, CNC, etc.) that are closed source or crippled by a patent, we would prefer that you choose another firmware or, better yet, make your own.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

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