Compare commits

..

249 Commits

Author SHA1 Message Date
Scott Lahteine 4d4fb0cf39 move G29 stuff to #27146 2024-06-02 14:43:22 -05:00
Scott Lahteine 81e4698097 Merge branch 'bugfix-2.1.x' into pr/26754 2024-06-02 14:26:36 -05:00
thinkyhead 95f81d2565 [cron] Bump distribution date (2024-05-29) 2024-05-29 00:26:13 +00:00
Scott Lahteine 9c922f0eab 🧑‍💻 Fix test STM32F103RC_btt_USB 2024-05-28 19:05:03 -05:00
Scott Lahteine 35a03d66e5 🔨 Update SAMD51 build deps 2024-05-28 18:49:39 -05:00
Mihai a4a0887fa7 🐛 Fix NONE, ALL, EVAL macro collision (#27132) 2024-05-28 18:22:39 -05:00
thinkyhead e7c9cf3e1d [cron] Bump distribution date (2024-05-27) 2024-05-27 00:22:53 +00:00
ellensp 6710616a09 🩹 Longer3D LK has ONBOARD_SDIO (#27129) 2024-05-26 12:09:18 -05:00
Scott Lahteine 2064c83c66 🚸 Fix SD nav after "one click print" (2) 2024-05-26 12:04:14 -05:00
thinkyhead 2e97ad1f4b [cron] Bump distribution date (2024-05-26) 2024-05-26 12:07:31 +00:00
Scott Lahteine 4f85f88ae3 🚸 Fix SD nav after "one click print" 2024-05-26 02:18:37 -05:00
thinkyhead 181a57ae9b [cron] Bump distribution date (2024-05-24) 2024-05-24 00:22:18 +00:00
Keith Bennett 3ee1248cf2 🩹 Even more Z input shaper followup (#27119)
Followup to #27118
2024-05-23 14:58:22 +12:00
thinkyhead 68c3916d46 [cron] Bump distribution date (2024-05-23) 2024-05-23 00:21:53 +00:00
Keith Bennett e3bbacd8b9 📝 Update Input Shaping comments (#27116)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-05-22 18:30:44 -05:00
Scott Lahteine f915371248 🧑‍💻 More language cleanup 2024-05-22 17:37:13 -05:00
Scott Lahteine dbf0f5faec we don't have this yet 2024-05-22 14:08:54 -05:00
Andrew ea848aa891 🩹 Z input shaper followup (#27118)
Followup to #27073
2024-05-22 14:07:04 -05:00
Scott Lahteine 5157849c60 🧑‍💻 Remove unused strings, label some 2024-05-22 13:07:33 -05:00
Scott Lahteine ca31f9789e 🩹 Fix LCD getFreeTxBuffer typo 2024-05-21 19:26:18 -05:00
Scott Lahteine 78d3cf1de1 🎨 PGM => _P rename 2024-05-21 19:26:18 -05:00
Scott Lahteine 521e7eafce 🧑‍💻 Clarify media "mounted" 2024-05-21 19:26:18 -05:00
thinkyhead 2d78a80cf6 [cron] Bump distribution date (2024-05-22) 2024-05-22 00:21:43 +00:00
Scott Lahteine cb963669db Merge branch 'bugfix-2.1.x' into pr/26754 2024-05-21 15:28:09 -05:00
Miguel Risco-Castillo 5f32698da5 Ender-3 V3 board CR4NS200320C13 (#27003) 2024-05-21 15:20:12 -05:00
thinkyhead 1845056014 [cron] Bump distribution date (2024-05-21) 2024-05-21 00:22:16 +00:00
Jason Smith 0b8ec2aa74 🎨 Decimal TMC address (#27028) 2024-05-20 17:16:49 -05:00
ellensp 578bdd4b20 🧑‍💻 Address trailing spaces (#27108) 2024-05-20 00:04:51 -05:00
Jonathan Brazier 6b6865d068 INPUT_SHAPING_Z (#27073) 2024-05-20 00:03:03 -05:00
Andrew 6c018eb770 📝 Update some G-code and other comments (#27034) 2024-05-20 00:01:05 -05:00
ellensp 5561bafbe6 M110 Get Command Line Number (#27090)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-05-19 23:11:30 -05:00
ellensp 75eee04972 🩹 Return 0 for bad index in Temperature::getHeaterPower (#27037)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-05-19 23:10:15 -05:00
ellensp ee1d1faa52 🔨 Sim pins / INI cleanup 2024-05-19 23:07:24 -05:00
Chris dbd3e10959 🩹 Solid background for DWIN_MARLINUI text (#27029) 2024-05-19 22:53:45 -05:00
Andrew fde330af5a 🎨 Fix MarlinUI "untyped" string args (#27046) 2024-05-19 21:50:24 -05:00
Keith Bennett e8d953257e 🔨 Warn about Input Shaping + I2S_STEPPER_STREAM (#27051) 2024-05-19 21:45:57 -05:00
Keith Bennett cc86e9ecce Fix CI badge (#27060) 2024-05-19 21:44:22 -05:00
vrooze 5a6db519d6 Ender-3 V2 LCD with SKR 3[EZ] (#27061) 2024-05-19 20:31:53 -05:00
thinkyhead 98d09e5304 [cron] Bump distribution date (2024-05-20) 2024-05-20 00:35:32 +00:00
Vovodroid d87a0ea7f7 🚸 Quickly apply touch screen fan/laser edit (#27064) 2024-05-19 19:32:43 -05:00
Dave Gateman 0e2bd069d4 🩹 Fix cutter power extra '%' (#27105) 2024-05-19 18:53:38 -05:00
ellensp feca9a33d5 SHOW_CUSTOM_BOOTSCREEN for HD44780 (#26793)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-05-19 18:51:52 -05:00
Scott Lahteine eec1aec071 🐛 Fix multi-byte menu string buffer overrun (#27100) 2024-05-19 18:43:04 -05:00
Scott Lahteine a97d1088f0 🔧 Ensure distinct languages (#27107) 2024-05-19 18:42:07 -05:00
Scott Lahteine a7317de3b4 🔨 Sim needs GLM_ENABLE_EXPERIMENTAL 2024-05-19 14:12:17 -05:00
thinkyhead 06762db050 [cron] Bump distribution date (2024-05-18) 2024-05-18 00:22:00 +00:00
Vovodroid 4f3ebea3a6 🐛 Fix FT_MOTION block reference (#27063) 2024-05-17 16:47:44 -05:00
ellensp fa88e0f054 🔨 Windows Simulator needs -DGLM_ENABLE_EXPERIMENTAL (#27092) 2024-05-17 16:04:36 -05:00
Mihai 2fd7c2b865 ️ Fix motion smoothness (#27013) 2024-05-16 20:48:21 -05:00
jam-berg ef0bd975cf 🩹 Fix Ender 2 Pro EXP1-7 pin (PB15 / LCD_RS) (#27074) 2024-05-16 20:23:17 -05:00
Keith Bennett bdc14ddbd7 ️ Revert DELTA Z endstop homing patch (#27088)
Reverts #26297 f7a3172c20
2024-05-16 20:18:41 -05:00
Mihai 383e6f4646 🐛 Move LASER_POWER_TRAP cruise to cruise block (#27031) 2024-05-16 20:05:27 -05:00
thinkyhead e37415c95b [cron] Bump distribution date (2024-05-17) 2024-05-17 00:22:14 +00:00
Scott Lahteine a33112a4c0 🐛 Reorder FLOAT_SQ
Followup to 5f96dffb
2024-05-15 20:30:14 -05:00
thinkyhead 7e8007f024 [cron] Bump distribution date (2024-05-16) 2024-05-16 00:21:28 +00:00
Chris f320c2a455 🧑‍💻 Define, apply F_CPU on HC32 (#27086)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-05-15 18:10:04 -05:00
Chris 6eedeaedaf 🐛 Fix HC32 temperature ADC (#27085) 2024-05-15 15:49:40 -05:00
Chris 6b5e19cfc4 🐛 Fix HC32 watchdog timeout (#27084)
by reducing PCLK3 clock
2024-05-15 15:45:52 -05:00
ellensp 3dc437add4 🎨 Apply TERN0/1 for some contexts (#27036) 2024-05-15 15:42:19 -05:00
Scott Lahteine 5f96dffb9b 🧑‍💻 FLOAT_SQ macro 2024-05-15 15:21:39 -05:00
Mihai 6423b8031d ️ Add / enforce min_entry_speed_sqr (#27089) 2024-05-15 15:01:56 -05:00
thinkyhead bbdad79ce5 [cron] Bump distribution date (2024-05-13) 2024-05-13 00:22:55 +00:00
Keith Bennett a2daee8f7a 📝 MPCTEMP is tested (#27075) 2024-05-12 17:39:58 -05:00
ellensp 909e3ad116 🩹 Motor PWM followup (#27087)
Followup to 08fe8a3076
2024-05-12 17:31:02 -05:00
Scott Lahteine 556616c4f0 🧑‍💻 Controller warning as macro 2024-05-12 14:37:27 -05:00
Miguel Risco-Castillo 46e426ce96 📝 Use "based on" for partial ProUI (#26998) 2024-05-12 13:28:38 -05:00
Alexander Thomas Julian f5f6c37c17 🐛 LCD Bed Tramming fixes (#26962)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-05-12 13:25:14 -05:00
Scott Lahteine 08fe8a3076 🔧 Undef motor current PWM for unused axes 2024-05-12 13:21:32 -05:00
thinkyhead dabcea991f [cron] Bump distribution date (2024-05-12) 2024-05-12 00:24:03 +00:00
Scott Lahteine 4a5bd47b6a 🎨 Apply MUL_TERN 2024-05-11 13:41:15 -05:00
thinkyhead e5742a98df [cron] Bump distribution date (2024-05-11) 2024-05-11 18:06:35 +00:00
Keith Bennett 774cecc3b4 🩹 Fix AT90USB1286 PIO upload (#27070) 2024-05-11 12:03:04 -05:00
Keith Bennett 83b7e32ec4 🩹 Fix Nextion cstr/fstr typo (#27071) 2024-05-11 12:02:17 -05:00
thinkyhead a22155bd96 [cron] Bump distribution date (2024-05-10) 2024-05-10 00:21:41 +00:00
narno2202 1da947f548 ️ FT_MOTION : Core and other refinements (#26720)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Co-authored-by: Ulendo Alex <alex@ulendo.io>
2024-05-09 16:57:23 -05:00
Scott Lahteine 70332b271b 🎨 DGUS PGM => _P 2024-05-09 16:23:03 -05:00
David Buezas a3960dfa53 🚸 New encoder logic & debounce (#26723)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-05-09 16:20:57 -05:00
Scott Lahteine 4296ddb92c also… 2024-05-08 18:37:16 -05:00
Scott Lahteine 6be8ed2956 Merge branch 'bugfix-2.1.x' into pr/26754 2024-05-08 18:23:29 -05:00
Scott Lahteine 1f0c4d809a name change 2024-05-08 18:09:25 -05:00
thinkyhead bab1917311 [cron] Bump distribution date (2024-05-07) 2024-05-07 01:00:35 +00:00
Andrew 49348716f5 🩹 Fix printf et.al. expecting F-strings (#27032) 2024-05-06 18:58:00 -05:00
thinkyhead eb781afe7b [cron] Bump distribution date (2024-05-03) 2024-05-03 00:21:23 +00:00
Jason Smith 39f53c3f8c 🧑‍💻Improve make tests-all-local (#27040)
* Sleep 5 seconds between platforms

* Inform users if they need to install pyyaml

* Fix old workflow name

* Skip linux_native on Darwin
2024-05-02 06:36:24 -07:00
thinkyhead b5307aaaad [cron] Bump distribution date (2024-05-02) 2024-05-02 00:21:16 +00:00
Andrew f5cf667c95 🎨 Clarify some string parameters (#26949)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-05-01 15:08:15 -05:00
thinkyhead 737095f852 [cron] Bump distribution date (2024-04-30) 2024-04-30 00:20:48 +00:00
Keith Bennett f56952c9e6 🔧 Assert TMC slave addresses, minor pins cleanup (#26842) 2024-04-28 22:17:02 -07:00
Keith Bennett ca5a7be5e8 🔧 More suppressible warnings (#27009)
* 🔧 Suppressible LCD contrast warning

* 🔧 Suppressible Z_SAFE_HOMING warning

* 🔧 Suppressible user feedback warning
2024-04-28 18:15:07 -07:00
thinkyhead 582c5a36d7 [cron] Bump distribution date (2024-04-29) 2024-04-29 00:21:47 +00:00
Chris a8058729cc 🩹Free debug pins in HC32 HAL (#26985)
implements DISABLE_DEBUG and DISABLE_JTAG in HAL
2024-04-28 15:59:28 -07:00
Keith Bennett a2f024ffe3 🔧 Rework MKS Monster8 pins (#26988) 2024-04-28 15:53:48 -07:00
thinkyhead e1d65cc5e0 [cron] Bump distribution date (2024-04-28) 2024-04-28 00:23:55 +00:00
ellensp 75cda8d191 📝Update comments to match board labeling (#27016) 2024-04-27 13:13:00 -07:00
thinkyhead af8dcc6ee8 [cron] Bump distribution date (2024-04-25) 2024-04-25 00:29:51 +00:00
Scott Lahteine 2270bf41d7 🩹 IA-Creality minor cleanup 2024-04-24 18:09:32 -05:00
Scott Lahteine 489ef6e5e1 🩹 Simple IA-Creality babystep patch
See https://github.com/MarlinFirmware/Marlin/issues/26896#issuecomment-2015630458

Co-Authored-By: ellensp <530024+ellensp@users.noreply.github.com>
2024-04-24 17:58:51 -05:00
InsanityAutomation cecc745844 🚸 Fix duplicate temperature report (#26952) 2024-04-24 17:51:08 -05:00
thinkyhead 5366362e47 [cron] Bump distribution date (2024-04-24) 2024-04-24 00:46:36 +00:00
ellensp a1ecea60fd ✏️ MPCTEMP_START => MPC_STARTED (#27002) 2024-04-23 19:35:11 -05:00
Keith Bennett 882421a03e 🔧 BIQU MicroProbe V2 pull-up warning (#27008) 2024-04-23 19:19:02 -05:00
Jason Smith a36f72e886 🎨 Format pins which fail validation (#27007) 2024-04-23 14:19:14 -07:00
Jason Smith 247e989377 CI - Validate Pins Formatting (#26996) 2024-04-22 21:10:35 -05:00
thinkyhead 91ae676b9b [cron] Bump distribution date (2024-04-23) 2024-04-23 00:21:36 +00:00
Scott Lahteine a955e06259 🎨 Clean up after recent PRs 2024-04-22 18:59:18 -05:00
thinkyhead 31683ce35b [cron] Bump distribution date (2024-04-22) 2024-04-22 00:22:27 +00:00
Jason Smith d773570cd6 🐛 Fix Flags<N> data storage width (#26995)
* Fix Flags and associated unit tests
2024-04-21 00:24:57 -07:00
Jason Smith 556da2b3fc Add additional unit tests for types.h (#26994)
* Add more XYval (and similar) unit tests

* Add  Flags tests, with multiple BUGs identified
2024-04-20 23:59:43 -07:00
Jason Smith 9e19a6efe1 Unit test improvements (#26993)
- Reset config.ini in restore_configs
- Allow running a single configuration of unit tests locally
2024-04-20 23:40:26 -07:00
InsanityAutomation f433b2c433 🔧 Add RAMPS TMC SPI pins when !TMC_USE_SW_SPI (#26960)
* Allows RAMPS to auto assign HW SPI Pins for TMC
2024-04-20 18:27:56 -07:00
Aron List bc0d7d7140 🐛 Fix PID upon entering PID_FUNCTIONAL_RANGE (#26926)
The PID algorithm did not cache the last seen temperature until it entered the PID_FUNCTIONAL_RANGE. This caused an incorrect output power to be calculated temporarily while the algorithm caught up.

This has likely always been a problem for bed and chamber PID. For the hotend this error was introduced in refactoring in commit 54e7b933cd.
2024-04-20 18:18:49 -07:00
thinkyhead 24f8831021 [cron] Bump distribution date (2024-04-21) 2024-04-21 00:23:15 +00:00
Jason Smith 9a8fb80eed 🎨Match unit test folder structure to code (#26990) 2024-04-20 17:00:07 -07:00
Jason Smith ca12459b9c Skip compile tests when editing unit tests (#26991) 2024-04-20 15:55:30 -07:00
InsanityAutomation e1ab911c35 📝Improve Freeze Feature comment (#26959)
* Fix and Improve Freeze Feature comment
2024-04-20 14:58:13 -07:00
ellensp 58d4494365 add ui_api.h include (#26977) 2024-04-20 14:48:31 -07:00
ellensp d502e5beaa 🐛 Fix auto-assignment errors for J and U axis (#26979) 2024-04-20 14:46:48 -07:00
Chris b4a95db7da 🚨Fix buffer overrun warning in UBL (#26984)
to account for null terminator
2024-04-20 14:43:31 -07:00
thinkyhead 02ba6f9f3a [cron] Bump distribution date (2024-04-19) 2024-04-19 00:21:25 +00:00
Andrew dba0010607 🎨 Rename some G-code files (#26981) 2024-04-18 18:04:03 -05:00
I3DBeeTech 90667f6114 🐛 Fix BLACKBEEZMINI fan, info (#26983) 2024-04-18 15:54:17 -05:00
thinkyhead d6961b2626 [cron] Bump distribution date (2024-04-17) 2024-04-17 06:06:51 +00:00
Javlon Sodikov 07ebb8171f 🩹Fix ProUI error when !CASELIGHT_USES_BRIGHTNESS (#26976)
* Fix the compile error with the case light menu

Fix the compile error with the case light menu

* Add failing test

---------

Co-authored-by: Jason Smith <jason.inet@gmail.com>
2024-04-16 22:25:22 -07:00
thinkyhead 245db73929 [cron] Bump distribution date (2024-04-16) 2024-04-16 18:06:16 +00:00
Scott Lahteine 9342dae8f0 📝 Remove dead PDF links 2024-04-16 12:18:26 -05:00
thinkyhead 1f84f50fd8 [cron] Bump distribution date (2024-04-15) 2024-04-15 02:38:10 +00:00
Scott Lahteine 3326c749f8 📝 Minor README changes 2024-04-14 16:36:56 -05:00
Scott Lahteine 0269106066 🎨 Dagoma D6 followup 2024-04-14 16:24:51 -05:00
Sophist 95d38a8e54 Add Dagoma D6 as found in DiscoUltimate v2 TMC (#26874)
* Add Dagoma D6 board as used in their DiscoUltimate v2 TMC.

Taken from the Dagoma fork of Marlin DU_MC branch where it is called FYSETC_DAGOMA_F5 and explicitly confirmed by Dagoma as being the D6:

"the BOARD_FYSETC_DAGOMA_F5 is effectively the definition for the D6"

---------

Co-authored-by: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com>
Co-authored-by: Orel <37673727+0r31@users.noreply.github.com>
2024-04-14 13:04:52 -07:00
Chris dca6afc26e 🐛 HC32 - Add SERIAL_DMA, fix SDIO and MEATPACK (#26845)
* fix meatpack on hc32

* add support for SERIAL_DMA on HC32

* add additional checks in HC32 HAL

* migrate HC32 HAL to use app_config.h

* fix memory leak in HC32 sdio HAL
https://github.com/MarlinFirmware/Marlin/pull/26845#issuecomment-1980218771

* hc32: fail if both EMERGENCY_PARSER and SERIAL_DMA are enabled
2024-04-14 11:42:57 -07:00
Jason Smith 19684f23bc Add unit tests for macros.h (#26968) 2024-04-13 17:49:08 -07:00
Keith Bennett 52a561399e ️ Revert unintended README changes (#26967)
* Revert all the changes that went in with the unit test framework
This restored broken links and other changes. Restoring to the prior revision seems the most appropriate action until the intentions of those file changes are known.
---------

Co-authored-by: Jason Smith <jason.inet@gmail.com>
2024-04-13 17:47:16 -07:00
thinkyhead 0683e8a9a3 [cron] Bump distribution date (2024-04-14) 2024-04-14 00:24:15 +00:00
Jason Smith 1bb4a042e2 Unit test improvements (#26965)
* Do not warn about display in unit tests

* Treat warnings as errors in unit tests

* Report actual filenames with unit tests
2024-04-13 14:11:51 -07:00
Jason Smith d10861e478 Add unit testing framework (#26948)
- Add a framework to build and execute unit tests for Marlin.
- Enable unit test execution as part of PR checks.

---------

Co-authored-by: Costas Basdekis <costas.basdekis@gmail.com>
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-04-13 12:06:08 -07:00
Andrew cf7c86d581 🔧Fix M936 in features.ini (#26957) 2024-04-13 11:59:59 -07:00
David Buezas d99e150097 ️Reduce DISPLAY_SLEEP_MINUTES overhead (#26964) 2024-04-13 09:54:25 -07:00
thinkyhead 9e88eb6100 [cron] Bump distribution date (2024-04-13) 2024-04-13 12:06:36 +00:00
Vovodroid 71d9a3e1df 🩹 Fix M413 report (#26846) 2024-04-13 00:04:34 -07:00
InsanityAutomation 6575dcc803 🩹 Reduce Kill Pin Wait (#26945)
Reduce kill pin wait time, and allow override by setting KILL_DELAY
2024-04-12 23:40:59 -07:00
InsanityAutomation 2715e5ba1b 🐛Fix IDEX X2 Direction (#26958)
* Fix IDEX X2 Direction

* Sanity Check IDEX X1_MAX_POS
2024-04-12 23:29:59 -07:00
thinkyhead 9a570b23a3 [cron] Bump distribution date (2024-04-11) 2024-04-11 12:07:54 +00:00
Andrew 1b091ecb87 ✏️Minor style and typo fixups (#26947)
* tweaks from PR, whitespace, wording in pause.h

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

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

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

---------

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

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

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

* Add WIFISUPPORT defines for documentation purposes

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

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

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

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
2024-01-31 12:33:42 -06:00
InsanityAutomation 85f60cc71a Baseline ExtUI Additions 2024-01-31 08:42:39 -05:00
538 changed files with 9534 additions and 5328 deletions
-40
View File
@@ -1,40 +0,0 @@
#
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
#
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 60
# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: [ 'no-locking' ]
# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false
# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: true
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated
# pulls:
# daysUntilLock: 30
# Repository to extend settings from
# _extends: repo
+2 -2
View File
@@ -19,7 +19,7 @@ jobs:
steps: steps:
- name: Check out bugfix-2.0.x - name: Check out bugfix-2.0.x
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: bugfix-2.0.x ref: bugfix-2.0.x
@@ -39,7 +39,7 @@ jobs:
exit 0 exit 0
- name: Check out bugfix-2.1.x - name: Check out bugfix-2.1.x
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: bugfix-2.1.x ref: bugfix-2.1.x
@@ -1,9 +1,9 @@
# #
# test-builds.yml # ci-build-tests.yml
# Do test builds to catch compile errors # Do test builds to catch compile errors
# #
name: CI name: CI - Build Tests
on: on:
pull_request: pull_request:
@@ -14,6 +14,8 @@ on:
- config/** - config/**
- data/** - data/**
- docs/** - docs/**
- test/**
- Marlin/tests/**
- '**/*.md' - '**/*.md'
push: push:
branches: branches:
@@ -23,11 +25,13 @@ on:
- config/** - config/**
- data/** - data/**
- docs/** - docs/**
- test/**
- Marlin/tests/**
- '**/*.md' - '**/*.md'
jobs: jobs:
test_builds: test_builds:
name: Run All Tests name: Build Test
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -152,7 +156,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Cache pip - name: Cache pip
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@@ -160,13 +164,13 @@ jobs:
${{ runner.os }}-pip- ${{ runner.os }}-pip-
- name: Cache PlatformIO - name: Cache PlatformIO
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ~/.platformio path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Select Python 3.9 - name: Select Python 3.9
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: '3.9' python-version: '3.9'
architecture: 'x64' architecture: 'x64'
+73
View File
@@ -0,0 +1,73 @@
#
# ci-unit-tests.yml
# Build and execute unit tests to catch functional issues in code
#
name: CI - Unit Tests
on:
pull_request:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths-ignore:
- config/**
- data/**
- docs/**
- '**/*.md'
push:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths-ignore:
- config/**
- data/**
- docs/**
- '**/*.md'
jobs:
# This runs all unit tests as a single job. While it should be possible to break this up into
# multiple jobs, they currently run quickly and finish long before the compilation tests.
run_unit_tests:
name: Unit Test
# These tests will only be able to run on the bugfix-2.1.x branch, until the next release
# pulls them into additional branches.
if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-latest
steps:
- name: Check out the PR
uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Select Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- name: Install PlatformIO
run: |
pip install -U platformio
pio upgrade --dev
pio pkg update --global
- name: Run All Unit Tests
run: |
make unit-test-all-local
+51
View File
@@ -0,0 +1,51 @@
#
# ci-validate-pins.yml
# Validate that all of the pins files are unchanged by pinsformat.py
#
name: CI - Validate Pins Files
on:
pull_request:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths:
- 'Marlin/src/pins/*/**'
push:
branches:
- bugfix-2.1.x
# Cannot be enabled on 2.1.x until it contains the unit test framework
#- 2.1.x
paths:
- 'Marlin/src/pins/*/**'
jobs:
validate_pins_files:
name: Validate Pins Files
if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-latest
steps:
- name: Check out the PR
uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Select Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: 'x64'
- name: Validate all pins files
run: |
make validate-pins -j
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
- "Needs: Work" - "Needs: Work"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Remove Labels - name: Remove Labels
uses: actions-ecosystem/action-remove-labels@v1 uses: actions-ecosystem/action-remove-labels@v1
with: with:
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@v8 - uses: actions/stale@v9
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: | stale-issue-message: |
+6 -6
View File
@@ -17,15 +17,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: dessant/lock-threads@v2 - uses: dessant/lock-threads@v5
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
process-only: 'issues' process-only: 'issues'
issue-lock-inactive-days: '60' issue-inactive-days: '60'
issue-exclude-created-before: '' exclude-issue-created-before: ''
issue-exclude-labels: 'no-locking' exclude-any-issue-labels: 'no-locking'
issue-lock-labels: '' add-issue-labels: ''
issue-lock-comment: > issue-comment: >
This issue has been automatically locked since there This issue has been automatically locked since there
has not been any recent activity after it was closed. has not been any recent activity after it was closed.
Please open a new issue for related bugs. Please open a new issue for related bugs.
+46 -7
View File
@@ -2,17 +2,23 @@ SCRIPTS_DIR := buildroot/share/scripts
CONTAINER_RT_BIN := docker CONTAINER_RT_BIN := docker
CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio
CONTAINER_IMAGE := marlin-dev CONTAINER_IMAGE := marlin-dev
UNIT_TEST_CONFIG ?= default
help: help:
@echo "Tasks for local development:" @echo "Tasks for local development:"
@echo "make marlin : Build marlin for the configured board" @echo "make marlin : Build marlin for the configured board"
@echo "make format-pins : Reformat all pins files" @echo "make format-pins -j : Reformat all pins files (-j for parallel execution)"
@echo "make validate-pins -j : Validate all pins files, fails if any require reformatting"
@echo "make tests-single-ci : Run a single test from inside the CI" @echo "make tests-single-ci : Run a single test from inside the CI"
@echo "make tests-single-local : Run a single test locally" @echo "make tests-single-local : Run a single test locally"
@echo "make tests-single-local-docker : Run a single test locally, using docker" @echo "make tests-single-local-docker : Run a single test locally, using docker"
@echo "make tests-all-local : Run all tests locally" @echo "make tests-all-local : Run all tests locally"
@echo "make tests-all-local-docker : Run all tests locally, using docker" @echo "make tests-all-local-docker : Run all tests locally, using docker"
@echo "make setup-local-docker : Build the local docker image" @echo "make unit-test-single-local : Run unit tests for a single config locally"
@echo "make unit-test-single-local-docker : Run unit tests for a single config locally, using docker"
@echo "make unit-test-all-local : Run all code tests locally"
@echo "make unit-test-all-local-docker : Run all code tests locally, using docker"
@echo "make setup-local-docker : Setup local docker using buildx"
@echo "" @echo ""
@echo "Options for testing:" @echo "Options for testing:"
@echo " TEST_TARGET Set when running tests-single-*, to select the" @echo " TEST_TARGET Set when running tests-single-*, to select the"
@@ -22,6 +28,9 @@ help:
@echo " run on GitHub CI" @echo " run on GitHub CI"
@echo " ONLY_TEST Limit tests to only those that contain this, or" @echo " ONLY_TEST Limit tests to only those that contain this, or"
@echo " the index of the test (1-based)" @echo " the index of the test (1-based)"
@echo " UNIT_TEST_CONFIG Set the name of the config from the test folder, without"
@echo " the leading number. Default is 'default'". Used with the
@echo " unit-test-single-* tasks"
@echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value" @echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value"
@echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:" @echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!" @echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
@@ -43,23 +52,53 @@ tests-single-local:
tests-single-local-docker: tests-single-local-docker:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi @if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)" $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
tests-all-local: tests-all-local:
@python -c "import yaml" 2>/dev/null || (echo 'pyyaml module is not installed. Install it with "python -m pip install pyyaml"' && exit 1)
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done && for TEST_TARGET in $$(python $(SCRIPTS_DIR)/get_test_targets.py) ; do \
if [ "$$TEST_TARGET" = "linux_native" ] && [ "$$(uname)" = "Darwin" ]; then \
echo "Skipping tests for $$TEST_TARGET on macOS" ; \
continue ; \
fi ; \
echo "Running tests for $$TEST_TARGET" ; \
run_tests . $$TEST_TARGET || exit 1 ; \
sleep 5; \
done
tests-all-local-docker: tests-all-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi @if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
unit-test-single-local:
platformio run -t marlin_$(UNIT_TEST_CONFIG) -e linux_native_test
unit-test-single-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-single-local UNIT_TEST_CONFIG=$(UNIT_TEST_CONFIG)
unit-test-all-local:
platformio run -t test-marlin -e linux_native_test
unit-test-all-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-all-local
setup-local-docker: setup-local-docker:
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile . $(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h') PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
.PHONY: $(PINS) format-pins validate-pins
$(PINS): %: $(PINS): %:
@echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@ @echo "Formatting $@"
@python $(SCRIPTS_DIR)/pinsformat.py $< $@
format-pins: $(PINS) format-pins: $(PINS)
validate-pins: format-pins
@echo "Validating pins files"
@git diff --exit-code || (git status && echo "\nError: Pins files are not formatted correctly. Run \"make format-pins\" to fix.\n" && exit 1)
+26 -25
View File
@@ -135,9 +135,9 @@
* Options: A4988, A5984, DRV8825, LV8729, TB6560, TB6600, TMC2100, * Options: A4988, A5984, DRV8825, LV8729, TB6560, TB6600, TMC2100,
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
* TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC2660, TMC2660_STANDALONE, TMC5130, TMC5130_STANDALONE,
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/ */
#define X_DRIVER_TYPE A4988 #define X_DRIVER_TYPE A4988
#define Y_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988
@@ -401,9 +401,18 @@
//#define PS_OFF_SOUND // Beep 1s when power off //#define PS_OFF_SOUND // Beep 1s when power off
#define PSU_ACTIVE_STATE LOW // Set 'LOW' for ATX, 'HIGH' for X-Box #define PSU_ACTIVE_STATE LOW // Set 'LOW' for ATX, 'HIGH' for X-Box
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
//#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power //#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power
//#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay //#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay
//#define PSU_OFF_REDUNDANT // Second pin for redundant power control
//#define PSU_OFF_REDUNDANT_INVERTED // Redundant pin state is the inverse of PSU_ACTIVE_STATE
//#define PS_ON1_PIN 6 // Redundant pin required to enable power in combination with PS_ON_PIN
//#define PS_ON_EDM_PIN 8 // External Device Monitoring pins for external power control relay feedback. Fault on mismatch.
//#define PS_ON1_EDM_PIN 9
#define PS_EDM_RESPONSE 250 // (ms) Time to allow for relay action
//#define POWER_OFF_TIMER // Enable M81 D<seconds> to power off after a delay //#define POWER_OFF_TIMER // Enable M81 D<seconds> to power off after a delay
//#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S to power off only after cooldown //#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S to power off only after cooldown
@@ -663,7 +672,7 @@
* MPCTEMP : Predictive Model temperature control. (~1.8K without auto-tune) * MPCTEMP : Predictive Model temperature control. (~1.8K without auto-tune)
*/ */
#define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning #define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning
//#define MPCTEMP // ** EXPERIMENTAL ** See https://marlinfw.org/docs/features/model_predictive_control.html //#define MPCTEMP // See https://marlinfw.org/docs/features/model_predictive_control.html
#define PID_MAX 255 // Limit hotend current while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #define PID_MAX 255 // Limit hotend current while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#define PID_K1 0.95 // Smoothing factor within any PID loop #define PID_K1 0.95 // Smoothing factor within any PID loop
@@ -1006,9 +1015,6 @@
// Radius around the center where the arm cannot reach // Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm) #define MIDDLE_DEAD_ZONE_R 0 // (mm)
#define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
#define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
#elif ENABLED(MP_SCARA) #elif ENABLED(MP_SCARA)
#define SCARA_OFFSET_THETA1 12 // degrees #define SCARA_OFFSET_THETA1 12 // degrees
@@ -1027,23 +1033,19 @@
#define DEFAULT_SEGMENTS_PER_SECOND 200 #define DEFAULT_SEGMENTS_PER_SECOND 200
// Length of inner and outer support arms. Measure arm lengths precisely. // Length of inner and outer support arms. Measure arm lengths precisely.
#define TPARA_LINKAGE_1 120 // (mm) #define TPARA_LINKAGE_1 120 // (mm)
#define TPARA_LINKAGE_2 120 // (mm) #define TPARA_LINKAGE_2 120 // (mm)
// SCARA tower offset (position of Tower relative to bed zero position) // TPARA tower offset (position of Tower relative to bed zero position)
// This needs to be reasonably accurate as it defines the printbed position in the SCARA space. // This needs to be reasonably accurate as it defines the printbed position in the TPARA space.
#define TPARA_OFFSET_X 0 // (mm) #define TPARA_OFFSET_X 0 // (mm)
#define TPARA_OFFSET_Y 0 // (mm) #define TPARA_OFFSET_Y 0 // (mm)
#define TPARA_OFFSET_Z 0 // (mm) #define TPARA_OFFSET_Z 0 // (mm)
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly #define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
// Radius around the center where the arm cannot reach // Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm) #define MIDDLE_DEAD_ZONE_R 0 // (mm)
// Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
#define THETA_HOMING_OFFSET 0
#define PSI_HOMING_OFFSET 0
#endif #endif
// @section polar // @section polar
@@ -2216,7 +2218,7 @@
#if ENABLED(LCD_BED_TRAMMING) #if ENABLED(LCD_BED_TRAMMING)
#define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets #define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets
#define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at tramming points #define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at tramming points
#define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between tramming points #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z raise between tramming points
//#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner //#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner
//#define BED_TRAMMING_USE_PROBE //#define BED_TRAMMING_USE_PROBE
#if ENABLED(BED_TRAMMING_USE_PROBE) #if ENABLED(BED_TRAMMING_USE_PROBE)
@@ -2634,9 +2636,9 @@
#define DISPLAY_CHARSET_HD44780 JAPANESE #define DISPLAY_CHARSET_HD44780 JAPANESE
/** /**
* Info Screen Style (0:Classic, 1:Průša) * Info Screen Style (0:Classic, 1:Průša, 2:CNC)
* *
* :[0:'Classic', 1:'Průša'] * :[0:'Classic', 1:'Průša', 2:'CNC']
*/ */
#define LCD_INFO_SCREEN_STYLE 0 #define LCD_INFO_SCREEN_STYLE 0
@@ -3414,7 +3416,6 @@
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
//#define DISABLE_ENCODER // Disable the click encoder, if any //#define DISABLE_ENCODER // Disable the click encoder, if any
//#define TOUCH_IDLE_SLEEP_MINS 5 // (minutes) Display Sleep after a period of inactivity. Set with M255 S.
#define TOUCH_SCREEN_CALIBRATION #define TOUCH_SCREEN_CALIBRATION
+40 -43
View File
@@ -1185,33 +1185,32 @@
* Zero Vibration (ZV) Input Shaping for X and/or Y movements. * Zero Vibration (ZV) Input Shaping for X and/or Y movements.
* *
* This option uses a lot of SRAM for the step buffer. The buffer size is * This option uses a lot of SRAM for the step buffer. The buffer size is
* calculated automatically from SHAPING_FREQ_[XY], DEFAULT_AXIS_STEPS_PER_UNIT, * calculated automatically from SHAPING_FREQ_[XYZ], DEFAULT_AXIS_STEPS_PER_UNIT,
* DEFAULT_MAX_FEEDRATE and ADAPTIVE_STEP_SMOOTHING. The default calculation can * DEFAULT_MAX_FEEDRATE and ADAPTIVE_STEP_SMOOTHING. The default calculation can
* be overridden by setting SHAPING_MIN_FREQ and/or SHAPING_MAX_FEEDRATE. * be overridden by setting SHAPING_MIN_FREQ and/or SHAPING_MAX_FEEDRATE.
* The higher the frequency and the lower the feedrate, the smaller the buffer. * The higher the frequency and the lower the feedrate, the smaller the buffer.
* If the buffer is too small at runtime, input shaping will have reduced * If the buffer is too small at runtime, input shaping will have reduced
* effectiveness during high speed movements. * effectiveness during high speed movements.
* *
* Tune with M593 D<factor> F<frequency>: * Tune with M593 D<factor> F<frequency>
*
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes.
* F<frequency> Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes.
* T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet)
* X<1> Set the given parameters only for the X axis.
* Y<1> Set the given parameters only for the Y axis.
*/ */
//#define INPUT_SHAPING_X //#define INPUT_SHAPING_X
//#define INPUT_SHAPING_Y //#define INPUT_SHAPING_Y
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y) //#define INPUT_SHAPING_Z
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z)
#if ENABLED(INPUT_SHAPING_X) #if ENABLED(INPUT_SHAPING_X)
#define SHAPING_FREQ_X 40 // (Hz) The default dominant resonant frequency on the X axis. #define SHAPING_FREQ_X 40.0 // (Hz) The default dominant resonant frequency on the X axis.
#define SHAPING_ZETA_X 0.15f // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping). #define SHAPING_ZETA_X 0.15 // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif #endif
#if ENABLED(INPUT_SHAPING_Y) #if ENABLED(INPUT_SHAPING_Y)
#define SHAPING_FREQ_Y 40 // (Hz) The default dominant resonant frequency on the Y axis. #define SHAPING_FREQ_Y 40.0 // (Hz) The default dominant resonant frequency on the Y axis.
#define SHAPING_ZETA_Y 0.15f // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping). #define SHAPING_ZETA_Y 0.15 // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif #endif
//#define SHAPING_MIN_FREQ 20 // By default the minimum of the shaping frequencies. Override to affect SRAM usage. #if ENABLED(INPUT_SHAPING_Z)
#define SHAPING_FREQ_Z 40.0 // (Hz) The default dominant resonant frequency on the Z axis.
#define SHAPING_ZETA_Z 0.15 // Damping ratio of the Z axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif
//#define SHAPING_MIN_FREQ 20.0 // (Hz) By default the minimum of the shaping frequencies. Override to affect SRAM usage.
//#define SHAPING_MAX_STEPRATE 10000 // By default the maximum total step rate of the shaped axes. Override to affect SRAM usage. //#define SHAPING_MAX_STEPRATE 10000 // By default the maximum total step rate of the shaped axes. Override to affect SRAM usage.
//#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters. //#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters.
#endif #endif
@@ -1270,11 +1269,11 @@
* XY Frequency limit * XY Frequency limit
* Reduce resonance by limiting the frequency of small zigzag infill moves. * Reduce resonance by limiting the frequency of small zigzag infill moves.
* See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html * See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html
* Use M201 F<freq> G<min%> to change limits at runtime. * Use M201 F<freq> S<min%> to change limits at runtime.
*/ */
//#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F<hertz>. //#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F<hertz>.
#ifdef XY_FREQUENCY_LIMIT #ifdef XY_FREQUENCY_LIMIT
#define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 G<min%>. #define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 S<min%>.
#endif #endif
// //
@@ -1584,7 +1583,7 @@
#if HAS_MARLINUI_U8GLIB #if HAS_MARLINUI_U8GLIB
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash. //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash.
#endif #endif
#if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE) #if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, HAS_MARLINUI_HD44780)
//#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup.
#endif #endif
#endif #endif
@@ -1970,17 +1969,6 @@
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
//#define USE_SMALL_INFOFONT //#define USE_SMALL_INFOFONT
/**
* Graphical Display Sleep
*
* The U8G library provides sleep / wake functions for SH1106, SSD1306,
* SSD1309, and some other DOGM displays.
* Enable this option to save energy and prevent OLED pixel burn-in.
* Adds the menu item Configuration > LCD Timeout (m) to set a wait period
* from 0 (disabled) to 99 minutes.
*/
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen. Set with M255 S.
/** /**
* ST7920-based LCDs can emulate a 16 x 4 character display using * ST7920-based LCDs can emulate a 16 x 4 character display using
* the ST7920 character-generator for very fast screen updates. * the ST7920 character-generator for very fast screen updates.
@@ -2229,13 +2217,20 @@
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
#endif #endif
// /**
// LCD Backlight Timeout * Display Sleep
// Requires a display with a controllable backlight * Enable this option to save energy and prevent OLED pixel burn-in.
// */
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen
/**
* LCD Backlight Timeout
* Requires a display with a controllable backlight
*/
//#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight //#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight
#if defined(DISPLAY_SLEEP_MINUTES) || defined(LCD_BACKLIGHT_TIMEOUT_MINS) #if defined(DISPLAY_SLEEP_MINUTES) || defined(LCD_BACKLIGHT_TIMEOUT_MINS)
#define EDITABLE_DISPLAY_TIMEOUT // Edit timeout with M255 S<minutes> and a menu item #define EDITABLE_DISPLAY_TIMEOUT // Edit sleep / backlight timeout with M255 S<minutes> and a menu item
#endif #endif
// //
@@ -2702,7 +2697,7 @@
* This feature is EXPERIMENTAL so use with caution and test thoroughly. * This feature is EXPERIMENTAL so use with caution and test thoroughly.
* Enable this option to receive data on the serial ports via the onboard DMA * Enable this option to receive data on the serial ports via the onboard DMA
* controller for more stable and reliable high-speed serial communication. * controller for more stable and reliable high-speed serial communication.
* Only some STM32 MCUs are currently supported. * Support is currently limited to some STM32 MCUs and all HC32 MCUs.
* Note: This has no effect on emulated USB serial ports. * Note: This has no effect on emulated USB serial ports.
*/ */
//#define SERIAL_DMA //#define SERIAL_DMA
@@ -2957,15 +2952,12 @@
* Some boards have simple jumper connections! See your board's documentation. * Some boards have simple jumper connections! See your board's documentation.
* - These drivers can also be used with Hardware Serial. * - These drivers can also be used with Hardware Serial.
* *
* The TMC26XStepper library is required for TMC26X stepper drivers.
* https://github.com/MarlinFirmware/TMC26XStepper
*
* The TMCStepper library is required for other TMC stepper drivers. * The TMCStepper library is required for other TMC stepper drivers.
* https://github.com/teemuatlut/TMCStepper * https://github.com/teemuatlut/TMCStepper
* *
* @section tmc/config * @section tmc/config
*/ */
#if HAS_TRINAMIC_CONFIG || HAS_TMC26X #if HAS_TRINAMIC_CONFIG
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
@@ -2979,7 +2971,7 @@
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing
#define X_MICROSTEPS 16 // 0..256 #define X_MICROSTEPS 16 // 0..256
#define X_RSENSE 0.11 // Multiplied x1000 for TMC26X #define X_RSENSE 0.11
#define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ... #define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ...
//#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis //#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis
//#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis //#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis
@@ -3472,7 +3464,7 @@
*/ */
#define TMC_ADV() { } #define TMC_ADV() { }
#endif // HAS_TRINAMIC_CONFIG || HAS_TMC26X #endif // HAS_TRINAMIC_CONFIG
// @section i2cbus // @section i2cbus
@@ -3565,7 +3557,7 @@
* Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and
* to set spindle speed, spindle direction, and laser power. * to set spindle speed, spindle direction, and laser power.
* *
* SuperPid is a router/spindle speed controller used in the CNC milling community. * SuperPID is a router/spindle speed controller used in the CNC milling community.
* Marlin can be used to turn the spindle on and off. It can also be used to set * Marlin can be used to turn the spindle on and off. It can also be used to set
* the spindle speed from 5,000 to 30,000 RPM. * the spindle speed from 5,000 to 30,000 RPM.
* *
@@ -4268,7 +4260,8 @@
/** /**
* Instant freeze / unfreeze functionality * Instant freeze / unfreeze functionality
* Potentially useful for emergency stop that allows being resumed. * Potentially useful for rapid stop that allows being resumed. Halts stepper movement.
* Note this does NOT pause spindles, lasers, fans, heaters or any other auxiliary device.
* @section interface * @section interface
*/ */
//#define FREEZE_FEATURE //#define FREEZE_FEATURE
@@ -4315,6 +4308,7 @@
// See class CodeProfiler. // See class CodeProfiler.
//#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multi-stepping 1 to 128 on this LED matrix row. //#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multi-stepping 1 to 128 on this LED matrix row.
//#define MAX7219_DEBUG_SLOWDOWN 6 // Count (mod 16) how many times SLOWDOWN has reduced print speed. //#define MAX7219_DEBUG_SLOWDOWN 6 // Count (mod 16) how many times SLOWDOWN has reduced print speed.
//#define MAX7219_REINIT_ON_POWERUP // Re-initialize MAX7129 when power supply turns on
#endif #endif
/** /**
@@ -4348,7 +4342,7 @@
* Extras for an ESP32-based motherboard with WIFISUPPORT * Extras for an ESP32-based motherboard with WIFISUPPORT
* These options don't apply to add-on WiFi modules based on ESP32 WiFi101. * These options don't apply to add-on WiFi modules based on ESP32 WiFi101.
*/ */
#if ENABLED(WIFISUPPORT) #if ANY(WIFISUPPORT, ESP3D_WIFISUPPORT)
//#define WEBSUPPORT // Start a webserver (which may include auto-discovery) using SPIFFS //#define WEBSUPPORT // Start a webserver (which may include auto-discovery) using SPIFFS
//#define OTASUPPORT // Support over-the-air firmware updates //#define OTASUPPORT // Support over-the-air firmware updates
//#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host //#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host
@@ -4531,3 +4525,6 @@
// Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR. // Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR.
//#define OPTIBOOT_RESET_REASON //#define OPTIBOOT_RESET_REASON
// Shrink the build for smaller boards by sacrificing some serial feedback
//#define MARLIN_SMALL_BUILD
+1 -1
View File
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
//#define STRING_DISTRIBUTION_DATE "2024-01-31" //#define STRING_DISTRIBUTION_DATE "2024-05-29"
/** /**
* Defines a generic printer name to be output to the LCD after booting Marlin. * Defines a generic printer name to be output to the LCD after booting Marlin.
+1 -1
View File
@@ -141,7 +141,7 @@ typedef Servo hal_servo_t;
#error "LCD_SERIAL_PORT must be from 0 to 3." #error "LCD_SERIAL_PORT must be from 0 to 3."
#endif #endif
#define LCD_SERIAL lcdSerial #define LCD_SERIAL lcdSerial
#if HAS_DGUS_LCD #if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
#endif #endif
#endif #endif
+1 -1
View File
@@ -629,7 +629,7 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >; template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser); MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
#if HAS_DGUS_LCD #if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
template<typename Cfg> template<typename Cfg>
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() { typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send. const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
+1 -1
View File
@@ -205,7 +205,7 @@
static ring_buffer_pos_t available(); static ring_buffer_pos_t available();
static void write(const uint8_t c); static void write(const uint8_t c);
static void flushTX(); static void flushTX();
#if HAS_DGUS_LCD #if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
static ring_buffer_pos_t get_tx_buffer_free(); static ring_buffer_pos_t get_tx_buffer_free();
#endif #endif
+1 -1
View File
@@ -61,7 +61,7 @@
#else #else
#define G2_PWM_Z 0 #define G2_PWM_Z 0
#endif #endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) #if HAS_MOTOR_CURRENT_PWM_E
#define G2_PWM_E 1 #define G2_PWM_E 1
#else #else
#define G2_PWM_E 0 #define G2_PWM_E 0
+20 -22
View File
@@ -18,30 +18,30 @@ extern "C" {
void sd_mmc_spi_mem_init() { void sd_mmc_spi_mem_init() {
} }
Ctrl_status sd_mmc_spi_test_unit_ready() { inline bool media_ready() {
#ifdef DISABLE_DUE_SD_MMC return IS_SD_INSERTED() && !IS_SD_PRINTING() && !IS_SD_FILE_OPEN() && card.isMounted();
return CTRL_NO_PRESENT;
#endif
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
return CTRL_GOOD;
}
// NOTE: This function is defined as returning the address of the last block
// in the card, which is cardSize() - 1
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
*nb_sector = card.diskIODriver()->cardSize() - 1;
return CTRL_GOOD;
} }
bool sd_mmc_spi_unload(bool) { return true; } bool sd_mmc_spi_unload(bool) { return true; }
bool sd_mmc_spi_wr_protect() { return false; } bool sd_mmc_spi_wr_protect() { return false; }
bool sd_mmc_spi_removal() { bool sd_mmc_spi_removal() { return !media_ready(); }
return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted());
Ctrl_status sd_mmc_spi_test_unit_ready() {
#ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT;
#endif
if (!media_ready()) return CTRL_NO_PRESENT;
return CTRL_GOOD;
}
// NOTE: This function is defined as returning the address of the last block
// in the card, which is cardSize() - 1
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
if (!media_ready()) return CTRL_NO_PRESENT;
*nb_sector = card.diskIODriver()->cardSize() - 1;
return CTRL_GOOD;
} }
#if ACCESS_USB == true #if ACCESS_USB == true
@@ -61,8 +61,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC #ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
#endif #endif
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) if (!media_ready()) return CTRL_NO_PRESENT;
return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC #ifdef DEBUG_MMC
{ {
@@ -101,8 +100,7 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC #ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
#endif #endif
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) if (!media_ready()) return CTRL_NO_PRESENT;
return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC #ifdef DEBUG_MMC
{ {
+8 -8
View File
@@ -74,7 +74,7 @@
//! //!
//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI. //! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
//!/ //!/
extern void sd_mmc_spi_mem_init(void); void sd_mmc_spi_mem_init();
//! //!
//! @brief This function tests the state of the SD_MMC memory and sends it to the Host. //! @brief This function tests the state of the SD_MMC memory and sends it to the Host.
@@ -87,7 +87,7 @@ extern void sd_mmc_spi_mem_init(void);
//! Media not present -> CTRL_NO_PRESENT //! Media not present -> CTRL_NO_PRESENT
//! Media has changed -> CTRL_BUSY //! Media has changed -> CTRL_BUSY
//!/ //!/
extern Ctrl_status sd_mmc_spi_test_unit_ready(void); Ctrl_status sd_mmc_spi_test_unit_ready();
//! //!
//! @brief This function gives the address of the last valid sector. //! @brief This function gives the address of the last valid sector.
@@ -98,7 +98,7 @@ extern Ctrl_status sd_mmc_spi_test_unit_ready(void);
//! Media ready -> CTRL_GOOD //! Media ready -> CTRL_GOOD
//! Media not present -> CTRL_NO_PRESENT //! Media not present -> CTRL_NO_PRESENT
//!/ //!/
extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector); Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
/*! \brief Unload/Load the SD/MMC card selected /*! \brief Unload/Load the SD/MMC card selected
* *
@@ -109,7 +109,7 @@ extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
* *
* \return \c true if unload/load done success. * \return \c true if unload/load done success.
*/ */
extern bool sd_mmc_spi_unload(bool unload); bool sd_mmc_spi_unload(bool unload);
//! //!
//! @brief This function returns the write protected status of the memory. //! @brief This function returns the write protected status of the memory.
@@ -120,14 +120,14 @@ extern bool sd_mmc_spi_unload(bool unload);
//! //!
//! @return false -> the memory is not write-protected (always) //! @return false -> the memory is not write-protected (always)
//!/ //!/
extern bool sd_mmc_spi_wr_protect(void); bool sd_mmc_spi_wr_protect();
//! //!
//! @brief This function tells if the memory has been removed or not. //! @brief This function tells if the memory has been removed or not.
//! //!
//! @return false -> The memory isn't removed //! @return false -> The memory isn't removed
//! //!
extern bool sd_mmc_spi_removal(void); bool sd_mmc_spi_removal();
//---- ACCESS DATA FUNCTIONS ---- //---- ACCESS DATA FUNCTIONS ----
@@ -147,7 +147,7 @@ extern bool sd_mmc_spi_removal(void);
//! It is ready -> CTRL_GOOD //! It is ready -> CTRL_GOOD
//! A error occur -> CTRL_FAIL //! A error occur -> CTRL_FAIL
//! //!
extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector); Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
//! This function initializes the SD/MMC memory for a write operation //! This function initializes the SD/MMC memory for a write operation
//! //!
@@ -161,7 +161,7 @@ extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
//! It is ready -> CTRL_GOOD //! It is ready -> CTRL_GOOD
//! An error occurs -> CTRL_FAIL //! An error occurs -> CTRL_FAIL
//! //!
extern Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector); Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector);
#endif // #if ACCESS_USB == true #endif // #if ACCESS_USB == true
+20 -1
View File
@@ -142,12 +142,31 @@
// ADC // ADC
// //
#define HAL_ADC_VREF_MV 3300 #define HAL_ADC_VREF_MV 3300
#define HAL_ADC_RESOLUTION 10 #define HAL_ADC_RESOLUTION 12
#define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
//
// Debug port disable
// JTMS / SWDIO = PA13
// JTCK / SWCLK = PA14
// JTDI = PA15
// JTDO = PB3
// NJTRST = PB4
//
#define DBG_SWCLK _BV(0)
#define DBG_SWDIO _BV(1)
#define DBG_TDO _BV(2)
#define DBG_TDI _BV(3)
#define DBG_TRST _BV(4)
#define DBG_ALL (DBG_SWCLK | DBG_SWDIO | DBG_TDO | DBG_TDI | DBG_TRST)
#define JTAGSWD_RESET() PORT_DebugPortSetting(DBG_ALL, Enable);
#define JTAG_DISABLE() PORT_DebugPortSetting(DBG_TDO | DBG_TDI | DBG_TRST, Disable);
#define JTAGSWD_DISABLE() PORT_DebugPortSetting(DBG_ALL, Disable);
// //
// MarlinHAL implementation // MarlinHAL implementation
// //
+33 -2
View File
@@ -123,6 +123,11 @@ void MarlinHAL::init() {
// Register min serial // Register min serial
TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); TERN_(POSTMORTEM_DEBUGGING, install_min_serial());
// warn if low memory after init
if (freeMemory() < 1024) {
SERIAL_WARN_MSG("HAL: low memory after init!\n");
}
} }
void MarlinHAL::init_board() {} void MarlinHAL::init_board() {}
@@ -147,7 +152,31 @@ void MarlinHAL::delay_ms(const int ms) {
delay(ms); delay(ms);
} }
void MarlinHAL::idletask() {} void MarlinHAL::idletask() {
#if ENABLED(MARLIN_DEV_MODE)
// check & print serial RX errors
MSerialT *serials[] = { &MSerial1, &MSerial2 };
for (int serial = 0; serial < 2; serial++) {
usart_receive_error_t err = serials[serial]->getReceiveError();
if (err != usart_receive_error_t::None) {
// "Warning: MSerial[n] RX [Framing|Parity|Overrun] Error"
SERIAL_WARN_START();
SERIAL_ECHOPGM(" MSerial");
SERIAL_ECHO(serial + 1);
SERIAL_ECHOPGM(" RX ");
switch(err) {
case usart_receive_error_t::FramingError: SERIAL_ECHOPGM("Framing"); break;
case usart_receive_error_t::ParityError: SERIAL_ECHOPGM("Parity"); break;
case usart_receive_error_t::OverrunError: SERIAL_ECHOPGM("Overrun"); break;
case usart_receive_error_t::RxDataDropped: SERIAL_ECHOPGM("DataDropped"); break;
default: break;
}
SERIAL_ECHOPGM(" Error");
SERIAL_EOL();
}
}
#endif
}
uint8_t MarlinHAL::get_reset_source() { uint8_t MarlinHAL::get_reset_source() {
// Query reset cause from RMU // Query reset cause from RMU
@@ -203,7 +232,9 @@ int MarlinHAL::freeMemory() {
return &top - _sbrk(0); return &top - _sbrk(0);
} }
void MarlinHAL::adc_init() {} void MarlinHAL::adc_init() {
analogReadResolution(HAL_ADC_RESOLUTION);
}
void MarlinHAL::adc_enable(const pin_t pin) { void MarlinHAL::adc_enable(const pin_t pin) {
#if TEMP_SENSOR_SOC #if TEMP_SENSOR_SOC
+23 -3
View File
@@ -46,14 +46,34 @@ constexpr bool serial_handles_emergency(int port) {
// //
// Define serial ports // Define serial ports
// //
#define DEFINE_HWSERIAL_MARLIN(name, n) \
// serial port where RX and TX use IRQs
#define DEFINE_IRQ_SERIAL_MARLIN(name, n) \
MSerialT name(serial_handles_emergency(n), \ MSerialT name(serial_handles_emergency(n), \
&USART##n##_config, \ &USART##n##_config, \
BOARD_USART##n##_TX_PIN, \ BOARD_USART##n##_TX_PIN, \
BOARD_USART##n##_RX_PIN); BOARD_USART##n##_RX_PIN);
DEFINE_HWSERIAL_MARLIN(MSerial1, 1); // serial port where RX uses DMA and TX uses IRQs
DEFINE_HWSERIAL_MARLIN(MSerial2, 2); // all serial ports use DMA1
// since there are 4 USARTs and 4 DMA channels, we can use the USART number as the DMA channel
#define DEFINE_DMA_SERIAL_MARLIN(name, n) \
MSerialT name(serial_handles_emergency(n), \
&USART##n##_config, \
BOARD_USART##n##_TX_PIN, \
BOARD_USART##n##_RX_PIN, \
M4_DMA1, \
((en_dma_channel_t)(n - 1))); // map USART1 to DMA channel 0, USART2 to DMA channel 1, etc.
#define DEFINE_SERIAL_MARLIN(name, n) TERN(SERIAL_DMA, DEFINE_DMA_SERIAL_MARLIN(name, n), DEFINE_IRQ_SERIAL_MARLIN(name, n))
DEFINE_SERIAL_MARLIN(MSerial1, 1);
DEFINE_SERIAL_MARLIN(MSerial2, 2);
// TODO: remove this warning when SERIAL_DMA has been tested some more
#if ENABLED(SERIAL_DMA)
#warning "SERIAL_DMA may be unstable on HC32F460."
#endif
// //
// Serial port assertions // Serial port assertions
+38 -8
View File
@@ -25,17 +25,42 @@
#include <drivers/usart/Usart.h> #include <drivers/usart/Usart.h>
// Optionally set uart IRQ priority to reduce overflow errors // Optionally set uart IRQ priority to reduce overflow errors
// #define UART_IRQ_PRIO 1 //#define UART_RX_IRQ_PRIO 1
//#define UART_TX_IRQ_PRIO 1
//#define UART_RX_DMA_IRQ_PRIO 1
struct MarlinSerial : public Usart { struct MarlinSerial : public Usart {
MarlinSerial(struct usart_config_t *usart_device, gpio_pin_t tx_pin, gpio_pin_t rx_pin) : Usart(usart_device, tx_pin, rx_pin) {} MarlinSerial(
struct usart_config_t *usart_device,
gpio_pin_t tx_pin,
gpio_pin_t rx_pin
#if ENABLED(SERIAL_DMA)
, M4_DMA_TypeDef *dma_unit = nullptr,
en_dma_channel_t rx_dma_channel = DmaCh0
#endif
) : Usart(usart_device, tx_pin, rx_pin) {
#if ENABLED(SERIAL_DMA)
if (dma_unit != nullptr) {
enableRxDma(dma_unit, rx_dma_channel);
}
#endif
}
#ifdef UART_IRQ_PRIO #if defined(UART_RX_IRQ_PRIO) || defined(UART_TX_IRQ_PRIO) || defined(UART_RX_DMA_IRQ_PRIO)
void setPriority() { void setPriority() {
NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_IRQ_PRIO); #if defined(UART_RX_IRQ_PRIO)
NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_IRQ_PRIO); NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_RX_IRQ_PRIO);
NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_IRQ_PRIO); NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_RX_IRQ_PRIO);
NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_IRQ_PRIO); #endif
#if defined(UART_TX_IRQ_PRIO)
NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_TX_IRQ_PRIO);
NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_TX_IRQ_PRIO);
#endif
#if defined(UART_RX_DMA_IRQ_PRIO) && ENABLED(SERIAL_DMA)
NVIC_SetPriority(c_dev()->dma.rx.rx_data_available_dma_btc.interrupt_number, UART_RX_DMA_IRQ_PRIO);
#endif
} }
void begin(uint32_t baud) { void begin(uint32_t baud) {
@@ -47,7 +72,12 @@ struct MarlinSerial : public Usart {
Usart::begin(baud, config); Usart::begin(baud, config);
setPriority(); setPriority();
} }
#endif
void begin(uint32_t baud, const stc_usart_uart_init_t *config, const bool rxNoiseFilter = true) {
Usart::begin(baud, config, rxNoiseFilter);
setPriority();
}
#endif // UART_RX_IRQ_PRIO || UART_TX_IRQ_PRIO || UART_RX_DMA_IRQ_PRIO
}; };
typedef Serial1Class<MarlinSerial> MSerialT; typedef Serial1Class<MarlinSerial> MSerialT;
+75
View File
@@ -0,0 +1,75 @@
/**
* app_config.h is included by the hc32f460 arduino build script for every source file.
* it is used to configure the arduino core (and ddl) automatically according
* to the settings in Configuration.h and Configuration_adv.h.
*/
#pragma once
#ifndef _HC32_APP_CONFIG_H_
#define _HC32_APP_CONFIG_H_
#include "../../inc/MarlinConfigPre.h"
//
// dev mode
//
#if ENABLED(MARLIN_DEV_MODE)
#define __DEBUG 1
#define __CORE_DEBUG 1
#endif
//
// Fault Handlers and Panic
//
#if ENABLED(POSTMORTEM_DEBUGGING)
// disable arduino core fault handler, as we define our own
#define CORE_DISABLE_FAULT_HANDLER 1
#endif
// force-enable panic handler so that we can use our custom one (in MinSerial)
#define PANIC_ENABLE 1
// use short filenames in ddl debug and core panic output
#define __DEBUG_SHORT_FILENAMES 1
#define __PANIC_SHORT_FILENAMES 1
// omit panic messages in core panic output
#define __OMIT_PANIC_MESSAGE 1
//
// Usart
//
// disable serial globals (Serial1, Serial2, ...), as we define our own
#define DISABLE_SERIAL_GLOBALS 1
// increase the size of the Usart buffers (both RX and TX)
// NOTE:
// the heap usage will increase by (SERIAL_BUFFER_SIZE - 64) * "number of serial ports used"
// if running out of heap, the system may become unstable
//#define SERIAL_BUFFER_SIZE 256
// enable support for Usart Clock Divider / Oversampling auto config
#define USART_AUTO_CLKDIV_OS_CONFIG 1
// enable USART_RX_DMA_SUPPORT core option when SERIAL_DMA is enabled
#if ENABLED(SERIAL_DMA)
#define USART_RX_DMA_SUPPORT 1
#endif
//
// Misc.
//
// redirect printf to host serial
#define REDIRECT_PRINTF_TO_SERIAL 1
// F_CPU must be known at compile time, but on HC32F460 it's not.
// Thus we assume HCLK to be 200MHz, as that's what is configured in
// 'core_hook_sysclock_init' in 'sysclock.cpp'.
// If you face issues with this assumption, please double-check with the values
// printed by 'MarlinHAL::HAL_clock_frequencies_dump'.
// see also: HAL_TIMER_RATE in timers.h
#define F_CPU 200000000 // 200MHz HCLK
#endif // _HC32_APP_CONFIG_H_
+19 -1
View File
@@ -40,9 +40,15 @@ void endstopIRQHandler() {
CHECK(X_MAX); CHECK(X_MAX);
CHECK(X_MIN); CHECK(X_MIN);
CHECK(X2_MAX);
CHECK(X2_MIN);
CHECK(Y_MAX); CHECK(Y_MAX);
CHECK(Y_MIN); CHECK(Y_MIN);
CHECK(Y2_MAX);
CHECK(Y2_MIN);
CHECK(Z_MAX); CHECK(Z_MAX);
CHECK(Z_MIN); CHECK(Z_MIN);
@@ -52,6 +58,9 @@ void endstopIRQHandler() {
CHECK(Z3_MAX); CHECK(Z3_MAX);
CHECK(Z3_MIN); CHECK(Z3_MIN);
CHECK(Z4_MAX);
CHECK(Z4_MIN);
CHECK(Z_MIN_PROBE); CHECK(Z_MIN_PROBE);
// Update endstops // Update endstops
@@ -69,9 +78,15 @@ void setup_endstop_interrupts() {
SETUP(X_MAX); SETUP(X_MAX);
SETUP(X_MIN); SETUP(X_MIN);
SETUP(X2_MAX);
SETUP(X2_MIN);
SETUP(Y_MAX); SETUP(Y_MAX);
SETUP(Y_MIN); SETUP(Y_MIN);
SETUP(Y2_MAX);
SETUP(Y2_MIN);
SETUP(Z_MAX); SETUP(Z_MAX);
SETUP(Z_MIN); SETUP(Z_MIN);
@@ -81,6 +96,9 @@ void setup_endstop_interrupts() {
SETUP(Z3_MAX); SETUP(Z3_MAX);
SETUP(Z3_MIN); SETUP(Z3_MIN);
SETUP(Z4_MAX);
SETUP(Z4_MIN);
SETUP(Z_MIN_PROBE); SETUP(Z_MIN_PROBE);
#undef SETUP #undef SETUP
@@ -88,7 +106,7 @@ void setup_endstop_interrupts() {
// Ensure 1 - 10 IRQs are registered // Ensure 1 - 10 IRQs are registered
// Disable some endstops if you encounter this error // Disable some endstops if you encounter this error
#define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_Y_MAX, USE_Y_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z_MIN_PROBE) #define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_X2_MAX, USE_X2_MIN, USE_Y_MAX, USE_Y_MIN, USE_Y2_MAX, USE_Y2_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z4_MAX, USE_Z4_MIN, USE_Z_MIN_PROBE)
#if ENDSTOPS_INTERRUPTS_COUNT > 10 #if ENDSTOPS_INTERRUPTS_COUNT > 10
#error "Too many endstop interrupts! HC32F460 only supports 10 endstop interrupts." #error "Too many endstop interrupts! HC32F460 only supports 10 endstop interrupts."
#elif ENDSTOPS_INTERRUPTS_COUNT == 0 #elif ENDSTOPS_INTERRUPTS_COUNT == 0
+29
View File
@@ -20,6 +20,20 @@
* *
*/ */
#pragma once #pragma once
#include <core_util.h>
#if !defined(ARDUINO_CORE_VERSION_INT) || !defined(GET_VERSION_INT)
// version macros were introduced in arduino core version 1.1.0
// below that version, we polyfill them
#define GET_VERSION_INT(major, minor, patch) ((major * 100000) + (minor * 1000) + patch)
#define ARDUINO_CORE_VERSION_INT GET_VERSION_INT(1, 0, 0)
#endif
#if ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 1, 0)
// because we use app_config.h introduced in arduino core version 1.1.0, the
// HAL is not compatible with older versions
#error "The HC32 HAL is not compatible with Arduino Core versions < 1.1.0. Consider updating the Arduino Core."
#endif
#ifndef BOARD_XTAL_FREQUENCY #ifndef BOARD_XTAL_FREQUENCY
#error "BOARD_XTAL_FREQUENCY is required for HC32F460." #error "BOARD_XTAL_FREQUENCY is required for HC32F460."
@@ -74,3 +88,18 @@
#error "HC32 HAL uses a custom panic handler. Do not define PANIC_USARTx_TX_PIN." #error "HC32 HAL uses a custom panic handler. Do not define PANIC_USARTx_TX_PIN."
#endif #endif
#endif #endif
#if ENABLED(SERIAL_DMA)
#if !defined(USART_RX_DMA_SUPPORT)
#error "SERIAL_DMA requires USART_RX_DMA_SUPPORT to be enabled in the arduino core."
#endif
// USART_RX_DMA_SUPPORT does not implement core_hook_usart_rx_irq, which is required for the emergency parser
#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not supported with SERIAL_DMA. Please disable either SERIAL_DMA or EMERGENCY_PARSER."
#endif
#if ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 1, 0)
#error "SERIAL_DMA is not supported with arduino core version < 1.1.0."
#endif
#endif
+26 -17
View File
@@ -54,7 +54,7 @@
fn \ fn \
} }
stc_sd_handle_t *handle; stc_sd_handle_t *handle = nullptr;
bool SDIO_Init() { bool SDIO_Init() {
// Configure SDIO pins // Configure SDIO pins
@@ -66,36 +66,45 @@ bool SDIO_Init() {
GPIO_SetFunc(BOARD_SDIO_CMD, Func_Sdio); GPIO_SetFunc(BOARD_SDIO_CMD, Func_Sdio);
GPIO_SetFunc(BOARD_SDIO_DET, Func_Sdio); GPIO_SetFunc(BOARD_SDIO_DET, Func_Sdio);
// If a handle is already initialized, free it before creating a new one
// otherwise, we will leak memory, which will eventually crash the system
if (handle != nullptr) {
delete handle->pstcDmaInitCfg;
delete handle->pstcCardInitCfg;
delete handle;
handle = nullptr;
}
// Create DMA configuration // Create DMA configuration
stc_sdcard_dma_init_t *dmaConf = new stc_sdcard_dma_init_t; stc_sdcard_dma_init_t *dmaConf = new stc_sdcard_dma_init_t;
dmaConf->DMAx = SDIO_DMA_PERIPHERAL; dmaConf->DMAx = SDIO_DMA_PERIPHERAL;
dmaConf->enDmaCh = SDIO_DMA_CHANNEL; dmaConf->enDmaCh = SDIO_DMA_CHANNEL;
// Create card configuration
// This should be a fairly safe configuration for most cards
stc_sdcard_init_t *cardConf = new stc_sdcard_init_t;
cardConf->enBusWidth = SdiocBusWidth4Bit;
cardConf->enClkFreq = SdiocClk400K;
cardConf->enSpeedMode = SdiocNormalSpeedMode;
cardConf->pstcInitCfg = nullptr;
// Create handle in DMA mode // Create handle in DMA mode
handle = new stc_sd_handle_t; handle = new stc_sd_handle_t;
handle->SDIOCx = SDIO_PERIPHERAL; handle->SDIOCx = SDIO_PERIPHERAL;
handle->enDevMode = SdCardDmaMode; handle->enDevMode = SdCardDmaMode;
handle->pstcDmaInitCfg = dmaConf; handle->pstcDmaInitCfg = dmaConf;
//handle->pstcCardInitCfg = cardConf; // assigned in SDCARD_Init
// Create card configuration
// This should be a fairly safe configuration for most cards
stc_sdcard_init_t cardConf = {
.enBusWidth = SdiocBusWidth4Bit,
.enClkFreq = SdiocClk400K,
.enSpeedMode = SdiocNormalSpeedMode,
//.pstcInitCfg = NULL,
};
// Initialize sd card // Initialize sd card
en_result_t rc = SDCARD_Init(handle, &cardConf); en_result_t rc = SDCARD_Init(handle, cardConf);
if (rc != Ok) printf("SDIO_Init() error (rc=%u)\n", rc); if (rc != Ok) printf("SDIO_Init() error (rc=%u)\n", rc);
return rc == Ok; return rc == Ok;
} }
bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
CORE_ASSERT(handle != NULL, "SDIO not initialized"); CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
CORE_ASSERT(dst != NULL, "SDIO_ReadBlock dst is NULL"); CORE_ASSERT(dst != nullptr, "SDIO_ReadBlock dst is NULL", return false);
WITH_RETRY(SDIO_READ_RETRIES, { WITH_RETRY(SDIO_READ_RETRIES, {
en_result_t rc = SDCARD_ReadBlocks(handle, block, 1, dst, SDIO_READ_TIMEOUT); en_result_t rc = SDCARD_ReadBlocks(handle, block, 1, dst, SDIO_READ_TIMEOUT);
@@ -107,8 +116,8 @@ bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
} }
bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
CORE_ASSERT(handle != NULL, "SDIO not initialized"); CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
CORE_ASSERT(src != NULL, "SDIO_WriteBlock src is NULL"); CORE_ASSERT(src != nullptr, "SDIO_WriteBlock src is NULL", return false);
WITH_RETRY(SDIO_WRITE_RETRIES, { WITH_RETRY(SDIO_WRITE_RETRIES, {
en_result_t rc = SDCARD_WriteBlocks(handle, block, 1, (uint8_t *)src, SDIO_WRITE_TIMEOUT); en_result_t rc = SDCARD_WriteBlocks(handle, block, 1, (uint8_t *)src, SDIO_WRITE_TIMEOUT);
@@ -120,12 +129,12 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
} }
bool SDIO_IsReady() { bool SDIO_IsReady() {
CORE_ASSERT(handle != NULL, "SDIO not initialized"); CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
return bool(handle->stcCardStatus.READY_FOR_DATA); return bool(handle->stcCardStatus.READY_FOR_DATA);
} }
uint32_t SDIO_GetCardSize() { uint32_t SDIO_GetCardSize() {
CORE_ASSERT(handle != NULL, "SDIO not initialized"); CORE_ASSERT(handle != nullptr, "SDIO not initialized", return 0);
// Multiply number of blocks with block size to get size in bytes // Multiply number of blocks with block size to get size in bytes
const uint64_t cardSizeBytes = uint64_t(handle->stcSdCardInfo.u32LogBlockNbr) * uint64_t(handle->stcSdCardInfo.u32LogBlockSize); const uint64_t cardSizeBytes = uint64_t(handle->stcSdCardInfo.u32LogBlockNbr) * uint64_t(handle->stcSdCardInfo.u32LogBlockSize);
+24 -9
View File
@@ -96,29 +96,44 @@ void core_hook_sysclock_init() {
#endif #endif
#endif #endif
// Setup clock divisors for sysclk = 200 MHz: // sysclk is now configured according to F_CPU (i.e., 200MHz PLL output)
constexpr uint32_t sysclock = F_CPU;
// Setup clock divisors for sysclk = 200 MHz
// Note: PCLK1 is used for step+temp timers, and need to be kept at 50 MHz (until there is a better solution) // Note: PCLK1 is used for step+temp timers, and need to be kept at 50 MHz (until there is a better solution)
stc_clk_sysclk_cfg_t sysClkConf = { constexpr stc_clk_sysclk_cfg_t sysClkConf = {
.enHclkDiv = ClkSysclkDiv1, // HCLK = 200 MHz (CPU) .enHclkDiv = ClkSysclkDiv1, // HCLK = 200 MHz (CPU)
.enExclkDiv = ClkSysclkDiv2, // EXCLK = 100 MHz (SDIO) .enExclkDiv = ClkSysclkDiv2, // EXCLK = 100 MHz (SDIO)
.enPclk0Div = ClkSysclkDiv1, // PCLK0 = 200 MHz (Timer6 (not used)) .enPclk0Div = ClkSysclkDiv2, // PCLK0 = 100 MHz (Timer6 (not used))
.enPclk1Div = ClkSysclkDiv4, // PCLK1 = 50 MHz (USART, SPI, I2S, Timer0 (step+temp), TimerA (Servo)) .enPclk1Div = ClkSysclkDiv4, // PCLK1 = 50 MHz (USART, SPI, I2S, Timer0 (step+temp), TimerA (Servo))
.enPclk2Div = ClkSysclkDiv4, // PCLK2 = 50 MHz (ADC) .enPclk2Div = ClkSysclkDiv8, // PCLK2 = 25 MHz (ADC)
.enPclk3Div = ClkSysclkDiv4, // PCLK3 = 50 MHz (I2C, WDT) .enPclk3Div = ClkSysclkDiv8, // PCLK3 = 25 MHz (I2C, WDT)
.enPclk4Div = ClkSysclkDiv2, // PCLK4 = 100 MHz (ADC ctl) .enPclk4Div = ClkSysclkDiv2, // PCLK4 = 100 MHz (ADC ctl)
}; };
#if ARDUINO_CORE_VERSION_INT >= GET_VERSION_INT(1, 2, 0)
assert_system_clocks_valid<
sysclock,
sysClkConf.enHclkDiv,
sysClkConf.enPclk0Div,
sysClkConf.enPclk1Div,
sysClkConf.enPclk2Div,
sysClkConf.enPclk3Div,
sysClkConf.enPclk4Div,
sysClkConf.enExclkDiv
>();
#endif
sysclock_set_clock_dividers(&sysClkConf); sysclock_set_clock_dividers(&sysClkConf);
// Set power mode // Set power mode
#define POWER_MODE_SYSTEM_CLOCK 200000000 // 200 MHz power_mode_update_pre(sysclock);
power_mode_update_pre(POWER_MODE_SYSTEM_CLOCK);
// Switch to MPLL as sysclk source // Switch to MPLL as sysclk source
CLK_SetSysClkSource(CLKSysSrcMPLL); CLK_SetSysClkSource(CLKSysSrcMPLL);
// Set power mode // Set power mode
power_mode_update_post(POWER_MODE_SYSTEM_CLOCK); power_mode_update_post(sysclock);
#undef POWER_MODE_SYSTEM_CLOCK
} }
#endif // ARDUINO_ARCH_HC32 #endif // ARDUINO_ARCH_HC32
+31 -27
View File
@@ -38,44 +38,48 @@ extern Timer0 step_timer;
// Timer Configurations // Timer Configurations
// //
// TODO: some calculations (step irq min_step_rate) require the timer rate to be known at compile time /**
// this is not possible with the HC32F460, as the timer rate depends on PCLK1 * HAL_TIMER_RATE must be known at compile time since it's used to calculate
// as a workaround, PCLK1 = 50MHz is assumed (check with clock dump in MarlinHAL::init()) * STEPPER_TIMER_RATE, which is used in 'constexpr' calculations.
#define HAL_TIMER_RATE 50000000 // 50MHz * On the HC32F460 the timer rate depends on PCLK1, which is derived from the
// #define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY * system clock configured at runtime. As a workaround, we use the existing
* assumption of a 200MHz clock, defining F_CPU as 200000000, then configure PCLK1
// TODO: CYCLES_PER_MICROSECOND seems to be used by Marlin to calculate the number of cycles per microsecond in the timer ISRs * as F_CPU with a divider of 4 in 'sysclock.cpp::core_hook_sysclock_init'.
// by default, it uses F_CPU, but since that is not known at compile time for HC32, we overwrite it here *
#undef CYCLES_PER_MICROSECOND * If you face issues with this assumption, please double-check with the values
#define CYCLES_PER_MICROSECOND (HAL_TIMER_RATE / 1000000UL) * printed by 'MarlinHAL::HAL_clock_frequencies_dump'.
*
* TODO: If the 'constexpr' requirement is ever lifted, use TIMER0_BASE_FREQUENCY instead
*/
#define HAL_TIMER_RATE (F_CPU / 4) // i.e., 50MHz
//#define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY
// Temperature timer // Temperature timer
#define TEMP_TIMER_NUM (&temp_timer) #define TEMP_TIMER_NUM (&temp_timer)
#define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02 #define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02
#define TEMP_TIMER_PRESCALE 16ul #define TEMP_TIMER_PRESCALE 16UL // 12.5MHz
#define TEMP_TIMER_RATE 1000 // 1kHz #define TEMP_TIMER_RATE 1000 // 1kHz
#define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // Alias for Marlin #define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // 1kHz also
// Stepper timer // Stepper timer
#define STEP_TIMER_NUM (&step_timer) #define STEP_TIMER_NUM (&step_timer)
#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_01 #define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_00 // Top priority, nothing else uses it
#define STEPPER_TIMER_PRESCALE 16ul #define STEPPER_TIMER_PRESCALE 16UL // 12.5MHz
// TODO: STEPPER_TIMER_RATE seems to work fine like this, but requires further testing... #define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz
#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz #define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000UL) // Integer 3
#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000)
// Pulse timer (== stepper timer) // Pulse timer (== stepper timer)
#define PULSE_TIMER_NUM STEP_TIMER_NUM #define PULSE_TIMER_NUM STEP_TIMER_NUM
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE #define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US #define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
// //
// Channel aliases // Channel aliases
// //
#define MF_TIMER_TEMP TEMP_TIMER_NUM #define MF_TIMER_TEMP TEMP_TIMER_NUM
#define MF_TIMER_STEP STEP_TIMER_NUM #define MF_TIMER_STEP STEP_TIMER_NUM
#define MF_TIMER_PULSE PULSE_TIMER_NUM #define MF_TIMER_PULSE PULSE_TIMER_NUM
// //
// HAL functions // HAL functions
+4 -1
View File
@@ -37,7 +37,10 @@ Timer::Timer() {
} }
Timer::~Timer() { Timer::~Timer() {
timer_delete(timerid); if (timerid != 0) {
timer_delete(timerid);
timerid = 0;
}
} }
void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) { void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) {
+2
View File
@@ -21,6 +21,7 @@
*/ */
#ifdef __PLAT_LINUX__ #ifdef __PLAT_LINUX__
#ifndef UNIT_TEST
//#define GPIO_LOGGING // Full GPIO and Positional Logging //#define GPIO_LOGGING // Full GPIO and Positional Logging
@@ -135,4 +136,5 @@ int main() {
read_serial.join(); read_serial.join();
} }
#endif // UNIT_TEST
#endif // __PLAT_LINUX__ #endif // __PLAT_LINUX__
+1 -1
View File
@@ -100,7 +100,7 @@ extern DefaultSerial1 USBSerial;
#else #else
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB." #error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#endif #endif
#if HAS_DGUS_LCD #if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.available() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.available()
#endif #endif
#endif #endif
+1 -1
View File
@@ -112,7 +112,7 @@
#else #else
#error "LCD_SERIAL_PORT must be from 1 to 9, or -1 for Native USB." #error "LCD_SERIAL_PORT must be from 1 to 9, or -1 for Native USB."
#endif #endif
#if HAS_DGUS_LCD #if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif #endif
#endif #endif
+4 -4
View File
@@ -126,7 +126,7 @@
void serialEvent2() __attribute__((weak)); void serialEvent2() __attribute__((weak));
#endif #endif
#ifdef USING_HW_SERIAL3 #ifdef USING_HW_SERIAL3
HAL_HardwareSerial Serial3(USART3); HAL_HardwareSerial HSerial3(USART3);
void serialEvent3() __attribute__((weak)); void serialEvent3() __attribute__((weak));
#endif #endif
#ifdef USING_HW_SERIAL4 #ifdef USING_HW_SERIAL4
@@ -147,11 +147,11 @@
#endif #endif
#ifdef USING_HW_SERIAL6 #ifdef USING_HW_SERIAL6
#ifdef USART6 #ifdef USART6
HAL_HardwareSerial HSerial5(USART6); HAL_HardwareSerial HSerial6(USART6);
#else #else
HAL_HardwareSerial HSerial5(UART6); HAL_HardwareSerial HSerial6(UART6);
#endif #endif
void serialEvent5() __attribute__((weak)); void serialEvent6() __attribute__((weak));
#endif #endif
// Constructors //////////////////////////////////////////////////////////////// // Constructors ////////////////////////////////////////////////////////////////
+1
View File
@@ -53,6 +53,7 @@
inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); } inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
void _rx_complete_irq(serial_t *obj); void _rx_complete_irq(serial_t *obj);
FORCE_INLINE static uint8_t buffer_overruns() { return 0; } // Not implemented. Void to avoid platform-dependent code.
protected: protected:
usart_rx_callback_t _rx_callback; usart_rx_callback_t _rx_callback;
+3 -2
View File
@@ -58,8 +58,9 @@
* Check for common serial pin conflicts * Check for common serial pin conflicts
*/ */
#define _CHECK_SERIAL_PIN(N) (( \ #define _CHECK_SERIAL_PIN(N) (( \
BTN_EN1 == N || DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \ BTN_EN1 == N || BTN_EN2 == N ||DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \
SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N \ SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N || \
Y_STEP_PIN == N || Y_ENABLE_PIN == N || E0_ENABLE_PIN == N || POWER_LOSS_PIN == N \
)) ))
#define CHECK_SERIAL_PIN(T,N) defined(UART##N##_##T##_PIN) && _CHECK_SERIAL_PIN(UART##N##_##T##_PIN) #define CHECK_SERIAL_PIN(T,N) defined(UART##N##_##T##_PIN) && _CHECK_SERIAL_PIN(UART##N##_##T##_PIN)
#if SERIAL_IN_USE(1) #if SERIAL_IN_USE(1)
+71 -65
View File
@@ -37,50 +37,61 @@ LCD_CONTROLLER_TypeDef *TFT_FSMC::LCD;
void TFT_FSMC::init() { void TFT_FSMC::init() {
uint32_t controllerAddress; uint32_t controllerAddress;
FSMC_NORSRAM_TimingTypeDef timing, extTiming; FMC_OR_FSMC(NORSRAM_TimingTypeDef) timing, extTiming;
uint32_t nsBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), pinMap_FSMC_CS); uint32_t nsBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), pinMap_FSMC_CS);
// Perform the SRAM1 memory initialization sequence // Perform the SRAM1 memory initialization sequence
SRAMx.Instance = FSMC_NORSRAM_DEVICE; SRAMx.Instance = FMC_OR_FSMC(NORSRAM_DEVICE);
SRAMx.Extended = FSMC_NORSRAM_EXTENDED_DEVICE; SRAMx.Extended = FMC_OR_FSMC(NORSRAM_EXTENDED_DEVICE);
// SRAMx.Init // SRAMx.Init
SRAMx.Init.NSBank = nsBank; SRAMx.Init.NSBank = nsBank;
SRAMx.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE; SRAMx.Init.DataAddressMux = FMC_OR_FSMC(DATA_ADDRESS_MUX_DISABLE);
SRAMx.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM; SRAMx.Init.MemoryType = FMC_OR_FSMC(MEMORY_TYPE_SRAM);
SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FSMC_8BIT, FSMC_NORSRAM_MEM_BUS_WIDTH_8, FSMC_NORSRAM_MEM_BUS_WIDTH_16); #ifdef STM32F446xx
SRAMx.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE; SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FMC_8BIT, FMC_NORSRAM_MEM_BUS_WIDTH_8, FMC_NORSRAM_MEM_BUS_WIDTH_16);
SRAMx.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW; #else
SRAMx.Init.WrapMode = FSMC_WRAP_MODE_DISABLE; SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FSMC_8BIT, FSMC_NORSRAM_MEM_BUS_WIDTH_8, FSMC_NORSRAM_MEM_BUS_WIDTH_16);
SRAMx.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS;
SRAMx.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE;
SRAMx.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE;
SRAMx.Init.ExtendedMode = FSMC_EXTENDED_MODE_ENABLE;
SRAMx.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE;
SRAMx.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE;
#ifdef STM32F4xx
SRAMx.Init.PageSize = FSMC_PAGE_SIZE_NONE;
#endif #endif
SRAMx.Init.BurstAccessMode = FMC_OR_FSMC(BURST_ACCESS_MODE_DISABLE);
SRAMx.Init.WaitSignalPolarity = FMC_OR_FSMC(WAIT_SIGNAL_POLARITY_LOW);
SRAMx.Init.WrapMode = FMC_OR_FSMC(WRAP_MODE_DISABLE);
SRAMx.Init.WaitSignalActive = FMC_OR_FSMC(WAIT_TIMING_BEFORE_WS);
SRAMx.Init.WriteOperation = FMC_OR_FSMC(WRITE_OPERATION_ENABLE);
SRAMx.Init.WaitSignal = FMC_OR_FSMC(WAIT_SIGNAL_DISABLE);
SRAMx.Init.ExtendedMode = FMC_OR_FSMC(EXTENDED_MODE_ENABLE);
SRAMx.Init.AsynchronousWait = FMC_OR_FSMC(ASYNCHRONOUS_WAIT_DISABLE);
SRAMx.Init.WriteBurst = FMC_OR_FSMC(WRITE_BURST_DISABLE);
#if defined(STM32F446xx) || defined(STM32F4xx)
SRAMx.Init.PageSize = FMC_OR_FSMC(PAGE_SIZE_NONE);
#endif
// Read Timing - relatively slow to ensure ID information is correctly read from TFT controller // Read Timing - relatively slow to ensure ID information is correctly read from TFT controller
// Can be decreases from 15-15-24 to 4-4-8 with risk of stability loss // Can be decreased from 15-15-24 to 4-4-8 with risk of stability loss
timing.AddressSetupTime = 15; timing.AddressSetupTime = 15;
timing.AddressHoldTime = 15; timing.AddressHoldTime = 15;
timing.DataSetupTime = 24; timing.DataSetupTime = 24;
timing.BusTurnAroundDuration = 0; timing.BusTurnAroundDuration = 0;
timing.CLKDivision = 16; timing.CLKDivision = 16;
timing.DataLatency = 17; timing.DataLatency = 17;
timing.AccessMode = FSMC_ACCESS_MODE_A; timing.AccessMode = FMC_OR_FSMC(ACCESS_MODE_A);
// Write Timing // Write Timing
// Can be decreased from 8-15-8 to 0-0-1 with risk of stability loss // Can be decreased from 8-15-8 to 0-0-1 with risk of stability loss
extTiming.AddressSetupTime = 8; extTiming.AddressSetupTime = 8;
extTiming.AddressHoldTime = 15; extTiming.AddressHoldTime = 15;
extTiming.DataSetupTime = 8; extTiming.DataSetupTime = 8;
extTiming.BusTurnAroundDuration = 0; extTiming.BusTurnAroundDuration = 0;
extTiming.CLKDivision = 16; extTiming.CLKDivision = 16;
extTiming.DataLatency = 17; extTiming.DataLatency = 17;
extTiming.AccessMode = FSMC_ACCESS_MODE_A; extTiming.AccessMode = FMC_OR_FSMC(ACCESS_MODE_A);
__HAL_RCC_FSMC_CLK_ENABLE(); #ifdef STM32F446xx
__HAL_RCC_FMC_CLK_ENABLE();
#else
__HAL_RCC_FSMC_CLK_ENABLE();
#endif
for (uint16_t i = 0; pinMap_FSMC[i].pin != NC; i++) for (uint16_t i = 0; pinMap_FSMC[i].pin != NC; i++)
pinmap_pinout(pinMap_FSMC[i].pin, pinMap_FSMC); pinmap_pinout(pinMap_FSMC[i].pin, pinMap_FSMC);
@@ -90,9 +101,9 @@ void TFT_FSMC::init() {
controllerAddress = FSMC_BANK1_1; controllerAddress = FSMC_BANK1_1;
#ifdef PF0 #ifdef PF0
switch (nsBank) { switch (nsBank) {
case FSMC_NORSRAM_BANK2: controllerAddress = FSMC_BANK1_2 ; break; case FMC_OR_FSMC(NORSRAM_BANK2): controllerAddress = FSMC_BANK1_2; break;
case FSMC_NORSRAM_BANK3: controllerAddress = FSMC_BANK1_3 ; break; case FMC_OR_FSMC(NORSRAM_BANK3): controllerAddress = FSMC_BANK1_3; break;
case FSMC_NORSRAM_BANK4: controllerAddress = FSMC_BANK1_4 ; break; case FMC_OR_FSMC(NORSRAM_BANK4): controllerAddress = FSMC_BANK1_4; break;
} }
#endif #endif
@@ -100,49 +111,44 @@ void TFT_FSMC::init() {
HAL_SRAM_Init(&SRAMx, &timing, &extTiming); HAL_SRAM_Init(&SRAMx, &timing, &extTiming);
__HAL_RCC_DMA2_CLK_ENABLE();
#ifdef STM32F1xx #ifdef STM32F1xx
__HAL_RCC_DMA1_CLK_ENABLE(); DMAtx.Instance = DMA2_Channel1;
DMAtx.Instance = DMA1_Channel1;
#elif defined(STM32F4xx) #elif defined(STM32F4xx)
__HAL_RCC_DMA2_CLK_ENABLE(); DMAtx.Instance = DMA2_Stream0;
DMAtx.Instance = DMA2_Stream0; DMAtx.Init.Channel = DMA_CHANNEL_0;
DMAtx.Init.Channel = DMA_CHANNEL_0; DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE;
DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; DMAtx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
DMAtx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; DMAtx.Init.MemBurst = DMA_MBURST_SINGLE;
DMAtx.Init.MemBurst = DMA_MBURST_SINGLE; DMAtx.Init.PeriphBurst = DMA_PBURST_SINGLE;
DMAtx.Init.PeriphBurst = DMA_PBURST_SINGLE;
#endif #endif
DMAtx.Init.Direction = DMA_MEMORY_TO_MEMORY; DMAtx.Init.Direction = DMA_MEMORY_TO_MEMORY;
DMAtx.Init.MemInc = DMA_MINC_DISABLE; DMAtx.Init.MemInc = DMA_MINC_DISABLE;
DMAtx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; DMAtx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
DMAtx.Init.Mode = DMA_NORMAL; DMAtx.Init.Mode = DMA_NORMAL;
DMAtx.Init.Priority = DMA_PRIORITY_HIGH; DMAtx.Init.Priority = DMA_PRIORITY_HIGH;
LCD = (LCD_CONTROLLER_TypeDef *)controllerAddress; LCD = (LCD_CONTROLLER_TypeDef *)controllerAddress;
} }
uint32_t TFT_FSMC::getID() { uint32_t TFT_FSMC::getID() {
uint32_t id;
writeReg(0); writeReg(0);
id = LCD->RAM; uint32_t id = LCD->RAM;
if (id == 0) id = readID(LCD_READ_ID);
if (id == 0) if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) id = readID(LCD_READ_ID4);
id = readID(LCD_READ_ID);
if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF)
id = readID(LCD_READ_ID4);
return id; return id;
} }
uint32_t TFT_FSMC::readID(const tft_data_t inReg) { uint32_t TFT_FSMC::readID(tft_data_t inReg) {
uint32_t id;
writeReg(inReg); writeReg(inReg);
id = LCD->RAM; // dummy read uint32_t id = LCD->RAM; // dummy read
id = inReg << 24; id = inReg << 24;
id |= (LCD->RAM & 0x00FF) << 16; id |= (LCD->RAM & 0x00FF) << 16;
id |= (LCD->RAM & 0x00FF) << 8; id |= (LCD->RAM & 0x00FF) << 8;
id |= LCD->RAM & 0x00FF; id |= (LCD->RAM & 0x00FF);
return id; return id;
} }
@@ -155,7 +161,9 @@ bool TFT_FSMC::isBusy() {
#define __IS_DMA_CONFIGURED(__HANDLE__) ((__HANDLE__)->Instance->PAR != 0) #define __IS_DMA_CONFIGURED(__HANDLE__) ((__HANDLE__)->Instance->PAR != 0)
#endif #endif
if (!__IS_DMA_CONFIGURED(&DMAtx)) return false; #ifdef __IS_DMA_CONFIGURED
if (!__IS_DMA_CONFIGURED(&DMAtx)) return false;
#endif
// Check if DMA transfer error or transfer complete flags are set // Check if DMA transfer error or transfer complete flags are set
if ((__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) == 0) && (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) == 0)) return true; if ((__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) == 0) && (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) == 0)) return true;
@@ -174,8 +182,6 @@ void TFT_FSMC::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t cou
DMAtx.Init.PeriphInc = memoryIncrease; DMAtx.Init.PeriphInc = memoryIncrease;
HAL_DMA_Init(&DMAtx); HAL_DMA_Init(&DMAtx);
HAL_DMA_Start(&DMAtx, (uint32_t)data, (uint32_t)&(LCD->RAM), count); HAL_DMA_Start(&DMAtx, (uint32_t)data, (uint32_t)&(LCD->RAM), count);
TERN_(TFT_SHARED_IO, while (isBusy()));
} }
void TFT_FSMC::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) { void TFT_FSMC::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) {
+35 -29
View File
@@ -28,11 +28,7 @@
#elif defined(STM32F4xx) #elif defined(STM32F4xx)
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"
#else #else
#error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware." #error "FSMC/FMC TFT is currently only supported on STM32F1 and STM32F4 hardware."
#endif
#ifndef HAL_SRAM_MODULE_ENABLED
#error "SRAM module disabled for the STM32 framework (HAL_SRAM_MODULE_ENABLED)! Please consult the development team."
#endif #endif
#ifndef LCD_READ_ID #ifndef LCD_READ_ID
@@ -55,6 +51,12 @@ typedef struct {
__IO tft_data_t RAM; __IO tft_data_t RAM;
} LCD_CONTROLLER_TypeDef; } LCD_CONTROLLER_TypeDef;
#ifdef STM32F446xx
#define FMC_OR_FSMC(N) _CAT(FMC_, N)
#else
#define FMC_OR_FSMC(N) _CAT(FSMC_, N)
#endif
class TFT_FSMC { class TFT_FSMC {
private: private:
static SRAM_HandleTypeDef SRAMx; static SRAM_HandleTypeDef SRAMx;
@@ -62,7 +64,7 @@ class TFT_FSMC {
static LCD_CONTROLLER_TypeDef *LCD; static LCD_CONTROLLER_TypeDef *LCD;
static uint32_t readID(const tft_data_t reg); static uint32_t readID(tft_data_t inReg);
static void transmit(tft_data_t data) { LCD->RAM = data; __DSB(); } static void transmit(tft_data_t data) { LCD->RAM = data; __DSB(); }
static void transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count); static void transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count);
static void transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t count); static void transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t count);
@@ -94,7 +96,11 @@ class TFT_FSMC {
#ifdef STM32F1xx #ifdef STM32F1xx
#define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE) #define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE)
#elif defined(STM32F4xx) #elif defined(STM32F4xx)
#define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FSMC) #ifdef STM32F446xx
#define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FMC)
#else
#define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FSMC)
#endif
#define FSMC_BANK1_1 0x60000000U #define FSMC_BANK1_1 0x60000000U
#define FSMC_BANK1_2 0x64000000U #define FSMC_BANK1_2 0x64000000U
#define FSMC_BANK1_3 0x68000000U #define FSMC_BANK1_3 0x68000000U
@@ -104,35 +110,35 @@ class TFT_FSMC {
#endif #endif
const PinMap pinMap_FSMC[] = { const PinMap pinMap_FSMC[] = {
{PD_14, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D00 {PD_14, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D00
{PD_15, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D01 {PD_15, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D01
{PD_0, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D02 {PD_0, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D02
{PD_1, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D03 {PD_1, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D03
{PE_7, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D04 {PE_7, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D04
{PE_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D05 {PE_8, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D05
{PE_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D06 {PE_9, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D06
{PE_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D07 {PE_10, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D07
#if DISABLED(TFT_INTERFACE_FSMC_8BIT) #if DISABLED(TFT_INTERFACE_FSMC_8BIT)
{PE_11, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D08 {PE_11, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D08
{PE_12, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D09 {PE_12, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D09
{PE_13, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D10 {PE_13, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D10
{PE_14, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D11 {PE_14, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D11
{PE_15, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D12 {PE_15, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D12
{PD_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D13 {PD_8, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D13
{PD_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D14 {PD_9, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D14
{PD_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D15 {PD_10, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D15
#endif #endif
{PD_4, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_NOE {PD_4, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_NOE
{PD_5, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_NWE {PD_5, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_NWE
{NC, NP, 0} {NC, NP, 0}
}; };
const PinMap pinMap_FSMC_CS[] = { const PinMap pinMap_FSMC_CS[] = {
{PD_7, (void *)FSMC_NORSRAM_BANK1, FSMC_PIN_DATA}, // FSMC_NE1 {PD_7, (void *)FMC_OR_FSMC(NORSRAM_BANK1), FSMC_PIN_DATA}, // FSMC_NE1
#ifdef PF0 #ifdef PF0
{PG_9, (void *)FSMC_NORSRAM_BANK2, FSMC_PIN_DATA}, // FSMC_NE2 {PG_9, (void *)FMC_OR_FSMC(NORSRAM_BANK2), FSMC_PIN_DATA}, // FSMC_NE2
{PG_10, (void *)FSMC_NORSRAM_BANK3, FSMC_PIN_DATA}, // FSMC_NE3 {PG_10, (void *)FMC_OR_FSMC(NORSRAM_BANK3), FSMC_PIN_DATA}, // FSMC_NE3
{PG_12, (void *)FSMC_NORSRAM_BANK4, FSMC_PIN_DATA}, // FSMC_NE4 {PG_12, (void *)FMC_OR_FSMC(NORSRAM_BANK4), FSMC_PIN_DATA}, // FSMC_NE4
#endif #endif
{NC, NP, 0} {NC, NP, 0}
}; };
+1 -1
View File
@@ -138,7 +138,7 @@
#define LCD_SERIAL MSERIAL(1) // dummy port #define LCD_SERIAL MSERIAL(1) // dummy port
static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.") static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.")
#endif #endif
#if HAS_DGUS_LCD #if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif #endif
#endif #endif
+17 -8
View File
@@ -77,8 +77,6 @@
#include "lcd/e3v2/common/encoder.h" #include "lcd/e3v2/common/encoder.h"
#if ENABLED(DWIN_CREALITY_LCD) #if ENABLED(DWIN_CREALITY_LCD)
#include "lcd/e3v2/creality/dwin.h" #include "lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "lcd/e3v2/proui/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "lcd/e3v2/jyersui/dwin.h" #include "lcd/e3v2/jyersui/dwin.h"
#endif #endif
@@ -268,7 +266,7 @@ PGMSTR(M112_KILL_STR, "M112 Shutdown");
MarlinState marlin_state = MF_INITIALIZING; MarlinState marlin_state = MF_INITIALIZING;
// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop // For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
bool wait_for_heatup = true; bool wait_for_heatup = false;
// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
#if HAS_RESUME_CONTINUE #if HAS_RESUME_CONTINUE
@@ -476,11 +474,16 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
#if HAS_KILL #if HAS_KILL
// Check if the kill button was pressed and wait just in case it was an accidental // Check if the kill button was pressed and wait to ensure the signal is not noise
// key kill key press // typically caused by poor insulation and grounding on LCD cables.
// Lower numbers here will increase response time and therefore safety rating.
// It is recommended to set this as low as possibe without false triggers.
// ------------------------------------------------------------------------------- // -------------------------------------------------------------------------------
#ifndef KILL_DELAY
#define KILL_DELAY 250
#endif
static int killCount = 0; // make the inactivity button a bit less responsive static int killCount = 0; // make the inactivity button a bit less responsive
const int KILL_DELAY = 750;
if (kill_state()) if (kill_state())
killCount++; killCount++;
else if (killCount > 0) else if (killCount > 0)
@@ -671,6 +674,12 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check()); TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check());
#if ANY(PSU_CONTROL, AUTO_POWER_CONTROL) && PIN_EXISTS(PS_ON_EDM)
if ( ELAPSED(ms, powerManager.last_state_change_ms + PS_EDM_RESPONSE)
&& (READ(PS_ON_PIN) != READ(PS_ON_EDM_PIN) || TERN0(PSU_OFF_REDUNDANT, extDigitalRead(PS_ON1_PIN) != extDigitalRead(PS_ON1_EDM_PIN)))
) kill(GET_TEXT_F(MSG_POWER_EDM_FAULT));
#endif
#if ENABLED(EXTRUDER_RUNOUT_PREVENT) #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
if (thermalManager.degHotend(active_extruder) > (EXTRUDER_RUNOUT_MINTEMP) if (thermalManager.degHotend(active_extruder) > (EXTRUDER_RUNOUT_MINTEMP)
&& ELAPSED(ms, gcode.previous_move_ms + SEC_TO_MS(EXTRUDER_RUNOUT_SECONDS)) && ELAPSED(ms, gcode.previous_move_ms + SEC_TO_MS(EXTRUDER_RUNOUT_SECONDS))
@@ -1588,11 +1597,11 @@ void setup() {
SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n"); SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n");
#endif #endif
#if HAS_DWIN_E3V2_BASIC #if ENABLED(DWIN_CREALITY_LCD)
SETUP_RUN(dwinInitScreen()); SETUP_RUN(dwinInitScreen());
#endif #endif
#if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)
SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status
#endif #endif
+10 -4
View File
@@ -131,6 +131,7 @@
#define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3 #define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3
#define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1) #define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1)
#define BOARD_KODAMA_BARDO 1166 // Kodama Bardo V1.x (as found in the Kodama Trinus) #define BOARD_KODAMA_BARDO 1166 // Kodama Bardo V1.x (as found in the Kodama Trinus)
#define BOARD_DAGOMA_D6 1167 // Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
// //
// RAMBo and derivatives // RAMBo and derivatives
@@ -382,9 +383,9 @@
#define BOARD_CREALITY_V452 5050 // Creality v4.5.2 (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_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_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 5053 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) CR-FDM-v2.4.S1_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_V24S1_301 5054 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) CR-FDM-v24S1_301 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_CREALITY_V25S1 5055 // Creality v2.5.S1 (STM32F103RE) CR-FDM-v2.5.S1_100 as found in the CR-10 Smart Pro
#define BOARD_TRIGORILLA_PRO 5056 // Trigorilla Pro (STM32F103ZE) #define BOARD_TRIGORILLA_PRO 5056 // Trigorilla Pro (STM32F103ZE)
#define BOARD_FLY_MINI 5057 // FLYmaker FLY MINI (STM32F103RC) #define BOARD_FLY_MINI 5057 // FLYmaker FLY MINI (STM32F103RC)
#define BOARD_FLSUN_HISPEED 5058 // FLSUN HiSpeedV1 (STM32F103VE) #define BOARD_FLSUN_HISPEED 5058 // FLSUN HiSpeedV1 (STM32F103VE)
@@ -459,7 +460,7 @@
#define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG) #define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG) #define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE) #define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 5245 // TRONXY V10 (STM32F446ZE) #define BOARD_TRONXY_CXY_446_V10 5245 // TRONXY CXY-446-V10-220413/CXY-V6-191121 (STM32F446ZE)
#define BOARD_CREALITY_F401RE 5246 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1 #define BOARD_CREALITY_F401RE 5246 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
#define BOARD_BLACKPILL_CUSTOM 5247 // Custom board based on STM32F401CDU6. #define BOARD_BLACKPILL_CUSTOM 5247 // Custom board based on STM32F401CDU6.
#define BOARD_I3DBEEZ9_V1 5248 // I3DBEEZ9 V1 (STM32F407ZG) #define BOARD_I3DBEEZ9_V1 5248 // I3DBEEZ9 V1 (STM32F407ZG)
@@ -467,6 +468,11 @@
#define BOARD_FYSETC_CHEETAH_V30 5250 // FYSETC Cheetah V3.0 (STM32F446RC) #define BOARD_FYSETC_CHEETAH_V30 5250 // FYSETC Cheetah V3.0 (STM32F446RC)
#define BOARD_BLACKBEEZMINI_V1 5251 // BlackBeezMini V1 (STM32F401CCU6) #define BOARD_BLACKBEEZMINI_V1 5251 // BlackBeezMini V1 (STM32F401CCU6)
//
// Other ARM Cortex-M4
//
#define BOARD_CREALITY_CR4NS 5300 // Creality CR4NS200320C13 (GD32F303RET6) as found in the Ender-3 V3 SE
// //
// ARM Cortex-M7 // ARM Cortex-M7
// //
+9 -13
View File
@@ -41,8 +41,6 @@
#define _TMC2208_STANDALONE 0x2208B #define _TMC2208_STANDALONE 0x2208B
#define _TMC2209 0x2209A #define _TMC2209 0x2209A
#define _TMC2209_STANDALONE 0x2209B #define _TMC2209_STANDALONE 0x2209B
#define _TMC26X 0x2600A
#define _TMC26X_STANDALONE 0x2600B
#define _TMC2660 0x2660A #define _TMC2660 0x2660A
#define _TMC2660_STANDALONE 0x2660B #define _TMC2660_STANDALONE 0x2660B
#define _TMC5130 0x5130A #define _TMC5130 0x5130A
@@ -107,8 +105,8 @@
#if ( HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2160_STANDALONE) \ #if ( HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2160_STANDALONE) \
|| HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC2209_STANDALONE) \ || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC2209_STANDALONE) \
|| HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \ || HAS_DRIVER(TMC2660_STANDALONE) || HAS_DRIVER(TMC5130_STANDALONE) \
|| HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) ) || HAS_DRIVER(TMC5160_STANDALONE) )
#define HAS_TRINAMIC_STANDALONE 1 #define HAS_TRINAMIC_STANDALONE 1
#endif #endif
@@ -125,13 +123,13 @@
|| AXIS_DRIVER_TYPE(A,TMC2660) \ || AXIS_DRIVER_TYPE(A,TMC2660) \
|| AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) ) || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) )
#define AXIS_IS_TMC_CONFIG(A) ( AXIS_IS_TMC(A) || AXIS_DRIVER_TYPE(A,TMC26X) ) #define AXIS_IS_TMC_CONFIG AXIS_IS_TMC
// Test for a driver that uses SPI - this allows checking whether a _CS_ pin // Test for a driver that uses SPI - this allows checking whether a _CS_ pin
// is considered sensitive // is considered sensitive
#define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \ #define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \
|| AXIS_DRIVER_TYPE(A,TMC26X) || AXIS_DRIVER_TYPE(A,TMC2660) \ || AXIS_DRIVER_TYPE(A,TMC2660) || AXIS_DRIVER_TYPE(A,TMC5130) \
|| AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) ) || AXIS_DRIVER_TYPE(A,TMC5160) )
#define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) ) #define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) )
@@ -184,10 +182,8 @@
#if ANY_AXIS_HAS(SPI) #if ANY_AXIS_HAS(SPI)
#define HAS_TMC_SPI 1 #define HAS_TMC_SPI 1
#endif #endif
#if HAS_STALLGUARD || HAS_DRIVER(TMC2160_STANDALONE) || HAS_DRIVER(TMC2130_STANDALONE) \
// || HAS_DRIVER(TMC2209_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \
// TMC26XX Stepper Drivers || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE)
// #define HAS_DIAG_PINS 1
#if HAS_DRIVER(TMC26X)
#define HAS_TMC26X 1
#endif #endif
+1
View File
@@ -135,6 +135,7 @@
#define STR_BUSY_PAUSED_FOR_USER "busy: paused for user" #define STR_BUSY_PAUSED_FOR_USER "busy: paused for user"
#define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input" #define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
#define STR_Z_MOVE_COMP "Z_move_comp" #define STR_Z_MOVE_COMP "Z_move_comp"
#define STR_LINE_NO "Line: "
#define STR_RESEND "Resend: " #define STR_RESEND "Resend: "
#define STR_UNKNOWN_COMMAND "Unknown command: \"" #define STR_UNKNOWN_COMMAND "Unknown command: \""
#define STR_ACTIVE_EXTRUDER "Active Extruder: " #define STR_ACTIVE_EXTRUDER "Active Extruder: "
+5 -4
View File
@@ -89,7 +89,8 @@
#define HYPOT2(x,y) (sq(x)+sq(y)) #define HYPOT2(x,y) (sq(x)+sq(y))
#define NORMSQ(x,y,z) (sq(x)+sq(y)+sq(z)) #define NORMSQ(x,y,z) (sq(x)+sq(y)+sq(z))
#define CIRCLE_AREA(R) (float(M_PI) * sq(float(R))) #define FLOAT_SQ(I) sq(float(I))
#define CIRCLE_AREA(R) (float(M_PI) * FLOAT_SQ(R))
#define CIRCLE_CIRC(R) (2 * float(M_PI) * float(R)) #define CIRCLE_CIRC(R) (2 * float(M_PI) * float(R))
#define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);}) #define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);})
@@ -196,8 +197,8 @@
#define ENABLED(V...) DO(ENA,&&,V) #define ENABLED(V...) DO(ENA,&&,V)
#define DISABLED(V...) DO(DIS,&&,V) #define DISABLED(V...) DO(DIS,&&,V)
#define ANY(V...) !DISABLED(V) #define ANY(V...) !DISABLED(V)
#define ALL ENABLED #define ALL(V...) ENABLED(V)
#define NONE DISABLED #define NONE(V...) DISABLED(V)
#define COUNT_ENABLED(V...) DO(ENA,+,V) #define COUNT_ENABLED(V...) DO(ENA,+,V)
#define MANY(V...) (COUNT_ENABLED(V) > 1) #define MANY(V...) (COUNT_ENABLED(V) > 1)
@@ -629,7 +630,7 @@
#define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()() #define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()()
// Force define expansion // Force define expansion
#define EVAL EVAL16 #define EVAL(V...) EVAL16(V)
#define EVAL4096(V...) EVAL2048(EVAL2048(V)) #define EVAL4096(V...) EVAL2048(EVAL2048(V))
#define EVAL2048(V...) EVAL1024(EVAL1024(V)) #define EVAL2048(V...) EVAL1024(EVAL1024(V))
#define EVAL1024(V...) EVAL512(EVAL512(V)) #define EVAL1024(V...) EVAL512(EVAL512(V))
+5 -5
View File
@@ -143,13 +143,13 @@ public:
// Set with format string and arguments, like printf // Set with format string and arguments, like printf
template<typename... Args> template<typename... Args>
MString& setf_P(PGM_P const fmt, Args... more) { SNPRINTF_P(str, SIZE, fmt, more...); debug(F("setf_P")); return *this; } MString& setf_P(PGM_P const pfmt, Args... more) { SNPRINTF_P(str, SIZE, pfmt, more...); debug(F("setf_P")); return *this; }
template<typename... Args> template<typename... Args>
MString& setf(const char *fmt, Args... more) { SNPRINTF(str, SIZE, fmt, more...); debug(F("setf")); return *this; } MString& setf(const char *fmt, Args... more) { SNPRINTF(str, SIZE, fmt, more...); debug(F("setf")); return *this; }
template<typename... Args> template<typename... Args>
MString& setf(FSTR_P const fmt, Args... more) { return setf_P(FTOP(fmt), more...); } MString& setf(FSTR_P const ffmt, Args... more) { return setf_P(FTOP(ffmt), more...); }
// Chainable String appenders // Chainable String appenders
MString& append() { debug(F("nil")); return *this; } // for macros that might emit no output MString& append() { debug(F("nil")); return *this; } // for macros that might emit no output
@@ -206,9 +206,9 @@ public:
MString& append(const spaces_t &s) { return append(repchr_t(' ', s.count)); } MString& append(const spaces_t &s) { return append(repchr_t(' ', s.count)); }
template<typename... Args> template<typename... Args>
MString& appendf_P(PGM_P const fmt, Args... more) { MString& appendf_P(PGM_P const pfmt, Args... more) {
int sz = length(); int sz = length();
if (sz < SIZE) SNPRINTF_P(str + sz, SIZE - sz, fmt, more...); if (sz < SIZE) SNPRINTF_P(str + sz, SIZE - sz, pfmt, more...);
debug(F("appendf_P")); debug(F("appendf_P"));
return *this; return *this;
} }
+3 -3
View File
@@ -271,13 +271,13 @@ public:
SString& set() { super::set(); return *this; } SString& set() { super::set(); return *this; }
template<typename... Args> template<typename... Args>
SString& setf_P(PGM_P const fmt, Args... more) { super::setf_P(fmt, more...); return *this; } SString& setf_P(PGM_P const pfmt, Args... more) { super::setf_P(pfmt, more...); return *this; }
template<typename... Args> template<typename... Args>
SString& setf(const char *fmt, Args... more) { super::setf(fmt, more...); return *this; } SString& setf(const char *fmt, Args... more) { super::setf(fmt, more...); return *this; }
template<typename... Args> template<typename... Args>
SString& setf(FSTR_P const fmt, Args... more) { super::setf(fmt, more...); return *this; } SString& setf(FSTR_P const ffmt, Args... more) { super::setf(ffmt, more...); return *this; }
template <typename T> template <typename T>
SString& set(const T &v) { super::set(v); return *this; } SString& set(const T &v) { super::set(v); return *this; }
+15 -7
View File
@@ -46,6 +46,7 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
#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_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_DECL(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 NUM_AXIS_DECL(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) #define MAIN_AXIS_NAMES NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W)
#define MAIN_AXIS_NAMES_LC NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)
#define STR_AXES_MAIN NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W) #define STR_AXES_MAIN NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
#define LOGICAL_AXIS_GANG(E,V...) NUM_AXIS_GANG(V) GANG_ITEM_E(E) #define LOGICAL_AXIS_GANG(E,V...) NUM_AXIS_GANG(V) GANG_ITEM_E(E)
@@ -58,17 +59,21 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
#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_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_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) #define LOGICAL_AXIS_NAMES LOGICAL_AXIS_LIST(E, X, Y, Z, I, J, K, U, V, W)
#define LOGICAL_AXIS_NAMES_LC LOGICAL_AXIS_LIST(e, x, y, z, i, j, k, u, v, w)
#define LOGICAL_AXIS_MAP(F) MAP(F, LOGICAL_AXIS_NAMES) #define LOGICAL_AXIS_MAP(F) MAP(F, LOGICAL_AXIS_NAMES)
#define LOGICAL_AXIS_MAP_LC(F) MAP(F, LOGICAL_AXIS_NAMES_LC)
#define STR_AXES_LOGICAL LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W) #define STR_AXES_LOGICAL LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
#if NUM_AXES #if NUM_AXES
#define NUM_AXES_SEP , #define NUM_AXES_SEP ,
#define MAIN_AXIS_MAP(F) MAP(F, MAIN_AXIS_NAMES) #define MAIN_AXIS_MAP(F) MAP(F, MAIN_AXIS_NAMES)
#define MAIN_AXIS_MAP_LC(F) MAP(F, MAIN_AXIS_NAMES_LC)
#define OPTARGS_NUM(T) , NUM_AXIS_ARGS(T) #define OPTARGS_NUM(T) , NUM_AXIS_ARGS(T)
#define OPTARGS_LOGICAL(T) , LOGICAL_AXIS_ARGS(T) #define OPTARGS_LOGICAL(T) , LOGICAL_AXIS_ARGS(T)
#else #else
#define NUM_AXES_SEP #define NUM_AXES_SEP
#define MAIN_AXIS_MAP(F) #define MAIN_AXIS_MAP(F)
#define MAIN_AXIS_MAP_LC(F)
#define OPTARGS_NUM(T) #define OPTARGS_NUM(T)
#define OPTARGS_LOGICAL(T) #define OPTARGS_LOGICAL(T)
#endif #endif
@@ -79,6 +84,7 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
#define NUM_AXIS_ARGS_(T) NUM_AXIS_ARGS(T) NUM_AXES_SEP #define NUM_AXIS_ARGS_(T) NUM_AXIS_ARGS(T) NUM_AXES_SEP
#define NUM_AXIS_ELEM_(T) NUM_AXIS_ELEM(T) NUM_AXES_SEP #define NUM_AXIS_ELEM_(T) NUM_AXIS_ELEM(T) NUM_AXES_SEP
#define MAIN_AXIS_NAMES_ MAIN_AXIS_NAMES NUM_AXES_SEP #define MAIN_AXIS_NAMES_ MAIN_AXIS_NAMES NUM_AXES_SEP
#define MAIN_AXIS_NAMES_LC_ MAIN_AXIS_NAMES_LC NUM_AXES_SEP
#if LOGICAL_AXES #if LOGICAL_AXES
#define LOGICAL_AXES_SEP , #define LOGICAL_AXES_SEP ,
@@ -92,6 +98,7 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
#define LOGICAL_AXIS_ARGS_(T) LOGICAL_AXIS_ARGS(T) LOGICAL_AXES_SEP #define LOGICAL_AXIS_ARGS_(T) LOGICAL_AXIS_ARGS(T) LOGICAL_AXES_SEP
#define LOGICAL_AXIS_ELEM_(T) LOGICAL_AXIS_ELEM(T) LOGICAL_AXES_SEP #define LOGICAL_AXIS_ELEM_(T) LOGICAL_AXIS_ELEM(T) LOGICAL_AXES_SEP
#define LOGICAL_AXIS_NAMES_ LOGICAL_AXIS_NAMES LOGICAL_AXES_SEP #define LOGICAL_AXIS_NAMES_ LOGICAL_AXIS_NAMES LOGICAL_AXES_SEP
#define LOGICAL_AXIS_NAMES_LC_ LOGICAL_AXIS_NAMES_LC LOGICAL_AXES_SEP
#define SECONDARY_AXIS_GANG(V...) GANG_N(SECONDARY_AXES, V) #define SECONDARY_AXIS_GANG(V...) GANG_N(SECONDARY_AXES, V)
#define SECONDARY_AXIS_CODE(V...) CODE_N(SECONDARY_AXES, V) #define SECONDARY_AXIS_CODE(V...) CODE_N(SECONDARY_AXES, V)
@@ -159,7 +166,7 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
// General Flags for some number of states // General Flags for some number of states
template<size_t N> template<size_t N>
struct Flags { struct Flags {
typedef uvalue_t(N) flagbits_t; typedef bits_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; } 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; } 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, 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,
@@ -219,7 +226,7 @@ typedef struct {
// //
// - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space // - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space
// - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians // - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians
// - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics // - X_HEAD, Y_HEAD, and Z_HEAD should be used for axes on Core kinematics
// //
enum AxisEnum : uint8_t { enum AxisEnum : uint8_t {
@@ -449,7 +456,7 @@ struct XYval {
// Length reduced to one dimension // Length reduced to one dimension
FI constexpr T magnitude() const { return (T)sqrtf(x*x + y*y); } FI constexpr T magnitude() const { return (T)sqrtf(x*x + y*y); }
// Pointer to the data as a simple array // Pointer to the data as a simple array
FI operator T* () { return pos; } explicit FI operator T* () { return pos; }
// If any element is true then it's true // If any element is true then it's true
FI constexpr operator bool() const { return x || y; } FI constexpr operator bool() const { return x || y; }
// Smallest element // Smallest element
@@ -599,13 +606,13 @@ struct XYZval {
// Length reduced to one dimension // Length reduced to one dimension
FI constexpr T magnitude() const { return (T)TERN(HAS_X_AXIS, sqrtf(NUM_AXIS_GANG(x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)), 0); } FI constexpr T magnitude() const { return (T)TERN(HAS_X_AXIS, sqrtf(NUM_AXIS_GANG(x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)), 0); }
// Pointer to the data as a simple array // Pointer to the data as a simple array
FI operator T* () { return pos; } explicit FI operator T* () { return pos; }
// If any element is true then it's true // If any element is true then it's true
FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); } FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element // Smallest element
FI constexpr T small() const { return TERN(HAS_X_AXIS, _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)), 0); } FI constexpr T small() const { return TERN0(HAS_X_AXIS, _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w))); }
// Largest element // Largest element
FI constexpr T large() const { return TERN(HAS_X_AXIS, _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)), 0); } FI constexpr T large() const { return TERN0(HAS_X_AXIS, _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w))); }
// Explicit copy and copies with conversion // Explicit copy and copies with conversion
FI constexpr XYZval<T> copy() const { XYZval<T> o = *this; return o; } FI constexpr XYZval<T> copy() const { XYZval<T> o = *this; return o; }
@@ -747,7 +754,7 @@ struct XYZEval {
// Length reduced to one dimension // Length reduced to one dimension
FI constexpr T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); } FI constexpr T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); }
// Pointer to the data as a simple array // Pointer to the data as a simple array
FI operator T* () { return pos; } explicit FI operator T* () { return pos; }
// If any element is true then it's true // If any element is true then it's true
FI constexpr operator bool() const { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); } FI constexpr operator bool() const { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element // Smallest element
@@ -1084,6 +1091,7 @@ public:
FI bool toggle(const AxisEnum n) { TBI(bits, n); return TEST(bits, n); } FI bool toggle(const AxisEnum n) { TBI(bits, n); return TEST(bits, n); }
FI void bset(const AxisEnum n) { SBI(bits, n); } FI void bset(const AxisEnum n) { SBI(bits, n); }
FI void bclr(const AxisEnum n) { CBI(bits, n); } FI void bclr(const AxisEnum n) { CBI(bits, n); }
FI void bset(const AxisEnum n, const bool b) { if (b) bset(n); else bclr(n); }
// Accessor via an AxisEnum (or any integer) [index] // Accessor via an AxisEnum (or any integer) [index]
FI bool operator[](const int n) const { return TEST(bits, n); } FI bool operator[](const int n) const { return TEST(bits, n); }
+10 -4
View File
@@ -46,10 +46,16 @@ BDS_Leveling bdl;
#define DEBUG_OUT ENABLED(DEBUG_OUT_BD) #define DEBUG_OUT ENABLED(DEBUG_OUT_BD)
#include "../../../core/debug_out.h" #include "../../../core/debug_out.h"
// M102 S-5 Read raw Calibrate data /**
// M102 S-6 Start Calibrate * M102 S<#> : Set adjustable Z height in 0.1mm units (10ths of a mm)
// M102 S4 Set the adjustable Z height value (e.g., 'M102 S4' means it will do adjusting while the Z height <= 0.4mm , disable with 'M102 S0'.) * (e.g., 'M102 S4' enables adjusting for Z <= 0.4mm)
// M102 S-1 Read sensor information * M102 S0 : Disable adjustable Z height
*
* M102 S-1 : Read BDsensor version
* M102 S-2 : Read BDsensor distance value
* M102 S-5 : Read raw Calibration data
* M102 S-6 : Start Calibration
*/
#define MAX_BD_HEIGHT 4.0f #define MAX_BD_HEIGHT 4.0f
#define CMD_READ_VERSION 1016 #define CMD_READ_VERSION 1016
@@ -63,7 +63,7 @@
*/ */
void mesh_bed_leveling::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) { void mesh_bed_leveling::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
// Get current and destination cells for this line // Get current and destination cells for this line
xy_int8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination); xy_uint8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination);
NOMORE(scel.x, GRID_MAX_CELLS_X - 1); NOMORE(scel.x, GRID_MAX_CELLS_X - 1);
NOMORE(scel.y, GRID_MAX_CELLS_Y - 1); NOMORE(scel.y, GRID_MAX_CELLS_Y - 1);
NOMORE(ecel.x, GRID_MAX_CELLS_X - 1); NOMORE(ecel.x, GRID_MAX_CELLS_X - 1);
@@ -80,7 +80,7 @@
float normalized_dist; float normalized_dist;
xyze_pos_t dest; xyze_pos_t dest;
const int8_t gcx = _MAX(scel.x, ecel.x), gcy = _MAX(scel.y, ecel.y); const uint8_t gcx = _MAX(scel.x, ecel.x), gcy = _MAX(scel.y, ecel.y);
// Crosses on the X and not already split on this X? // Crosses on the X and not already split on this X?
// The x_splits flags are insurance against rounding errors. // The x_splits flags are insurance against rounding errors.
+1 -1
View File
@@ -95,7 +95,7 @@ public:
static void report_current_mesh(); static void report_current_mesh();
static void report_state(); static void report_state();
static void save_ubl_active_state_and_disable(); static void save_ubl_active_state_and_disable();
static void restore_ubl_active_state_and_leave(); static void restore_ubl_active_state(const bool is_done=true);
static void display_map(const uint8_t) __O0; static void display_map(const uint8_t) __O0;
static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0; static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0;
static mesh_index_pair find_furthest_invalid_mesh_point() __O0; static mesh_index_pair find_furthest_invalid_mesh_point() __O0;
+17 -22
View File
@@ -309,7 +309,7 @@ void unified_bed_leveling::G29() {
#if ALL(DWIN_LCD_PROUI, ZHOME_BEFORE_LEVELING) #if ALL(DWIN_LCD_PROUI, ZHOME_BEFORE_LEVELING)
save_ubl_active_state_and_disable(); save_ubl_active_state_and_disable();
gcode.process_subcommands_now(F("G28Z")); gcode.process_subcommands_now(F("G28Z"));
restore_ubl_active_state_and_leave(); restore_ubl_active_state(false); // ...without telling ExtUI "done"
#else #else
// Send 'N' to force homing before G29 (internal only) // Send 'N' to force homing before G29 (internal only)
if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes(); if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes();
@@ -425,7 +425,7 @@ void unified_bed_leveling::G29() {
if (parser.seen_test('J')) { if (parser.seen_test('J')) {
save_ubl_active_state_and_disable(); save_ubl_active_state_and_disable();
tilt_mesh_based_on_probed_grid(param.J_grid_size == 0); // Zero size does 3-Point tilt_mesh_based_on_probed_grid(param.J_grid_size == 0); // Zero size does 3-Point
restore_ubl_active_state_and_leave(); restore_ubl_active_state();
#if ENABLED(UBL_G29_J_RECENTER) #if ENABLED(UBL_G29_J_RECENTER)
do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y))); do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y)));
#endif #endif
@@ -754,7 +754,6 @@ void unified_bed_leveling::shift_mesh_height() {
TERN_(HAS_MARLINUI_MENU, ui.capture()); TERN_(HAS_MARLINUI_MENU, ui.capture());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
grid_count_t count = GRID_MAX_POINTS; grid_count_t count = GRID_MAX_POINTS;
@@ -766,9 +765,8 @@ void unified_bed_leveling::shift_mesh_height() {
const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1; const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1;
SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, "."); SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS))); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout()); TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout());
TERN_(DWIN_LCD_PROUI, dwinRedrawScreen());
#if HAS_MARLINUI_MENU #if HAS_MARLINUI_MENU
if (ui.button_pressed()) { if (ui.button_pressed()) {
@@ -778,8 +776,7 @@ void unified_bed_leveling::shift_mesh_height() {
ui.quick_feedback(); ui.quick_feedback();
ui.release(); ui.release();
probe.stow(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW probe.stow(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); return restore_ubl_active_state();
return restore_ubl_active_state_and_leave();
} }
#endif #endif
@@ -815,15 +812,12 @@ void unified_bed_leveling::shift_mesh_height() {
probe.move_z_after_probing(); probe.move_z_after_probing();
restore_ubl_active_state_and_leave();
do_blocking_move_to_xy( do_blocking_move_to_xy(
constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X),
constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y)
); );
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); restore_ubl_active_state();
TERN_(DWIN_LCD_PROUI, dwinLevelingDone());
} }
#endif // HAS_BED_PROBE #endif // HAS_BED_PROBE
@@ -932,7 +926,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
if (param.V_verbosity > 1) if (param.V_verbosity > 1)
SERIAL_ECHOLNPGM("Business Card is ", p_float_t(thickness, 4), "mm thick."); SERIAL_ECHOLNPGM("Business Card is ", p_float_t(thickness, 4), "mm thick.");
restore_ubl_active_state_and_leave(); restore_ubl_active_state();
return thickness; return thickness;
} }
@@ -987,7 +981,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
if (_click_and_hold([]{ if (_click_and_hold([]{
SERIAL_ECHOLNPGM("\nMesh only partially populated."); SERIAL_ECHOLNPGM("\nMesh only partially populated.");
do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE);
})) return restore_ubl_active_state_and_leave(); })) return restore_ubl_active_state();
// Store the Z position minus the shim height // Store the Z position minus the shim height
z_values[lpos.x][lpos.y] = current_position.z - thick; z_values[lpos.x][lpos.y] = current_position.z - thick;
@@ -1002,10 +996,8 @@ void set_message_with_feedback(FSTR_P const fstr) {
if (do_ubl_mesh_map) display_map(param.T_map_type); // show user where we're probing if (do_ubl_mesh_map) display_map(param.T_map_type); // show user where we're probing
restore_ubl_active_state_and_leave(); restore_ubl_active_state();
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE); do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE);
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
} }
/** /**
@@ -1111,7 +1103,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
} while (lpos.x >= 0 && --param.R_repetition > 0); } while (lpos.x >= 0 && --param.R_repetition > 0);
if (do_ubl_mesh_map) display_map(param.T_map_type); if (do_ubl_mesh_map) display_map(param.T_map_type);
restore_ubl_active_state_and_leave(); restore_ubl_active_state();
do_blocking_move_to_xy_z(pos, Z_TWEEN_SAFE_CLEARANCE); do_blocking_move_to_xy_z(pos, Z_TWEEN_SAFE_CLEARANCE);
@@ -1263,17 +1255,20 @@ void unified_bed_leveling::save_ubl_active_state_and_disable() {
set_bed_leveling_enabled(false); set_bed_leveling_enabled(false);
} }
void unified_bed_leveling::restore_ubl_active_state_and_leave() { void unified_bed_leveling::restore_ubl_active_state(const bool is_done/*=true*/) {
TERN_(HAS_MARLINUI_MENU, ui.release()); TERN_(HAS_MARLINUI_MENU, ui.release());
#if ENABLED(UBL_DEVEL_DEBUGGING) #if ENABLED(UBL_DEVEL_DEBUGGING)
if (--ubl_state_recursion_chk) { if (--ubl_state_recursion_chk) {
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); SERIAL_ECHOLNPGM("restore_ubl_active_state() called too many times.");
set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR)); set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR));
return; return;
} }
#endif #endif
set_bed_leveling_enabled(ubl_state_at_invocation); set_bed_leveling_enabled(ubl_state_at_invocation);
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
if (is_done) {
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
}
} }
mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() {
@@ -1499,7 +1494,7 @@ void unified_bed_leveling::smart_fill_mesh() {
for (uint8_t i = 0; i < 3; ++i) { for (uint8_t i = 0; i < 3; ++i) {
SERIAL_ECHOLNPGM("Tilting mesh (", i + 1, "/3)"); SERIAL_ECHOLNPGM("Tilting mesh (", i + 1, "/3)");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT(MSG_LCD_TILTING_MESH), i + 1)); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT_F(MSG_LCD_TILTING_MESH), i + 1));
measured_z = probe.probe_at_point(points[i], i < 2 ? PROBE_PT_RAISE : PROBE_PT_LAST_STOW, param.V_verbosity); measured_z = probe.probe_at_point(points[i], i < 2 ? PROBE_PT_RAISE : PROBE_PT_LAST_STOW, param.V_verbosity);
if ((abort_flag = isnan(measured_z))) break; if ((abort_flag = isnan(measured_z))) break;
@@ -1555,7 +1550,7 @@ void unified_bed_leveling::smart_fill_mesh() {
#endif #endif
SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n"); SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points)); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_LCD_TILTING_MESH), point_num, total_points));
measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
+8 -3
View File
@@ -137,7 +137,7 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
// Retract by moving from a faux E position back to the current E position // Retract by moving from a faux E position back to the current E position
current_retract[active_extruder] = base_retract; current_retract[active_extruder] = base_retract;
prepare_internal_move_to_destination( // set current from destination prepare_internal_move_to_destination( // set current from destination
settings.retract_feedrate_mm_s * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS)) MUL_TERN(RETRACT_SYNC_MIXING, settings.retract_feedrate_mm_s, MIXING_STEPPERS)
); );
// Is a Z hop set, and has the hop not yet been done? // Is a Z hop set, and has the hop not yet been done?
@@ -165,8 +165,7 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
// Recover E, set_current_to_destination // Recover E, set_current_to_destination
prepare_internal_move_to_destination( prepare_internal_move_to_destination(
(swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s) MUL_TERN(RETRACT_SYNC_MIXING, swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s, MIXING_STEPPERS)
* TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS))
); );
} }
@@ -212,6 +211,8 @@ void FWRetract::M207() {
} }
void FWRetract::M207_report() { void FWRetract::M207_report() {
TERN_(MARLIN_SMALL_BUILD, return);
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length) PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length)
, PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length) , PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length)
@@ -237,6 +238,8 @@ void FWRetract::M208() {
} }
void FWRetract::M208_report() { void FWRetract::M208_report() {
TERN_(MARLIN_SMALL_BUILD, return);
SERIAL_ECHOLNPGM( SERIAL_ECHOLNPGM(
" M208 S", LINEAR_UNIT(settings.retract_recover_extra) " M208 S", LINEAR_UNIT(settings.retract_recover_extra)
, " W", LINEAR_UNIT(settings.swap_retract_recover_extra) , " W", LINEAR_UNIT(settings.swap_retract_recover_extra)
@@ -258,6 +261,8 @@ void FWRetract::M208_report() {
} }
void FWRetract::M209_report() { void FWRetract::M209_report() {
TERN_(MARLIN_SMALL_BUILD, return);
SERIAL_ECHOLNPGM(" M209 S", AS_DIGIT(autoretract_enabled)); SERIAL_ECHOLNPGM(" M209 S", AS_DIGIT(autoretract_enabled));
} }
+2 -2
View File
@@ -186,13 +186,13 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
switch (response) { switch (response) {
case 0: // "Purge More" button case 0: // "Purge More" button
#if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE) #if ENABLED(M600_PURGE_MORE_RESUMABLE)
pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more) pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more)
#endif #endif
break; break;
case 1: // "Continue" / "Disable Runout" button case 1: // "Continue" / "Disable Runout" button
#if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE) #if ENABLED(M600_PURGE_MORE_RESUMABLE)
pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection
#endif #endif
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
+3 -1
View File
@@ -32,7 +32,9 @@ typedef struct {
timeout = HOTEND_IDLE_TIMEOUT_SEC; timeout = HOTEND_IDLE_TIMEOUT_SEC;
trigger = HOTEND_IDLE_MIN_TRIGGER; trigger = HOTEND_IDLE_MIN_TRIGGER;
nozzle_target = HOTEND_IDLE_NOZZLE_TARGET; nozzle_target = HOTEND_IDLE_NOZZLE_TARGET;
bed_target = HOTEND_IDLE_BED_TARGET; #if HAS_HEATED_BED
bed_target = HOTEND_IDLE_BED_TARGET;
#endif
} }
} hotend_idle_settings_t; } hotend_idle_settings_t;
+1 -1
View File
@@ -130,7 +130,7 @@ public:
} }
// Accessors // Accessors
static uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); } static uint16_t pixels() { return MUL_TERN(NEOPIXEL2_INSERIES, adaneo1.numPixels(), 2); }
static uint32_t pixel_color(const uint16_t n) { static uint32_t pixel_color(const uint16_t n) {
#if ENABLED(NEOPIXEL2_INSERIES) #if ENABLED(NEOPIXEL2_INSERIES)
+1 -1
View File
@@ -56,7 +56,7 @@ public:
#if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER #if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER
static void onHeatingDone() { leds.set_white(); } static void onHeatingDone() { leds.set_white(); }
static void onPidTuningDone(LEDColor c) { leds.set_color(c); } static void onPIDTuningDone(LEDColor c) { leds.set_color(c); }
#endif #endif
#if HAS_MEDIA #if HAS_MEDIA
+43 -5
View File
@@ -72,6 +72,26 @@
uint16_t CodeProfiler::call_count = 0; uint16_t CodeProfiler::call_count = 0;
#endif #endif
#if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF;
#else
#ifdef MAX7219_DEBUG_PLANNER_HEAD
static int16_t last_head_cnt = 0x1;
#endif
#ifdef MAX7219_DEBUG_PLANNER_TAIL
static int16_t last_tail_cnt = 0x1;
#endif
#endif
#ifdef MAX7219_DEBUG_PLANNER_QUEUE
static int16_t last_depth = 0;
#endif
#ifdef MAX7219_DEBUG_PROFILE
static uint8_t last_time_fraction = 0;
#endif
#ifdef MAX7219_DEBUG_MULTISTEPPING
static uint8_t last_multistepping = 0;
#endif
Max7219 max7219; Max7219 max7219;
uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 };
@@ -550,6 +570,29 @@ void Max7219::init() {
#if MAX7219_INIT_TEST #if MAX7219_INIT_TEST
start_test_pattern(); start_test_pattern();
#endif #endif
#ifdef MAX7219_REINIT_ON_POWERUP
#if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
last_head_cnt = 0xF;
last_tail_cnt = 0xF;
#else
#ifdef MAX7219_DEBUG_PLANNER_HEAD
last_head_cnt = 0x1;
#endif
#ifdef MAX7219_DEBUG_PLANNER_TAIL
last_tail_cnt = 0x1;
#endif
#endif
#ifdef MAX7219_DEBUG_PLANNER_QUEUE
last_depth = 0;
#endif
#ifdef MAX7219_DEBUG_PROFILE
last_time_fraction = 0;
#endif
#ifdef MAX7219_DEBUG_MULTISTEPPING
last_multistepping = 0;
#endif
#endif
} }
/** /**
@@ -676,8 +719,6 @@ void Max7219::idle_tasks() {
#if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL
static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF;
if (last_head_cnt != head || last_tail_cnt != tail) { if (last_head_cnt != head || last_tail_cnt != tail) {
range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head, &row_change_mask); range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head, &row_change_mask);
last_head_cnt = head; last_head_cnt = head;
@@ -687,7 +728,6 @@ void Max7219::idle_tasks() {
#else #else
#ifdef MAX7219_DEBUG_PLANNER_HEAD #ifdef MAX7219_DEBUG_PLANNER_HEAD
static int16_t last_head_cnt = 0x1;
if (last_head_cnt != head) { if (last_head_cnt != head) {
mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head, &row_change_mask); mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head, &row_change_mask);
last_head_cnt = head; last_head_cnt = head;
@@ -695,7 +735,6 @@ void Max7219::idle_tasks() {
#endif #endif
#ifdef MAX7219_DEBUG_PLANNER_TAIL #ifdef MAX7219_DEBUG_PLANNER_TAIL
static int16_t last_tail_cnt = 0x1;
if (last_tail_cnt != tail) { if (last_tail_cnt != tail) {
mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail, &row_change_mask); mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail, &row_change_mask);
last_tail_cnt = tail; last_tail_cnt = tail;
@@ -714,7 +753,6 @@ void Max7219::idle_tasks() {
#endif #endif
#ifdef MAX7219_DEBUG_PROFILE #ifdef MAX7219_DEBUG_PROFILE
static uint8_t last_time_fraction = 0;
const uint8_t current_time_fraction = (uint16_t(CodeProfiler::get_time_fraction()) * MAX7219_NUMBER_UNITS + 8) / 16; const uint8_t current_time_fraction = (uint16_t(CodeProfiler::get_time_fraction()) * MAX7219_NUMBER_UNITS + 8) / 16;
if (current_time_fraction != last_time_fraction) { if (current_time_fraction != last_time_fraction) {
quantity(MAX7219_DEBUG_PROFILE, last_time_fraction, current_time_fraction, &row_change_mask); quantity(MAX7219_DEBUG_PROFILE, last_time_fraction, current_time_fraction, &row_change_mask);
+5 -5
View File
@@ -23,6 +23,8 @@
/** /**
* feature/pause.cpp - Pause feature support functions * feature/pause.cpp - Pause feature support functions
* This may be combined with related G-codes if features are consolidated. * This may be combined with related G-codes if features are consolidated.
*
* Note: Calls to ui.pause_show_message are passed to either ExtUI or MarlinUI.
*/ */
#include "../inc/MarlinConfigPre.h" #include "../inc/MarlinConfigPre.h"
@@ -60,8 +62,6 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h" #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../lcd/e3v2/proui/dwin.h"
#endif #endif
#include "../lcd/marlinui.h" #include "../lcd/marlinui.h"
@@ -148,7 +148,7 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P
thermalManager.setTargetHotend(thermalManager.extrude_min_temp, active_extruder); thermalManager.setTargetHotend(thermalManager.extrude_min_temp, active_extruder);
#endif #endif
ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode); UNUSED(mode); ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode);
if (wait) return thermalManager.wait_for_hotend(active_extruder); if (wait) return thermalManager.wait_for_hotend(active_extruder);
@@ -288,8 +288,8 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
// Show "Purge More" / "Resume" menu and wait for reply // Show "Purge More" / "Resume" menu and wait for reply
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = false; wait_for_user = false;
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI)
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR ui.pause_show_message(PAUSE_MESSAGE_OPTION); // MarlinUI and MKS UI also set PAUSE_RESPONSE_WAIT_FOR
#else #else
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
#endif #endif
+5 -3
View File
@@ -52,10 +52,12 @@ enum PauseMessage : char {
PAUSE_MESSAGE_RESUME, PAUSE_MESSAGE_RESUME,
PAUSE_MESSAGE_HEAT, PAUSE_MESSAGE_HEAT,
PAUSE_MESSAGE_HEATING, PAUSE_MESSAGE_HEATING,
PAUSE_MESSAGE_STATUS PAUSE_MESSAGE_STATUS,
PAUSE_MESSAGE_COUNT
}; };
#if M600_PURGE_MORE_RESUMABLE #if M600_PURGE_MORE_RESUMABLE
// Input methods can Purge More, Resume, or request input
enum PauseMenuResponse : char { enum PauseMenuResponse : char {
PAUSE_RESPONSE_WAIT_FOR, PAUSE_RESPONSE_WAIT_FOR,
PAUSE_RESPONSE_EXTRUDE_MORE, PAUSE_RESPONSE_EXTRUDE_MORE,
@@ -105,7 +107,7 @@ void wait_for_confirmation(
void resume_print( void resume_print(
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
const_float_t extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
const int8_t max_beep_count=0, // Beep alert for attention const int8_t max_beep_count=0, // Beep alert for attention
const celsius_t targetTemp=0 // (°C) A target temperature for the hotend const celsius_t targetTemp=0 // (°C) A target temperature for the hotend
DXC_PARAMS // Dual-X-Carriage extruder index DXC_PARAMS // Dual-X-Carriage extruder index
@@ -114,7 +116,7 @@ void resume_print(
bool load_filament( bool load_filament(
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
const_float_t extrude_length=0, // (mm) Purge length const_float_t purge_length=0, // (mm) Purge length
const int8_t max_beep_count=0, // Beep alert for attention const int8_t max_beep_count=0, // Beep alert for attention
const bool show_lcd=false, // Set LCD status messages? const bool show_lcd=false, // Set LCD status messages?
const bool pause_for_user=false, // Pause for user before returning? const bool pause_for_user=false, // Pause for user before returning?
+22
View File
@@ -34,6 +34,10 @@
#include "../module/temperature.h" #include "../module/temperature.h"
#include "../MarlinCore.h" #include "../MarlinCore.h"
#if ENABLED(MAX7219_REINIT_ON_POWERUP)
#include "max7219.h"
#endif
#if ENABLED(PS_OFF_SOUND) #if ENABLED(PS_OFF_SOUND)
#include "../libs/buzzer.h" #include "../libs/buzzer.h"
#endif #endif
@@ -60,6 +64,10 @@ bool Power::psu_on;
millis_t Power::lastPowerOn; millis_t Power::lastPowerOn;
#endif #endif
#if PSU_TRACK_STATE_MS
millis_t Power::last_state_change_ms = 0;
#endif
/** /**
* Initialize pins & state for the power manager. * Initialize pins & state for the power manager.
* *
@@ -87,9 +95,18 @@ void Power::power_on() {
#endif #endif
OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE); OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE);
#if ENABLED(PSU_OFF_REDUNDANT)
OUT_WRITE(PS_ON1_PIN, TERN_(PSU_OFF_REDUNDANT_INVERTED, !)PSU_ACTIVE_STATE);
#endif
TERN_(PSU_TRACK_STATE_MS, last_state_change_ms = millis());
psu_on = true; psu_on = true;
safe_delay(PSU_POWERUP_DELAY); safe_delay(PSU_POWERUP_DELAY);
restore_stepper_drivers(); restore_stepper_drivers();
TERN_(MAX7219_REINIT_ON_POWERUP, max7219.init());
TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY)); TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY));
#ifdef PSU_POWERUP_GCODE #ifdef PSU_POWERUP_GCODE
@@ -117,6 +134,11 @@ void Power::power_off() {
#endif #endif
OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE); OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE);
#if ENABLED(PSU_OFF_REDUNDANT)
OUT_WRITE(PS_ON1_PIN, IF_DISABLED(PSU_OFF_REDUNDANT_INVERTED, !)PSU_ACTIVE_STATE);
#endif
TERN_(PSU_TRACK_STATE_MS, last_state_change_ms = millis());
psu_on = false; psu_on = false;
#if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) #if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN)
+8 -1
View File
@@ -24,8 +24,11 @@
/** /**
* power.h - power control * power.h - power control
*/ */
#if PIN_EXISTS(PS_ON_EDM) || (PIN_EXISTS(PS_ON1_EDM) && ENABLED(PSU_OFF_REDUNDANT))
#define PSU_TRACK_STATE_MS 1
#endif
#if ANY(AUTO_POWER_CONTROL, POWER_OFF_TIMER) #if ANY(AUTO_POWER_CONTROL, POWER_OFF_TIMER, PSU_TRACK_STATE_MS)
#include "../core/millis_t.h" #include "../core/millis_t.h"
#endif #endif
@@ -37,6 +40,10 @@ class Power {
static void power_on(); static void power_on();
static void power_off(); static void power_off();
#if PSU_TRACK_STATE_MS
static millis_t last_state_change_ms;
#endif
#if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) #if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN)
#if ENABLED(POWER_OFF_TIMER) #if ENABLED(POWER_OFF_TIMER)
static millis_t power_off_time; static millis_t power_off_time;
+2 -2
View File
@@ -48,8 +48,8 @@ uint8_t PrintJobRecovery::queue_index_r;
uint32_t PrintJobRecovery::cmd_sdpos, // = 0 uint32_t PrintJobRecovery::cmd_sdpos, // = 0
PrintJobRecovery::sdpos[BUFSIZE]; PrintJobRecovery::sdpos[BUFSIZE];
#if HAS_DWIN_E3V2_BASIC #if HAS_PLR_UI_FLAG
bool PrintJobRecovery::dwin_flag; // = false bool PrintJobRecovery::ui_flag_resume; // = false
#endif #endif
#include "../sd/cardreader.h" #include "../sd/cardreader.h"
+2 -2
View File
@@ -151,8 +151,8 @@ class PrintJobRecovery {
static uint32_t cmd_sdpos, //!< SD position of the next command static uint32_t cmd_sdpos, //!< SD position of the next command
sdpos[BUFSIZE]; //!< SD positions of queued commands sdpos[BUFSIZE]; //!< SD positions of queued commands
#if HAS_DWIN_E3V2_BASIC #if HAS_PLR_UI_FLAG
static bool dwin_flag; static bool ui_flag_resume; //!< Flag the UI to show a dialog to Resume (M1000) or Cancel (M1000C)
#endif #endif
static void init(); static void init();
-3
View File
@@ -68,8 +68,6 @@ bool FilamentMonitorBase::enabled = true,
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h" #include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../lcd/e3v2/proui/dwin.h"
#endif #endif
void event_filament_runout(const uint8_t extruder) { void event_filament_runout(const uint8_t extruder) {
@@ -88,7 +86,6 @@ void event_filament_runout(const uint8_t extruder) {
#endif #endif
TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder))); TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder)));
TERN_(DWIN_LCD_PROUI, dwinFilamentRunout(extruder));
#if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR) #if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR)
const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder); const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder);
+1 -1
View File
@@ -31,7 +31,7 @@ static uint32_t axis_plug_backward = 0;
void stepper_driver_backward_error(FSTR_P const fstr) { void stepper_driver_backward_error(FSTR_P const fstr) {
SERIAL_ERROR_START(); SERIAL_ERROR_START();
SERIAL_ECHOLN(fstr, F(" driver is backward!")); SERIAL_ECHOLN(fstr, F(" driver is backward!"));
ui.status_printf(2, F(S_FMT S_FMT), FTOP(fstr), GET_TEXT(MSG_DRIVER_BACKWARD)); ui.status_printf(2, F(S_FMT S_FMT), FTOP(fstr), GET_TEXT_F(MSG_DRIVER_BACKWARD));
} }
void stepper_driver_backward_check() { void stepper_driver_backward_check() {
+1 -1
View File
@@ -763,7 +763,7 @@
SERIAL_CHAR('\t'); SERIAL_CHAR('\t');
st.printLabel(); st.printLabel();
SERIAL_CHAR('\t'); SERIAL_CHAR('\t');
print_hex_long(drv_status, ':'); print_hex_long(drv_status, ':', true);
if (drv_status == 0xFFFFFFFF || drv_status == 0) SERIAL_ECHOPGM("\t Bad response!"); if (drv_status == 0xFFFFFFFF || drv_status == 0) SERIAL_ECHOPGM("\t Bad response!");
SERIAL_EOL(); SERIAL_EOL();
break; break;
+18 -26
View File
@@ -144,15 +144,13 @@ class TMCMarlin : public TMC, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
#endif #endif
#endif #endif
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) void refresh_stepper_current() { rms_current(this->val_mA); }
void refresh_stepper_current() { rms_current(this->val_mA); }
#if ENABLED(HYBRID_THRESHOLD) #if ENABLED(HYBRID_THRESHOLD)
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
#endif #endif
#if USE_SENSORLESS #if USE_SENSORLESS
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
#endif
#endif #endif
static constexpr int8_t sgt_min = -64, static constexpr int8_t sgt_min = -64,
@@ -207,12 +205,10 @@ class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
} }
#endif #endif
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) void refresh_stepper_current() { rms_current(this->val_mA); }
void refresh_stepper_current() { rms_current(this->val_mA); }
#if ENABLED(HYBRID_THRESHOLD) #if ENABLED(HYBRID_THRESHOLD)
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
#endif
#endif #endif
}; };
@@ -269,15 +265,13 @@ class TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
} }
#endif #endif
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) void refresh_stepper_current() { rms_current(this->val_mA); }
void refresh_stepper_current() { rms_current(this->val_mA); }
#if ENABLED(HYBRID_THRESHOLD) #if ENABLED(HYBRID_THRESHOLD)
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
#endif #endif
#if USE_SENSORLESS #if USE_SENSORLESS
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
#endif
#endif #endif
static constexpr uint8_t sgt_min = 0, static constexpr uint8_t sgt_min = 0,
@@ -315,12 +309,10 @@ class TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC266
} }
#endif #endif
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) void refresh_stepper_current() { rms_current(this->val_mA); }
void refresh_stepper_current() { rms_current(this->val_mA); }
#if USE_SENSORLESS #if USE_SENSORLESS
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
#endif
#endif #endif
static constexpr int8_t sgt_min = -64, static constexpr int8_t sgt_min = -64,
+12 -12
View File
@@ -532,7 +532,7 @@ void GcodeSuite::G26() {
if (bedtemp) { if (bedtemp) {
if (!WITHIN(bedtemp, 40, BED_MAX_TARGET)) { if (!WITHIN(bedtemp, 40, BED_MAX_TARGET)) {
SERIAL_ECHOLNPGM("?Specified bed temperature not plausible (40-", BED_MAX_TARGET, "C)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified bed temperature not plausible (40-", BED_MAX_TARGET, "C)."));
return; return;
} }
g26.bed_temp = bedtemp; g26.bed_temp = bedtemp;
@@ -543,7 +543,7 @@ void GcodeSuite::G26() {
if (parser.seenval('L')) { if (parser.seenval('L')) {
g26.layer_height = parser.value_linear_units(); g26.layer_height = parser.value_linear_units();
if (!WITHIN(g26.layer_height, 0.0, 2.0)) { if (!WITHIN(g26.layer_height, 0.0, 2.0)) {
SERIAL_ECHOLNPGM("?Specified layer height not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified layer height not plausible."));
return; return;
} }
} }
@@ -552,12 +552,12 @@ void GcodeSuite::G26() {
if (parser.has_value()) { if (parser.has_value()) {
g26.retraction_multiplier = parser.value_float(); g26.retraction_multiplier = parser.value_float();
if (!WITHIN(g26.retraction_multiplier, 0.05, 15.0)) { if (!WITHIN(g26.retraction_multiplier, 0.05, 15.0)) {
SERIAL_ECHOLNPGM("?Specified Retraction Multiplier not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified Retraction Multiplier not plausible."));
return; return;
} }
} }
else { else {
SERIAL_ECHOLNPGM("?Retraction Multiplier must be specified."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Retraction Multiplier must be specified."));
return; return;
} }
} }
@@ -565,7 +565,7 @@ void GcodeSuite::G26() {
if (parser.seenval('S')) { if (parser.seenval('S')) {
g26.nozzle = parser.value_float(); g26.nozzle = parser.value_float();
if (!WITHIN(g26.nozzle, 0.1, 2.0)) { if (!WITHIN(g26.nozzle, 0.1, 2.0)) {
SERIAL_ECHOLNPGM("?Specified nozzle size not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified nozzle size not plausible."));
return; return;
} }
} }
@@ -575,7 +575,7 @@ void GcodeSuite::G26() {
#if HAS_MARLINUI_MENU #if HAS_MARLINUI_MENU
g26.prime_flag = -1; g26.prime_flag = -1;
#else #else
SERIAL_ECHOLNPGM("?Prime length must be specified when not using an LCD."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Prime length must be specified when not using an LCD."));
return; return;
#endif #endif
} }
@@ -583,7 +583,7 @@ void GcodeSuite::G26() {
g26.prime_flag++; g26.prime_flag++;
g26.prime_length = parser.value_linear_units(); g26.prime_length = parser.value_linear_units();
if (!WITHIN(g26.prime_length, 0.0, 25.0)) { if (!WITHIN(g26.prime_length, 0.0, 25.0)) {
SERIAL_ECHOLNPGM("?Specified prime length not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified prime length not plausible."));
return; return;
} }
} }
@@ -592,7 +592,7 @@ void GcodeSuite::G26() {
if (parser.seenval('F')) { if (parser.seenval('F')) {
g26.filament_diameter = parser.value_linear_units(); g26.filament_diameter = parser.value_linear_units();
if (!WITHIN(g26.filament_diameter, 1.0, 4.0)) { if (!WITHIN(g26.filament_diameter, 1.0, 4.0)) {
SERIAL_ECHOLNPGM("?Specified filament size not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified filament size not plausible."));
return; return;
} }
} }
@@ -616,7 +616,7 @@ void GcodeSuite::G26() {
// If any preset or temperature was specified // If any preset or temperature was specified
if (noztemp) { if (noztemp) {
if (!WITHIN(noztemp, 165, thermalManager.hotend_max_target(active_extruder))) { if (!WITHIN(noztemp, 165, thermalManager.hotend_max_target(active_extruder))) {
SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified nozzle temperature not plausible."));
return; return;
} }
g26.hotend_temp = noztemp; g26.hotend_temp = noztemp;
@@ -637,12 +637,12 @@ void GcodeSuite::G26() {
if (parser.seen('R')) if (parser.seen('R'))
g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1; g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1;
else { else {
SERIAL_ECHOLNPGM("?(R)epeat must be specified when not using an LCD."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(R)epeat must be specified when not using an LCD."));
return; return;
} }
#endif #endif
if (g26_repeats < 1) { if (g26_repeats < 1) {
SERIAL_ECHOLNPGM("?(R)epeat value not plausible; must be at least 1."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(R)epeat value not plausible; must be at least 1."));
return; return;
} }
@@ -650,7 +650,7 @@ void GcodeSuite::G26() {
g26.xy_pos.set(parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x, g26.xy_pos.set(parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x,
parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y); parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y);
if (!position_is_reachable(g26.xy_pos)) { if (!position_is_reachable(g26.xy_pos)) {
SERIAL_ECHOLNPGM("?Specified X,Y coordinate out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified X,Y coordinate out of bounds."));
return; return;
} }
+6 -4
View File
@@ -64,7 +64,7 @@ void GcodeSuite::G35() {
const uint8_t screw_thread = parser.byteval('S', TRAMMING_SCREW_THREAD); const uint8_t screw_thread = parser.byteval('S', TRAMMING_SCREW_THREAD);
if (!WITHIN(screw_thread, 30, 51) || screw_thread % 10 > 1) { if (!WITHIN(screw_thread, 30, 51) || screw_thread % 10 > 1) {
SERIAL_ECHOLNPGM("?(S)crew thread must be 30, 31, 40, 41, 50, or 51."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S)crew thread must be 30, 31, 40, 41, 50, or 51."));
return; return;
} }
@@ -95,9 +95,11 @@ void GcodeSuite::G35() {
for (uint8_t i = 0; i < G35_PROBE_COUNT; ++i) { for (uint8_t i = 0; i < G35_PROBE_COUNT; ++i) {
const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE); const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE);
if (isnan(z_probed_height)) { if (isnan(z_probed_height)) {
SERIAL_ECHO( SERIAL_ECHOLN(
F("G35 failed at point "), i + 1, F(" ("), FPSTR(pgm_read_ptr(&tramming_point_name[i])), C(')'), F("G35 failed at point "), i + 1,
FPSTR(SP_X_STR), tramming_points[i].x, FPSTR(SP_Y_STR), tramming_points[i].y F(" ("), FPSTR(pgm_read_ptr(&tramming_point_name[i])), C(')'),
FPSTR(SP_X_STR), tramming_points[i].x,
FPSTR(SP_Y_STR), tramming_points[i].y
); );
err_break = true; err_break = true;
break; break;
+6
View File
@@ -32,6 +32,12 @@
/** /**
* G42: Move X & Y axes to mesh coordinates (I & J) * G42: Move X & Y axes to mesh coordinates (I & J)
*
* Parameters:
* F<feedrate> : Feedrate in mm/min
* I<index> : X axis point index
* J<index> : Y axis point index
* P<bool> : Flag to put the prove at the given point
*/ */
void GcodeSuite::G42() { void GcodeSuite::G42() {
if (MOTION_CONDITIONS) { if (MOTION_CONDITIONS) {
+5 -4
View File
@@ -105,13 +105,12 @@ void GcodeSuite::M420() {
const int16_t a = settings.calc_num_meshes(); const int16_t a = settings.calc_num_meshes();
if (!a) { if (!a) {
SERIAL_ECHOLNPGM("?EEPROM storage not available."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("EEPROM storage not available."));
return; return;
} }
if (!WITHIN(storage_slot, 0, a - 1)) { if (!WITHIN(storage_slot, 0, a - 1)) {
SERIAL_ECHOLNPGM("?Invalid storage slot."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Invalid storage slot. Use 0 to ", a - 1));
SERIAL_ECHOLNPGM("?Use 0 to ", a - 1);
return; return;
} }
@@ -120,7 +119,7 @@ void GcodeSuite::M420() {
#else #else
SERIAL_ECHOLNPGM("?EEPROM storage not available."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("EEPROM storage not available."));
return; return;
#endif #endif
@@ -245,6 +244,8 @@ void GcodeSuite::M420() {
} }
void GcodeSuite::M420_report(const bool forReplay/*=true*/) { void GcodeSuite::M420_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F( report_heading_etc(forReplay, F(
TERN(MESH_BED_LEVELING, "Mesh Bed Leveling", TERN(AUTO_BED_LEVELING_UBL, "Unified Bed Leveling", "Auto Bed Leveling")) TERN(MESH_BED_LEVELING, "Mesh Bed Leveling", TERN(AUTO_BED_LEVELING_UBL, "Unified Bed Leveling", "Auto Bed Leveling"))
)); ));
+8 -16
View File
@@ -51,8 +51,6 @@
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD) #elif ENABLED(DWIN_CREALITY_LCD)
#include "../../../lcd/e3v2/creality/dwin.h" #include "../../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@@ -77,7 +75,7 @@ static void pre_g29_return(const bool retry, const bool did) {
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false));
} }
if (did) { if (did) {
TERN_(HAS_DWIN_E3V2_BASIC, dwinLevelingDone()); TERN_(DWIN_CREALITY_LCD, dwinLevelingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
} }
} }
@@ -344,7 +342,7 @@ G29_TYPE GcodeSuite::G29() {
abl.verbose_level = parser.intval('V'); abl.verbose_level = parser.intval('V');
if (!WITHIN(abl.verbose_level, 0, 4)) { if (!WITHIN(abl.verbose_level, 0, 4)) {
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-4)."));
G29_RETURN(false, false); G29_RETURN(false, false);
} }
@@ -365,11 +363,11 @@ G29_TYPE GcodeSuite::G29() {
if (parser.seenval('P')) abl.grid_points.x = abl.grid_points.y = parser.value_int(); if (parser.seenval('P')) abl.grid_points.x = abl.grid_points.y = parser.value_int();
if (!WITHIN(abl.grid_points.x, 2, GRID_MAX_POINTS_X)) { if (!WITHIN(abl.grid_points.x, 2, GRID_MAX_POINTS_X)) {
SERIAL_ECHOLNPGM("?Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."));
G29_RETURN(false, false); G29_RETURN(false, false);
} }
if (!WITHIN(abl.grid_points.y, 2, GRID_MAX_POINTS_Y)) { if (!WITHIN(abl.grid_points.y, 2, GRID_MAX_POINTS_Y)) {
SERIAL_ECHOLNPGM("?Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."));
G29_RETURN(false, false); G29_RETURN(false, false);
} }
@@ -404,7 +402,7 @@ G29_TYPE GcodeSuite::G29() {
DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x, DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x,
" F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y); " F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y);
} }
SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG(" (L,R,F,B) out of bounds."));
G29_RETURN(false, false); G29_RETURN(false, false);
} }
@@ -425,8 +423,6 @@ G29_TYPE GcodeSuite::G29() {
#if ENABLED(AUTO_BED_LEVELING_3POINT) #if ENABLED(AUTO_BED_LEVELING_3POINT)
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling");
points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
#endif #endif
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
@@ -436,11 +432,7 @@ G29_TYPE GcodeSuite::G29() {
#if ENABLED(PREHEAT_BEFORE_LEVELING) #if ENABLED(PREHEAT_BEFORE_LEVELING)
if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP,
#if ALL(DWIN_LCD_PROUI, HAS_HEATED_BED) TERN(EXTENSIBLE_UI, ExtUI::getLevelingBedTemp(), LEVELING_BED_TEMP)
hmiData.bedLevT
#else
LEVELING_BED_TEMP
#endif
); );
#endif #endif
} }
@@ -691,7 +683,7 @@ G29_TYPE GcodeSuite::G29() {
if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue; if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue;
if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing mesh point ", pt_index, "/", abl.abl_points, "."); if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing mesh point ", pt_index, "/", abl.abl_points, ".");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points))); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points)));
#if ENABLED(BD_SENSOR_PROBE_NO_STOP) #if ENABLED(BD_SENSOR_PROBE_NO_STOP)
if (PR_INNER_VAR == inStart) { if (PR_INNER_VAR == inStart) {
@@ -790,7 +782,7 @@ G29_TYPE GcodeSuite::G29() {
for (uint8_t i = 0; i < 3; ++i) { for (uint8_t i = 0; i < 3; ++i) {
if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing point ", i + 1, "/3."); if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing point ", i + 1, "/3.");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_POINT), int(i + 1))); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT_F(MSG_PROBING_POINT), int(i + 1)));
// Retain the last probe position // Retain the last probe position
abl.probePos = xy_pos_t(points[i]); abl.probePos = xy_pos_t(points[i]);
+1 -6
View File
@@ -40,8 +40,6 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@@ -144,7 +142,6 @@ void GcodeSuite::G29() {
queue.inject(F("G29S2")); queue.inject(F("G29S2"));
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
return; return;
} }
@@ -170,7 +167,6 @@ void GcodeSuite::G29() {
// Save Z for the previous mesh position // Save Z for the previous mesh position
bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z); bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z);
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z)); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z));
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z));
SET_SOFT_ENDSTOP_LOOSE(false); SET_SOFT_ENDSTOP_LOOSE(false);
} }
// If there's another point to sample, move there with optional lift. // If there's another point to sample, move there with optional lift.
@@ -237,7 +233,6 @@ void GcodeSuite::G29() {
if (parser.seenval('Z')) { if (parser.seenval('Z')) {
bedlevel.z_values[ix][iy] = parser.value_linear_units(); bedlevel.z_values[ix][iy] = parser.value_linear_units();
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy])); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
} }
else else
return echo_not_entered('Z'); return echo_not_entered('Z');
@@ -258,7 +253,7 @@ void GcodeSuite::G29() {
if (state == MeshNext) { if (state == MeshNext) {
SERIAL_ECHOLNPGM("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", GRID_MAX_POINTS); SERIAL_ECHOLNPGM("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", GRID_MAX_POINTS);
if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS))); if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS)));
} }
report_current_position(); report_current_position();
-3
View File
@@ -33,8 +33,6 @@
#if ENABLED(EXTENSIBLE_UI) #if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h" #include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif #endif
/** /**
@@ -69,7 +67,6 @@ void GcodeSuite::M421() {
float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point
zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ij.x, ij.y, zval));
} }
} }
+2 -4
View File
@@ -52,8 +52,6 @@
#include "../../lcd/extui/ui_api.h" #include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD) #elif ENABLED(DWIN_CREALITY_LCD)
#include "../../lcd/e3v2/creality/dwin.h" #include "../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif #endif
#if ENABLED(LASER_FEATURE) #if ENABLED(LASER_FEATURE)
@@ -223,7 +221,7 @@ void GcodeSuite::G28() {
set_and_report_grblstate(M_HOMING); set_and_report_grblstate(M_HOMING);
#endif #endif
TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingStart()); TERN_(DWIN_CREALITY_LCD, dwinHomingStart());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
planner.synchronize(); // Wait for planner moves to finish! planner.synchronize(); // Wait for planner moves to finish!
@@ -652,7 +650,7 @@ void GcodeSuite::G28() {
ui.refresh(); ui.refresh();
TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingDone()); TERN_(DWIN_CREALITY_LCD, dwinHomingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone());
report_current_position(); report_current_position();
+4 -4
View File
@@ -390,7 +390,7 @@ void GcodeSuite::G33() {
const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS);
if (!WITHIN(probe_points, 0, 10)) { if (!WITHIN(probe_points, 0, 10)) {
SERIAL_ECHOLNPGM("?(P)oints implausible (0-10)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(P)oints implausible (0-10)."));
return; return;
} }
@@ -409,19 +409,19 @@ void GcodeSuite::G33() {
const float calibration_precision = parser.floatval('C', 0.0f); const float calibration_precision = parser.floatval('C', 0.0f);
if (calibration_precision < 0) { if (calibration_precision < 0) {
SERIAL_ECHOLNPGM("?(C)alibration precision implausible (>=0)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(C)alibration precision implausible (>=0)."));
return; return;
} }
const int8_t force_iterations = parser.intval('F', 0); const int8_t force_iterations = parser.intval('F', 0);
if (!WITHIN(force_iterations, 0, 30)) { if (!WITHIN(force_iterations, 0, 30)) {
SERIAL_ECHOLNPGM("?(F)orce iteration implausible (0-30)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(F)orce iteration implausible (0-30)."));
return; return;
} }
const int8_t verbose_level = parser.byteval('V', 1); const int8_t verbose_level = parser.byteval('V', 1);
if (!WITHIN(verbose_level, 0, 3)) { if (!WITHIN(verbose_level, 0, 3)) {
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-3)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-3)."));
return; return;
} }
+10 -8
View File
@@ -110,19 +110,19 @@ void GcodeSuite::G34() {
const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS); const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS);
if (!WITHIN(z_auto_align_iterations, 1, 30)) { if (!WITHIN(z_auto_align_iterations, 1, 30)) {
SERIAL_ECHOLNPGM("?(I)teration out of bounds (1-30)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(I)teration out of bounds (1-30)."));
break; break;
} }
const float z_auto_align_accuracy = parser.floatval('T', Z_STEPPER_ALIGN_ACC); const float z_auto_align_accuracy = parser.floatval('T', Z_STEPPER_ALIGN_ACC);
if (!WITHIN(z_auto_align_accuracy, 0.01f, 1.0f)) { if (!WITHIN(z_auto_align_accuracy, 0.001f, 1.0f)) {
SERIAL_ECHOLNPGM("?(T)arget accuracy out of bounds (0.01-1.0)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(T)arget accuracy out of bounds (0.001-1.0)."));
break; break;
} }
const float z_auto_align_amplification = TERN(HAS_Z_STEPPER_ALIGN_STEPPER_XY, Z_STEPPER_ALIGN_AMP, parser.floatval('A', Z_STEPPER_ALIGN_AMP)); const float z_auto_align_amplification = TERN(HAS_Z_STEPPER_ALIGN_STEPPER_XY, Z_STEPPER_ALIGN_AMP, parser.floatval('A', Z_STEPPER_ALIGN_AMP));
if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) {
SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(A)mplification out of bounds (0.5-2.0)."));
break; break;
} }
@@ -450,7 +450,7 @@ void GcodeSuite::M422() {
const bool is_probe_point = parser.seen_test('S'); const bool is_probe_point = parser.seen_test('S');
if (TERN0(HAS_Z_STEPPER_ALIGN_STEPPER_XY, is_probe_point && parser.seen_test('W'))) { if (TERN0(HAS_Z_STEPPER_ALIGN_STEPPER_XY, is_probe_point && parser.seen_test('W'))) {
SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S) and (W) may not be combined."));
return; return;
} }
@@ -460,7 +460,7 @@ void GcodeSuite::M422() {
); );
if (!is_probe_point && TERN1(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !parser.seen_test('W'))) { if (!is_probe_point && TERN1(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !parser.seen_test('W'))) {
SERIAL_ECHOLNPGM("?(S)" TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, " or (W)") " is required."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S)" TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, " or (W)") " is required."));
return; return;
} }
@@ -490,11 +490,11 @@ void GcodeSuite::M422() {
if (is_probe_point) { if (is_probe_point) {
if (!probe.can_reach(pos.x, Y_CENTER)) { if (!probe.can_reach(pos.x, Y_CENTER)) {
SERIAL_ECHOLNPGM("?(X) out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(X) out of bounds."));
return; return;
} }
if (!probe.can_reach(pos)) { if (!probe.can_reach(pos)) {
SERIAL_ECHOLNPGM("?(Y) out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(Y) out of bounds."));
return; return;
} }
} }
@@ -503,6 +503,8 @@ void GcodeSuite::M422() {
} }
void GcodeSuite::M422_report(const bool forReplay/*=true*/) { void GcodeSuite::M422_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_Z_AUTO_ALIGN)); report_heading(forReplay, F(STR_Z_AUTO_ALIGN));
for (uint8_t i = 0; i < NUM_Z_STEPPERS; ++i) { for (uint8_t i = 0; i < NUM_Z_STEPPERS; ++i) {
report_echo_start(forReplay); report_echo_start(forReplay);
+2
View File
@@ -106,6 +106,8 @@ void GcodeSuite::M425() {
} }
void GcodeSuite::M425_report(const bool forReplay/*=true*/) { void GcodeSuite::M425_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_BACKLASH_COMPENSATION)); report_heading_etc(forReplay, F(STR_BACKLASH_COMPENSATION));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M425 F"), backlash.get_correction() PSTR(" M425 F"), backlash.get_correction()
+5 -5
View File
@@ -62,13 +62,13 @@ void GcodeSuite::M48() {
const int8_t verbose_level = parser.byteval('V', 1); const int8_t verbose_level = parser.byteval('V', 1);
if (!WITHIN(verbose_level, 0, 4)) { if (!WITHIN(verbose_level, 0, 4)) {
SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-4)."));
return; return;
} }
const int8_t n_samples = parser.byteval('P', 10); const int8_t n_samples = parser.byteval('P', 10);
if (!WITHIN(n_samples, 4, 50)) { if (!WITHIN(n_samples, 4, 50)) {
SERIAL_ECHOLNPGM("?Sample size not plausible (4-50)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Sample size not plausible (4-50)."));
return; return;
} }
@@ -82,7 +82,7 @@ void GcodeSuite::M48() {
if (!probe.can_reach(test_position)) { if (!probe.can_reach(test_position)) {
LCD_MESSAGE_MAX(MSG_M48_OUT_OF_BOUNDS); LCD_MESSAGE_MAX(MSG_M48_OUT_OF_BOUNDS);
SERIAL_ECHOLNPGM("? (X,Y) out of bounds."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG(" (X,Y) out of bounds."));
return; return;
} }
@@ -90,7 +90,7 @@ void GcodeSuite::M48() {
bool seen_L = parser.seen('L'); bool seen_L = parser.seen('L');
uint8_t n_legs = seen_L ? parser.value_byte() : 0; uint8_t n_legs = seen_L ? parser.value_byte() : 0;
if (n_legs > 15) { if (n_legs > 15) {
SERIAL_ECHOLNPGM("?Legs of movement implausible (0-15)."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Legs of movement implausible (0-15)."));
return; return;
} }
if (n_legs == 1) n_legs = 2; if (n_legs == 1) n_legs = 2;
@@ -149,7 +149,7 @@ void GcodeSuite::M48() {
for (uint8_t n = 0; n < n_samples; ++n) { for (uint8_t n = 0; n < n_samples; ++n) {
#if HAS_STATUS_MESSAGE #if HAS_STATUS_MESSAGE
// Display M48 progress in the status bar // Display M48 progress in the status bar
ui.status_printf(0, F(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples)); ui.status_printf(0, F(S_FMT ": %d/%d"), GET_TEXT_F(MSG_M48_POINT), int(n + 1), int(n_samples));
#endif #endif
// When there are "legs" of movement move around the point before probing // When there are "legs" of movement move around the point before probing
+8 -1
View File
@@ -62,6 +62,8 @@
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_DELTA_SETTINGS)); report_heading_etc(forReplay, F(STR_DELTA_SETTINGS));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod) PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod)
@@ -132,6 +134,8 @@
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_SCARA_SETTINGS " (" STR_S_SEG_PER_SEC TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")")); report_heading_etc(forReplay, F(STR_SCARA_SETTINGS " (" STR_S_SEG_PER_SEC TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")"));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M665 S"), segments_per_second PSTR(" M665 S"), segments_per_second
@@ -170,6 +174,8 @@
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_POLARGRAPH_SETTINGS)); report_heading_etc(forReplay, F(STR_POLARGRAPH_SETTINGS));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M665 S"), LINEAR_UNIT(segments_per_second), PSTR(" M665 S"), LINEAR_UNIT(segments_per_second),
@@ -196,10 +202,11 @@
} }
void GcodeSuite::M665_report(const bool forReplay/*=true*/) { void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_POLAR_SETTINGS)); report_heading_etc(forReplay, F(STR_POLAR_SETTINGS));
SERIAL_ECHOLNPGM_P(PSTR(" M665 S"), segments_per_second); SERIAL_ECHOLNPGM_P(PSTR(" M665 S"), segments_per_second);
} }
#endif #endif // POLAR
#endif // IS_KINEMATIC #endif // IS_KINEMATIC
+5 -1
View File
@@ -56,11 +56,13 @@
} }
} }
} }
if (is_err) SERIAL_ECHOLNPGM("?M666 offsets must be <= 0"); if (is_err) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("M666 offsets must be <= 0"));
if (!is_set) M666_report(); if (!is_set) M666_report();
} }
void GcodeSuite::M666_report(const bool forReplay/*=true*/) { void GcodeSuite::M666_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT)); report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a) PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a)
@@ -105,6 +107,8 @@
} }
void GcodeSuite::M666_report(const bool forReplay/*=true*/) { void GcodeSuite::M666_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT)); report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT));
SERIAL_ECHOPGM(" M666"); SERIAL_ECHOPGM(" M666");
#if ENABLED(X_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS)
+2
View File
@@ -92,6 +92,8 @@ void GcodeSuite::M852() {
} }
void GcodeSuite::M852_report(const bool forReplay/*=true*/) { void GcodeSuite::M852_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_SKEW_FACTOR)); report_heading_etc(forReplay, F(STR_SKEW_FACTOR));
SERIAL_ECHOPGM(" M852 I", p_float_t(planner.skew_factor.xy, 6)); SERIAL_ECHOPGM(" M852 I", p_float_t(planner.skew_factor.xy, 6));
#if ENABLED(SKEW_CORRECTION_FOR_Z) #if ENABLED(SKEW_CORRECTION_FOR_Z)
+11 -1
View File
@@ -67,7 +67,7 @@
if (WITHIN(lval, 0, VOLUMETRIC_EXTRUDER_LIMIT_MAX)) if (WITHIN(lval, 0, VOLUMETRIC_EXTRUDER_LIMIT_MAX))
planner.set_volumetric_extruder_limit(target_extruder, lval); planner.set_volumetric_extruder_limit(target_extruder, lval);
else else
SERIAL_ECHOLNPGM("?L value out of range (0-" STRINGIFY(VOLUMETRIC_EXTRUDER_LIMIT_MAX) ")."); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("L value out of range (0-" STRINGIFY(VOLUMETRIC_EXTRUDER_LIMIT_MAX) ")."));
} }
#endif #endif
@@ -75,6 +75,8 @@
} }
void GcodeSuite::M200_report(const bool forReplay/*=true*/) { void GcodeSuite::M200_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
if (!forReplay) { if (!forReplay) {
report_heading(forReplay, F(STR_FILAMENT_SETTINGS), false); report_heading(forReplay, F(STR_FILAMENT_SETTINGS), false);
if (!parser.volumetric_enabled) SERIAL_ECHOPGM(" (Disabled):"); if (!parser.volumetric_enabled) SERIAL_ECHOPGM(" (Disabled):");
@@ -142,6 +144,8 @@ void GcodeSuite::M201() {
} }
void GcodeSuite::M201_report(const bool forReplay/*=true*/) { void GcodeSuite::M201_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_MAX_ACCELERATION)); report_heading_etc(forReplay, F(STR_MAX_ACCELERATION));
#if NUM_AXES #if NUM_AXES
SERIAL_ECHOPGM_P( SERIAL_ECHOPGM_P(
@@ -198,6 +202,8 @@ void GcodeSuite::M203() {
} }
void GcodeSuite::M203_report(const bool forReplay/*=true*/) { void GcodeSuite::M203_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_MAX_FEEDRATES)); report_heading_etc(forReplay, F(STR_MAX_FEEDRATES));
#if NUM_AXES #if NUM_AXES
SERIAL_ECHOPGM_P( SERIAL_ECHOPGM_P(
@@ -255,6 +261,8 @@ void GcodeSuite::M204() {
} }
void GcodeSuite::M204_report(const bool forReplay/*=true*/) { void GcodeSuite::M204_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_ACCELERATION_P_R_T)); report_heading_etc(forReplay, F(STR_ACCELERATION_P_R_T));
SERIAL_ECHOLNPGM_P( SERIAL_ECHOLNPGM_P(
PSTR(" M204 P"), LINEAR_UNIT(planner.settings.acceleration) PSTR(" M204 P"), LINEAR_UNIT(planner.settings.acceleration)
@@ -329,6 +337,8 @@ void GcodeSuite::M205() {
} }
void GcodeSuite::M205_report(const bool forReplay/*=true*/) { void GcodeSuite::M205_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F( report_heading_etc(forReplay, F(
"Advanced (" M205_MIN_SEG_TIME_STR "<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>" "Advanced (" M205_MIN_SEG_TIME_STR "<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>") TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
+2
View File
@@ -164,6 +164,8 @@ void GcodeSuite::M217() {
} }
void GcodeSuite::M217_report(const bool forReplay/*=true*/) { void GcodeSuite::M217_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_TOOL_CHANGING)); report_heading_etc(forReplay, F(STR_TOOL_CHANGING));
SERIAL_ECHOPGM(" M217"); SERIAL_ECHOPGM(" M217");
+2
View File
@@ -63,6 +63,8 @@ void GcodeSuite::M218() {
} }
void GcodeSuite::M218_report(const bool forReplay/*=true*/) { void GcodeSuite::M218_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_HOTEND_OFFSETS)); report_heading_etc(forReplay, F(STR_HOTEND_OFFSETS));
for (uint8_t e = 1; e < HOTENDS; ++e) { for (uint8_t e = 1; e < HOTENDS; ++e) {
report_echo_start(forReplay); report_echo_start(forReplay);
+2
View File
@@ -55,6 +55,8 @@ void GcodeSuite::M281() {
} }
void GcodeSuite::M281_report(const bool forReplay/*=true*/) { void GcodeSuite::M281_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_SERVO_ANGLES)); report_heading_etc(forReplay, F(STR_SERVO_ANGLES));
for (uint8_t i = 0; i < NUM_SERVOS; ++i) { for (uint8_t i = 0; i < NUM_SERVOS; ++i) {
switch (i) { switch (i) {
+2
View File
@@ -78,6 +78,8 @@ void GcodeSuite::M301() {
} }
void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t eindex/*=-1*/)) { void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t eindex/*=-1*/)) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_HOTEND_PID)); report_heading(forReplay, F(STR_HOTEND_PID));
IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr int8_t eindex = -1); IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr int8_t eindex = -1);
HOTEND_LOOP() { HOTEND_LOOP() {
+10 -8
View File
@@ -25,12 +25,13 @@
#if ENABLED(PREVENT_COLD_EXTRUSION) #if ENABLED(PREVENT_COLD_EXTRUSION)
#include "../gcode.h" #include "../gcode.h"
#include "../../module/temperature.h"
#if ENABLED(DWIN_LCD_PROUI) #if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/e3v2/proui/dwin.h" #include "../../lcd/extui/ui_api.h"
#endif #endif
#include "../../module/temperature.h"
/** /**
* M302: Allow cold extrudes, or set the minimum extrude temperature * M302: Allow cold extrudes, or set the minimum extrude temperature
* *
@@ -50,13 +51,14 @@ void GcodeSuite::M302() {
const bool seen_S = parser.seen('S'); const bool seen_S = parser.seen('S');
if (seen_S) { if (seen_S) {
thermalManager.extrude_min_temp = parser.value_celsius(); thermalManager.extrude_min_temp = parser.value_celsius();
thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); TERN_(EXTENSIBLE_UI, ExtUI::onSetMinExtrusionTemp(thermalManager.extrude_min_temp));
TERN_(DWIN_LCD_PROUI, hmiData.extMinT = thermalManager.extrude_min_temp);
} }
if (parser.seen('P')) const bool seen_P = parser.seen('P');
thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || parser.value_bool(); if (seen_P || seen_S) {
else if (!seen_S) { thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || (seen_P && parser.value_bool());
}
else {
// Report current state // Report current state
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOLN(F("Cold extrudes are "), thermalManager.allow_cold_extrude ? F("en") : F("dis"), F("abled (min temp "), thermalManager.extrude_min_temp, F("C)")); SERIAL_ECHOLN(F("Cold extrudes are "), thermalManager.allow_cold_extrude ? F("en") : F("dis"), F("abled (min temp "), thermalManager.extrude_min_temp, F("C)"));
+2
View File
@@ -42,6 +42,8 @@ void GcodeSuite::M304() {
} }
void GcodeSuite::M304_report(const bool forReplay/*=true*/) { void GcodeSuite::M304_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_BED_PID)); report_heading_etc(forReplay, F(STR_BED_PID));
SERIAL_ECHOLNPGM(" M304" SERIAL_ECHOLNPGM(" M304"
" P", thermalManager.temp_bed.pid.p() " P", thermalManager.temp_bed.pid.p()
+2
View File
@@ -42,6 +42,8 @@ void GcodeSuite::M309() {
} }
void GcodeSuite::M309_report(const bool forReplay/*=true*/) { void GcodeSuite::M309_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_CHAMBER_PID)); report_heading_etc(forReplay, F(STR_CHAMBER_PID));
SERIAL_ECHOLNPGM(" M309" SERIAL_ECHOLNPGM(" M309"
" P", thermalManager.temp_chamber.pid.p() " P", thermalManager.temp_chamber.pid.p()
+2
View File
@@ -96,6 +96,8 @@ void GcodeSuite::M92() {
} }
void GcodeSuite::M92_report(const bool forReplay/*=true*/, const int8_t e/*=-1*/) { void GcodeSuite::M92_report(const bool forReplay/*=true*/, const int8_t e/*=-1*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_STEPS_PER_UNIT)); report_heading_etc(forReplay, F(STR_STEPS_PER_UNIT));
#if NUM_AXES #if NUM_AXES
#define PRINT_EOL #define PRINT_EOL
@@ -20,6 +20,11 @@
* *
*/ */
/**
* gcode/control/M10_M11.cpp
* Air Evacuation
*/
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(AIR_EVACUATION) #if ENABLED(AIR_EVACUATION)
+2
View File
@@ -40,6 +40,8 @@ void GcodeSuite::M211() {
} }
void GcodeSuite::M211_report(const bool forReplay/*=true*/) { void GcodeSuite::M211_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_SOFT_ENDSTOPS)); report_heading_etc(forReplay, F(STR_SOFT_ENDSTOPS));
SERIAL_ECHOPGM(" M211 S", AS_DIGIT(soft_endstop._enabled), " ; "); SERIAL_ECHOPGM(" M211 S", AS_DIGIT(soft_endstop._enabled), " ; ");
serialprintln_onoff(soft_endstop._enabled); serialprintln_onoff(soft_endstop._enabled);
+2 -2
View File
@@ -79,7 +79,7 @@ void GcodeSuite::M42() {
#ifdef OUTPUT_OPEN_DRAIN #ifdef OUTPUT_OPEN_DRAIN
case 5: pinMode(pin, OUTPUT_OPEN_DRAIN); break; case 5: pinMode(pin, OUTPUT_OPEN_DRAIN); break;
#endif #endif
default: SERIAL_ECHOLNPGM("Invalid Pin Mode"); return; default: SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Invalid Pin Mode")); return;
} }
} }
@@ -94,7 +94,7 @@ void GcodeSuite::M42() {
#endif #endif
if (avoidWrite) { if (avoidWrite) {
SERIAL_ECHOLNPGM("?Cannot write to INPUT"); SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Cannot write to INPUT"));
return; return;
} }
+6 -1
View File
@@ -32,11 +32,16 @@ void GcodeSuite::M85() {
const millis_t ms = parser.value_millis_from_seconds(); const millis_t ms = parser.value_millis_from_seconds();
#if LASER_SAFETY_TIMEOUT_MS > 0 #if LASER_SAFETY_TIMEOUT_MS > 0
if (ms && ms <= LASER_SAFETY_TIMEOUT_MS) { if (ms && ms <= LASER_SAFETY_TIMEOUT_MS) {
SERIAL_ECHO_MSG("M85 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety."); SERIAL_ECHO_MSG(GCODE_ERR_MSG("M85 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety."));
return; return;
} }
#endif #endif
max_inactive_time = ms; max_inactive_time = ms;
} }
else {
#if DISABLED(MARLIN_SMALL_BUILD)
SERIAL_ECHOLNPGM("Inactivity timeout ", MS_TO_SEC(max_inactive_time), " s.");
#endif
}
} }
+3 -3
View File
@@ -24,8 +24,8 @@
#if ENABLED(PLATFORM_M997_SUPPORT) #if ENABLED(PLATFORM_M997_SUPPORT)
#if ENABLED(DWIN_LCD_PROUI) #if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/e3v2/proui/dwin.h" #include "../../lcd/extui/ui_api.h"
#endif #endif
/** /**
@@ -33,7 +33,7 @@
*/ */
void GcodeSuite::M997() { void GcodeSuite::M997() {
TERN_(DWIN_LCD_PROUI, dwinRebootScreen()); TERN_(EXTENSIBLE_UI, ExtUI::onFirmwareFlash());
flashFirmware(parser.intval('S')); flashFirmware(parser.intval('S'));
@@ -141,6 +141,8 @@ void GcodeSuite::M900() {
} }
void GcodeSuite::M900_report(const bool forReplay/*=true*/) { void GcodeSuite::M900_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading(forReplay, F(STR_LINEAR_ADVANCE)); report_heading(forReplay, F(STR_LINEAR_ADVANCE));
#if DISTINCT_E < 2 #if DISTINCT_E < 2
report_echo_start(forReplay); report_echo_start(forReplay);
@@ -67,6 +67,8 @@ void GcodeSuite::M710() {
} }
void GcodeSuite::M710_report(const bool forReplay/*=true*/) { void GcodeSuite::M710_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_CONTROLLER_FAN)); report_heading_etc(forReplay, F(STR_CONTROLLER_FAN));
SERIAL_ECHOLNPGM(" M710" SERIAL_ECHOLNPGM(" M710"
" S", int(controllerFan.settings.active_speed), " S", int(controllerFan.settings.active_speed),
@@ -68,7 +68,7 @@ void GcodeSuite::M907() {
#define HAS_X_Y_XY_I_J_K_U_V_W 1 #define HAS_X_Y_XY_I_J_K_U_V_W 1
#endif #endif
#if HAS_X_Y_XY_I_J_K_U_V_W || ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_Z) #if HAS_X_Y_XY_I_J_K_U_V_W || HAS_MOTOR_CURRENT_PWM_E || PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
if (!parser.seen("S" if (!parser.seen("S"
#if HAS_X_Y_XY_I_J_K_U_V_W #if HAS_X_Y_XY_I_J_K_U_V_W
@@ -77,7 +77,7 @@ void GcodeSuite::M907() {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
"Z" "Z"
#endif #endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) #if HAS_MOTOR_CURRENT_PWM_E
"E" "E"
#endif #endif
)) return M907_report(); )) return M907_report();
@@ -94,7 +94,7 @@ void GcodeSuite::M907() {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
if (parser.seenval('Z')) stepper.set_digipot_current(1, parser.value_int()); if (parser.seenval('Z')) stepper.set_digipot_current(1, parser.value_int());
#endif #endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) #if HAS_MOTOR_CURRENT_PWM_E
if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int()); if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int());
#endif #endif
@@ -126,12 +126,16 @@ void GcodeSuite::M907() {
#if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM
void GcodeSuite::M907_report(const bool forReplay/*=true*/) { void GcodeSuite::M907_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_STEPPER_MOTOR_CURRENTS)); report_heading_etc(forReplay, F(STR_STEPPER_MOTOR_CURRENTS));
#if HAS_MOTOR_CURRENT_PWM #if HAS_MOTOR_CURRENT_PWM
SERIAL_ECHOLNPGM_P( // PWM-based has 3 values: SERIAL_ECHOLNPGM_P( // PWM-based has 3 values:
PSTR(" M907 X"), stepper.motor_current_setting[0] // X, Y, (I, J, K, U, V, W) PSTR(" M907 X"), stepper.motor_current_setting[0] // X, Y, (I, J, K, U, V, W)
, SP_Z_STR, stepper.motor_current_setting[1] // Z , SP_Z_STR, stepper.motor_current_setting[1] // Z
, SP_E_STR, stepper.motor_current_setting[2] // E #if HAS_MOTOR_CURRENT_PWM_E
, SP_E_STR, stepper.motor_current_setting[2] // E
#endif
); );
#elif HAS_MOTOR_CURRENT_SPI #elif HAS_MOTOR_CURRENT_SPI
SERIAL_ECHOPGM(" M907"); // SPI-based has 5 values: SERIAL_ECHOPGM(" M907"); // SPI-based has 5 values:
@@ -104,6 +104,8 @@ void say_shaping() {
} }
void GcodeSuite::M493_report(const bool forReplay/*=true*/) { void GcodeSuite::M493_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_FT_MOTION)); report_heading_etc(forReplay, F(STR_FT_MOTION));
const ft_config_t &c = ftMotion.cfg; const ft_config_t &c = ftMotion.cfg;
SERIAL_ECHOPGM(" M493 S", c.mode); SERIAL_ECHOPGM(" M493 S", c.mode);
@@ -38,6 +38,8 @@
void GcodeSuite::M207() { fwretract.M207(); } void GcodeSuite::M207() { fwretract.M207(); }
void GcodeSuite::M207_report(const bool forReplay/*=true*/) { void GcodeSuite::M207_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_RETRACT_S_F_Z)); report_heading_etc(forReplay, F(STR_RETRACT_S_F_Z));
fwretract.M207_report(); fwretract.M207_report();
} }
@@ -53,6 +55,8 @@ void GcodeSuite::M207_report(const bool forReplay/*=true*/) {
void GcodeSuite::M208() { fwretract.M208(); } void GcodeSuite::M208() { fwretract.M208(); }
void GcodeSuite::M208_report(const bool forReplay/*=true*/) { void GcodeSuite::M208_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_RECOVER_S_F)); report_heading_etc(forReplay, F(STR_RECOVER_S_F));
fwretract.M208_report(); fwretract.M208_report();
} }
@@ -68,6 +72,8 @@ void GcodeSuite::M208_report(const bool forReplay/*=true*/) {
void GcodeSuite::M209() { fwretract.M209(); } void GcodeSuite::M209() { fwretract.M209(); }
void GcodeSuite::M209_report(const bool forReplay/*=true*/) { void GcodeSuite::M209_report(const bool forReplay/*=true*/) {
TERN_(MARLIN_SMALL_BUILD, return);
report_heading_etc(forReplay, F(STR_AUTO_RETRACT_S)); report_heading_etc(forReplay, F(STR_AUTO_RETRACT_S));
fwretract.M209_report(); fwretract.M209_report();
} }

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