Compare commits

...

172 Commits

Author SHA1 Message Date
InsanityAutomation b0c433e803 Minor tweaks 2023-03-10 15:18:43 -05:00
InsanityAutomation 695b3fe303 Merge branch 'bugfix-2.1.x' into Raptor_2.0.X_Devel 2023-03-10 09:34:18 -05:00
InsanityAutomation 0f7ef6b586 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-03-10 09:10:03 -05:00
thinkyhead cff395236c [cron] Bump distribution date (2023-03-10) 2023-03-10 06:06:44 +00:00
Evgeniy Zhabotinskiy 904ddf8551 Z_SAFE_HOMING_POINT_ABSOLUTE (#23069) 2023-03-09 18:56:19 -06:00
thinkyhead 26f96dc7a6 [cron] Bump distribution date (2023-03-09) 2023-03-09 12:08:13 +00:00
Sion Williams 32dcd7f118 🔨 VSCode + Devcontainer support (#22420) 2023-03-09 02:45:01 -06:00
Scott Lahteine 1d06fe8e26 🔧 Update some config.ini options 2023-03-09 01:37:09 -06:00
Kurt Haenen db5ff20b72 Extra Z Servo Probe options (#21427)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-03-09 00:20:30 -06:00
thinkyhead 0b473eecbc [cron] Bump distribution date (2023-03-08) 2023-03-08 00:23:50 +00:00
Scott Lahteine 4b9bb85b12 🔧 Add DGUS_LCD_UI RELOADED conditions 2023-03-06 23:17:19 -06:00
albatorsssx cc31537ae3 🌐 DGUS Reloaded non-accented French (#25443)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-03-06 20:04:47 -06:00
thinkyhead 0e2837e3e7 [cron] Bump distribution date (2023-03-07) 2023-03-07 00:40:18 +00:00
Scott Lahteine e053827831 🌐 Update Turkish language
Followup to #25447
2023-03-06 13:55:38 -06:00
Scott Lahteine 22f370a3fa 🧑‍💻 Script to make non-accented languages 2023-03-05 19:16:50 -06:00
thinkyhead c2572de9f4 [cron] Bump distribution date (2023-03-06) 2023-03-06 00:23:51 +00:00
Abdullah YILMAZ c63577fd1d 🌐 Update Turkish language (#25447) 2023-03-05 16:29:43 -06:00
alextrical 33ed748004 🐛 Fix Flash EEPROM for STM32G0B1CB (#25469) 2023-03-05 16:28:50 -06:00
Hans-Christian Ebke dee4ef09f8 🐛 Fix apply_power for SPINDLE_SERVO (#25465) 2023-03-05 16:25:11 -06:00
thinkyhead f3f7b1e7e3 [cron] Bump distribution date (2023-03-05) 2023-03-05 00:26:20 +00:00
Scott Lahteine f0c8c91820 🧑‍💻 Width/Magnitude-based types (#25458) 2023-03-03 20:44:24 -06:00
EvilGremlin e977232735 Switching extruder/nozzle without servo (e.g., Dondolo) (#24553)
Co-authored-by: Anson Liu <ansonl@users.noreply.github.com>
2023-03-03 20:43:20 -06:00
thinkyhead f359f8818a [cron] Bump distribution date (2023-03-04) 2023-03-04 00:28:15 +00:00
tombrazier c1ced60db0 🐛 Fix ISR_SHAPING_LOOP_CYCLES (#25335) 2023-03-03 14:37:10 -06:00
ellensp 8b74df0095 🔨 Fix 'step' type in createTemperatureLookupMarlin.py (#25455) 2023-03-03 14:32:04 -06:00
Giuliano Zaro 3c492793e0 🌐 Update Italian language (#25454) 2023-03-03 14:27:15 -06:00
jamespearson04 59f30d384c 🐛 Fix UBL 'G29 J' mesh tilt (#25453)
Fix regression from #24214
2023-03-03 14:26:38 -06:00
Scott Lahteine 13eab74fb8 ♻️ Stepper options followup
Followup to #25422
2023-03-03 14:22:21 -06:00
Scott Lahteine 593567b440 📝 Fix a comment 2023-03-03 13:42:46 -06:00
thinkyhead 49911c8f5d [cron] Bump distribution date (2023-03-02) 2023-03-02 06:06:30 +00:00
Marcio T 41115e0590 🚸 Improve CocoaPress Touch UI (#25446) 2023-03-01 22:07:23 -06:00
Scott Lahteine 31f1a0207f 🌐 Regenerate language data 2023-03-01 20:06:47 -06:00
Scott Lahteine 6a8ebddaf6 🔨 Update font scripts 2023-03-01 20:03:19 -06:00
thinkyhead 030559bf7f [cron] Bump distribution date (2023-03-01) 2023-03-01 00:26:50 +00:00
tombrazier 42cd314d96 🐛 Fix LA retract/feedrate edge case (#25445)
Followup to #25442
2023-02-28 18:16:27 -06:00
Scott Lahteine 894e378702 🔨 Improve config.ini example fetch 2023-02-28 18:03:21 -06:00
ellensp 579833e2a3 🔧 Fix Sensorless Probe sanity-check err (#25417) 2023-02-27 21:16:11 -06:00
thinkyhead 20d4b995f7 [cron] Bump distribution date (2023-02-28) 2023-02-28 00:23:17 +00:00
tombrazier 6084502f80 🐛 Fix Linear Advance E position tracking (#25442)
Fix regression from #24951
2023-02-27 17:00:13 -06:00
ellensp 18601f458f 🧑‍💻 Add IA_CREALITY CI test (#25434) 2023-02-27 11:11:53 -06:00
thinkyhead 80f0d4ed7c [cron] Bump distribution date (2023-02-27) 2023-02-27 06:07:00 +00:00
Daranbalt4 866e7d3128 LCD_BACKLIGHT_TIMEOUT for Neopixel LCD (#25438) 2023-02-26 21:23:52 -06:00
Keith Bennett 1068963092 🔨 Fix env STM32G0B1RE_btt, add …_manta_btt (#25431) 2023-02-26 21:03:28 -06:00
Scott Lahteine 445181fc42 🩹 Native types for RTS overloads (#25440)
Followup to #25400
2023-02-26 20:54:10 -06:00
ellensp db904f1895 📝 Link to archived RA Control Panel page (#25424) 2023-02-26 20:27:58 -06:00
ellensp 03eb9b0582 📝 New URL for IA_CREALITY DWIN files (#25423) 2023-02-26 20:23:39 -06:00
thinkyhead b1f45b384b [cron] Bump distribution date (2023-02-24) 2023-02-24 06:06:31 +00:00
Scott Lahteine 7552fc8f8d 📝 Update DISABLE_INACTIVE_* comment
Followup to #25422
2023-02-23 22:03:06 -06:00
Scott Lahteine acfde4e7e5 🎨 Use LIMIT macro 2023-02-23 21:38:52 -06:00
Guðni Már Gilbert c5d5c375fd ️ Reduce edit_screen code size (#25420) 2023-02-23 21:29:47 -06:00
Scott Lahteine f9f6662a8c ♻️ Stepper options refactor (#25422) 2023-02-23 21:08:31 -06:00
thinkyhead d3527f5de4 [cron] Bump distribution date (2023-02-23) 2023-02-23 00:22:15 +00:00
Scott Lahteine 44faf5cbab 🔧 Fix Einsy Rambo TMC driver check 2023-02-22 14:31:06 -06:00
Scott Lahteine 9e42480855 🔨 Fix marlin_custom.* without lib_deps 2023-02-21 18:22:16 -06:00
thinkyhead e46a50236f [cron] Bump distribution date (2023-02-22) 2023-02-22 00:20:53 +00:00
tombrazier 5a8883b44f 🐛 Fix AVR maths used by Stepper (#25338) 2023-02-21 16:37:11 -06:00
ellensp 464bb1f149 🔨 Encrypt some MKS Robin (#25349) 2023-02-21 16:27:47 -06:00
EvilGremlin bc450b4582 🌐 Update Russian language (#25360) 2023-02-21 15:19:29 -06:00
Scott Lahteine df44424388 🧑‍💻 Fix preheat tests (nested macro limit ~256)
Followup to #25407
2023-02-21 15:13:01 -06:00
DerAndere babd3b0037 🧑‍💻 Add get_move_distance for rotation/kinematics (#25370) 2023-02-21 12:26:10 -06:00
thinkyhead 122d4a89f6 [cron] Bump distribution date (2023-02-21) 2023-02-21 06:06:25 +00:00
ellensp 03a4378670 🔧 Sanity-check hotend max / preheat temps (#25407)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-02-20 20:25:22 -06:00
ellensp e002f4fd38 📺 Update Re-ARM VIKI2 SPI pins (#25411) 2023-02-20 18:58:40 -06:00
lukasradek 0f745468a1 🔧 Up to 9 tramming points (#25293)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-02-20 18:57:15 -06:00
Anson Liu 4f212e50b6 TC_GCODE_USE_GLOBAL_* (#25399)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-02-20 18:49:15 -06:00
thinkyhead d67e701b75 [cron] Bump distribution date (2023-02-20) 2023-02-20 00:25:06 +00:00
Scott Lahteine c950f0f5d1 🧑‍💻 ExtUI::onPowerLoss 2023-02-19 11:41:50 -06:00
thinkyhead 786c666151 [cron] Bump distribution date (2023-02-19) 2023-02-19 00:23:11 +00:00
Davide Rombolà 9db5bd000b IA_CREALITY screen rotation (#25397)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-02-18 03:49:57 -06:00
Scott Lahteine 96bc084f3d 🎨 Misc. LCD cleanup (#25400) 2023-02-18 02:23:08 -06:00
thinkyhead c68a4c085d [cron] Bump distribution date (2023-02-18) 2023-02-18 06:05:56 +00:00
Scott Lahteine aa9df38b05 🚸 Interruptible PLR (#25395) 2023-02-17 22:12:11 -06:00
thinkyhead 38e6330236 [cron] Bump distribution date (2023-02-16) 2023-02-16 00:27:36 +00:00
Trevin Small 90066e7160 ✏️ Fix README typo (#25388) 2023-02-15 18:00:10 -06:00
ellensp d925305b9e 🐛 Fix FastPWM calculations (#25343)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-02-15 17:58:51 -06:00
alexgrach 196f403dd6 🚸 Stop button for Touch UI (#25379) 2023-02-15 00:40:26 -06:00
apulver fc20533583 AVOID_OBSTACLES for UBL (#25256) 2023-02-15 00:38:54 -06:00
thinkyhead aacb81ea60 [cron] Bump distribution date (2023-02-15) 2023-02-15 06:13:44 +00:00
Scott Lahteine 2b86daa30b 🎨 Tweak VALIDATE_MESH_TILT 2023-02-14 22:31:19 -06:00
Frederik Kemner aa8afe90b0 🚸 SPI endstops for X/Y Dual and Core (#25371) 2023-02-14 22:25:47 -06:00
Davide Rombolà 028b11f2ca 🩹 Fix DGUS_LCD_UI input (#25374) 2023-02-14 22:10:18 -06:00
Radek fb480dffe4 📝 Fix BTT_MINI_12864_V1 comment (#25366) 2023-02-14 21:57:39 -06:00
thinkyhead 4c136c3dad [cron] Bump distribution date (2023-02-13) 2023-02-13 00:44:22 +00:00
Giuliano Zaro c421a2f5dd M306 E for MPC extruder index (#25326)
Co-Authored-By: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-02-12 01:32:06 -06:00
thinkyhead 0ddce13ebe [cron] Bump distribution date (2023-02-12) 2023-02-12 06:05:48 +00:00
Trivalik db01960a0e 🚸 Negative temperature display option (#25036)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2023-02-11 22:14:53 -06:00
Scott Lahteine 58d6b5db0a 🔨 Suppress native build warnings 2023-02-11 21:31:49 -06:00
thinkyhead ef3f484d3c [cron] Bump distribution date (2023-02-09) 2023-02-09 06:33:20 +00:00
EvilGremlin 8a9de407a1 🔨 Adjust INI comments (#25183) 2023-02-08 21:46:02 -06:00
Alexander Gavrilenko 3cd9599155 🐛 Fix 8-bit FSMC AA font colors (#25285) 2023-02-08 21:12:26 -06:00
Scott Lahteine 339773dcb5 🩹 Extra axis min home with Delta Sensorless Probe 2023-02-08 20:42:41 -06:00
Scott Lahteine a6b677f0ac 🩹 Extra axes for Tool Change 2023-02-08 20:42:41 -06:00
Scott Lahteine f595878b5b 🩹 Various simple fixes 2023-02-08 20:42:41 -06:00
Scott Lahteine 7e79fc5b8e 🩹 Safe Bed Leveling updates 2023-02-08 20:42:41 -06:00
Scott Lahteine 23e2cb0c53 🩹 Misc. extra axis updates 2023-02-08 20:42:41 -06:00
Scott Lahteine 88de52210f 🩹 Use 'M205 D' when 'B' is an axis 2023-02-08 20:42:41 -06:00
Scott Lahteine 842489a5dc 🐛 Don't skip G2/G3 E-only moves 2023-02-08 20:42:41 -06:00
Scott Lahteine 88dea487c2 🔧 Add a test for extra axes 2023-02-08 20:31:34 -06:00
thinkyhead 7659f522d6 [cron] Bump distribution date (2023-02-08) 2023-02-08 12:36:53 +00:00
Keith Bennett 2bc711ce58 BigTreeTech Manta M4P, M5P, M8P V1.0 / 1.1, E3 EZ (#25001) 2023-02-08 00:39:09 -06:00
InsanityAutomation 9cbb6b1512 Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x 2023-02-06 15:59:13 -05:00
thinkyhead 444259da07 [cron] Bump distribution date (2023-02-04) 2023-02-04 12:06:25 +00:00
Victor Oliveira 218ca05304 🧑‍💻 General 'MediaFile' type alias (#24424) 2023-02-04 02:10:26 -06:00
vyacheslav-shubin 08d9cbb930 🧑‍💻 Add SD Card 'hide' method for dev usage (#22425) 2023-02-04 01:36:07 -06:00
InsanityAutomation e353c84292 Merge branch 'Implement-M591-Configurable-Runout-Sensors' into Raptor_2.0.X_Devel 2022-04-15 15:17:49 -04:00
InsanityAutomation 6f4e7d6bb2 Merge branch 'bugfix-2.0.x' into Implement-M591-Configurable-Runout-Sensors 2022-04-10 15:01:53 -04:00
Scott Lahteine 7a7485ce71 🧑‍💻 Strip #errors in Configurations deployment 2022-04-10 09:21:06 -05:00
InsanityAutomation 5e5d22b77a Merge branch 'bugfix-2.0.x' into Implement-M591-Configurable-Runout-Sensors 2022-04-08 20:08:23 -04:00
InsanityAutomation c4ac453e37 Update dwin.cpp 2022-04-08 20:05:49 -04:00
InsanityAutomation bba892e327 Trim output on slim menus 2022-04-03 17:03:52 -04:00
InsanityAutomation 2caaff6b4d Merge branch 'Implement-M591-Configurable-Runout-Sensors' into Raptor_2.0.X_Devel 2022-04-03 15:12:13 -04:00
InsanityAutomation 25172b3acf M591Fixes 2022-04-03 14:54:16 -04:00
InsanityAutomation 0b6ecbd553 Merge branch 'bugfix-2.0.x' into Implement-M591-Configurable-Runout-Sensors 2022-04-03 10:33:18 -04:00
InsanityAutomation de6246f826 Merge branch 'Implement-M591-Configurable-Runout-Sensors' of https://github.com/InsanityAutomation/Marlin into Implement-M591-Configurable-Runout-Sensors 2022-04-03 10:32:57 -04:00
Scott Lahteine e813742ae0 Merge branch 'bugfix-2.0.x' into pr/23899 2022-03-29 03:25:51 -05:00
Scott Lahteine 46c8204990 Extend enum 2022-03-27 19:46:47 -05:00
Scott Lahteine bdfe4ca4d1 Simplify menu items, use enum, adjust settings 2022-03-26 21:10:16 -05:00
Scott Lahteine 6741f5182d Simplify menu items, use enum 2022-03-26 18:54:02 -05:00
InsanityAutomation 489b75ae3c Update menu_advanced.cpp 2022-03-15 12:47:14 -04:00
InsanityAutomation e9cf02c4d3 Update menu_advanced.cpp 2022-03-15 12:46:57 -04:00
InsanityAutomation 378fc12628 Add runout menu, small fixes 2022-03-15 12:28:19 -04:00
InsanityAutomation 0c2ce78246 Update Configuration.h 2022-03-15 12:28:08 -04:00
InsanityAutomation 7c6c7f872f Add runout menu, small fixes 2022-03-15 12:24:29 -04:00
InsanityAutomation c045666820 Update Configuration_adv.h 2022-03-15 10:59:40 -04:00
InsanityAutomation 941458759c Reorganize config options, remove obsolete option. 2022-03-14 18:04:22 -04:00
Scott Lahteine 9cb2bfcae5 glue for CI test 2022-03-14 18:03:35 -04:00
Scott Lahteine 433011fd52 Allow user to change 2022-03-14 18:03:35 -04:00
Scott Lahteine 717b52ff28 misc. cleanup 2022-03-14 18:03:35 -04:00
InsanityAutomation c9fed9303b Remove obsolete state from tests 2022-03-14 17:58:59 -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 4d2fd182ee M591 Cleanup and tweaks 2022-03-13 13:48:18 -04:00
InsanityAutomation 1b65fc5e32 Config Fixes 2022-03-13 13:47:41 -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 384fec1c25 Update Configuration.h 2022-03-12 15:53:28 -05:00
InsanityAutomation 70f7866b73 Initial commit - Flexible Runout Configuration M591 2022-03-12 15:53:04 -05:00
InsanityAutomation 74d45c5dd8 Merge branch 'bugfix-2.0.x' into Raptor_2.0.X_Devel 2022-03-12 12:03:35 -05:00
InsanityAutomation 815f4854da Update cardreader.h 2021-03-22 23:03:46 -04:00
InsanityAutomation 858448c65a Update menu_media.cpp 2021-03-22 22:54:42 -04:00
InsanityAutomation cfad2a9406 Update menu_main.cpp 2021-03-22 22:52:46 -04:00
InsanityAutomation aaaf16593b Update menu_main.cpp 2021-03-22 22:45:45 -04:00
InsanityAutomation 1f371391b0 Update Configuration.h 2021-03-22 22:45:40 -04:00
InsanityAutomation bebd793a2f Allow G34 on Raptor with Trex board 2021-03-18 22:51:52 -04:00
InsanityAutomation 465fedff7c Merge branch 'bugfix-2.0.x' into Raptor_2.0.X_Devel 2021-02-24 09:51:58 -05:00
Marcio T 34cda524c4 LVGL Touch UI followup (#21167) 2021-02-22 22:38:54 -06:00
InsanityAutomation f72ac5e09d Merge branch 'bugfix-2.0.x' into Raptor_2.0.X_Devel 2021-01-30 18:40:43 -05:00
InsanityAutomation cf2951a6a1 Update Configuration_adv.h 2020-12-15 09:09:17 -05:00
InsanityAutomation 0caccc4991 Updated for new formbat screen supplier and linear rail kits 2020-11-21 15:04:38 -05:00
InsanityAutomation 4fd8d60a8a Merge branch 'bugfix-2.0.x' into Raptor_2.0.X_Devel 2020-11-21 14:34:31 -05:00
InsanityAutomation 3165043527 Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2020-11-21 14:33:24 -05:00
Luu Lac cd3bf4c766 Fix "autotune" LCD message (#20127) 2020-11-13 18:48:59 -06:00
Scott Lahteine 30162df320 Optimize M360 2020-11-13 18:47:34 -06:00
InsanityAutomation dbcc84ceb6 Merge branch 'Raptor_2.0.X_Devel' of https://github.com/InsanityAutomation/Marlin into Raptor_2.0.X_Devel 2020-11-10 10:57:23 -05:00
InsanityAutomation 558df3bb3b Add raptor2 dc pid for prototypes 2020-11-10 10:57:10 -05:00
InsanityAutomation 5e40f2d84b Update Configuration.h 2020-11-10 10:42:31 -05:00
InsanityAutomation 7573fb4940 bump version 2020-11-10 10:42:30 -05:00
InsanityAutomation f9cc460237 Refactor branch, bump to head 2020-11-10 10:42:30 -05:00
InsanityAutomation d86b5bec4f Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x 2020-11-10 10:40:57 -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 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 0451bc099d Update Configuration.h 2020-09-27 12:20:17 -04:00
InsanityAutomation 701b238c48 bump version 2020-09-26 10:58:59 -04:00
InsanityAutomation f2c62933be Refactor branch, bump to head 2020-09-26 10:58:58 -04:00
285 changed files with 10372 additions and 3951 deletions
+29
View File
@@ -0,0 +1,29 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3/.devcontainer/base.Dockerfile
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT="3.9.0-buster"
FROM python:${VARIANT}
# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
RUN pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
RUN platformio update
# To get the test platforms
RUN pip install PyYaml
#ENV PATH /code/buildroot/bin/:/code/buildroot/tests/:${PATH}
+51
View File
@@ -0,0 +1,51 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
"VARIANT": "3.9.0-buster",
// Options
"INSTALL_NODE": "false",
"NODE_VERSION": "lts/*"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"platformio.platformio-ide",
"marlinfirmware.auto-build",
"editorconfig.editorconfig"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
+2 -1
View File
@@ -21,7 +21,8 @@
# Generated files
_Version.h
bdf2u8g
bdf2u8g.exe
genpages.exe
marlin_config.json
mczip.h
*.gen
+498 -158
View File
File diff suppressed because it is too large Load Diff
+211 -136
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 30 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 15 // Degrees Celsius
//#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
#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 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 210 // Seconds
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
#endif
@@ -328,28 +328,28 @@
* 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
#define THERMAL_PROTECTION_BED_PERIOD 300 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
/**
* As described above, except for the bed (M140/M190/M303).
*/
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
#endif
/**
* Thermal Protection parameters for the heated chamber.
*/
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius
/**
* Heated chamber watch settings (M141/M191).
*/
#define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds
#define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius
#define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds
#define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius
#endif
/**
@@ -515,9 +515,9 @@
* 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_TIMEOUT_SEC (60*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_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
@@ -565,7 +565,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,7 +643,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
#if ENABLED(Trex3Board) && DISABLED(RaptorFanPins)
#define E0_AUTO_FAN_PIN 6
#elif ENABLED(RAPTOR2) && DISABLED(SKRBoard)
#define E0_AUTO_FAN_PIN 9
#else
#define E0_AUTO_FAN_PIN -1
#endif
#define E1_AUTO_FAN_PIN -1
#define E2_AUTO_FAN_PIN -1
#define E3_AUTO_FAN_PIN -1
@@ -709,15 +715,17 @@
/**
* M355 Case Light on-off / brightness
*/
//#define CASE_LIGHT_ENABLE
#if DISABLED(SKRBoard)
#define CASE_LIGHT_ENABLE
#endif
#if ENABLED(CASE_LIGHT_ENABLE)
//#define CASE_LIGHT_PIN 4 // Override the default pin if needed
#define CASE_LIGHT_PIN 5 // Override the default pin if needed
#define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW
#define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on
#define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin)
//#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting.
#define CASE_LIGHT_DEFAULT_BRIGHTNESS 205 // Set default power-up brightness (0-255, requires PWM pin)
#define CASE_LIGHT_NO_BRIGHTNESS // Disable brightness control. Enable for non-PWM lighting.
//#define CASE_LIGHT_MAX_PWM 128 // Limit PWM duty cycle (0-255)
//#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu
#define CASE_LIGHT_MENU // Add Case Light options to the LCD menu
#if ENABLED(NEOPIXEL_LED)
//#define CASE_LIGHT_USE_NEOPIXEL // Use NeoPixel LED as case light
#endif
@@ -887,7 +895,7 @@
//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing
//#define XY_COUNTERPART_BACKOFF_MM 0 // (mm) Backoff X after homing Y, and vice-versa
//#define 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 +964,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 +977,9 @@
* Z Steppers Auto-Alignment
* Add the G34 command to align multiple Z steppers using a bed probe.
*/
//#define Z_STEPPER_AUTO_ALIGN
#if ANY(SKRBoard, Trex3Board) && ENABLED(DualZ)
#define Z_STEPPER_AUTO_ALIGN
#endif
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
/**
* Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
@@ -1034,7 +1044,7 @@
//#define ASSISTED_TRAMMING
#if ENABLED(ASSISTED_TRAMMING)
// Define positions for probe points.
// Define from 3 to 9 points to probe.
#define TRAMMING_POINT_XY { { 20, 20 }, { 180, 20 }, { 180, 180 }, { 20, 180 } }
// Define position names for probe points.
@@ -1104,34 +1114,33 @@
// Add a Duplicate option for well-separated conjoined nozzles
//#define MULTI_NOZZLE_DUPLICATION
// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
#define INVERT_I_STEP_PIN false
#define INVERT_J_STEP_PIN false
#define INVERT_K_STEP_PIN false
#define INVERT_U_STEP_PIN false
#define INVERT_V_STEP_PIN false
#define INVERT_W_STEP_PIN false
#define INVERT_E_STEP_PIN false
// By default stepper drivers require an active-HIGH signal but some high-power drivers require an active-LOW signal to step.
#define STEP_STATE_X HIGH
#define STEP_STATE_Y HIGH
#define STEP_STATE_Z HIGH
#define STEP_STATE_I HIGH
#define STEP_STATE_J HIGH
#define STEP_STATE_K HIGH
#define STEP_STATE_U HIGH
#define STEP_STATE_V HIGH
#define STEP_STATE_W HIGH
#define STEP_STATE_E HIGH
/**
* Idle Stepper Shutdown
* Set DISABLE_INACTIVE_? 'true' to shut down axis steppers after an idle period.
* Enable DISABLE_INACTIVE_* to shut down axis steppers after an idle period.
* The Deactive Time can be overridden with M18 and M84. Set to 0 for No Timeout.
*/
#define DEFAULT_STEPPER_DEACTIVE_TIME 120
#define DISABLE_INACTIVE_X true
#define DISABLE_INACTIVE_Y true
#define DISABLE_INACTIVE_Z true // Set 'false' if the nozzle could fall onto your printed part!
#define DISABLE_INACTIVE_I true
#define DISABLE_INACTIVE_J true
#define DISABLE_INACTIVE_K true
#define DISABLE_INACTIVE_U true
#define DISABLE_INACTIVE_V true
#define DISABLE_INACTIVE_W true
#define DISABLE_INACTIVE_E true
#define DISABLE_INACTIVE_X
#define DISABLE_INACTIVE_Y
#define DISABLE_INACTIVE_Z // Disable if the nozzle could fall onto your printed part!
//#define DISABLE_INACTIVE_I
//#define DISABLE_INACTIVE_J
//#define DISABLE_INACTIVE_K
//#define DISABLE_INACTIVE_U
//#define DISABLE_INACTIVE_V
//#define DISABLE_INACTIVE_W
// 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.
@@ -1167,7 +1176,8 @@
// Backlash Compensation
// Adds extra movement to axes on direction-changes to account for backlash.
//
//#define BACKLASH_COMPENSATION
#define BACKLASH_COMPENSATION
#if ENABLED(BACKLASH_COMPENSATION)
// Define values for backlash distance and correction.
// If BACKLASH_GCODE is enabled these values are the defaults.
@@ -1182,7 +1192,7 @@
//#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"
@@ -1274,7 +1284,9 @@
* vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
* lowest stepping frequencies.
*/
//#define ADAPTIVE_STEP_SMOOTHING
#if ENABLED(SKRBoard)
#define ADAPTIVE_STEP_SMOOTHING
#endif
/**
* Custom Microstepping
@@ -1434,7 +1446,7 @@
#define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state
// The timeout to return to the status screen from sub-menus
//#define LCD_TIMEOUT_TO_STATUS 15000 // (ms)
#define LCD_TIMEOUT_TO_STATUS 15000 // (ms)
#if ENABLED(SHOW_BOOTSCREEN)
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
@@ -1444,7 +1456,7 @@
#endif
// Scroll a longer status message into view
//#define STATUS_MESSAGE_SCROLLING
#define STATUS_MESSAGE_SCROLLING
// Apply a timeout to low-priority status messages
//#define STATUS_MESSAGE_TIMEOUT_SEC 30 // (seconds)
@@ -1455,6 +1467,9 @@
// Show the E position (filament used) during printing
//#define LCD_SHOW_E_TOTAL
// Display a negative temperature instead of "err"
//#define SHOW_TEMPERATURE_BELOW_ZERO
/**
* LED Control Menu
* Add LED Control to the LCD menu
@@ -1484,7 +1499,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
@@ -1570,13 +1585,15 @@
* 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
#if ENABLED(SKRBoard)
#define POWER_LOSS_PIN -1 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
#define POWER_LOSS_STATE LOW // State of pin indicating power loss
#endif
//#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,11 +1652,11 @@
// 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
//#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu
#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu
//#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!)
@@ -1655,7 +1672,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
@@ -1784,7 +1801,7 @@
// A bigger font is available for edit items. Costs 3120 bytes of flash.
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
//#define USE_BIG_EDIT_FONT
#define USE_BIG_EDIT_FONT
// A smaller font may be used on the Info Screen. Costs 2434 bytes of flash.
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
@@ -1845,9 +1862,11 @@
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash.
// Frivolous Game Options
//#define MARLIN_BRICKOUT
//#define MARLIN_INVADERS
//#define MARLIN_SNAKE
#if ENABLED(SKRBoard)
#define MARLIN_BRICKOUT
#define MARLIN_INVADERS
#define MARLIN_SNAKE
#endif
//#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu
#endif // HAS_MARLINUI_U8GLIB
@@ -2063,18 +2082,18 @@
*
* Warning: Does not respect endstops!
*/
//#define BABYSTEPPING
#define BABYSTEPPING
#if ENABLED(BABYSTEPPING)
//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
#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 (Z_STEPSMM / 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.
#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)
#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
// Note: Extra time may be added to mitigate controller latency.
@@ -2086,10 +2105,10 @@
//#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
//#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
#endif
#endif
@@ -2110,16 +2129,17 @@
*
* 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
@@ -2342,8 +2362,8 @@
*
* Override the default value based on the driver type set in Configuration.h.
*/
//#define MINIMUM_STEPPER_POST_DIR_DELAY 650
//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650
#define MINIMUM_STEPPER_POST_DIR_DELAY 250
#define MINIMUM_STEPPER_PRE_DIR_DELAY 250
/**
* Minimum stepper driver pulse width (in µs)
@@ -2387,17 +2407,21 @@
// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g., 8, 16, 32)
#if BOTH(SDSUPPORT, DIRECT_STEPPING)
#define BLOCK_BUFFER_SIZE 8
#elif ENABLED(SDSUPPORT)
#define BLOCK_BUFFER_SIZE 16
#elif ENABLED(SKRBoard)
#define BLOCK_BUFFER_SIZE 32
#else
#define BLOCK_BUFFER_SIZE 16
#define BLOCK_BUFFER_SIZE 8
#endif
// @section serial
// The ASCII buffer for serial input
#define MAX_CMD_SIZE 96
#define BUFSIZE 4
#if ENABLED(SKRBoard)
#define BUFSIZE 16
#else
#define BUFSIZE 8
#endif
// Transmission to Host Buffer Size
// To save 386 bytes of flash (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
@@ -2406,8 +2430,11 @@
// 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
#if ENABLED(SKRBoard)
#define TX_BUFFER_SIZE 32
#else
#define TX_BUFFER_SIZE 0
#endif
// Host Receive Buffer Size
// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough.
// To use flow control, set this buffer size to at least 1024 bytes.
@@ -2444,7 +2471,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 +2500,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.
@@ -2516,7 +2543,9 @@
*
* Note that M207 / M208 / M209 settings are saved to EEPROM.
*/
//#define FWRETRACT
#if DISABLED(UBL) || ENABLED(SKRBoard)
#define FWRETRACT
#endif
#if ENABLED(FWRETRACT)
#define FWRETRACT_AUTORETRACT // Override slicer retractions
#if ENABLED(FWRETRACT_AUTORETRACT)
@@ -2553,9 +2582,17 @@
* Extra G-code to run while executing tool-change commands. Can be used to use an additional
* stepper motor (e.g., I axis in Configuration.h) to drive the tool-changer.
*/
//#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0
//#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1
//#define EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN // Always execute above G-code sequences. Use with caution!
//#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0
//#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1
//#define EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN // Always execute above G-code sequences. Use with caution!
/**
* Consider coordinates for EVENT_GCODE_TOOLCHANGE_Tx as relative to T0
* so that moves in the specified axes are the same for all tools.
*/
//#define TC_GCODE_USE_GLOBAL_X // Use X position relative to Tool 0
//#define TC_GCODE_USE_GLOBAL_Y // Use Y position relative to Tool 0
//#define TC_GCODE_USE_GLOBAL_Z // Use Z position relative to Tool 0
/**
* Tool Sensors detect when tools have been picked up or dropped.
@@ -2637,7 +2674,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.
@@ -2653,7 +2690,7 @@
// 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_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 2 // (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.
@@ -2662,8 +2699,8 @@
// Set to 0 for manual extrusion.
// Filament can be extruded repeatedly from the Filament Change menu
// until extrusion is consistent, and to purge old filament.
#define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park.
//#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.
#define ADVANCED_PAUSE_RESUME_PRIME 2 // (mm) Extra distance to prime nozzle after returning from park.
#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.
// Filament Unload does a Retract, Delay, and Purge first:
#define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length.
@@ -2672,16 +2709,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 // Ensure homing has been completed prior to 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
@@ -2985,9 +3022,28 @@
* Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers
* on the same serial port, either here or in your board's pins file.
*/
//#define X_SLAVE_ADDRESS 0
//#define Y_SLAVE_ADDRESS 0
//#define Z_SLAVE_ADDRESS 0
#if ENABLED(SKRBoard)
#define X_SLAVE_ADDRESS 0
#define Y_SLAVE_ADDRESS 0
#define Z_SLAVE_ADDRESS 0
#define E0_SLAVE_ADDRESS 0
#else
#define X_SLAVE_ADDRESS 0
#define Y_SLAVE_ADDRESS 2
#define Z_SLAVE_ADDRESS 1
#define E0_SLAVE_ADDRESS 3
#define X_SERIAL_TX_PIN 58
#define X_SERIAL_RX_PIN 12
#define Y_SERIAL_TX_PIN 58
#define Y_SERIAL_RX_PIN 12
#define Z_SERIAL_TX_PIN 58
#define Z_SERIAL_RX_PIN 12
#define E0_SERIAL_TX_PIN 58
#define E0_SERIAL_RX_PIN 12
#endif
//#define X2_SLAVE_ADDRESS 0
//#define Y2_SLAVE_ADDRESS 0
//#define Z2_SLAVE_ADDRESS 0
@@ -3052,7 +3108,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 +3145,9 @@
* M912 - Clear stepper driver overtemperature pre-warn condition flag.
* M122 - Report driver parameters (Requires TMC_DEBUG)
*/
//#define MONITOR_DRIVER_STATUS
#if ENABLED(SKRBoard)
#define MONITOR_DRIVER_STATUS
#endif
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
@@ -3106,12 +3164,12 @@
* 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 Y2_HYBRID_THRESHOLD 100
#define X_HYBRID_THRESHOLD 70 // [mm/s]
#define X2_HYBRID_THRESHOLD 70
#define Y_HYBRID_THRESHOLD 50
#define Y2_HYBRID_THRESHOLD 50
#define Z_HYBRID_THRESHOLD 3
#define Z2_HYBRID_THRESHOLD 3
#define Z3_HYBRID_THRESHOLD 3
@@ -3197,7 +3255,7 @@
* 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.
@@ -3322,11 +3380,13 @@
* See https://marlinfw.org/docs/configuration/2.0.9/laser_spindle.html for more config details.
*/
//#define SPINDLE_FEATURE
//#define LASER_FEATURE
#if ENABLED(RAPTOR2) && DISABLED(SKRBoard)
//#define LASER_FEATURE
#endif
#if EITHER(SPINDLE_FEATURE, LASER_FEATURE)
#define SPINDLE_LASER_ACTIVE_STATE LOW // Set to "HIGH" if SPINDLE_LASER_ENA_PIN is active HIGH
#define SPINDLE_LASER_ACTIVE_STATE HIGH // Set to "HIGH" if SPINDLE_LASER_ENA_PIN is active HIGH
#define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power
//#define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power
#if ENABLED(SPINDLE_LASER_USE_PWM)
#define SPINDLE_LASER_PWM_INVERT false // Set to "true" if the speed/power goes up when you want it to go slower
#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR, ESP32, and LPC)
@@ -3377,8 +3437,8 @@
#define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction
#define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed
#define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power
#define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop
#define SPINDLE_LASER_POWERUP_DELAY 1 // (ms) Delay to allow the spindle/laser to come up to speed/power
#define SPINDLE_LASER_POWERDOWN_DELAY 1 // (ms) Delay to allow the spindle to stop
/**
* M3/M4 Power Equation
@@ -3494,6 +3554,7 @@
*/
//#define LASER_SYNCHRONOUS_M106_M107
/**
* Coolant Control
*
@@ -3739,33 +3800,47 @@
// @section custom main menu
// Custom Menu: Main Menu
//#define CUSTOM_MENU_MAIN
#define CUSTOM_MENU_MAIN
#if ENABLED(CUSTOM_MENU_MAIN)
//#define CUSTOM_MENU_MAIN_TITLE "Custom Commands"
#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done"
#define CUSTOM_MENU_MAIN_TITLE "Leveling Tools"
//#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done"
#define CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK
//#define CUSTOM_MENU_MAIN_SCRIPT_RETURN // Return to status screen after a script
#define CUSTOM_MENU_MAIN_SCRIPT_RETURN // Return to status screen after a script
#define CUSTOM_MENU_MAIN_ONLY_IDLE // Only show custom menu when the machine is idle
#define MAIN_MENU_ITEM_1_DESC "Home & UBL Info"
#define MAIN_MENU_ITEM_1_GCODE "G28\nG29 W"
//#define MAIN_MENU_ITEM_1_CONFIRM // Show a confirmation dialog before this action
#if ENABLED(DualZ)
#define DZ_Script "G34I8\n"
#else
#define DZ_Script
#endif
#define MAIN_MENU_ITEM_1_DESC "Setup"
#if ENABLED(UBL)
#define MAIN_MENU_ITEM_1_GCODE "M190S75\nG28\n" DZ_Script "G29P1\nG29P3\nM109S215\nG29S1\nG29S0\nG29F0.0\nG29A\nG28\nG1X150Y150F5000\nG1Z0\nM500\nM400\nM117 Set Z Offset"
#else
#define MAIN_MENU_ITEM_1_GCODE "M190S75\nG28\n" DZ_Script "G29\nM400\nM109S215\nG28\nM420S1\nG1X100Y100F5000\nG1Z0\nM500\nM117 Set Z Offset"
#endif
#define MAIN_MENU_ITEM_1_CONFIRM // Show a confirmation dialog before this action
#define MAIN_MENU_ITEM_2_DESC "Preheat for " PREHEAT_1_LABEL
#define MAIN_MENU_ITEM_2_GCODE "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
//#define MAIN_MENU_ITEM_2_CONFIRM
#define MAIN_MENU_ITEM_2_DESC "PID Hotend"
#define MAIN_MENU_ITEM_2_GCODE "G28\nG1X200Y200Z5\nM106S128\nM303C8S215E0U\nM500\nM117 PID Tune Done"
#define MAIN_MENU_ITEM_2_CONFIRM
//#define MAIN_MENU_ITEM_3_DESC "Preheat for " PREHEAT_2_LABEL
//#define MAIN_MENU_ITEM_3_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
//#define MAIN_MENU_ITEM_3_CONFIRM
#define MAIN_MENU_ITEM_3_DESC "PID Bed"
#define MAIN_MENU_ITEM_3_GCODE "M303C4S75E-1U\nM500\nM117 PID Tune Done"
#define MAIN_MENU_ITEM_3_CONFIRM
//#define MAIN_MENU_ITEM_4_DESC "Heat Bed/Home/Level"
//#define MAIN_MENU_ITEM_4_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define MAIN_MENU_ITEM_4_CONFIRM
#define MAIN_MENU_ITEM_4_DESC "Prep for Z Adjust"
#define MAIN_MENU_ITEM_4_GCODE "M190S75\nM104S215\nG28\nG29L1\nG1 X100Y100F5000\nG1Z0"
#define MAIN_MENU_ITEM_4_CONFIRM
#define MAIN_MENU_ITEM_5_DESC "Store Settings"
#define MAIN_MENU_ITEM_5_GCODE "M500\nM117 Settings Stored"
#define MAIN_MENU_ITEM_5_CONFIRM
#define MAIN_MENU_ITEM_6_DESC "Run Mesh Validation"
#define MAIN_MENU_ITEM_6_GCODE "G26"
#define MAIN_MENU_ITEM_6_CONFIRM
//#define MAIN_MENU_ITEM_5_DESC "Home & Info"
//#define MAIN_MENU_ITEM_5_GCODE "G28\nM503"
//#define MAIN_MENU_ITEM_5_CONFIRM
#endif
// @section custom config menu
@@ -3849,14 +3924,14 @@
* 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_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
#endif
+7 -7
View File
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
@@ -28,25 +28,25 @@
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "bugfix-2.1.x"
#define SHORT_BUILD_VERSION "bugfix-2.1.x_R01"
/**
* 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
#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " TM3D"
/**
* 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-03-10"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
*/
//#define MACHINE_NAME "3D Printer"
#define MACHINE_NAME "TM3D Raptor"
/**
* The SOURCE_CODE_URL is the location where users will find the Marlin Source
@@ -54,7 +54,7 @@
* has a distinct Github fork— the Source Code URL should just be the main
* Marlin repository.
*/
//#define SOURCE_CODE_URL "github.com/MarlinFirmware/Marlin"
#define SOURCE_CODE_URL "https://github.com/InsanityAutomation/Marlin/tree/Raptor_2.0.X"
/**
* Default generic printer UUID.
@@ -65,7 +65,7 @@
* 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 "tinymachines3d.com"
/**
* Set the vendor info the serial USB interface, if changable
+105
View File
@@ -0,0 +1,105 @@
/**
* 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_BMPHEIGHT 64
const unsigned char custom_start_bmp[] PROGMEM = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFD, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFD, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFE, 0x07, 0xC0, 0x05, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFC, 0x0A, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFE, 0x14, 0x10, 0x05, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFC, 0x28, 0x08, 0x06, 0x07, 0xC0, 0x05, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5F, 0xFF, 0xFF, 0xFF,
0xFE, 0x54, 0x04, 0x04, 0x0A, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF,
0xFC, 0x60, 0x04, 0x06, 0x14, 0x10, 0x05, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFE, 0x50, 0x04, 0x04, 0x28, 0x08, 0x06, 0x07, 0xC0, 0x05, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5F,
0xFC, 0x60, 0x04, 0x06, 0x54, 0x04, 0x04, 0x0A, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
0xFE, 0x54, 0x04, 0x1C, 0x60, 0x04, 0x06, 0x14, 0x10, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F,
0xFC, 0x28, 0x08, 0x2E, 0x50, 0x04, 0x04, 0x28, 0x08, 0x06, 0x07, 0xC0, 0x00, 0x01, 0xF0, 0x3F,
0xFE, 0x14, 0x10, 0x54, 0x60, 0x04, 0x06, 0x54, 0x04, 0x04, 0x0A, 0x20, 0x00, 0x02, 0x08, 0x1F,
0xFC, 0x0A, 0x20, 0x66, 0x54, 0x04, 0x1C, 0x60, 0x04, 0x06, 0x14, 0x10, 0x00, 0x05, 0x04, 0x3F,
0xFE, 0x07, 0xC0, 0x54, 0x28, 0x08, 0x2E, 0x50, 0x04, 0x04, 0x28, 0x08, 0x00, 0x0A, 0x02, 0x1F,
0xFC, 0x00, 0x00, 0x2E, 0x14, 0x10, 0x54, 0x60, 0x04, 0x06, 0x54, 0x04, 0x00, 0x15, 0x01, 0x3F,
0xFE, 0x00, 0x00, 0x1C, 0x0A, 0x20, 0x66, 0x54, 0x04, 0x1C, 0x60, 0x04, 0x00, 0x18, 0x01, 0x1F,
0xFC, 0x00, 0x00, 0x06, 0x07, 0xC0, 0x54, 0x28, 0x08, 0x2E, 0x50, 0x04, 0x00, 0x14, 0x01, 0x3F,
0xFE, 0x00, 0x00, 0x04, 0x00, 0x00, 0x2E, 0x14, 0x10, 0x54, 0x60, 0x04, 0x00, 0x18, 0x01, 0x1F,
0xFC, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x1C, 0x0A, 0x20, 0x66, 0x54, 0x04, 0x1C, 0x15, 0x01, 0x3F,
0xFE, 0xD5, 0x55, 0x54, 0x00, 0x00, 0x06, 0x07, 0xC0, 0x54, 0x28, 0x08, 0x2A, 0x0A, 0x02, 0x1F,
0xFC, 0x84, 0x10, 0x46, 0x00, 0x00, 0x04, 0x00, 0x00, 0x2E, 0x14, 0x10, 0x51, 0x05, 0x04, 0x3F,
0xFE, 0xC4, 0x10, 0x44, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x1C, 0x0A, 0x20, 0x61, 0x02, 0x88, 0x1F,
0xFC, 0x84, 0x10, 0x46, 0xD5, 0x55, 0x54, 0x00, 0x00, 0x06, 0x07, 0xC0, 0x51, 0x01, 0xF0, 0x3F,
0xFE, 0x84, 0x10, 0x44, 0x84, 0x10, 0x46, 0x00, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x1F,
0xFC, 0xC4, 0x10, 0x46, 0xC4, 0x10, 0x44, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x3F,
0xFE, 0x84, 0x10, 0x44, 0x84, 0x10, 0x46, 0xD5, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F,
0xFC, 0xD5, 0x55, 0x56, 0x84, 0x10, 0x44, 0x84, 0x10, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
0xFC, 0xFF, 0xFF, 0xFC, 0xC4, 0x10, 0x46, 0xC4, 0x10, 0x44, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F,
0xFE, 0x00, 0x00, 0x06, 0x84, 0x10, 0x44, 0x84, 0x10, 0x46, 0xD5, 0x55, 0x55, 0x55, 0x55, 0xBF,
0xFD, 0x55, 0x55, 0x54, 0xD5, 0x55, 0x56, 0x84, 0x10, 0x44, 0x84, 0x10, 0x41, 0x04, 0x10, 0x9F,
0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFC, 0xC4, 0x10, 0x46, 0xC4, 0x10, 0x41, 0x04, 0x11, 0xBF,
0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x06, 0x84, 0x10, 0x44, 0x84, 0x10, 0x41, 0x04, 0x10, 0x9F,
0xFF, 0xFF, 0xFF, 0xFD, 0x55, 0x55, 0x54, 0xD5, 0x55, 0x56, 0x84, 0x10, 0x41, 0x04, 0x10, 0x9F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFC, 0xC4, 0x10, 0x41, 0x04, 0x11, 0xBF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x06, 0x84, 0x10, 0x41, 0x04, 0x10, 0x9F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x55, 0x55, 0x54, 0xD5, 0x55, 0x55, 0x55, 0x55, 0xBF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xE0, 0x2E, 0xFB, 0x7D, 0xFB, 0xFB, 0xCF, 0xC1, 0xDF, 0xBB, 0x3E, 0xC0, 0xE1, 0xFE, 0x3C, 0x1F,
0xFD, 0xEE, 0x7B, 0x39, 0xF9, 0xF3, 0xCF, 0x9E, 0xDF, 0xBB, 0x3E, 0xDF, 0xDE, 0xFC, 0xDD, 0xE7,
0xFD, 0xEE, 0x3B, 0xBB, 0xF9, 0xEB, 0xD7, 0xBF, 0x5F, 0xBB, 0x5E, 0xDF, 0xDE, 0xFD, 0xED, 0xF7,
0xFD, 0xEE, 0xBB, 0xD3, 0xFA, 0xEB, 0xB7, 0x3F, 0xDF, 0xBB, 0x4E, 0xDF, 0xDF, 0xFF, 0xCD, 0xF3,
0xFD, 0xEE, 0xDB, 0xC7, 0xFA, 0xEB, 0xBB, 0x7F, 0xC0, 0x3B, 0x6E, 0xC0, 0xE3, 0xFF, 0x1D, 0xF3,
0xFD, 0xEE, 0xCB, 0xEF, 0xFA, 0xDB, 0xBB, 0x7F, 0xDF, 0xBB, 0x66, 0xDF, 0xF8, 0xFF, 0xCD, 0xF3,
0xFD, 0xEE, 0xEB, 0xEF, 0xFB, 0x5B, 0x03, 0x3F, 0x5F, 0xBB, 0x76, 0xDF, 0xFE, 0x7F, 0xED, 0xF3,
0xFD, 0xEE, 0xF3, 0xEF, 0xFB, 0x5B, 0x79, 0xBE, 0xDF, 0xBB, 0x7A, 0xDF, 0xDE, 0x7D, 0xED, 0xF7,
0xFD, 0xEE, 0xF3, 0xEF, 0xFB, 0xBA, 0xFD, 0x9E, 0xDF, 0xBB, 0x7C, 0xDF, 0xDE, 0xFD, 0xCD, 0xE7,
0xFD, 0xEE, 0xFB, 0xEF, 0xFB, 0xBA, 0xFD, 0xC1, 0xDF, 0xBB, 0x7E, 0xC0, 0xE0, 0xFE, 0x1C, 0x1F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
+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
+5 -5
View File
@@ -95,10 +95,10 @@ invert_y_dir = true
invert_z_dir = false
invert_e0_dir = false
invert_e_step_pin = false
invert_x_step_pin = false
invert_y_step_pin = false
invert_z_step_pin = false
step_state_e = HIGH
step_state_x = HIGH
step_state_y = HIGH
step_state_z = HIGH
disable_x = false
disable_y = false
@@ -178,7 +178,7 @@ autotemp_oldweight = 0.98
bed_check_interval = 5000
default_stepper_deactive_time = 120
default_volumetric_extruder_limit = 0.00
disable_inactive_e = true
disable_inactive_extruder = true
disable_inactive_x = true
disable_inactive_y = true
disable_inactive_z = true
+2 -5
View File
@@ -34,6 +34,7 @@
#include <WString.h>
#include "../../inc/MarlinConfigPre.h"
#include "../../core/types.h"
#include "../../core/serial_hook.h"
#ifndef SERIAL_PORT
@@ -138,10 +139,6 @@
#define BYTE 0
// Templated type selector
template<bool b, typename T, typename F> struct TypeSelector { typedef T type;} ;
template<typename T, typename F> struct TypeSelector<false, T, F> { typedef F type; };
template<typename Cfg>
class MarlinSerial {
protected:
@@ -164,7 +161,7 @@
static constexpr B_U2Xx<Cfg::PORT> B_U2X = 0;
// Base size of type on buffer size
typedef typename TypeSelector<(Cfg::RX_SIZE>256), uint16_t, uint8_t>::type ring_buffer_pos_t;
typedef uvalue_t(Cfg::RX_SIZE - 1) ring_buffer_pos_t;
struct ring_buffer_r {
volatile ring_buffer_pos_t head, tail;
+22 -5
View File
@@ -23,6 +23,10 @@
#include "../../inc/MarlinConfig.h"
//#define DEBUG_AVR_FAST_PWM
#define DEBUG_OUT ENABLED(DEBUG_AVR_FAST_PWM)
#include "../../core/debug_out.h"
struct Timer {
volatile uint8_t* TCCRnQ[3]; // max 3 TCCR registers per timer
volatile uint16_t* OCRnQ[3]; // max 3 OCR registers per timer
@@ -108,12 +112,15 @@ const Timer get_pwm_timer(const pin_t pin) {
}
void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
DEBUG_ECHOLNPGM("set_pwm_frequency(pin=", pin, ", freq=", f_desired, ")");
const Timer timer = get_pwm_timer(pin);
if (timer.isProtected || !timer.isPWM) return; // Don't proceed if protected timer or not recognized
const bool is_timer2 = timer.n == 2;
const uint16_t maxtop = is_timer2 ? 0xFF : 0xFFFF;
DEBUG_ECHOLNPGM("maxtop=", maxtop);
uint16_t res = 0xFF; // resolution (TOP value)
uint8_t j = CS_NONE; // prescaler index
uint8_t wgm = WGM_PWM_PC_8; // waveform generation mode
@@ -121,23 +128,29 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
// Calculating the prescaler and resolution to use to achieve closest frequency
if (f_desired != 0) {
constexpr uint16_t prescaler[] = { 1, 8, (32), 64, (128), 256, 1024 }; // (*) are Timer 2 only
uint16_t f = (F_CPU) / (2 * 1024 * maxtop) + 1; // Start with the lowest non-zero frequency achievable (1 or 31)
uint16_t f = (F_CPU) / (uint32_t(maxtop) << 11) + 1; // Start with the lowest non-zero frequency achievable (for 16MHz, 1 or 31)
DEBUG_ECHOLNPGM("f=", f);
DEBUG_ECHOLNPGM("(prescaler loop)");
LOOP_L_N(i, COUNT(prescaler)) { // Loop through all prescaler values
const uint16_t p = prescaler[i];
const uint32_t p = prescaler[i]; // Extend to 32 bits for calculations
DEBUG_ECHOLNPGM("prescaler[", i, "]=", p);
uint16_t res_fast_temp, res_pc_temp;
if (is_timer2) {
#if ENABLED(USE_OCR2A_AS_TOP) // No resolution calculation for TIMER2 unless enabled USE_OCR2A_AS_TOP
const uint16_t rft = (F_CPU) / (p * f_desired);
res_fast_temp = rft - 1;
res_pc_temp = rft / 2;
DEBUG_ECHOLNPGM("(Timer2) res_fast_temp=", res_fast_temp, " res_pc_temp=", res_pc_temp);
#else
res_fast_temp = res_pc_temp = maxtop;
DEBUG_ECHOLNPGM("(Timer2) res_fast_temp=", maxtop, " res_pc_temp=", maxtop);
#endif
}
else {
if (p == 32 || p == 128) continue; // Skip TIMER2 specific prescalers when not TIMER2
const uint16_t rft = (F_CPU) / (p * f_desired);
DEBUG_ECHOLNPGM("(Not Timer 2) F_CPU=" STRINGIFY(F_CPU), " prescaler=", p, " f_desired=", f_desired);
res_fast_temp = rft - 1;
res_pc_temp = rft / 2;
}
@@ -147,23 +160,27 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
// Calculate frequencies of test prescaler and resolution values
const uint16_t f_fast_temp = (F_CPU) / (p * (1 + res_fast_temp)),
f_pc_temp = (F_CPU) / (2 * p * res_pc_temp);
const int f_diff = _MAX(f, f_desired) - _MIN(f, f_desired),
f_pc_temp = (F_CPU) / ((p * res_pc_temp) << 1),
f_diff = _MAX(f, f_desired) - _MIN(f, f_desired),
f_fast_diff = _MAX(f_fast_temp, f_desired) - _MIN(f_fast_temp, f_desired),
f_pc_diff = _MAX(f_pc_temp, f_desired) - _MIN(f_pc_temp, f_desired);
DEBUG_ECHOLNPGM("f_fast_temp=", f_fast_temp, " f_pc_temp=", f_pc_temp, " f_diff=", f_diff, " f_fast_diff=", f_fast_diff, " f_pc_diff=", f_pc_diff);
if (f_fast_diff < f_diff && f_fast_diff <= f_pc_diff) { // FAST values are closest to desired f
// Set the Wave Generation Mode to FAST PWM
wgm = is_timer2 ? uint8_t(TERN(USE_OCR2A_AS_TOP, WGM2_FAST_PWM_OCR2A, WGM2_FAST_PWM)) : uint8_t(WGM_FAST_PWM_ICRn);
// Remember this combination
f = f_fast_temp; res = res_fast_temp; j = i + 1;
DEBUG_ECHOLNPGM("(FAST) updated f=", f);
}
else if (f_pc_diff < f_diff) { // PHASE CORRECT values are closes to desired f
// Set the Wave Generation Mode to PWM PHASE CORRECT
wgm = is_timer2 ? uint8_t(TERN(USE_OCR2A_AS_TOP, WGM2_PWM_PC_OCR2A, WGM2_PWM_PC)) : uint8_t(WGM_PWM_PC_ICRn);
f = f_pc_temp; res = res_pc_temp; j = i + 1;
DEBUG_ECHOLNPGM("(PHASE) updated f=", f);
}
}
} // prescaler loop
}
_SET_WGMnQ(timer, wgm);
+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),
+2 -5
View File
@@ -30,6 +30,7 @@
#include <WString.h>
#include "../../inc/MarlinConfigPre.h"
#include "../../core/types.h"
#include "../../core/serial_hook.h"
// Define constants and variables for buffering incoming serial data. We're
@@ -52,10 +53,6 @@
// #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256."
//#endif
// Templated type selector
template<bool b, typename T, typename F> struct TypeSelector { typedef T type;} ;
template<typename T, typename F> struct TypeSelector<false, T, F> { typedef F type; };
// Templated structure wrapper
template<typename S, unsigned int addr> struct StructWrapper {
constexpr StructWrapper(int) {}
@@ -76,7 +73,7 @@ protected:
static constexpr int HWUART_IRQ_ID = IRQ_IDS[Cfg::PORT];
// Base size of type on buffer size
typedef typename TypeSelector<(Cfg::RX_SIZE>256), uint16_t, uint8_t>::type ring_buffer_pos_t;
typedef uvalue_t(Cfg::RX_SIZE - 1) ring_buffer_pos_t;
struct ring_buffer_r {
volatile ring_buffer_pos_t head, tail;
+16 -18
View File
@@ -342,16 +342,16 @@ void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v
}
else
pindata.pwm_duty_ticks = duty; // PWM duty count = # of 4µs ticks per full PWM cycle
return;
}
else
#endif
{
const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION);
if (cid >= 0) {
const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1);
ledcWrite(cid, duty);
}
}
const int8_t cid = get_pwm_channel(pin, PWM_FREQUENCY, PWM_RESOLUTION);
if (cid >= 0) {
const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, _BV(PWM_RESOLUTION)-1);
ledcWrite(cid, duty);
}
}
int8_t MarlinHAL::set_pwm_frequency(const pin_t pin, const uint32_t f_desired) {
@@ -360,17 +360,15 @@ int8_t MarlinHAL::set_pwm_frequency(const pin_t pin, const uint32_t f_desired) {
pwm_pin_data[pin & 0x7F].pwm_cycle_ticks = 1000000UL / f_desired / 4; // # of 4µs ticks per full PWM cycle
return 0;
}
else
#endif
{
const int8_t cid = channel_for_pin(pin);
if (cid >= 0) {
if (f_desired == ledcReadFreq(cid)) return cid; // no freq change
ledcDetachPin(chan_pin[cid]);
chan_pin[cid] = 0; // remove old freq channel
}
return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one
}
const int8_t cid = channel_for_pin(pin);
if (cid >= 0) {
if (f_desired == ledcReadFreq(cid)) return cid; // no freq change
ledcDetachPin(chan_pin[cid]);
chan_pin[cid] = 0; // remove old freq channel
}
return get_pwm_channel(pin, f_desired, PWM_RESOLUTION); // try for new one
}
// use hardware PWM if avail, if not then ISR
+2 -2
View File
@@ -48,7 +48,7 @@ static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
bool PersistentStore::access_start() {
if (!card.isMounted()) return false;
SdFile file, root = card.getroot();
MediaFile file, root = card.getroot();
if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
return true;
@@ -63,7 +63,7 @@ bool PersistentStore::access_start() {
bool PersistentStore::access_finish() {
if (!card.isMounted()) return false;
SdFile file, root = card.getroot();
MediaFile file, root = card.getroot();
int bytes_written = 0;
if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
+2 -2
View File
@@ -47,7 +47,7 @@ static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
bool PersistentStore::access_start() {
if (!card.isMounted()) return false;
SdFile file, root = card.getroot();
MediaFile file, root = card.getroot();
if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
return true; // false aborts the save
@@ -62,7 +62,7 @@ bool PersistentStore::access_start() {
bool PersistentStore::access_finish() {
if (!card.isMounted()) return false;
SdFile file, root = card.getroot();
MediaFile file, root = card.getroot();
int bytes_written = 0;
if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) {
bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE);
+2 -2
View File
@@ -39,7 +39,7 @@ inline uint8_t timer_and_index_for_pin(const pin_t pin, timer_dev **timer_ptr) {
void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
const uint16_t duty = invert ? v_size - v : v;
if (PWM_PIN(pin)) {
timer_dev *timer; UNUSED(timer);
timer_dev *timer;
if (timer_freq[timer_and_index_for_pin(pin, &timer)] == 0)
set_pwm_frequency(pin, PWM_FREQUENCY);
const uint8_t channel = PIN_MAP[pin].timer_channel;
@@ -55,7 +55,7 @@ void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v
void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
timer_dev *timer; UNUSED(timer);
timer_dev *timer;
timer_freq[timer_and_index_for_pin(pin, &timer)] = f_desired;
// Protect used timers
+6 -6
View File
@@ -448,7 +448,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
TERN_(DISABLE_INACTIVE_U, stepper.disable_axis(U_AXIS));
TERN_(DISABLE_INACTIVE_V, stepper.disable_axis(V_AXIS));
TERN_(DISABLE_INACTIVE_W, stepper.disable_axis(W_AXIS));
TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers());
TERN_(DISABLE_INACTIVE_EXTRUDER, stepper.disable_e_steppers());
TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled());
}
@@ -669,7 +669,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
&& ELAPSED(ms, gcode.previous_move_ms + SEC_TO_MS(EXTRUDER_RUNOUT_SECONDS))
&& !planner.has_blocks_queued()
) {
#if ENABLED(SWITCHING_EXTRUDER)
#if HAS_SWITCHING_EXTRUDER
bool oldstatus;
switch (active_extruder) {
default: oldstatus = stepper.AXIS_IS_ENABLED(E_AXIS, 0); stepper.ENABLE_EXTRUDER(0); break;
@@ -683,7 +683,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
#endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1
}
#else // !SWITCHING_EXTRUDER
#else // !HAS_SWITCHING_EXTRUDER
bool oldstatus;
switch (active_extruder) {
default:
@@ -699,7 +699,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
planner.set_e_position_mm(olde);
planner.synchronize();
#if ENABLED(SWITCHING_EXTRUDER)
#if HAS_SWITCHING_EXTRUDER
switch (active_extruder) {
default: if (oldstatus) stepper.ENABLE_EXTRUDER(0); else stepper.DISABLE_EXTRUDER(0); break;
#if E_STEPPERS > 1
@@ -709,12 +709,12 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
#endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1
}
#else // !SWITCHING_EXTRUDER
#else // !HAS_SWITCHING_EXTRUDER
switch (active_extruder) {
#define _CASE_RESTORE(N) case N: if (oldstatus) stepper.ENABLE_EXTRUDER(N); else stepper.DISABLE_EXTRUDER(N); break;
REPEAT(E_STEPPERS, _CASE_RESTORE);
}
#endif // !SWITCHING_EXTRUDER
#endif // !HAS_SWITCHING_EXTRUDER
gcode.reset_stepper_timeout(ms);
}
+156 -146
View File
@@ -221,7 +221,7 @@
#define BOARD_5DPRINT 1707 // 5DPrint D8 Driver Board
//
// LPC1768 ARM Cortex M3
// LPC1768 ARM Cortex-M3
//
#define BOARD_RAMPS_14_RE_ARM_EFB 2000 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend, Fan, Bed)
@@ -242,7 +242,7 @@
#define BOARD_EMOTRONIC 2015 // eMotion-Tech eMotronic
//
// LPC1769 ARM Cortex M3
// LPC1769 ARM Cortex-M3
//
#define BOARD_MKS_SGEN 2500 // MKS-SGen
@@ -259,7 +259,7 @@
#define BOARD_FLY_CDY 2511 // FLYmaker FLY CDY
//
// SAM3X8E ARM Cortex M3
// SAM3X8E ARM Cortex-M3
//
#define BOARD_DUE3DOM 3000 // DUE3DOM for Arduino DUE
@@ -292,185 +292,195 @@
#define BOARD_KRATOS32 3027 // K.3D Kratos32 (Arduino Due Shield)
//
// SAM3X8C ARM Cortex M3
// SAM3X8C ARM Cortex-M3
//
#define BOARD_PRINTRBOARD_G2 3100 // Printrboard G2
#define BOARD_ADSK 3101 // Arduino DUE Shield Kit (ADSK)
//
// STM32 ARM Cortex-M0+
//
#define BOARD_BTT_EBB42_V1_1 4000 // BigTreeTech EBB42 V1.1 (STM32G0B1CB)
#define BOARD_BTT_SKR_MINI_E3_V3_0 4001 // BigTreeTech SKR Mini E3 V3.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_E3_EZ_V1_0 4002 // BigTreeTech Manta E3 EZ V1.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_M4P_V1_0 4003 // BigTreeTech Manta M4P V1.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_M5P_V1_0 4004 // BigTreeTech Manta M5P V1.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_M8P_V1_0 4005 // BigTreeTech Manta M8P V1.0 (STM32G0B1VE)
#define BOARD_BTT_MANTA_M8P_V1_1 4006 // BigTreeTech Manta M8P V1.1 (STM32G0B1VE)
//
// STM32 ARM Cortex-M3
//
#define BOARD_MALYAN_M200_V2 4000 // STM32F070CB controller
#define BOARD_MALYAN_M300 4001 // STM32F070-based delta
#define BOARD_STM32F103RE 4002 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_MALYAN_M200 4003 // STM32C8 Libmaple-based STM32F1 controller
#define BOARD_STM3R_MINI 4004 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_GTM32_PRO_VB 4005 // STM32F103VE controller
#define BOARD_GTM32_MINI 4006 // STM32F103VE controller
#define BOARD_GTM32_MINI_A30 4007 // STM32F103VE controller
#define BOARD_GTM32_REV_B 4008 // STM32F103VE controller
#define BOARD_MORPHEUS 4009 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
#define BOARD_CHITU3D 4010 // Chitu3D (STM32F103RE)
#define BOARD_MKS_ROBIN 4011 // MKS Robin (STM32F103ZE)
#define BOARD_MKS_ROBIN_MINI 4012 // MKS Robin Mini (STM32F103VE)
#define BOARD_MKS_ROBIN_NANO 4013 // MKS Robin Nano (STM32F103VE)
#define BOARD_MKS_ROBIN_NANO_V2 4014 // MKS Robin Nano V2 (STM32F103VE)
#define BOARD_MKS_ROBIN_LITE 4015 // MKS Robin Lite/Lite2 (STM32F103RC)
#define BOARD_MKS_ROBIN_LITE3 4016 // MKS Robin Lite3 (STM32F103RC)
#define BOARD_MKS_ROBIN_PRO 4017 // MKS Robin Pro (STM32F103ZE)
#define BOARD_MKS_ROBIN_E3 4018 // MKS Robin E3 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3_V1_1 4019 // MKS Robin E3 V1.1 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3D 4020 // MKS Robin E3D (STM32F103RC)
#define BOARD_MKS_ROBIN_E3D_V1_1 4021 // MKS Robin E3D V1.1 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3P 4022 // MKS Robin E3p (STM32F103VE)
#define BOARD_BTT_EBB42_V1_1 4023 // BigTreeTech EBB42 V1.1 (STM32G0B1CB)
#define BOARD_BTT_SKR_MINI_V1_1 4024 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_0 4025 // BigTreeTech SKR Mini E3 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_2 4026 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V2_0 4027 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_MINI_E3_V3_0 4028 // BigTreeTech SKR Mini E3 V3.0 (STM32G0B1RE)
#define BOARD_BTT_SKR_MINI_E3_V3_0_1 4029 // BigTreeTech SKR Mini E3 V3.0.1 (STM32F401RC)
#define BOARD_BTT_SKR_MINI_MZ_V1_0 4030 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
#define BOARD_BTT_SKR_E3_DIP 4031 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_CR6 4032 // BigTreeTech SKR CR6 v1.0 (STM32F103RE)
#define BOARD_JGAURORA_A5S_A1 4033 // JGAurora A5S A1 (STM32F103ZE)
#define BOARD_FYSETC_AIO_II 4034 // FYSETC AIO_II (STM32F103RC)
#define BOARD_FYSETC_CHEETAH 4035 // FYSETC Cheetah (STM32F103RC)
#define BOARD_FYSETC_CHEETAH_V12 4036 // FYSETC Cheetah V1.2 (STM32F103RC)
#define BOARD_LONGER3D_LK 4037 // Longer3D LK1/2 - Alfawise U20/U20+/U30 (STM32F103VE)
#define BOARD_CCROBOT_MEEB_3DP 4038 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 4039 // Chitu3D TronXY X5SA V5 Board (STM32F103ZE)
#define BOARD_CHITU3D_V6 4040 // Chitu3D TronXY X5SA V6 Board (STM32F103ZE)
#define BOARD_CHITU3D_V9 4041 // Chitu3D TronXY X5SA V9 Board (STM32F103ZE)
#define BOARD_CREALITY_V4 4042 // Creality v4.x (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V422 4043 // Creality v4.2.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V423 4044 // Creality v4.2.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V425 4045 // Creality v4.2.5 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V427 4046 // Creality v4.2.7 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V4210 4047 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30
#define BOARD_CREALITY_V431 4048 // Creality v4.3.1 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_A 4049 // Creality v4.3.1a (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_B 4050 // Creality v4.3.1b (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_C 4051 // Creality v4.3.1c (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_D 4052 // Creality v4.3.1d (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V452 4053 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V453 4054 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V521 4055 // Creality v5.2.1 (STM32F103VE) as found in the SV04
#define BOARD_CREALITY_V24S1 4056 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7
#define BOARD_CREALITY_V24S1_301 4057 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1
#define BOARD_CREALITY_V25S1 4058 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
#define BOARD_TRIGORILLA_PRO 4059 // Trigorilla Pro (STM32F103ZE)
#define BOARD_FLY_MINI 4060 // FLYmaker FLY MINI (STM32F103RC)
#define BOARD_FLSUN_HISPEED 4061 // FLSUN HiSpeedV1 (STM32F103VE)
#define BOARD_BEAST 4062 // STM32F103RE Libmaple-based controller
#define BOARD_MINGDA_MPX_ARM_MINI 4063 // STM32F103ZE Mingda MD-16
#define BOARD_GTM32_PRO_VD 4064 // STM32F103VE controller
#define BOARD_ZONESTAR_ZM3E2 4065 // Zonestar ZM3E2 (STM32F103RC)
#define BOARD_ZONESTAR_ZM3E4 4066 // Zonestar ZM3E4 V1 (STM32F103VC)
#define BOARD_ZONESTAR_ZM3E4V2 4067 // Zonestar ZM3E4 V2 (STM32F103VC)
#define BOARD_ERYONE_ERY32_MINI 4068 // Eryone Ery32 mini (STM32F103VE)
#define BOARD_PANDA_PI_V29 4069 // Panda Pi V2.9 - Standalone (STM32F103RC)
#define BOARD_MALYAN_M200_V2 5000 // STM32F070CB controller
#define BOARD_MALYAN_M300 5001 // STM32F070-based delta
#define BOARD_STM32F103RE 5002 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_MALYAN_M200 5003 // STM32C8 Libmaple-based STM32F1 controller
#define BOARD_STM3R_MINI 5004 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_GTM32_PRO_VB 5005 // STM32F103VE controller
#define BOARD_GTM32_MINI 5006 // STM32F103VE controller
#define BOARD_GTM32_MINI_A30 5007 // STM32F103VE controller
#define BOARD_GTM32_REV_B 5008 // STM32F103VE controller
#define BOARD_MORPHEUS 5009 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
#define BOARD_CHITU3D 5010 // Chitu3D (STM32F103RE)
#define BOARD_MKS_ROBIN 5011 // MKS Robin (STM32F103ZE)
#define BOARD_MKS_ROBIN_MINI 5012 // MKS Robin Mini (STM32F103VE)
#define BOARD_MKS_ROBIN_NANO 5013 // MKS Robin Nano (STM32F103VE)
#define BOARD_MKS_ROBIN_NANO_V2 5014 // MKS Robin Nano V2 (STM32F103VE)
#define BOARD_MKS_ROBIN_LITE 5015 // MKS Robin Lite/Lite2 (STM32F103RC)
#define BOARD_MKS_ROBIN_LITE3 5016 // MKS Robin Lite3 (STM32F103RC)
#define BOARD_MKS_ROBIN_PRO 5017 // MKS Robin Pro (STM32F103ZE)
#define BOARD_MKS_ROBIN_E3 5018 // MKS Robin E3 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3_V1_1 5019 // MKS Robin E3 V1.1 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3D 5020 // MKS Robin E3D (STM32F103RC)
#define BOARD_MKS_ROBIN_E3D_V1_1 5021 // MKS Robin E3D V1.1 (STM32F103RC)
#define BOARD_MKS_ROBIN_E3P 5022 // MKS Robin E3P (STM32F103VE)
#define BOARD_BTT_SKR_MINI_V1_1 5023 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_0 5024 // BigTreeTech SKR Mini E3 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_2 5025 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V2_0 5026 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_MINI_MZ_V1_0 5027 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
#define BOARD_BTT_SKR_E3_DIP 5028 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_CR6 5029 // BigTreeTech SKR CR6 v1.0 (STM32F103RE)
#define BOARD_JGAURORA_A5S_A1 5030 // JGAurora A5S A1 (STM32F103ZE)
#define BOARD_FYSETC_AIO_II 5031 // FYSETC AIO_II (STM32F103RC)
#define BOARD_FYSETC_CHEETAH 5032 // FYSETC Cheetah (STM32F103RC)
#define BOARD_FYSETC_CHEETAH_V12 5033 // FYSETC Cheetah V1.2 (STM32F103RC)
#define BOARD_LONGER3D_LK 5034 // Longer3D LK1/2 - Alfawise U20/U20+/U30 (STM32F103VE)
#define BOARD_CCROBOT_MEEB_3DP 5035 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 5036 // Chitu3D TronXY X5SA V5 Board (STM32F103ZE)
#define BOARD_CHITU3D_V6 5037 // Chitu3D TronXY X5SA V6 Board (STM32F103ZE)
#define BOARD_CHITU3D_V9 5038 // Chitu3D TronXY X5SA V9 Board (STM32F103ZE)
#define BOARD_CREALITY_V4 5039 // Creality v4.x (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V422 5040 // Creality v4.2.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V423 5041 // Creality v4.2.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V425 5042 // Creality v4.2.5 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V427 5043 // Creality v4.2.7 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V4210 5044 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30
#define BOARD_CREALITY_V431 5045 // Creality v4.3.1 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_A 5046 // Creality v4.3.1a (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_B 5047 // Creality v4.3.1b (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_C 5048 // Creality v4.3.1c (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V431_D 5049 // Creality v4.3.1d (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V452 5050 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V453 5051 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V521 5052 // Creality v5.2.1 (STM32F103VE) as found in the SV04
#define BOARD_CREALITY_V24S1 5053 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7
#define BOARD_CREALITY_V24S1_301 5054 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1
#define BOARD_CREALITY_V25S1 5055 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
#define BOARD_TRIGORILLA_PRO 5056 // Trigorilla Pro (STM32F103ZE)
#define BOARD_FLY_MINI 5057 // FLYmaker FLY MINI (STM32F103RC)
#define BOARD_FLSUN_HISPEED 5058 // FLSUN HiSpeedV1 (STM32F103VE)
#define BOARD_BEAST 5059 // STM32F103RE Libmaple-based controller
#define BOARD_MINGDA_MPX_ARM_MINI 5060 // STM32F103ZE Mingda MD-16
#define BOARD_GTM32_PRO_VD 5061 // STM32F103VE controller
#define BOARD_ZONESTAR_ZM3E2 5062 // Zonestar ZM3E2 (STM32F103RC)
#define BOARD_ZONESTAR_ZM3E4 5063 // Zonestar ZM3E4 V1 (STM32F103VC)
#define BOARD_ZONESTAR_ZM3E4V2 5064 // Zonestar ZM3E4 V2 (STM32F103VC)
#define BOARD_ERYONE_ERY32_MINI 5065 // Eryone Ery32 mini (STM32F103VE)
#define BOARD_PANDA_PI_V29 5066 // Panda Pi V2.9 - Standalone (STM32F103RC)
//
// ARM Cortex-M4F
//
#define BOARD_TEENSY31_32 4100 // Teensy3.1 and Teensy3.2
#define BOARD_TEENSY35_36 4101 // Teensy3.5 and Teensy3.6
#define BOARD_TEENSY31_32 5100 // Teensy3.1 and Teensy3.2
#define BOARD_TEENSY35_36 5101 // Teensy3.5 and Teensy3.6
//
// STM32 ARM Cortex-M4F
//
#define BOARD_ARMED 4200 // Arm'ed STM32F4-based controller
#define BOARD_RUMBA32_V1_0 4201 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_V1_1 4202 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_MKS 4203 // RUMBA32 STM32F446VE based controller from Makerbase
#define BOARD_RUMBA32_BTT 4204 // RUMBA32 STM32F446VE based controller from BIGTREETECH
#define BOARD_BLACK_STM32F407VE 4205 // BLACK_STM32F407VE
#define BOARD_BLACK_STM32F407ZE 4206 // BLACK_STM32F407ZE
#define BOARD_BTT_SKR_PRO_V1_1 4207 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
#define BOARD_BTT_SKR_PRO_V1_2 4208 // BigTreeTech SKR Pro v1.2 (STM32F407ZG)
#define BOARD_BTT_BTT002_V1_0 4209 // BigTreeTech BTT002 v1.0 (STM32F407VG)
#define BOARD_BTT_E3_RRF 4210 // BigTreeTech E3 RRF (STM32F407VG)
#define BOARD_BTT_SKR_V2_0_REV_A 4211 // BigTreeTech SKR v2.0 Rev A (STM32F407VG)
#define BOARD_BTT_SKR_V2_0_REV_B 4212 // BigTreeTech SKR v2.0 Rev B (STM32F407VG/STM32F429VG)
#define BOARD_BTT_GTR_V1_0 4213 // BigTreeTech GTR v1.0 (STM32F407IGT)
#define BOARD_BTT_OCTOPUS_V1_0 4214 // BigTreeTech Octopus v1.0 (STM32F446ZE)
#define BOARD_BTT_OCTOPUS_V1_1 4215 // BigTreeTech Octopus v1.1 (STM32F446ZE)
#define BOARD_BTT_OCTOPUS_PRO_V1_0 4216 // BigTreeTech Octopus Pro v1.0 (STM32F446ZE / STM32F429ZG)
#define BOARD_LERDGE_K 4217 // Lerdge K (STM32F407ZG)
#define BOARD_LERDGE_S 4218 // Lerdge S (STM32F407VE)
#define BOARD_LERDGE_X 4219 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 4220 // VAkE 403D (STM32F446VE)
#define BOARD_FYSETC_S6 4221 // FYSETC S6 (STM32F446VE)
#define BOARD_FYSETC_S6_V2_0 4222 // FYSETC S6 v2.0 (STM32F446VE)
#define BOARD_FYSETC_SPIDER 4223 // FYSETC Spider (STM32F446VE)
#define BOARD_FLYF407ZG 4224 // FLYmaker FLYF407ZG (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4225 // MKS_ROBIN2 (STM32F407ZE)
#define BOARD_MKS_ROBIN_PRO_V2 4226 // MKS Robin Pro V2 (STM32F407VE)
#define BOARD_MKS_ROBIN_NANO_V3 4227 // MKS Robin Nano V3 (STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V3_1 4228 // MKS Robin Nano V3.1 (STM32F407VE)
#define BOARD_MKS_MONSTER8_V1 4229 // MKS Monster8 V1 (STM32F407VE)
#define BOARD_MKS_MONSTER8_V2 4230 // MKS Monster8 V2 (STM32F407VE)
#define BOARD_ANET_ET4 4231 // ANET ET4 V1.x (STM32F407VG)
#define BOARD_ANET_ET4P 4232 // ANET ET4P V1.x (STM32F407VG)
#define BOARD_FYSETC_CHEETAH_V20 4233 // FYSETC Cheetah V2.0 (STM32F401RC)
#define BOARD_TH3D_EZBOARD_V2 4234 // TH3D EZBoard v2.0 (STM32F405RG)
#define BOARD_OPULO_LUMEN_REV3 4235 // Opulo Lumen PnP Controller REV3 (STM32F407VE / STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4236 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE)
#define BOARD_MKS_EAGLE 4237 // MKS Eagle (STM32F407VE)
#define BOARD_ARTILLERY_RUBY 4238 // Artillery Ruby (STM32F401RC)
#define BOARD_FYSETC_SPIDER_V2_2 4239 // FYSETC Spider V2.2 (STM32F446VE)
#define BOARD_CREALITY_V24S1_301F4 4240 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
#define BOARD_OPULO_LUMEN_REV4 4241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 4242 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 4243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 4244 // TRONXY V10 (STM32F446ZE)
#define BOARD_ARMED 5200 // Arm'ed STM32F4-based controller
#define BOARD_RUMBA32_V1_0 5201 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_V1_1 5202 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_MKS 5203 // RUMBA32 STM32F446VE based controller from Makerbase
#define BOARD_RUMBA32_BTT 5204 // RUMBA32 STM32F446VE based controller from BIGTREETECH
#define BOARD_BLACK_STM32F407VE 5205 // BLACK_STM32F407VE
#define BOARD_BLACK_STM32F407ZE 5206 // BLACK_STM32F407ZE
#define BOARD_BTT_SKR_MINI_E3_V3_0_1 5207 // BigTreeTech SKR Mini E3 V3.0.1 (STM32F401RC)
#define BOARD_BTT_SKR_PRO_V1_1 5208 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
#define BOARD_BTT_SKR_PRO_V1_2 5209 // BigTreeTech SKR Pro v1.2 (STM32F407ZG)
#define BOARD_BTT_BTT002_V1_0 5210 // BigTreeTech BTT002 v1.0 (STM32F407VG)
#define BOARD_BTT_E3_RRF 5211 // BigTreeTech E3 RRF (STM32F407VG)
#define BOARD_BTT_SKR_V2_0_REV_A 5212 // BigTreeTech SKR v2.0 Rev A (STM32F407VG)
#define BOARD_BTT_SKR_V2_0_REV_B 5213 // BigTreeTech SKR v2.0 Rev B (STM32F407VG/STM32F429VG)
#define BOARD_BTT_GTR_V1_0 5214 // BigTreeTech GTR v1.0 (STM32F407IGT)
#define BOARD_BTT_OCTOPUS_V1_0 5215 // BigTreeTech Octopus v1.0 (STM32F446ZE)
#define BOARD_BTT_OCTOPUS_V1_1 5216 // BigTreeTech Octopus v1.1 (STM32F446ZE)
#define BOARD_BTT_OCTOPUS_PRO_V1_0 5217 // BigTreeTech Octopus Pro v1.0 (STM32F446ZE / STM32F429ZG)
#define BOARD_LERDGE_K 5218 // Lerdge K (STM32F407ZG)
#define BOARD_LERDGE_S 5219 // Lerdge S (STM32F407VE)
#define BOARD_LERDGE_X 5220 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 5221 // VAkE 403D (STM32F446VE)
#define BOARD_FYSETC_S6 5222 // FYSETC S6 (STM32F446VE)
#define BOARD_FYSETC_S6_V2_0 5223 // FYSETC S6 v2.0 (STM32F446VE)
#define BOARD_FYSETC_SPIDER 5224 // FYSETC Spider (STM32F446VE)
#define BOARD_FLYF407ZG 5225 // FLYmaker FLYF407ZG (STM32F407ZG)
#define BOARD_MKS_ROBIN2 5226 // MKS_ROBIN2 (STM32F407ZE)
#define BOARD_MKS_ROBIN_PRO_V2 5227 // MKS Robin Pro V2 (STM32F407VE)
#define BOARD_MKS_ROBIN_NANO_V3 5228 // MKS Robin Nano V3 (STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V3_1 5229 // MKS Robin Nano V3.1 (STM32F407VE)
#define BOARD_MKS_MONSTER8_V1 5230 // MKS Monster8 V1 (STM32F407VE)
#define BOARD_MKS_MONSTER8_V2 5231 // MKS Monster8 V2 (STM32F407VE)
#define BOARD_ANET_ET4 5232 // ANET ET4 V1.x (STM32F407VG)
#define BOARD_ANET_ET4P 5233 // ANET ET4P V1.x (STM32F407VG)
#define BOARD_FYSETC_CHEETAH_V20 5234 // FYSETC Cheetah V2.0 (STM32F401RC)
#define BOARD_TH3D_EZBOARD_V2 5235 // TH3D EZBoard v2.0 (STM32F405RG)
#define BOARD_OPULO_LUMEN_REV3 5236 // Opulo Lumen PnP Controller REV3 (STM32F407VE / STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V1_3_F4 5237 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE)
#define BOARD_MKS_EAGLE 5238 // MKS Eagle (STM32F407VE)
#define BOARD_ARTILLERY_RUBY 5239 // Artillery Ruby (STM32F401RC)
#define BOARD_FYSETC_SPIDER_V2_2 5240 // FYSETC Spider V2.2 (STM32F446VE)
#define BOARD_CREALITY_V24S1_301F4 5241 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
#define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 5245 // TRONXY V10 (STM32F446ZE)
//
// ARM Cortex M7
// ARM Cortex-M7
//
#define BOARD_REMRAM_V1 5000 // RemRam v1
#define BOARD_TEENSY41 5001 // Teensy 4.1
#define BOARD_T41U5XBB 5002 // T41U5XBB Teensy 4.1 breakout board
#define BOARD_NUCLEO_F767ZI 5003 // ST NUCLEO-F767ZI Dev Board
#define BOARD_BTT_SKR_SE_BX_V2 5004 // BigTreeTech SKR SE BX V2.0 (STM32H743II)
#define BOARD_BTT_SKR_SE_BX_V3 5005 // BigTreeTech SKR SE BX V3.0 (STM32H743II)
#define BOARD_BTT_SKR_V3_0 5006 // BigTreeTech SKR V3.0 (STM32H743VG)
#define BOARD_BTT_SKR_V3_0_EZ 5007 // BigTreeTech SKR V3.0 EZ (STM32H743VG)
#define BOARD_REMRAM_V1 6000 // RemRam v1
#define BOARD_TEENSY41 6001 // Teensy 4.1
#define BOARD_T41U5XBB 6002 // T41U5XBB Teensy 4.1 breakout board
#define BOARD_NUCLEO_F767ZI 6003 // ST NUCLEO-F767ZI Dev Board
#define BOARD_BTT_SKR_SE_BX_V2 6004 // BigTreeTech SKR SE BX V2.0 (STM32H743II)
#define BOARD_BTT_SKR_SE_BX_V3 6005 // BigTreeTech SKR SE BX V3.0 (STM32H743II)
#define BOARD_BTT_SKR_V3_0 6006 // BigTreeTech SKR V3.0 (STM32H743VG)
#define BOARD_BTT_SKR_V3_0_EZ 6007 // BigTreeTech SKR V3.0 EZ (STM32H743VG)
//
// Espressif ESP32 WiFi
//
#define BOARD_ESPRESSIF_ESP32 6000 // Generic ESP32
#define BOARD_MRR_ESPA 6001 // MRR ESPA based on ESP32 (native pins only)
#define BOARD_MRR_ESPE 6002 // MRR ESPE based on ESP32 (with I2S stepper stream)
#define BOARD_E4D_BOX 6003 // E4d@BOX
#define BOARD_RESP32_CUSTOM 6004 // Rutilea ESP32 custom board
#define BOARD_FYSETC_E4 6005 // FYSETC E4
#define BOARD_PANDA_ZHU 6006 // Panda_ZHU
#define BOARD_PANDA_M4 6007 // Panda_M4
#define BOARD_MKS_TINYBEE 6008 // MKS TinyBee based on ESP32 (with I2S stepper stream)
#define BOARD_ENWI_ESPNP 6009 // enwi ESPNP based on ESP32 (with I2S stepper stream)
#define BOARD_ESPRESSIF_ESP32 7000 // Generic ESP32
#define BOARD_MRR_ESPA 7001 // MRR ESPA based on ESP32 (native pins only)
#define BOARD_MRR_ESPE 7002 // MRR ESPE based on ESP32 (with I2S stepper stream)
#define BOARD_E4D_BOX 7003 // E4d@BOX
#define BOARD_RESP32_CUSTOM 7004 // Rutilea ESP32 custom board
#define BOARD_FYSETC_E4 7005 // FYSETC E4
#define BOARD_PANDA_ZHU 7006 // Panda_ZHU
#define BOARD_PANDA_M4 7007 // Panda_M4
#define BOARD_MKS_TINYBEE 7008 // MKS TinyBee based on ESP32 (with I2S stepper stream)
#define BOARD_ENWI_ESPNP 7009 // enwi ESPNP based on ESP32 (with I2S stepper stream)
//
// SAMD51 ARM Cortex M4
// SAMD51 ARM Cortex-M4
//
#define BOARD_AGCM4_RAMPS_144 6100 // RAMPS 1.4.4
#define BOARD_BRICOLEMON_V1_0 6101 // Bricolemon
#define BOARD_BRICOLEMON_LITE_V1_0 6102 // Bricolemon Lite
#define BOARD_AGCM4_RAMPS_144 7100 // RAMPS 1.4.4
#define BOARD_BRICOLEMON_V1_0 7101 // Bricolemon
#define BOARD_BRICOLEMON_LITE_V1_0 7102 // Bricolemon Lite
//
// SAMD21 ARM Cortex M4
// SAMD21 ARM Cortex-M4
//
#define BOARD_MINITRONICS20 6103 // Minitronics v2.0
#define BOARD_MINITRONICS20 7103 // Minitronics v2.0
//
// Custom board
+1
View File
@@ -55,6 +55,7 @@
// eu Basque-Euskera
// fi Finnish
// fr French
// fr_na French without accents (DWIN T5UID1 touchscreen)
// gl Galician
// hr Croatian
// hu Hungarian
+21 -5
View File
@@ -634,7 +634,9 @@
#define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()()
// Force define expansion
#define EVAL(V...) EVAL16(V)
#define EVAL EVAL16
#define EVAL4096(V...) EVAL2048(EVAL2048(V))
#define EVAL2048(V...) EVAL1024(EVAL1024(V))
#define EVAL1024(V...) EVAL512(EVAL512(V))
#define EVAL512(V...) EVAL256(EVAL256(V))
#define EVAL256(V...) EVAL128(EVAL128(V))
@@ -712,10 +714,24 @@
( DEFER2(__RREPEAT2)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP,V) ) \
( /* Do nothing */ )
#define __RREPEAT2() _RREPEAT2
#define RREPEAT_S(S,N,OP) EVAL1024(_RREPEAT(S,SUB##S(N),OP))
#define RREPEAT(N,OP) RREPEAT_S(0,N,OP)
#define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V))
#define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V)
#define RREPEAT_S(S,N,OP) EVAL1024(_RREPEAT(S,SUB##S(N),OP))
#define RREPEAT(N,OP) RREPEAT_S(0,N,OP)
#define RREPEAT_1(N,OP) RREPEAT_S(1,INCREMENT(N),OP)
#define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V))
#define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V)
// Emit a list of N OP(I) items with ascending counter.
#define _REPLIST(_RPT_I,_RPT_N,_RPT_OP) \
_RPT_OP(_RPT_I) \
IF_ELSE(SUB1(_RPT_N)) \
( , DEFER2(__REPLIST)()(ADD1(_RPT_I),SUB1(_RPT_N),_RPT_OP) ) \
( /* Do nothing */ )
#define __REPLIST() _REPLIST
// Repeat a macro, comma-separated, passing S...N-1.
#define REPLIST_S(S,N,OP) EVAL(_REPLIST(S,SUB##S(N),OP))
#define REPLIST(N,OP) REPLIST_S(0,N,OP)
#define REPLIST_1(N,OP) REPLIST_S(1,INCREMENT(N),OP)
// Call OP(A) with each item as an argument
#define _MAP(_MAP_OP,A,V...) \
+34 -29
View File
@@ -31,10 +31,8 @@
//
// typename IF<(MYOPT==12), int, float>::type myvar;
//
template <bool, class L, class R>
struct IF { typedef R type; };
template <class L, class R>
struct IF<true, L, R> { typedef L type; };
template <bool, class L, class R> struct IF { typedef R type; };
template <class L, class R> struct IF<true, L, R> { typedef L type; };
#define ALL_AXIS_NAMES X, X2, Y, Y2, Z, Z2, Z3, Z4, I, J, K, U, V, W, E0, E1, E2, E3, E4, E5, E6, E7
@@ -44,7 +42,7 @@ struct IF<true, L, R> { typedef L type; };
#define NUM_AXIS_LIST_1(V) LIST_N_1(NUM_AXES, V)
#define NUM_AXIS_ARRAY(V...) { NUM_AXIS_LIST(V) }
#define NUM_AXIS_ARRAY_1(V) { NUM_AXIS_LIST_1(V) }
#define NUM_AXIS_ARGS(T...) NUM_AXIS_LIST(T x, T y, T z, T i, T j, T k, T u, T v, T w)
#define NUM_AXIS_ARGS(T) NUM_AXIS_LIST(T x, T y, T z, T i, T j, T k, T u, T v, T w)
#define NUM_AXIS_ELEM(O) NUM_AXIS_LIST(O.x, O.y, O.z, O.i, O.j, O.k, O.u, O.v, O.w)
#define NUM_AXIS_DEFS(T,V) NUM_AXIS_LIST(T x=V, T y=V, T z=V, T i=V, T j=V, T k=V, T u=V, T v=V, T w=V)
#define MAIN_AXIS_NAMES NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W)
@@ -57,7 +55,7 @@ struct IF<true, L, R> { typedef L type; };
#define LOGICAL_AXIS_LIST_1(V) NUM_AXIS_LIST_1(V) LIST_ITEM_E(V)
#define LOGICAL_AXIS_ARRAY(E,V...) { LOGICAL_AXIS_LIST(E,V) }
#define LOGICAL_AXIS_ARRAY_1(V) { LOGICAL_AXIS_LIST_1(V) }
#define LOGICAL_AXIS_ARGS(T...) LOGICAL_AXIS_LIST(T e, T x, T y, T z, T i, T j, T k, T u, T v, T w)
#define LOGICAL_AXIS_ARGS(T) LOGICAL_AXIS_LIST(T e, T x, T y, T z, T i, T j, T k, T u, T v, T w)
#define LOGICAL_AXIS_ELEM(O) LOGICAL_AXIS_LIST(O.e, O.x, O.y, O.z, O.i, O.j, O.k, O.u, O.v, O.w)
#define LOGICAL_AXIS_DECL(T,V) LOGICAL_AXIS_LIST(T e=V, T x=V, T y=V, T z=V, T i=V, T j=V, T k=V, T u=V, T v=V, T w=V)
#define LOGICAL_AXIS_NAMES LOGICAL_AXIS_LIST(E, X, Y, Z, I, J, K, U, V, W)
@@ -86,24 +84,31 @@ struct IF<true, L, R> { typedef L type; };
#define AXIS_COLLISION(L) (AXIS4_NAME == L || AXIS5_NAME == L || AXIS6_NAME == L || AXIS7_NAME == L || AXIS8_NAME == L || AXIS9_NAME == L)
// Define types based on largest bit width stored value required
#define bits_t(W) typename IF<((W)> 16), uint32_t, typename IF<((W)> 8), uint16_t, uint8_t>::type>::type
#define uvalue_t(V) typename IF<((V)>65535), uint32_t, typename IF<((V)>255), uint16_t, uint8_t>::type>::type
#define value_t(V) typename IF<((V)>32767), int32_t, typename IF<((V)>127), int16_t, int8_t>::type>::type
// General Flags for some number of states
template<size_t N>
struct Flags {
typedef typename IF<(N>8), uint16_t, uint8_t>::type bits_t;
typedef value_t(N) flagbits_t;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; } N8;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1; } N16;
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1,
b16:1, b17:1, b18:1, b19:1, b20:1, b21:1, b22:1, b23:1, b24:1, b25:1, b26:1, b27:1, b28:1, b29:1, b30:1, b31:1; } N32;
union {
bits_t b;
typename IF<(N>8), N16, N8>::type flag;
flagbits_t b;
typename IF<(N>16), N32, typename IF<(N>8), N16, N8>::type>::type flag;
};
void reset() { b = 0; }
void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
void set(const int n) { b |= (bits_t)_BV(n); }
void clear(const int n) { b &= ~(bits_t)_BV(n); }
bool test(const int n) const { return TEST(b, n); }
bool operator[](const int n) { return test(n); }
bool operator[](const int n) const { return test(n); }
int size() const { return sizeof(b); }
void reset() { b = 0; }
void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
void set(const int n) { b |= (flagbits_t)_BV(n); }
void clear(const int n) { b &= ~(flagbits_t)_BV(n); }
bool test(const int n) const { return TEST(b, n); }
bool operator[](const int n) { return test(n); }
bool operator[](const int n) const { return test(n); }
int size() const { return sizeof(b); }
};
// Specialization for a single bool flag
@@ -129,14 +134,14 @@ typedef struct AxisFlags {
struct Flags<LOGICAL_AXES> flags;
struct { bool LOGICAL_AXIS_LIST(e:1, x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1); };
};
void reset() { flags.reset(); }
void set(const int n) { flags.set(n); }
void set(const int n, const bool onoff) { flags.set(n, onoff); }
void clear(const int n) { flags.clear(n); }
bool test(const int n) const { return flags.test(n); }
bool operator[](const int n) { return flags[n]; }
bool operator[](const int n) const { return flags[n]; }
int size() const { return sizeof(flags); }
void reset() { flags.reset(); }
void set(const int n) { flags.set(n); }
void set(const int n, const bool onoff) { flags.set(n, onoff); }
void clear(const int n) { flags.clear(n); }
bool test(const int n) const { return flags.test(n); }
bool operator[](const int n) { return flags[n]; }
bool operator[](const int n) const { return flags[n]; }
int size() const { return sizeof(flags); }
} axis_flags_t;
//
@@ -182,15 +187,15 @@ enum AxisEnum : uint8_t {
, ALL_AXES_ENUM = 0xFE, NO_AXIS_ENUM = 0xFF
};
typedef IF<(NUM_AXIS_ENUMS > 8), uint16_t, uint8_t>::type axis_bits_t;
typedef bits_t(NUM_AXIS_ENUMS) axis_bits_t;
//
// Loop over axes
//
#define LOOP_ABC(VAR) LOOP_S_LE_N(VAR, A_AXIS, C_AXIS)
#define LOOP_NUM_AXES(VAR) LOOP_S_L_N(VAR, X_AXIS, NUM_AXES)
#define LOOP_LOGICAL_AXES(VAR) LOOP_S_L_N(VAR, X_AXIS, LOGICAL_AXES)
#define LOOP_DISTINCT_AXES(VAR) LOOP_S_L_N(VAR, X_AXIS, DISTINCT_AXES)
#define LOOP_NUM_AXES(VAR) LOOP_S_L_N(VAR, 0, NUM_AXES)
#define LOOP_LOGICAL_AXES(VAR) LOOP_S_L_N(VAR, 0, LOGICAL_AXES)
#define LOOP_DISTINCT_AXES(VAR) LOOP_S_L_N(VAR, 0, DISTINCT_AXES)
#define LOOP_DISTINCT_E(VAR) LOOP_L_N(VAR, DISTINCT_E)
//
+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");
+6 -6
View File
@@ -38,12 +38,12 @@ void safe_delay(millis_t ms); // Delay ensuring that temperatures are
// 16x16 bit arrays
template <int W, int H>
struct FlagBits {
typename IF<(W>8), uint16_t, uint8_t>::type bits[H];
void fill() { memset(bits, 0xFF, sizeof(bits)); }
void reset() { memset(bits, 0x00, sizeof(bits)); }
void unmark(const uint8_t x, const uint8_t y) { CBI(bits[y], x); }
void mark(const uint8_t x, const uint8_t y) { SBI(bits[y], x); }
bool marked(const uint8_t x, const uint8_t y) { return TEST(bits[y], x); }
bits_t(W) flags[H];
void fill() { memset(flags, 0xFF, sizeof(flags)); }
void reset() { memset(flags, 0x00, sizeof(flags)); }
void unmark(const uint8_t x, const uint8_t y) { CBI(flags[y], x); }
void mark(const uint8_t x, const uint8_t y) { SBI(flags[y], x); }
bool marked(const uint8_t x, const uint8_t y) { return TEST(flags[y], x); }
inline void unmark(const xy_int8_t &xy) { unmark(xy.x, xy.y); }
inline void mark(const xy_int8_t &xy) { mark(xy.x, xy.y); }
inline bool marked(const xy_int8_t &xy) { return marked(xy.x, xy.y); }
+1 -1
View File
@@ -153,7 +153,7 @@ void LevelingBilinear::extrapolate_unprobed_bed_level() {
}
}
void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values /*= NULL*/) {
void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values/*=nullptr*/) {
// print internal grid(s) or just the one passed as a parameter
SERIAL_ECHOLNPGM("Bilinear Leveling Grid:");
print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, _z_values ? *_z_values[0] : z_values[0]);
+1 -1
View File
@@ -53,7 +53,7 @@ public:
static void reset();
static void set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start);
static void extrapolate_unprobed_bed_level();
static void print_leveling_grid(const bed_mesh_t* _z_values = NULL);
static void print_leveling_grid(const bed_mesh_t *_z_values=nullptr);
static void refresh_bed_level();
static bool has_mesh() { return !!grid_spacing.x; }
static bool mesh_is_valid() { return has_mesh(); }
@@ -32,8 +32,8 @@ enum MeshLevelingState : char {
MeshReset // G29 S5
};
#define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_CELLS_X))
#define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y))
#define MESH_X_DIST (float((MESH_MAX_X) - (MESH_MIN_X)) / (GRID_MAX_CELLS_X))
#define MESH_Y_DIST (float((MESH_MAX_Y) - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y))
class mesh_bed_leveling {
public:
+5 -5
View File
@@ -38,8 +38,8 @@ enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP, CLOSEST };
struct mesh_index_pair;
#define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / (GRID_MAX_CELLS_X))
#define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y))
#define MESH_X_DIST (float((MESH_MAX_X) - (MESH_MIN_X)) / (GRID_MAX_CELLS_X))
#define MESH_Y_DIST (float((MESH_MAX_Y) - (MESH_MIN_Y)) / (GRID_MAX_CELLS_Y))
#if ENABLED(OPTIMIZED_MESH_STORAGE)
typedef int16_t mesh_store_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
@@ -264,9 +264,9 @@ public:
return UBL_Z_RAISE_WHEN_OFF_MESH;
#endif
const uint8_t mx = _MIN(cx, (GRID_MAX_POINTS_X) - 2) + 1, my = _MIN(cy, (GRID_MAX_POINTS_Y) - 2) + 1,
x0 = get_mesh_x(cx), x1 = get_mesh_x(cx + 1);
const float z1 = calc_z0(rx0, x0, z_values[cx][cy], x1, z_values[mx][cy]),
const uint8_t mx = _MIN(cx, (GRID_MAX_POINTS_X) - 2) + 1, my = _MIN(cy, (GRID_MAX_POINTS_Y) - 2) + 1;
const float x0 = get_mesh_x(cx), x1 = get_mesh_x(cx + 1),
z1 = calc_z0(rx0, x0, z_values[cx][cy], x1, z_values[mx][cy]),
z2 = calc_z0(rx0, x0, z_values[cx][my], x1, z_values[mx][my]);
float z0 = calc_z0(ry0, get_mesh_y(cy), z1, get_mesh_y(cy + 1), z2);
+44 -20
View File
@@ -318,9 +318,7 @@ void unified_bed_leveling::G29() {
TERN_(HAS_MULTI_HOTEND, if (active_extruder != 0) tool_change(0, true));
// Position bed horizontally and Z probe vertically.
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
|| defined(SAFE_BED_LEVELING_START_I) || defined(SAFE_BED_LEVELING_START_J) || defined(SAFE_BED_LEVELING_START_K) \
|| defined(SAFE_BED_LEVELING_START_U) || defined(SAFE_BED_LEVELING_START_V) || defined(SAFE_BED_LEVELING_START_W)
#if HAS_SAFE_BED_LEVELING
xyze_pos_t safe_position = current_position;
#ifdef SAFE_BED_LEVELING_START_X
safe_position.x = SAFE_BED_LEVELING_START_X;
@@ -351,7 +349,7 @@ void unified_bed_leveling::G29() {
#endif
do_blocking_move_to(safe_position);
#endif
#endif // HAS_SAFE_BED_LEVELING
}
// Invalidate one or more nearby mesh points, possibly all.
@@ -887,8 +885,32 @@ void set_message_with_feedback(FSTR_P const fstr) {
ui.capture();
save_ubl_active_state_and_disable(); // Disable bed level correction for probing
do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), MANUAL_PROBE_START_Z);
//, _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f);
do_blocking_move_to(
NUM_AXIS_LIST(
0.5f * ((MESH_MAX_X) - (MESH_MIN_X)),
0.5f * ((MESH_MAX_Y) - (MESH_MIN_Y)),
MANUAL_PROBE_START_Z
#ifdef SAFE_BED_LEVELING_START_I
, SAFE_BED_LEVELING_START_I
#endif
#ifdef SAFE_BED_LEVELING_START_J
, SAFE_BED_LEVELING_START_J
#endif
#ifdef SAFE_BED_LEVELING_START_K
, SAFE_BED_LEVELING_START_K
#endif
#ifdef SAFE_BED_LEVELING_START_U
, SAFE_BED_LEVELING_START_U
#endif
#ifdef SAFE_BED_LEVELING_START_V
, SAFE_BED_LEVELING_START_V
#endif
#ifdef SAFE_BED_LEVELING_START_W
, SAFE_BED_LEVELING_START_W
#endif
)
//, _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f
);
planner.synchronize();
SERIAL_ECHOPGM("Place shim under nozzle");
@@ -1456,9 +1478,17 @@ void unified_bed_leveling::smart_fill_mesh() {
#include "../../../libs/vector_3.h"
void unified_bed_leveling::tilt_mesh_based_on_probed_grid(const bool do_3_pt_leveling) {
const float x_min = probe.min_x(), x_max = probe.max_x(),
y_min = probe.min_y(), y_max = probe.max_y(),
dx = (x_max - x_min) / (param.J_grid_size - 1),
#ifdef G29J_MESH_TILT_MARGIN
const float x_min = _MAX(probe.min_x() + (G29J_MESH_TILT_MARGIN), X_MIN_POS),
x_max = _MIN(probe.max_x() - (G29J_MESH_TILT_MARGIN), X_MAX_POS),
y_min = _MAX(probe.min_y() + (G29J_MESH_TILT_MARGIN), Y_MIN_POS),
y_max = _MIN(probe.max_y() - (G29J_MESH_TILT_MARGIN), Y_MAX_POS);
#else
const float x_min = probe.min_x(), x_max = probe.max_x(),
y_min = probe.min_y(), y_max = probe.max_y();
#endif
const float dx = (x_max - x_min) / (param.J_grid_size - 1),
dy = (y_max - y_min) / (param.J_grid_size - 1);
xy_float_t points[3];
@@ -1467,7 +1497,7 @@ void unified_bed_leveling::smart_fill_mesh() {
float measured_z;
bool abort_flag = false;
#ifdef VALIDATE_MESH_TILT
#if ENABLED(VALIDATE_MESH_TILT)
float z1, z2, z3; // Needed for algorithm validation below
#endif
@@ -1483,9 +1513,7 @@ void unified_bed_leveling::smart_fill_mesh() {
abort_flag = true;
else {
measured_z -= get_z_correction(points[0]);
#ifdef VALIDATE_MESH_TILT
z1 = measured_z;
#endif
TERN_(VALIDATE_MESH_TILT, z1 = measured_z);
if (param.V_verbosity > 3) {
serial_spaces(16);
SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
@@ -1498,9 +1526,7 @@ void unified_bed_leveling::smart_fill_mesh() {
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, param.V_verbosity);
#ifdef VALIDATE_MESH_TILT
z2 = measured_z;
#endif
TERN_(VALIDATE_MESH_TILT, z2 = measured_z);
if (isnan(measured_z))
abort_flag = true;
else {
@@ -1518,9 +1544,7 @@ void unified_bed_leveling::smart_fill_mesh() {
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
measured_z = probe.probe_at_point(points[2], PROBE_PT_LAST_STOW, param.V_verbosity);
#ifdef VALIDATE_MESH_TILT
z3 = measured_z;
#endif
TERN_(VALIDATE_MESH_TILT, z3 = measured_z);
if (isnan(measured_z))
abort_flag = true;
else {
@@ -1667,7 +1691,7 @@ void unified_bed_leveling::smart_fill_mesh() {
* The Z error between the probed point locations and the get_z_correction()
* numbers for those locations should be 0.
*/
#ifdef VALIDATE_MESH_TILT
#if ENABLED(VALIDATE_MESH_TILT)
auto d_from = []{ DEBUG_ECHOPGM("D from "); };
auto normed = [&](const xy_pos_t &pos, const_float_t zadd) {
return normal.x * pos.x + normal.y * pos.y + zadd;
+2 -5
View File
@@ -80,9 +80,6 @@ namespace DirectStepping {
static void set_page_state(const page_idx_t page_idx, const PageState page_state);
};
template<bool b, typename T, typename F> struct TypeSelector { typedef T type;} ;
template<typename T, typename F> struct TypeSelector<false, T, F> { typedef F type; };
template <int num_pages, int num_axes, int bits_segment, bool dir, int segments>
struct config_t {
static constexpr char CONTROL_CHAR = '!';
@@ -98,8 +95,8 @@ namespace DirectStepping {
static constexpr int TOTAL_STEPS = SEGMENT_STEPS * SEGMENTS;
static constexpr int PAGE_SIZE = (AXIS_COUNT * BITS_SEGMENT * SEGMENTS) / 8;
typedef typename TypeSelector<(PAGE_SIZE>256), uint16_t, uint8_t>::type write_byte_idx_t;
typedef typename TypeSelector<(PAGE_COUNT>256), uint16_t, uint8_t>::type page_idx_t;
typedef uvalue_t(PAGE_SIZE - 1) write_byte_idx_t;
typedef uvalue_t(PAGE_COUNT - 1) page_idx_t;
};
template <uint8_t num_pages>
+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
+9 -1
View File
@@ -54,7 +54,15 @@ Adafruit_NeoPixel Marlin_NeoPixel::adaneo1(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIX
set_background_color(background_color);
}
#endif
void Marlin_NeoPixel::set_background_off() {
#ifndef NEOPIXEL_BKGD_TIMEOUT_COLOR
#define NEOPIXEL_BKGD_TIMEOUT_COLOR { 0, 0, 0, 0 }
#endif
constexpr uint8_t background_color_off[4] = NEOPIXEL_BKGD_TIMEOUT_COLOR;
set_background_color(background_color_off);
}
#endif // NEOPIXEL_BKGD_INDEX_FIRST
void Marlin_NeoPixel::set_color(const uint32_t color) {
if (neoindex >= 0) {
+2 -1
View File
@@ -66,7 +66,7 @@
// Types
// ------------------------
typedef IF<(TERN0(NEOPIXEL_LED, NEOPIXEL_PIXELS > 127)), int16_t, int8_t>::type pixel_index_t;
typedef value_t(TERN0(NEOPIXEL_LED, NEOPIXEL_PIXELS)) pixel_index_t;
// ------------------------
// Classes
@@ -91,6 +91,7 @@ public:
static void set_background_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w);
static void set_background_color(const uint8_t (&rgbw)[4]) { set_background_color(rgbw[0], rgbw[1], rgbw[2], rgbw[3]); }
static void reset_background_color();
static void set_background_off();
#endif
static void begin() {
+1 -1
View File
@@ -471,7 +471,7 @@ void Max7219::register_setup() {
constexpr millis_t pattern_delay = 4;
int8_t spiralx, spiraly, spiral_dir;
IF<(MAX7219_LEDS > 255), uint16_t, uint8_t>::type spiral_count;
uvalue_t(MAX7219_LEDS) spiral_count;
void Max7219::test_pattern() {
constexpr int8_t way[][2] = { { 1, 0 }, { 0, 1 }, { -1, 0 }, { 0, -1 } };
+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) {
+13 -4
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();
+57 -39
View File
@@ -31,9 +31,13 @@
#include "powerloss.h"
#include "../core/macros.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h"
#endif
bool PrintJobRecovery::enabled; // Initialized by settings.load()
SdFile PrintJobRecovery::file;
MediaFile PrintJobRecovery::file;
job_recovery_info_t PrintJobRecovery::info;
const char PrintJobRecovery::filename[5] = "/PLR";
uint8_t PrintJobRecovery::queue_index_r;
@@ -78,6 +82,14 @@ PrintJobRecovery recovery;
#define POWER_LOSS_RETRACT_LEN 0
#endif
// Allow power-loss recovery to be aborted
#define PLR_CAN_ABORT
#if ENABLED(PLR_CAN_ABORT)
#define PROCESS_SUBCOMMANDS_NOW(cmd) do { if (card.flag.abort_sd_printing) return; gcode.process_subcommands_now(cmd); }while(0)
#else
#define PROCESS_SUBCOMMANDS_NOW(cmd) gcode.process_subcommands_now(cmd)
#endif
/**
* Clear the recovery info
*/
@@ -305,6 +317,9 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
// and a flag whether the raise was already done here.
if (IS_SD_PRINTING()) save(true, zraise, ENABLED(BACKUP_POWER_SUPPLY));
// Tell the LCD about the outage, even though it is about to die
TERN_(EXTENSIBLE_UI, ExtUI::onPowerLoss());
// Disable all heaters to reduce power loss
thermalManager.disable_all_heaters();
@@ -352,12 +367,23 @@ void PrintJobRecovery::resume() {
// Apply the dry-run flag if enabled
if (info.flag.dryrun) marlin_debug_flags |= MARLIN_DEBUG_DRYRUN;
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
struct OnExit {
uint8_t old_flags;
OnExit() {
old_flags = marlin_debug_flags;
marlin_debug_flags |= MARLIN_DEBUG_ECHO;
}
~OnExit() { marlin_debug_flags = old_flags; }
} on_exit;
#endif
// Restore cold extrusion permission
TERN_(PREVENT_COLD_EXTRUSION, thermalManager.allow_cold_extrude = info.flag.allow_cold_extrusion);
#if HAS_LEVELING
// Make sure leveling is off before any G92 and G28
gcode.process_subcommands_now(F("M420 S0 Z0"));
PROCESS_SUBCOMMANDS_NOW(F("M420S0"));
#endif
#if HAS_HEATED_BED
@@ -365,7 +391,7 @@ void PrintJobRecovery::resume() {
if (bt) {
// Restore the bed temperature
sprintf_P(cmd, PSTR("M190S%i"), bt);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
#endif
@@ -376,10 +402,10 @@ void PrintJobRecovery::resume() {
if (et) {
#if HAS_MULTI_HOTEND
sprintf_P(cmd, PSTR("T%iS"), e);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#endif
sprintf_P(cmd, PSTR("M109S%i"), et);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
}
#endif
@@ -393,7 +419,7 @@ void PrintJobRecovery::resume() {
// establish the current position as best we can.
//
gcode.process_subcommands_now(F("G92.9E0")); // Reset E to 0
PROCESS_SUBCOMMANDS_NOW(F("G92.9E0")); // Reset E to 0
#if Z_HOME_TO_MAX
@@ -404,7 +430,7 @@ void PrintJobRecovery::resume() {
"G28R0\n" // Home all axes (no raise)
"G1Z%sF1200" // Move Z down to (raised) height
), dtostrf(z_now, 1, 3, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#elif DISABLED(BELTPRINTER)
@@ -417,18 +443,18 @@ void PrintJobRecovery::resume() {
#if !HOMING_Z_DOWN
// Set Z to the real position
sprintf_P(cmd, PSTR("G92.9Z%s"), dtostrf(z_now, 1, 3, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#endif
// Does Z need to be raised now? It should be raised before homing XY.
if (z_raised > z_now) {
z_now = z_raised;
sprintf_P(cmd, PSTR("G1Z%sF600"), dtostrf(z_now, 1, 3, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
// Home XY with no Z raise
gcode.process_subcommands_now(F("G28R0XY")); // No raise during G28
PROCESS_SUBCOMMANDS_NOW(F("G28R0XY")); // No raise during G28
#endif
@@ -436,7 +462,7 @@ void PrintJobRecovery::resume() {
// Move to a safe XY position and home Z while avoiding the print.
const xy_pos_t p = xy_pos_t(POWER_LOSS_ZHOME_POS) TERN_(HOMING_Z_WITH_PROBE, - probe.offset_xy);
sprintf_P(cmd, PSTR("G1X%sY%sF1000\nG28HZ"), dtostrf(p.x, 1, 3, str_1), dtostrf(p.y, 1, 3, str_2));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#endif
// Mark all axes as having been homed (no effect on current_position)
@@ -447,12 +473,12 @@ void PrintJobRecovery::resume() {
// Leveling may already be enabled due to the ENABLE_LEVELING_AFTER_G28 option.
// TODO: Add a G28 parameter to leave leveling disabled.
sprintf_P(cmd, PSTR("M420S%cZ%s"), '0' + (char)info.flag.leveling, dtostrf(info.fade, 1, 1, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#if !HOMING_Z_DOWN
// The physical Z was adjusted at power-off so undo the M420S1 correction to Z with G92.9.
sprintf_P(cmd, PSTR("G92.9Z%s"), dtostrf(z_now, 1, 1, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#endif
#endif
@@ -460,7 +486,7 @@ void PrintJobRecovery::resume() {
// Z was homed down to the bed, so move up to the raised height.
z_now = z_raised;
sprintf_P(cmd, PSTR("G1Z%sF600"), dtostrf(z_now, 1, 3, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#endif
// Recover volumetric extrusion state
@@ -468,16 +494,16 @@ void PrintJobRecovery::resume() {
#if HAS_MULTI_EXTRUDER
EXTRUDER_LOOP() {
sprintf_P(cmd, PSTR("M200T%iD%s"), e, dtostrf(info.filament_size[e], 1, 3, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
if (!info.flag.volumetric_enabled) {
sprintf_P(cmd, PSTR("M200T%iD0"), info.active_extruder);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
#else
if (info.flag.volumetric_enabled) {
sprintf_P(cmd, PSTR("M200D%s"), dtostrf(info.filament_size[0], 1, 3, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
#endif
#endif
@@ -489,10 +515,10 @@ void PrintJobRecovery::resume() {
if (et) {
#if HAS_MULTI_HOTEND
sprintf_P(cmd, PSTR("T%iS"), e);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#endif
sprintf_P(cmd, PSTR("M109S%i"), et);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
}
#endif
@@ -500,7 +526,7 @@ void PrintJobRecovery::resume() {
// Restore the previously active tool (with no_move)
#if HAS_MULTI_EXTRUDER || HAS_MULTI_HOTEND
sprintf_P(cmd, PSTR("T%i S"), info.active_extruder);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#endif
// Restore print cooling fan speeds
@@ -509,7 +535,7 @@ void PrintJobRecovery::resume() {
const int f = info.fan_speed[i];
if (f) {
sprintf_P(cmd, PSTR("M106P%iS%i"), i, f);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
}
#endif
@@ -531,17 +557,17 @@ void PrintJobRecovery::resume() {
// Un-retract if there was a retract at outage
#if ENABLED(BACKUP_POWER_SUPPLY) && POWER_LOSS_RETRACT_LEN > 0
gcode.process_subcommands_now(F("G1F3000E" STRINGIFY(POWER_LOSS_RETRACT_LEN)));
PROCESS_SUBCOMMANDS_NOW(F("G1F3000E" STRINGIFY(POWER_LOSS_RETRACT_LEN)));
#endif
// Additional purge on resume if configured
#if POWER_LOSS_PURGE_LEN
sprintf_P(cmd, PSTR("G1F3000E%d"), (POWER_LOSS_PURGE_LEN) + (POWER_LOSS_RETRACT_LEN));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
#endif
#if ENABLED(NOZZLE_CLEAN_FEATURE)
gcode.process_subcommands_now(F("G12"));
PROCESS_SUBCOMMANDS_NOW(F("G12"));
#endif
// Move back over to the saved XY
@@ -549,19 +575,19 @@ void PrintJobRecovery::resume() {
dtostrf(info.current_position.x, 1, 3, str_1),
dtostrf(info.current_position.y, 1, 3, str_2)
);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
// Move back down to the saved Z for printing
sprintf_P(cmd, PSTR("G1Z%sF600"), dtostrf(z_print, 1, 3, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
// Restore the feedrate
sprintf_P(cmd, PSTR("G1F%d"), info.feedrate);
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
// Restore E position with G92.9
sprintf_P(cmd, PSTR("G92.9E%s"), dtostrf(info.current_position.e, 1, 3, str_1));
gcode.process_subcommands_now(cmd);
PROCESS_SUBCOMMANDS_NOW(cmd);
TERN_(GCODE_REPEAT_MARKERS, repeat = info.stored_repeat);
TERN_(HAS_HOME_OFFSET, home_offset = info.home_offset);
@@ -573,22 +599,14 @@ void PrintJobRecovery::resume() {
// Relative axis modes
gcode.axis_relative = info.axis_relative;
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
const uint8_t old_flags = marlin_debug_flags;
marlin_debug_flags |= MARLIN_DEBUG_ECHO;
#endif
// Continue to apply PLR when a file is resumed!
enable(true);
// Resume the SD file from the last position
char *fn = info.sd_filename;
sprintf_P(cmd, M23_STR, fn);
gcode.process_subcommands_now(cmd);
sprintf_P(cmd, M23_STR, &info.sd_filename[0]);
PROCESS_SUBCOMMANDS_NOW(cmd);
sprintf_P(cmd, PSTR("M24S%ldT%ld"), resume_sdpos, info.print_job_elapsed);
gcode.process_subcommands_now(cmd);
TERN_(DEBUG_POWER_LOSS_RECOVERY, marlin_debug_flags = old_flags);
PROCESS_SUBCOMMANDS_NOW(cmd);
}
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
+1 -1
View File
@@ -138,7 +138,7 @@ class PrintJobRecovery {
public:
static const char filename[5];
static SdFile file;
static MediaFile file;
static job_recovery_info_t info;
static uint8_t queue_index_r; //!< Queue index of the active command
+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
}
};
+1 -1
View File
@@ -141,7 +141,7 @@ void SpindleLaser::apply_power(const uint8_t opwr) {
else
ocr_off();
#elif ENABLED(SPINDLE_SERVO)
MOVE_SERVO(SPINDLE_SERVO_NR, power);
servo[SPINDLE_SERVO_NR].move(opwr);
#else
WRITE(SPINDLE_LASER_ENA_PIN, enabled() ? SPINDLE_LASER_ACTIVE_STATE : !SPINDLE_LASER_ACTIVE_STATE);
isReadyForUI = true;
+1 -1
View File
@@ -57,7 +57,7 @@
#endif
#endif
typedef IF<(SPEED_POWER_MAX > 255), uint16_t, uint8_t>::type cutter_cpower_t;
typedef uvalue_t(SPEED_POWER_MAX) cutter_cpower_t;
#if CUTTER_UNIT_IS(RPM) && SPEED_POWER_MAX > 255
typedef uint16_t cutter_power_t;
+4 -24
View File
@@ -29,31 +29,11 @@
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../core/debug_out.h"
PGMSTR(point_name_1, TRAMMING_POINT_NAME_1);
PGMSTR(point_name_2, TRAMMING_POINT_NAME_2);
PGMSTR(point_name_3, TRAMMING_POINT_NAME_3);
#ifdef TRAMMING_POINT_NAME_4
PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
#ifdef TRAMMING_POINT_NAME_5
PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
#ifdef TRAMMING_POINT_NAME_6
PGMSTR(point_name_6, TRAMMING_POINT_NAME_6);
#endif
#endif
#endif
#define _TRAM_NAME_DEF(N) PGMSTR(point_name_##N, TRAMMING_POINT_NAME_##N);
#define _TRAM_NAME_ITEM(N) point_name_##N
REPEAT_1(_NR_TRAM_NAMES, _TRAM_NAME_DEF)
PGM_P const tramming_point_name[] PROGMEM = {
point_name_1, point_name_2, point_name_3
#ifdef TRAMMING_POINT_NAME_4
, point_name_4
#ifdef TRAMMING_POINT_NAME_5
, point_name_5
#ifdef TRAMMING_POINT_NAME_6
, point_name_6
#endif
#endif
#endif
};
PGM_P const tramming_point_name[] PROGMEM = { REPLIST_1(_NR_TRAM_NAMES, _TRAM_NAME_ITEM) };
#ifdef ASSISTED_TRAMMING_WAIT_POSITION
+24 -33
View File
@@ -31,43 +31,34 @@
constexpr xy_pos_t tramming_points[] = TRAMMING_POINT_XY;
#define G35_PROBE_COUNT COUNT(tramming_points)
static_assert(WITHIN(G35_PROBE_COUNT, 3, 6), "TRAMMING_POINT_XY requires between 3 and 6 XY positions.");
static_assert(WITHIN(G35_PROBE_COUNT, 3, 9), "TRAMMING_POINT_XY requires between 3 and 9 XY positions.");
#define VALIDATE_TRAMMING_POINT(N) static_assert(N >= G35_PROBE_COUNT || Probe::build_time::can_reach(tramming_points[N]), \
"TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.")
VALIDATE_TRAMMING_POINT(0); VALIDATE_TRAMMING_POINT(1); VALIDATE_TRAMMING_POINT(2); VALIDATE_TRAMMING_POINT(3); VALIDATE_TRAMMING_POINT(4); VALIDATE_TRAMMING_POINT(5);
extern const char point_name_1[], point_name_2[], point_name_3[]
#ifdef TRAMMING_POINT_NAME_4
, point_name_4[]
#ifdef TRAMMING_POINT_NAME_5
, point_name_5[]
#ifdef TRAMMING_POINT_NAME_6
, point_name_6[]
#endif
#endif
#endif
;
#define _NR_TRAM_NAMES 2
#ifdef TRAMMING_POINT_NAME_3
#undef _NR_TRAM_NAMES
#ifdef TRAMMING_POINT_NAME_9
#define _NR_TRAM_NAMES 9
#elif defined(TRAMMING_POINT_NAME_8)
#define _NR_TRAM_NAMES 8
#elif defined(TRAMMING_POINT_NAME_7)
#define _NR_TRAM_NAMES 7
#elif defined(TRAMMING_POINT_NAME_6)
#define _NR_TRAM_NAMES 6
#elif defined(TRAMMING_POINT_NAME_5)
#define _NR_TRAM_NAMES 5
#elif defined(TRAMMING_POINT_NAME_4)
#define _NR_TRAM_NAMES 4
#elif defined(TRAMMING_POINT_NAME_3)
#define _NR_TRAM_NAMES 3
#ifdef TRAMMING_POINT_NAME_4
#undef _NR_TRAM_NAMES
#define _NR_TRAM_NAMES 4
#ifdef TRAMMING_POINT_NAME_5
#undef _NR_TRAM_NAMES
#define _NR_TRAM_NAMES 5
#ifdef TRAMMING_POINT_NAME_6
#undef _NR_TRAM_NAMES
#define _NR_TRAM_NAMES 6
#endif
#endif
#endif
#else
#define _NR_TRAM_NAMES 0
#endif
static_assert(_NR_TRAM_NAMES >= G35_PROBE_COUNT, "Define enough TRAMMING_POINT_NAME_s for all TRAMMING_POINT_XY entries.");
#undef _NR_TRAM_NAMES
#define _TRAM_NAME_PTR(N) point_name_##N[]
extern const char REPLIST_1(_NR_TRAM_NAMES, _TRAM_NAME_PTR);
#define _CHECK_TRAM_POINT(N) static_assert(Probe::build_time::can_reach(tramming_points[N]), "TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.");
REPEAT(_NR_TRAM_NAMES, _CHECK_TRAM_POINT)
#undef _CHECK_TRAM_POINT
extern PGM_P const tramming_point_name[];
+3 -5
View File
@@ -453,9 +453,7 @@ G29_TYPE GcodeSuite::G29() {
}
// Position bed horizontally and Z probe vertically.
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
|| defined(SAFE_BED_LEVELING_START_I) || defined(SAFE_BED_LEVELING_START_J) || defined(SAFE_BED_LEVELING_START_K) \
|| defined(SAFE_BED_LEVELING_START_U) || defined(SAFE_BED_LEVELING_START_V) || defined(SAFE_BED_LEVELING_START_W)
#if HAS_SAFE_BED_LEVELING
xyze_pos_t safe_position = current_position;
#ifdef SAFE_BED_LEVELING_START_X
safe_position.x = SAFE_BED_LEVELING_START_X;
@@ -486,14 +484,14 @@ G29_TYPE GcodeSuite::G29() {
#endif
do_blocking_move_to(safe_position);
#endif
#endif // HAS_SAFE_BED_LEVELING
// Disable auto bed leveling during G29.
// Be formal so G29 can be done successively without G28.
if (!no_action) set_bed_leveling_enabled(false);
// Deploy certain probes before starting probing
#if ENABLED(BLTOUCH)
#if ENABLED(BLTOUCH) || BOTH(HAS_Z_SERVO_PROBE, Z_SERVO_INTERMEDIATE_STOW)
do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE);
#elif HAS_BED_PROBE
if (probe.deploy()) { // (returns true on deploy failure)
+2 -4
View File
@@ -108,9 +108,7 @@ void GcodeSuite::G29() {
TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());
// Position bed horizontally and Z probe vertically.
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
|| defined(SAFE_BED_LEVELING_START_I) || defined(SAFE_BED_LEVELING_START_J) || defined(SAFE_BED_LEVELING_START_K) \
|| defined(SAFE_BED_LEVELING_START_U) || defined(SAFE_BED_LEVELING_START_V) || defined(SAFE_BED_LEVELING_START_W)
#if HAS_SAFE_BED_LEVELING
xyze_pos_t safe_position = current_position;
#ifdef SAFE_BED_LEVELING_START_X
safe_position.x = SAFE_BED_LEVELING_START_X;
@@ -141,7 +139,7 @@ void GcodeSuite::G29() {
#endif
do_blocking_move_to(safe_position);
#endif
#endif // HAS_SAFE_BED_LEVELING
return;
}
+2 -2
View File
@@ -86,7 +86,7 @@
NUM_AXIS_LIST(
TERN0(X_SENSORLESS, tmc_enable_stallguard(stepperX)),
TERN0(Y_SENSORLESS, tmc_enable_stallguard(stepperY)),
false, false, false, false
false, false, false, false, false, false, false
)
, TERN0(X2_SENSORLESS, tmc_enable_stallguard(stepperX2))
, TERN0(Y2_SENSORLESS, tmc_enable_stallguard(stepperY2))
@@ -124,7 +124,7 @@
* (Z is already at the right height)
*/
constexpr xy_float_t safe_homing_xy = { Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT };
#if HAS_HOME_OFFSET
#if HAS_HOME_OFFSET && DISABLED(Z_SAFE_HOMING_POINT_ABSOLUTE)
xy_float_t okay_homing_xy = safe_homing_xy;
okay_homing_xy -= home_offset;
#else
+1 -1
View File
@@ -58,7 +58,7 @@ void GcodeSuite::G34() {
// Move XY to safe position
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Parking XY");
const xy_pos_t safe_pos = GANTRY_CALIBRATION_SAFE_POSITION;
do_blocking_move_to(safe_pos, MMM_TO_MMS(GANTRY_CALIBRATION_XY_PARK_FEEDRATE));
do_blocking_move_to_xy(safe_pos, MMM_TO_MMS(GANTRY_CALIBRATION_XY_PARK_FEEDRATE));
#endif
const float move_distance = parser.intval('Z', GANTRY_CALIBRATION_EXTRA_HEIGHT),
+29 -16
View File
@@ -221,9 +221,9 @@ void GcodeSuite::M203_report(const bool forReplay/*=true*/) {
/**
* M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000)
*
* P = Printing moves
* R = Retract only (no X, Y, Z) moves
* T = Travel (non printing) moves
* P<accel> Printing moves
* R<accel> Retract only (no X, Y, Z) moves
* T<accel> Travel (non printing) moves
*/
void GcodeSuite::M204() {
if (!parser.seen("PRST"))
@@ -247,24 +247,37 @@ void GcodeSuite::M204_report(const bool forReplay/*=true*/) {
);
}
#if AXIS_COLLISION('B')
#define M205_MIN_SEG_TIME_PARAM 'D'
#define M205_MIN_SEG_TIME_STR "D"
#warning "Use 'M205 D' for Minimum Segment Time."
#else
#define M205_MIN_SEG_TIME_PARAM 'B'
#define M205_MIN_SEG_TIME_STR "B"
#endif
/**
* M205: Set Advanced Settings
*
* B = Min Segment Time (µs)
* S = Min Feed Rate (units/s)
* T = Min Travel Feed Rate (units/s)
* X = Max X Jerk (units/sec^2)
* Y = Max Y Jerk (units/sec^2)
* Z = Max Z Jerk (units/sec^2)
* E = Max E Jerk (units/sec^2)
* J = Junction Deviation (mm) (If not using CLASSIC_JERK)
* B<µs> : Min Segment Time
* S<units/s> : Min Feed Rate
* T<units/s> : Min Travel Feed Rate
*
* With CLASSIC_JERK:
* X<units/sec^2> : Max X Jerk
* Y<units/sec^2> : Max Y Jerk
* Z<units/sec^2> : Max Z Jerk
* ... : etc
* E<units/sec^2> : Max E Jerk
*
* Without CLASSIC_JERK:
* J(mm) : Junction Deviation
*/
void GcodeSuite::M205() {
if (!parser.seen("BST" TERN_(HAS_JUNCTION_DEVIATION, "J") TERN_(HAS_CLASSIC_JERK, "XYZE")))
return M205_report();
if (!parser.seen_any()) return M205_report();
//planner.synchronize();
if (parser.seenval('B')) planner.settings.min_segment_time_us = parser.value_ulong();
if (parser.seenval(M205_MIN_SEG_TIME_PARAM)) planner.settings.min_segment_time_us = parser.value_ulong();
if (parser.seenval('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units();
if (parser.seenval('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units();
#if HAS_JUNCTION_DEVIATION
@@ -304,7 +317,7 @@ void GcodeSuite::M205() {
void GcodeSuite::M205_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(
"Advanced (B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
"Advanced (" M205_MIN_SEG_TIME_STR "<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
#if HAS_CLASSIC_JERK
NUM_AXIS_GANG(
@@ -317,7 +330,7 @@ void GcodeSuite::M205_report(const bool forReplay/*=true*/) {
")"
));
SERIAL_ECHOLNPGM_P(
PSTR(" M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us)
PSTR(" M205 " M205_MIN_SEG_TIME_STR), LINEAR_UNIT(planner.settings.min_segment_time_us)
, PSTR(" S"), LINEAR_UNIT(planner.settings.min_feedrate_mm_s)
, SP_T_STR, LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s)
#if HAS_JUNCTION_DEVIATION
-3
View File
@@ -29,9 +29,6 @@
#if NUM_AXES == XYZ && EXTRUDERS >= 1
#define HAS_M350_B_PARAM 1 // "5th axis" (after E0) for an original XYZEB setup.
#if AXIS_COLLISION('B')
#error "M350 parameter 'B' collision with axis name."
#endif
#endif
/**
+6 -4
View File
@@ -128,11 +128,13 @@ void GcodeSuite::M240() {
if (homing_needed_error()) return;
const xyz_pos_t old_pos = {
const xyz_pos_t old_pos = NUM_AXIS_ARRAY(
current_position.x + parser.linearval('A'),
current_position.y + parser.linearval('B'),
current_position.z
};
current_position.z,
current_position.i, current_position.j, current_position.k,
current_position.u, current_position.v, current_position.w
);
#ifdef PHOTO_RETRACT_MM
const float rval = parser.linearval('R', _PHOTO_RETRACT_MM);
@@ -140,7 +142,7 @@ void GcodeSuite::M240() {
e_move_m240(-rval, sval);
#endif
feedRate_t fr_mm_s = MMM_TO_MMS(parser.linearval('F'));
feedRate_t fr_mm_s = parser.feedrateval('F');
if (fr_mm_s) NOLESS(fr_mm_s, 10.0f);
constexpr xyz_pos_t photo_position = PHOTO_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
-81
View File
@@ -1,81 +0,0 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_FILAMENT_SENSOR
#include "../../gcode.h"
#include "../../../feature/runout.h"
/**
* M412: Enable / Disable filament runout detection
*
* Parameters
* R : Reset the runout sensor
* S<bool> : Reset and enable/disable the runout sensor
* H<bool> : Enable/disable host handling of filament runout
* D<linear> : Extra distance to continue after runout is triggered
*/
void GcodeSuite::M412() {
if (parser.seen("RS"
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, "D")
TERN_(HOST_ACTION_COMMANDS, "H")
)) {
#if ENABLED(HOST_ACTION_COMMANDS)
if (parser.seen('H')) runout.host_handling = parser.value_bool();
#endif
const bool seenR = parser.seen_test('R'), seenS = parser.seen('S');
if (seenR || seenS) runout.reset();
if (seenS) runout.enabled = parser.value_bool();
#if HAS_FILAMENT_RUNOUT_DISTANCE
if (parser.seenval('D')) runout.set_runout_distance(parser.value_linear_units());
#endif
}
else {
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Filament runout ");
serialprint_onoff(runout.enabled);
#if HAS_FILAMENT_RUNOUT_DISTANCE
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(), "mm");
#endif
#if ENABLED(HOST_ACTION_COMMANDS)
SERIAL_ECHOPGM(" ; Host handling ");
serialprint_onoff(runout.host_handling);
#endif
SERIAL_EOL();
}
}
void GcodeSuite::M412_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(STR_FILAMENT_RUNOUT_SENSOR));
SERIAL_ECHOPGM(
" M412 S", runout.enabled
#if HAS_FILAMENT_RUNOUT_DISTANCE
, " D", LINEAR_UNIT(runout.runout_distance())
#endif
, " ; Sensor "
);
serialprintln_onoff(runout.enabled);
}
#endif // HAS_FILAMENT_SENSOR
+97
View File
@@ -0,0 +1,97 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_FILAMENT_SENSOR
#include "../../gcode.h"
#include "../../../feature/runout.h"
/**
* M591: Configure filament runout detection
*
* Parameters
* R : Reset the runout sensor
* S<bool> : Reset and enable/disable the runout sensor
* H<bool> : Enable/disable host handling of filament runout
* L<linear> : Extra distance to continue after runout is triggered or motion interval
* D<linear> : Alias for L
* P<index> : Mode 0 = NONE
* 1 = Switch NO (HIGH = filament present)
* 2 = Switch NC (LOW = filament present)
* 3 = Encoder / Motion Sensor
*/
void GcodeSuite::M591() {
if (parser.seen("RSDP" TERN_(HOST_ACTION_COMMANDS, "H"))) {
#if ENABLED(HOST_ACTION_COMMANDS)
if (parser.seen('H')) runout.host_handling = parser.value_bool();
#endif
const bool seenR = parser.seen_test('R'), seenS = parser.seen('S');
if (seenR || seenS) runout.reset();
const uint8_t tool = TERN0(MULTI_FILAMENT_SENSOR, parser.ushortval('E', active_extruder));
if (seenS) runout.enabled[tool] = parser.value_bool();
if (parser.seen('D') || parser.seen('L')) runout.set_runout_distance(parser.value_linear_units(), tool);
if (parser.seen('P')) {
const RunoutMode tmp_mode = (RunoutMode)parser.value_int();
switch (tmp_mode) {
case RM_NONE ... RM_OUT_ON_HIGH:
case RM_MOTION_SENSOR:
runout.mode[tool] = tmp_mode;
runout.setup();
default: break;
}
}
}
else {
#if DISABLED(SLIM_LCD_MENUS)
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Filament runout ");
serialprint_onoff(runout.enabled[active_extruder]);
SERIAL_ECHOPGM(" ; Distance ", runout.runout_distance(active_extruder), "mm");
SERIAL_ECHOPGM(" ; Mode ", runout.mode[active_extruder]);
#if ENABLED(HOST_ACTION_COMMANDS)
SERIAL_ECHOPGM(" ; Host handling ");
serialprint_onoff(runout.host_handling);
#endif
SERIAL_EOL();
#else
M591_report(false);
#endif
}
}
void GcodeSuite::M591_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(STR_FILAMENT_RUNOUT_SENSOR));
LOOP_S_L_N(e, 1, NUM_RUNOUT_SENSORS)
SERIAL_ECHOLNPGM(
" M591"
#if MULTI_FILAMENT_SENSOR
" E", e,
#endif
" S", runout.enabled[e]
, " D", LINEAR_UNIT(runout.runout_distance(e))
, " P", runout.mode[e]
);
}
#endif // HAS_FILAMENT_SENSOR
+4 -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,10 @@ 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;
#endif // M591 Configure filament runout detection
#if HAS_SHAPING
case 593: M593(); break; // M593: Set Input Shaping parameters
#endif
+7 -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)
@@ -476,6 +476,9 @@ public:
private:
friend class MarlinSettings;
#if ENABLED(ARC_SUPPORT)
friend void plan_arc(const xyze_pos_t&, const ab_float_t&, const bool, const uint8_t);
#endif
#if ENABLED(MARLIN_DEV_MODE)
static void D(const int16_t dcode);
@@ -1003,8 +1006,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 -3
View File
@@ -33,9 +33,7 @@
/**
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
*
* *** @thinkyhead: I recommend deprecating M206 for SCARA in favor of M665.
* *** M206 for SCARA will remain enabled in 1.1.x for compatibility.
* *** In the 2.0 release, it will simply be disabled by default.
* *** TODO: Deprecate M206 for SCARA in favor of M665.
*/
void GcodeSuite::M206() {
if (!parser.seen_any()) return M206_report();
+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)
+58 -74
View File
@@ -45,91 +45,75 @@ extern xyze_pos_t destination;
* G0, G1: Coordinated movement of X Y Z E axes
*/
void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
if (!MOTION_CONDITIONS) return;
if (IsRunning()
#if ENABLED(NO_MOTION_BEFORE_HOMING)
&& !homing_needed_error(
NUM_AXIS_GANG(
(parser.seen_test('X') ? _BV(X_AXIS) : 0),
| (parser.seen_test('Y') ? _BV(Y_AXIS) : 0),
| (parser.seen_test('Z') ? _BV(Z_AXIS) : 0),
| (parser.seen_test(AXIS4_NAME) ? _BV(I_AXIS) : 0),
| (parser.seen_test(AXIS5_NAME) ? _BV(J_AXIS) : 0),
| (parser.seen_test(AXIS6_NAME) ? _BV(K_AXIS) : 0),
| (parser.seen_test(AXIS7_NAME) ? _BV(U_AXIS) : 0),
| (parser.seen_test(AXIS8_NAME) ? _BV(V_AXIS) : 0),
| (parser.seen_test(AXIS9_NAME) ? _BV(W_AXIS) : 0))
)
#endif
) {
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_RUNNING));
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_RUNNING));
#ifdef G0_FEEDRATE
feedRate_t old_feedrate;
#if ENABLED(VARIABLE_G0_FEEDRATE)
if (fast_move) {
old_feedrate = feedrate_mm_s; // Back up the (old) motion mode feedrate
feedrate_mm_s = fast_move_feedrate; // Get G0 feedrate from last usage
}
#endif
#endif
get_destination_from_command(); // Get X Y [Z[I[J[K]]]] [E] F (and set cutter power)
#ifdef G0_FEEDRATE
#ifdef G0_FEEDRATE
feedRate_t old_feedrate;
#if ENABLED(VARIABLE_G0_FEEDRATE)
if (fast_move) {
#if ENABLED(VARIABLE_G0_FEEDRATE)
fast_move_feedrate = feedrate_mm_s; // Save feedrate for the next G0
#else
old_feedrate = feedrate_mm_s; // Back up the (new) motion mode feedrate
feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); // Get the fixed G0 feedrate
#endif
old_feedrate = feedrate_mm_s; // Back up the (old) motion mode feedrate
feedrate_mm_s = fast_move_feedrate; // Get G0 feedrate from last usage
}
#endif
#endif
#if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT)
get_destination_from_command(); // Get X Y [Z[I[J[K]]]] [E] F (and set cutter power)
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
// When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves
if (fwretract.autoretract_enabled && parser.seen_test('E')
&& !parser.seen(STR_AXES_MAIN)
) {
const float echange = destination.e - current_position.e;
// Is this a retract or recover move?
if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) {
current_position.e = destination.e; // Hide a G1-based retract/recover from calculations
sync_plan_position_e(); // AND from the planner
return fwretract.retract(echange < 0.0); // Firmware-based retract/recover (double-retract ignored)
}
#ifdef G0_FEEDRATE
if (fast_move) {
#if ENABLED(VARIABLE_G0_FEEDRATE)
fast_move_feedrate = feedrate_mm_s; // Save feedrate for the next G0
#else
old_feedrate = feedrate_mm_s; // Back up the (new) motion mode feedrate
feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); // Get the fixed G0 feedrate
#endif
}
#endif
#if BOTH(FWRETRACT, FWRETRACT_AUTORETRACT)
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
// When M209 Autoretract is enabled, convert E-only moves to firmware retract/recover moves
if (fwretract.autoretract_enabled && parser.seen_test('E')
&& !parser.seen(STR_AXES_MAIN)
) {
const float echange = destination.e - current_position.e;
// Is this a retract or recover move?
if (WITHIN(ABS(echange), MIN_AUTORETRACT, MAX_AUTORETRACT) && fwretract.retracted[active_extruder] == (echange > 0.0)) {
current_position.e = destination.e; // Hide a G1-based retract/recover from calculations
sync_plan_position_e(); // AND from the planner
return fwretract.retract(echange < 0.0); // Firmware-based retract/recover (double-retract ignored)
}
}
}
#endif // FWRETRACT
#endif // FWRETRACT
#if EITHER(IS_SCARA, POLAR)
fast_move ? prepare_fast_move_to_destination() : prepare_line_to_destination();
#if EITHER(IS_SCARA, POLAR)
fast_move ? prepare_fast_move_to_destination() : prepare_line_to_destination();
#else
prepare_line_to_destination();
#endif
#ifdef G0_FEEDRATE
// Restore the motion mode feedrate
if (fast_move) feedrate_mm_s = old_feedrate;
#endif
#if ENABLED(NANODLP_Z_SYNC)
#if ENABLED(NANODLP_ALL_AXIS)
#define _MOVE_SYNC parser.seenval('X') || parser.seenval('Y') || parser.seenval('Z') // For any move wait and output sync message
#else
prepare_line_to_destination();
#define _MOVE_SYNC parser.seenval('Z') // Only for Z move
#endif
#ifdef G0_FEEDRATE
// Restore the motion mode feedrate
if (fast_move) feedrate_mm_s = old_feedrate;
#endif
#if ENABLED(NANODLP_Z_SYNC)
#if ENABLED(NANODLP_ALL_AXIS)
#define _MOVE_SYNC parser.seenval('X') || parser.seenval('Y') || parser.seenval('Z') // For any move wait and output sync message
#else
#define _MOVE_SYNC parser.seenval('Z') // Only for Z move
#endif
if (_MOVE_SYNC) {
planner.synchronize();
SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
}
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
#else
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
#endif
}
if (_MOVE_SYNC) {
planner.synchronize();
SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP);
}
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
#else
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
#endif
}
+77 -73
View File
@@ -142,8 +142,8 @@ void plan_arc(
part_per_circle = RADIANS(360) / total_angular; // Each circle's part of the total
ARC_LIJKUVWE_CODE(
const float per_circle_L = travel_L * part_per_circle, // L movement per circle
const float per_circle_I = travel_I * part_per_circle,
const float per_circle_L = travel_L * part_per_circle, // X, Y, or Z movement per circle
const float per_circle_I = travel_I * part_per_circle, // The rest are also non-arc
const float per_circle_J = travel_J * part_per_circle,
const float per_circle_K = travel_K * part_per_circle,
const float per_circle_U = travel_U * part_per_circle,
@@ -154,9 +154,9 @@ void plan_arc(
xyze_pos_t temp_position = current_position;
for (uint16_t n = circles; n--;) {
ARC_LIJKUVWE_CODE( // Destination Linear Axes
temp_position[axis_l] += per_circle_L,
temp_position.i += per_circle_I,
ARC_LIJKUVWE_CODE( // Destination Linear Axes
temp_position[axis_l] += per_circle_L, // Linear X, Y, or Z
temp_position.i += per_circle_I, // The rest are also non-circular
temp_position.j += per_circle_J,
temp_position.k += per_circle_K,
temp_position.u += per_circle_U,
@@ -167,8 +167,8 @@ void plan_arc(
plan_arc(temp_position, offset, clockwise, 0); // Plan a single whole circle
}
ARC_LIJKUVWE_CODE(
travel_L = cart[axis_l] - current_position[axis_l],
travel_I = cart.i - current_position.i,
travel_L = cart[axis_l] - current_position[axis_l], // Linear X, Y, or Z
travel_I = cart.i - current_position.i, // The rest are also non-arc
travel_J = cart.j - current_position.j,
travel_K = cart.k - current_position.k,
travel_U = cart.u - current_position.u,
@@ -183,16 +183,21 @@ void plan_arc(
// Return if the move is near zero
if (flat_mm < 0.0001f
GANG_N(SUB2(NUM_AXES),
&& travel_L < 0.0001f,
&& travel_I < 0.0001f,
&& travel_J < 0.0001f,
&& travel_K < 0.0001f,
&& travel_U < 0.0001f,
&& travel_V < 0.0001f,
&& travel_W < 0.0001f
GANG_N(SUB2(NUM_AXES), // Two axes for the arc
&& NEAR_ZERO(travel_L), // Linear X, Y, or Z
&& NEAR_ZERO(travel_I),
&& NEAR_ZERO(travel_J),
&& NEAR_ZERO(travel_K),
&& NEAR_ZERO(travel_U),
&& NEAR_ZERO(travel_V),
&& NEAR_ZERO(travel_W)
)
) return;
) {
#if HAS_EXTRUDERS
if (!NEAR_ZERO(travel_E)) gcode.G0_G1(); // Handle retract/recover as G1
return;
#endif
}
// Feedrate for the move, scaled by the feedrate multiplier
const feedRate_t scaled_fr_mm_s = MMS_SCALED(feedrate_mm_s);
@@ -426,71 +431,70 @@ void plan_arc(
* G3 X20 Y12 R14 ; CCW circle with r=14 ending at X20 Y12
*/
void GcodeSuite::G2_G3(const bool clockwise) {
if (MOTION_CONDITIONS) {
if (!MOTION_CONDITIONS) return;
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_RUNNING));
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_RUNNING));
#if ENABLED(SF_ARC_FIX)
const bool relative_mode_backup = relative_mode;
relative_mode = true;
#endif
#if ENABLED(SF_ARC_FIX)
const bool relative_mode_backup = relative_mode;
relative_mode = true;
#endif
get_destination_from_command(); // Get X Y [Z[I[J[K...]]]] [E] F (and set cutter power)
get_destination_from_command(); // Get X Y [Z[I[J[K...]]]] [E] F (and set cutter power)
TERN_(SF_ARC_FIX, relative_mode = relative_mode_backup);
TERN_(SF_ARC_FIX, relative_mode = relative_mode_backup);
ab_float_t arc_offset = { 0, 0 };
if (parser.seenval('R')) {
const float r = parser.value_linear_units();
if (r) {
const xy_pos_t p1 = current_position, p2 = destination;
if (p1 != p2) {
const xy_pos_t d2 = (p2 - p1) * 0.5f; // XY vector to midpoint of move from current
const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1
len = d2.magnitude(), // Distance to mid-point of move from current
h2 = (r - len) * (r + len), // factored to reduce rounding error
h = (h2 >= 0) ? SQRT(h2) : 0.0f; // Distance to the arc pivot-point from midpoint
const xy_pos_t s = { -d2.y, d2.x }; // Perpendicular bisector. (Divide by len for unit vector.)
arc_offset = d2 + s / len * e * h; // The calculated offset (mid-point if |r| <= len)
}
ab_float_t arc_offset = { 0, 0 };
if (parser.seenval('R')) {
const float r = parser.value_linear_units();
if (r) {
const xy_pos_t p1 = current_position, p2 = destination;
if (p1 != p2) {
const xy_pos_t d2 = (p2 - p1) * 0.5f; // XY vector to midpoint of move from current
const float e = clockwise ^ (r < 0) ? -1 : 1, // clockwise -1/1, counterclockwise 1/-1
len = d2.magnitude(), // Distance to mid-point of move from current
h2 = (r - len) * (r + len), // factored to reduce rounding error
h = (h2 >= 0) ? SQRT(h2) : 0.0f; // Distance to the arc pivot-point from midpoint
const xy_pos_t s = { -d2.y, d2.x }; // Perpendicular bisector. (Divide by len for unit vector.)
arc_offset = d2 + s / len * e * h; // The calculated offset (mid-point if |r| <= len)
}
}
else {
#if ENABLED(CNC_WORKSPACE_PLANES)
char achar, bchar;
switch (workspace_plane) {
default:
case GcodeSuite::PLANE_XY: achar = 'I'; bchar = 'J'; break;
case GcodeSuite::PLANE_YZ: achar = 'J'; bchar = 'K'; break;
case GcodeSuite::PLANE_ZX: achar = 'K'; bchar = 'I'; break;
}
#else
constexpr char achar = 'I', bchar = 'J';
#endif
if (parser.seenval(achar)) arc_offset.a = parser.value_linear_units();
if (parser.seenval(bchar)) arc_offset.b = parser.value_linear_units();
}
if (arc_offset) {
#if ENABLED(ARC_P_CIRCLES)
// P indicates number of circles to do
const int8_t circles_to_do = parser.byteval('P');
if (!WITHIN(circles_to_do, 0, 100))
SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS);
#else
constexpr uint8_t circles_to_do = 0;
#endif
// Send the arc to the planner
plan_arc(destination, arc_offset, clockwise, circles_to_do);
reset_stepper_timeout();
}
else
SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS);
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
}
else {
#if ENABLED(CNC_WORKSPACE_PLANES)
char achar, bchar;
switch (workspace_plane) {
default:
case GcodeSuite::PLANE_XY: achar = 'I'; bchar = 'J'; break;
case GcodeSuite::PLANE_YZ: achar = 'J'; bchar = 'K'; break;
case GcodeSuite::PLANE_ZX: achar = 'K'; bchar = 'I'; break;
}
#else
constexpr char achar = 'I', bchar = 'J';
#endif
if (parser.seenval(achar)) arc_offset.a = parser.value_linear_units();
if (parser.seenval(bchar)) arc_offset.b = parser.value_linear_units();
}
if (arc_offset) {
#if ENABLED(ARC_P_CIRCLES)
// P indicates number of circles to do
const int8_t circles_to_do = parser.byteval('P');
if (!WITHIN(circles_to_do, 0, 100))
SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS);
#else
constexpr uint8_t circles_to_do = 0;
#endif
// Send the arc to the planner
plan_arc(destination, arc_offset, clockwise, circles_to_do);
reset_stepper_timeout();
}
else
SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS);
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
}
#endif // ARC_SUPPORT
+1 -7
View File
@@ -110,13 +110,7 @@ void GcodeSuite::G38(const int8_t subcode) {
remember_feedrate_scaling_off();
const bool error_on_fail =
#if ENABLED(G38_PROBE_AWAY)
!TEST(subcode, 0)
#else
(subcode == 2)
#endif
;
const bool error_on_fail = TERN(G38_PROBE_AWAY, !TEST(subcode, 0), subcode == 2);
// If any axis has enough movement, do the move
LOOP_NUM_AXES(i)
+12 -5
View File
@@ -31,11 +31,13 @@
/**
* M306: MPC settings and autotune
*
* T Autotune the active extruder.
* E<extruder> Extruder index. (Default: Active Extruder)
*
* T Autotune the specified or active extruder.
*
* Set MPC values manually for the specified or active extruder:
* A<watts/kelvin> Ambient heat transfer coefficient (no fan).
* C<joules/kelvin> Block heat capacity.
* E<extruder> Extruder number to set. (Default: E0)
* F<watts/kelvin> Ambient heat transfer coefficient (fan on full).
* H<joules/kelvin/mm> Filament heat capacity per mm.
* P<watts> Heater power.
@@ -43,16 +45,21 @@
*/
void GcodeSuite::M306() {
const uint8_t e = TERN(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder), 0);
if (e >= (EXTRUDERS)) {
SERIAL_ECHOLNPGM("?(E)xtruder index out of range (0-", (EXTRUDERS) - 1, ").");
return;
}
if (parser.seen_test('T')) {
LCD_MESSAGE(MSG_MPC_AUTOTUNE);
thermalManager.MPC_autotune();
thermalManager.MPC_autotune(e);
ui.reset_status();
return;
}
if (parser.seen("ACFPRH")) {
const heater_id_t hid = (heater_id_t)parser.intval('E', 0);
MPC_t &mpc = thermalManager.temp_hotend[hid].mpc;
MPC_t &mpc = thermalManager.temp_hotend[e].mpc;
if (parser.seenval('P')) mpc.heater_power = parser.value_float();
if (parser.seenval('C')) mpc.block_heat_capacity = parser.value_float();
if (parser.seenval('R')) mpc.sensor_responsiveness = parser.value_float();
+81 -60
View File
@@ -613,7 +613,9 @@
#undef TEMP_SENSOR_7
#undef SINGLENOZZLE
#undef SWITCHING_EXTRUDER
#undef MECHANICAL_SWITCHING_EXTRUDER
#undef SWITCHING_NOZZLE
#undef MECHANICAL_SWITCHING_NOZZLE
#undef MIXING_EXTRUDER
#undef HOTEND_IDLE_TIMEOUT
#undef DISABLE_E
@@ -629,12 +631,19 @@
#define E_TERN_(N) TERN_(HAS_MULTI_EXTRUDER, N)
#define E_TERN0(N) TERN0(HAS_MULTI_EXTRUDER, N)
#if EITHER(SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_EXTRUDER)
#define HAS_SWITCHING_EXTRUDER 1
#endif
#if EITHER(SWITCHING_NOZZLE, MECHANICAL_SWITCHING_NOZZLE)
#define HAS_SWITCHING_NOZZLE 1
#endif
#if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0
#define E_STEPPERS 2
#define E_MANUAL 1
#elif ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS
#elif HAS_SWITCHING_EXTRUDER // One stepper for every two EXTRUDERS
#if EXTRUDERS > 4
#define E_STEPPERS 3
@@ -643,7 +652,7 @@
#else
#define E_STEPPERS 1
#endif
#if DISABLED(SWITCHING_NOZZLE)
#if !HAS_SWITCHING_NOZZLE
#define HOTENDS E_STEPPERS
#endif
@@ -668,7 +677,7 @@
#endif
// No inactive extruders with SWITCHING_NOZZLE or Průša MMU1
#if ENABLED(SWITCHING_NOZZLE) || HAS_PRUSA_MMU1
#if HAS_SWITCHING_NOZZLE || HAS_PRUSA_MMU1
#undef DISABLE_INACTIVE_EXTRUDER
#endif
@@ -758,39 +767,31 @@
#define HAS_X_AXIS 1
#if NUM_AXES >= XY
#define HAS_Y_AXIS 1
#if NUM_AXES >= XYZ
#define HAS_Z_AXIS 1
#ifdef Z4_DRIVER_TYPE
#define NUM_Z_STEPPERS 4
#elif defined(Z3_DRIVER_TYPE)
#define NUM_Z_STEPPERS 3
#elif defined(Z2_DRIVER_TYPE)
#define NUM_Z_STEPPERS 2
#else
#define NUM_Z_STEPPERS 1
#endif
#if NUM_AXES >= 4
#define HAS_I_AXIS 1
#if NUM_AXES >= 5
#define HAS_J_AXIS 1
#if NUM_AXES >= 6
#define HAS_K_AXIS 1
#if NUM_AXES >= 7
#define HAS_U_AXIS 1
#if NUM_AXES >= 8
#define HAS_V_AXIS 1
#if NUM_AXES >= 9
#define HAS_W_AXIS 1
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#if NUM_AXES >= XYZ
#define HAS_Z_AXIS 1
#endif
#if NUM_AXES >= 4
#define HAS_I_AXIS 1
#endif
#if NUM_AXES >= 5
#define HAS_J_AXIS 1
#endif
#if NUM_AXES >= 6
#define HAS_K_AXIS 1
#endif
#if NUM_AXES >= 7
#define HAS_U_AXIS 1
#endif
#if NUM_AXES >= 8
#define HAS_V_AXIS 1
#endif
#if NUM_AXES >= 9
#define HAS_W_AXIS 1
#endif
#if !HAS_Y_AXIS
#undef AVOID_OBSTACLES
#undef ENDSTOPPULLUP_YMIN
#undef ENDSTOPPULLUP_YMAX
#undef Y_MIN_ENDSTOP_INVERTING
@@ -807,7 +808,17 @@
#undef MAX_SOFTWARE_ENDSTOP_Y
#endif
#if !HAS_Z_AXIS
#if HAS_Z_AXIS
#ifdef Z4_DRIVER_TYPE
#define NUM_Z_STEPPERS 4
#elif defined(Z3_DRIVER_TYPE)
#define NUM_Z_STEPPERS 3
#elif defined(Z2_DRIVER_TYPE)
#define NUM_Z_STEPPERS 2
#else
#define NUM_Z_STEPPERS 1
#endif
#else
#undef ENDSTOPPULLUP_ZMIN
#undef ENDSTOPPULLUP_ZMAX
#undef Z_MIN_ENDSTOP_INVERTING
@@ -822,6 +833,7 @@
#undef Z_MIN_POS
#undef Z_MAX_POS
#undef MANUAL_Z_HOME_POS
#undef Z_SAFE_HOMING
#undef MIN_SOFTWARE_ENDSTOP_Z
#undef MAX_SOFTWARE_ENDSTOP_Z
#endif
@@ -933,7 +945,7 @@
/**
* Number of Primary Linear Axes (e.g., XYZ)
* X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2. Z2. Z3, Z4)
* X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2, Z2, Z3, Z4)
*/
#if NUM_AXES >= 3
#define PRIMARY_LINEAR_AXES 3
@@ -1061,7 +1073,7 @@
#endif
// Switching extruder has its own servo?
#if ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)
#if ENABLED(SWITCHING_EXTRUDER) && (!HAS_SWITCHING_NOZZLE || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)
#define DO_SWITCH_EXTRUDER 1
#endif
@@ -1102,10 +1114,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 +1130,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 +1139,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 +1147,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 +1155,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 +1163,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 +1171,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 +1179,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 +1666,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
+177 -107
View File
@@ -30,26 +30,26 @@
#define AXIS_RELATIVE_MODES {}
#endif
#ifdef SWITCHING_NOZZLE_E1_SERVO_NR
#if defined(SWITCHING_NOZZLE_E1_SERVO_NR) && DISABLED(MECHANICAL_SWITCHING_NOZZLE)
#define SWITCHING_NOZZLE_TWO_SERVOS 1
#endif
// Determine NUM_SERVOS if none was supplied
#ifndef NUM_SERVOS
#define NUM_SERVOS 0
#if ANY(HAS_Z_SERVO_PROBE, CHAMBER_VENT, SWITCHING_TOOLHEAD, SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SPINDLE_SERVO)
#if NUM_SERVOS <= Z_PROBE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
#endif
#if NUM_SERVOS <= CHAMBER_VENT_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (CHAMBER_VENT_SERVO_NR + 1)
#endif
#if NUM_SERVOS <= SWITCHING_TOOLHEAD_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_TOOLHEAD_SERVO_NR + 1)
#endif
#if HAS_Z_SERVO_PROBE && NUM_SERVOS <= Z_PROBE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
#endif
#if ENABLED(CHAMBER_VENT) && NUM_SERVOS <= CHAMBER_VENT_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (CHAMBER_VENT_SERVO_NR + 1)
#endif
#if ENABLED(SWITCHING_TOOLHEAD) && NUM_SERVOS <= SWITCHING_TOOLHEAD_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_TOOLHEAD_SERVO_NR + 1)
#endif
#if ENABLED(SWITCHING_NOZZLE)
#if NUM_SERVOS <= SWITCHING_NOZZLE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_NOZZLE_SERVO_NR + 1)
@@ -58,6 +58,8 @@
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_NOZZLE_E1_SERVO_NR + 1)
#endif
#endif
#if ENABLED(SWITCHING_EXTRUDER)
#if NUM_SERVOS <= SWITCHING_EXTRUDER_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_EXTRUDER_SERVO_NR + 1)
@@ -66,12 +68,12 @@
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1)
#endif
#if NUM_SERVOS <= SPINDLE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SPINDLE_SERVO_NR + 1)
#endif
#endif
#endif
#if ENABLED(SPINDLE_SERVO) && NUM_SERVOS <= SPINDLE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SPINDLE_SERVO_NR + 1)
#endif
#endif // !defined(NUM_SERVOS)
// Convenience override for a BLTouch alone
#if ENABLED(BLTOUCH) && NUM_SERVOS == 1
@@ -88,51 +90,108 @@
// Some options are disallowed without required axes
#if !HAS_Y_AXIS
#undef SAFE_BED_LEVELING_START_Y
#undef ARC_SUPPORT
#undef CALIBRATION_MEASURE_YMAX
#undef CALIBRATION_MEASURE_YMIN
#undef DISABLE_INACTIVE_Y
#undef HOME_Y_BEFORE_X
#undef INPUT_SHAPING_Y
#undef SHAPING_FREQ_Y
#undef QUICK_HOME
#undef SAFE_BED_LEVELING_START_Y
#undef SHAPING_BUFFER_Y
#undef SHAPING_FREQ_Y
#undef STEALTHCHOP_Y
#undef STEP_STATE_Y
#endif
#if !HAS_Z_AXIS
#undef CALIBRATION_MEASURE_ZMAX
#undef CALIBRATION_MEASURE_ZMIN
#undef CNC_WORKSPACE_PLANES
#undef DISABLE_INACTIVE_Z
#undef ENABLE_LEVELING_FADE_HEIGHT
#undef HOME_Z_FIRST
#undef HOMING_Z_WITH_PROBE
#undef NUM_Z_STEPPERS
#undef SAFE_BED_LEVELING_START_Z
#undef STEALTHCHOP_Z
#undef STEP_STATE_Z
#undef Z_IDLE_HEIGHT
#undef Z_PROBE_SLED
#undef Z_SAFE_HOMING
#endif
#if !HAS_I_AXIS
#undef CALIBRATION_MEASURE_IMAX
#undef CALIBRATION_MEASURE_IMIN
#undef DISABLE_INACTIVE_I
#undef SAFE_BED_LEVELING_START_I
#undef STEALTHCHOP_I
#undef STEP_STATE_I
#endif
#if !HAS_J_AXIS
#undef CALIBRATION_MEASURE_JMAX
#undef CALIBRATION_MEASURE_JMIN
#undef DISABLE_INACTIVE_J
#undef SAFE_BED_LEVELING_START_J
#undef STEALTHCHOP_J
#undef STEP_STATE_J
#endif
#if !HAS_K_AXIS
#undef CALIBRATION_MEASURE_KMAX
#undef CALIBRATION_MEASURE_KMIN
#undef DISABLE_INACTIVE_K
#undef SAFE_BED_LEVELING_START_K
#undef STEALTHCHOP_K
#undef STEP_STATE_K
#endif
#if !HAS_U_AXIS
#undef CALIBRATION_MEASURE_UMAX
#undef CALIBRATION_MEASURE_UMIN
#undef DISABLE_INACTIVE_U
#undef SAFE_BED_LEVELING_START_U
#undef STEALTHCHOP_U
#undef STEP_STATE_U
#endif
#if !HAS_V_AXIS
#undef CALIBRATION_MEASURE_VMAX
#undef CALIBRATION_MEASURE_VMIN
#undef DISABLE_INACTIVE_V
#undef SAFE_BED_LEVELING_START_V
#undef STEALTHCHOP_V
#undef STEP_STATE_V
#endif
#if !HAS_W_AXIS
#undef CALIBRATION_MEASURE_WMAX
#undef CALIBRATION_MEASURE_WMIN
#undef DISABLE_INACTIVE_W
#undef SAFE_BED_LEVELING_START_W
#undef STEALTHCHOP_W
#undef STEP_STATE_W
#endif
// Disallowed with no extruders
#if !HAS_EXTRUDERS
#define NO_VOLUMETRICS
#undef FWRETRACT
#undef PIDTEMP
#undef AUTOTEMP
#undef PID_EXTRUSION_SCALING
#undef LIN_ADVANCE
#undef ADVANCED_PAUSE_FEATURE
#undef FILAMENT_LOAD_UNLOAD_GCODES
#undef AUTOTEMP
#undef EXTRUDER_RUNOUT_PREVENT
#undef FILAMENT_LOAD_UNLOAD_GCODES
#undef FWRETRACT
#undef LCD_SHOW_E_TOTAL
#undef LIN_ADVANCE
#undef MANUAL_E_MOVES_RELATIVE
#undef PID_EXTRUSION_SCALING
#undef PIDTEMP
#undef SHOW_TEMP_ADC_VALUES
#undef STEALTHCHOP_E
#undef THERMAL_PROTECTION_PERIOD
#undef WATCH_TEMP_PERIOD
#undef SHOW_TEMP_ADC_VALUES
#undef LCD_SHOW_E_TOTAL
#undef MANUAL_E_MOVES_RELATIVE
#undef STEALTHCHOP_E
#endif
#if HOTENDS <= 7
@@ -223,13 +282,12 @@
#define TEMP_SENSOR_0_IS_AD8495 1
#elif TEMP_SENSOR_0 == -1
#define TEMP_SENSOR_0_IS_AD595 1
#elif TEMP_SENSOR_0 == 1000
#define TEMP_SENSOR_0_IS_CUSTOM 1
#elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
#define TEMP_SENSOR_0_IS_DUMMY 1
#elif TEMP_SENSOR_0 > 0
#define TEMP_SENSOR_0_IS_THERMISTOR 1
#if TEMP_SENSOR_0 == 1000
#define TEMP_SENSOR_0_IS_CUSTOM 1
#elif TEMP_SENSOR_0 == 998 || TEMP_SENSOR_0 == 999
#define TEMP_SENSOR_0_IS_DUMMY 1
#endif
#else
#undef HEATER_0_MINTEMP
#undef HEATER_0_MAXTEMP
@@ -269,13 +327,12 @@
#define TEMP_SENSOR_1_IS_AD8495 1
#elif TEMP_SENSOR_1 == -1
#define TEMP_SENSOR_1_IS_AD595 1
#elif TEMP_SENSOR_1 == 1000
#define TEMP_SENSOR_1_IS_CUSTOM 1
#elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
#define TEMP_SENSOR_1_IS_DUMMY 1
#elif TEMP_SENSOR_1 > 0
#define TEMP_SENSOR_1_IS_THERMISTOR 1
#if TEMP_SENSOR_1 == 1000
#define TEMP_SENSOR_1_IS_CUSTOM 1
#elif TEMP_SENSOR_1 == 998 || TEMP_SENSOR_1 == 999
#define TEMP_SENSOR_1_IS_DUMMY 1
#endif
#else
#undef HEATER_1_MINTEMP
#undef HEATER_1_MAXTEMP
@@ -315,18 +372,72 @@
#define TEMP_SENSOR_2_IS_AD8495 1
#elif TEMP_SENSOR_2 == -1
#define TEMP_SENSOR_2_IS_AD595 1
#elif TEMP_SENSOR_2 == 1000
#define TEMP_SENSOR_2_IS_CUSTOM 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define TEMP_SENSOR_2_IS_DUMMY 1
#elif TEMP_SENSOR_2 > 0
#define TEMP_SENSOR_2_IS_THERMISTOR 1
#if TEMP_SENSOR_2 == 1000
#define TEMP_SENSOR_2_IS_CUSTOM 1
#elif TEMP_SENSOR_2 == 998 || TEMP_SENSOR_2 == 999
#define TEMP_SENSOR_2_IS_DUMMY 1
#endif
#else
#undef HEATER_2_MINTEMP
#undef HEATER_2_MAXTEMP
#endif
#if TEMP_SENSOR_3 == 1000
#define TEMP_SENSOR_3_IS_CUSTOM 1
#elif TEMP_SENSOR_3 == 998 || TEMP_SENSOR_3 == 999
#define TEMP_SENSOR_3_IS_DUMMY 1
#elif TEMP_SENSOR_3 > 0
#define TEMP_SENSOR_3_IS_THERMISTOR 1
#elif !TEMP_SENSOR_3
#undef HEATER_3_MINTEMP
#undef HEATER_3_MAXTEMP
#endif
#if TEMP_SENSOR_4 == 1000
#define TEMP_SENSOR_4_IS_CUSTOM 1
#elif TEMP_SENSOR_4 == 998 || TEMP_SENSOR_4 == 999
#define TEMP_SENSOR_4_IS_DUMMY 1
#elif TEMP_SENSOR_4 > 0
#define TEMP_SENSOR_4_IS_THERMISTOR 1
#elif !TEMP_SENSOR_4
#undef HEATER_4_MINTEMP
#undef HEATER_4_MAXTEMP
#endif
#if TEMP_SENSOR_5 == 1000
#define TEMP_SENSOR_5_IS_CUSTOM 1
#elif TEMP_SENSOR_5 == 998 || TEMP_SENSOR_5 == 999
#define TEMP_SENSOR_5_IS_DUMMY 1
#elif TEMP_SENSOR_5 > 0
#define TEMP_SENSOR_5_IS_THERMISTOR 1
#elif !TEMP_SENSOR_5
#undef HEATER_5_MINTEMP
#undef HEATER_5_MAXTEMP
#endif
#if TEMP_SENSOR_6 == 1000
#define TEMP_SENSOR_6_IS_CUSTOM 1
#elif TEMP_SENSOR_6 == 998 || TEMP_SENSOR_6 == 999
#define TEMP_SENSOR_6_IS_DUMMY 1
#elif TEMP_SENSOR_6 > 0
#define TEMP_SENSOR_6_IS_THERMISTOR 1
#elif !TEMP_SENSOR_6
#undef HEATER_6_MINTEMP
#undef HEATER_6_MAXTEMP
#endif
#if TEMP_SENSOR_7 == 1000
#define TEMP_SENSOR_7_IS_CUSTOM 1
#elif TEMP_SENSOR_7 == 998 || TEMP_SENSOR_7 == 999
#define TEMP_SENSOR_7_IS_DUMMY 1
#elif TEMP_SENSOR_7 > 0
#define TEMP_SENSOR_7_IS_THERMISTOR 1
#elif !TEMP_SENSOR_7
#undef HEATER_7_MINTEMP
#undef HEATER_7_MAXTEMP
#endif
#if TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
#if TEMP_SENSOR_REDUNDANT == -5
#if !REDUNDANT_TEMP_MATCH(SOURCE, E0) && !REDUNDANT_TEMP_MATCH(SOURCE, E1) && !REDUNDANT_TEMP_MATCH(SOURCE, E2)
@@ -620,19 +731,16 @@
#define HAS_SERVICE_INTERVALS 1
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define HAS_FILAMENT_SENSOR 1
#if NUM_RUNOUT_SENSORS > 1
#define MULTI_FILAMENT_SENSOR 1
#endif
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
#define HAS_FILAMENT_RUNOUT_DISTANCE 1
#endif
#if ENABLED(MIXING_EXTRUDER)
#define WATCH_ALL_RUNOUT_SENSORS
#endif
// Probe Temperature Compensation
#if !TEMP_SENSOR_PROBE
#undef PTC_PROBE
#endif
#if !TEMP_SENSOR_BED
#undef PTC_BED
#endif
#if !HAS_EXTRUDERS
#undef PTC_HOTEND
#endif
#if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND)
#define HAS_PTC 1
#endif
@@ -991,51 +1099,10 @@
#endif
#endif
// Remove unused STEALTHCHOP flags
#if NUM_AXES < 9
#undef STEALTHCHOP_W
#undef CALIBRATION_MEASURE_WMIN
#undef CALIBRATION_MEASURE_WMAX
#if NUM_AXES < 8
#undef STEALTHCHOP_V
#undef CALIBRATION_MEASURE_VMIN
#undef CALIBRATION_MEASURE_VMAX
#if NUM_AXES < 7
#undef STEALTHCHOP_U
#undef CALIBRATION_MEASURE_UMIN
#undef CALIBRATION_MEASURE_UMAX
#if NUM_AXES < 6
#undef STEALTHCHOP_K
#undef CALIBRATION_MEASURE_KMIN
#undef CALIBRATION_MEASURE_KMAX
#if NUM_AXES < 5
#undef STEALTHCHOP_J
#undef CALIBRATION_MEASURE_JMIN
#undef CALIBRATION_MEASURE_JMAX
#if NUM_AXES < 4
#undef STEALTHCHOP_I
#undef CALIBRATION_MEASURE_IMIN
#undef CALIBRATION_MEASURE_IMAX
#if NUM_AXES < 3
#undef STEALTHCHOP_Z
#undef Z_IDLE_HEIGHT
#undef Z_PROBE_SLED
#undef Z_SAFE_HOMING
#undef HOME_Z_FIRST
#undef HOMING_Z_WITH_PROBE
#undef ENABLE_LEVELING_FADE_HEIGHT
#undef NUM_Z_STEPPERS
#undef CNC_WORKSPACE_PLANES
#if NUM_AXES < 2
#undef STEALTHCHOP_Y
#undef QUICK_HOME
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#if defined(SAFE_BED_LEVELING_START_X) || defined(SAFE_BED_LEVELING_START_Y) || defined(SAFE_BED_LEVELING_START_Z) \
|| defined(SAFE_BED_LEVELING_START_I) || defined(SAFE_BED_LEVELING_START_J) || defined(SAFE_BED_LEVELING_START_K) \
|| defined(SAFE_BED_LEVELING_START_U) || defined(SAFE_BED_LEVELING_START_V) || defined(SAFE_BED_LEVELING_START_W)
#define HAS_SAFE_BED_LEVELING 1
#endif
//
@@ -1127,10 +1194,6 @@
#define CANNOT_EMBED_CONFIGURATION defined(__AVR__)
#endif
#if ANY(DISABLE_INACTIVE_X, DISABLE_INACTIVE_Y, DISABLE_INACTIVE_Z, DISABLE_INACTIVE_I, DISABLE_INACTIVE_J, DISABLE_INACTIVE_K, DISABLE_INACTIVE_U, DISABLE_INACTIVE_V, DISABLE_INACTIVE_W, DISABLE_INACTIVE_E)
#define HAS_DISABLE_INACTIVE_AXIS 1
#endif
// Fan Kickstart
#if FAN_KICKSTART_TIME && !defined(FAN_KICKSTART_POWER)
#define FAN_KICKSTART_POWER 180
@@ -1146,3 +1209,10 @@
#if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#define HAS_SHAPING 1
#endif
// Toolchange Event G-code
#if !HAS_MULTI_EXTRUDER || !(defined(EVENT_GCODE_TOOLCHANGE_T0) || defined(EVENT_GCODE_TOOLCHANGE_T1) || defined(EVENT_GCODE_TOOLCHANGE_T2) || defined(EVENT_GCODE_TOOLCHANGE_T3) || defined(EVENT_GCODE_TOOLCHANGE_T4) || defined(EVENT_GCODE_TOOLCHANGE_T5) || defined(EVENT_GCODE_TOOLCHANGE_T6) || defined(EVENT_GCODE_TOOLCHANGE_T7))
#undef TC_GCODE_USE_GLOBAL_X
#undef TC_GCODE_USE_GLOBAL_Y
#undef TC_GCODE_USE_GLOBAL_Z
#endif
+43 -54
View File
@@ -190,22 +190,22 @@
#define XY_CENTER { X_CENTER, Y_CENTER }
#endif
#if HAS_I_AXIS
#define I_CENTER TERN(BED_CENTER_AT_0_0, 0, _I_HALF_BED)
#define I_CENTER _I_HALF_BED
#endif
#if HAS_J_AXIS
#define J_CENTER TERN(BED_CENTER_AT_0_0, 0, _J_HALF_BED)
#define J_CENTER _J_HALF_BED
#endif
#if HAS_K_AXIS
#define K_CENTER TERN(BED_CENTER_AT_0_0, 0, _K_HALF_BED)
#define K_CENTER _K_HALF_BED
#endif
#if HAS_U_AXIS
#define U_CENTER TERN(BED_CENTER_AT_0_0, 0, _U_HALF_BED)
#define U_CENTER _U_HALF_BED
#endif
#if HAS_V_AXIS
#define V_CENTER TERN(BED_CENTER_AT_0_0, 0, _V_HALF_BED)
#define V_CENTER _V_HALF_BED
#endif
#if HAS_W_AXIS
#define W_CENTER TERN(BED_CENTER_AT_0_0, 0, _W_HALF_BED)
#define W_CENTER _W_HALF_BED
#endif
// Get the linear boundaries of the bed
@@ -1308,9 +1308,6 @@
/**
* Set defaults for missing (newer) options
*/
#if !defined(DISABLE_INACTIVE_X) && ENABLED(DISABLE_X)
#define DISABLE_INACTIVE_X 1
#endif
#if HAS_Y_AXIS
#if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y))
@@ -1338,11 +1335,6 @@
#if PIN_EXISTS(Y2_MS1)
#define HAS_Y2_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_Y) && ENABLED(DISABLE_Y)
#define DISABLE_INACTIVE_Y 1
#endif
#else
#undef DISABLE_INACTIVE_Y
#endif
#if HAS_Z_AXIS
@@ -1358,11 +1350,6 @@
#if PIN_EXISTS(Z_MS1)
#define HAS_Z_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_Z) && ENABLED(DISABLE_Z)
#define DISABLE_INACTIVE_Z 1
#endif
#else
#undef DISABLE_INACTIVE_Z
#endif
#if NUM_Z_STEPPERS >= 2
@@ -1423,11 +1410,6 @@
#if PIN_EXISTS(I_MS1)
#define HAS_I_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_I) && ENABLED(DISABLE_I)
#define DISABLE_INACTIVE_I 1
#endif
#else
#undef DISABLE_INACTIVE_I
#endif
#if HAS_J_AXIS
@@ -1443,11 +1425,6 @@
#if PIN_EXISTS(J_MS1)
#define HAS_J_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_J) && ENABLED(DISABLE_J)
#define DISABLE_INACTIVE_J 1
#endif
#else
#undef DISABLE_INACTIVE_J
#endif
#if HAS_K_AXIS
@@ -1463,11 +1440,6 @@
#if PIN_EXISTS(K_MS1)
#define HAS_K_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_K) && ENABLED(DISABLE_K)
#define DISABLE_INACTIVE_K 1
#endif
#else
#undef DISABLE_INACTIVE_K
#endif
#if HAS_U_AXIS
@@ -1483,11 +1455,6 @@
#if PIN_EXISTS(U_MS1)
#define HAS_U_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_U) && ENABLED(DISABLE_U)
#define DISABLE_INACTIVE_U 1
#endif
#else
#undef DISABLE_INACTIVE_U
#endif
#if HAS_V_AXIS
@@ -1503,11 +1470,6 @@
#if PIN_EXISTS(V_MS1)
#define HAS_V_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_V) && ENABLED(DISABLE_V)
#define DISABLE_INACTIVE_V 1
#endif
#else
#undef DISABLE_INACTIVE_V
#endif
#if HAS_W_AXIS
@@ -1523,11 +1485,43 @@
#if PIN_EXISTS(W_MS1)
#define HAS_W_MS_PINS 1
#endif
#if !defined(DISABLE_INACTIVE_W) && ENABLED(DISABLE_W)
#define DISABLE_INACTIVE_W 1
#endif
#else
#undef DISABLE_INACTIVE_W
#endif
#if !defined(DISABLE_INACTIVE_X) && ENABLED(DISABLE_X)
#define DISABLE_INACTIVE_X
#endif
#if !defined(DISABLE_INACTIVE_Y) && ENABLED(DISABLE_Y)
#define DISABLE_INACTIVE_Y
#endif
#if !defined(DISABLE_INACTIVE_Z) && ENABLED(DISABLE_Z)
#define DISABLE_INACTIVE_Z
#endif
#if !defined(DISABLE_INACTIVE_I) && ENABLED(DISABLE_I)
#define DISABLE_INACTIVE_I
#endif
#if !defined(DISABLE_INACTIVE_J) && ENABLED(DISABLE_J)
#define DISABLE_INACTIVE_J
#endif
#if !defined(DISABLE_INACTIVE_K) && ENABLED(DISABLE_K)
#define DISABLE_INACTIVE_K
#endif
#if !defined(DISABLE_INACTIVE_U) && ENABLED(DISABLE_U)
#define DISABLE_INACTIVE_U
#endif
#if !defined(DISABLE_INACTIVE_V) && ENABLED(DISABLE_V)
#define DISABLE_INACTIVE_V
#endif
#if !defined(DISABLE_INACTIVE_W) && ENABLED(DISABLE_W)
#define DISABLE_INACTIVE_W
#endif
#if !defined(DISABLE_INACTIVE_EXTRUDER) && ENABLED(DISABLE_E)
#define DISABLE_INACTIVE_EXTRUDER
#endif
#if ANY(DISABLE_INACTIVE_X, DISABLE_INACTIVE_Y, DISABLE_INACTIVE_Z, DISABLE_INACTIVE_I, DISABLE_INACTIVE_J, DISABLE_INACTIVE_K, DISABLE_INACTIVE_U, DISABLE_INACTIVE_V, DISABLE_INACTIVE_W, DISABLE_INACTIVE_EXTRUDER)
#define HAS_DISABLE_INACTIVE_AXIS 1
#endif
#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K, DISABLE_U, DISABLE_V, DISABLE_W, DISABLE_E)
#define HAS_DISABLE_AXIS 1
#endif
// Extruder steppers and solenoids
@@ -1651,11 +1645,6 @@
#endif
#endif
#if !defined(DISABLE_INACTIVE_E) && ENABLED(DISABLE_E)
#define DISABLE_INACTIVE_E 1
#endif
#else
#undef DISABLE_INACTIVE_E
#endif // HAS_EXTRUDERS
/**
+193 -54
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."
@@ -670,6 +670,12 @@
#error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS."
#elif defined(EXPERIMENTAL_SCURVE)
#error "EXPERIMENTAL_SCURVE is no longer needed and should be removed."
#elif defined(BABYSTEP_ZPROBE_GFX_OVERLAY)
#error "BABYSTEP_ZPROBE_GFX_OVERLAY is now BABYSTEP_GFX_OVERLAY."
#elif defined(DISABLE_INACTIVE_E)
#error "DISABLE_INACTIVE_E is now set with DISABLE_INACTIVE_EXTRUDER."
#elif defined(INVERT_X_STEP_PIN) || defined(INVERT_Y_STEP_PIN) || defined(INVERT_Z_STEP_PIN) || defined(INVERT_I_STEP_PIN) || defined(INVERT_J_STEP_PIN) || defined(INVERT_K_STEP_PIN) || defined(INVERT_U_STEP_PIN) || defined(INVERT_V_STEP_PIN) || defined(INVERT_W_STEP_PIN) || defined(INVERT_E_STEP_PIN)
#error "INVERT_*_STEP_PIN true is now STEP_STATE_* LOW, and INVERT_*_STEP_PIN false is now STEP_STATE_* HIGH."
#endif
// L64xx stepper drivers have been removed
@@ -1013,9 +1019,15 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#endif
#endif
/**
* Custom Event G-code
*/
#if defined(EVENT_GCODE_SD_ABORT) && DISABLED(NOZZLE_PARK_FEATURE)
static_assert(nullptr == strstr(EVENT_GCODE_SD_ABORT, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_ABORT.");
#endif
#if ANY(TC_GCODE_USE_GLOBAL_X, TC_GCODE_USE_GLOBAL_Y, TC_GCODE_USE_GLOBAL_Z) && ENABLED(NO_WORKSPACE_OFFSETS)
#error "TC_GCODE_USE_GLOBAL_* options are incompatible with NO_WORKSPACE_OFFSETS."
#endif
/**
* I2C Position Encoders
@@ -1042,10 +1054,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
#elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
#error "BABYSTEP_ZPROBE_OFFSET requires a probe."
#elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
#error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
#elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(BABYSTEP_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
#error "BABYSTEP_GFX_OVERLAY requires a Graphical LCD."
#elif ENABLED(BABYSTEP_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "BABYSTEP_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
#error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
#elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
@@ -1102,10 +1114,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
@@ -1257,20 +1330,34 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
/**
* A Dual Nozzle carriage with switching servo
*/
#if ENABLED(SWITCHING_NOZZLE)
#if ENABLED(DUAL_X_CARRIAGE)
#if BOTH(SWITCHING_NOZZLE, MECHANICAL_SWITCHING_NOZZLE)
#error "Enable only one of SWITCHING_NOZZLE or MECHANICAL_SWITCHING_NOZZLE."
#elif ENABLED(MECHANICAL_SWITCHING_NOZZLE)
#if EXTRUDERS != 2
#error "MECHANICAL_SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
#elif ENABLED(DUAL_X_CARRIAGE)
#error "MECHANICAL_SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
#elif ENABLED(SINGLENOZZLE)
#error "MECHANICAL_SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
#elif HAS_PRUSA_MMU2
#error "MECHANICAL_SWITCHING_NOZZLE and PRUSA_MMU2(S) are incompatible."
#elif !defined(EVENT_GCODE_TOOLCHANGE_T0)
#error "MECHANICAL_SWITCHING_NOZZLE requires EVENT_GCODE_TOOLCHANGE_T0."
#elif !defined(EVENT_GCODE_TOOLCHANGE_T1)
#error "MECHANICAL_SWITCHING_NOZZLE requires EVENT_GCODE_TOOLCHANGE_T1."
#endif
#elif ENABLED(SWITCHING_NOZZLE)
#if EXTRUDERS != 2
#error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
#elif ENABLED(DUAL_X_CARRIAGE)
#error "SWITCHING_NOZZLE and DUAL_X_CARRIAGE are incompatible."
#elif ENABLED(SINGLENOZZLE)
#error "SWITCHING_NOZZLE and SINGLENOZZLE are incompatible."
#elif HAS_PRUSA_MMU2
#error "SWITCHING_NOZZLE and PRUSA_MMU2(S) are incompatible."
#elif EXTRUDERS != 2
#error "SWITCHING_NOZZLE requires exactly 2 EXTRUDERS."
#elif NUM_SERVOS < 1
#error "SWITCHING_NOZZLE requires NUM_SERVOS >= 1."
#endif
#ifndef SWITCHING_NOZZLE_SERVO_NR
#elif !defined(SWITCHING_NOZZLE_SERVO_NR)
#error "SWITCHING_NOZZLE requires SWITCHING_NOZZLE_SERVO_NR."
#elif SWITCHING_NOZZLE_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your SWITCHING_NOZZLE."
@@ -1281,7 +1368,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#elif SWITCHING_NOZZLE_SERVO_NR == 3 && !PIN_EXISTS(SERVO3)
#error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
#endif
#ifdef SWITCHING_NOZZLE_E1_SERVO_NR
#if SWITCHING_NOZZLE_E1_SERVO_NR == SWITCHING_NOZZLE_SERVO_NR
#error "SWITCHING_NOZZLE_E1_SERVO_NR must be different from SWITCHING_NOZZLE_SERVO_NR."
@@ -1295,14 +1381,26 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "SERVO3_PIN must be defined for your SWITCHING_NOZZLE."
#endif
#endif
#endif
#endif // SWITCHING_NOZZLE
/**
* Single Stepper Dual Extruder with switching servo
*/
#if ENABLED(SWITCHING_EXTRUDER)
#if BOTH(SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_EXTRUDER)
#error "Enable only one of SWITCHING_EXTRUDER or MECHANICAL_SWITCHING_EXTRUDER."
#elif ENABLED(MECHANICAL_SWITCHING_EXTRUDER)
#if EXTRUDERS < 2
#error "MECHANICAL_SWITCHING_EXTRUDER requires EXTRUDERS >= 2."
#elif !defined(EVENT_GCODE_TOOLCHANGE_T0)
#error "MECHANICAL_SWITCHING_EXTRUDER requires EVENT_GCODE_TOOLCHANGE_T0."
#elif !defined(EVENT_GCODE_TOOLCHANGE_T1)
#error "MECHANICAL_SWITCHING_EXTRUDER requires EVENT_GCODE_TOOLCHANGE_T1."
#endif
#elif ENABLED(SWITCHING_EXTRUDER)
#if NUM_SERVOS < 1
#error "SWITCHING_EXTRUDER requires NUM_SERVOS >= 1."
#elif !defined(SWITCHING_EXTRUDER_SERVO_NR)
#error "SWITCHING_EXTRUDER requires SWITCHING_EXTRUDER_SERVO_NR."
#elif SWITCHING_EXTRUDER_SERVO_NR == 0 && !PIN_EXISTS(SERVO0)
#error "SERVO0_PIN must be defined for your SWITCHING_EXTRUDER."
#elif SWITCHING_EXTRUDER_SERVO_NR == 1 && !PIN_EXISTS(SERVO1)
@@ -1326,8 +1424,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#elif SWITCHING_EXTRUDER_E23_SERVO_NR == SWITCHING_EXTRUDER_SERVO_NR
#error "SWITCHING_EXTRUDER_E23_SERVO_NR should be a different extruder from SWITCHING_EXTRUDER_SERVO_NR."
#endif
#elif EXTRUDERS < 2
#error "SWITCHING_EXTRUDER requires EXTRUDERS >= 2."
#endif
#endif
#endif // SWITCHING_EXTRUDER
/**
* Mixing Extruder requirements
@@ -1339,14 +1439,12 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "You must set MIXING_STEPPERS >= 2 for a mixing extruder."
#elif ENABLED(FILAMENT_WIDTH_SENSOR)
#error "MIXING_EXTRUDER is incompatible with FILAMENT_WIDTH_SENSOR. Comment out this line to use it anyway."
#elif ENABLED(SWITCHING_EXTRUDER)
#error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both."
#elif HAS_SWITCHING_EXTRUDER
#error "MIXING_EXTRUDER is incompatible with (MECHANICAL_)SWITCHING_EXTRUDER."
#elif ENABLED(SINGLENOZZLE)
#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
@@ -1358,8 +1456,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "E_DUAL_STEPPER_DRIVERS can only be used with EXTRUDERS set to 1."
#elif ENABLED(MIXING_EXTRUDER)
#error "E_DUAL_STEPPER_DRIVERS is incompatible with MIXING_EXTRUDER."
#elif ENABLED(SWITCHING_EXTRUDER)
#error "E_DUAL_STEPPER_DRIVERS is incompatible with SWITCHING_EXTRUDER."
#elif HAS_SWITCHING_EXTRUDER
#error "E_DUAL_STEPPER_DRIVERS is incompatible with (MECHANICAL_)SWITCHING_EXTRUDER."
#endif
#endif
@@ -1580,18 +1678,18 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#endif
/**
* Features that require a min/max/specific NUM_AXES
* Features that require a min/max/specific steppers / axes to be enabled.
*/
#if HAS_LEVELING && !HAS_Z_AXIS
#error "Leveling in Marlin requires three or more axes, with Z as the vertical axis."
#elif ENABLED(CNC_WORKSPACE_PLANES) && !HAS_Z_AXIS
#error "CNC_WORKSPACE_PLANES currently requires NUM_AXES >= 3"
#error "CNC_WORKSPACE_PLANES currently requires a Z axis"
#elif ENABLED(DIRECT_STEPPING) && NUM_AXES > XYZ
#error "DIRECT_STEPPING currently requires NUM_AXES 3"
#elif ENABLED(FOAMCUTTER_XYUV) && NUM_AXES < 5
#error "FOAMCUTTER_XYUV requires NUM_AXES >= 5."
#error "DIRECT_STEPPING does not currently support more than 3 axes (i.e., XYZ)."
#elif ENABLED(FOAMCUTTER_XYUV) && !(HAS_I_AXIS && HAS_J_AXIS)
#error "FOAMCUTTER_XYUV requires I and J steppers to be enabled."
#elif ENABLED(LINEAR_ADVANCE) && HAS_I_AXIS
#error "LINEAR_ADVANCE currently requires NUM_AXES <= 3."
#error "LINEAR_ADVANCE does not currently support the inclusion of an I axis."
#endif
/**
@@ -1599,11 +1697,13 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
*/
#if HAS_I_AXIS
#if !defined(I_MIN_POS) || !defined(I_MAX_POS)
#error "I_MIN_POS and I_MAX_POS are required with NUM_AXES >= 4."
#error "I_MIN_POS and I_MAX_POS are required for the I axis."
#elif !defined(I_HOME_DIR)
#error "I_HOME_DIR is required with NUM_AXES >= 4."
#error "I_HOME_DIR is required for the I axis."
#elif HAS_I_ENABLE && !defined(I_ENABLE_ON)
#error "I_ENABLE_ON is required for your I driver with NUM_AXES >= 4."
#error "I_ENABLE_ON is required for the I stepper."
#elif !defined(INVERT_I_DIR)
#error "INVERT_I_DIR is required for the I stepper."
#endif
#endif
#if HAS_J_AXIS
@@ -1612,11 +1712,13 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#elif ENABLED(AXIS5_ROTATES) && DISABLED(AXIS4_ROTATES)
#error "AXIS5_ROTATES requires AXIS4_ROTATES."
#elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
#error "J_MIN_POS and J_MAX_POS are required with NUM_AXES >= 5."
#error "J_MIN_POS and J_MAX_POS are required for the J axis."
#elif !defined(J_HOME_DIR)
#error "J_HOME_DIR is required with NUM_AXES >= 5."
#error "J_HOME_DIR is required for the J axis."
#elif HAS_J_ENABLE && !defined(J_ENABLE_ON)
#error "J_ENABLE_ON is required for your J driver with NUM_AXES >= 5."
#error "J_ENABLE_ON is required for the J stepper."
#elif !defined(INVERT_J_DIR)
#error "INVERT_J_DIR is required for the J stepper."
#endif
#endif
#if HAS_K_AXIS
@@ -1625,11 +1727,13 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#elif ENABLED(AXIS6_ROTATES) && DISABLED(AXIS5_ROTATES)
#error "AXIS6_ROTATES requires AXIS5_ROTATES."
#elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
#error "K_MIN_POS and K_MAX_POS are required with NUM_AXES >= 6."
#error "K_MIN_POS and K_MAX_POS are required for the K axis."
#elif !defined(K_HOME_DIR)
#error "K_HOME_DIR is required with NUM_AXES >= 6."
#error "K_HOME_DIR is required for the K axis."
#elif HAS_K_ENABLE && !defined(K_ENABLE_ON)
#error "K_ENABLE_ON is required for your K driver with NUM_AXES >= 6."
#error "K_ENABLE_ON is required for the K stepper."
#elif !defined(INVERT_K_DIR)
#error "INVERT_K_DIR is required for the K stepper."
#endif
#endif
#if HAS_U_AXIS
@@ -1638,11 +1742,13 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#elif ENABLED(AXIS7_ROTATES) && DISABLED(AXIS6_ROTATES)
#error "AXIS7_ROTATES requires AXIS6_ROTATES."
#elif !defined(U_MIN_POS) || !defined(U_MAX_POS)
#error "U_MIN_POS and U_MAX_POS are required with NUM_AXES >= 7."
#error "U_MIN_POS and U_MAX_POS are required for the U axis."
#elif !defined(U_HOME_DIR)
#error "U_HOME_DIR is required with NUM_AXES >= 7."
#error "U_HOME_DIR is required for the U axis."
#elif HAS_U_ENABLE && !defined(U_ENABLE_ON)
#error "U_ENABLE_ON is required for your U driver with NUM_AXES >= 7."
#error "U_ENABLE_ON is required for the U stepper."
#elif !defined(INVERT_U_DIR)
#error "INVERT_U_DIR is required for the U stepper."
#endif
#endif
#if HAS_V_AXIS
@@ -1651,11 +1757,13 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#elif ENABLED(AXIS8_ROTATES) && DISABLED(AXIS7_ROTATES)
#error "AXIS8_ROTATES requires AXIS7_ROTATES."
#elif !defined(V_MIN_POS) || !defined(V_MAX_POS)
#error "V_MIN_POS and V_MAX_POS are required with NUM_AXES >= 8."
#error "V_MIN_POS and V_MAX_POS are required for the V axis."
#elif !defined(V_HOME_DIR)
#error "V_HOME_DIR is required with NUM_AXES >= 8."
#error "V_HOME_DIR is required for the V axis."
#elif HAS_V_ENABLE && !defined(V_ENABLE_ON)
#error "V_ENABLE_ON is required for your V driver with NUM_AXES >= 8."
#error "V_ENABLE_ON is required for the V stepper."
#elif !defined(INVERT_V_DIR)
#error "INVERT_V_DIR is required for the V stepper."
#endif
#endif
#if HAS_W_AXIS
@@ -1664,11 +1772,13 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#elif ENABLED(AXIS9_ROTATES) && DISABLED(AXIS8_ROTATES)
#error "AXIS9_ROTATES requires AXIS8_ROTATES."
#elif !defined(W_MIN_POS) || !defined(W_MAX_POS)
#error "W_MIN_POS and W_MAX_POS are required with NUM_AXES >= 9."
#error "W_MIN_POS and W_MAX_POS are required for the W axis."
#elif !defined(W_HOME_DIR)
#error "W_HOME_DIR is required with NUM_AXES >= 9."
#error "W_HOME_DIR is required for the W axis."
#elif HAS_W_ENABLE && !defined(W_ENABLE_ON)
#error "W_ENABLE_ON is required for your W driver with NUM_AXES >= 9."
#error "W_ENABLE_ON is required for the W stepper."
#elif !defined(INVERT_W_DIR)
#error "INVERT_W_DIR is required for the W stepper."
#endif
#endif
@@ -1895,9 +2005,9 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
*/
#if ENABLED(SENSORLESS_PROBING)
#if ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
#error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z."
#error "SENSORLESS_PROBING requires TMC2130/2160/2209/5130/5160 drivers on X, Y, and Z and {X|Y|Z}_STALL_SENSITIVITY."
#elif !Z_SENSORLESS
#error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z."
#error "SENSORLESS_PROBING requires a TMC2130/2160/2209/5130/5160 driver on Z and Z_STALL_SENSITIVITY."
#endif
#elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if DISABLED(USE_ZMIN_PLUG)
@@ -2185,6 +2295,27 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
#endif
// Check Safe Bed Leveling settings
#if HAS_SAFE_BED_LEVELING
#if defined(SAFE_BED_LEVELING_START_Y) && !defined(SAFE_BED_LEVELING_START_X)
#error "If SAFE_BED_LEVELING_START_Y is defined, SAFE_BED_LEVELING_START_X must also be defined."
#elif defined(SAFE_BED_LEVELING_START_Z) && !defined(SAFE_BED_LEVELING_START_Y)
#error "If SAFE_BED_LEVELING_START_Z is defined, SAFE_BED_LEVELING_START_Y must also be defined."
#elif defined(SAFE_BED_LEVELING_START_I) && !defined(SAFE_BED_LEVELING_START_Z)
#error "If SAFE_BED_LEVELING_START_I is defined, SAFE_BED_LEVELING_START_Z must also be defined."
#elif defined(SAFE_BED_LEVELING_START_J) && !defined(SAFE_BED_LEVELING_START_I)
#error "If SAFE_BED_LEVELING_START_J is defined, SAFE_BED_LEVELING_START_I must also be defined."
#elif defined(SAFE_BED_LEVELING_START_K) && !defined(SAFE_BED_LEVELING_START_J)
#error "If SAFE_BED_LEVELING_START_K is defined, SAFE_BED_LEVELING_START_J must also be defined."
#elif defined(SAFE_BED_LEVELING_START_U) && !defined(SAFE_BED_LEVELING_START_K)
#error "If SAFE_BED_LEVELING_START_U is defined, SAFE_BED_LEVELING_START_K must also be defined."
#elif defined(SAFE_BED_LEVELING_START_V) && !defined(SAFE_BED_LEVELING_START_U)
#error "If SAFE_BED_LEVELING_START_V is defined, SAFE_BED_LEVELING_START_U must also be defined."
#elif defined(SAFE_BED_LEVELING_START_W) && !defined(SAFE_BED_LEVELING_START_V)
#error "If SAFE_BED_LEVELING_START_W is defined, SAFE_BED_LEVELING_START_V must also be defined."
#endif
#endif
/**
* Make sure DISABLE_[XYZ] compatible with selected homing options
*/
@@ -2688,8 +2819,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#error "MULTI_NOZZLE_DUPLICATION is incompatible with DUAL_X_CARRIAGE."
#elif ENABLED(MIXING_EXTRUDER)
#error "MULTI_NOZZLE_DUPLICATION is incompatible with MIXING_EXTRUDER."
#elif ENABLED(SWITCHING_EXTRUDER)
#error "MULTI_NOZZLE_DUPLICATION is incompatible with SWITCHING_EXTRUDER."
#elif HAS_SWITCHING_EXTRUDER
#error "MULTI_NOZZLE_DUPLICATION is incompatible with (MECHANICAL_)SWITCHING_EXTRUDER."
#elif HOTENDS < 2
#error "MULTI_NOZZLE_DUPLICATION requires 2 or more hotends."
#endif
@@ -3196,8 +3327,14 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#if LCD_BACKLIGHT_TIMEOUT_MINS
#if !HAS_ENCODER_ACTION
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad."
#elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST)
#if PIN_EXISTS(LCD_BACKLIGHT)
#error "LCD_BACKLIGHT_PIN and NEOPIXEL_BKGD_INDEX_FIRST are not supported at the same time."
#elif ENABLED(NEOPIXEL_BKGD_ALWAYS_ON)
#error "LCD_BACKLIGHT_TIMEOUT is not compatible with NEOPIXEL_BKGD_ALWAYS_ON."
#endif
#elif !PIN_EXISTS(LCD_BACKLIGHT)
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires LCD_BACKLIGHT_PIN."
#error "LCD_BACKLIGHT_TIMEOUT_MINS requires either LCD_BACKLIGHT_PIN or NEOPIXEL_BKGD_INDEX_FIRST."
#endif
#endif
@@ -4331,6 +4468,8 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(HOME_AFTER_DEACTIVATE)
#error "DGUS_LCD_UI RELOADED requires HOME_AFTER_DEACTIVATE to be disabled."
#elif ENABLED(AUTO_BED_LEVELING_UBL) && DISABLED(UBL_SAVE_ACTIVE_ON_M500)
#warning "Without UBL_SAVE_ACTIVE_ON_M500, your mesh will not be saved when using the touchscreen."
#endif
+1 -1
View File
@@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2023-02-03"
#define STRING_DISTRIBUTION_DATE "2023-03-10"
#endif
/**
+12 -2
View File
@@ -537,7 +537,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
*/
FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) {
#if HAS_HEATED_BED
const bool isBed = TERN(HAS_HEATED_CHAMBER, heater_id == H_BED, heater_id < 0);
const bool isBed = heater_id == H_BED;
const celsius_t t1 = (isBed ? thermalManager.wholeDegBed() : thermalManager.wholeDegHotend(heater_id)),
t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater_id));
#else
@@ -546,7 +546,17 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr
if (prefix >= 0) lcd_put_lchar(prefix);
lcd_put_u8str(t1 < 0 ? "err" : i16tostr3rj(t1));
if (t1 >= 0)
lcd_put_u8str(ui16tostr3rj(t1));
else {
#if ENABLED(SHOW_TEMPERATURE_BELOW_ZERO)
char * const str = i16tostr3rj(t1);
lcd_put_u8str(&str[1]);
#else
lcd_put_u8str(F("err"));
#endif
}
lcd_put_u8str(F("/"));
#if !HEATER_IDLE_HANDLER
@@ -0,0 +1,10 @@
/**
* Generated automatically by buildroot/share/fonts/uxggenpages.sh
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#pragma once
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_fr_na[] PROGMEM = {};
+1 -7
View File
@@ -7,10 +7,4 @@
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_2_241_241[31] U8G_FONT_SECTION("fontpage_2_241_241") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF1,0xF1,0x00,0x08,0x00,0x00,
0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x48,0x90,0x00,0x88,0x88,0x88,0x88,0x70};
static const uxg_fontinfo_t g_fontinfo_hu[] PROGMEM = {
FONTDATA_ITEM(2, 241, 241, fontpage_2_241_241), // 'ű' -- 'ű'
};
static const uxg_fontinfo_t g_fontinfo_hu[] PROGMEM = {};
@@ -27,6 +27,9 @@ const u8g_fntpgm_uint8_t fontpage_2_218_219[47] U8G_FONT_SECTION("fontpage_2_218
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xDA,0xDB,0x00,0x0A,0x00,0x00,
0x00,0x05,0x0A,0x0A,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x80,0x70,0x08,0x88,
0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x78,0x80,0x70,0x08,0xF0};
const u8g_fntpgm_uint8_t fontpage_2_250_250[31] U8G_FONT_SECTION("fontpage_2_250_250") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xFA,0xFA,0x00,0x08,0x00,0x00,
0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0xF8,0x10,0x20,0x40,0xF8};
const u8g_fntpgm_uint8_t fontpage_2_252_252[30] U8G_FONT_SECTION("fontpage_2_252_252") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xFC,0xFC,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x00,0xF8,0x10,0x20,0x40,0xF8};
@@ -37,5 +40,6 @@ static const uxg_fontinfo_t g_fontinfo_pl[] PROGMEM = {
FONTDATA_ITEM(2, 153, 153, fontpage_2_153_153), // 'ę' -- 'ę'
FONTDATA_ITEM(2, 193, 196, fontpage_2_193_196), // 'Ł' -- 'ń'
FONTDATA_ITEM(2, 218, 219, fontpage_2_218_219), // 'Ś' -- 'ś'
FONTDATA_ITEM(2, 250, 250, fontpage_2_250_250), // 'ź' -- 'ź'
FONTDATA_ITEM(2, 252, 252, fontpage_2_252_252), // 'ż' -- 'ż'
};
@@ -0,0 +1,10 @@
/**
* Generated automatically by buildroot/share/fonts/uxggenpages.sh
* Contents will be REPLACED by future processing!
* Use genallfont.sh to generate font data for updated languages.
*/
#pragma once
#include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_sv[] PROGMEM = {};
@@ -7,9 +7,6 @@
#include "langdata.h"
const u8g_fntpgm_uint8_t fontpage_64_157_157[26] U8G_FONT_SECTION("fontpage_64_157_157") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9D,0x9D,0x00,0x07,0x00,0x00,
0x00,0x05,0x03,0x03,0x06,0x00,0x04,0xD8,0x48,0x90};
const u8g_fntpgm_uint8_t fontpage_69_191_191[28] U8G_FONT_SECTION("fontpage_69_191_191") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBF,0xBF,0x00,0x05,0x00,0x00,
0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x08,0x18,0x28,0x48,0xF8};
@@ -382,10 +379,6 @@ const u8g_fntpgm_uint8_t fontpage_172_232_232[45] U8G_FONT_SECTION("fontpage_172
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xE8,0xE8,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x7B,0xC0,0x4A,0x40,0x4A,0x40,0x7B,0xC0,0x04,
0x80,0xFF,0xE0,0x11,0x00,0xFB,0xE0,0x4A,0x40,0x4A,0x40,0x7B,0xC0};
const u8g_fntpgm_uint8_t fontpage_172_244_244[45] U8G_FONT_SECTION("fontpage_172_244_244") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF4,0xF4,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x01,0x00,0xEF,0xE0,0xA5,0x40,0xAF,0xE0,0xA4,
0x40,0xA7,0xC0,0xE4,0x40,0x07,0xC0,0x04,0x40,0x07,0xC0,0x0C,0x60};
const u8g_fntpgm_uint8_t fontpage_173_222_222[45] U8G_FONT_SECTION("fontpage_173_222_222") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xDE,0xDE,0x00,0x0A,0xFF,0x00,
0x00,0x0A,0x0B,0x16,0x0C,0x01,0xFF,0xFF,0xC0,0x80,0x40,0x80,0x40,0x9E,0x40,0x92,
@@ -744,10 +737,6 @@ const u8g_fntpgm_uint8_t fontpage_202_244_244[45] U8G_FONT_SECTION("fontpage_202
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF4,0xF4,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x11,0x00,0xFF,0xE0,0x55,0x40,0x7C,0x80,0x39,
0x40,0x56,0x20,0x7F,0xC0,0x04,0x00,0x27,0x80,0x24,0x00,0xFF,0xE0};
const u8g_fntpgm_uint8_t fontpage_203_135_135[45] U8G_FONT_SECTION("fontpage_203_135_135") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x87,0x87,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x08,0x00,0x04,0x00,0xFF,0xE0,0x11,0x00,0x11,
0x00,0x11,0x00,0x0A,0x00,0x0A,0x00,0x04,0x00,0x1B,0x00,0xE0,0xE0};
const u8g_fntpgm_uint8_t fontpage_203_153_153[45] U8G_FONT_SECTION("fontpage_203_153_153") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x99,0x99,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x20,0x80,0xAC,0x80,0x72,0x80,0x20,0x80,0xFC,
@@ -1050,10 +1039,6 @@ const u8g_fntpgm_uint8_t fontpage_246_201_201[45] U8G_FONT_SECTION("fontpage_246
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xC9,0xC9,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x42,0x00,0x7B,0xE0,0x94,0x80,0x7F,0xC0,0x04,
0x00,0xFF,0xE0,0x01,0x00,0x7F,0xC0,0x11,0x00,0x09,0x00,0x03,0x00};
const u8g_fntpgm_uint8_t fontpage_247_128_128[45] U8G_FONT_SECTION("fontpage_247_128_128") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x42,0x00,0x7B,0xE0,0x94,0x80,0x27,0xC0,0x50,
0x40,0x4F,0x40,0x49,0x40,0x4F,0x40,0x49,0x40,0x4F,0x40,0x40,0xC0};
const u8g_fntpgm_uint8_t fontpage_247_177_177[45] U8G_FONT_SECTION("fontpage_247_177_177") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xB1,0xB1,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x21,0x00,0x3D,0xE0,0x4A,0x80,0x94,0x40,0x7F,
@@ -1465,7 +1450,6 @@ const u8g_fntpgm_uint8_t fontpage_510_154_154[30] U8G_FONT_SECTION("fontpage_510
0x00,0x02,0x07,0x07,0x0C,0x06,0x01,0xC0,0xC0,0x00,0x00,0x00,0xC0,0xC0};
static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(64, 157, 157, fontpage_64_157_157), // '”' -- '”'
FONTDATA_ITEM(69, 191, 191, fontpage_69_191_191), // '⊿' -- '⊿'
FONTDATA_ITEM(156, 128, 128, fontpage_156_128_128), // '一' -- '一'
FONTDATA_ITEM(156, 137, 139, fontpage_156_137_139), // '三' -- '下'
@@ -1553,7 +1537,6 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(171, 183, 183, fontpage_171_183_183), // '喷' -- '喷'
FONTDATA_ITEM(172, 180, 180, fontpage_172_180_180), // '嘴' -- '嘴'
FONTDATA_ITEM(172, 232, 232, fontpage_172_232_232), // '器' -- '器'
FONTDATA_ITEM(172, 244, 244, fontpage_172_244_244), // '噴' -- '噴'
FONTDATA_ITEM(173, 222, 222, fontpage_173_222_222), // '回' -- '回'
FONTDATA_ITEM(173, 224, 224, fontpage_173_224_224), // '因' -- '因'
FONTDATA_ITEM(173, 250, 250, fontpage_173_250_250), // '固' -- '固'
@@ -1642,7 +1625,6 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(202, 240, 240, fontpage_202_240_240), // '数' -- '数'
FONTDATA_ITEM(202, 242, 242, fontpage_202_242_242), // '敲' -- '敲'
FONTDATA_ITEM(202, 244, 244, fontpage_202_244_244), // '整' -- '整'
FONTDATA_ITEM(203, 135, 135, fontpage_203_135_135), // '文' -- '文'
FONTDATA_ITEM(203, 153, 153, fontpage_203_153_153), // '料' -- '料'
FONTDATA_ITEM(203, 156, 156, fontpage_203_156_156), // '斜' -- '斜'
FONTDATA_ITEM(203, 173, 173, fontpage_203_173_173), // '断' -- '断'
@@ -1718,7 +1700,6 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(245, 239, 239, fontpage_245_239_239), // '端' -- '端'
FONTDATA_ITEM(246, 172, 172, fontpage_246_172_172), // '第' -- '第'
FONTDATA_ITEM(246, 201, 201, fontpage_246_201_201), // '等' -- '等'
FONTDATA_ITEM(247, 128, 128, fontpage_247_128_128), // '简' -- '简'
FONTDATA_ITEM(247, 177, 177, fontpage_247_177_177), // '箱' -- '箱'
FONTDATA_ITEM(248, 251, 251, fontpage_248_251_251), // '类' -- '类'
FONTDATA_ITEM(250, 162, 162, fontpage_250_162_162), // '索' -- '索'
@@ -343,12 +343,10 @@ const u8g_fntpgm_uint8_t fontpage_178_167_167[45] U8G_FONT_SECTION("fontpage_178
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xA7,0xA7,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x04,0x00,0x04,0x00,0x04,0x00,0xFF,0xE0,0x04,
0x00,0x04,0x00,0x0A,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0xC0,0x60};
const u8g_fntpgm_uint8_t fontpage_178_169_170[73] U8G_FONT_SECTION("fontpage_178_169_170") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xA9,0xAA,0x00,0x0A,0xFF,0x00,
const u8g_fntpgm_uint8_t fontpage_178_169_169[45] U8G_FONT_SECTION("fontpage_178_169_169") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xA9,0xA9,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x7F,0xC0,0x04,0x00,0x04,0x00,0x04,0x00,0xFF,
0xE0,0x04,0x00,0x0A,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0xC0,0x60,0x0B,0x0B,0x16,
0x0C,0x00,0xFF,0x04,0x00,0x04,0x00,0x04,0x00,0xFF,0xE0,0x04,0x00,0x0A,0x00,0x0A,
0x00,0x11,0x00,0x19,0x00,0x24,0x80,0xC4,0x60};
0xE0,0x04,0x00,0x0A,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0xC0,0x60};
const u8g_fntpgm_uint8_t fontpage_178_177_177[45] U8G_FONT_SECTION("fontpage_178_177_177") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xB1,0xB1,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x24,0x00,0x24,0x00,0x3F,0xC0,0x44,0x00,0x04,
@@ -1302,7 +1300,7 @@ static const uxg_fontinfo_t g_fontinfo_zh_TW[] PROGMEM = {
FONTDATA_ITEM(178, 154, 154, fontpage_178_154_154), // '多' -- '多'
FONTDATA_ITEM(178, 160, 160, fontpage_178_160_160), // '夠' -- '夠'
FONTDATA_ITEM(178, 167, 167, fontpage_178_167_167), // '大' -- '大'
FONTDATA_ITEM(178, 169, 170, fontpage_178_169_170), // '天' -- ''
FONTDATA_ITEM(178, 169, 169, fontpage_178_169_169), // '天' -- ''
FONTDATA_ITEM(178, 177, 177, fontpage_178_177_177), // '失' -- '失'
FONTDATA_ITEM(179, 203, 203, fontpage_179_203_203), // '始' -- '始'
FONTDATA_ITEM(181, 146, 146, fontpage_181_146_146), // '媒' -- '媒'
+2 -2
View File
@@ -628,7 +628,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
#endif // AUTO_BED_LEVELING_UBL
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
//
// Draw knob rotation => Z motion key for:
@@ -746,7 +746,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
}
}
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
#endif // BABYSTEP_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
#endif // HAS_MARLINUI_MENU
+25 -10
View File
@@ -96,9 +96,10 @@
DRAWBIT_HOTEND,
DRAWBIT_BED = HOTENDS,
DRAWBIT_CHAMBER,
DRAWBIT_CUTTER
DRAWBIT_CUTTER,
DRAWBIT_COUNT
};
IF<(DRAWBIT_CUTTER > 7), uint16_t, uint8_t>::type draw_bits;
bits_t(DRAWBIT_COUNT) draw_bits;
#endif
#if ANIM_HOTEND
@@ -192,14 +193,26 @@
#define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, const uint8_t ty) {
if (temp < 0)
lcd_put_u8str(tx - 3 * (INFO_FONT_WIDTH) / 2 + 1, ty, F("err"));
else {
const char *str = i16tostr3rj(temp);
const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]);
lcd_put_lchar(LCD_STR_DEGREE[0]);
const char *str;
uint8_t len;
if (temp >= 0) {
str = i16tostr3left(temp);
len = strlen(str);
lcd_moveto(tx + 1 - len * (INFO_FONT_WIDTH) / 2, ty);
}
else {
#if ENABLED(SHOW_TEMPERATURE_BELOW_ZERO)
str = i16tostr3left((-temp) % 100);
len = strlen(str) + 1;
lcd_moveto(tx + 1 - len * (INFO_FONT_WIDTH) / 2, ty);
lcd_put_lchar('-');
#else
lcd_put_u8str(tx + 1 - 3 * (INFO_FONT_WIDTH) / 2, ty, F("err"));
return;
#endif
}
lcd_put_u8str(str);
lcd_put_lchar(LCD_STR_DEGREE[0]);
}
#if DO_DRAW_FLOWMETER
@@ -512,7 +525,9 @@ void MarlinUI::draw_status_screen() {
const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive());
static u8g_uint_t progress_bar_solid_width = 0;
#if HAS_PRINT_PROGRESS
static u8g_uint_t progress_bar_solid_width = 0;
#endif
// At the first page, generate new display values
if (first_page) {
+18 -22
View File
@@ -2734,7 +2734,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
#define ADVANCED_UNLOAD (ADVANCED_LOAD + ENABLED(ADVANCED_PAUSE_FEATURE))
#define ADVANCED_COLD_EXTRUDE (ADVANCED_UNLOAD + ENABLED(PREVENT_COLD_EXTRUSION))
#define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(FILAMENT_RUNOUT_SENSOR))
#define ADVANCED_FILSENSORDISTANCE (ADVANCED_FILSENSORENABLED + ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE))
#define ADVANCED_FILSENSORDISTANCE (ADVANCED_FILSENSORENABLED + 1)
#define ADVANCED_POWER_LOSS (ADVANCED_FILSENSORDISTANCE + ENABLED(POWER_LOSS_RECOVERY))
#define ADVANCED_TOTAL ADVANCED_POWER_LOSS
@@ -2833,24 +2833,22 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
case ADVANCED_FILSENSORENABLED:
if (draw) {
Draw_Menu_Item(row, ICON_Extruder, F("Filament Sensor"));
Draw_Checkbox(row, runout.enabled);
Draw_Checkbox(row, runout.enabled[0]);
}
else {
runout.enabled = !runout.enabled;
Draw_Checkbox(row, runout.enabled);
runout.enabled[0] = !runout.enabled[0];
Draw_Checkbox(row, runout.enabled[0]);
}
break;
#if ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE)
case ADVANCED_FILSENSORDISTANCE:
if (draw) {
Draw_Menu_Item(row, ICON_MaxAccE, F("Runout Distance"));
Draw_Float(runout.runout_distance(), row, false, 10);
}
else
Modify_Value(runout.runout_distance(), 0, 999, 10);
break;
#endif
case ADVANCED_FILSENSORDISTANCE:
if (draw) {
Draw_Menu_Item(row, ICON_MaxAccE, F("Runout Distance"));
Draw_Float(runout.runout_distance(), row, false, 10);
}
else
Modify_Value(runout.runout_distance(), 0, 999, 10);
break;
#endif // FILAMENT_RUNOUT_SENSOR
#if ENABLED(POWER_LOSS_RECOVERY)
@@ -3816,11 +3814,11 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
case TUNE_FILSENSORENABLED:
if (draw) {
Draw_Menu_Item(row, ICON_Extruder, F("Filament Sensor"));
Draw_Checkbox(row, runout.enabled);
Draw_Checkbox(row, runout.enabled[0]);
}
else {
runout.enabled = !runout.enabled;
Draw_Checkbox(row, runout.enabled);
runout.enabled = !runout.enabled[0];
Draw_Checkbox(row, runout.enabled[0]);
}
break;
#endif
@@ -4229,8 +4227,7 @@ void CrealityDWINClass::Value_Control() {
if (funcpointer) funcpointer();
return;
}
NOLESS(tempvalue, (valuemin * valueunit));
NOMORE(tempvalue, (valuemax * valueunit));
LIMIT(tempvalue, valuemin * valueunit, valuemax * valueunit);
Draw_Float(tempvalue / valueunit, selection - scrollpos, true, valueunit);
DWIN_UpdateLCD();
if (active_menu == Move && livemove) {
@@ -4272,8 +4269,7 @@ void CrealityDWINClass::Option_Control() {
DWIN_UpdateLCD();
return;
}
NOLESS(tempvalue, valuemin);
NOMORE(tempvalue, valuemax);
LIMIT(tempvalue, valuemin, valuemax);
Draw_Option(tempvalue, static_cast<const char * const *>(valuepointer), selection - scrollpos, true);
DWIN_UpdateLCD();
}
@@ -4663,7 +4659,7 @@ void CrealityDWINClass::Start_Print(bool sd) {
if (sd) {
#if ENABLED(POWER_LOSS_RECOVERY)
if (recovery.valid()) {
SdFile *diveDir = nullptr;
MediaFile *diveDir = nullptr;
const char * const fname = card.diveToFile(true, diveDir, recovery.info.sd_filename);
card.selectFileByName(fname);
}
+2 -2
View File
@@ -565,7 +565,7 @@ void MarlinUI::draw_status_message(const bool blink) {
#endif // AUTO_BED_LEVELING_UBL
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
void MarlinUI::zoffset_overlay(const int8_t dir) {
const int rot_up = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCCW, ICON_RotateCW),
@@ -587,7 +587,7 @@ void MarlinUI::draw_status_message(const bool blink) {
DWIN_ICON_Show(ICON, rot_up, LCD_PIXEL_WIDTH - 10 - 48, arrow_y);
}
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
#endif // BABYSTEP_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
#endif // HAS_MARLINUI_MENU
+6 -24
View File
@@ -1271,7 +1271,6 @@ void EachMomentUpdate() {
if ((Printing() != HMI_flag.printing_flag) && !HMI_flag.home_flag) {
HMI_flag.printing_flag = Printing();
DEBUG_ECHOLNPGM("printing_flag: ", HMI_flag.printing_flag);
if (HMI_flag.printing_flag)
DWIN_Print_Started();
else if (HMI_flag.abort_flag)
@@ -1282,7 +1281,6 @@ void EachMomentUpdate() {
if ((printingIsPaused() != HMI_flag.pause_flag) && !HMI_flag.home_flag) {
HMI_flag.pause_flag = printingIsPaused();
DEBUG_ECHOLNPGM("pause_flag: ", HMI_flag.pause_flag);
if (HMI_flag.pause_flag)
DWIN_Print_Pause();
else if (HMI_flag.abort_flag)
@@ -1347,7 +1345,7 @@ void EachMomentUpdate() {
DWINUI::Draw_Button(BTN_Cancel, 26, 280);
DWINUI::Draw_Button(BTN_Continue, 146, 280);
}
SdFile *dir = nullptr;
MediaFile *dir = nullptr;
const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename);
card.selectFileByName(filename);
DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 207, card.longest_filename());
@@ -1628,7 +1626,6 @@ void DWIN_LevelingDone() {
// Started a Print Job
void DWIN_Print_Started() {
DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing());
TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) Preview_Invalidate());
_percent_done = 0;
_remain_time = 0;
@@ -1642,20 +1639,17 @@ void DWIN_Print_Started() {
// Pause a print job
void DWIN_Print_Pause() {
DEBUG_ECHOLNPGM("DWIN_Print_Pause");
ICON_ResumeOrPause();
}
// Resume print job
void DWIN_Print_Resume() {
DEBUG_ECHOLNPGM("DWIN_Print_Resume");
ICON_ResumeOrPause();
LCD_MESSAGE(MSG_RESUME_PRINT);
}
// Ended print job
void DWIN_Print_Finished() {
DEBUG_ECHOLNPGM("DWIN_Print_Finished");
TERN_(POWER_LOSS_RECOVERY, if (card.isPrinting()) recovery.cancel());
HMI_flag.pause_flag = false;
wait_for_heatup = false;
@@ -1666,7 +1660,6 @@ void DWIN_Print_Finished() {
// Print was aborted
void DWIN_Print_Aborted() {
DEBUG_ECHOLNPGM("DWIN_Print_Aborted");
DWIN_Print_Finished();
}
@@ -1714,7 +1707,6 @@ void DWIN_SetColorDefaults() {
}
void DWIN_SetDataDefaults() {
DEBUG_ECHOLNPGM("DWIN_SetDataDefaults");
DWIN_SetColorDefaults();
DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color);
TERN_(PIDTEMP, HMI_data.HotendPidT = DEF_HOTENDPIDT);
@@ -1738,13 +1730,10 @@ void DWIN_SetDataDefaults() {
}
void DWIN_CopySettingsTo(char * const buff) {
DEBUG_ECHOLNPGM("DWIN_CopySettingsTo");
DEBUG_ECHOLNPGM("HMI_data: ", sizeof(HMI_data_t));
memcpy(buff, &HMI_data, eeprom_data_size);
}
void DWIN_CopySettingsFrom(const char * const buff) {
DEBUG_ECHOLNPGM("DWIN_CopySettingsFrom");
memcpy(&HMI_data, buff, sizeof(HMI_data_t));
if (HMI_data.Text_Color == HMI_data.Background_Color) DWIN_SetColorDefaults();
DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color);
@@ -1764,18 +1753,14 @@ void DWIN_CopySettingsFrom(const char * const buff) {
// Initialize or re-initialize the LCD
void MarlinUI::init_lcd() {
DEBUG_ECHOLNPGM("MarlinUI::init_lcd");
delay(750); // wait to wakeup screen
const bool hs = DWIN_Handshake(); UNUSED(hs);
DEBUG_ECHOPGM("DWIN_Handshake ");
DEBUG_ECHOLNF(hs ? F("ok.") : F("error."));
DWIN_Frame_SetDir(1);
DWIN_JPG_CacheTo1(Language_English);
Encoder_Configuration();
}
void DWIN_InitScreen() {
DEBUG_ECHOLNPGM("DWIN_InitScreen");
DWIN_SetColorDefaults();
HMI_Init(); // draws boot screen
DWINUI::init();
@@ -2034,7 +2019,6 @@ void AutoHome() { queue.inject_P(G28_STR); }
#if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
const_float_t step_zoffset = round((MenuData.Value / 100.0f) * planner.settings.axis_steps_per_mm[Z_AXIS]) - babystep.accum;
if (BABYSTEP_ALLOWED()) babystep.add_steps(Z_AXIS, step_zoffset);
//DEBUG_ECHOLNF(F("BB Steps: "), step_zoffset);
#endif
}
void SetZOffset() {
@@ -2225,12 +2209,10 @@ 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);
Toggle_Chkb_Line(runout.enabled[0]);
}
#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)
@@ -3203,7 +3185,7 @@ void Draw_FilSet_Menu() {
if (SET_MENU(FilSetMenu, MSG_FILAMENT_SET, 9)) {
BACK_ITEM(Draw_AdvancedSettings_Menu);
#if HAS_FILAMENT_SENSOR
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, SetRunoutEnable, &runout.enabled);
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, SetRunoutEnable, &runout.enabled[0]);
#endif
#if HAS_FILAMENT_RUNOUT_DISTANCE
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance());
@@ -3542,7 +3524,7 @@ void Draw_Steps_Menu() {
#if ENABLED(MPCTEMP)
void HotendMPC() { thermalManager.MPC_autotune(); }
void HotendMPC() { thermalManager.MPC_autotune(active_extruder); }
void SetHeaterPower() { SetPFloatOnClick(1, 200, 1); }
void SetBlkHeatCapacity() { SetPFloatOnClick(0, 40, 2); }
void SetSensorRespons() { SetPFloatOnClick(0, 1, 4); }
+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();
}
+1 -1
View File
@@ -135,7 +135,7 @@ bool Has_Preview() {
Get_Value(buf, ";MAXZ:", fileprop.height);
fileprop.height -= tmp;
posptr = strstr(buf, tbstart);
if (posptr != NULL) {
if (posptr != nullptr) {
fileprop.thumbstart = indx + (posptr - &buf[0]);
}
else {
@@ -70,7 +70,6 @@ char FileNavigator::currentfoldername[MAX_PATH_LEN + 1]; // Current folde
FileNavigator::FileNavigator() { reset(); }
void FileNavigator::reset() {
DEBUG_ECHOLNPGM("reset()");
currentfoldername[0] = '\0';
currentfolderdepth = 0;
currentindex = 0;
@@ -86,7 +85,6 @@ void FileNavigator::refresh() { filelist.refresh(); }
void FileNavigator::changeDIR(const char *folder) {
if (currentfolderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth
DEBUG_ECHOLNPGM("FD:" , folderdepth, " FP:",currentindex, " currentfolder:", currentfoldername, " enter:", folder);
currentfolderindex[currentfolderdepth] = currentindex;
strcat(currentfoldername, folder);
strcat(currentfoldername, "/");
@@ -96,7 +94,6 @@ void FileNavigator::changeDIR(const char *folder) {
}
void FileNavigator::upDIR() {
DEBUG_ECHOLNPGM("upDIR() from D:", currentfolderdepth, " N:", currentfoldername);
if (!filelist.isAtRootDir()) {
filelist.upDir();
currentfolderdepth--;
@@ -117,7 +114,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
if (skip == 0) return;
while (skip > 0) {
if (filelist.seek(currentindex)) {
DEBUG_ECHOLNPGM("CI:", currentindex, " FD:", currentfolderdepth, " N:", skip, " ", filelist.longFilename());
if (!filelist.isDir()) {
skip--;
currentindex++;
@@ -151,8 +147,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
}
lastpanelindex = index;
DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex);
if (currentindex == 0 && currentfolderdepth > 0) { // Add a link to go up a folder
// The new panel ignores entries that don't end in .GCO or .gcode so add and pad them.
if (paneltype <= AC_panel_new) {
@@ -166,12 +160,8 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
filesneeded--;
}
for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++) {
if (filelist.seek(seek)) {
sendFile(paneltype);
DEBUG_ECHOLNPGM("-", seek, " '", filelist.longFilename(), "' '", currentfoldername, "", filelist.shortFilename(), "'");
}
}
for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++)
if (filelist.seek(seek)) sendFile(paneltype);
}
void FileNavigator::sendFile(panel_type_t paneltype) {
@@ -212,7 +202,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
#else // Flat file list
void FileNavigator::getFiles(uint16_t index, panel_type_t paneltype, uint8_t filesneeded) {
DEBUG_ECHOLNPGM("getFiles() I:", index," L:", lastpanelindex);
// if we're searching backwards, jump back to start and search forward
if (index < lastpanelindex) {
reset();
@@ -248,7 +237,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
TFTSer.println(filelist.shortFilename());
if (currentfolderdepth > 0) TFTSer.print(currentfoldername);
TFTSer.println(filelist.longFilename());
DEBUG_ECHOLNPGM("/", currentfoldername, "", filelist.shortFilename(), " ", filelist.longFilename());
}
#endif // Flat file list
@@ -120,6 +120,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLoss() {
// Called when power-loss state is detected
}
// Called on resume from power-loss
void onPowerLossResume() { Chiron.PowerLossRecovery(); }
#endif
@@ -80,9 +80,6 @@ void ChironTFT::Startup() {
OUT_WRITE(OUTAGECON_PIN, HIGH);
#endif
// Filament runout is handled by Marlin settings in Configuration.h
// opt_set FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
// opt_enable FIL_RUNOUT_PULLUP
TFTSer.begin(115200);
// Wait for the TFT panel to initialize and finish the animation
@@ -106,6 +106,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLoss() {
// Called when power-loss state is detected
}
void onPowerLossResume() {
// Called on resume from power-loss
}
@@ -704,7 +704,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
break;
case 16: { // A16 set hotend temp
unsigned int tempvalue;
uint16_t tempvalue;
if (CodeSeen('S')) {
tempvalue = constrain(CodeValue(), 0, 275);
setTargetTemp_celsius(tempvalue, (extruder_t)E0);
@@ -719,7 +719,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
break;
case 17: { // A17 set heated bed temp
unsigned int tempbed;
uint16_t tempbed;
if (CodeSeen('S')) {
tempbed = constrain(CodeValue(), 0, 100);
setTargetTemp_celsius(tempbed, (heater_t)BED);
@@ -777,7 +777,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
case 22: // A22 move X/Y/Z or extrude
if (!isPrinting()) {
float coorvalue;
unsigned int movespeed = 0;
uint16_t movespeed = 0;
char commandStr[30];
char fullCommandStr[38];
@@ -141,7 +141,6 @@ void DGUSDisplay::ProcessRx() {
if (!LCD_SERIAL.available() && LCD_SERIAL.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;
//LCD_SERIAL.reset_rx_overun();
LCD_SERIAL.flush();
@@ -205,17 +204,11 @@ void DGUSDisplay::ProcessRx() {
| 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_ECHOPGM(" vp=", vp, " dlen=", dlen);
DGUS_VP_Variable ramcopy;
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_ECHOLNPGM(" VPVar not found:", vp);
rx_datagram_state = DGUS_IDLE;
break;
@@ -260,9 +253,7 @@ bool DGUSDisplay::Initialized = false,
#define sw_barrier() asm volatile("": : :"memory");
bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy) {
//DEBUG_ECHOPGM("populate_VPVar ", VP);
const DGUS_VP_Variable *pvp = DGUSLCD_FindVPVar(VP);
//DEBUG_ECHOLNPGM(" pvp ", (uint16_t )pvp);
if (!pvp) return false;
memcpy_P(ramcopy, pvp, sizeof(DGUS_VP_Variable));
return true;
@@ -112,8 +112,6 @@ void DGUSScreenHandler::setstatusmessagePGM(PGM_P const msg) {
// Send an 8 bit or 16 bit value to the display.
void DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
//DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
//DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
if (var.size > 1)
dgusdisplay.WriteVariable(var.VP, *(int16_t*)var.memadr);
else
@@ -124,8 +122,6 @@ void DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) {
// Send an uint8_t between 0 and 255 to the display, but scale to a percentage (0..100)
void DGUSScreenHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
//DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
//DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
uint16_t tmp = *(uint8_t *) var.memadr + 1; // +1 -> avoid rounding issues for the display.
tmp = map(tmp, 0, 255, 0, 100);
dgusdisplay.WriteVariable(var.VP, tmp);
@@ -134,9 +130,7 @@ void DGUSScreenHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) {
// Send the current print progress to the display.
void DGUSScreenHandler::DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var) {
//DEBUG_ECHOPGM(" DGUSLCD_SendPrintProgressToDisplay ", var.VP);
uint16_t tmp = ExtUI::getProgress_percent();
//DEBUG_ECHOLNPGM(" data ", tmp);
dgusdisplay.WriteVariable(var.VP, tmp);
}
@@ -153,9 +147,7 @@ void DGUSScreenHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) {
void DGUSScreenHandler::DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr) {
if (var.memadr) {
const uint16_t value = BE16_P(val_ptr);
DEBUG_ECHOLNPGM("Got percent:", value);
*(uint8_t*)var.memadr = map(constrain(value, 0, 100), 0, 100, 0, 255);
DEBUG_ECHOLNPGM("Set uint8:", *(uint8_t*)var.memadr);
}
}
@@ -236,8 +228,6 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
void DGUSScreenHandler::DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
DEBUG_ECHOPGM(" DGUSLCD_SendFanStatusToDisplay ", var.VP);
DEBUG_ECHOLNPGM(" data ", *(uint8_t *)var.memadr);
uint16_t data_to_send = 0;
if (*(uint8_t *) var.memadr) data_to_send = 1;
dgusdisplay.WriteVariable(var.VP, data_to_send);
@@ -249,8 +239,6 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
// Send heater status value to the display.
void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
DEBUG_ECHOPGM(" DGUSLCD_SendHeaterStatusToDisplay ", var.VP);
DEBUG_ECHOLNPGM(" data ", *(int16_t *)var.memadr);
uint16_t data_to_send = 0;
if (*(int16_t *) var.memadr) data_to_send = 1;
dgusdisplay.WriteVariable(var.VP, data_to_send);
@@ -263,11 +251,8 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
// In FYSETC UI design there are 10 statuses to loop
static uint16_t period = 0;
static uint16_t index = 0;
//DEBUG_ECHOPGM(" DGUSLCD_SendWaitingStatusToDisplay ", var.VP);
//DEBUG_ECHOLNPGM(" data ", BE16_P(&index));
if (period++ > DGUS_UI_WAITING_STATUS_PERIOD) {
dgusdisplay.WriteVariable(var.VP, index);
//DEBUG_ECHOLNPGM(" data ", BE16_P(&index));
if (++index >= DGUS_UI_WAITING_STATUS) index = 0;
period = 0;
}
@@ -309,17 +294,14 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
const int16_t scroll = (int16_t)BE16_P(val_ptr);
if (scroll) {
top_file += scroll;
DEBUG_ECHOPGM("new topfile calculated:", top_file);
if (top_file < 0) {
top_file = 0;
DEBUG_ECHOLNPGM("Top of filelist reached");
}
else {
int16_t max_top = filelist.count() - DGUS_SD_FILESPERSCREEN;
NOLESS(max_top, 0);
NOMORE(top_file, max_top);
}
DEBUG_ECHOPGM("new topfile adjusted:", top_file);
}
else if (!filelist.isAtRootDir()) {
IF_DISABLED(DGUS_LCD_UI_MKS, filelist.upDir());
@@ -374,7 +356,6 @@ const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp) {
++ret;
} while (1);
DEBUG_ECHOLNPGM("FindVPVar NOT FOUND ", vp);
return nullptr;
}
@@ -444,8 +425,6 @@ void DGUSScreenHandler::HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_p
}
void DGUSScreenHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleManualExtrude");
const int16_t movevalue = BE16_P(val_ptr);
float target = movevalue * 0.01f;
ExtUI::extruder_t target_extruder;
@@ -467,19 +446,16 @@ void DGUSScreenHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
void DGUSScreenHandler::HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleManualMoveOption");
*(uint16_t*)var.memadr = BE16_P(val_ptr);
}
#endif
void DGUSScreenHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleMotorLockUnlock");
const int16_t lock = BE16_P(val_ptr);
queue.enqueue_one_now(lock ? F("M18") : F("M17"));
}
void DGUSScreenHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleSettings");
const uint16_t value = BE16_P(val_ptr);
switch (value) {
default: break;
@@ -495,7 +471,6 @@ void DGUSScreenHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) {
void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t value_raw = BE16_P(val_ptr);
DEBUG_ECHOLNPGM("HandleStepPerMMChanged:", value_raw);
const float value = (float)value_raw / 10;
ExtUI::axis_t axis;
switch (var.VP) {
@@ -504,15 +479,12 @@ void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_
case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break;
default: return;
}
DEBUG_ECHOLNPGM("value:", value);
ExtUI::setAxisSteps_per_mm(value, axis);
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis));
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t value_raw = BE16_P(val_ptr);
DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged:", value_raw);
const float value = (float)value_raw / 10;
ExtUI::extruder_t extruder;
switch (var.VP) {
@@ -524,16 +496,12 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
#endif
#endif
}
DEBUG_ECHOLNPGM("value:", value);
ExtUI::setAxisSteps_per_mm(value, extruder);
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder));
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
#if HAS_PID_HEATING
void DGUSScreenHandler::HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandlePIDAutotune");
char buf[32] = {0};
switch (var.VP) {
@@ -568,8 +536,6 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
#if HAS_BED_PROBE
void DGUSScreenHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged");
const float offset = float(int16_t(BE16_P(val_ptr))) / 100.0f;
ExtUI::setZOffset_mm(offset);
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
@@ -579,14 +545,11 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
#if HAS_FAN
void DGUSScreenHandler::HandleFanControl(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleFanControl");
*(uint8_t*)var.memadr = *(uint8_t*)var.memadr > 0 ? 0 : 255;
}
#endif
void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleHeaterControl");
uint8_t preheat_temp = 0;
switch (var.VP) {
#if HAS_HOTEND
@@ -614,8 +577,6 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
#if ENABLED(DGUS_PREHEAT_UI)
void DGUSScreenHandler::HandlePreheat(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandlePreheat");
const uint16_t preheat_option = BE16_P(val_ptr);
switch (preheat_option) {
default:
@@ -654,7 +615,6 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
#endif
void DGUSScreenHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) {
DEBUG_ECHOLNPGM("SetNewScreen: ", newscreen);
if (!popup) {
memmove(&past_screens[1], &past_screens[0], sizeof(past_screens) - 1);
past_screens[0] = current_screen;
@@ -665,18 +625,14 @@ void DGUSScreenHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) {
}
void DGUSScreenHandler::PopToOldScreen() {
DEBUG_ECHOLNPGM("PopToOldScreen s=", past_screens[0]);
GotoScreen(past_screens[0], true);
memmove(&past_screens[0], &past_screens[1], sizeof(past_screens) - 1);
past_screens[sizeof(past_screens) - 1] = DGUSLCD_SCREEN_MAIN;
}
void DGUSScreenHandler::UpdateScreenVPData() {
DEBUG_ECHOPGM(" UpdateScreenVPData Screen: ", current_screen);
const uint16_t *VPList = DGUSLCD_FindScreenVPMapList(current_screen);
if (!VPList) {
DEBUG_ECHOLNPGM(" NO SCREEN FOR: ", current_screen);
ScreenComplete = true;
return; // nothing to do, likely a bug or boring screen.
}
@@ -687,10 +643,8 @@ void DGUSScreenHandler::UpdateScreenVPData() {
bool sent_one = false;
do {
uint16_t VP = pgm_read_word(VPList);
DEBUG_ECHOPGM(" VP: ", VP);
if (!VP) {
update_ptr = 0;
DEBUG_ECHOLNPGM(" UpdateScreenVPData done");
ScreenComplete = true;
return; // Screen completed.
}
@@ -703,14 +657,10 @@ void DGUSScreenHandler::UpdateScreenVPData() {
// Send the VP to the display, but try to avoid overrunning the Tx Buffer.
// But send at least one VP, to avoid getting stalled.
if (rcpy.send_to_display_handler && (!sent_one || expected_tx <= dgusdisplay.GetFreeTxBuffer())) {
//DEBUG_ECHOPGM(" calling handler for ", rcpy.VP);
sent_one = true;
rcpy.send_to_display_handler(rcpy);
}
else {
// auto x=dgusdisplay.GetFreeTxBuffer();
//DEBUG_ECHOLNPGM(" tx almost full: ", x);
//DEBUG_ECHOPGM(" update_ptr ", update_ptr);
ScreenComplete = false;
return; // please call again!
}
@@ -725,7 +675,6 @@ void DGUSScreenHandler::GotoScreen(DGUSLCD_Screens screen, bool ispopup) {
}
void DGUSDisplay::RequestScreen(DGUSLCD_Screens screen) {
DEBUG_ECHOLNPGM("GotoScreen ", screen);
const unsigned char gotoscreen[] = { 0x5A, 0x01, (unsigned char) (screen >> 8U), (unsigned char) (screen & 0xFFU) };
WriteVariable(0x84, gotoscreen, sizeof(gotoscreen));
}
@@ -191,7 +191,7 @@ public:
// 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>
template<uint16_t decimals>
static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
float f = *(float *)var.memadr;
@@ -203,7 +203,7 @@ public:
// 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>
template<uint16_t decimals>
static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
float f = *(float *)var.memadr;
+3
View File
@@ -126,6 +126,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLoss() {
// Called when power-loss state is detected
}
void onPowerLossResume() {
// Called on resume from power-loss
IF_DISABLED(DGUS_LCD_UI_MKS, ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POWER_LOSS));
@@ -258,7 +258,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C;
constexpr uint16_t VP_MOVE_OPTION = 0x3400;
// Step per mm
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4
//constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602;
constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604;
//constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606;
@@ -272,10 +272,10 @@ constexpr uint16_t VP_E1_STEP_PER_MM = 0x3612;
//constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A;
// PIDs
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
constexpr uint16_t VP_E0_PID_I = 0x3702;
constexpr uint16_t VP_E0_PID_D = 0x3704;
constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4
constexpr uint16_t VP_E1_PID_I = 0x3708;
constexpr uint16_t VP_E1_PID_D = 0x370A;
constexpr uint16_t VP_BED_PID_P = 0x3710;
@@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
// meaning "return to previous screen"
DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
DEBUG_ECHOLNPGM("\n DEBUG target", target);
if (target == DGUSLCD_SCREEN_POPUP) {
// Special handling for popup is to return to previous menu
if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb();
@@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
}
void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleManualMove");
int16_t movevalue = swap16(*(uint16_t*)val_ptr);
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
if (movevalue) {
@@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
}
#endif
char axiscode;
unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode.
uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves
switch (var.VP) {
default: return;
@@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove;
break;
case VP_MOVE_Y:
axiscode = 'Y';
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
break;
#if HAS_Y_AXIS
case VP_MOVE_Y:
axiscode = 'Y';
speed = _mf[Y_AXIS];
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
break;
#endif
case VP_MOVE_Z:
axiscode = 'Z';
speed = 300; // default to 5mm/s
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
break;
#if HAS_Z_AXIS
case VP_MOVE_Z:
axiscode = 'Z';
speed = _mf[Z_AXIS];
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
break;
#endif
case VP_HOME_ALL: // only used for homing
axiscode = '\0';
@@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!movevalue) {
// homing
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
char buf[6] = "G28 X";
buf[4] = axiscode;
//DEBUG_ECHOPGM(" ", buf);
queue.enqueue_one_now(buf);
//DEBUG_ECHOLNPGM(" ✓");
ForceCompleteUpdate();
return;
}
else {
// movement
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
bool old_relative_mode = relative_mode;
if (!relative_mode) {
//DEBUG_ECHOPGM(" G91");
queue.enqueue_now(F("G91"));
//DEBUG_ECHOPGM(" ✓ ");
}
if (!relative_mode) queue.enqueue_now(F("G91"));
char buf[32]; // G1 X9999.99 F12345
unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s);
const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
char sign[] = "\0";
int16_t value = movevalue / 100;
if (movevalue < 0) { value = -value; sign[0] = '-'; }
int16_t fraction = ABS(movevalue) % 100;
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
//DEBUG_ECHOPGM(" ", buf);
queue.enqueue_one_now(buf);
//DEBUG_ECHOLNPGM(" ✓ ");
if (backup_speed != speed) {
snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
queue.enqueue_one_now(buf);
//DEBUG_ECHOPGM(" ", buf);
}
// while (!enqueue_and_echo_command(buf)) idle();
//DEBUG_ECHOLNPGM(" ✓ ");
if (!old_relative_mode) {
//DEBUG_ECHOPGM("G90");
queue.enqueue_now(F("G90"));
//DEBUG_ECHOPGM(" ✓ ");
}
//while (!enqueue_and_echo_command(buf)) idle();
if (!old_relative_mode) queue.enqueue_now(F("G90"));
}
ForceCompleteUpdate();
DEBUG_ECHOLNPGM("manmv done.");
return;
cannotmove:
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
return;
}
#if HAS_PID_HEATING
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
DEBUG_ECHOLNPGM("V1:", rawvalue);
float value = (float)rawvalue / 10;
DEBUG_ECHOLNPGM("V2:", value);
float newvalue = 0;
switch (var.VP) {
@@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#endif
}
DEBUG_ECHOLNPGM("V3:", newvalue);
*(float *)var.memadr = newvalue;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
@@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#if ENABLED(BABYSTEPPING)
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
int16_t flag = swap16(*(uint16_t*)val_ptr),
steps = flag ? -20 : 20;
ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true);
@@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleFilamentOption");
uint8_t e_temp = 0;
filament_data.heated = false;
uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
@@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
}
void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) {
DEBUG_ECHOLNPGM("HandleFilamentLoadUnload");
if (filament_data.action <= 0) return;
// If we close to the target temperature, we can start load or unload the filament
@@ -257,7 +257,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C;
constexpr uint16_t VP_MOVE_OPTION = 0x3400;
// Step per mm
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4
//constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602;
constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604;
//constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606;
@@ -271,7 +271,7 @@ constexpr uint16_t VP_E0_STEP_PER_MM = 0x3610;
//constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A;
// PIDs
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
constexpr uint16_t VP_E0_PID_I = 0x3702;
constexpr uint16_t VP_E0_PID_D = 0x3704;
constexpr uint16_t VP_BED_PID_P = 0x3710;
@@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
// meaning "return to previous screen"
DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
DEBUG_ECHOLNPGM("\n DEBUG target", target);
if (target == DGUSLCD_SCREEN_POPUP) {
// Special handling for popup is to return to previous menu
if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb();
@@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
}
void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleManualMove");
int16_t movevalue = swap16(*(uint16_t*)val_ptr);
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
if (movevalue) {
@@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
}
#endif
char axiscode;
unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode.
uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves
switch (var.VP) {
default: return;
@@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove;
break;
case VP_MOVE_Y:
axiscode = 'Y';
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
break;
#if HAS_Y_AXIS
case VP_MOVE_Y:
axiscode = 'Y';
speed = _mf[Y_AXIS];
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
break;
#endif
case VP_MOVE_Z:
axiscode = 'Z';
speed = 300; // default to 5mm/s
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
break;
#if HAS_Z_AXIS
case VP_MOVE_Z:
axiscode = 'Z';
speed = _mf[Z_AXIS];
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
break;
#endif
case VP_HOME_ALL: // only used for homing
axiscode = '\0';
@@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!movevalue) {
// homing
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
char buf[6] = "G28 X";
buf[4] = axiscode;
//DEBUG_ECHOPGM(" ", buf);
queue.enqueue_one_now(buf);
//DEBUG_ECHOLNPGM(" ✓");
ForceCompleteUpdate();
return;
}
else {
// movement
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
bool old_relative_mode = relative_mode;
if (!relative_mode) {
//DEBUG_ECHOPGM(" G91");
queue.enqueue_now(F("G91"));
//DEBUG_ECHOPGM(" ✓ ");
}
const bool old_relative_mode = relative_mode;
if (!relative_mode) queue.enqueue_now(F("G91"));
char buf[32]; // G1 X9999.99 F12345
unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s);
const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
char sign[] = "\0";
int16_t value = movevalue / 100;
if (movevalue < 0) { value = -value; sign[0] = '-'; }
int16_t fraction = ABS(movevalue) % 100;
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
//DEBUG_ECHOPGM(" ", buf);
queue.enqueue_one_now(buf);
//DEBUG_ECHOLNPGM(" ✓ ");
if (backup_speed != speed) {
snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
queue.enqueue_one_now(buf);
//DEBUG_ECHOPGM(" ", buf);
}
// while (!enqueue_and_echo_command(buf)) idle();
//DEBUG_ECHOLNPGM(" ✓ ");
if (!old_relative_mode) {
//DEBUG_ECHOPGM("G90");
queue.enqueue_now(F("G90"));
//DEBUG_ECHOPGM(" ✓ ");
}
//while (!enqueue_and_echo_command(buf)) idle();
if (!old_relative_mode) queue.enqueue_now(F("G90"));
}
ForceCompleteUpdate();
DEBUG_ECHOLNPGM("manmv done.");
return;
cannotmove:
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
return;
}
#if HAS_PID_HEATING
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
DEBUG_ECHOLNPGM("V1:", rawvalue);
float value = (float)rawvalue / 10;
DEBUG_ECHOLNPGM("V2:", value);
float newvalue = 0;
switch (var.VP) {
@@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#endif
}
DEBUG_ECHOLNPGM("V3:", newvalue);
*(float *)var.memadr = newvalue;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
@@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#if ENABLED(BABYSTEPPING)
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
int16_t flag = swap16(*(uint16_t*)val_ptr),
steps = flag ? -20 : 20;
ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true);
@@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleFilamentOption");
uint8_t e_temp = 0;
filament_data.heated = false;
uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
@@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
}
void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) {
DEBUG_ECHOLNPGM("HandleFilamentLoadUnload");
if (filament_data.action <= 0) return;
// If we close to the target temperature, we can start load or unload the filament
@@ -256,10 +256,10 @@ constexpr uint16_t VP_E1_STATUS = 0x3412;
constexpr uint16_t VP_MOVE_OPTION = 0x3500;
// // PIDs
// constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
// constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
// constexpr uint16_t VP_E0_PID_I = 0x3702;
// constexpr uint16_t VP_E0_PID_D = 0x3704;
// constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4
// constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4
// constexpr uint16_t VP_E1_PID_I = 0x3708;
// constexpr uint16_t VP_E1_PID_D = 0x370A;
// constexpr uint16_t VP_BED_PID_P = 0x3710;
@@ -414,7 +414,7 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
constexpr uint16_t VP_FAN3_STATUS = 0x2716;
// Step per mm
constexpr uint16_t VP_X_STEP_PER_MM = 0x2900; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_X_STEP_PER_MM = 0x2900; // at the moment , uint16_t , 0~1638.4
constexpr uint16_t VP_Y_STEP_PER_MM = 0x2904;
constexpr uint16_t VP_Z_STEP_PER_MM = 0x2908;
constexpr uint16_t VP_E0_STEP_PER_MM = 0x2910;
@@ -521,10 +521,10 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
constexpr uint16_t VP_PrintTime_S = 0x3504;
// PIDs
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
constexpr uint16_t VP_E0_PID_I = 0x3702;
constexpr uint16_t VP_E0_PID_D = 0x3704;
constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4
constexpr uint16_t VP_E1_PID_I = 0x3708;
constexpr uint16_t VP_E1_PID_D = 0x370A;
constexpr uint16_t VP_BED_PID_P = 0x3710;
@@ -80,8 +80,6 @@ void DGUSScreenHandlerMKS::sendinfoscreen(const void *line1, const void *line2,
void DGUSScreenHandlerMKS::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) {
if (var.memadr) {
//DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
//DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
uint16_t tmp = *(uint8_t *) var.memadr; // +1 -> avoid rounding issues for the display.
// tmp = map(tmp, 0, 255, 0, 100);
dgusdisplay.WriteVariable(var.VP, tmp);
@@ -90,7 +88,6 @@ 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);
value *= cpow(10, 2);
dgusdisplay.WriteVariable(VP_SD_Print_Baby, (uint16_t)value);
}
@@ -106,14 +103,11 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var)
void DGUSScreenHandlerMKS::DGUSLCD_SetUint8(DGUS_VP_Variable &var, void *val_ptr) {
if (var.memadr) {
const uint16_t value = BE16_P(val_ptr);
DEBUG_ECHOLNPGM("Got uint8:", value);
*(uint8_t*)var.memadr = map(constrain(value, 0, 255), 0, 255, 0, 255);
DEBUG_ECHOLNPGM("Set uint8:", *(uint8_t*)var.memadr);
}
}
void DGUSScreenHandlerMKS::DGUSLCD_SendGbkToDisplay(DGUS_VP_Variable &var) {
DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
uint16_t *tmp = (uint16_t*) var.memadr;
dgusdisplay.WriteVariable(var.VP, tmp, var.size, true);
}
@@ -278,8 +272,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
// meaning "return to previous screen"
DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
DEBUG_ECHOLNPGM("\n DEBUG target", target);
// when the dgus had reboot, it will enter the DGUSLCD_SCREEN_MAIN page,
// so user can change any page to use this function, an it will check
// if robin nano is printing. when it is, dgus will enter the printing
@@ -313,7 +305,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
void DGUSScreenHandlerMKS::ScreenBackChange(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t target = BE16_P(val_ptr);
DEBUG_ECHOLNPGM(" back = 0x%x", target);
switch (target) {
}
}
@@ -327,7 +318,6 @@ void DGUSScreenHandlerMKS::ZoffsetConfirm(DGUS_VP_Variable &var, void *val_ptr)
}
void DGUSScreenHandlerMKS::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("GetTurnOffCtrl\n");
const uint16_t value = BE16_P(val_ptr);
switch (value) {
case 0 ... 1: DGUSAutoTurnOff = (bool)value; break;
@@ -336,7 +326,6 @@ void DGUSScreenHandlerMKS::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr)
}
void DGUSScreenHandlerMKS::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("GetMinExtrudeTemp");
const uint16_t value = BE16_P(val_ptr);
TERN_(PREVENT_COLD_EXTRUSION, thermalManager.extrude_min_temp = value);
mks_min_extrusion_temp = value;
@@ -344,7 +333,6 @@ void DGUSScreenHandlerMKS::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_pt
}
void DGUSScreenHandlerMKS::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("GetZoffsetDistance");
const uint16_t value = BE16_P(val_ptr);
float val_distance = 0;
switch (value) {
@@ -358,7 +346,6 @@ void DGUSScreenHandlerMKS::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_p
}
void DGUSScreenHandlerMKS::GetManualMovestep(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("\nGetManualMovestep");
*(uint16_t *)var.memadr = BE16_P(val_ptr);
}
@@ -381,8 +368,8 @@ void DGUSScreenHandlerMKS::EEPROM_CTRL(DGUS_VP_Variable &var, void *val_ptr) {
}
void DGUSScreenHandlerMKS::Z_offset_select(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t z_value = BE16_P(val_ptr);
switch (z_value) {
const uint16_t z = BE16_P(val_ptr);
switch (z) {
case 0: Z_distance = 0.01; break;
case 1: Z_distance = 0.1; break;
case 2: Z_distance = 0.5; break;
@@ -395,7 +382,6 @@ void DGUSScreenHandlerMKS::GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr)
#if HAS_BED_PROBE
const int32_t value = BE32_P(val_ptr);
const float Offset = value / 100.0f;
DEBUG_ECHOLNPGM("\nget int6 offset >> ", value, 6);
switch (var.VP) {
default: break;
@@ -491,7 +477,7 @@ void DGUSScreenHandlerMKS::MeshLevelDistanceConfig(DGUS_VP_Variable &var, void *
void DGUSScreenHandlerMKS::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) {
#if ENABLED(MESH_BED_LEVELING)
const uint16_t mesh_value = BE16_P(val_ptr);
const uint16_t mesh_val = BE16_P(val_ptr);
// static uint8_t a_first_level = 1;
char cmd_buf[30];
float offset = mesh_adj_distance;
@@ -499,7 +485,7 @@ void DGUSScreenHandlerMKS::MeshLevel(DGUS_VP_Variable &var, void *val_ptr) {
if (!queue.ring_buffer.empty()) return;
switch (mesh_value) {
switch (mesh_val) {
case 0:
offset = mesh_adj_distance;
integer = offset; // get int
@@ -589,20 +575,19 @@ void DGUSScreenHandlerMKS::SD_FileBack(DGUS_VP_Variable&, void*) {
}
void DGUSScreenHandlerMKS::LCD_BLK_Adjust(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t lcd_value = BE16_P(val_ptr);
lcd_default_light = constrain(lcd_value, 10, 100);
const uint16_t lcd_val = BE16_P(val_ptr);
lcd_default_light = constrain(lcd_val, 10, 100);
const uint16_t lcd_data[2] = { lcd_default_light, lcd_default_light };
dgusdisplay.WriteVariable(0x0082, &lcd_data, 5, true);
}
void DGUSScreenHandlerMKS::ManualAssistLeveling(DGUS_VP_Variable &var, void *val_ptr) {
const int16_t point_value = BE16_P(val_ptr);
const int16_t point_val = BE16_P(val_ptr);
// Insist on leveling first time at this screen
static bool first_level_flag = false;
if (!first_level_flag || point_value == 0x0001) {
if (!first_level_flag || point_val == 0x0001) {
queue.enqueue_now_P(G28_STR);
first_level_flag = true;
}
@@ -615,10 +600,10 @@ void DGUSScreenHandlerMKS::ManualAssistLeveling(DGUS_VP_Variable &var, void *val
queue.enqueue_one_now(buf_level);
};
if (WITHIN(point_value, 0x0001, 0x0005))
if (WITHIN(point_val, 0x0001, 0x0005))
queue.enqueue_now(F("G1Z10"));
switch (point_value) {
switch (point_val) {
case 0x0001:
enqueue_corner_move(X_MIN_POS + ABS(mks_corner_offsets[0].x),
Y_MIN_POS + ABS(mks_corner_offsets[0].y), level_speed);
@@ -642,7 +627,7 @@ void DGUSScreenHandlerMKS::ManualAssistLeveling(DGUS_VP_Variable &var, void *val
break;
}
if (WITHIN(point_value, 0x0002, 0x0005)) {
if (WITHIN(point_val, 0x0002, 0x0005)) {
//queue.enqueue_now(F("G28Z"));
queue.enqueue_now(F("G1Z-10"));
}
@@ -652,14 +637,14 @@ void DGUSScreenHandlerMKS::ManualAssistLeveling(DGUS_VP_Variable &var, void *val
#define mks_max(a, b) ((a) > (b)) ? (a) : (b)
void DGUSScreenHandlerMKS::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr) {
#if EITHER(HAS_TRINAMIC_CONFIG, HAS_STEALTHCHOP)
const uint16_t tmc_value = BE16_P(val_ptr);
const uint16_t tmc_val = BE16_P(val_ptr);
#endif
switch (var.VP) {
case VP_TMC_X_STEP:
#if USE_SENSORLESS
#if X_HAS_STEALTHCHOP
stepperX.homing_threshold(mks_min(tmc_value, 255));
stepperX.homing_threshold(mks_min(tmc_val, 255));
settings.save();
//tmc_step.x = stepperX.homing_threshold();
#endif
@@ -668,7 +653,7 @@ void DGUSScreenHandlerMKS::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr
case VP_TMC_Y_STEP:
#if USE_SENSORLESS
#if Y_HAS_STEALTHCHOP
stepperY.homing_threshold(mks_min(tmc_value, 255));
stepperY.homing_threshold(mks_min(tmc_val, 255));
settings.save();
//tmc_step.y = stepperY.homing_threshold();
#endif
@@ -677,7 +662,7 @@ void DGUSScreenHandlerMKS::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr
case VP_TMC_Z_STEP:
#if USE_SENSORLESS
#if Z_HAS_STEALTHCHOP
stepperZ.homing_threshold(mks_min(tmc_value, 255));
stepperZ.homing_threshold(mks_min(tmc_val, 255));
settings.save();
//tmc_step.z = stepperZ.homing_threshold();
#endif
@@ -685,49 +670,49 @@ void DGUSScreenHandlerMKS::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr
break;
case VP_TMC_X_Current:
#if AXIS_IS_TMC(X)
stepperX.rms_current(tmc_value);
stepperX.rms_current(tmc_val);
settings.save();
#endif
break;
case VP_TMC_X1_Current:
#if AXIS_IS_TMC(X2)
stepperX2.rms_current(tmc_value);
stepperX2.rms_current(tmc_val);
settings.save();
#endif
break;
case VP_TMC_Y_Current:
#if AXIS_IS_TMC(Y)
stepperY.rms_current(tmc_value);
stepperY.rms_current(tmc_val);
settings.save();
#endif
break;
case VP_TMC_Y1_Current:
#if AXIS_IS_TMC(X2)
stepperY2.rms_current(tmc_value);
stepperY2.rms_current(tmc_val);
settings.save();
#endif
break;
case VP_TMC_Z_Current:
#if AXIS_IS_TMC(Z)
stepperZ.rms_current(tmc_value);
stepperZ.rms_current(tmc_val);
settings.save();
#endif
break;
case VP_TMC_Z1_Current:
#if AXIS_IS_TMC(Z2)
stepperZ2.rms_current(tmc_value);
stepperZ2.rms_current(tmc_val);
settings.save();
#endif
break;
case VP_TMC_E0_Current:
#if AXIS_IS_TMC(E0)
stepperE0.rms_current(tmc_value);
stepperE0.rms_current(tmc_val);
settings.save();
#endif
break;
case VP_TMC_E1_Current:
#if AXIS_IS_TMC(E1)
stepperE1.rms_current(tmc_value);
stepperE1.rms_current(tmc_val);
settings.save();
#endif
break;
@@ -743,8 +728,6 @@ void DGUSScreenHandlerMKS::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr
}
void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleManualMove");
int16_t movevalue = BE16_P(val_ptr);
// Choose Move distance
@@ -752,69 +735,64 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
else if (manualMoveStep == 0x02) manualMoveStep = 100;
else if (manualMoveStep == 0x03) manualMoveStep = 1000;
DEBUG_ECHOLNPGM("QUEUE LEN:", queue.ring_buffer.length);
if (!print_job_timer.isPaused() && !queue.ring_buffer.empty())
return;
char axiscode;
unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode.
uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves
switch (var.VP) { // switch X Y Z or Home
default: return;
case VP_MOVE_X:
DEBUG_ECHOLNPGM("X Move");
axiscode = 'X';
if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove;
break;
case VP_MOVE_Y:
DEBUG_ECHOLNPGM("Y Move");
axiscode = 'Y';
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
break;
#if HAS_Y_AXIS
case VP_MOVE_Y:
axiscode = 'Y';
speed = _mf[Y_AXIS];
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
break;
#endif
case VP_MOVE_Z:
DEBUG_ECHOLNPGM("Z Move");
axiscode = 'Z';
speed = 300; // default to 5mm/s
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
break;
#if HAS_Z_AXIS
case VP_MOVE_Z:
axiscode = 'Z';
speed = _mf[Z_AXIS];
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
break;
#endif
case VP_MOTOR_LOCK_UNLOK:
DEBUG_ECHOLNPGM("Motor Unlock");
movevalue = 5;
axiscode = '\0';
// return ;
break;
case VP_HOME_ALL: // only used for homing
DEBUG_ECHOLNPGM("Home all");
axiscode = '\0';
axiscode = '\0';
movevalue = 0; // ignore value sent from display, this VP is _ONLY_ for homing.
//return;
break;
case VP_X_HOME:
DEBUG_ECHOLNPGM("X Home");
axiscode = 'X';
axiscode = 'X';
movevalue = 0;
break;
case VP_Y_HOME:
DEBUG_ECHOLNPGM("Y Home");
axiscode = 'Y';
movevalue = 0;
break;
#if HAS_Y_AXIS
case VP_Y_HOME:
axiscode = 'Y';
movevalue = 0;
break;
#endif
case VP_Z_HOME:
DEBUG_ECHOLNPGM("Z Home");
axiscode = 'Z';
movevalue = 0;
break;
#if HAS_Z_AXIS
case VP_Z_HOME:
axiscode = 'Z';
movevalue = 0;
break;
#endif
}
DEBUG_ECHOPGM("movevalue = ", movevalue);
if (movevalue != 0 && movevalue != 5) { // get move distance
switch (movevalue) {
case 0x0001: movevalue = manualMoveStep; break;
@@ -824,21 +802,16 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
}
if (!movevalue) {
// homing
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
// char buf[6] = "G28 X";
// buf[4] = axiscode;
char buf[6];
sprintf(buf, "G28 %c", axiscode);
//DEBUG_ECHOPGM(" ", buf);
queue.enqueue_one_now(buf);
//DEBUG_ECHOLNPGM(" ✓");
ForceCompleteUpdate();
return;
}
else if (movevalue == 5) {
DEBUG_ECHOPGM("send M84");
char buf[6];
snprintf_P(buf,6,PSTR("M84 %c"), axiscode);
queue.enqueue_one_now(buf);
@@ -847,80 +820,57 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
}
else {
// movement
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
bool old_relative_mode = relative_mode;
if (!relative_mode) {
//DEBUG_ECHOPGM(" G91");
queue.enqueue_now(F("G91"));
//DEBUG_ECHOPGM(" ✓ ");
}
const bool old_relative_mode = relative_mode;
if (!relative_mode) queue.enqueue_now(F("G91"));
char buf[32]; // G1 X9999.99 F12345
// unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s);
//const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
char sign[] = "\0";
int16_t value = movevalue / 100;
if (movevalue < 0) { value = -value; sign[0] = '-'; }
int16_t fraction = ABS(movevalue) % 100;
const int16_t fraction = ABS(movevalue) % 100;
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
queue.enqueue_one_now(buf);
//if (backup_speed != speed) {
// snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
// queue.enqueue_one_now(buf);
// //DEBUG_ECHOPGM(" ", buf);
//}
//while (!enqueue_and_echo_command(buf)) idle();
//DEBUG_ECHOLNPGM(" ✓ ");
if (!old_relative_mode) {
//DEBUG_ECHOPGM("G90");
//queue.enqueue_now(F("G90"));
queue.enqueue_now(F("G90"));
//DEBUG_ECHOPGM(" ✓ ");
}
if (!old_relative_mode) queue.enqueue_now(F("G90"));
}
ForceCompleteUpdate();
DEBUG_ECHOLNPGM("manmv done.");
return;
cannotmove:
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
return;
}
void DGUSScreenHandlerMKS::GetParkPos(DGUS_VP_Variable &var, void *val_ptr) {
const int16_t value_pos = BE16_P(val_ptr);
const int16_t pos = BE16_P(val_ptr);
switch (var.VP) {
case VP_X_PARK_POS: mks_park_pos.x = value_pos; break;
case VP_Y_PARK_POS: mks_park_pos.y = value_pos; break;
case VP_Z_PARK_POS: mks_park_pos.z = value_pos; break;
case VP_X_PARK_POS: mks_park_pos.x = pos; break;
case VP_Y_PARK_POS: mks_park_pos.y = pos; break;
case VP_Z_PARK_POS: mks_park_pos.z = pos; break;
default: break;
}
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleChangeLevelPoint(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleChangeLevelPoint");
const int16_t raw = BE16_P(val_ptr);
const int16_t value_raw = BE16_P(val_ptr);
DEBUG_ECHOLNPGM("value_raw:", value_raw);
*(int16_t*)var.memadr = value_raw;
*(int16_t*)var.memadr = raw;
settings.save();
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleStepPerMMChanged");
const uint16_t value_raw = BE16_P(val_ptr);
const float value = (float)value_raw;
DEBUG_ECHOLNPGM("value_raw:", value_raw);
DEBUG_ECHOLNPGM("value:", value);
const uint16_t raw = BE16_P(val_ptr);
const float value = (float)raw;
ExtUI::axis_t axis;
switch (var.VP) {
@@ -930,19 +880,13 @@ void DGUSScreenHandlerMKS::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *v
case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break;
}
ExtUI::setAxisSteps_per_mm(value, axis);
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis));
settings.save();
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged");
const uint16_t value_raw = BE16_P(val_ptr);
const float value = (float)value_raw;
DEBUG_ECHOLNPGM("value_raw:", value_raw);
DEBUG_ECHOLNPGM("value:", value);
const uint16_t raw = BE16_P(val_ptr);
const float value = (float)raw;
ExtUI::extruder_t extruder;
switch (var.VP) {
@@ -955,19 +899,13 @@ void DGUSScreenHandlerMKS::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var,
#endif
}
ExtUI::setAxisSteps_per_mm(value, extruder);
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder));
settings.save();
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleMaxSpeedChange");
const uint16_t value_raw = BE16_P(val_ptr);
const float value = (float)value_raw;
DEBUG_ECHOLNPGM("value_raw:", value_raw);
DEBUG_ECHOLNPGM("value:", value);
const uint16_t raw = BE16_P(val_ptr);
const float value = (float)raw;
ExtUI::axis_t axis;
switch (var.VP) {
@@ -977,19 +915,13 @@ void DGUSScreenHandlerMKS::HandleMaxSpeedChange(DGUS_VP_Variable &var, void *val
default: return;
}
ExtUI::setAxisMaxFeedrate_mm_s(value, axis);
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(axis));
settings.save();
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleExtruderMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleExtruderMaxSpeedChange");
const uint16_t value_raw = BE16_P(val_ptr);
const float value = (float)value_raw;
DEBUG_ECHOLNPGM("value_raw:", value_raw);
DEBUG_ECHOLNPGM("value:", value);
const uint16_t raw = BE16_P(val_ptr);
const float value = (float)raw;
ExtUI::extruder_t extruder;
switch (var.VP) {
@@ -1002,19 +934,13 @@ void DGUSScreenHandlerMKS::HandleExtruderMaxSpeedChange(DGUS_VP_Variable &var, v
case VP_E1_MAX_SPEED: extruder = ExtUI::extruder_t::E1; break;
}
ExtUI::setAxisMaxFeedrate_mm_s(value, extruder);
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(extruder));
settings.save();
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleMaxAccChange(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleMaxAccChange");
const uint16_t value_raw = BE16_P(val_ptr);
const float value = (float)value_raw;
DEBUG_ECHOLNPGM("value_raw:", value_raw);
DEBUG_ECHOLNPGM("value:", value);
const uint16_t raw = BE16_P(val_ptr);
const float value = (float)raw;
ExtUI::axis_t axis;
switch (var.VP) {
@@ -1024,17 +950,13 @@ void DGUSScreenHandlerMKS::HandleMaxAccChange(DGUS_VP_Variable &var, void *val_p
case VP_Z_ACC_MAX_SPEED: axis = ExtUI::axis_t::Z; break;
}
ExtUI::setAxisMaxAcceleration_mm_s2(value, axis);
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(axis));
settings.save();
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleExtruderAccChange(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleExtruderAccChange");
uint16_t value_raw = BE16_P(val_ptr);
DEBUG_ECHOLNPGM("value_raw:", value_raw);
float value = (float)value_raw;
uint16_t raw = BE16_P(val_ptr);
float value = (float)raw;
ExtUI::extruder_t extruder;
switch (var.VP) {
default: return;
@@ -1045,41 +967,39 @@ void DGUSScreenHandlerMKS::HandleExtruderAccChange(DGUS_VP_Variable &var, void *
case VP_E1_ACC_MAX_SPEED: extruder = ExtUI::extruder_t::E1; settings.load(); break;
#endif
}
DEBUG_ECHOLNPGM("value:", value);
ExtUI::setAxisMaxAcceleration_mm_s2(value, extruder);
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(extruder));
settings.save();
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleTravelAccChange(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t value_travel = BE16_P(val_ptr);
planner.settings.travel_acceleration = (float)value_travel;
uint16_t travel = BE16_P(val_ptr);
planner.settings.travel_acceleration = (float)travel;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleFeedRateMinChange(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t value_t = BE16_P(val_ptr);
planner.settings.min_feedrate_mm_s = (float)value_t;
uint16_t t = BE16_P(val_ptr);
planner.settings.min_feedrate_mm_s = (float)t;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleMin_T_F(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t value_t_f = BE16_P(val_ptr);
planner.settings.min_travel_feedrate_mm_s = (float)value_t_f;
uint16_t t_f = BE16_P(val_ptr);
planner.settings.min_travel_feedrate_mm_s = (float)t_f;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t value_acc = BE16_P(val_ptr);
planner.settings.acceleration = (float)value_acc;
uint16_t acc = BE16_P(val_ptr);
planner.settings.acceleration = (float)acc;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
#if ENABLED(PREVENT_COLD_EXTRUSION)
void DGUSScreenHandlerMKS::HandleGetExMinTemp(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t value_ex_min_temp = BE16_P(val_ptr);
thermalManager.extrude_min_temp = value_ex_min_temp;
const uint16_t ex_min_temp = BE16_P(val_ptr);
thermalManager.extrude_min_temp = ex_min_temp;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
#endif
@@ -1087,9 +1007,7 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr)
#if HAS_PID_HEATING
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t rawvalue = BE16_P(val_ptr);
DEBUG_ECHOLNPGM("V1:", rawvalue);
const float value = 1.0f * rawvalue;
DEBUG_ECHOLNPGM("V2:", value);
const float value = float(rawvalue);
float newvalue = 0;
switch (var.VP) {
@@ -1111,7 +1029,6 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr)
#endif
}
DEBUG_ECHOLNPGM("V3:", newvalue);
*(float *)var.memadr = newvalue;
settings.save();
@@ -1121,7 +1038,6 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr)
#if ENABLED(BABYSTEPPING)
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
const float step = ZOffset_distance;
const uint16_t flag = BE16_P(val_ptr);
@@ -1163,19 +1079,17 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr)
#endif // BABYSTEPPING
void DGUSScreenHandlerMKS::GetManualFilament(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t value_len = BE16_P(val_ptr);
const float value = (float)value_len;
const uint16_t len = BE16_P(val_ptr);
const float value = (float)len;
DEBUG_ECHOLNPGM("GetManualFilament:", value);
distanceFilament = value;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
void DGUSScreenHandlerMKS::GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr) {
const uint16_t value_len = BE16_P(val_ptr);
filamentSpeed_mm_s = value_len;
DEBUG_ECHOLNPGM("GetManualFilamentSpeed:", value_len);
const uint16_t len = BE16_P(val_ptr);
filamentSpeed_mm_s = len;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
}
@@ -1264,20 +1178,16 @@ void GcodeSuite::M1002() {
}
void DGUSScreenHandlerMKS::FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("FilamentLoad");
FilamentLoadUnload(var, val_ptr, 1);
}
void DGUSScreenHandlerMKS::FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("FilamentUnLoad");
FilamentLoadUnload(var, val_ptr, -1);
}
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleFilamentOption");
uint8_t e_temp = 0;
filament_data.heated = false;
uint16_t preheat_option = BE16_P(val_ptr);
@@ -1345,7 +1255,6 @@ void DGUSScreenHandlerMKS::FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr)
}
void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) {
DEBUG_ECHOLNPGM("HandleFilamentLoadUnload");
if (filament_data.action <= 0) return;
// If we close to the target temperature, we can start load or unload the filament
@@ -247,7 +247,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C;
constexpr uint16_t VP_MOVE_OPTION = 0x3400;
// Step per mm
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4
//constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602;
constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604;
//constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606;
@@ -261,7 +261,7 @@ constexpr uint16_t VP_E0_STEP_PER_MM = 0x3610;
//constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A;
// PIDs
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
constexpr uint16_t VP_E0_PID_I = 0x3702;
constexpr uint16_t VP_E0_PID_D = 0x3704;
constexpr uint16_t VP_BED_PID_P = 0x3710;
@@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
// meaning "return to previous screen"
DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
DEBUG_ECHOLNPGM("\n DEBUG target", target);
if (target == DGUSLCD_SCREEN_POPUP) {
// Special handling for popup is to return to previous menu
if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb();
@@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
}
void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleManualMove");
int16_t movevalue = swap16(*(uint16_t*)val_ptr);
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
if (movevalue) {
@@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
}
#endif
char axiscode;
unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode.
uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves
switch (var.VP) {
default: return;
@@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove;
break;
case VP_MOVE_Y:
axiscode = 'Y';
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
break;
#if HAS_Y_AXIS
case VP_MOVE_Y:
axiscode = 'Y';
speed = _mf[Y_AXIS];
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
break;
#endif
case VP_MOVE_Z:
axiscode = 'Z';
speed = 300; // default to 5mm/s
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
break;
#if HAS_Z_AXIS
case VP_MOVE_Z:
axiscode = 'Z';
speed = _mf[Z_AXIS];
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
break;
#endif
case VP_HOME_ALL: // only used for homing
axiscode = '\0';
@@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!movevalue) {
// homing
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
char buf[6] = "G28 X";
buf[4] = axiscode;
//DEBUG_ECHOPGM(" ", buf);
queue.enqueue_one_now(buf);
//DEBUG_ECHOLNPGM(" ✓");
ForceCompleteUpdate();
return;
}
else {
// movement
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
bool old_relative_mode = relative_mode;
if (!relative_mode) {
//DEBUG_ECHOPGM(" G91");
queue.enqueue_now(F("G91"));
//DEBUG_ECHOPGM(" ✓ ");
}
const bool old_relative_mode = relative_mode;
if (!relative_mode) queue.enqueue_now(F("G91"));
char buf[32]; // G1 X9999.99 F12345
unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s);
const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
char sign[] = "\0";
int16_t value = movevalue / 100;
if (movevalue < 0) { value = -value; sign[0] = '-'; }
int16_t fraction = ABS(movevalue) % 100;
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
//DEBUG_ECHOPGM(" ", buf);
queue.enqueue_one_now(buf);
//DEBUG_ECHOLNPGM(" ✓ ");
if (backup_speed != speed) {
snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
queue.enqueue_one_now(buf);
//DEBUG_ECHOPGM(" ", buf);
}
// while (!enqueue_and_echo_command(buf)) idle();
//DEBUG_ECHOLNPGM(" ✓ ");
if (!old_relative_mode) {
//DEBUG_ECHOPGM("G90");
queue.enqueue_now(F("G90"));
//DEBUG_ECHOPGM(" ✓ ");
}
//while (!enqueue_and_echo_command(buf)) idle();
if (!old_relative_mode) queue.enqueue_now(F("G90"));
}
ForceCompleteUpdate();
DEBUG_ECHOLNPGM("manmv done.");
return;
cannotmove:
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
return;
}
#if HAS_PID_HEATING
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
DEBUG_ECHOLNPGM("V1:", rawvalue);
float value = (float)rawvalue / 10;
DEBUG_ECHOLNPGM("V2:", value);
float newvalue = 0;
switch (var.VP) {
@@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#endif
}
DEBUG_ECHOLNPGM("V3:", newvalue);
*(float *)var.memadr = newvalue;
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
@@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#if ENABLED(BABYSTEPPING)
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
int16_t flag = swap16(*(uint16_t*)val_ptr),
steps = flag ? -20 : 20;
ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true);
@@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleFilamentOption");
uint8_t e_temp = 0;
filament_data.heated = false;
uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
@@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
}
void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) {
DEBUG_ECHOLNPGM("HandleFilamentLoadUnload");
if (filament_data.action <= 0) return;
// If we close to the target temperature, we can start load or unload the filament
@@ -125,8 +125,7 @@ void DGUSDisplay::WriteStringPGM(uint16_t addr, const void* data_ptr, uint8_t si
const char* data = static_cast<const char*>(data_ptr);
size_t len = strlen_P(data);
uint8_t left_spaces = 0;
uint8_t right_spaces = 0;
uint8_t left_spaces = 0, right_spaces = 0;
if (len < size) {
if (!len) {
@@ -147,15 +146,9 @@ void DGUSDisplay::WriteStringPGM(uint16_t addr, const void* data_ptr, uint8_t si
len = size;
}
while (left_spaces--) {
LCD_SERIAL.write(' ');
}
while (len--) {
LCD_SERIAL.write(pgm_read_byte(data++));
}
while (right_spaces--) {
LCD_SERIAL.write(use_space ? ' ' : '\0');
}
while (left_spaces--) LCD_SERIAL.write(' ');
while (len--) LCD_SERIAL.write(pgm_read_byte(data++));
while (right_spaces--) LCD_SERIAL.write(use_space ? ' ' : '\0');
}
void DGUSDisplay::ReadVersions() {
@@ -164,7 +157,6 @@ void DGUSDisplay::ReadVersions() {
}
void DGUSDisplay::SwitchScreen(DGUS_Screen screen) {
DEBUG_ECHOLNPGM("SwitchScreen ", (uint8_t)screen);
const uint8_t command[] = { 0x5A, 0x01, 0x00, (uint8_t)screen };
Write(0x84, command, sizeof(command));
}
@@ -172,14 +164,11 @@ void DGUSDisplay::SwitchScreen(DGUS_Screen screen) {
void DGUSDisplay::PlaySound(uint8_t start, uint8_t len, uint8_t volume) {
if (volume == 0) volume = DGUSDisplay::volume;
if (volume == 0) return;
DEBUG_ECHOLNPGM("PlaySound ", start, ":", len, "\nVolume ", volume);
const uint8_t command[] = { start, len, volume, 0x00 };
Write(0xA0, command, sizeof(command));
}
void DGUSDisplay::EnableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_Control control) {
DEBUG_ECHOLNPGM("EnableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type);
const uint8_t command[] = { 0x5A, 0xA5, 0x00, (uint8_t)screen, (uint8_t)control, type, 0x00, 0x01 };
Write(0xB0, command, sizeof(command));
@@ -188,8 +177,6 @@ void DGUSDisplay::EnableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_
}
void DGUSDisplay::DisableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_Control control) {
DEBUG_ECHOLNPGM("DisableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type);
const uint8_t command[] = { 0x5A, 0xA5, 0x00, (uint8_t)screen, (uint8_t)control, type, 0x00, 0x00 };
Write(0xB0, command, sizeof(command));
@@ -208,14 +195,12 @@ uint8_t DGUSDisplay::GetVolume() {
void DGUSDisplay::SetBrightness(uint8_t new_brightness) {
brightness = constrain(new_brightness, 0, 100);
new_brightness = map_precise(brightness, 0, 100, 5, 100);
DEBUG_ECHOLNPGM("SetBrightness ", new_brightness);
const uint8_t command[] = { new_brightness, new_brightness };
Write(0x82, command, sizeof(command));
}
void DGUSDisplay::SetVolume(uint8_t new_volume) {
volume = map_precise(constrain(new_volume, 0, 100), 0, 100, 0, 255);
DEBUG_ECHOLNPGM("SetVolume ", volume);
const uint8_t command[] = { volume, 0x00 };
Write(0xA1, command, sizeof(command));
}
@@ -226,7 +211,6 @@ void DGUSDisplay::ProcessRx() {
if (!LCD_SERIAL.available() && LCD_SERIAL.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;
//LCD_SERIAL.reset_rx_overun();
LCD_SERIAL.flush();
@@ -239,20 +223,16 @@ void DGUSDisplay::ProcessRx() {
case DGUS_IDLE: // Waiting for the first header byte
receivedbyte = LCD_SERIAL.read();
DEBUG_ECHOPGM("< ", receivedbyte);
if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN;
break;
case DGUS_HEADER1_SEEN: // Waiting for the second header byte
receivedbyte = LCD_SERIAL.read();
DEBUG_ECHOPGM(" ", 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 = LCD_SERIAL.read();
DEBUG_ECHOPGM(" (", 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;
@@ -262,22 +242,16 @@ void DGUSDisplay::ProcessRx() {
initialized = true; // We've talked to it, so we defined it as initialized.
uint8_t command = LCD_SERIAL.read();
DEBUG_ECHOPGM("# ", 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 = LCD_SERIAL.read();
DEBUG_ECHOPGM(" ", receivedbyte);
*ptmp++ = receivedbyte;
}
DEBUG_ECHOPGM(" # ");
// mostly we'll get this: 5A A5 03 82 4F 4B -- ACK on 0x82, so discard it.
if (command == DGUS_WRITEVAR && 'O' == tmp[0] && 'K' == tmp[1]) {
DEBUG_ECHOLNPGM(">");
rx_datagram_state = DGUS_IDLE;
break;
}
@@ -292,10 +266,7 @@ void DGUSDisplay::ProcessRx() {
if (command == DGUS_READVAR) {
const uint16_t addr = tmp[0] << 8 | tmp[1];
const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words)
DEBUG_ECHOPGM("addr=", addr, " dlen=", dlen, "> ");
if (addr == DGUS_VERSION && dlen == 2) {
DEBUG_ECHOLNPGM("VERSIONS");
gui_version = tmp[3];
os_version = tmp[4];
rx_datagram_state = DGUS_IDLE;
@@ -304,13 +275,11 @@ void DGUSDisplay::ProcessRx() {
DGUS_VP vp;
if (!DGUS_PopulateVP((DGUS_Addr)addr, &vp)) {
DEBUG_ECHOLNPGM("VP not found");
rx_datagram_state = DGUS_IDLE;
break;
}
if (!vp.rx_handler) {
DEBUG_ECHOLNPGM("VP found, no handler.");
rx_datagram_state = DGUS_IDLE;
break;
}
@@ -346,7 +315,6 @@ void DGUSDisplay::ProcessRx() {
}
if (dlen != vp.size) {
DEBUG_ECHOLNPGM("VP found, size mismatch.");
rx_datagram_state = DGUS_IDLE;
break;
}
@@ -358,7 +326,6 @@ void DGUSDisplay::ProcessRx() {
break;
}
DEBUG_ECHOLNPGM(">");
rx_datagram_state = DGUS_IDLE;
break;
}
@@ -366,11 +333,13 @@ void DGUSDisplay::ProcessRx() {
}
size_t DGUSDisplay::GetFreeTxBuffer() {
#ifdef LCD_SERIAL_GET_TX_BUFFER_FREE
return LCD_SERIAL_GET_TX_BUFFER_FREE();
#else
return SIZE_MAX;
#endif
return (
#ifdef LCD_SERIAL_GET_TX_BUFFER_FREE
LCD_SERIAL_GET_TX_BUFFER_FREE()
#else
SIZE_MAX
#endif
);
}
void DGUSDisplay::FlushTx() {
@@ -402,7 +371,6 @@ bool DGUS_PopulateVP(const DGUS_Addr addr, DGUS_VP * const buffer) {
return true;
}
} while (++ret);
DEBUG_ECHOLNPGM("VP not found: ", (uint16_t)addr);
return false;
}
@@ -47,13 +47,13 @@ public:
enum DGUS_ControlType : uint8_t {
VARIABLE_DATA_INPUT = 0x00,
POPUP_WINDOW = 0x01,
INCREMENTAL_ADJUST = 0x02,
SLIDER_ADJUST = 0x03,
RTC_SETTINGS = 0x04,
RETURN_KEY_CODE = 0x05,
TEXT_INPUT = 0x06,
FIRMWARE_SETTINGS = 0x07
POPUP_WINDOW = 0x01,
INCREMENTAL_ADJUST = 0x02,
SLIDER_ADJUST = 0x03,
RTC_SETTINGS = 0x04,
RETURN_KEY_CODE = 0x05,
TEXT_INPUT = 0x06,
FIRMWARE_SETTINGS = 0x07
};
DGUSDisplay() = default;
@@ -63,8 +63,11 @@ public:
static void Read(uint16_t addr, uint8_t size);
static void Write(uint16_t addr, const void* data_ptr, uint8_t size);
static void WriteString(uint16_t addr, const void* data_ptr, uint8_t size, bool left = true, bool right = false, bool use_space = true);
static void WriteStringPGM(uint16_t addr, const void* data_ptr, uint8_t size, bool left = true, bool right = false, bool use_space = true);
static void WriteString(uint16_t addr, const void* data_ptr, uint8_t size, bool left=true, bool right=false, bool use_space=true);
static void WriteStringPGM(uint16_t addr, const void* data_ptr, uint8_t size, bool left=true, bool right=false, bool use_space=true);
static void WriteString(uint16_t addr, FSTR_P const fstr, uint8_t size, bool left=true, bool right=false, bool use_space=true) {
WriteStringPGM(addr, FTOP(fstr), size, left, right, use_space);
}
template<typename T>
static void Write(uint16_t addr, T data) {
@@ -83,7 +86,7 @@ public:
// start: position at which the sound was stored on the display.
// len: how many sounds to play. Sounds will play consecutively from start to start+len-1.
// volume: playback volume. 0 keeps the current volume.
static void PlaySound(uint8_t start, uint8_t len = 1, uint8_t volume = 0);
static void PlaySound(uint8_t start, uint8_t len=1, uint8_t volume=0);
// Enable/disable a specific touch control.
// type: control type.
// control: index of the control on the page (set during screen development).
@@ -154,7 +157,7 @@ private:
};
enum dgus_system_addr : uint16_t {
DGUS_VERSION = 0x000f // OS/GUI version
DGUS_VERSION = 0x000F // OS/GUI version
};
static void WriteHeader(uint16_t addr, uint8_t command, uint8_t len);

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