Compare commits

...

132 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
Scott Lahteine 1eff7796d5 add _t 2024-03-09 21:24:08 -06: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
InsanityAutomation 85f60cc71a Baseline ExtUI Additions 2024-01-31 08:42:39 -05:00
307 changed files with 3637 additions and 2701 deletions
+4
View File
@@ -14,6 +14,8 @@ on:
- config/**
- data/**
- docs/**
- test/**
- Marlin/tests/**
- '**/*.md'
push:
branches:
@@ -23,6 +25,8 @@ on:
- config/**
- data/**
- docs/**
- test/**
- Marlin/tests/**
- '**/*.md'
jobs:
+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
+33 -20
View File
@@ -2,22 +2,23 @@ SCRIPTS_DIR := buildroot/share/scripts
CONTAINER_RT_BIN := docker
CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio
CONTAINER_IMAGE := marlin-dev
UNIT_TEST_CONFIG ?= default
help:
@echo "Tasks for local development:"
@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-local : Run a single test locally"
@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-docker : Run all tests locally, using docker"
# @echo "make unit-test-single-ci : Run a single code test from inside the CI"
# @echo "make unit-test-single-local : Run a single code test locally"
# @echo "make unit-test-single-local-docker : Run a single code test locally, using docker-compose"
@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-compose"
@echo "make setup-local-docker : Setup local docker-compose"
@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 "Options for testing:"
@echo " TEST_TARGET Set when running tests-single-*, to select the"
@@ -27,6 +28,9 @@ help:
@echo " run on GitHub CI"
@echo " ONLY_TEST Limit tests to only those that contain this, or"
@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 " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
@@ -51,27 +55,29 @@ tests-single-local-docker:
$(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:
@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 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:
@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)
#unit-test-single-ci:
# export GIT_RESET_HARD=true
# $(MAKE) unit-test-single-local TEST_TARGET=$(TEST_TARGET)
unit-test-single-local:
platformio run -t marlin_$(UNIT_TEST_CONFIG) -e linux_native_test
# TODO: How can we limit tests with ONLY_TEST with platformio?
#unit-test-single-local:
# @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make unit-test-all-local" ; return 1; fi
# platformio run -t marlin_$(TEST_TARGET)
#unit-test-single-local-docker:
# @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make unit-test-all-local-docker" ; return 1; 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 unit-test-single-local TEST_TARGET=$(TEST_TARGET) ONLY_TEST="$(ONLY_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
@@ -85,7 +91,14 @@ setup-local-docker:
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
.PHONY: $(PINS) format-pins validate-pins
$(PINS): %:
@echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@
@echo "Formatting $@"
@python $(SCRIPTS_DIR)/pinsformat.py $< $@
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)
+2 -2
View File
@@ -672,7 +672,7 @@
* 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 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_K1 0.95 // Smoothing factor within any PID loop
@@ -2218,7 +2218,7 @@
#if ENABLED(LCD_BED_TRAMMING)
#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_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_USE_PROBE
#if ENABLED(BED_TRAMMING_USE_PROBE)
+11 -11
View File
@@ -1185,24 +1185,19 @@
* 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
* 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
* 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.
* If the buffer is too small at runtime, input shaping will have reduced
* effectiveness during high speed movements.
*
* 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.
* Tune with M593 D<factor> F<frequency>
*/
//#define INPUT_SHAPING_X
//#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)
#define SHAPING_FREQ_X 40.0 // (Hz) The default dominant resonant frequency on the X axis.
#define SHAPING_ZETA_X 0.15 // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping).
@@ -1211,6 +1206,10 @@
#define SHAPING_FREQ_Y 40.0 // (Hz) The default dominant resonant frequency on the Y axis.
#define SHAPING_ZETA_Y 0.15 // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif
#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_MENU // Add a menu to the LCD to set shaping parameters.
@@ -1584,7 +1583,7 @@
#if HAS_MARLINUI_U8GLIB
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash.
#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.
#endif
#endif
@@ -4261,7 +4260,8 @@
/**
* 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
*/
//#define FREEZE_FEATURE
+1 -1
View File
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-04-15"
//#define STRING_DISTRIBUTION_DATE "2024-05-29"
/**
* 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."
#endif
#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()
#endif
#endif
+1 -1
View File
@@ -629,7 +629,7 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
#if HAS_DGUS_LCD
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
template<typename Cfg>
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
+1 -1
View File
@@ -205,7 +205,7 @@
static ring_buffer_pos_t available();
static void write(const uint8_t c);
static void flushTX();
#if HAS_DGUS_LCD
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
static ring_buffer_pos_t get_tx_buffer_free();
#endif
+1 -1
View File
@@ -61,7 +61,7 @@
#else
#define G2_PWM_Z 0
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#if HAS_MOTOR_CURRENT_PWM_E
#define G2_PWM_E 1
#else
#define G2_PWM_E 0
+20 -22
View File
@@ -18,30 +18,30 @@ extern "C" {
void sd_mmc_spi_mem_init() {
}
Ctrl_status sd_mmc_spi_test_unit_ready() {
#ifdef DISABLE_DUE_SD_MMC
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;
inline bool media_ready() {
return IS_SD_INSERTED() && !IS_SD_PRINTING() && !IS_SD_FILE_OPEN() && card.isMounted();
}
bool sd_mmc_spi_unload(bool) { return true; }
bool sd_mmc_spi_wr_protect() { return false; }
bool sd_mmc_spi_removal() {
return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted());
bool sd_mmc_spi_removal() { return !media_ready(); }
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
@@ -61,8 +61,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT;
#endif
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
if (!media_ready()) return CTRL_NO_PRESENT;
#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
return CTRL_NO_PRESENT;
#endif
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
if (!media_ready()) return CTRL_NO_PRESENT;
#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.
//!/
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.
@@ -87,7 +87,7 @@ extern void sd_mmc_spi_mem_init(void);
//! Media not present -> CTRL_NO_PRESENT
//! 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.
@@ -98,7 +98,7 @@ extern Ctrl_status sd_mmc_spi_test_unit_ready(void);
//! Media ready -> CTRL_GOOD
//! 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
*
@@ -109,7 +109,7 @@ extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
*
* \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.
@@ -120,14 +120,14 @@ extern bool sd_mmc_spi_unload(bool unload);
//!
//! @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.
//!
//! @return false -> The memory isn't removed
//!
extern bool sd_mmc_spi_removal(void);
bool sd_mmc_spi_removal();
//---- ACCESS DATA FUNCTIONS ----
@@ -147,7 +147,7 @@ extern bool sd_mmc_spi_removal(void);
//! It is ready -> CTRL_GOOD
//! 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
//!
@@ -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
//! 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
+20 -1
View File
@@ -142,12 +142,31 @@
// ADC
//
#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_INDEX(pin) pin
#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
//
+3 -1
View File
@@ -232,7 +232,9 @@ int MarlinHAL::freeMemory() {
return &top - _sbrk(0);
}
void MarlinHAL::adc_init() {}
void MarlinHAL::adc_init() {
analogReadResolution(HAL_ADC_RESOLUTION);
}
void MarlinHAL::adc_enable(const pin_t pin) {
#if TEMP_SENSOR_SOC
+2 -2
View File
@@ -31,8 +31,8 @@
struct MarlinSerial : public Usart {
MarlinSerial(
struct usart_config_t *usart_device,
gpio_pin_t tx_pin,
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,
+9 -4
View File
@@ -1,6 +1,6 @@
/**
* 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
* it is used to configure the arduino core (and ddl) automatically according
* to the settings in Configuration.h and Configuration_adv.h.
*/
#pragma once
@@ -44,7 +44,7 @@
#define DISABLE_SERIAL_GLOBALS 1
// increase the size of the Usart buffers (both RX and TX)
// NOTE:
// 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
@@ -64,7 +64,12 @@
// redirect printf to host serial
#define REDIRECT_PRINTF_TO_SERIAL 1
// FIXME override F_CPU to PCLK1, as marlin freaks out otherwise
#define F_CPU (SYSTEM_CLOCK_FREQUENCIES.pclk1)
// 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_
+1 -1
View File
@@ -30,7 +30,7 @@
#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
// 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
+24 -9
View File
@@ -96,29 +96,44 @@ void core_hook_sysclock_init() {
#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)
stc_clk_sysclk_cfg_t sysClkConf = {
constexpr stc_clk_sysclk_cfg_t sysClkConf = {
.enHclkDiv = ClkSysclkDiv1, // HCLK = 200 MHz (CPU)
.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))
.enPclk2Div = ClkSysclkDiv4, // PCLK2 = 50 MHz (ADC)
.enPclk3Div = ClkSysclkDiv4, // PCLK3 = 50 MHz (I2C, WDT)
.enPclk2Div = ClkSysclkDiv8, // PCLK2 = 25 MHz (ADC)
.enPclk3Div = ClkSysclkDiv8, // PCLK3 = 25 MHz (I2C, WDT)
.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);
// Set power mode
#define POWER_MODE_SYSTEM_CLOCK 200000000 // 200 MHz
power_mode_update_pre(POWER_MODE_SYSTEM_CLOCK);
power_mode_update_pre(sysclock);
// Switch to MPLL as sysclk source
CLK_SetSysClkSource(CLKSysSrcMPLL);
// Set power mode
power_mode_update_post(POWER_MODE_SYSTEM_CLOCK);
#undef POWER_MODE_SYSTEM_CLOCK
power_mode_update_post(sysclock);
}
#endif // ARDUINO_ARCH_HC32
+31 -27
View File
@@ -38,44 +38,48 @@ extern Timer0 step_timer;
// 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
// as a workaround, PCLK1 = 50MHz is assumed (check with clock dump in MarlinHAL::init())
#define HAL_TIMER_RATE 50000000 // 50MHz
// #define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY
// TODO: CYCLES_PER_MICROSECOND seems to be used by Marlin to calculate the number of cycles per microsecond in the timer ISRs
// 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
#define CYCLES_PER_MICROSECOND (HAL_TIMER_RATE / 1000000UL)
/**
* HAL_TIMER_RATE must be known at compile time since it's used to calculate
* STEPPER_TIMER_RATE, which is used in 'constexpr' calculations.
* On the HC32F460 the timer rate depends on PCLK1, which is derived from the
* 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
* as F_CPU with a divider of 4 in 'sysclock.cpp::core_hook_sysclock_init'.
*
* If you face issues with this assumption, please double-check with the values
* 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
#define TEMP_TIMER_NUM (&temp_timer)
#define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02
#define TEMP_TIMER_PRESCALE 16ul
#define TEMP_TIMER_RATE 1000 // 1kHz
#define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // Alias for Marlin
#define TEMP_TIMER_NUM (&temp_timer)
#define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02
#define TEMP_TIMER_PRESCALE 16UL // 12.5MHz
#define TEMP_TIMER_RATE 1000 // 1kHz
#define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // 1kHz also
// Stepper timer
#define STEP_TIMER_NUM (&step_timer)
#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_01
#define STEPPER_TIMER_PRESCALE 16ul
#define STEP_TIMER_NUM (&step_timer)
#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_00 // Top priority, nothing else uses it
#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_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000)
#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
// Pulse timer (== stepper timer)
#define PULSE_TIMER_NUM STEP_TIMER_NUM
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
#define PULSE_TIMER_NUM STEP_TIMER_NUM
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
//
// Channel aliases
//
#define MF_TIMER_TEMP TEMP_TIMER_NUM
#define MF_TIMER_STEP STEP_TIMER_NUM
#define MF_TIMER_PULSE PULSE_TIMER_NUM
#define MF_TIMER_TEMP TEMP_TIMER_NUM
#define MF_TIMER_STEP STEP_TIMER_NUM
#define MF_TIMER_PULSE PULSE_TIMER_NUM
//
// HAL functions
+1 -1
View File
@@ -100,7 +100,7 @@ extern DefaultSerial1 USBSerial;
#else
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#endif
#if HAS_DGUS_LCD
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.available()
#endif
#endif
+1 -1
View File
@@ -112,7 +112,7 @@
#else
#error "LCD_SERIAL_PORT must be from 1 to 9, or -1 for Native USB."
#endif
#if HAS_DGUS_LCD
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif
#endif
+1
View File
@@ -53,6 +53,7 @@
inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
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:
usart_rx_callback_t _rx_callback;
+1 -1
View File
@@ -138,7 +138,7 @@
#define LCD_SERIAL MSERIAL(1) // dummy port
static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.")
#endif
#if HAS_DGUS_LCD
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif
#endif
+1 -1
View File
@@ -266,7 +266,7 @@ PGMSTR(M112_KILL_STR, "M112 Shutdown");
MarlinState marlin_state = MF_INITIALIZING;
// 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
#if HAS_RESUME_CONTINUE
+8 -3
View File
@@ -383,9 +383,9 @@
#define BOARD_CREALITY_V452 5050 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V453 5051 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
#define BOARD_CREALITY_V521 5052 // Creality v5.2.1 (STM32F103VE) as found in the SV04
#define BOARD_CREALITY_V24S1 5053 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7
#define BOARD_CREALITY_V24S1_301 5054 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1
#define BOARD_CREALITY_V25S1 5055 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
#define BOARD_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) CR-FDM-v24S1_301 as found in the Ender-3 S1
#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_FLY_MINI 5057 // FLYmaker FLY MINI (STM32F103RC)
#define BOARD_FLSUN_HISPEED 5058 // FLSUN HiSpeedV1 (STM32F103VE)
@@ -468,6 +468,11 @@
#define BOARD_FYSETC_CHEETAH_V30 5250 // FYSETC Cheetah V3.0 (STM32F446RC)
#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
//
+1
View File
@@ -135,6 +135,7 @@
#define STR_BUSY_PAUSED_FOR_USER "busy: paused for user"
#define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
#define STR_Z_MOVE_COMP "Z_move_comp"
#define STR_LINE_NO "Line: "
#define STR_RESEND "Resend: "
#define STR_UNKNOWN_COMMAND "Unknown command: \""
#define STR_ACTIVE_EXTRUDER "Active Extruder: "
+5 -4
View File
@@ -89,7 +89,8 @@
#define HYPOT2(x,y) (sq(x)+sq(y))
#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 SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);})
@@ -196,8 +197,8 @@
#define ENABLED(V...) DO(ENA,&&,V)
#define DISABLED(V...) DO(DIS,&&,V)
#define ANY(V...) !DISABLED(V)
#define ALL ENABLED
#define NONE DISABLED
#define ALL(V...) ENABLED(V)
#define NONE(V...) DISABLED(V)
#define COUNT_ENABLED(V...) DO(ENA,+,V)
#define MANY(V...) (COUNT_ENABLED(V) > 1)
@@ -629,7 +630,7 @@
#define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()()
// Force define expansion
#define EVAL EVAL16
#define EVAL(V...) EVAL16(V)
#define EVAL4096(V...) EVAL2048(EVAL2048(V))
#define EVAL2048(V...) EVAL1024(EVAL1024(V))
#define EVAL1024(V...) EVAL512(EVAL512(V))
+5 -5
View File
@@ -143,13 +143,13 @@ public:
// Set with format string and arguments, like printf
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>
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>
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
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)); }
template<typename... Args>
MString& appendf_P(PGM_P const fmt, Args... more) {
MString& appendf_P(PGM_P const pfmt, Args... more) {
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"));
return *this;
}
+3 -3
View File
@@ -271,13 +271,13 @@ public:
SString& set() { super::set(); return *this; }
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>
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>
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>
SString& set(const T &v) { super::set(v); return *this; }
+12 -4
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_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_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 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_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_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_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)
#if NUM_AXES
#define NUM_AXES_SEP ,
#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_LOGICAL(T) , LOGICAL_AXIS_ARGS(T)
#else
#define NUM_AXES_SEP
#define MAIN_AXIS_MAP(F)
#define MAIN_AXIS_MAP_LC(F)
#define OPTARGS_NUM(T)
#define OPTARGS_LOGICAL(T)
#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_ELEM_(T) NUM_AXIS_ELEM(T) 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
#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_ELEM_(T) LOGICAL_AXIS_ELEM(T) 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_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
template<size_t N>
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, 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,
@@ -219,7 +226,7 @@ typedef struct {
//
// - 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
// - 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 {
@@ -603,9 +610,9 @@ struct XYZval {
// 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); }
// 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
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
FI constexpr XYZval<T> copy() const { XYZval<T> o = *this; return o; }
@@ -1084,6 +1091,7 @@ public:
FI bool toggle(const AxisEnum n) { TBI(bits, n); return TEST(bits, n); }
FI void bset(const AxisEnum n) { SBI(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]
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)
#include "../../../core/debug_out.h"
// M102 S-5 Read raw Calibrate data
// M102 S-6 Start Calibrate
// 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'.)
// M102 S-1 Read sensor information
/**
* M102 S<#> : Set adjustable Z height in 0.1mm units (10ths of a mm)
* (e.g., 'M102 S4' enables adjusting for Z <= 0.4mm)
* 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 CMD_READ_VERSION 1016
+3 -3
View File
@@ -765,7 +765,7 @@ void unified_bed_leveling::shift_mesh_height() {
const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1;
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());
#if HAS_MARLINUI_MENU
@@ -1494,7 +1494,7 @@ void unified_bed_leveling::smart_fill_mesh() {
for (uint8_t i = 0; i < 3; ++i) {
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);
if ((abort_flag = isnan(measured_z))) break;
@@ -1550,7 +1550,7 @@ void unified_bed_leveling::smart_fill_mesh() {
#endif
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
+2 -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
current_retract[active_extruder] = base_retract;
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?
@@ -165,8 +165,7 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
// Recover E, set_current_to_destination
prepare_internal_move_to_destination(
(swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s)
* TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS))
MUL_TERN(RETRACT_SYNC_MIXING, swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s, MIXING_STEPPERS)
);
}
+1 -1
View File
@@ -130,7 +130,7 @@ public:
}
// 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) {
#if ENABLED(NEOPIXEL2_INSERIES)
+1 -1
View File
@@ -31,7 +31,7 @@ static uint32_t axis_plug_backward = 0;
void stepper_driver_backward_error(FSTR_P const fstr) {
SERIAL_ERROR_START();
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() {
+6
View File
@@ -32,6 +32,12 @@
/**
* 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() {
if (MOTION_CONDITIONS) {
+2 -2
View File
@@ -683,7 +683,7 @@ G29_TYPE GcodeSuite::G29() {
if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue;
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 (PR_INNER_VAR == inStart) {
@@ -782,7 +782,7 @@ G29_TYPE GcodeSuite::G29() {
for (uint8_t i = 0; i < 3; ++i) {
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
abl.probePos = xy_pos_t(points[i]);
+1 -1
View File
@@ -253,7 +253,7 @@ void GcodeSuite::G29() {
if (state == MeshNext) {
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();
+1 -1
View File
@@ -149,7 +149,7 @@ void GcodeSuite::M48() {
for (uint8_t n = 0; n < n_samples; ++n) {
#if HAS_STATUS_MESSAGE
// 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
// When there are "legs" of movement move around the point before probing
@@ -20,6 +20,11 @@
*
*/
/**
* gcode/control/M10_M11.cpp
* Air Evacuation
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(AIR_EVACUATION)
@@ -68,7 +68,7 @@ void GcodeSuite::M907() {
#define HAS_X_Y_XY_I_J_K_U_V_W 1
#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 HAS_X_Y_XY_I_J_K_U_V_W
@@ -77,7 +77,7 @@ void GcodeSuite::M907() {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
"Z"
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#if HAS_MOTOR_CURRENT_PWM_E
"E"
#endif
)) return M907_report();
@@ -94,7 +94,7 @@ void GcodeSuite::M907() {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
if (parser.seenval('Z')) stepper.set_digipot_current(1, parser.value_int());
#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());
#endif
@@ -133,7 +133,7 @@ void GcodeSuite::M907() {
SERIAL_ECHOLNPGM_P( // PWM-based has 3 values:
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
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#if HAS_MOTOR_CURRENT_PWM_E
, SP_E_STR, stepper.motor_current_setting[2] // E
#endif
);
@@ -44,6 +44,15 @@ void GcodeSuite::M593_report(const bool forReplay/*=true*/) {
" D", stepper.get_shaping_damping_ratio(Y_AXIS)
);
#endif
#if ENABLED(INPUT_SHAPING_Z)
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
report_echo_start(forReplay);
#endif
SERIAL_ECHOLNPGM(" M593 Z"
" F", stepper.get_shaping_frequency(Z_AXIS),
" D", stepper.get_shaping_damping_ratio(Z_AXIS)
);
#endif
}
/**
@@ -59,14 +68,17 @@ void GcodeSuite::M593() {
const bool seen_X = TERN0(INPUT_SHAPING_X, parser.seen_test('X')),
seen_Y = TERN0(INPUT_SHAPING_Y, parser.seen_test('Y')),
for_X = seen_X || TERN0(INPUT_SHAPING_X, (!seen_X && !seen_Y)),
for_Y = seen_Y || TERN0(INPUT_SHAPING_Y, (!seen_X && !seen_Y));
seen_Z = TERN0(INPUT_SHAPING_Z, parser.seen_test('Z')),
for_X = seen_X || TERN0(INPUT_SHAPING_X, (!seen_X && !seen_Y && !seen_Z)),
for_Y = seen_Y || TERN0(INPUT_SHAPING_Y, (!seen_X && !seen_Y && !seen_Z)),
for_Z = seen_Z || TERN0(INPUT_SHAPING_Z, (!seen_X && !seen_Y && !seen_Z));
if (parser.seen('D')) {
const float zeta = parser.value_float();
if (WITHIN(zeta, 0, 1)) {
if (for_X) stepper.set_shaping_damping_ratio(X_AXIS, zeta);
if (for_Y) stepper.set_shaping_damping_ratio(Y_AXIS, zeta);
if (for_Z) stepper.set_shaping_damping_ratio(Z_AXIS, zeta);
}
else
SERIAL_ECHO_MSG("?Zeta (D) value out of range (0-1)");
@@ -78,6 +90,7 @@ void GcodeSuite::M593() {
if (freq == 0.0f || freq > min_freq) {
if (for_X) stepper.set_shaping_frequency(X_AXIS, freq);
if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq);
if (for_Z) stepper.set_shaping_frequency(Z_AXIS, freq);
}
else
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Frequency (F) must be greater than ", min_freq, " or 0 to disable"));
+4
View File
@@ -1105,6 +1105,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move
#endif
#if ENABLED(ONE_CLICK_PRINT)
case 1003: M1003(); break; // M1003: [INTERNAL] Set the current dir to /
#endif
#if ENABLED(UBL_MESH_WIZARD)
case 1004: M1004(); break; // M1004: UBL Mesh Wizard
#endif
+5 -1
View File
@@ -143,7 +143,7 @@
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
*
* M110 - Set the current line number. (Used by host printing)
* M110 - Get or set the current line number. (Used by host printing)
* M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
* M112 - Full Shutdown.
*
@@ -1276,6 +1276,10 @@ private:
static void M1002();
#endif
#if ENABLED(ONE_CLICK_PRINT)
static void M1003();
#endif
#if ENABLED(UBL_MESH_WIZARD)
static void M1004();
#endif
+10 -2
View File
@@ -24,11 +24,19 @@
#include "../queue.h" // for last_N
/**
* M110: Set Current Line Number
* M110: Get or set Current Line Number
*
* Parameters:
* N<int> Number to set as last-processed command
*
* Without parameters:
* Report the last-processed (not last-received or last-enqueued) command
* (To purge the queue and resume from this line, the host should use 'M999' instead.)
*/
void GcodeSuite::M110() {
if (parser.seenval('N'))
queue.set_current_line_number(parser.value_long());
else
SERIAL_ECHOLNPGM(STR_LINE_NO, queue.get_current_line_number());
}
+1 -1
View File
@@ -34,7 +34,7 @@
#include "../../feature/probe_temp_comp.h"
#endif
#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#if ANY(DWIN_CREALITY_LCD_JYERSUI, EXTENSIBLE_UI)
#define VERBOSE_SINGLE_PROBE
#endif
+1 -1
View File
@@ -55,7 +55,7 @@ inline bool G38_run_probe() {
}
#endif
planner.synchronize(); // wait until the machine is idle
planner.synchronize(); // Wait until the machine is idle
// Move flag value
#if ENABLED(G38_PROBE_AWAY)
+15
View File
@@ -54,6 +54,21 @@ void mpe_settings_init() {
mpe_settings_report();
}
/**
* M951: Magnetic Parking Extruder
*
* Parameters:
* L<linear> : Set X[0] position
* R<linear> : Set X[1] position
* I<linear> : Set grab distance
* J<feedrate> : Set slow feedrate
* H<feedrate> : Set fast feedrate
* D<feedrate> : Set travel feedrate
* C<factor> : Set compensation factor
*
* With no parameters report the current settings.
*
*/
void GcodeSuite::M951() {
if (parser.seenval('L')) mpe_settings.parking_xpos[0] = parser.value_linear_units();
if (parser.seenval('R')) mpe_settings.parking_xpos[1] = parser.value_linear_units();
+5
View File
@@ -212,6 +212,11 @@ public:
*/
static void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; }
/**
* Get the current line number for the last received command
*/
static long get_current_line_number() { return serial_state[ring_buffer.command_port().index].last_N; }
#if ENABLED(BUFFER_MONITORING)
private:
+36
View File
@@ -0,0 +1,36 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(ONE_CLICK_PRINT)
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M1003: Set the current dir to /. Should come after 'M24'.
* Prevents the SD menu getting stuck in the newest file's workDir.
*/
void GcodeSuite::M1003() { card.cdroot(); }
#endif // ONE_CLICK_PRINT
+1 -1
View File
@@ -49,7 +49,7 @@
*/
void GcodeSuite::M306() {
const uint8_t e = TERN(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder), 0);
const uint8_t e = TERN0(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder));
if (e >= (EXTRUDERS)) {
SERIAL_ECHOLNPGM("?(E)xtruder index out of range (0-", (EXTRUDERS) - 1, ").");
return;
@@ -21,7 +21,7 @@
*/
/**
* gcode/temp/M86-M87.cpp
* gcode/temp/M86_M87.cpp
*
* Hotend Idle Timeout
*/
+19 -12
View File
@@ -893,10 +893,11 @@
#endif
#endif
// FSMC/SPI TFT Panels (LVGL)
// FSMC/SPI TFT Panels (LVGL) with encoder click wheel
#if ENABLED(TFT_LVGL_UI)
#define HAS_TFT_LVGL_UI 1
#define SERIAL_RUNTIME_HOOK 1
#define STD_ENCODER_PULSES_PER_STEP 4
#endif
// FSMC/SPI TFT Panels
@@ -976,6 +977,17 @@
#define DETECT_I2C_LCD_DEVICE 1
#endif
/**
* Ender-3 V2 DWIN with Encoder
*/
#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI)
#define HAS_DWIN_E3V2_BASIC 1
#endif
#if ANY(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI)
#define HAS_DWIN_E3V2 1
#define STD_ENCODER_PULSES_PER_STEP 4
#endif
// Encoder behavior
#ifndef STD_ENCODER_PULSES_PER_STEP
#if ENABLED(TOUCH_SCREEN)
@@ -997,10 +1009,12 @@
#define ENCODER_FEEDRATE_DEADZONE 6
#endif
// Shift register panels
// ---------------------
// 2 wire Non-latching LCD SR from:
// https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection
/**
* Shift register panels
* ---------------------
* 2 wire Non-latching LCD SR from:
* https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection
*/
#if ENABLED(FF_INTERFACEBOARD)
#define SR_LCD_3W_NL // Non latching 3 wire shift register
#define IS_ULTIPANEL 1
@@ -1040,11 +1054,6 @@
#define EXTENSIBLE_UI
#endif
// Aliases for LCD features
#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#define HAS_DWIN_E3V2 1
#endif
// E3V2 extras
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
#define SERIAL_CATCHALL 0
@@ -1594,8 +1603,6 @@
#endif
#if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ
#define IS_CORE 1
#endif
#if IS_CORE
#if CORE_IS_XY
#define CORE_AXIS_1 A_AXIS
#define CORE_AXIS_2 B_AXIS
+9 -5
View File
@@ -112,8 +112,8 @@
#undef DISABLE_IDLE_X
#undef INPUT_SHAPING_X
#undef SAFE_BED_LEVELING_START_X
#undef SHAPING_BUFFER_X
#undef SHAPING_FREQ_X
#undef SHAPING_ZETA_X
#undef STEALTHCHOP_X
#endif
@@ -128,8 +128,8 @@
#undef INPUT_SHAPING_Y
#undef QUICK_HOME
#undef SAFE_BED_LEVELING_START_Y
#undef SHAPING_BUFFER_Y
#undef SHAPING_FREQ_Y
#undef SHAPING_ZETA_Y
#undef STEALTHCHOP_Y
#undef STEP_STATE_Y
#endif
@@ -142,8 +142,11 @@
#undef ENABLE_LEVELING_FADE_HEIGHT
#undef HOME_Z_FIRST
#undef HOMING_Z_WITH_PROBE
#undef INPUT_SHAPING_Z
#undef NUM_Z_STEPPERS
#undef SAFE_BED_LEVELING_START_Z
#undef SHAPING_FREQ_Z
#undef SHAPING_ZETA_Z
#undef STEALTHCHOP_Z
#undef STEP_STATE_Z
#undef Z_IDLE_HEIGHT
@@ -1185,7 +1188,7 @@
#elif HAS_DRIVER(A4988)
#define MINIMUM_STEPPER_POST_DIR_DELAY 200
#elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
#define MINIMUM_STEPPER_POST_DIR_DELAY 70
#define MINIMUM_STEPPER_POST_DIR_DELAY 100
#else
#define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire
#endif
@@ -1311,7 +1314,8 @@
* currently HAL.h must be included ahead of pins.h.
*/
#if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT)
#if MB(MKS_MONSTER8_V1, BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, AQUILA_V101)
#if MB(MKS_MONSTER8_V1, BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, BTT_SKR_V3_0, BTT_SKR_V3_0_EZ, AQUILA_V101)
#define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, CREALITY_CR4NTXXC10, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
#define LCD_SERIAL_PORT 2
@@ -1337,7 +1341,7 @@
#endif
// Input shaping
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z)
#define HAS_ZV_SHAPING 1
#endif
+1 -1
View File
@@ -2814,7 +2814,7 @@
#if PIN_EXISTS(DIGIPOTSS)
#define HAS_MOTOR_CURRENT_SPI 1
#endif
#if HAS_EXTRUDERS && PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#if ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_E0, MOTOR_CURRENT_PWM_E1)
#define HAS_MOTOR_CURRENT_PWM_E 1
#endif
#if HAS_MOTOR_CURRENT_PWM_E || ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_I, MOTOR_CURRENT_PWM_J, MOTOR_CURRENT_PWM_K, MOTOR_CURRENT_PWM_U, MOTOR_CURRENT_PWM_V, MOTOR_CURRENT_PWM_W)
+5 -2
View File
@@ -52,8 +52,6 @@
#include HAL_PATH(.., inc/Conditionals_type.h)
#include "Changes.h"
#include "SanityCheck.h"
#include HAL_PATH(.., inc/SanityCheck.h)
// Include all core headers
#include "../core/language.h"
@@ -65,3 +63,8 @@
#endif
#include "../core/multi_language.h"
#ifndef __MARLIN_DEPS__
#include "SanityCheck.h"
#include HAL_PATH(.., inc/SanityCheck.h)
#endif
+53 -5
View File
@@ -388,8 +388,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
/**
* Custom Boot and Status screens
*/
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI)
#error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE."
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_HD44780, HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI)
#error "SHOW_CUSTOM_BOOTSCREEN requires Character LCD, Graphical LCD, or TOUCH_UI_FTDI_EVE."
#elif ENABLED(SHOW_CUSTOM_BOOTSCREEN) && DISABLED(SHOW_BOOTSCREEN)
#error "SHOW_CUSTOM_BOOTSCREEN requires SHOW_BOOTSCREEN."
#elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB
@@ -1545,6 +1545,9 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "BED_TRAMMING_USE_PROBE is incompatible with SENSORLESS_PROBING."
#endif
#endif
static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0.");
#elif ANY(DGUS_LCD_UI_RELOADED, DGUS_LCD_UI_E3S1PRO)
#error "LCD_BED_TRAMMING is required for the selected display."
#endif
/**
@@ -2700,6 +2703,28 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#undef IS_U8GLIB_SSD1306
#undef IS_EXTUI
/**
* Make sure LCD language settings are distinct
*/
#if NUM_LANGUAGES > 1
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_2), STRINGIFY(LCD_LANGUAGE)), "Error: LCD_LANGUAGE_2 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE.");
#endif
#if NUM_LANGUAGES > 2
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_3), STRINGIFY(LCD_LANGUAGE)), "Error: LCD_LANGUAGE_3 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE.");
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_3), STRINGIFY(LCD_LANGUAGE_2)), "Error: LCD_LANGUAGE_3 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_2.");
#endif
#if NUM_LANGUAGES > 3
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_4), STRINGIFY(LCD_LANGUAGE)), "Error: LCD_LANGUAGE_4 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE.");
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_4), STRINGIFY(LCD_LANGUAGE_2)), "Error: LCD_LANGUAGE_4 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_2.");
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_4), STRINGIFY(LCD_LANGUAGE_3)), "Error: LCD_LANGUAGE_4 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_3.");
#endif
#if NUM_LANGUAGES > 4
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_5), STRINGIFY(LCD_LANGUAGE)), "Error: LCD_LANGUAGE_5 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE.");
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_5), STRINGIFY(LCD_LANGUAGE_2)), "Error: LCD_LANGUAGE_5 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_2.");
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_5), STRINGIFY(LCD_LANGUAGE_3)), "Error: LCD_LANGUAGE_5 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_3.");
static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_5), STRINGIFY(LCD_LANGUAGE_4)), "Error: LCD_LANGUAGE_5 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_4.");
#endif
#if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, \
TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35, BIQU_BX_TFT70, BTT_TFT35_SPI_V1_0)
#if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
@@ -4183,7 +4208,12 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
*/
#if HAS_ZV_SHAPING
#if ENABLED(DELTA)
#error "Input Shaping is not compatible with DELTA kinematics."
#if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z)
#error "INPUT_SHAPING_X, INPUT_SHAPING_Y and INPUT_SHAPING_Z must all be enabled for DELTA."
#else
static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Y && SHAPING_FREQ_Y == SHAPING_FREQ_Z, "SHAPING_FREQ_X, SHAPING_FREQ_Y and SHAPING_FREQ_Z must be the same for DELTA.");
static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Y && SHAPING_ZETA_Y == SHAPING_ZETA_Z, "SHAPING_ZETA_X, SHAPING_ZETA_Y and SHAPING_ZETA_Z must be the same for DELTA.");
#endif
#elif ENABLED(SCARA)
#error "Input Shaping is not compatible with SCARA kinematics."
#elif ENABLED(TPARA)
@@ -4195,9 +4225,19 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
#elif ENABLED(DIRECT_STEPPING)
#error "Input Shaping is not compatible with DIRECT_STEPPING."
#elif ALL(INPUT_SHAPING_X, CORE_IS_XZ)
#error "INPUT_SHAPING_X is not supported with COREXZ."
#if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Z)
#error "INPUT_SHAPING_X and INPUT_SHAPING_Z must both be enabled for COREXZ."
#else
static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Z, "SHAPING_FREQ_X and SHAPING_FREQ_Z must be the same for COREXZ.");
static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Z, "SHAPING_ZETA_X and SHAPING_ZETA_Z must be the same for COREXZ.");
#endif
#elif ALL(INPUT_SHAPING_Y, CORE_IS_YZ)
#error "INPUT_SHAPING_Y is not supported with COREYZ."
#if !ALL(INPUT_SHAPING_Y, INPUT_SHAPING_Z)
#error "INPUT_SHAPING_Y and INPUT_SHAPING_Z must both be enabled for COREYZ."
#else
static_assert(SHAPING_FREQ_Y == SHAPING_FREQ_Z, "SHAPING_FREQ_Y and SHAPING_FREQ_Z must be the same for COREYZ.");
static_assert(SHAPING_ZETA_Y == SHAPING_ZETA_Z, "SHAPING_ZETA_Y and SHAPING_ZETA_Z must be the same for COREYZ.");
#endif
#elif ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#error "INPUT_SHAPING_X and INPUT_SHAPING_Y must both be enabled for COREXY, COREYX, or MARKFORGED_*."
@@ -4212,6 +4252,7 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
#else
TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set."));
TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set."));
TERN_(INPUT_SHAPING_Z, static_assert((SHAPING_FREQ_Z) > 0, "SHAPING_FREQ_Z must be > 0 or SHAPING_MIN_FREQ must be set."));
#endif
#ifdef __AVR__
#if ENABLED(INPUT_SHAPING_X)
@@ -4228,6 +4269,13 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz.");
#endif
#endif
#if ENABLED(INPUT_SHAPING_Z)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_Z) == 0 || (SHAPING_FREQ_Z) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Z is below the minimum (20) for AVR 20MHz.");
#else
static_assert((SHAPING_FREQ_Z) == 0 || (SHAPING_FREQ_Z) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Z is below the minimum (16) for AVR 16MHz.");
#endif
#endif
#endif
#endif
+1 -1
View File
@@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-04-15"
#define STRING_DISTRIBUTION_DATE "2024-05-29"
#endif
/**
+24 -8
View File
@@ -99,8 +99,8 @@
#warning "Warning! Don't use dummy thermistors (998/999) for final build!"
#endif
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT, UNIT_TEST)
#warning "Your Configuration provides no method to acquire user feedback!"
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT, UNIT_TEST, NO_USER_FEEDBACK_WARNING)
#warning "Your Configuration provides no method to acquire user feedback! (Define NO_USER_FEEDBACK_WARNING to suppress this warning.)"
#endif
#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_BOARD
@@ -690,8 +690,12 @@
#warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save."
#endif
#if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING)
#error "Z_SAFE_HOMING is recommended when homing with a probe. Enable Z_SAFE_HOMING or comment out this line to continue."
#if HOMING_Z_WITH_PROBE && IS_CARTESIAN && NONE(Z_SAFE_HOMING, NO_Z_SAFE_HOMING_WARNING)
#error "Z_SAFE_HOMING is recommended when homing with a probe. (Enable Z_SAFE_HOMING or define NO_Z_SAFE_HOMING_WARNING to suppress this warning.)"
#endif
#if ENABLED(BIQU_MICROPROBE_V2) && NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, NO_MICROPROBE_WARNING)
#warning "BIQU MicroProbe V2 detect signal requires a strong pull-up. Some processors have weak internal pull-up capabilities, so we recommended connecting MicroProbe SIGNAL / GND to Z-MIN / Z-STOP instead of the dedicated PROBE port. (Define NO_MICROPROBE_WARNING to suppress this warning.)"
#endif
//
@@ -714,8 +718,8 @@
#warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override."
#endif
#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX
#warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX."
#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX && DISABLED(NO_LCD_CONTRAST_WARNING)
#warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX. (Define NO_LCD_CONTRAST_WARNING to suppress this warning.)"
#endif
#if PROGRESS_MSG_EXPIRE > 0 && HAS_STATUS_MESSAGE_TIMEOUT
@@ -784,8 +788,13 @@
/**
* Input Shaping
*/
#if HAS_ZV_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
#if HAS_ZV_SHAPING
#if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
#endif
#if ENABLED(I2S_STEPPER_STREAM)
#warning "Input Shaping has not been tested with I2S_STEPPER_STREAM."
#endif
#endif
/**
@@ -860,3 +869,10 @@
#if DISABLED(EDITABLE_STEPS_PER_UNIT)
#warning "EDITABLE_STEPS_PER_UNIT is required to enable G92 runtime configuration of steps-per-unit."
#endif
/**
* HC32 clock speed is hard-coded in Marlin
*/
#if defined(ARDUINO_ARCH_HC32) && F_CPU == 200000000
#warning "HC32 clock is assumed to be 200MHz. If this isn't the case for your board please submit a report so we can add support."
#endif
+59 -13
View File
@@ -331,15 +331,24 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS
#endif // HAS_MEDIA
#if ENABLED(SHOW_BOOTSCREEN)
// Set boot screen corner characters
if (screen_charset == CHARSET_BOOT) {
for (uint8_t i = 4; i--;)
createChar_P(i, corner[i]);
}
else
#endif
{ // Info Screen uses 5 special characters
switch (screen_charset) {
#if ENABLED(SHOW_BOOTSCREEN)
case CHARSET_BOOT: {
// Set boot screen corner characters
for (uint8_t i = 4; i--;) createChar_P(i, corner[i]);
} break;
#endif
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
case CHARSET_BOOT_CUSTOM: {
for (uint8_t i = COUNT(customBootChars); i--;)
createChar_P(i, customBootChars[i]);
} break;
#endif
default: {
// Info Screen uses 5 special characters
createChar_P(LCD_STR_BEDTEMP[0], bedTemp);
createChar_P(LCD_STR_DEGREE[0], degree);
createChar_P(LCD_STR_THERMOMETER[0], thermometer);
@@ -361,7 +370,9 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS
createChar_P(LCD_STR_FOLDER[0], folder);
#endif
}
}
} break;
}
}
@@ -400,6 +411,42 @@ bool MarlinUI::detected() {
return TERN1(DETECT_I2C_LCD_DEVICE, lcd.LcdDetected() == 1);
}
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#ifndef CUSTOM_BOOTSCREEN_X
#define CUSTOM_BOOTSCREEN_X -1
#endif
#ifndef CUSTOM_BOOTSCREEN_Y
#define CUSTOM_BOOTSCREEN_Y ((LCD_HEIGHT - COUNT(custom_boot_lines)) / 2)
#endif
#ifndef CUSTOM_BOOTSCREEN_TIMEOUT
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
#endif
void MarlinUI::draw_custom_bootscreen(const uint8_t/*=0*/) {
set_custom_characters(CHARSET_BOOT_CUSTOM);
lcd.clear();
const int8_t sx = CUSTOM_BOOTSCREEN_X;
const uint8_t sy = CUSTOM_BOOTSCREEN_Y;
for (lcd_uint_t i = 0; i < COUNT(custom_boot_lines); ++i) {
PGM_P const pstr = (PGM_P)pgm_read_ptr(&custom_boot_lines[i]);
const uint8_t clen = utf8_strlen_P(pstr);
const lcd_uint_t x = sx >= 0 ? sx : (LCD_WIDTH - clen) / 2;
for (lcd_uint_t j = 0; j < clen; ++j) {
const lchar_t c = pgm_read_byte(&pstr[j]);
lcd_put_lchar(x + j, sy + i, c == '\x08' ? '\x00' : c);
}
}
}
// Shows the custom bootscreen and delays
void MarlinUI::show_custom_bootscreen() {
draw_custom_bootscreen();
safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT);
}
#endif // SHOW_CUSTOM_BOOTSCREEN
#if HAS_SLOW_BUTTONS
uint8_t MarlinUI::read_slow_buttons() {
#if ENABLED(LCD_I2C_TYPE_MCP23017)
@@ -466,6 +513,8 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
}
void MarlinUI::show_bootscreen() {
TERN_(SHOW_CUSTOM_BOOTSCREEN, show_custom_bootscreen());
set_custom_characters(CHARSET_BOOT);
lcd.clear();
@@ -660,9 +709,6 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
lcd_put_u8str(F("K"));
#else
lcd_put_u8str(cutter_power2str(cutter.unitPower));
#if CUTTER_UNIT_IS(PERCENT)
lcd_put_u8str(F("%"));
#endif
#endif
lcd_put_u8str(F(" "));
+14
View File
@@ -27,6 +27,20 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#include "../../../_Bootscreen.h"
#ifdef CUSTOM_BOOTSCREEN_Y
#define CUSTOM_BOOT_LAST COUNT(custom_boot_lines) + CUSTOM_BOOTSCREEN_Y
#else
#define CUSTOM_BOOT_LAST COUNT(custom_boot_lines)
#endif
static_assert(CUSTOM_BOOT_LAST <= LCD_HEIGHT, "custom_boot_lines (plus CUSTOM_BOOTSCREEN_Y) doesn't fit on the selected LCD.");
#endif
#if ENABLED(LCD_I2C_TYPE_PCF8575)
// NOTE: These are register-mapped pins on the PCF8575 controller, not Arduino pins.
+2 -2
View File
@@ -24,9 +24,9 @@
#include "../inc/MarlinConfig.h"
#if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL
#define HAS_ENCODER_WHEEL 1
#define HAS_MARLINUI_ENCODER 1
#endif
#if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE)
#if (HAS_MARLINUI_ENCODER || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE)
#define HAS_DIGITAL_BUTTONS 1
#endif
#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL))
+2 -2
View File
@@ -377,10 +377,10 @@ void MarlinUI::draw_kill_screen() {
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
#if HAS_DISPLAY_SLEEP
void MarlinUI::sleep_display(const bool sleep/*=true*/) {
void MarlinUI::sleep_display(const bool sleep/*=true*/) {
static bool asleep = false;
if (asleep != sleep){
sleep ? u8g.sleepOn() : u8g.sleepOff();
sleep ? u8g.sleepOn() : u8g.sleepOff();
asleep = sleep;
}
}
+24 -72
View File
@@ -42,10 +42,6 @@
#include <stdlib.h>
#ifndef ENCODER_PULSES_PER_STEP
#define ENCODER_PULSES_PER_STEP 4
#endif
EncoderRate encoderRate;
// TODO: Replace with ui.quick_feedback
@@ -53,32 +49,12 @@ void Encoder_tick() {
TERN_(HAS_BEEPER, if (ui.sound_on) buzzer.click(10));
}
// Encoder initialization
void encoderConfiguration() {
#if BUTTON_EXISTS(EN1)
SET_INPUT_PULLUP(BTN_EN1);
#endif
#if BUTTON_EXISTS(EN2)
SET_INPUT_PULLUP(BTN_EN2);
#endif
#if BUTTON_EXISTS(ENC)
SET_INPUT_PULLUP(BTN_ENC);
#endif
#if HAS_BEEPER
SET_OUTPUT(BEEPER_PIN); // TODO: Use buzzer.h which already inits this
#endif
}
// Analyze encoder value and return state
EncoderState encoderReceiveAnalyze() {
const millis_t now = millis();
static uint8_t lastEncoderBits;
uint8_t newbutton = 0;
static signed char temp_diff = 0;
static int8_t temp_diff = 0; // Cleared on each full step, as configured
EncoderState temp_diffState = ENCODER_DIFF_NO;
if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
if (BUTTON_PRESSED(ENC)) {
static millis_t next_click_update_ms;
if (ELAPSED(now, next_click_update_ms)) {
@@ -98,71 +74,47 @@ EncoderState encoderReceiveAnalyze() {
}
else return ENCODER_DIFF_NO;
}
if (newbutton != lastEncoderBits) {
switch (newbutton) {
case 0:
if (lastEncoderBits == 1) temp_diff++;
else if (lastEncoderBits == 2) temp_diff--;
break;
case 2:
if (lastEncoderBits == 0) temp_diff++;
else if (lastEncoderBits == 3) temp_diff--;
break;
case 3:
if (lastEncoderBits == 2) temp_diff++;
else if (lastEncoderBits == 1) temp_diff--;
break;
case 1:
if (lastEncoderBits == 3) temp_diff++;
else if (lastEncoderBits == 0) temp_diff--;
break;
}
lastEncoderBits = newbutton;
}
if (ABS(temp_diff) >= ENCODER_PULSES_PER_STEP) {
if (temp_diff > 0) temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CCW, ENCODER_DIFF_CW);
else temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CW, ENCODER_DIFF_CCW);
temp_diff += ui.get_encoder_delta();
const int8_t abs_diff = ABS(temp_diff);
if (abs_diff >= ENCODER_PULSES_PER_STEP) {
temp_diffState = temp_diff > 0
? TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CCW, ENCODER_DIFF_CW)
: TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CW, ENCODER_DIFF_CCW);
int32_t encoder_multiplier = 1;
#if ENABLED(ENCODER_RATE_MULTIPLIER)
millis_t ms = millis();
int32_t encoder_multiplier = 1;
const millis_t ms = millis();
// if must encoder rati multiplier
// Encoder rate multiplier
if (encoderRate.enabled) {
const float abs_diff = ABS(temp_diff),
encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP);
if (encoderRate.lastEncoderTime) {
// Note that the rate is always calculated between two passes through the
// loop and that the abs of the temp_diff value is tracked.
const float encoderStepRate = encoderMovementSteps / float(ms - encoderRate.lastEncoderTime) * 1000;
if (ENCODER_100X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_100X_STEPS_PER_SEC)
encoder_multiplier = 100;
else if (ENCODER_10X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)
encoder_multiplier = 10;
else if (ENCODER_5X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_5X_STEPS_PER_SEC)
encoder_multiplier = 5;
}
// Note that the rate is always calculated between two passes through the
// loop and that the abs of the temp_diff value is tracked.
const float encoderStepRate = ((float(abs_diff) / float(ENCODER_PULSES_PER_STEP)) * 1000.0f) / float(ms - encoderRate.lastEncoderTime);
encoderRate.lastEncoderTime = ms;
if (ENCODER_100X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_100X_STEPS_PER_SEC)
encoder_multiplier = 100;
else if (ENCODER_10X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)
encoder_multiplier = 10;
else if (ENCODER_5X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_5X_STEPS_PER_SEC)
encoder_multiplier = 5;
}
#else
constexpr int32_t encoder_multiplier = 1;
#endif
// encoderRate.encoderMoveValue += (temp_diff * encoder_multiplier) / (ENCODER_PULSES_PER_STEP);
encoderRate.encoderMoveValue = (temp_diff * encoder_multiplier) / (ENCODER_PULSES_PER_STEP);
if (encoderRate.encoderMoveValue < 0) encoderRate.encoderMoveValue = -encoderRate.encoderMoveValue;
encoderRate.encoderMoveValue = abs_diff * encoder_multiplier / (ENCODER_PULSES_PER_STEP);
temp_diff = 0;
}
if (temp_diffState != ENCODER_DIFF_NO) {
TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout());
if (!ui.backlight) ui.refresh_brightness();
}
return temp_diffState;
}
-3
View File
@@ -47,9 +47,6 @@ typedef enum {
#define ENCODER_WAIT_MS TERN(DWIN_LCD_PROUI, 10, 20)
// Encoder initialization
void encoderConfiguration();
// Analyze encoder value and return state
EncoderState encoderReceiveAnalyze();
-1
View File
@@ -4078,7 +4078,6 @@ void hmiInit() {
}
void dwinInitScreen() {
encoderConfiguration();
hmiInit();
hmiSetLanguageCache();
hmiStartFrame(true);
-1
View File
@@ -5143,7 +5143,6 @@ void MarlinUI::init_lcd() {
if (dwinHandshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error.");
dwinFrameSetDir(1); // Orientation 90°
dwinUpdateLCD(); // Show bootscreen (first image)
encoderConfiguration();
for (uint16_t t = 0; t <= 100; t += 2) {
dwinIconShow(ICON, ICON_Bar, 15, 260);
dwinDrawRectangle(1, COLOR_BG_BLACK, 15 + t * 242 / 100, 260, 257, 280);
@@ -22,9 +22,6 @@
/**
* Bed Level Tools for Pro UI
* Extended by: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.2.0
* Date: 2023/05/03
*
* Based on the original work of: Henri-J-Norden
* https://github.com/Jyers/Marlin/pull/126
@@ -22,9 +22,6 @@
/**
* Bed Level Tools for Pro UI
* Extended by: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.2.0
* Date: 2023/05/03
*
* Based on the original work of: Henri-J-Norden
* https://github.com/Jyers/Marlin/pull/126
+23 -11
View File
@@ -22,7 +22,8 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.25.3
* Date: 2023/05/18
*/
@@ -37,6 +38,7 @@
#include "../../utf8.h"
#include "../../marlinui.h"
#include "../../extui/ui_api.h"
#include "../../../MarlinCore.h"
#include "../../../core/serial.h"
#include "../../../core/macros.h"
@@ -1311,7 +1313,7 @@ void eachMomentUpdate() {
TERN_(PIDTEMP, if (hmiValue.tempControl == PIDTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); })
TERN_(PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) { plot.update(thermalManager.wholeDegBed()); })
TERN_(PIDTEMPCHAMBER, if (hmiValue.tempControl == PIDTEMPCHAMBER_START) { plot.update(thermalManager.wholeDegChamber()); })
TERN_(MPCTEMP, if (hmiValue.tempControl == MPCTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); })
TERN_(MPCTEMP, if (hmiValue.tempControl == MPC_STARTED) { plot.update(thermalManager.wholeDegHotend(0)); })
if (hmiFlag.abort_flag || hmiFlag.pause_flag || print_job_timer.isPaused()) {
hmiReturnScreen();
}
@@ -1566,7 +1568,7 @@ void dwinLevelingDone() {
switch (hmiValue.tempControl) {
default: return;
#if ENABLED(MPC_AUTOTUNE)
case MPCTEMP_START:
case MPC_STARTED:
DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_MPC_AUTOTUNE));
DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("MPC target: Celsius"));
DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_NOZZLE));
@@ -1619,7 +1621,7 @@ void dwinLevelingDone() {
switch (result) {
#if ENABLED(MPCTEMP)
case MPCTEMP_START:
case MPC_STARTED:
#elif ENABLED(PIDTEMP)
case PIDTEMP_START:
#endif
@@ -1655,7 +1657,7 @@ void dwinLevelingDone() {
void drawHPlot() {
TERN_(PIDTEMP, dwinDrawPlot(PIDTEMP_START));
TERN_(MPCTEMP, dwinDrawPlot(MPCTEMP_START));
TERN_(MPCTEMP, dwinDrawPlot(MPC_STARTED));
}
void drawBPlot() {
TERN_(PIDTEMPBED, dwinDrawPlot(PIDTEMPBED_START));
@@ -1741,7 +1743,7 @@ void dwinLevelingDone() {
void dwinMPCTuning(tempcontrol_t result) {
hmiValue.tempControl = result;
switch (result) {
case MPCTEMP_START:
case MPC_STARTED:
hmiSaveProcessID(ID_MPCProcess);
#if PROUI_TUNING_GRAPH
dwinDrawPIDMPCPopup();
@@ -1909,7 +1911,6 @@ void MarlinUI::init_lcd() {
const bool hs = dwinHandshake(); UNUSED(hs);
dwinFrameSetDir(1);
dwinJPGCacheTo1(Language_English);
encoderConfiguration();
}
void dwinInitScreen() {
@@ -3145,7 +3146,7 @@ void drawControlMenu() {
enableLiveCaseLightBrightness = true; // Allow live update of brightness in control menu
MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawSubMenu, drawCaseLightMenu);
#else
MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on);
EDIT_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on);
#endif
#endif
#if ENABLED(LED_CONTROL_MENU)
@@ -3315,7 +3316,7 @@ void drawFilSetMenu() {
if (SET_MENU(filSetMenu, MSG_FILAMENT_SET, 9)) {
BACK_ITEM(drawAdvancedSettingsMenu);
#if HAS_FILAMENT_SENSOR
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, setRunoutEnable, &runout.enabled);
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_SENSOR, onDrawChkbMenu, setRunoutEnable, &runout.enabled);
#endif
#if HAS_FILAMENT_RUNOUT_DISTANCE
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, setRunoutDistance, &runout.runout_distance());
@@ -3406,7 +3407,7 @@ void drawTuneMenu() {
MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, changeFilament);
#endif
#if HAS_FILAMENT_SENSOR
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, setRunoutEnable, &runout.enabled);
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_SENSOR, onDrawChkbMenu, setRunoutEnable, &runout.enabled);
#endif
#if ENABLED(PROUI_ITEM_PLR)
EDIT_ITEM(ICON_Pwrlossr, MSG_OUTAGE_RECOVERY, onDrawChkbMenu, setPwrLossr, &recovery.enabled);
@@ -3477,9 +3478,16 @@ void drawTuneMenu() {
void setShapingYZeta() { hmiValue.axis = Y_AXIS; setFloatOnClick(0, 1, 2, stepper.get_shaping_damping_ratio(Y_AXIS), applyShapingZeta); }
#endif
#if ENABLED(INPUT_SHAPING_Z)
void onDrawShapingZFreq(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, stepper.get_shaping_frequency(Z_AXIS)); }
void onDrawShapingZZeta(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, stepper.get_shaping_damping_ratio(Z_AXIS)); }
void setShapingZFreq() { hmiValue.axis = Z_AXIS; setFloatOnClick(0, 200, 2, stepper.get_shaping_frequency(Z_AXIS), applyShapingFreq); }
void setShapingZZeta() { hmiValue.axis = Z_AXIS; setFloatOnClick(0, 1, 2, stepper.get_shaping_damping_ratio(Z_AXIS), applyShapingZeta); }
#endif
void drawInputShaping_menu() {
checkkey = ID_Menu;
if (SET_MENU(inputShapingMenu, MSG_INPUT_SHAPING, 5)) {
if (SET_MENU(inputShapingMenu, MSG_INPUT_SHAPING, 1 PLUS_TERN0(INPUT_SHAPING_X, 2) PLUS_TERN0(INPUT_SHAPING_Y, 2) PLUS_TERN0(INPUT_SHAPING_Z, 2))) {
BACK_ITEM(drawMotionMenu);
#if ENABLED(INPUT_SHAPING_X)
MENU_ITEM(ICON_ShapingX, MSG_SHAPING_A_FREQ, onDrawShapingXFreq, setShapingXFreq);
@@ -3489,6 +3497,10 @@ void drawTuneMenu() {
MENU_ITEM(ICON_ShapingY, MSG_SHAPING_B_FREQ, onDrawShapingYFreq, setShapingYFreq);
MENU_ITEM(ICON_ShapingY, MSG_SHAPING_B_ZETA, onDrawShapingYZeta, setShapingYZeta);
#endif
#if ENABLED(INPUT_SHAPING_Z)
MENU_ITEM(ICON_ShapingZ, MSG_SHAPING_C_FREQ, onDrawShapingZFreq, setShapingZFreq);
MENU_ITEM(ICON_ShapingZ, MSG_SHAPING_C_ZETA, onDrawShapingZZeta, setShapingZZeta);
#endif
}
updateMenu(inputShapingMenu);
}
+3 -2
View File
@@ -23,7 +23,8 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.25.3
* Date: 2023/05/18
*/
@@ -90,7 +91,7 @@ enum processID : uint8_t {
PID_TUNING_TIMEOUT,
#endif
#if ENABLED(MPC_AUTOTUNE)
MPCTEMP_START,
MPC_STARTED,
MPC_TEMP_ERROR,
MPC_INTERRUPTED,
#endif
+2 -1
View File
@@ -23,7 +23,8 @@
/**
* DWIN general defines and data structs for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.12.2
* Date: 2022/08/08
*/
+2 -1
View File
@@ -22,7 +22,8 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.12.1
* Date: 2023/01/22
*/
+2 -1
View File
@@ -23,7 +23,8 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.12.1
* Date: 2023/01/22
*/
+2 -1
View File
@@ -22,7 +22,8 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.11.1
* Date: 2022/02/28
*/
+2 -1
View File
@@ -23,7 +23,8 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.11.1
* Date: 2022/02/28
*/
+2 -1
View File
@@ -22,7 +22,8 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.21.1
* Date: 2023/03/21
*/
+2 -1
View File
@@ -23,7 +23,8 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.21.1
* Date: 2023/03/21
*/
+2 -1
View File
@@ -22,7 +22,8 @@
/**
* DWIN Endstops diagnostic page for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 1.4.3
* Date: 2023/05/10
*/
+2 -1
View File
@@ -23,7 +23,8 @@
/**
* DWIN End Stops diagnostic page for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 1.4.3
* Date: 2023/05/10
*/
+2 -1
View File
@@ -22,7 +22,8 @@
/**
* Lock screen implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 2.3.2
* Date: 2022/11/20
*/
+2 -1
View File
@@ -23,7 +23,8 @@
/**
* Lock screen implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 2.3.2
* Date: 2022/11/20
*/
+2 -1
View File
@@ -22,7 +22,8 @@
/**
* Mesh Viewer for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* version: 4.2.1
* Date: 2023/05/05
*/
+2 -1
View File
@@ -23,7 +23,8 @@
/**
* Mesh Viewer for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* version: 4.2.1
* Date: 2023/05/05
*/
+4 -3
View File
@@ -22,7 +22,8 @@
/**
* Print Stats page for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 1.4.0
* Date: 2022/12/03
*/
@@ -55,9 +56,9 @@ void PrintStats::draw() {
DWINUI::drawString(MRG, 80, TS(GET_TEXT_F(MSG_INFO_PRINT_COUNT), F(": "), ps.totalPrints));
DWINUI::drawString(MRG, 100, TS(GET_TEXT_F(MSG_INFO_COMPLETED_PRINTS), F(": "), ps.finishedPrints));
duration_t(print_job_timer.getStats().printTime).toDigital(str, true);
DWINUI::drawString(MRG, 120, MString<50>(GET_TEXT_F(MSG_INFO_PRINT_TIME), F(": "), str));
DWINUI::drawString(MRG, 120, TS(GET_TEXT_F(MSG_INFO_PRINT_TIME), F(": "), str));
duration_t(print_job_timer.getStats().longestPrint).toDigital(str, true);
DWINUI::drawString(MRG, 140, MString<50>(GET_TEXT(MSG_INFO_PRINT_LONGEST), F(": "), str));
DWINUI::drawString(MRG, 140, TS(GET_TEXT_F(MSG_INFO_PRINT_LONGEST), F(": "), str));
DWINUI::drawString(MRG, 160, TS(GET_TEXT_F(MSG_INFO_PRINT_FILAMENT), F(": "), p_float_t(ps.filamentUsed / 1000, 2), F(" m")));
}
+2 -1
View File
@@ -23,7 +23,8 @@
/**
* Print Stats page for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Based on the original work of: Miguel Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 1.4.0
* Date: 2022/12/03
*/
+3 -3
View File
@@ -65,8 +65,8 @@ namespace ExtUI {
void onIdle() {}
void onPrinterKilled(FSTR_P const error, FSTR_P const component) {}
void onMediaInserted() {}
void onMediaError() {}
void onMediaMounted() {}
void onMediaError() {}
void onMediaRemoved() {}
void onHeatingError(const heater_id_t heater_id) {
@@ -222,7 +222,7 @@ namespace ExtUI {
void onMPCTuning(const mpcresult_t rst) {
// Called for temperature MPC tuning result
switch (rst) {
case MPC_STARTED: dwinMPCTuning(MPCTEMP_START); break;
case MPC_STARTED: dwinMPCTuning(MPC_STARTED); break;
case MPC_TEMP_ERROR: dwinMPCTuning(MPC_TEMP_ERROR); break;
case MPC_INTERRUPTED: dwinMPCTuning(MPC_INTERRUPTED); break;
case MPC_DONE: dwinMPCTuning(AUTOTUNE_DONE); break;
@@ -45,9 +45,9 @@ namespace ExtUI {
chiron.printerKilled(error, component);
}
void onMediaInserted() { chiron.mediaEvent(AC_media_inserted); }
void onMediaError() { chiron.mediaEvent(AC_media_error); }
void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); }
void onMediaMounted() { chiron.mediaEvent(AC_media_inserted); }
void onMediaError() { chiron.mediaEvent(AC_media_error); }
void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); }
void onHeatingError(const heater_id_t header_id) {}
void onMinTempError(const heater_id_t header_id) {}
@@ -564,8 +564,8 @@ void ChironTFT::panelInfo(uint8_t req) {
} break;
case 8: // A8 Get SD Card list A8 S0
if (!isMediaInserted()) safe_delay(500);
if (!isMediaInserted()) // Make sure the card is removed
if (!isMediaMounted()) safe_delay(500);
if (!isMediaMounted()) // Make sure the card is removed
tftSendLn(AC_msg_no_sd_card);
else if (panel_command[3] == 'S')
sendFileList( atoi( &panel_command[4] ) );
@@ -780,11 +780,11 @@ void ChironTFT::panelProcess(uint8_t req) {
DEBUG_ECHOLNPGM("Moving to mesh point at x: ", pos.x, " y: ", pos.y, " z: ", pos_z);
#endif
// Go up before moving
setAxisPosition_mm(3.0,Z);
setAxisPosition_mm(3.0f, Z);
setAxisPosition_mm(17 + (93 * pos.x), X);
setAxisPosition_mm(20 + (93 * pos.y), Y);
setAxisPosition_mm(0.0, Z);
setAxisPosition_mm(17.0f + (93.0f * pos.x), X);
setAxisPosition_mm(20.0f + (93.0f * pos.y), Y);
setAxisPosition_mm(0.0f, Z);
#if ACDEBUG(AC_INFO)
DEBUG_ECHOLNPGM("Current Z: ", getAxisPosition_mm(Z));
#endif
@@ -39,7 +39,7 @@ namespace ExtUI {
void onIdle() { anycubicTFT.onCommandScan(); }
void onPrinterKilled(FSTR_P const error, FSTR_P const component) { anycubicTFT.onKillTFT(); }
void onMediaInserted() { anycubicTFT.onSDCardStateChange(true); }
void onMediaMounted() { anycubicTFT.onSDCardStateChange(true); }
void onMediaError() { anycubicTFT.onSDCardError(); }
void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); }
@@ -138,8 +138,8 @@ void AnycubicTFT::onKillTFT() {
SENDLINE_DBG_PGM("J11", "TFT Serial Debug: Kill command... J11");
}
void AnycubicTFT::onSDCardStateChange(bool isInserted) {
DEBUG_ECHOLNPGM("TFT Serial Debug: onSDCardStateChange event triggered...", isInserted);
void AnycubicTFT::onSDCardStateChange(bool isMounted) {
DEBUG_ECHOLNPGM("TFT Serial Debug: onSDCardStateChange event triggered...", isMounted);
doSDCardStateCheck();
}
@@ -363,7 +363,7 @@ void AnycubicTFT::renderCurrentFileList() {
SENDLINE_PGM("FN "); // Filelist start
if (!isMediaInserted() && !specialMenu) {
if (!isMediaMounted() && !specialMenu) {
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02");
SENDLINE_PGM("<SPECI~1.GCO");
@@ -579,7 +579,7 @@ void AnycubicTFT::getCommandFromTFT() {
#if HAS_MEDIA
if (isPrintingFromMedia()) {
SEND_PGM("A6V ");
if (isMediaInserted())
if (isMediaMounted())
SENDLINE(ui8tostr3rj(getProgress_percent()));
else
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02");
@@ -632,7 +632,7 @@ void AnycubicTFT::getCommandFromTFT() {
case 13: // A13 SELECTION FILE
#if HAS_MEDIA
if (isMediaInserted()) {
if (isMediaMounted()) {
starpos = (strchr(tftStrchrPtr + 4, '*'));
if (tftStrchrPtr[4] == '/') {
strcpy(selectedDirectory, tftStrchrPtr + 5);
@@ -831,7 +831,7 @@ void AnycubicTFT::getCommandFromTFT() {
case 26: // A26 refresh SD
#if HAS_MEDIA
if (isMediaInserted()) {
if (isMediaMounted()) {
if (strlen(selectedDirectory) > 0) {
FileList currentFileList;
if ((selectedDirectory[0] == '.') && (selectedDirectory[1] == '.')) {
@@ -883,12 +883,12 @@ void AnycubicTFT::getCommandFromTFT() {
}
void AnycubicTFT::doSDCardStateCheck() {
#if ALL(HAS_MEDIA, HAS_SD_DETECT)
bool isInserted = isMediaInserted();
if (isInserted)
SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted");
#if HAS_MEDIA
const bool isMounted = isMediaMounted();
if (isMounted)
SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isMounted");
else
SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isInserted");
SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isMounted");
#endif
}
@@ -1268,7 +1268,7 @@ namespace Anycubic {
break;
case 4: // page refresh
if (!isMediaInserted()) safe_delay(500);
if (!isMediaMounted()) safe_delay(500);
filenavigator.reset();
@@ -45,9 +45,9 @@ namespace ExtUI {
dgus.printerKilled(error, component);
}
void onMediaInserted() { dgus.mediaEvent(AC_media_inserted); }
void onMediaError() { dgus.mediaEvent(AC_media_error); }
void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); }
void onMediaMounted() { dgus.mediaEvent(AC_media_inserted); }
void onMediaError() { dgus.mediaEvent(AC_media_error); }
void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); }
void onHeatingError(const heater_id_t header_id) {}
void onMinTempError(const heater_id_t header_id) {}
@@ -264,7 +264,7 @@ void DGUSScreenHandler::sendHeaterStatusToDisplay(DGUS_VP_Variable &var) {
void DGUSScreenHandler::screenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr) {
// default action executed when there is a SD card, but not printing
if (ExtUI::isMediaInserted() && !ExtUI::isPrintingFromMedia()) {
if (ExtUI::isMediaMounted() && !ExtUI::isPrintingFromMedia()) {
screenChangeHook(var, val_ptr);
dgus.requestScreen(current_screenID);
return;
@@ -279,7 +279,7 @@ void DGUSScreenHandler::sendHeaterStatusToDisplay(DGUS_VP_Variable &var) {
}
// Don't let the user in the dark why there is no reaction.
if (!ExtUI::isMediaInserted()) {
if (!ExtUI::isMediaMounted()) {
setStatusMessage(GET_TEXT_F(MSG_NO_MEDIA));
return;
}
+3 -3
View File
@@ -48,9 +48,9 @@ namespace ExtUI {
while (!screen.loop()); // Wait while anything is left to be sent
}
void onMediaInserted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
void onMediaMounted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
void onHeatingError(const heater_id_t header_id) {}
void onMinTempError(const heater_id_t header_id) {}
@@ -337,8 +337,8 @@ void DGUSDisplay::processRx() {
size_t DGUSDisplay::getFreeTxBuffer() {
return (
#ifdef LCD_SERIAL_GET_TX_BUFFER_FREE
LCD_SERIAL_GET_TX_BUFFER_FREE()
#ifdef LCD_SERIAL_TX_BUFFER_FREE
LCD_SERIAL_TX_BUFFER_FREE()
#else
SIZE_MAX
#endif
@@ -72,7 +72,7 @@ void DGUSReturnKeyCodeHandler::Command_MenuSelect(DGUS_VP &vp, void *data) {
break;
case DGUS_Data::MenuSelectCommand::Print:
if (ExtUI::isMediaInserted()) {
if (ExtUI::isMediaMounted()) {
dgus_sdcard_handler.Reset();
screen.triggerScreenChange(DGUS_ScreenID::FILE1);
}
@@ -241,7 +241,7 @@ void DGUSReturnKeyCodeHandler::Command_CheckOK(DGUS_VP &vp, void *data) {
#endif // HAS_FILAMENT_SENSOR
case DGUS_Data::CheckOKCommand::SDCardCheck_Yes:
if (ExtUI::isMediaInserted()) {
if (ExtUI::isMediaMounted()) {
dgus_sdcard_handler.Reset();
screen.triggerScreenChange(DGUS_ScreenID::FILE1);
}
@@ -401,15 +401,14 @@ static void _gotoTrammingPoint(unsigned char point) {
switch (point) {
default: return;
case 1: x = X_CENTER; y = Y_CENTER; break;
case 2: x = X_MIN_POS + lfrb[0]; y = Y_MIN_POS + lfrb[1]; break;
case 3: x = X_MAX_POS - lfrb[2]; y = Y_MIN_POS + lfrb[1]; break;
case 4: x = X_MAX_POS - lfrb[2]; y = Y_MAX_POS - lfrb[3]; break;
case 5: x = X_MIN_POS + lfrb[0]; y = Y_MAX_POS - lfrb[3]; break;
case 2: x = X_MIN_BED + lfrb[0]; y = Y_MIN_BED + lfrb[1]; break;
case 3: x = X_MAX_BED - lfrb[2]; y = Y_MIN_BED + lfrb[1]; break;
case 4: x = X_MAX_BED - lfrb[2]; y = Y_MAX_BED - lfrb[3]; break;
case 5: x = X_MIN_BED + lfrb[0]; y = Y_MAX_BED - lfrb[3]; break;
}
if (ExtUI::getAxisPosition_mm(ExtUI::Z) < (Z_MIN_POS) + (BED_TRAMMING_Z_HOP))
ExtUI::setAxisPosition_mm((Z_MIN_POS) + (BED_TRAMMING_Z_HOP), ExtUI::Z);
if (BED_TRAMMING_Z_HOP)
ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(ExtUI::Z) + (BED_TRAMMING_Z_HOP), ExtUI::Z);
ExtUI::setAxisPosition_mm(x, ExtUI::X);
ExtUI::setAxisPosition_mm(y, ExtUI::Y);
ExtUI::setAxisPosition_mm((Z_MIN_POS) + (BED_TRAMMING_HEIGHT), ExtUI::Z);
@@ -84,7 +84,7 @@ void DGUSTxHandler::levelingProgressIcon(DGUS_VP &vp) {
#endif
void DGUSTxHandler::sdCardInsertionStatus(DGUS_VP &vp) {
const uint16_t data = ExtUI::isMediaInserted() ? 1 : 0;
const uint16_t data = ExtUI::isMediaMounted() ? 1 : 0;
dgus.write((uint16_t)vp.addr, Endianness::toBE(data));
}
@@ -45,13 +45,3 @@
#ifndef DGUS_STATUS_EXPIRATION_MS
#define DGUS_STATUS_EXPIRATION_MS 30000
#endif
#ifndef BED_TRAMMING_Z_HOP
#define BED_TRAMMING_Z_HOP 4.0
#endif
#ifndef BED_TRAMMING_HEIGHT
#define BED_TRAMMING_HEIGHT 0.0
#endif
static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration.");
@@ -55,9 +55,9 @@ namespace ExtUI {
screen.printerKilled(error, component);
}
void onMediaInserted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
void onMediaMounted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); }
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
void onHeatingError(const heater_id_t header_id) {}
void onMinTempError(const heater_id_t header_id) {}

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