diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c37e64b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,44 @@
+# Pascal err out logs
+
+*.err
+*.out
+
+~$*.SLDPRT
+~$*.SLDASM
+
+# For PCBs designed using KiCad: http://www.kicad-pcb.org/
+# Format documentation: http://kicad-pcb.org/help/file-formats/
+
+# Temporary files
+*-backups/
+*.000
+*.bak
+*.bck
+*.kicad_sch.lck
+*.kicad_pcb-bak
+*.kicad_pcb.lck
+*#auto_saved_files#
+
+*~
+_autosave-*
+*.tmp
+*-cache.lib
+*-rescue.lib
+*-save.pro
+*-save.kicad_pcb
+*.sch-bak
+fp-info-cache
+
+# Netlist files (exported from Eeschema)
+*.net
+
+# Autorouter files (exported from Pcbnew)
+*.dsn
+*.ses
+
+# Visual Studio Code
+*.vscode/
+# Platformio .pio
+.pio/
+# JetBrains CLion
+.idea/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7acdc90..257da4d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,10 +4,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+## [v5-rc2] Намотчик - 2025-01-05
+
+### Добавлено
+- Начата работа над программой-генератором g-code. Эта программа необходима для автоматического расчета траекторий движения конца иголки, в процессе намотки.
+- Детали чтобы использовать трубочку диаметром 0.9мм, вместо иглы.
+- Добавлена кнопка аварийного останова.
+- Экспериментальная система, подтягивающая проволку назад, призванная сохранять натяжение во время провисания провода.
+
+### Изменено
+- Изменен дизайн системы натяжения
+- Дизайн каретки, чтобы при стягивании деталей, держащих иголку, резьба вкручивалась в металлическую гайку, а не в пластик.
+- Также изменена высота каретки, чтобы можно было менять высоту иглы.
+- Небольшие изменения в раме станка. (Удалил лишние построения, для старого держателя катушки)
+
+### Исправлено
+
+
## [v5-rc1] Намотчик - 2024-11-11
### Добавлено
-
- Тормоз для катушки
- Проставки под плату вместо металлических стоек
- Отверстия для крепления RAMPS
@@ -16,18 +32,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Сделана спецификация с временем печати и расходом пластика для каждой детали
### Изменено
-
- Отредактирована крышка. Добавлены прорези под провода
- Рельсы заменены с MGN12 на MGN9
- Удалены все мелкие скругления
-- Увеличил пространство для гайки М8, которая одевается шпильку
+- Увеличено пространство для гайки М8, которая одевается шпильку
- Перепроектирован стенд для дисплея
- Упрощена деталь Organizer
- Увеличена глубина борозды под провод на колесе
- Оптимизированы детали для печати. Там где это возможно, печатаются без поддержек.
-### Исправлено
-
+### Исправлено
- Удалены все лишние плоскости, которые очень мешают, если включить их отображение. Кроме того, в некоторых эскизах были привязки не к плоскостям или граням, а к этим самым плоскостям. То есть, удаление или смещение плоскости, привело бы к непредсказуемому изменению модели.
- Исправены ошибки и "костыли". В некоторых деталях встречались случаи, когда, например, была сделана вытяжка, а потом эта вытяжка удалялась вырезом.
Или наоборот, делался вырез, который потом заполнялся вытяжкой. Что перегружало дерево. Некоторые детали были сделаны из "заготовок", что лишало возможности редактировать геометрию. Этот инструмент хорош для быстрой прикидки, но не стоит его оставлять в конечной версии проекта.
diff --git a/firmware/.aiderignore b/firmware/.aiderignore
new file mode 100644
index 0000000..b80c459
--- /dev/null
+++ b/firmware/.aiderignore
@@ -0,0 +1,21 @@
+# Build artifacts
+buildroot/
+*.o
+*.a
+*.so
+*.dylib
+*.dll
+*.exe
+
+# Web assets
+*.min.js
+*.min.css
+
+# Generated files
+__pycache__/
+*.pyc
+.DS_Store
+
+# IDE files
+.vscode/
+.idea/
diff --git a/firmware/.devcontainer/Dockerfile b/firmware/.devcontainer/Dockerfile
new file mode 100644
index 0000000..4f29a10
--- /dev/null
+++ b/firmware/.devcontainer/Dockerfile
@@ -0,0 +1,29 @@
+# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3/.devcontainer/base.Dockerfile
+
+# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
+ARG VARIANT="3.9.0-buster"
+FROM python:${VARIANT}
+
+# [Option] Install Node.js
+ARG INSTALL_NODE="true"
+ARG NODE_VERSION="lts/*"
+RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
+
+# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
+# COPY requirements.txt /tmp/pip-tmp/
+# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
+# && rm -rf /tmp/pip-tmp
+
+# [Optional] Uncomment this section to install additional OS packages.
+# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+# && apt-get -y install --no-install-recommends
+
+# [Optional] Uncomment this line to install global node packages.
+# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1
+
+
+RUN pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
+RUN platformio update
+# To get the test platforms
+RUN pip install PyYaml
+#ENV PATH /code/buildroot/bin/:/code/buildroot/tests/:${PATH}
diff --git a/firmware/.devcontainer/devcontainer.json b/firmware/.devcontainer/devcontainer.json
new file mode 100644
index 0000000..54627d4
--- /dev/null
+++ b/firmware/.devcontainer/devcontainer.json
@@ -0,0 +1,51 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3
+{
+ "name": "Python 3",
+ "build": {
+ "dockerfile": "Dockerfile",
+ "context": "..",
+ "args": {
+ // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
+ "VARIANT": "3.9.0-buster",
+ // Options
+ "INSTALL_NODE": "false",
+ "NODE_VERSION": "lts/*"
+ }
+ },
+
+ // Set *default* container specific settings.json values on container create.
+ "settings": {
+ "python.pythonPath": "/usr/local/bin/python",
+ "python.languageServer": "Pylance",
+ "python.linting.enabled": true,
+ "python.linting.pylintEnabled": true,
+ "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
+ "python.formatting.blackPath": "/usr/local/py-utils/bin/black",
+ "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
+ "python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
+ "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
+ "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
+ "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
+ "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
+ "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
+ },
+
+ // Add the IDs of extensions you want installed when the container is created.
+ "extensions": [
+ "ms-python.python",
+ "ms-python.vscode-pylance",
+ "platformio.platformio-ide",
+ "marlinfirmware.auto-build",
+ "editorconfig.editorconfig"
+ ],
+
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
+ // "forwardPorts": [],
+
+ // Use 'postCreateCommand' to run commands after the container is created.
+ // "postCreateCommand": "pip3 install --user -r requirements.txt",
+
+ // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
+ // "remoteUser": "vscode"
+}
diff --git a/firmware/.github/FUNDING.yml b/firmware/.github/FUNDING.yml
new file mode 100644
index 0000000..a973242
--- /dev/null
+++ b/firmware/.github/FUNDING.yml
@@ -0,0 +1,3 @@
+github: [thinkyhead]
+patreon: thinkyhead
+custom: ["https://www.thinkyhead.com/donate-to-marlin"]
diff --git a/firmware/.github/ISSUE_TEMPLATE/bug_report.yml b/firmware/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000..e0ee13a
--- /dev/null
+++ b/firmware/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,184 @@
+name: 🪲 Report a bug
+description: Create a bug report to help improve Marlin Firmware
+title: "[BUG] (bug summary)"
+labels: ["Bug: Potential ?"]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ Do you want to ask a question? Are you looking for support? Please use one of the [support links](https://github.com/MarlinFirmware/Marlin/issues/new/choose).
+
+ - type: markdown
+ attributes:
+ value: |
+ **Thank you for reporting a bug in Marlin Firmware!**
+
+ ## Before Reporting a Bug
+
+ - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.1.x/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect.
+
+ - Test with the [`bugfix-2.1.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.1.x.zip) to see whether the issue still exists.
+
+ ## Instructions
+
+ Please follow the instructions below. Failure to do so may result in your issue being closed. See [Contributing to Marlin](https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.1.x/.github/contributing.md) for additional guidelines.
+
+ 1. Provide a good title starting with [BUG].
+ 2. Fill out all sections of this bug report form.
+ 3. Always attach configuration files so we can build and test your setup.
+
+ - type: dropdown
+ attributes:
+ label: Did you test the latest `bugfix-2.1.x` code?
+ description: >-
+ Always try the latest code to make sure the issue you are reporting is not already fixed. To download
+ the latest code just [click this link](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.1.x.zip).
+ options:
+ - Yes, and the problem still exists.
+ - No, but I will test it now!
+ validations:
+ required: true
+
+ - type: markdown
+ attributes:
+ value: |
+ # Bug Details
+
+ - type: textarea
+ attributes:
+ label: Bug Description
+ description: >-
+ Describe the bug in this section. Tell us what you were trying to do and what
+ happened that you did not expect. Provide a clear and concise description of the
+ problem and include as many details as possible.
+
+ When pasting formatted text don't forget to put ` ``` ` (on its own line) before and after to make it readable.
+ placeholder: |
+ Marlin doesn't work.
+ validations:
+ required: true
+
+ - type: input
+ attributes:
+ label: Bug Timeline
+ description: Is this a new bug or an old issue? When did it first start?
+
+ - type: textarea
+ attributes:
+ label: Expected behavior
+ description: >-
+ What did you expect to happen?
+ placeholder: I expected it to move left.
+
+ - type: textarea
+ attributes:
+ label: Actual behavior
+ description: What actually happened instead?
+ placeholder: It moved right instead of left.
+
+ - type: textarea
+ attributes:
+ label: Steps to Reproduce
+ description: >-
+ Please describe the steps needed to reproduce the issue.
+ placeholder: |
+ 1. [First Step] ...
+ 2. [Second Step] ...
+ 3. [and so on] ...
+
+ - type: markdown
+ attributes:
+ value: |
+ # Your Setup
+
+ - type: input
+ attributes:
+ label: Version of Marlin Firmware
+ description: "See the About Menu on the LCD or the output of `M115`. NOTE: For older releases we only patch critical bugs."
+ validations:
+ required: true
+
+ - type: input
+ attributes:
+ label: Printer model
+ description: Creality Ender-3, Prusa mini, or Kossel Delta?
+
+ - type: input
+ attributes:
+ label: Electronics
+ description: Stock electronics, upgrade board, or something else?
+
+ - type: input
+ attributes:
+ label: LCD/Controller
+ description: Some Marlin behaviors are determined by the controller. Describe your LCD/Controller model and version.
+
+ - type: input
+ attributes:
+ label: Other add-ons
+ description: Please list any other hardware add-ons that could be involved.
+
+ - type: dropdown
+ attributes:
+ label: Bed Leveling
+ description: What kind of bed leveling compensation are you using?
+ options:
+ - UBL Bilinear mesh
+ - ABL Bilinear mesh
+ - ABL Linear grid
+ - ABL 3-point
+ - MBL Manual Bed Leveling
+ - No Bed Leveling
+
+ - type: dropdown
+ attributes:
+ label: Your Slicer
+ description: Do you use Slic3r, Prusa Slicer, Simplify3D, IdeaMaker...?
+ options:
+ - Slic3r
+ - Simplify3D
+ - Prusa Slicer
+ - IdeaMaker
+ - Cura
+ - Other (explain below)
+
+ - type: dropdown
+ attributes:
+ label: Host Software
+ description: Do you use OctoPrint, Repetier Host, Pronterface...?
+ options:
+ - SD Card (headless)
+ - Repetier Host
+ - OctoPrint
+ - Pronterface
+ - Cura
+ - Same as my slicer
+ - Other (explain below)
+
+ - type: markdown
+ attributes:
+ value: |
+ # Attachments
+
+ - type: checkboxes
+ attributes:
+ label: Don't forget to include
+ options:
+ - label: A ZIP file containing your `Configuration.h` and `Configuration_adv.h`.
+ required: true
+
+ - type: markdown
+ attributes:
+ value: |
+ ### Optional items to include:
+ - 'Log output from the host. (`M111 S247` for maximum logging.)'
+ - Images or videos demonstrating the problem, if it helps to make it clear.
+ - A G-Code file that exposes the problem, if not affecting _all_ G-code.
+
+ - type: textarea
+ attributes:
+ label: Additional information & file uploads
+ description: >-
+ If you've made any other modifications to the firmware, please describe them in detail.
+
+ When pasting formatted text don't forget to put ` ``` ` (on its own line) before and after to make it readable.
diff --git a/firmware/.github/ISSUE_TEMPLATE/config.yml b/firmware/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..a22a1bb
--- /dev/null
+++ b/firmware/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,20 @@
+blank_issues_enabled: false
+contact_links:
+ - name: 📖 Marlin Documentation
+ url: https://marlinfw.org/
+ about: Lots of documentation on installing and using Marlin.
+ - name: 👤 MarlinFirmware Facebook group
+ url: https://www.facebook.com/groups/1049718498464482
+ about: Please ask and answer questions here.
+ - name: 🕹 Marlin on Discord
+ url: https://discord.com/servers/marlin-firmware-461605380783472640
+ about: Join the Discord server for support and discussion.
+ - name: 🔗 Marlin Discussion Forum
+ url: https://reprap.org/forum/list.php?415
+ about: A searchable web forum hosted by RepRap dot org.
+ - name: 📺 Marlin Videos on YouTube
+ url: https://www.youtube.com/results?search_query=marlin+firmware
+ about: Tutorials and more from Marlin users all around the world. Great for new users!
+ - name: 💸 Want to donate?
+ url: https://www.thinkyhead.com/donate-to-marlin
+ about: Please take a look at the various options to support Marlin Firmware's development financially!
diff --git a/firmware/.github/ISSUE_TEMPLATE/feature_request.yml b/firmware/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000..2e86071
--- /dev/null
+++ b/firmware/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,44 @@
+name: ✨ Request a feature
+description: Request a new Marlin Firmware feature
+title: "[FR] (feature summary)"
+labels: ["T: Feature Request"]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ Do you want to ask a question? Are you looking for support? Please use one of the [support links](https://github.com/MarlinFirmware/Marlin/issues/new/choose).
+
+ - type: markdown
+ attributes:
+ value: >
+ **Thank you for requesting a new Marlin Firmware feature!**
+
+ ## Before Requesting a Feature
+
+ - Read and understand Marlin's [Code of Conduct](https://github.com/MarlinFirmware/Marlin/blob/master/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect.
+
+ - Check the latest [`bugfix-2.1.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.1.x.zip) to see if the feature already exists.
+
+ - Before you proceed with your request, please consider if it is necessary to make it into a firmware feature, or if it may be better suited for a slicer or host feature.
+
+ - type: textarea
+ attributes:
+ label: Is your feature request related to a problem? Please describe.
+ description: A clear description of the problem (e.g., "I need X but Marlin can't do it [...]").
+
+ - type: textarea
+ attributes:
+ label: Are you looking for hardware support?
+ description: Tell us the printer, board, or peripheral that needs support.
+
+ - type: textarea
+ attributes:
+ label: Describe the feature you want
+ description: A clear description of the feature and how you think it should work.
+ validations:
+ required: true
+
+ - type: textarea
+ attributes:
+ label: Additional context
+ description: Add any other context or screenshots about the feature request here.
diff --git a/firmware/.github/code_of_conduct.md b/firmware/.github/code_of_conduct.md
new file mode 100644
index 0000000..5fd9e0c
--- /dev/null
+++ b/firmware/.github/code_of_conduct.md
@@ -0,0 +1,40 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by following GitHub's [reporting abuse or spam article](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
+
+[homepage]: https://contributor-covenant.org
+[version]: https://contributor-covenant.org/version/1/4/
diff --git a/firmware/.github/contributing.md b/firmware/.github/contributing.md
new file mode 100644
index 0000000..9455977
--- /dev/null
+++ b/firmware/.github/contributing.md
@@ -0,0 +1,148 @@
+# Contributing to Marlin
+
+Thanks for your interest in contributing to Marlin Firmware!
+
+The following is a set of guidelines for contributing to Marlin, hosted by the [MarlinFirmware Organization](https://github.com/MarlinFirmware) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a Pull Request.
+
+#### Table Of Contents
+
+[Code of Conduct](#code-of-conduct)
+
+[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
+
+[How Can I Contribute?](#how-can-i-contribute)
+ * [Reporting Bugs](#reporting-bugs)
+ * [Suggesting Features or Changes](#suggesting-features-or-changes)
+ * [Your First Code Contribution](#your-first-code-contribution)
+ * [Pull Requests](#pull-requests)
+
+[Styleguides](#styleguides)
+ * [Git Commit Messages](#git-commit-messages)
+ * [C++ Coding Standards](#c++-coding-standards)
+ * [Documentation Styleguide](#documentation)
+
+[Additional Notes](#additional-notes)
+ * [Issue and Pull Request Labels](#issue-and-pull-request-labels)
+
+## Code of Conduct
+
+This project and everyone participating in it is governed by the [Marlin Code of Conduct](code_of_conduct.md). By participating, you are expected to uphold this code. Please report unacceptable behavior by following GitHub's [reporting abuse or spam article](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam).
+
+## I don't want to read this whole thing I just have a question!!!
+
+> [!NOTE]
+> Please don't file an issue to ask a question. You'll get faster results by using the resources below.
+
+We have a Message Board and a Facebook group where our knowledgable user community can provide helpful advice if you have questions.
+
+- [Marlin Documentation](https://marlinfw.org) - Official Marlin documentation
+- Facebook Group ["Marlin Firmware"](https://www.facebook.com/groups/1049718498464482/)
+- RepRap.org [Marlin Forum](https://forums.reprap.org/list.php?415)
+- Facebook Group ["Marlin Firmware for 3D Printers"](https://www.facebook.com/groups/3Dtechtalk/)
+- [Marlin Configuration](https://www.youtube.com/results?search_query=marlin+configuration) on YouTube
+
+If chat is more your speed, you can join the MarlinFirmware Discord server:
+
+* Use the link https://discord.com/servers/marlin-firmware-461605380783472640 to join up as a General User.
+* Even though our Discord is pretty active, it may take a while for community members to respond — please be patient!
+* Use the `#general` channel for general questions or discussion about Marlin.
+* Other channels exist for certain topics or are limited to Patrons. Check the channel list.
+
+## How Can I Contribute?
+
+### Reporting Bugs
+
+This section guides you through submitting a Bug Report for Marlin. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
+
+Before creating a Bug Report, please test the "nightly" development branch, as you might find out that you don't need to create one. When you are creating a Bug Report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](ISSUE_TEMPLATE/bug_report.yml), the information it asks for helps us resolve issues faster.
+
+> [!NOTE]
+> Regressions can happen. If you find a **Closed** issue that seems like your issue, go ahead and open a new issue and include a link to the original issue in the body of your new one. All you need to create a link is the issue number, preceded by #. For example, #8888.
+
+#### How Do I Submit A (Good) Bug Report?
+
+Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Use the New Issue button to create an issue and provide the following information by filling in [the template](ISSUE_TEMPLATE/bug_report.yml).
+
+Explain the problem and include additional details to help maintainers reproduce the problem:
+
+* **Use a clear and descriptive title** for the issue to identify the problem.
+* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started Marlin, e.g. which command exactly you used in the terminal, or how you started Marlin otherwise. When listing steps, **don't just say what you did, but explain how you did it**. For example, if you moved the cursor to the end of a line, explain if you used the mouse, or a keyboard shortcut or an Marlin command, and if so which one?
+* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets or log output in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
+* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
+* **Explain which behavior you expected to see instead and why.**
+* **Include detailed log output** especially for probing and leveling. See below for usage of `DEBUG_LEVELING_FEATURE`.
+* **Include screenshots, links to videos, etc.** which clearly demonstrate the problem.
+* **Include G-code** (if relevant) that reliably causes the problem to show itself.
+* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
+
+Provide more context:
+
+* **Can you reproduce the problem with a minimum of options enabled?**
+* **Did the problem start happening recently** (e.g. after updating to a new version of Marlin) or was this always a problem?
+* If the problem started happening recently, **can you reproduce the problem in an older version of Marlin?** What's the most recent version in which the problem doesn't happen? You can download older versions of Marlin from [the releases page](https://github.com/MarlinFirmware/Marlin/releases).
+* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
+
+Include details about your configuration and environment:
+
+* **Which version of Marlin are you using?** Marlin's exact version and build date can be seen in the startup message when a host connects to Marlin, or in the LCD Info menu (if enabled).
+* **What kind of 3D Printer and electronics are you using**?
+* **What kind of add-ons (probe, filament sensor) do you have**?
+* **Include your Configuration files.** Make a ZIP file containing `Configuration.h` and `Configuration_adv.h` and drop it on your reply.
+
+### Suggesting Features or Changes
+
+This section guides you through submitting a suggestion for Marlin, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
+
+Before creating a suggestion, please check [this list](https://github.com/MarlinFirmware/Marlin/issues?q=is%3Aopen+is%3Aissue+label%3A%22T%3A+Feature+Request%22) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-feature-request). Fill in [the template](ISSUE_TEMPLATE/feature_request.yml), including the steps that you imagine you would take if the feature you're requesting existed.
+
+#### Before Submitting a Feature Request
+
+* **Check the [Marlin website](https://marlinfw.org/)** for tips — you might discover that the feature is already included. Most importantly, check if you're using [the latest version of Marlin](https://github.com/MarlinFirmware/Marlin/releases) and if you can get the desired behavior by changing [Marlin's config settings](https://marlinfw.org/docs/configuration/configuration.html).
+* **Perform a [cursory search](https://github.com/MarlinFirmware/Marlin/issues?q=is%3Aopen+is%3Aissue+label%3A%22T%3A+Feature+Request%22)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
+
+#### How Do I Submit A (Good) Feature Request?
+
+Feature Requests are tracked as [GitHub issues](https://guides.github.com/features/issues/). Please follow these guidelines in your request:
+
+* **Use a clear and descriptive title** for the issue to identify the suggestion.
+* **Provide a step-by-step description of the requested feature** in as much detail as possible.
+* **Provide specific examples to demonstrate the steps**.
+* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
+* **Include screenshots and links to videos** which demonstrate the feature or point out the part of Marlin to which the request is related.
+* **Explain why this feature would be useful** to most Marlin users.
+* **Name other firmwares that have this feature, if any.**
+
+### Your First Code Contribution
+
+Unsure where to begin contributing to Marlin? You can start by looking through these `good-first-issue` and `help-wanted` issues:
+
+* [Beginner issues][good-first-issue] - issues which should only require a few lines of code, and a test or two.
+* [Help Wanted issues][help-wanted] - issues which should be a bit more involved than `beginner` issues.
+
+### Pull Requests
+
+Pull Requests should always be targeted to working branches (e.g., `bugfix-2.1.x` and/or `bugfix-1.1.x`) and never to release branches (e.g., `2.0.x` and/or `1.1.x`). If this is your first Pull Request, please read our [Guide to Pull Requests](https://marlinfw.org/docs/development/getting_started_pull_requests.html) and Github's [Pull Request](https://help.github.com/articles/creating-a-pull-request/) documentation.
+
+* Fill in [the required template](pull_request_template.md).
+* Don't include issue numbers in the PR title.
+* Include pictures, diagrams, and links to videos in your Pull Request to demonstrate your changes, if needed.
+* Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) posted on our website.
+* Document new code with clear and concise comments.
+* End all files with a newline.
+
+## Styleguides
+
+### Git Commit Messages
+
+* Use the present tense ("Add feature" not "Added feature").
+* Use the imperative mood ("Move cursor to..." not "Moves cursor to...").
+* Limit the first line to 72 characters or fewer.
+* Reference issues and Pull Requests liberally after the first line.
+
+### C++ Coding Standards
+
+* Please read and follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) posted on our website. Failure to follow these guidelines will delay evaluation and acceptance of Pull Requests.
+
+### Documentation
+
+* Guidelines for documentation are still under development. In-general, be clear, concise, and to-the-point.
diff --git a/firmware/.github/pull_request_template.md b/firmware/.github/pull_request_template.md
new file mode 100644
index 0000000..cd5158b
--- /dev/null
+++ b/firmware/.github/pull_request_template.md
@@ -0,0 +1,33 @@
+
+
+### Description
+
+
+
+### Requirements
+
+
+
+### Benefits
+
+
+
+### Configurations
+
+
+
+### Related Issues
+
+
diff --git a/firmware/.github/workflows/auto-label.yml b/firmware/.github/workflows/auto-label.yml
new file mode 100644
index 0000000..3cbf110
--- /dev/null
+++ b/firmware/.github/workflows/auto-label.yml
@@ -0,0 +1,41 @@
+#
+# auto-label.yml
+# - Find all open issues without a label and a title containing "[BUG]".
+# - Apply the label "Bug: Potential ?" to these issues.
+#
+
+name: Label Old Bugs
+
+on:
+ schedule:
+ - cron: "30 8 * * *"
+
+jobs:
+ autolabel:
+ name: Auto Label
+ if: github.repository == 'MarlinFirmware/Marlin'
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Auto Label for [BUG]
+ uses: actions/github-script@v7
+ with:
+ script: |
+ // Get all open issues in this repository
+ const issueList = await github.rest.issues.listForRepo({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ state: 'open'
+ });
+ // Filter issues without labels that have a title containing '[BUG]'.
+ const matchingIssues = issueList.data.filter(
+ issue => issue.title.includes('[BUG]') && issue.labels.length === 0
+ );
+ // Process the first 50
+ for (const issue of matchingIssues.slice(0, 50)) {
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: issue.number,
+ labels: ['Bug: Potential ?']
+ });
+ }
diff --git a/firmware/.github/workflows/bump-date.yml b/firmware/.github/workflows/bump-date.yml
new file mode 100644
index 0000000..cb27ef1
--- /dev/null
+++ b/firmware/.github/workflows/bump-date.yml
@@ -0,0 +1,59 @@
+#
+# bump-date.yml
+# Bump the distribution date once per day
+#
+
+name: Bump Distribution Date
+
+on:
+ schedule:
+ - cron: '0 */6 * * *'
+
+jobs:
+ bump_date:
+ name: Bump Distribution Date
+ if: github.repository == 'MarlinFirmware/Marlin'
+
+ runs-on: ubuntu-22.04
+
+ steps:
+
+ - name: Check out bugfix-2.0.x
+ uses: actions/checkout@v4
+ with:
+ ref: bugfix-2.0.x
+
+ - name: Bump Date (bugfix-2.0.x)
+ run: |
+ # Inline Bump Script
+ if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then
+ DIST=$( date +"%Y-%m-%d" )
+ eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
+ eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \
+ git config user.name "${GITHUB_ACTOR}" && \
+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
+ git add . && \
+ git commit -m "[cron] Bump distribution date ($DIST)" && \
+ git push
+ fi
+ exit 0
+
+ - name: Check out bugfix-2.1.x
+ uses: actions/checkout@v4
+ with:
+ ref: bugfix-2.1.x
+
+ - name: Bump Date (bugfix-2.1.x)
+ run: |
+ # Inline Bump Script
+ if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then
+ DIST=$( date +"%Y-%m-%d" )
+ eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
+ eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \
+ git config user.name "${GITHUB_ACTOR}" && \
+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
+ git add . && \
+ git commit -m "[cron] Bump distribution date ($DIST)" && \
+ git push
+ fi
+ exit 0
diff --git a/firmware/.github/workflows/check-pr.yml b/firmware/.github/workflows/check-pr.yml
new file mode 100644
index 0000000..a28b7fd
--- /dev/null
+++ b/firmware/.github/workflows/check-pr.yml
@@ -0,0 +1,33 @@
+#
+# check-pr.yml
+# Close PRs directed at release branches
+#
+
+name: PR Bad Target
+
+on:
+ pull_request_target:
+ types: [opened]
+ branches:
+ - 1.0.x
+ - 1.1.x
+ - 2.0.x
+
+jobs:
+ bad_target:
+ name: PR Bad Target
+ if: github.repository == 'MarlinFirmware/Marlin'
+
+ runs-on: ubuntu-22.04
+
+ steps:
+ - uses: superbrothers/close-pull-request@v3
+ with:
+ comment: >
+ Thanks for your contribution! Unfortunately we can't accept PRs directed at release branches. We make patches to the bugfix branches and only later do we push them out as releases.
+
+ Please redo this PR starting with the `bugfix-2.1.x` branch and be careful to target `bugfix-2.1.x` when resubmitting the PR. Patches may also target `bugfix-2.0.x` if they are specifically for 2.0.9.x.
+
+ It may help to set your fork's default branch to `bugfix-2.1.x`.
+
+ See [this page](https://marlinfw.org/docs/development/getting_started_pull_requests.html) for full instructions.
diff --git a/firmware/.github/workflows/ci-build-tests.yml b/firmware/.github/workflows/ci-build-tests.yml
new file mode 100644
index 0000000..afe9292
--- /dev/null
+++ b/firmware/.github/workflows/ci-build-tests.yml
@@ -0,0 +1,198 @@
+#
+# ci-build-tests.yml
+# Do test builds to catch compile errors
+#
+
+name: CI - Build Tests
+
+on:
+ pull_request:
+ branches:
+ - bugfix-2.1.x
+ - 2.1.x
+ paths-ignore:
+ - config/**
+ - data/**
+ - docs/**
+ - test/**
+ - Marlin/tests/**
+ - '**/*.md'
+ push:
+ branches:
+ - bugfix-2.1.x
+ - 2.1.x
+ paths-ignore:
+ - config/**
+ - data/**
+ - docs/**
+ - test/**
+ - Marlin/tests/**
+ - '**/*.md'
+
+jobs:
+ test_builds:
+ name: Build Test
+ if: github.repository == 'MarlinFirmware/Marlin'
+
+ runs-on: ubuntu-22.04
+
+ strategy:
+ fail-fast: true
+ matrix:
+ test-platform:
+
+ # RP2040
+ - SKR_Pico
+
+ # Native
+ - linux_native
+ - simulator_linux_release
+
+ # AVR
+ - mega2560
+ - mega1280
+ - at90usb1286_dfu
+
+ # AVR Extended
+ - FYSETC_F6
+ - melzi_optiboot
+ - rambo
+ - sanguino1284p
+ - sanguino644p
+
+ # SAM3X8E
+ - DUE
+ - DUE_archim
+
+ # SAMD21
+ - SAMD51_grandcentral_m4
+ - SAMD21_minitronics20
+
+ # ESP32
+ - esp32
+ - mks_tinybee
+
+ # Teensy 2
+ #- at90usb1286_cdc
+
+ # Teensy MK20DX256
+ - teensy31
+
+ # Teensy MK64FX512, MK66FX1M0
+ - teensy35
+
+ # Teensy IMXRT1062DVx6A
+ - teensy41
+
+ # STM32F0
+ - malyan_M300
+ - STM32F070CB_malyan
+ - STM32F070RB_malyan
+
+ # STM32F1
+ - chitu_f103
+ - mks_robin
+ - mks_robin_nano_v1v2
+ - PANDA_PI_V29
+ - STM32F103RC_btt
+ - STM32F103RC_fysetc
+ - STM32F103RE_btt
+ - STM32F103RE_btt_USB
+ - STM32F103RE_creality
+ - STM32F103VE_longer
+ #- mks_robin_mini
+ #- mks_robin_nano_v1_3_f4_usbmod
+ #- mks_robin_nano_v1v2_usbmod
+ #- STM32F103CB_malyan
+ #- STM32F103RC_btt_USB
+ #- STM32F103RE
+
+ # STM32F4
+ - ARMED
+ - BTT_BTT002
+ - BTT_GTR_V1_0
+ - BTT_SKR_PRO
+ - FLYF407ZG
+ - FYSETC_S6
+ - LERDGEK
+ - LERDGEX
+ - mks_robin_pro2
+ - Opulo_Lumen_REV3
+ - rumba32
+ - STM32F401RC_creality
+ - STM32F407VE_black
+ - I3DBEEZ9_V1
+
+ # STM32F7
+ - NUCLEO_F767ZI
+ - REMRAM_V1
+
+ # STM32H7
+ - BTT_SKR_SE_BX
+ - STM32H743VI_btt
+
+ # STM32F1 (Maple)
+ - jgaurora_a5s_a1_maple
+ - mks_robin_lite_maple
+ - mks_robin_pro_maple
+ - STM32F103RC_btt_USB_maple
+ - STM32F103RC_fysetc_maple
+ - STM32F103RC_meeb_maple
+ - STM32F103VE_longer_maple
+ - STM32F103VE_ZM3E4V2_USB_maple
+ #- mks_robin_maple
+ #- mks_robin_nano_v1v2_maple
+ #- STM32F103RC_btt_maple
+ #- STM32F103RE_creality_maple
+
+ # STM32G0
+ - STM32G0B1RE_btt
+
+ # HC32
+ - HC32F460C_aquila_101
+
+ # LPC176x - Lengthy tests
+ - LPC1768
+ - LPC1769
+
+ steps:
+
+ - name: Check out the PR
+ uses: actions/checkout@v4
+
+ - name: Cache pip
+ uses: actions/cache@v4
+ with:
+ path: ~/.cache/pip
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+ restore-keys: |
+ ${{ runner.os }}-pip-
+
+ - name: Cache PlatformIO
+ uses: actions/cache@v4
+ with:
+ path: ~/.platformio
+ key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
+
+ - name: Select Python 3.9
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.9'
+ architecture: 'x64'
+
+ - name: Install PlatformIO
+ run: |
+ pip install -U platformio
+ pio upgrade --dev
+ pio pkg update --global
+
+ - name: Install Simulator dependencies
+ run: |
+ sudo apt-get install build-essential
+ sudo apt-get install libsdl2-dev
+ sudo apt-get install libsdl2-net-dev
+ sudo apt-get install libglm-dev
+
+ - name: Run ${{ matrix.test-platform }} Tests
+ run: |
+ make tests-single-ci TEST_TARGET=${{ matrix.test-platform }}
diff --git a/firmware/.github/workflows/ci-unit-tests.yml b/firmware/.github/workflows/ci-unit-tests.yml
new file mode 100644
index 0000000..9a311aa
--- /dev/null
+++ b/firmware/.github/workflows/ci-unit-tests.yml
@@ -0,0 +1,73 @@
+#
+# ci-unit-tests.yml
+# Build and execute unit tests to catch functional issues in code
+#
+
+name: CI - Unit Tests
+
+on:
+ pull_request:
+ branches:
+ - bugfix-2.1.x
+ # Cannot be enabled on 2.1.x until it contains the unit test framework
+ #- 2.1.x
+ paths-ignore:
+ - config/**
+ - data/**
+ - docs/**
+ - '**/*.md'
+ push:
+ branches:
+ - bugfix-2.1.x
+ # Cannot be enabled on 2.1.x until it contains the unit test framework
+ #- 2.1.x
+ paths-ignore:
+ - config/**
+ - data/**
+ - docs/**
+ - '**/*.md'
+
+jobs:
+ # This runs all unit tests as a single job. While it should be possible to break this up into
+ # multiple jobs, they currently run quickly and finish long before the compilation tests.
+ run_unit_tests:
+ name: Unit Test
+ # These tests will only be able to run on the bugfix-2.1.x branch, until the next release
+ # pulls them into additional branches.
+ if: github.repository == 'MarlinFirmware/Marlin'
+
+ runs-on: ubuntu-22.04
+
+ steps:
+ - name: Check out the PR
+ uses: actions/checkout@v4
+
+ - name: Cache pip
+ uses: actions/cache@v4
+ with:
+ path: ~/.cache/pip
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+ restore-keys: |
+ ${{ runner.os }}-pip-
+
+ - name: Cache PlatformIO
+ uses: actions/cache@v4
+ with:
+ path: ~/.platformio
+ key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
+
+ - name: Select Python 3.9
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.9'
+ architecture: 'x64'
+
+ - name: Install PlatformIO
+ run: |
+ pip install -U platformio
+ pio upgrade --dev
+ pio pkg update --global
+
+ - name: Run All Unit Tests
+ run: |
+ make unit-test-all-local
diff --git a/firmware/.github/workflows/ci-validate-boards.yml b/firmware/.github/workflows/ci-validate-boards.yml
new file mode 100644
index 0000000..baa7b8b
--- /dev/null
+++ b/firmware/.github/workflows/ci-validate-boards.yml
@@ -0,0 +1,48 @@
+#
+# ci-validate-boards.yml
+# Validate boards.h to make sure it's all set up correctly
+#
+
+name: CI - Validate boards.h
+
+# We can do the on: section as two items, one for pull requests and one for pushes...
+on:
+ pull_request:
+ branches:
+ - bugfix-2.1.x
+ paths:
+ - 'Marlin/src/core/boards.h'
+ push:
+ branches:
+ - bugfix-2.1.x
+ paths:
+ - 'Marlin/src/core/boards.h'
+
+jobs:
+ validate_pins_files:
+ name: Validate boards.h
+ if: github.repository == 'MarlinFirmware/Marlin'
+
+ runs-on: ubuntu-22.04
+
+ 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 core/boards.h
+ run: |
+ make validate-boards -j
diff --git a/firmware/.github/workflows/ci-validate-pins.yml b/firmware/.github/workflows/ci-validate-pins.yml
new file mode 100644
index 0000000..695f8ef
--- /dev/null
+++ b/firmware/.github/workflows/ci-validate-pins.yml
@@ -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-22.04
+
+ 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
diff --git a/firmware/.github/workflows/clean-closed.yml b/firmware/.github/workflows/clean-closed.yml
new file mode 100644
index 0000000..ad0ee8e
--- /dev/null
+++ b/firmware/.github/workflows/clean-closed.yml
@@ -0,0 +1,40 @@
+#
+# clean-closed.yml
+# Remove obsolete labels when an Issue or PR is closed
+#
+
+name: Clean Closed
+
+on:
+ pull_request:
+ types: [closed]
+ issues:
+ types: [closed]
+
+jobs:
+ remove_label:
+ runs-on: ubuntu-22.04
+
+ strategy:
+ matrix:
+ label:
+ - "S: Don't Merge"
+ - "S: Hold for 2.1"
+ - "S: Please Merge"
+ - "S: Please Test"
+ - "help wanted"
+ - "Bug: Potential ?"
+ - "Needs: Discussion"
+ - "Needs: Documentation"
+ - "Needs: More Data"
+ - "Needs: Patch"
+ - "Needs: Testing"
+ - "Needs: Work"
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Remove Labels
+ uses: actions-ecosystem/action-remove-labels@v1
+ with:
+ github_token: ${{ github.token }}
+ labels: ${{ matrix.label }}
diff --git a/firmware/.github/workflows/close-stale.yml b/firmware/.github/workflows/close-stale.yml
new file mode 100644
index 0000000..4bb488c
--- /dev/null
+++ b/firmware/.github/workflows/close-stale.yml
@@ -0,0 +1,40 @@
+#
+# close-stale.yml
+# Close open issues after a period of inactivity
+#
+
+name: Close Stale Issues
+
+on:
+ schedule:
+ - cron: "22 1 * * *"
+
+jobs:
+ stale:
+ name: Close Stale Issues
+ if: github.repository == 'MarlinFirmware/Marlin'
+
+ runs-on: ubuntu-22.04
+
+ steps:
+ - uses: actions/stale@v9
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ stale-issue-message: |
+ Greetings from the Marlin AutoBot!
+ This issue has had no activity for the last 90 days.
+ Do you still see this issue with the latest `bugfix-2.1.x` code?
+ Please add a reply within 14 days or this issue will be automatically closed.
+ To keep a confirmed issue open we can also add a "Bug: Confirmed" tag.
+
+ Disclaimer: This is an open community project with lots of activity and limited
+ resources. The main project contributors will do a bug sweep ahead of the next
+ release, but any skilled member of the community may jump in at any time to fix
+ this issue. That can take a while depending on our busy lives so please be patient,
+ and take advantage of other resources such as the MarlinFirmware Discord to help
+ solve the issue.
+ days-before-stale: 90
+ days-before-close: 14
+ stale-issue-label: 'stale-closing-soon'
+ exempt-all-assignees: true
+ exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: More Data,Needs: Discussion,Needs: Documentation,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking'
diff --git a/firmware/.github/workflows/lock-closed.yml b/firmware/.github/workflows/lock-closed.yml
new file mode 100644
index 0000000..1435a3e
--- /dev/null
+++ b/firmware/.github/workflows/lock-closed.yml
@@ -0,0 +1,32 @@
+#
+# lock-closed.yml
+# Lock closed issues after a period of inactivity
+#
+
+name: Lock Closed Issues
+
+on:
+ schedule:
+ - cron: '0 1/13 * * *'
+
+jobs:
+ lock:
+ name: Lock Closed Issues
+ if: github.repository == 'MarlinFirmware/Marlin'
+
+ runs-on: ubuntu-22.04
+
+ steps:
+ - uses: dessant/lock-threads@v5
+ with:
+ github-token: ${{ github.token }}
+ process-only: 'issues'
+ issue-inactive-days: '60'
+ exclude-issue-created-before: ''
+ exclude-any-issue-labels: 'no-locking'
+ add-issue-labels: ''
+ issue-comment: >
+ This issue has been automatically locked since there
+ has not been any recent activity after it was closed.
+ Please open a new issue for related bugs.
+ issue-lock-reason: ''
diff --git a/firmware/.github/workflows/unlock-reopened.yml b/firmware/.github/workflows/unlock-reopened.yml
new file mode 100644
index 0000000..f88e07c
--- /dev/null
+++ b/firmware/.github/workflows/unlock-reopened.yml
@@ -0,0 +1,22 @@
+#
+# unlock-reopened.yml
+# Unlock an issue whenever it is re-opened
+#
+
+name: "Unlock reopened issue"
+
+on:
+ issues:
+ types: [reopened]
+
+jobs:
+ unlock:
+ name: Unlock Reopened
+ if: github.repository == 'MarlinFirmware/Marlin'
+
+ runs-on: ubuntu-22.04
+
+ steps:
+ - uses: OSDKDev/unlock-issues@v1.1
+ with:
+ repo-token: "${{ secrets.GITHUB_TOKEN }}"
diff --git a/firmware/.gitignore b/firmware/.gitignore
old mode 100755
new mode 100644
index 50a34f9..daa5c5c
--- a/firmware/.gitignore
+++ b/firmware/.gitignore
@@ -169,3 +169,6 @@ __pycache__
tags
*.logs
*.bak
+.aider*
+!.aiderignore
+.env
diff --git a/firmware/.vscode/extensions.json b/firmware/.vscode/extensions.json
new file mode 100644
index 0000000..52fe2a0
--- /dev/null
+++ b/firmware/.vscode/extensions.json
@@ -0,0 +1,12 @@
+{
+ // See http://go.microsoft.com/fwlink/?LinkId=827846
+ // for the documentation about the extensions.json format
+ "recommendations": [
+ "marlinfirmware.auto-build",
+ "platformio.platformio-ide"
+ ],
+ "unwantedRecommendations": [
+ "ms-vscode-remote.remote-containers",
+ "ms-vscode.cpptools-extension-pack"
+ ]
+}
diff --git a/firmware/.zed/settings.json b/firmware/.zed/settings.json
new file mode 100644
index 0000000..70bb149
--- /dev/null
+++ b/firmware/.zed/settings.json
@@ -0,0 +1,16 @@
+/**
+ * Marlin-specific settings for Zed
+ *
+ * For a full list of overridable settings, and general information on folder-specific settings,
+ * see the documentation: https://zed.dev/docs/configuring-zed#settings-files
+ */
+{
+ "languages": {
+ "C": {
+ "enable_language_server": false
+ },
+ "C++": {
+ "enable_language_server": false
+ }
+ }
+}
diff --git a/firmware/Makefile b/firmware/Makefile
index 02722b9..83b27e5 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -6,9 +6,10 @@ UNIT_TEST_CONFIG ?= default
help:
@echo "Tasks for local development:"
- @echo "make marlin : Build marlin for the configured board"
+ @echo "make marlin : Build Marlin for the configured board"
@echo "make format-pins -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 validate-boards -j : Validate boards.h and pins.h for standards compliance"
@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"
@@ -102,3 +103,11 @@ 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)
+
+BOARDS_FILE := Marlin/src/core/boards.h
+
+.PHONY: validate-boards
+
+validate-boards:
+ @echo "Validating boards.h file"
+ @python $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1)
diff --git a/firmware/Marlin/Configuration.h b/firmware/Marlin/Configuration.h
index df06ce6..0a00fc9 100644
--- a/firmware/Marlin/Configuration.h
+++ b/firmware/Marlin/Configuration.h
@@ -21,8 +21,6 @@
*/
#pragma once
-#define CONFIG_EXAMPLES_DIR "Creality/Ender-5 Pro/CrealityV427"
-
/**
* Configuration.h
*
@@ -63,16 +61,18 @@
// @section info
// Author info of this build printed to the host during boot and M115
-#define STRING_CONFIG_H_AUTHOR "(Dust, Ender-5 Pro)" // Who made the changes.
+#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Original author or contributor.
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
// @section machine
// Choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD
- #define MOTHERBOARD BOARD_CREALITY_V427
+ #define MOTHERBOARD BOARD_RAMPS_14_SF
#endif
+// @section serial
+
/**
* Select the serial port on the board to use for communication with the host.
* This allows the connection of wireless adapters (for instance) to non-default port pins.
@@ -81,7 +81,7 @@
*
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
*/
-#define SERIAL_PORT 1
+#define SERIAL_PORT 0
/**
* Serial Port Baud Rate
@@ -94,7 +94,7 @@
*
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
*/
-#define BAUDRATE 115200
+#define BAUDRATE 250000
//#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate
@@ -128,7 +128,7 @@
//#define BLUETOOTH
// Name displayed in the LCD "Ready" message and Info menu
-#define CUSTOM_MACHINE_NAME "Motor-Winder 1.0"
+//#define CUSTOM_MACHINE_NAME "3D Printer"
// Printer's unique ID, used by some programs to differentiate between machines.
// Choose your own or use a service like https://www.uuidgenerator.net/version4
@@ -151,9 +151,9 @@
* TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/
-#define X_DRIVER_TYPE TMC2208_STANDALONE
-#define Y_DRIVER_TYPE TMC2208_STANDALONE
-#define Z_DRIVER_TYPE TMC2208_STANDALONE
+#define X_DRIVER_TYPE A4988
+#define Y_DRIVER_TYPE A4988
+#define Z_DRIVER_TYPE A4988
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
@@ -165,7 +165,7 @@
//#define U_DRIVER_TYPE A4988
//#define V_DRIVER_TYPE A4988
//#define W_DRIVER_TYPE A4988
-#define E0_DRIVER_TYPE TMC2208_STANDALONE
+//#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
@@ -220,7 +220,7 @@
// This defines the number of extruders
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
-#define EXTRUDERS 1
+#define EXTRUDERS 0
// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc.
#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75
@@ -566,7 +566,7 @@
* 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below.
* 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below.
*/
-#define TEMP_SENSOR_0 1
+#define TEMP_SENSOR_0 0
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
@@ -574,7 +574,7 @@
#define TEMP_SENSOR_5 0
#define TEMP_SENSOR_6 0
#define TEMP_SENSOR_7 0
-#define TEMP_SENSOR_BED 1
+#define TEMP_SENSOR_BED 0
#define TEMP_SENSOR_PROBE 0
#define TEMP_SENSOR_CHAMBER 0
#define TEMP_SENSOR_COOLER 0
@@ -658,7 +658,7 @@
#define HEATER_5_MAXTEMP 275
#define HEATER_6_MAXTEMP 275
#define HEATER_7_MAXTEMP 275
-#define BED_MAXTEMP 125
+#define BED_MAXTEMP 150
#define CHAMBER_MAXTEMP 60
/**
@@ -684,7 +684,7 @@
* PIDTEMP : PID temperature control (~4.1K)
* MPCTEMP : Predictive Model temperature control. (~1.8K without auto-tune)
*/
-#define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning
+//#define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning
//#define MPCTEMP // 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
@@ -695,17 +695,16 @@
//#define PID_PARAMS_PER_HOTEND // Use separate PID parameters for each extruder (useful for mismatched extruders)
// Set/get with G-code: M301 E[extruder number, 0-2]
- // Creality Ender-5 Pro
#if ENABLED(PID_PARAMS_PER_HOTEND)
// Specify up to one value per hotend here, according to your setup.
// If there are fewer values, the last one applies to the remaining hotends.
- #define DEFAULT_Kp_LIST { 21.73, 21.73 }
- #define DEFAULT_Ki_LIST { 1.54, 1.54 }
- #define DEFAULT_Kd_LIST { 76.55, 76.55 }
+ #define DEFAULT_Kp_LIST { 22.20, 22.20 }
+ #define DEFAULT_Ki_LIST { 1.08, 1.08 }
+ #define DEFAULT_Kd_LIST { 114.00, 114.00 }
#else
- #define DEFAULT_Kp 21.73
- #define DEFAULT_Ki 1.54
- #define DEFAULT_Kd 76.55
+ #define DEFAULT_Kp 22.20
+ #define DEFAULT_Ki 1.08
+ #define DEFAULT_Kd 114.00
#endif
#else
#define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current
@@ -805,6 +804,40 @@
//#define BED_LIMIT_SWITCHING // Keep the bed temperature within BED_HYSTERESIS of the target
#endif
+/**
+ * Peltier Bed - Heating and Cooling
+ *
+ * A Peltier device transfers heat from one side to the other in proportion to the amount of
+ * current flowing through the device and the direction of current flow. So the same device
+ * can both heat and cool.
+ *
+ * When "cooling" in addition to rejecting the heat transferred from the hot side to the cold
+ * side, the dissipated power (voltage * current) must also be rejected. Be sure to set up a
+ * fan that can be powered in sync with the Peltier unit.
+ *
+ * This feature is only set up to run in bang-bang mode because Peltiers don't handle PWM
+ * well without filter circuitry.
+ *
+ * Since existing 3D printers are made to handle relatively high current for the heated bed,
+ * we can use the heated bed power pins to control the Peltier power using the same G-codes
+ * as the heated bed (M140, M190, etc.).
+ *
+ * A second GPIO pin is required to control current direction.
+ * Two configurations are possible: Relay and H-Bridge
+ *
+ * (At this time only relay is supported. H-bridge requires 4 MOS switches configured in H-Bridge.)
+ *
+ * Power is handled by the bang-bang control loop: 0 or 255.
+ * Cooling applications are more common than heating, so the pin states are commonly:
+ * LOW = Heating = Relay Energized
+ * HIGH = Cooling = Relay in "Normal" state
+ */
+//#define PELTIER_BED
+#if ENABLED(PELTIER_BED)
+ #define PELTIER_DIR_PIN -1 // Relay control pin for Peltier
+ #define PELTIER_DIR_HEAT_STATE LOW // The relay pin state that causes the Peltier to heat
+#endif
+
// Add 'M190 R T' for more gradual M190 R bed cooling.
//#define BED_ANNEALING_GCODE
@@ -861,8 +894,8 @@
#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
- #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash)
- #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash)
+ #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash)
+ #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash)
#endif
// @section safety
@@ -874,8 +907,8 @@
*
* *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! ***
*/
-// #define PREVENT_COLD_EXTRUSION
-// #define EXTRUDE_MINTEMP 170
+//#define PREVENT_COLD_EXTRUSION
+//#define EXTRUDE_MINTEMP 170
/**
* Prevent a single extrusion longer than EXTRUDE_MAXLENGTH.
@@ -901,16 +934,16 @@
* details can be tuned in Configuration_adv.h
*/
-#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
-#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
-#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber
-#define THERMAL_PROTECTION_COOLER // Enable thermal protection for the laser cooling
+//#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
+//#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
+//#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber
+//#define THERMAL_PROTECTION_COOLER // Enable thermal protection for the laser cooling
//===========================================================================
//============================= Mechanical Settings =========================
//===========================================================================
-// @section machine
+// @section kinematics
// Enable one of the options below for CoreXY, CoreXZ, or CoreYZ kinematics,
// either in the usual order or reversed
@@ -934,6 +967,15 @@
// Enable for a belt style printer with endless "Z" motion
//#define BELTPRINTER
+// Articulated robot (arm). Joints are directly mapped to axes with no kinematics.
+//#define ARTICULATED_ROBOT_ARM
+
+// For a hot wire cutter with parallel horizontal axes (X, I) where the heights of the two wire
+// ends are controlled by parallel axes (Y, J). Joints are directly mapped to axes (no kinematics).
+//#define FOAMCUTTER_XYUV
+
+// @section polargraph
+
// Enable for Polargraph Kinematics
//#define POLARGRAPH
#if ENABLED(POLARGRAPH)
@@ -1120,15 +1162,6 @@
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
#endif
-// @section machine
-
-// Articulated robot (arm). Joints are directly mapped to axes with no kinematics.
-//#define ARTICULATED_ROBOT_ARM
-
-// For a hot wire cutter with parallel horizontal axes (X, I) where the heights of the two wire
-// ends are controlled by parallel axes (Y, J). Joints are directly mapped to axes (no kinematics).
-//#define FOAMCUTTER_XYUV
-
//===========================================================================
//============================== Endstop Settings ===========================
//===========================================================================
@@ -1189,25 +1222,25 @@
* Endstop "Hit" State
* Set to the state (HIGH or LOW) that applies to each endstop.
*/
-#define X_MIN_ENDSTOP_HIT_STATE HIGH
-#define X_MAX_ENDSTOP_HIT_STATE HIGH
-#define Y_MIN_ENDSTOP_HIT_STATE HIGH
-#define Y_MAX_ENDSTOP_HIT_STATE HIGH
-#define Z_MIN_ENDSTOP_HIT_STATE HIGH
-#define Z_MAX_ENDSTOP_HIT_STATE HIGH
-#define I_MIN_ENDSTOP_HIT_STATE HIGH
-#define I_MAX_ENDSTOP_HIT_STATE HIGH
-#define J_MIN_ENDSTOP_HIT_STATE HIGH
-#define J_MAX_ENDSTOP_HIT_STATE HIGH
-#define K_MIN_ENDSTOP_HIT_STATE HIGH
-#define K_MAX_ENDSTOP_HIT_STATE HIGH
-#define U_MIN_ENDSTOP_HIT_STATE HIGH
-#define U_MAX_ENDSTOP_HIT_STATE HIGH
-#define V_MIN_ENDSTOP_HIT_STATE HIGH
-#define V_MAX_ENDSTOP_HIT_STATE HIGH
-#define W_MIN_ENDSTOP_HIT_STATE HIGH
-#define W_MAX_ENDSTOP_HIT_STATE HIGH
-#define Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH
+#define X_MIN_ENDSTOP_HIT_STATE LOW //!
+#define X_MAX_ENDSTOP_HIT_STATE LOW
+#define Y_MIN_ENDSTOP_HIT_STATE LOW
+#define Y_MAX_ENDSTOP_HIT_STATE HIGH //!
+#define Z_MIN_ENDSTOP_HIT_STATE HIGH
+#define Z_MAX_ENDSTOP_HIT_STATE LOW //!
+//#define I_MIN_ENDSTOP_HIT_STATE HIGH
+//#define I_MAX_ENDSTOP_HIT_STATE HIGH
+//#define J_MIN_ENDSTOP_HIT_STATE HIGH
+//#define J_MAX_ENDSTOP_HIT_STATE HIGH
+//#define K_MIN_ENDSTOP_HIT_STATE HIGH
+//#define K_MAX_ENDSTOP_HIT_STATE HIGH
+//#define U_MIN_ENDSTOP_HIT_STATE HIGH
+//#define U_MAX_ENDSTOP_HIT_STATE HIGH
+//#define V_MIN_ENDSTOP_HIT_STATE HIGH
+//#define V_MAX_ENDSTOP_HIT_STATE HIGH
+//#define W_MIN_ENDSTOP_HIT_STATE HIGH
+//#define W_MAX_ENDSTOP_HIT_STATE HIGH
+//#define Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH
// Enable this feature if all enabled endstop pins are interrupt-capable.
// This will remove the need to poll the interrupt pins, saving many CPU cycles.
@@ -1255,7 +1288,8 @@
* Override with M92 (when enabled below)
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
-#define DEFAULT_AXIS_STEPS_PER_UNIT { 2572, 80, 800, 93 }
+//#define DEFAULT_AXIS_STEPS_PER_UNIT { 1280, 80, 8.89 }
+#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 8.89, 1280 }
/**
* Enable support for M92. Disable to save at least ~530 bytes of flash.
@@ -1267,7 +1301,7 @@
* Override with M203
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
-#define DEFAULT_MAX_FEEDRATE { 5, 150, 5, 25 }
+#define DEFAULT_MAX_FEEDRATE { 300, 5000, 5}
//#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
#if ENABLED(LIMITED_MAX_FR_EDITING)
@@ -1280,7 +1314,7 @@
* Override with M201
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
-#define DEFAULT_MAX_ACCELERATION { 1500, 700, 100, 5000 }
+#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 3000}
//#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2
#if ENABLED(LIMITED_MAX_ACCEL_EDITING)
@@ -1294,16 +1328,10 @@
* M204 P Acceleration
* M204 R Retract Acceleration
* M204 T Travel Acceleration
- * M204 I Angular Acceleration
- * M204 J Angular Travel Acceleration
*/
-#define DEFAULT_ACCELERATION 500 // X, Y, Z ... and E acceleration for printing moves
-#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts
-#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z ... acceleration for travel (non printing) moves
-#if ENABLED(AXIS4_ROTATES)
- #define DEFAULT_ANGULAR_ACCELERATION 3000 // I, J, K acceleration for rotational-only printing moves
- #define DEFAULT_ANGULAR_TRAVEL_ACCELERATION 3000 // I, J, K acceleration for rotational-only travel (non printing) moves
-#endif
+#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts
+#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves
/**
* Default Jerk limits (mm/s)
@@ -1342,7 +1370,7 @@
* https://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
*/
#if DISABLED(CLASSIC_JERK)
- #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge
+ #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge
#define JD_HANDLE_SMALL_SEGMENTS // Use curvature estimation instead of just the junction angle
// for small segments (< 1mm) with large junction angles (> 135°).
#endif
@@ -1371,7 +1399,7 @@
* The probe replaces the Z-MIN endstop and is used for Z homing.
* (Automatically enables USE_PROBE_FOR_Z_HOMING.)
*/
-// #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
// Force the use of the probe for Z-axis homing
//#define USE_PROBE_FOR_Z_HOMING
@@ -1619,7 +1647,8 @@
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define PROBING_MARGIN 10
-// X and Y axis travel speed (mm/min) between probes
+// X and Y axis travel speed (mm/min) between probes.
+// Leave undefined to use the average of the current XY homing feedrate.
#define XY_PROBE_FEEDRATE (133*60)
// Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2)
@@ -1743,17 +1772,17 @@
// @section stepper drivers
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
-// :{ 0:'Low', 1:'High' }
-#define X_ENABLE_ON 0
-#define Y_ENABLE_ON 0
-#define Z_ENABLE_ON 0
-#define E_ENABLE_ON 0 // For all extruders
-//#define I_ENABLE_ON 0
-//#define J_ENABLE_ON 0
-//#define K_ENABLE_ON 0
-//#define U_ENABLE_ON 0
-//#define V_ENABLE_ON 0
-//#define W_ENABLE_ON 0
+// :['LOW', 'HIGH']
+#define X_ENABLE_ON LOW
+#define Y_ENABLE_ON LOW
+#define Z_ENABLE_ON LOW
+#define E_ENABLE_ON LOW // For all extruders
+//#define I_ENABLE_ON LOW
+//#define J_ENABLE_ON LOW
+//#define K_ENABLE_ON LOW
+//#define U_ENABLE_ON LOW
+//#define V_ENABLE_ON LOW
+//#define W_ENABLE_ON LOW
// Disable axis steppers immediately when they're not being stepped.
// WARNING: When motors turn off there is a chance of losing position accuracy!
@@ -1773,14 +1802,14 @@
// @section extruder
//#define DISABLE_E // Disable the extruder when not stepping
-//#define DISABLE_OTHER_EXTRUDERS // Keep only the active extruder enabled
+//#define DISABLE_OTHER_EXTRUDERS // Keep only the active extruder enabled
// @section motion
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
-#define INVERT_X_DIR false
+#define INVERT_X_DIR true
#define INVERT_Y_DIR false
-#define INVERT_Z_DIR false
+#define INVERT_Z_DIR true
//#define INVERT_I_DIR false
//#define INVERT_J_DIR false
//#define INVERT_K_DIR false
@@ -1812,7 +1841,7 @@
*/
//#define Z_IDLE_HEIGHT Z_HOME_POS
-//#define Z_CLEARANCE_FOR_HOMING 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
+#define Z_CLEARANCE_FOR_HOMING 0 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
// You'll need this much clearance above Z_MAX_POS to avoid grinding.
//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing (if Z was homed)
@@ -1823,8 +1852,8 @@
// Direction of endstops when homing; 1=MAX, -1=MIN
// :[-1,1]
#define X_HOME_DIR -1
-#define Y_HOME_DIR -1
-#define Z_HOME_DIR -1
+#define Y_HOME_DIR 1
+#define Z_HOME_DIR 1
//#define I_HOME_DIR -1
//#define J_HOME_DIR -1
//#define K_HOME_DIR -1
@@ -1850,8 +1879,8 @@
// @section geometry
// The size of the printable area
-#define X_BED_SIZE 26
-#define Y_BED_SIZE 44
+#define X_BED_SIZE (38+26+16)
+#define Y_BED_SIZE 360
// Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
@@ -1859,7 +1888,7 @@
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
-#define Z_MAX_POS 3000
+#define Z_MAX_POS 41
//#define I_MIN_POS 0
//#define I_MAX_POS 50
//#define J_MIN_POS 0
@@ -1883,7 +1912,7 @@
*/
// Min software endstops constrain movement within minimum coordinate bounds
-#define MIN_SOFTWARE_ENDSTOPS
+//#define MIN_SOFTWARE_ENDSTOPS
#if ENABLED(MIN_SOFTWARE_ENDSTOPS)
#define MIN_SOFTWARE_ENDSTOP_X
#define MIN_SOFTWARE_ENDSTOP_Y
@@ -1897,7 +1926,7 @@
#endif
// Max software endstops constrain movement within maximum coordinate bounds
-#define MAX_SOFTWARE_ENDSTOPS
+//#define MAX_SOFTWARE_ENDSTOPS
#if ENABLED(MAX_SOFTWARE_ENDSTOPS)
#define MAX_SOFTWARE_ENDSTOP_X
#define MAX_SOFTWARE_ENDSTOP_Y
@@ -2028,9 +2057,9 @@
//#define FIL_MOTION8_PULLUP
//#define FIL_MOTION8_PULLDOWN
#endif
- #endif
- #endif
-#endif
+ #endif // FILAMENT_MOTION_SENSOR
+ #endif // FILAMENT_RUNOUT_DISTANCE_MM
+#endif // FILAMENT_RUNOUT_SENSOR
//===========================================================================
//=============================== Bed Leveling ==============================
@@ -2122,12 +2151,6 @@
#define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height.
#endif
- /**
- * Add Z offset (M424 Z) that applies to all moves at the planner level.
- * This Z offset will be automatically set to the middle value with G29.
- */
- //#define GLOBAL_MESH_Z_OFFSET
-
/**
* For Cartesian machines, instead of dividing moves on mesh boundaries,
* split up moves into short segments like a Delta. This follows the
@@ -2291,8 +2314,8 @@
// Manually set the home position. Leave these undefined for automatic settings.
// For DELTA this is the top-center of the Cartesian print volume.
-#define MANUAL_X_HOME_POS 0
-#define MANUAL_Y_HOME_POS 0
+//#define MANUAL_X_HOME_POS 0
+//#define MANUAL_Y_HOME_POS 0
//#define MANUAL_Z_HOME_POS 0
//#define MANUAL_I_HOME_POS 0
//#define MANUAL_J_HOME_POS 0
@@ -2317,7 +2340,10 @@
#endif
// Homing speeds (linear=mm/min, rotational=°/min)
-#define HOMING_FEEDRATE_MM_M { (20*60), (20*60), (4*60) }
+#define HOMING_FEEDRATE_MM_M { 3000, 3000, 3000}
+
+// Edit homing feedrates with M210 and MarlinUI menu items
+#define EDITABLE_HOMING_FEEDRATE
// Validate that endstops are triggered on homing moves
#define VALIDATE_HOMING_ENDSTOPS
@@ -2395,7 +2421,7 @@
* M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes)
* M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
*/
-#define EEPROM_SETTINGS // Persistent storage with M500 and M501
+#define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save flash.
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
@@ -2433,17 +2459,17 @@
//
// Preheat Constants - Up to 10 are supported without changes
//
-#define PREHEAT_1_LABEL "PLA"
-#define PREHEAT_1_TEMP_HOTEND 185
-#define PREHEAT_1_TEMP_BED 45
-#define PREHEAT_1_TEMP_CHAMBER 35
-#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
+//#define PREHEAT_1_LABEL "PLA"
+//#define PREHEAT_1_TEMP_HOTEND 180
+//#define PREHEAT_1_TEMP_BED 70
+//#define PREHEAT_1_TEMP_CHAMBER 35
+//#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
-#define PREHEAT_2_LABEL "ABS"
-#define PREHEAT_2_TEMP_HOTEND 240
-#define PREHEAT_2_TEMP_BED 70
-#define PREHEAT_2_TEMP_CHAMBER 35
-#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255
+//#define PREHEAT_2_LABEL "ABS"
+//#define PREHEAT_2_TEMP_HOTEND 240
+//#define PREHEAT_2_TEMP_BED 110
+//#define PREHEAT_2_TEMP_CHAMBER 35
+//#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
/**
* @section nozzle park
@@ -2694,7 +2720,7 @@
*
* :[0:'Classic', 1:'Průša', 2:'CNC']
*/
-#define LCD_INFO_SCREEN_STYLE 0
+#define LCD_INFO_SCREEN_STYLE 2
/**
* LCD Menu Items
@@ -2734,7 +2760,7 @@
//
// Set this option if CLOCKWISE causes values to DECREASE
//
-//#define REVERSE_ENCODER_DIRECTION
+#define REVERSE_ENCODER_DIRECTION
//
// This option reverses the encoder direction for navigating LCD menus.
@@ -2757,7 +2783,7 @@
//
// This option increases encoder samples to filter out phantom encoder clicks caused by EMI noise.
//
-#define ENCODER_NOISE_FILTER
+//#define ENCODER_NOISE_FILTER
#if ENABLED(ENCODER_NOISE_FILTER)
#define ENCODER_SAMPLES 10
#endif
@@ -2970,7 +2996,7 @@
// RepRapDiscount FULL GRAPHIC Smart Controller
// https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
//
-//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
//
// K.3D Full Graphic Smart Controller
@@ -3082,10 +3108,7 @@
//
// Connect to EXP1 on RAMPS and compatible boards.
//
-#define CR10_STOCKDISPLAY
-#if ENABLED(CR10_STOCKDISPLAY)
- #define RET6_12864_LCD // Specific to the SoC (can either be RET / VET)
-#endif
+//#define CR10_STOCKDISPLAY
//
// Ender-2 OEM display, a variant of the MKS_MINI_12864
@@ -3217,16 +3240,13 @@
* - Download https://github.com/CrealityOfficial/Ender-3S1/archive/3S1_Plus_Screen.zip
* - Copy the downloaded DWIN_SET folder to the SD card.
*
- * CREALITY_TOUCH
- * - CR-6 OEM touch screen. A DWIN display with touch.
- *
* Flash display with DGUS Displays for Marlin:
* - Format the SD card to FAT32 with an allocation size of 4kb.
* - Download files as specified for your type of display.
* - Plug the microSD card into the back of the display.
* - Boot the display and wait for the update to complete.
*
- * :[ 'ORIGIN', 'FYSETC', 'HYPRECY', 'MKS', 'RELOADED', 'IA_CREALITY', 'E3S1PRO', 'CREALITY_TOUCH' ]
+ * :[ 'ORIGIN', 'FYSETC', 'HYPRECY', 'MKS', 'RELOADED', 'IA_CREALITY', 'E3S1PRO' ]
*/
//#define DGUS_LCD_UI ORIGIN
#if DGUS_UI_IS(MKS)
@@ -3265,17 +3285,16 @@
//
//#define ANYCUBIC_LCD_VYPER
+//
+// Sovol SV-06 Resistive Touch Screen
+//
+//#define SOVOL_SV06_RTS
+
//
// 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
//
//#define NEXTION_TFT
-//
-// PanelDue touch controller by Escher3D
-// http://escher3d.com/pages/order/products/product2.php
-//
-//#define PANELDUE
-
//
// Third-party or vendor-customized controller interfaces.
// Sources should be installed in 'src/lcd/extui'.
@@ -3442,6 +3461,8 @@
* TFT_ROTATE_180, TFT_ROTATE_180_MIRROR_X, TFT_ROTATE_180_MIRROR_Y,
* TFT_ROTATE_270, TFT_ROTATE_270_MIRROR_X, TFT_ROTATE_270_MIRROR_Y,
* TFT_MIRROR_X, TFT_MIRROR_Y, TFT_NO_ROTATION
+ *
+ * :{ 'TFT_NO_ROTATION':'None', 'TFT_ROTATE_90':'90°', 'TFT_ROTATE_90_MIRROR_X':'90° (Mirror X)', 'TFT_ROTATE_90_MIRROR_Y':'90° (Mirror Y)', 'TFT_ROTATE_180':'180°', 'TFT_ROTATE_180_MIRROR_X':'180° (Mirror X)', 'TFT_ROTATE_180_MIRROR_Y':'180° (Mirror Y)', 'TFT_ROTATE_270':'270°', 'TFT_ROTATE_270_MIRROR_X':'270° (Mirror X)', 'TFT_ROTATE_270_MIRROR_Y':'270° (Mirror Y)', 'TFT_MIRROR_X':'Mirror X', 'TFT_MIRROR_Y':'Mirror Y' }
*/
//#define TFT_ROTATION TFT_NO_ROTATION
@@ -3512,7 +3533,7 @@
// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
// is too low, you should also increment SOFT_PWM_SCALE.
-#define FAN_SOFT_PWM
+//#define FAN_SOFT_PWM
// Incrementing this by 1 will double the software PWM frequency,
// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
@@ -3659,4 +3680,4 @@
//#define EDITABLE_SERVO_ANGLES
// Disable servo with M282 to reduce power consumption, noise, and heat when not in use
-//#define SERVO_DETACH_GCODE
\ No newline at end of file
+//#define SERVO_DETACH_GCODE
diff --git a/firmware/Marlin/Configuration_adv.h b/firmware/Marlin/Configuration_adv.h
index 7c94ad0..2d7aa47 100644
--- a/firmware/Marlin/Configuration_adv.h
+++ b/firmware/Marlin/Configuration_adv.h
@@ -21,8 +21,6 @@
*/
#pragma once
-#define CONFIG_EXAMPLES_DIR "Creality/Ender-5 Pro/CrealityV427"
-
/**
* Configuration_adv.h
*
@@ -205,7 +203,7 @@
//
#if DISABLED(PIDTEMPBED)
#define BED_CHECK_INTERVAL 5000 // (ms) Interval between checks in bang-bang control
- #if ENABLED(BED_LIMIT_SWITCHING)
+ #if ANY(BED_LIMIT_SWITCHING, PELTIER_BED)
#define BED_HYSTERESIS 2 // (°C) Only set the relevant heater state when ABS(T-target) > BED_HYSTERESIS
#endif
#endif
@@ -213,18 +211,19 @@
//
// Heated Chamber options
//
-#if DISABLED(PIDTEMPCHAMBER)
- #define CHAMBER_CHECK_INTERVAL 5000 // (ms) Interval between checks in bang-bang control
- #if ENABLED(CHAMBER_LIMIT_SWITCHING)
- #define CHAMBER_HYSTERESIS 2 // (°C) Only set the relevant heater state when ABS(T-target) > CHAMBER_HYSTERESIS
- #endif
-#endif
#if TEMP_SENSOR_CHAMBER
//#define HEATER_CHAMBER_PIN P2_04 // Required heater on/off pin (example: SKR 1.4 Turbo HE1 plug)
//#define HEATER_CHAMBER_INVERTING false
//#define FAN1_PIN -1 // Remove the fan signal on pin P2_04 (example: SKR 1.4 Turbo HE1 plug)
+ #if DISABLED(PIDTEMPCHAMBER)
+ #define CHAMBER_CHECK_INTERVAL 5000 // (ms) Interval between checks in bang-bang control
+ #if ENABLED(CHAMBER_LIMIT_SWITCHING)
+ #define CHAMBER_HYSTERESIS 2 // (°C) Only set the relevant heater state when ABS(T-target) > CHAMBER_HYSTERESIS
+ #endif
+ #endif
+
//#define CHAMBER_FAN // Enable a fan on the chamber
#if ENABLED(CHAMBER_FAN)
//#define CHAMBER_FAN_INDEX 2 // Index of a fan to repurpose as the chamber fan. (Default: first unused fan)
@@ -593,6 +592,8 @@
// Use TEMP_SENSOR_SOC as a trigger for enabling the controller fan
//#define CONTROLLER_FAN_MIN_SOC_TEMP 40 // (°C) Turn on the fan if the SoC reaches this temperature
+ #define CONTROLLER_FAN_BED_HEATING // Turn on the fan when heating the bed
+
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
#if ENABLED(CONTROLLER_FAN_EDITABLE)
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu
@@ -930,13 +931,13 @@
//#define SENSORLESS_BACKOFF_MM { 2, 2, 0 } // (linear=mm, rotational=°) Backoff from endstops before sensorless homing
-#define HOMING_BUMP_MM { 5, 5, 2 } // (linear=mm, rotational=°) Backoff from endstops after first bump
-#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
+#define HOMING_BUMP_MM { 5, 5, 5 } // (linear=mm, rotational=°) Backoff from endstops after first bump
+#define HOMING_BUMP_DIVISOR { 10, 10, 10 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing
//#define XY_COUNTERPART_BACKOFF_MM 0 // (mm) Backoff X after homing Y, and vice-versa
-#define QUICK_HOME // If G28 contains XY do a diagonal move first
+//#define QUICK_HOME // If G28 contains XY do a diagonal move first
//#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X
//#define HOME_Z_FIRST // Home Z first. Requires a real endstop (not a probe).
//#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first
@@ -1033,7 +1034,7 @@
* If not defined, probe limits will be used.
* Override with 'M422 S X Y'.
*/
- //#define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } }
+ //#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
/**
* Orientation for the automatically-calculated probe positions.
@@ -1076,7 +1077,7 @@
// On a 300mm bed a 5% grade would give a misalignment of ~1.5cm
#define G34_MAX_GRADE 5 // (%) Maximum incline that G34 will handle
- #define Z_STEPPER_ALIGN_ITERATIONS 3 // Number of iterations to apply during alignment
+ #define Z_STEPPER_ALIGN_ITERATIONS 5 // Number of iterations to apply during alignment
#define Z_STEPPER_ALIGN_ACC 0.02 // Stop iterating early if the accuracy is better than this
#define RESTORE_LEVELING_AFTER_G34 // Restore leveling after G34 is done?
// After G34, re-home Z (G28 Z) or just calculate it from the last probe heights?
@@ -1112,8 +1113,8 @@
* Screw Thread. Use one of the following defines:
*
* M3_CW = M3 Clockwise, M3_CCW = M3 Counter-Clockwise
- * M4_CW = M3 Clockwise, M4_CCW = M4 Counter-Clockwise
- * M5_CW = M3 Clockwise, M5_CCW = M5 Counter-Clockwise
+ * M4_CW = M4 Clockwise, M4_CCW = M4 Counter-Clockwise
+ * M5_CW = M5 Clockwise, M5_CCW = M5 Counter-Clockwise
*
* :{'M3_CW':'M3 Clockwise','M3_CCW':'M3 Counter-Clockwise','M4_CW':'M4 Clockwise','M4_CCW':'M4 Counter-Clockwise','M5_CW':'M5 Clockwise','M5_CCW':'M5 Counter-Clockwise'}
*/
@@ -1137,7 +1138,7 @@
#define FTM_SHAPING_DEFAULT_FREQ_X 37.0f // (Hz) Default peak frequency used by input shapers
#define FTM_SHAPING_DEFAULT_FREQ_Y 37.0f // (Hz) Default peak frequency used by input shapers
#define FTM_LINEAR_ADV_DEFAULT_ENA false // Default linear advance enable (true) or disable (false)
- #define FTM_LINEAR_ADV_DEFAULT_K 0 // Default linear advance gain, integer value. (Acceleration-based scaling factor.)
+ #define FTM_LINEAR_ADV_DEFAULT_K 0.0f // Default linear advance gain. (Acceleration-based scaling factor.)
#define FTM_SHAPING_ZETA_X 0.1f // Zeta used by input shapers for X axis
#define FTM_SHAPING_ZETA_Y 0.1f // Zeta used by input shapers for Y axis
@@ -1225,7 +1226,7 @@
// @section motion
-#define AXIS_RELATIVE_MODES { false, false, false, false }
+#define AXIS_RELATIVE_MODES { false, false, false}
// Add a Duplicate option for well-separated conjoined nozzles
//#define MULTI_NOZZLE_DUPLICATION
@@ -1250,7 +1251,7 @@
#define DEFAULT_STEPPER_TIMEOUT_SEC 120
#define DISABLE_IDLE_X
#define DISABLE_IDLE_Y
-//#define DISABLE_IDLE_Z // Disable if the nozzle could fall onto your printed part!
+#define DISABLE_IDLE_Z // Disable if the nozzle could fall onto your printed part!
//#define DISABLE_IDLE_I
//#define DISABLE_IDLE_J
//#define DISABLE_IDLE_K
@@ -1260,12 +1261,8 @@
#define DISABLE_IDLE_E // Shut down all idle extruders
// Default Minimum Feedrates for printing and travel moves
-#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S.
-#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T.
-#if HAS_ROTATIONAL_AXES
- #define DEFAULT_ANGULAR_MINIMUMFEEDRATE 0.0 // (°/s) Minimum feedrate for rotational-only moves. Set with M205 P.
- #define DEFAULT_ANGULAR_MINTRAVELFEEDRATE 0.0 // (°/s) Minimum travel feedrate for rotational-only moves. Set with M205 Q.
-#endif
+#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S.
+#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T.
// Minimum time that a segment needs to take as the buffer gets emptied
#define DEFAULT_MINSEGMENTTIME 20000 // (µs) Set with M205 B.
@@ -1478,7 +1475,7 @@
// @section lcd
#if HAS_MANUAL_MOVE_MENU
- #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel
+ #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60} // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel
#define FINE_MANUAL_MOVE 0.025 // (mm) Smallest manual move (< 0.1mm) applying to Z on most machines
#if IS_ULTIPANEL
#define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position"
@@ -1549,7 +1546,7 @@
#endif
// Include a page of printer information in the LCD Main Menu
- #define LCD_INFO_MENU
+ //#define LCD_INFO_MENU
#if ENABLED(LCD_INFO_MENU)
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif
@@ -1608,12 +1605,12 @@
//#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, HAS_MARLINUI_HD44780)
- #define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup.
+ //#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup.
#endif
#endif
#if HAS_MARLINUI_U8GLIB
- #define CUSTOM_STATUS_SCREEN_IMAGE // Show the bitmap in Marlin/_Statusscreen.h on the status screen.
+ //#define CUSTOM_STATUS_SCREEN_IMAGE // Show the bitmap in Marlin/_Statusscreen.h on the status screen.
#endif
//#define SOUND_MENU_ITEM // Add a mute option to the LCD menu
@@ -1627,7 +1624,7 @@
//#define LCD_TIMEOUT_TO_STATUS 15000 // (ms)
// Scroll a longer status message into view
- #define STATUS_MESSAGE_SCROLLING
+ //#define STATUS_MESSAGE_SCROLLING
// Apply a timeout to low-priority status messages
//#define STATUS_MESSAGE_TIMEOUT_SEC 30 // (seconds)
@@ -1731,7 +1728,7 @@
//#define SD_IGNORE_AT_STARTUP // Don't mount the SD card when starting up
//#define SDCARD_READONLY // Read-only SD card (to save over 2K of flash)
- #define GCODE_REPEAT_MARKERS // Enable G-code M808 to set repeat markers and do looping
+ //#define GCODE_REPEAT_MARKERS // Enable G-code M808 to set repeat markers and do looping
#define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls
@@ -1842,7 +1839,7 @@
//#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol
//#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands
- #define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu
+ //#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu
//#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!)
@@ -2289,7 +2286,7 @@
*
* Warning: Does not respect endstops!
*/
-#define BABYSTEPPING
+//#define BABYSTEPPING
#if ENABLED(BABYSTEPPING)
//#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support
//#define BABYSTEP_WITHOUT_HOMING
@@ -2300,7 +2297,7 @@
#define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep
#define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep
- #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
+ //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)
#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
// Note: Extra time may be added to mitigate controller latency.
@@ -2313,12 +2310,8 @@
//#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
- //#define BABYSTEP_GLOBAL_Z // Combine M424 Z and Babystepping
-
- #if ANY(BABYSTEP_ZPROBE_OFFSET, BABYSTEP_GLOBAL_Z)
- #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
- //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
- #endif
+ #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
+ //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
//#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
#endif
#endif
@@ -2998,7 +2991,7 @@
#define INTERPOLATE true
#if AXIS_IS_TMC_CONFIG(X)
- #define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current.
+ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for homing. (Typically lower than *_CURRENT.)
#define X_MICROSTEPS 16 // 0..256
#define X_RSENSE 0.11
@@ -3018,7 +3011,7 @@
#endif
#if AXIS_IS_TMC_CONFIG(Y)
- #define Y_CURRENT 650
+ #define Y_CURRENT 800
#define Y_CURRENT_HOME Y_CURRENT
#define Y_MICROSTEPS 16
#define Y_RSENSE 0.11
@@ -3038,7 +3031,7 @@
#endif
#if AXIS_IS_TMC_CONFIG(Z)
- #define Z_CURRENT 580
+ #define Z_CURRENT 800
#define Z_CURRENT_HOME Z_CURRENT
#define Z_MICROSTEPS 16
#define Z_RSENSE 0.11
@@ -3138,7 +3131,7 @@
#endif
#if AXIS_IS_TMC_CONFIG(E0)
- #define E0_CURRENT 650
+ #define E0_CURRENT 800
#define E0_MICROSTEPS 16
#define E0_RSENSE 0.11
#define E0_CHAIN_POS -1
@@ -3336,7 +3329,7 @@
* Define your own with:
* { , , hysteresis_start[1..8] }
*/
- #define CHOPPER_TIMING CHOPPER_DEFAULT_24V // All axes (override below)
+ #define CHOPPER_TIMING CHOPPER_DEFAULT_12V // All axes (override below)
//#define CHOPPER_TIMING_X CHOPPER_TIMING // For X Axes (override below)
//#define CHOPPER_TIMING_X2 CHOPPER_TIMING_X
//#define CHOPPER_TIMING_Y CHOPPER_TIMING // For Y Axes (override below)
@@ -3872,14 +3865,6 @@
*/
//#define CNC_COORDINATE_SYSTEMS
-/**
- * CNC Drilling Cycle - UNDER DEVELOPMENT
- *
- * Enables G81 to perform a drilling cycle.
- * Currently only supports a single cycle, no G-code chaining.
- */
-//#define CNC_DRILLING_CYCLE
-
// @section security
/**
@@ -3977,15 +3962,6 @@
//#define GCODE_QUOTED_STRINGS // Support for quoted string parameters
#endif
-/**
- * Variables
- *
- * Define a variable from 100-115 with G-code like '#101=19.6'.
- * A variable can then be used in a G-code expression like 'G0 X[#101+3]'.
- * See https://gcodetutor.com/cnc-macro-programming/cnc-variables.html
- */
-//#define GCODE_VARIABLES
-
/**
* Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
*/
@@ -4028,7 +4004,6 @@
#ifdef G0_FEEDRATE
//#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
#endif
-//#define G0_ANGULAR_FEEDRATE 2700 // (°/min)
/**
* Startup commands
@@ -4043,7 +4018,7 @@
* Add G-codes M810-M819 to define and run G-code macros.
* Macros are not saved to EEPROM.
*/
-#define GCODE_MACROS
+//#define GCODE_MACROS
#if ENABLED(GCODE_MACROS)
#define GCODE_MACROS_SLOTS 5 // Up to 10 may be used
#define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro
@@ -4433,93 +4408,56 @@
//#define E_MUX0_PIN 40 // Always Required
//#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs
//#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs
+
#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3
// Common settings for MMU2/MMU2S/MMU3
// Serial port used for communication with MMU2/MMU2S/MMU3.
- #define MMU2_SERIAL_PORT 2
+ #define MMU_SERIAL_PORT 2
#define MMU_BAUD 115200
- // Use hardware reset for MMU if a pin is defined for it
- //#define MMU2_RST_PIN 23
+ //#define MMU_RST_PIN 23 // Define this pin to use Hardware Reset for MMU2/MMU2S/MMU3
+ //#define MMU_MENUS // Add an LCD menu for MMU2/MMU2S/MMU3
+
+ //#define MMU_DEBUG // Write debug info to serial output
+
+ // Options pertaining to MMU2 and MMU2S
#if HAS_PRUSA_MMU2
// Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up)
//#define MMU2_MODE_12V
+ // Settings for filament load / unload from the LCD menu.
+ // This is for Průša MK3-style extruders. Customize for your hardware.
+ #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0
+
// G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout
#define MMU2_FILAMENT_RUNOUT_SCRIPT "M600"
- #endif
- // Add an LCD menu for MMU2/MMU2S/MMU3
- //#define MMU_MENUS
+ // MMU2 sequences use mm/min. Not compatible with MMU3, which use mm/sec.
+ #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \
+ { 4.4, 871 }, \
+ { 10.0, 1393 }, \
+ { 4.4, 871 }, \
+ { 10.0, 198 }
- // Settings for filament load / unload from the LCD menu.
- // This is for Průša MK3-style extruders. Customize for your hardware.
- #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0
+ #define MMU2_RAMMING_SEQUENCE \
+ { 1.0, 1000 }, \
+ { 1.0, 1500 }, \
+ { 2.0, 2000 }, \
+ { 1.5, 3000 }, \
+ { 2.5, 4000 }, \
+ { -15.0, 5000 }, \
+ { -14.0, 1200 }, \
+ { -6.0, 600 }, \
+ { 10.0, 700 }, \
+ { -10.0, 400 }, \
+ { -50.0, 2000 }
+
+ #endif // HAS_PRUSA_MMU2
/**
- * ------------
- * MMU2 / MMU2S
- * ------------
- * MMU2 sequences use mm/min. Not compatible with MMU3 (see below).
- * #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \
- * { 4.4, 871 }, \
- * { 10.0, 1393 }, \
- * { 4.4, 871 }, \
- * { 10.0, 198 }
- */
-
- /* #define MMU2_RAMMING_SEQUENCE \
- * { 1.0, 1000 }, \
- * { 1.0, 1500 }, \
- * { 2.0, 2000 }, \
- * { 1.5, 3000 }, \
- * { 2.5, 4000 }, \
- * { -15.0, 5000 }, \
- * { -14.0, 1200 }, \
- * { -6.0, 600 }, \
- * { 10.0, 700 }, \
- * { -10.0, 400 }, \
- * { -50.0, 2000 }
- */
-
- /**
- * ----
- * MMU3
- * ----
- * These values are compatible with MMU3 as they are defined in mm/s
- */
-
- #define MMU2_EXTRUDER_PTFE_LENGTH 42.3 // (mm)
- #define MMU2_EXTRUDER_HEATBREAK_LENGTH 17.7 // (mm)
-
- #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \
- { MMU2_EXTRUDER_PTFE_LENGTH, MMM_TO_MMS(810) }, /* (13.5 mm/s) Fast load ahead of heatbreak */ \
- { MMU2_EXTRUDER_HEATBREAK_LENGTH, MMM_TO_MMS(198) } // ( 3.3 mm/s) Slow load after heatbreak
-
- #define MMU2_RAMMING_SEQUENCE \
- { 0.2816, MMM_TO_MMS(1339.0) }, \
- { 0.3051, MMM_TO_MMS(1451.0) }, \
- { 0.3453, MMM_TO_MMS(1642.0) }, \
- { 0.3990, MMM_TO_MMS(1897.0) }, \
- { 0.4761, MMM_TO_MMS(2264.0) }, \
- { 0.5767, MMM_TO_MMS(2742.0) }, \
- { 0.5691, MMM_TO_MMS(3220.0) }, \
- { 0.1081, MMM_TO_MMS(3220.0) }, \
- { 0.7644, MMM_TO_MMS(3635.0) }, \
- { 0.8248, MMM_TO_MMS(3921.0) }, \
- { 0.8483, MMM_TO_MMS(4033.0) }, \
- { -15.0, MMM_TO_MMS(6000.0) }, \
- { -24.5, MMM_TO_MMS(1200.0) }, \
- { -7.0, MMM_TO_MMS( 600.0) }, \
- { -3.5, MMM_TO_MMS( 360.0) }, \
- { 20.0, MMM_TO_MMS( 454.0) }, \
- { -20.0, MMM_TO_MMS( 303.0) }, \
- { -35.0, MMM_TO_MMS(2000.0) }
-
- /**
- * Using a sensor like the MMU2S
- * This mode requires a MK3S extruder with a sensor at the extruder idler, like the MMU2S.
+ * Options pertaining to MMU2S devices
+ * Requires the MK3S extruder with a sensor at the extruder idler, like the MMU2S.
* See https://help.prusa3d.com/guide/3b-mk3s-mk2-5s-extruder-upgrade_41560#42048, step 11
*/
#if HAS_PRUSA_MMU2S
@@ -4560,14 +4498,9 @@
// MMU3 settings
- #define MMU2_MAX_RETRIES 3 // Number of retries (total time = timeout*retries)
+ #define MMU3_HAS_CUTTER // Enable cutter related functionality
- // Nominal distance from the extruder gear to the nozzle tip is 87mm
- // However, some slipping may occur and we need separate distances for
- // LoadToNozzle and ToolChange.
- // - +5mm seemed good for LoadToNozzle,
- // - but too much (made blobs) for a ToolChange
- #define MMU2_LOAD_TO_NOZZLE_LENGTH 87.0 + 5.0
+ #define MMU3_MAX_RETRIES 3 // Number of retries (total time = timeout*retries)
// As discussed with our PrusaSlicer profile specialist
// - ToolChange shall not try to push filament into the very tip of the nozzle
@@ -4576,28 +4509,26 @@
// Beware - this value is used to initialize the MMU logic layer - it will be sent to the MMU upon line up (written into its 8bit register 0x0b)
// However - in the G-code we can get a request to set the extra load distance at runtime to something else (M708 A0xb Xsomething).
// The printer intercepts such a call and sets its extra load distance to match the new value as well.
- #define MMU2_FILAMENT_SENSOR_POSITION 0 // (mm)
- #define MMU2_LOAD_DISTANCE_PAST_GEARS 5 // (mm)
- #define MMU2_TOOL_CHANGE_LOAD_LENGTH MMU2_FILAMENT_SENSOR_POSITION + MMU2_LOAD_DISTANCE_PAST_GEARS // (mm)
+ #define MMU3_FILAMENT_SENSOR_E_POSITION 0 // (mm)
+ #define _MMU3_LOAD_DISTANCE_PAST_GEARS 5 // (mm)
+ #define MMU3_TOOL_CHANGE_LOAD_LENGTH (MMU3_FILAMENT_SENSOR_E_POSITION + _MMU3_LOAD_DISTANCE_PAST_GEARS) // (mm)
- #define MMU2_LOAD_TO_NOZZLE_FEED_RATE 20.0 // (mm/s)
- #define MMU2_UNLOAD_TO_FINDA_FEED_RATE 120.0 // (mm/s)
+ #define MMU3_LOAD_TO_NOZZLE_FEED_RATE 20.0 // (mm/s)
- #define MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE 50.0 // (mm/s)
- #define MMU2_VERIFY_LOAD_TO_NOZZLE_TWEAK -5.0 // (mm) Amount to adjust the length for verifying load-to-nozzle
+ #define MMU3_VERIFY_LOAD_TO_NOZZLE_FEED_RATE 50.0 // (mm/s)
+ #define _MMU3_VERIFY_LOAD_TO_NOZZLE_TWEAK -5.0 // (mm) Amount to adjust the length for verifying load-to-nozzle
// The first thing the MMU does is initialize its axis.
// Meanwhile the E-motor will unload 20mm of filament in about 1 second.
- #define MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH 80.0 // (mm)
- #define MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE 80.0 // (mm/s)
+ #define MMU3_RETRY_UNLOAD_TO_FINDA_LENGTH 80.0 // (mm)
+ #define MMU3_RETRY_UNLOAD_TO_FINDA_FEED_RATE 80.0 // (mm/s)
// After loading a new filament, the printer will extrude this length of filament
// then retract to the original position. This is used to check if the filament sensor
// reading flickers or filament is jammed.
- #define MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH (MMU2_EXTRUDER_PTFE_LENGTH + MMU2_EXTRUDER_HEATBREAK_LENGTH + MMU2_VERIFY_LOAD_TO_NOZZLE_TWEAK + MMU2_FILAMENT_SENSOR_POSITION) // (mm)
-
- #define MMU_HAS_CUTTER // Enable cutter related functionalities
- //#define MMU_FORCE_STEALTH_MODE // Force stealth mode and disable menu item
+ #define _MMU_EXTRUDER_PTFE_LENGTH 42.3 // (mm)
+ #define _MMU_EXTRUDER_HEATBREAK_LENGTH 17.7 // (mm)
+ #define MMU3_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH (MMU3_FILAMENT_SENSOR_E_POSITION + _MMU_EXTRUDER_PTFE_LENGTH + _MMU_EXTRUDER_HEATBREAK_LENGTH + _MMU3_VERIFY_LOAD_TO_NOZZLE_TWEAK) // (mm)
/**
* SpoolJoin Consumes All Filament -- EXPERIMENTAL
@@ -4615,12 +4546,37 @@
* sensor is triggered through the gears) and the end of the PTFE tube and
* can cause filament load issues.
*/
- //#define MMU_SPOOL_JOIN_CONSUMES_ALL_FILAMENT
+ //#define MMU3_SPOOL_JOIN_CONSUMES_ALL_FILAMENT
- #else
+ // MMU3 sequences use mm/sec. Not compatible with MMU2 which use mm/min.
+ #define MMU3_LOAD_TO_NOZZLE_SEQUENCE \
+ { _MMU_EXTRUDER_PTFE_LENGTH, MMM_TO_MMS(810) }, /* (13.5 mm/s) Fast load ahead of heatbreak */ \
+ { _MMU_EXTRUDER_HEATBREAK_LENGTH, MMM_TO_MMS(198) } /* ( 3.3 mm/s) Slow load after heatbreak */
+
+ #define MMU3_RAMMING_SEQUENCE \
+ { 0.2816, MMM_TO_MMS(1339.0) }, \
+ { 0.3051, MMM_TO_MMS(1451.0) }, \
+ { 0.3453, MMM_TO_MMS(1642.0) }, \
+ { 0.3990, MMM_TO_MMS(1897.0) }, \
+ { 0.4761, MMM_TO_MMS(2264.0) }, \
+ { 0.5767, MMM_TO_MMS(2742.0) }, \
+ { 0.5691, MMM_TO_MMS(3220.0) }, \
+ { 0.1081, MMM_TO_MMS(3220.0) }, \
+ { 0.7644, MMM_TO_MMS(3635.0) }, \
+ { 0.8248, MMM_TO_MMS(3921.0) }, \
+ { 0.8483, MMM_TO_MMS(4033.0) }, \
+ { -15.0, MMM_TO_MMS(6000.0) }, \
+ { -24.5, MMM_TO_MMS(1200.0) }, \
+ { -7.0, MMM_TO_MMS( 600.0) }, \
+ { -3.5, MMM_TO_MMS( 360.0) }, \
+ { 20.0, MMM_TO_MMS( 454.0) }, \
+ { -20.0, MMM_TO_MMS( 303.0) }, \
+ { -35.0, MMM_TO_MMS(2000.0) }
+
+ #else // MMU2 (not MMU2S)
/**
- * MMU1 Extruder Sensor
+ * MMU2 Extruder Sensor
*
* Support for a Průša (or other) IR Sensor to detect filament near the extruder
* and make loading more reliable. Suitable for an extruder equipped with a filament
@@ -4630,15 +4586,13 @@
* move up to the gears. If no filament is detected, the MMU2 can make some more attempts.
* If all attempts fail, a filament runout will be triggered.
*/
- //#define MMU_EXTRUDER_SENSOR
- #if ENABLED(MMU_EXTRUDER_SENSOR)
- #define MMU_LOADING_ATTEMPTS_NR 5 // max. number of attempts to load filament if first load fail
+ //#define MMU2_EXTRUDER_SENSOR
+ #if ENABLED(MMU2_EXTRUDER_SENSOR)
+ #define MMU2_LOADING_ATTEMPTS_NR 5 // Number of times to try loading filament before failure
#endif
#endif
- //#define MMU2_DEBUG // Write debug info to serial output
-
#endif // HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3
/**
@@ -4704,4 +4658,4 @@
//#define OPTIBOOT_RESET_REASON
// Shrink the build for smaller boards by sacrificing some serial feedback
-//#define MARLIN_SMALL_BUILD
\ No newline at end of file
+//#define MARLIN_SMALL_BUILD
diff --git a/firmware/Marlin/Makefile b/firmware/Marlin/Makefile
index e5ba9cb..63b1029 100644
--- a/firmware/Marlin/Makefile
+++ b/firmware/Marlin/Makefile
@@ -187,6 +187,17 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1033)
# RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan)
else ifeq ($(HARDWARE_MOTHERBOARD),1034)
+# RAMPS 1.6+ (Power outputs: Hotend, Fan, Bed)
+else ifeq ($(HARDWARE_MOTHERBOARD),1035)
+# RAMPS 1.6+ (Power outputs: Hotend0, Hotend1, Bed)
+else ifeq ($(HARDWARE_MOTHERBOARD),1036)
+# RAMPS 1.6+ (Power outputs: Hotend, Fan0, Fan1)
+else ifeq ($(HARDWARE_MOTHERBOARD),1037)
+# RAMPS 1.6+ (Power outputs: Hotend0, Hotend1, Fan)
+else ifeq ($(HARDWARE_MOTHERBOARD),1038)
+# RAMPS 1.6+ (Power outputs: Spindle, Controller Fan)
+else ifeq ($(HARDWARE_MOTHERBOARD),1039)
+
#
# RAMPS Derivatives - ATmega1280, ATmega2560
#
@@ -221,108 +232,113 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1112)
else ifeq ($(HARDWARE_MOTHERBOARD),1113)
# BigTreeTech or BIQU KFB2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1114)
-# zrib V2.0 (Chinese RAMPS replica)
+# Zonestar zrib V2.0 (Chinese RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1115)
-# zrib V5.2 (Chinese RAMPS replica)
+# Zonestar zrib V5.2 (Chinese RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1116)
-# Felix 2.0+ Electronics Board (RAMPS like)
+# Zonestar zrib V5.3 (Chinese RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1117)
-# Invent-A-Part RigidBoard
+# Felix 2.0+ Electronics Board (RAMPS like)
else ifeq ($(HARDWARE_MOTHERBOARD),1118)
-# Invent-A-Part RigidBoard V2
+# Invent-A-Part RigidBoard
else ifeq ($(HARDWARE_MOTHERBOARD),1119)
-# Sainsmart 2-in-1 board
+# Invent-A-Part RigidBoard V2
else ifeq ($(HARDWARE_MOTHERBOARD),1120)
-# Ultimaker
+# Sainsmart 2-in-1 board
else ifeq ($(HARDWARE_MOTHERBOARD),1121)
-# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
+# Ultimaker
else ifeq ($(HARDWARE_MOTHERBOARD),1122)
+# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
+else ifeq ($(HARDWARE_MOTHERBOARD),1123)
MCU ?= atmega1280
PROG_MCU ?= m1280
# Azteeg X3
-else ifeq ($(HARDWARE_MOTHERBOARD),1123)
-# Azteeg X3 Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1124)
-# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
+# Azteeg X3 Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1125)
-# Rumba
+# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
else ifeq ($(HARDWARE_MOTHERBOARD),1126)
-# Raise3D N series Rumba derivative
+# Rumba
else ifeq ($(HARDWARE_MOTHERBOARD),1127)
-# Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
+# Raise3D N series Rumba derivative
else ifeq ($(HARDWARE_MOTHERBOARD),1128)
-# Formbot T-Rex 2 Plus
+# Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
else ifeq ($(HARDWARE_MOTHERBOARD),1129)
-# Formbot T-Rex 3
+# Formbot T-Rex 2 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1130)
-# Formbot Raptor
+# Formbot T-Rex 3
else ifeq ($(HARDWARE_MOTHERBOARD),1131)
-# Formbot Raptor 2
+# Formbot Raptor
else ifeq ($(HARDWARE_MOTHERBOARD),1132)
-# bq ZUM Mega 3D
+# Formbot Raptor 2
else ifeq ($(HARDWARE_MOTHERBOARD),1133)
-# MakeBoard Mini v2.1.2 by MicroMake
+# bq ZUM Mega 3D
else ifeq ($(HARDWARE_MOTHERBOARD),1134)
-# TriGorilla Anycubic version 1.3-based on RAMPS EFB
+# MakeBoard Mini v2.1.2 by MicroMake
else ifeq ($(HARDWARE_MOTHERBOARD),1135)
-# ... Ver 1.4
+# TriGorilla Anycubic version 1.3-based on RAMPS EFB
else ifeq ($(HARDWARE_MOTHERBOARD),1136)
-# ... Rev 1.1 (new servo pin order)
+# ... Ver 1.4
else ifeq ($(HARDWARE_MOTHERBOARD),1137)
-# Creality: Ender-4, CR-8
+# ... Rev 1.1 (new servo pin order)
else ifeq ($(HARDWARE_MOTHERBOARD),1138)
-# Creality: CR10S, CR20, CR-X
+# Creality: Ender-4, CR-8
else ifeq ($(HARDWARE_MOTHERBOARD),1139)
-# Dagoma F5
+# Creality: CR10S, CR20, CR-X
else ifeq ($(HARDWARE_MOTHERBOARD),1140)
-# FYSETC F6 1.3
+# Dagoma F5
else ifeq ($(HARDWARE_MOTHERBOARD),1141)
-# FYSETC F6 1.4
+# Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
else ifeq ($(HARDWARE_MOTHERBOARD),1142)
-# Wanhao Duplicator i3 Plus
+# FYSETC F6 1.3
else ifeq ($(HARDWARE_MOTHERBOARD),1143)
-# VORON Design
+# FYSETC F6 1.4
else ifeq ($(HARDWARE_MOTHERBOARD),1144)
-# Tronxy TRONXY-V3-1.0
+# Wanhao Duplicator i3 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1145)
-# Z-Bolt X Series
+# VORON Design
else ifeq ($(HARDWARE_MOTHERBOARD),1146)
-# TT OSCAR
+# Tronxy TRONXY-V3-1.0
else ifeq ($(HARDWARE_MOTHERBOARD),1147)
-# Overlord/Overlord Pro
+# Z-Bolt X Series
else ifeq ($(HARDWARE_MOTHERBOARD),1148)
-# ADIMLab Gantry v1
+# TT OSCAR
else ifeq ($(HARDWARE_MOTHERBOARD),1149)
-# ADIMLab Gantry v2
-else ifeq ($(HARDWARE_MOTHERBOARD),1150)
# BIQU Tango V1
-else ifeq ($(HARDWARE_MOTHERBOARD),1151)
+else ifeq ($(HARDWARE_MOTHERBOARD),1150)
# MKS GEN L V2
-else ifeq ($(HARDWARE_MOTHERBOARD),1152)
+else ifeq ($(HARDWARE_MOTHERBOARD),1151)
# MKS GEN L V2.1
-else ifeq ($(HARDWARE_MOTHERBOARD),1153)
+else ifeq ($(HARDWARE_MOTHERBOARD),1152)
# Copymaster 3D
-else ifeq ($(HARDWARE_MOTHERBOARD),1154)
+else ifeq ($(HARDWARE_MOTHERBOARD),1153)
# Ortur 4
-else ifeq ($(HARDWARE_MOTHERBOARD),1155)
+else ifeq ($(HARDWARE_MOTHERBOARD),1154)
# Tenlog D3 Hero IDEX printer
+else ifeq ($(HARDWARE_MOTHERBOARD),1155)
+# Tenlog D3, D5, D6 IDEX Printer
else ifeq ($(HARDWARE_MOTHERBOARD),1156)
-# Tenlog D3,5,6 Pro IDEX printers
-else ifeq ($(HARDWARE_MOTHERBOARD),1157)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
-else ifeq ($(HARDWARE_MOTHERBOARD),1158)
+else ifeq ($(HARDWARE_MOTHERBOARD),1157)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
-else ifeq ($(HARDWARE_MOTHERBOARD),1159)
+else ifeq ($(HARDWARE_MOTHERBOARD),1158)
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
-else ifeq ($(HARDWARE_MOTHERBOARD),1160)
+else ifeq ($(HARDWARE_MOTHERBOARD),1159)
# Longer LK1 PRO / Alfawise U20 Pro (PRO version)
-else ifeq ($(HARDWARE_MOTHERBOARD),1161)
+else ifeq ($(HARDWARE_MOTHERBOARD),1160)
# Longer LKx PRO / Alfawise Uxx Pro (PRO version)
-else ifeq ($(HARDWARE_MOTHERBOARD),1162)
-# Zonestar zrib V5.3 (Chinese RAMPS replica)
-else ifeq ($(HARDWARE_MOTHERBOARD),1163)
+else ifeq ($(HARDWARE_MOTHERBOARD),1161)
# Pxmalion Core I3
+else ifeq ($(HARDWARE_MOTHERBOARD),1162)
+# Panowin Cutlass (as found in the Panowin F1)
+else ifeq ($(HARDWARE_MOTHERBOARD),1163)
+# Kodama Bardo V1.x (as found in the Kodama Trinus)
else ifeq ($(HARDWARE_MOTHERBOARD),1164)
+# XTLW MFF V1.0
+else ifeq ($(HARDWARE_MOTHERBOARD),1165)
+# XTLW MFF V2.0
+else ifeq ($(HARDWARE_MOTHERBOARD),1166)
+
#
# RAMBo and derivatives
@@ -340,7 +356,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1203)
else ifeq ($(HARDWARE_MOTHERBOARD),1204)
# abee Scoovo X9H
else ifeq ($(HARDWARE_MOTHERBOARD),1205)
-# Rambo ThinkerV2
+# ThinkerV2
else ifeq ($(HARDWARE_MOTHERBOARD),1206)
#
@@ -383,30 +399,40 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1315)
else ifeq ($(HARDWARE_MOTHERBOARD),1316)
# Geeetech GT2560 Rev B for A10(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1317)
-# Geeetech GT2560 Rev B for A10(M/T/D)
-else ifeq ($(HARDWARE_MOTHERBOARD),1318)
# Geeetech GT2560 Rev B for Mecreator2
+else ifeq ($(HARDWARE_MOTHERBOARD),1318)
+# Geeetech GT2560 Rev B for A20(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1319)
-# Geeetech GT2560 Rev B for A20(M/T/D)
+# Geeetech GT2560 Rev B for A10(M/T/D)
else ifeq ($(HARDWARE_MOTHERBOARD),1320)
-# Einstart retrofit
-else ifeq ($(HARDWARE_MOTHERBOARD),1321)
-# Wanhao 0ne+ i3 Mini
-else ifeq ($(HARDWARE_MOTHERBOARD),1322)
-# Leapfrog Xeed 2015
-else ifeq ($(HARDWARE_MOTHERBOARD),1323)
-# PICA Shield (original version)
-else ifeq ($(HARDWARE_MOTHERBOARD),1324)
-# PICA Shield (rev C or later)
-else ifeq ($(HARDWARE_MOTHERBOARD),1325)
-# Intamsys 4.0 (Funmat HT)
-else ifeq ($(HARDWARE_MOTHERBOARD),1326)
-# Malyan M180 Mainboard Version 2 (no display function, direct G-code only)
-else ifeq ($(HARDWARE_MOTHERBOARD),1327)
# Geeetech GT2560 Rev B for A20(M/T/D)
+else ifeq ($(HARDWARE_MOTHERBOARD),1321)
+# Einstart retrofit
+else ifeq ($(HARDWARE_MOTHERBOARD),1322)
+# Wanhao 0ne+ i3 Mini
+else ifeq ($(HARDWARE_MOTHERBOARD),1323)
+# Overlord/Overlord Pro
+else ifeq ($(HARDWARE_MOTHERBOARD),1324)
+# ADIMLab Gantry v1
+else ifeq ($(HARDWARE_MOTHERBOARD),1325)
+# ADIMLab Gantry v2
+else ifeq ($(HARDWARE_MOTHERBOARD),1326)
+# Leapfrog Xeed 2015
+else ifeq ($(HARDWARE_MOTHERBOARD),1327)
+# PICA Shield (original version)
else ifeq ($(HARDWARE_MOTHERBOARD),1328)
-# Mega controller & Protoneer CNC Shield V3.00
+# PICA Shield (rev C or later)
else ifeq ($(HARDWARE_MOTHERBOARD),1329)
+# Intamsys 4.0 (Funmat HT)
+else ifeq ($(HARDWARE_MOTHERBOARD),1330)
+# Malyan M180 Mainboard Version 2 (no display function, direct G-code only)
+else ifeq ($(HARDWARE_MOTHERBOARD),1331)
+# Mega controller & Protoneer CNC Shield V3.00
+else ifeq ($(HARDWARE_MOTHERBOARD),1332)
+# WEEDO 62A board (TINA2, Monoprice Cadet, etc.)
+else ifeq ($(HARDWARE_MOTHERBOARD),1333)
+# Geeetech GT2560 V4.1B for A10(M/T/D)
+else ifeq ($(HARDWARE_MOTHERBOARD),1334)
#
# ATmega1281, ATmega2561
@@ -440,7 +466,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1502)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega644p
PROG_MCU ?= m644p
-# Melzi V2.0
+# Melzi V2
else ifeq ($(HARDWARE_MOTHERBOARD),1503)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
@@ -450,36 +476,41 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1504)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
PROG_MCU ?= m1284p
-# Melzi Creality3D board (for CR-10 etc)
+# Melzi Creality3D (for CR-10 etc)
else ifeq ($(HARDWARE_MOTHERBOARD),1505)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
PROG_MCU ?= m1284p
-# Melzi Malyan M150 board
+# Melzi Creality3D (for Ender-2)
else ifeq ($(HARDWARE_MOTHERBOARD),1506)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
PROG_MCU ?= m1284p
-# Tronxy X5S
+# Melzi Malyan M150
else ifeq ($(HARDWARE_MOTHERBOARD),1507)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
PROG_MCU ?= m1284p
-# STB V1.1
+# Tronxy X5S
else ifeq ($(HARDWARE_MOTHERBOARD),1508)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
PROG_MCU ?= m1284p
-# Azteeg X1
+# STB V1.1
else ifeq ($(HARDWARE_MOTHERBOARD),1509)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
PROG_MCU ?= m1284p
-# Anet 1.0 (Melzi clone)
+# Azteeg X1
else ifeq ($(HARDWARE_MOTHERBOARD),1510)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
PROG_MCU ?= m1284p
+# Anet 1.0 (Melzi clone)
+else ifeq ($(HARDWARE_MOTHERBOARD),1511)
+ HARDWARE_VARIANT ?= Sanguino
+ MCU ?= atmega1284p
+ PROG_MCU ?= m1284p
# ZoneStar ZMIB V2
else ifeq ($(HARDWARE_MOTHERBOARD),1511)
HARDWARE_VARIANT ?= Sanguino
@@ -995,7 +1026,7 @@ extcoff: $(TARGET).elf
$(NM) -n $< > $@
# Link: create ELF output file from library.
-
+LDFLAGS+= -Wl,-V
$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
$(Pecho) " CXX $@"
$P $(CXX) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
diff --git a/firmware/Marlin/Version.h b/firmware/Marlin/Version.h
index 07fc8b1..41a645e 100644
--- a/firmware/Marlin/Version.h
+++ b/firmware/Marlin/Version.h
@@ -41,7 +41,14 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
-//#define STRING_DISTRIBUTION_DATE "2024-09-09"
+//#define STRING_DISTRIBUTION_DATE "2024-12-06"
+
+/**
+ * The protocol for communication to the host. Protocol indicates communication
+ * standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
+ * (Other behaviors are given by the firmware version and capabilities report.)
+ */
+//#define PROTOCOL_VERSION "1.0"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
@@ -68,8 +75,8 @@
//#define WEBSITE_URL "marlinfw.org"
/**
- * Set the vendor info the serial USB interface, if changable
- * Currently only supported by DUE platform
+ * Set the vendor info the serial USB interface, if changeable.
+ * Currently only supported by DUE platform.
*/
//#define USB_DEVICE_VENDOR_ID 0x0000
//#define USB_DEVICE_PRODUCT_ID 0x0000
diff --git a/firmware/Marlin/_Bootscreen.h b/firmware/Marlin/_Bootscreen.h
deleted file mode 100644
index fc0cfa6..0000000
--- a/firmware/Marlin/_Bootscreen.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#pragma once
-
-#define CUSTOM_BOOTSCREEN_BMPWIDTH 88
-
-const unsigned char custom_start_bmp[] PROGMEM = {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x1F,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x00,
- 0x11,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x00,
- 0x10,0x8E,0x3E,0x1C,0x38,0xF1,0xC5,0x9C,0x78,0x87,0x16,
- 0x11,0x93,0x33,0x26,0x41,0x02,0x26,0x64,0x64,0x88,0x98,
- 0x1F,0x11,0x21,0x22,0x41,0x06,0x24,0x46,0x44,0x90,0x90,
- 0x19,0x31,0x21,0x62,0x38,0xE7,0xE4,0x42,0x46,0x9F,0x90,
- 0x11,0x91,0x21,0x22,0x0C,0x34,0x04,0x42,0x44,0x90,0x10,
- 0x10,0x91,0x33,0x22,0x04,0x12,0x04,0x42,0x44,0x88,0x10,
- 0x10,0xCE,0x3E,0x1C,0x79,0xE3,0xE4,0x42,0x78,0x8F,0x90,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x41,0x04,0x18,0x61,0xE3,0xFB,0x11,0x0C,0x86,0x00,
- 0x00,0x41,0x0E,0x18,0x62,0x30,0x43,0x11,0x1C,0x8C,0x00,
- 0x00,0x41,0x0A,0x18,0xE6,0x18,0x43,0x11,0x1C,0x98,0x00,
- 0x00,0x61,0x1A,0x14,0xA4,0x08,0x43,0x11,0x2C,0xB0,0x00,
- 0x00,0x7F,0x11,0x15,0xA4,0x08,0x41,0xF1,0x2C,0xF0,0x00,
- 0x00,0x41,0x11,0x13,0x24,0x08,0x40,0x11,0x4C,0xC8,0x00,
- 0x00,0x41,0x3F,0x93,0x26,0x18,0x40,0x11,0x4C,0x8C,0x00,
- 0x00,0x41,0x20,0x90,0x22,0x10,0x40,0x11,0x8C,0x84,0x00,
- 0x00,0x41,0x60,0x90,0x21,0xE0,0x40,0x11,0x8C,0x82,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x0C,0xFE,0xE0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xC7,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0x03,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x3F,0x01,0xF8,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xFE,0x00,0xFE,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xFE,0x00,0xFE,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xFE,0x00,0xFE,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x7E,0x01,0xFC,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0x01,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0x83,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x3F,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x08,0x7C,0x60,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
-};
-
-// Saves 283 bytes
-#define COMPACT_CUSTOM_BOOTSCREEN_EXT
-const unsigned char custom_start_bmp_rle[355] PROGMEM = {
- 0x0F, 0xFB, 0xB4, 0x90, 0xF1, 0xE0, 0x50, 0xF0, 0x20, 0x21, 0x80, 0xF1, 0xE0, 0x50, 0xF0, 0x20,
- 0x30, 0x22, 0x24, 0x32, 0x32, 0x23, 0x22, 0x20, 0x01, 0x12, 0x23, 0x20, 0x32, 0x20, 0x01, 0x30,
- 0x21, 0x10, 0x11, 0x11, 0x11, 0x10, 0x11, 0x10, 0x40, 0x50, 0x20, 0x11, 0x11, 0x10, 0x21, 0x10,
- 0x10, 0x20, 0x20, 0x11, 0x54, 0x20, 0x20, 0x10, 0x30, 0x10, 0x20, 0x10, 0x40, 0x41, 0x20, 0x10,
- 0x20, 0x21, 0x10, 0x20, 0x10, 0x10, 0x30, 0x10, 0x61, 0x10, 0x11, 0x20, 0x10, 0x30, 0x01, 0x20,
- 0x22, 0x22, 0x15, 0x10, 0x20, 0x30, 0x10, 0x21, 0x00, 0x15, 0x10, 0x60, 0x21, 0x10, 0x20, 0x10,
- 0x30, 0x10, 0x20, 0x41, 0x31, 0x00, 0x60, 0x20, 0x30, 0x10, 0x20, 0x10, 0x10, 0x60, 0x60, 0x30,
- 0x10, 0x20, 0x11, 0x11, 0x10, 0x20, 0x50, 0x40, 0x10, 0x50, 0x20, 0x30, 0x10, 0x20, 0x10, 0x20,
- 0x50, 0x60, 0x31, 0x12, 0x24, 0x32, 0x23, 0x13, 0x24, 0x10, 0x20, 0x30, 0x13, 0x20, 0x24, 0x10,
- 0xFF, 0xC5, 0x04, 0x04, 0x04, 0x13, 0x13, 0x32, 0x60, 0x12, 0x02, 0x03, 0x11, 0x03, 0x1F, 0x02,
- 0x04, 0x03, 0x23, 0x13, 0x12, 0x02, 0x14, 0x03, 0x12, 0x02, 0x02, 0x21, 0x02, 0x1F, 0x03, 0x04,
- 0x03, 0x00, 0x03, 0x12, 0x21, 0x13, 0x13, 0x03, 0x12, 0x02, 0x02, 0x21, 0x01, 0x1F, 0x04, 0x13,
- 0x02, 0x10, 0x03, 0x00, 0x01, 0x00, 0x01, 0x05, 0x03, 0x03, 0x12, 0x02, 0x01, 0x00, 0x11, 0x00,
- 0x1F, 0x05, 0x62, 0x02, 0x02, 0x00, 0x00, 0x10, 0x01, 0x05, 0x03, 0x04, 0x42, 0x01, 0x00, 0x11,
- 0x3F, 0x05, 0x04, 0x02, 0x02, 0x02, 0x01, 0x11, 0x01, 0x05, 0x03, 0x08, 0x02, 0x00, 0x01, 0x11,
- 0x11, 0x0F, 0x04, 0x04, 0x01, 0x61, 0x01, 0x11, 0x01, 0x13, 0x13, 0x08, 0x02, 0x00, 0x01, 0x11,
- 0x02, 0x1F, 0x03, 0x04, 0x01, 0x04, 0x01, 0x05, 0x02, 0x03, 0x04, 0x08, 0x02, 0x12, 0x11, 0x03,
- 0x0F, 0x03, 0x04, 0x00, 0x14, 0x01, 0x05, 0x03, 0x35, 0x08, 0x02, 0x12, 0x11, 0x04, 0x0F, 0xF9,
- 0x32, 0xF4, 0x43, 0xF4, 0x44, 0xF3, 0xE1, 0x16, 0x02, 0xF3, 0x8F, 0x01, 0xF3, 0x7F, 0x01, 0xF3,
- 0x7F, 0x01, 0xF3, 0x76, 0x26, 0xF3, 0x74, 0x55, 0xF3, 0x65, 0x65, 0xF3, 0x36, 0x86, 0xF3, 0x16,
- 0x86, 0xF3, 0x16, 0x86, 0xF3, 0x25, 0x76, 0xF3, 0x54, 0x64, 0xF3, 0x75, 0x45, 0xF3, 0x7F, 0x01,
- 0xF3, 0x7F, 0x01, 0xF3, 0x6F, 0x02, 0xF3, 0x7F, 0x01, 0xF3, 0x80, 0x34, 0x21, 0xF3, 0xE3, 0xF4,
- 0x52, 0xFF, 0x33
-};
diff --git a/firmware/Marlin/_Statusscreen.h b/firmware/Marlin/_Statusscreen.h
deleted file mode 100644
index 408b250..0000000
--- a/firmware/Marlin/_Statusscreen.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-
-/**
- * Custom Status Screen bitmap
- *
- * Place this file in the root with your configuration files
- * and enable CUSTOM_STATUS_SCREEN_IMAGE in Configuration.h.
- *
- * Use the Marlin Bitmap Converter to make your own:
- * https://marlinfw.org/tools/u8glib/converter.html
- */
-
-//
-// Status Screen Logo bitmap
-//
-#define STATUS_LOGO_Y 6
-#define STATUS_LOGO_WIDTH 40
-
-const unsigned char status_logo_bmp[] PROGMEM = {
- 0xFF,0xFF,0xFF,0xFF,0x7F,
- 0xB6,0x6E,0x88,0xCD,0x5D,
- 0xB5,0xA4,0xAD,0xB5,0xD9,
- 0xB5,0xAA,0xAD,0xB5,0xDD,
- 0xB5,0xAA,0xAD,0xB5,0xDD,
- 0xB5,0xAA,0xAD,0xB5,0xD8,
- 0xB5,0xAA,0xAD,0xB5,0xDF,
- 0x84,0x2E,0xAD,0x85,0xDD,
- 0xB5,0xAE,0xAD,0xB5,0x9F,
- 0xB5,0xAE,0xAD,0xB5,0x58,
- 0xB5,0xAE,0xAD,0xB4,0xDA,
- 0xB5,0xAE,0xAD,0xB4,0xDA,
- 0xB5,0xAE,0xAD,0xB4,0xD8,
- 0xB5,0xAE,0x8D,0xB5,0xDF,
- 0xFF,0xFF,0xFF,0xFF,0xFF
-};
-
-//
-// Use default bitmaps
-//
-#define STATUS_HOTEND_ANIM
-#define STATUS_BED_ANIM
-#define STATUS_HEATERS_XSPACE 20
-#if HOTENDS < 2
- #define STATUS_HEATERS_X 48
- #define STATUS_BED_X 73
-#else
- #define STATUS_HEATERS_X 40
- #define STATUS_BED_X 81
-#endif
\ No newline at end of file
diff --git a/firmware/Marlin/config.ini b/firmware/Marlin/config.ini
index fed2a5c..d6d2395 100644
--- a/firmware/Marlin/config.ini
+++ b/firmware/Marlin/config.ini
@@ -62,6 +62,11 @@ motherboard = BOARD_RAMPS_14_EFB
serial_port = 0
baudrate = 250000
+string_config_h_author = "(default from config.ini)"
+
+capabilities_report = on
+extended_capabilities_report = on
+
use_watchdog = on
thermal_protection_hotends = on
thermal_protection_hysteresis = 4
@@ -77,9 +82,7 @@ temp_sensor_0 = 1
temp_hysteresis = 3
heater_0_mintemp = 5
heater_0_maxtemp = 275
-preheat_1_temp_hotend = 180
-bang_max = 255
pidtemp = on
pid_k1 = 0.95
pid_max = 255
@@ -89,6 +92,14 @@ default_kp = 22.20
default_ki = 1.08
default_kd = 114.00
+temp_sensor_bed = 1
+bed_mintemp = 5
+bed_maxtemp = 150
+
+thermal_protection_bed = on
+thermal_protection_bed_hysteresis = 2
+thermal_protection_bed_period = 20
+
x_driver_type = A4988
y_driver_type = A4988
z_driver_type = A4988
@@ -121,10 +132,10 @@ default_max_acceleration = { 3000, 3000, 100, 10000 }
homing_feedrate_mm_m = { (50*60), (50*60), (4*60) }
homing_bump_divisor = { 2, 2, 4 }
-x_enable_on = 0
-y_enable_on = 0
-z_enable_on = 0
-e_enable_on = 0
+x_enable_on = LOW
+y_enable_on = LOW
+z_enable_on = LOW
+e_enable_on = LOW
invert_x_dir = false
invert_y_dir = true
@@ -136,11 +147,6 @@ step_state_x = HIGH
step_state_y = HIGH
step_state_z = HIGH
-disable_x = off
-disable_y = off
-disable_z = off
-disable_e = off
-
proportional_font_ratio = 1.0
default_nominal_filament_dia = 1.75
@@ -153,18 +159,13 @@ default_retract_acceleration = 3000
default_minimumfeedrate = 0.0
default_mintravelfeedrate = 0.0
-minimum_planner_speed = 0.05
min_steps_per_segment = 6
default_minsegmenttime = 20000
[config:basic]
bed_overshoot = 10
busy_while_heating = on
-default_ejerk = 5.0
default_keepalive_interval = 2
-default_leveling_fade_height = 0.0
-disable_other_extruders = on
-display_charset_hd44780 = JAPANESE
eeprom_boot_silent = on
eeprom_chitchat = on
endstoppullups = on
@@ -173,10 +174,8 @@ extrude_mintemp = 170
host_keepalive_feature = on
hotend_overshoot = 15
jd_handle_small_segments = on
-lcd_info_screen_style = 0
-lcd_language = en
max_bed_power = 255
-mesh_inset = 0
+
min_software_endstops = on
max_software_endstops = on
min_software_endstop_x = on
@@ -185,50 +184,48 @@ min_software_endstop_z = on
max_software_endstop_x = on
max_software_endstop_y = on
max_software_endstop_z = on
-preheat_1_fan_speed = 0
+
preheat_1_label = "PLA"
+preheat_1_temp_hotend = 180
preheat_1_temp_bed = 70
+preheat_1_fan_speed = 0
+
+preheat_2_label = "ABS"
+preheat_2_temp_hotend = 240
+preheat_2_temp_bed = 110
+preheat_2_fan_speed = 0
+
prevent_cold_extrusion = on
prevent_lengthy_extrude = on
printjob_timer_autostart = on
-probing_margin = 10
-show_bootscreen = on
-soft_pwm_scale = 0
-string_config_h_author = "(none, default config)"
+
temp_bed_hysteresis = 3
temp_bed_residency_time = 10
temp_bed_window = 1
temp_residency_time = 10
temp_window = 1
validate_homing_endstops = on
-xy_probe_feedrate = (133*60)
-z_clearance_between_probes = 5
-z_clearance_deploy_probe = 10
-z_clearance_multi_probe = 5
+
+editable_steps_per_unit = on
[config:advanced]
arc_support = on
auto_report_temperatures = on
+
autotemp = on
+autotemp_min = 210
+autotemp_max = 250
+autotemp_factor = 0.1f
autotemp_oldweight = 0.98
-bed_check_interval = 5000
+
default_stepper_timeout_sec = 120
-default_volumetric_extruder_limit = 0.00
disable_idle_x = on
disable_idle_y = on
disable_idle_z = on
disable_idle_e = on
e0_auto_fan_pin = -1
-encoder_100x_steps_per_sec = 80
-encoder_10x_steps_per_sec = 30
-encoder_rate_multiplier = on
-extended_capabilities_report = on
-extruder_auto_fan_speed = 255
-extruder_auto_fan_temperature = 50
-fanmux0_pin = -1
-fanmux1_pin = -1
-fanmux2_pin = -1
faster_gcode_parser = on
+debug_flags_gcode = on
homing_bump_mm = { 5, 5, 2 }
max_arc_segment_mm = 1.0
min_arc_segment_mm = 0.1
@@ -237,11 +234,11 @@ n_arc_correction = 25
serial_overrun_protection = on
slowdown = on
slowdown_divisor = 2
-temp_sensor_bed = 0
-thermal_protection_bed_hysteresis = 2
-thermocouple_max_errors = 15
tx_buffer_size = 0
+
+bed_check_interval = 5000
watch_bed_temp_increase = 2
watch_bed_temp_period = 60
+
watch_temp_increase = 2
-watch_temp_period = 20
+watch_temp_period = 40
diff --git a/firmware/Marlin/src/HAL/AVR/HAL.h b/firmware/Marlin/src/HAL/AVR/HAL.h
index 717bc7e..b420236 100644
--- a/firmware/Marlin/src/HAL/AVR/HAL.h
+++ b/firmware/Marlin/src/HAL/AVR/HAL.h
@@ -129,11 +129,11 @@ typedef Servo hal_servo_t;
#endif
#endif
-#ifdef MMU2_SERIAL_PORT
- #if !WITHIN(MMU2_SERIAL_PORT, 0, 3)
- #error "MMU2_SERIAL_PORT must be from 0 to 3"
+#ifdef MMU_SERIAL_PORT
+ #if !WITHIN(MMU_SERIAL_PORT, 0, 3)
+ #error "MMU_SERIAL_PORT must be from 0 to 3"
#endif
- #define MMU2_SERIAL mmuSerial
+ #define MMU_SERIAL mmuSerial
#endif
#ifdef LCD_SERIAL_PORT
diff --git a/firmware/Marlin/src/HAL/AVR/MarlinSerial.cpp b/firmware/Marlin/src/HAL/AVR/MarlinSerial.cpp
index dabcfb5..d070731 100644
--- a/firmware/Marlin/src/HAL/AVR/MarlinSerial.cpp
+++ b/firmware/Marlin/src/HAL/AVR/MarlinSerial.cpp
@@ -601,20 +601,20 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
#endif // SERIAL_PORT_3
-#ifdef MMU2_SERIAL_PORT
+#ifdef MMU_SERIAL_PORT
- ISR(SERIAL_REGNAME(USART, MMU2_SERIAL_PORT, _RX_vect)) {
- MarlinSerial>::store_rxd_char();
+ ISR(SERIAL_REGNAME(USART, MMU_SERIAL_PORT, _RX_vect)) {
+ MarlinSerial>::store_rxd_char();
}
- ISR(SERIAL_REGNAME(USART, MMU2_SERIAL_PORT, _UDRE_vect)) {
- MarlinSerial>::_tx_udr_empty_irq();
+ ISR(SERIAL_REGNAME(USART, MMU_SERIAL_PORT, _UDRE_vect)) {
+ MarlinSerial>::_tx_udr_empty_irq();
}
- template class MarlinSerial< MMU2SerialCfg >;
+ template class MarlinSerial< MMU2SerialCfg >;
MSerialMMU2 mmuSerial(MSerialMMU2::HasEmergencyParser);
-#endif // MMU2_SERIAL_PORT
+#endif // MMU_SERIAL_PORT
#ifdef LCD_SERIAL_PORT
diff --git a/firmware/Marlin/src/HAL/AVR/MarlinSerial.h b/firmware/Marlin/src/HAL/AVR/MarlinSerial.h
index 609aac5..9ecf3bd 100644
--- a/firmware/Marlin/src/HAL/AVR/MarlinSerial.h
+++ b/firmware/Marlin/src/HAL/AVR/MarlinSerial.h
@@ -246,7 +246,7 @@
#endif // !USBCON
-#ifdef MMU2_SERIAL_PORT
+#ifdef MMU_SERIAL_PORT
template
struct MMU2SerialCfg {
static constexpr int PORT = serial;
@@ -260,7 +260,7 @@
static constexpr bool RX_OVERRUNS = false;
};
- typedef Serial1Class< MarlinSerial< MMU2SerialCfg > > MSerialMMU2;
+ typedef Serial1Class< MarlinSerial< MMU2SerialCfg > > MSerialMMU2;
extern MSerialMMU2 mmuSerial;
#endif
diff --git a/firmware/Marlin/src/HAL/AVR/pinsDebug.h b/firmware/Marlin/src/HAL/AVR/pinsDebug.h
index b4352fd..e9bc09a 100644
--- a/firmware/Marlin/src/HAL/AVR/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/AVR/pinsDebug.h
@@ -22,7 +22,23 @@
#pragma once
/**
- * PWM print routines for Atmel 8 bit AVR CPUs
+ * Pins Debugging for Atmel 8 bit AVR CPUs
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#include "../../inc/MarlinConfig.h"
@@ -39,30 +55,30 @@
#include "pinsDebug_Teensyduino.h"
// Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
// portModeRegister takes a different argument
- #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
- #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
- #define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
- #define getValidPinMode(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))
+ #define digitalPinToTimer_DEBUG(P) digitalPinToTimer(P)
+ #define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask(P)
+ #define digitalPinToPort_DEBUG(P) digitalPinToPort(P)
+ #define getValidPinMode(P) (*portModeRegister(P) & digitalPinToBitMask_DEBUG(P))
#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70
#include "pinsDebug_plus_70.h"
- #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p)
- #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p)
- #define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p)
+ #define digitalPinToTimer_DEBUG(P) digitalPinToTimer_plus_70(P)
+ #define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask_plus_70(P)
+ #define digitalPinToPort_DEBUG(P) digitalPinToPort_plus_70(P)
bool getValidPinMode(pin_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
#else
- #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
- #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
- #define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
+ #define digitalPinToTimer_DEBUG(P) digitalPinToTimer(P)
+ #define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask(P)
+ #define digitalPinToPort_DEBUG(P) digitalPinToPort(P)
bool getValidPinMode(pin_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
- #define getPinByIndex(p) pgm_read_byte(&pin_array[p].pin)
+ #define getPinByIndex(x) pgm_read_byte(&pin_array[x].pin)
#endif
-#define isValidPin(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
+#define isValidPin(P) (P >= 0 && P < NUMBER_PINS_TOTAL)
#if AVR_ATmega1284_FAMILY
#define isAnalogPin(P) WITHIN(P, analogInputToDigitalPin(7), analogInputToDigitalPin(0))
#define digitalPinToAnalogIndex(P) int(isAnalogPin(P) ? (P) - analogInputToDigitalPin(7) : -1)
@@ -72,11 +88,11 @@
#define isAnalogPin(P) (_ANALOG1(P) || _ANALOG2(P))
#define digitalPinToAnalogIndex(P) int(_ANALOG1(P) ? (P) - analogInputToDigitalPin(0) : _ANALOG2(P) ? (P) - analogInputToDigitalPin(8) + 8 : -1)
#endif
-#define getPinByIndex(p) pgm_read_byte(&pin_array[p].pin)
+#define getPinByIndex(x) pgm_read_byte(&pin_array[x].pin)
#define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin
-void printPinNameByIndex(uint8_t x) {
- PGM_P const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name);
+void printPinNameByIndex(const uint8_t index) {
+ PGM_P const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[index].name);
for (uint8_t y = 0; y < MAX_NAME_LENGTH; ++y) {
char temp_char = pgm_read_byte(name_mem_pointer + y);
if (temp_char != 0)
@@ -109,7 +125,7 @@ void printPinNameByIndex(uint8_t x) {
* Print a pin's PWM status.
* Return true if it's currently a PWM pin.
*/
-bool pwm_status(uint8_t pin) {
+bool pwm_status(const uint8_t pin) {
char buffer[20]; // for the sprintf statements
switch (digitalPinToTimer_DEBUG(pin)) {
@@ -276,7 +292,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
if (TEST(*TMSK, TOIE)) err_prob_interrupt();
}
-void printPinPWM(uint8_t pin) {
+void printPinPWM(const uint8_t pin) {
switch (digitalPinToTimer_DEBUG(pin)) {
#if ABTEST(0)
@@ -386,7 +402,7 @@ void printPinPort(const pin_t pin) { // print port number
#endif
}
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
#undef ABTEST
diff --git a/firmware/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h b/firmware/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h
index c812d4f..463a77e 100644
--- a/firmware/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h
+++ b/firmware/Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h
@@ -102,7 +102,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
// digitalPinToBitMask(pin) is OK
-#define digitalRead_mod(p) extDigitalRead(p) // Teensyduino's version of digitalRead doesn't
+#define digitalRead_mod(P) extDigitalRead(P) // Teensyduino's version of digitalRead doesn't
// disable the PWMs so we can use it as is
// portModeRegister(pin) is OK
diff --git a/firmware/Marlin/src/HAL/DUE/HAL.h b/firmware/Marlin/src/HAL/DUE/HAL.h
index fde235e..9d00d9d 100644
--- a/firmware/Marlin/src/HAL/DUE/HAL.h
+++ b/firmware/Marlin/src/HAL/DUE/HAL.h
@@ -81,11 +81,11 @@ extern DefaultSerial4 MSerial3;
#endif
#endif
-#ifdef MMU2_SERIAL_PORT
- #if WITHIN(MMU2_SERIAL_PORT, 0, 3)
- #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
+#ifdef MMU_SERIAL_PORT
+ #if WITHIN(MMU_SERIAL_PORT, 0, 3)
+ #define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
#else
- #error "MMU2_SERIAL_PORT must be from 0 to 3."
+ #error "MMU_SERIAL_PORT must be from 0 to 3."
#endif
#endif
diff --git a/firmware/Marlin/src/HAL/DUE/eeprom_flash.cpp b/firmware/Marlin/src/HAL/DUE/eeprom_flash.cpp
index a5c7ab8..55206a0 100644
--- a/firmware/Marlin/src/HAL/DUE/eeprom_flash.cpp
+++ b/firmware/Marlin/src/HAL/DUE/eeprom_flash.cpp
@@ -291,7 +291,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
uint32_t *p1 = (uint32_t*)addrflash;
uint32_t *p2 = (uint32_t*)data;
int count = 0;
- for (i =0; i> 2; i++) {
+ for (i = 0; i < PageSize >> 2; i++) {
if (p1[i] != p2[i]) {
uint32_t delta = p1[i] ^ p2[i];
while (delta) {
diff --git a/firmware/Marlin/src/HAL/DUE/pinsDebug.h b/firmware/Marlin/src/HAL/DUE/pinsDebug.h
index e320189..e9e364d 100644
--- a/firmware/Marlin/src/HAL/DUE/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/DUE/pinsDebug.h
@@ -19,13 +19,26 @@
* along with this program. If not, see .
*
*/
+#pragma once
/**
- * Support routines for Due
- */
-
-/**
- * Translation of routines & variables used by pinsDebug.h
+ * Pins Debugging for DUE
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#include "../shared/Marduino.h"
@@ -63,20 +76,20 @@
#define NUMBER_PINS_TOTAL PINS_COUNT
-#define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin
+#define digitalRead_mod(P) extDigitalRead(P) // AVR digitalRead disabled PWM before it read the pin
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
-#define getPinByIndex(p) pin_array[p].pin
-#define getPinIsDigitalByIndex(p) pin_array[p].is_digital
-#define isValidPin(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
-#define digitalPinToAnalogIndex(p) int(p - analogInputToDigitalPin(0))
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+#define getPinByIndex(x) pin_array[x].pin
+#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
+#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
+#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0))
#define isAnalogPin(P) WITHIN(P, pin_t(analogInputToDigitalPin(0)), pin_t(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
-#define pwm_status(pin) (((g_pinStatus[pin] & 0xF) == PIN_STATUS_PWM) && \
- ((g_APinDescription[pin].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM))
+#define pwm_status(P) (((g_pinStatus[P] & 0xF) == PIN_STATUS_PWM) && \
+ ((g_APinDescription[P].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM))
#define MULTI_NAME_PAD 14 // space needed to be pretty if not first name assigned to a pin
-bool getValidPinMode(int8_t pin) { // 1: output, 0: input
+bool getValidPinMode(const pin_t pin) { // 1: output, 0: input
volatile Pio* port = g_APinDescription[pin].pPort;
uint32_t mask = g_APinDescription[pin].ulPin;
uint8_t pin_status = g_pinStatus[pin] & 0xF;
@@ -85,7 +98,7 @@ bool getValidPinMode(int8_t pin) { // 1: output, 0: input
|| pwm_status(pin));
}
-void printPinPWM(int32_t pin) {
+void printPinPWM(const int32_t pin) {
if (pwm_status(pin)) {
uint32_t chan = g_APinDescription[pin].ulPWMChannel;
SERIAL_ECHOPGM("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
diff --git a/firmware/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp b/firmware/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp
index a7789c5..cf6739c 100644
--- a/firmware/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp
+++ b/firmware/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp
@@ -19,9 +19,7 @@ void sd_mmc_spi_mem_init() {
}
inline bool media_ready() {
- return DISABLED(DISABLE_DUE_SD_MMC)
- && IS_SD_MOUNTED() && IS_SD_INSERTED()
- && !IS_SD_FILE_OPEN() && !IS_SD_PRINTING();
+ return IS_SD_MOUNTED() && IS_SD_INSERTED() && !IS_SD_FILE_OPEN() && !IS_SD_PRINTING();
}
bool sd_mmc_spi_unload(bool) { return true; }
@@ -31,6 +29,9 @@ bool sd_mmc_spi_wr_protect() { return false; }
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 (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
return CTRL_GOOD;
}
@@ -57,6 +58,9 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE];
// #define DEBUG_MMC
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 (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC
@@ -93,6 +97,9 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
}
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 (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC
diff --git a/firmware/Marlin/src/HAL/ESP32/HAL.cpp b/firmware/Marlin/src/HAL/ESP32/HAL.cpp
index 4890972..415e251 100644
--- a/firmware/Marlin/src/HAL/ESP32/HAL.cpp
+++ b/firmware/Marlin/src/HAL/ESP32/HAL.cpp
@@ -209,16 +209,17 @@ int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
// ADC
// ------------------------
-#define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL
-
+// https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/api-reference/peripherals/adc.html
adc1_channel_t get_channel(int pin) {
switch (pin) {
- case 39: return ADC1_CHANNEL(39);
- case 36: return ADC1_CHANNEL(36);
- case 35: return ADC1_CHANNEL(35);
- case 34: return ADC1_CHANNEL(34);
- case 33: return ADC1_CHANNEL(33);
- case 32: return ADC1_CHANNEL(32);
+ case 39: return ADC1_CHANNEL_3;
+ case 36: return ADC1_CHANNEL_0;
+ case 35: return ADC1_CHANNEL_7;
+ case 34: return ADC1_CHANNEL_6;
+ case 33: return ADC1_CHANNEL_5;
+ case 32: return ADC1_CHANNEL_4;
+ case 37: return ADC1_CHANNEL_1;
+ case 38: return ADC1_CHANNEL_2;
}
return ADC1_CHANNEL_MAX;
}
diff --git a/firmware/Marlin/src/HAL/ESP32/fastio.h b/firmware/Marlin/src/HAL/ESP32/fastio.h
index c8e3f7e..a85423d 100644
--- a/firmware/Marlin/src/HAL/ESP32/fastio.h
+++ b/firmware/Marlin/src/HAL/ESP32/fastio.h
@@ -37,6 +37,10 @@
// Set pin as output
#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT)
+// TODO: Store set modes in an array and use those to get the mode
+#define _IS_OUTPUT(IO) true
+#define _IS_INPUT(IO) true
+
// Set pin as input with pullup mode
#define _PULLUP(IO, v) pinMode(IO, v ? INPUT_PULLUP : INPUT)
@@ -70,6 +74,9 @@
// Set pin as output and init
#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
+#define IS_OUTPUT(IO) _IS_OUTPUT(IO)
+#define IS_INPUT(IO) _IS_INPUT(IO)
+
// digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO)
#define extDigitalWrite(IO,V) digitalWrite(IO,V)
diff --git a/firmware/Marlin/src/HAL/ESP32/ota.cpp b/firmware/Marlin/src/HAL/ESP32/ota.cpp
index 01f5924..be5847b 100644
--- a/firmware/Marlin/src/HAL/ESP32/ota.cpp
+++ b/firmware/Marlin/src/HAL/ESP32/ota.cpp
@@ -22,11 +22,15 @@
#ifdef ARDUINO_ARCH_ESP32
+#include
+
+#undef ENABLED
+#undef DISABLED
+
#include "../../inc/MarlinConfigPre.h"
#if ALL(WIFISUPPORT, OTASUPPORT)
-#include
#include
#include
#include
diff --git a/firmware/Marlin/src/HAL/ESP32/pinsDebug.h b/firmware/Marlin/src/HAL/ESP32/pinsDebug.h
new file mode 100644
index 0000000..42304b2
--- /dev/null
+++ b/firmware/Marlin/src/HAL/ESP32/pinsDebug.h
@@ -0,0 +1,71 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+#error "PINS_DEBUGGING is not yet supported for ESP32!"
+
+/**
+ * Pins Debugging for ESP32
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
+ */
+
+#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
+#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
+
+#define digitalRead_mod(P) extDigitalRead(P)
+#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+#define getPinByIndex(x) pin_array[x].pin
+#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
+#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
+#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0))
+#define isAnalogPin(P) WITHIN(P, pin_t(analogInputToDigitalPin(0)), pin_t(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
+bool pwm_status(const pin_t) { return false; }
+
+void printPinPort(const pin_t) {}
+
+static bool getValidPinMode(const pin_t pin) {
+ return isValidPin(pin) && !IS_INPUT(pin);
+}
+
+void printPinPWM(const int32_t pin) {
+ if (pwm_status(pin)) {
+ //uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
+ //SERIAL_ECHOPGM("PWM = ", duty);
+ }
+}
diff --git a/firmware/Marlin/src/HAL/ESP32/timers.cpp b/firmware/Marlin/src/HAL/ESP32/timers.cpp
index a689315..743ed65 100644
--- a/firmware/Marlin/src/HAL/ESP32/timers.cpp
+++ b/firmware/Marlin/src/HAL/ESP32/timers.cpp
@@ -90,7 +90,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
config.counter_en = TIMER_PAUSE;
config.alarm_en = TIMER_ALARM_EN;
config.intr_type = TIMER_INTR_LEVEL;
- config.auto_reload = true;
+ config.auto_reload = TIMER_AUTORELOAD_EN;
// Select and initialize the timer
timer_init(timer.group, timer.idx, &config);
diff --git a/firmware/Marlin/src/HAL/ESP32/wifi.cpp b/firmware/Marlin/src/HAL/ESP32/wifi.cpp
index 060f3bd..aa2796a 100644
--- a/firmware/Marlin/src/HAL/ESP32/wifi.cpp
+++ b/firmware/Marlin/src/HAL/ESP32/wifi.cpp
@@ -21,11 +21,12 @@
*/
#ifdef ARDUINO_ARCH_ESP32
-#include "../../core/serial.h"
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(WIFISUPPORT)
+#include "../../core/serial.h"
+
#include
#include
#include
diff --git a/firmware/Marlin/src/HAL/HC32/HAL.h b/firmware/Marlin/src/HAL/HC32/HAL.h
index 8111e1b..3f4ba14 100644
--- a/firmware/Marlin/src/HAL/HC32/HAL.h
+++ b/firmware/Marlin/src/HAL/HC32/HAL.h
@@ -30,7 +30,6 @@
#include "../../inc/MarlinConfig.h"
-#include "../../core/macros.h"
#include "../shared/Marduino.h"
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"
@@ -39,8 +38,6 @@
#include "timers.h"
#include "MarlinSerial.h"
-#include
-
//
// Serial Ports
//
diff --git a/firmware/Marlin/src/HAL/HC32/README.md b/firmware/Marlin/src/HAL/HC32/README.md
index c9ae8a9..ed11c40 100644
--- a/firmware/Marlin/src/HAL/HC32/README.md
+++ b/firmware/Marlin/src/HAL/HC32/README.md
@@ -11,7 +11,7 @@ The HC32F460 HAL is designed to be generic enough for any HC32F460-based board.
- Examine the board's main processor. (Refer the naming key in `hc32.ini`.)
- Extend the `HC32F460C_common` base env for 256K, or `HC32F460E_common` for 512K.
3. Determine your board's application start address (see [below](#finding-the-application-start-address))
-4. Set `board_build.ld_args.flash_start` to the app start address once you've found it. If your board doesn't use a bootloader, you may be able to use the "ICSP" header or DFU. This document will be updated once we have more information about flashing without a bootloader.
+4. Set `board_upload.offset_address` to the app start address once you've found it. If your board doesn't use a bootloader, you may be able to use the "ICSP" header or DFU. This document will be updated once we have more information about flashing without a bootloader.
### Finding the application start address
diff --git a/firmware/Marlin/src/HAL/HC32/app_config.h b/firmware/Marlin/src/HAL/HC32/app_config.h
index fb29141..b971903 100644
--- a/firmware/Marlin/src/HAL/HC32/app_config.h
+++ b/firmware/Marlin/src/HAL/HC32/app_config.h
@@ -8,6 +8,7 @@
#define _HC32_APP_CONFIG_H_
#include "../../inc/MarlinConfigPre.h"
+#include "sysclock.h"
//
// dev mode
@@ -64,12 +65,8 @@
// redirect printf to host serial
#define REDIRECT_PRINTF_TO_SERIAL 1
-// F_CPU must be known at compile time, but on HC32F460 it's not.
-// Thus we assume HCLK to be 200MHz, as that's what is configured in
-// 'core_hook_sysclock_init' in 'sysclock.cpp'.
-// If you face issues with this assumption, please double-check with the values
-// printed by 'MarlinHAL::HAL_clock_frequencies_dump'.
-// see also: HAL_TIMER_RATE in timers.h
-#define F_CPU 200000000 // 200MHz HCLK
+// F_CPU is F_HCLK, as that's the main CPU core's clock.
+// see 'sysclock.h' for more information.
+#define F_CPU F_HCLK
#endif // _HC32_APP_CONFIG_H_
diff --git a/firmware/Marlin/src/HAL/HC32/docs/HC32F460 series Datasheet Rev1.3.pdf b/firmware/Marlin/src/HAL/HC32/docs/HC32F460 series Datasheet Rev1.3.pdf
new file mode 100644
index 0000000..a8943c8
Binary files /dev/null and b/firmware/Marlin/src/HAL/HC32/docs/HC32F460 series Datasheet Rev1.3.pdf differ
diff --git a/firmware/Marlin/src/HAL/HC32/inc/SanityCheck.h b/firmware/Marlin/src/HAL/HC32/inc/SanityCheck.h
index 6b12e4d..e38bce9 100644
--- a/firmware/Marlin/src/HAL/HC32/inc/SanityCheck.h
+++ b/firmware/Marlin/src/HAL/HC32/inc/SanityCheck.h
@@ -94,8 +94,10 @@
#error "SERIAL_DMA requires USART_RX_DMA_SUPPORT to be enabled in the arduino core."
#endif
- // USART_RX_DMA_SUPPORT does not implement core_hook_usart_rx_irq, which is required for the emergency parser
- #if ENABLED(EMERGENCY_PARSER)
+ // Before arduino core version 1.2.0, USART_RX_DMA_SUPPORT did not implement
+ // core_hook_usart_rx_irq, which is required for the emergency parser.
+ // With 1.2.0, this was fixed (see https://github.com/shadow578/framework-arduino-hc32f46x/pull/25).
+ #if ENABLED(EMERGENCY_PARSER) && ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 2, 0)
#error "EMERGENCY_PARSER is not supported with SERIAL_DMA. Please disable either SERIAL_DMA or EMERGENCY_PARSER."
#endif
diff --git a/firmware/Marlin/src/HAL/HC32/pinsDebug.h b/firmware/Marlin/src/HAL/HC32/pinsDebug.h
index c00ddf3..e80b5a0 100644
--- a/firmware/Marlin/src/HAL/HC32/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/HC32/pinsDebug.h
@@ -18,41 +18,47 @@
*/
#pragma once
+/**
+ * Pins Debugging for HC32
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
+ */
+
#include "../../inc/MarlinConfig.h"
#include "fastio.h"
#include
-//
-// Translation of routines & variables used by pinsDebug.h
-//
#ifndef BOARD_NR_GPIO_PINS
#error "Expected BOARD_NR_GPIO_PINS not found."
#endif
#define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS
#define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS
-#define isValidPin(pin) IS_GPIO_PIN(pin)
+#define isValidPin(P) IS_GPIO_PIN(P)
// Note: pin_array is defined in `Marlin/src/pins/pinsDebug.h`, and since this file is included
// after it, it is available in this file as well.
-#define getPinByIndex(p) pin_t(pin_array[p].pin)
-#define digitalRead_mod(p) extDigitalRead(p)
-#define printPinNumber(p) \
- do { \
- sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); \
- SERIAL_ECHO(buffer); \
- } while (0)
-#define printPinAnalog(p) \
- do { \
- sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); \
- SERIAL_ECHO(buffer); \
- } while (0)
-#define PRINT_PORT(p) printPinPort(p)
-#define printPinNameByIndex(x) \
- do { \
- sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); \
- SERIAL_ECHO(buffer); \
- } while (0)
+#define getPinByIndex(x) pin_t(pin_array[x].pin)
+#define digitalRead_mod(P) extDigitalRead(P)
+
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(P)); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+
+#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 21 // Space needed to be pretty if not first name assigned to a pin
@@ -71,13 +77,13 @@
#define M43_NEVER_TOUCH(Q) (IS_HOST_USART_PIN(Q) || IS_OSC_PIN(Q))
#endif
-static int8_t digitalPinToAnalogIndex(pin_t pin) {
+int8_t digitalPinToAnalogIndex(const pin_t pin) {
if (!isValidPin(pin)) return -1;
const int8_t adc_channel = int8_t(PIN_MAP[pin].adc_info.channel);
return pin_t(adc_channel);
}
-static bool isAnalogPin(pin_t pin) {
+bool isAnalogPin(pin_t pin) {
if (!isValidPin(pin)) return false;
if (PIN_MAP[pin].adc_info.channel != ADC_PIN_INVALID)
@@ -86,12 +92,12 @@ static bool isAnalogPin(pin_t pin) {
return false;
}
-static bool getValidPinMode(const pin_t pin) {
+bool getValidPinMode(const pin_t pin) {
return isValidPin(pin) && !IS_INPUT(pin);
}
-static bool getPinIsDigitalByIndex(const int16_t array_pin) {
- const pin_t pin = getPinByIndex(array_pin);
+bool getPinIsDigitalByIndex(const int16_t index) {
+ const pin_t pin = getPinByIndex(index);
return (!isAnalogPin(pin));
}
diff --git a/firmware/Marlin/src/HAL/HC32/sysclock.cpp b/firmware/Marlin/src/HAL/HC32/sysclock.cpp
index 475be3b..493515b 100644
--- a/firmware/Marlin/src/HAL/HC32/sysclock.cpp
+++ b/firmware/Marlin/src/HAL/HC32/sysclock.cpp
@@ -26,64 +26,144 @@
#ifdef ARDUINO_ARCH_HC32
-// Get BOARD_XTAL_FREQUENCY from configuration / pins
#include "../../inc/MarlinConfig.h"
+#include "sysclock.h"
#include
#include
+/***
+ * @brief Automatically calculate M, N, P values for the MPLL to reach a target frequency.
+ * @param input_frequency The input frequency.
+ * @param target_frequency The target frequency.
+ * @return The MPLL configuration structure. Q and R are not set.
+ *
+ * @note
+ * Simplified MPLL block diagram, with intermediary clocks (1) = VCO_in, (2) = VCO_out:
+ *
+ * INPUT -> [/ M] -(1)-> [* N] -(2)-|-> [/ P] -> MPLL-P
+ */
+constexpr stc_clk_mpll_cfg_t get_mpll_config(double input_frequency, double target_frequency) {
+ // PLL input clock divider: M in [1, 24]
+ for (uint32_t M = 1; M <= 24; M++) {
+ double f_vco_in = input_frequency / M;
+
+ // 1 <= VCO_in <= 25 MHz
+ if (f_vco_in < 1e6 || f_vco_in > 25e6) continue;
+
+ // VCO multiplier: N in [20, 480]
+ for (uint32_t N = 20; N <= 480; N++) {
+ double f_vco_out = f_vco_in * N;
+
+ // 240 <= VCO_out <= 480 MHz
+ if (f_vco_out < 240e6 || f_vco_out > 480e6) continue;
+
+ // Output "P" divider: P in [2, 16]
+ for (uint32_t P = 2; P <= 16; P++) {
+ double f_calculated_out = f_vco_out / P;
+ if (f_calculated_out == target_frequency) {
+ // Found a match, return it
+ return {
+ .PllpDiv = P,
+ .PllqDiv = P, // Don't care for Q and R
+ .PllrDiv = P, // "
+ .plln = N,
+ .pllmDiv = M
+ };
+ }
+ }
+ }
+ }
+
+ // If no valid M, N, P found, return invalid config
+ return { 0, 0, 0, 0, 0 };
+}
+
+/**
+ * @brief Get the division factor required to get the target frequency from the input frequency.
+ * @tparam input_freq The input frequency.
+ * @tparam target_freq The target frequency.
+ * @return The division factor.
+ */
+template
+constexpr en_clk_sysclk_div_factor_t get_division_factor() {
+ // Calculate the divider to get the target frequency
+ constexpr float fdivider = static_cast(input_freq) / static_cast(target_freq);
+ constexpr int divider = static_cast(fdivider);
+
+ // divider must be an integer
+ static_assert(fdivider == divider, "Target frequency not achievable, divider must be an integer");
+
+ // divider must be between 1 and 64 (enum range), and must be a power of 2
+ static_assert(divider >= 1 && divider <= 64, "Invalid divider, out of range");
+ static_assert((divider & (divider - 1)) == 0, "Invalid divider, not a power of 2");
+
+ // return the divider
+ switch (divider) {
+ case 1: return ClkSysclkDiv1;
+ case 2: return ClkSysclkDiv2;
+ case 4: return ClkSysclkDiv4;
+ case 8: return ClkSysclkDiv8;
+ case 16: return ClkSysclkDiv16;
+ case 32: return ClkSysclkDiv32;
+ case 64: return ClkSysclkDiv64;
+ }
+}
+
+/**
+ * @brief Validate the runtime clocks match the expected values.
+ */
+void validate_system_clocks() {
+ #define CLOCK_ASSERT(expected, actual) \
+ if (expected != actual) { \
+ SERIAL_ECHOPGM( \
+ "Clock Mismatch for " #expected ": " \
+ "expected ", expected, \
+ ", got ", actual \
+ ); \
+ CORE_ASSERT_FAIL("Clock Mismatch: " #expected); \
+ }
+
+ update_system_clock_frequencies();
+
+ CLOCK_ASSERT(F_SYSTEM_CLOCK, SYSTEM_CLOCK_FREQUENCIES.system);
+ CLOCK_ASSERT(F_HCLK, SYSTEM_CLOCK_FREQUENCIES.hclk);
+ CLOCK_ASSERT(F_EXCLK, SYSTEM_CLOCK_FREQUENCIES.exclk);
+ CLOCK_ASSERT(F_PCLK0, SYSTEM_CLOCK_FREQUENCIES.pclk0);
+ CLOCK_ASSERT(F_PCLK1, SYSTEM_CLOCK_FREQUENCIES.pclk1);
+ CLOCK_ASSERT(F_PCLK2, SYSTEM_CLOCK_FREQUENCIES.pclk2);
+ CLOCK_ASSERT(F_PCLK3, SYSTEM_CLOCK_FREQUENCIES.pclk3);
+ CLOCK_ASSERT(F_PCLK4, SYSTEM_CLOCK_FREQUENCIES.pclk4);
+}
+
+/**
+ * @brief Configure HC32 system clocks.
+ *
+ * This function is called by the Arduino core early in the startup process, before setup() is called.
+ * It is used to configure the system clocks to the desired state.
+ *
+ * See https://github.com/MarlinFirmware/Marlin/pull/27099 for more information.
+ */
void core_hook_sysclock_init() {
// Set wait cycles, as we are about to switch to 200 MHz HCLK
sysclock_configure_flash_wait_cycles();
sysclock_configure_sram_wait_cycles();
- // Configure MPLLp to 200 MHz output, with different settings depending on XTAL availability
- #if BOARD_XTAL_FREQUENCY == 8000000 // 8 MHz XTAL
- // - M = 1 => 8 MHz / 1 = 8 MHz
- // - N = 50 => 8 MHz * 50 = 400 MHz
- // - P = 2 => 400 MHz / 2 = 200 MHz (sysclk)
- // - Q,R = 4 => 400 MHz / 4 = 100 MHz (dont care)
- stc_clk_mpll_cfg_t pllConf = {
- .PllpDiv = 2u, // P
- .PllqDiv = 4u, // Q
- .PllrDiv = 4u, // R
- .plln = 50u, // N
- .pllmDiv = 1u, // M
- };
- sysclock_configure_xtal();
- sysclock_configure_mpll(ClkPllSrcXTAL, &pllConf);
+ // Select MPLL input frequency based on clock availability
+ #if BOARD_XTAL_FREQUENCY == 8000000 || BOARD_XTAL_FREQUENCY == 16000000 // 8 MHz or 16 MHz XTAL
+ constexpr uint32_t mpll_input_clock = BOARD_XTAL_FREQUENCY;
- #elif BOARD_XTAL_FREQUENCY == 16000000 // 16 MHz XTAL
- // - M = 1 => 16 MHz / 1 = 16 MHz
- // - N = 50 => 16 MHz * 25 = 400 MHz
- // - P = 2 => 400 MHz / 2 = 200 MHz (sysclk)
- // - Q,R = 4 => 400 MHz / 4 = 100 MHz (dont care)
- stc_clk_mpll_cfg_t pllConf = {
- .PllpDiv = 2u, // P
- .PllqDiv = 4u, // Q
- .PllrDiv = 4u, // R
- .plln = 50u, // N
- .pllmDiv = 1u, // M
- };
sysclock_configure_xtal();
- sysclock_configure_mpll(ClkPllSrcXTAL, &pllConf);
- #warning "HC32F460 with 16 MHz XTAL has not been tested."
+ #if BOARD_XTAL_FREQUENCY == 16000000
+ #warning "HC32F460 with 16 MHz XTAL has not been tested."
+ #endif
#else // HRC (16 MHz)
- // - M = 1 => 16 MHz / 1 = 16 MHz
- // - N = 25 => 16 MHz * 25 = 400 MHz
- // - P = 2 => 400 MHz / 2 = 200 MHz (sysclk)
- // - Q,R = 4 => 400 MHz / 4 = 100 MHz (dont care)
- stc_clk_mpll_cfg_t pllConf = {
- .PllpDiv = 2u, // P
- .PllqDiv = 4u, // Q
- .PllrDiv = 4u, // R
- .plln = 25u, // N
- .pllmDiv = 1u, // M
- };
+
+ constexpr uint32_t mpll_input_clock = 16000000;
+
sysclock_configure_hrc();
- sysclock_configure_mpll(ClkPllSrcHRC, &pllConf);
// HRC could have been configured by ICG to 20 MHz
// TODO: handle gracefully if HRC is not 16 MHz
@@ -91,29 +171,56 @@ void core_hook_sysclock_init() {
panic("HRC is not 16 MHz");
}
- #ifdef BOARD_XTAL_FREQUENCY
+ #if defined(BOARD_XTAL_FREQUENCY)
#warning "No valid XTAL frequency defined, falling back to HRC."
#endif
+
#endif
- // sysclk is now configured according to F_CPU (i.e., 200MHz PLL output)
- const uint32_t sysclock = F_CPU;
+ // Automagically calculate MPLL configuration
+ constexpr stc_clk_mpll_cfg_t pllConf = get_mpll_config(mpll_input_clock, F_SYSTEM_CLOCK);
+ static_assert(pllConf.pllmDiv != 0 && pllConf.plln != 0 && pllConf.PllpDiv != 0, "MPLL auto-configuration failed");
+ sysclock_configure_mpll(ClkPllSrcXTAL, &pllConf);
- // 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)
+ // Setup clock divisors
constexpr stc_clk_sysclk_cfg_t sysClkConf = {
- .enHclkDiv = ClkSysclkDiv1, // HCLK = 200 MHz (CPU)
- .enExclkDiv = ClkSysclkDiv2, // EXCLK = 100 MHz (SDIO)
- .enPclk0Div = ClkSysclkDiv2, // PCLK0 = 100 MHz (Timer6 (not used))
- .enPclk1Div = ClkSysclkDiv4, // PCLK1 = 50 MHz (USART, SPI, I2S, Timer0 (step+temp), TimerA (Servo))
- .enPclk2Div = ClkSysclkDiv8, // PCLK2 = 25 MHz (ADC)
- .enPclk3Div = ClkSysclkDiv8, // PCLK3 = 25 MHz (I2C, WDT)
- .enPclk4Div = ClkSysclkDiv2, // PCLK4 = 100 MHz (ADC ctl)
+ .enHclkDiv = get_division_factor(),
+ .enExclkDiv = get_division_factor(),
+ .enPclk0Div = get_division_factor(),
+ .enPclk1Div = get_division_factor(),
+ .enPclk2Div = get_division_factor(),
+ .enPclk3Div = get_division_factor(),
+ .enPclk4Div = get_division_factor(),
};
+ sysclock_set_clock_dividers(&sysClkConf);
+ // Set power mode, before switch
+ power_mode_update_pre(F_SYSTEM_CLOCK);
+
+ // Switch to MPLL-P as system clock source
+ CLK_SetSysClkSource(CLKSysSrcMPLL);
+
+ // Set power mode, after switch
+ power_mode_update_post(F_SYSTEM_CLOCK);
+
+ // Verify clocks match expected values (at runtime)
+ #if ENABLED(MARLIN_DEV_MODE) || ENABLED(ALWAYS_VALIDATE_CLOCKS)
+ validate_system_clocks();
+ #endif
+
+ // Verify clock configuration (at compile time)
#if ARDUINO_CORE_VERSION_INT >= GET_VERSION_INT(1, 2, 0)
+ assert_mpll_config_valid<
+ mpll_input_clock,
+ pllConf.pllmDiv,
+ pllConf.plln,
+ pllConf.PllpDiv,
+ pllConf.PllqDiv,
+ pllConf.PllrDiv
+ >();
+
assert_system_clocks_valid<
- sysclock,
+ F_SYSTEM_CLOCK,
sysClkConf.enHclkDiv,
sysClkConf.enPclk0Div,
sysClkConf.enPclk1Div,
@@ -122,18 +229,14 @@ void core_hook_sysclock_init() {
sysClkConf.enPclk4Div,
sysClkConf.enExclkDiv
>();
+
+ static_assert(get_mpll_output_clock(
+ mpll_input_clock,
+ pllConf.pllmDiv,
+ pllConf.plln,
+ pllConf.PllpDiv
+ ) == F_SYSTEM_CLOCK, "actual MPLL output clock does not match F_SYSTEM_CLOCK");
#endif
-
- sysclock_set_clock_dividers(&sysClkConf);
-
- // Set power mode
- power_mode_update_pre(sysclock);
-
- // Switch to MPLL as sysclk source
- CLK_SetSysClkSource(CLKSysSrcMPLL);
-
- // Set power mode
- power_mode_update_post(sysclock);
}
#endif // ARDUINO_ARCH_HC32
diff --git a/firmware/Marlin/src/HAL/HC32/sysclock.h b/firmware/Marlin/src/HAL/HC32/sysclock.h
new file mode 100644
index 0000000..783d567
--- /dev/null
+++ b/firmware/Marlin/src/HAL/HC32/sysclock.h
@@ -0,0 +1,65 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+/**
+ * HC32F460 system clock configuration.
+ *
+ * With the HC32 HAL, the various peripheral clocks (including the CPU clock) are derived
+ * from the main PLL (MPLL-P) output (referred to at F_SYSTEM_CLOCK).
+ *
+ * F_SYSTEM_CLOCK is the target frequency of the main PLL, and the PLL is automatically configured
+ * to achieve this frequency.
+ *
+ * The peripheral clocks are the result of integer division of F_SYSTEM_CLOCK.
+ * Their target frequencies are defined here, and the required division factors are calculated automatically.
+ * Note that the division factor must be a power of 2 between 1 and 64.
+ * If the target frequency is not achievable, a compile-time error will be generated.
+ *
+ * Additionally, there are interdependencies between the peripheral clocks, which are described in
+ * Section 4.4 "Working Clock Specifications" of the HC32F460 Reference Manual.
+ * With Arduino core >= 1.2.0, these interdependencies are checked at compile time.
+ * On earlier versions, you are on your own.
+ *
+ * For all clock frequencies, they can be checked at runtime by enabling the 'ALWAYS_VALIDATE_CLOCKS' define.
+ * In MARLIN_DEV_MODE, they will also be printed to the serial console by 'MarlinHAL::HAL_clock_frequencies_dump'.
+ *
+ * See https://github.com/MarlinFirmware/Marlin/pull/27099 for more information.
+ */
+
+// Target peripheral clock frequencies, must be integer divisors of F_SYSTEM_CLOCK.
+// Changing the frequency here will automagically update everything else.
+#define F_HCLK 200000000UL // 200 MHz; CPU
+#define F_EXCLK (F_HCLK / 2) // 100 MHz; SDIO
+#define F_PCLK0 (F_HCLK / 2) // 100 MHz; Timer6 (unused)
+#define F_PCLK1 (F_HCLK / 4) // 50 MHz; USART, SPI, Timer0 (step + temp), TimerA (Servo)
+#define F_PCLK2 (F_HCLK / 8) // 25 MHz; ADC Sampling
+#define F_PCLK3 (F_HCLK / 8) // 25 MHz; I2C, WDT
+#define F_PCLK4 (F_HCLK / 2) // 100 MHz; ADC Control
+
+// MPLL-P clock target frequency. This must be >= the highest peripheral clock frequency.
+// PLL config is automatically calculated based on this value.
+#define F_SYSTEM_CLOCK F_HCLK
+
+// The Peripheral clocks are only checked at runtime if this is enabled OR MARLIN_DEV_MODE is enabled.
+// Compile time checks are always performed with Arduino core version >= 1.2.0.
+#define ALWAYS_VALIDATE_CLOCKS 1
diff --git a/firmware/Marlin/src/HAL/HC32/timers.h b/firmware/Marlin/src/HAL/HC32/timers.h
index f5a590d..c0014df 100644
--- a/firmware/Marlin/src/HAL/HC32/timers.h
+++ b/firmware/Marlin/src/HAL/HC32/timers.h
@@ -20,6 +20,7 @@
#pragma once
#include
#include
+#include "sysclock.h"
//
// Timer Types
@@ -42,17 +43,15 @@ extern Timer0 step_timer;
* 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'.
+ * system clock configured at runtime.
+ * Thus we use the 'F_PCLK1' constant defined in 'sysclock.h'.
*
- * If you face issues with this assumption, please double-check with the values
- * printed by 'MarlinHAL::HAL_clock_frequencies_dump'.
+ * See https://github.com/MarlinFirmware/Marlin/pull/27099 for more information.
*
- * TODO: If the 'constexpr' requirement is ever lifted, use TIMER0_BASE_FREQUENCY instead
+ * NOTE: If the 'constexpr' requirement is ever lifted, TIMER0_BASE_FREQUENCY could
+ * be used instead. Tho this would probably not make any noticable difference.
*/
-#define HAL_TIMER_RATE (F_CPU / 4) // i.e., 50MHz
-//#define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY
+#define HAL_TIMER_RATE F_PCLK1
// Temperature timer
#define TEMP_TIMER_NUM (&temp_timer)
diff --git a/firmware/Marlin/src/HAL/LINUX/include/pinmapping.h b/firmware/Marlin/src/HAL/LINUX/include/pinmapping.h
index b766f30..9147ef8 100644
--- a/firmware/Marlin/src/HAL/LINUX/include/pinmapping.h
+++ b/firmware/Marlin/src/HAL/LINUX/include/pinmapping.h
@@ -37,29 +37,29 @@ constexpr uint8_t NUM_ANALOG_INPUTS = 16;
constexpr uint8_t analog_offset = NUM_DIGITAL_PINS - NUM_ANALOG_INPUTS;
// Get the digital pin for an analog index
-constexpr pin_t analogInputToDigitalPin(const int8_t p) {
- return (WITHIN(p, 0, NUM_ANALOG_INPUTS) ? analog_offset + p : P_NC);
+constexpr pin_t analogInputToDigitalPin(const int8_t a) {
+ return (WITHIN(a, 0, NUM_ANALOG_INPUTS - 1) ? analog_offset + a : P_NC);
}
// Get the analog index for a digital pin
-constexpr int8_t digitalPinToAnalogIndex(const pin_t p) {
- return (WITHIN(p, analog_offset, NUM_DIGITAL_PINS) ? p - analog_offset : P_NC);
+constexpr int8_t digitalPinToAnalogIndex(const pin_t pin) {
+ return (WITHIN(pin, analog_offset, NUM_DIGITAL_PINS - 1) ? pin - analog_offset : P_NC);
}
// Return the index of a pin number
constexpr int16_t GET_PIN_MAP_INDEX(const pin_t pin) { return pin; }
// Test whether the pin is valid
-constexpr bool isValidPin(const pin_t p) { return WITHIN(p, 0, NUM_DIGITAL_PINS); }
+constexpr bool isValidPin(const pin_t pin) { return WITHIN(pin, 0, NUM_DIGITAL_PINS - 1); }
// Test whether the pin is PWM
-constexpr bool PWM_PIN(const pin_t p) { return false; }
+constexpr bool PWM_PIN(const pin_t) { return false; }
// Test whether the pin is interruptible
-constexpr bool INTERRUPT_PIN(const pin_t p) { return false; }
+constexpr bool INTERRUPT_PIN(const pin_t) { return false; }
// Get the pin number at the given index
-constexpr pin_t GET_PIN_MAP_PIN(const int16_t ind) { return ind; }
+constexpr pin_t GET_PIN_MAP_PIN(const int16_t index) { return pin_t(index); }
// Parse a G-code word into a pin index
int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
diff --git a/firmware/Marlin/src/HAL/LINUX/pinsDebug.h b/firmware/Marlin/src/HAL/LINUX/pinsDebug.h
index 59290df..aacb626 100644
--- a/firmware/Marlin/src/HAL/LINUX/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/LINUX/pinsDebug.h
@@ -19,26 +19,46 @@
* along with this program. If not, see .
*
*/
+#pragma once
/**
- * Support routines for X86_64
- */
-
-/**
- * Translation of routines & variables used by pinsDebug.h
+ * Pins Debugging for Linux Native
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
-#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0 ? 1 : 0)
-#define digitalRead_mod(p) digitalRead(p)
-#define getPinByIndex(p) pin_array[p].pin
-#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
+#define getPinByIndex(x) pin_array[x].pin
+
+#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
+
// active ADC function/mode/code values for PINSEL registers
-constexpr int8_t ADC_pin_mode(pin_t pin) { return -1; }
+constexpr int8_t ADC_pin_mode(const pin_t) { return -1; }
+
+// The pin and index are the same on this platform
+bool getPinIsDigitalByIndex(const pin_t pin) {
+ return (!isAnalogPin(pin) || get_pin_mode(pin) != ADC_pin_mode(pin));
+}
+
+#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0)
+
+#define digitalRead_mod(P) digitalRead(P)
int8_t get_pin_mode(const pin_t pin) { return isValidPin(pin) ? 0 : -1; }
@@ -50,11 +70,11 @@ bool getValidPinMode(const pin_t pin) {
return (Gpio::getMode(pin) != 0); // Input/output state
}
-bool getPinIsDigitalByIndex(const pin_t pin) {
- return (!isAnalogPin(pin) || get_pin_mode(pin) != ADC_pin_mode(pin));
-}
-
-void printPinPWM(const pin_t pin) {}
+void printPinPWM(const pin_t) {}
bool pwm_status(const pin_t) { return false; }
void printPinPort(const pin_t) {}
+
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0)
+
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
diff --git a/firmware/Marlin/src/HAL/LPC1768/HAL.h b/firmware/Marlin/src/HAL/LPC1768/HAL.h
index 55fffa9..6e0c9cf 100644
--- a/firmware/Marlin/src/HAL/LPC1768/HAL.h
+++ b/firmware/Marlin/src/HAL/LPC1768/HAL.h
@@ -82,13 +82,13 @@ extern DefaultSerial1 USBSerial;
#endif
#endif
-#ifdef MMU2_SERIAL_PORT
- #if MMU2_SERIAL_PORT == -1
- #define MMU2_SERIAL USBSerial
- #elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
- #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
+#ifdef MMU_SERIAL_PORT
+ #if MMU_SERIAL_PORT == -1
+ #define MMU_SERIAL USBSerial
+ #elif WITHIN(MMU_SERIAL_PORT, 0, 3)
+ #define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
#else
- #error "MMU2_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
+ #error "MMU_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#endif
#endif
diff --git a/firmware/Marlin/src/HAL/LPC1768/pinsDebug.h b/firmware/Marlin/src/HAL/LPC1768/pinsDebug.h
index a520874..5baeadd 100644
--- a/firmware/Marlin/src/HAL/LPC1768/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/LPC1768/pinsDebug.h
@@ -19,22 +19,35 @@
* along with this program. If not, see .
*
*/
+#pragma once
/**
- * Support routines for LPC1768
- */
-
-/**
- * Translation of routines & variables used by pinsDebug.h
+ * Pins Debugging for LPC1768/9
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
-#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0 ? 1 : 0)
-#define digitalRead_mod(p) extDigitalRead(p)
-#define getPinByIndex(p) pin_array[p].pin
+#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0)
+#define digitalRead_mod(P) extDigitalRead(P)
+#define getPinByIndex(x) pin_array[x].pin
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("P%d_%02d"), LPC176x::pin_port(p), LPC176x::pin_bit(p)); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR("_A%d "), LPC176x::pin_get_adc_channel(pin)); SERIAL_ECHO(buffer); }while(0)
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("P%d_%02d"), LPC176x::pin_port(P), LPC176x::pin_bit(P)); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR("_A%d "), LPC176x::pin_get_adc_channel(P)); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 17 // space needed to be pretty if not first name assigned to a pin
// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities
diff --git a/firmware/Marlin/src/HAL/LPC1768/upload_extra_script.py b/firmware/Marlin/src/HAL/LPC1768/upload_extra_script.py
old mode 100755
new mode 100644
index b788a2b..ce241c4
--- a/firmware/Marlin/src/HAL/LPC1768/upload_extra_script.py
+++ b/firmware/Marlin/src/HAL/LPC1768/upload_extra_script.py
@@ -37,7 +37,7 @@ if pioutil.is_pio_build():
#
# platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:'
# Windows - doesn't care about the disk's name, only cares about the drive letter
- import subprocess,string
+ import subprocess, string
from ctypes import windll
from pathlib import PureWindowsPath
diff --git a/firmware/Marlin/src/HAL/NATIVE_SIM/HAL.h b/firmware/Marlin/src/HAL/NATIVE_SIM/HAL.h
index f57e065..020299f 100644
--- a/firmware/Marlin/src/HAL/NATIVE_SIM/HAL.h
+++ b/firmware/Marlin/src/HAL/NATIVE_SIM/HAL.h
@@ -87,11 +87,11 @@ extern MSerialT serial_stream_3;
#endif
#endif
-#ifdef MMU2_SERIAL_PORT
- #if WITHIN(MMU2_SERIAL_PORT, 0, 3)
- #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
+#ifdef MMU_SERIAL_PORT
+ #if WITHIN(MMU_SERIAL_PORT, 0, 3)
+ #define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
#else
- #error "MMU2_SERIAL_PORT must be from 0 to 3. Please update your configuration."
+ #error "MMU_SERIAL_PORT must be from 0 to 3. Please update your configuration."
#endif
#endif
diff --git a/firmware/Marlin/src/HAL/NATIVE_SIM/pinsDebug.cpp b/firmware/Marlin/src/HAL/NATIVE_SIM/pinsDebug.cpp
index 6c74821..1354c79 100644
--- a/firmware/Marlin/src/HAL/NATIVE_SIM/pinsDebug.cpp
+++ b/firmware/Marlin/src/HAL/NATIVE_SIM/pinsDebug.cpp
@@ -25,7 +25,7 @@
#include "../../inc/MarlinConfig.h"
#include "pinsDebug.h"
-int8_t ADC_pin_mode(pin_t pin) { return -1; }
+int8_t ADC_pin_mode(const pin_t) { return -1; }
int8_t get_pin_mode(const pin_t pin) { return isValidPin(pin) ? 0 : -1; }
@@ -37,6 +37,7 @@ bool getValidPinMode(const pin_t pin) {
return (Gpio::getMode(pin) != 0); // Input/output state
}
+// The pin and index are the same on this platform
bool getPinIsDigitalByIndex(const pin_t pin) {
return !isAnalogPin(pin) || get_pin_mode(pin) != ADC_pin_mode(pin);
}
diff --git a/firmware/Marlin/src/HAL/NATIVE_SIM/pinsDebug.h b/firmware/Marlin/src/HAL/NATIVE_SIM/pinsDebug.h
index 8fea576..752802d 100644
--- a/firmware/Marlin/src/HAL/NATIVE_SIM/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/NATIVE_SIM/pinsDebug.h
@@ -19,30 +19,43 @@
* along with this program. If not, see .
*
*/
-
-/**
- * Support routines for X86_64
- */
#pragma once
/**
- * Translation of routines & variables used by pinsDebug.h
+ * Pins Debugging for x86_64
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
-#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0 ? 1 : 0)
-#define digitalRead_mod(p) digitalRead(p)
-#define getPinByIndex(p) pin_array[p].pin
+#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
+#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0)
+#define digitalRead_mod(P) digitalRead(P)
+#define getPinByIndex(x) pin_array[x].pin
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
// Active ADC function/mode/code values for PINSEL registers
-int8_t ADC_pin_mode(pin_t pin);
-int8_t get_pin_mode(const pin_t pin);
-bool getValidPinMode(const pin_t pin);
-bool getPinIsDigitalByIndex(const pin_t pin);
+int8_t ADC_pin_mode(const pin_t);
+int8_t get_pin_mode(const pin_t);
+bool getValidPinMode(const pin_t);
+bool getPinIsDigitalByIndex(const pin_t);
void printPinPort(const pin_t);
void printPinPWM(const pin_t);
bool pwm_status(const pin_t);
diff --git a/firmware/Marlin/src/HAL/RP2040/HAL.cpp b/firmware/Marlin/src/HAL/RP2040/HAL.cpp
new file mode 100644
index 0000000..d1af25a
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/HAL.cpp
@@ -0,0 +1,188 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "HAL.h"
+//#include "usb_serial.h"
+
+#include "../../inc/MarlinConfig.h"
+#include "../shared/Delay.h"
+
+extern "C" {
+ #include "pico/bootrom.h"
+ #include "hardware/watchdog.h"
+}
+
+#if HAS_SD_HOST_DRIVE
+ #include "msc_sd.h"
+ #include "usbd_cdc_if.h"
+#endif
+
+// ------------------------
+// Public Variables
+// ------------------------
+
+volatile uint16_t adc_result;
+
+// ------------------------
+// Public functions
+// ------------------------
+
+TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial());
+
+// HAL initialization task
+void MarlinHAL::init() {
+ // Ensure F_CPU is a constant expression.
+ // If the compiler breaks here, it means that delay code that should compute at compile time will not work.
+ // So better safe than sorry here.
+ constexpr int cpuFreq = F_CPU;
+ UNUSED(cpuFreq);
+
+ #undef SDSS
+ #define SDSS 2
+ #define PIN_EXISTS_(P1,P2) (defined(P1##P2) && P1##P2 >= 0)
+ #if HAS_MEDIA && DISABLED(SDIO_SUPPORT) && PIN_EXISTS_(SDSS,)
+ OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
+ #endif
+
+ #if PIN_EXISTS(LED)
+ OUT_WRITE(LED_PIN, LOW);
+ #endif
+
+ #if ENABLED(SRAM_EEPROM_EMULATION)
+ // __HAL_RCC_PWR_CLK_ENABLE();
+ // HAL_PWR_EnableBkUpAccess(); // Enable access to backup SRAM
+ // __HAL_RCC_BKPSRAM_CLK_ENABLE();
+ // LL_PWR_EnableBkUpRegulator(); // Enable backup regulator
+ // while (!LL_PWR_IsActiveFlag_BRR()); // Wait until backup regulator is initialized
+ #endif
+
+ HAL_timer_init();
+
+ #if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC
+ USB_Hook_init();
+ #endif
+
+ TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler
+
+ TERN_(HAS_SD_HOST_DRIVE, MSC_SD_init()); // Enable USB SD card access
+
+ #if PIN_EXISTS(USB_CONNECT)
+ OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
+ delay_ms(1000); // Give OS time to notice
+ WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
+ #endif
+}
+
+uint8_t MarlinHAL::get_reset_source() {
+ return watchdog_enable_caused_reboot() ? RST_WATCHDOG : 0;
+}
+
+void MarlinHAL::reboot() { watchdog_reboot(0, 0, 1); }
+
+// ------------------------
+// Watchdog Timer
+// ------------------------
+
+#if ENABLED(USE_WATCHDOG)
+
+ #define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
+
+ extern "C" {
+ #include "hardware/watchdog.h"
+ }
+
+ void MarlinHAL::watchdog_init() {
+ #if DISABLED(DISABLE_WATCHDOG_INIT)
+ static_assert(WDT_TIMEOUT_US > 1000, "WDT Timout is too small, aborting");
+ watchdog_enable(WDT_TIMEOUT_US/1000, true);
+ #endif
+ }
+
+ void MarlinHAL::watchdog_refresh() {
+ watchdog_update();
+ #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
+ TOGGLE(LED_PIN); // heartbeat indicator
+ #endif
+ }
+
+#endif
+
+// ------------------------
+// ADC
+// ------------------------
+
+volatile bool MarlinHAL::adc_has_result = false;
+
+void MarlinHAL::adc_init() {
+ analogReadResolution(HAL_ADC_RESOLUTION);
+ ::adc_init();
+ adc_fifo_setup(true, false, 1, false, false);
+ irq_set_exclusive_handler(ADC_IRQ_FIFO, adc_exclusive_handler);
+ irq_set_enabled(ADC_IRQ_FIFO, true);
+ adc_irq_set_enabled(true);
+}
+
+void MarlinHAL::adc_enable(const pin_t pin) {
+ if (pin >= A0 && pin <= A3)
+ adc_gpio_init(pin);
+ else if (pin == HAL_ADC_MCU_TEMP_DUMMY_PIN)
+ adc_set_temp_sensor_enabled(true);
+}
+
+void MarlinHAL::adc_start(const pin_t pin) {
+ adc_has_result = false;
+ // Select an ADC input. 0...3 are GPIOs 26...29 respectively.
+ adc_select_input(pin == HAL_ADC_MCU_TEMP_DUMMY_PIN ? 4 : pin - A0);
+ adc_run(true);
+}
+
+void MarlinHAL::adc_exclusive_handler() {
+ adc_run(false); // Disable since we only want one result
+ irq_clear(ADC_IRQ_FIFO); // Clear the IRQ
+
+ if (adc_fifo_get_level() >= 1) {
+ adc_result = adc_fifo_get(); // Pop the result
+ adc_fifo_drain();
+ adc_has_result = true; // Signal the end of the conversion
+ }
+}
+
+uint16_t MarlinHAL::adc_value() { return adc_result; }
+
+// Reset the system to initiate a firmware flash
+void flashFirmware(const int16_t) { hal.reboot(); }
+
+extern "C" {
+ void * _sbrk(int incr);
+ extern unsigned int __bss_end__; // end of bss section
+}
+
+// Return free memory between end of heap (or end bss) and whatever is current
+int freeMemory() {
+ int free_memory, heap_end = (int)_sbrk(0);
+ return (int)&free_memory - (heap_end ?: (int)&__bss_end__);
+}
+
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/HAL.h b/firmware/Marlin/src/HAL/RP2040/HAL.h
new file mode 100644
index 0000000..fa1a356
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/HAL.h
@@ -0,0 +1,250 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+#define CPU_32_BIT
+
+#ifndef F_CPU
+ #define F_CPU (XOSC_MHZ * 1000000UL)
+#endif
+
+#include "arduino_extras.h"
+#include "../../core/macros.h"
+#include "../shared/Marduino.h"
+#include "../shared/math_32bit.h"
+#include "../shared/HAL_SPI.h"
+#include "fastio.h"
+//#include "Servo.h"
+#include "watchdog.h"
+#include "MarlinSerial.h"
+
+#include "../../inc/MarlinConfigPre.h"
+
+#include
+
+// ------------------------
+// Serial ports
+// ------------------------
+
+#include "../../core/serial_hook.h"
+typedef ForwardSerial1Class< decltype(Serial) > DefaultSerial1;
+extern DefaultSerial1 MSerial0;
+
+#define _MSERIAL(X) MSerial##X
+#define MSERIAL(X) _MSERIAL(X)
+
+#if SERIAL_PORT == -1
+ #define MYSERIAL1 MSerial0
+#elif WITHIN(SERIAL_PORT, 0, 6)
+ #define MYSERIAL1 MSERIAL(SERIAL_PORT)
+#else
+ #error "SERIAL_PORT must be from 0 to 6. You can also use -1 if the board supports Native USB."
+#endif
+
+#ifdef SERIAL_PORT_2
+ #if SERIAL_PORT_2 == -1
+ #define MYSERIAL2 MSerial0
+ #elif WITHIN(SERIAL_PORT_2, 0, 6)
+ #define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
+ #else
+ #error "SERIAL_PORT_2 must be from 0 to 6. You can also use -1 if the board supports Native USB."
+ #endif
+#endif
+
+#ifdef SERIAL_PORT_3
+ #if SERIAL_PORT_3 == -1
+ #define MYSERIAL3 MSerial0
+ #elif WITHIN(SERIAL_PORT_3, 0, 6)
+ #define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
+ #else
+ #error "SERIAL_PORT_3 must be from 0 to 6. You can also use -1 if the board supports Native USB."
+ #endif
+#endif
+
+#ifdef MMU2_SERIAL_PORT
+ #if MMU2_SERIAL_PORT == -1
+ #define MMU2_SERIAL MSerial0
+ #elif WITHIN(MMU2_SERIAL_PORT, 0, 6)
+ #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
+ #else
+ #error "MMU2_SERIAL_PORT must be from 0 to 6. You can also use -1 if the board supports Native USB."
+ #endif
+#endif
+
+#ifdef LCD_SERIAL_PORT
+ #if LCD_SERIAL_PORT == -1
+ #define LCD_SERIAL MSerial0
+ #elif WITHIN(LCD_SERIAL_PORT, 0, 6)
+ #define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
+ #else
+ #error "LCD_SERIAL_PORT must be from 0 to 6. You can also use -1 if the board supports Native USB."
+ #endif
+ #if HAS_DGUS_LCD
+ #define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
+ #endif
+#endif
+
+// ------------------------
+// Defines
+// ------------------------
+
+/**
+ * TODO: review this to return 1 for pins that are not analog input
+ */
+#ifndef analogInputToDigitalPin
+ #define analogInputToDigitalPin(p) (p)
+#endif
+
+#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
+#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
+#define cli() __disable_irq()
+#define sei() __enable_irq()
+
+// ------------------------
+// Types
+// ------------------------
+
+template struct IFPIN { typedef R type; };
+template struct IFPIN { typedef L type; };
+typedef IFPIN::type pin_t;
+
+class libServo;
+typedef libServo hal_servo_t;
+#define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos()
+#define RESUME_SERVO_OUTPUT() libServo::resume_all_servos()
+
+// ------------------------
+// ADC
+// ------------------------
+
+#define HAL_ADC_VREF 3.3
+#ifdef ADC_RESOLUTION
+ #define HAL_ADC_RESOLUTION ADC_RESOLUTION
+#else
+ #define HAL_ADC_RESOLUTION 12
+#endif
+// ADC index 4 is the MCU temperature
+#define HAL_ADC_MCU_TEMP_DUMMY_PIN 127
+
+//
+// Pin Mapping for M42, M43, M226
+//
+#define GET_PIN_MAP_PIN(index) index
+#define GET_PIN_MAP_INDEX(pin) pin
+#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
+
+#ifndef PLATFORM_M997_SUPPORT
+ #define PLATFORM_M997_SUPPORT
+#endif
+void flashFirmware(const int16_t);
+
+// Maple Compatibility
+typedef void (*systickCallback_t)(void);
+void systick_attach_callback(systickCallback_t cb);
+void HAL_SYSTICK_Callback();
+
+extern volatile uint32_t systick_uptime_millis;
+
+#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
+#define PWM_FREQUENCY 1000 // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency()
+
+// ------------------------
+// Class Utilities
+// ------------------------
+
+int freeMemory();
+
+// ------------------------
+// MarlinHAL Class
+// ------------------------
+
+class MarlinHAL {
+public:
+
+ // Earliest possible init, before setup()
+ MarlinHAL() {}
+
+ // Watchdog
+ static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
+ static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {});
+
+ static void init(); // Called early in setup()
+ static void init_board() {} // Called less early in setup()
+ static void reboot(); // Restart the firmware from 0x0
+
+ // Interrupts
+ static bool isr_state() { return !__get_PRIMASK(); }
+ static void isr_on() { __enable_irq(); }
+ static void isr_off() { __disable_irq(); }
+
+ static void delay_ms(const int ms) { ::delay(ms); }
+
+ // Tasks, called from idle()
+ static void idletask() {}
+
+ // Reset
+ static uint8_t get_reset_source();
+ static void clear_reset_source() {}
+
+ // Free SRAM
+ static int freeMemory() { return ::freeMemory(); }
+
+ //
+ // ADC Methods
+ //
+
+ // Called by Temperature::init once at startup
+ static void adc_init();
+
+ // Called by Temperature::init for each sensor at startup
+ static void adc_enable(const pin_t pin);
+
+ // Begin ADC sampling on the given pin. Called from Temperature::isr!
+ static void adc_start(const pin_t pin);
+
+ // This ADC runs a periodic task
+ static void adc_exclusive_handler();
+
+ // Is the ADC ready for reading?
+ static volatile bool adc_has_result;
+ static bool adc_ready() { return adc_has_result; }
+
+ // The current value of the ADC register
+ static uint16_t adc_value();
+
+ /**
+ * Set the PWM duty cycle for the pin to the given value.
+ * Optionally invert the duty cycle [default = false]
+ * Optionally change the scale of the provided value to enable finer PWM duty control [default = 255]
+ */
+ static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);
+
+ /**
+ * Set the frequency of the timer for the given pin as close as
+ * possible to the provided desired frequency. Internally calculate
+ * the required waveform generation mode, prescaler, and resolution
+ * values and set timer registers accordingly.
+ * NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3B)
+ * NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST_PWM_FAN Settings)
+ */
+ static void set_pwm_frequency(const pin_t pin, const uint16_t f_desired);
+};
diff --git a/firmware/Marlin/src/HAL/RP2040/HAL_MinSerial.cpp b/firmware/Marlin/src/HAL/RP2040/HAL_MinSerial.cpp
new file mode 100644
index 0000000..5a65163
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/HAL_MinSerial.cpp
@@ -0,0 +1,69 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfigPre.h"
+
+#if ENABLED(POSTMORTEM_DEBUGGING)
+
+#include "../shared/HAL_MinSerial.h"
+
+
+static void TXBegin() {
+ #if !WITHIN(SERIAL_PORT, -1, 2)
+ #warning "Using POSTMORTEM_DEBUGGING requires a physical U(S)ART hardware in case of severe error."
+ #warning "Disabling the severe error reporting feature currently because the used serial port is not a HW port."
+ #else
+ #if SERIAL_PORT == -1
+ USBSerial.begin(BAUDRATE);
+ #elif SERIAL_PORT == 0
+ USBSerial.begin(BAUDRATE);
+ #elif SERIAL_PORT == 1
+ Serial1.begin(BAUDRATE);
+ #endif
+ #endif
+}
+
+static void TX(char b){
+ #if SERIAL_PORT == -1
+ USBSerial
+ #elif SERIAL_PORT == 0
+ USBSerial
+ #elif SERIAL_PORT == 1
+ Serial1
+ #endif
+ .write(b);
+}
+
+// A SW memory barrier, to ensure GCC does not overoptimize loops
+#define sw_barrier() __asm__ volatile("": : :"memory");
+
+
+void install_min_serial() {
+ HAL_min_serial_init = &TXBegin;
+ HAL_min_serial_out = &TX;
+}
+
+#endif // POSTMORTEM_DEBUGGING
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/HAL_SPI.cpp b/firmware/Marlin/src/HAL/RP2040/HAL_SPI.cpp
new file mode 100644
index 0000000..c88b6d1
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/HAL_SPI.cpp
@@ -0,0 +1,228 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfig.h"
+
+#include
+
+// ------------------------
+// Public Variables
+// ------------------------
+
+static SPISettings spiConfig;
+
+// ------------------------
+// Public functions
+// ------------------------
+
+#if ENABLED(SOFTWARE_SPI)
+
+ // ------------------------
+ // Software SPI
+ // ------------------------
+
+ #include "../shared/Delay.h"
+
+ void spiBegin(void) {
+ OUT_WRITE(SD_SS_PIN, HIGH);
+ OUT_WRITE(SD_SCK_PIN, HIGH);
+ SET_INPUT(SD_MISO_PIN);
+ OUT_WRITE(SD_MOSI_PIN, HIGH);
+ }
+
+ // Use function with compile-time value so we can actually reach the desired frequency
+ // Need to adjust this a little bit: on a 72MHz clock, we have 14ns/clock
+ // and we'll use ~3 cycles to jump to the method and going back, so it'll take ~40ns from the given clock here
+ #define CALLING_COST_NS (3U * 1000000000U) / (F_CPU)
+ void (*delaySPIFunc)();
+ void delaySPI_125() { DELAY_NS(125 - CALLING_COST_NS); }
+ void delaySPI_250() { DELAY_NS(250 - CALLING_COST_NS); }
+ void delaySPI_500() { DELAY_NS(500 - CALLING_COST_NS); }
+ void delaySPI_1000() { DELAY_NS(1000 - CALLING_COST_NS); }
+ void delaySPI_2000() { DELAY_NS(2000 - CALLING_COST_NS); }
+ void delaySPI_4000() { DELAY_NS(4000 - CALLING_COST_NS); }
+
+ void spiInit(uint8_t spiRate) {
+ // Use datarates Marlin uses
+ switch (spiRate) {
+ case SPI_FULL_SPEED: delaySPIFunc = &delaySPI_125; break; // desired: 8,000,000 actual: ~1.1M
+ case SPI_HALF_SPEED: delaySPIFunc = &delaySPI_125; break; // desired: 4,000,000 actual: ~1.1M
+ case SPI_QUARTER_SPEED:delaySPIFunc = &delaySPI_250; break; // desired: 2,000,000 actual: ~890K
+ case SPI_EIGHTH_SPEED: delaySPIFunc = &delaySPI_500; break; // desired: 1,000,000 actual: ~590K
+ case SPI_SPEED_5: delaySPIFunc = &delaySPI_1000; break; // desired: 500,000 actual: ~360K
+ case SPI_SPEED_6: delaySPIFunc = &delaySPI_2000; break; // desired: 250,000 actual: ~210K
+ default: delaySPIFunc = &delaySPI_4000; break; // desired: 125,000 actual: ~123K
+ }
+ SPI.begin();
+ }
+
+ // Begin SPI transaction, set clock, bit order, data mode
+ void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { /* do nothing */ }
+
+ uint8_t HAL_SPI_RP2040_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
+ for (uint8_t bits = 8; bits--;) {
+ WRITE(SD_SCK_PIN, LOW);
+ WRITE(SD_MOSI_PIN, b & 0x80);
+
+ delaySPIFunc();
+ WRITE(SD_SCK_PIN, HIGH);
+ delaySPIFunc();
+
+ b <<= 1; // little setup time
+ b |= (READ(SD_MISO_PIN) != 0);
+ }
+ DELAY_NS(125);
+ return b;
+ }
+
+ // Soft SPI receive byte
+ uint8_t spiRec() {
+ hal.isr_off(); // No interrupts during byte receive
+ const uint8_t data = HAL_SPI_RP2040_SpiTransfer_Mode_3(0xFF);
+ hal.isr_on(); // Enable interrupts
+ return data;
+ }
+
+ // Soft SPI read data
+ void spiRead(uint8_t *buf, uint16_t nbyte) {
+ for (uint16_t i = 0; i < nbyte; i++)
+ buf[i] = spiRec();
+ }
+
+ // Soft SPI send byte
+ void spiSend(uint8_t data) {
+ hal.isr_off(); // No interrupts during byte send
+ HAL_SPI_RP2040_SpiTransfer_Mode_3(data); // Don't care what is received
+ hal.isr_on(); // Enable interrupts
+ }
+
+ // Soft SPI send block
+ void spiSendBlock(uint8_t token, const uint8_t *buf) {
+ spiSend(token);
+ for (uint16_t i = 0; i < 512; i++)
+ spiSend(buf[i]);
+ }
+
+#else
+
+ // ------------------------
+ // Hardware SPI
+ // ------------------------
+
+ /**
+ * VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz
+ */
+
+ /**
+ * @brief Begin SPI port setup
+ *
+ * @return Nothing
+ *
+ * @details Only configures SS pin since stm32duino creates and initialize the SPI object
+ */
+ void spiBegin() {
+ #if PIN_EXISTS(SD_SS)
+ OUT_WRITE(SD_SS_PIN, HIGH);
+ #endif
+ }
+
+ // Configure SPI for specified SPI speed
+ void spiInit(uint8_t spiRate) {
+ // Use datarates Marlin uses
+ uint32_t clock;
+ switch (spiRate) {
+ case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000
+ case SPI_HALF_SPEED: clock = 5000000; break;
+ case SPI_QUARTER_SPEED: clock = 2500000; break;
+ case SPI_EIGHTH_SPEED: clock = 1250000; break;
+ case SPI_SPEED_5: clock = 625000; break;
+ case SPI_SPEED_6: clock = 300000; break;
+ default:
+ clock = 4000000; // Default from the SPI library
+ }
+ spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
+
+ //SPI.setMISO(SD_MISO_PIN); //todo: implement? bad interface
+ //SPI.setMOSI(SD_MOSI_PIN);
+ //SPI.setSCLK(SD_SCK_PIN);
+
+ SPI.begin();
+ }
+
+ /**
+ * @brief Receives a single byte from the SPI port.
+ *
+ * @return Byte received
+ *
+ * @details
+ */
+ uint8_t spiRec() {
+ uint8_t returnByte = SPI.transfer(0xFF);
+ return returnByte;
+ }
+
+ /**
+ * @brief Receive a number of bytes from the SPI port to a buffer
+ *
+ * @param buf Pointer to starting address of buffer to write to.
+ * @param nbyte Number of bytes to receive.
+ * @return Nothing
+ *
+ * @details Uses DMA
+ */
+ void spiRead(uint8_t *buf, uint16_t nbyte) {
+ if (nbyte == 0) return;
+ memset(buf, 0xFF, nbyte);
+ SPI.transfer(buf, nbyte);
+ }
+
+ /**
+ * @brief Send a single byte on SPI port
+ *
+ * @param b Byte to send
+ *
+ * @details
+ */
+ void spiSend(uint8_t b) {
+ SPI.transfer(b);
+ }
+
+ /**
+ * @brief Write token and then write from 512 byte buffer to SPI (for SD card)
+ *
+ * @param buf Pointer with buffer start address
+ * @return Nothing
+ *
+ * @details Use DMA
+ */
+ void spiSendBlock(uint8_t token, const uint8_t *buf) {
+ //uint8_t rxBuf[512];
+ //SPI.transfer(token);
+ SPI.transfer((uint8_t*)buf, 512); //implement? bad interface
+ }
+
+#endif // SOFTWARE_SPI
+
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/MarlinSerial.cpp b/firmware/Marlin/src/HAL/RP2040/MarlinSerial.cpp
new file mode 100644
index 0000000..dd01edd
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/MarlinSerial.cpp
@@ -0,0 +1,39 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfig.h"
+#include "MarlinSerial.h"
+
+#if ENABLED(EMERGENCY_PARSER)
+ #include "../../feature/e_parser.h"
+#endif
+
+#define _IMPLEMENT_SERIAL(X) DefaultSerial##X MSerial##X(false, Serial##X)
+#define IMPLEMENT_SERIAL(X) _IMPLEMENT_SERIAL(X)
+#if WITHIN(SERIAL_PORT, 0, 3)
+ IMPLEMENT_SERIAL(SERIAL_PORT);
+#endif
+
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/MarlinSerial.h b/firmware/Marlin/src/HAL/RP2040/MarlinSerial.h
new file mode 100644
index 0000000..c5924c9
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/MarlinSerial.h
@@ -0,0 +1,52 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+#include "../../inc/MarlinConfigPre.h"
+
+#if ENABLED(EMERGENCY_PARSER)
+ #include "../../feature/e_parser.h"
+#endif
+
+#include "../../core/serial_hook.h"
+
+#define Serial0 Serial
+#define _DECLARE_SERIAL(X) \
+ typedef ForwardSerial1Class DefaultSerial##X; \
+ extern DefaultSerial##X MSerial##X
+#define DECLARE_SERIAL(X) _DECLARE_SERIAL(X)
+
+typedef ForwardSerial1Class USBSerialType;
+extern USBSerialType USBSerial;
+
+#define _MSERIAL(X) MSerial##X
+#define MSERIAL(X) _MSERIAL(X)
+
+#if SERIAL_PORT == -1
+ // #define MYSERIAL1 USBSerial this is already done in the HAL
+#elif WITHIN(SERIAL_PORT, 0, 3)
+ #define MYSERIAL1 MSERIAL(SERIAL_PORT)
+ DECLARE_SERIAL(SERIAL_PORT);
+#else
+ #error "SERIAL_PORT must be from 0 to 3, or -1 for Native USB."
+#endif
+
diff --git a/firmware/Marlin/src/HAL/RP2040/README.md b/firmware/Marlin/src/HAL/RP2040/README.md
new file mode 100644
index 0000000..4f9f70b
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/README.md
@@ -0,0 +1 @@
+# RP2040 Hardware Interface
diff --git a/firmware/Marlin/src/HAL/RP2040/Servo.cpp b/firmware/Marlin/src/HAL/RP2040/Servo.cpp
new file mode 100644
index 0000000..2b1b2a1
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/Servo.cpp
@@ -0,0 +1,93 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfig.h"
+
+#if HAS_SERVOS
+
+#include "Servo.h"
+
+static uint_fast8_t servoCount = 0;
+static libServo *servos[NUM_SERVOS] = {0};
+constexpr millis_t servoDelay[] = SERVO_DELAY;
+static_assert(COUNT(servoDelay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
+
+libServo::libServo()
+: delay(servoDelay[servoCount]),
+ was_attached_before_pause(false),
+ value_before_pause(0)
+{
+ servos[servoCount++] = this;
+}
+
+int8_t libServo::attach(const int pin) {
+ if (servoCount >= MAX_SERVOS) return -1;
+ if (pin > 0) servo_pin = pin;
+ auto result = pico_servo.attach(servo_pin);
+ return result;
+}
+
+int8_t libServo::attach(const int pin, const int min, const int max) {
+ if (servoCount >= MAX_SERVOS) return -1;
+ if (pin > 0) servo_pin = pin;
+ auto result = pico_servo.attach(servo_pin, min, max);
+ return result;
+}
+
+void libServo::move(const int value) {
+ if (attach(0) >= 0) {
+ pico_servo.write(value);
+ safe_delay(delay);
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
+ }
+}
+
+void libServo::pause() {
+ was_attached_before_pause = pico_servo.attached();
+ if (was_attached_before_pause) {
+ value_before_pause = pico_servo.read();
+ pico_servo.detach();
+ }
+}
+
+void libServo::resume() {
+ if (was_attached_before_pause) {
+ attach();
+ move(value_before_pause);
+ }
+}
+
+void libServo::pause_all_servos() {
+ for (auto& servo : servos)
+ if (servo) servo->pause();
+}
+
+void libServo::resume_all_servos() {
+ for (auto& servo : servos)
+ if (servo) servo->resume();
+}
+
+#endif // HAS_SERVOS
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/Servo.h b/firmware/Marlin/src/HAL/RP2040/Servo.h
new file mode 100644
index 0000000..031610f
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/Servo.h
@@ -0,0 +1,77 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+#include
+
+#if 1
+
+#include "../../core/millis_t.h"
+
+// Inherit and expand on the official library
+class libServo {
+ public:
+ libServo();
+ int8_t attach(const int pin = 0); // pin == 0 uses value from previous call
+ int8_t attach(const int pin, const int min, const int max);
+ void detach() { pico_servo.detach(); }
+ int read() { return pico_servo.read(); }
+ void move(const int value);
+
+ void pause();
+ void resume();
+
+ static void pause_all_servos();
+ static void resume_all_servos();
+ static void setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority);
+
+ private:
+ Servo pico_servo;
+
+ int servo_pin = 0;
+ millis_t delay = 0;
+
+ bool was_attached_before_pause;
+ int value_before_pause;
+};
+
+#else
+
+class libServo: public Servo {
+ public:
+ void move(const int value) {
+ constexpr uint16_t servo_delay[] = SERVO_DELAY;
+ static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
+
+ if (attach(servo_info[servoIndex].Pin.nbr) >= 0) { // try to reattach
+ write(value);
+ safe_delay(servo_delay[servoIndex]); // delay to allow servo to reach position
+ TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
+ }
+
+ }
+};
+
+class libServo;
+typedef libServo hal_servo_t;
+
+#endif
diff --git a/firmware/Marlin/src/HAL/RP2040/arduino_extras.cpp b/firmware/Marlin/src/HAL/RP2040/arduino_extras.cpp
new file mode 100644
index 0000000..cdc0a0a
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/arduino_extras.cpp
@@ -0,0 +1,33 @@
+/**
+ * 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 .
+ *
+ */
+#ifdef __PLAT_RP2040__
+
+#include
+
+char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) {
+ char format_string[20];
+ snprintf(format_string, 20, "%%%d.%df", __width, __prec);
+ sprintf(__s, format_string, __val);
+ return __s;
+}
+
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/arduino_extras.h b/firmware/Marlin/src/HAL/RP2040/arduino_extras.h
new file mode 100644
index 0000000..9794140
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/arduino_extras.h
@@ -0,0 +1,29 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+// #include
+// #include
+// #include
+// #include
+
+char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s);
diff --git a/firmware/Marlin/src/HAL/RP2040/docs/rp2040-datasheet.pdf b/firmware/Marlin/src/HAL/RP2040/docs/rp2040-datasheet.pdf
new file mode 100644
index 0000000..4c5c9db
Binary files /dev/null and b/firmware/Marlin/src/HAL/RP2040/docs/rp2040-datasheet.pdf differ
diff --git a/firmware/Marlin/src/HAL/RP2040/eeprom_flash.cpp b/firmware/Marlin/src/HAL/RP2040/eeprom_flash.cpp
new file mode 100644
index 0000000..5b1131e
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/eeprom_flash.cpp
@@ -0,0 +1,88 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfig.h"
+
+#if ENABLED(FLASH_EEPROM_EMULATION)
+
+#include "../shared/eeprom_api.h"
+
+// NOTE: The Bigtreetech SKR Pico has an onboard W25Q16 flash module
+
+// Use EEPROM.h for compatibility, for now.
+#include
+
+static bool eeprom_data_written = false;
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_start() {
+ EEPROM.begin(); // Avoid EEPROM.h warning (do nothing)
+ eeprom_buffer_fill();
+ return true;
+}
+
+bool PersistentStore::access_finish() {
+ if (eeprom_data_written) {
+ TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT());
+ hal.isr_off();
+ eeprom_buffer_flush();
+ hal.isr_on();
+ TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());
+ eeprom_data_written = false;
+ }
+ return true;
+}
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ while (size--) {
+ uint8_t v = *value;
+ if (v != eeprom_buffered_read_byte(pos)) {
+ eeprom_buffered_write_byte(pos, v);
+ eeprom_data_written = true;
+ }
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ do {
+ const uint8_t c = eeprom_buffered_read_byte(pos);
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ } while (--size);
+ return false;
+}
+
+#endif // FLASH_EEPROM_EMULATION
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/eeprom_wired.cpp b/firmware/Marlin/src/HAL/RP2040/eeprom_wired.cpp
new file mode 100644
index 0000000..974f6f8
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/eeprom_wired.cpp
@@ -0,0 +1,79 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfig.h"
+
+#if USE_WIRED_EEPROM
+
+/**
+ * PersistentStore for Arduino-style EEPROM interface
+ * with simple implementations supplied by Marlin.
+ */
+
+#include "../shared/eeprom_if.h"
+#include "../shared/eeprom_api.h"
+
+#ifndef MARLIN_EEPROM_SIZE
+ #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
+#endif
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+
+bool PersistentStore::access_start() { eeprom_init(); return true; }
+bool PersistentStore::access_finish() { return true; }
+
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
+ uint16_t written = 0;
+ while (size--) {
+ uint8_t v = *value;
+ uint8_t * const p = (uint8_t * const)pos;
+ if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
+ eeprom_write_byte(p, v);
+ if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
+ if (eeprom_read_byte(p) != v) {
+ SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
+ return true;
+ }
+ }
+ crc16(crc, &v, 1);
+ pos++;
+ value++;
+ }
+ return false;
+}
+
+bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ do {
+ // Read from either external EEPROM, program flash or Backup SRAM
+ const uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ if (writing) *value = c;
+ crc16(crc, &c, 1);
+ pos++;
+ value++;
+ } while (--size);
+ return false;
+}
+
+#endif // USE_WIRED_EEPROM
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/endstop_interrupts.h b/firmware/Marlin/src/HAL/RP2040/endstop_interrupts.h
new file mode 100644
index 0000000..af53840
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/endstop_interrupts.h
@@ -0,0 +1,60 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+#include "../../module/endstops.h"
+
+// One ISR for all EXT-Interrupts
+void endstop_ISR() { endstops.update(); }
+
+void setup_endstop_interrupts() {
+ #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
+ TERN_(USE_X_MAX, _ATTACH(X_MAX_PIN));
+ TERN_(USE_X_MIN, _ATTACH(X_MIN_PIN));
+ TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
+ TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
+ TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
+ TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN));
+ TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
+ TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
+ TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));
+ TERN_(USE_Y2_MIN, _ATTACH(Y2_MIN_PIN));
+ TERN_(USE_Z2_MAX, _ATTACH(Z2_MAX_PIN));
+ TERN_(USE_Z2_MIN, _ATTACH(Z2_MIN_PIN));
+ TERN_(USE_Z3_MAX, _ATTACH(Z3_MAX_PIN));
+ TERN_(USE_Z3_MIN, _ATTACH(Z3_MIN_PIN));
+ TERN_(USE_Z4_MAX, _ATTACH(Z4_MAX_PIN));
+ TERN_(USE_Z4_MIN, _ATTACH(Z4_MIN_PIN));
+ TERN_(USE_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
+ TERN_(USE_I_MAX, _ATTACH(I_MAX_PIN));
+ TERN_(USE_I_MIN, _ATTACH(I_MIN_PIN));
+ TERN_(USE_J_MAX, _ATTACH(J_MAX_PIN));
+ TERN_(USE_J_MIN, _ATTACH(J_MIN_PIN));
+ TERN_(USE_K_MAX, _ATTACH(K_MAX_PIN));
+ TERN_(USE_K_MIN, _ATTACH(K_MIN_PIN));
+ TERN_(USE_U_MAX, _ATTACH(U_MAX_PIN));
+ TERN_(USE_U_MIN, _ATTACH(U_MIN_PIN));
+ TERN_(USE_V_MAX, _ATTACH(V_MAX_PIN));
+ TERN_(USE_V_MIN, _ATTACH(V_MIN_PIN));
+ TERN_(USE_W_MAX, _ATTACH(W_MAX_PIN));
+ TERN_(USE_W_MIN, _ATTACH(W_MIN_PIN));
+}
diff --git a/firmware/Marlin/src/HAL/RP2040/fast_pwm.cpp b/firmware/Marlin/src/HAL/RP2040/fast_pwm.cpp
new file mode 100644
index 0000000..1349a1d
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/fast_pwm.cpp
@@ -0,0 +1,43 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfigPre.h"
+
+#include "HAL.h"
+#include "pinDefinitions.h"
+
+void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
+ analogWrite(pin, v);
+}
+
+void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
+ mbed::PwmOut* pwm = digitalPinToPwm(pin);
+ if (pwm != NULL) delete pwm;
+ pwm = new mbed::PwmOut(digitalPinToPinName(pin));
+ digitalPinToPwm(pin) = pwm;
+ pwm->period_ms(1000 / f_desired);
+}
+
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/fastio.cpp b/firmware/Marlin/src/HAL/RP2040/fastio.cpp
new file mode 100644
index 0000000..fa77106
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/fastio.cpp
@@ -0,0 +1,32 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfig.h"
+
+void FastIO_init() {
+
+}
+
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/fastio.h b/firmware/Marlin/src/HAL/RP2040/fastio.h
new file mode 100644
index 0000000..e84d2e7
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/fastio.h
@@ -0,0 +1,87 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+/**
+ * Fast I/O interfaces for RP2040
+ * These use GPIO register access for fast port manipulation.
+ */
+
+// ------------------------
+// Public Variables
+// ------------------------
+
+
+// ------------------------
+// Public functions
+// ------------------------
+
+void FastIO_init(); // Must be called before using fast io macros
+#define FASTIO_INIT() FastIO_init()
+
+// ------------------------
+// Defines
+// ------------------------
+
+#define _BV32(b) (1UL << (b))
+
+#ifndef PWM
+ #define PWM OUTPUT
+#endif
+
+#define _WRITE(IO, V) digitalWrite((IO), (V))
+
+#define _READ(IO) digitalRead(IO)
+#define _TOGGLE(IO) digitalWrite(IO, !digitalRead(IO))
+
+#define _GET_MODE(IO)
+#define _SET_MODE(IO,M) pinMode(IO, M)
+#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) //!< Output Push Pull Mode & GPIO_NOPULL
+#define _SET_OUTPUT_OD(IO) pinMode(IO, OUTPUT_OPEN_DRAIN)
+
+#define WRITE(IO,V) _WRITE(IO,V)
+#define READ(IO) _READ(IO)
+#define TOGGLE(IO) _TOGGLE(IO)
+
+#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
+#define OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0)
+
+#define SET_INPUT(IO) _SET_MODE(IO, INPUT) //!< Input Floating Mode
+#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) //!< Input with Pull-up activation
+#define SET_INPUT_PULLDOWN(IO) _SET_MODE(IO, INPUT_PULLDOWN) //!< Input with Pull-down activation
+#define SET_OUTPUT(IO) OUT_WRITE(IO, LOW)
+#define SET_PWM(IO) _SET_MODE(IO, PWM)
+
+#define IS_INPUT(IO)
+#define IS_OUTPUT(IO)
+
+#define PWM_PIN(P) true //digitalPinHasPWM(P)
+#define NO_COMPILE_TIME_PWM
+
+// digitalRead/Write wrappers
+#define extDigitalRead(IO) digitalRead(IO)
+#define extDigitalWrite(IO,V) digitalWrite(IO,V)
+
+#undef I2C_SDA
+#define I2C_SDA_PIN PIN_WIRE_SDA
+#undef I2C_SCL
+#define I2C_SCL_PIN PIN_WIRE_SCL
diff --git a/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_LCD.h b/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_LCD.h
new file mode 100644
index 0000000..82f95a1
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_LCD.h
@@ -0,0 +1,22 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
diff --git a/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_adv.h b/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_adv.h
new file mode 100644
index 0000000..442639e
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_adv.h
@@ -0,0 +1,35 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+#if ALL(SDSUPPORT, USBD_USE_CDC_MSC) && DISABLED(NO_SD_HOST_DRIVE)
+ #define HAS_SD_HOST_DRIVE 1
+#endif
+
+// Fix F_CPU not being a compile-time constant in RP2040 framework
+#ifdef BOARD_F_CPU
+ #undef F_CPU
+ #define F_CPU BOARD_F_CPU
+#endif
+
+// The Sensitive Pins array is not optimizable
+#define RUNTIME_ONLY_ANALOG_TO_DIGITAL
diff --git a/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_post.h b/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_post.h
new file mode 100644
index 0000000..ef7853b
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_post.h
@@ -0,0 +1,29 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+// If no real or emulated EEPROM selected, fall back to SD emulation
+#if USE_FALLBACK_EEPROM
+ #define SDCARD_EEPROM_EMULATION
+#elif ANY(I2C_EEPROM, SPI_EEPROM)
+ #define USE_SHARED_EEPROM 1
+#endif
diff --git a/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_type.h b/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_type.h
new file mode 100644
index 0000000..82f95a1
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
diff --git a/firmware/Marlin/src/HAL/RP2040/inc/SanityCheck.h b/firmware/Marlin/src/HAL/RP2040/inc/SanityCheck.h
new file mode 100644
index 0000000..29175f8
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/inc/SanityCheck.h
@@ -0,0 +1,60 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+/**
+ * Test RP2040-specific configuration values for errors at compile-time.
+ */
+//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
+// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
+//#endif
+
+#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
+ #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
+ #if USE_FALLBACK_EEPROM
+ #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION."
+ #endif
+ #error "SDCARD_EEPROM_EMULATION requires SDSUPPORT. Enable SDSUPPORT or choose another EEPROM emulation."
+#endif
+
+#if ENABLED(SRAM_EEPROM_EMULATION)
+ #error "SRAM_EEPROM_EMULATION is not supported for RP2040."
+#endif
+
+#if ALL(PRINTCOUNTER, FLASH_EEPROM_EMULATION)
+ #warning "FLASH_EEPROM_EMULATION may cause long delays when writing and should not be used while printing."
+ #error "Disable PRINTCOUNTER or choose another EEPROM emulation."
+#endif
+
+#if ENABLED(FLASH_EEPROM_LEVELING)
+ #error "FLASH_EEPROM_LEVELING is not supported for RP2040."
+#endif
+
+#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
+ #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on RP2040."
+#elif ENABLED(SERIAL_STATS_DROPPED_RX)
+ #error "SERIAL_STATS_DROPPED_RX is not supported on RP2040."
+#endif
+
+#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI)
+ #error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_UI are not supported for RP2040."
+#endif
diff --git a/firmware/Marlin/src/HAL/RP2040/msc_sd.cpp b/firmware/Marlin/src/HAL/RP2040/msc_sd.cpp
new file mode 100644
index 0000000..bc945c1
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/msc_sd.cpp
@@ -0,0 +1,136 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfigPre.h"
+
+#if HAS_SD_HOST_DRIVE
+
+#include "../shared/Marduino.h"
+#include "msc_sd.h"
+#include "usbd_core.h"
+
+#include "../../sd/cardreader.h"
+
+#include
+#include
+
+#define BLOCK_SIZE 512
+#define PRODUCT_ID 0x29
+
+class Sd2CardUSBMscHandler : public USBMscHandler {
+public:
+ DiskIODriver* diskIODriver() {
+ #if ENABLED(MULTI_VOLUME)
+ #if SHARED_VOLUME_IS(SD_ONBOARD)
+ return &card.media_driver_sdcard;
+ #elif SHARED_VOLUME_IS(USB_FLASH_DRIVE)
+ return &card.media_driver_usbFlash;
+ #endif
+ #else
+ return card.diskIODriver();
+ #endif
+ }
+
+ bool GetCapacity(uint32_t *pBlockNum, uint16_t *pBlockSize) {
+ *pBlockNum = diskIODriver()->cardSize();
+ *pBlockSize = BLOCK_SIZE;
+ return true;
+ }
+
+ bool Write(uint8_t *pBuf, uint32_t blkAddr, uint16_t blkLen) {
+ auto sd2card = diskIODriver();
+ // single block
+ if (blkLen == 1) {
+ watchdog_refresh();
+ sd2card->writeBlock(blkAddr, pBuf);
+ return true;
+ }
+
+ // multi block optimization
+ sd2card->writeStart(blkAddr, blkLen);
+ while (blkLen--) {
+ watchdog_refresh();
+ sd2card->writeData(pBuf);
+ pBuf += BLOCK_SIZE;
+ }
+ sd2card->writeStop();
+ return true;
+ }
+
+ bool Read(uint8_t *pBuf, uint32_t blkAddr, uint16_t blkLen) {
+ auto sd2card = diskIODriver();
+ // single block
+ if (blkLen == 1) {
+ watchdog_refresh();
+ sd2card->readBlock(blkAddr, pBuf);
+ return true;
+ }
+
+ // multi block optimization
+ sd2card->readStart(blkAddr);
+ while (blkLen--) {
+ watchdog_refresh();
+ sd2card->readData(pBuf);
+ pBuf += BLOCK_SIZE;
+ }
+ sd2card->readStop();
+ return true;
+ }
+
+ bool IsReady() {
+ return diskIODriver()->isReady();
+ }
+};
+
+Sd2CardUSBMscHandler usbMscHandler;
+
+/* USB Mass storage Standard Inquiry Data */
+uint8_t Marlin_STORAGE_Inquirydata[] = { /* 36 */
+ /* LUN 0 */
+ 0x00,
+ 0x80,
+ 0x02,
+ 0x02,
+ (STANDARD_INQUIRY_DATA_LEN - 5),
+ 0x00,
+ 0x00,
+ 0x00,
+ 'M', 'A', 'R', 'L', 'I', 'N', ' ', ' ', /* Manufacturer : 8 bytes */
+ 'P', 'r', 'o', 'd', 'u', 'c', 't', ' ', /* Product : 16 Bytes */
+ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
+ '0', '.', '0', '1', /* Version : 4 Bytes */
+};
+
+USBMscHandler *pSingleMscHandler = &usbMscHandler;
+
+void MSC_SD_init() {
+ USBDevice.end();
+ delay(200);
+ USBDevice.registerMscHandlers(1, &pSingleMscHandler, Marlin_STORAGE_Inquirydata);
+ USBDevice.begin();
+}
+
+#endif // HAS_SD_HOST_DRIVE
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/msc_sd.h b/firmware/Marlin/src/HAL/RP2040/msc_sd.h
new file mode 100644
index 0000000..1c13f55
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/msc_sd.h
@@ -0,0 +1,24 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+void MSC_SD_init();
diff --git a/firmware/Marlin/src/HAL/RP2040/pinsDebug.h b/firmware/Marlin/src/HAL/RP2040/pinsDebug.h
new file mode 100644
index 0000000..964fb71
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/pinsDebug.h
@@ -0,0 +1,146 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+#include
+#include "HAL.h"
+
+#ifndef NUM_DIGITAL_PINS
+ #error "Expected NUM_DIGITAL_PINS not found"
+#endif
+
+/**
+ * Life gets complicated if you want an easy to use 'M43 I' output (in port/pin order)
+ * because the variants in this platform do not always define all the I/O port/pins
+ * that a CPU has.
+ *
+ * VARIABLES:
+ * Ard_num - Arduino pin number - defined by the platform. It is used by digitalRead and
+ * digitalWrite commands and by M42.
+ * - does not contain port/pin info
+ * - is not in port/pin order
+ * - typically a variant will only assign Ard_num to port/pins that are actually used
+ * Index - M43 counter - only used to get Ard_num
+ * x - a parameter/argument used to search the pin_array to try to find a signal name
+ * associated with a Ard_num
+ * Port_pin - port number and pin number for use with CPU registers and printing reports
+ *
+ * Since M43 uses digitalRead and digitalWrite commands, only the Port_pins with an Ard_num
+ * are accessed and/or displayed.
+ *
+ * Three arrays are used.
+ *
+ * digitalPin[] is provided by the platform. It consists of the Port_pin numbers in
+ * Arduino pin number order.
+ *
+ * pin_array is a structure generated by the pins/pinsDebug.h header file. It is generated by
+ * the preprocessor. Only the signals associated with enabled options are in this table.
+ * It contains:
+ * - name of the signal
+ * - the Ard_num assigned by the pins_YOUR_BOARD.h file using the platform defines.
+ * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as the
+ * argument to digitalPinToPinName(IO) to get the Port_pin number
+ * - if it is a digital or analog signal. PWMs are considered digital here.
+ *
+ * pin_xref is a structure generated by this header file. It is generated by the
+ * preprocessor. It is in port/pin order. It contains just the port/pin numbers defined by the
+ * platform for this variant.
+ * - Ard_num
+ * - printable version of Port_pin
+ *
+ * Routines with an "x" as a parameter/argument are used to search the pin_array to try to
+ * find a signal name associated with a port/pin.
+ *
+ * NOTE - the Arduino pin number is what is used by the M42 command, NOT the port/pin for that
+ * signal. The Arduino pin number is listed by the M43 I command.
+ */
+
+#define NUM_ANALOG_FIRST A0
+
+#define MODE_PIN_INPUT 0 // Input mode (reset state)
+#define MODE_PIN_OUTPUT 1 // General purpose output mode
+#define MODE_PIN_ALT 2 // Alternate function mode
+#define MODE_PIN_ANALOG 3 // Analog mode
+
+#define PIN_NUM(P) (P & 0x000F)
+#define PIN_NUM_ALPHA_LEFT(P) (((P & 0x000F) < 10) ? ('0' + (P & 0x000F)) : '1')
+#define PIN_NUM_ALPHA_RIGHT(P) (((P & 0x000F) > 9) ? ('0' + (P & 0x000F) - 10) : 0 )
+#define PORT_NUM(P) ((P >> 4) & 0x0007)
+#define PORT_ALPHA(P) ('A' + (P >> 4))
+
+/**
+ * Translation of routines & variables used by pinsDebug.h
+ */
+#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
+#define VALID_PIN(ANUM) (pin_t(ANUM) >= 0 && pin_t(ANUM) < NUMBER_PINS_TOTAL)
+#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads
+#define PRINT_PIN(Q)
+#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
+#define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine
+
+// x is a variable used to search pin_array
+#define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital)
+#define GET_ARRAY_PIN(x) ((pin_t) pin_array[x].pin)
+#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
+#define MULTI_NAME_PAD 33 // space needed to be pretty if not first name assigned to a pin
+
+uint8_t get_pin_mode(const pin_t Ard_num) {
+
+ uint dir = gpio_get_dir( Ard_num);
+
+ if(dir) return MODE_PIN_OUTPUT;
+ else return MODE_PIN_INPUT;
+
+}
+
+bool getValidPinMode(const pin_t Ard_num) {
+ const uint8_t pin_mode = get_pin_mode(Ard_num);
+ return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM
+}
+
+int8_t digital_pin_to_analog_pin(pin_t Ard_num) {
+ Ard_num -= NUM_ANALOG_FIRST;
+ return (Ard_num >= 0 && Ard_num < NUM_ANALOG_INPUTS) ? Ard_num : -1;
+}
+
+bool isAnalogPin(const pin_t Ard_num) {
+ return digital_pin_to_analog_pin(Ard_num) != -1;
+}
+
+bool is_digital(const pin_t x) {
+ const uint8_t pin_mode = get_pin_mode(x);
+ return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT;
+}
+
+void printPinPort(const pin_t Ard_num) {
+ SERIAL_ECHOPGM("Pin: ");
+ SERIAL_ECHO(Ard_num);
+}
+
+bool pwm_status(const pin_t Ard_num) {
+ return get_pin_mode(Ard_num) == MODE_PIN_ALT;
+}
+
+void printPinPWM(const pin_t Ard_num) {
+ if (PWM_PIN(Ard_num)) {
+ }
+}
diff --git a/firmware/Marlin/src/HAL/RP2040/spi_pins.h b/firmware/Marlin/src/HAL/RP2040/spi_pins.h
new file mode 100644
index 0000000..e6ee840
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/spi_pins.h
@@ -0,0 +1,38 @@
+/**
+ * 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 .
+ *
+ */
+#pragma once
+
+/**
+ * Define SPI Pins: SCK, MISO, MOSI, SS
+ */
+#ifndef SD_SCK_PIN
+ #define SD_SCK_PIN PIN_SPI_SCK
+#endif
+#ifndef SD_MISO_PIN
+ #define SD_MISO_PIN PIN_SPI_MISO
+#endif
+#ifndef SD_MOSI_PIN
+ #define SD_MOSI_PIN PIN_SPI_MOSI
+#endif
+#ifndef SD_SS_PIN
+ #define SD_SS_PIN PIN_SPI_SS
+#endif
diff --git a/firmware/Marlin/src/HAL/RP2040/timers.cpp b/firmware/Marlin/src/HAL/RP2040/timers.cpp
new file mode 100644
index 0000000..88d5af2
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/timers.cpp
@@ -0,0 +1,126 @@
+/**
+ * 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 .
+ *
+ */
+#include "../platforms.h"
+
+#ifdef __PLAT_RP2040__
+
+#include "../../inc/MarlinConfig.h"
+
+alarm_pool_t* HAL_timer_pool_0;
+alarm_pool_t* HAL_timer_pool_1;
+alarm_pool_t* HAL_timer_pool_2;
+alarm_pool_t* HAL_timer_pool_3;
+
+struct repeating_timer HAL_timer_0;
+struct repeating_timer HAL_timer_1;
+struct repeating_timer HAL_timer_2;
+struct repeating_timer HAL_timer_3;
+
+volatile bool HAL_timer_irq_en[4] = { false, false, false, false };
+
+void HAL_timer_init() {
+ //reserve all the available alarm pools to use as "pseudo" hardware timers
+ //HAL_timer_pool_0 = alarm_pool_create(0,2);
+ HAL_timer_pool_1 = alarm_pool_create(1, 6);
+ HAL_timer_pool_0 = HAL_timer_pool_1;
+ HAL_timer_pool_2 = alarm_pool_create(2, 6);
+ HAL_timer_pool_3 = HAL_timer_pool_2;
+ //HAL_timer_pool_3 = alarm_pool_create(3, 6);
+
+ irq_set_priority(TIMER_IRQ_0, 0xC0);
+ irq_set_priority(TIMER_IRQ_1, 0x80);
+ irq_set_priority(TIMER_IRQ_2, 0x40);
+ irq_set_priority(TIMER_IRQ_3, 0x00);
+
+ //alarm_pool_init_default();
+}
+
+void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
+ const int64_t freq = (int64_t)frequency,
+ us = (1000000ll / freq) * -1ll;
+ bool result;
+ switch (timer_num) {
+ case 0:
+ result = alarm_pool_add_repeating_timer_us(HAL_timer_pool_0, us, HAL_timer_repeating_0_callback, NULL, &HAL_timer_0);
+ break;
+ case 1:
+ result = alarm_pool_add_repeating_timer_us(HAL_timer_pool_1, us, HAL_timer_repeating_1_callback, NULL, &HAL_timer_1);
+ break;
+ case 2:
+ result = alarm_pool_add_repeating_timer_us(HAL_timer_pool_2, us, HAL_timer_repeating_2_callback, NULL, &HAL_timer_2);
+ break;
+ case 3:
+ result = alarm_pool_add_repeating_timer_us(HAL_timer_pool_3, us, HAL_timer_repeating_3_callback, NULL, &HAL_timer_3);
+ break;
+ }
+ UNUSED(result);
+}
+
+void HAL_timer_stop(const uint8_t timer_num) {
+ switch (timer_num) {
+ case 0: cancel_repeating_timer(&HAL_timer_0); break;
+ case 1: cancel_repeating_timer(&HAL_timer_1); break;
+ case 2: cancel_repeating_timer(&HAL_timer_2); break;
+ case 3: cancel_repeating_timer(&HAL_timer_3); break;
+ }
+}
+
+int64_t HAL_timer_alarm_pool_0_callback(long int, void*) {
+ if (HAL_timer_irq_en[0]) HAL_timer_0_callback();
+ return 0;
+}
+int64_t HAL_timer_alarm_pool_1_callback(long int, void*) {
+ if (HAL_timer_irq_en[1]) HAL_timer_1_callback();
+ return 0;
+}
+int64_t HAL_timer_alarm_pool_2_callback(long int, void*) {
+ if (HAL_timer_irq_en[2]) HAL_timer_2_callback();
+ return 0;
+}
+int64_t HAL_timer_alarm_pool_3_callback(long int, void*) {
+ if (HAL_timer_irq_en[3]) HAL_timer_3_callback();
+ return 0;
+}
+
+bool HAL_timer_repeating_0_callback(repeating_timer* timer) {
+ if (HAL_timer_irq_en[0]) HAL_timer_0_callback();
+ return true;
+}
+bool HAL_timer_repeating_1_callback(repeating_timer* timer) {
+ if (HAL_timer_irq_en[1]) HAL_timer_1_callback();
+ return true;
+}
+bool HAL_timer_repeating_2_callback(repeating_timer* timer) {
+ if (HAL_timer_irq_en[2]) HAL_timer_2_callback();
+ return true;
+}
+bool HAL_timer_repeating_3_callback(repeating_timer* timer) {
+ if (HAL_timer_irq_en[3]) HAL_timer_3_callback();
+ return true;
+}
+
+void __attribute__((weak)) HAL_timer_0_callback() {}
+void __attribute__((weak)) HAL_timer_1_callback() {}
+void __attribute__((weak)) HAL_timer_2_callback() {}
+void __attribute__((weak)) HAL_timer_3_callback() {}
+
+#endif // __PLAT_RP2040__
diff --git a/firmware/Marlin/src/HAL/RP2040/timers.h b/firmware/Marlin/src/HAL/RP2040/timers.h
new file mode 100644
index 0000000..83fdc0a
--- /dev/null
+++ b/firmware/Marlin/src/HAL/RP2040/timers.h
@@ -0,0 +1,177 @@
+/**
+ * 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 .
+ *
+ */
+#include
+
+#include "../../core/macros.h"
+
+#ifdef PICO_TIME_DEFAULT_ALARM_POOL_DISABLED
+ #undef PICO_TIME_DEFAULT_ALARM_POOL_DISABLED
+ #define PICO_TIME_DEFAULT_ALARM_POOL_DISABLED 0
+#else
+ #define PICO_TIME_DEFAULT_ALARM_POOL_DISABLED 0
+#endif
+
+// ------------------------
+// Defines
+// ------------------------
+
+//#define _HAL_TIMER(T) _CAT(LPC_TIM, T)
+//#define _HAL_TIMER_IRQ(T) TIMER##T##_IRQn
+//#define __HAL_TIMER_ISR(T) extern "C" alarm_callback_t HAL_timer_alarm_pool_##T##_callback()
+#define __HAL_TIMER_ISR(T) extern void HAL_timer_##T##_callback()
+#define _HAL_TIMER_ISR(T) __HAL_TIMER_ISR(T)
+
+typedef uint64_t hal_timer_t;
+#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFFFFFFFFF
+
+#define HAL_TIMER_RATE (1000000ull) // fixed value as we use a microsecond timesource
+#ifndef MF_TIMER_STEP
+ #define MF_TIMER_STEP 0 // Timer Index for Stepper
+#endif
+#ifndef MF_TIMER_PULSE
+ #define MF_TIMER_PULSE MF_TIMER_STEP
+#endif
+#ifndef MF_TIMER_TEMP
+ #define MF_TIMER_TEMP 1 // Timer Index for Temperature
+#endif
+#ifndef MF_TIMER_PWM
+ #define MF_TIMER_PWM 3 // Timer Index for PWM
+#endif
+
+#define TEMP_TIMER_RATE HAL_TIMER_RATE
+#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
+
+#define STEPPER_TIMER_RATE HAL_TIMER_RATE / 10 // 100khz roughly
+#define STEPPER_TIMER_TICKS_PER_US (0.1) // fixed value as we use a microsecond timesource
+#define STEPPER_TIMER_PRESCALE (10)
+
+#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
+#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
+#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
+
+#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
+#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
+#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
+
+#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
+#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP)
+
+#ifndef HAL_STEP_TIMER_ISR
+ #define HAL_STEP_TIMER_ISR() _HAL_TIMER_ISR(MF_TIMER_STEP)
+#endif
+#ifndef HAL_TEMP_TIMER_ISR
+ #define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(MF_TIMER_TEMP)
+#endif
+
+// Timer references by index
+//#define STEP_TIMER_PTR _HAL_TIMER(MF_TIMER_STEP)
+//#define TEMP_TIMER_PTR _HAL_TIMER(MF_TIMER_TEMP)
+
+extern alarm_pool_t* HAL_timer_pool_0;
+extern alarm_pool_t* HAL_timer_pool_1;
+extern alarm_pool_t* HAL_timer_pool_2;
+extern alarm_pool_t* HAL_timer_pool_3;
+
+extern struct repeating_timer HAL_timer_0;
+
+void HAL_timer_0_callback();
+void HAL_timer_1_callback();
+void HAL_timer_2_callback();
+void HAL_timer_3_callback();
+
+int64_t HAL_timer_alarm_pool_0_callback(long int, void*);
+int64_t HAL_timer_alarm_pool_1_callback(long int, void*);
+int64_t HAL_timer_alarm_pool_2_callback(long int, void*);
+int64_t HAL_timer_alarm_pool_3_callback(long int, void*);
+
+bool HAL_timer_repeating_0_callback(repeating_timer* timer);
+bool HAL_timer_repeating_1_callback(repeating_timer* timer);
+bool HAL_timer_repeating_2_callback(repeating_timer* timer);
+bool HAL_timer_repeating_3_callback(repeating_timer* timer);
+
+extern volatile bool HAL_timer_irq_en[4];
+
+// ------------------------
+// Public functions
+// ------------------------
+
+void HAL_timer_init();
+void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
+void HAL_timer_stop(const uint8_t timer_num);
+
+FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, hal_timer_t compare) {
+
+ if (timer_num == MF_TIMER_STEP){
+ if (compare == HAL_TIMER_TYPE_MAX){
+ HAL_timer_stop(timer_num);
+ return;
+ }
+ }
+
+ compare = compare *10; //Dirty fix, figure out a proper way
+
+ switch (timer_num) {
+ case 0:
+ alarm_pool_add_alarm_in_us(HAL_timer_pool_0 ,compare , HAL_timer_alarm_pool_0_callback ,0 ,false );
+ break;
+
+ case 1:
+ alarm_pool_add_alarm_in_us(HAL_timer_pool_1 ,compare , HAL_timer_alarm_pool_1_callback ,0 ,false );
+ break;
+
+ case 2:
+ alarm_pool_add_alarm_in_us(HAL_timer_pool_2 ,compare , HAL_timer_alarm_pool_2_callback ,0 ,false );
+ break;
+
+ case 3:
+ alarm_pool_add_alarm_in_us(HAL_timer_pool_3 ,compare , HAL_timer_alarm_pool_3_callback ,0 ,false );
+ break;
+ }
+}
+
+FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
+ return 0;
+}
+
+FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
+ if (timer_num == MF_TIMER_STEP) return 0ull;
+ return time_us_64();
+}
+
+
+FORCE_INLINE static void HAL_timer_enable_interrupt(const uint8_t timer_num) {
+ HAL_timer_irq_en[timer_num] = 1;
+}
+
+FORCE_INLINE static void HAL_timer_disable_interrupt(const uint8_t timer_num) {
+ HAL_timer_irq_en[timer_num] = 0;
+}
+
+FORCE_INLINE static bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
+ return HAL_timer_irq_en[timer_num]; //lucky coincidence that timer_num and rp2040 irq num matches
+}
+
+FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
+ return;
+}
+
+#define HAL_timer_isr_epilogue(T) NOOP
diff --git a/firmware/Marlin/src/HAL/SAMD21/HAL.h b/firmware/Marlin/src/HAL/SAMD21/HAL.h
index 95f391f..63beb29 100644
--- a/firmware/Marlin/src/HAL/SAMD21/HAL.h
+++ b/firmware/Marlin/src/HAL/SAMD21/HAL.h
@@ -69,13 +69,13 @@ extern DefaultSerial3 MSerial1;
#endif
#endif
-#ifdef MMU2_SERIAL_PORT
- #if WITHIN(MMU2_SERIAL_PORT, 0, 1)
- #define MMU2_SERIAL MSERIAL(SERIAL_PORT)
- #elif MMU2_SERIAL_PORT == -1
- #define MMU2_SERIAL MSerialUSB
+#ifdef MMU_SERIAL_PORT
+ #if WITHIN(MMU_SERIAL_PORT, 0, 1)
+ #define MMU_SERIAL MSERIAL(SERIAL_PORT)
+ #elif MMU_SERIAL_PORT == -1
+ #define MMU_SERIAL MSerialUSB
#else
- #error "MMU2_SERIAL_PORT must be -1 (Native USB only)."
+ #error "MMU_SERIAL_PORT must be -1 (Native USB only)."
#endif
#endif
diff --git a/firmware/Marlin/src/HAL/SAMD21/HAL_SPI.cpp b/firmware/Marlin/src/HAL/SAMD21/HAL_SPI.cpp
index e01f540..d41f868 100644
--- a/firmware/Marlin/src/HAL/SAMD21/HAL_SPI.cpp
+++ b/firmware/Marlin/src/HAL/SAMD21/HAL_SPI.cpp
@@ -108,7 +108,6 @@
SPI.beginTransaction(spiConfig);
SPI.transfer(buf, nbyte);
SPI.endTransaction();
-
}
/**
diff --git a/firmware/Marlin/src/HAL/SAMD21/pinsDebug.h b/firmware/Marlin/src/HAL/SAMD21/pinsDebug.h
index cc20f28..387516a 100644
--- a/firmware/Marlin/src/HAL/SAMD21/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/SAMD21/pinsDebug.h
@@ -22,41 +22,57 @@
#pragma once
/**
- * SAMD21 HAL developed by Bart Meijer (brupje)
- * Based on SAMD51 HAL by Giuliano Zaro (AKA GMagician)
+ * Pins Debugging for SAMD21
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#define NUMBER_PINS_TOTAL PINS_COUNT
-#define digitalRead_mod(p) extDigitalRead(p)
-#define PRINT_PORT(p) do{ SERIAL_ECHOPGM(" Port: "); sprintf_P(buffer, PSTR("%c%02ld"), 'A' + g_APinDescription[p].ulPort, g_APinDescription[p].ulPin); SERIAL_ECHO(buffer); }while (0)
+#define digitalRead_mod(P) extDigitalRead(P)
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
-#define getPinByIndex(p) pin_array[p].pin
-#define getPinIsDigitalByIndex(p) pin_array[p].is_digital
-#define isValidPin(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL)
-#define isAnalogPin(P) (digitalPinToAnalogIndex(P)!=-1)
-#define pwm_status(pin) digitalPinHasPWM(pin)
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+#define getPinByIndex(x) pin_array[x].pin
+#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
+#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
+#define isAnalogPin(P) (digitalPinToAnalogIndex(P) != -1)
+#define pwm_status(P) digitalPinHasPWM(P)
#define MULTI_NAME_PAD 27 // space needed to be pretty if not first name assigned to a pin
// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities
// uses pin index
#define M43_NEVER_TOUCH(Q) ((Q) >= 75)
-bool getValidPinMode(int8_t pin) { // 1: output, 0: input
+bool getValidPinMode(const int8_t pin) { // 1: output, 0: input
const EPortType samdport = g_APinDescription[pin].ulPort;
const uint32_t samdpin = g_APinDescription[pin].ulPin;
return PORT->Group[samdport].DIR.reg & MASK(samdpin) || (PORT->Group[samdport].PINCFG[samdpin].reg & (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN)) == PORT_PINCFG_PULLEN;
}
-void printPinPWM(int32_t pin) {
+void printPinPWM(const int32_t pin) {
if (pwm_status(pin)) {
//uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
//SERIAL_ECHOPGM("PWM = ", duty);
}
}
+void printPinPort(const pin_t) {}
+
/**
* SAMD21 Board pin| PORT | Label
* ----------------+--------+-------
diff --git a/firmware/Marlin/src/HAL/SAMD51/HAL.h b/firmware/Marlin/src/HAL/SAMD51/HAL.h
index c43d1b5..7655f82 100644
--- a/firmware/Marlin/src/HAL/SAMD51/HAL.h
+++ b/firmware/Marlin/src/HAL/SAMD51/HAL.h
@@ -79,13 +79,13 @@
#endif
#endif
- #ifdef MMU2_SERIAL_PORT
- #if MMU2_SERIAL_PORT == -1
- #define MMU2_SERIAL MSerial0
- #elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
- #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
+ #ifdef MMU_SERIAL_PORT
+ #if MMU_SERIAL_PORT == -1
+ #define MMU_SERIAL MSerial0
+ #elif WITHIN(MMU_SERIAL_PORT, 0, 3)
+ #define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
#else
- #error "MMU2_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
+ #error "MMU_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#endif
#endif
diff --git a/firmware/Marlin/src/HAL/SAMD51/pinsDebug.h b/firmware/Marlin/src/HAL/SAMD51/pinsDebug.h
index 00f246f..1518c61 100644
--- a/firmware/Marlin/src/HAL/SAMD51/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/SAMD51/pinsDebug.h
@@ -22,40 +22,57 @@
#pragma once
/**
- * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
+ * Pins Debugging for SAMD51
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#define NUMBER_PINS_TOTAL PINS_COUNT
-#define digitalRead_mod(p) extDigitalRead(p)
-#define PRINT_PORT(p) do{ SERIAL_ECHOPGM(" Port: "); sprintf_P(buffer, PSTR("%c%02ld"), 'A' + g_APinDescription[p].ulPort, g_APinDescription[p].ulPin); SERIAL_ECHO(buffer); }while (0)
+#define digitalRead_mod(P) extDigitalRead(P)
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
-#define getPinByIndex(p) pin_array[p].pin
-#define getPinIsDigitalByIndex(p) pin_array[p].is_digital
-#define isValidPin(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
-#define isAnalogPin(P) (digitalPinToAnalogIndex(P)!=-1)
-#define pwm_status(pin) digitalPinHasPWM(pin)
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+#define getPinByIndex(x) pin_array[x].pin
+#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
+#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
+#define isAnalogPin(P) (digitalPinToAnalogIndex(P) != -1)
+#define pwm_status(P) digitalPinHasPWM(P)
#define MULTI_NAME_PAD 27 // space needed to be pretty if not first name assigned to a pin
// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities
// uses pin index
#define M43_NEVER_TOUCH(Q) ((Q) >= 75)
-bool getValidPinMode(int8_t pin) { // 1: output, 0: input
+bool getValidPinMode(const int8_t pin) { // 1: output, 0: input
const EPortType samdport = g_APinDescription[pin].ulPort;
const uint32_t samdpin = g_APinDescription[pin].ulPin;
return PORT->Group[samdport].DIR.reg & MASK(samdpin) || (PORT->Group[samdport].PINCFG[samdpin].reg & (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN)) == PORT_PINCFG_PULLEN;
}
-void printPinPWM(int32_t pin) {
+void printPinPWM(const int32_t pin) {
if (pwm_status(pin)) {
//uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
//SERIAL_ECHOPGM("PWM = ", duty);
}
}
+void printPinPort(const pin_t) {}
+
/**
* AGCM4 Board pin | PORT | Label
* ----------------+--------+-------
diff --git a/firmware/Marlin/src/HAL/STM32/HAL.h b/firmware/Marlin/src/HAL/STM32/HAL.h
index 9a43b5d..eab31be 100644
--- a/firmware/Marlin/src/HAL/STM32/HAL.h
+++ b/firmware/Marlin/src/HAL/STM32/HAL.h
@@ -90,15 +90,15 @@
#endif
#endif
-#ifdef MMU2_SERIAL_PORT
- #if WITHIN(MMU2_SERIAL_PORT, 1, 9)
- #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
+#ifdef MMU_SERIAL_PORT
+ #if WITHIN(MMU_SERIAL_PORT, 1, 9)
+ #define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
#elif !defined(USBCON)
- #error "MMU2_SERIAL_PORT must be from 1 to 9."
- #elif MMU2_SERIAL_PORT == -1
- #define MMU2_SERIAL MSerialUSB
+ #error "MMU_SERIAL_PORT must be from 1 to 9."
+ #elif MMU_SERIAL_PORT == -1
+ #define MMU_SERIAL MSerialUSB
#else
- #error "MMU2_SERIAL_PORT must be from 1 to 9, or -1 for Native USB."
+ #error "MMU_SERIAL_PORT must be from 1 to 9, or -1 for Native USB."
#endif
#endif
diff --git a/firmware/Marlin/src/HAL/STM32/pinsDebug.h b/firmware/Marlin/src/HAL/STM32/pinsDebug.h
index cce7054..21cd2de 100644
--- a/firmware/Marlin/src/HAL/STM32/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/STM32/pinsDebug.h
@@ -21,6 +21,26 @@
*/
#pragma once
+/**
+ * Pins Debugging for STM32
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
+ */
+
#include
#ifndef NUM_DIGITAL_PINS
@@ -34,11 +54,11 @@
* that a CPU has.
*
* VARIABLES:
- * Ard_num - Arduino pin number - defined by the platform. It is used by digitalRead and
- * digitalWrite commands and by M42.
- * - does not contain port/pin info
- * - is not in port/pin order
- * - typically a variant will only assign Ard_num to port/pins that are actually used
+ * A - Arduino pin number - defined by the platform. It is used by digitalRead and
+ * digitalWrite commands and by M42.
+ * - does not contain port/pin info
+ * - is not in port/pin order
+ * - typically a variant will only assign Ard_num to port/pins that are actually used
* Index - M43 counter - only used to get Ard_num
* x - a parameter/argument used to search the pin_array to try to find a signal name
* associated with a Ard_num
@@ -98,15 +118,11 @@ const XrefInfo pin_xref[] PROGMEM = {
#define MODE_PIN_ALT 2 // Alternate function mode
#define MODE_PIN_ANALOG 3 // Analog mode
-#define PIN_NUM(P) (P & 0x000F)
-#define PIN_NUM_ALPHA_LEFT(P) (((P & 0x000F) < 10) ? ('0' + (P & 0x000F)) : '1')
-#define PIN_NUM_ALPHA_RIGHT(P) (((P & 0x000F) > 9) ? ('0' + (P & 0x000F) - 10) : 0 )
-#define PORT_NUM(P) ((P >> 4) & 0x0007)
-#define PORT_ALPHA(P) ('A' + (P >> 4))
-
-/**
- * Translation of routines & variables used by pinsDebug.h
- */
+#define PIN_NUM(P) ((P) & 0x000F)
+#define PIN_NUM_ALPHA_LEFT(P) ((((P) & 0x000F) < 10) ? ('0' + ((P) & 0x000F)) : '1')
+#define PIN_NUM_ALPHA_RIGHT(P) ((((P) & 0x000F) > 9) ? ('0' + ((P) & 0x000F) - 10) : 0 )
+#define PORT_NUM(P) (((P) >> 4) & 0x0007)
+#define PORT_ALPHA(P) ('A' + ((P) >> 4))
#if NUM_ANALOG_FIRST >= NUM_DIGITAL_PINS
#define HAS_HIGH_ANALOG_PINS 1
@@ -116,10 +132,10 @@ const XrefInfo pin_xref[] PROGMEM = {
#endif
#define NUMBER_PINS_TOTAL ((NUM_DIGITAL_PINS) + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS))
#define isValidPin(P) (WITHIN(P, 0, (NUM_DIGITAL_PINS) - 1) || TERN0(HAS_HIGH_ANALOG_PINS, WITHIN(P, NUM_ANALOG_FIRST, NUM_ANALOG_LAST)))
-#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads
+#define digitalRead_mod(A) extDigitalRead(A) // must use Arduino pin numbers when doing reads
#define printPinNumber(Q)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
-#define digitalPinToAnalogIndex(ANUM) -1 // will report analog pin number in the print port routine
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+#define digitalPinToAnalogIndex(P) -1 // will report analog pin number in the print port routine
// x is a variable used to search pin_array
#define getPinIsDigitalByIndex(x) ((bool) pin_array[x].is_digital)
@@ -130,27 +146,27 @@ const XrefInfo pin_xref[] PROGMEM = {
//
// Pin Mapping for M43
//
-#define GET_PIN_MAP_PIN_M43(Index) pin_xref[Index].Ard_num
+#define GET_PIN_MAP_PIN_M43(x) pin_xref[x].Ard_num
#ifndef M43_NEVER_TOUCH
- #define _M43_NEVER_TOUCH(Index) (Index >= 9 && Index <= 12) // SERIAL/USB pins: PA9(TX) PA10(RX) PA11(USB_DM) PA12(USB_DP)
+ #define _M43_NEVER_TOUCH(x) WITHIN(x, 9, 12) // SERIAL/USB pins: PA9(TX) PA10(RX) PA11(USB_DM) PA12(USB_DP)
#ifdef KILL_PIN
- #define M43_NEVER_TOUCH(Index) m43_never_touch(Index)
+ #define M43_NEVER_TOUCH(x) m43_never_touch(x)
- bool m43_never_touch(const pin_t Index) {
+ bool m43_never_touch(const pin_t index) {
static pin_t M43_kill_index = -1;
if (M43_kill_index < 0)
for (M43_kill_index = 0; M43_kill_index < NUMBER_PINS_TOTAL; M43_kill_index++)
if (KILL_PIN == GET_PIN_MAP_PIN_M43(M43_kill_index)) break;
- return _M43_NEVER_TOUCH(Index) || Index == M43_kill_index; // KILL_PIN and SERIAL/USB
+ return _M43_NEVER_TOUCH(index) || index == M43_kill_index; // KILL_PIN and SERIAL/USB
}
#else
- #define M43_NEVER_TOUCH(Index) _M43_NEVER_TOUCH(Index)
+ #define M43_NEVER_TOUCH(index) _M43_NEVER_TOUCH(index)
#endif
#endif
-uint8_t get_pin_mode(const pin_t Ard_num) {
- const PinName dp = digitalPinToPinName(Ard_num);
+uint8_t get_pin_mode(const pin_t pin) {
+ const PinName dp = digitalPinToPinName(pin);
uint32_t ll_pin = STM_LL_GPIO_PIN(dp);
GPIO_TypeDef *port = get_GPIO_Port(STM_PORT(dp));
uint32_t mode = LL_GPIO_GetPinMode(port, ll_pin);
@@ -164,41 +180,41 @@ uint8_t get_pin_mode(const pin_t Ard_num) {
}
}
-bool getValidPinMode(const pin_t Ard_num) {
- const uint8_t pin_mode = get_pin_mode(Ard_num);
+bool getValidPinMode(const pin_t pin) {
+ const uint8_t pin_mode = get_pin_mode(pin);
return pin_mode == MODE_PIN_OUTPUT || pin_mode == MODE_PIN_ALT; // assume all alt definitions are PWM
}
-int8_t digital_pin_to_analog_pin(const pin_t Ard_num) {
- if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
- return Ard_num - NUM_ANALOG_FIRST;
+int8_t digital_pin_to_analog_pin(const pin_t pin) {
+ if (WITHIN(pin, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
+ return pin - NUM_ANALOG_FIRST;
- const int8_t ind = digitalPinToAnalogIndex(Ard_num);
+ const int8_t ind = digitalPinToAnalogIndex(pin);
return (ind < NUM_ANALOG_INPUTS) ? ind : -1;
}
-bool isAnalogPin(const pin_t Ard_num) {
- return get_pin_mode(Ard_num) == MODE_PIN_ANALOG;
+bool isAnalogPin(const pin_t pin) {
+ return get_pin_mode(pin) == MODE_PIN_ANALOG;
}
-bool is_digital(const pin_t Ard_num) {
- const uint8_t pin_mode = get_pin_mode(pin_array[Ard_num].pin);
+bool is_digital(const pin_t pin) {
+ const uint8_t pin_mode = get_pin_mode(pin_array[pin].pin);
return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT;
}
-void printPinPort(const pin_t Ard_num) {
+void printPinPort(const pin_t pin) {
char buffer[16];
- pin_t Index;
- for (Index = 0; Index < NUMBER_PINS_TOTAL; Index++)
- if (Ard_num == GET_PIN_MAP_PIN_M43(Index)) break;
+ pin_t index;
+ for (index = 0; index < NUMBER_PINS_TOTAL; index++)
+ if (pin == GET_PIN_MAP_PIN_M43(index)) break;
- const char * ppa = pin_xref[Index].Port_pin_alpha;
+ const char * ppa = pin_xref[index].Port_pin_alpha;
sprintf_P(buffer, PSTR("%s"), ppa);
SERIAL_ECHO(buffer);
if (ppa[3] == '\0') SERIAL_CHAR(' ');
// print analog pin number
- const int8_t Port_pin = digital_pin_to_analog_pin(Ard_num);
+ const int8_t Port_pin = digital_pin_to_analog_pin(pin);
if (Port_pin >= 0) {
sprintf_P(buffer, PSTR(" (A%d) "), Port_pin);
SERIAL_ECHO(buffer);
@@ -208,8 +224,8 @@ void printPinPort(const pin_t Ard_num) {
SERIAL_ECHO_SP(7);
// Print number to be used with M42
- int calc_p = Ard_num;
- if (Ard_num > NUM_DIGITAL_PINS) {
+ int calc_p = pin;
+ if (pin > NUM_DIGITAL_PINS) {
calc_p -= NUM_ANALOG_FIRST;
if (calc_p > 7) calc_p += 8;
}
@@ -222,15 +238,15 @@ void printPinPort(const pin_t Ard_num) {
}
}
-bool pwm_status(const pin_t Ard_num) {
- return get_pin_mode(Ard_num) == MODE_PIN_ALT;
+bool pwm_status(const pin_t pin) {
+ return get_pin_mode(pin) == MODE_PIN_ALT;
}
-void printPinPWM(const pin_t Ard_num) {
+void printPinPWM(const pin_t pin) {
#ifndef STM32F1xx
- if (pwm_status(Ard_num)) {
+ if (pwm_status(pin)) {
uint32_t alt_all = 0;
- const PinName dp = digitalPinToPinName(Ard_num);
+ const PinName dp = digitalPinToPinName(pin);
pin_t pin_number = uint8_t(PIN_NUM(dp));
const bool over_7 = pin_number >= 8;
const uint8_t ind = over_7 ? 1 : 0;
diff --git a/firmware/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp b/firmware/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp
index e508f90..bb011ec 100644
--- a/firmware/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp
+++ b/firmware/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp
@@ -111,11 +111,11 @@ void TFT_FSMC::init() {
HAL_SRAM_Init(&SRAMx, &timing, &extTiming);
+ __HAL_RCC_DMA2_CLK_ENABLE();
+
#ifdef STM32F1xx
- __HAL_RCC_DMA1_CLK_ENABLE();
- DMAtx.Instance = DMA1_Channel1;
+ DMAtx.Instance = DMA2_Channel1;
#elif defined(STM32F4xx)
- __HAL_RCC_DMA2_CLK_ENABLE();
DMAtx.Instance = DMA2_Stream0;
DMAtx.Init.Channel = DMA_CHANNEL_0;
DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE;
diff --git a/firmware/Marlin/src/HAL/STM32F1/HAL.h b/firmware/Marlin/src/HAL/STM32F1/HAL.h
index 0266b79..e80ced8 100644
--- a/firmware/Marlin/src/HAL/STM32F1/HAL.h
+++ b/firmware/Marlin/src/HAL/STM32F1/HAL.h
@@ -118,14 +118,14 @@
#endif
#endif
-#ifdef MMU2_SERIAL_PORT
- #if MMU2_SERIAL_PORT == -1
- #define MMU2_SERIAL UsbSerial
- #elif WITHIN(MMU2_SERIAL_PORT, 1, NUM_UARTS)
- #define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
+#ifdef MMU_SERIAL_PORT
+ #if MMU_SERIAL_PORT == -1
+ #define MMU_SERIAL UsbSerial
+ #elif WITHIN(MMU_SERIAL_PORT, 1, NUM_UARTS)
+ #define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
#else
- #define MMU2_SERIAL MSERIAL(1) // dummy port
- static_assert(false, "MMU2_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.")
+ #define MMU_SERIAL MSERIAL(1) // dummy port
+ static_assert(false, "MMU_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.")
#endif
#endif
diff --git a/firmware/Marlin/src/HAL/STM32F1/pinsDebug.h b/firmware/Marlin/src/HAL/STM32F1/pinsDebug.h
index ab8bc88..9191614 100644
--- a/firmware/Marlin/src/HAL/STM32F1/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/STM32F1/pinsDebug.h
@@ -22,11 +22,23 @@
#pragma once
/**
- * Support routines for MAPLE_STM32F1
- */
-
-/**
- * Translation of routines & variables used by pinsDebug.h
+ * Pins Debugging for Maple STM32F1
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#ifndef BOARD_NR_GPIO_PINS // Only in MAPLE_STM32F1
@@ -39,11 +51,11 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS];
#define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS
#define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS
-#define isValidPin(pin) (pin >= 0 && pin < BOARD_NR_GPIO_PINS)
-#define getPinByIndex(p) pin_t(pin_array[p].pin)
-#define digitalRead_mod(p) extDigitalRead(p)
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
+#define isValidPin(P) (P >= 0 && P < BOARD_NR_GPIO_PINS)
+#define getPinByIndex(x) pin_t(pin_array[x].pin)
+#define digitalRead_mod(P) extDigitalRead(P)
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(P)); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 21 // space needed to be pretty if not first name assigned to a pin
@@ -78,8 +90,8 @@ bool getValidPinMode(const pin_t pin) {
return isValidPin(pin) && !IS_INPUT(pin);
}
-bool getPinIsDigitalByIndex(const int16_t array_pin) {
- const pin_t pin = getPinByIndex(array_pin);
+bool getPinIsDigitalByIndex(const int16_t index) {
+ const pin_t pin = getPinByIndex(index);
return (!isAnalogPin(pin)
#ifdef NUM_ANALOG_INPUTS
|| PIN_MAP[pin].adc_channel >= NUM_ANALOG_INPUTS
diff --git a/firmware/Marlin/src/HAL/TEENSY31_32/pinsDebug.h b/firmware/Marlin/src/HAL/TEENSY31_32/pinsDebug.h
index d4a91ce..741909b 100644
--- a/firmware/Marlin/src/HAL/TEENSY31_32/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/TEENSY31_32/pinsDebug.h
@@ -1 +1,71 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2019 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 .
+ *
+ */
+#pragma once
+
#error "PINS_DEBUGGING is not yet supported for Teensy 3.1 / 3.2!"
+
+/**
+ * Pins Debugging for ESP32
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
+ */
+
+#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
+#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
+
+#define digitalRead_mod(P) extDigitalRead(P)
+#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+#define getPinByIndex(x) pin_array[x].pin
+#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
+#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
+#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0))
+#define isAnalogPin(P) WITHIN(P, pin_t(analogInputToDigitalPin(0)), pin_t(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
+bool pwm_status(const pin_t) { return false; }
+
+void printPinPort(const pin_t) {}
+
+static bool getValidPinMode(const pin_t pin) {
+ return isValidPin(pin) /* && !IS_INPUT(pin) */ ;
+}
+
+void printPinPWM(const int32_t pin) {
+ if (pwm_status(pin)) {
+ //uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
+ //SERIAL_ECHOPGM("PWM = ", duty);
+ }
+}
diff --git a/firmware/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h b/firmware/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h
index 843905a..8f2651d 100644
--- a/firmware/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h
+++ b/firmware/Marlin/src/HAL/TEENSY35_36/inc/SanityCheck.h
@@ -48,3 +48,7 @@
#if USING_PULLDOWNS
#error "PULLDOWN pin mode is not available for Teensy 3.5/3.6."
#endif
+
+#if ENABLED(PINS_DEBUGGING)
+ #error "PINS_DEBUGGING is not yet supported for Teensy 3.5/3.6. Needs is_output(pin), etc."
+#endif
diff --git a/firmware/Marlin/src/HAL/TEENSY35_36/pinsDebug.h b/firmware/Marlin/src/HAL/TEENSY35_36/pinsDebug.h
index 34efc18..f0f61b8 100644
--- a/firmware/Marlin/src/HAL/TEENSY35_36/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/TEENSY35_36/pinsDebug.h
@@ -22,7 +22,23 @@
#pragma once
/**
- * HAL Pins Debugging for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0)
+ * Pins Debugging for Teensy 3.5 (MK64FX512) and Teensy 3.6 (MK66FX1M0)
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
@@ -53,6 +69,15 @@
#define TPM1_CH1_PIN 17
#endif
+#define getPinByIndex(x) pin_array[x].pin
+#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
+#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
+#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0))
+#define getValidPinMode(P) (isValidPin(P) && IS_OUTPUT(P))
+#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+
#define isAnalogPin(P) ((P) >= analogInputToDigitalPin(0) && (P) <= analogInputToDigitalPin(9)) || ((P) >= analogInputToDigitalPin(12) && (P) <= analogInputToDigitalPin(20))
void printAnalogPin(char buffer[], int8_t pin) {
@@ -77,7 +102,7 @@ void analog_pin_state(char buffer[], int8_t pin) {
* Print a pin's PWM status.
* Return true if it's currently a PWM pin.
*/
-bool pwm_status(int8_t pin) {
+bool pwm_status(const int8_t pin) {
char buffer[20]; // for the sprintf statements
switch (pin) {
FTM_CASE(0,0);
@@ -108,4 +133,6 @@ bool pwm_status(int8_t pin) {
SERIAL_ECHOPGM(" ");
}
-void printPinPWM(uint8_t pin) { /* TODO */ }
+void printPinPWM(const pin_t) { /* TODO */ }
+
+void printPinPort(const pin_t) {}
diff --git a/firmware/Marlin/src/HAL/TEENSY40_41/pinsDebug.h b/firmware/Marlin/src/HAL/TEENSY40_41/pinsDebug.h
index 4056549..3307b3f 100644
--- a/firmware/Marlin/src/HAL/TEENSY40_41/pinsDebug.h
+++ b/firmware/Marlin/src/HAL/TEENSY40_41/pinsDebug.h
@@ -22,25 +22,40 @@
#pragma once
/**
- * HAL Pins Debugging for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A)
+ * Pins Debugging for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A)
+ *
+ * - NUMBER_PINS_TOTAL
+ * - MULTI_NAME_PAD
+ * - getPinByIndex(index)
+ * - printPinNameByIndex(index)
+ * - getPinIsDigitalByIndex(index)
+ * - digitalPinToAnalogIndex(pin)
+ * - getValidPinMode(pin)
+ * - isValidPin(pin)
+ * - isAnalogPin(pin)
+ * - digitalRead_mod(pin)
+ * - pwm_status(pin)
+ * - printPinPWM(pin)
+ * - printPinPort(pin)
+ * - printPinNumber(pin)
+ * - printPinAnalog(pin)
*/
#warning "PINS_DEBUGGING is not fully supported for Teensy 4.0 / 4.1 so 'M43' may cause hangs."
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
-#define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin
+#define getPinByIndex(x) pin_array[x].pin
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
-#define printPinNumber(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
-#define printPinAnalog(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(pin)); SERIAL_ECHO(buffer); }while(0)
-#define getPinByIndex(p) pin_array[p].pin
-#define getPinIsDigitalByIndex(p) pin_array[p].is_digital
-#define isValidPin(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
-#define digitalPinToAnalogIndex(p) int(p - analogInputToDigitalPin(0))
-#define getValidPinMode(PIN) (isValidPin(pin) && IS_OUTPUT(pin))
-#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
-
+#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
+#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0))
+#define getValidPinMode(P) (isValidPin(P) && IS_OUTPUT(P))
+#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
#define isAnalogPin(P) (pin_t(P) >= analogInputToDigitalPin(0) && pin_t(P) <= analogInputToDigitalPin(13)) || (pin_t(P) >= analogInputToDigitalPin(14) && pin_t(P) <= analogInputToDigitalPin(17))
+#define digitalRead_mod(P) extDigitalRead(P) // AVR digitalRead disabled PWM before it read the pin
+#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0)
+#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
+#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
struct pwm_pin_info_struct {
uint8_t type; // 0=no pwm, 1=flexpwm, 2=quad
diff --git a/firmware/Marlin/src/HAL/platforms.h b/firmware/Marlin/src/HAL/platforms.h
index 9eaf7ce..36fb792 100644
--- a/firmware/Marlin/src/HAL/platforms.h
+++ b/firmware/Marlin/src/HAL/platforms.h
@@ -54,6 +54,8 @@
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/SAMD51/NAME)
#elif defined(__SAMD21__)
#define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/SAMD21/NAME)
+#elif defined(__PLAT_RP2040__)
+ #define HAL_PATH(PATH, NAME) XSTR(PATH/HAL/RP2040/NAME)
#else
#error "Unsupported Platform!"
#endif
diff --git a/firmware/Marlin/src/HAL/shared/servo.h b/firmware/Marlin/src/HAL/shared/servo.h
index 786c1e6..fa75445 100644
--- a/firmware/Marlin/src/HAL/shared/servo.h
+++ b/firmware/Marlin/src/HAL/shared/servo.h
@@ -82,13 +82,15 @@
#include "../STM32/Servo.h"
#elif defined(ARDUINO_ARCH_ESP32)
#include "../ESP32/Servo.h"
+#elif defined(__PLAT_RP2040__)
+ #include "../RP2040/Servo.h"
#else
#include
- #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM) || defined(__SAMD51__) || defined(__SAMD21__)
+ #if defined(__AVR__) || defined(ARDUINO_ARCH_SAM) || defined(__SAMD51__) || defined(__SAMD21__) || defined(__PLAT_RP2040__)
// we're good to go
#else
- #error "This library only supports boards with an AVR, SAM3X, SAMD21 or SAMD51 processor."
+ #error "This library only supports boards with an AVR, SAM3X, SAMD21, SAMD51, or RP2040 processor."
#endif
#define Servo_VERSION 2 // software version of this library
diff --git a/firmware/Marlin/src/MarlinCore.cpp b/firmware/Marlin/src/MarlinCore.cpp
index 740e053..140423f 100644
--- a/firmware/Marlin/src/MarlinCore.cpp
+++ b/firmware/Marlin/src/MarlinCore.cpp
@@ -79,6 +79,8 @@
#include "lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "lcd/e3v2/jyersui/dwin.h"
+ #elif ENABLED(SOVOL_SV06_RTS)
+ #include "lcd/sovol_rts/sovol_rts.h"
#endif
#endif
@@ -230,8 +232,8 @@
#endif
#if HAS_PRUSA_MMU3
- #include "feature/mmu3/mmu2.h"
- #include "feature/mmu3/mmu2_reporting.h"
+ #include "feature/mmu3/mmu3.h"
+ #include "feature/mmu3/mmu3_reporting.h"
#include "feature/mmu3/SpoolJoin.h"
#elif HAS_PRUSA_MMU2
#include "feature/mmu/mmu2.h"
@@ -825,7 +827,11 @@ void idle(const bool no_stepper_sleep/*=false*/) {
TERN_(HAS_BEEPER, buzzer.tick());
// Handle UI input / draw events
- ui.update();
+ #if ENABLED(SOVOL_SV06_RTS)
+ RTS_Update();
+ #else
+ ui.update();
+ #endif
// Run i2c Position Encoders
#if ENABLED(I2C_POSITION_ENCODERS)
@@ -1162,6 +1168,12 @@ void setup() {
millis_t serial_connect_timeout = millis() + 1000UL;
while (!MYSERIAL1.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
+ #if ENABLED(SOVOL_SV06_RTS)
+ LCD_SERIAL.begin(BAUDRATE);
+ serial_connect_timeout = millis() + 1000UL;
+ while (!LCD_SERIAL.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
+ #endif
+
#if HAS_MULTI_SERIAL && !HAS_ETHERNET
#ifndef BAUDRATE_2
#define BAUDRATE_2 BAUDRATE
@@ -1246,7 +1258,7 @@ void setup() {
SETUP_RUN(runout.setup());
#endif
- #if HAS_TMC220x
+ #if HAS_TMC_UART
SETUP_RUN(tmc_serial_begin());
#endif
@@ -1319,8 +1331,11 @@ void setup() {
// UI must be initialized before EEPROM
// (because EEPROM code calls the UI).
-
- SETUP_RUN(ui.init());
+ #if ENABLED(SOVOL_SV06_RTS)
+ SETUP_RUN(RTS_Update());
+ #else
+ SETUP_RUN(ui.init());
+ #endif
#if PIN_EXISTS(SAFE_POWER)
#if HAS_DRIVER_SAFE_POWER_PROTECT
@@ -1609,6 +1624,8 @@ void setup() {
#if ENABLED(DWIN_CREALITY_LCD)
SETUP_RUN(dwinInitScreen());
+ #elif ENABLED(SOVOL_SV06_RTS)
+ SETUP_RUN(rts.init());
#endif
#if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)
diff --git a/firmware/Marlin/src/core/boards.h b/firmware/Marlin/src/core/boards.h
index 710cb8d..f08d69e 100644
--- a/firmware/Marlin/src/core/boards.h
+++ b/firmware/Marlin/src/core/boards.h
@@ -79,61 +79,58 @@
#define BOARD_MKS_GEN_13 1112 // MKS GEN v1.3 or 1.4
#define BOARD_MKS_GEN_L 1113 // MKS GEN L
#define BOARD_KFB_2 1114 // BigTreeTech or BIQU KFB2.0
-#define BOARD_ZRIB_V20 1115 // zrib V2.0 (Chinese RAMPS replica)
-#define BOARD_ZRIB_V52 1116 // zrib V5.2 (Chinese RAMPS replica)
-#define BOARD_FELIX2 1117 // Felix 2.0+ Electronics Board (RAMPS like)
-#define BOARD_RIGIDBOARD 1118 // Invent-A-Part RigidBoard
-#define BOARD_RIGIDBOARD_V2 1119 // Invent-A-Part RigidBoard V2
-#define BOARD_SAINSMART_2IN1 1120 // Sainsmart 2-in-1 board
-#define BOARD_ULTIMAKER 1121 // Ultimaker
-#define BOARD_ULTIMAKER_OLD 1122 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
-#define BOARD_AZTEEG_X3 1123 // Azteeg X3
-#define BOARD_AZTEEG_X3_PRO 1124 // Azteeg X3 Pro
-#define BOARD_ULTIMAIN_2 1125 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
-#define BOARD_RUMBA 1126 // Rumba
-#define BOARD_RUMBA_RAISE3D 1127 // Raise3D N series Rumba derivative
-#define BOARD_RL200 1128 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
-#define BOARD_FORMBOT_TREX2PLUS 1129 // Formbot T-Rex 2 Plus
-#define BOARD_FORMBOT_TREX3 1130 // Formbot T-Rex 3
-#define BOARD_FORMBOT_RAPTOR 1131 // Formbot Raptor
-#define BOARD_FORMBOT_RAPTOR2 1132 // Formbot Raptor 2
-#define BOARD_BQ_ZUM_MEGA_3D 1133 // bq ZUM Mega 3D
-#define BOARD_MAKEBOARD_MINI 1134 // MakeBoard Mini v2.1.2 by MicroMake
-#define BOARD_TRIGORILLA_13 1135 // TriGorilla Anycubic version 1.3-based on RAMPS EFB
-#define BOARD_TRIGORILLA_14 1136 // ... Ver 1.4
-#define BOARD_TRIGORILLA_14_11 1137 // ... Rev 1.1 (new servo pin order)
-#define BOARD_RAMPS_ENDER_4 1138 // Creality: Ender-4, CR-8
-#define BOARD_RAMPS_CREALITY 1139 // Creality: CR10S, CR20, CR-X
-#define BOARD_DAGOMA_F5 1140 // Dagoma F5
-#define BOARD_FYSETC_F6_13 1141 // FYSETC F6 1.3
-#define BOARD_FYSETC_F6_14 1142 // FYSETC F6 1.4
-#define BOARD_DUPLICATOR_I3_PLUS 1143 // Wanhao Duplicator i3 Plus
-#define BOARD_VORON 1144 // VORON Design
-#define BOARD_TRONXY_V3_1_0 1145 // Tronxy TRONXY-V3-1.0
-#define BOARD_Z_BOLT_X_SERIES 1146 // Z-Bolt X Series
-#define BOARD_TT_OSCAR 1147 // TT OSCAR
-#define BOARD_OVERLORD 1148 // Overlord/Overlord Pro
-#define BOARD_HJC2560C_REV1 1149 // ADIMLab Gantry v1
-#define BOARD_HJC2560C_REV2 1150 // ADIMLab Gantry v2
-#define BOARD_TANGO 1151 // BIQU Tango V1
-#define BOARD_MKS_GEN_L_V2 1152 // MKS GEN L V2
-#define BOARD_MKS_GEN_L_V21 1153 // MKS GEN L V2.1
-#define BOARD_COPYMASTER_3D 1154 // Copymaster 3D
-#define BOARD_ORTUR_4 1155 // Ortur 4
-#define BOARD_TENLOG_D3_HERO 1156 // Tenlog D3 Hero IDEX printer
-#define BOARD_TENLOG_MB1_V23 1157 // Tenlog D3, D5, D6 IDEX Printer
-#define BOARD_RAMPS_S_12_EEFB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
-#define BOARD_RAMPS_S_12_EEEB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
-#define BOARD_RAMPS_S_12_EFFB 1160 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
-#define BOARD_LONGER3D_LK1_PRO 1161 // Longer LK1 PRO / Alfawise U20 Pro (PRO version)
-#define BOARD_LONGER3D_LKx_PRO 1162 // Longer LKx PRO / Alfawise Uxx Pro (PRO version)
-#define BOARD_ZRIB_V53 1163 // Zonestar zrib V5.3 (Chinese RAMPS replica)
-#define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3
-#define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1)
-#define BOARD_KODAMA_BARDO 1166 // Kodama Bardo V1.x (as found in the Kodama Trinus)
-#define BOARD_DAGOMA_D6 1167 // Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
-#define BOARD_XTLW_MFF_V1 1168 // XTLW MFF V1.0
-#define BOARD_XTLW_MFF_V2 1169 // XTLW MFF V2.0
+#define BOARD_ZRIB_V20 1115 // Zonestar zrib V2.0 (Chinese RAMPS replica)
+#define BOARD_ZRIB_V52 1116 // Zonestar zrib V5.2 (Chinese RAMPS replica)
+#define BOARD_ZRIB_V53 1117 // Zonestar zrib V5.3 (Chinese RAMPS replica)
+#define BOARD_FELIX2 1118 // Felix 2.0+ Electronics Board (RAMPS like)
+#define BOARD_RIGIDBOARD 1119 // Invent-A-Part RigidBoard
+#define BOARD_RIGIDBOARD_V2 1120 // Invent-A-Part RigidBoard V2
+#define BOARD_SAINSMART_2IN1 1121 // Sainsmart 2-in-1 board
+#define BOARD_ULTIMAKER 1122 // Ultimaker
+#define BOARD_ULTIMAKER_OLD 1123 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
+#define BOARD_AZTEEG_X3 1124 // Azteeg X3
+#define BOARD_AZTEEG_X3_PRO 1125 // Azteeg X3 Pro
+#define BOARD_ULTIMAIN_2 1126 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
+#define BOARD_RUMBA 1127 // Rumba
+#define BOARD_RUMBA_RAISE3D 1128 // Raise3D N series Rumba derivative
+#define BOARD_RL200 1129 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
+#define BOARD_FORMBOT_TREX2PLUS 1130 // Formbot T-Rex 2 Plus
+#define BOARD_FORMBOT_TREX3 1131 // Formbot T-Rex 3
+#define BOARD_FORMBOT_RAPTOR 1132 // Formbot Raptor
+#define BOARD_FORMBOT_RAPTOR2 1133 // Formbot Raptor 2
+#define BOARD_BQ_ZUM_MEGA_3D 1134 // bq ZUM Mega 3D
+#define BOARD_MAKEBOARD_MINI 1135 // MakeBoard Mini v2.1.2 by MicroMake
+#define BOARD_TRIGORILLA_13 1136 // TriGorilla Anycubic version 1.3-based on RAMPS EFB
+#define BOARD_TRIGORILLA_14 1137 // ... Ver 1.4
+#define BOARD_TRIGORILLA_14_11 1138 // ... Rev 1.1 (new servo pin order)
+#define BOARD_RAMPS_ENDER_4 1139 // Creality: Ender-4, CR-8
+#define BOARD_RAMPS_CREALITY 1140 // Creality: CR10S, CR20, CR-X
+#define BOARD_DAGOMA_F5 1141 // Dagoma F5
+#define BOARD_DAGOMA_D6 1142 // Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
+#define BOARD_FYSETC_F6_13 1143 // FYSETC F6 1.3
+#define BOARD_FYSETC_F6_14 1144 // FYSETC F6 1.4
+#define BOARD_DUPLICATOR_I3_PLUS 1145 // Wanhao Duplicator i3 Plus
+#define BOARD_VORON 1146 // VORON Design
+#define BOARD_TRONXY_V3_1_0 1147 // Tronxy TRONXY-V3-1.0
+#define BOARD_Z_BOLT_X_SERIES 1148 // Z-Bolt X Series
+#define BOARD_TT_OSCAR 1149 // TT OSCAR
+#define BOARD_TANGO 1150 // BIQU Tango V1
+#define BOARD_MKS_GEN_L_V2 1151 // MKS GEN L V2
+#define BOARD_MKS_GEN_L_V21 1152 // MKS GEN L V2.1
+#define BOARD_COPYMASTER_3D 1153 // Copymaster 3D
+#define BOARD_ORTUR_4 1154 // Ortur 4
+#define BOARD_TENLOG_D3_HERO 1155 // Tenlog D3 Hero IDEX printer
+#define BOARD_TENLOG_MB1_V23 1156 // Tenlog D3, D5, D6 IDEX Printer
+#define BOARD_RAMPS_S_12_EEFB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
+#define BOARD_RAMPS_S_12_EEEB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
+#define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
+#define BOARD_LONGER3D_LK1_PRO 1160 // Longer LK1 PRO / Alfawise U20 Pro (PRO version)
+#define BOARD_LONGER3D_LKx_PRO 1161 // Longer LKx PRO / Alfawise Uxx Pro (PRO version)
+#define BOARD_PXMALION_CORE_I3 1162 // Pxmalion Core I3
+#define BOARD_PANOWIN_CUTLASS 1163 // Panowin Cutlass (as found in the Panowin F1)
+#define BOARD_KODAMA_BARDO 1164 // Kodama Bardo V1.x (as found in the Kodama Trinus)
+#define BOARD_XTLW_MFF_V1 1165 // XTLW MFF V1.0
+#define BOARD_XTLW_MFF_V2 1166 // XTLW MFF V2.0
//
// RAMBo and derivatives
@@ -169,20 +166,23 @@
#define BOARD_GT2560_REV_A_PLUS 1315 // Geeetech GT2560 Rev A+ (with auto level probe)
#define BOARD_GT2560_REV_B 1316 // Geeetech GT2560 Rev B
#define BOARD_GT2560_V3 1317 // Geeetech GT2560 Rev B for A10(M/T/D)
-#define BOARD_GT2560_V4 1318 // Geeetech GT2560 Rev B for A10(M/T/D)
-#define BOARD_GT2560_V3_MC2 1319 // Geeetech GT2560 Rev B for Mecreator2
-#define BOARD_GT2560_V3_A20 1320 // Geeetech GT2560 Rev B for A20(M/T/D)
-#define BOARD_EINSTART_S 1321 // Einstart retrofit
-#define BOARD_WANHAO_ONEPLUS 1322 // Wanhao 0ne+ i3 Mini
-#define BOARD_LEAPFROG_XEED2015 1323 // Leapfrog Xeed 2015
-#define BOARD_PICA_REVB 1324 // PICA Shield (original version)
-#define BOARD_PICA 1325 // PICA Shield (rev C or later)
-#define BOARD_INTAMSYS40 1326 // Intamsys 4.0 (Funmat HT)
-#define BOARD_MALYAN_M180 1327 // Malyan M180 Mainboard Version 2 (no display function, direct G-code only)
-#define BOARD_GT2560_V4_A20 1328 // Geeetech GT2560 Rev B for A20(M/T/D)
-#define BOARD_PROTONEER_CNC_SHIELD_V3 1329 // Mega controller & Protoneer CNC Shield V3.00
-#define BOARD_WEEDO_62A 1330 // WEEDO 62A board (TINA2, Monoprice Cadet, etc.)
-#define BOARD_GT2560_V41B 1331 // Geeetech GT2560 V4.1B for A10(M/T/D)
+#define BOARD_GT2560_V3_MC2 1318 // Geeetech GT2560 Rev B for Mecreator2
+#define BOARD_GT2560_V3_A20 1319 // Geeetech GT2560 Rev B for A20(M/T/D)
+#define BOARD_GT2560_V4 1320 // Geeetech GT2560 Rev B for A10(M/T/D)
+#define BOARD_GT2560_V4_A20 1321 // Geeetech GT2560 Rev B for A20(M/T/D)
+#define BOARD_GT2560_V41B 1322 // Geeetech GT2560 V4.1B for A10(M/T/D)
+#define BOARD_EINSTART_S 1323 // Einstart retrofit
+#define BOARD_WANHAO_ONEPLUS 1324 // Wanhao 0ne+ i3 Mini
+#define BOARD_OVERLORD 1325 // Overlord/Overlord Pro
+#define BOARD_HJC2560C_REV1 1326 // ADIMLab Gantry v1
+#define BOARD_HJC2560C_REV2 1327 // ADIMLab Gantry v2
+#define BOARD_LEAPFROG_XEED2015 1328 // Leapfrog Xeed 2015
+#define BOARD_PICA_REVB 1329 // PICA Shield (original version)
+#define BOARD_PICA 1330 // PICA Shield (rev C or later)
+#define BOARD_INTAMSYS40 1331 // Intamsys 4.0 (Funmat HT)
+#define BOARD_MALYAN_M180 1332 // Malyan M180 Mainboard Version 2 (no display function, direct G-code only)
+#define BOARD_PROTONEER_CNC_SHIELD_V3 1333 // Mega controller & Protoneer CNC Shield V3.00
+#define BOARD_WEEDO_62A 1334 // WEEDO 62A board (TINA2, Monoprice Cadet, etc.)
//
// ATmega1281, ATmega2561
@@ -328,6 +328,7 @@
#define BOARD_BTT_MANTA_M5P_V1_0 4004 // BigTreeTech Manta M5P V1.0 (STM32G0B1RE)
#define BOARD_BTT_MANTA_M8P_V1_0 4005 // BigTreeTech Manta M8P V1.0 (STM32G0B1VE)
#define BOARD_BTT_MANTA_M8P_V1_1 4006 // BigTreeTech Manta M8P V1.1 (STM32G0B1VE)
+#define BOARD_BTT_SKRAT_V1_0 4007 // BigTreeTech SKRat V1.0 (STM32G0B1VE)
//
// STM32 ARM Cortex-M3
@@ -339,62 +340,62 @@
#define BOARD_MALYAN_M200 5003 // STM32C8 Libmaple-based STM32F1 controller
#define BOARD_STM3R_MINI 5004 // STM32F103RE Libmaple-based STM32F1 controller
#define BOARD_GTM32_PRO_VB 5005 // STM32F103VE controller
-#define BOARD_GTM32_MINI 5006 // STM32F103VE controller
-#define BOARD_GTM32_MINI_A30 5007 // STM32F103VE controller
-#define BOARD_GTM32_REV_B 5008 // STM32F103VE controller
-#define BOARD_MORPHEUS 5009 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
-#define BOARD_CHITU3D 5010 // Chitu3D (STM32F103RE)
-#define BOARD_MKS_ROBIN 5011 // MKS Robin (STM32F103ZE)
-#define BOARD_MKS_ROBIN_MINI 5012 // MKS Robin Mini (STM32F103VE)
-#define BOARD_MKS_ROBIN_NANO 5013 // MKS Robin Nano (STM32F103VE)
-#define BOARD_MKS_ROBIN_NANO_V2 5014 // MKS Robin Nano V2 (STM32F103VE)
-#define BOARD_MKS_ROBIN_LITE 5015 // MKS Robin Lite/Lite2 (STM32F103RC)
-#define BOARD_MKS_ROBIN_LITE3 5016 // MKS Robin Lite3 (STM32F103RC)
-#define BOARD_MKS_ROBIN_PRO 5017 // MKS Robin Pro (STM32F103ZE)
-#define BOARD_MKS_ROBIN_E3 5018 // MKS Robin E3 (STM32F103RC)
-#define BOARD_MKS_ROBIN_E3_V1_1 5019 // MKS Robin E3 V1.1 (STM32F103RC)
-#define BOARD_MKS_ROBIN_E3D 5020 // MKS Robin E3D (STM32F103RC)
-#define BOARD_MKS_ROBIN_E3D_V1_1 5021 // MKS Robin E3D V1.1 (STM32F103RC)
-#define BOARD_MKS_ROBIN_E3P 5022 // MKS Robin E3P (STM32F103VE)
-#define BOARD_BTT_SKR_MINI_V1_1 5023 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
-#define BOARD_BTT_SKR_MINI_E3_V1_0 5024 // BigTreeTech SKR Mini E3 (STM32F103RC)
-#define BOARD_BTT_SKR_MINI_E3_V1_2 5025 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
-#define BOARD_BTT_SKR_MINI_E3_V2_0 5026 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC / STM32F103RE)
-#define BOARD_BTT_SKR_MINI_MZ_V1_0 5027 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
-#define BOARD_BTT_SKR_E3_DIP 5028 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
-#define BOARD_BTT_SKR_CR6 5029 // BigTreeTech SKR CR6 v1.0 (STM32F103RE)
-#define BOARD_JGAURORA_A5S_A1 5030 // JGAurora A5S A1 (STM32F103ZE)
-#define BOARD_FYSETC_AIO_II 5031 // FYSETC AIO_II (STM32F103RC)
-#define BOARD_FYSETC_CHEETAH 5032 // FYSETC Cheetah (STM32F103RC)
-#define BOARD_FYSETC_CHEETAH_V12 5033 // FYSETC Cheetah V1.2 (STM32F103RC)
-#define BOARD_LONGER3D_LK 5034 // Longer3D LK1/2 - Alfawise U20/U20+/U30 (STM32F103VE)
-#define BOARD_CCROBOT_MEEB_3DP 5035 // ccrobot-online.com MEEB_3DP (STM32F103RC)
-#define BOARD_CHITU3D_V5 5036 // Chitu3D TronXY X5SA V5 Board (STM32F103ZE)
-#define BOARD_CHITU3D_V6 5037 // Chitu3D TronXY X5SA V6 Board (STM32F103ZE)
-#define BOARD_CHITU3D_V9 5038 // Chitu3D TronXY X5SA V9 Board (STM32F103ZE)
-#define BOARD_CREALITY_V4 5039 // Creality v4.x (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V422 5040 // Creality v4.2.2 (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V423 5041 // Creality v4.2.3 (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V425 5042 // Creality v4.2.5 (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V427 5043 // Creality v4.2.7 (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V4210 5044 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30
-#define BOARD_CREALITY_V431 5045 // Creality v4.3.1 (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V431_A 5046 // Creality v4.3.1a (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V431_B 5047 // Creality v4.3.1b (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V431_C 5048 // Creality v4.3.1c (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V431_D 5049 // Creality v4.3.1d (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V452 5050 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V453 5051 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
-#define BOARD_CREALITY_V521 5052 // Creality v5.2.1 (STM32F103VE) as found in the SV04
-#define BOARD_CREALITY_V24S1 5053 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) 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)
-#define BOARD_BEAST 5059 // STM32F103RE Libmaple-based controller
-#define BOARD_MINGDA_MPX_ARM_MINI 5060 // STM32F103ZE Mingda MD-16
-#define BOARD_GTM32_PRO_VD 5061 // STM32F103VE controller
+#define BOARD_GTM32_PRO_VD 5006 // STM32F103VE controller
+#define BOARD_GTM32_MINI 5007 // STM32F103VE controller
+#define BOARD_GTM32_MINI_A30 5008 // STM32F103VE controller
+#define BOARD_GTM32_REV_B 5009 // STM32F103VE controller
+#define BOARD_MORPHEUS 5010 // STM32F103C8 / STM32F103CB Libmaple-based STM32F1 controller
+#define BOARD_CHITU3D 5011 // Chitu3D (STM32F103RE)
+#define BOARD_MKS_ROBIN 5012 // MKS Robin (STM32F103ZE)
+#define BOARD_MKS_ROBIN_MINI 5013 // MKS Robin Mini (STM32F103VE)
+#define BOARD_MKS_ROBIN_NANO 5014 // MKS Robin Nano (STM32F103VE)
+#define BOARD_MKS_ROBIN_NANO_V2 5015 // MKS Robin Nano V2 (STM32F103VE)
+#define BOARD_MKS_ROBIN_LITE 5016 // MKS Robin Lite/Lite2 (STM32F103RC)
+#define BOARD_MKS_ROBIN_LITE3 5017 // MKS Robin Lite3 (STM32F103RC)
+#define BOARD_MKS_ROBIN_PRO 5018 // MKS Robin Pro (STM32F103ZE)
+#define BOARD_MKS_ROBIN_E3 5019 // MKS Robin E3 (STM32F103RC)
+#define BOARD_MKS_ROBIN_E3_V1_1 5020 // MKS Robin E3 V1.1 (STM32F103RC)
+#define BOARD_MKS_ROBIN_E3D 5021 // MKS Robin E3D (STM32F103RC)
+#define BOARD_MKS_ROBIN_E3D_V1_1 5022 // MKS Robin E3D V1.1 (STM32F103RC)
+#define BOARD_MKS_ROBIN_E3P 5023 // MKS Robin E3P (STM32F103VE)
+#define BOARD_BTT_SKR_MINI_V1_1 5024 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
+#define BOARD_BTT_SKR_MINI_E3_V1_0 5025 // BigTreeTech SKR Mini E3 (STM32F103RC)
+#define BOARD_BTT_SKR_MINI_E3_V1_2 5026 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
+#define BOARD_BTT_SKR_MINI_E3_V2_0 5027 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC / STM32F103RE)
+#define BOARD_BTT_SKR_MINI_MZ_V1_0 5028 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
+#define BOARD_BTT_SKR_E3_DIP 5029 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
+#define BOARD_BTT_SKR_CR6 5030 // BigTreeTech SKR CR6 v1.0 (STM32F103RE)
+#define BOARD_JGAURORA_A5S_A1 5031 // JGAurora A5S A1 (STM32F103ZE)
+#define BOARD_FYSETC_AIO_II 5032 // FYSETC AIO_II (STM32F103RC)
+#define BOARD_FYSETC_CHEETAH 5033 // FYSETC Cheetah (STM32F103RC)
+#define BOARD_FYSETC_CHEETAH_V12 5034 // FYSETC Cheetah V1.2 (STM32F103RC)
+#define BOARD_LONGER3D_LK 5035 // Longer3D LK1/2 - Alfawise U20/U20+/U30 (STM32F103VE)
+#define BOARD_CCROBOT_MEEB_3DP 5036 // ccrobot-online.com MEEB_3DP (STM32F103RC)
+#define BOARD_CHITU3D_V5 5037 // Chitu3D TronXY X5SA V5 Board (STM32F103ZE)
+#define BOARD_CHITU3D_V6 5038 // Chitu3D TronXY X5SA V6 Board (STM32F103ZE)
+#define BOARD_CHITU3D_V9 5039 // Chitu3D TronXY X5SA V9 Board (STM32F103ZE)
+#define BOARD_CREALITY_V4 5040 // Creality v4.x (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V422 5041 // Creality v4.2.2 (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V423 5042 // Creality v4.2.3 (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V425 5043 // Creality v4.2.5 (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V427 5044 // Creality v4.2.7 (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V4210 5045 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30
+#define BOARD_CREALITY_V431 5046 // Creality v4.3.1 (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V431_A 5047 // Creality v4.3.1a (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V431_B 5048 // Creality v4.3.1b (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V431_C 5049 // Creality v4.3.1c (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V431_D 5050 // Creality v4.3.1d (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V452 5051 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V453 5052 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
+#define BOARD_CREALITY_V521 5053 // Creality v5.2.1 (STM32F103VE) as found in the SV04
+#define BOARD_CREALITY_V24S1 5054 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) CR-FDM-v2.4.S1_v101 as found in the Ender-7
+#define BOARD_CREALITY_V24S1_301 5055 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) CR-FDM-v24S1_301 as found in the Ender-3 S1
+#define BOARD_CREALITY_V25S1 5056 // Creality v2.5.S1 (STM32F103RE) CR-FDM-v2.5.S1_100 as found in the CR-10 Smart Pro
+#define BOARD_TRIGORILLA_PRO 5057 // Trigorilla Pro (STM32F103ZE)
+#define BOARD_FLY_MINI 5058 // FLYmaker FLY MINI (STM32F103RC)
+#define BOARD_FLSUN_HISPEED 5059 // FLSUN HiSpeedV1 (STM32F103VE)
+#define BOARD_BEAST 5060 // STM32F103RE Libmaple-based controller
+#define BOARD_MINGDA_MPX_ARM_MINI 5061 // STM32F103ZE Mingda MD-16
#define BOARD_ZONESTAR_ZM3E2 5062 // Zonestar ZM3E2 (STM32F103RC)
#define BOARD_ZONESTAR_ZM3E4 5063 // Zonestar ZM3E4 V1 (STM32F103VC)
#define BOARD_ZONESTAR_ZM3E4V2 5064 // Zonestar ZM3E4 V2 (STM32F103VC)
@@ -423,8 +424,8 @@
#define BOARD_RUMBA32_V1_1 5202 // RUMBA32 STM32F446VE based controller from Aus3D
#define BOARD_RUMBA32_MKS 5203 // RUMBA32 STM32F446VE based controller from Makerbase
#define BOARD_RUMBA32_BTT 5204 // RUMBA32 STM32F446VE based controller from BIGTREETECH
-#define BOARD_BLACK_STM32F407VE 5205 // BLACK_STM32F407VE
-#define BOARD_BLACK_STM32F407ZE 5206 // BLACK_STM32F407ZE
+#define BOARD_BLACK_STM32F407VE 5205 // Black STM32F407VE development board
+#define BOARD_BLACK_STM32F407ZE 5206 // Black STM32F407ZE development board
#define BOARD_BTT_SKR_MINI_E3_V3_0_1 5207 // BigTreeTech SKR Mini E3 V3.0.1 (STM32F401RC)
#define BOARD_BTT_SKR_PRO_V1_1 5208 // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
#define BOARD_BTT_SKR_PRO_V1_2 5209 // BigTreeTech SKR Pro v1.2 (STM32F407ZG)
@@ -442,35 +443,36 @@
#define BOARD_FYSETC_S6 5221 // FYSETC S6 (STM32F446VE)
#define BOARD_FYSETC_S6_V2_0 5222 // FYSETC S6 v2.0 (STM32F446VE)
#define BOARD_FYSETC_SPIDER 5223 // FYSETC Spider (STM32F446VE)
-#define BOARD_FLYF407ZG 5224 // FLYmaker FLYF407ZG (STM32F407ZG)
-#define BOARD_MKS_ROBIN2 5225 // MKS Robin2 V1.0 (STM32F407ZE)
-#define BOARD_MKS_ROBIN_PRO_V2 5226 // MKS Robin Pro V2 (STM32F407VE)
-#define BOARD_MKS_ROBIN_NANO_V3 5227 // MKS Robin Nano V3 (STM32F407VG)
-#define BOARD_MKS_ROBIN_NANO_V3_1 5228 // MKS Robin Nano V3.1 (STM32F407VE)
-#define BOARD_MKS_MONSTER8_V1 5229 // MKS Monster8 V1 (STM32F407VE)
-#define BOARD_MKS_MONSTER8_V2 5230 // MKS Monster8 V2 (STM32F407VE)
-#define BOARD_ANET_ET4 5231 // ANET ET4 V1.x (STM32F407VG)
-#define BOARD_ANET_ET4P 5232 // ANET ET4P V1.x (STM32F407VG)
-#define BOARD_FYSETC_CHEETAH_V20 5233 // FYSETC Cheetah V2.0 (STM32F401RC)
-#define BOARD_TH3D_EZBOARD_V2 5234 // TH3D EZBoard v2.0 (STM32F405RG)
-#define BOARD_OPULO_LUMEN_REV3 5235 // Opulo Lumen PnP Controller REV3 (STM32F407VE / STM32F407VG)
-#define BOARD_MKS_ROBIN_NANO_V1_3_F4 5236 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE)
-#define BOARD_MKS_EAGLE 5237 // MKS Eagle (STM32F407VE)
-#define BOARD_ARTILLERY_RUBY 5238 // Artillery Ruby (STM32F401RC)
-#define BOARD_FYSETC_SPIDER_V2_2 5239 // FYSETC Spider V2.2 (STM32F446VE)
-#define BOARD_CREALITY_V24S1_301F4 5240 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
-#define BOARD_CREALITY_CR4NTXXC10 5241 // Creality E3 Free-runs Silent Motherboard (STM32F401RET6)
-#define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
-#define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG)
-#define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
-#define BOARD_TRONXY_CXY_446_V10 5245 // TRONXY CXY-446-V10-220413/CXY-V6-191121 (STM32F446ZE)
-#define BOARD_CREALITY_F401RE 5246 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
-#define BOARD_BLACKPILL_CUSTOM 5247 // Custom board based on STM32F401CDU6.
-#define BOARD_I3DBEEZ9_V1 5248 // I3DBEEZ9 V1 (STM32F407ZG)
-#define BOARD_MELLOW_FLY_E3_V2 5249 // Mellow Fly E3 V2 (STM32F407VG)
-#define BOARD_FYSETC_CHEETAH_V30 5250 // FYSETC Cheetah V3.0 (STM32F446RC)
+#define BOARD_FYSETC_SPIDER_V2_2 5224 // FYSETC Spider V2.2 (STM32F446VE)
+#define BOARD_FLYF407ZG 5225 // FLYmaker FLYF407ZG (STM32F407ZG)
+#define BOARD_MKS_ROBIN2 5226 // MKS Robin2 V1.0 (STM32F407ZE)
+#define BOARD_MKS_ROBIN_PRO_V2 5227 // MKS Robin Pro V2 (STM32F407VE)
+#define BOARD_MKS_ROBIN_NANO_V3 5228 // MKS Robin Nano V3 (STM32F407VG)
+#define BOARD_MKS_ROBIN_NANO_V3_1 5229 // MKS Robin Nano V3.1 (STM32F407VE)
+#define BOARD_MKS_MONSTER8_V1 5230 // MKS Monster8 V1 (STM32F407VE)
+#define BOARD_MKS_MONSTER8_V2 5231 // MKS Monster8 V2 (STM32F407VE)
+#define BOARD_ANET_ET4 5232 // ANET ET4 V1.x (STM32F407VG)
+#define BOARD_ANET_ET4P 5233 // ANET ET4P V1.x (STM32F407VG)
+#define BOARD_FYSETC_CHEETAH_V20 5234 // FYSETC Cheetah V2.0 (STM32F401RC)
+#define BOARD_FYSETC_CHEETAH_V30 5235 // FYSETC Cheetah V3.0 (STM32F446RC)
+#define BOARD_TH3D_EZBOARD_V2 5236 // TH3D EZBoard v2.0 (STM32F405RG)
+#define BOARD_OPULO_LUMEN_REV3 5237 // Opulo Lumen PnP Controller REV3 (STM32F407VE / STM32F407VG)
+#define BOARD_MKS_ROBIN_NANO_V1_3_F4 5238 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE)
+#define BOARD_MKS_EAGLE 5239 // MKS Eagle (STM32F407VE)
+#define BOARD_ARTILLERY_RUBY 5240 // Artillery Ruby (STM32F401RC)
+#define BOARD_CREALITY_V24S1_301F4 5241 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
+#define BOARD_CREALITY_CR4NTXXC10 5242 // Creality E3 Free-runs Silent Motherboard (STM32F401RET6)
+#define BOARD_OPULO_LUMEN_REV4 5243 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
+#define BOARD_FYSETC_SPIDER_KING407 5244 // FYSETC Spider King407 (STM32F407ZG)
+#define BOARD_MKS_SKIPR_V1 5245 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
+#define BOARD_TRONXY_CXY_446_V10 5246 // TRONXY CXY-446-V10-220413/CXY-V6-191121 (STM32F446ZE)
+#define BOARD_CREALITY_F401RE 5247 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
+#define BOARD_BLACKPILL_CUSTOM 5248 // Custom board based on STM32F401CDU6.
+#define BOARD_I3DBEEZ9_V1 5249 // I3DBEEZ9 V1 (STM32F407ZG)
+#define BOARD_MELLOW_FLY_E3_V2 5250 // Mellow Fly E3 V2 (STM32F407VG)
#define BOARD_BLACKBEEZMINI_V1 5251 // BlackBeezMini V1 (STM32F401CCU6)
#define BOARD_XTLW_CLIMBER_8TH 5252 // XTLW Climber-8th (STM32F407VGT6)
+#define BOARD_FLY_RRF_E3_V1 5253 // Fly RRF E3 V1.0 (STM32F407VG)
//
// Other ARM Cortex-M4
@@ -482,18 +484,18 @@
//
#define BOARD_REMRAM_V1 6000 // RemRam v1
-#define BOARD_TEENSY41 6001 // Teensy 4.1
-#define BOARD_T41U5XBB 6002 // T41U5XBB Teensy 4.1 breakout board
-#define BOARD_NUCLEO_F767ZI 6003 // ST NUCLEO-F767ZI Dev Board
-#define BOARD_BTT_SKR_SE_BX_V2 6004 // BigTreeTech SKR SE BX V2.0 (STM32H743II)
-#define BOARD_BTT_SKR_SE_BX_V3 6005 // BigTreeTech SKR SE BX V3.0 (STM32H743II)
-#define BOARD_BTT_SKR_V3_0 6006 // BigTreeTech SKR V3.0 (STM32H743VI / STM32H723VG)
-#define BOARD_BTT_SKR_V3_0_EZ 6007 // BigTreeTech SKR V3.0 EZ (STM32H743VI / STM32H723VG)
-#define BOARD_BTT_OCTOPUS_MAX_EZ_V1_0 6008 // BigTreeTech Octopus Max EZ V1.0 (STM32H723ZE)
-#define BOARD_BTT_OCTOPUS_PRO_V1_0_1 6009 // BigTreeTech Octopus Pro v1.0.1 (STM32H723ZE)
-#define BOARD_BTT_OCTOPUS_PRO_V1_1 6010 // BigTreeTech Octopus Pro v1.1 (STM32H723ZE)
-#define BOARD_BTT_MANTA_M8P_V2_0 6011 // BigTreeTech Manta M8P V2.0 (STM32H723ZE)
-#define BOARD_BTT_KRAKEN_V1_0 6012 // BigTreeTech Kraken v1.0 (STM32H723ZG)
+#define BOARD_NUCLEO_F767ZI 6001 // ST NUCLEO-F767ZI Dev Board
+#define BOARD_BTT_SKR_SE_BX_V2 6002 // BigTreeTech SKR SE BX V2.0 (STM32H743II)
+#define BOARD_BTT_SKR_SE_BX_V3 6003 // BigTreeTech SKR SE BX V3.0 (STM32H743II)
+#define BOARD_BTT_SKR_V3_0 6004 // BigTreeTech SKR V3.0 (STM32H743VI / STM32H723VG)
+#define BOARD_BTT_SKR_V3_0_EZ 6005 // BigTreeTech SKR V3.0 EZ (STM32H743VI / STM32H723VG)
+#define BOARD_BTT_OCTOPUS_MAX_EZ_V1_0 6006 // BigTreeTech Octopus Max EZ V1.0 (STM32H723ZE)
+#define BOARD_BTT_OCTOPUS_PRO_V1_0_1 6007 // BigTreeTech Octopus Pro v1.0.1 (STM32H723ZE)
+#define BOARD_BTT_OCTOPUS_PRO_V1_1 6008 // BigTreeTech Octopus Pro v1.1 (STM32H723ZE)
+#define BOARD_BTT_MANTA_M8P_V2_0 6009 // BigTreeTech Manta M8P V2.0 (STM32H723ZE)
+#define BOARD_BTT_KRAKEN_V1_0 6010 // BigTreeTech Kraken v1.0 (STM32H723ZG)
+#define BOARD_TEENSY41 6011 // Teensy 4.1
+#define BOARD_T41U5XBB 6012 // T41U5XBB Teensy 4.1 breakout board
//
// Espressif ESP32 WiFi
@@ -533,6 +535,13 @@
#define BOARD_AQUILA_V101 7200 // Voxelab Aquila V1.0.0/V1.0.1/V1.0.2/V1.0.3 as found in the Voxelab Aquila X2 and C2
#define BOARD_CREALITY_ENDER2P_V24S4 7201 // Creality Ender 2 Pro v2.4.S4_170 (HC32f460kcta)
+//
+// Raspberry Pi
+//
+
+#define BOARD_RP2040 6200 // Generic RP2040 Test board
+#define BOARD_BTT_SKR_PICO 6201 // BigTreeTech SKR Pico 1.x
+
//
// Custom board
//
@@ -543,7 +552,7 @@
// Simulations
//
-#define BOARD_SIMULATED 9999
+#define BOARD_SIMULATED 9999 // Simulated 3D Printer with LCD / TFT for development
#define _MB_1(B) (defined(BOARD_##B) && MOTHERBOARD==BOARD_##B)
#define MB(V...) DO(MB,||,V)
diff --git a/firmware/Marlin/src/core/drivers.h b/firmware/Marlin/src/core/drivers.h
index c4417aa..c54e42c 100644
--- a/firmware/Marlin/src/core/drivers.h
+++ b/firmware/Marlin/src/core/drivers.h
@@ -188,3 +188,16 @@
|| HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE)
#define HAS_DIAG_PINS 1
#endif
+
+// Hybrid Threshold ranges
+#define THRS_TMC2100 65535
+#define THRS_TMC2130 65535
+#define THRS_TMC2160 255
+#define THRS_TMC2208 255
+#define THRS_TMC2209 255
+#define THRS_TMC2660 65535
+#define THRS_TMC5130 65535
+#define THRS_TMC5160 65535
+
+#define _DRIVER_THRS(V) CAT(THRS_, V)
+#define STEPPER_MAX_THRS(S) _DRIVER_THRS(S##_DRIVER_TYPE)
diff --git a/firmware/Marlin/src/core/language.h b/firmware/Marlin/src/core/language.h
index 2736a78..f64c751 100644
--- a/firmware/Marlin/src/core/language.h
+++ b/firmware/Marlin/src/core/language.h
@@ -191,6 +191,7 @@
#define STR_ERR_HOTEND_TOO_COLD "Hotend too cold"
#define STR_ERR_EEPROM_WRITE "Error writing to EEPROM!"
#define STR_ERR_EEPROM_CORRUPT "EEPROM Corrupt"
+#define STR_EEPROM_INITIALIZED "EEPROM Initialized"
#define STR_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle"
#define STR_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button"
@@ -290,6 +291,7 @@
#define STR_MAX_ACCELERATION "Max Acceleration (units/s2)"
#define STR_MAX_FEEDRATES "Max feedrates (units/s)"
#define STR_ACCELERATION_P_R_T "Acceleration (units/s2) (P R T)"
+#define STR_HOMING_FEEDRATE "Homing Feedrate"
#define STR_TOOL_CHANGING "Tool-changing"
#define STR_HOTEND_OFFSETS "Hotend offsets"
#define STR_SERVO_ANGLES "Servo Angles"
@@ -322,6 +324,38 @@
#define STR_TEMPERATURE_UNITS "Temperature Units"
#define STR_USER_THERMISTORS "User thermistors"
#define STR_DELAYED_POWEROFF "Delayed poweroff"
+#define STR_STORED_MACROS "Stored macros"
+
+//
+// General axis names
+//
+#if HAS_X_AXIS
+ #define AXIS1_NAME 'X'
+#endif
+#if HAS_Y_AXIS
+ #define AXIS2_NAME 'Y'
+#endif
+#if HAS_Z_AXIS
+ #define AXIS3_NAME 'Z'
+#endif
+#define STR_X "X"
+#define STR_Y "Y"
+#define STR_Z "Z"
+#define STR_E "E"
+#if IS_KINEMATIC
+ #define STR_A "A"
+ #define STR_B "B"
+ #define STR_C "C"
+#else
+ #define STR_A STR_X
+ #define STR_B STR_Y
+ #define STR_C STR_Z
+#endif
+#define STR_X2 STR_A "2"
+#define STR_Y2 STR_B "2"
+#define STR_Z2 STR_C "2"
+#define STR_Z3 STR_C "3"
+#define STR_Z4 STR_C "4"
//
// Endstop Names used by Endstops::report_states
@@ -354,29 +388,8 @@
#define STR_Z_PROBE "z_probe"
#define STR_PROBE_EN "probe_en"
#define STR_FILAMENT "filament"
-
#define STR_CALIBRATION "calibration"
-// General axis names
-#define STR_X "X"
-#define STR_Y "Y"
-#define STR_Z "Z"
-#define STR_E "E"
-#if IS_KINEMATIC
- #define STR_A "A"
- #define STR_B "B"
- #define STR_C "C"
-#else
- #define STR_A "X"
- #define STR_B "Y"
- #define STR_C "Z"
-#endif
-#define STR_X2 "X2"
-#define STR_Y2 "Y2"
-#define STR_Z2 "Z2"
-#define STR_Z3 "Z3"
-#define STR_Z4 "Z4"
-
// Extra Axis and Endstop Names
#if HAS_I_AXIS
#if AXIS4_NAME == 'A'
diff --git a/firmware/Marlin/src/core/multi_language.h b/firmware/Marlin/src/core/multi_language.h
index 2c0eb7a..81a1754 100644
--- a/firmware/Marlin/src/core/multi_language.h
+++ b/firmware/Marlin/src/core/multi_language.h
@@ -91,6 +91,7 @@ typedef const char Language_Str[];
#define LANG_CHARSIZE GET_TEXT(CHARSIZE)
#define USE_WIDE_GLYPH (LANG_CHARSIZE > 2)
+// The final "\0" is added invisibly by the compiler
#define MSG_1_LINE(A) A "\0" "\0"
#define MSG_2_LINE(A,B) A "\0" B "\0"
#define MSG_3_LINE(A,B,C) A "\0" B "\0" C
diff --git a/firmware/Marlin/src/core/serial.cpp b/firmware/Marlin/src/core/serial.cpp
index 5373f5e..8a83783 100644
--- a/firmware/Marlin/src/core/serial.cpp
+++ b/firmware/Marlin/src/core/serial.cpp
@@ -27,6 +27,8 @@
#include "../feature/ethernet.h"
#endif
+#include // dtostrf
+
// Echo commands to the terminal by default in dev mode
uint8_t marlin_debug_flags = TERN(MARLIN_DEV_MODE, MARLIN_DEBUG_ECHO, MARLIN_DEBUG_NONE);
diff --git a/firmware/Marlin/src/core/utility.cpp b/firmware/Marlin/src/core/utility.cpp
index b555d9f..6a8452b 100644
--- a/firmware/Marlin/src/core/utility.cpp
+++ b/firmware/Marlin/src/core/utility.cpp
@@ -60,29 +60,38 @@ void safe_delay(millis_t ms) {
#include "../feature/bedlevel/bedlevel.h"
void log_machine_info() {
- SERIAL_ECHOLNPGM("Machine Type: "
- TERN_(DELTA, "Delta")
- TERN_(IS_SCARA, "SCARA")
- TERN_(IS_CORE, "Core")
- TERN_(MARKFORGED_XY, "MarkForgedXY")
- TERN_(MARKFORGED_YX, "MarkForgedYX")
- TERN_(IS_CARTESIAN, "Cartesian")
+ SERIAL_ECHOLNPGM("Machine Type:"
+ TERN_(DELTA, " Delta")
+ TERN_(IS_SCARA, " SCARA")
+ TERN_(AXEL_TPARA, " TPARA")
+ TERN_(IS_CORE, " Core")
+ TERN_(BELTPRINTER, " Belt Printer")
+ TERN_(MARKFORGED_XY, " MarkForgedXY")
+ TERN_(MARKFORGED_YX, " MarkForgedYX")
+ TERN_(POLAR, " Polar")
+ TERN_(POLARGRAPH, " Polargraph")
+ TERN_(ARTICULATED_ROBOT_ARM, " Robot Arm")
+ TERN_(FOAMCUTTER_XYUV, " Foam Cutter")
+ TERN_(IS_CARTESIAN, " Cartesian")
);
SERIAL_ECHOLNPGM("Probe: "
- TERN_(PROBE_MANUALLY, "PROBE_MANUALLY")
- TERN_(NOZZLE_AS_PROBE, "NOZZLE_AS_PROBE")
- TERN_(FIX_MOUNTED_PROBE, "FIX_MOUNTED_PROBE")
- TERN_(HAS_Z_SERVO_PROBE, TERN(BLTOUCH, "BLTOUCH", "SERVO PROBE"))
- TERN_(BD_SENSOR, "BD_SENSOR")
- TERN_(TOUCH_MI_PROBE, "TOUCH_MI_PROBE")
- TERN_(Z_PROBE_SLED, "Z_PROBE_SLED")
- TERN_(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY")
- TERN_(SOLENOID_PROBE, "SOLENOID_PROBE")
- TERN_(MAGLEV4, "MAGLEV4")
- TERN_(BIQU_MICROPROBE_V1, "BIQU_MICROPROBE_V1")
- TERN_(BIQU_MICROPROBE_V2, "BIQU_MICROPROBE_V2")
- IF_DISABLED(PROBE_SELECTED, "NONE")
+ TERN_(PROBE_MANUALLY, "PROBE_MANUALLY")
+ TERN_(NOZZLE_AS_PROBE, "NOZZLE_AS_PROBE")
+ TERN_(FIX_MOUNTED_PROBE, "FIX_MOUNTED_PROBE")
+ TERN_(HAS_Z_SERVO_PROBE, TERN(BLTOUCH, "BLTOUCH", "SERVO PROBE"))
+ TERN_(BD_SENSOR, "BD_SENSOR")
+ TERN_(TOUCH_MI_PROBE, "TOUCH_MI_PROBE")
+ TERN_(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY")
+ TERN_(Z_PROBE_SLED, "Z_PROBE_SLED")
+ TERN_(RACK_AND_PINION_PROBE, "RACK_AND_PINION_PROBE")
+ TERN_(SOLENOID_PROBE, "SOLENOID_PROBE")
+ TERN_(SENSORLESS_PROBING, "SENSORLESS_PROBING")
+ TERN_(MAGLEV4, "MAGLEV4")
+ TERN_(MAG_MOUNTED_PROBE, "MAG_MOUNTED_PROBE")
+ TERN_(BIQU_MICROPROBE_V1, "BIQU_MICROPROBE_V1")
+ TERN_(BIQU_MICROPROBE_V2, "BIQU_MICROPROBE_V2")
+ IF_DISABLED(PROBE_SELECTED, "NONE")
);
#if HAS_BED_PROBE
diff --git a/firmware/Marlin/src/feature/babystep.cpp b/firmware/Marlin/src/feature/babystep.cpp
index c671726..014ccea 100644
--- a/firmware/Marlin/src/feature/babystep.cpp
+++ b/firmware/Marlin/src/feature/babystep.cpp
@@ -60,7 +60,7 @@ void Babystep::add_mm(const AxisEnum axis, const_float_t mm) {
#if ENABLED(BD_SENSOR)
void Babystep::set_mm(const AxisEnum axis, const_float_t mm) {
- //if (DISABLED(BABYSTEP_WITHOUT_HOMING) && axes_should_home(_BV(axis))) return;
+ //if (DISABLED(BABYSTEP_WITHOUT_HOMING) && axis_should_home(axis)) return;
const int16_t distance = mm * planner.settings.axis_steps_per_mm[axis];
accum = distance; // Count up babysteps for the UI
steps[BS_AXIS_IND(axis)] = distance;
@@ -70,8 +70,12 @@ void Babystep::add_mm(const AxisEnum axis, const_float_t mm) {
}
#endif
+bool Babystep::can_babystep(const AxisEnum axis) {
+ return (ENABLED(BABYSTEP_WITHOUT_HOMING) || !axis_should_home(axis));
+}
+
void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
- if (DISABLED(BABYSTEP_WITHOUT_HOMING) && axes_should_home(_BV(axis))) return;
+ if (!can_babystep(axis)) return;
accum += distance; // Count up babysteps for the UI
steps[BS_AXIS_IND(axis)] += distance;
diff --git a/firmware/Marlin/src/feature/babystep.h b/firmware/Marlin/src/feature/babystep.h
index 38a19a3..666a0ee 100644
--- a/firmware/Marlin/src/feature/babystep.h
+++ b/firmware/Marlin/src/feature/babystep.h
@@ -59,6 +59,7 @@ public:
}
#endif
+ static bool can_babystep(const AxisEnum axis);
static void add_steps(const AxisEnum axis, const int16_t distance);
static void add_mm(const AxisEnum axis, const_float_t mm);
diff --git a/firmware/Marlin/src/feature/cancel_object.cpp b/firmware/Marlin/src/feature/cancel_object.cpp
index 0040f6e..818661b 100644
--- a/firmware/Marlin/src/feature/cancel_object.cpp
+++ b/firmware/Marlin/src/feature/cancel_object.cpp
@@ -30,23 +30,20 @@
CancelObject cancelable;
-int8_t CancelObject::object_count, // = 0
- CancelObject::active_object = -1;
-uint32_t CancelObject::canceled; // = 0x0000
-bool CancelObject::skipping; // = false
+cancel_state_t CancelObject::state;
void CancelObject::set_active_object(const int8_t obj) {
- active_object = obj;
+ state.active_object = obj;
if (WITHIN(obj, 0, 31)) {
- if (obj >= object_count) object_count = obj + 1;
- skipping = TEST(canceled, obj);
+ if (obj >= state.object_count) state.object_count = obj + 1;
+ state.skipping = TEST(state.canceled, obj);
}
else
- skipping = false;
+ state.skipping = false;
#if ALL(HAS_STATUS_MESSAGE, CANCEL_OBJECTS_REPORTING)
- if (active_object >= 0)
- ui.set_status(MString<30>(GET_TEXT_F(MSG_PRINTING_OBJECT), ' ', active_object));
+ if (state.active_object >= 0)
+ ui.set_status(MString<30>(GET_TEXT_F(MSG_PRINTING_OBJECT), ' ', state.active_object));
else
ui.reset_status();
#endif
@@ -54,29 +51,29 @@ void CancelObject::set_active_object(const int8_t obj) {
void CancelObject::cancel_object(const int8_t obj) {
if (WITHIN(obj, 0, 31)) {
- SBI(canceled, obj);
- if (obj == active_object) skipping = true;
+ SBI(state.canceled, obj);
+ if (obj == state.active_object) state.skipping = true;
}
}
void CancelObject::uncancel_object(const int8_t obj) {
if (WITHIN(obj, 0, 31)) {
- CBI(canceled, obj);
- if (obj == active_object) skipping = false;
+ CBI(state.canceled, obj);
+ if (obj == state.active_object) state.skipping = false;
}
}
void CancelObject::report() {
- if (active_object >= 0)
- SERIAL_ECHO_MSG("Active Object: ", active_object);
+ if (state.active_object >= 0)
+ SERIAL_ECHO_MSG("Active Object: ", state.active_object);
- if (canceled) {
- SERIAL_ECHO_START();
- SERIAL_ECHOPGM("Canceled:");
- for (int i = 0; i < object_count; i++)
- if (TEST(canceled, i)) { SERIAL_CHAR(' '); SERIAL_ECHO(i); }
- SERIAL_EOL();
- }
+ if (state.canceled == 0x0000) return;
+
+ SERIAL_ECHO_START();
+ SERIAL_ECHOPGM("Canceled:");
+ for (int i = 0; i < state.object_count; i++)
+ if (TEST(state.canceled, i)) { SERIAL_CHAR(' '); SERIAL_ECHO(i); }
+ SERIAL_EOL();
}
#endif // CANCEL_OBJECTS
diff --git a/firmware/Marlin/src/feature/cancel_object.h b/firmware/Marlin/src/feature/cancel_object.h
index 62548a3..7f04612 100644
--- a/firmware/Marlin/src/feature/cancel_object.h
+++ b/firmware/Marlin/src/feature/cancel_object.h
@@ -23,19 +23,23 @@
#include
+typedef struct CancelState {
+ bool skipping = false;
+ int8_t object_count = 0, active_object = 0;
+ uint32_t canceled = 0x0000;
+} cancel_state_t;
+
class CancelObject {
public:
- static bool skipping;
- static int8_t object_count, active_object;
- static uint32_t canceled;
- static void set_active_object(const int8_t obj);
+ static cancel_state_t state;
+ static void set_active_object(const int8_t obj=state.active_object);
static void cancel_object(const int8_t obj);
static void uncancel_object(const int8_t obj);
static void report();
- static bool is_canceled(const int8_t obj) { return TEST(canceled, obj); }
+ static bool is_canceled(const int8_t obj) { return TEST(state.canceled, obj); }
static void clear_active_object() { set_active_object(-1); }
- static void cancel_active_object() { cancel_object(active_object); }
- static void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); }
+ static void cancel_active_object() { cancel_object(state.active_object); }
+ static void reset() { state.canceled = 0x0000; state.object_count = 0; clear_active_object(); }
};
extern CancelObject cancelable;
diff --git a/firmware/Marlin/src/feature/controllerfan.cpp b/firmware/Marlin/src/feature/controllerfan.cpp
index acbae45..323d988 100644
--- a/firmware/Marlin/src/feature/controllerfan.cpp
+++ b/firmware/Marlin/src/feature/controllerfan.cpp
@@ -70,7 +70,9 @@ void ControllerFan::update() {
*/
const ena_mask_t axis_mask = TERN(CONTROLLER_FAN_USE_Z_ONLY, _BV(Z_AXIS), (ena_mask_t)~TERN0(CONTROLLER_FAN_IGNORE_Z, _BV(Z_AXIS)));
if ( (stepper.axis_enabled.bits & axis_mask)
- || TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0)
+ #if ALL(HAS_HEATED_BED, CONTROLLER_FAN_BED_HEATING)
+ || thermalManager.temp_bed.soft_pwm_amount > 0
+ #endif
#ifdef CONTROLLER_FAN_MIN_BOARD_TEMP
|| thermalManager.wholeDegBoard() >= CONTROLLER_FAN_MIN_BOARD_TEMP
#endif
diff --git a/firmware/Marlin/src/feature/e_parser.cpp b/firmware/Marlin/src/feature/e_parser.cpp
index da193ed..e249d81 100644
--- a/firmware/Marlin/src/feature/e_parser.cpp
+++ b/firmware/Marlin/src/feature/e_parser.cpp
@@ -61,9 +61,13 @@ extern bool wait_for_user, wait_for_heatup;
#endif
void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
+ auto uppercase = [](char c) {
+ return TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')) ? c + 'A' - 'a' : c;
+ };
+
switch (state) {
case EP_RESET:
- switch (c) {
+ switch (uppercase(c)) {
case ' ': case '\n': case '\r': break;
case 'N': state = EP_N; break;
case 'M': state = EP_M; break;
@@ -81,7 +85,7 @@ void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
break;
case EP_N:
- switch (c) {
+ switch (uppercase(c)) {
case '0' ... '9':
case '-': case ' ': break;
case 'M': state = EP_M; break;
@@ -152,20 +156,8 @@ void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
#endif
#if ENABLED(EP_BABYSTEPPING)
- case EP_M2:
- switch (c) {
- case '9': state = EP_M29; break;
- default: state = EP_IGNORE;
- }
- break;
-
- case EP_M29:
- switch (c) {
- case '3': state = EP_M293; break;
- case '4': state = EP_M294; break;
- default: state = EP_IGNORE;
- }
- break;
+ case EP_M2: state = (c == '9') ? EP_M29 : EP_IGNORE; break;
+ case EP_M29: state = (c == '3') ? EP_M293 : (c == '4') ? EP_M294 : EP_IGNORE; break;
#endif
#if ENABLED(HOST_PROMPT_SUPPORT)
@@ -174,7 +166,7 @@ void EmergencyParser::update(EmergencyParser::State &state, const uint8_t c) {
case EP_M87: state = (c == '6') ? EP_M876 : EP_IGNORE; break;
case EP_M876:
- switch (c) {
+ switch (uppercase(c)) {
case ' ': break;
case 'S': state = EP_M876S; break;
default: state = EP_IGNORE; break;
diff --git a/firmware/Marlin/src/feature/easythreed_ui.cpp b/firmware/Marlin/src/feature/easythreed_ui.cpp
index 39248bf..9617c62 100644
--- a/firmware/Marlin/src/feature/easythreed_ui.cpp
+++ b/firmware/Marlin/src/feature/easythreed_ui.cpp
@@ -189,7 +189,7 @@ void EasythreedUI::printButton() {
blink_interval_ms = LED_BLINK_2; // Blink the indicator LED at 1 second intervals
print_key_flag = PF_PAUSE; // The "Print" button now pauses the print
card.mount(); // Force SD card to mount - now!
- if (!card.isMounted) { // Failed to mount?
+ if (!card.isMounted()) { // Failed to mount?
blink_interval_ms = LED_OFF; // Turn off LED
print_key_flag = PF_START;
return; // Bail out
diff --git a/firmware/Marlin/src/feature/encoder_i2c.cpp b/firmware/Marlin/src/feature/encoder_i2c.cpp
index 1351784..55bde4c 100644
--- a/firmware/Marlin/src/feature/encoder_i2c.cpp
+++ b/firmware/Marlin/src/feature/encoder_i2c.cpp
@@ -36,7 +36,7 @@
#include "../module/stepper.h"
#include "../gcode/parser.h"
-#include "../feature/babystep.h"
+#include "babystep.h"
#include
diff --git a/firmware/Marlin/src/feature/hotend_idle.cpp b/firmware/Marlin/src/feature/hotend_idle.cpp
index 050898e..eb16781 100644
--- a/firmware/Marlin/src/feature/hotend_idle.cpp
+++ b/firmware/Marlin/src/feature/hotend_idle.cpp
@@ -40,7 +40,7 @@
HotendIdleProtection hotend_idle;
millis_t HotendIdleProtection::next_protect_ms = 0;
-hotend_idle_settings_t HotendIdleProtection::cfg; // Initialized by settings.load()
+hotend_idle_settings_t HotendIdleProtection::cfg; // Initialized by settings.load
void HotendIdleProtection::check_hotends(const millis_t &ms) {
const bool busy = (TERN0(HAS_RESUME_CONTINUE, wait_for_user) || planner.has_blocks_queued());
diff --git a/firmware/Marlin/src/feature/leds/leds.cpp b/firmware/Marlin/src/feature/leds/leds.cpp
index 2f0e5d9..0c70253 100644
--- a/firmware/Marlin/src/feature/leds/leds.cpp
+++ b/firmware/Marlin/src/feature/leds/leds.cpp
@@ -31,7 +31,7 @@
#include "leds.h"
#if ANY(CASE_LIGHT_USE_RGB_LED, CASE_LIGHT_USE_NEOPIXEL)
- #include "../../feature/caselight.h"
+ #include "../caselight.h"
#endif
#if ENABLED(LED_COLOR_PRESETS)
diff --git a/firmware/Marlin/src/feature/max7219.cpp b/firmware/Marlin/src/feature/max7219.cpp
index 64960f1..a98248c 100644
--- a/firmware/Marlin/src/feature/max7219.cpp
+++ b/firmware/Marlin/src/feature/max7219.cpp
@@ -744,7 +744,6 @@ void Max7219::idle_tasks() {
#endif
#ifdef MAX7219_DEBUG_PLANNER_QUEUE
- static int16_t last_depth = 0;
const int16_t current_depth = BLOCK_MOD(head - tail + (BLOCK_BUFFER_SIZE)) & 0xF;
if (current_depth != last_depth) {
quantity16(MAX7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth, &row_change_mask);
diff --git a/firmware/Marlin/src/feature/mixing.cpp b/firmware/Marlin/src/feature/mixing.cpp
index 4021393..f3fb2d0 100644
--- a/firmware/Marlin/src/feature/mixing.cpp
+++ b/firmware/Marlin/src/feature/mixing.cpp
@@ -28,10 +28,6 @@
Mixer mixer;
-#ifdef MIXER_NORMALIZER_DEBUG
- #include "../core/serial.h"
-#endif
-
// Used up to Planner level
uint_fast8_t Mixer::selected_vtool = 0;
float Mixer::collector[MIXING_STEPPERS]; // mix proportion. 0.0 = off, otherwise <= COLOR_A_MASK.
diff --git a/firmware/Marlin/src/feature/mmu/mmu2.cpp b/firmware/Marlin/src/feature/mmu/mmu2.cpp
index 562cc33..d5f115e 100644
--- a/firmware/Marlin/src/feature/mmu/mmu2.cpp
+++ b/firmware/Marlin/src/feature/mmu/mmu2.cpp
@@ -24,6 +24,10 @@
#if HAS_PRUSA_MMU2
+/**
+ * mmu2.cpp - Support for Průša MMU2 and MMU2S
+ */
+
#include "mmu2.h"
#include "../../lcd/menu/menu_mmu2.h"
@@ -39,14 +43,14 @@ MMU2 mmu2;
#include "../../MarlinCore.h"
#if ENABLED(HOST_PROMPT_SUPPORT)
- #include "../../feature/host_actions.h"
+ #include "../host_actions.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif
-#define DEBUG_OUT ENABLED(MMU2_DEBUG)
+#define DEBUG_OUT ENABLED(MMU_DEBUG)
#include "../../core/debug_out.h"
#define MMU_TODELAY 100
@@ -57,7 +61,7 @@ MMU2 mmu2;
#define MMU2_SEND(S) tx_str(F(S "\n"))
#define MMU2_RECV(S) rx_str(F(S "\n"))
-#if ENABLED(MMU_EXTRUDER_SENSOR)
+#if ENABLED(MMU2_EXTRUDER_SENSOR)
uint8_t mmu_idl_sens = 0;
static bool mmu_loading_flag = false;
#endif
@@ -106,12 +110,12 @@ void MMU2::init() {
set_runout_valid(false);
- #if PIN_EXISTS(MMU2_RST)
- WRITE(MMU2_RST_PIN, HIGH);
- SET_OUTPUT(MMU2_RST_PIN);
+ #if PIN_EXISTS(MMU_RST)
+ WRITE(MMU_RST_PIN, HIGH);
+ SET_OUTPUT(MMU_RST_PIN);
#endif
- MMU2_SERIAL.begin(MMU_BAUD);
+ MMU_SERIAL.begin(MMU_BAUD);
extruder = MMU2_NO_TOOL;
safe_delay(10);
@@ -123,10 +127,10 @@ void MMU2::init() {
void MMU2::reset() {
DEBUG_ECHOLNPGM("MMU <= reset");
- #if PIN_EXISTS(MMU2_RST)
- WRITE(MMU2_RST_PIN, LOW);
+ #if PIN_EXISTS(MMU_RST)
+ WRITE(MMU_RST_PIN, LOW);
safe_delay(20);
- WRITE(MMU2_RST_PIN, HIGH);
+ WRITE(MMU_RST_PIN, HIGH);
#else
MMU2_SEND("X0"); // Send soft reset
#endif
@@ -134,7 +138,7 @@ void MMU2::reset() {
int8_t MMU2::get_current_tool() { return extruder == MMU2_NO_TOOL ? -1 : extruder; }
-#if ANY(HAS_PRUSA_MMU2S, MMU_EXTRUDER_SENSOR)
+#if ANY(HAS_PRUSA_MMU2S, MMU2_EXTRUDER_SENSOR)
#define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE)
#else
#define FILAMENT_PRESENT() true
@@ -226,7 +230,7 @@ void MMU2::mmu_loop() {
const int filament = cmd - MMU_CMD_T0;
DEBUG_ECHOLNPGM("MMU <= T", filament);
tx_printf(F("T%d\n"), filament);
- TERN_(MMU_EXTRUDER_SENSOR, mmu_idl_sens = 1); // enable idler sensor, if any
+ TERN_(MMU2_EXTRUDER_SENSOR, mmu_idl_sens = 1); // enable idler sensor, if any
state = 3; // wait for response
}
else if (WITHIN(cmd, MMU_CMD_L0, MMU_CMD_L0 + EXTRUDERS - 1)) {
@@ -299,7 +303,7 @@ void MMU2::mmu_loop() {
break;
case 3: // response to mmu commands
- #if ENABLED(MMU_EXTRUDER_SENSOR)
+ #if ENABLED(MMU2_EXTRUDER_SENSOR)
if (mmu_idl_sens) {
if (FILAMENT_PRESENT() && mmu_loading_flag) {
DEBUG_ECHOLNPGM("MMU <= 'A'");
@@ -361,8 +365,8 @@ bool MMU2::rx_str(FSTR_P fstr) {
uint8_t i = strlen(rx_buffer);
- while (MMU2_SERIAL.available()) {
- rx_buffer[i++] = MMU2_SERIAL.read();
+ while (MMU_SERIAL.available()) {
+ rx_buffer[i++] = MMU_SERIAL.read();
if (i == sizeof(rx_buffer) - 1) {
DEBUG_ECHOLNPGM("rx buffer overrun");
@@ -393,7 +397,7 @@ bool MMU2::rx_str(FSTR_P fstr) {
void MMU2::tx_str(FSTR_P fstr) {
clear_rx_buffer();
PGM_P pstr = FTOP(fstr);
- while (const char c = pgm_read_byte(pstr)) { MMU2_SERIAL.write(c); pstr++; }
+ while (const char c = pgm_read_byte(pstr)) { MMU_SERIAL.write(c); pstr++; }
prev_request = millis();
}
@@ -403,7 +407,7 @@ void MMU2::tx_str(FSTR_P fstr) {
void MMU2::tx_printf(FSTR_P format, int argument = -1) {
clear_rx_buffer();
const uint8_t len = sprintf_P(tx_buffer, FTOP(format), argument);
- for (uint8_t i = 0; i < len; ++i) MMU2_SERIAL.write(tx_buffer[i]);
+ for (uint8_t i = 0; i < len; ++i) MMU_SERIAL.write(tx_buffer[i]);
prev_request = millis();
}
@@ -413,7 +417,7 @@ void MMU2::tx_printf(FSTR_P format, int argument = -1) {
void MMU2::tx_printf(FSTR_P format, int argument1, int argument2) {
clear_rx_buffer();
const uint8_t len = sprintf_P(tx_buffer, FTOP(format), argument1, argument2);
- for (uint8_t i = 0; i < len; ++i) MMU2_SERIAL.write(tx_buffer[i]);
+ for (uint8_t i = 0; i < len; ++i) MMU_SERIAL.write(tx_buffer[i]);
prev_request = millis();
}
@@ -421,7 +425,7 @@ void MMU2::tx_printf(FSTR_P format, int argument1, int argument2) {
* Empty the rx buffer
*/
void MMU2::clear_rx_buffer() {
- while (MMU2_SERIAL.available()) MMU2_SERIAL.read();
+ while (MMU_SERIAL.available()) MMU_SERIAL.read();
rx_buffer[0] = '\0';
}
@@ -563,7 +567,7 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
set_runout_valid(true);
}
-#elif ENABLED(MMU_EXTRUDER_SENSOR)
+#elif ENABLED(MMU2_EXTRUDER_SENSOR)
/**
* Handle tool change
@@ -656,7 +660,7 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
void MMU2::mmu_continue_loading() {
// Try to load the filament a limited number of times
bool fil_present = 0;
- for (uint8_t i = 0; i < MMU_LOADING_ATTEMPTS_NR; i++) {
+ for (uint8_t i = 0; i < MMU2_LOADING_ATTEMPTS_NR; i++) {
DEBUG_ECHOLNPGM("Load attempt #", i + 1);
// Done as soon as filament is present
@@ -688,7 +692,7 @@ inline void beep_bad_cmd() { BUZZ(400, 40); }
mmu_idl_sens = 0;
}
-#else // !HAS_PRUSA_MMU2S && !MMU_EXTRUDER_SENSOR
+#else // !HAS_PRUSA_MMU2S && !MMU2_EXTRUDER_SENSOR
/**
* Handle tool change
@@ -891,8 +895,8 @@ void MMU2::filament_runout() {
}
bool MMU2::can_load() {
- static const E_Step can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE },
- can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE };
+ static constexpr E_Step can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE },
+ can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE };
execute_extruder_sequence(can_load_sequence, COUNT(can_load_sequence));
@@ -1041,7 +1045,8 @@ void MMU2::load_to_nozzle_sequence() {
execute_extruder_sequence(sequence, COUNT(sequence));
}
-void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) {
+void MMU2::execute_extruder_sequence(const E_Step * const sequence, const uint8_t steps) {
+
planner.synchronize();
const E_Step *step = sequence;
diff --git a/firmware/Marlin/src/feature/mmu/mmu2.h b/firmware/Marlin/src/feature/mmu/mmu2.h
index 2c9fd33..117b3a6 100644
--- a/firmware/Marlin/src/feature/mmu/mmu2.h
+++ b/firmware/Marlin/src/feature/mmu/mmu2.h
@@ -21,6 +21,10 @@
*/
#pragma once
+/**
+ * mmu2.h - Support for Průša MMU2 and MMU2S
+ */
+
#include "../../inc/MarlinConfig.h"
#if HAS_FILAMENT_SENSOR
@@ -70,7 +74,7 @@ private:
static bool get_response();
static void manage_response(const bool move_axes, const bool turn_off_nozzle);
- static void execute_extruder_sequence(const E_Step * sequence, int steps);
+ static void execute_extruder_sequence(const E_Step * const sequence, const uint8_t steps);
static void ramming_sequence();
static void load_to_nozzle_sequence();
@@ -85,7 +89,7 @@ private:
FORCE_INLINE static bool load_to_gears() { return true; }
#endif
- #if ENABLED(MMU_EXTRUDER_SENSOR)
+ #if ENABLED(MMU2_EXTRUDER_SENSOR)
#define MMU_LOAD_FEEDRATE 19.02f // (mm/s)
static void mmu_continue_loading();
#endif
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2.cpp b/firmware/Marlin/src/feature/mmu3/mmu3.cpp
similarity index 97%
rename from firmware/Marlin/src/feature/mmu3/mmu2.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3.cpp
index ed4a04f..b4d4c76 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3.cpp
@@ -28,15 +28,15 @@
#if HAS_PRUSA_MMU3
-#include "mmu2.h"
-#include "mmu2_error_converter.h"
-#include "mmu2_fsensor.h"
-#include "mmu2_log.h"
-#include "mmu2_marlin.h"
-#include "mmu2_marlin_macros.h"
-#include "mmu2_power.h"
-#include "mmu2_progress_converter.h"
-#include "mmu2_reporting.h"
+#include "mmu3.h"
+#include "mmu3_error_converter.h"
+#include "mmu3_fsensor.h"
+#include "mmu3_log.h"
+#include "mmu3_marlin.h"
+#include "mmu3_marlin_macros.h"
+#include "mmu3_power.h"
+#include "mmu3_progress_converter.h"
+#include "mmu3_reporting.h"
#include "strlen_cx.h"
#include "SpoolJoin.h"
@@ -91,7 +91,7 @@ namespace MMU3 {
int MMU3::mmu_hw_enabled_addr; // Initialized by settings.load
MMU3::MMU3()
- : logic(MMU2_TOOL_CHANGE_LOAD_LENGTH, MMU2_LOAD_TO_NOZZLE_FEED_RATE)
+ : logic(MMU3_TOOL_CHANGE_LOAD_LENGTH, MMU3_LOAD_TO_NOZZLE_FEED_RATE)
, extruder(MMU2_NO_TOOL)
, tool_change_extruder(MMU2_NO_TOOL)
, resume_position()
@@ -121,10 +121,10 @@ namespace MMU3 {
settings.save();
#endif
- MMU2_SERIAL.begin(MMU_BAUD);
+ MMU_SERIAL.begin(MMU_BAUD);
powerOn();
- MMU2_SERIAL.flush(); // Make sure the UART buffer is clear before starting communication
+ MMU_SERIAL.flush(); // Make sure the UART buffer is clear before starting communication
setCurrentTool(MMU2_NO_TOOL);
_state = xState::Connecting;
@@ -153,7 +153,7 @@ namespace MMU3 {
_state = xState::Stopped;
logic.stop();
- MMU2_SERIAL.end();
+ MMU_SERIAL.end();
}
void MMU3::tune() {
@@ -279,14 +279,14 @@ namespace MMU3 {
&& TERN1(HAS_LEVELING, planner.leveling_active)
&& xy_are_trusted()
&& e_active()
- #if ENABLED(MMU_SPOOL_JOIN_CONSUMES_ALL_FILAMENT)
+ #if ENABLED(MMU3_SPOOL_JOIN_CONSUMES_ALL_FILAMENT)
&& runout.enabled // to prevent M600 to be triggered during M600 AUTO
&& !FILAMENT_PRESENT() // so the filament is totally consumed
#endif
) {
SERIAL_ECHOLN_P("FINDA filament runout!");
if (spooljoin.isEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN) { // Can't auto if F=?
- #if ENABLED(MMU_SPOOL_JOIN_CONSUMES_ALL_FILAMENT)
+ #if ENABLED(MMU3_SPOOL_JOIN_CONSUMES_ALL_FILAMENT)
// set the current tool to FILAMENT_UNKNOWN so that we don't try to unload it
extruder = MMU2_NO_TOOL;
// disable the filament runout sensor (this is going to be re-enabled after the filament is loaded)
@@ -294,7 +294,7 @@ namespace MMU3 {
runout.filament_ran_out = false; // trying to disable the purge more / continue message
runout.enabled = false;
#endif
- queue.enqueue_now(F("M600A")); // Save print and run M600 command
+ queue.enqueue_now(F("M600A")); // Save print and run M600 A (automatic) command
}
else {
marlin_stop_and_save_print_to_ram();
@@ -349,7 +349,7 @@ namespace MMU3 {
// MMU has finished its load, push the filament further by some defined constant length
// If the filament sensor reads 0 at any moment, then report FAILURE
- const float tryload_length = MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH - logic.ExtraLoadDistance();
+ const float tryload_length = MMU3_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH - logic.ExtraLoadDistance();
TryLoadUnloadReporter tlur(tryload_length);
/**
@@ -378,7 +378,7 @@ namespace MMU3 {
// Pixel index will go from 0 to 10, then back from 10 to 0.
// A change in this value indicates a new pixel should be drawn on the display.
for (uint8_t move = 0; move < 2; move++) {
- extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE);
+ extruder_move(move == 0 ? tryload_length : -tryload_length, MMU3_VERIFY_LOAD_TO_NOZZLE_FEED_RATE);
while (planner_any_moves()) {
filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR);
tlur.Progress(filament_inserted);
@@ -392,7 +392,7 @@ namespace MMU3 {
}
bool MMU3::toolChangeCommonOnce(uint8_t slot) {
- static_assert(MMU2_MAX_RETRIES > 1); // Need >1 retries to do the cut in the last attempt
+ static_assert(MMU3_MAX_RETRIES > 1); // Need >1 retries to do the cut in the last attempt
uint8_t retries = 0;
for (;;) {
for (;;) {
@@ -419,9 +419,9 @@ namespace MMU3 {
// Prepare a retry attempt
unloadInner();
- if (retries == (MMU2_MAX_RETRIES) - 1 && cutter_enabled()) {
+ if (retries == (MMU3_MAX_RETRIES) - 1 && cutter_enabled()) {
cutFilamentInner(slot); // try cutting filament tip at the last attempt
- retries = 0; // reset retries every MMU2_MAX_RETRIES
+ retries = 0; // reset retries every MMU3_MAX_RETRIES
}
++retries;
@@ -1013,7 +1013,7 @@ namespace MMU3 {
void MMU3::execute_load_to_nozzle_sequence() {
planner_synchronize();
// Compensate for configurable Extra Loading Distance
- planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU2_FILAMENT_SENSOR_POSITION));
+ planner_set_current_position_E(planner_get_current_position_E() - (logic.ExtraLoadDistance() - MMU3_FILAMENT_SENSOR_E_POSITION));
execute_extruder_sequence(load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof(load_to_nozzle_sequence[0]));
}
@@ -1120,7 +1120,7 @@ namespace MMU3 {
}
void __attribute__((noinline)) MMU3::helpUnloadToFinda() {
- extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE);
+ extruder_move(-MMU3_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU3_RETRY_UNLOAD_TO_FINDA_FEED_RATE);
}
void MMU3::onMMUProgressMsgSame(ProgressCode pc) {
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2.h b/firmware/Marlin/src/feature/mmu3/mmu3.h
similarity index 98%
rename from firmware/Marlin/src/feature/mmu3/mmu2.h
rename to firmware/Marlin/src/feature/mmu3/mmu3.h
index f69e6ac..3c1088f 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2.h
+++ b/firmware/Marlin/src/feature/mmu3/mmu3.h
@@ -25,10 +25,10 @@
* mmu2.h
*/
-#include "mmu2_state.h"
-#include "mmu2_marlin.h"
+#include "mmu3_state.h"
+#include "mmu3_marlin.h"
-#include "mmu2_protocol_logic.h"
+#include "mmu3_protocol_logic.h"
#include "../../MarlinCore.h"
@@ -43,8 +43,8 @@
float feedRate; //!< feed rate in mm/s
};
- static constexpr E_Step ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE };
- static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE };
+ static constexpr E_Step ramming_sequence[] PROGMEM = { MMU3_RAMMING_SEQUENCE };
+ static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = { MMU3_LOAD_TO_NOZZLE_SEQUENCE };
namespace MMU3 {
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_crc.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_crc.cpp
similarity index 98%
rename from firmware/Marlin/src/feature/mmu3/mmu2_crc.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_crc.cpp
index d94e2d9..2e752c4 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_crc.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_crc.cpp
@@ -28,7 +28,7 @@
#if HAS_PRUSA_MMU3
-#include "mmu2_crc.h"
+#include "mmu3_crc.h"
#ifdef __AVR__
#include
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_crc.h b/firmware/Marlin/src/feature/mmu3/mmu3_crc.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_crc.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_crc.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_error_converter.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_error_converter.cpp
similarity index 99%
rename from firmware/Marlin/src/feature/mmu3/mmu2_error_converter.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_error_converter.cpp
index b370798..d5d1244 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_error_converter.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_error_converter.cpp
@@ -29,7 +29,7 @@
#if HAS_PRUSA_MMU3
#include "../../core/language.h"
-#include "mmu2_error_converter.h"
+#include "mmu3_error_converter.h"
#include "mmu_hw/error_codes.h"
#include "mmu_hw/errors_list.h"
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_error_converter.h b/firmware/Marlin/src/feature/mmu3/mmu3_error_converter.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_error_converter.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_error_converter.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_fsensor.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_fsensor.cpp
similarity index 96%
rename from firmware/Marlin/src/feature/mmu3/mmu2_fsensor.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_fsensor.cpp
index 4252fb5..32d2fac 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_fsensor.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_fsensor.cpp
@@ -28,8 +28,8 @@
#if HAS_PRUSA_MMU3
-#include "../../feature/runout.h"
-#include "mmu2_fsensor.h"
+#include "../runout.h"
+#include "mmu3_fsensor.h"
namespace MMU3 {
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_fsensor.h b/firmware/Marlin/src/feature/mmu3/mmu3_fsensor.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_fsensor.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_fsensor.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_log.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_log.cpp
similarity index 98%
rename from firmware/Marlin/src/feature/mmu3/mmu2_log.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_log.cpp
index 4dd0d79..af2c92e 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_log.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_log.cpp
@@ -28,7 +28,7 @@
#if HAS_PRUSA_MMU3
-#include "mmu2_log.h"
+#include "mmu3_log.h"
namespace MMU3 {
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_log.h b/firmware/Marlin/src/feature/mmu3/mmu3_log.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_log.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_log.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_marlin.h b/firmware/Marlin/src/feature/mmu3/mmu3_marlin.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_marlin.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_marlin.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_marlin1.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_marlin1.cpp
similarity index 98%
rename from firmware/Marlin/src/feature/mmu3/mmu2_marlin1.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_marlin1.cpp
index 3fae1c3..be54695 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_marlin1.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_marlin1.cpp
@@ -34,9 +34,9 @@
#include "../../module/planner.h"
#include "../../module/temperature.h"
-#include "../../feature/pause.h"
+#include "../pause.h"
#include "../../libs/nozzle.h"
-#include "mmu2_marlin.h"
+#include "mmu3_marlin.h"
namespace MMU3 {
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_marlin_macros.h b/firmware/Marlin/src/feature/mmu3/mmu3_marlin_macros.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_marlin_macros.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_marlin_macros.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_power.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_power.cpp
similarity index 87%
rename from firmware/Marlin/src/feature/mmu3/mmu2_power.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_power.cpp
index 418f32a..da905c6 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_power.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_power.cpp
@@ -28,8 +28,8 @@
#if HAS_PRUSA_MMU3
-#include "mmu2.h"
-#include "mmu2_power.h"
+#include "mmu3.h"
+#include "mmu3_power.h"
#include "../../MarlinCore.h"
@@ -41,8 +41,8 @@ namespace MMU3 {
// On MK3 we cannot do actual power cycle on HW. Instead trigger a hardware reset.
void power_on() {
- #if PIN_EXISTS(MMU2_RST)
- OUT_WRITE(MMU2_RST_PIN, HIGH);
+ #if PIN_EXISTS(MMU_RST)
+ OUT_WRITE(MMU_RST_PIN, HIGH);
#endif
power_reset();
}
@@ -50,10 +50,10 @@ void power_on() {
void power_off() {}
void power_reset() {
- #if PIN_EXISTS(MMU2_RST) // HW - pulse reset pin
- WRITE(MMU2_RST_PIN, LOW);
+ #if PIN_EXISTS(MMU_RST) // HW - pulse reset pin
+ WRITE(MMU_RST_PIN, LOW);
safe_delay(100);
- WRITE(MMU2_RST_PIN, HIGH);
+ WRITE(MMU_RST_PIN, HIGH);
#else
mmu3.reset(MMU3::Software); // TODO: Needs redesign. This power implementation shouldn't know anything about the MMU itself
#endif
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_power.h b/firmware/Marlin/src/feature/mmu3/mmu3_power.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_power.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_power.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_progress_converter.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_progress_converter.cpp
similarity index 85%
rename from firmware/Marlin/src/feature/mmu3/mmu2_progress_converter.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_progress_converter.cpp
index 0e8e258..8933f2d 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_progress_converter.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_progress_converter.cpp
@@ -29,34 +29,31 @@
#if HAS_PRUSA_MMU3
#include "../../core/language.h"
-#include "mmu2_progress_converter.h"
-#ifdef __AVR__
- #include
-#endif
+#include "mmu3_progress_converter.h"
#include "mmu_hw/progress_codes.h"
#include "mmu_hw/errors_list.h"
namespace MMU3 {
FSTR_P const progressTexts[] PROGMEM = {
- GET_TEXT_F(MSG_PROGRESS_OK),
- GET_TEXT_F(MSG_PROGRESS_ENGAGE_IDLER),
- GET_TEXT_F(MSG_PROGRESS_DISENGAGE_IDLER),
+ GET_TEXT_F(MSG_PROGRESS_OK), // TODO: Generic messages for Marlin
+ GET_TEXT_F(MSG_PROGRESS_ENGAGE_IDLER), // reused below
+ GET_TEXT_F(MSG_PROGRESS_DISENGAGE_IDLER), // reused below
GET_TEXT_F(MSG_PROGRESS_UNLOAD_FINDA),
GET_TEXT_F(MSG_PROGRESS_UNLOAD_PULLEY),
GET_TEXT_F(MSG_PROGRESS_FEED_FINDA),
GET_TEXT_F(MSG_PROGRESS_FEED_EXTRUDER),
GET_TEXT_F(MSG_PROGRESS_FEED_NOZZLE),
GET_TEXT_F(MSG_PROGRESS_AVOID_GRIND),
- GET_TEXT_F(MSG_FINISHING_MOVEMENTS), // reuse from messages.cpp
+ GET_TEXT_F(MSG_FINISHING_MOVEMENTS),
GET_TEXT_F(MSG_PROGRESS_DISENGAGE_IDLER), // err disengaging idler is the same text
GET_TEXT_F(MSG_PROGRESS_ENGAGE_IDLER), // engage dtto.
GET_TEXT_F(MSG_PROGRESS_WAIT_USER),
GET_TEXT_F(MSG_PROGRESS_ERR_INTERNAL),
GET_TEXT_F(MSG_PROGRESS_ERR_HELP_FIL),
GET_TEXT_F(MSG_PROGRESS_ERR_TMC),
- GET_TEXT_F(MSG_UNLOADING_FILAMENT), // reuse from messages.cpp
- GET_TEXT_F(MSG_LOADING_FILAMENT), // reuse from messages.cpp
+ GET_TEXT_F(MSG_UNLOADING_FILAMENT),
+ GET_TEXT_F(MSG_LOADING_FILAMENT),
GET_TEXT_F(MSG_PROGRESS_SELECT_SLOT),
GET_TEXT_F(MSG_PROGRESS_PREPARE_BLADE),
GET_TEXT_F(MSG_PROGRESS_PUSH_FILAMENT),
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_progress_converter.h b/firmware/Marlin/src/feature/mmu3/mmu3_progress_converter.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_progress_converter.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_progress_converter.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_protocol.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_protocol.cpp
similarity index 99%
rename from firmware/Marlin/src/feature/mmu3/mmu2_protocol.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_protocol.cpp
index 6cc5423..739599f 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_protocol.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_protocol.cpp
@@ -28,7 +28,7 @@
#if HAS_PRUSA_MMU3
-#include "mmu2_protocol.h"
+#include "mmu3_protocol.h"
// protocol definition
// command: Q0
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_protocol.h b/firmware/Marlin/src/feature/mmu3/mmu3_protocol.h
similarity index 99%
rename from firmware/Marlin/src/feature/mmu3/mmu2_protocol.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_protocol.h
index 712ba17..7ec47fd 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_protocol.h
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_protocol.h
@@ -28,7 +28,7 @@
#include "../../MarlinCore.h"
#include
-#include "mmu2_crc.h"
+#include "mmu3_crc.h"
// prevent ARM HAL macros from breaking our code
#undef CRC
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_protocol_logic.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_protocol_logic.cpp
similarity index 98%
rename from firmware/Marlin/src/feature/mmu3/mmu2_protocol_logic.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_protocol_logic.cpp
index 9453e67..cf74e66 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_protocol_logic.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_protocol_logic.cpp
@@ -28,9 +28,9 @@
#if HAS_PRUSA_MMU3
-#include "mmu2_protocol_logic.h"
-#include "mmu2_log.h"
-#include "mmu2_fsensor.h"
+#include "mmu3_protocol_logic.h"
+#include "mmu3_log.h"
+#include "mmu3_fsensor.h"
#ifdef __AVR__
// on MK3/S/+ we shuffle the timers a bit, thus "_millis" may not equal "millis"
@@ -48,7 +48,7 @@
#endif
#include
- #include "mmu2_supported_version.h"
+ #include "mmu3_supported_version.h"
namespace MMU3 {
@@ -186,7 +186,7 @@ namespace MMU3 {
OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;)
// try to consume as many rx bytes as possible (until a message has been completed)
- while ((c = MMU2_SERIAL.read()) >= 0) {
+ while ((c = MMU_SERIAL.read()) >= 0) {
++bytesConsumed;
RecordReceivedByte(c);
switch (protocol.DecodeResponse(c)) {
@@ -234,10 +234,10 @@ namespace MMU3 {
#if defined(__AVR__) || defined(TARGET_LPC1768)
// TODO: I'm not sure if this is the correct approach with AVR
for ( uint8_t i = 0; i < len; i++) {
- MMU2_SERIAL.write(txbuff[i]);
+ MMU_SERIAL.write(txbuff[i]);
}
#else
- MMU2_SERIAL.write(txbuff, len);
+ MMU_SERIAL.write(txbuff, len);
#endif
LogRequestMsg(txbuff, len);
RecordUARTActivity();
@@ -254,10 +254,10 @@ namespace MMU3 {
#if defined(__AVR__) || defined(TARGET_LPC1768)
// TODO: I'm not sure if this is the correct approach with AVR
for ( uint8_t i = 0; i < len; i++) {
- MMU2_SERIAL.write(txbuff[i]);
+ MMU_SERIAL.write(txbuff[i]);
}
#else
- MMU2_SERIAL.write(txbuff, len);
+ MMU_SERIAL.write(txbuff, len);
#endif
LogRequestMsg(txbuff, len);
RecordUARTActivity();
@@ -373,7 +373,7 @@ namespace MMU3 {
StepStatus ProtocolLogic::DelayedRestartWait() {
if (Elapsed(heartBeatPeriod)) { // this basically means, that we are waiting until there is some traffic on
- while (MMU2_SERIAL.read() != -1); // clear the input buffer
+ while (MMU_SERIAL.read() != -1); // clear the input buffer
// switch to StartSeq
start();
}
@@ -587,7 +587,7 @@ namespace MMU3 {
, buttonCode(Buttons::NoButton)
, lastFSensor((uint8_t)WhereIsFilament())
, regIndex(0)
- , retryAttempts(MMU2_MAX_RETRIES)
+ , retryAttempts(MMU3_MAX_RETRIES)
, inAutoRetry(false) {
// @@TODO currently, I don't see a way of writing the initialization better :(
// I'd like to write something like: initRegs8 { extraLoadDistance, pulleySlowFeedrate }
@@ -803,14 +803,14 @@ namespace MMU3 {
}
StepStatus ProtocolLogic::HandleCommunicationTimeout() {
- MMU2_SERIAL.flush(); // clear the output buffer
+ MMU_SERIAL.flush(); // clear the output buffer
protocol.ResetResponseDecoder();
start();
return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout);
}
StepStatus ProtocolLogic::HandleProtocolError() {
- MMU2_SERIAL.flush(); // clear the output buffer
+ MMU_SERIAL.flush(); // clear the output buffer
state = State::InitSequence;
currentScope = Scope::DelayedRestart;
DelayedRestartRestart();
@@ -880,7 +880,7 @@ namespace MMU3 {
void ProtocolLogic::ResetRetryAttempts() {
SERIAL_ECHOLNPGM("ResetRetryAttempts");
- retryAttempts = MMU2_MAX_RETRIES;
+ retryAttempts = MMU3_MAX_RETRIES;
}
void __attribute__((noinline)) ProtocolLogic::ResetCommunicationTimeoutAttempts() {
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_protocol_logic.h b/firmware/Marlin/src/feature/mmu3/mmu3_protocol_logic.h
similarity index 99%
rename from firmware/Marlin/src/feature/mmu3/mmu2_protocol_logic.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_protocol_logic.h
index 6b24099..2fef77c 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_protocol_logic.h
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_protocol_logic.h
@@ -35,7 +35,7 @@
#include "mmu_hw/progress_codes.h"
#include "mmu_hw/buttons.h"
#include "mmu_hw/registers.h"
- #include "mmu2_protocol.h"
+ #include "mmu3_protocol.h"
// #include std array is not available on AVR ... we need to "fake" it
namespace std {
@@ -59,7 +59,7 @@
// Prevent ARM HAL macros from breaking our code
#undef CRC
- #include "mmu2_protocol.h"
+ #include "mmu3_protocol.h"
#include "mmu_hw/buttons.h"
#include "registers.h"
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_reporting.cpp b/firmware/Marlin/src/feature/mmu3/mmu3_reporting.cpp
similarity index 99%
rename from firmware/Marlin/src/feature/mmu3/mmu2_reporting.cpp
rename to firmware/Marlin/src/feature/mmu3/mmu3_reporting.cpp
index a51fa1b..4bf2088 100644
--- a/firmware/Marlin/src/feature/mmu3/mmu2_reporting.cpp
+++ b/firmware/Marlin/src/feature/mmu3/mmu3_reporting.cpp
@@ -28,13 +28,13 @@
#if HAS_PRUSA_MMU3
-#include "mmu2.h"
-#include "mmu2_log.h"
-#include "mmu2_fsensor.h"
-#include "mmu2_reporting.h"
-#include "mmu2_error_converter.h"
-#include "mmu2_marlin_macros.h"
-#include "mmu2_progress_converter.h"
+#include "mmu3.h"
+#include "mmu3_log.h"
+#include "mmu3_fsensor.h"
+#include "mmu3_reporting.h"
+#include "mmu3_error_converter.h"
+#include "mmu3_marlin_macros.h"
+#include "mmu3_progress_converter.h"
#include "mmu_hw/buttons.h"
#include "mmu_hw/error_codes.h"
#include "mmu_hw/errors_list.h"
@@ -43,7 +43,7 @@
#include "../../core/language.h"
#include "../../gcode/gcode.h"
-#include "../../feature/host_actions.h"
+#include "../host_actions.h"
#include "../../lcd/marlinui.h"
#include "../../lcd/menu/menu.h"
#include "../../lcd/menu/menu_item.h"
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_reporting.h b/firmware/Marlin/src/feature/mmu3/mmu3_reporting.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_reporting.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_reporting.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_state.h b/firmware/Marlin/src/feature/mmu3/mmu3_state.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_state.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_state.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu2_supported_version.h b/firmware/Marlin/src/feature/mmu3/mmu3_supported_version.h
similarity index 100%
rename from firmware/Marlin/src/feature/mmu3/mmu2_supported_version.h
rename to firmware/Marlin/src/feature/mmu3/mmu3_supported_version.h
diff --git a/firmware/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh b/firmware/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh
old mode 100755
new mode 100644
diff --git a/firmware/Marlin/src/feature/mmu3/ultralcd.cpp b/firmware/Marlin/src/feature/mmu3/ultralcd.cpp
index fdf4367..96e0197 100644
--- a/firmware/Marlin/src/feature/mmu3/ultralcd.cpp
+++ b/firmware/Marlin/src/feature/mmu3/ultralcd.cpp
@@ -28,8 +28,8 @@
#if HAS_PRUSA_MMU3
-#include "mmu2.h"
-#include "mmu2_marlin_macros.h"
+#include "mmu3.h"
+#include "mmu3_marlin_macros.h"
#include "mmu_hw/errors_list.h"
#include "ultralcd.h"
diff --git a/firmware/Marlin/src/feature/pause.cpp b/firmware/Marlin/src/feature/pause.cpp
index 38ba0d6..3589847 100644
--- a/firmware/Marlin/src/feature/pause.cpp
+++ b/firmware/Marlin/src/feature/pause.cpp
@@ -62,6 +62,8 @@
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h"
+#elif ENABLED(SOVOL_SV06_RTS)
+ #include "../lcd/sovol_rts/sovol_rts.h"
#endif
#include "../lcd/marlinui.h"
@@ -150,6 +152,11 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P
ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode);
+ #if ENABLED(SOVOL_SV06_RTS)
+ rts.gotoPage(ID_Cold_L, ID_Cold_D);
+ rts.updateTempE0();
+ #endif
+
if (wait) return thermalManager.wait_for_hotend(active_extruder);
// Allow interruption by Emergency Parser M108
@@ -212,14 +219,14 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
while (wait_for_user) {
impatient_beep(max_beep_count);
- #if ALL(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR)
+ #if ALL(HAS_FILAMENT_SENSOR, FILAMENT_CHANGE_RESUME_ON_INSERT)
#if MULTI_FILAMENT_SENSOR
#define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break;
switch (active_extruder) {
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED)
}
#else
- if (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) wait_for_user = false;
+ if (!FILAMENT_IS_OUT()) wait_for_user = false;
#endif
#endif
idle_no_sleep();
@@ -277,6 +284,11 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
// "Wait for filament purge"
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
+ #if ENABLED(SOVOL_SV06_RTS)
+ rts.updateTempE0();
+ rts.gotoPage(ID_Purge_L, ID_Purge_D);
+ #endif
+
// Extrude filament to get into hotend
unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
}
@@ -292,6 +304,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // MarlinUI and MKS UI also set PAUSE_RESPONSE_WAIT_FOR
#else
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
+ TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_PurgeMore_L, ID_PurgeMore_D));
#endif
while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep();
}
@@ -355,6 +368,11 @@ bool unload_filament(const_float_t unload_length, const bool show_lcd/*=false*/,
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_UNLOAD, mode);
+ #if ENABLED(SOVOL_SV06_RTS)
+ rts.updateTempE0();
+ rts.gotoPage(ID_Unload_L, ID_Unload_D);
+ #endif
+
// Retract filament
unscaled_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
@@ -503,6 +521,11 @@ void show_continue_prompt(const bool is_reload) {
DEBUG_ECHOLNPGM("... is_reload:", is_reload);
ui.pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING);
+ #if ENABLED(SOVOL_SV06_RTS)
+ rts.updateTempE0();
+ rts.gotoPage(ID_Insert_L, ID_Insert_D);
+ rts.sendData(Beep, SoundAddr);
+ #endif
SERIAL_ECHO_START();
SERIAL_ECHO(is_reload ? F(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : F(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n"));
}
@@ -544,6 +567,10 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
// re-heat the nozzle, re-show the continue prompt, restart idle timers, start over
if (nozzle_timed_out) {
ui.pause_show_message(PAUSE_MESSAGE_HEAT);
+ #if ENABLED(SOVOL_SV06_RTS)
+ rts.updateTempE0();
+ rts.gotoPage(ID_HeatNozzle_L, ID_HeatNozzle_D);
+ #endif
SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT));
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
@@ -709,6 +736,12 @@ void resume_print(
planner.set_e_position_mm((destination.e = current_position.e = resume_position.e));
ui.pause_show_message(PAUSE_MESSAGE_STATUS);
+ #if ENABLED(SOVOL_SV06_RTS)
+ if (pause_flag)
+ rts.gotoPage(ID_PrintResume_L, ID_PrintResume_D);
+ else
+ rts.refreshTime();
+ #endif
#ifdef ACTION_ON_RESUMED
hostui.resumed();
diff --git a/firmware/Marlin/src/feature/powerloss.cpp b/firmware/Marlin/src/feature/powerloss.cpp
index cd5fc13..3cd96e1 100644
--- a/firmware/Marlin/src/feature/powerloss.cpp
+++ b/firmware/Marlin/src/feature/powerloss.cpp
@@ -28,17 +28,18 @@
#if ENABLED(POWER_LOSS_RECOVERY)
+#include "../inc/MarlinConfig.h"
+
#include "powerloss.h"
-#include "../core/macros.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h"
#endif
-bool PrintJobRecovery::enabled; // Initialized by settings.load()
+bool PrintJobRecovery::enabled; // Initialized by settings.load
#if HAS_PLR_BED_THRESHOLD
- celsius_t PrintJobRecovery::bed_temp_threshold; // Initialized by settings.load()
+ celsius_t PrintJobRecovery::bed_temp_threshold; // Initialized by settings.load
#endif
MediaFile PrintJobRecovery::file;
@@ -60,12 +61,15 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0
#include "../module/planner.h"
#include "../module/printcounter.h"
#include "../module/temperature.h"
-#include "../core/serial.h"
#if HOMING_Z_WITH_PROBE
#include "../module/probe.h"
#endif
+#if ENABLED(SOVOL_SV06_RTS)
+ #include "../lcd/sovol_rts/sovol_rts.h"
+#endif
+
#if ENABLED(FWRETRACT)
#include "fwretract.h"
#endif
@@ -95,7 +99,7 @@ PrintJobRecovery recovery;
/**
* Clear the recovery info
*/
-void PrintJobRecovery::init() { memset(&info, 0, sizeof(info)); }
+void PrintJobRecovery::init() { info = {}; }
/**
* Enable or disable then call changed()
@@ -211,6 +215,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
info.zraise = zraise;
info.flag.raised = raised; // Was Z raised before power-off?
+ TERN_(CANCEL_OBJECTS, info.cancel_state = cancelable.state);
TERN_(GCODE_REPEAT_MARKERS, info.stored_repeat = repeat);
TERN_(HAS_HOME_OFFSET, info.home_offset = home_offset);
TERN_(HAS_WORKSPACE_OFFSET, info.workspace_offset = workspace_offset);
@@ -571,6 +576,11 @@ void PrintJobRecovery::resume() {
// Restore E position with G92.9
PROCESS_SUBCOMMANDS_NOW(TS(F("G92.9E"), p_float_t(resume_pos.e, 3)));
+ #if ENABLED(CANCEL_OBJECTS)
+ cancelable.state = info.cancel_state;
+ cancelable.set_active_object(); // Sets the status message
+ #endif
+
TERN_(GCODE_REPEAT_MARKERS, repeat = info.stored_repeat);
TERN_(HAS_HOME_OFFSET, home_offset = info.home_offset);
TERN_(HAS_WORKSPACE_OFFSET, workspace_offset = info.workspace_offset);
@@ -584,6 +594,11 @@ void PrintJobRecovery::resume() {
// Resume the SD file from the last position
PROCESS_SUBCOMMANDS_NOW(MString(F("M23 "), info.sd_filename));
PROCESS_SUBCOMMANDS_NOW(TS(F("M24S"), resume_sdpos, 'T', info.print_job_elapsed));
+
+ #if ENABLED(SOVOL_SV06_RTS)
+ if (rts.print_state) rts.refreshTime();
+ rts.start_print_flag = false;
+ #endif
}
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
@@ -604,6 +619,14 @@ void PrintJobRecovery::resume() {
DEBUG_ECHOLNPGM("zraise: ", info.zraise, " ", info.flag.raised ? "(before)" : "");
+ #if ENABLED(CANCEL_OBJECTS)
+ const cancel_state_t cs = info.cancel_state;
+ DEBUG_ECHOPGM("Canceled:");
+ for (int i = 0; i < cs.object_count; i++)
+ if (TEST(cs.canceled, i)) { DEBUG_CHAR(' '); DEBUG_ECHO(i); }
+ DEBUG_EOL();
+ #endif
+
#if ENABLED(GCODE_REPEAT_MARKERS)
const uint8_t ind = info.stored_repeat.count();
DEBUG_ECHOLNPGM("repeat markers: ", ind);
diff --git a/firmware/Marlin/src/feature/powerloss.h b/firmware/Marlin/src/feature/powerloss.h
index 238f276..8e1e299 100644
--- a/firmware/Marlin/src/feature/powerloss.h
+++ b/firmware/Marlin/src/feature/powerloss.h
@@ -30,12 +30,16 @@
#include "../inc/MarlinConfig.h"
+#if ENABLED(CANCEL_OBJECTS)
+ #include "cancel_object.h"
+#endif
+
#if ENABLED(GCODE_REPEAT_MARKERS)
- #include "../feature/repeat.h"
+ #include "repeat.h"
#endif
#if ENABLED(MIXING_EXTRUDER)
- #include "../feature/mixing.h"
+ #include "mixing.h"
#endif
#if !defined(POWER_LOSS_STATE) && PIN_EXISTS(POWER_LOSS)
@@ -64,6 +68,11 @@ typedef struct {
float zraise;
+ // Canceled objects
+ #if ENABLED(CANCEL_OBJECTS)
+ cancel_state_t cancel_state;
+ #endif
+
// Repeat information
#if ENABLED(GCODE_REPEAT_MARKERS)
Repeat stored_repeat;
diff --git a/firmware/Marlin/src/feature/runout.cpp b/firmware/Marlin/src/feature/runout.cpp
index 2bcb47e..cb7c627 100644
--- a/firmware/Marlin/src/feature/runout.cpp
+++ b/firmware/Marlin/src/feature/runout.cpp
@@ -59,7 +59,7 @@ bool FilamentMonitorBase::enabled = true,
// Filament Runout event handler
//
#include "../MarlinCore.h"
-#include "../feature/pause.h"
+#include "pause.h"
#include "../gcode/queue.h"
#if ENABLED(HOST_ACTION_COMMANDS)
diff --git a/firmware/Marlin/src/feature/runout.h b/firmware/Marlin/src/feature/runout.h
index c95c39f..52a9020 100644
--- a/firmware/Marlin/src/feature/runout.h
+++ b/firmware/Marlin/src/feature/runout.h
@@ -30,7 +30,7 @@
#include "../module/planner.h"
#include "../module/stepper.h" // for block_t
#include "../gcode/queue.h"
-#include "../feature/pause.h" // for did_pause_print
+#include "pause.h" // for did_pause_print
#include "../MarlinCore.h" // for printingIsActive()
#include "../inc/MarlinConfig.h"
@@ -51,6 +51,8 @@
#define HAS_FILAMENT_SWITCH 1
#endif
+#define FILAMENT_IS_OUT() (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_STATE)
+
typedef Flags<
#if NUM_MOTION_SENSORS > NUM_RUNOUT_SENSORS
NUM_MOTION_SENSORS
diff --git a/firmware/Marlin/src/feature/spindle_laser.cpp b/firmware/Marlin/src/feature/spindle_laser.cpp
index c0635c7..b83c1c1 100644
--- a/firmware/Marlin/src/feature/spindle_laser.cpp
+++ b/firmware/Marlin/src/feature/spindle_laser.cpp
@@ -35,7 +35,7 @@
#endif
#if ENABLED(I2C_AMMETER)
- #include "../feature/ammeter.h"
+ #include "ammeter.h"
#endif
SpindleLaser cutter;
diff --git a/firmware/Marlin/src/feature/tmc_util.cpp b/firmware/Marlin/src/feature/tmc_util.cpp
index a2c1207..6afbf4a 100644
--- a/firmware/Marlin/src/feature/tmc_util.cpp
+++ b/firmware/Marlin/src/feature/tmc_util.cpp
@@ -32,6 +32,10 @@
#include "../libs/duration_t.h"
#include "../gcode/gcode.h"
+#if ENABLED(SOVOL_SV06_RTS)
+ #include "../lcd/sovol_rts/sovol_rts.h"
+#endif
+
#if ENABLED(TMC_DEBUG)
#include "../libs/hex_print.h"
#if ENABLED(MONITOR_DRIVER_STATUS)
@@ -207,6 +211,7 @@
if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature");
if (data.is_s2g) SERIAL_ECHOLNPGM("coil short circuit");
TERN_(TMC_DEBUG, tmc_report_all());
+ TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_DriverError_L, ID_DriverError_D));
kill(F("Driver error"));
}
#endif
@@ -609,9 +614,10 @@
default: break;
}
}
- #endif
+ #endif // TMC2160 || TMC5160
#if HAS_TMC220x
+
static void _tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) {
switch (i) {
case TMC_PWM_SCALE_SUM: SERIAL_ECHO(st.pwm_scale_sum()); break;
@@ -659,7 +665,8 @@
}
}
#endif
- #endif
+
+ #endif // HAS_TMC220x
#if HAS_DRIVER(TMC2660)
static void _tmc_parse_drv_status(TMC2660Stepper, const TMC_drv_status_enum) { }
diff --git a/firmware/Marlin/src/feature/tmc_util.h b/firmware/Marlin/src/feature/tmc_util.h
index 12f3a38..27aae23 100644
--- a/firmware/Marlin/src/feature/tmc_util.h
+++ b/firmware/Marlin/src/feature/tmc_util.h
@@ -29,7 +29,7 @@
#include
#include "../module/planner.h"
-#define CHOPPER_DEFAULT_12V { 3, -1, 1 }
+#define CHOPPER_DEFAULT_12V { 3, -1, 1 } // { toff, hend, hstrt }
#define CHOPPER_DEFAULT_19V { 4, 1, 1 }
#define CHOPPER_DEFAULT_24V { 4, 2, 1 }
#define CHOPPER_DEFAULT_36V { 5, 2, 4 }
@@ -77,8 +77,8 @@ class TMCStorage {
struct {
OPTCODE(HAS_STEALTHCHOP, bool stealthChop_enabled = false)
- OPTCODE(HYBRID_THRESHOLD, uint8_t hybrid_thrs = 0)
- OPTCODE(USE_SENSORLESS, int16_t homing_thrs = 0)
+ OPTCODE(HYBRID_THRESHOLD, uint16_t hybrid_thrs = 0)
+ OPTCODE(USE_SENSORLESS, int16_t homing_thrs = 0)
} stored;
};
diff --git a/firmware/Marlin/src/feature/x_twist.cpp b/firmware/Marlin/src/feature/x_twist.cpp
index b8f7e52..2b79247 100644
--- a/firmware/Marlin/src/feature/x_twist.cpp
+++ b/firmware/Marlin/src/feature/x_twist.cpp
@@ -30,7 +30,7 @@ XATC xatc;
bool XATC::enabled;
float XATC::spacing, XATC::start;
-xatc_array_t XATC::z_offset; // Initialized by settings.load()
+xatc_array_t XATC::z_offset; // Initialized by settings.load
void XATC::reset() {
constexpr float xzo[] = XATC_Z_OFFSETS;
diff --git a/firmware/Marlin/src/gcode/bedlevel/G26.cpp b/firmware/Marlin/src/gcode/bedlevel/G26.cpp
index e4272c1..8c26ca4 100644
--- a/firmware/Marlin/src/gcode/bedlevel/G26.cpp
+++ b/firmware/Marlin/src/gcode/bedlevel/G26.cpp
@@ -102,7 +102,7 @@
#define G26_OK false
#define G26_ERR true
-#include "../../gcode/gcode.h"
+#include "../gcode.h"
#include "../../feature/bedlevel/bedlevel.h"
#include "../../MarlinCore.h"
diff --git a/firmware/Marlin/src/gcode/bedlevel/G35.cpp b/firmware/Marlin/src/gcode/bedlevel/G35.cpp
index c1a329f..b3c56b4 100644
--- a/firmware/Marlin/src/gcode/bedlevel/G35.cpp
+++ b/firmware/Marlin/src/gcode/bedlevel/G35.cpp
@@ -53,7 +53,7 @@
* 41 - Counter-Clockwise M4
* 50 - Clockwise M5
* 51 - Counter-Clockwise M5
- **/
+ */
void GcodeSuite::G35() {
DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING));
diff --git a/firmware/Marlin/src/gcode/bedlevel/G42.cpp b/firmware/Marlin/src/gcode/bedlevel/G42.cpp
index f55f149..44f5cea 100644
--- a/firmware/Marlin/src/gcode/bedlevel/G42.cpp
+++ b/firmware/Marlin/src/gcode/bedlevel/G42.cpp
@@ -43,40 +43,40 @@
* P : Flag to put the probe at the given point
*/
void GcodeSuite::G42() {
- if (MOTION_CONDITIONS) {
- const bool hasI = parser.seenval('I');
- const int8_t ix = hasI ? parser.value_int() : 0;
- const bool hasJ = parser.seenval('J');
- const int8_t iy = hasJ ? parser.value_int() : 0;
+ if (!MOTION_CONDITIONS) return;
- if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) {
- SERIAL_ECHOLNPGM(STR_ERR_MESH_XY);
- return;
- }
+ const bool hasI = parser.seenval('I');
+ const int8_t ix = hasI ? parser.value_int() : 0;
+ const bool hasJ = parser.seenval('J');
+ const int8_t iy = hasJ ? parser.value_int() : 0;
- // Move to current_position, as modified by I, J, P parameters
- destination = current_position;
-
- if (hasI) destination.x = bedlevel.get_mesh_x(ix);
- if (hasJ) destination.y = bedlevel.get_mesh_y(iy);
-
- #if HAS_PROBE_XY_OFFSET
- if (parser.seen_test('P')) {
- if (hasI) destination.x -= probe.offset_xy.x;
- if (hasJ) destination.y -= probe.offset_xy.y;
- }
- #endif
-
- const feedRate_t fval = parser.linearval('F'),
- fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f);
-
- // SCARA kinematic has "safe" XY raw moves
- #if IS_SCARA
- prepare_internal_fast_move_to_destination(fr_mm_s);
- #else
- prepare_internal_move_to_destination(fr_mm_s);
- #endif
+ if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) {
+ SERIAL_ECHOLNPGM(STR_ERR_MESH_XY);
+ return;
}
+
+ // Move to current_position, as modified by I, J, P parameters
+ destination = current_position;
+
+ if (hasI) destination.x = bedlevel.get_mesh_x(ix);
+ if (hasJ) destination.y = bedlevel.get_mesh_y(iy);
+
+ #if HAS_PROBE_XY_OFFSET
+ if (parser.seen_test('P')) {
+ if (hasI) destination.x -= probe.offset_xy.x;
+ if (hasJ) destination.y -= probe.offset_xy.y;
+ }
+ #endif
+
+ const feedRate_t fval = parser.linearval('F'),
+ fr_mm_s = MMM_TO_MMS(fval > 0 ? fval : 0.0f);
+
+ // SCARA kinematic has "safe" XY raw moves
+ #if IS_SCARA
+ prepare_internal_fast_move_to_destination(fr_mm_s);
+ #else
+ prepare_internal_move_to_destination(fr_mm_s);
+ #endif
}
#endif // HAS_MESH
diff --git a/firmware/Marlin/src/gcode/bedlevel/abl/G29.cpp b/firmware/Marlin/src/gcode/bedlevel/abl/G29.cpp
index 9e85b73..7c8289b 100644
--- a/firmware/Marlin/src/gcode/bedlevel/abl/G29.cpp
+++ b/firmware/Marlin/src/gcode/bedlevel/abl/G29.cpp
@@ -33,6 +33,7 @@
#include "../../../module/motion.h"
#include "../../../module/planner.h"
#include "../../../module/probe.h"
+#include "../../../module/temperature.h"
#include "../../queue.h"
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
@@ -51,6 +52,8 @@
#include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD)
#include "../../../lcd/e3v2/creality/dwin.h"
+#elif ENABLED(SOVOL_SV06_RTS)
+ #include "../../../lcd/sovol_rts/sovol_rts.h"
#endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@@ -438,6 +441,12 @@ G29_TYPE GcodeSuite::G29() {
remember_feedrate_scaling_off();
#if ENABLED(PREHEAT_BEFORE_LEVELING)
+ #if ENABLED(SOVOL_SV06_RTS)
+ rts.updateTempE0();
+ rts.updateTempBed();
+ rts.sendData(1, Wait_VP);
+ rts.gotoPage(ID_ABL_HeatWait_L, ID_ABL_HeatWait_D);
+ #endif
if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP,
TERN(EXTENSIBLE_UI, ExtUI::getLevelingBedTemp(), LEVELING_BED_TEMP)
);
@@ -775,6 +784,12 @@ G29_TYPE GcodeSuite::G29() {
abl.z_values[abl.meshCount.x][abl.meshCount.y] = z;
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(abl.meshCount, z));
+ #if ENABLED(SOVOL_SV06_RTS)
+ if (pt_index <= GRID_MAX_POINTS) rts.sendData(pt_index, AUTO_BED_LEVEL_ICON_VP);
+ rts.sendData(z * 100.0f, AUTO_BED_LEVEL_1POINT_VP + (pt_index - 1) * 2);
+ rts.gotoPage(ID_ABL_Wait_L, ID_ABL_Wait_D);
+ #endif
+
#endif
abl.reenable = false; // Don't re-enable after modifying the mesh
@@ -992,6 +1007,8 @@ G29_TYPE GcodeSuite::G29() {
process_subcommands_now(F(EVENT_GCODE_AFTER_G29));
#endif
+ TERN_(SOVOL_SV06_RTS, RTS_AutoBedLevelPage());
+
probe.use_probing_tool(false);
report_current_position();
diff --git a/firmware/Marlin/src/gcode/calibrate/G28.cpp b/firmware/Marlin/src/gcode/calibrate/G28.cpp
index 56b4761..ac90756 100644
--- a/firmware/Marlin/src/gcode/calibrate/G28.cpp
+++ b/firmware/Marlin/src/gcode/calibrate/G28.cpp
@@ -58,6 +58,8 @@
#include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_CREALITY_LCD)
#include "../../lcd/e3v2/creality/dwin.h"
+#elif ENABLED(SOVOL_SV06_RTS)
+ #include "../../lcd/sovol_rts/sovol_rts.h"
#endif
#if ENABLED(LASER_FEATURE)
@@ -203,6 +205,11 @@
* L Force leveling state ON (if possible) or OFF after homing (Requires RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28)
* O Home only if the position is not known and trusted
* R Raise by n mm/inches before homing
+ * H Hold the current X/Y position when executing a home Z, or if
+ * multiple axes are homed, the position when Z home is executed.
+ * When using a probe for Z Home, positions close to the edge may
+ * fail with position unreachable due to probe/nozzle offset. This
+ * can be used to avoid a model.
*
* Cartesian/SCARA parameters
*
@@ -315,9 +322,9 @@ void GcodeSuite::G28() {
#else // !DELTA && !AXEL_TPARA
- #define _UNSAFE(A) (homeZ && TERN0(Z_SAFE_HOMING, axes_should_home(_BV(A##_AXIS))))
+ #define _UNSAFE(A) TERN0(Z_SAFE_HOMING, homeZZ && axis_should_home(_AXIS(A)))
- const bool homeZ = TERN0(HAS_Z_AXIS, parser.seen_test('Z')),
+ const bool homeZZ = TERN0(HAS_Z_AXIS, parser.seen_test('Z')),
NUM_AXIS_LIST_( // Other axes should be homed before Z safe-homing
needX = _UNSAFE(X), needY = _UNSAFE(Y), needZ = false, // UNUSED
needI = _UNSAFE(I), needJ = _UNSAFE(J), needK = _UNSAFE(K),
@@ -326,7 +333,7 @@ void GcodeSuite::G28() {
NUM_AXIS_LIST_( // Home each axis if needed or flagged
homeX = needX || parser.seen_test('X'),
homeY = needY || parser.seen_test('Y'),
- homeZZ = homeZ,
+ homeZ = homeZZ,
homeI = needI || parser.seen_test(AXIS4_NAME), homeJ = needJ || parser.seen_test(AXIS5_NAME),
homeK = needK || parser.seen_test(AXIS6_NAME), homeU = needU || parser.seen_test(AXIS7_NAME),
homeV = needV || parser.seen_test(AXIS8_NAME), homeW = needW || parser.seen_test(AXIS9_NAME)
@@ -348,7 +355,7 @@ void GcodeSuite::G28() {
#if HAS_Z_AXIS
- UNUSED(needZ); UNUSED(homeZZ);
+ UNUSED(needZ);
// Z may home first, e.g., when homing away from the bed.
// This is also permitted when homing with a Z endstop.
@@ -432,8 +439,7 @@ void GcodeSuite::G28() {
#if HAS_Y_AXIS
// Home Y (after X)
- if (DISABLED(HOME_Y_BEFORE_X) && doY)
- homeaxis(Y_AXIS);
+ if (DISABLED(HOME_Y_BEFORE_X) && doY) homeaxis(Y_AXIS);
#endif
#if ALL(FOAMCUTTER_XYUV, HAS_J_AXIS)
@@ -459,7 +465,12 @@ void GcodeSuite::G28() {
#endif
#if ENABLED(Z_SAFE_HOMING)
- if (TERN1(POWER_LOSS_RECOVERY, !parser.seen_test('H'))) home_z_safely(); else homeaxis(Z_AXIS);
+ // H means hold the current X/Y position when probing.
+ // Otherwise move to the define safe X/Y position before homing Z.
+ if (!parser.seen_test('H'))
+ home_z_safely();
+ else
+ homeaxis(Z_AXIS);
#else
homeaxis(Z_AXIS);
#endif
@@ -555,6 +566,7 @@ void GcodeSuite::G28() {
ui.refresh();
+ TERN_(SOVOL_SV06_RTS, RTS_MoveAxisHoming());
TERN_(DWIN_CREALITY_LCD, dwinHomingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone());
diff --git a/firmware/Marlin/src/gcode/calibrate/G34_M422.cpp b/firmware/Marlin/src/gcode/calibrate/G34_M422.cpp
index 7a27a61..17d5766 100644
--- a/firmware/Marlin/src/gcode/calibrate/G34_M422.cpp
+++ b/firmware/Marlin/src/gcode/calibrate/G34_M422.cpp
@@ -212,7 +212,28 @@ void GcodeSuite::G34() {
// Probe a Z height for each stepper.
// Probing sanity check is disabled, as it would trigger even in normal cases because
// current_position.z has been manually altered in the "dirty trick" above.
- const float z_probed_height = probe.probe_at_point(DIFF_TERN(HAS_HOME_OFFSET, ppos, xy_pos_t(home_offset)), raise_after, 0, true, false, (Z_PROBE_LOW_POINT) - z_probe * 0.5f, z_probe * 0.5f);
+
+ if (DEBUGGING(LEVELING))
+ DEBUG_ECHOLNPGM(
+ "Z_PROBE_LOW_POINT: ", p_float_t(Z_PROBE_LOW_POINT, 2),
+ "z_probe: ", p_float_t(z_probe, 2),
+ "Probe Tgt: ", p_float_t((Z_PROBE_LOW_POINT) - z_probe * 0.5f, 2)
+ );
+
+ const float z_probed_height = probe.probe_at_point(
+ DIFF_TERN(HAS_HOME_OFFSET, ppos, xy_pos_t(home_offset)), // xy
+ raise_after, // raise_after
+ (DEBUGGING(LEVELING) || DEBUGGING(INFO)) ? 3 : 0, // verbose_level
+ true, false, // probe_relative, sanity_check
+ (Z_PROBE_LOW_POINT) - (z_probe * 0.5f), // z_min_point
+ Z_TWEEN_SAFE_CLEARANCE // z_clearance
+ );
+
+ if (DEBUGGING(LEVELING)) {
+ DEBUG_ECHOLNPGM_P(PSTR("Probing X"), ppos.x, SP_Y_STR, ppos.y);
+ DEBUG_ECHOLNPGM("Height = ", z_probed_height);
+ }
+
if (isnan(z_probed_height)) {
SERIAL_ECHOLNPGM(STR_ERR_PROBING_FAILED);
LCD_MESSAGE(MSG_LCD_PROBING_FAILED);
@@ -236,7 +257,12 @@ void GcodeSuite::G34() {
// Adapt the next probe clearance height based on the new measurements.
// Safe_height = lowest distance to bed (= highest measurement) plus highest measured misalignment.
z_maxdiff = z_measured_max - z_measured_min;
- z_probe = (Z_TWEEN_SAFE_CLEARANCE + zoffs) + z_measured_max + z_maxdiff; //Not sure we need z_maxdiff, but leaving it in for safety.
+
+ // The intent of the line below seems to be to clamp the probe depth on successive iterations of G34, but in reality if the amplification
+ // factor is not completely accurate, this was causing probing to fail as the probe stopped fractions of a mm from the trigger point
+ // on the second iteration very reliably. This may be restored with an uncertainty factor at some point, however its usefulness after
+ // all probe points have seen a successful probe is questionable.
+ //z_probe = (Z_TWEEN_SAFE_CLEARANCE + zoffs) + z_measured_max + z_maxdiff; // Not sure we need z_maxdiff, but leaving it in for safety.
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
// Replace the initial values in z_measured with calculated heights at
@@ -401,7 +427,15 @@ void GcodeSuite::G34() {
// Use the probed height from the last iteration to determine the Z height.
// z_measured_min is used, because all steppers are aligned to z_measured_min.
// Ideally, this would be equal to the 'z_probe * 0.5f' which was added earlier.
- current_position.z -= z_measured_min - (Z_TWEEN_SAFE_CLEARANCE + zoffs); //we shouldn't want to subtract the clearance from here right? (Depends if we added it further up)
+ if (DEBUGGING(LEVELING))
+ DEBUG_ECHOLNPGM(
+ "z_measured_min: ", p_float_t(z_measured_min, 2),
+ "Z_TWEEN_SAFE_CLEARANCE: ", p_float_t(Z_TWEEN_SAFE_CLEARANCE, 2),
+ "zoffs: ", p_float_t(zoffs, 2)
+ );
+
+ if (!err_break)
+ current_position.z -= z_measured_min - (Z_TWEEN_SAFE_CLEARANCE + zoffs); // We shouldn't want to subtract the clearance from here right? (Depends if we added it further up)
sync_plan_position();
#endif
diff --git a/firmware/Marlin/src/gcode/calibrate/G425.cpp b/firmware/Marlin/src/gcode/calibrate/G425.cpp
index ad17b2e..6338873 100644
--- a/firmware/Marlin/src/gcode/calibrate/G425.cpp
+++ b/firmware/Marlin/src/gcode/calibrate/G425.cpp
@@ -332,10 +332,22 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
probe_side(m, uncertainty, TOP);
#endif
- TERN_(CALIBRATION_MEASURE_RIGHT, probe_side(m, uncertainty, RIGHT, probe_top_at_edge));
+ /**
+ * Allow Y axis to probe and compute values before X axis (or remaining arbitrary axes)
+ * to assist with centering in calibration object. Lulzbot saw issues with higher uncertainty
+ * values where the nozzle was catching on the edges of the cube, and this was intended to help
+ * ensure the probe object remained centered.
+ */
TERN_(CALIBRATION_MEASURE_FRONT, probe_side(m, uncertainty, FRONT, probe_top_at_edge));
- TERN_(CALIBRATION_MEASURE_LEFT, probe_side(m, uncertainty, LEFT, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_BACK, probe_side(m, uncertainty, BACK, probe_top_at_edge));
+
+ #if HAS_Y_CENTER
+ m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2;
+ m.nozzle_outer_dimension.y = m.obj_side[BACK] - m.obj_side[FRONT] - dimensions.y;
+ #endif
+
+ TERN_(CALIBRATION_MEASURE_LEFT, probe_side(m, uncertainty, LEFT, probe_top_at_edge));
+ TERN_(CALIBRATION_MEASURE_RIGHT, probe_side(m, uncertainty, RIGHT, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_IMIN, probe_side(m, uncertainty, IMINIMUM, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_IMAX, probe_side(m, uncertainty, IMAXIMUM, probe_top_at_edge));
TERN_(CALIBRATION_MEASURE_JMIN, probe_side(m, uncertainty, JMINIMUM, probe_top_at_edge));
@@ -351,7 +363,6 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
// Compute the measured center of the calibration object.
TERN_(HAS_X_CENTER, m.obj_center.x = (m.obj_side[LEFT] + m.obj_side[RIGHT]) / 2);
- TERN_(HAS_Y_CENTER, m.obj_center.y = (m.obj_side[FRONT] + m.obj_side[BACK]) / 2);
TERN_(HAS_I_CENTER, m.obj_center.i = (m.obj_side[IMINIMUM] + m.obj_side[IMAXIMUM]) / 2);
TERN_(HAS_J_CENTER, m.obj_center.j = (m.obj_side[JMINIMUM] + m.obj_side[JMAXIMUM]) / 2);
TERN_(HAS_K_CENTER, m.obj_center.k = (m.obj_side[KMINIMUM] + m.obj_side[KMAXIMUM]) / 2);
@@ -362,7 +373,6 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
// Compute the outside diameter of the nozzle at the height
// at which it makes contact with the calibration object
TERN_(HAS_X_CENTER, m.nozzle_outer_dimension.x = m.obj_side[RIGHT] - m.obj_side[LEFT] - dimensions.x);
- TERN_(HAS_Y_CENTER, m.nozzle_outer_dimension.y = m.obj_side[BACK] - m.obj_side[FRONT] - dimensions.y);
park_above_object(m, uncertainty);
diff --git a/firmware/Marlin/src/gcode/config/M210.cpp b/firmware/Marlin/src/gcode/config/M210.cpp
new file mode 100644
index 0000000..99c750b
--- /dev/null
+++ b/firmware/Marlin/src/gcode/config/M210.cpp
@@ -0,0 +1,100 @@
+/**
+ * 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 .
+ *
+ */
+
+#include "../../inc/MarlinConfigPre.h"
+
+#if ENABLED(EDITABLE_HOMING_FEEDRATE)
+
+#include "../gcode.h"
+#include "../../module/motion.h"
+
+/**
+ * M210 - Set homing feedrate for one or more axes
+ * in current units (in/mm) per minute
+ *
+ * X[feedrate] Set X axis homing feedrate
+ * Y[feedrate] Set Y axis homing feedrate
+ * Z[feedrate] Set Z axis homing feedrate
+ * A[feedrate] Set I axis homing feedrate (configured axis name applies)
+ * B[feedrate] Set J axis homing feedrate (configured axis name applies)
+ * C[feedrate] Set K axis homing feedrate (configured axis name applies)
+ * U[feedrate] Set U axis homing feedrate (configured axis name applies)
+ * V[feedrate] Set V axis homing feedrate (configured axis name applies)
+ * W[feedrate] Set W axis homing feedrate (configured axis name applies)
+ *
+ * With no arguments, report the current offsets.
+ */
+void GcodeSuite::M210() {
+ if (!parser.seen_any())
+ return M210_report();
+
+ #if HAS_X_AXIS
+ if (parser.floatval('X') > 0) homing_feedrate_mm_m.x = parser.value_axis_units(X_AXIS);
+ #endif
+ #if HAS_Y_AXIS
+ if (parser.floatval('Y') > 0) homing_feedrate_mm_m.y = parser.value_axis_units(Y_AXIS);
+ #endif
+ #if HAS_Z_AXIS
+ if (parser.floatval('Z') > 0) homing_feedrate_mm_m.z = parser.value_axis_units(Z_AXIS);
+ #endif
+ #if HAS_I_AXIS
+ if (parser.floatval(AXIS4_NAME) > 0) homing_feedrate_mm_m.i = parser.value_axis_units(I_AXIS);
+ #endif
+ #if HAS_J_AXIS
+ if (parser.floatval(AXIS5_NAME) > 0) homing_feedrate_mm_m.j = parser.value_axis_units(J_AXIS);
+ #endif
+ #if HAS_K_AXIS
+ if (parser.floatval(AXIS6_NAME) > 0) homing_feedrate_mm_m.k = parser.value_axis_units(K_AXIS);
+ #endif
+ #if HAS_U_AXIS
+ if (parser.floatval(AXIS7_NAME) > 0) homing_feedrate_mm_m.u = parser.value_axis_units(U_AXIS);
+ #endif
+ #if HAS_V_AXIS
+ if (parser.floatval(AXIS8_NAME) > 0) homing_feedrate_mm_m.v = parser.value_axis_units(V_AXIS);
+ #endif
+ #if HAS_W_AXIS
+ if (parser.floatval(AXIS9_NAME) > 0) homing_feedrate_mm_m.w = parser.value_axis_units(W_AXIS);
+ #endif
+}
+
+void GcodeSuite::M210_report(const bool forReplay/*=true*/) {
+ TERN_(MARLIN_SMALL_BUILD, return);
+
+ report_heading_etc(forReplay, F(STR_HOMING_FEEDRATE));
+
+ SERIAL_ECHOPGM(" M210");
+ SERIAL_ECHOLNPGM_P(
+ LIST_N(DOUBLE(NUM_AXES)
+ , SP_X_STR, X_AXIS_UNIT(homing_feedrate_mm_m.x)
+ , SP_Y_STR, Y_AXIS_UNIT(homing_feedrate_mm_m.y)
+ , SP_Z_STR, Z_AXIS_UNIT(homing_feedrate_mm_m.z)
+ , SP_I_STR, I_AXIS_UNIT(homing_feedrate_mm_m.i)
+ , SP_J_STR, J_AXIS_UNIT(homing_feedrate_mm_m.j)
+ , SP_K_STR, K_AXIS_UNIT(homing_feedrate_mm_m.k)
+ , SP_U_STR, U_AXIS_UNIT(homing_feedrate_mm_m.u)
+ , SP_V_STR, V_AXIS_UNIT(homing_feedrate_mm_m.v)
+ , SP_W_STR, W_AXIS_UNIT(homing_feedrate_mm_m.w)
+ )
+ );
+}
+
+#endif // EDITABLE_HOMING_FEEDRATE
diff --git a/firmware/Marlin/src/gcode/config/M43.cpp b/firmware/Marlin/src/gcode/config/M43.cpp
index c695cd3..8936077 100644
--- a/firmware/Marlin/src/gcode/config/M43.cpp
+++ b/firmware/Marlin/src/gcode/config/M43.cpp
@@ -71,11 +71,13 @@ inline void toggle_pins() {
else {
hal.watchdog_refresh();
printPinStateExt(pin, ignore_protection, true, F("Pulsing "));
- #ifdef __STM32F1__
- const auto prior_mode = _GET_MODE(i);
- #else
- const bool prior_mode = getValidPinMode(pin);
- #endif
+ const auto prior_mode = (
+ #ifdef __STM32F1__
+ _GET_MODE(i)
+ #else
+ getValidPinMode(pin)
+ #endif
+ );
#if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
if (pin == TEENSY_E2) {
SET_OUTPUT(TEENSY_E2);
diff --git a/firmware/Marlin/src/gcode/control/T.cpp b/firmware/Marlin/src/gcode/control/T.cpp
index 3b0c173..9f6fb2b 100644
--- a/firmware/Marlin/src/gcode/control/T.cpp
+++ b/firmware/Marlin/src/gcode/control/T.cpp
@@ -32,7 +32,7 @@
#endif
#if HAS_PRUSA_MMU3
- #include "../../feature/mmu3/mmu2.h"
+ #include "../../feature/mmu3/mmu3.h"
#elif HAS_PRUSA_MMU2
#include "../../feature/mmu/mmu2.h"
#endif
diff --git a/firmware/Marlin/src/gcode/eeprom/M500-M504.cpp b/firmware/Marlin/src/gcode/eeprom/M500-M504.cpp
index c396211..ffa6d5c 100644
--- a/firmware/Marlin/src/gcode/eeprom/M500-M504.cpp
+++ b/firmware/Marlin/src/gcode/eeprom/M500-M504.cpp
@@ -22,7 +22,6 @@
#include "../gcode.h"
#include "../../module/settings.h"
-#include "../../core/serial.h"
#include "../../inc/MarlinConfig.h"
#if ENABLED(CONFIGURATION_EMBEDDING)
diff --git a/firmware/Marlin/src/gcode/feature/cancel/M486.cpp b/firmware/Marlin/src/gcode/feature/cancel/M486.cpp
index c1e90d1..37347e9 100644
--- a/firmware/Marlin/src/gcode/feature/cancel/M486.cpp
+++ b/firmware/Marlin/src/gcode/feature/cancel/M486.cpp
@@ -41,7 +41,7 @@ void GcodeSuite::M486() {
if (parser.seen('T')) {
cancelable.reset();
- cancelable.object_count = parser.intval('T', 1);
+ cancelable.state.object_count = parser.intval('T', 1);
}
if (parser.seenval('S'))
diff --git a/firmware/Marlin/src/gcode/feature/macro/M820.cpp b/firmware/Marlin/src/gcode/feature/macro/M820.cpp
new file mode 100644
index 0000000..9759f48
--- /dev/null
+++ b/firmware/Marlin/src/gcode/feature/macro/M820.cpp
@@ -0,0 +1,52 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2019 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 .
+ *
+ */
+
+#include "../../../inc/MarlinConfig.h"
+
+#if ENABLED(GCODE_MACROS)
+
+#include "../../gcode.h"
+#include "../../queue.h"
+#include "../../parser.h"
+
+extern char gcode_macros[GCODE_MACROS_SLOTS][GCODE_MACROS_SLOT_SIZE + 1];
+
+/**
+ * M820: List defined M810 - M819 macros
+ */
+void GcodeSuite::M820() {
+ SERIAL_ECHOLNPGM(STR_STORED_MACROS);
+ bool some = false;
+ for (uint8_t i = 0; i < GCODE_MACROS_SLOTS; ++i) {
+ const char *cmd = gcode_macros[i];
+ if (*cmd) {
+ SERIAL_ECHO(F("M81"), i, C(' '));
+ char c;
+ while ((c = *cmd++)) SERIAL_CHAR(c == '\n' ? '|' : c);
+ SERIAL_EOL();
+ some = true;
+ }
+ }
+ if (!some) SERIAL_ECHOLNPGM("None");
+}
+
+#endif // GCODE_MACROS
diff --git a/firmware/Marlin/src/gcode/feature/pause/G27.cpp b/firmware/Marlin/src/gcode/feature/pause/G27.cpp
index 229b22a..99159cf 100644
--- a/firmware/Marlin/src/gcode/feature/pause/G27.cpp
+++ b/firmware/Marlin/src/gcode/feature/pause/G27.cpp
@@ -27,6 +27,9 @@
#include "../../gcode.h"
#include "../../../libs/nozzle.h"
#include "../../../module/motion.h"
+#if ENABLED(SOVOL_SV06_RTS)
+ #include "../../../lcd/sovol_rts/sovol_rts.h"
+#endif
/**
* G27: Park the nozzle according with the given style
@@ -42,6 +45,7 @@ void GcodeSuite::G27() {
// Don't allow nozzle parking without homing first
if (homing_needed_error()) return;
nozzle.park(parser.ushortval('P'));
+ TERN_(SOVOL_SV06_RTS, RTS_MoveAxisHoming());
}
#endif // NOZZLE_PARK_FEATURE
diff --git a/firmware/Marlin/src/gcode/feature/pause/G61.cpp b/firmware/Marlin/src/gcode/feature/pause/G61.cpp
index 08b4a99..7f2a45b 100644
--- a/firmware/Marlin/src/gcode/feature/pause/G61.cpp
+++ b/firmware/Marlin/src/gcode/feature/pause/G61.cpp
@@ -75,7 +75,9 @@ void GcodeSuite::G61(int8_t slot/*=-1*/) {
// No XYZ...E parameters, move to stored position
- float epos = stored_position[slot].e;
+ #if HAS_EXTRUDERS
+ float epos = stored_position[slot].e;
+ #endif
if (!parser.seen_axis()) {
DEBUG_ECHOLNPGM(STR_RESTORING_POSITION, slot, " (all axes)");
// Move to the saved position, all axes except E
diff --git a/firmware/Marlin/src/gcode/feature/pause/M600.cpp b/firmware/Marlin/src/gcode/feature/pause/M600.cpp
index a87f14c..294836f 100644
--- a/firmware/Marlin/src/gcode/feature/pause/M600.cpp
+++ b/firmware/Marlin/src/gcode/feature/pause/M600.cpp
@@ -28,14 +28,18 @@
#include "../../../feature/pause.h"
#include "../../../module/motion.h"
#include "../../../module/printcounter.h"
+
#include "../../../lcd/marlinui.h"
+#if ENABLED(SOVOL_SV06_RTS)
+ #include "../../../lcd/sovol_rts/sovol_rts.h"
+#endif
#if HAS_MULTI_EXTRUDER
#include "../../../module/tool_change.h"
#endif
#if HAS_PRUSA_MMU3
- #include "../../../feature/mmu3/mmu2.h"
+ #include "../../../feature/mmu3/mmu3.h"
#if ENABLED(MMU_MENUS)
#include "../../../lcd/menu/menu_mmu2.h"
#endif
@@ -115,6 +119,8 @@ void GcodeSuite::M600() {
if (standardM600)
ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder);
+ TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_ChangeWait_L, ID_ChangeWait_D)); //given the context it seems this likely should have been pages 6 & 61
+
// If needed, home before parking for filament change
TERN_(HOME_BEFORE_FILAMENT_CHANGE, home_if_needed(true));
diff --git a/firmware/Marlin/src/gcode/feature/pause/M701_M702.cpp b/firmware/Marlin/src/gcode/feature/pause/M701_M702.cpp
index 29c8fe9..7e76828 100644
--- a/firmware/Marlin/src/gcode/feature/pause/M701_M702.cpp
+++ b/firmware/Marlin/src/gcode/feature/pause/M701_M702.cpp
@@ -36,7 +36,7 @@
#endif
#if HAS_PRUSA_MMU3
- #include "../../../feature/mmu3/mmu2.h"
+ #include "../../../feature/mmu3/mmu3.h"
#elif HAS_PRUSA_MMU2
#include "../../../feature/mmu/mmu2.h"
#endif
diff --git a/firmware/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp b/firmware/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp
index 23665ac..538583d 100644
--- a/firmware/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp
+++ b/firmware/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp
@@ -27,7 +27,7 @@
#include "../../gcode.h"
#if HAS_PRUSA_MMU3
- #include "../../../feature/mmu3/mmu2.h"
+ #include "../../../feature/mmu3/mmu3.h"
#elif HAS_PRUSA_MMU2
#include "../../../feature/mmu/mmu2.h"
#endif
diff --git a/firmware/Marlin/src/gcode/feature/prusa_MMU2/M704-M709.cpp b/firmware/Marlin/src/gcode/feature/prusa_MMU2/M704-M709.cpp
index 8229959..f6af70b 100644
--- a/firmware/Marlin/src/gcode/feature/prusa_MMU2/M704-M709.cpp
+++ b/firmware/Marlin/src/gcode/feature/prusa_MMU2/M704-M709.cpp
@@ -26,8 +26,8 @@
#include "../../gcode.h"
#include "../../../module/settings.h"
-#include "../../../feature/mmu3/mmu2.h"
-#include "../../../feature/mmu3/mmu2_reporting.h"
+#include "../../../feature/mmu3/mmu3.h"
+#include "../../../feature/mmu3/mmu3_reporting.h"
#include "../../../feature/mmu3/SpoolJoin.h"
// Shared by the G-codes below to save flash memory.
@@ -39,7 +39,7 @@ static void gcodes_M704_M705_M706(uint16_t gcode) {
case 704: mmu3.load_to_feeder(mmuSlotIndex); break;
case 705: mmu3.eject_filament(mmuSlotIndex, false); break;
case 706:
- #if ENABLED(MMU_HAS_CUTTER)
+ #if ENABLED(MMU3_HAS_CUTTER)
if (mmu3.cutter_mode > 0) mmu3.cut_filament(mmuSlotIndex);
#endif
break;
@@ -187,7 +187,7 @@ void GcodeSuite::MMU3_report(const bool forReplay/*=true*/) {
report_heading(forReplay, F("MMU3 Operational Stats"));
SERIAL_ECHOPGM(" MMU "); serialprintln_onoff(mmu3.mmu_hw_enabled);
SERIAL_ECHOPGM(" Stealth Mode "); serialprintln_onoff(mmu3.stealth_mode);
- #if ENABLED(MMU_HAS_CUTTER)
+ #if ENABLED(MMU3_HAS_CUTTER)
SERIAL_ECHOPGM(" Cutter ");
serialprintln_onoff(mmu3.cutter_mode != 0);
#endif
diff --git a/firmware/Marlin/src/gcode/gcode.cpp b/firmware/Marlin/src/gcode/gcode.cpp
index 1ccb107..9fed4dc 100644
--- a/firmware/Marlin/src/gcode/gcode.cpp
+++ b/firmware/Marlin/src/gcode/gcode.cpp
@@ -165,7 +165,7 @@ void GcodeSuite::get_destination_from_command() {
xyze_bool_t seen{false};
#if ENABLED(CANCEL_OBJECTS)
- const bool &skip_move = cancelable.skipping;
+ const bool &skip_move = cancelable.state.skipping;
#else
constexpr bool skip_move = false;
#endif
@@ -200,9 +200,10 @@ void GcodeSuite::get_destination_from_command() {
#endif
if (parser.floatval('F') > 0) {
- feedrate_mm_s = parser.value_feedrate();
+ const float fr_mm_min = parser.value_linear_units();
+ feedrate_mm_s = MMM_TO_MMS(fr_mm_min);
// Update the cutter feed rate for use by M4 I set inline moves.
- TERN_(LASER_FEATURE, cutter.feedrate_mm_m = MMS_TO_MMM(feedrate_mm_s));
+ TERN_(LASER_FEATURE, cutter.feedrate_mm_m = fr_mm_min);
}
#if ALL(PRINTCOUNTER, HAS_EXTRUDERS)
@@ -742,6 +743,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#endif
#endif
+ #if ENABLED(EDITABLE_HOMING_FEEDRATE)
+ case 210: M210(); break; // M210: Set the homing feedrate
+ #endif
+
#if HAS_SOFTWARE_ENDSTOPS
case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops
#endif
@@ -1005,6 +1010,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 810: case 811: case 812: case 813: case 814:
case 815: case 816: case 817: case 818: case 819:
M810_819(); break; // M810-M819: Define/execute G-code macro
+ case 820: M820(); break; // M820: Report macros to serial output
#endif
#if HAS_BED_PROBE
diff --git a/firmware/Marlin/src/gcode/gcode.h b/firmware/Marlin/src/gcode/gcode.h
index 421dda9..589cd2b 100644
--- a/firmware/Marlin/src/gcode/gcode.h
+++ b/firmware/Marlin/src/gcode/gcode.h
@@ -128,6 +128,8 @@
* M84 - Disable steppers until next move, or use S to specify an idle
* duration after which steppers should turn off. S0 disables the timeout.
* M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default)
+ * M86 - Set / Report Hotend Idle Timeout. (Requires HOTEND_IDLE_TIMEOUT)
+ * M87 - Cancel Hotend Idle Timeout (by setting the timeout period to 0). (Requires HOTEND_IDLE_TIMEOUT)
* M92 - Set planner.settings.axis_steps_per_mm for one or more axes. (Requires EDITABLE_STEPS_PER_UNIT)
*
* M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
@@ -195,6 +197,7 @@
* M208 - Set Recover (unretract) Additional (!) Length: S and Feedrate: F. (Requires FWRETRACT)
* M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT_AUTORETRACT)
Every normal extrude-only move will be classified as retract depending on the direction.
+ * M210 - Set or Report the homing feedrate (Requires EDITABLE_HOMING_FEEDRATE)
* M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS)
* M217 - Set filament swap parameters: "M217 S P R". (Requires SINGLENOZZLE)
* M218 - Set/get a tool offset: "M218 T X Y". (Requires 2 or more extruders)
@@ -212,6 +215,8 @@
* M281 - Set servo min|max position: "M281 P L U". (Requires EDITABLE_SERVO_ANGLES)
* M282 - Detach servo: "M282 P". (Requires SERVO_DETACH_GCODE)
* M290 - Babystepping (Requires BABYSTEPPING)
+ * M293 - Babystep Z UP (Requires EP_BABYSTEPPING)
+ * M294 - Babystep Z DOWN (Requires EP_BABYSTEPPING)
* M300 - Play beep sound S P
* M301 - Set PID parameters P I and D. (Requires PIDTEMP)
* M302 - Allow cold extrudes, or set the minimum extrude S. (Requires PREVENT_COLD_EXTRUSION)
@@ -245,6 +250,7 @@
* M430 - Read the system current, voltage, and power (Requires POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE, or POWER_MONITOR_FIXED_VOLTAGE)
* M485 - Send RS485 packets (Requires RS485_SERIAL_PORT)
* M486 - Identify and cancel objects. (Requires CANCEL_OBJECTS)
+ * M493 - Get or set input FT Motion / Shaping parameters. (Requires FT_MOTION)
* M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
* M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
* M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
@@ -260,7 +266,7 @@
* M554 - Get or set IP gateway. (Requires enabled Ethernet port)
* M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160)
* M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE)
- * M592 - Get or set nonlinear extrusion parameters. (Requires NONLINEAR_EXTRUSION)
+ * M592 - Get or set Nonlinear Extrusion parameters. (Requires NONLINEAR_EXTRUSION)
* M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY])
* M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE)
* M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE)
@@ -273,15 +279,17 @@
* M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
* M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
*
- * M704 - Preload to MMU (Requires PRUSA_MMU3)
- * M705 - Eject filament (Requires PRUSA_MMU3)
- * M706 - Cut filament (Requires PRUSA_MMU3)
- * M707 - Read from MMU register (Requires PRUSA_MMU3)
- * M708 - Write to MMU register (Requires PRUSA_MMU3)
- * M709 - MMU power & reset (Requires PRUSA_MMU3)
+ *** PRUSA_MMU3 ***
+ * M704 - Preload to MMU
+ * M705 - Eject filament
+ * M706 - Cut filament
+ * M707 - Read from MMU register
+ * M708 - Write to MMU register
+ * M709 - MMU power & reset
*
* M808 - Set or Goto a Repeat Marker (Requires GCODE_REPEAT_MARKERS)
* M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS)
+ * M820 - Report all defined M810-M819 G-code macros (Requires GCODE_MACROS)
* M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below)
* M852 - Set skew factors: "M852 [I] [J] [K]". (Requires SKEW_CORRECTION_GCODE, plus SKEW_CORRECTION_FOR_Z for IJ)
*
@@ -897,8 +905,15 @@ private:
#endif
#endif
- static void M211();
- static void M211_report(const bool forReplay=true);
+ #if ENABLED(EDITABLE_HOMING_FEEDRATE)
+ static void M210();
+ static void M210_report(const bool forReplay=true);
+ #endif
+
+ #if HAS_SOFTWARE_ENDSTOPS
+ static void M211();
+ static void M211_report(const bool forReplay=true);
+ #endif
#if HAS_MULTI_EXTRUDER
static void M217();
@@ -1186,6 +1201,7 @@ private:
#if ENABLED(GCODE_MACROS)
static void M810_819();
+ static void M820();
#endif
#if HAS_BED_PROBE
diff --git a/firmware/Marlin/src/gcode/host/M115.cpp b/firmware/Marlin/src/gcode/host/M115.cpp
index 0d38d31..a4a2ac4 100644
--- a/firmware/Marlin/src/gcode/host/M115.cpp
+++ b/firmware/Marlin/src/gcode/host/M115.cpp
@@ -109,7 +109,7 @@ void GcodeSuite::M115() {
SERIAL_ECHO(F("CEDE2A2F-"));
for (uint8_t i = 1; i <= 6; i++) {
print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444
- if (i <= 3) SERIAL_ECHO(C('-'));
+ if (i <= 3) SERIAL_CHAR('-');
}
#endif
#endif
@@ -155,7 +155,7 @@ void GcodeSuite::M115() {
cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
// RUNOUT (M412, M600)
- cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
+ cap_line(F("RUNOUT"), ENABLED(HAS_FILAMENT_SENSOR));
// Z_PROBE (G30)
cap_line(F("Z_PROBE"), ENABLED(HAS_BED_PROBE));
diff --git a/firmware/Marlin/src/gcode/host/M360.cpp b/firmware/Marlin/src/gcode/host/M360.cpp
index 8d6bb47..535ed48 100644
--- a/firmware/Marlin/src/gcode/host/M360.cpp
+++ b/firmware/Marlin/src/gcode/host/M360.cpp
@@ -61,7 +61,9 @@ void GcodeSuite::M360() {
PGMSTR(X_STR, "X");
PGMSTR(Y_STR, "Y");
PGMSTR(Z_STR, "Z");
- PGMSTR(JERK_STR, "Jerk");
+ #if ANY(CLASSIC_JERK, HAS_LINEAR_E_JERK)
+ PGMSTR(JERK_STR, "Jerk");
+ #endif
//
// Basics and Enabled items
diff --git a/firmware/Marlin/src/gcode/motion/G0_G1.cpp b/firmware/Marlin/src/gcode/motion/G0_G1.cpp
index 957541a..c6c1833 100644
--- a/firmware/Marlin/src/gcode/motion/G0_G1.cpp
+++ b/firmware/Marlin/src/gcode/motion/G0_G1.cpp
@@ -35,6 +35,10 @@
#include "../../module/planner.h"
#endif
+#if ENABLED(SOVOL_SV06_RTS)
+ #include "../../lcd/sovol_rts/sovol_rts.h"
+#endif
+
extern xyze_pos_t destination;
#if ENABLED(VARIABLE_G0_FEEDRATE)
@@ -116,4 +120,6 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
#else
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
#endif
+
+ TERN_(SOVOL_SV06_RTS, RTS_PauseMoveAxisPage());
}
diff --git a/firmware/Marlin/src/gcode/motion/G5.cpp b/firmware/Marlin/src/gcode/motion/G5.cpp
index c47f443..fe1e664 100644
--- a/firmware/Marlin/src/gcode/motion/G5.cpp
+++ b/firmware/Marlin/src/gcode/motion/G5.cpp
@@ -45,25 +45,24 @@
* G5: Cubic B-spline
*/
void GcodeSuite::G5() {
- if (MOTION_CONDITIONS) {
+ if (!MOTION_CONDITIONS) return;
- #if ENABLED(CNC_WORKSPACE_PLANES)
- if (workspace_plane != PLANE_XY) {
- SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE);
- return;
- }
- #endif
+ #if ENABLED(CNC_WORKSPACE_PLANES)
+ if (workspace_plane != PLANE_XY) {
+ SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE);
+ return;
+ }
+ #endif
- get_destination_from_command();
+ get_destination_from_command();
- const xy_pos_t offsets[2] = {
- { parser.linearval('I'), parser.linearval('J') },
- { parser.linearval('P'), parser.linearval('Q') }
- };
+ const xy_pos_t offsets[2] = {
+ { parser.linearval('I'), parser.linearval('J') },
+ { parser.linearval('P'), parser.linearval('Q') }
+ };
- cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder);
- current_position = destination;
- }
+ cubic_b_spline(current_position, destination, offsets, MMS_SCALED(feedrate_mm_s), active_extruder);
+ current_position = destination;
}
#endif // BEZIER_CURVE_SUPPORT
diff --git a/firmware/Marlin/src/gcode/motion/M290.cpp b/firmware/Marlin/src/gcode/motion/M290.cpp
index d10f9ee..192efe7 100644
--- a/firmware/Marlin/src/gcode/motion/M290.cpp
+++ b/firmware/Marlin/src/gcode/motion/M290.cpp
@@ -29,10 +29,6 @@
#include "../../module/probe.h"
#include "../../module/planner.h"
-#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
- #include "../../core/serial.h"
-#endif
-
#if ENABLED(MESH_BED_LEVELING)
#include "../../feature/bedlevel/bedlevel.h"
#endif
diff --git a/firmware/Marlin/src/gcode/ota/M936.cpp b/firmware/Marlin/src/gcode/ota/M936.cpp
index 6324b3d..f42d197 100644
--- a/firmware/Marlin/src/gcode/ota/M936.cpp
+++ b/firmware/Marlin/src/gcode/ota/M936.cpp
@@ -26,10 +26,6 @@
#include "../gcode.h"
#include "../../libs/BL24CXX.h"
-#if ENABLED(CREALITY_RTS)
- #include "../../lcd/rts/lcd_rts.h"
-#endif
-
#define OTA_FLAG_EEPROM 90
//#define DEBUG_OUT 1
@@ -48,21 +44,11 @@ void GcodeSuite::M936() {
// Set the OTA board firmware upgrade flag ahead of reboot.
ota_update_flag = 0x01;
DEBUG_ECHOLNPGM("Motherboard upgrade flag set");
- TERN_(CREALITY_RTS, RTS_Error(Error_205));
break;
-
- #if ENABLED(CREALITY_RTS)
- case 3:
- // Set the OTA screen firmware upgrade flag ahead of reboot.
- ota_update_flag = 0x02;
- DEBUG_ECHOLNPGM("DWIN upgrade flag set");
- TERN_(CREALITY_RTS, RTS_Error(Error_206));
- break;
- #endif
}
switch (ota) {
- case 2: TERN_(CREALITY_RTS, case 3:)
+ case 2:
BL24CXX::write(OTA_FLAG_EEPROM, &ota_update_flag, sizeof(ota_update_flag));
safe_delay(100);
hal.reboot();
diff --git a/firmware/Marlin/src/gcode/parser.cpp b/firmware/Marlin/src/gcode/parser.cpp
index 3975cea..54ae802 100644
--- a/firmware/Marlin/src/gcode/parser.cpp
+++ b/firmware/Marlin/src/gcode/parser.cpp
@@ -115,9 +115,7 @@ void GCodeParser::parse(char *p) {
reset(); // No codes to report
auto uppercase = [](char c) {
- if (TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')))
- c += 'A' - 'a';
- return c;
+ return TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')) ? c + 'A' - 'a' : c;
};
// Skip spaces
diff --git a/firmware/Marlin/src/gcode/parser.h b/firmware/Marlin/src/gcode/parser.h
index 94c5b28..9423b23 100644
--- a/firmware/Marlin/src/gcode/parser.h
+++ b/firmware/Marlin/src/gcode/parser.h
@@ -192,7 +192,7 @@ public:
#if ENABLED(GCODE_CASE_INSENSITIVE)
FORCE_INLINE static char* strgchr(char *p, char g) {
auto uppercase = [](char c) {
- return c + (WITHIN(c, 'a', 'z') ? 'A' - 'a' : 0);
+ return TERN0(GCODE_CASE_INSENSITIVE, WITHIN(c, 'a', 'z')) ? c + 'A' - 'a' : c;
};
const char d = uppercase(g);
for (char cc; (cc = uppercase(*p)); p++) if (cc == d) return p;
@@ -347,6 +347,9 @@ public:
#define LINEAR_UNIT(V) parser.mm_to_linear_unit(V)
#define VOLUMETRIC_UNIT(V) parser.mm_to_volumetric_unit(V)
+ #define X_AXIS_UNIT LINEAR_UNIT
+ #define Y_AXIS_UNIT LINEAR_UNIT
+ #define Z_AXIS_UNIT LINEAR_UNIT
#define I_AXIS_UNIT(V) TERN(AXIS4_ROTATES, (V), LINEAR_UNIT(V))
#define J_AXIS_UNIT(V) TERN(AXIS5_ROTATES, (V), LINEAR_UNIT(V))
#define K_AXIS_UNIT(V) TERN(AXIS6_ROTATES, (V), LINEAR_UNIT(V))
diff --git a/firmware/Marlin/src/gcode/sd/M1001.cpp b/firmware/Marlin/src/gcode/sd/M1001.cpp
index a00ca61..a8213f3 100644
--- a/firmware/Marlin/src/gcode/sd/M1001.cpp
+++ b/firmware/Marlin/src/gcode/sd/M1001.cpp
@@ -59,6 +59,10 @@
#define PE_LEDS_COMPLETED_TIME (30*60)
#endif
+#if ENABLED(SOVOL_SV06_RTS)
+ #include "../../lcd/sovol_rts/sovol_rts.h"
+#endif
+
/**
* M1001: Execute actions for SD print completion
*/
@@ -110,6 +114,14 @@ void GcodeSuite::M1001() {
// Re-select the last printed file in the UI
TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file());
+
+ #if ENABLED(SOVOL_SV06_RTS)
+ rts.sendData(100, PRINT_PROCESS_VP); delay(1);
+ rts.sendData(100, PRINT_PROCESS_ICON_VP); delay(1);
+ rts.sendData(0, PRINT_SURPLUS_TIME_HOUR_VP); delay(1);
+ rts.sendData(0, PRINT_SURPLUS_TIME_MIN_VP); delay(1);
+ rts.gotoPage(ID_Finish_L, ID_Finish_D);
+ #endif
}
#endif // HAS_MEDIA
diff --git a/firmware/Marlin/src/gcode/stats/M31.cpp b/firmware/Marlin/src/gcode/stats/M31.cpp
index ad48eae..a826f9f 100644
--- a/firmware/Marlin/src/gcode/stats/M31.cpp
+++ b/firmware/Marlin/src/gcode/stats/M31.cpp
@@ -21,7 +21,6 @@
*/
#include "../gcode.h"
-#include "../../core/serial.h"
#include "../../module/printcounter.h"
#include "../../libs/duration_t.h"
#include "../../lcd/marlinui.h"
diff --git a/firmware/Marlin/src/inc/Changes.h b/firmware/Marlin/src/inc/Changes.h
index 4d81b22..8e7a71e 100644
--- a/firmware/Marlin/src/inc/Changes.h
+++ b/firmware/Marlin/src/inc/Changes.h
@@ -468,7 +468,7 @@
#elif defined(ANYCUBIC_LCD_SERIAL_PORT)
#error "ANYCUBIC_LCD_SERIAL_PORT is now LCD_SERIAL_PORT."
#elif defined(INTERNAL_SERIAL_PORT)
- #error "INTERNAL_SERIAL_PORT is now MMU2_SERIAL_PORT."
+ #error "INTERNAL_SERIAL_PORT is now MMU_SERIAL_PORT."
#elif defined(X_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Y_DUAL_ENDSTOPS_ADJUSTMENT) || defined(Z_DUAL_ENDSTOPS_ADJUSTMENT)
#error "[XYZ]_DUAL_ENDSTOPS_ADJUSTMENT is now [XYZ]2_ENDSTOP_ADJUSTMENT."
#elif defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT2) || defined(Z_TRIPLE_ENDSTOPS_ADJUSTMENT3)
@@ -676,7 +676,7 @@
#elif defined(Z2_USE_ENDSTOP)
#error "Z2_USE_ENDSTOP is obsolete. Instead set Z2_STOP_PIN directly. (e.g., 'Z2_USE_ENDSTOP _ZMAX_' becomes 'Z2_STOP_PIN Z_MAX_PIN')"
#elif defined(Z3_USE_ENDSTOP)
- #error "Z3_USE_ENDSTOP is obsolete. Instead set Z2_STOP_PIN directly. (e.g., 'Z3_USE_ENDSTOP _ZMAX_' becomes 'Z3_STOP_PIN Z_MAX_PIN')"
+ #error "Z3_USE_ENDSTOP is obsolete. Instead set Z3_STOP_PIN directly. (e.g., 'Z3_USE_ENDSTOP _ZMAX_' becomes 'Z3_STOP_PIN Z_MAX_PIN')"
#elif defined(Z4_USE_ENDSTOP)
#error "Z4_USE_ENDSTOP is obsolete. Instead set Z4_STOP_PIN directly. (e.g., 'Z4_USE_ENDSTOP _ZMAX_' becomes 'Z4_STOP_PIN Z_MAX_PIN')"
#elif defined(INTEGRATED_BABYSTEPPING)
@@ -701,6 +701,46 @@
#error "CALIBRATION_MEASUREMENT_RESOLUTION is no longer needed and should be removed."
#elif defined(MMU2_MENUS)
#error "MMU2_MENUS is now MMU_MENUS."
+#elif defined(MMU2_SERIAL_PORT)
+ #error "MMU2_SERIAL_PORT is now MMU_SERIAL_PORT."
+#elif defined(MMU2_RST_PIN)
+ #error "MMU2_RST_PIN is now MMU_RST_PIN."
+#elif defined(MMU2_MAX_RETRIES)
+ #error "MMU2_MAX_RETRIES is now MMU3_MAX_RETRIES."
+#elif defined(MMU2_FILAMENT_SENSOR_POSITION)
+ #error "MMU2_FILAMENT_SENSOR_POSITION is now MMU3_FILAMENT_SENSOR_POSITION."
+#elif defined(MMU2_TOOL_CHANGE_LOAD_LENGTH)
+ #error "MMU2_TOOL_CHANGE_LOAD_LENGTH is now MMU3_TOOL_CHANGE_LOAD_LENGTH."
+#elif defined(MMU2_LOAD_TO_NOZZLE_FEED_RATE)
+ #error "MMU2_LOAD_TO_NOZZLE_FEED_RATE is now MMU3_LOAD_TO_NOZZLE_FEED_RATE."
+#elif defined(MMU2_UNLOAD_TO_FINDA_FEED_RATE)
+ #error "MMU2_UNLOAD_TO_FINDA_FEED_RATE is no longer needed and should be removed."
+#elif defined(MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE)
+ #error "MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE is now MMU3_VERIFY_LOAD_TO_NOZZLE_FEED_RATE."
+#elif defined(MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH)
+ #error "MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH is now MMU3_RETRY_UNLOAD_TO_FINDA_LENGTH."
+#elif defined(MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE)
+ #error "MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE is now MMU3_RETRY_UNLOAD_TO_FINDA_FEED_RATE."
+#elif defined(MMU2_FILAMENT_SENSOR_POSITION)
+ #error "MMU2_FILAMENT_SENSOR_POSITION is now MMU3_FILAMENT_SENSOR_E_POSITION."
+#elif defined(MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH)
+ #error "MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH is now MMU3_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH."
+#elif defined(MMU_HAS_CUTTER)
+ #error "MMU_HAS_CUTTER is now MMU3_HAS_CUTTER."
+#elif defined(MMU_FORCE_STEALTH_MODE)
+ #error "MMU_FORCE_STEALTH_MODE is obsolete and should be removed."
+#elif defined(MMU_SPOOL_JOIN_CONSUMES_ALL_FILAMENT)
+ #error "MMU_SPOOL_JOIN_CONSUMES_ALL_FILAMENT is now MMU3_SPOOL_JOIN_CONSUMES_ALL_FILAMENT."
+#elif HAS_PRUSA_MMU3 && defined(MMU2_LOAD_TO_NOZZLE_SEQUENCE)
+ #error "MMU2_LOAD_TO_NOZZLE_SEQUENCE is now MMU3_LOAD_TO_NOZZLE_SEQUENCE for MMU_MODEL MMU3."
+#elif HAS_PRUSA_MMU3 && defined(MMU2_RAMMING_SEQUENCE)
+ #error "MMU2_RAMMING_SEQUENCE is now MMU3_RAMMING_SEQUENCE for MMU_MODEL MMU3."
+#elif defined(MMU_EXTRUDER_SENSOR)
+ #error "MMU_EXTRUDER_SENSOR is now MMU2_EXTRUDER_SENSOR."
+#elif defined(MMU_LOADING_ATTEMPTS_NR)
+ #error "MMU_LOADING_ATTEMPTS_NR is now MMU2_LOADING_ATTEMPTS_NR."
+#elif defined(MMU2_DEBUG)
+ #error "MMU2_DEBUG is now MMU_DEBUG."
#elif defined(FTM_SHAPING_DEFAULT_X_FREQ) || defined(FTM_SHAPING_DEFAULT_Y_FREQ)
#error "FTM_SHAPING_DEFAULT_[XY]_FREQ is now FTM_SHAPING_DEFAULT_FREQ_[XY]."
#endif
diff --git a/firmware/Marlin/src/inc/Conditionals-1-axes.h b/firmware/Marlin/src/inc/Conditionals-1-axes.h
index 1ea88ce..5f8dad3 100644
--- a/firmware/Marlin/src/inc/Conditionals-1-axes.h
+++ b/firmware/Marlin/src/inc/Conditionals-1-axes.h
@@ -67,6 +67,7 @@
#undef MECHANICAL_SWITCHING_NOZZLE
#undef MIXING_EXTRUDER
#undef HOTEND_IDLE_TIMEOUT
+ #undef HOTEND_OVERSHOOT
#undef DISABLE_E
#undef PREVENT_LENGTHY_EXTRUDE
#undef FILAMENT_RUNOUT_SENSOR
diff --git a/firmware/Marlin/src/inc/Conditionals-2-LCD.h b/firmware/Marlin/src/inc/Conditionals-2-LCD.h
index cc01e93..e7ea7bd 100644
--- a/firmware/Marlin/src/inc/Conditionals-2-LCD.h
+++ b/firmware/Marlin/src/inc/Conditionals-2-LCD.h
@@ -483,7 +483,7 @@
#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)
+#if ANY(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI, SOVOL_SV06_RTS)
#define HAS_DWIN_E3V2 1
#define STD_ENCODER_PULSES_PER_STEP 4
#endif
@@ -555,7 +555,7 @@
#endif
// E3V2 extras
-#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
+#if ANY(HAS_DWIN_E3V2, IS_DWIN_MARLINUI, SOVOL_SV06_RTS)
#define SERIAL_CATCHALL 0
#define HAS_LCD_BRIGHTNESS 1
#define LCD_BRIGHTNESS_MAX 250
@@ -568,7 +568,7 @@
#endif
// Serial Controllers require LCD_SERIAL_PORT
-#if ANY(IS_DWIN_MARLINUI, HAS_DWIN_E3V2, HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT)
+#if ANY(IS_DWIN_MARLINUI, HAS_DWIN_E3V2, HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, SOVOL_SV06_RTS)
#define LCD_IS_SERIAL_HOST 1
#endif
@@ -649,7 +649,7 @@
#if !HAS_MARLINUI_HD44780
#undef LCD_INFO_SCREEN_STYLE
#endif
-#if NONE(HAS_MARLINUI_U8GLIB, HAS_TFT_LVGL_UI, DGUS_LCD_UI_E3S1PRO)
+#if NONE(HAS_MARLINUI_U8GLIB, HAS_TFT_LVGL_UI, TFT_COLOR_UI, DGUS_LCD_UI_E3S1PRO)
#undef LCD_LANGUAGE
#endif
#if DISABLED(MPC_AUTOTUNE)
diff --git a/firmware/Marlin/src/inc/Conditionals-3-etc.h b/firmware/Marlin/src/inc/Conditionals-3-etc.h
index 3c685ad..6a1b3b7 100644
--- a/firmware/Marlin/src/inc/Conditionals-3-etc.h
+++ b/firmware/Marlin/src/inc/Conditionals-3-etc.h
@@ -71,17 +71,19 @@
#undef TEMP_SENSOR_BED
#undef THERMAL_PROTECTION_BED
#undef MAX_BED_POWER
+ #undef PREHEAT_1_TEMP_BED
+ #undef PREHEAT_2_TEMP_BED
#endif
#if !TEMP_SENSOR_CHAMBER
#undef TEMP_SENSOR_CHAMBER
#undef THERMAL_PROTECTION_CHAMBER
- #undef CHAMBER_AUTO_FAN_PIN
#undef MAX_CHAMBER_POWER
+ #undef PREHEAT_1_TEMP_CHAMBER
+ #undef PREHEAT_2_TEMP_CHAMBER
#endif
#if !TEMP_SENSOR_COOLER
#undef TEMP_SENSOR_COOLER
#undef THERMAL_PROTECTION_COOLER
- #undef COOLER_AUTO_FAN_PIN
#endif
#if !TEMP_SENSOR_PROBE
#undef TEMP_SENSOR_PROBE
@@ -442,6 +444,7 @@
#else
// Clear probe pin settings when no probe is selected
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+ #undef Z_MIN_PROBE_ENDSTOP_HIT_STATE
#undef USE_PROBE_FOR_Z_HOMING
#undef Z_MIN_PROBE_REPEATABILITY_TEST
#undef HOMING_Z_WITH_PROBE
diff --git a/firmware/Marlin/src/inc/Conditionals-4-adv.h b/firmware/Marlin/src/inc/Conditionals-4-adv.h
index 1401dab..be65120 100644
--- a/firmware/Marlin/src/inc/Conditionals-4-adv.h
+++ b/firmware/Marlin/src/inc/Conditionals-4-adv.h
@@ -51,39 +51,39 @@
#define NUM_SERVOS 0
#if HAS_Z_SERVO_PROBE && NUM_SERVOS <= Z_PROBE_SERVO_NR
#undef NUM_SERVOS
- #define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
+ #define NUM_SERVOS INCREMENT(Z_PROBE_SERVO_NR)
#endif
#if ENABLED(CHAMBER_VENT) && NUM_SERVOS <= CHAMBER_VENT_SERVO_NR
#undef NUM_SERVOS
- #define NUM_SERVOS (CHAMBER_VENT_SERVO_NR + 1)
+ #define NUM_SERVOS INCREMENT(CHAMBER_VENT_SERVO_NR)
#endif
#if ENABLED(SWITCHING_TOOLHEAD) && NUM_SERVOS <= SWITCHING_TOOLHEAD_SERVO_NR
#undef NUM_SERVOS
- #define NUM_SERVOS (SWITCHING_TOOLHEAD_SERVO_NR + 1)
+ #define NUM_SERVOS INCREMENT(SWITCHING_TOOLHEAD_SERVO_NR)
#endif
#if ENABLED(SWITCHING_NOZZLE)
#if NUM_SERVOS <= SWITCHING_NOZZLE_SERVO_NR
#undef NUM_SERVOS
- #define NUM_SERVOS (SWITCHING_NOZZLE_SERVO_NR + 1)
+ #define NUM_SERVOS INCREMENT(SWITCHING_NOZZLE_SERVO_NR)
#endif
#if NUM_SERVOS <= SWITCHING_NOZZLE_E1_SERVO_NR
#undef NUM_SERVOS
- #define NUM_SERVOS (SWITCHING_NOZZLE_E1_SERVO_NR + 1)
+ #define NUM_SERVOS INCREMENT(SWITCHING_NOZZLE_E1_SERVO_NR)
#endif
#endif
#if ENABLED(SWITCHING_EXTRUDER)
#if NUM_SERVOS <= SWITCHING_EXTRUDER_SERVO_NR
#undef NUM_SERVOS
- #define NUM_SERVOS (SWITCHING_EXTRUDER_SERVO_NR + 1)
+ #define NUM_SERVOS INCREMENT(SWITCHING_EXTRUDER_SERVO_NR)
#endif
#if NUM_SERVOS <= SWITCHING_EXTRUDER_E23_SERVO_NR
#undef NUM_SERVOS
- #define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1)
+ #define NUM_SERVOS INCREMENT(SWITCHING_EXTRUDER_E23_SERVO_NR)
#endif
#endif
#if ENABLED(SPINDLE_SERVO) && NUM_SERVOS <= SPINDLE_SERVO_NR
#undef NUM_SERVOS
- #define NUM_SERVOS (SPINDLE_SERVO_NR + 1)
+ #define NUM_SERVOS INCREMENT(SPINDLE_SERVO_NR)
#endif
#endif // !defined(NUM_SERVOS)
@@ -233,6 +233,14 @@
#undef STEALTHCHOP_E
#endif
+#if !TEMP_SENSOR_CHAMBER
+ #undef CHAMBER_CHECK_INTERVAL
+ #undef CHAMBER_AUTO_FAN_PIN
+#endif
+#if !TEMP_SENSOR_COOLER
+ #undef COOLER_AUTO_FAN_PIN
+#endif
+
#if ENABLED(DISABLE_X) && !defined(DISABLE_IDLE_X)
#define DISABLE_IDLE_X
#endif
@@ -610,23 +618,6 @@
#endif
#endif
-#if TEMP_SENSOR_IS_MAX_TC(0) || TEMP_SENSOR_IS_MAX_TC(1) || TEMP_SENSOR_IS_MAX_TC(2) || TEMP_SENSOR_IS_MAX_TC(BED) || TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
- #define HAS_MAX_TC 1
-#endif
-#if TEMP_SENSOR_0_IS_MAX6675 || TEMP_SENSOR_1_IS_MAX6675 || TEMP_SENSOR_2_IS_MAX6675 || TEMP_SENSOR_BED_IS_MAX6675 || TEMP_SENSOR_REDUNDANT_IS_MAX6675
- #define HAS_MAX6675 1
-#endif
-#if TEMP_SENSOR_0_IS_MAX31855 || TEMP_SENSOR_1_IS_MAX31855 || TEMP_SENSOR_2_IS_MAX31855 || TEMP_SENSOR_BED_IS_MAX31855 || TEMP_SENSOR_REDUNDANT_IS_MAX31855
- #define HAS_MAX31855 1
-#endif
-#if TEMP_SENSOR_0_IS_MAX31865 || TEMP_SENSOR_1_IS_MAX31865 || TEMP_SENSOR_2_IS_MAX31865 || TEMP_SENSOR_BED_IS_MAX31865 || TEMP_SENSOR_REDUNDANT_IS_MAX31865
- #define HAS_MAX31865 1
-#endif
-
-#if !HAS_MAX_TC
- #undef THERMOCOUPLE_MAX_ERRORS
-#endif
-
#if TEMP_SENSOR_3 == -4
#define TEMP_SENSOR_3_IS_AD8495 1
#elif TEMP_SENSOR_3 == -3
@@ -745,6 +736,23 @@
#endif
#endif
+#if TEMP_SENSOR_IS_MAX_TC(0) || TEMP_SENSOR_IS_MAX_TC(1) || TEMP_SENSOR_IS_MAX_TC(2) || TEMP_SENSOR_IS_MAX_TC(BED) || TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
+ #define HAS_MAX_TC 1
+#endif
+#if TEMP_SENSOR_0_IS_MAX6675 || TEMP_SENSOR_1_IS_MAX6675 || TEMP_SENSOR_2_IS_MAX6675 || TEMP_SENSOR_BED_IS_MAX6675 || TEMP_SENSOR_REDUNDANT_IS_MAX6675
+ #define HAS_MAX6675 1
+#endif
+#if TEMP_SENSOR_0_IS_MAX31855 || TEMP_SENSOR_1_IS_MAX31855 || TEMP_SENSOR_2_IS_MAX31855 || TEMP_SENSOR_BED_IS_MAX31855 || TEMP_SENSOR_REDUNDANT_IS_MAX31855
+ #define HAS_MAX31855 1
+#endif
+#if TEMP_SENSOR_0_IS_MAX31865 || TEMP_SENSOR_1_IS_MAX31865 || TEMP_SENSOR_2_IS_MAX31865 || TEMP_SENSOR_BED_IS_MAX31865 || TEMP_SENSOR_REDUNDANT_IS_MAX31865
+ #define HAS_MAX31865 1
+#endif
+
+#if !HAS_MAX_TC
+ #undef THERMOCOUPLE_MAX_ERRORS
+#endif
+
#if TEMP_SENSOR_CHAMBER == -4
#define TEMP_SENSOR_CHAMBER_IS_AD8495 1
#elif TEMP_SENSOR_CHAMBER == -3
@@ -821,7 +829,12 @@
#undef TEMP_SENSOR_AD8495_GAIN
#undef TEMP_SENSOR_AD8495_OFFSET
#endif
-
+#if !ANY_THERMISTOR_IS(998)
+ #undef DUMMY_THERMISTOR_998_VALUE
+#endif
+#if !ANY_THERMISTOR_IS(999)
+ #undef DUMMY_THERMISTOR_999_VALUE
+#endif
#if !ALL(HAS_X_AXIS, HAS_HOTEND)
#undef AUTOTEMP
#endif
@@ -838,6 +851,8 @@
#if !TEMP_SENSOR_BED
#undef BED_MINTEMP
#undef BED_MAXTEMP
+ #undef BED_OVERSHOOT
+ #undef CONTROLLER_FAN_BED_HEATING
#endif
#if DISABLED(THERMAL_PROTECTION_BED)
#undef THERMAL_PROTECTION_BED_PERIOD
@@ -860,6 +875,7 @@
#if !TEMP_SENSOR_COOLER
#undef COOLER_MINTEMP
#undef COOLER_MAXTEMP
+ #undef COOLER_OVERSHOOT
#endif
#if DISABLED(THERMAL_PROTECTION_COOLER)
#undef THERMAL_PROTECTION_COOLER_PERIOD
@@ -1370,7 +1386,7 @@
#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)
+ #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, CREALITY_CR4NTXXC10, CREALITY_CR4NS, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
#define LCD_SERIAL_PORT 2
#else
#define LCD_SERIAL_PORT 3
diff --git a/firmware/Marlin/src/inc/Conditionals-5-post.h b/firmware/Marlin/src/inc/Conditionals-5-post.h
index df6efb1..55d91c4 100644
--- a/firmware/Marlin/src/inc/Conditionals-5-post.h
+++ b/firmware/Marlin/src/inc/Conditionals-5-post.h
@@ -1851,7 +1851,7 @@
#define SERIAL_IN_USE(N) ( (defined(SERIAL_PORT) && N == SERIAL_PORT) \
|| (defined(SERIAL_PORT_2) && N == SERIAL_PORT_2) \
|| (defined(SERIAL_PORT_3) && N == SERIAL_PORT_3) \
- || (defined(MMU2_SERIAL_PORT) && N == MMU2_SERIAL_PORT) \
+ || (defined(MMU_SERIAL_PORT) && N == MMU_SERIAL_PORT) \
|| (defined(LCD_SERIAL_PORT) && N == LCD_SERIAL_PORT) \
|| (defined(RS485_SERIAL_PORT) && N == RS485_SERIAL_PORT) )
@@ -3039,7 +3039,7 @@
#endif
/**
- * Heated bed requires settings
+ * Heated Bed required settings
*/
#if HAS_HEATED_BED
#ifndef MIN_BED_POWER
@@ -3049,6 +3049,14 @@
#define MAX_BED_POWER 255
#endif
#define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ ENABLED(HEATER_BED_INVERTING))
+ #if ENABLED(PELTIER_BED)
+ /**
+ * A "Heated Bed" Peltier device needs a direction (heat/cool) to be
+ * implemented by a relay (single pin) or H-bridge (2 or 4 pin).
+ * H-Bridge can also perform PWM. (Not recommended for Peltier devices).
+ */
+ #define WRITE_PELTIER_DIR(v) WRITE(PELTIER_DIR_PIN, (v) ? PELTIER_DIR_HEAT_STATE : !PELTIER_DIR_HEAT_STATE)
+ #endif
#endif
/**
@@ -3225,7 +3233,7 @@
* Advanced Pause - Filament Change
*/
#if ENABLED(ADVANCED_PAUSE_FEATURE)
- #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) || ALL(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT)
+ #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI, SOVOL_SV06_RTS) || ALL(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT)
#define M600_PURGE_MORE_RESUMABLE 1 // UI provides some way to Purge More / Resume
#endif
#ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH
diff --git a/firmware/Marlin/src/inc/MarlinConfig.h b/firmware/Marlin/src/inc/MarlinConfig.h
index b0a0434..0164b7c 100644
--- a/firmware/Marlin/src/inc/MarlinConfig.h
+++ b/firmware/Marlin/src/inc/MarlinConfig.h
@@ -26,10 +26,10 @@
//
#include "MarlinConfigPre-6-type.h" // Include even with __MARLIN_DEPS__
+#include "Conditionals-6-type.h"
#ifndef __MARLIN_DEPS__
- #include "Conditionals-6-type.h"
#include HAL_PATH(.., inc/Conditionals_type.h)
#include "Changes.h"
diff --git a/firmware/Marlin/src/inc/MarlinConfigPre-1-axes.h b/firmware/Marlin/src/inc/MarlinConfigPre-1-axes.h
index 4bc16e4..4ddf3bf 100644
--- a/firmware/Marlin/src/inc/MarlinConfigPre-1-axes.h
+++ b/firmware/Marlin/src/inc/MarlinConfigPre-1-axes.h
@@ -25,7 +25,7 @@
#define __MARLIN_FIRMWARE__
#endif
-#if __has_include("../../Config.h")
+#if __has_include("../../../Marlin/Config.h")
#include "../../Config.h"
#else
#define USE_STD_CONFIGS 1
diff --git a/firmware/Marlin/src/inc/MarlinConfigPre-6-type.h b/firmware/Marlin/src/inc/MarlinConfigPre-6-type.h
index 358e34a..31597c6 100644
--- a/firmware/Marlin/src/inc/MarlinConfigPre-6-type.h
+++ b/firmware/Marlin/src/inc/MarlinConfigPre-6-type.h
@@ -26,5 +26,6 @@
#ifndef __MARLIN_DEPS__
#include HAL_PATH(.., inc/Conditionals_post.h)
- #include "../core/types.h" // Ahead of sanity-checks
#endif
+
+#include "../core/types.h" // Ahead of sanity-checks
diff --git a/firmware/Marlin/src/inc/SanityCheck.h b/firmware/Marlin/src/inc/SanityCheck.h
index 42d63ee..6e9e635 100644
--- a/firmware/Marlin/src/inc/SanityCheck.h
+++ b/firmware/Marlin/src/inc/SanityCheck.h
@@ -500,10 +500,12 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#elif ENABLED(BABYSTEP_XY) && !defined(BABYSTEP_MULTIPLICATOR_XY)
#error "BABYSTEP_XY requires BABYSTEP_MULTIPLICATOR_XY."
#elif ENABLED(BABYSTEP_MILLIMETER_UNITS)
- static_assert(BABYSTEP_MULTIPLICATOR_Z <= 0.1f, "BABYSTEP_MULTIPLICATOR_Z must be less or equal to 0.1mm.");
+ static_assert(BABYSTEP_MULTIPLICATOR_Z <= 0.1f, "BABYSTEP_MULTIPLICATOR_Z with BABYSTEP_MILLIMETER_UNITS must be less or equal to 0.1mm.");
#if ENABLED(BABYSTEP_XY)
static_assert(BABYSTEP_MULTIPLICATOR_XY <= 0.25f, "BABYSTEP_MULTIPLICATOR_XY must be less than or equal to 0.25mm.");
#endif
+ #else
+ static_assert(BABYSTEP_MULTIPLICATOR_Z && BABYSTEP_MULTIPLICATOR_Z == int(BABYSTEP_MULTIPLICATOR_Z), "BABYSTEP_MULTIPLICATOR_Z must be a non-zero integer.");
#endif
#endif
@@ -615,10 +617,10 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
#elif (HAS_PRUSA_MMU2S || HAS_PRUSA_MMU3) && DISABLED(FILAMENT_RUNOUT_SENSOR)
#error "PRUSA_MMU2S and HAS_PRUSA_MMU3 requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
- #elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
- #error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
- #elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_MARLINUI_MENU
- #error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI."
+ #elif ENABLED(MMU2_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
+ #error "MMU2_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
+ #elif ENABLED(MMU2_EXTRUDER_SENSOR) && !HAS_MARLINUI_MENU
+ #error "MMU2_EXTRUDER_SENSOR requires an LCD supporting MarlinUI."
#elif ENABLED(MMU_MENUS) && !HAS_MARLINUI_MENU
#error "MMU_MENUS requires an LCD supporting MarlinUI."
#elif HAS_PRUSA_MMU3 && !HAS_MARLINUI_MENU
@@ -628,7 +630,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#elif HAS_PRUSA_MMU3 && DISABLED(EEPROM_SETTINGS)
#error "MMU3 requires EEPROM_SETTINGS."
#elif DISABLED(ADVANCED_PAUSE_FEATURE)
- static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "MMU2_FILAMENT_RUNOUT_SCRIPT cannot make use of M600 unless ADVANCED_PAUSE_FEATURE is enabled");
+ static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required for MMU2_FILAMENT_RUNOUT_SCRIPT to use M600.");
#endif
#endif
@@ -1073,8 +1075,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "DIRECT_STEPPING does not currently support more than 3 axes (i.e., XYZ)."
#elif ENABLED(FOAMCUTTER_XYUV) && !(HAS_I_AXIS && HAS_J_AXIS)
#error "FOAMCUTTER_XYUV requires I and J steppers to be enabled."
-#elif ENABLED(LINEAR_ADVANCE) && HAS_I_AXIS
- #error "LINEAR_ADVANCE does not currently support the inclusion of an I axis."
+#elif ENABLED(LIN_ADVANCE) && HAS_I_AXIS
+ #error "LIN_ADVANCE does not currently support the inclusion of an I axis."
#endif
/**
@@ -1223,7 +1225,54 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#if 1 < 0 \
+ (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
+ COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, BD_SENSOR, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2)
- #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, BD_SENSOR, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2, or Z Servo."
+ #error "Please enable only one probe option. See the following errors:"
+ #if DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE
+ #error "(Z_SERVO_PROBE is enabled.)"
+ #elif ENABLED(BLTOUCH) && !HAS_Z_SERVO_PROBE
+ #error "(BLTOUCH is enabled.)"
+ #endif
+ #if ENABLED(PROBE_MANUALLY)
+ #error "(PROBE_MANUALLY is enabled.)"
+ #endif
+ #if ENABLED(BD_SENSOR)
+ #error "(BD_SENSOR is enabled.)"
+ #endif
+ #if ENABLED(FIX_MOUNTED_PROBE)
+ #error "(FIX_MOUNTED_PROBE is enabled.)"
+ #endif
+ #if ENABLED(NOZZLE_AS_PROBE)
+ #error "(NOZZLE_AS_PROBE is enabled.)"
+ #endif
+ #if ENABLED(TOUCH_MI_PROBE)
+ #error "(TOUCH_MI_PROBE is enabled.)"
+ #endif
+ #if ENABLED(SOLENOID_PROBE)
+ #error "(SOLENOID_PROBE is enabled.)"
+ #endif
+ #if ENABLED(Z_PROBE_ALLEN_KEY)
+ #error "(Z_PROBE_ALLEN_KEY is enabled.)"
+ #endif
+ #if ENABLED(Z_PROBE_SLED)
+ #error "(Z_PROBE_SLED is enabled.)"
+ #endif
+ #if ENABLED(RACK_AND_PINION_PROBE)
+ #error "(RACK_AND_PINION_PROBE is enabled.)"
+ #endif
+ #if ENABLED(SENSORLESS_PROBING)
+ #error "(SENSORLESS_PROBING is enabled.)"
+ #endif
+ #if ENABLED(MAGLEV4)
+ #error "(MAGLEV4 is enabled.)"
+ #endif
+ #if ENABLED(MAG_MOUNTED_PROBE)
+ #error "(MAG_MOUNTED_PROBE is enabled.)"
+ #endif
+ #if ENABLED(BIQU_MICROPROBE_V1)
+ #error "(BIQU_MICROPROBE_V1 is enabled.)"
+ #endif
+ #if ENABLED(BIQU_MICROPROBE_V2)
+ #error "(BIQU_MICROPROBE_V2 is enabled.)"
+ #endif
#endif
#if HAS_BED_PROBE
@@ -2736,7 +2785,7 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
+ COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35, ANYCUBIC_LCD_VYPER) \
+ DGUS_UI_IS(ORIGIN) + DGUS_UI_IS(FYSETC) + DGUS_UI_IS(HIPRECY) + DGUS_UI_IS(MKS) + DGUS_UI_IS(RELOADED) + DGUS_UI_IS(IA_CREALITY) \
+ COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \
- + COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \
+ + COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE, SOVOL_SV06_RTS) \
+ COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_GENERIC_12864_1_1) \
+ COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
+ COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
@@ -2944,8 +2993,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT to a valid value for your board."
#elif SERIAL_PORT_2 == -1
#error "SERIAL_PORT_2 is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT_2 to a valid value for your board."
- #elif MMU2_SERIAL_PORT == -1
- #error "MMU2_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set MMU2_SERIAL_PORT to a valid value for your board."
+ #elif MMU_SERIAL_PORT == -1
+ #error "MMU_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set MMU_SERIAL_PORT to a valid value for your board."
#elif LCD_SERIAL_PORT == -1
#error "LCD_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set LCD_SERIAL_PORT to a valid value for your board."
#endif
@@ -2954,15 +3003,15 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
/**
* MMU2 require a dedicated serial port
*/
-#ifdef MMU2_SERIAL_PORT
- #if MMU2_SERIAL_PORT == SERIAL_PORT
- #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT."
- #elif defined(SERIAL_PORT_2) && MMU2_SERIAL_PORT == SERIAL_PORT_2
- #error "MMU2_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
- #elif defined(LCD_SERIAL_PORT) && MMU2_SERIAL_PORT == LCD_SERIAL_PORT
- #error "MMU2_SERIAL_PORT cannot be the same as LCD_SERIAL_PORT."
- #elif defined(RS485_SERIAL_PORT) && MMU2_SERIAL_PORT == RS485_SERIAL_PORT
- #error "MMU2_SERIAL_PORT cannot be the same as RS485_SERIAL_PORT."
+#ifdef MMU_SERIAL_PORT
+ #if MMU_SERIAL_PORT == SERIAL_PORT
+ #error "MMU_SERIAL_PORT cannot be the same as SERIAL_PORT."
+ #elif defined(SERIAL_PORT_2) && MMU_SERIAL_PORT == SERIAL_PORT_2
+ #error "MMU_SERIAL_PORT cannot be the same as SERIAL_PORT_2."
+ #elif defined(LCD_SERIAL_PORT) && MMU_SERIAL_PORT == LCD_SERIAL_PORT
+ #error "MMU_SERIAL_PORT cannot be the same as LCD_SERIAL_PORT."
+ #elif defined(RS485_SERIAL_PORT) && MMU_SERIAL_PORT == RS485_SERIAL_PORT
+ #error "MMU_SERIAL_PORT cannot be the same as RS485_SERIAL_PORT."
#endif
#endif
@@ -3057,49 +3106,69 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#define INVALID_TMC_UART(ST) (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PINS_EXIST(ST##_SERIAL_RX, ST##_SERIAL_TX))))
#if INVALID_TMC_UART(X)
#error "TMC2208 or TMC2209 on X requires X_HARDWARE_SERIAL or X_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(X2)
+#endif
+#if INVALID_TMC_UART(X2)
#error "TMC2208 or TMC2209 on X2 requires X2_HARDWARE_SERIAL or X2_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(Y)
+#endif
+#if INVALID_TMC_UART(Y)
#error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(Y2)
+#endif
+#if INVALID_TMC_UART(Y2)
#error "TMC2208 or TMC2209 on Y2 requires Y2_HARDWARE_SERIAL or Y2_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(Z)
+#endif
+#if INVALID_TMC_UART(Z)
#error "TMC2208 or TMC2209 on Z requires Z_HARDWARE_SERIAL or Z_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(Z2)
+#endif
+#if INVALID_TMC_UART(Z2)
#error "TMC2208 or TMC2209 on Z2 requires Z2_HARDWARE_SERIAL or Z2_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(Z3)
+#endif
+#if INVALID_TMC_UART(Z3)
#error "TMC2208 or TMC2209 on Z3 requires Z3_HARDWARE_SERIAL or Z3_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(Z4)
+#endif
+#if INVALID_TMC_UART(Z4)
#error "TMC2208 or TMC2209 on Z4 requires Z4_HARDWARE_SERIAL or Z4_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(E0)
+#endif
+#if INVALID_TMC_UART(E0)
#error "TMC2208 or TMC2209 on E0 requires E0_HARDWARE_SERIAL or E0_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(E1)
+#endif
+#if INVALID_TMC_UART(E1)
#error "TMC2208 or TMC2209 on E1 requires E1_HARDWARE_SERIAL or E1_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(E2)
+#endif
+#if INVALID_TMC_UART(E2)
#error "TMC2208 or TMC2209 on E2 requires E2_HARDWARE_SERIAL or E2_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(E3)
+#endif
+#if INVALID_TMC_UART(E3)
#error "TMC2208 or TMC2209 on E3 requires E3_HARDWARE_SERIAL or E3_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(E4)
+#endif
+#if INVALID_TMC_UART(E4)
#error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(E5)
+#endif
+#if INVALID_TMC_UART(E5)
#error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(E6)
+#endif
+#if INVALID_TMC_UART(E6)
#error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(E7)
+#endif
+#if INVALID_TMC_UART(E7)
#error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(I)
+#endif
+#if INVALID_TMC_UART(I)
#error "TMC2208 or TMC2209 on I requires I_HARDWARE_SERIAL or I_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(J)
+#endif
+#if INVALID_TMC_UART(J)
#error "TMC2208 or TMC2209 on J requires J_HARDWARE_SERIAL or J_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(K)
+#endif
+#if INVALID_TMC_UART(K)
#error "TMC2208 or TMC2209 on K requires K_HARDWARE_SERIAL or K_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(U)
+#endif
+#if INVALID_TMC_UART(U)
#error "TMC2208 or TMC2209 on U requires U_HARDWARE_SERIAL or U_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(V)
+#endif
+#if INVALID_TMC_UART(V)
#error "TMC2208 or TMC2209 on V requires V_HARDWARE_SERIAL or V_SERIAL_(RX|TX)_PIN."
-#elif INVALID_TMC_UART(W)
+#endif
+#if INVALID_TMC_UART(W)
#error "TMC2208 or TMC2209 on W requires W_HARDWARE_SERIAL or W_SERIAL_(RX|TX)_PIN."
-
#endif
#undef INVALID_TMC_UART
@@ -4307,6 +4376,17 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
#error "SDSUPPORT, BINARY_FILE_TRANSFER, and CUSTOM_FIRMWARE_UPLOAD are required for custom upload."
#endif
+/**
+ * Direct Stepping requirements
+ */
+#if ENABLED(DIRECT_STEPPING)
+ #if ENABLED(CPU_32_BIT)
+ #error "Direct Stepping is not supported on 32-bit boards."
+ #elif !IS_FULL_CARTESIAN
+ #error "Direct Stepping is incompatible with enabled kinematics."
+ #endif
+#endif
+
/**
* Input Shaping requirements
*/
diff --git a/firmware/Marlin/src/inc/Version.h b/firmware/Marlin/src/inc/Version.h
index c060a15..e0cd061 100644
--- a/firmware/Marlin/src/inc/Version.h
+++ b/firmware/Marlin/src/inc/Version.h
@@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
- #define STRING_DISTRIBUTION_DATE "2024-09-09"
+ #define STRING_DISTRIBUTION_DATE "2024-12-06"
#endif
/**
@@ -101,8 +101,8 @@
#endif
/**
- * Set the vendor info the serial USB interface, if changable
- * Currently only supported by DUE platform
+ * Set the vendor info the serial USB interface, if changeable.
+ * Currently only supported by DUE platform.
*/
#ifndef USB_DEVICE_VENDOR_ID
#define USB_DEVICE_VENDOR_ID 0x03EB /* ATMEL VID */
diff --git a/firmware/Marlin/src/inc/Warnings.cpp b/firmware/Marlin/src/inc/Warnings.cpp
index f10408d..a6ea570 100644
--- a/firmware/Marlin/src/inc/Warnings.cpp
+++ b/firmware/Marlin/src/inc/Warnings.cpp
@@ -729,8 +729,12 @@
#endif
#endif
-#if ENABLED(QUICK_HOME) && (X_SPI_SENSORLESS || Y_SPI_SENSORLESS)
- #warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust SENSORLESS_BACKOFF_MM for better results."
+#if ENABLED(QUICK_HOME)
+ #if X_SPI_SENSORLESS || Y_SPI_SENSORLESS
+ #warning "If SPI_ENDSTOPS are unreliable with QUICK_HOME try adjusting SENSORLESS_BACKOFF_MM, Travel Acceleration (M204 T), Homing Feedrate (M210 XY), or disable QUICK_HOME."
+ #elif X_SENSORLESS || Y_SENSORLESS
+ #warning "If SENSORLESS_HOMING is unreliable with QUICK_HOME try adjusting SENSORLESS_BACKOFF_MM, Travel Acceleration (M204 T), Homing Feedrate (M210 XY), or disable QUICK_HOME."
+ #endif
#endif
#if HIGHER_CURRENT_HOME_WARNING
@@ -916,8 +920,8 @@
#endif
/**
- * HC32 clock speed is hard-coded in Marlin
+ * Peltier with PIDTEMPBED
*/
-#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."
+#if ALL(PELTIER_BED, PIDTEMPBED)
+ #warning "PELTIER_BED with PIDTEMPBED requires extra circuitry. Use with caution."
#endif
diff --git a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_el.h b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_el.h
index 6fefab9..9faacfb 100644
--- a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_el.h
+++ b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_el.h
@@ -11,19 +11,21 @@ const u8g_fntpgm_uint8_t fontpage_7_136_136[33] U8G_FONT_SECTION("fontpage_7_136
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0A,0x00,0x00,
0x00,0x05,0x0A,0x0A,0x06,0x00,0x00,0x40,0x80,0x00,0xF8,0x80,0x80,0xF0,0x80,0x80,
0xF8};
-const u8g_fntpgm_uint8_t fontpage_7_145_157[186] U8G_FONT_SECTION("fontpage_7_145_157") = {
- 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x91,0x9D,0x00,0x07,0x00,0x00,
+const u8g_fntpgm_uint8_t fontpage_7_145_149[82] U8G_FONT_SECTION("fontpage_7_145_149") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x91,0x95,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x07,
0x07,0x06,0x00,0x00,0xF0,0x88,0x88,0xF0,0x88,0x88,0xF0,0x05,0x07,0x07,0x06,0x00,
0x00,0xF8,0x80,0x80,0x80,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,
0x50,0x50,0x88,0x88,0xF8,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x80,0x80,0xF0,0x80,
- 0x80,0xF8,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x08,0x10,0x20,0x40,0x80,0xF8,0x05,
- 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,
- 0x00,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x70,0x03,0x07,0x07,0x06,0x01,0x00,0xE0,
- 0x40,0x40,0x40,0x40,0x40,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xA0,0xC0,
- 0xA0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0x50,0x50,0x88,0x88,0x88,
- 0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xD8,0xA8,0x88,0x88,0x88,0x88,0x05,0x07,0x07,
- 0x06,0x00,0x00,0x88,0x88,0xC8,0xA8,0x98,0x88,0x88};
+ 0x80,0xF8};
+const u8g_fntpgm_uint8_t fontpage_7_151_157[108] U8G_FONT_SECTION("fontpage_7_151_157") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x97,0x9D,0x00,0x07,0x00,0x00,
+ 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x07,
+ 0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x70,0x03,0x07,0x07,0x06,0x01,
+ 0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,
+ 0xA0,0xC0,0xA0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0x50,0x50,0x88,
+ 0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xD8,0xA8,0x88,0x88,0x88,0x88,0x05,
+ 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0xC8,0xA8,0x98,0x88,0x88};
const u8g_fntpgm_uint8_t fontpage_7_159_161[56] U8G_FONT_SECTION("fontpage_7_159_161") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9F,0xA1,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,
@@ -79,7 +81,8 @@ const u8g_fntpgm_uint8_t fontpage_64_166_166[24] U8G_FONT_SECTION("fontpage_64_1
static const uxg_fontinfo_t g_fontinfo_el[] PROGMEM = {
FONTDATA_ITEM(7, 136, 136, fontpage_7_136_136), // 'Έ' -- 'Έ'
- FONTDATA_ITEM(7, 145, 157, fontpage_7_145_157), // 'Α' -- 'Ν'
+ FONTDATA_ITEM(7, 145, 149, fontpage_7_145_149), // 'Α' -- 'Ε'
+ FONTDATA_ITEM(7, 151, 157, fontpage_7_151_157), // 'Η' -- 'Ν'
FONTDATA_ITEM(7, 159, 161, fontpage_7_159_161), // 'Ο' -- 'Ρ'
FONTDATA_ITEM(7, 163, 167, fontpage_7_163_167), // 'Σ' -- 'Χ'
FONTDATA_ITEM(7, 172, 175, fontpage_7_172_175), // 'ά' -- 'ί'
diff --git a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_el_CY.h b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_el_CY.h
index c3a2264..6ad34eb 100644
--- a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_el_CY.h
+++ b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_el_CY.h
@@ -11,19 +11,21 @@ const u8g_fntpgm_uint8_t fontpage_7_136_136[33] U8G_FONT_SECTION("fontpage_7_136
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x00,0x0A,0x00,0x00,
0x00,0x05,0x0A,0x0A,0x06,0x00,0x00,0x40,0x80,0x00,0xF8,0x80,0x80,0xF0,0x80,0x80,
0xF8};
-const u8g_fntpgm_uint8_t fontpage_7_145_157[186] U8G_FONT_SECTION("fontpage_7_145_157") = {
- 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x91,0x9D,0x00,0x07,0x00,0x00,
+const u8g_fntpgm_uint8_t fontpage_7_145_149[82] U8G_FONT_SECTION("fontpage_7_145_149") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x91,0x95,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x07,
0x07,0x06,0x00,0x00,0xF0,0x88,0x88,0xF0,0x88,0x88,0xF0,0x05,0x07,0x07,0x06,0x00,
0x00,0xF8,0x80,0x80,0x80,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,
0x50,0x50,0x88,0x88,0xF8,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x80,0x80,0xF0,0x80,
- 0x80,0xF8,0x05,0x07,0x07,0x06,0x00,0x00,0xF8,0x08,0x10,0x20,0x40,0x80,0xF8,0x05,
- 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,
- 0x00,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x70,0x03,0x07,0x07,0x06,0x01,0x00,0xE0,
- 0x40,0x40,0x40,0x40,0x40,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,0xA0,0xC0,
- 0xA0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0x50,0x50,0x88,0x88,0x88,
- 0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xD8,0xA8,0x88,0x88,0x88,0x88,0x05,0x07,0x07,
- 0x06,0x00,0x00,0x88,0x88,0xC8,0xA8,0x98,0x88,0x88};
+ 0x80,0xF8};
+const u8g_fntpgm_uint8_t fontpage_7_151_157[108] U8G_FONT_SECTION("fontpage_7_151_157") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x97,0x9D,0x00,0x07,0x00,0x00,
+ 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xF8,0x88,0x88,0x88,0x05,0x07,
+ 0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xF8,0x88,0x88,0x70,0x03,0x07,0x07,0x06,0x01,
+ 0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0xE0,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90,
+ 0xA0,0xC0,0xA0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0x50,0x50,0x88,
+ 0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xD8,0xA8,0x88,0x88,0x88,0x88,0x05,
+ 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0xC8,0xA8,0x98,0x88,0x88};
const u8g_fntpgm_uint8_t fontpage_7_159_161[56] U8G_FONT_SECTION("fontpage_7_159_161") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9F,0xA1,0x00,0x07,0x00,0x00,
0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,
@@ -79,7 +81,8 @@ const u8g_fntpgm_uint8_t fontpage_64_166_166[24] U8G_FONT_SECTION("fontpage_64_1
static const uxg_fontinfo_t g_fontinfo_el_CY[] PROGMEM = {
FONTDATA_ITEM(7, 136, 136, fontpage_7_136_136), // 'Έ' -- 'Έ'
- FONTDATA_ITEM(7, 145, 157, fontpage_7_145_157), // 'Α' -- 'Ν'
+ FONTDATA_ITEM(7, 145, 149, fontpage_7_145_149), // 'Α' -- 'Ε'
+ FONTDATA_ITEM(7, 151, 157, fontpage_7_151_157), // 'Η' -- 'Ν'
FONTDATA_ITEM(7, 159, 161, fontpage_7_159_161), // 'Ο' -- 'Ρ'
FONTDATA_ITEM(7, 163, 167, fontpage_7_163_167), // 'Σ' -- 'Χ'
FONTDATA_ITEM(7, 172, 175, fontpage_7_172_175), // 'ά' -- 'ί'
diff --git a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h
index 31cc0bc..78aa07b 100644
--- a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h
+++ b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h
@@ -7,6 +7,10 @@
#include "langdata.h"
+const u8g_fntpgm_uint8_t fontpage_344_146_146[45] U8G_FONT_SECTION("fontpage_344_146_146") = {
+ 0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0x92,0x92,0x00,0x09,0xFE,0x00,
+ 0x00,0x09,0x0B,0x16,0x0A,0x01,0xFE,0xF9,0x00,0x09,0x00,0x11,0x80,0x11,0x00,0x61,
+ 0x00,0x80,0x00,0x4A,0x00,0x4A,0x00,0x72,0x00,0x4D,0x00,0x74,0x80};
const u8g_fntpgm_uint8_t fontpage_344_240_240[34] U8G_FONT_SECTION("fontpage_344_240_240") = {
0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0x00,0x09,0xFE,0x00,
0x00,0x08,0x0B,0x0B,0x0A,0x01,0xFE,0xF9,0x09,0x09,0x11,0x17,0x21,0x41,0x81,0x01,
@@ -191,6 +195,10 @@ const u8g_fntpgm_uint8_t fontpage_377_248_248[45] U8G_FONT_SECTION("fontpage_377
0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0x00,0x09,0xFE,0x00,
0x00,0x0A,0x0B,0x16,0x0A,0x00,0xFE,0x20,0x80,0x20,0x80,0x3F,0x00,0x20,0x80,0x3F,
0x00,0x04,0x00,0xFF,0xC0,0x00,0x00,0x20,0x00,0x20,0x00,0x3F,0x80};
+const u8g_fntpgm_uint8_t fontpage_380_140_140[41] U8G_FONT_SECTION("fontpage_380_140_140") = {
+ 0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0x8C,0x8C,0x00,0x09,0x00,0x00,
+ 0x00,0x0A,0x09,0x12,0x0A,0x00,0x00,0x20,0x80,0x20,0x80,0x3F,0x80,0x20,0x80,0x20,
+ 0x80,0x3F,0x80,0x00,0x00,0x00,0x00,0xFF,0xC0};
const u8g_fntpgm_uint8_t fontpage_380_196_196[34] U8G_FONT_SECTION("fontpage_380_196_196") = {
0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0xC4,0xC4,0x00,0x09,0xFE,0x00,
0x00,0x08,0x0B,0x0B,0x0A,0x01,0xFE,0x89,0x89,0x89,0xF9,0x89,0x89,0x89,0xF9,0x01,
@@ -329,6 +337,10 @@ const u8g_fntpgm_uint8_t fontpage_400_156_156[45] U8G_FONT_SECTION("fontpage_400
0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0x9C,0x9C,0x00,0x09,0xFE,0x00,
0x00,0x09,0x0B,0x16,0x0A,0x00,0xFE,0x7A,0x80,0x0A,0x80,0x0A,0x80,0x16,0x80,0x12,
0x80,0x2A,0x80,0x4A,0x80,0x86,0x80,0x02,0x80,0x02,0x80,0x02,0x80};
+const u8g_fntpgm_uint8_t fontpage_400_240_240[41] U8G_FONT_SECTION("fontpage_400_240_240") = {
+ 0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0x00,0x09,0x00,0x00,
+ 0x00,0x0A,0x09,0x12,0x0A,0x00,0x00,0x3F,0x00,0x01,0x00,0x02,0x00,0x0C,0x00,0x33,
+ 0x00,0x64,0x80,0x04,0x00,0x04,0x00,0xFF,0xC0};
const u8g_fntpgm_uint8_t fontpage_401_253_253[45] U8G_FONT_SECTION("fontpage_401_253_253") = {
0x00,0x0B,0x0D,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0xFD,0xFD,0x00,0x09,0xFE,0x00,
0x00,0x0A,0x0B,0x16,0x0A,0x00,0xFE,0x3F,0x00,0x01,0x00,0x0E,0x00,0x71,0x80,0x00,
@@ -439,6 +451,7 @@ const u8g_fntpgm_uint8_t fontpage_431_136_136[34] U8G_FONT_SECTION("fontpage_431
0x01,0x01};
static const uxg_fontinfo_t g_fontinfo_ko_KR[] PROGMEM = {
+ FONTDATA_ITEM(344, 146, 146, fontpage_344_146_146), // '값' -- '값'
FONTDATA_ITEM(344, 240, 240, fontpage_344_240_240), // '거' -- '거'
FONTDATA_ITEM(345, 224, 224, fontpage_345_224_224), // '고' -- '고'
FONTDATA_ITEM(347, 248, 248, fontpage_347_248_248), // '그' -- '그'
@@ -485,6 +498,7 @@ static const uxg_fontinfo_t g_fontinfo_ko_KR[] PROGMEM = {
FONTDATA_ITEM(377, 160, 160, fontpage_377_160_160), // '베' -- '베'
FONTDATA_ITEM(377, 168, 168, fontpage_377_168_168), // '벨' -- '벨'
FONTDATA_ITEM(377, 248, 248, fontpage_377_248_248), // '본' -- '본'
+ FONTDATA_ITEM(380, 140, 140, fontpage_380_140_140), // '브' -- '브'
FONTDATA_ITEM(380, 196, 196, fontpage_380_196_196), // '비' -- '비'
FONTDATA_ITEM(385, 172, 172, fontpage_385_172_172), // '사' -- '사'
FONTDATA_ITEM(385, 189, 189, fontpage_385_189_189), // '삽' -- '삽'
@@ -518,6 +532,7 @@ static const uxg_fontinfo_t g_fontinfo_ko_KR[] PROGMEM = {
FONTDATA_ITEM(400, 132, 132, fontpage_400_132_132), // '전' -- '전'
FONTDATA_ITEM(400, 149, 149, fontpage_400_149_149), // '정' -- '정'
FONTDATA_ITEM(400, 156, 156, fontpage_400_156_156), // '제' -- '제'
+ FONTDATA_ITEM(400, 240, 240, fontpage_400_240_240), // '조' -- '조'
FONTDATA_ITEM(401, 253, 253, fontpage_401_253_253), // '죽' -- '죽'
FONTDATA_ITEM(402, 128, 128, fontpage_402_128_128), // '준' -- '준'
FONTDATA_ITEM(402, 145, 145, fontpage_402_145_145), // '중' -- '중'
diff --git a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h
index 60316a1..ab2ccd0 100644
--- a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h
+++ b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h
@@ -493,10 +493,12 @@ const u8g_fntpgm_uint8_t fontpage_183_171_171[45] U8G_FONT_SECTION("fontpage_183
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xAB,0xAB,0x00,0x0A,0xFF,0x00,
0x00,0x0A,0x0B,0x16,0x0C,0x01,0xFF,0x08,0x00,0xFF,0xC0,0x80,0x40,0x3F,0x00,0x21,
0x00,0x3F,0x00,0x00,0x00,0x7F,0x80,0x40,0x80,0x7F,0x80,0x40,0x80};
-const u8g_fntpgm_uint8_t fontpage_183_249_249[45] U8G_FONT_SECTION("fontpage_183_249_249") = {
- 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF9,0xF9,0x00,0x0A,0xFF,0x00,
- 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x00,0x80,0xF0,0x80,0x1F,0xE0,0x90,0x80,0x50,
- 0x80,0x24,0x80,0x22,0x80,0x50,0x80,0x50,0x80,0x82,0x80,0x01,0x00};
+const u8g_fntpgm_uint8_t fontpage_183_248_249[73] U8G_FONT_SECTION("fontpage_183_248_249") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF8,0xF9,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0A,0x0B,0x16,0x0C,0x01,0xFF,0x02,0x00,0x02,0x00,0x02,0x00,0xFF,0xC0,0x02,
+ 0x00,0x22,0x00,0x12,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x0E,0x00,0x0B,0x0B,0x16,
+ 0x0C,0x00,0xFF,0x00,0x80,0xF0,0x80,0x1F,0xE0,0x90,0x80,0x50,0x80,0x24,0x80,0x22,
+ 0x80,0x50,0x80,0x50,0x80,0x82,0x80,0x01,0x00};
const u8g_fntpgm_uint8_t fontpage_184_134_134[45] U8G_FONT_SECTION("fontpage_184_134_134") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x22,0x00,0x27,0xC0,0xA4,0x80,0x6B,0x00,0x22,
@@ -509,6 +511,10 @@ const u8g_fntpgm_uint8_t fontpage_184_177_177[45] U8G_FONT_SECTION("fontpage_184
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xB1,0xB1,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x11,0x00,0xFD,0x40,0x01,0x20,0x7F,0xE0,0x4A,
0x80,0x7A,0x80,0x12,0x80,0x5A,0xA0,0x56,0xA0,0x92,0xA0,0x34,0x60};
+const u8g_fntpgm_uint8_t fontpage_184_186_186[45] U8G_FONT_SECTION("fontpage_184_186_186") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBA,0xBA,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x3F,0xC0,0x20,0x40,0x20,0x40,0x20,0x40,0x3F,
+ 0xC0,0x24,0x00,0x24,0x00,0x22,0x00,0x21,0x00,0x40,0x80,0x80,0x60};
const u8g_fntpgm_uint8_t fontpage_184_207_207[45] U8G_FONT_SECTION("fontpage_184_207_207") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xCF,0xCF,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x3F,0xE0,0x20,0x20,0x3F,0xE0,0x28,0x40,0x24,
@@ -553,10 +559,6 @@ const u8g_fntpgm_uint8_t fontpage_190_128_128[45] U8G_FONT_SECTION("fontpage_190
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x7F,0xC0,0x11,0x00,0x11,0x00,0x11,0x00,0x11,
0x00,0xFF,0xE0,0x11,0x00,0x21,0x00,0x21,0x00,0x41,0x00,0x81,0x00};
-const u8g_fntpgm_uint8_t fontpage_190_131_131[45] U8G_FONT_SECTION("fontpage_190_131_131") = {
- 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x0A,0xFF,0x00,
- 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x04,0x00,0xFF,0xE0,0x08,0x00,0x10,0x80,0x3F,
- 0xC0,0x11,0x00,0xFF,0xE0,0x11,0x00,0x11,0x00,0x21,0x00,0x41,0x00};
const u8g_fntpgm_uint8_t fontpage_190_143_143[45] U8G_FONT_SECTION("fontpage_190_143_143") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x8F,0x8F,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x02,0x80,0x02,0x40,0x02,0x00,0xFF,0xE0,0x02,
@@ -797,6 +799,10 @@ const u8g_fntpgm_uint8_t fontpage_206_159_159[45] U8G_FONT_SECTION("fontpage_206
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9F,0x9F,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x49,0xE0,0xFD,0x20,0x49,0x20,0x79,0xE0,0x49,
0x20,0x79,0x20,0x49,0xE0,0xFD,0x20,0x01,0x20,0x49,0x20,0x86,0x60};
+const u8g_fntpgm_uint8_t fontpage_206_172_172[45] U8G_FONT_SECTION("fontpage_206_172_172") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xAC,0xAC,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x04,0x00,0x04,0x00,0xFF,0xE0,0x0E,0x00,0x15,
+ 0x00,0x15,0x00,0x24,0x80,0x44,0x40,0x9F,0x20,0x04,0x00,0x04,0x00};
const u8g_fntpgm_uint8_t fontpage_206_186_186[45] U8G_FONT_SECTION("fontpage_206_186_186") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBA,0xBA,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x20,0x00,0x27,0x80,0x24,0x80,0xFC,0x80,0x24,
@@ -947,6 +953,10 @@ const u8g_fntpgm_uint8_t fontpage_224_239_239[45] U8G_FONT_SECTION("fontpage_224
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xEF,0xEF,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x10,0x00,0x17,0xE0,0x54,0x80,0x58,0x80,0x50,
0x80,0x90,0x80,0x10,0x80,0x10,0x80,0x28,0x80,0x44,0x80,0x81,0x80};
+const u8g_fntpgm_uint8_t fontpage_224_245_245[45] U8G_FONT_SECTION("fontpage_224_245_245") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF5,0xF5,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x3F,0x80,0x00,0x80,0x3F,0x80,0x00,0x80,0x3F,
+ 0x80,0x04,0x00,0x14,0x40,0x24,0x80,0x0A,0x00,0x11,0x00,0xE0,0xE0};
const u8g_fntpgm_uint8_t fontpage_225_185_185[45] U8G_FONT_SECTION("fontpage_225_185_185") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xB9,0xB9,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x04,0x00,0x04,0x00,0x07,0xC0,0x04,0x00,0x3F,
@@ -955,10 +965,12 @@ const u8g_fntpgm_uint8_t fontpage_225_237_237[45] U8G_FONT_SECTION("fontpage_225
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xED,0xED,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x22,0x00,0xF7,0x80,0x22,0x80,0x32,0x80,0x66,
0x80,0xA3,0x80,0x24,0xA0,0x68,0x60,0x00,0x00,0x52,0x40,0x89,0x20};
-const u8g_fntpgm_uint8_t fontpage_228_199_199[45] U8G_FONT_SECTION("fontpage_228_199_199") = {
- 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xC7,0xC7,0x00,0x0A,0xFF,0x00,
+const u8g_fntpgm_uint8_t fontpage_228_199_200[73] U8G_FONT_SECTION("fontpage_228_199_200") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xC7,0xC8,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x21,0x00,0x21,0x00,0x21,0x00,0x3F,0xE0,0x20,
- 0x00,0x20,0x00,0x3F,0x80,0x20,0x80,0x20,0x80,0x40,0x80,0x80,0x80};
+ 0x00,0x20,0x00,0x3F,0x80,0x20,0x80,0x20,0x80,0x40,0x80,0x80,0x80,0x0B,0x0B,0x16,
+ 0x0C,0x00,0xFF,0x10,0xC0,0x57,0x00,0x54,0x00,0x7F,0xE0,0x46,0x40,0x45,0x40,0x75,
+ 0x40,0x54,0x80,0x54,0x80,0x95,0x40,0x9A,0x20};
const u8g_fntpgm_uint8_t fontpage_228_233_233[45] U8G_FONT_SECTION("fontpage_228_233_233") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xE9,0xE9,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x22,0x00,0xA2,0x00,0xA7,0xE0,0xFA,0xA0,0xA2,
@@ -983,6 +995,10 @@ const u8g_fntpgm_uint8_t fontpage_234_181_181[45] U8G_FONT_SECTION("fontpage_234
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xB5,0xB5,0x00,0x0A,0xFF,0x00,
0x00,0x0A,0x0B,0x16,0x0C,0x01,0xFF,0x08,0x00,0x08,0x00,0xFF,0x80,0x88,0x80,0xFF,
0x80,0x88,0x80,0x88,0x80,0xFF,0x80,0x08,0x40,0x08,0x40,0x07,0xC0};
+const u8g_fntpgm_uint8_t fontpage_234_204_204[45] U8G_FONT_SECTION("fontpage_234_204_204") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x7F,0xC0,0x44,0x40,0x7F,0xC0,0x44,0x40,0x7F,
+ 0xC0,0x0A,0x00,0x31,0x80,0xD1,0x60,0x11,0x00,0x21,0x00,0x41,0x00};
const u8g_fntpgm_uint8_t fontpage_234_229_229[45] U8G_FONT_SECTION("fontpage_234_229_229") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xE5,0xE5,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x02,0x00,0xFB,0xC0,0xAE,0x40,0xA9,0x80,0xFA,
@@ -1047,6 +1063,10 @@ const u8g_fntpgm_uint8_t fontpage_248_251_251[45] U8G_FONT_SECTION("fontpage_248
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xFB,0xFB,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x24,0x80,0x15,0x00,0xFF,0xE0,0x15,0x00,0x24,
0x80,0x40,0x40,0x04,0x00,0xFF,0xE0,0x0A,0x00,0x11,0x00,0xE0,0xE0};
+const u8g_fntpgm_uint8_t fontpage_249_190_190[45] U8G_FONT_SECTION("fontpage_249_190_190") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBE,0xBE,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x21,0x00,0xAF,0xE0,0x71,0x00,0x27,0xC0,0xF1,
+ 0x00,0x2F,0xE0,0x74,0x40,0x6F,0xC0,0xA4,0x40,0x27,0xC0,0x24,0x40};
const u8g_fntpgm_uint8_t fontpage_250_162_162[45] U8G_FONT_SECTION("fontpage_250_162_162") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xA2,0xA2,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x04,0x00,0x7F,0xC0,0x04,0x00,0xFF,0xE0,0x91,
@@ -1223,6 +1243,10 @@ const u8g_fntpgm_uint8_t fontpage_283_133_133[45] U8G_FONT_SECTION("fontpage_283
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x85,0x85,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x17,0xC0,0x11,0x40,0x7D,0x40,0x12,0xC0,0xFC,
0x00,0x13,0xC0,0x5E,0x40,0x52,0x40,0x73,0xC0,0x98,0x00,0x87,0xE0};
+const u8g_fntpgm_uint8_t fontpage_283_138_138[45] U8G_FONT_SECTION("fontpage_283_138_138") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x8A,0x8A,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x10,0xC0,0x10,0xA0,0x7F,0xE0,0x12,0x80,0xFE,
+ 0xA0,0x12,0xA0,0x5E,0x40,0x52,0xA0,0x71,0x20,0x9A,0x00,0x87,0xE0};
const u8g_fntpgm_uint8_t fontpage_283_221_221[45] U8G_FONT_SECTION("fontpage_283_221_221") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xDD,0xDD,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x7B,0xE0,0x4A,0x00,0x4A,0x00,0x7B,0xE0,0x12,
@@ -1293,6 +1317,10 @@ const u8g_fntpgm_uint8_t fontpage_288_137_137[45] U8G_FONT_SECTION("fontpage_288
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x45,0x00,0x25,0x00,0x27,0xC0,0x09,0x00,0xEF,
0xE0,0x22,0x80,0x22,0xA0,0x24,0xA0,0x28,0x60,0x50,0x00,0x8F,0xE0};
+const u8g_fntpgm_uint8_t fontpage_288_144_144[45] U8G_FONT_SECTION("fontpage_288_144_144") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x4F,0xE0,0x21,0x00,0x22,0x00,0x0D,0x20,0xE2,
+ 0xC0,0x2D,0x80,0x22,0xC0,0x2C,0xA0,0x23,0x00,0x50,0x00,0x8F,0xE0};
const u8g_fntpgm_uint8_t fontpage_288_159_159[45] U8G_FONT_SECTION("fontpage_288_159_159") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9F,0x9F,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x41,0x00,0x3F,0xE0,0x21,0x00,0x0F,0xE0,0xE9,
@@ -1421,6 +1449,10 @@ const u8g_fntpgm_uint8_t fontpage_306_241_241[45] U8G_FONT_SECTION("fontpage_306
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF1,0xF1,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x44,0x00,0x47,0xC0,0x7C,0x40,0x97,0x40,0xAD,
0x40,0x25,0x40,0x27,0x40,0x24,0xC0,0x2C,0x20,0x34,0x20,0x23,0xE0};
+const u8g_fntpgm_uint8_t fontpage_307_150_150[45] U8G_FONT_SECTION("fontpage_307_150_150") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x96,0x96,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x20,0x80,0x11,0x00,0xFF,0xE0,0x08,0x00,0x3F,
+ 0x80,0x20,0x80,0x3F,0x80,0x20,0x80,0x3F,0x80,0x20,0x80,0x3F,0x80};
const u8g_fntpgm_uint8_t fontpage_308_236_236[45] U8G_FONT_SECTION("fontpage_308_236_236") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xEC,0xEC,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x7F,0x80,0x00,0x80,0x10,0x80,0x11,0x00,0x21,
@@ -1429,6 +1461,10 @@ const u8g_fntpgm_uint8_t fontpage_308_241_241[45] U8G_FONT_SECTION("fontpage_308
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF1,0xF1,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0xF3,0xE0,0x12,0x00,0x52,0x20,0x53,0x20,0x52,
0xA0,0x7A,0x40,0x0A,0x40,0xEA,0xA0,0x0B,0x20,0x0A,0x00,0x33,0xE0};
+const u8g_fntpgm_uint8_t fontpage_309_140_140[45] U8G_FONT_SECTION("fontpage_309_140_140") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x8C,0x8C,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0xF1,0x00,0x11,0x00,0x52,0x80,0x5C,0x60,0x53,
+ 0x80,0x78,0x00,0x0A,0x40,0x3D,0x40,0xCA,0x80,0x09,0x00,0x37,0xE0};
const u8g_fntpgm_uint8_t fontpage_309_216_216[45] U8G_FONT_SECTION("fontpage_309_216_216") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xD8,0xD8,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x04,0x00,0xFF,0xE0,0x00,0x00,0x1F,0x00,0x11,
@@ -1565,10 +1601,11 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(183, 154, 154, fontpage_183_154_154), // '定' -- '定'
FONTDATA_ITEM(183, 162, 162, fontpage_183_162_162), // '客' -- '客'
FONTDATA_ITEM(183, 171, 171, fontpage_183_171_171), // '宫' -- '宫'
- FONTDATA_ITEM(183, 249, 249, fontpage_183_249_249), // '对' -- '对'
+ FONTDATA_ITEM(183, 248, 249, fontpage_183_248_249), // '寸' -- '对'
FONTDATA_ITEM(184, 134, 134, fontpage_184_134_134), // '将' -- '将'
FONTDATA_ITEM(184, 143, 143, fontpage_184_143_143), // '小' -- '小'
FONTDATA_ITEM(184, 177, 177, fontpage_184_177_177), // '就' -- '就'
+ FONTDATA_ITEM(184, 186, 186, fontpage_184_186_186), // '尺' -- '尺'
FONTDATA_ITEM(184, 207, 207, fontpage_184_207_207), // '屏' -- '屏'
FONTDATA_ITEM(187, 229, 229, fontpage_187_229_229), // '工' -- '工'
FONTDATA_ITEM(187, 238, 238, fontpage_187_238_238), // '差' -- '差'
@@ -1580,7 +1617,6 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(189, 159, 159, fontpage_189_159_159), // '废' -- '废'
FONTDATA_ITEM(189, 166, 166, fontpage_189_166_166), // '度' -- '度'
FONTDATA_ITEM(190, 128, 128, fontpage_190_128_128), // '开' -- '开'
- FONTDATA_ITEM(190, 131, 131, fontpage_190_131_131), // '弃' -- '弃'
FONTDATA_ITEM(190, 143, 143, fontpage_190_143_143), // '式' -- '式'
FONTDATA_ITEM(190, 149, 149, fontpage_190_149_149), // '引' -- '引'
FONTDATA_ITEM(190, 185, 185, fontpage_190_185_185), // '弹' -- '弹'
@@ -1640,6 +1676,7 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(206, 128, 128, fontpage_206_128_128), // '最' -- '最'
FONTDATA_ITEM(206, 137, 137, fontpage_206_137_137), // '有' -- '有'
FONTDATA_ITEM(206, 159, 159, fontpage_206_159_159), // '期' -- '期'
+ FONTDATA_ITEM(206, 172, 172, fontpage_206_172_172), // '本' -- '本'
FONTDATA_ITEM(206, 186, 186, fontpage_206_186_186), // '机' -- '机'
FONTDATA_ITEM(206, 192, 192, fontpage_206_192_192), // '杀' -- '杀'
FONTDATA_ITEM(206, 223, 223, fontpage_206_223_223), // '束' -- '束'
@@ -1677,15 +1714,17 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(222, 143, 143, fontpage_222_143_143), // '漏' -- '漏'
FONTDATA_ITEM(223, 192, 192, fontpage_223_192_192), // '激' -- '激'
FONTDATA_ITEM(224, 239, 239, fontpage_224_239_239), // '灯' -- '灯'
+ FONTDATA_ITEM(224, 245, 245, fontpage_224_245_245), // '灵' -- '灵'
FONTDATA_ITEM(225, 185, 185, fontpage_225_185_185), // '点' -- '点'
FONTDATA_ITEM(225, 237, 237, fontpage_225_237_237), // '热' -- '热'
- FONTDATA_ITEM(228, 199, 199, fontpage_228_199_199), // '片' -- '片'
+ FONTDATA_ITEM(228, 199, 200, fontpage_228_199_200), // '片' -- '版'
FONTDATA_ITEM(228, 233, 233, fontpage_228_233_233), // '物' -- '物'
FONTDATA_ITEM(228, 249, 249, fontpage_228_249_249), // '特' -- '特'
FONTDATA_ITEM(231, 135, 135, fontpage_231_135_135), // '率' -- '率'
FONTDATA_ITEM(231, 175, 175, fontpage_231_175_175), // '环' -- '环'
FONTDATA_ITEM(234, 168, 168, fontpage_234_168_168), // '用' -- '用'
FONTDATA_ITEM(234, 181, 181, fontpage_234_181_181), // '电' -- '电'
+ FONTDATA_ITEM(234, 204, 204, fontpage_234_204_204), // '界' -- '界'
FONTDATA_ITEM(234, 229, 229, fontpage_234_229_229), // '略' -- '略'
FONTDATA_ITEM(236, 253, 253, fontpage_236_253_253), // '白' -- '白'
FONTDATA_ITEM(237, 132, 132, fontpage_237_132_132), // '的' -- '的'
@@ -1702,6 +1741,7 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(246, 201, 201, fontpage_246_201_201), // '等' -- '等'
FONTDATA_ITEM(247, 177, 177, fontpage_247_177_177), // '箱' -- '箱'
FONTDATA_ITEM(248, 251, 251, fontpage_248_251_251), // '类' -- '类'
+ FONTDATA_ITEM(249, 190, 190, fontpage_249_190_190), // '精' -- '精'
FONTDATA_ITEM(250, 162, 162, fontpage_250_162_162), // '索' -- '索'
FONTDATA_ITEM(250, 171, 171, fontpage_250_171_171), // '紫' -- '紫'
FONTDATA_ITEM(253, 162, 162, fontpage_253_162_162), // '红' -- '红'
@@ -1746,6 +1786,7 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(282, 170, 170, fontpage_282_170_170), // '贪' -- '贪'
FONTDATA_ITEM(282, 247, 247, fontpage_282_247_247), // '起' -- '起'
FONTDATA_ITEM(283, 133, 133, fontpage_283_133_133), // '超' -- '超'
+ FONTDATA_ITEM(283, 138, 138, fontpage_283_138_138), // '越' -- '越'
FONTDATA_ITEM(283, 221, 221, fontpage_283_221_221), // '距' -- '距'
FONTDATA_ITEM(286, 236, 236, fontpage_286_236_236), // '转' -- '转'
FONTDATA_ITEM(286, 239, 239, fontpage_286_239_239), // '软' -- '软'
@@ -1763,6 +1804,7 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(287, 247, 247, fontpage_287_247_247), // '迷' -- '迷'
FONTDATA_ITEM(288, 128, 128, fontpage_288_128_128), // '退' -- '退'
FONTDATA_ITEM(288, 137, 137, fontpage_288_137_137), // '选' -- '选'
+ FONTDATA_ITEM(288, 144, 144, fontpage_288_144_144), // '逐' -- '逐'
FONTDATA_ITEM(288, 159, 159, fontpage_288_159_159), // '速' -- '速'
FONTDATA_ITEM(289, 232, 232, fontpage_289_232_232), // '部' -- '部'
FONTDATA_ITEM(290, 205, 205, fontpage_290_205_205), // '配' -- '配'
@@ -1795,8 +1837,10 @@ static const uxg_fontinfo_t g_fontinfo_zh_CN[] PROGMEM = {
FONTDATA_ITEM(305, 157, 157, fontpage_305_157_157), // '额' -- '额'
FONTDATA_ITEM(305, 206, 206, fontpage_305_206_206), // '风' -- '风'
FONTDATA_ITEM(306, 241, 241, fontpage_306_241_241), // '饱' -- '饱'
+ FONTDATA_ITEM(307, 150, 150, fontpage_307_150_150), // '首' -- '首'
FONTDATA_ITEM(308, 236, 236, fontpage_308_236_236), // '马' -- '马'
FONTDATA_ITEM(308, 241, 241, fontpage_308_241_241), // '驱' -- '驱'
+ FONTDATA_ITEM(309, 140, 140, fontpage_309_140_140), // '验' -- '验'
FONTDATA_ITEM(309, 216, 216, fontpage_309_216_216), // '高' -- '高'
FONTDATA_ITEM(317, 196, 196, fontpage_317_196_196), // '黄' -- '黄'
FONTDATA_ITEM(317, 222, 222, fontpage_317_222_222), // '點' -- '點'
diff --git a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h
index c132a0d..65ef7bf 100644
--- a/firmware/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h
+++ b/firmware/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h
@@ -387,6 +387,10 @@ const u8g_fntpgm_uint8_t fontpage_183_185_185[45] U8G_FONT_SECTION("fontpage_183
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xB9,0xB9,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x04,0x00,0xFF,0xE0,0x91,0x20,0x24,0x80,0x4A,
0x40,0x11,0x00,0x20,0x80,0xDF,0x60,0x11,0x00,0x11,0x00,0x1F,0x00};
+const u8g_fntpgm_uint8_t fontpage_183_248_248[45] U8G_FONT_SECTION("fontpage_183_248_248") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0A,0x0B,0x16,0x0C,0x01,0xFF,0x02,0x00,0x02,0x00,0x02,0x00,0xFF,0xC0,0x02,
+ 0x00,0x22,0x00,0x12,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x0E,0x00};
const u8g_fntpgm_uint8_t fontpage_184_141_141[45] U8G_FONT_SECTION("fontpage_184_141_141") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x8D,0x8D,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x28,0x40,0xAA,0x40,0x6C,0x40,0xFF,0xE0,0x28,
@@ -399,6 +403,10 @@ const u8g_fntpgm_uint8_t fontpage_184_177_177[45] U8G_FONT_SECTION("fontpage_184
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xB1,0xB1,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x11,0x00,0xFD,0x40,0x01,0x20,0x7F,0xE0,0x4A,
0x80,0x7A,0x80,0x12,0x80,0x5A,0xA0,0x56,0xA0,0x92,0xA0,0x34,0x60};
+const u8g_fntpgm_uint8_t fontpage_184_186_186[45] U8G_FONT_SECTION("fontpage_184_186_186") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xBA,0xBA,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x3F,0xC0,0x20,0x40,0x20,0x40,0x20,0x40,0x3F,
+ 0xC0,0x24,0x00,0x24,0x00,0x22,0x00,0x21,0x00,0x40,0x80,0x80,0x60};
const u8g_fntpgm_uint8_t fontpage_187_229_229[41] U8G_FONT_SECTION("fontpage_187_229_229") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xE5,0xE5,0x00,0x09,0x00,0x00,
0x00,0x0B,0x09,0x12,0x0C,0x00,0x00,0x7F,0xC0,0x04,0x00,0x04,0x00,0x04,0x00,0x04,
@@ -641,6 +649,10 @@ const u8g_fntpgm_uint8_t fontpage_206_137_137[45] U8G_FONT_SECTION("fontpage_206
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x89,0x89,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x08,0x00,0xFF,0xE0,0x10,0x00,0x1F,0x80,0x30,
0x80,0x5F,0x80,0x90,0x80,0x1F,0x80,0x10,0x80,0x10,0x80,0x11,0x80};
+const u8g_fntpgm_uint8_t fontpage_206_172_172[45] U8G_FONT_SECTION("fontpage_206_172_172") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xAC,0xAC,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x04,0x00,0x04,0x00,0xFF,0xE0,0x0E,0x00,0x15,
+ 0x00,0x15,0x00,0x24,0x80,0x44,0x40,0x9F,0x20,0x04,0x00,0x04,0x00};
const u8g_fntpgm_uint8_t fontpage_206_255_255[45] U8G_FONT_SECTION("fontpage_206_255_255") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x20,0xC0,0x27,0x00,0xFC,0x00,0x24,0x00,0x27,
@@ -751,10 +763,12 @@ const u8g_fntpgm_uint8_t fontpage_227_200_200[45] U8G_FONT_SECTION("fontpage_227
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xC8,0xC8,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x2F,0xA0,0x2B,0x40,0xAC,0x80,0xB7,0xC0,0xA8,
0x20,0x37,0xC0,0x24,0x40,0x27,0xC0,0x52,0x80,0x49,0x00,0x8F,0xE0};
-const u8g_fntpgm_uint8_t fontpage_228_199_199[45] U8G_FONT_SECTION("fontpage_228_199_199") = {
- 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xC7,0xC7,0x00,0x0A,0xFF,0x00,
+const u8g_fntpgm_uint8_t fontpage_228_199_200[73] U8G_FONT_SECTION("fontpage_228_199_200") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xC7,0xC8,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x21,0x00,0x21,0x00,0x21,0x00,0x3F,0xE0,0x20,
- 0x00,0x20,0x00,0x3F,0x80,0x20,0x80,0x20,0x80,0x40,0x80,0x80,0x80};
+ 0x00,0x20,0x00,0x3F,0x80,0x20,0x80,0x20,0x80,0x40,0x80,0x80,0x80,0x0B,0x0B,0x16,
+ 0x0C,0x00,0xFF,0x10,0xC0,0x57,0x00,0x54,0x00,0x7F,0xE0,0x46,0x40,0x45,0x40,0x75,
+ 0x40,0x54,0x80,0x54,0x80,0x95,0x40,0x9A,0x20};
const u8g_fntpgm_uint8_t fontpage_228_233_233[45] U8G_FONT_SECTION("fontpage_228_233_233") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0xE9,0xE9,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x22,0x00,0xA2,0x00,0xA7,0xE0,0xFA,0xA0,0xA2,
@@ -1037,6 +1051,10 @@ const u8g_fntpgm_uint8_t fontpage_288_128_128[45] U8G_FONT_SECTION("fontpage_288
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x8F,0xC0,0x48,0x40,0x4F,0xC0,0x08,0x40,0xCF,
0xC0,0x48,0x00,0x4B,0x40,0x48,0x80,0x4E,0x40,0xB0,0x00,0x8F,0xE0};
+const u8g_fntpgm_uint8_t fontpage_288_144_144[45] U8G_FONT_SECTION("fontpage_288_144_144") = {
+ 0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0x00,0x0A,0xFF,0x00,
+ 0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x4F,0xE0,0x21,0x00,0x22,0x00,0x0D,0x20,0xE2,
+ 0xC0,0x2D,0x80,0x22,0xC0,0x2C,0xA0,0x23,0x00,0x50,0x00,0x8F,0xE0};
const u8g_fntpgm_uint8_t fontpage_288_159_159[45] U8G_FONT_SECTION("fontpage_288_159_159") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x9F,0x9F,0x00,0x0A,0xFF,0x00,
0x00,0x0B,0x0B,0x16,0x0C,0x00,0xFF,0x41,0x00,0x3F,0xE0,0x21,0x00,0x0F,0xE0,0xE9,
@@ -1311,9 +1329,11 @@ static const uxg_fontinfo_t g_fontinfo_zh_TW[] PROGMEM = {
FONTDATA_ITEM(183, 154, 154, fontpage_183_154_154), // '定' -- '定'
FONTDATA_ITEM(183, 162, 162, fontpage_183_162_162), // '客' -- '客'
FONTDATA_ITEM(183, 185, 185, fontpage_183_185_185), // '容' -- '容'
+ FONTDATA_ITEM(183, 248, 248, fontpage_183_248_248), // '寸' -- '寸'
FONTDATA_ITEM(184, 141, 141, fontpage_184_141_141), // '對' -- '對'
FONTDATA_ITEM(184, 143, 143, fontpage_184_143_143), // '小' -- '小'
FONTDATA_ITEM(184, 177, 177, fontpage_184_177_177), // '就' -- '就'
+ FONTDATA_ITEM(184, 186, 186, fontpage_184_186_186), // '尺' -- '尺'
FONTDATA_ITEM(187, 229, 229, fontpage_187_229_229), // '工' -- '工'
FONTDATA_ITEM(187, 238, 238, fontpage_187_238_238), // '差' -- '差'
FONTDATA_ITEM(187, 242, 242, fontpage_187_242_242), // '已' -- '已'
@@ -1374,6 +1394,7 @@ static const uxg_fontinfo_t g_fontinfo_zh_TW[] PROGMEM = {
FONTDATA_ITEM(205, 244, 244, fontpage_205_244_244), // '更' -- '更'
FONTDATA_ITEM(206, 128, 128, fontpage_206_128_128), // '最' -- '最'
FONTDATA_ITEM(206, 137, 137, fontpage_206_137_137), // '有' -- '有'
+ FONTDATA_ITEM(206, 172, 172, fontpage_206_172_172), // '本' -- '本'
FONTDATA_ITEM(206, 255, 255, fontpage_206_255_255), // '板' -- '板'
FONTDATA_ITEM(207, 241, 241, fontpage_207_241_241), // '柱' -- '柱'
FONTDATA_ITEM(208, 161, 161, fontpage_208_161_161), // '校' -- '校'
@@ -1401,7 +1422,7 @@ static const uxg_fontinfo_t g_fontinfo_zh_TW[] PROGMEM = {
FONTDATA_ITEM(226, 161, 161, fontpage_226_161_161), // '無' -- '無'
FONTDATA_ITEM(227, 177, 177, fontpage_227_177_177), // '熱' -- '熱'
FONTDATA_ITEM(227, 200, 200, fontpage_227_200_200), // '燈' -- '燈'
- FONTDATA_ITEM(228, 199, 199, fontpage_228_199_199), // '片' -- '片'
+ FONTDATA_ITEM(228, 199, 200, fontpage_228_199_200), // '片' -- '版'
FONTDATA_ITEM(228, 233, 233, fontpage_228_233_233), // '物' -- '物'
FONTDATA_ITEM(231, 135, 135, fontpage_231_135_135), // '率' -- '率'
FONTDATA_ITEM(234, 168, 168, fontpage_234_168_168), // '用' -- '用'
@@ -1472,6 +1493,7 @@ static const uxg_fontinfo_t g_fontinfo_zh_TW[] PROGMEM = {
FONTDATA_ITEM(287, 209, 209, fontpage_287_209_209), // '近' -- '近'
FONTDATA_ITEM(287, 212, 212, fontpage_287_212_212), // '返' -- '返'
FONTDATA_ITEM(288, 128, 128, fontpage_288_128_128), // '退' -- '退'
+ FONTDATA_ITEM(288, 144, 144, fontpage_288_144_144), // '逐' -- '逐'
FONTDATA_ITEM(288, 159, 159, fontpage_288_159_159), // '速' -- '速'
FONTDATA_ITEM(288, 163, 163, fontpage_288_163_163), // '連' -- '連'
FONTDATA_ITEM(288, 178, 178, fontpage_288_178_178), // '進' -- '進'
diff --git a/firmware/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/firmware/Marlin/src/lcd/dogm/marlinui_DOGM.cpp
index c215afb..29316c5 100644
--- a/firmware/Marlin/src/lcd/dogm/marlinui_DOGM.cpp
+++ b/firmware/Marlin/src/lcd/dogm/marlinui_DOGM.cpp
@@ -390,8 +390,9 @@ void MarlinUI::clear_for_drawing() {
}
#if HAS_DISPLAY_SLEEP
+ static bool asleep = false;
+ bool MarlinUI::display_is_asleep() { return asleep; }
void MarlinUI::sleep_display(const bool sleep/*=true*/) {
- static bool asleep = false;
if (asleep != sleep) {
sleep ? u8g.sleepOn() : u8g.sleepOff();
asleep = sleep;
diff --git a/firmware/Marlin/src/lcd/e3v2/common/dwin_api.cpp b/firmware/Marlin/src/lcd/e3v2/common/dwin_api.cpp
index 1688b24..4a93d30 100644
--- a/firmware/Marlin/src/lcd/e3v2/common/dwin_api.cpp
+++ b/firmware/Marlin/src/lcd/e3v2/common/dwin_api.cpp
@@ -93,16 +93,18 @@ bool dwinHandshake() {
// Get font character width
uint8_t fontWidth(uint8_t cfont) {
switch (cfont) {
- case font6x12 : return 6;
+ #if DISABLED(TJC_DISPLAY)
+ case font6x12 : return 6;
+ case font20x40: return 20;
+ case font24x48: return 24;
+ case font28x56: return 28;
+ case font32x64: return 32;
+ #endif
case font8x16 : return 8;
case font10x20: return 10;
case font12x24: return 12;
case font14x28: return 14;
case font16x32: return 16;
- case font20x40: return 20;
- case font24x48: return 24;
- case font28x56: return 28;
- case font32x64: return 32;
default: return 0;
}
}
@@ -110,16 +112,18 @@ uint8_t fontWidth(uint8_t cfont) {
// Get font character height
uint8_t fontHeight(uint8_t cfont) {
switch (cfont) {
- case font6x12 : return 12;
+ #if DISABLED(TJC_DISPLAY)
+ case font6x12 : return 12;
+ case font20x40: return 40;
+ case font24x48: return 48;
+ case font28x56: return 56;
+ case font32x64: return 64;
+ #endif
case font8x16 : return 16;
case font10x20: return 20;
case font12x24: return 24;
case font14x28: return 28;
case font16x32: return 32;
- case font20x40: return 40;
- case font24x48: return 48;
- case font28x56: return 56;
- case font32x64: return 64;
default: return 0;
}
}
diff --git a/firmware/Marlin/src/lcd/e3v2/common/limits.h b/firmware/Marlin/src/lcd/e3v2/common/limits.h
index 5debc3f..560c873 100644
--- a/firmware/Marlin/src/lcd/e3v2/common/limits.h
+++ b/firmware/Marlin/src/lcd/e3v2/common/limits.h
@@ -36,13 +36,15 @@
//
#define MIN_FEEDRATE_EDIT_VALUE 1
-constexpr xyze_float_t min_feedrate_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_FEEDRATE_EDIT_VALUE),
- default_max_feedrate = DEFAULT_MAX_FEEDRATE,
- max_feedrate_edit_values =
+constexpr xyze_feedrate_t min_feedrate_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_FEEDRATE_EDIT_VALUE);
+#if !defined(MAX_FEEDRATE_EDIT_VALUES) && defined(DEFAULT_MAX_MULTIPLIER)
+ constexpr xyze_feedrate_t default_max_feedrate = DEFAULT_MAX_FEEDRATE;
+#endif
+constexpr xyze_feedrate_t max_feedrate_edit_values =
#ifdef MAX_FEEDRATE_EDIT_VALUES
MAX_FEEDRATE_EDIT_VALUES
#else
- default_max_feedrate * float(DEFAULT_MAX_MULTIPLIER)
+ default_max_feedrate * DEFAULT_MAX_MULTIPLIER
#endif
;
@@ -51,35 +53,39 @@ constexpr xyze_float_t min_feedrate_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_FEEDR
//
#define MIN_ACCELERATION_EDIT_VALUE 1
-constexpr xyze_float_t min_acceleration_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_ACCELERATION_EDIT_VALUE),
- default_max_acceleration = DEFAULT_MAX_ACCELERATION,
- max_acceleration_edit_values =
- #ifdef MAX_ACCEL_EDIT_VALUES
- MAX_ACCEL_EDIT_VALUES
- #else
- default_max_acceleration * float(DEFAULT_MAX_MULTIPLIER)
- #endif
- ;
+constexpr xyze_float_t min_acceleration_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_ACCELERATION_EDIT_VALUE);
+#if !defined(MAX_ACCEL_EDIT_VALUES) && defined(DEFAULT_MAX_MULTIPLIER)
+ constexpr xyze_float_t default_max_acceleration = DEFAULT_MAX_ACCELERATION;
+#endif
+constexpr xyze_float_t max_acceleration_edit_values =
+ #ifdef MAX_ACCEL_EDIT_VALUES
+ MAX_ACCEL_EDIT_VALUES
+ #else
+ default_max_acceleration * DEFAULT_MAX_MULTIPLIER
+ #endif
+ ;
//
-// Max jerk limits
+// Max Jerk limits
//
-#define MIN_JERK_EDIT_VALUE 0.1
-#define DEFAULT_MAX_JERK_MULTIPLIER 2
-
#if ENABLED(CLASSIC_JERK)
- constexpr xyze_float_t min_jerk_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_JERK_EDIT_VALUE),
- default_jerk = LOGICAL_AXIS_ARRAY(
- DEFAULT_EJERK,
- DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK,
- DEFAULT_IJERK, DEFAULT_JJERK, DEFAULT_KJERK,
- DEFAULT_UJERK, DEFAULT_VJERK, DEFAULT_WJERK
- ),
- max_jerk_edit_values =
+ #define MIN_JERK_EDIT_VALUE 0.1
+
+ constexpr xyze_float_t min_jerk_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_JERK_EDIT_VALUE);
+ #if !defined(MAX_JERK_EDIT_VALUES) && defined(DEFAULT_MAX_MULTIPLIER)
+ #define DEFAULT_MAX_JERK_MULTIPLIER 2
+ constexpr xyze_float_t default_jerk = LOGICAL_AXIS_ARRAY(
+ DEFAULT_EJERK,
+ DEFAULT_XJERK, DEFAULT_YJERK, DEFAULT_ZJERK,
+ DEFAULT_IJERK, DEFAULT_JJERK, DEFAULT_KJERK,
+ DEFAULT_UJERK, DEFAULT_VJERK, DEFAULT_WJERK
+ );
+ #endif
+ constexpr xyze_float_t max_jerk_edit_values =
#ifdef MAX_JERK_EDIT_VALUES
MAX_JERK_EDIT_VALUES
#else
- default_jerk * float(DEFAULT_MAX_JERK_MULTIPLIER)
+ default_jerk * DEFAULT_MAX_JERK_MULTIPLIER
#endif
;
#endif
@@ -89,12 +95,33 @@ constexpr xyze_float_t min_acceleration_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_A
//
#define MIN_STEPS_EDIT_VALUE 1
-constexpr xyze_float_t min_steps_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_STEPS_EDIT_VALUE),
- default_steps = DEFAULT_AXIS_STEPS_PER_UNIT,
- max_steps_edit_values =
+constexpr xyze_float_t min_steps_edit_values = LOGICAL_AXIS_ARRAY_1(MIN_STEPS_EDIT_VALUE);
+#if !defined(MAX_STEPS_EDIT_VALUES) && defined(DEFAULT_MAX_MULTIPLIER)
+ constexpr xyze_float_t default_steps = DEFAULT_AXIS_STEPS_PER_UNIT;
+#endif
+constexpr xyze_float_t max_steps_edit_values =
#ifdef MAX_STEPS_EDIT_VALUES
MAX_STEPS_EDIT_VALUES
#else
- default_steps * float(DEFAULT_MAX_MULTIPLIER)
+ default_steps * DEFAULT_MAX_MULTIPLIER
#endif
;
+
+//
+// Homing Feedrate limits
+//
+#if ENABLED(EDITABLE_HOMING_FEEDRATE)
+ #define MIN_HOMING_EDIT_VALUE 1
+
+ constexpr xyz_uint_t min_homing_edit_values = NUM_AXIS_ARRAY_1(MIN_HOMING_EDIT_VALUE);
+ #ifdef DEFAULT_MAX_MULTIPLIER
+ constexpr xyz_long_t default_homing = HOMING_FEEDRATE_MM_M;
+ #endif
+ constexpr xyz_long_t max_homing_edit_values =
+ #ifdef DEFAULT_MAX_MULTIPLIER
+ default_homing * DEFAULT_MAX_MULTIPLIER
+ #else
+ { 10000, 10000, 3000 }
+ #endif
+ ;
+#endif
diff --git a/firmware/Marlin/src/lcd/e3v2/creality/dwin.cpp b/firmware/Marlin/src/lcd/e3v2/creality/dwin.cpp
index 34bdd29..04135ff 100644
--- a/firmware/Marlin/src/lcd/e3v2/creality/dwin.cpp
+++ b/firmware/Marlin/src/lcd/e3v2/creality/dwin.cpp
@@ -51,8 +51,6 @@
#include "../../../sd/cardreader.h"
#include "../../../MarlinCore.h"
-#include "../../../core/serial.h"
-#include "../../../core/macros.h"
#include "../../../gcode/queue.h"
#include "../../../module/temperature.h"
diff --git a/firmware/Marlin/src/lcd/e3v2/jyersui/README.md b/firmware/Marlin/src/lcd/e3v2/jyersui/README.md
deleted file mode 100644
index 09055d0..0000000
--- a/firmware/Marlin/src/lcd/e3v2/jyersui/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# DWIN for Creality Ender-3 v2
-
-Marlin's Ender-3 v2 support requires the `DWIN_SET` included with the Ender-3 V2 [example configuration](https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.1.x/config/examples/Creality/Ender-3%20V2).
-
-## Easy Install
-
-Copy the `DWIN_SET` folder onto a Micro-SD card and insert the card into the slot on the DWIN screen. Cycle the machine and wait for the screen to go from blue to orange. Turn the machine off and remove the SD card. When you turn on the machine the screen will display a "Creality" loading screen.
diff --git a/firmware/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/firmware/Marlin/src/lcd/e3v2/jyersui/dwin.cpp
index 8e71da8..115987b 100644
--- a/firmware/Marlin/src/lcd/e3v2/jyersui/dwin.cpp
+++ b/firmware/Marlin/src/lcd/e3v2/jyersui/dwin.cpp
@@ -46,7 +46,7 @@
#include "../../../feature/pause.h"
#endif
-#if ENABLED(FILAMENT_RUNOUT_SENSOR)
+#if HAS_FILAMENT_SENSOR
#include "../../../feature/runout.h"
#endif
@@ -2857,7 +2857,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
#define ADVANCED_LOAD (ADVANCED_LA + ENABLED(ADVANCED_PAUSE_FEATURE))
#define ADVANCED_UNLOAD (ADVANCED_LOAD + ENABLED(ADVANCED_PAUSE_FEATURE))
#define ADVANCED_COLD_EXTRUDE (ADVANCED_UNLOAD + ENABLED(PREVENT_COLD_EXTRUSION))
- #define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(FILAMENT_RUNOUT_SENSOR))
+ #define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(HAS_FILAMENT_SENSOR))
#define ADVANCED_FILSENSORDISTANCE (ADVANCED_FILSENSORENABLED + ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE))
#define ADVANCED_POWER_LOSS (ADVANCED_FILSENSORDISTANCE + ENABLED(POWER_LOSS_RECOVERY))
#define ADVANCED_TOTAL ADVANCED_POWER_LOSS
@@ -2953,7 +2953,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
break;
#endif
- #if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ #if HAS_FILAMENT_SENSOR
case ADVANCED_FILSENSORENABLED:
if (draw) {
drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR));
@@ -2975,7 +2975,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
modifyValue(runout.runout_distance(), 0, 999, 10);
break;
#endif
- #endif // FILAMENT_RUNOUT_SENSOR
+ #endif // HAS_FILAMENT_SENSOR
#if ENABLED(POWER_LOSS_RECOVERY)
case ADVANCED_POWER_LOSS:
@@ -3830,7 +3830,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
#define TUNE_LA (TUNE_ZDOWN + ENABLED(LIN_ADVANCE))
#define TUNE_CHANGEFIL (TUNE_LA + ENABLED(FILAMENT_LOAD_UNLOAD_GCODES))
#define TUNE_FWRETRACT (TUNE_CHANGEFIL + ENABLED(FWRETRACT))
- #define TUNE_FILSENSORENABLED (TUNE_FWRETRACT + ENABLED(FILAMENT_RUNOUT_SENSOR))
+ #define TUNE_FILSENSORENABLED (TUNE_FWRETRACT + ENABLED(HAS_FILAMENT_SENSOR))
#define TUNE_BACKLIGHT_OFF (TUNE_FILSENSORENABLED + 1)
#define TUNE_BACKLIGHT (TUNE_BACKLIGHT_OFF + 1)
#define TUNE_TOTAL TUNE_BACKLIGHT
@@ -3950,7 +3950,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
break;
#endif
- #if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ #if HAS_FILAMENT_SENSOR
case TUNE_FILSENSORENABLED:
if (draw) {
drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR));
@@ -4140,7 +4140,7 @@ FSTR_P JyersDWIN::getMenuTitle(const uint8_t menu) {
case ID_Move: return GET_TEXT_F(MSG_MOVE_AXIS);
case ID_ManualLevel: return GET_TEXT_F(MSG_BED_TRAMMING_MANUAL);
#if HAS_ZOFFSET_ITEM
- case ID_ZOffset: return GET_TEXT_F(MSG_ZPROBE_ZOFFSET);
+ case ID_ZOffset: return liveadjust ? GET_TEXT_F(MSG_BABYSTEP_PROBE_Z) : GET_TEXT_F(MSG_ZPROBE_ZOFFSET);
#endif
#if HAS_PREHEAT
case ID_Preheat: return F("Preheat");
@@ -4326,7 +4326,7 @@ void JyersDWIN::popupHandler(const PopupID popupid, const bool option/*=false*/)
case Popup_FilLoad: drawPopup(option ? F("Unloading Filament") : F("Loading Filament"), PWID, F(""), Proc_Wait, ICON_BLTouch); break;
case Popup_FilChange: drawPopup(F("Filament Change"), F("Please wait for prompt."), F(""), Proc_Wait, ICON_BLTouch); break;
case Popup_TempWarn: drawPopup(option ? F("Nozzle temp too low!") : F("Nozzle temp too high!"), F(""), F(""), Proc_Wait, option ? ICON_TempTooLow : ICON_TempTooHigh); break;
- #if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ #if HAS_FILAMENT_SENSOR
case Popup_Runout: drawPopup(F("Filament Runout"), F(""), F(""), Proc_Wait, ICON_BLTouch); break;
#endif
#if ANY(PIDTEMP, PIDTEMPBED)
@@ -4953,7 +4953,7 @@ void JyersDWIN::stateUpdate() {
}
}
#endif
- #if ENABLED(FILAMENT_RUNOUT_SENSOR)
+ #if HAS_FILAMENT_SENSOR
static bool ranout = false;
if (runout.filament_ran_out != ranout) {
ranout = runout.filament_ran_out;
diff --git a/firmware/Marlin/src/lcd/e3v2/proui/dwin.cpp b/firmware/Marlin/src/lcd/e3v2/proui/dwin.cpp
index 633f756..c4d94d6 100644
--- a/firmware/Marlin/src/lcd/e3v2/proui/dwin.cpp
+++ b/firmware/Marlin/src/lcd/e3v2/proui/dwin.cpp
@@ -40,8 +40,6 @@
#include "../../marlinui.h"
#include "../../extui/ui_api.h"
#include "../../../MarlinCore.h"
-#include "../../../core/serial.h"
-#include "../../../core/macros.h"
#include "../../../module/temperature.h"
#include "../../../module/printcounter.h"
#include "../../../module/motion.h"
@@ -270,6 +268,9 @@ Menu *stepsMenu = nullptr;
#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
Menu *homingMenu = nullptr;
#endif
+#if ENABLED(EDITABLE_HOMING_FEEDRATE)
+ Menu *homingFRMenu = nullptr;
+#endif
#if ENABLED(FWRETRACT)
Menu *fwRetractMenu = nullptr;
#endif
@@ -2206,6 +2207,13 @@ void setMoveX() { hmiValue.axis = X_AXIS; setPFloatOnClick(X_MIN_POS, X_MAX_POS,
void setMoveY() { hmiValue.axis = Y_AXIS; setPFloatOnClick(Y_MIN_POS, Y_MAX_POS, UNITFDIGITS, applyMove, liveMove); }
void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS, UNITFDIGITS, applyMove, liveMove); }
+#if ENABLED(Z_STEPPER_AUTO_ALIGN)
+ void autoZAlign() {
+ LCD_MESSAGE(MSG_AUTO_Z_ALIGN);
+ queue.inject(F("G34"));
+ }
+#endif
+
#if HAS_HOTEND
void setMoveE() {
const float e_min = current_position.e - (EXTRUDE_MAXLENGTH),
@@ -2598,13 +2606,13 @@ void setFlow() { setPIntOnClick(FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refres
void applyMaxSpeed() { planner.set_max_feedrate(hmiValue.axis, menuData.value / MINUNITMULT); }
#if HAS_X_AXIS
- void setMaxSpeedX() { hmiValue.axis = X_AXIS, setFloatOnClick(min_feedrate_edit_values.x, max_feedrate_edit_values.x, UNITFDIGITS, planner.settings.max_feedrate_mm_s[X_AXIS], applyMaxSpeed); }
+ void setMaxSpeedX() { hmiValue.axis = X_AXIS; setFloatOnClick(min_feedrate_edit_values.x, max_feedrate_edit_values.x, UNITFDIGITS, planner.settings.max_feedrate_mm_s[X_AXIS], applyMaxSpeed); }
#endif
#if HAS_Y_AXIS
- void setMaxSpeedY() { hmiValue.axis = Y_AXIS, setFloatOnClick(min_feedrate_edit_values.y, max_feedrate_edit_values.y, UNITFDIGITS, planner.settings.max_feedrate_mm_s[Y_AXIS], applyMaxSpeed); }
+ void setMaxSpeedY() { hmiValue.axis = Y_AXIS; setFloatOnClick(min_feedrate_edit_values.y, max_feedrate_edit_values.y, UNITFDIGITS, planner.settings.max_feedrate_mm_s[Y_AXIS], applyMaxSpeed); }
#endif
#if HAS_Z_AXIS
- void setMaxSpeedZ() { hmiValue.axis = Z_AXIS, setFloatOnClick(min_feedrate_edit_values.z, max_feedrate_edit_values.z, UNITFDIGITS, planner.settings.max_feedrate_mm_s[Z_AXIS], applyMaxSpeed); }
+ void setMaxSpeedZ() { hmiValue.axis = Z_AXIS; setFloatOnClick(min_feedrate_edit_values.z, max_feedrate_edit_values.z, UNITFDIGITS, planner.settings.max_feedrate_mm_s[Z_AXIS], applyMaxSpeed); }
#endif
#if HAS_HOTEND
void setMaxSpeedE() { hmiValue.axis = E_AXIS; setFloatOnClick(min_feedrate_edit_values.e, max_feedrate_edit_values.e, UNITFDIGITS, planner.settings.max_feedrate_mm_s[E_AXIS], applyMaxSpeed); }
@@ -2612,13 +2620,13 @@ void applyMaxSpeed() { planner.set_max_feedrate(hmiValue.axis, menuData.value /
void applyMaxAccel() { planner.set_max_acceleration(hmiValue.axis, menuData.value); }
#if HAS_X_AXIS
- void setMaxAccelX() { hmiValue.axis = X_AXIS, setIntOnClick(min_acceleration_edit_values.x, max_acceleration_edit_values.x, planner.settings.max_acceleration_mm_per_s2[X_AXIS], applyMaxAccel); }
+ void setMaxAccelX() { hmiValue.axis = X_AXIS; setIntOnClick(min_acceleration_edit_values.x, max_acceleration_edit_values.x, planner.settings.max_acceleration_mm_per_s2[X_AXIS], applyMaxAccel); }
#endif
#if HAS_Y_AXIS
- void setMaxAccelY() { hmiValue.axis = Y_AXIS, setIntOnClick(min_acceleration_edit_values.y, max_acceleration_edit_values.y, planner.settings.max_acceleration_mm_per_s2[Y_AXIS], applyMaxAccel); }
+ void setMaxAccelY() { hmiValue.axis = Y_AXIS; setIntOnClick(min_acceleration_edit_values.y, max_acceleration_edit_values.y, planner.settings.max_acceleration_mm_per_s2[Y_AXIS], applyMaxAccel); }
#endif
#if HAS_Z_AXIS
- void setMaxAccelZ() { hmiValue.axis = Z_AXIS, setIntOnClick(min_acceleration_edit_values.z, max_acceleration_edit_values.z, planner.settings.max_acceleration_mm_per_s2[Z_AXIS], applyMaxAccel); }
+ void setMaxAccelZ() { hmiValue.axis = Z_AXIS; setIntOnClick(min_acceleration_edit_values.z, max_acceleration_edit_values.z, planner.settings.max_acceleration_mm_per_s2[Z_AXIS], applyMaxAccel); }
#endif
#if HAS_HOTEND
void setMaxAccelE() { hmiValue.axis = E_AXIS; setIntOnClick(min_acceleration_edit_values.e, max_acceleration_edit_values.e, planner.settings.max_acceleration_mm_per_s2[E_AXIS], applyMaxAccel); }
@@ -2627,13 +2635,13 @@ void applyMaxAccel() { planner.set_max_acceleration(hmiValue.axis, menuData.valu
#if ENABLED(CLASSIC_JERK)
void applyMaxJerk() { planner.set_max_jerk(hmiValue.axis, menuData.value / MINUNITMULT); }
#if HAS_X_AXIS
- void setMaxJerkX() { hmiValue.axis = X_AXIS, setFloatOnClick(min_jerk_edit_values.x, max_jerk_edit_values.x, UNITFDIGITS, planner.max_jerk.x, applyMaxJerk); }
+ void setMaxJerkX() { hmiValue.axis = X_AXIS; setFloatOnClick(min_jerk_edit_values.x, max_jerk_edit_values.x, UNITFDIGITS, planner.max_jerk.x, applyMaxJerk); }
#endif
#if HAS_Y_AXIS
- void setMaxJerkY() { hmiValue.axis = Y_AXIS, setFloatOnClick(min_jerk_edit_values.y, max_jerk_edit_values.y, UNITFDIGITS, planner.max_jerk.y, applyMaxJerk); }
+ void setMaxJerkY() { hmiValue.axis = Y_AXIS; setFloatOnClick(min_jerk_edit_values.y, max_jerk_edit_values.y, UNITFDIGITS, planner.max_jerk.y, applyMaxJerk); }
#endif
#if HAS_Z_AXIS
- void setMaxJerkZ() { hmiValue.axis = Z_AXIS, setFloatOnClick(min_jerk_edit_values.z, max_jerk_edit_values.z, UNITFDIGITS, planner.max_jerk.z, applyMaxJerk); }
+ void setMaxJerkZ() { hmiValue.axis = Z_AXIS; setFloatOnClick(min_jerk_edit_values.z, max_jerk_edit_values.z, UNITFDIGITS, planner.max_jerk.z, applyMaxJerk); }
#endif
#if HAS_HOTEND
void setMaxJerkE() { hmiValue.axis = E_AXIS; setFloatOnClick(min_jerk_edit_values.e, max_jerk_edit_values.e, UNITFDIGITS, planner.max_jerk.e, applyMaxJerk); }
@@ -2648,17 +2656,39 @@ void applyMaxAccel() { planner.set_max_acceleration(hmiValue.axis, menuData.valu
#endif
#if HAS_X_AXIS
- void setStepsX() { hmiValue.axis = X_AXIS, setPFloatOnClick( min_steps_edit_values.x, max_steps_edit_values.x, UNITFDIGITS); }
+ void setStepsX() { hmiValue.axis = X_AXIS; setPFloatOnClick( min_steps_edit_values.x, max_steps_edit_values.x, UNITFDIGITS); }
#endif
#if HAS_Y_AXIS
- void setStepsY() { hmiValue.axis = Y_AXIS, setPFloatOnClick( min_steps_edit_values.y, max_steps_edit_values.y, UNITFDIGITS); }
+ void setStepsY() { hmiValue.axis = Y_AXIS; setPFloatOnClick( min_steps_edit_values.y, max_steps_edit_values.y, UNITFDIGITS); }
#endif
#if HAS_Z_AXIS
- void setStepsZ() { hmiValue.axis = Z_AXIS, setPFloatOnClick( min_steps_edit_values.z, max_steps_edit_values.z, UNITFDIGITS); }
+ void setStepsZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick( min_steps_edit_values.z, max_steps_edit_values.z, UNITFDIGITS); }
#endif
#if HAS_HOTEND
void setStepsE() { hmiValue.axis = E_AXIS; setPFloatOnClick( min_steps_edit_values.e, max_steps_edit_values.e, UNITFDIGITS); }
#endif
+
+#if ENABLED(EDITABLE_HOMING_FEEDRATE)
+ void updateHomingFR(AxisEnum axis, feedRate_t value) {
+ switch (axis) {
+ case X_AXIS: homing_feedrate_mm_m.x = value; break;
+ case Y_AXIS: homing_feedrate_mm_m.y = value; break;
+ case Z_AXIS: homing_feedrate_mm_m.z = value; break;
+ default: break;
+ }
+ }
+ void applyHomingFR() { updateHomingFR(hmiValue.axis, menuData.value); }
+ #if HAS_X_AXIS
+ void setHomingX() { hmiValue.axis = X_AXIS; setIntOnClick(min_homing_edit_values.x, max_homing_edit_values.x, homing_feedrate_mm_m.x, applyHomingFR); }
+ #endif
+ #if HAS_Y_AXIS
+ void setHomingY() { hmiValue.axis = Y_AXIS; setIntOnClick(min_homing_edit_values.y, max_homing_edit_values.y, homing_feedrate_mm_m.x, applyHomingFR); }
+ #endif
+ #if HAS_Z_AXIS
+ void setHomingZ() { hmiValue.axis = Z_AXIS; setIntOnClick(min_homing_edit_values.z, max_homing_edit_values.z, homing_feedrate_mm_m.x, applyHomingFR); }
+ #endif
+#endif
+
#if ENABLED(FWRETRACT)
void returnFWRetractMenu() { (previousMenu == filSetMenu) ? drawFilSetMenu() : drawTuneMenu(); }
void setRetractLength() { setPFloatOnClick( 0, 10, UNITFDIGITS); }
@@ -3358,7 +3388,7 @@ void drawFilSetMenu() {
if (SET_MENU(ledControlMenu, MSG_LED_CONTROL, 10)) {
BACK_ITEM((currentMenu == tuneMenu) ? drawTuneMenu : drawControlMenu);
#if !ALL(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL)
- EDIT_ITEM(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, setLedStatus, &leds.lights_on);
+ EDIT_ITEM(ICON_LedControl, MSG_LIGHTS, onDrawChkbMenu, setLedStatus, &leds.lights_on);
#endif
#if HAS_COLOR_LEDS
#if ENABLED(LED_COLOR_PRESETS)
@@ -3400,7 +3430,7 @@ void drawTuneMenu() {
fanSpeedItem = EDIT_ITEM(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, setFanSpeed, &thermalManager.fan_speed[0]);
#endif
#if ALL(HAS_ZOFFSET_ITEM, HAS_BED_PROBE, BABYSTEP_ZPROBE_OFFSET, BABYSTEPPING)
- EDIT_ITEM(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawZOffset, setZOffset, &BABY_Z_VAR);
+ EDIT_ITEM(ICON_Zoffset, MSG_BABYSTEP_PROBE_Z, onDrawZOffset, setZOffset, &BABY_Z_VAR);
#elif ALL(HAS_ZOFFSET_ITEM, MESH_BED_LEVELING, BABYSTEPPING)
EDIT_ITEM(ICON_Zoffset, MSG_HOME_OFFSET_Z, onDrawPFloat2Menu, setZOffset, &BABY_Z_VAR);
#endif
@@ -3450,7 +3480,7 @@ void drawTuneMenu() {
MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, drawLedControlMenu);
#endif
#elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL)
- EDIT_ITEM(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, setLedStatus, &leds.lights_on);
+ EDIT_ITEM(ICON_LedControl, MSG_LIGHTS, onDrawChkbMenu, setLedStatus, &leds.lights_on);
#endif
}
updateMenu(tuneMenu);
@@ -3545,7 +3575,7 @@ void drawTuneMenu() {
void drawMotionMenu() {
checkkey = ID_Menu;
- if (SET_MENU_R(motionMenu, selrect({1, 16, 28, 13}), MSG_MOTION, 10)) {
+ if (SET_MENU_R(motionMenu, selrect({1, 16, 28, 13}), MSG_MOTION, 11)) {
BACK_ITEM(drawControlMenu);
MENU_ITEM(ICON_MaxSpeed, MSG_SPEED, onDrawSpeed, drawMaxSpeedMenu);
MENU_ITEM(ICON_MaxAccelerated, MSG_ACCELERATION, onDrawAcc, drawMaxAccelMenu);
@@ -3554,6 +3584,12 @@ void drawMotionMenu() {
#elif HAS_JUNCTION_DEVIATION
EDIT_ITEM(ICON_JDmm, MSG_JUNCTION_DEVIATION, onDrawPFloat3Menu, setJDmm, &planner.junction_deviation_mm);
#endif
+ #if ENABLED(EDITABLE_STEPS_PER_UNIT)
+ MENU_ITEM(ICON_Step, MSG_STEPS_PER_MM, onDrawSteps, drawStepsMenu);
+ #endif
+ #if ENABLED(EDITABLE_HOMING_FEEDRATE)
+ MENU_ITEM(ICON_Homing, MSG_HOMING_FEEDRATE, onDrawSubMenu, drawHomingFRMenu);
+ #endif
#if ENABLED(LIN_ADVANCE)
EDIT_ITEM(ICON_MaxAccelerated, MSG_ADVANCE_K, onDrawPFloat3Menu, setLA_K, &planner.extruder_advance_K[0]);
#endif
@@ -3563,9 +3599,6 @@ void drawMotionMenu() {
#if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE)
EDIT_ITEM(ICON_UBLActive, MSG_STEP_SMOOTHING, onDrawChkbMenu, setAdaptiveStepSmoothing, &stepper.adaptive_step_smoothing_enabled);
#endif
- #if ENABLED(EDITABLE_STEPS_PER_UNIT)
- MENU_ITEM(ICON_Step, MSG_STEPS_PER_MM, onDrawSteps, drawStepsMenu);
- #endif
EDIT_ITEM(ICON_Flow, MSG_FLOW, onDrawPIntMenu, setFlow, &planner.flow_percentage[0]);
EDIT_ITEM(ICON_Speed, MSG_SPEED, onDrawPIntMenu, setSpeed, &feedrate_percentage);
}
@@ -3764,6 +3797,30 @@ void drawMaxAccelMenu() {
#endif
+#if ENABLED(EDITABLE_HOMING_FEEDRATE)
+
+ void drawHomingFRMenu() {
+ checkkey = ID_Menu;
+ if (SET_MENU(homingFRMenu, MSG_HOMING_FEEDRATE, 4)) {
+ BACK_ITEM(drawMotionMenu);
+ #if HAS_X_AXIS
+ uint16_t xhome = static_cast(homing_feedrate_mm_m.x);
+ EDIT_ITEM(ICON_MaxSpeedJerkX, MSG_HOMING_FEEDRATE_X, onDrawPIntMenu, setHomingX, &xhome);
+ #endif
+ #if HAS_Y_AXIS
+ uint16_t yhome = static_cast(homing_feedrate_mm_m.y);
+ EDIT_ITEM(ICON_MaxSpeedJerkY, MSG_HOMING_FEEDRATE_Y, onDrawPIntMenu, setHomingY, &yhome);
+ #endif
+ #if HAS_Z_AXIS
+ uint16_t zhome = static_cast(homing_feedrate_mm_m.z);
+ EDIT_ITEM(ICON_MaxSpeedJerkZ, MSG_HOMING_FEEDRATE_Z, onDrawPIntMenu, setHomingZ, &zhome);
+ #endif
+ }
+ updateMenu(homingFRMenu);
+ }
+
+#endif
+
//=============================================================================
// UI editable custom colors
//=============================================================================
@@ -4028,7 +4085,7 @@ void drawMaxAccelMenu() {
BACK_ITEM(drawPrepareMenu);
MENU_ITEM(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, autoHome);
MENU_ITEM(ICON_AxisD, MSG_MOVE_NOZZLE_TO_BED, onDrawMenuItem, setMoveZto0);
- EDIT_ITEM(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, setZOffset, &BABY_Z_VAR);
+ EDIT_ITEM(ICON_Zoffset, MSG_BABYSTEP_PROBE_Z, onDrawPFloat2Menu, setZOffset, &BABY_Z_VAR);
}
updateMenu(zOffsetWizMenu);
if (!axis_is_trusted(Z_AXIS)) LCD_MESSAGE_F("WARNING: Z position unknown, move Z to home");
@@ -4052,6 +4109,9 @@ void drawMaxAccelMenu() {
#if HAS_Z_AXIS
MENU_ITEM(ICON_HomeZ, MSG_AUTO_HOME_Z, onDrawMenuItem, homeZ);
#endif
+ #if ENABLED(Z_STEPPER_AUTO_ALIGN)
+ MENU_ITEM(ICON_HomeZ, MSG_AUTO_Z_ALIGN, onDrawMenuItem, autoZAlign);
+ #endif
#if ENABLED(MESH_BED_LEVELING)
EDIT_ITEM(ICON_ZAfterHome, MSG_Z_AFTER_HOME, onDrawPInt8Menu, setZAfterHoming, &hmiData.zAfterHoming);
#endif
diff --git a/firmware/Marlin/src/lcd/e3v2/proui/dwin.h b/firmware/Marlin/src/lcd/e3v2/proui/dwin.h
index b424c8d..b6534a6 100644
--- a/firmware/Marlin/src/lcd/e3v2/proui/dwin.h
+++ b/firmware/Marlin/src/lcd/e3v2/proui/dwin.h
@@ -372,6 +372,9 @@ void drawMaxAccelMenu();
#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
void drawHomingMenu();
#endif
+#if ENABLED(EDITABLE_HOMING_FEEDRATE)
+ void drawHomingFRMenu();
+#endif
#if ENABLED(FWRETRACT)
void drawFWRetractMenu();
#endif
diff --git a/firmware/Marlin/src/lcd/e3v2/proui/menus.cpp b/firmware/Marlin/src/lcd/e3v2/proui/menus.cpp
index 88fbf60..0f0005e 100644
--- a/firmware/Marlin/src/lcd/e3v2/proui/menus.cpp
+++ b/firmware/Marlin/src/lcd/e3v2/proui/menus.cpp
@@ -390,14 +390,14 @@ CustomMenuItem** Menu::items() {
int8_t Menu::count() {
return MenuItemCount;
-};
+}
/* MenuItem Class ===========================================================*/
void CustomMenuItem::draw(int8_t line) {
if (line < 0 || line >= TROWS) return;
if (onDraw != nullptr) (*onDraw)(static_cast
-Additional documentation can be found at the [Marlin Home Page](https://marlinfw.org/).
+Additional documentation can be found at the [Marlin Home Page](//marlinfw.org/).
Please test this firmware and let us know if it misbehaves in any way. Volunteers are standing by!
## Marlin 2.1 Bugfix Branch
__Not for production use. Use with caution!__
-Marlin 2.1 takes this popular RepRap firmware to the next level by adding support for much faster 32-bit and ARM-based boards while improving support for 8-bit AVR boards. Read about Marlin's decision to use a "Hardware Abstraction Layer" below.
+Marlin 2.1 continues to support both 32-bit ARM and 8-bit AVR boards while adding support for up to 9 coordinated axes and to up to 8 extruders.
This branch is for patches to the latest 2.1.x release version. Periodically this branch will form the basis for the next minor 2.1.x release.
-Download earlier versions of Marlin on the [Releases page](https://github.com/MarlinFirmware/Marlin/releases).
+Download earlier versions of Marlin on the [Releases page](//github.com/MarlinFirmware/Marlin/releases).
## Example Configurations
-Before you can build Marlin for your machine you'll need a configuration for your specific hardware. Upon request, your vendor will be happy to provide you with the complete source code and configurations for your machine, but you'll need to get updated configuration files if you want to install a newer version of Marlin. Fortunately, Marlin users have contributed dozens of tested configurations to get you started. Visit the [MarlinFirmware/Configurations](https://github.com/MarlinFirmware/Configurations) repository to find the right configuration for your hardware.
+Before you can build Marlin for your machine you'll need a configuration for your specific hardware. Upon request, your vendor will be happy to provide you with the complete source code and configurations for your machine, but you'll need to get updated configuration files if you want to install a newer version of Marlin. Fortunately, Marlin users have contributed dozens of tested configurations to get you started. Visit the [MarlinFirmware/Configurations](//github.com/MarlinFirmware/Configurations) repository to find the right configuration for your hardware.
## Building Marlin 2.1
To build and upload Marlin you will use one of these tools:
-- The free [Visual Studio Code](https://code.visualstudio.com/download) using the [Auto Build Marlin](https://marlinfw.org/docs/basics/auto_build_marlin.html) extension.
-- The free [Arduino IDE](https://www.arduino.cc/en/main/software) : See [Building Marlin with Arduino](https://marlinfw.org/docs/basics/install_arduino.html)
+- The free [Visual Studio Code](//code.visualstudio.com/download) using the [Auto Build Marlin](//marlinfw.org/docs/basics/auto_build_marlin.html) extension.
+- The free [Arduino IDE](//www.arduino.cc/en/main/software) : See [Building Marlin with Arduino](//marlinfw.org/docs/basics/install_arduino.html)
- You can also use VSCode with devcontainer : See [Installing Marlin (VSCode devcontainer)](http://marlinfw.org/docs/basics/install_devcontainer_vscode.html).
Marlin is optimized to build with the **PlatformIO IDE** extension for **Visual Studio Code**. You can still build Marlin with **Arduino IDE**, and we hope to improve the Arduino build experience, but at this time PlatformIO is the better choice.
@@ -53,43 +54,48 @@ Every new HAL opens up a world of hardware. At this time we need HALs for RP2040
Platform|MCU|Example Boards
--------|---|-------
- [Arduino AVR](https://www.arduino.cc/)|ATmega|RAMPS, Melzi, RAMBo
- [Teensy++ 2.0](https://www.microchip.com/en-us/product/AT90USB1286)|AT90USB1286|Printrboard
- [Arduino Due](https://www.arduino.cc/en/Guide/ArduinoDue)|SAM3X8E|RAMPS-FD, RADDS, RAMPS4DUE
- [ESP32](https://github.com/espressif/arduino-esp32)|ESP32|FYSETC E4, E4d@BOX, MRR
- [LPC1768](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1768FBD100)|ARM® Cortex-M3|MKS SBASE, Re-ARM, Selena Compact
- [LPC1769](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1769FBD100)|ARM® Cortex-M3|Smoothieboard, Azteeg X5 mini, TH3D EZBoard
- [STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html)|ARM® Cortex-M3|Malyan M200, GTM32 Pro, MKS Robin, BTT SKR Mini
- [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)|ARM® Cortex-M4|ARMED, Rumba32, SKR Pro, Lerdge, FYSETC S6, Artillery Ruby
- [STM32F7x6](https://www.st.com/en/microcontrollers-microprocessors/stm32f7x6.html)|ARM® Cortex-M7|The Borg, RemRam V1
- [STM32G0B1RET6](https://www.st.com/en/microcontrollers-microprocessors/stm32g0x1.html)|ARM® Cortex-M0+|BigTreeTech SKR mini E3 V3.0
- [STM32H743xIT6](https://www.st.com/en/microcontrollers-microprocessors/stm32h743-753.html)|ARM® Cortex-M7|BigTreeTech SKR V3.0, SKR EZ V3.0, SKR SE BX V2.0/V3.0
- [SAMD51P20A](https://www.adafruit.com/product/4064)|ARM® Cortex-M4|Adafruit Grand Central M4
- [Teensy 3.5](https://www.pjrc.com/store/teensy35.html)|ARM® Cortex-M4|
- [Teensy 3.6](https://www.pjrc.com/store/teensy36.html)|ARM® Cortex-M4|
- [Teensy 4.0](https://www.pjrc.com/store/teensy40.html)|ARM® Cortex-M7|
- [Teensy 4.1](https://www.pjrc.com/store/teensy41.html)|ARM® Cortex-M7|
- Linux Native|x86/ARM/etc.|Raspberry Pi
- [All supported boards](https://marlinfw.org/docs/hardware/boards.html#boards-list)|All platforms|All boards
+ [Arduino AVR](//www.arduino.cc/)|ATmega|RAMPS, Melzi, RAMBo
+ [Teensy++ 2.0](//www.microchip.com/en-us/product/AT90USB1286)|AT90USB1286|Printrboard
+ [Arduino Due](//www.arduino.cc/en/Guide/ArduinoDue)|SAM3X8E|RAMPS-FD, RADDS, RAMPS4DUE
+ [ESP32](//github.com/espressif/arduino-esp32)|ESP32|FYSETC E4, E4d@BOX, MRR
+ [HC32](//www.huazhoucn.com/)|HC32|Ender-2 Pro, Voxelab Aquila
+ [LPC1768](//www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1768FBD100)|ARM® Cortex-M3|MKS SBASE, Re-ARM, Selena Compact
+ [LPC1769](//www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512-kb-flash-64-kb-sram-ethernet-usb-lqfp100-package:LPC1769FBD100)|ARM® Cortex-M3|Smoothieboard, Azteeg X5 mini, TH3D EZBoard
+ [STM32F103](//www.st.com/en/microcontrollers-microprocessors/stm32f103.html)|ARM® Cortex-M3|Malyan M200, GTM32 Pro, MKS Robin, BTT SKR Mini
+ [STM32F401](//www.st.com/en/microcontrollers-microprocessors/stm32f401.html)|ARM® Cortex-M4|ARMED, Rumba32, SKR Pro, Lerdge, FYSETC S6, Artillery Ruby
+ [Pico RP2040](//www.raspberrypi.com/documentation/microcontrollers/pico-series.html)|Dual Cortex M0+|BigTreeTech SKR Pico
+ [STM32F7x6](//www.st.com/en/microcontrollers-microprocessors/stm32f7x6.html)|ARM® Cortex-M7|The Borg, RemRam V1
+ [STM32G0B1RET6](//www.st.com/en/microcontrollers-microprocessors/stm32g0x1.html)|ARM® Cortex-M0+|BigTreeTech SKR mini E3 V3.0
+ [STM32H743xIT6](//www.st.com/en/microcontrollers-microprocessors/stm32h743-753.html)|ARM® Cortex-M7|BigTreeTech SKR V3.0, SKR EZ V3.0, SKR SE BX V2.0/V3.0
+ [SAMD21P20A](//www.adafruit.com/product/4064)|ARM® Cortex-M0+|Adafruit Grand Central M4
+ [SAMD51P20A](//www.adafruit.com/product/4064)|ARM® Cortex-M4|Adafruit Grand Central M4
+ [Teensy 3.2/3.1](//www.pjrc.com/teensy/teensy31.html)|MK20DX256VLH7 ARM® Cortex-M4|
+ [Teensy 3.5](//www.pjrc.com/store/teensy35.html)|MK64FX512-VMD12 ARM® Cortex-M4|
+ [Teensy 3.6](//www.pjrc.com/store/teensy36.html)|MK66FX1MB-VMD18 ARM® Cortex-M4|
+ [Teensy 4.0](//www.pjrc.com/store/teensy40.html)|MIMXRT1062-DVL6B ARM® Cortex-M7|
+ [Teensy 4.1](//www.pjrc.com/store/teensy41.html)|MIMXRT1062-DVJ6B ARM® Cortex-M7|
+ Linux Native|x86 / ARM / RISC-V|Raspberry Pi GPIO
+ Simulator|Windows, macOS, Linux|Desktop OS
+ [All supported boards](//marlinfw.org/docs/hardware/boards.html#boards-list)|All platforms|All boards
## Marlin Support
The Issue Queue is reserved for Bug Reports and Feature Requests. Please use the following resources for help with configuration and troubleshooting:
-- [Marlin Documentation](https://marlinfw.org) - Official Marlin documentation
-- [Marlin Discord](https://discord.com/servers/marlin-firmware-461605380783472640) - Discuss issues with Marlin users and developers
-- Facebook Group ["Marlin Firmware"](https://www.facebook.com/groups/1049718498464482/)
-- RepRap.org [Marlin Forum](https://forums.reprap.org/list.php?415)
-- Facebook Group ["Marlin Firmware for 3D Printers"](https://www.facebook.com/groups/3Dtechtalk/)
-- [Marlin Configuration](https://www.youtube.com/results?search_query=marlin+configuration) on YouTube
+- [Marlin Documentation](//marlinfw.org) - Official Marlin documentation
+- [Marlin Discord](//discord.com/servers/marlin-firmware-461605380783472640) - Discuss issues with Marlin users and developers
+- Facebook Group ["Marlin Firmware"](//www.facebook.com/groups/1049718498464482/)
+- RepRap.org [Marlin Forum](//forums.reprap.org/list.php?415)
+- Facebook Group ["Marlin Firmware for 3D Printers"](//www.facebook.com/groups/3Dtechtalk/)
+- [Marlin Configuration](//www.youtube.com/results?search_query=marlin+configuration) on YouTube
## Contributing Patches
-You can contribute patches by submitting a Pull Request to the ([bugfix-2.1.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.1.x)) branch.
+You can contribute patches by submitting a Pull Request to the ([bugfix-2.1.x](//github.com/MarlinFirmware/Marlin/tree/bugfix-2.1.x)) branch.
- We use branches named with a "bugfix" or "dev" prefix to fix bugs and integrate new features.
-- Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers.
-- Please submit Feature Requests and Bug Reports to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues/new/choose). See above for user support.
+- Follow the [Coding Standards](//marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers.
+- Please submit Feature Requests and Bug Reports to the [Issue Queue](//github.com/MarlinFirmware/Marlin/issues/new/choose). See above for user support.
- Whenever you add new features, be sure to add one or more build tests to `buildroot/tests`. Any tests added to a PR will be run within that PR on GitHub servers as soon as they are pushed. To minimize iteration be sure to run your new tests locally, if possible.
- Local build tests:
- All: `make tests-config-all-local`
@@ -109,21 +115,33 @@ You can contribute patches by submitting a Pull Request to the ([bugfix-2.1.x](h
## Contributors
-Marlin is constantly improving thanks to a huge number of contributors from all over the world bringing their specialties and talents. Huge thanks are due to [all the contributors](https://github.com/MarlinFirmware/Marlin/graphs/contributors) who regularly patch up bugs, help direct traffic, and basically keep Marlin from falling apart. Marlin's continued existence would not be possible without them.
+Marlin is constantly improving thanks to a huge number of contributors from all over the world bringing their specialties and talents. Huge thanks are due to [all the contributors](//github.com/MarlinFirmware/Marlin/graphs/contributors) who regularly patch up bugs, help direct traffic, and basically keep Marlin from falling apart. Marlin's continued existence would not be possible without them.
+
+Marlin Firmware original logo design by Ahmet Cem TURAN [@ahmetcemturan](//github.com/ahmetcemturan).
## Project Leadership
Name|Role|Link|Donate
----|----|----|----
-🇺🇸 Scott Lahteine|Project Lead|[[@thinkyhead](https://github.com/thinkyhead)]|[💸 Donate](https://marlinfw.org/docs/development/contributing.html#donate)
-🇺🇸 Roxanne Neufeld|Admin|[[@Roxy-3D](https://github.com/Roxy-3D)]|
-🇺🇸 Keith Bennett|Admin|[[@thisiskeithb](https://github.com/thisiskeithb)]|[💸 Donate](https://github.com/sponsors/thisiskeithb)
-🇺🇸 Jason Smith|Admin|[[@sjasonsmith](https://github.com/sjasonsmith)]|
-🇧🇷 Victor Oliveira|Admin|[[@rhapsodyv](https://github.com/rhapsodyv)]|
-🇬🇧 Chris Pepper|Admin|[[@p3p](https://github.com/p3p)]|
-🇳🇿 Peter Ellens|Admin|[[@ellensp](https://github.com/ellensp)]|[💸 Donate](https://ko-fi.com/ellensp)
-🇺🇸 Bob Kuhn|Admin|[[@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn)]|
-🇳🇱 Erik van der Zalm|Founder|[[@ErikZalm](https://github.com/ErikZalm)]|
+🇺🇸 Scott Lahteine|Project Lead|[[@thinkyhead](//github.com/thinkyhead)]|[💸 Donate](//marlinfw.org/docs/development/contributing.html#donate)
+🇺🇸 Roxanne Neufeld|Admin|[[@Roxy-3D](//github.com/Roxy-3D)]|
+🇺🇸 Keith Bennett|Admin|[[@thisiskeithb](//github.com/thisiskeithb)]|[💸 Donate](//github.com/sponsors/thisiskeithb)
+🇺🇸 Jason Smith|Admin|[[@sjasonsmith](//github.com/sjasonsmith)]|
+🇧🇷 Victor Oliveira|Admin|[[@rhapsodyv](//github.com/rhapsodyv)]|
+🇬🇧 Chris Pepper|Admin|[[@p3p](//github.com/p3p)]|
+🇳🇿 Peter Ellens|Admin|[[@ellensp](//github.com/ellensp)]|[💸 Donate](//ko-fi.com/ellensp)
+🇺🇸 Bob Kuhn|Admin|[[@Bob-the-Kuhn](//github.com/Bob-the-Kuhn)]|
+🇳🇱 Erik van der Zalm|Founder|[[@ErikZalm](//github.com/ErikZalm)]|
+
+## Star History
+
+
+
+
+
+
+
+
## License
diff --git a/firmware/buildroot/bin/__init__.py b/firmware/buildroot/bin/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/firmware/buildroot/bin/build_all_examples b/firmware/buildroot/bin/build_all_examples
old mode 100755
new mode 100644
index 7c4e8cb..c2b0007
--- a/firmware/buildroot/bin/build_all_examples
+++ b/firmware/buildroot/bin/build_all_examples
@@ -2,47 +2,48 @@
#
# Usage:
#
-# build_all_examples [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x)
+# build_all_examples [-a|--archive] - Copy the binary to the export location
# [-B|--base] - Base path of configurations, overriding -b
+# [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x)
# [-c|--continue] - Continue the paused build
-# [-p|--purge] - Purge the status file and start over
-# [-s|--skip] - Continue the paused build, skipping one
-# [-r|--resume=] - Start at some config in the filesystem order
-# [-l|--limit=#] - Limit the number of builds in this run
-# [-d|--debug] - Print extra debug output (after)
-# [-n|--nobuild] - Don't actually build anything
+# [-d|-v|--debug] - Print extra debug output (after)
+# [-e|--export=N] - Set CONFIG_EXPORT and export to the export location
# [-f|--nofail] - Don't stop on a failed build
-# [-e|--export=N] - Set CONFIG_EXPORT and export into each config folder
-# [-a|--archive] - Copy the binary to the export location
+# [-h|--help] - Print usage and exit
+# [-l|--limit=#] - Limit the number of builds in this run
+# [-n|--nobuild] - Don't actually build anything
# [-o|--output] - Redirect export / archiving to another location
# (By default export to origin config folders)
-# [-h|--help] - Print usage and exit
+# [-p|--purge] - Purge the status file and start over
+# [-r|--resume=] - Start at some config in the filesystem order
+# [-s|--skip] - Continue the paused build, skipping one
#
HERE=`dirname $0`
+PATH="$HERE:$PATH"
-. "$HERE/mfutil"
+. mfutil
GITREPO=https://github.com/MarlinFirmware/Configurations.git
STAT_FILE=./.pio/.buildall
usage() { echo "Usage:
-build_all_examples [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x)
+build_all_examples [-a|--archive] - Copy the binary to the export location
[-B|--base] - Base path of configurations, overriding -b
+ [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x)
[-c|--continue] - Continue the paused build
- [-p|--purge] - Purge the status file and start over
- [-s|--skip] - Continue the paused build, skipping one
- [-r|--resume=] - Start at some config in the filesystem order
+ [-d|-v|--debug] - Print extra debug output (after)
[-e|--export=N] - Set CONFIG_EXPORT and export to the export location
- [-a|--archive] - Copy the binary to the export location
- [-o|--output] - Redirect export / archiving to another location
- (By default export to origin config folders)
- [-d|--debug] - Print extra debug output (after)
- [-l|--limit=#] - Limit the number of builds in this run
- [-n|--nobuild] - Don't actually build anything
[-f|--nofail] - Don't stop on a failed build
[-h|--help] - Print usage and exit
+ [-l|--limit=#] - Limit the number of builds in this run
+ [-n|--nobuild] - Don't actually build anything
+ [-o|--output] - Redirect export / archiving to another location
+ (By default export to origin config folders)
+ [-p|--purge] - Purge the status file and start over
+ [-r|--resume=] - Start at some config in the filesystem order
+ [-s|--skip] - Continue the paused build, skipping one
"
}
@@ -52,26 +53,26 @@ unset FIRST_CONF
EXIT_USAGE=
LIMIT=1000
-while getopts 'aB:b:ce:fdhl:no:pr:sv-:' OFLAG; do
+while getopts 'aB:b:cde:fhl:no:pr:sv-:' OFLAG; do
case "${OFLAG}" in
a) ARCHIVE=1 ; bugout "Archiving" ;;
- B) OPATH=${OPTARG%/} ; bugout "Base: $OPATH" ;;
+ B) CBASE=${OPTARG%/} ; bugout "Base: $CBASE" ;;
b) BRANCH=$OPTARG ; bugout "Branch: $BRANCH" ;;
- f) NOFAIL=1 ; bugout "Continue on Fail" ;;
- r) ISRES=1 ; FIRST_CONF=$OPTARG ; bugout "Resume: $FIRST_CONF" ;;
c) CONTINUE=1 ; bugout "Continue" ;;
- s) CONTSKIP=1 ; bugout "Continue, skipping" ;;
+ d|v) DEBUG=1 ; bugout "Debug ON" ;;
e) CEXPORT=$OPTARG ; bugout "Export $CEXPORT" ;;
- o) OUTBASE="${OPTARG%/}" ; bugout "Archive to $OUTBASE" ;;
+ f) NOFAIL=1 ; bugout "Continue on Fail" ;;
h) EXIT_USAGE=1 ; break ;;
l) LIMIT=$OPTARG ; bugout "Limit to $LIMIT build(s)" ;;
- d|v) DEBUG=1 ; bugout "Debug ON" ;;
n) DRYRUN=1 ; bugout "Dry Run" ;;
+ o) OUTBASE="${OPTARG%/}" ; bugout "Archive to $OUTBASE" ;;
p) PURGE=1 ; bugout "Purge stat file" ;;
+ r) ISRES=1 ; FIRST_CONF=$OPTARG ; bugout "Resume: $FIRST_CONF" ;;
+ s) CONTSKIP=1 ; bugout "Continue, skipping" ;;
-) ONAM="${OPTARG%%=*}" ; OVAL="${OPTARG#*=}"
case "$ONAM" in
archive) ARCHIVE=1 ; bugout "Archiving" ;;
- base) OPATH=${OVAL%/} ; bugout "Base: $OPATH" ;;
+ base) CBASE=${OVAL%/} ; bugout "Base: $CBASE" ;;
branch) BRANCH=$OVAL ; bugout "Branch: $BRANCH" ;;
nofail) NOFAIL=1 ; bugout "Continue on Fail" ;;
resume) ISRES=1 ; FIRST_CONF=$OVAL ; bugout "Resume: $FIRST_CONF" ;;
@@ -131,45 +132,49 @@ else
git diff --quiet || { echo "The working copy is modified. Commit or stash changes before proceeding."; exit ; }
fi
-# Create a temporary folder inside .pio
-if [[ -n $OPATH ]]; then
- [[ -d "$OPATH" ]] || { echo "Given base -B $OPATH not found." ; exit ; }
+# Check for the given base path
+if [[ -n $CBASE ]]; then
+ CBASE="${CBASE/#\~/$HOME}"
+ [[ -d "$CBASE" ]] || { echo "Given base -B $CBASE not found." ; exit ; }
else
# Make a Configurations temporary folder if needed
- OPATH=./.pio/build-$BRANCH
- [[ -d "$OPATH" ]] || mkdir -p "$OPATH"
+ CBASE=./.pio/build-$BRANCH
+ [[ -d "$CBASE" ]] || mkdir -p "$CBASE"
# Download the specified Configurations branch if needed
- if [[ ! -e "$OPATH/README.md" ]]; then
- echo "Fetching Configurations from GitHub to $OPATH"
- git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$OPATH" || { echo "Failed to clone the configuration repository"; exit ; }
+ if [[ ! -e "$CBASE/README.md" ]]; then
+ echo "Fetching Configurations from GitHub to $CBASE"
+ git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$CBASE" || { echo "Failed to clone the configuration repository"; exit ; }
fi
fi
# Build
echo -e "=====================\nProceed with builds...\n====================="
shopt -s nullglob
-shopt -s globstar
-IFS='
-'
-CONF_TREE=$( ls -d "$OPATH"/config/examples/**/ | grep -vE ".+\.(\w+)$" )
-for CONF in $CONF_TREE ; do
+
+export PAUSE=1
+
+# Get a list of all folders that contain a file matching "Configuration*.h"
+find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Configuration_adv.h' -print0 | while IFS= read -r -d $'\0' CONF; do
+
+ # Remove the file name and slash from the end of the path
+ CONF=${CONF%/*}
# Get a config's directory name
- DIR=${CONF#$OPATH/config/examples/}
+ DIR=${CONF#$CBASE/config/examples/}
# If looking for a config, skip others
- [[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue
+ [[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && { ((DEBUG)) && echo "[SKIP] $DIR" ; continue ; }
# Once found, stop looking
unset FIRST_CONF
# If skipping, don't build the found one
[[ $SKIP_CONF ]] && { unset SKIP_CONF ; continue ; }
- # At least one config file is required here
- compgen -G "${CONF}Configuration*.h" > /dev/null || continue
+ # Either Configuration.h or Configuration_adv.h must exist
+ [[ -f "$CONF"/Configuration.h || -f "$CONF"/Configuration_adv.h ]] || { echo "[NONE] $DIR" ; continue ; }
# Command arguments for 'build_example'
- CARGS=("-b" "$OPATH" "-c" "$DIR")
+ CARGS=("-b" "$CBASE" "-c" "$DIR")
# Exporting? Add -e argument
((CEXPORT)) && CARGS+=("-e" "$CEXPORT")
@@ -189,16 +194,20 @@ for CONF in $CONF_TREE ; do
else
# Remember where we are in case of failure
echo "${BRANCH}*${DIR}" >"$STAT_FILE"
- ((DEBUG)) && echo "\"$HERE/build_example\" ${CARGS[@]}"
+ ((DEBUG)) && echo "build_example ${CARGS[@]}"
# Invoke build_example
- "$HERE"/build_example "${CARGS[@]}" || { echo "Failed to build $DIR" ; exit ; }
+ build_example "${CARGS[@]}" || { echo "Failed to build $DIR" ; exit ; }
fi
- ((--LIMIT)) || { echo "Limit reached" ; PAUSE=1 ; break ; }
+ echo
+ ((--LIMIT)) || { echo "Specified limit reached" ; break ; }
+ echo
- echo ; echo
+ export PAUSE=0
done
+echo "Exiting"
+
# Delete the build state if not paused early
-[[ $PAUSE ]] || rm "$STAT_FILE"
+((PAUSE)) || rm -f "$STAT_FILE"
diff --git a/firmware/buildroot/bin/build_example b/firmware/buildroot/bin/build_example
old mode 100755
new mode 100644
index 711346a..566919a
--- a/firmware/buildroot/bin/build_example
+++ b/firmware/buildroot/bin/build_example
@@ -4,7 +4,8 @@
#
# build_example -b|--base= - Configurations root folder (e.g., ./.pio/build-BRANCH)
# -c|--config= - Sub-path of the configs to build (within config/examples)
-# [-e|--export=N] - Set CONFIG_EXPORT before build and export
+# [-n|--index=N] - Which environment to build, by index (Based on pins.h comments)
+# [-e|--export=N] - Use CONFIG_EXPORT N to export the config to the export location
# [-a|--archive] - Archive the build (to the export location)
# [-o|--output] - Redirect export / archiving to another location
# (By default export to origin config folder)
@@ -19,7 +20,8 @@ usage() { echo "Usage:
build_example -b|--base= - Configurations root folder (e.g., ./.pio/build-BRANCH)
-c|--config= - Sub-path of the configs to build (within config/examples)
- [-e|--export=N] - Set CONFIG_EXPORT before build and export
+ [-n|--index=N] - Which environment to build, by index (Based on pins.h comments)
+ [-e|--export=N] - Use CONFIG_EXPORT N to export the config to the export location
[-a|--archive] - Archive the build (to the export location)
[-o|--output] - Redirect export / archiving to another location
(By default export to origin config folder)
@@ -32,10 +34,12 @@ build_example -b|--base= - Configurations root folder (e.g., ./.pio/bu
}
HERE=`dirname $0`
+PATH="$HERE:$PATH"
-source "$HERE/mfutil"
+. mfutil
annc() { echo -e "\033[0;32m$1\033[0m" ; }
+alrt() { echo -e "\033[0;31m$1\033[0m" ; }
# Get arguments
BUILD=./.pio/build
@@ -48,15 +52,18 @@ REVEAL=
EXPNUM=
NOFAIL=
OUTBASE=
-while getopts 'ab:c:e:fhio:r-:' OFLAG; do
+BUILDINDEX=1
+
+while getopts 'ab:c:e:fhn:o:r-:' OFLAG; do
case "${OFLAG}" in
a) ARCHIVE=1 ;;
b) BASE="${OPTARG%/}" ;;
c) CONFIG="${OPTARG%/}" ;;
e) EXPNUM="$OPTARG" ;;
- o) OUTBASE="${OPTARG%/}" ;;
- h) EXIT_USAGE=1 ; break ;;
f) NOFAIL=1 ;;
+ h) EXIT_USAGE=1 ; break ;;
+ n) BUILDINDEX="$OPTARG" ;;
+ o) OUTBASE="${OPTARG%/}" ;;
r) REVEAL=1 ;;
-) ONAM="${OPTARG%%=*}" ; OVAL="${OPTARG#*=}"
case "$ONAM" in
@@ -64,6 +71,7 @@ while getopts 'ab:c:e:fhio:r-:' OFLAG; do
allow) ALLOW=1 ;;
base) BASE="${OVAL%/}" ;;
config) CONFIG="${OVAL%/}" ;;
+ index) BUILDINDEX="$OVAL" ;;
export) EXPNUM="$OVAL" ;;
output) OUTBASE="${OVAL%/}" ;;
help) EXIT_USAGE=1 ; break ;;
@@ -100,7 +108,7 @@ SUB="$SUB1/$CONFIG"
[[ -d "$SUB" ]] || { echo "-c|--config $CONFIG doesn't exist" ; exit 1 ; }
# ...and contains Configuration.h or Configuration_adv.h
-[[ -n $(compgen -G "$SUB/Configuration*.h") ]] || { echo "No configuration files found in $SUB" ; exit 1 ; }
+[[ -f "$SUB"/Configuration.h || -f "$SUB"/Configuration_adv.h ]] || { echo "No configuration files found in $SUB" ; exit 1 ; }
# Get the location for exports and archives
if [[ -n $OUTBASE ]]; then
@@ -152,12 +160,12 @@ ENAME=("-name" "marlin_config.json" \
"-o" "-name" "schema.yml")
# Possible built firmware names (in the build folder)
-BNAME=("-type" "f" \
- "-name" 'firmware*.hex' \
+BNAME=("-name" "firmware*.hex" \
"-o" "-name" "firmware*.bin" \
"-o" "-name" "project*.bin" \
"-o" "-name" "Robin*.bin" \
- "-o" "-name" "main_*.bin")
+ "-o" "-name" "main_*.bin" \
+ "-o" "-name" "MarlinSimulator*")
mkdir -p "$BUILD"
@@ -165,49 +173,73 @@ mkdir -p "$BUILD"
if [[ $EXPNUM ]]; then
opt_set CONFIG_EXPORT $EXPNUM
# Clean up old exports
- find "$BUILD" \( "${ENAME[@]}" \) -exec rm "{}" \;
+ find "$BUILD" -type f \( "${ENAME[@]}" \) -exec rm "{}" \;
fi
-((ARCHIVE)) && find "$BUILD" \( "${BNAME[@]}" \) -exec rm "{}" \;
+((ARCHIVE)) && find "$BUILD" -type f \( "${BNAME[@]}" \) -exec rm "{}" \;
set +e
echo "Building example $CONFIG ..."
-"$HERE/mftest" -s -a -n1 ; ERR=$?
+mftest -s -a -n$BUILDINDEX ; ERR=$?
-((ERR)) && echo "Failed" || echo "Success"
+((ERR)) && alrt "Failed ($ERR)" || annc "Success"
set -e
-# Copy exports back to the configs
-if [[ -n $EXPNUM ]]; then
- annc "Exporting $EXPNUM"
- [[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; }
- find "$BUILD" "${ENAME[@]}" -exec cp "{}" "$ARCSUB" \;
-fi
+if [[ $ERR -gt 0 ]]; then
-# Copy potential firmware files into the config folder
-# TODO: Consider firmware that needs an STM32F4_UPDATE folder.
-# Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality
-if ((ARCHIVE)); then
- annc "Archiving"
- find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c '
- ARCSUB="$1"
- shift 1
- for file in "$@"; do
- cd "$(dirname "$file")"
- base=$(basename "$file")
- tar -czf "$ARCSUB/$base.tar.gz" "$base"
- rm "$base"
+ # Error? For --nofail simply log. Otherwise return the error.
+ if [[ -n $NOFAIL ]]; then
+ date +"%F %T [FAIL] $CONFIG" >>./.pio/error-log.txt
+ else
+ exit $ERR
+ fi
+
+else
+
+ # Copy exports back to the configs
+ if [[ -n $EXPNUM ]]; then
+ annc "Exporting $EXPNUM"
+ [[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; }
+ find "$BUILD" -type f \( "${ENAME[@]}" \) -exec cp "{}" "$ARCSUB" \;
+ fi
+
+ # Copy potential firmware files into the config folder
+ # TODO: Consider firmware that needs an STM32F4_UPDATE folder.
+ # Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality
+ if ((ARCHIVE)); then
+ annc "Archiving"
+ find "$BUILD" -type f \( "${BNAME[@]}" \) -exec sh -c '
+ ARCSUB="$1" ; CONFIG="$2" ; FILE="$3" ; shift 3
+ NAME=${FILE##*/} ; SHRT=${NAME%.*} ; DIR=${FILE%/*}
+ ZIPX=
+ if [[ $CONFIG == *Simulator* ]]; then
+ case $(uname | tr '[:upper:]' '[:lower:]') in
+ darwin) SUB="macOS" ; ZIPX="-X" ;;
+ *linux) SUB="Linux" ;;
+ win*) SUB="Windows" ;;
+ msys*) SUB="Windows" ;;
+ cygwin*) SUB="Windows" ;;
+ mingw*) SUB="Windows" ;;
+ *) SUB='Unix' ;;
+ esac
+ ARCH=$(uname -m | tr '[:lower:]' '[:upper:]')
+ ARCSUB="$ARCSUB/$SUB-$ARCH"
+ fi
+ mkdir -p "$ARCSUB"
+ rm -f "$ARCSUB"/*.zip "$ARCSUB"/*.sha256.txt
+ cd "$DIR"
+ SHASUM=$(sha256sum "$NAME" | cut -d" " -f1)
+ echo "$CONFIG\n$SHASUM" > "$ARCSUB/$NAME.sha256.txt"
+ zip $ZIPX "$ARCSUB/$SHRT.zip" "$NAME" && rm "$NAME"
cd - >/dev/null
- done
- ' sh "$ARCSUB" {} +
+ ' sh "$ARCSUB" "$CONFIG" {} +
+ fi
+
+ # Reveal the configs after the build, if requested
+ ((REVEAL)) && { annc "Revealing $ARCSUB" ; open "$ARCSUB" ; }
+
fi
-# Exit with error unless --nofail is set
-[[ $ERR -gt 0 && -z $NOFAIL ]] && exit $ERR
-
-# Reveal the configs after the build, if requested
-((REVEAL)) && { annc "Revealing $ARCSUB" ; open "$ARCSUB" ; }
-
exit 0
diff --git a/firmware/buildroot/bin/ci_src_filter b/firmware/buildroot/bin/ci_src_filter
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/bin/config.py b/firmware/buildroot/bin/config.py
new file mode 100644
index 0000000..b1a67ad
--- /dev/null
+++ b/firmware/buildroot/bin/config.py
@@ -0,0 +1,96 @@
+'''
+config.py - Helper functions for config manipulation
+'''
+import re
+
+FILES = ('Marlin/Configuration.h', 'Marlin/Configuration_adv.h')
+
+def set(file_path, define_name, value):
+ '''
+ Replaces a define in a file with a new value.
+ Returns True if the define was found and replaced, False otherwise.
+ '''
+ # Read the contents of the file
+ with open(file_path, 'r') as f:
+ content = f.readlines()
+
+ modified = False
+ for i in range(len(content)):
+ # Regex to match the desired pattern
+ match = re.match(r'^(\s*)(/*)(\s*)(#define\s+{})\s+(.*)$'.format(re.escape(define_name)), content[i])
+ if match:
+ new_line = f"{match[1]}{match[3]}{match[4]} {value} // {match[5]}\n"
+ content[i] = new_line
+ modified = True
+
+ # Write the modified content back to the file only if changes were made
+ if modified:
+ with open(file_path, 'w') as f:
+ f.writelines(content)
+ return True
+
+ return False
+
+def add(file_path, define_name, value=""):
+ '''
+ Insert a define on the first blank line in a file.
+ Returns True if the define was found and replaced, False otherwise.
+ '''
+ with open(file_path, 'r') as f:
+ content = f.readlines()
+
+ # Prepend a space to the value if it's not empty
+ if value != "":
+ value = " " + value
+
+ # Find the first blank line to insert the new define
+ for i in range(len(content)):
+ if content[i].strip() == '':
+ # Insert the define at the first blank line
+ content.insert(i, f"#define {define_name}{value}\n")
+ break
+ else:
+ # If no blank line is found, append to the end
+ content.append(f"#define {define_name}{value}\n")
+
+ with open(file_path, 'w') as f:
+ f.writelines(content)
+
+def enable(file_path, define_name, enable=True):
+ '''
+ Uncomment or comment the named defines in the given file path.
+ Returns True if the define was found, False otherwise.
+ '''
+ # Read the contents of the file
+ with open(file_path, 'r') as f:
+ content = f.readlines()
+
+ # Prepare the regex
+ regex = re.compile(r'^(\s*)(/*)(\s*)(#define\s+{}\b.*?)( *//.*)?$'.format(re.escape(define_name)))
+
+ # Find the define in the file and uncomment or comment it
+ found = False
+ modified = False
+ for i in range(len(content)):
+ match = regex.match(content[i])
+ if not match: continue
+ found = True
+ if enable:
+ if match[2]:
+ modified = True
+ comment = '' if match[5] is None else ' ' + match[5]
+ content[i] = f"{match[1]}{match[3]}{match[4]}{comment}\n"
+ else:
+ if not match[2]:
+ modified = True
+ comment = '' if match[5] is None else match[5]
+ if comment.startswith(' '): comment = comment[2:]
+ content[i] = f"{match[1]}//{match[3]}{match[4]}{comment}\n"
+ break
+
+ # Write the modified content back to the file only if changes were made
+ if modified:
+ with open(file_path, 'w') as f:
+ f.writelines(content)
+
+ return found
diff --git a/firmware/buildroot/bin/format_code b/firmware/buildroot/bin/format_code
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/bin/generate_version b/firmware/buildroot/bin/generate_version
old mode 100755
new mode 100644
index 70a108b..ff85fe7
--- a/firmware/buildroot/bin/generate_version
+++ b/firmware/buildroot/bin/generate_version
@@ -19,6 +19,7 @@ VERSION="$(git -C "${DIR}" describe --tags --first-parent 2>/dev/null || true)"
STRING_DISTRIBUTION_DATE="${STRING_DISTRIBUTION_DATE:-$(date '+%Y-%m-%d %H:%M')}"
SHORT_BUILD_VERSION="${SHORT_BUILD_VERSION:-${BRANCH}}"
DETAILED_BUILD_VERSION="${DETAILED_BUILD_VERSION:-${BRANCH}-${VERSION}}"
+PROTOCOL_VERSION="1.0"
# Gets some misc options from their defaults
DEFAULT_MACHINE_UUID="${DEFAULT_MACHINE_UUID:-$(awk -F'"' \
@@ -65,68 +66,52 @@ cat > "${WRITE_FILE}" <] [-n|--num=] [-m|--make] [-y|--build=]
- mftest [-a|--autobuild]
+Usage: mftest [-a|--autobuild]
mftest [-r|--rebuild]
mftest [-s|--silent]
+ mftest [-t|--env=] [-n|--num=] [-m|--make] [-y|--build=]
mftest [-u|--autoupload] [-n|--num=]
OPTIONS
- -t --env The environment to apply / run, or the menu index number.
- -n --num The index of the test to run. (In file order.)
- -m --make Use the make / Docker method for the build.
- -y --build Skip 'Do you want to build this test?' and assume YES.
- -h --help Print this help.
-a --autobuild PIO Build using the MOTHERBOARD environment.
+ -d --default Restore to defaults before applying configs.
+ -h --help Print this help.
+ -m --make Use the make / Docker method for the build.
+ -n --num The index of the test to run. (In file order.)
+ -r --rebuild Rebuild previous PIO Build.
+ -s --silent Silence build output from PlatformIO.
+ -t --env The environment to apply / run, or the menu index number.
-u --autoupload PIO Upload using the MOTHERBOARD environment.
-v --verbose Extra output for debugging.
- -s --silent Silence build output from PlatformIO.
- -d --default Restore to defaults before applying configs.
+ -y --build Skip 'Do you want to build this test?' and assume YES.
env shortcuts: tree due esp lin lp8|lpc8 lp9|lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41
"
@@ -41,7 +42,6 @@ env shortcuts: tree due esp lin lp8|lpc8 lp9|lpc9 m128 m256|mega stm|f1 f4 f7 s6
TESTPATH=buildroot/tests
STATE_FILE="./.pio/.mftestrc"
-SED=$(which gsed sed | head -n1)
shopt -s extglob nocasematch
@@ -57,7 +57,7 @@ TESTENV='-'
CHOICE=0
DEBUG=0
-while getopts 'abdhmrsuvyn:t:-:' OFLAG; do
+while getopts 'adhmn:rst:uvy-:' OFLAG; do
case "${OFLAG}" in
a) AUTO_BUILD=1 ; bugout "Auto-Build target..." ;;
d) DL_DEFAULTS=1 ; bugout "Restore to defaults..." ;;
@@ -163,12 +163,10 @@ if ((AUTO_BUILD)); then
#
# Get the MOTHERBOARD define value from the .h file and strip off the "BOARD_" prefix
#
- ACODE='/[[:space:]]*#define[[:space:]]MOTHERBOARD[[:space:]]/ { sub(/^BOARD_/, "", $3); print $3 }'
+ ACODE='/^[[:space:]]*#define[[:space:]]MOTHERBOARD[[:space:]]/ { sub(/^BOARD_/, "", $3); print $3 }'
MB=$(awk "$ACODE" Marlin/Configuration.h 2>/dev/null)
[[ -z $MB ]] && MB=$(awk "$ACODE" Marlin/Config.h 2>/dev/null)
[[ -z $MB ]] && { echo "Error - Can't read MOTHERBOARD setting." ; exit 1 ; }
- echo "Got $MB"
- exit
BLINE=$( grep -E "define\s+BOARD_$MB\b" Marlin/src/core/boards.h )
BNUM=$( sed -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" )
BDESC=$( sed -E 's/^.+\/\/ *(.+)$/\1/' <<<"$BLINE" )
diff --git a/firmware/buildroot/bin/mfutil b/firmware/buildroot/bin/mfutil
old mode 100755
new mode 100644
index 1699dd9..e9ee57f
--- a/firmware/buildroot/bin/mfutil
+++ b/firmware/buildroot/bin/mfutil
@@ -4,11 +4,9 @@
#
# Check dependencies
-which curl 1>/dev/null 2>&1 || { echo "curl not found! Please install it."; exit ; }
-which git 1>/dev/null 2>&1 || { echo "git not found! Please install it."; exit ; }
-
-SED=$(which gsed sed | head -n1)
-[[ -z "$SED" ]] && { echo "No sed found, please install sed" ; exit 1 ; }
+which curl &>/dev/null || { echo "curl not found! Please install it."; exit 1 ; }
+which git &>/dev/null || { echo "git not found! Please install it."; exit 1 ; }
+which sed &>/dev/null || { echo "sed not found! Please install it."; exit 1 ; }
OPEN=$( which gnome-open xdg-open open | head -n1 )
diff --git a/firmware/buildroot/bin/opt_add b/firmware/buildroot/bin/opt_add
old mode 100755
new mode 100644
index 2306ebd..3abe309
--- a/firmware/buildroot/bin/opt_add
+++ b/firmware/buildroot/bin/opt_add
@@ -1,3 +1,11 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
-eval "echo '#define ${@}' | cat - Marlin/Configuration.h > temp && mv temp Marlin/Configuration.h"
+import sys, config
+
+def main():
+ args = sys.argv[1:]
+ for name in args:
+ config.add(config.FILES[0], name)
+
+if __name__ == "__main__":
+ main()
diff --git a/firmware/buildroot/bin/opt_disable b/firmware/buildroot/bin/opt_disable
old mode 100755
new mode 100644
index 0444e1b..ce0eaa4
--- a/firmware/buildroot/bin/opt_disable
+++ b/firmware/buildroot/bin/opt_disable
@@ -1,15 +1,21 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
-# exit on first failure
-set -e
+import sys, os, config
-SED=$(which gsed sed | head -n1)
+def main():
+ args = sys.argv[1:]
-for opt in "$@" ; do
- DID=0 ; FOUND=0
- for FN in Configuration Configuration_adv; do
- "${SED}" -i "/^\(\s*\)\(#define\s\+${opt}\b\s\?\)\(\s\s\)\?/{s//\1\/\/\2/;h};\${x;/./{x;q0};x;q9}" Marlin/$FN.h && DID=1
- ((DID||FOUND)) || { grep -E "^\s*//\s*#define\s+${opt}\b" Marlin/$FN.h >/dev/null && FOUND=1 ; }
- done
- ((DID||FOUND)) || (echo "ERROR: $(basename $0) Can't find ${opt}" >&2 && exit 9)
-done
+ for name in args:
+ changed = False
+
+ for file in config.FILES:
+ if os.path.exists(file):
+ if config.enable(file, name, False):
+ changed = True
+
+ if not changed:
+ print(f"ERROR: Can't find {name}")
+ exit(1)
+
+if __name__ == "__main__":
+ main()
diff --git a/firmware/buildroot/bin/opt_enable b/firmware/buildroot/bin/opt_enable
old mode 100755
new mode 100644
index f9be82c..644edb9
--- a/firmware/buildroot/bin/opt_enable
+++ b/firmware/buildroot/bin/opt_enable
@@ -1,15 +1,21 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
-# exit on first failure
-set -e
+import sys, os, config
-SED=$(which gsed sed | head -n1)
+def main():
+ args = sys.argv[1:]
-for opt in "$@" ; do
- DID=0 ; FOUND=0
- for FN in Configuration Configuration_adv; do
- "${SED}" -i "/^\(\s*\)\/\/\(\s*\)\(#define\s\+${opt}\b\)\( \?\)/{s//\1\2\3\4\4\4/;h};\${x;/./{x;q0};x;q9}" Marlin/$FN.h && DID=1
- ((DID||FOUND)) || { grep -E "^\s*#define\s+${opt}\b" Marlin/$FN.h >/dev/null && FOUND=1 ; }
- done
- ((DID||FOUND)) || (echo "ERROR: $(basename $0) Can't find ${opt}" >&2 && exit 9)
-done
+ for name in args:
+ changed = False
+
+ for file in config.FILES:
+ if os.path.exists(file):
+ if config.enable(file, name):
+ changed = True
+
+ if not changed:
+ print(f"ERROR: Can't find {name}")
+ exit(1)
+
+if __name__ == "__main__":
+ main()
diff --git a/firmware/buildroot/bin/opt_find b/firmware/buildroot/bin/opt_find
old mode 100755
new mode 100644
index a7c8fd9..bab9da0
--- a/firmware/buildroot/bin/opt_find
+++ b/firmware/buildroot/bin/opt_find
@@ -23,8 +23,8 @@ esac
while [[ $# > 0 ]]; do
DID=0
- for FN in Configuration Configuration_adv; do
- FOUND=$( grep -HEn "^\s*${COMM}#define\s+[A-Z0-9_]*${1}" "Marlin/$FN.h" 2>/dev/null )
+ for FN in Marlin/Configuration.h Marlin/Configuration_adv.h; do
+ FOUND=$( grep -HEn "^\s*${COMM}#define\s+[A-Z0-9_]*${1}" $FN 2>/dev/null )
[[ -n "$FOUND" ]] && { echo "$FOUND" ; DID=1 ; }
done
((DID)) || { echo "ERROR: ${MYNAME} - No ${TYPE}match for ${1}" ; exit 9; }
diff --git a/firmware/buildroot/bin/opt_set b/firmware/buildroot/bin/opt_set
old mode 100755
new mode 100644
index b993551..cf8bbb9
--- a/firmware/buildroot/bin/opt_set
+++ b/firmware/buildroot/bin/opt_set
@@ -1,17 +1,25 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python
-# exit on first failure
-set -e
+import sys, os, config
-SED=$(which gsed sed | head -n1)
+def main():
+ args = sys.argv[1:]
+ if len(args) % 2 != 0:
+ print("ERROR: Please provide pairs of ")
+ return
-while [[ $# > 1 ]]; do
- DID=0
- for FN in Configuration Configuration_adv; do
- "${SED}" -i "/^\(\s*\)\/*\s*\(#define\s\+${1}\b\) *\(.*\)$/{s//\1\2 ${2} \/\/ \3/;h};\${x;/./{x;q0};x;q9}" Marlin/$FN.h && DID=1
- done
- ((DID)) ||
- eval "echo '#define ${1} ${2}' >>Marlin/Configuration.h" ||
- (echo "ERROR: opt_set Can't set or add ${1}" >&2 && exit 9)
- shift 2
-done
+ for i in range(0, len(args), 2):
+ name = args[i]
+ value = args[i + 1]
+ changed = False
+
+ for file in config.FILES:
+ if os.path.exists(file):
+ if config.set(file, name, value):
+ changed = True
+
+ if not changed:
+ config.add(config.FILES[0], name, value)
+
+if __name__ == "__main__":
+ main()
diff --git a/firmware/buildroot/bin/pins_set b/firmware/buildroot/bin/pins_set
deleted file mode 100755
index 216eabc..0000000
--- a/firmware/buildroot/bin/pins_set
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-
-IFS='/' read -r -a PINPATH <<< "$1"
-DIR=${PINPATH[0]}
-NAM=${PINPATH[1]}
-
-SED=$(which gsed sed | head -n1)
-
-shift
-while [[ $# > 1 ]]; do
- PIN=$1 ; VAL=$2
- FOUT="${DIR}/pins_${NAM}.h"
- eval "${SED} -i '/^[[:blank:]]*\(\/\/\)*[[:blank:]]*\(#define \+${PIN}\b\).*$/{s//\2 ${VAL}/;h};\${x;/./{x;q0};x;q9}' Marlin/src/pins/${FOUT}" ||
- (echo "ERROR: pins_set Can't find ${PIN} in ${FOUT}" >&2 && exit 9)
- shift 2
-done
diff --git a/firmware/buildroot/bin/restore_configs b/firmware/buildroot/bin/restore_configs
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/bin/run_tests b/firmware/buildroot/bin/run_tests
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/bin/uncrust b/firmware/buildroot/bin/uncrust
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/bin/use_example_configs b/firmware/buildroot/bin/use_example_configs
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/boards/marlin_MKS_TinyBee.json b/firmware/buildroot/share/PlatformIO/boards/marlin_MKS_TinyBee.json
new file mode 100644
index 0000000..719337f
--- /dev/null
+++ b/firmware/buildroot/share/PlatformIO/boards/marlin_MKS_TinyBee.json
@@ -0,0 +1,38 @@
+{
+ "build": {
+ "arduino":{
+ "ldscript": "esp32_out.ld"
+ },
+ "core": "esp32",
+ "extra_flags": "-DARDUINO_ESP32_DEV",
+ "f_cpu": "240000000L",
+ "f_flash": "40000000L",
+ "flash_mode": "dio",
+ "mcu": "esp32",
+ "variant": "esp32"
+ },
+ "connectivity": [
+ "wifi",
+ "bluetooth",
+ "ethernet",
+ "can"
+ ],
+ "debug": {
+ "openocd_board": "esp-wroom-32.cfg"
+ },
+ "frameworks": [
+ "arduino",
+ "espidf"
+ ],
+ "name": "MKS TinyBee V1.0",
+ "upload": {
+ "flash_size": "8MB",
+ "maximum_ram_size": 524288,
+ "maximum_size": 8388608,
+ "require_upload_port": true,
+ "speed": 460800,
+ "offset_address": 65536
+ },
+ "url": "https://github.com/makerbase-mks/MKS-TinyBee",
+ "vendor": "MKS Makerbase"
+}
diff --git a/firmware/buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RE.json b/firmware/buildroot/share/PlatformIO/boards/marlin_STM32F401RE_creality.json
similarity index 96%
rename from firmware/buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RE.json
rename to firmware/buildroot/share/PlatformIO/boards/marlin_STM32F401RE_creality.json
index 31739c3..031d804 100644
--- a/firmware/buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RE.json
+++ b/firmware/buildroot/share/PlatformIO/boards/marlin_STM32F401RE_creality.json
@@ -16,7 +16,7 @@
],
"ldscript": "ldscript.ld",
"mcu": "stm32f401ret6",
- "variant": "MARLIN_CREALITY_STM32F401RE"
+ "variant": "MARLIN_F401RE_CREALITY"
},
"debug": {
"jlink_device": "STM32F401RE",
diff --git a/firmware/buildroot/share/PlatformIO/boards/marlin_STM32F401RE_freeruns.json b/firmware/buildroot/share/PlatformIO/boards/marlin_STM32F401RE_freeruns.json
index 3a8848e..96f06b3 100644
--- a/firmware/buildroot/share/PlatformIO/boards/marlin_STM32F401RE_freeruns.json
+++ b/firmware/buildroot/share/PlatformIO/boards/marlin_STM32F401RE_freeruns.json
@@ -16,7 +16,7 @@
],
"ldscript": "ldscript.ld",
"mcu": "stm32f401ret6",
- "variant": "MARLIN_STM32F401RE_FREERUNS"
+ "variant": "MARLIN_F401RE_FREERUNS"
},
"debug": {
"jlink_device": "STM32F401RE",
diff --git a/firmware/buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld b/firmware/buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld b/firmware/buildroot/share/PlatformIO/ldscripts/mks_robin_nano.ld
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py b/firmware/buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py b/firmware/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
index 1ded5b4..6fa53ef 100644
--- a/firmware/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
+++ b/firmware/buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
@@ -3,28 +3,41 @@
#
import pioutil
if pioutil.is_pio_build():
- import shutil, marlin
from pathlib import Path
- env = pioutil.env
- platform = env.PioPlatform()
- board = env.BoardConfig()
- FRAMEWORK_DIR = Path(platform.get_package_dir("framework-arduinoststm32-maple"))
- assert FRAMEWORK_DIR.is_dir()
-
- source_root = Path("buildroot/share/PlatformIO/variants")
+ source_root_str = "buildroot/share/PlatformIO/variants"
+ source_root = Path(source_root_str)
assert source_root.is_dir()
+ env = pioutil.env
+ board = env.BoardConfig()
variant = board.get("build.variant")
- variant_dir = FRAMEWORK_DIR / "STM32F1/variants" / variant
source_dir = source_root / variant
assert source_dir.is_dir()
- if variant_dir.is_dir():
- shutil.rmtree(variant_dir)
+ if True:
+ # Copying to the platform folder is still needed by STM32F1 (Maple).
+ # The alternative code below comes close. See if you can solve it!
+ platform = env.PioPlatform()
+ FRAMEWORK_DIR = Path(platform.get_package_dir("framework-arduinoststm32-maple"))
+ assert FRAMEWORK_DIR.is_dir()
- if not variant_dir.is_dir():
- variant_dir.mkdir()
+ variant_dir = FRAMEWORK_DIR / "STM32F1/variants" / variant
- marlin.copytree(source_dir, variant_dir)
+ if variant_dir.is_dir():
+ import shutil
+ shutil.rmtree(variant_dir)
+
+ if not variant_dir.is_dir():
+ variant_dir.mkdir()
+
+ import marlin
+ marlin.copytree(source_dir, variant_dir)
+
+ else:
+
+ # The following almost works, but __start__ (from wirish/start.S) is not seen by common.inc
+ board.update("build.variants_dir", source_root_str);
+ src = str(source_dir)
+ env.Append(BUILD_FLAGS=[f"-I{src}", f"-L{src}/ld"]) # Add include path for variant
diff --git a/firmware/buildroot/share/PlatformIO/scripts/chitu_crypt.py b/firmware/buildroot/share/PlatformIO/scripts/chitu_crypt.py
index 71b1153..7c94ef0 100644
--- a/firmware/buildroot/share/PlatformIO/scripts/chitu_crypt.py
+++ b/firmware/buildroot/share/PlatformIO/scripts/chitu_crypt.py
@@ -34,7 +34,7 @@ if pioutil.is_pio_build():
for loop_counter in range(0, block_size):
# meant to make sure different bits of the key are used.
- xor_seed = int(loop_counter / key_length)
+ xor_seed = loop_counter // key_length
# IP is a scratch register / R12
ip = loop_counter - (key_length * xor_seed)
@@ -83,7 +83,7 @@ if pioutil.is_pio_build():
output_file.write(struct.pack(")', build_filters)
- for d in my_srcs:
- # Assume normalized relative paths
- plain = d[2:-1]
- if d[0] == '+':
- def addentry(fullpath, info=None):
- relp = os.path.relpath(fullpath, marlinbasedir)
- if srcfilepattern.match(relp):
- if info:
- blab("Added src file %s (%s)" % (relp, str(info)), 3)
- else:
- blab("Added src file %s " % relp, 3)
- cur_srcs.add(relp)
- # Special rule: If a direct folder is specified add all files within.
- fullplain = os.path.join(marlinbasedir, plain)
- if os.path.isdir(fullplain):
- blab("Directory content addition for %s " % plain, 3)
- gpattern = os.path.join(fullplain, "**")
- for fname in glob.glob(gpattern, recursive=True):
- addentry(fname, "dca")
- else:
- # Add all the things from the pattern by GLOB.
- def srepl(matchi):
- g0 = matchi.group(0)
- return r"**" + g0[1:]
- gpattern = re.sub(r'[*]($|[^*])', srepl, plain)
- gpattern = os.path.join(marlinbasedir, gpattern)
- for fname in glob.glob(gpattern, recursive=True):
- addentry(fname)
- else:
- # Special rule: If a direct folder is specified then remove all files within.
- def onremove(relp, info=None):
+ # Build the actual equivalent build_src_filter list based on the inclusions by the features.
+ # PlatformIO doesn't do it this way, but maybe in the future....
+ cur_srcs = set()
+ # Remove the references to the same folder
+ my_srcs = re.findall(r'([+-]<.*?>)', build_filters)
+ for d in my_srcs:
+ # Assume normalized relative paths
+ plain = d[2:-1]
+ if d[0] == '+':
+ def addentry(fullpath, info=None):
+ relp = os.path.relpath(fullpath, marlinbasedir)
+ if srcfilepattern.match(relp):
if info:
- blab("Removed src file %s (%s)" % (relp, str(info)), 3)
+ blab("Added src file %s (%s)" % (relp, str(info)), 3)
else:
- blab("Removed src file %s " % relp, 3)
- fullplain = os.path.join(marlinbasedir, plain)
- if os.path.isdir(fullplain):
- blab("Directory content removal for %s " % plain, 2)
- def filt(x):
- common = os.path.commonpath([plain, x])
- if not common == os.path.normpath(plain): return True
- onremove(x, "dcr")
- return False
- cur_srcs = set(filter(filt, cur_srcs))
- else:
- # Remove matching source entries.
- def filt(x):
- if not fnmatch.fnmatch(x, plain): return True
- onremove(x)
- return False
- cur_srcs = set(filter(filt, cur_srcs))
- # Transform the resulting set into a string.
- for x in cur_srcs:
- if build_src_filter != "": build_src_filter += ' '
- build_src_filter += "+<" + x + ">"
+ blab("Added src file %s " % relp, 3)
+ cur_srcs.add(relp)
+ # Special rule: If a direct folder is specified add all files within.
+ fullplain = os.path.join(marlinbasedir, plain)
+ if os.path.isdir(fullplain):
+ blab("Directory content addition for %s " % plain, 3)
+ gpattern = os.path.join(fullplain, "**")
+ for fname in glob.glob(gpattern, recursive=True):
+ addentry(fname, "dca")
+ else:
+ # Add all the things from the pattern by GLOB.
+ def srepl(matchi):
+ g0 = matchi.group(0)
+ return r"**" + g0[1:]
+ gpattern = re.sub(r'[*]($|[^*])', srepl, plain)
+ gpattern = os.path.join(marlinbasedir, gpattern)
- #blab("Final build_src_filter: " + build_src_filter, 3)
- else:
- build_src_filter = build_filters
+ for fname in glob.glob(gpattern, recursive=True):
+ addentry(fname)
+ else:
+ # Special rule: If a direct folder is specified then remove all files within.
+ def onremove(relp, info=None):
+ if info:
+ blab("Removed src file %s (%s)" % (relp, str(info)), 3)
+ else:
+ blab("Removed src file %s " % relp, 3)
+ fullplain = os.path.join(marlinbasedir, plain)
+ if os.path.isdir(fullplain):
+ blab("Directory content removal for %s " % plain, 2)
+ def filt(x):
+ common = os.path.commonpath([plain, x])
+ if not common == os.path.normpath(plain): return True
+ onremove(x, "dcr")
+ return False
+ cur_srcs = set(filter(filt, cur_srcs))
+ else:
+ # Remove matching source entries.
+ def filt(x):
+ if not fnmatch.fnmatch(x, plain): return True
+ onremove(x)
+ return False
+ cur_srcs = set(filter(filt, cur_srcs))
+ # Transform the resulting set into a string.
+ for x in cur_srcs:
+ if build_src_filter != "": build_src_filter += ' '
+ build_src_filter += "+<" + x + ">"
# Update in PlatformIO
set_env_field('build_src_filter', [build_src_filter])
env.Replace(SRC_FILTER=build_src_filter)
+ #blab("Final build_src_filter: " + build_src_filter, 3)
+
#
# Use the compiler to get a list of all enabled features
#
diff --git a/firmware/buildroot/share/PlatformIO/scripts/configuration.py b/firmware/buildroot/share/PlatformIO/scripts/configuration.py
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/scripts/generic_create_variant.py b/firmware/buildroot/share/PlatformIO/scripts/generic_create_variant.py
index db7f2e8..d03e0ba 100644
--- a/firmware/buildroot/share/PlatformIO/scripts/generic_create_variant.py
+++ b/firmware/buildroot/share/PlatformIO/scripts/generic_create_variant.py
@@ -6,6 +6,7 @@
# will be picked up by PlatformIO just like any other variant.
#
import pioutil, re
+
marlin_variant_pattern = re.compile("marlin_.*")
if pioutil.is_pio_build():
import shutil, marlin
@@ -40,26 +41,19 @@ if pioutil.is_pio_build():
FRAMEWORK_DIR = Path(platform.get_package_dir(platform_name))
assert FRAMEWORK_DIR.is_dir()
+ #
+ # Point variants_dir to our variant folder when board_build.variant
+ # is provided and the variant name begins with "marlin_".
+ #
board = env.BoardConfig()
-
- #mcu_type = board.get("build.mcu")[:-2]
variant = board.get("build.variant")
+ #mcu_type = board.get("build.mcu")[:-2]
#series = mcu_type[:7].upper() + "xx"
- # Only prepare a new variant if the PlatformIO configuration provides it (board_build.variant).
- # This check is important to avoid deleting official board config variants.
+ # Make sure the local variant sub-folder exists
if marlin_variant_pattern.match(str(variant).lower()):
- # Prepare a new empty folder at the destination
- variant_dir = FRAMEWORK_DIR / "variants" / variant
- if variant_dir.is_dir():
- shutil.rmtree(variant_dir)
- if not variant_dir.is_dir():
- variant_dir.mkdir()
-
- # Source dir is a local variant sub-folder
- source_dir = Path("buildroot/share/PlatformIO/variants", variant)
+ here = Path.cwd()
+ variants_dir = here / 'buildroot' / 'share' / 'PlatformIO' / 'variants'
+ source_dir = variants_dir / variant
assert source_dir.is_dir()
-
- print("Copying variant " + str(variant) + " to framework directory...")
-
- marlin.copytree(source_dir, variant_dir)
+ board.update("build.variants_dir", str(variants_dir))
diff --git a/firmware/buildroot/share/PlatformIO/scripts/mc-apply.py b/firmware/buildroot/share/PlatformIO/scripts/mc-apply.py
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/scripts/offset_and_rename.py b/firmware/buildroot/share/PlatformIO/scripts/offset_and_rename.py
index 3535186..c7bb002 100644
--- a/firmware/buildroot/share/PlatformIO/scripts/offset_and_rename.py
+++ b/firmware/buildroot/share/PlatformIO/scripts/offset_and_rename.py
@@ -24,7 +24,7 @@ if pioutil.is_pio_build():
marlin.relocate_vtab(LD_FLASH_OFFSET)
# Flash size
- maximum_flash_size = int(board.get("upload.maximum_size") / 1024)
+ maximum_flash_size = board.get("upload.maximum_size") // 1024
marlin.replace_define('STM32_FLASH_SIZE', maximum_flash_size)
# Get upload.maximum_ram_size (defined by /buildroot/share/PlatformIO/boards/VARIOUS.json)
diff --git a/firmware/buildroot/share/PlatformIO/scripts/preprocessor.py b/firmware/buildroot/share/PlatformIO/scripts/preprocessor.py
index b0fec52..bda00df 100644
--- a/firmware/buildroot/share/PlatformIO/scripts/preprocessor.py
+++ b/firmware/buildroot/share/PlatformIO/scripts/preprocessor.py
@@ -53,12 +53,14 @@ def run_preprocessor(env, fn=None):
# Find a compiler, considering the OS
#
def search_compiler(env):
+ global nocache
from pathlib import Path, PurePath
ENV_BUILD_PATH = Path(env['PROJECT_BUILD_DIR'], env['PIOENV'])
GCC_PATH_CACHE = ENV_BUILD_PATH / ".gcc_path"
+ gccpath = None
try:
gccpath = env.GetProjectOption('custom_gcc')
blab("Getting compiler from env")
@@ -71,24 +73,40 @@ def search_compiler(env):
blab("Getting g++ path from cache")
return GCC_PATH_CACHE.read_text()
- # Use any item in $PATH corresponding to a platformio toolchain bin folder
path_separator = ':'
gcc_exe = '*g++'
if env['PLATFORM'] == 'win32':
path_separator = ';'
gcc_exe += ".exe"
+ envpath = map(Path, env['ENV']['PATH'].split(path_separator))
+
# Search for the compiler in PATH
- for ppath in map(Path, env['ENV']['PATH'].split(path_separator)):
+ for ppath in envpath:
+ # Use any item in $PATH corresponding to a platformio toolchain bin folder
if ppath.match(env['PROJECT_PACKAGES_DIR'] + "/**/bin"):
for gpath in ppath.glob(gcc_exe):
- gccpath = str(gpath.resolve())
- # Cache the g++ path to no search always
- if not nocache and ENV_BUILD_PATH.exists():
- blab("Caching g++ for current env")
- GCC_PATH_CACHE.write_text(gccpath)
- return gccpath
+ # Skip '*-elf-g++' (crosstool-NG) except for xtensa32
+ if not gpath.stem.endswith('-elf-g++') or "xtensa32" in str(gpath):
+ gccpath = str(gpath.resolve())
+ break
+
+ if not gccpath:
+ for ppath in envpath:
+ for gpath in ppath.glob(gcc_exe):
+ # Skip macOS Clang
+ if not (gpath == 'usr/bin/g++' and env['PLATFORM'] == 'darwin'):
+ gccpath = str(gpath.resolve())
+ break
+
+ if not gccpath:
+ gccpath = env.get('CXX')
+ blab("Couldn't find a compiler! Fallback to '%s'" % gccpath)
+ nocache = 1
+
+ # Cache the g++ path to speed up the next build
+ if not nocache and gccpath and ENV_BUILD_PATH.exists():
+ blab("Caching g++ for current env")
+ GCC_PATH_CACHE.write_text(gccpath)
- gccpath = env.get('CXX')
- blab("Couldn't find a compiler! Fallback to %s" % gccpath)
return gccpath
diff --git a/firmware/buildroot/share/PlatformIO/scripts/schema.py b/firmware/buildroot/share/PlatformIO/scripts/schema.py
old mode 100755
new mode 100644
index 381a786..d5179d4
--- a/firmware/buildroot/share/PlatformIO/scripts/schema.py
+++ b/firmware/buildroot/share/PlatformIO/scripts/schema.py
@@ -11,7 +11,7 @@
# been extended to evaluate conditions and can determine what options are actually enabled, not just which
# options are uncommented. That will be migrated to this script for standalone migration.
#
-import re,json
+import re, json
from pathlib import Path
def extend_dict(d:dict, k:tuple):
@@ -120,15 +120,13 @@ def extract_files(filekey):
defgrep = re.compile(r'^(//)?\s*(#define)\s+([A-Za-z0-9_]+)\s*(.*?)\s*(//.+)?$')
# Pattern to match a float value
flt = r'[-+]?\s*(\d+\.|\d*\.\d+)([eE][-+]?\d+)?[fF]?'
- # Defines to ignore
- ignore = ('CONFIGURATION_H_VERSION', 'CONFIGURATION_ADV_H_VERSION', 'CONFIG_EXAMPLES_DIR', 'CONFIG_EXPORT')
# Start with unknown state
state = Parse.NORMAL
# Serial ID
sid = 0
# Loop through files and parse them line by line
for fn, fk in filekey.items():
- with Path("Marlin", fn).open() as fileobj:
+ with Path("Marlin", fn).open(encoding='utf-8') as fileobj:
section = 'none' # Current Settings section
line_number = 0 # Counter for the line number of the file
conditions = [] # Create a condition stack for the current file
@@ -138,7 +136,7 @@ def extract_files(filekey):
eol_options = False # The options came from end of line, so only apply once
join_line = False # A flag that the line should be joined with the previous one
line = '' # A line buffer to handle \ continuation
- last_added_ref = None # Reference to the last added item
+ last_added_ref = {} # Reference to the last added item
# Loop through the lines in the file
for the_line in fileobj.readlines():
line_number += 1
@@ -220,7 +218,6 @@ def extract_files(filekey):
# Temperature sensors are done
if state == Parse.GET_SENSORS:
options_json = f'[ {options_json[:-2]} ]'
-
state = Parse.NORMAL
# Strip the leading '* ' from block comments
@@ -230,7 +227,7 @@ def extract_files(filekey):
if state == Parse.GET_SENSORS:
sens = re.match(r'^(-?\d+)\s*:\s*(.+)$', cline)
if sens:
- s2 = sens[2].replace("'","''")
+ s2 = sens[2].replace("'", "''")
options_json += f"{sens[1]}:'{sens[1]} - {s2}', "
elif state == Parse.BLOCK_COMMENT:
@@ -255,12 +252,11 @@ def extract_files(filekey):
comment_buff = []
state = Parse.BLOCK_COMMENT
eol_options = False
-
elif cpos2 != -1 and (cpos2 < cpos1 or cpos1 == -1):
cpos = cpos2
# Comment after a define may be continued on the following lines
- if defmatch != None and cpos > 10:
+ if defmatch is not None and cpos > 10:
state = Parse.EOL_COMMENT
prev_comment = '\n'.join(comment_buff)
comment_buff = []
@@ -327,10 +323,10 @@ def extract_files(filekey):
conditions.append([ f'!defined({line[7:].strip()})' ])
# Handle a complete #define line
- elif defmatch != None:
+ elif defmatch is not None:
# Get the match groups into vars
- enabled, define_name, val = defmatch[1] == None, defmatch[3], defmatch[4]
+ enabled, define_name, val = defmatch[1] is None, defmatch[3], defmatch[4]
# Increment the serial ID
sid += 1
@@ -347,14 +343,14 @@ def extract_files(filekey):
# Type is based on the value
value_type = \
'switch' if val == '' \
- else 'bool' if re.match(r'^(true|false)$', val) \
else 'int' if re.match(r'^[-+]?\s*\d+$', val) \
else 'ints' if re.match(r'^([-+]?\s*\d+)(\s*,\s*[-+]?\s*\d+)+$', val) \
else 'floats' if re.match(rf'({flt}(\s*,\s*{flt})+)', val) \
else 'float' if re.match(f'^({flt})$', val) \
else 'string' if val[0] == '"' \
else 'char' if val[0] == "'" \
- else 'state' if re.match(r'^(LOW|HIGH)$', val) \
+ else 'bool' if val in ('true', 'false') \
+ else 'state' if val in ('HIGH', 'LOW') \
else 'enum' if re.match(r'^[A-Za-z0-9_]{3,}$', val) \
else 'int[]' if re.match(r'^{\s*[-+]?\s*\d+(\s*,\s*[-+]?\s*\d+)*\s*}$', val) \
else 'float[]' if re.match(r'^{{\s*{flt}(\s*,\s*{flt})*\s*}}$', val) \
@@ -375,7 +371,7 @@ def extract_files(filekey):
# If the comment_buff is not empty, add the comment to the info
if comment_buff:
- full_comment = '\n'.join(comment_buff)
+ full_comment = '\n'.join(comment_buff).strip()
# An EOL comment will be added later
# The handling could go here instead of above
@@ -389,9 +385,17 @@ def extract_files(filekey):
units = re.match(r'^\(([^)]+)\)', full_comment)
if units:
units = units[1]
- if units == 's' or units == 'sec': units = 'seconds'
+ if units in ('s', 'sec'): units = 'seconds'
define_info['units'] = units
+ if 'comment' not in define_info or define_info['comment'] == '':
+ if prev_comment:
+ define_info['comment'] = prev_comment
+ prev_comment = ''
+
+ if 'comment' in define_info and define_info['comment'] == '':
+ del define_info['comment']
+
# Set the options for the current #define
if define_name == "MOTHERBOARD" and boards != '':
define_info['options'] = boards
@@ -424,12 +428,12 @@ def extract():
return extract_files({ 'Configuration.h':'basic', 'Configuration_adv.h':'advanced' })
def dump_json(schema:dict, jpath:Path):
- with jpath.open('w') as jfile:
+ with jpath.open('w', encoding='utf-8') as jfile:
json.dump(schema, jfile, ensure_ascii=False, indent=2)
def dump_yaml(schema:dict, ypath:Path):
import yaml
- with ypath.open('w') as yfile:
+ with ypath.open('w', encoding='utf-8') as yfile:
yaml.dump(schema, yfile, default_flow_style=False, width=120, indent=2)
def main():
diff --git a/firmware/buildroot/share/PlatformIO/scripts/signature.py b/firmware/buildroot/share/PlatformIO/scripts/signature.py
old mode 100755
new mode 100644
index 046f02d..6ae3793
--- a/firmware/buildroot/share/PlatformIO/scripts/signature.py
+++ b/firmware/buildroot/share/PlatformIO/scripts/signature.py
@@ -2,9 +2,7 @@
#
# signature.py
#
-import schema
-
-import subprocess,re,json,hashlib
+import schema, subprocess, re, json, hashlib
from datetime import datetime
from pathlib import Path
from functools import reduce
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/hal_conf_custom.h
index bbce8a1..b6b95a6 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/hal_conf_custom.h
@@ -31,57 +31,153 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-/* #define HAL_CRC_MODULE_ENABLED */
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-//#define HAL_DAC_MODULE_ENABLED
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-/* #define HAL_SRAM_MODULE_ENABLED */
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-/* #define HAL_RTC_MODULE_ENABLED */
-/* #define HAL_SAI_MODULE_ENABLED */
-/* #define HAL_SD_MODULE_ENABLED */
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-/* #define HAL_UART_MODULE_ENABLED */
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-#ifndef HAL_PCD_MODULE_ENABLED
- #define HAL_PCD_MODULE_ENABLED //Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ //#define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ #define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
#endif
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/hal_conf_extra.h
index ef621d5..51782da 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/hal_conf_extra.h
@@ -1,52 +1,150 @@
#pragma once
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_FLASH_MODULE_ENABLED
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ //#define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/hal_conf_extra.h
index b4eb0f9..7bfa39c 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/hal_conf_extra.h
@@ -1,22 +1,56 @@
#pragma once
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
-#define HAL_SD_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
#undef HAL_DAC_MODULE_ENABLED
#undef HAL_FLASH_MODULE_ENABLED
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_EBB42_V1_1/variant_MARLIN_BTT_EBB42_V1_1.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_EBB42_V1_1/variant_MARLIN_BTT_EBB42_V1_1.h
index 9373e2f..170f893 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_EBB42_V1_1/variant_MARLIN_BTT_EBB42_V1_1.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_EBB42_V1_1/variant_MARLIN_BTT_EBB42_V1_1.h
@@ -167,7 +167,7 @@
#endif
// Extra HAL modules
-#if !defined(HAL_DAC_MODULE_DISABLED)
+#ifndef HAL_DAC_MODULE_DISABLED
#define HAL_DAC_MODULE_ENABLED
#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/hal_conf_extra.h
index ef621d5..51782da 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/hal_conf_extra.h
@@ -1,52 +1,150 @@
#pragma once
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_FLASH_MODULE_ENABLED
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ //#define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/hal_conf_extra.h
index d62c510..8325aba 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/hal_conf_extra.h
@@ -1,22 +1,56 @@
#pragma once
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
-#define HAL_SD_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
//#undef HAL_SD_MODULE_ENABLED
#undef HAL_DAC_MODULE_ENABLED
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/hal_conf_extra.h
index d62c510..8325aba 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/hal_conf_extra.h
@@ -1,22 +1,56 @@
#pragma once
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
-#define HAL_SD_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
//#undef HAL_SD_MODULE_ENABLED
#undef HAL_DAC_MODULE_ENABLED
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/hal_conf_extra.h
index ef621d5..51782da 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/hal_conf_extra.h
@@ -1,52 +1,150 @@
#pragma once
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_FLASH_MODULE_ENABLED
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ //#define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h
index f355549..1519ca3 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h
@@ -37,61 +37,171 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CEC_MODULE_ENABLED
-#define HAL_COMP_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_CRYP_MODULE_ENABLED
-#define HAL_DAC_MODULE_ENABLED
-#define HAL_DCMI_MODULE_ENABLED
-#define HAL_DFSDM_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_DMA2D_MODULE_ENABLED
-#define HAL_DSI_MODULE_ENABLED
-#define HAL_ETH_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_FDCAN_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_HASH_MODULE_ENABLED
-#define HAL_HCD_MODULE_ENABLED
-#define HAL_HRTIM_MODULE_ENABLED
-#define HAL_HSEM_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_I2S_MODULE_ENABLED
-#define HAL_IRDA_MODULE_ENABLED
-#define HAL_IWDG_MODULE_ENABLED
-#define HAL_JPEG_MODULE_ENABLED
-#define HAL_LPTIM_MODULE_ENABLED
-#define HAL_LTDC_MODULE_ENABLED
-#define HAL_MDIOS_MODULE_ENABLED
-#define HAL_MDMA_MODULE_ENABLED
-#define HAL_MMC_MODULE_ENABLED
-#define HAL_NAND_MODULE_ENABLED
-#define HAL_NOR_MODULE_ENABLED
-#define HAL_OPAMP_MODULE_ENABLED
-#define HAL_PCD_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_QSPI_MODULE_ENABLED
-#define HAL_RAMECC_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_RNG_MODULE_ENABLED
-#define HAL_RTC_MODULE_ENABLED
-#define HAL_SAI_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
-#define HAL_SDRAM_MODULE_ENABLED
-#define HAL_SMARTCARD_MODULE_ENABLED
-#define HAL_SMBUS_MODULE_ENABLED
-#define HAL_SPDIFRX_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_SRAM_MODULE_ENABLED
-#define HAL_SWPMI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_UART_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_WWDG_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ #define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_COMP_MODULE_ENABLED
+ #define HAL_COMP_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ #define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ #define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ #define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ #define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ #define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ #define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_FDCAN_MODULE_ENABLED
+ #define HAL_FDCAN_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ #define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ #define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_HRTIM_MODULE_ENABLED
+ #define HAL_HRTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_HSEM_MODULE_ENABLED
+ #define HAL_HSEM_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ #define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ #define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ #define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_JPEG_MODULE_ENABLED
+ #define HAL_JPEG_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ #define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ #define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_MDIOS_MODULE_ENABLED
+ #define HAL_MDIOS_MODULE_ENABLED
+#endif
+#ifndef HAL_MDMA_MODULE_ENABLED
+ #define HAL_MDMA_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ #define HAL_MMC_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ #define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ #define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_OPAMP_MODULE_ENABLED
+ #define HAL_OPAMP_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ #define HAL_PCD_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ #define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RAMECC_MODULE_ENABLED
+ #define HAL_RAMECC_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ #define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ #define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ #define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ #define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ #define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ #define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ #define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SWPMI_MODULE_ENABLED
+ #define HAL_SWPMI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ #define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ #define HAL_WWDG_MODULE_ENABLED
+#endif
#endif
/* ########################## Oscillator Values adaptation ####################*/
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h
index f03ba32..1d15d32 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h
@@ -188,9 +188,15 @@ extern "C" {
// #define USE_USB_FS
/* Extra HAL modules */
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
#ifdef __cplusplus
} // extern "C"
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h
index 7452020..d3e9e08 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h
@@ -142,7 +142,9 @@ extern "C" {
// Extra HAL modules
#if defined(STM32F103xE) || defined(STM32F103xG)
-#define HAL_DAC_MODULE_ENABLED
+ #ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+ #endif
#endif
#ifdef __cplusplus
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h
index b684a09..f674c0d 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h
@@ -30,8 +30,12 @@ extern "C" {
#undef HAL_HCD_MODULE_ENABLED // USB Host
#endif
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ #define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG
+#endif
#undef HAL_PWR_MODULE_ENABLED
#define HAL_PWR_MODULE_ONLY // disable low power & PA0 wakeup pin (its T°c pin)
@@ -44,39 +48,105 @@ extern "C" {
/**
* @brief List of modules in the framework (first ones enabled by default)
*/
-//#define HAL_MODULE_ENABLED
-//#define HAL_ADC_MODULE_ENABLED
-//#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_DMA_MODULE_ENABLED
-//#define HAL_FLASH_MODULE_ENABLED
-//#define HAL_GPIO_MODULE_ENABLED
-//#define HAL_I2C_MODULE_ENABLED
-//#define HAL_PCD_MODULE_ENABLED
-//#define HAL_PWR_MODULE_ENABLED
-//#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_SPI_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_TIM_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRC_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_USART_MODULE_ENABLED // Useless.... UART_MODULE does it
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ //#define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ //#define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ //#define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ //#define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ //#define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ //#define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ //#define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ //#define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ //#define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ //#define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ //#define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ //#define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED // Useless.... UART_MODULE does it
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## Oscillator Values adaptation ####################*/
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h
index 3fac649..05ce716 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h
@@ -140,9 +140,15 @@ extern "C" {
// Extra HAL modules
#ifdef STM32F103xE
-//#define HAL_DAC_MODULE_ENABLED (unused or maybe for the eeprom write?)
-#define HAL_SD_MODULE_ENABLED
-#define HAL_SRAM_MODULE_ENABLED
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED (unused or maybe for the eeprom write?)
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+#endif
#endif
#ifdef __cplusplus
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h
index 4061db4..8ed0025 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h
@@ -145,9 +145,15 @@ extern "C" {
// Extra HAL modules
#if defined(STM32F103xE) || defined(STM32F103xG)
-#define HAL_DAC_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
-#define HAL_SRAM_MODULE_ENABLED
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+#endif
#endif
// Default pin used for 'Serial' instance (ex: ST-Link)
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h
index a9475db..41d7cad 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h
@@ -37,24 +37,60 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_IWDG_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_SRAM_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
-#define HAL_SD_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ #define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
#undef HAL_CAN_MODULE_ENABLED
#undef HAL_CAN_LEGACY_MODULE_ENABLED
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h
index 8de1e06..1006906 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h
@@ -198,9 +198,15 @@ extern "C" {
#define PIN_SERIAL3_TX PB10
/* Extra HAL modules */
-#define HAL_DAC_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
-#define HAL_SRAM_MODULE_ENABLED
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+#endif
#ifdef __cplusplus
} // extern "C"
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.h
index 37d60d9..779ef92 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.h
@@ -153,7 +153,7 @@
#endif
// Extra HAL modules
-#if !defined(HAL_SD_MODULE_DISABLED)
+#ifndef HAL_SD_MODULE_DISABLED
#define HAL_SD_MODULE_ENABLED
#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PeripheralPins.c b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/PeripheralPins.c
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PeripheralPins.c
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/PeripheralPins.c
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PinNamesVar.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/PinNamesVar.h
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/PinNamesVar.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/PinNamesVar.h
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/hal_conf_custom.h
similarity index 82%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/hal_conf_custom.h
index 808b558..105f8a4 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/hal_conf_custom.h
@@ -31,56 +31,154 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_IWDG_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_RTC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ #define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ #define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_EXTI_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED
-//#define HAL_USART_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ //#define HAL_EXTI_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/ldscript.ld
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/ldscript.ld
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/ldscript.ld
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.cpp
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.cpp
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.h
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.h
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/PeripheralPins.c b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/PeripheralPins.c
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/PeripheralPins.c
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/PeripheralPins.c
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/PinNamesVar.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/PinNamesVar.h
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/PinNamesVar.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/PinNamesVar.h
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/hal_conf_custom.h
similarity index 82%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/hal_conf_custom.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/hal_conf_custom.h
index 1dd047b..cd07995 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/hal_conf_custom.h
@@ -31,56 +31,154 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_IWDG_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_RTC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ #define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ #define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_EXTI_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED
-//#define HAL_USART_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ //#define HAL_EXTI_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/ldscript.ld b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/ldscript.ld
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/ldscript.ld
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/ldscript.ld
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/variant.cpp b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.cpp
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/variant.cpp
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.cpp
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.h
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RE/variant.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.h
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/PeripheralPins.c b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/PeripheralPins.c
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/PeripheralPins.c
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/PeripheralPins.c
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/PinNamesVar.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/PinNamesVar.h
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/PinNamesVar.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/PinNamesVar.h
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/hal_conf_custom.h
similarity index 82%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/hal_conf_custom.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/hal_conf_custom.h
index 808b558..105f8a4 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/hal_conf_custom.h
@@ -31,56 +31,154 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_IWDG_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_RTC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ #define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ #define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_EXTI_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED
-//#define HAL_USART_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ //#define HAL_EXTI_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/ldscript.ld b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/ldscript.ld
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/ldscript.ld
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/ldscript.ld
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/variant.cpp b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/variant.cpp
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/variant.cpp
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/variant.cpp
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/variant.h
similarity index 100%
rename from firmware/buildroot/share/PlatformIO/variants/MARLIN_STM32F401RE_FREERUNS/variant.h
rename to firmware/buildroot/share/PlatformIO/variants/MARLIN_F401RE_FREERUNS/variant.h
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h
index ea5e2cc..2894696 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h
@@ -31,56 +31,154 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DAC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_RTC_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ #define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED
-//#define HAL_USART_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h
index df45a5d..3444315 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407VE/variant.h
@@ -320,8 +320,12 @@ extern "C" {
#define PIN_SERIAL_TX PA9
/* Extra HAL modules */
-#define HAL_DAC_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
#ifdef __cplusplus
} // extern "C"
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407ZE/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407ZE/hal_conf_extra.h
index d62c510..8325aba 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407ZE/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F407ZE/hal_conf_extra.h
@@ -1,22 +1,56 @@
#pragma once
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
-#define HAL_SD_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
//#undef HAL_SD_MODULE_ENABLED
#undef HAL_DAC_MODULE_ENABLED
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/hal_conf_custom.h
index c23d30c..9b03588 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/hal_conf_custom.h
@@ -31,57 +31,153 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-#define HAL_CRC_MODULE_ENABLED
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-#define HAL_DAC_MODULE_ENABLED
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-#define HAL_SRAM_MODULE_ENABLED //YSZ-WORK
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_EXTI_MODULE_ENABLED */
-#define HAL_I2C_MODULE_ENABLED
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-#define HAL_RTC_MODULE_ENABLED
-/* #define HAL_SAI_MODULE_ENABLED */
-#define HAL_SD_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-/* #define HAL_UART_MODULE_ENABLED */
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-#ifndef HAL_PCD_MODULE_ENABLED
- #define HAL_PCD_MODULE_ENABLED //Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED // YSZ-WORK
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ //#define HAL_EXTI_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ #define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ #define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ #define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
#endif
-#define HAL_HCD_MODULE_ENABLED
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h
index f2f4ed3..2b3e239 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h
@@ -34,56 +34,154 @@
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CAN_LEGACY_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DAC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED
-//#define HAL_PCD_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ #define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED
+#endif
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_FLASH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ //#define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h
index d6f8e9f..1eec6ba 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h
@@ -171,7 +171,9 @@ extern "C" {
#define PIN_SERIAL_TX PA2
/* Extra HAL modules */
-#define HAL_DAC_MODULE_ENABLED
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
#ifdef __cplusplus
} // extern "C"
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h
index 80d5d3e..2ed2b04 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h
@@ -205,8 +205,12 @@ extern "C" {
#define PIN_SERIAL_TX PA9
/* Extra HAL modules */
-//#define HAL_DAC_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
#ifdef __cplusplus
} // extern "C"
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h
index fb3d21c..f4e9eaa 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h
@@ -31,56 +31,154 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_IWDG_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_RTC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ #define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ #define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED
-//#define HAL_USART_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.h
index e6f2251..0c999d2 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.h
@@ -225,7 +225,7 @@
#endif
// Extra HAL modules
-#if !defined(HAL_DAC_MODULE_DISABLED)
+#ifndef HAL_DAC_MODULE_DISABLED
#define HAL_DAC_MODULE_ENABLED
#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.h
index c3e5c78..e5072e8 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.h
@@ -228,16 +228,16 @@
#endif
// Extra HAL modules
-#if !defined(HAL_DAC_MODULE_DISABLED)
+#ifndef HAL_DAC_MODULE_DISABLED
#define HAL_DAC_MODULE_ENABLED
#endif
-#if !defined(HAL_ETH_MODULE_DISABLED)
+#ifndef HAL_ETH_MODULE_DISABLED
#define HAL_ETH_MODULE_ENABLED
#endif
-#if !defined(HAL_OSPI_MODULE_DISABLED)
+#ifndef HAL_OSPI_MODULE_DISABLED
#define HAL_OSPI_MODULE_ENABLED
#endif
-#if !defined(HAL_SD_MODULE_DISABLED)
+#ifndef HAL_SD_MODULE_DISABLED
#define HAL_SD_MODULE_ENABLED
#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.h
index c9c6314..ce6f6e7 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.h
@@ -269,16 +269,16 @@
#endif
// Extra HAL modules
-#if !defined(HAL_DAC_MODULE_DISABLED)
+#ifndef HAL_DAC_MODULE_DISABLED
#define HAL_DAC_MODULE_ENABLED
#endif
-#if !defined(HAL_ETH_MODULE_DISABLED)
+#ifndef HAL_ETH_MODULE_DISABLED
#define HAL_ETH_MODULE_ENABLED
#endif
-#if !defined(HAL_OSPI_MODULE_DISABLED)
+#ifndef HAL_OSPI_MODULE_DISABLED
#define HAL_OSPI_MODULE_ENABLED
#endif
-#if !defined(HAL_SD_MODULE_DISABLED)
+#ifndef HAL_SD_MODULE_DISABLED
#define HAL_SD_MODULE_ENABLED
#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.h
index 1b518f0..5174ce0 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.h
@@ -267,16 +267,16 @@
#endif
// Extra HAL modules
-#if !defined(HAL_DAC_MODULE_DISABLED)
+#ifndef HAL_DAC_MODULE_DISABLED
#define HAL_DAC_MODULE_ENABLED
#endif
-#if !defined(HAL_ETH_MODULE_DISABLED)
+#ifndef HAL_ETH_MODULE_DISABLED
#define HAL_ETH_MODULE_ENABLED
#endif
-#if !defined(HAL_OSPI_MODULE_DISABLED)
+#ifndef HAL_OSPI_MODULE_DISABLED
#define HAL_OSPI_MODULE_ENABLED
#endif
-#if !defined(HAL_SD_MODULE_DISABLED)
+#ifndef HAL_SD_MODULE_DISABLED
#define HAL_SD_MODULE_ENABLED
#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/hal_conf_extra.h
index ef621d5..51782da 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/hal_conf_extra.h
@@ -1,52 +1,150 @@
#pragma once
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
-//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028)
+#endif
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_FLASH_MODULE_ENABLED
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ //#define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h
index e71bb1c..0664c5c 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h
@@ -210,10 +210,18 @@ extern "C" {
#define PIN_SERIAL_TX PA9
/* Extra HAL modules */
-//#define HAL_DAC_MODULE_ENABLED
-#define HAL_SD_MODULE_ENABLED
-#define HAL_SRAM_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
#ifdef __cplusplus
} // extern "C"
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/hal_conf_custom.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/hal_conf_custom.h
index 3640bd1..c017819 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/hal_conf_custom.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/hal_conf_custom.h
@@ -31,55 +31,153 @@ extern "C" {
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-/* #define HAL_CAN_MODULE_ENABLED */
-/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
-#define HAL_CRC_MODULE_ENABLED
-/* #define HAL_CEC_MODULE_ENABLED */
-/* #define HAL_CRYP_MODULE_ENABLED */
-#define HAL_DAC_MODULE_ENABLED
-/* #define HAL_DCMI_MODULE_ENABLED */
-#define HAL_DMA_MODULE_ENABLED
-/* #define HAL_DMA2D_MODULE_ENABLED */
-/* #define HAL_ETH_MODULE_ENABLED */
-#define HAL_FLASH_MODULE_ENABLED
-/* #define HAL_NAND_MODULE_ENABLED */
-/* #define HAL_NOR_MODULE_ENABLED */
-/* #define HAL_PCCARD_MODULE_ENABLED */
-#define HAL_SRAM_MODULE_ENABLED
-/* #define HAL_SDRAM_MODULE_ENABLED */
-/* #define HAL_HASH_MODULE_ENABLED */
-#define HAL_GPIO_MODULE_ENABLED
-/* #define HAL_EXTI_MODULE_ENABLED */
-#define HAL_I2C_MODULE_ENABLED
-/* #define HAL_SMBUS_MODULE_ENABLED */
-/* #define HAL_I2S_MODULE_ENABLED */
-/* #define HAL_IWDG_MODULE_ENABLED */
-/* #define HAL_LTDC_MODULE_ENABLED */
-/* #define HAL_DSI_MODULE_ENABLED */
-#define HAL_PWR_MODULE_ENABLED
-/* #define HAL_QSPI_MODULE_ENABLED */
-#define HAL_RCC_MODULE_ENABLED
-/* #define HAL_RNG_MODULE_ENABLED */
-#define HAL_RTC_MODULE_ENABLED
-/* #define HAL_SAI_MODULE_ENABLED */
-#define HAL_SD_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-/* #define HAL_UART_MODULE_ENABLED */
-/* #define HAL_USART_MODULE_ENABLED */
-/* #define HAL_IRDA_MODULE_ENABLED */
-/* #define HAL_SMARTCARD_MODULE_ENABLED */
-/* #define HAL_WWDG_MODULE_ENABLED */
-#define HAL_CORTEX_MODULE_ENABLED
-//#define HAL_PCD_MODULE_ENABLED
-/* #define HAL_HCD_MODULE_ENABLED */
-/* #define HAL_FMPI2C_MODULE_ENABLED */
-/* #define HAL_SPDIFRX_MODULE_ENABLED */
-/* #define HAL_DFSDM_MODULE_ENABLED */
-/* #define HAL_LPTIM_MODULE_ENABLED */
-/* #define HAL_MMC_MODULE_ENABLED */
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ //#define HAL_EXTI_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ #define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ //#define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ //#define HAL_PCD_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/hal_conf_extra.h
index 2ca9df2..7820beb 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/hal_conf_extra.h
@@ -34,56 +34,148 @@
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_CAN_LEGACY_MODULE_ENABLED
-#define HAL_CRC_MODULE_ENABLED
-#define HAL_DAC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_I2C_MODULE_ENABLED
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ #define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ #define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ #define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
// #define HAL_UART_MODULE_ENABLED
// #define HAL_PCD_MODULE_ENABLED
// #define HAL_CAN_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_FLASH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ //#define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/hal_conf_extra.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/hal_conf_extra.h
old mode 100755
new mode 100644
index 8a04b8b..0626670
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/hal_conf_extra.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/hal_conf_extra.h
@@ -34,56 +34,154 @@
/**
* @brief This is the list of modules to be used in the HAL driver
*/
-#define HAL_MODULE_ENABLED
-#define HAL_ADC_MODULE_ENABLED
-#define HAL_DMA_MODULE_ENABLED
-#define HAL_FLASH_MODULE_ENABLED
-#define HAL_GPIO_MODULE_ENABLED
-#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
-#define HAL_PWR_MODULE_ENABLED
-#define HAL_RCC_MODULE_ENABLED
-#define HAL_SPI_MODULE_ENABLED
-#define HAL_TIM_MODULE_ENABLED
-#define HAL_USART_MODULE_ENABLED
-#define HAL_CORTEX_MODULE_ENABLED
-#define HAL_PCD_MODULE_ENABLED
-//#define HAL_UART_MODULE_ENABLED // by default
+#ifndef HAL_MODULE_ENABLED
+ #define HAL_MODULE_ENABLED
+#endif
+#ifndef HAL_ADC_MODULE_ENABLED
+ #define HAL_ADC_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA_MODULE_ENABLED
+ #define HAL_DMA_MODULE_ENABLED
+#endif
+#ifndef HAL_FLASH_MODULE_ENABLED
+ #define HAL_FLASH_MODULE_ENABLED
+#endif
+#ifndef HAL_GPIO_MODULE_ENABLED
+ #define HAL_GPIO_MODULE_ENABLED
+#endif
+#ifndef HAL_EXTI_MODULE_ENABLED
+ #define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
+#endif
+#ifndef HAL_PWR_MODULE_ENABLED
+ #define HAL_PWR_MODULE_ENABLED
+#endif
+#ifndef HAL_RCC_MODULE_ENABLED
+ #define HAL_RCC_MODULE_ENABLED
+#endif
+#ifndef HAL_SPI_MODULE_ENABLED
+ #define HAL_SPI_MODULE_ENABLED
+#endif
+#ifndef HAL_TIM_MODULE_ENABLED
+ #define HAL_TIM_MODULE_ENABLED
+#endif
+#ifndef HAL_USART_MODULE_ENABLED
+ #define HAL_USART_MODULE_ENABLED
+#endif
+#ifndef HAL_CORTEX_MODULE_ENABLED
+ #define HAL_CORTEX_MODULE_ENABLED
+#endif
+#ifndef HAL_PCD_MODULE_ENABLED
+ #define HAL_PCD_MODULE_ENABLED
+#endif
+#ifndef HAL_UART_MODULE_ENABLED
+ //#define HAL_UART_MODULE_ENABLED // by default
+#endif
-//#define HAL_CAN_MODULE_ENABLED
-//#define HAL_CAN_LEGACY_MODULE_ENABLED
-//#define HAL_CRC_MODULE_ENABLED
-//#define HAL_CEC_MODULE_ENABLED
-//#define HAL_CRYP_MODULE_ENABLED
-//#define HAL_DAC_MODULE_ENABLED
-//#define HAL_DCMI_MODULE_ENABLED
-//#define HAL_DMA2D_MODULE_ENABLED
-//#define HAL_ETH_MODULE_ENABLED
-//#define HAL_NAND_MODULE_ENABLED
-//#define HAL_NOR_MODULE_ENABLED
-//#define HAL_PCCARD_MODULE_ENABLED
-//#define HAL_SRAM_MODULE_ENABLED
-//#define HAL_SDRAM_MODULE_ENABLED
-//#define HAL_HASH_MODULE_ENABLED
-//#define HAL_I2C_MODULE_ENABLED
-//#define HAL_SMBUS_MODULE_ENABLED
-//#define HAL_I2S_MODULE_ENABLED
-//#define HAL_IWDG_MODULE_ENABLED
-//#define HAL_LTDC_MODULE_ENABLED
-//#define HAL_DSI_MODULE_ENABLED
-//#define HAL_QSPI_MODULE_ENABLED
-//#define HAL_RNG_MODULE_ENABLED
-//#define HAL_RTC_MODULE_ENABLED
-//#define HAL_SAI_MODULE_ENABLED
-//#define HAL_SD_MODULE_ENABLED
-//#define HAL_IRDA_MODULE_ENABLED
-//#define HAL_SMARTCARD_MODULE_ENABLED
-//#define HAL_WWDG_MODULE_ENABLED
-//#define HAL_HCD_MODULE_ENABLED
-//#define HAL_FMPI2C_MODULE_ENABLED
-//#define HAL_SPDIFRX_MODULE_ENABLED
-//#define HAL_DFSDM_MODULE_ENABLED
-//#define HAL_LPTIM_MODULE_ENABLED
-//#define HAL_MMC_MODULE_ENABLED
+#ifndef HAL_CAN_MODULE_ENABLED
+ //#define HAL_CAN_MODULE_ENABLED
+#endif
+#ifndef HAL_CAN_LEGACY_MODULE_ENABLED
+ //#define HAL_CAN_LEGACY_MODULE_ENABLED
+#endif
+#ifndef HAL_CRC_MODULE_ENABLED
+ //#define HAL_CRC_MODULE_ENABLED
+#endif
+#ifndef HAL_CEC_MODULE_ENABLED
+ //#define HAL_CEC_MODULE_ENABLED
+#endif
+#ifndef HAL_CRYP_MODULE_ENABLED
+ //#define HAL_CRYP_MODULE_ENABLED
+#endif
+#ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED
+#endif
+#ifndef HAL_DCMI_MODULE_ENABLED
+ //#define HAL_DCMI_MODULE_ENABLED
+#endif
+#ifndef HAL_DMA2D_MODULE_ENABLED
+ //#define HAL_DMA2D_MODULE_ENABLED
+#endif
+#ifndef HAL_ETH_MODULE_ENABLED
+ //#define HAL_ETH_MODULE_ENABLED
+#endif
+#ifndef HAL_NAND_MODULE_ENABLED
+ //#define HAL_NAND_MODULE_ENABLED
+#endif
+#ifndef HAL_NOR_MODULE_ENABLED
+ //#define HAL_NOR_MODULE_ENABLED
+#endif
+#ifndef HAL_PCCARD_MODULE_ENABLED
+ //#define HAL_PCCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_SRAM_MODULE_ENABLED
+ //#define HAL_SRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_SDRAM_MODULE_ENABLED
+ //#define HAL_SDRAM_MODULE_ENABLED
+#endif
+#ifndef HAL_HASH_MODULE_ENABLED
+ //#define HAL_HASH_MODULE_ENABLED
+#endif
+#ifndef HAL_I2C_MODULE_ENABLED
+ //#define HAL_I2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SMBUS_MODULE_ENABLED
+ //#define HAL_SMBUS_MODULE_ENABLED
+#endif
+#ifndef HAL_I2S_MODULE_ENABLED
+ //#define HAL_I2S_MODULE_ENABLED
+#endif
+#ifndef HAL_IWDG_MODULE_ENABLED
+ //#define HAL_IWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_LTDC_MODULE_ENABLED
+ //#define HAL_LTDC_MODULE_ENABLED
+#endif
+#ifndef HAL_DSI_MODULE_ENABLED
+ //#define HAL_DSI_MODULE_ENABLED
+#endif
+#ifndef HAL_QSPI_MODULE_ENABLED
+ //#define HAL_QSPI_MODULE_ENABLED
+#endif
+#ifndef HAL_RNG_MODULE_ENABLED
+ //#define HAL_RNG_MODULE_ENABLED
+#endif
+#ifndef HAL_RTC_MODULE_ENABLED
+ //#define HAL_RTC_MODULE_ENABLED
+#endif
+#ifndef HAL_SAI_MODULE_ENABLED
+ //#define HAL_SAI_MODULE_ENABLED
+#endif
+#ifndef HAL_SD_MODULE_ENABLED
+ //#define HAL_SD_MODULE_ENABLED
+#endif
+#ifndef HAL_IRDA_MODULE_ENABLED
+ //#define HAL_IRDA_MODULE_ENABLED
+#endif
+#ifndef HAL_SMARTCARD_MODULE_ENABLED
+ //#define HAL_SMARTCARD_MODULE_ENABLED
+#endif
+#ifndef HAL_WWDG_MODULE_ENABLED
+ //#define HAL_WWDG_MODULE_ENABLED
+#endif
+#ifndef HAL_HCD_MODULE_ENABLED
+ //#define HAL_HCD_MODULE_ENABLED
+#endif
+#ifndef HAL_FMPI2C_MODULE_ENABLED
+ //#define HAL_FMPI2C_MODULE_ENABLED
+#endif
+#ifndef HAL_SPDIFRX_MODULE_ENABLED
+ //#define HAL_SPDIFRX_MODULE_ENABLED
+#endif
+#ifndef HAL_DFSDM_MODULE_ENABLED
+ //#define HAL_DFSDM_MODULE_ENABLED
+#endif
+#ifndef HAL_LPTIM_MODULE_ENABLED
+ //#define HAL_LPTIM_MODULE_ENABLED
+#endif
+#ifndef HAL_MMC_MODULE_ENABLED
+ //#define HAL_MMC_MODULE_ENABLED
+#endif
/* ########################## HSE/HSI Values adaptation ##################### */
/**
diff --git a/firmware/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h b/firmware/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h
index c825a6b..17bb2bf 100644
--- a/firmware/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h
+++ b/firmware/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h
@@ -116,7 +116,9 @@ extern "C" {
#define PIN_SERIAL_TX PA9
/* Extra HAL modules */
-#define HAL_DAC_MODULE_ENABLED
+#ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+#endif
#ifdef __cplusplus
} // extern "C"
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/common.inc b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/common.inc
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/extra_libs.inc b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/extra_libs.inc
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103z_dfu.ld b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103z_dfu.ld
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103zc.ld b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103zc.ld
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103zd.ld b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103zd.ld
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103ze.ld b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/stm32f103ze.ld
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/vector_symbols.inc b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/ld/vector_symbols.inc
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/start.S b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/start.S
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/start_c.c b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/start_c.c
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/syscalls.c b/firmware/buildroot/share/PlatformIO/variants/marlin_maple_CHITU_F103/wirish/syscalls.c
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/dwin/bin/DWIN_ICO.py b/firmware/buildroot/share/dwin/bin/DWIN_ICO.py
index ff95b8c..d132000 100644
--- a/firmware/buildroot/share/dwin/bin/DWIN_ICO.py
+++ b/firmware/buildroot/share/dwin/bin/DWIN_ICO.py
@@ -54,8 +54,7 @@
# does not define a name for 39. This is specially handled to
# prevent reordering stock icons.
-import os
-import struct
+import os, struct
from PIL import Image
def getJpegResolution(jpegFile):
diff --git a/firmware/buildroot/share/dwin/bin/makeIco.py b/firmware/buildroot/share/dwin/bin/makeIco.py
old mode 100755
new mode 100644
index 95d8150..b69b046
--- a/firmware/buildroot/share/dwin/bin/makeIco.py
+++ b/firmware/buildroot/share/dwin/bin/makeIco.py
@@ -18,9 +18,7 @@
# along with this program. If not, see .
#----------------------------------------------------------------
-import os.path
-import argparse
-import DWIN_ICO
+import os.path, argparse, DWIN_ICO
version = '2.0.7'
diff --git a/firmware/buildroot/share/dwin/bin/splitIco.py b/firmware/buildroot/share/dwin/bin/splitIco.py
old mode 100755
new mode 100644
index a96d182..a1a2097
--- a/firmware/buildroot/share/dwin/bin/splitIco.py
+++ b/firmware/buildroot/share/dwin/bin/splitIco.py
@@ -18,9 +18,7 @@
# along with this program. If not, see .
#----------------------------------------------------------------
-import os.path
-import argparse
-import DWIN_ICO
+import os.path, argparse, DWIN_ICO
version = '2.0.7'
diff --git a/firmware/buildroot/share/dwin/make_jpgs.sh b/firmware/buildroot/share/dwin/make_jpgs.sh
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/fonts/bdf2u8g/bdf2u8g.c b/firmware/buildroot/share/fonts/bdf2u8g/bdf2u8g.c
index ea9f17d..6501ead 100644
--- a/firmware/buildroot/share/fonts/bdf2u8g/bdf2u8g.c
+++ b/firmware/buildroot/share/fonts/bdf2u8g/bdf2u8g.c
@@ -1090,23 +1090,23 @@ void bdf_WriteC(const char *outname, const char *fontname) {
capital_ascent = bdf_capital_A_height > 0 ? bdf_capital_A_height : bdf_capital_1_height;
- fprintf(out_fp, "/*\n");
- fprintf(out_fp, " Fontname: %s\n", bdf_font);
- fprintf(out_fp, " Copyright: %s\n", bdf_copyright);
- fprintf(out_fp, " Capital A Height: %d, '1' Height: %d\n", bdf_capital_A_height, bdf_capital_1_height);
- fprintf(out_fp, " Calculated Max Values w=%2d h=%2d x=%2d y=%2d dx=%2d dy=%2d ascent=%2d len=%2d\n",
+ fprintf(out_fp, "/**\n");
+ fprintf(out_fp, " * Fontname: %s\n", bdf_font);
+ fprintf(out_fp, " * Copyright: %s\n", bdf_copyright);
+ fprintf(out_fp, " * Capital A Height: %d, '1' Height: %d\n", bdf_capital_A_height, bdf_capital_1_height);
+ fprintf(out_fp, " * Calculated Max Values w=%2d h=%2d x=%2d y=%2d dx=%2d dy=%2d ascent=%2d len=%2d\n",
bdf_char_max_width, bdf_char_max_height, bdf_char_max_x, bdf_char_max_y, bdf_delta_max_x, bdf_delta_max_y,
bdf_char_max_ascent, bdf_glyph_data_max_len);
- fprintf(out_fp, " Font Bounding box w=%2d h=%2d x=%2d y=%2d\n",
+ fprintf(out_fp, " * Font Bounding box w=%2d h=%2d x=%2d y=%2d\n",
bdf_font_width, bdf_font_height, bdf_font_x, bdf_font_y);
- fprintf(out_fp, " Calculated Min Values x=%2d y=%2d dx=%2d dy=%2d\n",
+ fprintf(out_fp, " * Calculated Min Values x=%2d y=%2d dx=%2d dy=%2d\n",
bdf_char_min_x, bdf_char_min_y, bdf_delta_min_x, bdf_delta_min_y);
- fprintf(out_fp, " Pure Font ascent =%2d descent=%2d\n", capital_ascent, bdf_lower_g_descent);
- fprintf(out_fp, " X Font ascent =%2d descent=%2d\n", bdf_char_xascent, bdf_char_xdescent);
- fprintf(out_fp, " Max Font ascent =%2d descent=%2d\n", bdf_char_max_ascent, bdf_char_min_y);
+ fprintf(out_fp, " * Pure Font ascent =%2d descent=%2d\n", capital_ascent, bdf_lower_g_descent);
+ fprintf(out_fp, " * X Font ascent =%2d descent=%2d\n", bdf_char_xascent, bdf_char_xdescent);
+ fprintf(out_fp, " * Max Font ascent =%2d descent=%2d\n", bdf_char_max_ascent, bdf_char_min_y);
- fprintf(out_fp, "*/\n");
+ fprintf(out_fp, " */\n");
fprintf(out_fp, "const u8g_fntpgm_uint8_t %s[%d] U8G_FONT_SECTION(\"%s\") = {\n", fontname, data_pos, fontname);
fprintf(out_fp, " ");
data_Write(out_fp, " ");
diff --git a/firmware/buildroot/share/fonts/buildhzk.py b/firmware/buildroot/share/fonts/buildhzk.py
index 185cc14..2b59980 100644
--- a/firmware/buildroot/share/fonts/buildhzk.py
+++ b/firmware/buildroot/share/fonts/buildhzk.py
@@ -4,8 +4,7 @@
# Author: Taylor Talkington
# License: GPL
-import bdflib.reader
-import math
+import bdflib.reader, math
def glyph_bits(size_x, size_y, font, glyph_ord):
asc = font[b'FONT_ASCENT']
diff --git a/firmware/buildroot/share/fonts/genallfont.sh b/firmware/buildroot/share/fonts/genallfont.sh
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/fonts/make_lang_na.sh b/firmware/buildroot/share/fonts/make_lang_na.sh
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/fonts/uxggenpages.sh b/firmware/buildroot/share/fonts/uxggenpages.sh
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/README.md b/firmware/buildroot/share/git/README.md
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/firstpush b/firmware/buildroot/share/git/firstpush
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/ghpc b/firmware/buildroot/share/git/ghpc
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/ghtp b/firmware/buildroot/share/git/ghtp
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfadd b/firmware/buildroot/share/git/mfadd
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfclean b/firmware/buildroot/share/git/mfclean
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfdoc b/firmware/buildroot/share/git/mfdoc
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mffp b/firmware/buildroot/share/git/mffp
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfhelp b/firmware/buildroot/share/git/mfhelp
old mode 100755
new mode 100644
index aff34b8..cbdd6ec
--- a/firmware/buildroot/share/git/mfhelp
+++ b/firmware/buildroot/share/git/mfhelp
@@ -40,7 +40,6 @@ Modify Configuration.h / Configuration_adv.h:
Modify pins files:
- pins_set ............. Set the value of a pin in a pins file
pinsformat.py ........ Python script to format pins files
THIS
diff --git a/firmware/buildroot/share/git/mfinfo b/firmware/buildroot/share/git/mfinfo
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfinit b/firmware/buildroot/share/git/mfinit
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfnew b/firmware/buildroot/share/git/mfnew
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfpr b/firmware/buildroot/share/git/mfpr
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfprep b/firmware/buildroot/share/git/mfprep
old mode 100755
new mode 100644
index 7446895..4554bdc
--- a/firmware/buildroot/share/git/mfprep
+++ b/firmware/buildroot/share/git/mfprep
@@ -9,7 +9,6 @@
# so at every release be sure to create a dev- tag and publish it to origin.
#
-SED=$(which gsed sed | head -n1)
SELF=`basename "$0"`
DRYRUN=0
diff --git a/firmware/buildroot/share/git/mfpub b/firmware/buildroot/share/git/mfpub
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfqp b/firmware/buildroot/share/git/mfqp
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfrb b/firmware/buildroot/share/git/mfrb
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/git/mfup b/firmware/buildroot/share/git/mfup
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/pixmaps/logo/marlin-old.svg b/firmware/buildroot/share/pixmaps/logo/marlin-old.svg
index d621d3a..a8c9369 100644
--- a/firmware/buildroot/share/pixmaps/logo/marlin-old.svg
+++ b/firmware/buildroot/share/pixmaps/logo/marlin-old.svg
@@ -1,6 +1,9 @@
-
-
+
diff --git a/firmware/buildroot/share/pixmaps/logo/marlin.svg b/firmware/buildroot/share/pixmaps/logo/marlin.svg
index e608a7e..5327c69 100644
--- a/firmware/buildroot/share/pixmaps/logo/marlin.svg
+++ b/firmware/buildroot/share/pixmaps/logo/marlin.svg
@@ -1,6 +1,9 @@
-
-
+
\ No newline at end of file
+ d="M 403.52901,561.50203" />
+
diff --git a/firmware/buildroot/share/scripts/MarlinBinaryProtocol.py b/firmware/buildroot/share/scripts/MarlinBinaryProtocol.py
index 5ec83b1..f759773 100644
--- a/firmware/buildroot/share/scripts/MarlinBinaryProtocol.py
+++ b/firmware/buildroot/share/scripts/MarlinBinaryProtocol.py
@@ -2,14 +2,9 @@
# MarlinBinaryProtocol.py
# Supporting Firmware upload via USB/Serial, saving to the attached media.
#
-import serial
-import math
-import time
+import serial, math, time, threading, sys, datetime, random
from collections import deque
-import threading
-import sys
-import datetime
-import random
+
try:
import heatshrink2 as heatshrink
heatshrink_exists = True
diff --git a/firmware/buildroot/share/scripts/check-urls.sh b/firmware/buildroot/share/scripts/check-urls.sh
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/scripts/createSpeedLookupTable.py b/firmware/buildroot/share/scripts/createSpeedLookupTable.py
old mode 100755
new mode 100644
index 70ed953..c5b8a02
--- a/firmware/buildroot/share/scripts/createSpeedLookupTable.py
+++ b/firmware/buildroot/share/scripts/createSpeedLookupTable.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python
-from __future__ import print_function
-from __future__ import division
+from __future__ import print_function, division
""" Generate the stepper delay lookup table for Marlin firmware. """
diff --git a/firmware/buildroot/share/scripts/createTemperatureLookupMarlin.py b/firmware/buildroot/share/scripts/createTemperatureLookupMarlin.py
old mode 100755
new mode 100644
index e2441f5..eb8c094
--- a/firmware/buildroot/share/scripts/createTemperatureLookupMarlin.py
+++ b/firmware/buildroot/share/scripts/createTemperatureLookupMarlin.py
@@ -18,8 +18,7 @@ Options:
--num-temps=... the number of temperature points to calculate (default: 36)
"""
-from __future__ import print_function
-from __future__ import division
+from __future__ import print_function, division
from math import *
import sys, getopt
diff --git a/firmware/buildroot/share/scripts/findMissingTranslations.sh b/firmware/buildroot/share/scripts/findMissingTranslations.sh
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/scripts/g29_auto.py b/firmware/buildroot/share/scripts/g29_auto.py
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/scripts/image_to_tft.py b/firmware/buildroot/share/scripts/image_to_tft.py
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/scripts/languageExport.py b/firmware/buildroot/share/scripts/languageExport.py
old mode 100755
new mode 100644
index 46485aa..ca1998c
--- a/firmware/buildroot/share/scripts/languageExport.py
+++ b/firmware/buildroot/share/scripts/languageExport.py
@@ -1,20 +1,22 @@
#!/usr/bin/env python3
'''
-languageExport.py
+languageExport.py [--single]
Export LCD language strings to CSV files for easier translation.
-Use importTranslations.py to import CSV into the language files.
+Use languageImport.py to import CSV into the language files.
+Use --single to export all languages to a single CSV file.
'''
import re
from pathlib import Path
+from sys import argv
from languageUtil import namebyid
LANGHOME = "Marlin/src/lcd/language"
# Write multiple sheets if true, otherwise write one giant sheet
-MULTISHEET = True
+MULTISHEET = '--single' not in argv[1:]
OUTDIR = 'out-csv'
# Check for the path to the language files
@@ -28,7 +30,7 @@ LIMIT = 0
# A dictionary to contain strings for each language.
# Init with 'en' so English will always be first.
-language_strings = { 'en': 0 }
+language_strings = { 'en': {} }
# A dictionary to contain all distinct LCD string names
names = {}
diff --git a/firmware/buildroot/share/scripts/languageImport.py b/firmware/buildroot/share/scripts/languageImport.py
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/scripts/languageUtil.py b/firmware/buildroot/share/scripts/languageUtil.py
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/share/scripts/pinsformat.py b/firmware/buildroot/share/scripts/pinsformat.py
old mode 100755
new mode 100644
index 7b041c8..0260d31
--- a/firmware/buildroot/share/scripts/pinsformat.py
+++ b/firmware/buildroot/share/scripts/pinsformat.py
@@ -43,7 +43,7 @@ mexpr = [ re.compile(f'^{m}$') for m in mpatt ]
ppad = [ 3, 4, 5, 5 ]
# Match a define line
-definePatt = re.compile(rf'^\s*(//)?#define\s+[A-Z_][A-Z0-9_]+\s+({mstr})\s*(//.*)?$')
+definePinPatt = re.compile(rf'^\s*(//)?#define\s+[A-Z_][A-Z0-9_]+?_PIN\s+({mstr})\s*(//.*)?$')
def format_pins(argv):
src_file = 'stdin'
@@ -93,7 +93,7 @@ def get_pin_pattern(txt):
# Find the most common matching pattern
match_threshold = 5
for line in txt.split('\n'):
- r = definePatt.match(line)
+ r = definePinPatt.match(line)
if r == None: continue
ind = -1
for p in mexpr:
diff --git a/firmware/buildroot/share/scripts/rle16_compress_cpp_image_data.py b/firmware/buildroot/share/scripts/rle16_compress_cpp_image_data.py
old mode 100755
new mode 100644
index 60681ee..ed0c640
--- a/firmware/buildroot/share/scripts/rle16_compress_cpp_image_data.py
+++ b/firmware/buildroot/share/scripts/rle16_compress_cpp_image_data.py
@@ -5,8 +5,7 @@
#
# Usage: rle16_compress_cpp_image_data.py INPUT_FILE.cpp OUTPUT_FILE.cpp
#
-import sys, struct
-import re
+import sys, struct, re
def addCompressedData(input_file, output_file):
ofile = open(output_file, 'wt')
diff --git a/firmware/buildroot/share/scripts/rle_compress_bitmap.py b/firmware/buildroot/share/scripts/rle_compress_bitmap.py
old mode 100755
new mode 100644
index 8c25204..d33f7be
--- a/firmware/buildroot/share/scripts/rle_compress_bitmap.py
+++ b/firmware/buildroot/share/scripts/rle_compress_bitmap.py
@@ -6,8 +6,7 @@
#
# Usage: rle_compress_bitmap.py INPUT_FILE OUTPUT_FILE
#
-import sys, struct
-import re
+import sys, struct, re
def addCompressedData(input_file, output_file):
input_lines = input_file.readlines()
diff --git a/firmware/buildroot/share/scripts/validate_boards.py b/firmware/buildroot/share/scripts/validate_boards.py
new file mode 100644
index 0000000..a495420
--- /dev/null
+++ b/firmware/buildroot/share/scripts/validate_boards.py
@@ -0,0 +1,128 @@
+#!/usr/bin/env python3
+#
+# buildroot/share/scripts/validate_boards.py
+# Assert standards for boards.h and pins.h
+#
+
+import sys, re
+
+do_log = False
+def logmsg(msg, line):
+ if do_log: print(msg, line)
+
+# Print a formatted error
+def err(board, msg):
+ print(f'[ERROR] {board:30} {msg}')
+
+# Print a formatted warning
+def warn(board, msg):
+ print(f'[WARNING] {board:30} {msg}')
+
+def bshort(board):
+ return board.replace('BOARD_', '')
+
+#
+# Run standards checks on boards.h and pins.h
+#
+def boards_checks(argv):
+ ERRS = 0
+ src_file = 'Marlin/src/core/boards.h'
+
+ scnt = 0
+ for arg in argv:
+ if arg == '-v':
+ global do_log
+ do_log = True
+ elif scnt == 0:
+ src_file = arg
+ scnt += 1
+
+ logmsg('Checking boards file:', src_file)
+
+ # Open the file
+ with open(src_file, 'r') as f:
+ lines = f.readlines()
+
+ # Get the board names and numbers
+ boards = []
+ for line in lines:
+ m = re.match(r'^\s*#define\s+(BO\w+)\s+(\d+)(\s+//\s*(.+))?', line)
+ if not m: continue
+ board, number, comment = m.group(1), int(m.group(2)), m.group(4)
+ boards.append((board, number, comment))
+
+ #
+ # Examine boards.h to check the formatting of the file
+ #
+ last_number, last_groun = (-1, -1)
+
+ for board, number, comment in boards:
+ logmsg('Checking:', board)
+ group = int(number / 100)
+ if not re.match(r'^BOARD_\w+$', board):
+ err(board, 'is not of the form BOARD_NAME')
+ ERRS += 1
+ if number != last_number + 1:
+ if int(number / 100) != int(last_number / 100):
+ if number % 100 != 0 and number < 9900:
+ err(board, f'is {number} (should be {group * 100}?)')
+ ERRS += 1
+ elif number > 1040:
+ err(board, f'is {number} but previous board is {last_number}')
+ ERRS += 1
+ if not comment:
+ err(board, ' has no comment')
+ ERRS += 1
+ else:
+ cshor = bshort(board)
+ cbore = cshor.replace('_', '')
+ if comment == board or comment == cshor or comment == cbore:
+ warn(board, f'comment needs more detail')
+ last_number = number
+ last_group = number % 100
+
+ #
+ # Validate that pins.h has all the boards mentioned in it
+ #
+ pins_boards = []
+ with open('Marlin/src/pins/pins.h', 'r') as f:
+ lines = f.readlines()
+ if_count = 0
+ for line in lines:
+ m = re.search(r'#(if|elif)\s+MB\(([^)]+)\)', line)
+ if not m: continue
+ if (m.group(1) == 'if'):
+ if_count += 1
+ if if_count == 3: break
+ if if_count == 2:
+ mb_items = m.group(2).split(',')
+ for board in mb_items:
+ pins_boards.append('BOARD_' + board.strip())
+
+ # Check that the list from boards.h matches the list from pins.h
+ boards_boards = [b[0] for b in boards]
+ if set(pins_boards) != set(boards_boards):
+ ERRS += 1
+ print(f'[ERROR] Boards in pins.h do not match boards.h')
+ # Show the differences only
+ for b in boards:
+ if b[0] not in pins_boards:
+ print(f' pins.h missing: {b[0]}')
+ for b in pins_boards:
+ if b not in boards_boards:
+ print(f' boards.h missing: {b}')
+
+ # Check that boards_boards and pins_boards are in the same order
+ for i in range(len(boards_boards)):
+ if boards_boards[i] != pins_boards[i]:
+ ERRS += 1
+ print(f'[ERROR] Non-matching boards order in pins.h. Expected {bshort(boards_boards[i])} but got {bshort(pins_boards[i])}')
+ break
+
+ return ERRS;
+
+if __name__ == '__main__':
+ ERR_COUNT = boards_checks(sys.argv[1:])
+ if ERR_COUNT:
+ print(f'\nFound {ERR_COUNT} errors')
+ sys.exit(1)
diff --git a/firmware/buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt b/firmware/buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt
deleted file mode 100644
index 5853977..0000000
--- a/firmware/buildroot/share/sublime/auto_build_sublime_menu/000_read_me.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-Overview:
-1) Install Sublime
-2) Install Deviot (?optional?)
-3) Install WebDevShell (this will execute the auto-build script)
-4) Copy the menu configuration to the proper Sublime directory
-5) Add platformio to your path (usually not needed)
-
-
-Sublime with autobuild
- Tools
- Install Package Control
- Tools
- Command Palette
- Package Control: Install Package
- type in deviot and click on it
- Tools
- Command Palette
- Package Control: Install Package
- type in WebDevShell and click on it
-
- in Sublime, open Marlin directory with "platformio.ini" in it
-
- starting in the top level directory, go to the folder "Buildroot/shared/Sublime"
- copy the folder "auto_build_sublime_menu" and contents to:
- Windows
- \Users\your_user_name\AppData\Roaming\Sublime Text 3\Packages
- Linux
- /home/your_user_name/.config/sublime-text-3/Packages/User
- macOS (Click on the Finder's 'Go' menu and hold down Option to open...)
- ~/Library/Application Support/Sublime Text 3/Packages/User
-
-The menu should now be visible
-
-If you get an error message that says "file not found" and "subprocess.Popen(['platformio' ... "
-then you'll need to add platformio to your path.
- macOS
- sudo nano /etc/paths
- add these to the bottom
- /Users/bob/.platformio
- /Users/bob/.platformio/penv/bin
diff --git a/firmware/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu b/firmware/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu
deleted file mode 100644
index 60939d1..0000000
--- a/firmware/buildroot/share/sublime/auto_build_sublime_menu/Main.sublime-menu
+++ /dev/null
@@ -1,66 +0,0 @@
-[
-
- {
- "caption": "Auto Build",
- "children": [
- {
- "caption": "PIO Build",
- "command": "webdevshell",
- "args": {
- "command": "python buildroot/share/vscode/auto_build.py build"
- }
- },
- {
- "caption": "PIO Clean",
- "command": "webdevshell",
- "args": {
- "command": "python buildroot/share/vscode/auto_build.py clean"
- }
- },
- {
- "caption": "PIO Upload",
- "command": "webdevshell",
- "args": {
- "command": "python buildroot/share/vscode/auto_build.py upload"
- }
- },
- {
- "caption": "PIO Upload (traceback)",
- "command": "webdevshell",
- "args": {
- "command": "python buildroot/share/vscode/auto_build.py traceback"
- }
- },
- {
- "caption": "PIO Upload using Programmer",
- "command": "webdevshell",
- "args": {
- "command": "python buildroot/share/vscode/auto_build.py program"
- }
- },
- {
- "caption": "PIO Test",
- "command": "webdevshell",
- "args": {
- "command": "python buildroot/share/vscode/auto_build.py test"
- }
- },
- {
- "caption": "PIO Debug",
- "command": "webdevshell",
- "args": {
- "command": "python buildroot/share/vscode/auto_build.py debug"
- }
- },
- {
- "caption": "PIO Remote",
- "command": "webdevshell",
- "args": {
- "command": "python buildroot/share/vscode/auto_build.py remote"
- }
- }
- ],
- "id": "AutoBuild",
- "mnemonic": "A"
- }
-]
diff --git a/firmware/buildroot/share/uncrustify/uncrustify.cfg b/firmware/buildroot/share/uncrustify/uncrustify.cfg
index 73ccadc..02b74dd 100644
--- a/firmware/buildroot/share/uncrustify/uncrustify.cfg
+++ b/firmware/buildroot/share/uncrustify/uncrustify.cfg
@@ -3055,7 +3055,7 @@ cmt_multi_first_len_minimum = 4 # unsigned number
# Path to a file that contains text to insert at the beginning of a file if
# the file doesn't start with a C/C++ comment. If the inserted text contains
# '$(filename)', that will be replaced with the current file's name.
-cmt_insert_file_header = "./buildroot/share/extras/file_header.h" # string
+cmt_insert_file_header = "./buildroot/share/uncrustify/file_header.h" # string
# Path to a file that contains text to insert at the end of a file if the
# file doesn't end with a C/C++ comment. If the inserted text contains
diff --git a/firmware/buildroot/share/vscode/auto_build.py b/firmware/buildroot/share/vscode/auto_build.py
deleted file mode 100644
index dcbf119..0000000
--- a/firmware/buildroot/share/vscode/auto_build.py
+++ /dev/null
@@ -1,1283 +0,0 @@
-#!/usr/bin/env python
-#######################################
-#
-# Marlin 3D Printer Firmware
-# Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
-#
-# Based on Sprinter and grbl.
-# Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-#######################################
-
-#######################################
-#
-# Revision: 2.1.0
-#
-# Description: script to automate PlatformIO builds
-# CLI: python auto_build.py build_option
-# build_option (required)
-# build executes -> platformio run -e target_env
-# clean executes -> platformio run --target clean -e target_env
-# upload executes -> platformio run --target upload -e target_env
-# traceback executes -> platformio run --target upload -e target_env
-# program executes -> platformio run --target program -e target_env
-# test executes -> platformio test upload -e target_env
-# remote executes -> platformio remote run --target upload -e target_env
-# debug executes -> platformio debug -e target_env
-#
-# 'traceback' just uses the debug variant of the target environment if one exists
-#
-#######################################
-
-#######################################
-#
-# General program flow
-#
-# 1. Scans Configuration.h for the motherboard name and Marlin version.
-# 2. Scans pins.h for the motherboard.
-# returns the CPU(s) and platformio environment(s) used by the motherboard
-# 3. If further info is needed then a popup gets it from the user.
-# 4. The OUTPUT_WINDOW class creates a window to display the output of the PlatformIO program.
-# 5. A thread is created by the OUTPUT_WINDOW class in order to execute the RUN_PIO function.
-# 6. The RUN_PIO function uses a subprocess to run the CLI version of PlatformIO.
-# 7. The "iter(pio_subprocess.stdout.readline, '')" function is used to stream the output of
-# PlatformIO back to the RUN_PIO function.
-# 8. Each line returned from PlatformIO is formatted to match the color coding seen in the
-# PlatformIO GUI.
-# 9. If there is a color change within a line then the line is broken at each color change
-# and sent separately.
-# 10. Each formatted segment (could be a full line or a split line) is put into the queue
-# IO_queue as it arrives from the platformio subprocess.
-# 11. The OUTPUT_WINDOW class periodically samples IO_queue. If data is available then it
-# is written to the window.
-# 12. The window stays open until the user closes it.
-# 13. The OUTPUT_WINDOW class continues to execute as long as the window is open. This allows
-# copying, saving, scrolling of the window. A right click popup is available.
-#
-#######################################
-
-from __future__ import print_function
-from __future__ import division
-
-import sys, os, re
-
-pwd = os.getcwd() # make sure we're executing from the correct directory level
-pwd = pwd.replace('\\', '/')
-if 0 <= pwd.find('buildroot/share/vscode'):
- pwd = pwd[:pwd.find('buildroot/share/vscode')]
- os.chdir(pwd)
-print('pwd: ', pwd)
-
-num_args = len(sys.argv)
-if num_args > 1:
- build_type = str(sys.argv[1])
-else:
- print('Please specify build type')
- exit()
-
-print('build_type: ', build_type)
-
-print('\nWorking\n')
-
-python_ver = sys.version_info[0] # major version - 2 or 3
-
-print("python version " + str(sys.version_info[0]) + "." + str(sys.version_info[1]) + "." + str(sys.version_info[2]))
-
-import platform
-current_OS = platform.system()
-
-#globals
-target_env = ''
-board_name = ''
-
-from datetime import datetime
-
-#########
-# Python 2 error messages:
-# Can't find a usable init.tcl in the following directories ...
-# error "invalid command name "tcl_findLibrary""
-#
-# Fix for the above errors on my Win10 system:
-# search all init.tcl files for the line "package require -exact Tcl" that has the highest 8.5.x number
-# copy it into the first directory listed in the error messages
-# set the environmental variables TCLLIBPATH and TCL_LIBRARY to the directory where you found the init.tcl file
-# reboot
-#########
-
-##########################################################################################
-#
-# popup to get input from user
-#
-##########################################################################################
-
-def get_answer(board_name, question_txt, options, default_value=1):
-
- if python_ver == 2:
- import Tkinter as tk
- else:
- import tkinter as tk
-
- def CPU_exit_3(): # forward declare functions
- CPU_exit_3_()
-
- def got_answer():
- got_answer_()
-
- def kill_session():
- kill_session_()
-
- root_get_answer = tk.Tk()
- root_get_answer.title('')
- #root_get_answer.withdraw()
- #root_get_answer.deiconify()
- root_get_answer.attributes("-topmost", True)
-
- def disable_event():
- pass
-
- root_get_answer.protocol("WM_DELETE_WINDOW", disable_event)
- root_get_answer.resizable(False, False)
-
- global get_answer_val
- get_answer_val = default_value # return get_answer_val, set default to match radio_state default
-
- radio_state = tk.IntVar()
- radio_state.set(get_answer_val)
-
- l1 = tk.Label(text=board_name, fg="light green", bg="dark green",
- font="default 14 bold").grid(row=0, columnspan=2, sticky='EW', ipadx=2, ipady=2)
-
- l2 = tk.Label(text=question_txt).grid(row=1, pady=4, columnspan=2, sticky='EW')
-
- buttons = []
-
- for index, val in enumerate(options):
- buttons.append(
- tk.Radiobutton(
- text=val,
- fg="black",
- bg="lightgray",
- relief=tk.SUNKEN,
- selectcolor="green",
- variable=radio_state,
- value=index + 1,
- indicatoron=0,
- command=CPU_exit_3
- ).grid(row=index + 2, pady=1, ipady=2, ipadx=10, columnspan=2))
-
- b6 = tk.Button(text="Cancel", fg="red", command=kill_session).grid(row=(2 + len(options)), column=0, padx=4, pady=4, ipadx=2, ipady=2)
-
- b7 = tk.Button(text="Continue", fg="green", command=got_answer).grid(row=(2 + len(options)), column=1, padx=4, pady=4, ipadx=2, ipady=2)
-
- def got_answer_():
- root_get_answer.destroy()
-
- def CPU_exit_3_():
- global get_answer_val
- get_answer_val = radio_state.get()
-
- def kill_session_():
- raise SystemExit(0) # kill everything
-
- root_get_answer.mainloop()
-
-# end - get answer
-
-
-#
-# move custom board definitions from project folder to PlatformIO
-#
-def resolve_path(path):
- import os
-
- # turn the selection into a partial path
-
- if 0 <= path.find('"'):
- path = path[path.find('"'):]
- if 0 <= path.find(', line '):
- path = path.replace(', line ', ':')
- path = path.replace('"', '')
-
- # get line and column numbers
- line_num = 1
- column_num = 1
- line_start = path.find(':', 2) # use 2 here so don't eat Windows full path
- column_start = path.find(':', line_start + 1)
- if column_start == -1:
- column_start = len(path)
- column_end = path.find(':', column_start + 1)
- if column_end == -1:
- column_end = len(path)
- if 0 <= line_start:
- line_num = path[line_start + 1:column_start]
- if line_num == '':
- line_num = 1
- if column_start != column_end:
- column_num = path[column_start + 1:column_end]
- if column_num == '':
- column_num = 0
-
- index_end = path.find(',')
- if 0 <= index_end:
- path = path[:index_end] # delete comma and anything after
- index_end = path.find(':', 2)
- if 0 <= index_end:
- path = path[:path.find(':', 2)] # delete the line number and anything after
-
- path = path.replace('\\', '/')
-
- if 1 == path.find(':') and current_OS == 'Windows':
- return path, line_num, column_num # found a full path - no need for further processing
- elif 0 == path.find('/') and (current_OS == 'Linux' or current_OS == 'Darwin'):
- return path, line_num, column_num # found a full path - no need for further processing
-
- else:
-
- # resolve as many '../' as we can
- while 0 <= path.find('../'):
- end = path.find('../') - 1
- start = path.find('/')
- while 0 <= path.find('/', start) < end:
- start = path.find('/', start) + 1
- path = path[0:start] + path[end + 4:]
-
- # this is an alternative to the above - it just deletes the '../' section
- # start_temp = path.find('../')
- # while 0 <= path.find('../',start_temp):
- # start = path.find('../',start_temp)
- # start_temp = start + 1
- # if 0 <= start:
- # path = path[start + 2 : ]
-
- start = path.find('/')
- if start != 0: # make sure path starts with '/'
- while 0 == path.find(' '): # eat any spaces at the beginning
- path = path[1:]
- path = '/' + path
-
- if current_OS == 'Windows':
- search_path = path.replace('/', '\\') # os.walk uses '\' in Windows
- else:
- search_path = path
-
- start_path = os.path.abspath('')
-
- # search project directory for the selection
- found = False
- full_path = ''
- for root, directories, filenames in os.walk(start_path):
- for filename in filenames:
- if 0 <= root.find('.git'): # don't bother looking in this directory
- break
- full_path = os.path.join(root, filename)
- if 0 <= full_path.find(search_path):
- found = True
- break
- if found:
- break
-
- return full_path, line_num, column_num
-
-# end - resolve_path
-
-
-#
-# Open the file in the preferred editor at the line & column number
-# If the preferred editor isn't already running then it tries the next.
-# If none are open then the system default is used.
-#
-# Editor order:
-# 1. Notepad++ (Windows only)
-# 2. Sublime Text
-# 3. Atom
-# 4. System default (opens at line 1, column 1 only)
-#
-def open_file(path):
- import subprocess
- file_path, line_num, column_num = resolve_path(path)
-
- if file_path == '':
- return
-
- if current_OS == 'Windows':
-
- editor_note = subprocess.check_output('wmic process where "name=' + "'notepad++.exe'" + '" get ExecutablePath')
- editor_sublime = subprocess.check_output('wmic process where "name=' + "'sublime_text.exe'" + '" get ExecutablePath')
- editor_atom = subprocess.check_output('wmic process where "name=' + "'atom.exe'" + '" get ExecutablePath')
-
- if 0 <= editor_note.find('notepad++.exe'):
- start = editor_note.find('\n') + 1
- end = editor_note.find('\n', start + 5) - 4
- editor_note = editor_note[start:end]
- command = file_path, ' -n' + str(line_num), ' -c' + str(column_num)
- subprocess.Popen([editor_note, command])
-
- elif 0 <= editor_sublime.find('sublime_text.exe'):
- start = editor_sublime.find('\n') + 1
- end = editor_sublime.find('\n', start + 5) - 4
- editor_sublime = editor_sublime[start:end]
- command = file_path + ':' + line_num + ':' + column_num
- subprocess.Popen([editor_sublime, command])
-
- elif 0 <= editor_atom.find('atom.exe'):
- start = editor_atom.find('\n') + 1
- end = editor_atom.find('\n', start + 5) - 4
- editor_atom = editor_atom[start:end]
- command = file_path + ':' + str(line_num) + ':' + str(column_num)
- subprocess.Popen([editor_atom, command])
-
- else:
- os.startfile(resolve_path(path)) # open file with default app
-
- elif current_OS == 'Linux':
-
- command = file_path + ':' + str(line_num) + ':' + str(column_num)
- index_end = command.find(',')
- if 0 <= index_end:
- command = command[:index_end] # sometimes a comma magically appears, don't want it
- running_apps = subprocess.Popen('ps ax -o cmd', stdout=subprocess.PIPE, shell=True)
- (output, err) = running_apps.communicate()
- temp = output.split('\n')
-
- def find_editor_linux(name, search_obj):
- for line in search_obj:
- if 0 <= line.find(name):
- path = line
- return True, path
- return False, ''
-
- (success_sublime, editor_path_sublime) = find_editor_linux('sublime_text', temp)
- (success_atom, editor_path_atom) = find_editor_linux('atom', temp)
-
- if success_sublime:
- subprocess.Popen([editor_path_sublime, command])
-
- elif success_atom:
- subprocess.Popen([editor_path_atom, command])
-
- else:
- os.system('xdg-open ' + file_path)
-
- elif current_OS == 'Darwin': # MAC
-
- command = file_path + ':' + str(line_num) + ':' + str(column_num)
- index_end = command.find(',')
- if 0 <= index_end:
- command = command[:index_end] # sometimes a comma magically appears, don't want it
- running_apps = subprocess.Popen('ps axwww -o command', stdout=subprocess.PIPE, shell=True)
- (output, err) = running_apps.communicate()
- temp = output.split('\n')
-
- def find_editor_mac(name, search_obj):
- for line in search_obj:
- if 0 <= line.find(name):
- path = line
- if 0 <= path.find('-psn'):
- path = path[:path.find('-psn') - 1]
- return True, path
- return False, ''
-
- (success_sublime, editor_path_sublime) = find_editor_mac('Sublime', temp)
- (success_atom, editor_path_atom) = find_editor_mac('Atom', temp)
-
- if success_sublime:
- subprocess.Popen([editor_path_sublime, command])
-
- elif success_atom:
- subprocess.Popen([editor_path_atom, command])
-
- else:
- os.system('open ' + file_path)
-
-# end - open_file
-
-
-# Get the last build environment
-def get_build_last():
- env_last = ''
- DIR_PWD = os.listdir('.')
- if '.pio' in DIR_PWD:
- date_last = 0.0
- DIR__pioenvs = os.listdir('.pio')
- for name in DIR__pioenvs:
- if 0 <= name.find('.') or 0 <= name.find('-'): # skip files in listing
- continue
- DIR_temp = os.listdir('.pio/build/' + name)
- for names_temp in DIR_temp:
-
- if 0 == names_temp.find('firmware.'):
- date_temp = os.path.getmtime('.pio/build/' + name + '/' + names_temp)
- if date_temp > date_last:
- date_last = date_temp
- env_last = name
- return env_last
-
-
-# Get the board being built from the Configuration.h file
-# return: board name, major version of Marlin being used (1 or 2)
-def get_board_name():
- board_name = ''
- # get board name
-
- with open('Marlin/Configuration.h', 'r') as myfile:
- Configuration_h = myfile.read()
-
- Configuration_h = Configuration_h.split('\n')
- Marlin_ver = 0 # set version to invalid number
- for lines in Configuration_h:
- if 0 == lines.find('#define CONFIGURATION_H_VERSION 01'):
- Marlin_ver = 1
- if 0 == lines.find('#define CONFIGURATION_H_VERSION 02'):
- Marlin_ver = 2
- board = lines.find(' BOARD_') + 1
- motherboard = lines.find(' MOTHERBOARD ') + 1
- define = lines.find('#define ')
- comment = lines.find('//')
- if (comment == -1 or comment > board) and \
- board > motherboard and \
- motherboard > define and \
- define >= 0 :
- spaces = lines.find(' ', board) # find the end of the board substring
- if spaces == -1:
- board_name = lines[board:]
- else:
- board_name = lines[board:spaces]
- break
-
- return board_name, Marlin_ver
-
-
-# extract first environment name found after the start position
-# return: environment name and position to start the next search from
-def get_env_from_line(line, start_position):
- env = ''
- next_position = -1
- env_position = line.find('env:', start_position)
- if 0 < env_position:
- next_position = line.find(' ', env_position + 4)
- if 0 < next_position:
- env = line[env_position + 4:next_position]
- else:
- env = line[env_position + 4:] # at the end of the line
- return env, next_position
-
-
-def invalid_board():
- print('ERROR - invalid board')
- print(board_name)
- raise SystemExit(0) # quit if unable to find board
-
-# scan pins.h for board name and return the environment(s) found
-def get_starting_env(board_name_full, version):
- # get environment starting point
-
- if version == 1:
- path = 'Marlin/pins.h'
- if version == 2:
- path = 'Marlin/src/pins/pins.h'
- with open(path, 'r') as myfile:
- pins_h = myfile.read()
-
- board_name = board_name_full[6:] # only use the part after "BOARD_" since we're searching the pins.h file
- pins_h = pins_h.split('\n')
- list_start_found = False
- possible_envs = None
- for i, line in enumerate(pins_h):
- if 0 < line.find("Unknown MOTHERBOARD value set in Configuration.h"):
- invalid_board()
- if list_start_found == False and 0 < line.find('1280'):
- list_start_found = True
- elif list_start_found == False: # skip lines until find start of CPU list
- continue
-
- # Use a regex to find the board. Make sure it is surrounded by separators so the full boardname
- # will be matched, even if multiple exist in a single MB macro. This avoids problems with boards
- # such as MALYAN_M200 and MALYAN_M200_V2 where one board is a substring of the other.
- if re.search(r'MB.*[\(, ]' + board_name + r'[, \)]', line):
- # need to look at the next line for environment info
- possible_envs = re.findall(r'env:([^ ]+)', pins_h[i + 1])
- break
- return possible_envs
-
-
-# get environment to be used for the build
-# return: environment
-def get_env(board_name, ver_Marlin):
-
- def no_environment():
- print('ERROR - no environment for this board')
- print(board_name)
- raise SystemExit(0) # no environment so quit
-
- possible_envs = get_starting_env(board_name, ver_Marlin)
-
- if not possible_envs:
- no_environment()
-
- # Proceed to ask questions based on the available environments to filter down to a smaller list.
- # If more then one remains after this filtering the user will be prompted to choose between
- # all remaining options.
-
- # Filter selection based on CPU choice
- CPU_questions = [
- {'options':['1280', '2560'], 'text':'1280 or 2560 CPU?', 'default':2},
- {'options':['644', '1284'], 'text':'644 or 1284 CPU?', 'default':2},
- {'options':['STM32F103RC', 'STM32F103RE'], 'text':'MCU Type?', 'default':1}]
-
- for question in CPU_questions:
- if any(question['options'][0] in env for env in possible_envs) and any(question['options'][1] in env for env in possible_envs):
- get_answer(board_name, question['text'], [question['options'][0], question['options'][1]], question['default'])
- possible_envs = [env for env in possible_envs if question['options'][get_answer_val - 1] in env]
-
- # Choose which STM32 framework to use, if both are available
- if [env for env in possible_envs if '_maple' in env] and [env for env in possible_envs if '_maple' not in env]:
- get_answer(board_name, 'Which STM32 Framework should be used?', ['ST STM32 (Preferred)', 'Maple (Deprecated)'])
- if 1 == get_answer_val:
- possible_envs = [env for env in possible_envs if '_maple' not in env]
- else:
- possible_envs = [env for env in possible_envs if '_maple' in env]
-
- # Both USB and non-USB STM32 options exist, filter based on these
- if any('STM32F103R' in env for env in possible_envs) and any('_USB' in env for env in possible_envs) and any('_USB' not in env for env in possible_envs):
- get_answer(board_name, 'USB Support?', ['USB', 'No USB'])
- if 1 == get_answer_val:
- possible_envs = [env for env in possible_envs if '_USB' in env]
- else:
- possible_envs = [env for env in possible_envs if '_USB' not in env]
-
- if not possible_envs:
- no_environment()
- if len(possible_envs) == 1:
- return possible_envs[0] # only one environment so finished
-
- target_env = None
-
- # A few environments require special behavior
- if 'LPC1768' in possible_envs:
- if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'LPC1768_debug_and_upload'):
- target_env = 'LPC1768_debug_and_upload'
- else:
- target_env = 'LPC1768'
- elif 'DUE' in possible_envs:
- target_env = 'DUE'
- if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'DUE_debug'):
- target_env = 'DUE_debug'
- elif 'DUE_USB' in possible_envs:
- get_answer(board_name, 'DUE Download Port?', ['(Native) USB port', 'Programming port'])
- if 1 == get_answer_val:
- target_env = 'DUE_USB'
- else:
- target_env = 'DUE'
- else:
- options = possible_envs
- # Perform some substitutions for environment names which follow a consistent
- # naming pattern and are very commonly used. This is fragile code, and replacements
- # should only be made here for stable environments unlikely to change often.
- for i, option in enumerate(options):
- if 'melzi' in option:
- options[i] = 'Melzi'
- elif 'sanguino1284p' in option:
- options[i] = 'sanguino1284p'
- if 'optiboot' in option:
- options[i] = options[i] + ' (Optiboot Bootloader)'
- if 'optimized' in option:
- options[i] = options[i] + ' (Optimized for Size)'
- get_answer(board_name, 'Which environment?', options)
- target_env = possible_envs[get_answer_val - 1]
-
- if build_type == 'traceback' and target_env != 'LPC1768_debug_and_upload' and target_env != 'DUE_debug' and Marlin_ver == 2:
- print("ERROR - this board isn't setup for traceback")
- print('board_name: ', board_name)
- print('target_env: ', target_env)
- raise SystemExit(0)
-
- return target_env
-
-# end - get_env
-
-
-# puts screen text into queue so that the parent thread can fetch the data from this thread
-if python_ver == 2:
- import Queue as queue
-else:
- import queue as queue
-IO_queue = queue.Queue()
-
-
-#PIO_queue = queue.Queue() not used!
-def write_to_screen_queue(text, format_tag='normal'):
- double_in = [text, format_tag]
- IO_queue.put(double_in, block=False)
-
-
-#
-# send one line to the terminal screen with syntax highlighting
-#
-# input: unformatted text, flags from previous run
-# return: formatted text ready to go to the terminal, flags from this run
-#
-# This routine remembers the status from call to call because previous
-# lines can affect how the current line is highlighted
-#
-
-# 'static' variables - init here and then keep updating them from within print_line
-warning = False
-warning_FROM = False
-error = False
-standard = True
-prev_line_COM = False
-next_line_warning = False
-warning_continue = False
-line_counter = 0
-
-
-def line_print(line_input):
-
- global warning
- global warning_FROM
- global error
- global standard
- global prev_line_COM
- global next_line_warning
- global warning_continue
- global line_counter
-
- # all '0' elements must precede all '1' elements or they'll be skipped
- platformio_highlights = [
- ['Environment', 0, 'highlight_blue'], ['[SKIP]', 1, 'warning'], ['[IGNORED]', 1, 'warning'], ['[ERROR]', 1, 'error'],
- ['[FAILED]', 1, 'error'], ['[SUCCESS]', 1, 'highlight_green']
- ]
-
- def write_to_screen_with_replace(text, highlights): # search for highlights & split line accordingly
- did_something = False
- for highlight in highlights:
- found = text.find(highlight[0])
- if did_something == True:
- break
- if found >= 0:
- did_something = True
- if 0 == highlight[1]:
- found_1 = text.find(' ')
- found_tab = text.find('\t')
- if not (0 <= found_1 <= found_tab):
- found_1 = found_tab
- write_to_screen_queue(text[:found_1 + 1])
- for highlight_2 in highlights:
- if highlight[0] == highlight_2[0]:
- continue
- found = text.find(highlight_2[0])
- if found >= 0:
- found_space = text.find(' ', found_1 + 1)
- found_tab = text.find('\t', found_1 + 1)
- if not (0 <= found_space <= found_tab):
- found_space = found_tab
- found_right = text.find(']', found + 1)
- write_to_screen_queue(text[found_1 + 1:found_space + 1], highlight[2])
- write_to_screen_queue(text[found_space + 1:found + 1])
- write_to_screen_queue(text[found + 1:found_right], highlight_2[2])
- write_to_screen_queue(text[found_right:] + '\n')
- break
- break
- if 1 == highlight[1]:
- found_right = text.find(']', found + 1)
- write_to_screen_queue(text[:found + 1])
- write_to_screen_queue(text[found + 1:found_right], highlight[2])
- write_to_screen_queue(text[found_right:] + '\n' + '\n')
- break
- if did_something == False:
- r_loc = text.find('\r') + 1
- if 0 < r_loc < len(text): # need to split this line
- text = text.split('\r')
- for line in text:
- if line != '':
- write_to_screen_queue(line + '\n')
- else:
- write_to_screen_queue(text + '\n')
-
- # end - write_to_screen_with_replace
-
-# scan the line
- line_counter = line_counter + 1
- max_search = len(line_input)
- if max_search > 3:
- max_search = 3
- beginning = line_input[:max_search]
-
- # set flags
- if 0 < line_input.find(': warning: '): # start of warning block
- warning = True
- warning_FROM = False
- error = False
- standard = False
- prev_line_COM = False
- prev_line_COM = False
- warning_continue = True
- if 0 < line_input.find('Thank you') or 0 < line_input.find('SUMMARY'):
- warning = False #standard line found
- warning_FROM = False
- error = False
- standard = True
- prev_line_COM = False
- warning_continue = False
- elif beginning == 'War' or \
- beginning == '#er' or \
- beginning == 'In ' or \
- (beginning != 'Com' and prev_line_COM == True and not(beginning == 'Arc' or beginning == 'Lin' or beginning == 'Ind') or \
- next_line_warning == True):
- warning = True #warning found
- warning_FROM = False
- error = False
- standard = False
- prev_line_COM = False
- elif beginning == 'Com' or \
- beginning == 'Ver' or \
- beginning == ' [E' or \
- beginning == 'Rem' or \
- beginning == 'Bui' or \
- beginning == 'Ind' or \
- beginning == 'PLA':
- warning = False #standard line found
- warning_FROM = False
- error = False
- standard = True
- prev_line_COM = False
- warning_continue = False
- elif beginning == '***':
- warning = False # error found
- warning_FROM = False
- error = True
- standard = False
- prev_line_COM = False
- elif 0 < line_input.find(': error:') or \
- 0 < line_input.find(': fatal error:'): # start of warning /error block
- warning = False # error found
- warning_FROM = False
- error = True
- standard = False
- prev_line_COM = False
- warning_continue = True
- elif beginning == 'fro' and warning == True or \
- beginning == '.pi' : # start of warning /error block
- warning_FROM = True
- prev_line_COM = False
- warning_continue = True
- elif warning_continue == True:
- warning = True
- warning_FROM = False # keep the warning status going until find a standard line or an error
- error = False
- standard = False
- prev_line_COM = False
- warning_continue = True
-
- else:
- warning = False # unknown so assume standard line
- warning_FROM = False
- error = False
- standard = True
- prev_line_COM = False
- warning_continue = False
-
- if beginning == 'Com':
- prev_line_COM = True
-
-# print based on flags
- if standard == True:
- write_to_screen_with_replace(line_input, platformio_highlights) #print white on black with substitutions
- if warning == True:
- write_to_screen_queue(line_input + '\n', 'warning')
- if error == True:
- write_to_screen_queue(line_input + '\n', 'error')
-
-# end - line_print
-
-
-##########################################################################
-# #
-# run Platformio #
-# #
-##########################################################################
-
-# build platformio run -e target_env
-# clean platformio run --target clean -e target_env
-# upload platformio run --target upload -e target_env
-# traceback platformio run --target upload -e target_env
-# program platformio run --target program -e target_env
-# test platformio test upload -e target_env
-# remote platformio remote run --target upload -e target_env
-# debug platformio debug -e target_env
-
-
-def sys_PIO():
-
- ##########################################################################
- # #
- # run Platformio inside the same shell as this Python script #
- # #
- ##########################################################################
-
- global build_type
- global target_env
-
- import os
-
- print('build_type: ', build_type)
- print('starting platformio')
-
- if build_type == 'build':
- # pio_result = os.system("echo -en '\033c'")
- pio_result = os.system('platformio run -e ' + target_env)
- elif build_type == 'clean':
- pio_result = os.system('platformio run --target clean -e ' + target_env)
- elif build_type == 'upload':
- pio_result = os.system('platformio run --target upload -e ' + target_env)
- elif build_type == 'traceback':
- pio_result = os.system('platformio run --target upload -e ' + target_env)
- elif build_type == 'program':
- pio_result = os.system('platformio run --target program -e ' + target_env)
- elif build_type == 'test':
- pio_result = os.system('platformio test upload -e ' + target_env)
- elif build_type == 'remote':
- pio_result = os.system('platformio remote run --target program -e ' + target_env)
- elif build_type == 'debug':
- pio_result = os.system('platformio debug -e ' + target_env)
- else:
- print('ERROR - unknown build type: ', build_type)
- raise SystemExit(0) # kill everything
-
- # stream output from subprocess and split it into lines
- #for line in iter(pio_subprocess.stdout.readline, ''):
- # line_print(line.replace('\n', ''))
-
- # append info used to run PlatformIO
- # write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen
- # write_to_screen_queue('Build type: ' + build_type + '\n')
- # write_to_screen_queue('Environment used: ' + target_env + '\n')
- # write_to_screen_queue(str(datetime.now()) + '\n')
-
-# end - sys_PIO
-
-
-def run_PIO(dummy):
-
- global build_type
- global target_env
- global board_name
- print('build_type: ', build_type)
-
- import subprocess
-
- print('starting platformio')
-
- if build_type == 'build':
- # platformio run -e target_env
- # combine stdout & stderr so all compile messages are included
- pio_subprocess = subprocess.Popen(
- ['platformio', 'run', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
- )
-
- elif build_type == 'clean':
- # platformio run --target clean -e target_env
- # combine stdout & stderr so all compile messages are included
- pio_subprocess = subprocess.Popen(
- ['platformio', 'run', '--target', 'clean', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
- )
-
- elif build_type == 'upload':
- # platformio run --target upload -e target_env
- # combine stdout & stderr so all compile messages are included
- pio_subprocess = subprocess.Popen(
- ['platformio', 'run', '--target', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
- )
-
- elif build_type == 'traceback':
- # platformio run --target upload -e target_env - select the debug environment if there is one
- # combine stdout & stderr so all compile messages are included
- pio_subprocess = subprocess.Popen(
- ['platformio', 'run', '--target', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
- )
-
- elif build_type == 'program':
- # platformio run --target program -e target_env
- # combine stdout & stderr so all compile messages are included
- pio_subprocess = subprocess.Popen(
- ['platformio', 'run', '--target', 'program', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
- )
-
- elif build_type == 'test':
- #platformio test upload -e target_env
- # combine stdout & stderr so all compile messages are included
- pio_subprocess = subprocess.Popen(
- ['platformio', 'test', 'upload', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
- )
-
- elif build_type == 'remote':
- # platformio remote run --target upload -e target_env
- # combine stdout & stderr so all compile messages are included
- pio_subprocess = subprocess.Popen(
- ['platformio', 'remote', 'run', '--target', 'program', '-e', target_env],
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT
- )
-
- elif build_type == 'debug':
- # platformio debug -e target_env
- # combine stdout & stderr so all compile messages are included
- pio_subprocess = subprocess.Popen(
- ['platformio', 'debug', '-e', target_env], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
- )
-
- else:
- print('ERROR - unknown build type: ', build_type)
- raise SystemExit(0) # kill everything
-
-# stream output from subprocess and split it into lines
- if python_ver == 2:
- for line in iter(pio_subprocess.stdout.readline, ''):
- line_print(line.replace('\n', ''))
- else:
- for line in iter(pio_subprocess.stdout.readline, b''):
- line = line.decode('utf-8')
- line_print(line.replace('\n', ''))
-
-# append info used to run PlatformIO
- write_to_screen_queue('\nBoard name: ' + board_name + '\n') # put build info at the bottom of the screen
- write_to_screen_queue('Build type: ' + build_type + '\n')
- write_to_screen_queue('Environment used: ' + target_env + '\n')
- write_to_screen_queue(str(datetime.now()) + '\n')
-
-# end - run_PIO
-
-########################################################################
-
-import threading
-if python_ver == 2:
- import Tkinter as tk
- import Queue as queue
- import ttk
- from Tkinter import Tk, Frame, Text, Scrollbar, Menu
- #from tkMessageBox import askokcancel this is not used: removed
- import tkFileDialog as fileDialog
-else:
- import tkinter as tk
- import queue as queue
- from tkinter import ttk, Tk, Frame, Text, Menu
-import sys
-que = queue.Queue()
-#IO_queue = queue.Queue()
-
-
-class output_window(Text):
- # based on Super Text
- global continue_updates
- continue_updates = True
-
- global search_position
- search_position = '' # start with invalid search position
-
- global error_found
- error_found = False # are there any errors?
-
- def __init__(self):
-
- self.root = tk.Tk()
- self.root.attributes("-topmost", True)
- self.frame = tk.Frame(self.root)
- self.frame.pack(fill='both', expand=True)
-
- # text widget
- #self.text = tk.Text(self.frame, borderwidth=3, relief="sunken")
- Text.__init__(self, self.frame, borderwidth=3, relief="sunken")
- self.config(tabs=(400, )) # configure Text widget tab stops
- self.config(background='black', foreground='white', font=("consolas", 12), wrap='word', undo='True')
- #self.config(background = 'black', foreground = 'white', font= ("consolas", 12), wrap = 'none', undo = 'True')
- self.config(height=24, width=100)
- self.config(insertbackground='pale green') # keyboard insertion point
- self.pack(side='left', fill='both', expand=True)
-
- self.tag_config('normal', foreground='white')
- self.tag_config('warning', foreground='yellow')
- self.tag_config('error', foreground='red')
- self.tag_config('highlight_green', foreground='green')
- self.tag_config('highlight_blue', foreground='cyan')
- self.tag_config('error_highlight_inactive', background='dim gray')
- self.tag_config('error_highlight_active', background='light grey')
-
- self.bind_class("Text", "", self.select_all) # required in windows, works in others
- self.bind_all("", self.scroll_errors)
- self.bind_class("", self.rebuild)
-
- # scrollbar
-
- scrb = tk.Scrollbar(self.frame, orient='vertical', command=self.yview)
- self.config(yscrollcommand=scrb.set)
- scrb.pack(side='right', fill='y')
-
- #self.scrb_Y = tk.Scrollbar(self.frame, orient='vertical', command=self.yview)
- #self.scrb_Y.config(yscrollcommand=self.scrb_Y.set)
- #self.scrb_Y.pack(side='right', fill='y')
-
- #self.scrb_X = tk.Scrollbar(self.frame, orient='horizontal', command=self.xview)
- #self.scrb_X.config(xscrollcommand=self.scrb_X.set)
- #self.scrb_X.pack(side='bottom', fill='x')
-
- #scrb_X = tk.Scrollbar(self, orient=tk.HORIZONTAL, command=self.xview) # tk.HORIZONTAL now have a horizsontal scroll bar BUT... shrinks it to a postage stamp and hides far right behind the vertical scroll bar
- #self.config(xscrollcommand=scrb_X.set)
- #scrb_X.pack(side='bottom', fill='x')
-
- #scrb= tk.Scrollbar(self, orient='vertical', command=self.yview)
- #self.config(yscrollcommand=scrb.set)
- #scrb.pack(side='right', fill='y')
-
- #self.config(height = 240, width = 1000) # didn't get the size baCK TO NORMAL
- #self.pack(side='left', fill='both', expand=True) # didn't get the size baCK TO NORMAL
-
- # pop-up menu
- self.popup = tk.Menu(self, tearoff=0)
-
- self.popup.add_command(label='Copy', command=self._copy)
- self.popup.add_command(label='Paste', command=self._paste)
- self.popup.add_separator()
- self.popup.add_command(label='Cut', command=self._cut)
- self.popup.add_separator()
- self.popup.add_command(label='Select All', command=self._select_all)
- self.popup.add_command(label='Clear All', command=self._clear_all)
- self.popup.add_separator()
- self.popup.add_command(label='Save As', command=self._file_save_as)
- self.popup.add_separator()
- #self.popup.add_command(label='Repeat Build(CTL-shift-r)', command=self._rebuild)
- self.popup.add_command(label='Repeat Build', command=self._rebuild)
- self.popup.add_separator()
- self.popup.add_command(label='Scroll Errors (CTL-shift-e)', command=self._scroll_errors)
- self.popup.add_separator()
- self.popup.add_command(label='Open File at Cursor', command=self._open_selected_file)
-
- if current_OS == 'Darwin': # MAC
- self.bind('', self._show_popup) # macOS only
- else:
- self.bind('', self._show_popup) # Windows & Linux
-
-# threading & subprocess section
-
- def start_thread(self, ):
- global continue_updates
- # create then start a secondary thread to run an arbitrary function
- # must have at least one argument
- self.secondary_thread = threading.Thread(target=lambda q, arg1: q.put(run_PIO(arg1)), args=(que, ''))
- self.secondary_thread.start()
- continue_updates = True
- # check the Queue in 50ms
- self.root.after(50, self.check_thread)
- self.root.after(50, self.update)
-
- def check_thread(self): # wait for user to kill the window
- global continue_updates
- if continue_updates == True:
- self.root.after(10, self.check_thread)
-
- def update(self):
- global continue_updates
- if continue_updates == True:
- self.root.after(10, self.update) #method is called every 50ms
- temp_text = ['0', '0']
- if IO_queue.empty():
- if not (self.secondary_thread.is_alive()):
- continue_updates = False # queue is exhausted and thread is dead so no need for further updates
- else:
- try:
- temp_text = IO_queue.get(block=False)
- except queue.Empty:
- continue_updates = False # queue is exhausted so no need for further updates
- else:
- self.insert('end', temp_text[0], temp_text[1])
- self.see("end") # make the last line visible (scroll text off the top)
-
-# text editing section
-
- def _scroll_errors(self):
- global search_position
- global error_found
- if search_position == '': # first time so highlight all errors
- countVar = tk.IntVar()
- search_position = '1.0'
- search_count = 0
- while search_position != '' and search_count < 100:
- search_position = self.search("error", search_position, stopindex="end", count=countVar, nocase=1)
- search_count = search_count + 1
- if search_position != '':
- error_found = True
- end_pos = '{}+{}c'.format(search_position, 5)
- self.tag_add("error_highlight_inactive", search_position, end_pos)
- search_position = '{}+{}c'.format(search_position, 1) # point to the next character for new search
- else:
- break
-
- if error_found:
- if search_position == '':
- search_position = self.search("error", '1.0', stopindex="end", nocase=1) # new search
- else: # remove active highlight
- end_pos = '{}+{}c'.format(search_position, 5)
- start_pos = '{}+{}c'.format(search_position, -1)
- self.tag_remove("error_highlight_active", start_pos, end_pos)
- search_position = self.search(
- "error", search_position, stopindex="end", nocase=1
- ) # finds first occurrence AGAIN on the first time through
- if search_position == "": # wrap around
- search_position = self.search("error", '1.0', stopindex="end", nocase=1)
- end_pos = '{}+{}c'.format(search_position, 5)
- self.tag_add("error_highlight_active", search_position, end_pos) # add active highlight
- self.see(search_position)
- search_position = '{}+{}c'.format(search_position, 1) # point to the next character for new search
-
- def scroll_errors(self, event):
- self._scroll_errors()
-
- def _rebuild(self):
- #global board_name
- #global Marlin_ver
- #global target_env
- #board_name, Marlin_ver = get_board_name()
- #target_env = get_env(board_name, Marlin_ver)
- self.start_thread()
-
- def rebuild(self, event):
- print("event happened")
- self._rebuild()
-
- def _open_selected_file(self):
- current_line = self.index('insert')
- line_start = current_line[:current_line.find('.')] + '.0'
- line_end = current_line[:current_line.find('.')] + '.200'
- self.mark_set("path_start", line_start)
- self.mark_set("path_end", line_end)
- path = self.get("path_start", "path_end")
- from_loc = path.find('from ')
- colon_loc = path.find(': ')
- if 0 <= from_loc and ((colon_loc == -1) or (from_loc < colon_loc)):
- path = path[from_loc + 5:]
- if 0 <= colon_loc:
- path = path[:colon_loc]
- if 0 <= path.find('\\') or 0 <= path.find('/'): # make sure it really contains a path
- open_file(path)
-
- def _file_save_as(self):
- self.filename = fileDialog.asksaveasfilename(defaultextension='.txt')
- f = open(self.filename, 'w')
- f.write(self.get('1.0', 'end'))
- f.close()
-
- def copy(self, event):
- try:
- selection = self.get(*self.tag_ranges('sel'))
- self.clipboard_clear()
- self.clipboard_append(selection)
- except TypeError:
- pass
-
- def cut(self, event):
- try:
- selection = self.get(*self.tag_ranges('sel'))
- self.clipboard_clear()
- self.clipboard_append(selection)
- self.delete(*self.tag_ranges('sel'))
- except TypeError:
- pass
-
- def _show_popup(self, event):
- '''right-click popup menu'''
-
- if self.root.focus_get() != self:
- self.root.focus_set()
-
- try:
- self.popup.tk_popup(event.x_root, event.y_root, 0)
- finally:
- self.popup.grab_release()
-
- def _cut(self):
- try:
- selection = self.get(*self.tag_ranges('sel'))
- self.clipboard_clear()
- self.clipboard_append(selection)
- self.delete(*self.tag_ranges('sel'))
- except TypeError:
- pass
-
- def cut(self, event):
- self._cut()
-
- def _copy(self):
-
- try:
- selection = self.get(*self.tag_ranges('sel'))
- self.clipboard_clear()
- self.clipboard_append(selection)
- except TypeError:
- pass
-
- def copy(self, event):
- self._copy()
-
- def _paste(self):
- self.insert('insert', self.selection_get(selection='CLIPBOARD'))
-
- def _select_all(self):
- self.tag_add('sel', '1.0', 'end')
-
- def select_all(self, event):
- self.tag_add('sel', '1.0', 'end')
-
- def _clear_all(self):
- #'''erases all text'''
- #
- #isok = askokcancel('Clear All', 'Erase all text?', frame=self,
- # default='ok')
- #if isok:
- # self.delete('1.0', 'end')
- self.delete('1.0', 'end')
-
-# end - output_window
-
-
-def main():
-
- ##########################################################################
- # #
- # main program #
- # #
- ##########################################################################
-
- global build_type
- global target_env
- global board_name
- global Marlin_ver
-
- board_name, Marlin_ver = get_board_name()
-
- target_env = get_env(board_name, Marlin_ver)
-
- # Re-use the VSCode terminal, if possible
- if os.environ.get('PLATFORMIO_CALLER', '') == 'vscode':
- sys_PIO()
- else:
- auto_build = output_window()
- auto_build.start_thread() # executes the "run_PIO" function
-
- auto_build.root.mainloop()
-
-
-if __name__ == '__main__':
-
- main()
diff --git a/firmware/buildroot/share/vscode/create_custom_upload_command_CDC.py b/firmware/buildroot/share/vscode/create_custom_upload_command_CDC.py
deleted file mode 100644
index b2d4d57..0000000
--- a/firmware/buildroot/share/vscode/create_custom_upload_command_CDC.py
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/env python
-#
-# Builds custom upload command
-# 1) Run platformio as a subprocess to find a COM port
-# 2) Build the upload command
-# 3) Exit and let upload tool do the work
-#
-# This script runs between completion of the library/dependencies installation and compilation.
-#
-# Will continue on if a COM port isn't found so that the compilation can be done.
-#
-
-from __future__ import print_function
-from __future__ import division
-
-import subprocess, os, platform
-from SCons.Script import DefaultEnvironment
-
-current_OS = platform.system()
-
-env = DefaultEnvironment()
-
-build_type = os.environ.get("BUILD_TYPE", 'Not Set')
-
-
-if not(build_type == 'upload' or build_type == 'traceback' or build_type == 'Not Set') :
- env.Replace(UPLOAD_PROTOCOL = 'teensy-gui') # run normal Teensy2 scripts
-else:
- com_first = ''
- com_last = ''
- com_CDC = ''
- description_first = ''
- description_last = ''
- description_CDC = ''
-
- #
- # grab the first com port that pops up unless we find one we know for sure
- # is a CDC device
- #
- def get_com_port(com_search_text, descr_search_text, start):
-
- global com_first
- global com_last
- global com_CDC
- global description_first
- global description_last
- global description_CDC
-
-
- print('\nLooking for Serial Port\n')
-
- # stream output from subprocess and split it into lines
- pio_subprocess = subprocess.Popen(['platformio', 'device', 'list'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
- looking_for_description = False
- for line in iter(pio_subprocess.stdout.readline, ''):
- if 0 <= line.find(com_search_text):
- looking_for_description = True
- com_last = line.replace('\n', '')
- if com_first == '':
- com_first = com_last
- if 0 <= line.find(descr_search_text) and looking_for_description:
- looking_for_description = False
- description_last = line[ start : ]
- if description_first == '':
- description_first = description_last
- if 0 <= description_last.find('CDC'):
- com_CDC = com_last
- description_CDC = description_last
-
- if com_CDC == '' and com_first != '':
- com_CDC = com_first
- description_CDC = description_first
- elif com_CDC == '':
- com_CDC = 'COM_PORT_NOT_FOUND'
-
- while 0 <= com_CDC.find('\n'):
- com_CDC = com_CDC.replace('\n', '')
- while 0 <= com_CDC.find('\r'):
- com_CDC = com_CDC.replace('\r', '')
-
- if com_CDC == 'COM_PORT_NOT_FOUND':
- print(com_CDC, '\n')
- else:
- print('FOUND: ', com_CDC)
- print('DESCRIPTION: ', description_CDC, '\n')
-
- if current_OS == 'Windows':
-
- get_com_port('COM', 'Hardware ID:', 13)
-
- # avrdude_conf_path = env.get("PIOHOME_DIR") + '\\packages\\toolchain-atmelavr\\etc\\avrdude.conf'
- avrdude_conf_path = 'buildroot\\share\\vscode\\avrdude.conf'
-
- avrdude_exe_path = 'buildroot\\share\\vscode\\avrdude_5.10.exe'
-
- # source_path = env.get("PROJECTBUILD_DIR") + '\\' + env.get("PIOENV") + '\\firmware.hex'
- source_path = '.pio\\build\\' + env.get("PIOENV") + '\\firmware.hex'
-
- upload_string = avrdude_exe_path + ' -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i'
-
-
- if current_OS == 'Darwin': # MAC
-
- get_com_port('usbmodem', 'Description:', 13)
-
-# avrdude_conf_path = env.get("PIOHOME_DIR") + '/packages/toolchain-atmelavr/etc/avrdude.conf'
- avrdude_conf_path = 'buildroot/share/vscode/avrdude_macOS.conf'
-
-
- avrdude_exe_path = 'buildroot/share/vscode/avrdude_5.10_macOS'
-
-# source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex'
- source_path = '.pio/build/' + env.get("PIOENV") + '/firmware.hex'
-
-
-# upload_string = 'avrdude -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i'
- upload_string = avrdude_exe_path + ' -p usb1286 -c avr109 -P ' + com_CDC + ' -C ' + avrdude_conf_path + ' -U flash:w:' + source_path + ':i'
- print('upload_string: ', upload_string)
-
-
-
- if current_OS == 'Linux':
-
- get_com_port('/dev/tty', 'Description:', 13)
-
-# avrdude_conf_path = env.get("PIOHOME_DIR") + '/packages/toolchain-atmelavr/etc/avrdude.conf'
- avrdude_conf_path = 'buildroot/share/vscode/avrdude_linux.conf'
-
-
- avrdude_exe_path = 'buildroot/share/vscode/avrdude_5.10_linux'
-# source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex'
- source_path = '.pio/build/' + env.get("PIOENV") + '/firmware.hex'
-
-# upload_string = 'avrdude -p usb1286 -c avr109 -P ' + com_CDC + ' -U flash:w:' + source_path + ':i'
- upload_string = avrdude_exe_path + ' -p usb1286 -c avr109 -P ' + com_CDC + ' -C ' + avrdude_conf_path + ' -U flash:w:' + source_path + ':i'
-
-
- env.Replace(
- UPLOADCMD = upload_string,
- MAXIMUM_RAM_SIZE = 8192,
- MAXIMUM_SIZE = 130048
- )
diff --git a/firmware/buildroot/share/vscode/create_custom_upload_command_DFU.py b/firmware/buildroot/share/vscode/create_custom_upload_command_DFU.py
deleted file mode 100644
index 22809e1..0000000
--- a/firmware/buildroot/share/vscode/create_custom_upload_command_DFU.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Builds custom upload command
-# 1) Run platformio as a subprocess to find a COM port
-# 2) Build the upload command
-# 3) Exit and let upload tool do the work
-#
-# This script runs between completion of the library/dependencies installation and compilation.
-#
-# Will continue on if a COM port isn't found so that the compilation can be done.
-#
-
-import os, platform
-from SCons.Script import DefaultEnvironment
-
-current_OS = platform.system()
-
-env = DefaultEnvironment()
-
-build_type = os.environ.get("BUILD_TYPE", 'Not Set')
-if not(build_type == 'upload' or build_type == 'traceback' or build_type == 'Not Set') :
- env.Replace(UPLOAD_PROTOCOL = 'teensy-gui') # run normal Teensy2 scripts
-else:
-
- if current_OS == 'Windows':
- avrdude_conf_path = env.get("PIOHOME_DIR") + '\\packages\\toolchain-atmelavr\\etc\\avrdude.conf'
-
- source_path = env.get("PROJECTBUILD_DIR") + '\\' + env.get("PIOENV") + '\\firmware.hex'
-
- upload_string = 'avrdude -p usb1286 -c flip1 -C ' + avrdude_conf_path + ' -U flash:w:' + source_path + ':i'
-
- else:
- source_path = env.get("PROJECTBUILD_DIR") + '/' + env.get("PIOENV") + '/firmware.hex'
-
- upload_string = 'avrdude -p usb1286 -c flip1 -U flash:w:' + source_path + ':i'
-
-
- env.Replace(
- UPLOADCMD = upload_string,
- MAXIMUM_RAM_SIZE = 8192,
- MAXIMUM_SIZE = 130048
- )
diff --git a/firmware/buildroot/tests/ARMED b/firmware/buildroot/tests/ARMED
old mode 100755
new mode 100644
index 7b9fef1..e47e101
--- a/firmware/buildroot/tests/ARMED
+++ b/firmware/buildroot/tests/ARMED
@@ -7,13 +7,10 @@
set -e
#
-# Build with the default configurations
+# Build with modified ArmEd configuration
#
restore_configs
use_example_configs ArmEd
opt_set X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208
opt_enable LASER_SYNCHRONOUS_M106_M107
exec_test $1 $2 "ArmEd Example Configuration with mixed TMC Drivers" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/BTT_BTT002 b/firmware/buildroot/tests/BTT_BTT002
old mode 100755
new mode 100644
index 5398d30..121aace
--- a/firmware/buildroot/tests/BTT_BTT002
+++ b/firmware/buildroot/tests/BTT_BTT002
@@ -21,6 +21,3 @@ exec_test $1 $2 "BigTreeTech BTT002 Default Configuration plus TMC steppers" "$3
#
use_example_configs Prusa/MK3S-BigTreeTech-BTT002
exec_test $1 $2 "BigTreeTech BTT002 with Prusa MK3S and related options" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/BTT_GTR_V1_0 b/firmware/buildroot/tests/BTT_GTR_V1_0
old mode 100755
new mode 100644
index dcfd2b3..c6cb7d5
--- a/firmware/buildroot/tests/BTT_GTR_V1_0
+++ b/firmware/buildroot/tests/BTT_GTR_V1_0
@@ -46,6 +46,3 @@ opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SWITCHING_TOOLHEAD TOOL_SENSOR MPCTEMP MPC_EDIT_MENU MPC_AUTOTUNE MPC_AUTOTUNE_MENU
opt_disable PIDTEMP
exec_test $1 $2 "BigTreeTech GTR | MPC | Switching Toolhead | Tool Sensors" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/BTT_GTR_V1_0_usb_flash_drive b/firmware/buildroot/tests/BTT_GTR_V1_0_usb_flash_drive
old mode 100755
new mode 100644
index 78aec13..da45592
--- a/firmware/buildroot/tests/BTT_GTR_V1_0_usb_flash_drive
+++ b/firmware/buildroot/tests/BTT_GTR_V1_0_usb_flash_drive
@@ -19,6 +19,3 @@ opt_set E0_AUTO_FAN_PIN PC10 E1_AUTO_FAN_PIN PC11 E2_AUTO_FAN_PIN PC12 NEOPIXEL_
FIL_RUNOUT4_STATE HIGH FIL_RUNOUT8_STATE HIGH
opt_enable FIL_RUNOUT4_PULLUP FIL_RUNOUT8_PULLUP
exec_test $1 $2 "GTT GTR | OTG USB Flash Drive | 8 Extruders | Auto-Fan | Mixed TMC Drivers | Runout Sensors (distinct)" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/BTT_SKR_PRO b/firmware/buildroot/tests/BTT_SKR_PRO
old mode 100755
new mode 100644
index 3ffc985..f20116d
--- a/firmware/buildroot/tests/BTT_SKR_PRO
+++ b/firmware/buildroot/tests/BTT_SKR_PRO
@@ -28,6 +28,3 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_PRO_V1_1 SERIAL_PORT -1 \
TEMP_SENSOR_COOLER 1000 TEMP_COOLER_PIN PD13
opt_enable LASER_FEATURE LASER_SAFETY_TIMEOUT_MS REPRAP_DISCOUNT_SMART_CONTROLLER
exec_test $1 $2 "BigTreeTech SKR Pro | HD44780 | Laser (Percent) | Cooling | LCD" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/BTT_SKR_SE_BX b/firmware/buildroot/tests/BTT_SKR_SE_BX
old mode 100755
new mode 100644
index 199cff1..8ba87da
--- a/firmware/buildroot/tests/BTT_SKR_SE_BX
+++ b/firmware/buildroot/tests/BTT_SKR_SE_BX
@@ -11,6 +11,3 @@ set -e
#
use_example_configs BIQU/BX
exec_test $1 $2 "BIQU/BX" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/DUE b/firmware/buildroot/tests/DUE
old mode 100755
new mode 100644
index 3c4876b..33f6bd5
--- a/firmware/buildroot/tests/DUE
+++ b/firmware/buildroot/tests/DUE
@@ -37,11 +37,10 @@ exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), ExtUI, S-Curve, many options
# RADDS with BLTouch, ABL(B), 3 x Z auto-align
#
restore_configs
-opt_set MOTHERBOARD BOARD_RADDS Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z3_DRIVER_TYPE A4988
+opt_set MOTHERBOARD BOARD_RADDS Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z3_DRIVER_TYPE A4988 \
+ X_MAX_PIN -1 Y_MAX_PIN -1
opt_enable ENDSTOPPULLUPS BLTOUCH AUTO_BED_LEVELING_BILINEAR \
Z_STEPPER_AUTO_ALIGN Z_STEPPER_ALIGN_STEPPER_XY Z_SAFE_HOMING
-pins_set ramps/RAMPS X_MAX_PIN -1
-pins_set ramps/RAMPS Y_MAX_PIN -1
exec_test $1 $2 "RADDS with ABL (Bilinear), Triple Z Axis, Z_STEPPER_AUTO_ALIGN, E_DUAL_STEPPER_DRIVERS" "$3"
#
@@ -49,5 +48,5 @@ exec_test $1 $2 "RADDS with ABL (Bilinear), Triple Z Axis, Z_STEPPER_AUTO_ALIGN,
#
restore_configs
opt_set MOTHERBOARD BOARD_RAMPS4DUE_EEF LCD_LANGUAGE fi EXTRUDERS 2 TEMP_SENSOR_BED 0 NUM_SERVOS 1
-opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER BEEP_ON_FEEDRATE_CHANGE POWER_LOSS_RECOVERY
-exec_test $1 $2 "RAMPS4DUE_EEF with SWITCHING_EXTRUDER, POWER_LOSS_RECOVERY" "$3"
+opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER BEEP_ON_FEEDRATE_CHANGE CANCEL_OBJECTS POWER_LOSS_RECOVERY
+exec_test $1 $2 "RAMPS4DUE_EEF with SWITCHING_EXTRUDER, CANCEL_OBJECTS, POWER_LOSS_RECOVERY" "$3"
diff --git a/firmware/buildroot/tests/DUE_archim b/firmware/buildroot/tests/DUE_archim
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/FLYF407ZG b/firmware/buildroot/tests/FLYF407ZG
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/FYSETC_F6 b/firmware/buildroot/tests/FYSETC_F6
old mode 100755
new mode 100644
index 713408b..6dd7bb6
--- a/firmware/buildroot/tests/FYSETC_F6
+++ b/firmware/buildroot/tests/FYSETC_F6
@@ -73,6 +73,3 @@ opt_enable FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW
FYSETC_242_OLED_12864 EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL Z_SAFE_HOMING \
STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY EDGE_STEPPING
exec_test $1 $2 "SCARA | Mixed TMC | EEPROM" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/FYSETC_S6 b/firmware/buildroot/tests/FYSETC_S6
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/HC32F460C_aquila_101 b/firmware/buildroot/tests/HC32F460C_aquila_101
old mode 100755
new mode 100644
index 0544720..00b286f
--- a/firmware/buildroot/tests/HC32F460C_aquila_101
+++ b/firmware/buildroot/tests/HC32F460C_aquila_101
@@ -8,7 +8,7 @@ set -e
restore_configs
opt_set MOTHERBOARD BOARD_AQUILA_V101 SERIAL_PORT 1
-opt_enable EEPROM_SETTINGS SDSUPPORT EMERGENCY_PARSER
+opt_enable EEPROM_SETTINGS SDSUPPORT EMERGENCY_PARSER PINS_DEBUGGING
exec_test $1 $2 "Default Configuration with Fallback SD EEPROM" "$3"
# cleanup
diff --git a/firmware/buildroot/tests/I3DBEEZ9_V1 b/firmware/buildroot/tests/I3DBEEZ9_V1
old mode 100755
new mode 100644
index 7c11d2e..8100932
--- a/firmware/buildroot/tests/I3DBEEZ9_V1
+++ b/firmware/buildroot/tests/I3DBEEZ9_V1
@@ -28,6 +28,3 @@ opt_set MOTHERBOARD BOARD_I3DBEEZ9_V1 SERIAL_PORT -1 \
TEMP_SENSOR_COOLER 1000 TEMP_COOLER_PIN PD13
opt_enable LASER_FEATURE LASER_SAFETY_TIMEOUT_MS REPRAP_DISCOUNT_SMART_CONTROLLER
exec_test $1 $2 "I3DBEE Z9 Board | HD44780 | Laser (Percent) | Cooling | LCD" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/LERDGEK b/firmware/buildroot/tests/LERDGEK
old mode 100755
new mode 100644
index b0806e9..347bdbf
--- a/firmware/buildroot/tests/LERDGEK
+++ b/firmware/buildroot/tests/LERDGEK
@@ -13,6 +13,3 @@ restore_configs
opt_set MOTHERBOARD BOARD_LERDGE_K SERIAL_PORT 1
opt_enable TFT_GENERIC TFT_INTERFACE_FSMC TFT_COLOR_UI COMPACT_MARLIN_BOOT_LOGO
exec_test $1 $2 "LERDGE K with Generic FSMC TFT with ColorUI" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/LERDGEX b/firmware/buildroot/tests/LERDGEX
old mode 100755
new mode 100644
index cf7dfeb..f7851db
--- a/firmware/buildroot/tests/LERDGEX
+++ b/firmware/buildroot/tests/LERDGEX
@@ -12,6 +12,3 @@ set -e
restore_configs
opt_set MOTHERBOARD BOARD_LERDGE_X SERIAL_PORT 1
exec_test $1 $2 "LERDGE X with Default Configuration" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/LPC1768 b/firmware/buildroot/tests/LPC1768
old mode 100755
new mode 100644
index f932625..3a08af8
--- a/firmware/buildroot/tests/LPC1768
+++ b/firmware/buildroot/tests/LPC1768
@@ -17,7 +17,9 @@ restore_configs
opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB SERIAL_PORT_3 3 \
NEOPIXEL_TYPE NEO_RGB RGB_LED_R_PIN P2_12 RGB_LED_G_PIN P1_23 RGB_LED_B_PIN P1_22 RGB_LED_W_PIN P1_24
opt_enable FYSETC_MINI_12864_2_1 SDSUPPORT SDCARD_READONLY SERIAL_PORT_2 RGBW_LED E_DUAL_STEPPER_DRIVERS \
- NEOPIXEL_LED NEOPIXEL_IS_SEQUENTIAL NEOPIXEL_STARTUP_TEST NEOPIXEL_BKGD_INDEX_FIRST NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_COLOR NEOPIXEL_BKGD_TIMEOUT_COLOR NEOPIXEL_BKGD_ALWAYS_ON
+ NEOPIXEL_LED NEOPIXEL_IS_SEQUENTIAL NEOPIXEL_STARTUP_TEST NEOPIXEL_BKGD_INDEX_FIRST NEOPIXEL_BKGD_INDEX_LAST \
+ NEOPIXEL_BKGD_COLOR NEOPIXEL_BKGD_TIMEOUT_COLOR NEOPIXEL_BKGD_ALWAYS_ON \
+ PINS_DEBUGGING
exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" "$3"
#restore_configs
@@ -74,7 +76,7 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_V1_4 SERIAL_PORT -1 \
Z_STEPPER_ALIGN_XY '{{10,110},{200,110}}' \
Z_STEPPER_ALIGN_ITERATIONS 10 DEFAULT_STEPPER_TIMEOUT_SEC 0 \
SLOWDOWN_DIVISOR 16 SDCARD_CONNECTION ONBOARD BLOCK_BUFFER_SIZE 64 \
- CHOPPER_TIMING CHOPPER_DEFAULT_24V MMU2_SERIAL_PORT 0
+ CHOPPER_TIMING CHOPPER_DEFAULT_24V MMU_SERIAL_PORT 0
opt_enable PIDTEMPBED S_CURVE_ACCELERATION \
USE_PROBE_FOR_Z_HOMING BLTOUCH FILAMENT_RUNOUT_SENSOR \
AUTO_BED_LEVELING_BILINEAR RESTORE_LEVELING_AFTER_G28 \
@@ -89,10 +91,7 @@ opt_enable PIDTEMPBED S_CURVE_ACCELERATION \
DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_DISPLAY_TOTAL LIN_ADVANCE \
BEZIER_CURVE_SUPPORT EMERGENCY_PARSER ADVANCED_PAUSE_FEATURE \
TMC_DEBUG HOST_ACTION_COMMANDS HOST_PAUSE_M76 HOST_PROMPT_SUPPORT \
- HOST_STATUS_NOTIFICATIONS MMU2_DEBUG
+ HOST_STATUS_NOTIFICATIONS MMU_DEBUG
opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN FILAMENT_LOAD_UNLOAD_GCODES \
PARK_HEAD_ON_PAUSE
exec_test $1 $2 "BigTreeTech SKR 1.4 | MMU2" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/LPC1769 b/firmware/buildroot/tests/LPC1769
old mode 100755
new mode 100644
index 6cdeb43..ad14e33
--- a/firmware/buildroot/tests/LPC1769
+++ b/firmware/buildroot/tests/LPC1769
@@ -79,7 +79,7 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_V1_4_TURBO SERIAL_PORT -1 \
Z_STEPPER_ALIGN_XY '{{10,110},{200,110}}' \
Z_STEPPER_ALIGN_ITERATIONS 10 DEFAULT_STEPPER_TIMEOUT_SEC 0 \
SLOWDOWN_DIVISOR 16 SDCARD_CONNECTION ONBOARD BLOCK_BUFFER_SIZE 64 \
- CHOPPER_TIMING CHOPPER_DEFAULT_24V MMU2_SERIAL_PORT 0 \
+ CHOPPER_TIMING CHOPPER_DEFAULT_24V MMU_SERIAL_PORT 0 \
Z_MIN_ENDSTOP_HIT_STATE HIGH
opt_enable PIDTEMPBED S_CURVE_ACCELERATION \
USE_PROBE_FOR_Z_HOMING BLTOUCH FILAMENT_RUNOUT_SENSOR \
@@ -95,9 +95,6 @@ opt_enable PIDTEMPBED S_CURVE_ACCELERATION \
DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_DISPLAY_TOTAL LIN_ADVANCE \
BEZIER_CURVE_SUPPORT EMERGENCY_PARSER ADVANCED_PAUSE_FEATURE \
TMC_DEBUG HOST_ACTION_COMMANDS HOST_PAUSE_M76 HOST_PROMPT_SUPPORT HOST_STATUS_NOTIFICATIONS \
- MMU_SPOOL_JOIN_CONSUMES_ALL_FILAMENT MMU_MENUS MMU2_DEBUG
+ MMU3_SPOOL_JOIN_CONSUMES_ALL_FILAMENT MMU_MENUS MMU_DEBUG
opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE
exec_test $1 $2 "BigTreeTech SKR 1.4 Turbo | MMU3" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/NUCLEO_F767ZI b/firmware/buildroot/tests/NUCLEO_F767ZI
old mode 100755
new mode 100644
index a331618..9f4e332
--- a/firmware/buildroot/tests/NUCLEO_F767ZI
+++ b/firmware/buildroot/tests/NUCLEO_F767ZI
@@ -13,6 +13,3 @@ restore_configs
opt_set MOTHERBOARD BOARD_NUCLEO_F767ZI SERIAL_PORT -1 X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2208
opt_enable BLTOUCH Z_SAFE_HOMING REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SPEAKER STARTUP_TUNE SOFTWARE_DRIVER_ENABLE
exec_test $1 $2 "Mixed timer usage" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/Opulo_Lumen_REV3 b/firmware/buildroot/tests/Opulo_Lumen_REV3
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/PANDA_PI_V29 b/firmware/buildroot/tests/PANDA_PI_V29
old mode 100755
new mode 100644
index a176e57..14f8671
--- a/firmware/buildroot/tests/PANDA_PI_V29
+++ b/firmware/buildroot/tests/PANDA_PI_V29
@@ -14,6 +14,3 @@ opt_set MOTHERBOARD BOARD_PANDA_PI_V29 SERIAL_PORT -1 \
Z_CLEARANCE_DEPLOY_PROBE 0 Z_CLEARANCE_BETWEEN_PROBES 1 Z_CLEARANCE_MULTI_PROBE 1
opt_enable BD_SENSOR AUTO_BED_LEVELING_BILINEAR Z_SAFE_HOMING BABYSTEPPING
exec_test $1 $2 "Panda Pi V29 | BD Sensor | ABL-B" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/REMRAM_V1 b/firmware/buildroot/tests/REMRAM_V1
old mode 100755
new mode 100644
index f5944ff..4ea63fa
--- a/firmware/buildroot/tests/REMRAM_V1
+++ b/firmware/buildroot/tests/REMRAM_V1
@@ -13,6 +13,3 @@ restore_configs
opt_set MOTHERBOARD BOARD_REMRAM_V1
opt_set SERIAL_PORT 1
exec_test $1 $2 "Default Configuration" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/SAMD21_minitronics20 b/firmware/buildroot/tests/SAMD21_minitronics20
old mode 100755
new mode 100644
index ae9fa55..fb23e90
--- a/firmware/buildroot/tests/SAMD21_minitronics20
+++ b/firmware/buildroot/tests/SAMD21_minitronics20
@@ -27,6 +27,3 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS
exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/SAMD51_grandcentral_m4 b/firmware/buildroot/tests/SAMD51_grandcentral_m4
old mode 100755
new mode 100644
index 312bd62..d4c4cea
--- a/firmware/buildroot/tests/SAMD51_grandcentral_m4
+++ b/firmware/buildroot/tests/SAMD51_grandcentral_m4
@@ -27,8 +27,5 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS \
SENSORLESS_HOMING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY Z2_STALL_SENSITIVITY \
- EDGE_STEPPING TMC_DEBUG
+ EDGE_STEPPING TMC_DEBUG PINS_DEBUGGING
exec_test $1 $2 "Grand Central M4 with assorted features" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/SKR_Pico b/firmware/buildroot/tests/SKR_Pico
new file mode 100644
index 0000000..1564a2c
--- /dev/null
+++ b/firmware/buildroot/tests/SKR_Pico
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+#
+# Build tests for BTT SKR Pico
+#
+
+# exit on first failure
+set -e
+
+#
+# Build with the default configurations
+#
+restore_configs
+opt_set MOTHERBOARD BOARD_BTT_SKR_PICO NUM_SERVOS 1
+opt_enable Z_PROBE_SERVO_NR Z_SERVO_ANGLES Z_SAFE_HOMING M114_DETAIL
+exec_test $1 $2 "Default Configuration" "$3"
+
+# clean up
+restore_configs
diff --git a/firmware/buildroot/tests/STM32F070CB_malyan b/firmware/buildroot/tests/STM32F070CB_malyan
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/STM32F070RB_malyan b/firmware/buildroot/tests/STM32F070RB_malyan
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/STM32F103CB_malyan b/firmware/buildroot/tests/STM32F103CB_malyan
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/STM32F103RC_btt b/firmware/buildroot/tests/STM32F103RC_btt
old mode 100755
new mode 100644
index b9fff2b..62ef7d9
--- a/firmware/buildroot/tests/STM32F103RC_btt
+++ b/firmware/buildroot/tests/STM32F103RC_btt
@@ -14,6 +14,3 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 SERIAL_PORT 1 SERIAL_PORT_2 -1 \
X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2209 E0_DRIVER_TYPE TMC2209
opt_enable CR10_STOCKDISPLAY PINS_DEBUGGING Z_IDLE_HEIGHT FT_MOTION FT_MOTION_MENU ADAPTIVE_STEP_SMOOTHING NONLINEAR_EXTRUSION
exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - TMC2209 HW Serial, FT_MOTION" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RC_btt_USB b/firmware/buildroot/tests/STM32F103RC_btt_USB
old mode 100755
new mode 100644
index c8ee4f7..922b8f8
--- a/firmware/buildroot/tests/STM32F103RC_btt_USB
+++ b/firmware/buildroot/tests/STM32F103RC_btt_USB
@@ -12,6 +12,3 @@ set -e
restore_configs
opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_V1_1 SERIAL_PORT 1 SERIAL_PORT_2 -1 TEMP_SENSOR_SOC 100
exec_test $1 $2 "BigTreeTech SKR Mini v1.1 - SOC Temperature" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RC_btt_USB_maple b/firmware/buildroot/tests/STM32F103RC_btt_USB_maple
old mode 100755
new mode 100644
index eeb4609..e9ce166
--- a/firmware/buildroot/tests/STM32F103RC_btt_USB_maple
+++ b/firmware/buildroot/tests/STM32F103RC_btt_USB_maple
@@ -12,6 +12,3 @@ set -e
restore_configs
opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_V1_1 SERIAL_PORT 1 SERIAL_PORT_2 -1 BAUDRATE_2 115200
exec_test $1 $2 "BigTreeTech SKR Mini v1.1 - Basic Configuration" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RC_btt_maple b/firmware/buildroot/tests/STM32F103RC_btt_maple
old mode 100755
new mode 100644
index 90e33ab..1ede07f
--- a/firmware/buildroot/tests/STM32F103RC_btt_maple
+++ b/firmware/buildroot/tests/STM32F103RC_btt_maple
@@ -14,6 +14,3 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 SERIAL_PORT 1 SERIAL_PORT_2 -1 \
X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2209 E0_DRIVER_TYPE TMC2209
opt_enable PINS_DEBUGGING Z_IDLE_HEIGHT
exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RC_fysetc b/firmware/buildroot/tests/STM32F103RC_fysetc
old mode 100755
new mode 100644
index 93b0fed..6a19e01
--- a/firmware/buildroot/tests/STM32F103RC_fysetc
+++ b/firmware/buildroot/tests/STM32F103RC_fysetc
@@ -11,6 +11,3 @@ set -e
#
use_example_configs "Creality/Ender-3/FYSETC Cheetah 1.2/BLTouch"
exec_test $1 $2 "Ender-3 with Cheetah 1.2 | BLTouch" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RC_fysetc_maple b/firmware/buildroot/tests/STM32F103RC_fysetc_maple
old mode 100755
new mode 100644
index 09dba7e..f401d1c
--- a/firmware/buildroot/tests/STM32F103RC_fysetc_maple
+++ b/firmware/buildroot/tests/STM32F103RC_fysetc_maple
@@ -11,6 +11,3 @@ set -e
#
use_example_configs "Creality/Ender-3/FYSETC Cheetah 1.2/base"
exec_test $1 $2 "Maple build of Cheetah 1.2 Configuration" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RC_meeb_maple b/firmware/buildroot/tests/STM32F103RC_meeb_maple
old mode 100755
new mode 100644
index 3a191b4..f2a05ab
--- a/firmware/buildroot/tests/STM32F103RC_meeb_maple
+++ b/firmware/buildroot/tests/STM32F103RC_meeb_maple
@@ -13,6 +13,3 @@ restore_configs
opt_set MOTHERBOARD BOARD_CCROBOT_MEEB_3DP SERIAL_PORT 1 SERIAL_PORT_2 -1 \
X_DRIVER_TYPE TMC2208 Y_DRIVER_TYPE TMC2208 Z_DRIVER_TYPE TMC2208 E0_DRIVER_TYPE TMC2208
exec_test $1 $2 "MEEB_3DP - Basic Config with TMC2208 SW Serial" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RE b/firmware/buildroot/tests/STM32F103RE
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/STM32F103RE_btt b/firmware/buildroot/tests/STM32F103RE_btt
old mode 100755
new mode 100644
index 197ca77..fdf1580
--- a/firmware/buildroot/tests/STM32F103RE_btt
+++ b/firmware/buildroot/tests/STM32F103RE_btt
@@ -15,6 +15,3 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_E3_DIP \
X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2130
opt_enable SERIAL_DMA
exec_test $1 $2 "BTT SKR E3 DIP 1.0 | Mixed TMC Drivers" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RE_btt_USB b/firmware/buildroot/tests/STM32F103RE_btt_USB
old mode 100755
new mode 100644
index 0bf5f61..ddf1903
--- a/firmware/buildroot/tests/STM32F103RE_btt_USB
+++ b/firmware/buildroot/tests/STM32F103RE_btt_USB
@@ -22,6 +22,3 @@ opt_enable CR10_STOCKDISPLAY SDSUPPORT EMERGENCY_PARSER FAN_SOFT_PWM \
PROBING_HEATERS_OFF PREHEAT_BEFORE_PROBING
opt_disable NOZZLE_TO_PROBE_OFFSET
exec_test $1 $2 "BigTreeTech SKR CR6 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103RE_creality b/firmware/buildroot/tests/STM32F103RE_creality
old mode 100755
new mode 100644
index 44d818b..d08b82f
--- a/firmware/buildroot/tests/STM32F103RE_creality
+++ b/firmware/buildroot/tests/STM32F103RE_creality
@@ -47,6 +47,3 @@ opt_enable NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE LCD_BED_TRAMMING CLASSIC_J
opt_add NO_CREALITY_422_DRIVER_WARNING
opt_add NO_AUTO_ASSIGN_WARNING
exec_test $1 $2 "Creality V4.2.2 with IA_CREALITY" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F103VE_ZM3E4V2_USB_maple b/firmware/buildroot/tests/STM32F103VE_ZM3E4V2_USB_maple
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/STM32F103VE_longer b/firmware/buildroot/tests/STM32F103VE_longer
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/STM32F103VE_longer_maple b/firmware/buildroot/tests/STM32F103VE_longer_maple
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/STM32F401RC_creality b/firmware/buildroot/tests/STM32F401RC_creality
old mode 100755
new mode 100644
index 61b8d2e..185599e
--- a/firmware/buildroot/tests/STM32F401RC_creality
+++ b/firmware/buildroot/tests/STM32F401RC_creality
@@ -11,6 +11,3 @@ opt_enable AUTO_BED_LEVELING_BILINEAR Z_SAFE_HOMING
opt_set MOTHERBOARD BOARD_CREALITY_V24S1_301F4
opt_add SDCARD_EEPROM_EMULATION
exec_test $1 $2 "Ender-3 v2 with MarlinUI" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32F407VE_black b/firmware/buildroot/tests/STM32F407VE_black
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/STM32G0B1RE_btt b/firmware/buildroot/tests/STM32G0B1RE_btt
old mode 100755
new mode 100644
index 35ccf0f..04f740d
--- a/firmware/buildroot/tests/STM32G0B1RE_btt
+++ b/firmware/buildroot/tests/STM32G0B1RE_btt
@@ -11,6 +11,3 @@ set -e
#
use_example_configs "Creality/Ender-3/BigTreeTech SKR Mini E3 3.0"
exec_test $1 $2 "Creality/Ender-3/BigTreeTech SKR Mini E3 3.0" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/STM32H743VI_btt b/firmware/buildroot/tests/STM32H743VI_btt
old mode 100755
new mode 100644
index b77cdb0..e73a786
--- a/firmware/buildroot/tests/STM32H743VI_btt
+++ b/firmware/buildroot/tests/STM32H743VI_btt
@@ -37,7 +37,7 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_V3_0_EZ SERIAL_PORT -1 \
Z_STEPPER_ALIGN_XY '{{10,110},{200,110}}' \
Z_STEPPER_ALIGN_ITERATIONS 10 DEFAULT_STEPPER_TIMEOUT_SEC 0 \
SLOWDOWN_DIVISOR 16 SDCARD_CONNECTION ONBOARD BLOCK_BUFFER_SIZE 64 \
- CHOPPER_TIMING CHOPPER_DEFAULT_24V MMU2_SERIAL_PORT 2
+ CHOPPER_TIMING CHOPPER_DEFAULT_24V MMU_SERIAL_PORT 2
opt_enable PIDTEMPBED ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION \
USE_PROBE_FOR_Z_HOMING BLTOUCH FILAMENT_RUNOUT_SENSOR \
AUTO_BED_LEVELING_BILINEAR RESTORE_LEVELING_AFTER_G28 \
@@ -52,7 +52,7 @@ opt_enable PIDTEMPBED ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION \
DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_DISPLAY_TOTAL LIN_ADVANCE \
BEZIER_CURVE_SUPPORT EMERGENCY_PARSER ADVANCED_PAUSE_FEATURE \
TMC_DEBUG HOST_ACTION_COMMANDS HOST_PAUSE_M76 HOST_PROMPT_SUPPORT HOST_STATUS_NOTIFICATIONS \
- MMU2_DEBUG
+ MMU_DEBUG
opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE
exec_test $1 $2 "BigTreeTech SKR 3 EZ | MMU2" "$3"
@@ -71,7 +71,7 @@ opt_set MOTHERBOARD BOARD_BTT_SKR_V3_0_EZ SERIAL_PORT -1 \
Z_STEPPER_ALIGN_XY '{{10,110},{200,110}}' \
Z_STEPPER_ALIGN_ITERATIONS 10 DEFAULT_STEPPER_TIMEOUT_SEC 0 \
SLOWDOWN_DIVISOR 16 SDCARD_CONNECTION ONBOARD BLOCK_BUFFER_SIZE 64 \
- CHOPPER_TIMING CHOPPER_DEFAULT_24V MMU2_SERIAL_PORT 2
+ CHOPPER_TIMING CHOPPER_DEFAULT_24V MMU_SERIAL_PORT 2
opt_enable PIDTEMPBED ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION \
USE_PROBE_FOR_Z_HOMING BLTOUCH FILAMENT_RUNOUT_SENSOR \
AUTO_BED_LEVELING_BILINEAR RESTORE_LEVELING_AFTER_G28 \
@@ -86,9 +86,6 @@ opt_enable PIDTEMPBED ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION \
DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_DISPLAY_TOTAL LIN_ADVANCE \
BEZIER_CURVE_SUPPORT EMERGENCY_PARSER ADVANCED_PAUSE_FEATURE \
TMC_DEBUG HOST_ACTION_COMMANDS HOST_PAUSE_M76 HOST_PROMPT_SUPPORT HOST_STATUS_NOTIFICATIONS \
- MMU_MENUS MMU_SPOOL_JOIN_CONSUMES_ALL_FILAMENT MMU2_DEBUG
+ MMU_MENUS MMU3_SPOOL_JOIN_CONSUMES_ALL_FILAMENT MMU_DEBUG
opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE
exec_test $1 $2 "BigTreeTech SKR 3 EZ | MMU3" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/at90usb1286_cdc b/firmware/buildroot/tests/at90usb1286_cdc
old mode 100755
new mode 100644
index 7dcf8d5..5f775ad
--- a/firmware/buildroot/tests/at90usb1286_cdc
+++ b/firmware/buildroot/tests/at90usb1286_cdc
@@ -12,6 +12,3 @@ set -e
restore_configs
opt_set MOTHERBOARD BOARD_BRAINWAVE_PRO
exec_test $1 $2 "Default Configuration" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/at90usb1286_dfu b/firmware/buildroot/tests/at90usb1286_dfu
old mode 100755
new mode 100644
index a753097..e1317ba
--- a/firmware/buildroot/tests/at90usb1286_dfu
+++ b/firmware/buildroot/tests/at90usb1286_dfu
@@ -17,6 +17,3 @@ restore_configs
opt_set MOTHERBOARD BOARD_PRINTRBOARD_REVF
opt_enable MINIPANEL
exec_test $1 $2 "Printrboard RevF with MiniPanel and Stepper DAC (in pins file)" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/chitu_f103 b/firmware/buildroot/tests/chitu_f103
old mode 100755
new mode 100644
index 139c480..d09ddf7
--- a/firmware/buildroot/tests/chitu_f103
+++ b/firmware/buildroot/tests/chitu_f103
@@ -11,6 +11,3 @@ set -e
#
use_example_configs Tronxy/X5SA
exec_test $1 $2 "Tronxy/X5SA" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/esp32 b/firmware/buildroot/tests/esp32
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/jgaurora_a5s_a1_maple b/firmware/buildroot/tests/jgaurora_a5s_a1_maple
old mode 100755
new mode 100644
index e9be89e..d59100e
--- a/firmware/buildroot/tests/jgaurora_a5s_a1_maple
+++ b/firmware/buildroot/tests/jgaurora_a5s_a1_maple
@@ -11,6 +11,3 @@ set -e
#
use_example_configs JGAurora/A5S
exec_test $1 $2 "JGAurora/A5S Configuration" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/linux_native b/firmware/buildroot/tests/linux_native
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/malyan_M300 b/firmware/buildroot/tests/malyan_M300
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mega1280 b/firmware/buildroot/tests/mega1280
old mode 100755
new mode 100644
index 7e99ee4..1b1a8f8
--- a/firmware/buildroot/tests/mega1280
+++ b/firmware/buildroot/tests/mega1280
@@ -19,7 +19,7 @@ restore_configs
opt_set LCD_LANGUAGE an \
POWER_MONITOR_CURRENT_PIN 14 POWER_MONITOR_VOLTAGE_PIN 15 \
CLOSED_LOOP_ENABLE_PIN 44 CLOSED_LOOP_MOVE_COMPLETE_PIN 45
-opt_enable SPINDLE_FEATURE ULTIMAKERCONTROLLER LCD_BED_LEVELING \
+opt_enable SPINDLE_FEATURE ULTIMAKERCONTROLLER LCD_BED_LEVELING EDITABLE_HOMING_FEEDRATE \
EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT \
SENSORLESS_BACKOFF_MM HOMING_BACKOFF_POST_MM HOME_Y_BEFORE_X CODEPENDENT_XY_HOMING \
MESH_BED_LEVELING ENABLE_LEVELING_FADE_HEIGHT MESH_G28_REST_ORIGIN \
@@ -60,6 +60,3 @@ opt_set LCD_LANGUAGE cz \
Z_MIN_ENDSTOP_HIT_STATE HIGH
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR BLTOUCH
exec_test $1 $2 "DELTA | RRD LCD | ABL Bilinear | BLTOUCH" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/mega2560 b/firmware/buildroot/tests/mega2560
old mode 100755
new mode 100644
index d61f17b..d7a1490
--- a/firmware/buildroot/tests/mega2560
+++ b/firmware/buildroot/tests/mega2560
@@ -290,6 +290,3 @@ exec_test $1 $2 "MEGA2560 RAMPS | 128x64 LIGHTWEIGHT_UI | progress rotation" "$3
opt_disable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER
exec_test $1 $2 "MEGA2560 RAMPS | HD44780 | progress rotation" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/melzi_optiboot b/firmware/buildroot/tests/melzi_optiboot
old mode 100755
new mode 100644
index 086fcc9..0d9b87b
--- a/firmware/buildroot/tests/melzi_optiboot
+++ b/firmware/buildroot/tests/melzi_optiboot
@@ -11,6 +11,3 @@ set -e
#
use_example_configs Creality/Ender-2
exec_test $1 $2 "Ender-2" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/mks_robin b/firmware/buildroot/tests/mks_robin
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_lite_maple b/firmware/buildroot/tests/mks_robin_lite_maple
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_maple b/firmware/buildroot/tests/mks_robin_maple
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_mini b/firmware/buildroot/tests/mks_robin_mini
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_nano_v1_3_f4_usbmod b/firmware/buildroot/tests/mks_robin_nano_v1_3_f4_usbmod
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_nano_v1v2 b/firmware/buildroot/tests/mks_robin_nano_v1v2
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_nano_v1v2_maple b/firmware/buildroot/tests/mks_robin_nano_v1v2_maple
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_nano_v1v2_usbmod b/firmware/buildroot/tests/mks_robin_nano_v1v2_usbmod
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_pro2 b/firmware/buildroot/tests/mks_robin_pro2
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_robin_pro_maple b/firmware/buildroot/tests/mks_robin_pro_maple
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/mks_tinybee b/firmware/buildroot/tests/mks_tinybee
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/rambo b/firmware/buildroot/tests/rambo
old mode 100755
new mode 100644
index 698765f..13a8e1e
--- a/firmware/buildroot/tests/rambo
+++ b/firmware/buildroot/tests/rambo
@@ -79,7 +79,7 @@ exec_test $1 $2 "Rambo heated bed only" "$3"
#
restore_configs
opt_set MOTHERBOARD BOARD_RAMBO EXTRUDERS 5 MMU_MODEL PRUSA_MMU2
-opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE EMERGENCY_PARSER MMU2_DEBUG
+opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE EMERGENCY_PARSER MMU_DEBUG
exec_test $1 $2 "Rambo with PRUSA_MMU2 " "$3"
#
@@ -87,7 +87,7 @@ exec_test $1 $2 "Rambo with PRUSA_MMU2 " "$3"
#
restore_configs
opt_set MOTHERBOARD BOARD_RAMBO EXTRUDERS 5 MMU_MODEL PRUSA_MMU3
-opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE EMERGENCY_PARSER MMU_MENUS MMU2_DEBUG EEPROM_SETTINGS
+opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE EMERGENCY_PARSER MMU_MENUS MMU_DEBUG EEPROM_SETTINGS
exec_test $1 $2 "Rambo with PRUSA_MMU3 " "$3"
#
@@ -144,6 +144,3 @@ opt_enable COREYX MIXING_EXTRUDER GRADIENT_MIX \
USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE CONTROLLER_FAN_USE_Z_ONLY
opt_disable DISABLE_OTHER_EXTRUDERS
exec_test $1 $2 "Rambo | CoreXY, Gradient Mix | Endstop Int. | Home Y > X | FW Retract ..." "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/rumba32 b/firmware/buildroot/tests/rumba32
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/sanguino1284p b/firmware/buildroot/tests/sanguino1284p
old mode 100755
new mode 100644
index 7c2aa61..345383c
--- a/firmware/buildroot/tests/sanguino1284p
+++ b/firmware/buildroot/tests/sanguino1284p
@@ -23,6 +23,3 @@ restore_configs
opt_set MOTHERBOARD BOARD_MELZI
opt_enable ZONESTAR_LCD
exec_test $1 $2 "Default Configuration | ZONESTAR_LCD " "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/sanguino644p b/firmware/buildroot/tests/sanguino644p
old mode 100755
new mode 100644
index 12910a7..81a202f
--- a/firmware/buildroot/tests/sanguino644p
+++ b/firmware/buildroot/tests/sanguino644p
@@ -12,6 +12,3 @@ set -e
restore_configs
opt_set MOTHERBOARD BOARD_SANGUINOLOLU_12
exec_test $1 $2 "Default Configuration" "$3"
-
-# clean up
-restore_configs
diff --git a/firmware/buildroot/tests/simulator_linux_release b/firmware/buildroot/tests/simulator_linux_release
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/teensy31 b/firmware/buildroot/tests/teensy31
old mode 100755
new mode 100644
diff --git a/firmware/buildroot/tests/teensy35 b/firmware/buildroot/tests/teensy35
old mode 100755
new mode 100644
index c7830ae..0e149e7
--- a/firmware/buildroot/tests/teensy35
+++ b/firmware/buildroot/tests/teensy35
@@ -106,10 +106,6 @@ exec_test $1 $2 "Teensy 3.5/3.6 COREXZ | BACKLASH" "$3"
# Enable Dual Z with Dual Z endstops
#
restore_configs
-opt_set MOTHERBOARD BOARD_TEENSY35_36 Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z2_MIN_PIN 2
+opt_set MOTHERBOARD BOARD_TEENSY35_36 Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z2_MIN_PIN 2 X_MAX_PIN -1
opt_enable Z_MULTI_ENDSTOPS
-pins_set ramps/RAMPS X_MAX_PIN -1
exec_test $1 $2 "Dual Z with Dual Z endstops" "$3"
-
-# Clean up
-restore_configs
diff --git a/firmware/buildroot/tests/teensy41 b/firmware/buildroot/tests/teensy41
old mode 100755
new mode 100644
index 894abc1..6cf3f4a
--- a/firmware/buildroot/tests/teensy41
+++ b/firmware/buildroot/tests/teensy41
@@ -28,7 +28,7 @@ opt_enable MAX31865_SENSOR_OHMS_0 MAX31865_CALIBRATION_OHMS_0 \
PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \
ADVANCED_PAUSE_FEATURE ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES PARK_HEAD_ON_PAUSE \
PHOTO_GCODE PHOTO_POSITION PHOTO_SWITCH_POSITION PHOTO_SWITCH_MS PHOTO_DELAY_MS PHOTO_RETRACT_MM \
- HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT HOST_STATUS_NOTIFICATIONS
+ HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT HOST_STATUS_NOTIFICATIONS PINS_DEBUGGING
opt_add EXTUI_EXAMPLE
exec_test $1 $2 "Teensy4.1 with many features" "$3"
@@ -105,10 +105,6 @@ exec_test $1 $2 "Teensy 4.0/4.1 COREXZ" "$3"
# Enable Dual Z with Dual Z endstops
#
restore_configs
-opt_set MOTHERBOARD BOARD_TEENSY41 Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z2_MIN_PIN 2
+opt_set MOTHERBOARD BOARD_TEENSY41 Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z2_MIN_PIN 2 X_MAX_PIN -1
opt_enable Z_MULTI_ENDSTOPS
-pins_set ramps/RAMPS X_MAX_PIN -1
exec_test $1 $2 "Dual Z with Dual Z endstops" "$3"
-
-# Clean up
-restore_configs
diff --git a/firmware/buildroot/web-ui/data/www/chart.min.js b/firmware/buildroot/web-ui/data/www/chart.min.js
old mode 100755
new mode 100644
diff --git a/firmware/docs/ConfigEmbedding.md b/firmware/docs/ConfigEmbedding.md
index 90075bc..562661e 100644
--- a/firmware/docs/ConfigEmbedding.md
+++ b/firmware/docs/ConfigEmbedding.md
@@ -3,7 +3,7 @@
Starting with version 2.0.9.3, Marlin can automatically extract the configuration used to generate the firmware and store it in the firmware binary. This is enabled by defining `CONFIGURATION_EMBEDDING` in `Configuration_adv.h`.
## How it's done
-At the start of the PlatformIO build process, we create an embedded configuration by extracting all active options from the Configuration files and writing them out as JSON to `marlin_config.json`, which also includes specific build information (like the git revision, the build date, and some version information. The JSON file is then compressed in a ZIP archive called `.pio/build/mc.zip` which is converted into a C array and stored in a C++ file called `mc.h` which is included in the build.
+At the start of the PlatformIO build process, we create an embedded configuration by extracting all active options from the Configuration files and writing them out as JSON to `marlin_config.json`, which also includes specific build information (like the git revision, the build date, and some version information). The JSON file is then compressed in a ZIP archive called `.pio/build/mc.zip` which is converted into a C array and stored in a C++ file called `mc.h` which is included in the build.
## Extracting configurations from a Marlin binary
To get the configuration out of a binary firmware, you'll need a non-write-protected SD card inserted into the printer while running the firmware.
diff --git a/firmware/ini/esp32.ini b/firmware/ini/esp32.ini
index 909394e..e60ab81 100644
--- a/firmware/ini/esp32.ini
+++ b/firmware/ini/esp32.ini
@@ -39,9 +39,14 @@ board_build.partitions = Marlin/src/HAL/ESP32/esp32.csv
upload_speed = 115200
monitor_speed = 115200
+# New espressif32 packages require a valid board definition file.
[env:mks_tinybee]
extends = env:esp32
+board = marlin_MKS_TinyBee
+platform = espressif32@~3.5.0
board_build.partitions = default_8MB.csv
+build_src_flags = -O3 -Wno-volatile
+monitor_filters = esp32_exception_decoder
[env:godi_esp32]
extends = env:esp32
diff --git a/firmware/ini/features.ini b/firmware/ini/features.ini
index a502808..b2e9d68 100644
--- a/firmware/ini/features.ini
+++ b/firmware/ini/features.ini
@@ -20,7 +20,7 @@ MARLIN_TEST_BUILD = build_src_filter=+
POSTMORTEM_DEBUGGING = build_src_filter=+ +
build_flags=-funwind-tables
MKS_WIFI_MODULE = QRCode=https://github.com/makerbase-mks/QRCode/archive/261c5a696a.zip
-HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.3
+HAS_TRINAMIC_CONFIG = TMCStepper=https://github.com/MarlinFirmware/TMCStepper/archive/marlin-2.1.3.x.zip
build_src_filter=+ + + + +
HAS_T(RINAMIC_CONFIG|MC_SPI) = build_src_filter=+
SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/6f53c19a8a.zip
@@ -40,11 +40,6 @@ HAS_MARLINUI_HD44780 = build_src_filter=+
HAS_MARLINUI_U8GLIB = marlinfirmware/U8glib-HAL@0.5.4
build_src_filter=+
HAS_(FSMC|SPI|LTDC)_TFT = build_src_filter=+
-HAS_LTDC_TFT = build_src_filter=+
-HAS_FSMC_TFT = build_src_filter=+ +
-HAS_SPI_TFT = build_src_filter=+ + +
-HAS_TFT_XPT2046 = build_src_filter=+ + +
-TFT_TOUCH_DEVICE_GT911 = build_src_filter=+
I2C_EEPROM = build_src_filter=+
SOFT_I2C_EEPROM = SlowSoftI2CMaster, SlowSoftWire=https://github.com/felias-fogg/SlowSoftWire/archive/f34d777f39.zip
SPI_EEPROM = build_src_filter=+
@@ -53,6 +48,7 @@ DWIN_CREALITY_LCD = build_src_filter=+
DWIN_CREALITY_LCD_JYERSUI = build_src_filter=+
IS_DWIN_MARLINUI = build_src_filter=+
+SOVOL_SV06_RTS = build_src_filter=+
HAS_GRAPHICAL_TFT = build_src_filter=+ - -
HAS_UI_320X.+ = build_src_filter=+
HAS_UI_480X.+ = build_src_filter=+
@@ -163,18 +159,19 @@ TFT_FONT_UNIFONT_30_ZH_TW = build_src_filter=+
IS_TFTGLCD_PANEL = build_src_filter=+
HAS_TOUCH_BUTTONS = build_src_filter=+
-HAS_MARLINUI_MENU = build_src_filter=+ -
+HAS_MARLINUI_MENU = build_src_filter=+ + + + + +
HAS_GAMES = build_src_filter=+
MARLIN_BRICKOUT = build_src_filter=+
MARLIN_INVADERS = build_src_filter=+
MARLIN_MAZE = build_src_filter=+
MARLIN_SNAKE = build_src_filter=+
HAS_MENU_BACKLASH = build_src_filter=+
-LCD_BED_LEVELING = build_src_filter=+
+HAS_MENU_PROBE_LEVEL = build_src_filter=+
HAS_MENU_BED_TRAMMING = build_src_filter=+
HAS_MENU_CANCELOBJECT = build_src_filter=+
HAS_MENU_DELTA_CALIBRATE = build_src_filter=+
HAS_MENU_FILAMENT = build_src_filter=+
+HAS_GAME_MENU = build_src_filter=+
LCD_INFO_MENU = build_src_filter=+
HAS_MENU_JOB_RECOVERY = build_src_filter=+
HAS_MENU_MULTI_LANGUAGE = build_src_filter=+
@@ -185,6 +182,7 @@ HAS_MENU_MMU = build_src_filter=+ +
HAS_MENU_PASSWORD = build_src_filter=+
HAS_MENU_POWER_MONITOR = build_src_filter=+
+PROBE_OFFSET_WIZARD = build_src_filter=+
HAS_MENU_CUTTER = build_src_filter=+
HAS_MENU_TEMPERATURE = build_src_filter=+
HAS_MENU_TMC = build_src_filter=+
@@ -287,6 +285,7 @@ SKEW_CORRECTION_GCODE = build_src_filter=+ +
PINS_DEBUGGING = build_src_filter=+
EDITABLE_STEPS_PER_UNIT = build_src_filter=+
+EDITABLE_HOMING_FEEDRATE = build_src_filter=+
HAS_MULTI_EXTRUDER = build_src_filter=+
HAS_HOTEND_OFFSET = build_src_filter=+
EDITABLE_SERVO_ANGLES = build_src_filter=+
diff --git a/firmware/ini/hc32.ini b/firmware/ini/hc32.ini
index c9533ba..a99614b 100644
--- a/firmware/ini/hc32.ini
+++ b/firmware/ini/hc32.ini
@@ -27,19 +27,20 @@
# Base Environment for all HC32F460 variants
#
[HC32F460_base]
-platform = https://github.com/shadow578/platform-hc32f46x/archive/1.0.0.zip
-board = generic_hc32f460
-build_src_filter = ${common.default_src_filter} + +
-build_type = release
-build_flags =
- -D ARDUINO_ARCH_HC32
- -D PLATFORM_M997_SUPPORT # Enable M997 command
- # note: ddl and arduino debug mode are
- # automatically enabled with MARLIN_DEV_MODE
- #-D __DEBUG # force DDL debug mode
- #-D __CORE_DEBUG # force Arduino core debug mode
+platform = https://github.com/shadow578/platform-hc32f46x/archive/1.1.0.zip
+platform_packages = framework-hc32f46x-ddl@https://github.com/shadow578/framework-hc32f46x-ddl/archive/2.2.2.zip
+ framework-arduino-hc32f46x@https://github.com/shadow578/framework-arduino-hc32f46x/archive/1.2.0.zip
+board = generic_hc32f460
+build_src_filter = ${common.default_src_filter} + +
+build_type = release
+build_flags = -D ARDUINO_ARCH_HC32
+ -D PLATFORM_M997_SUPPORT # Enable M997 command
+ # NOTE: DDL and Arduino debug mode are
+ # automatically enabled with MARLIN_DEV_MODE
+ #-D __DEBUG # force DDL debug mode
+ #-D __CORE_DEBUG # force Arduino core debug mode
-# hc32 app configuration file
+# HC32 app configuration file
board_build.app_config = Marlin/src/HAL/HC32/app_config.h
# Drivers and Middleware required by the HC32 HAL
@@ -50,42 +51,40 @@ board_build.ddl.timer0 = true
board_build.ddl.timera = true
board_build.mw.sd_card = true
-# extra build flags
-board_build.flags.common =
- -g3 # Force emit debug symbols to elf. this does not affect the final binary size
- -fno-signed-char # Force unsigned chars. this is required for meatpack to work
+# Extra build flags
+board_build.flags.common = -g3 # Force emit debug symbols to elf. This does not affect the final binary size
+ -fno-signed-char # Force unsigned char. This is required for meatpack to work
# Additional flags to reduce binary size
-board_build.flags.cpp =
- -fno-threadsafe-statics # Disable thread-safe statics (only one core anyway)
- -fno-exceptions # Disable exceptions (not used by marlin)
- -fno-rtti # Disable RTTI (not used by marlin)
+board_build.flags.cpp = -fno-threadsafe-statics # Disable thread-safe statics (only one core anyway)
+ -fno-exceptions # Disable exceptions (not used by Marlin)
+ -fno-rtti # Disable RTTI (not used by Marlin)
#
# Base HC32F460xCxx (256K Flash)
#
[HC32F460C_base]
extends = HC32F460_base
-board_build.ld_args.flash_size = 256K
+board_upload.maximum_size = 262144
#
# Base HC32F460xExx (512K Flash)
#
[HC32F460E_base]
extends = HC32F460_base
-board_build.ld_args.flash_size = 512K
+board_upload.maximum_size = 524288
#
# Voxelab Aquila V1.0.0/V1.0.1/V1.0.2/V1.0.3 as found in the Voxelab Aquila X2 & C2
#
[env:HC32F460C_aquila_101]
extends = HC32F460C_base
-board_build.ld_args.flash_start = 0xC000 # Bootloader start address, as logged by the bootloader on boot
-board_build.ld_args.boot_mode = secondary # Save ~1.4k of flash by compiling as secondary firmware
+board_upload.offset_address = 0xC000 # Bootloader start address, as logged by the bootloader on boot
+board_build.boot_mode = secondary # Save ~1.4k of flash by compiling as secondary firmware
#
# Creality Ender 2 Pro v2.4.S4_170 (HC32f460kcta) (256K Flash, 192K RAM).
#
[env:HC32F460C_e2p24s4]
extends = HC32F460C_base
-board_build.ld_args.flash_start = 0x8000
+board_upload.offset_address = 0x8000
diff --git a/firmware/ini/lpc176x.ini b/firmware/ini/lpc176x.ini
index 8d5d2fd..28c6546 100644
--- a/firmware/ini/lpc176x.ini
+++ b/firmware/ini/lpc176x.ini
@@ -14,23 +14,26 @@
#
[common_LPC]
platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.3.zip
-platform_packages = framework-arduino-lpc176x@^0.2.8
+platform_packages = framework-arduino-lpc176x@https://github.com/p3p/pio-framework-arduino-lpc176x/archive/ab41696b64.zip
toolchain-gccarmnoneeabi@1.100301.220327
board = nxp_lpc1768
lib_ldf_mode = off
lib_compat_mode = strict
extra_scripts = ${common.extra_scripts}
- Marlin/src/HAL/LPC1768/upload_extra_script.py
+ Marlin/src/HAL/LPC1768/upload_extra_script.py
build_src_filter = ${common.default_src_filter} + - +
lib_deps = ${common.lib_deps}
- Servo
-custom_marlin.USES_LIQUIDCRYSTAL = arduino-libraries/LiquidCrystal@~1.0.7
-custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/1.5.0.zip
+ Servo
build_flags = ${common.build_flags} -DU8G_HAL_LINKS -DPLATFORM_M997_SUPPORT
-IMarlin/src/HAL/LPC1768/include -IMarlin/src/HAL/LPC1768/u8g
- # debug options for backtrace
- #-funwind-tables
- #-mpoke-function-name
+ # debug options for backtrace
+ #-funwind-tables
+ #-mpoke-function-name
+build_src_flags = -std=gnu++20 -Wno-volatile
+custom_marlin.USES_LIQUIDCRYSTAL = arduino-libraries/LiquidCrystal@~1.0.7
+custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/1.5.0.zip
+custom_marlin.HAS_SPI_TFT = build_src_filter=+
+custom_marlin.HAS_TFT_XPT2046 = build_src_filter=+
#
# NXP LPC176x ARM Cortex-M3
diff --git a/firmware/ini/native.ini b/firmware/ini/native.ini
index 69233cd..5b62c87 100644
--- a/firmware/ini/native.ini
+++ b/firmware/ini/native.ini
@@ -83,7 +83,7 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags}
#
# MacPorts:
-# sudo port install gcc14 glm libsdl2 libsdl2_net
+# sudo port install gcc14 glm mesa libsdl2 libsdl2_net
#
# cd /opt/local/bin
# sudo rm gcc g++ cc ld
@@ -92,24 +92,18 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags}
# cd -
# rehash
#
-# Use 'sudo port install mesa' to get a if no Xcode is installed.
-# If Xcode is installed be sure to run `xcode-select --install` first.
-#
#==================================================================================
#
# Homebrew:
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#
-# brew install gcc@14 glm sdl2 sdl2_net
+# brew install gcc@14 glm mesa sdl2 sdl2_net
#
# cd /opt/homebrew/bin
# sudo rm -f gcc g++ cc
# sudo ln -s gcc-14 gcc ; sudo ln -s g++-14 g++ ; sudo ln -s g++ cc
# cd -
#
-# Use 'brew install mesa' to get a if no Xcode is installed.
-# If Xcode is installed be sure to run `xcode-select --install` first.
-#
[simulator_macos]
build_unflags = -g3 -lGL -fstack-protector-strong
diff --git a/firmware/ini/raspberrypi.ini b/firmware/ini/raspberrypi.ini
new file mode 100644
index 0000000..c61b89b
--- /dev/null
+++ b/firmware/ini/raspberrypi.ini
@@ -0,0 +1,37 @@
+#
+# Marlin Firmware
+# PlatformIO Configuration File
+#
+# See https://arduino-pico.readthedocs.io/en/latest/platformio.html
+#
+
+[env:RP2040]
+platform = raspberrypi
+board = pico
+framework = arduino
+#board_build.core = earlephilhower
+#lib_ldf_mode = off
+#lib_compat_mode = strict
+build_src_filter = ${common.default_src_filter} +
+lib_deps = ${common.lib_deps}
+ arduino-libraries/Servo
+ https://github.com/pkElectronics/SoftwareSerialM#master
+ #lvgl/lvgl@^8.1.0
+lib_ignore = WiFi
+build_flags = ${common.build_flags} -D__PLAT_RP2040__ -DPLATFORM_M997_SUPPORT -Wno-expansion-to-defined -Wno-vla -Wno-ignored-qualifiers
+#debug_tool = jlink
+#upload_protocol = jlink
+
+[env:RP2040-alt]
+extends = env:RP2040
+platform = https://github.com/maxgerhardt/platform-raspberrypi.git
+board_build.core = earlephilhower
+
+#
+# BigTreeTech SKR Pico 1.x
+#
+[env:SKR_Pico]
+extends = env:RP2040
+
+[env:SKR_Pico_UART]
+extends = env:SKR_Pico
diff --git a/firmware/ini/renamed.ini b/firmware/ini/renamed.ini
index fb5fce6..f39cbec 100644
--- a/firmware/ini/renamed.ini
+++ b/firmware/ini/renamed.ini
@@ -102,9 +102,6 @@ extends = renamed
[env:STM32G0B1RE_manta_btt_xfer] ;=> STM32G0B1RE_manta_btt
extends = renamed
-[env:STM32G0B1VE_btt_xfer] ;=> STM32G0B1VE_btt
-extends = renamed
-
[env:BIGTREE_SKR_PRO] ;=> BTT_SKR_PRO
extends = renamed
diff --git a/firmware/ini/samd21.ini b/firmware/ini/samd21.ini
index f2acf82..8652f13 100644
--- a/firmware/ini/samd21.ini
+++ b/firmware/ini/samd21.ini
@@ -10,7 +10,7 @@
#################################
#
-# Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4)
+# ReprapWorld Minitronics (Atmel SAMD21J18 ARM Cortex-M0+)
#
[env:SAMD21_minitronics20]
platform = atmelsam
diff --git a/firmware/ini/stm32-common.ini b/firmware/ini/stm32-common.ini
index e4afaf0..ec058d1 100644
--- a/firmware/ini/stm32-common.ini
+++ b/firmware/ini/stm32-common.ini
@@ -19,6 +19,12 @@ build_unflags = -std=gnu++11
build_src_filter = ${common.default_src_filter} + - +
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py
+custom_marlin.HAS_LTDC_TFT = build_src_filter=+
+custom_marlin.HAS_FSMC_TFT = build_src_filter=+
+ build_flags=-DHAL_SRAM_MODULE_ENABLED
+custom_marlin.HAS_SPI_TFT = build_src_filter=+
+custom_marlin.HAS_TFT_XPT2046 = build_src_filter=+
+custom_marlin.TFT_TOUCH_DEVICE_GT911 = build_src_filter=+
#
# STM32 board based on a variant.
diff --git a/firmware/ini/stm32f1-maple.ini b/firmware/ini/stm32f1-maple.ini
index db852ca..59150f3 100644
--- a/firmware/ini/stm32f1-maple.ini
+++ b/firmware/ini/stm32f1-maple.ini
@@ -23,7 +23,7 @@
# HAL/STM32F1 Common Environment values
#
[STM32F1_maple]
-platform = ststm32@~12.1
+platform = ststm32@~15.4.1
board_build.core = maple
build_flags = !python buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py
${common.build_flags} -DARDUINO_ARCH_STM32 -DMAPLE_STM32F1 -DPLATFORM_M997_SUPPORT
@@ -33,11 +33,15 @@ lib_ignore = SPI, FreeRTOS701, FreeRTOS821
lib_deps = ${common.lib_deps}
SoftwareSerialM
platform_packages = tool-stm32duino
+ toolchain-gccarmnoneeabi@1.100301.220327
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py
buildroot/share/PlatformIO/scripts/custom_board.py
buildroot/share/PlatformIO/scripts/offset_and_rename.py
+custom_marlin.HAS_SPI_TFT = build_src_filter=+
+custom_marlin.HAS_TFT_XPT2046 = build_src_filter=+
+custom_marlin.HAS_FSMC_TFT = build_src_filter=+
#
# Generic STM32F103RC environment
@@ -61,6 +65,7 @@ monitor_speed = 115200
[env:STM32F103RC_meeb_maple]
extends = env:STM32F103RC_maple
board = marlin_maple_MEEB_3DP
+platform_packages = platformio/tool-dfuutil@~1.11.0
build_flags = ${env:STM32F103RC_maple.build_flags}
-DDEBUG_LEVEL=0
-DSS_TIMER=4
@@ -84,13 +89,14 @@ upload_protocol = dfu
# FYSETC STM32F103RC
#
[env:STM32F103RC_fysetc_maple]
-extends = env:STM32F103RC_maple
-extra_scripts = ${env:STM32F103RC_maple.extra_scripts}
- buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
-build_flags = ${env:STM32F103RC_maple.build_flags} -DDEBUG_LEVEL=0
-lib_ldf_mode = chain
-debug_tool = stlink
-upload_protocol = serial
+extends = env:STM32F103RC_maple
+extra_scripts = ${env:STM32F103RC_maple.extra_scripts}
+ buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
+build_flags = ${env:STM32F103RC_maple.build_flags} -DDEBUG_LEVEL=0
+platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
+lib_ldf_mode = chain
+debug_tool = stlink
+upload_protocol = serial
#
# BigTreeTech SKR Mini V1.1 / SKR Mini E3 & MZ (STM32F103RCT6 ARM Cortex-M3)
@@ -103,6 +109,7 @@ extends = env:STM32F103RC_maple
board_build.address = 0x08007000
board_build.ldscript = STM32F103RC_SKR_MINI_256K.ld
build_flags = ${env:STM32F103RC_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4
+platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
monitor_speed = 115200
[env:STM32F103RC_btt_USB_maple]
@@ -129,6 +136,7 @@ upload_protocol = jlink
[env:STM32F103RC_creality_maple]
extends = env:STM32F103RC_maple
build_flags = ${env:STM32F103RC_maple.build_flags} -DTEMP_TIMER_CHAN=4
+platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
board_build.address = 0x08007000
board_build.ldscript = creality256k.ld
board_build.rename = firmware-{date}-{time}.bin
@@ -152,6 +160,7 @@ board_build.ldscript = crealityPro.ld
[env:GD32F103RC_voxelab_maple]
extends = env:STM32F103RC_maple
build_flags = ${env:STM32F103RC_maple.build_flags} -DTEMP_TIMER_CHAN=4
+platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
board_build.address = 0x08007000
board_build.ldscript = creality256k.ld
debug_tool = jlink
@@ -161,6 +170,7 @@ upload_protocol = jlink
extends = env:STM32F103RE_maple
build_flags = ${env:STM32F103RE_maple.build_flags} -DTEMP_TIMER_CHAN=4
-DVOXELAB_N32 -DSDCARD_FLASH_LIMIT_256K
+platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
board_build.address = 0x08007000
board_build.ldscript = creality.ld
debug_tool = jlink
@@ -382,11 +392,13 @@ lib_ignore = Adafruit NeoPixel, SPI, SailfishLCD, SailfishRGB_LED
[env:STM32F103RC_ZM3E2_USB_maple]
extends = ZONESTAR_ZM3E_maple
+platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
board = genericSTM32F103RC
board_build.ldscript = ZONESTAR_ZM3E_256K.ld
[env:STM32F103VC_ZM3E4_USB_maple]
extends = ZONESTAR_ZM3E_maple
+platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
board = genericSTM32F103VC
board_build.ldscript = ZONESTAR_ZM3E_256K.ld
build_flags = ${ZONESTAR_ZM3E_maple.build_flags} -DTONE_TIMER=1 -DTONE_CHANNEL=2
diff --git a/firmware/ini/stm32f1.ini b/firmware/ini/stm32f1.ini
index 3a74b6c..0978b19 100644
--- a/firmware/ini/stm32f1.ini
+++ b/firmware/ini/stm32f1.ini
@@ -71,7 +71,7 @@ build_flags = ${env:STM32F103RC_btt.build_flags}
-DUSBD_IRQ_PRIO=5
-DUSBD_IRQ_SUBPRIO=6
-DUSBD_USE_CDC_MSC
-build_unflags = ${common_stm32.build_unflags} -DUSBD_USE_CDC
+build_unflags = ${env:STM32F103RC_btt.build_unflags} -DUSBD_USE_CDC
#
# Panda Pi V2.9 - Standalone (STM32F103RC)
@@ -83,8 +83,8 @@ build_flags = ${common_STM32F103RC_variant.build_flags}
-DTIMER_SERVO=TIM1
board_build.offset = 0x5000
board_upload.offset_address = 0x08005000
-lib_deps =
- markyue/Panda_SoftMasterI2C@1.0.3
+lib_deps = markyue/Panda_SoftMasterI2C@1.0.3
+
#
# MKS Robin (STM32F103ZET6)
# Uses HAL STM32 to support Marlin UI for TFT screen with optional touch panel
@@ -200,7 +200,7 @@ board = genericSTM32F103RC
extends = STM32F103Rx_creality
board = genericSTM32F103VE
board_build.variant = MARLIN_F103Vx
-build_flags = ${stm32_variant.build_flags}
+build_flags = ${STM32F103Rx_creality.build_flags}
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
-DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
#
@@ -253,7 +253,7 @@ board = malyanm200_f103cb
build_flags = ${common_stm32.build_flags}
-DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB
-DHAL_UART_MODULE_ENABLED
-build_src_filter = ${common.default_src_filter} + -
+build_src_filter = ${common_stm32.build_src_filter} + -
#
# FLYmaker FLY Mini (STM32F103RCT6)
@@ -462,7 +462,7 @@ board_upload.offset_address = 0x08005000
board_build.offset = 0x5000
board_upload.maximum_size = 237568
extra_scripts = ${stm32_variant.extra_scripts}
-build_flags = ${common_stm32.build_flags}
+build_flags = ${stm32_variant.build_flags}
-DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DUSE_USB_FS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 -DUSBD_USE_CDC_MSC
build_unflags = ${stm32_variant.build_unflags} -DUSBD_USE_CDC
diff --git a/firmware/ini/stm32f4.ini b/firmware/ini/stm32f4.ini
index afa4ef5..7fdbc69 100644
--- a/firmware/ini/stm32f4.ini
+++ b/firmware/ini/stm32f4.ini
@@ -33,6 +33,7 @@ build_flags = ${common_stm32.build_flags}
#
[env:FYSETC_CHEETAH_V20]
extends = stm32_variant
+platform_packages = platformio/tool-dfuutil@~1.11.0
board = marlin_FYSETC_CHEETAH_V20
board_build.offset = 0x8000
build_flags = ${stm32_variant.build_flags} -DSTM32F401xC
@@ -43,6 +44,7 @@ upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE"
#
[env:FYSETC_CHEETAH_V30]
extends = stm32_variant
+platform_packages = platformio/tool-dfuutil@~1.11.0
board = marlin_FYSETC_CHEETAH_V30
build_flags = ${stm32_variant.build_flags} -DHAL_PCD_MODULE_ENABLED
debug_tool = stlink
@@ -54,6 +56,7 @@ upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE"
#
[env:FLYF407ZG]
extends = stm32_variant
+platform_packages = platformio/tool-dfuutil@~1.11.0
board = marlin_STM32F407ZGT6
board_build.variant = MARLIN_FLY_F407ZG
board_build.offset = 0x8000
@@ -64,6 +67,7 @@ upload_protocol = dfu
#
[env:FYSETC_S6]
extends = stm32_variant
+platform_packages = platformio/tool-dfuutil@~1.11.0
board = marlin_fysetc_s6
board_build.offset = 0x10000
board_upload.offset_address = 0x08010000
@@ -87,6 +91,7 @@ upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE"
#
[env:FYSETC_SPIDER_KING407]
extends = stm32_variant
+platform_packages = platformio/tool-dfuutil@~1.11.0
board = marlin_STM32F407ZGT6
board_build.variant = MARLIN_FYSETC_SPIDER_KING407
board_build.offset = 0x8000
@@ -153,7 +158,7 @@ extends = Anet_ET4
board_build.encode = firmware.srec
board_build.offset = 0x10000
board_upload.offset_address = 0x08010000
-extra_scripts = ${stm32_variant.extra_scripts}
+extra_scripts = ${Anet_ET4.extra_scripts}
buildroot/share/PlatformIO/scripts/openblt.py
#
@@ -189,6 +194,19 @@ build_flags = ${stm32_variant.build_flags}
-DMF_RX_BUFFER_SIZE=255
-DMF_TX_BUFFER_SIZE=255
+#
+# Mellow/Fly RRF E3 V1 (STM32F407VGT6 ARM Cortex-M4)
+#
+[env:FLY_RRF_E3_V1]
+extends = stm32_variant
+board = marlin_STM32F407VGT6_CCM
+#board_build.variant = MARLIN_BTT_E3_RRF
+board_build.offset = 0x8000
+build_flags = ${stm32_variant.build_flags}
+ -DSTM32F407_5VX
+ -DMF_RX_BUFFER_SIZE=255
+ -DMF_TX_BUFFER_SIZE=255
+
#
# Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4)
#
@@ -418,6 +436,7 @@ build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags}
#
[env:rumba32]
extends = stm32_variant
+platform_packages = platformio/tool-dfuutil@~1.11.0
board = rumba32_f446ve
board_build.variant = MARLIN_F446VE
board_build.offset = 0x0000
@@ -497,7 +516,8 @@ build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags}
extends = env:mks_robin_nano_v3_usb_flash_drive
build_flags = ${env:mks_robin_nano_v3_usb_flash_drive.build_flags}
-DUSBD_USE_CDC_MSC
-build_unflags = -DUSBD_USE_CDC
+build_unflags = ${env:mks_robin_nano_v3_usb_flash_drive.build_unflags}
+ -DUSBD_USE_CDC
#
# MKS Robin Nano V3_1
@@ -626,7 +646,7 @@ extends = TH3D_EZBoard_V2
board_build.encode = firmware.bin
board_build.offset = 0xC000
board_upload.offset_address = 0x0800C000
-extra_scripts = ${stm32_variant.extra_scripts}
+extra_scripts = ${TH3D_EZBoard_V2.extra_scripts}
buildroot/share/PlatformIO/scripts/openblt.py
[mks_robin_nano_v1_3_f4_common]
@@ -647,11 +667,11 @@ upload_protocol = jlink
#
[env:mks_robin_nano_v1_3_f4]
extends = mks_robin_nano_v1_3_f4_common
-build_flags = ${stm32_variant.build_flags}
+build_flags = ${mks_robin_nano_v1_3_f4_common.build_flags}
-DMCU_STM32F407VE -DENABLE_HWSERIAL3 -DSTM32_FLASH_SIZE=512
-DTIMER_SERVO=TIM2 -DTIMER_TONE=TIM3 -DSS_TIMER=4
-DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED
-build_unflags = ${stm32_variant.build_unflags}
+build_unflags = ${mks_robin_nano_v1_3_f4_common.build_unflags}
-DUSBCON -DUSBD_USE_CDC
#
@@ -659,7 +679,7 @@ build_unflags = ${stm32_variant.build_unflags}
#
[env:mks_robin_nano_v1_3_f4_usbmod]
extends = mks_robin_nano_v1_3_f4_common
-build_flags = ${stm32_variant.build_flags}
+build_flags = ${mks_robin_nano_v1_3_f4_common.build_flags}
-DMCU_STM32F407VE -DSTM32_FLASH_SIZE=512
-DTIMER_SERVO=TIM2 -DTIMER_TONE=TIM3 -DSS_TIMER=4
-DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED
@@ -684,7 +704,7 @@ extra_scripts = ${common_stm32.extra_scripts}
[STM32F401RC_creality_base]
extends = stm32_variant
board = genericSTM32F401RC
-board_build.variant = MARLIN_CREALITY_STM32F401RC
+board_build.variant = MARLIN_F401RC_CREALITY
build_flags = ${stm32_variant.build_flags} -DMCU_STM32F401RC -DSTM32F4
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
-DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
@@ -719,7 +739,7 @@ upload_protocol = stlink
#
[env:STM32F401RE_creality]
extends = stm32_variant
-board = marlin_CREALITY_STM32F401RE
+board = marlin_STM32F401RE_creality
board_build.offset = 0x10000
board_upload.offset_address = 0x08010000
board_build.rename = firmware-{date}-{time}.bin
@@ -805,6 +825,7 @@ board_build.rename = mks_skipr.bin
[env:mks_skipr_v1_nobootloader]
extends = env:mks_skipr_v1
+platform_packages = platformio/tool-dfuutil@~1.11.0
board_build.rename = firmware.bin
board_build.offset = 0x0000
board_upload.offset_address = 0x08000000
@@ -861,6 +882,7 @@ upload_protocol = stlink
#
[env:BLACKBEEZMINI_V1]
platform = ststm32
+platform_packages = platformio/tool-dfuutil@~1.11.0
extends = common_stm32
board = blackpill_f401cc
board_build.offset = 0x0000
@@ -893,7 +915,6 @@ upload_protocol = stlink
# XTLW3D Climber-8th-F4 (STM32F407VGT6 ARM Cortex-M4)
#
[env:XTLW_CLIMBER_8TH]
-platform = ${common_stm32.platform}
extends = stm32_variant
platform_packages = ${stm_flash_drive.platform_packages}
board = marlin_STM32F407VGT6_CCM
diff --git a/firmware/ini/stm32g0.ini b/firmware/ini/stm32g0.ini
index 40493b3..4a9d1e4 100644
--- a/firmware/ini/stm32g0.ini
+++ b/firmware/ini/stm32g0.ini
@@ -90,6 +90,7 @@ build_flags = ${env:STM32G0B1RE_btt.build_flags}
#
# BigTreeTech Manta M8P V1.x (STM32G0B1VET6 ARM Cortex-M0+)
+# BigTreeTech SKRat V1.0 (STM32G0B1VET6 ARM Cortex-M0+)
#
[env:STM32G0B1VE_btt]
extends = stm32_variant
@@ -108,3 +109,14 @@ build_flags = ${stm32_variant.build_flags}
-Wl,--no-warn-rwx-segment
upload_protocol = stlink
debug_tool = stlink
+
+#
+# BigTreeTech SKRat V1.0 (STM32G0B1VET6 ARM Cortex-M0+)
+# Custom upload to SD via Marlin with Binary Protocol
+#
+[env:STM32G0B1VE_btt_xfer]
+extends = env:STM32G0B1VE_btt
+build_flags = ${env:STM32G0B1VE_btt.build_flags} -DXFER_BUILD
+extra_scripts = ${env:STM32G0B1VE_btt.extra_scripts}
+ pre:buildroot/share/scripts/upload.py
+upload_protocol = custom
diff --git a/firmware/platformio.ini b/firmware/platformio.ini
index 76200cb..ed1670d 100644
--- a/firmware/platformio.ini
+++ b/firmware/platformio.ini
@@ -36,6 +36,7 @@ extra_configs =
ini/stm32g0.ini
ini/teensy.ini
ini/renamed.ini
+ ini/raspberrypi.ini
#
# The 'common' section applies to most Marlin builds.
@@ -56,7 +57,7 @@ lib_deps =
default_src_filter = + - -
; LCDs and Controllers
- - - - -
- - - - -
+ - - - - -
-
; Marlin HAL
-
diff --git a/firmware/process-palette.json b/firmware/process-palette.json
deleted file mode 100644
index b3b05b9..0000000
--- a/firmware/process-palette.json
+++ /dev/null
@@ -1,357 +0,0 @@
-{
- "patterns": {
- "P1": {
- "expression": "(path):(line)"
- },
- "P2": {
- "expression": "(path)\\s+(line)",
- "path": "(?:\\/[\\w\\.\\-]+)+"
- }
- },
- "commands": [
- {
- "namespace": "process-palette",
- "action": "PIO Build",
- "command": "python buildroot/share/vscode/auto_build.py build",
- "arguments": [],
- "cwd": "{projectPath}",
- "inputDialogs": [],
- "env": {},
- "keystroke": null,
- "stream": true,
- "outputTarget": "panel",
- "outputBufferSize": 80000,
- "maxCompleted": 3,
- "autoShowOutput": true,
- "autoHideOutput": false,
- "scrollLockEnabled": false,
- "singular": true,
- "promptToSave": true,
- "saveOption": "none",
- "patterns": [
- "default"
- ],
- "successOutput": "{stdout}",
- "errorOutput": "{stdout}\n{stderr}",
- "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "startMessage": "",
- "successMessage": "Executed : {fullCommand}",
- "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}",
- "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "menus": [
- "Auto Build"
- ],
- "startScript": null,
- "successScript": null,
- "errorScript": null,
- "scriptOnStart": false,
- "scriptOnSuccess": false,
- "scriptOnError": false,
- "notifyOnStart": false,
- "notifyOnSuccess": true,
- "notifyOnError": true,
- "input": null
- },
- {
- "namespace": "process-palette",
- "action": "PIO Clean",
- "command": "python buildroot/share/vscode/auto_build.py clean",
- "arguments": [],
- "cwd": "{projectPath}",
- "inputDialogs": [],
- "env": {},
- "keystroke": null,
- "stream": true,
- "outputTarget": "panel",
- "outputBufferSize": 80000,
- "maxCompleted": 3,
- "autoShowOutput": true,
- "autoHideOutput": false,
- "scrollLockEnabled": false,
- "singular": false,
- "promptToSave": true,
- "saveOption": "none",
- "patterns": [
- "default"
- ],
- "successOutput": "{stdout}",
- "errorOutput": "{stdout}\n{stderr}",
- "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "startMessage": null,
- "successMessage": "Executed : {fullCommand}",
- "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}",
- "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "menus": [
- "Auto Build"
- ],
- "startScript": null,
- "successScript": null,
- "errorScript": null,
- "scriptOnStart": false,
- "scriptOnSuccess": false,
- "scriptOnError": false,
- "notifyOnStart": false,
- "notifyOnSuccess": true,
- "notifyOnError": true,
- "input": null
- },
- {
- "namespace": "process-palette",
- "action": "PIO Upload",
- "command": "python buildroot/share/vscode/auto_build.py upload",
- "arguments": [],
- "cwd": "{projectPath}",
- "inputDialogs": [],
- "env": {},
- "keystroke": null,
- "stream": true,
- "outputTarget": "panel",
- "outputBufferSize": 80000,
- "maxCompleted": 3,
- "autoShowOutput": true,
- "autoHideOutput": false,
- "scrollLockEnabled": false,
- "singular": false,
- "promptToSave": true,
- "saveOption": "none",
- "patterns": [
- "default"
- ],
- "successOutput": "{stdout}",
- "errorOutput": "{stdout}\n{stderr}",
- "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "startMessage": null,
- "successMessage": "Executed : {fullCommand}",
- "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}",
- "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "menus": [
- "Auto Build"
- ],
- "startScript": null,
- "successScript": null,
- "errorScript": null,
- "scriptOnStart": false,
- "scriptOnSuccess": false,
- "scriptOnError": false,
- "notifyOnStart": false,
- "notifyOnSuccess": true,
- "notifyOnError": true,
- "input": null
- },
- {
- "namespace": "process-palette",
- "action": "PIO Upload (traceback)",
- "command": "python buildroot/share/vscode/auto_build.py traceback",
- "arguments": [],
- "cwd": "{projectPath}",
- "inputDialogs": [],
- "env": {},
- "keystroke": null,
- "stream": true,
- "outputTarget": "panel",
- "outputBufferSize": 80000,
- "maxCompleted": 3,
- "autoShowOutput": true,
- "autoHideOutput": false,
- "scrollLockEnabled": false,
- "singular": false,
- "promptToSave": true,
- "saveOption": "none",
- "patterns": [
- "default"
- ],
- "successOutput": "{stdout}",
- "errorOutput": "{stdout}\n{stderr}",
- "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "startMessage": null,
- "successMessage": "Executed : {fullCommand}",
- "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}",
- "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "menus": [
- "Auto Build"
- ],
- "startScript": null,
- "successScript": null,
- "errorScript": null,
- "scriptOnStart": false,
- "scriptOnSuccess": false,
- "scriptOnError": false,
- "notifyOnStart": false,
- "notifyOnSuccess": true,
- "notifyOnError": true,
- "input": null
- },
- {
- "namespace": "process-palette",
- "action": "PIO Upload using Programmer",
- "command": "python buildroot/share/vscode/auto_build.py program",
- "arguments": [],
- "cwd": "{projectPath}",
- "inputDialogs": [],
- "env": {},
- "keystroke": null,
- "stream": true,
- "outputTarget": "panel",
- "outputBufferSize": 80000,
- "maxCompleted": 3,
- "autoShowOutput": true,
- "autoHideOutput": false,
- "scrollLockEnabled": false,
- "singular": false,
- "promptToSave": true,
- "saveOption": "none",
- "patterns": [
- "default"
- ],
- "successOutput": "{stdout}",
- "errorOutput": "{stdout}\n{stderr}",
- "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "startMessage": null,
- "successMessage": "Executed : {fullCommand}",
- "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}",
- "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "menus": [
- "Auto Build"
- ],
- "startScript": null,
- "successScript": null,
- "errorScript": null,
- "scriptOnStart": false,
- "scriptOnSuccess": false,
- "scriptOnError": false,
- "notifyOnStart": false,
- "notifyOnSuccess": true,
- "notifyOnError": true,
- "input": null
- },
- {
- "namespace": "process-palette",
- "action": "PIO Test",
- "command": "python buildroot/share/vscode/auto_build.py test",
- "arguments": [],
- "cwd": "{projectPath}",
- "inputDialogs": [],
- "env": {},
- "keystroke": null,
- "stream": true,
- "outputTarget": "panel",
- "outputBufferSize": 80000,
- "maxCompleted": 3,
- "autoShowOutput": true,
- "autoHideOutput": false,
- "scrollLockEnabled": false,
- "singular": false,
- "promptToSave": true,
- "saveOption": "none",
- "patterns": [
- "default"
- ],
- "successOutput": "{stdout}",
- "errorOutput": "{stdout}\n{stderr}",
- "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "startMessage": null,
- "successMessage": "Executed : {fullCommand}",
- "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}",
- "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "menus": [
- "Auto Build"
- ],
- "startScript": null,
- "successScript": null,
- "errorScript": null,
- "scriptOnStart": false,
- "scriptOnSuccess": false,
- "scriptOnError": false,
- "notifyOnStart": false,
- "notifyOnSuccess": true,
- "notifyOnError": true,
- "input": null
- },
- {
- "namespace": "process-palette",
- "action": "PIO Debug",
- "command": "python buildroot/share/vscode/auto_build.py debug",
- "arguments": [],
- "cwd": "{projectPath}",
- "inputDialogs": [],
- "env": {},
- "keystroke": null,
- "stream": true,
- "outputTarget": "panel",
- "outputBufferSize": 80000,
- "maxCompleted": 3,
- "autoShowOutput": true,
- "autoHideOutput": false,
- "scrollLockEnabled": false,
- "singular": false,
- "promptToSave": true,
- "saveOption": "none",
- "patterns": [
- "default"
- ],
- "successOutput": "{stdout}",
- "errorOutput": "{stdout}\n{stderr}",
- "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "startMessage": null,
- "successMessage": "Executed : {fullCommand}",
- "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}",
- "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "menus": [
- "Auto Build"
- ],
- "startScript": null,
- "successScript": null,
- "errorScript": null,
- "scriptOnStart": false,
- "scriptOnSuccess": false,
- "scriptOnError": false,
- "notifyOnStart": false,
- "notifyOnSuccess": true,
- "notifyOnError": true,
- "input": null
- },
- {
- "namespace": "process-palette",
- "action": "PIO Remote",
- "command": "python buildroot/share/vscode/auto_build.py remote",
- "arguments": [],
- "cwd": "{projectPath}",
- "inputDialogs": [],
- "env": {},
- "keystroke": null,
- "stream": true,
- "outputTarget": "panel",
- "outputBufferSize": 80000,
- "maxCompleted": 3,
- "autoShowOutput": true,
- "autoHideOutput": false,
- "scrollLockEnabled": false,
- "singular": false,
- "promptToSave": true,
- "saveOption": "none",
- "patterns": [
- "default"
- ],
- "successOutput": "{stdout}",
- "errorOutput": "{stdout}\n{stderr}",
- "fatalOutput": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "startMessage": null,
- "successMessage": "Executed : {fullCommand}",
- "errorMessage": "Executed : {fullCommand}\nReturned with code {exitStatus}\n{stderr}",
- "fatalMessage": "Failed to execute : {fullCommand}\n{stdout}\n{stderr}",
- "menus": [
- "Auto Build"
- ],
- "startScript": null,
- "successScript": null,
- "errorScript": null,
- "scriptOnStart": false,
- "scriptOnSuccess": false,
- "scriptOnError": false,
- "notifyOnStart": false,
- "notifyOnSuccess": true,
- "notifyOnError": true,
- "input": null
- }
- ]
-}
diff --git a/gcode/home_large_stator.gcode b/gcode/home_large_stator.gcode
deleted file mode 100644
index f51c87c..0000000
--- a/gcode/home_large_stator.gcode
+++ /dev/null
@@ -1,10 +0,0 @@
-G90
-G28 X
-G28 Y
-G0 Y0 F3000
-G0 Y40 F3000
-G0 Y0 F3000
-G0 X23.3 Y21.2 F3000
-;DISABLE STEPPERS
-M17 X Y Z E
-G91
\ No newline at end of file
diff --git a/gcode/one_coil.gcode b/gcode/one_coil.gcode
deleted file mode 100644
index 78d2bce..0000000
--- a/gcode/one_coil.gcode
+++ /dev/null
@@ -1,313 +0,0 @@
-; Tuple begin
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.07 F1000
-G0 E1.43
-G0 Y-18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.07 F1000
-G0 E1.43
-G0 Y-18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y9.4 X-0.021 F1000
-G0 E1.43
-G0 Y-18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-M117 Begin transition up
-G0 Y-12.1 F300
-G0 X+6.58 F50
-G0 E1.43 F50
-G0 Y+12.1 F50
-M117 End transition up
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.07 F1000
-G0 E1.43
-G0 Y18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.07 F1000
-G0 E1.43
-G0 Y18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y-9.4 X-0.021 F1000
-G0 E1.43
-G0 Y18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-G0 Y-8 F500
-G0 X+6.58 F300
-G0 E7.1 F500
-G0 Y+8 F500
-G90 ; Disable positioning
-; Tuple end
-; Pause the print
-M0 "QUESTION FOR OPERATOR"
-; Tuple begin
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.07 F1000
-G0 E1.43
-G0 Y18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.07 F1000
-G0 E1.43
-G0 Y18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y-9.4 X-0.021 F1000
-G0 E1.43
-G0 Y18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-M117 Begin transition up
-G0 Y-12.1 F300
-G0 X+6.58 F50
-G0 E1.43 F50
-G0 Y+12.1 F50
-M117 End transition up
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.07 F1000
-G0 E1.43
-G0 Y-18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.07 F1000
-G0 E1.43
-G0 Y-18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y9.4 X-0.021 F1000
-G0 E1.43
-G0 Y-18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-G0 Y-8 F500
-G0 X+6.58 F300
-G0 E7.1 F500
-G0 Y+8 F500
-G90 ; Disable positioning
-; Tuple end
-M0 "QUESTION FOR OPERATOR"
-; Tuple begin
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.07 F1000
-G0 E1.43
-G0 Y-18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.07 F1000
-G0 E1.43
-G0 Y-18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y9.4 X-0.021 F1000
-G0 E1.43
-G0 Y-18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-M117 Begin transition up
-G0 Y-12.1 F300
-G0 X+6.58 F50
-G0 E1.43 F50
-G0 Y+12.1 F50
-M117 End transition up
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.07 F1000
-G0 E1.43
-G0 Y18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.07 F1000
-G0 E1.43
-G0 Y18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y-9.4 X-0.021 F1000
-G0 E1.43
-G0 Y18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-G0 Y-8 F500
-G0 X+6.58 F300
-G0 E7.1 F500
-G0 Y+8 F500
-G90 ; Disable positioning
-; Tuple end
-M0 "QUESTION FOR OPERATOR"
-; Tuple begin
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.07 F1000
-G0 E1.43
-G0 Y18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.07 F1000
-G0 E1.43
-G0 Y18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y-9.4 X-0.021 F1000
-G0 E1.43
-G0 Y18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-M117 Begin transition up
-G0 Y-12.1 F300
-G0 X+6.58 F50
-G0 E1.43 F50
-G0 Y+12.1 F50
-M117 End transition up
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.07 F1000
-G0 E1.43
-G0 Y-18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.07 F1000
-G0 E1.43
-G0 Y-18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y9.4 X-0.021 F1000
-G0 E1.43
-G0 Y-18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-; Tuple end
\ No newline at end of file
diff --git a/gcode/one_phase_large_stator.gcode b/gcode/one_phase_large_stator.gcode
deleted file mode 100644
index 1e52780..0000000
--- a/gcode/one_phase_large_stator.gcode
+++ /dev/null
@@ -1,112 +0,0 @@
-; 1/4 phase of the wire
-M808 L4
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.075 F1000
-G0 E1.4
-G0 Y-18.8 X-0.15 F1000
-G0 E-1.4
-G0 Y9.4 X-0.075 F1000
-M808
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.075 F1000
-G0 E1.4
-G0 Y-18.8 X+0.15 F1000
-G0 E-1.4
-G0 Y9.4 X+0.075 F1000
-M808
-M808 L70
-G0 Y9.4 X-0.019 F1000
-G0 E1.4
-G0 Y-18.8 X-0.038 F1000
-G0 E-1.4
-G0 Y9.4 X-0.019 F1000
-M808
-G90 ; Disable relative positioning
-; END One cycle of rotation
-;
-;
-;
-;
-;
-G91
-G0 Y9.4 X-0.075 F1000
-G90
-G0 X23.3
-G91
-G0 E1.4
-G0 Y-18.8 X-0.15 F1000
-G0 E-1.4
-G0 Y9.4 X-0.075 F1000
-G90
-
-; BEGIN TRANSITIONUP
-G91
-G0 Y4.7 F1000
-G0 Y4.7 F3000
-G0 E+1.43
-G0 Y-4.7 F3000
-G0 Y-4.7 F1000
-G0 Y-4.7 F1000
-G0 Y-4.7 F3000
-G0 E-1.43
-G0 Y4.7 F3000
-G0 Y4.7 F1000
-G0 Y4.7 F3000
-G0 Y4.7 F1000
-G0 E+1.43
-G0 Y-4.7 F3000
-G0 Y-4.7 F1000
-G90
-; END TRANSITIONUP
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.075 F1000
-G0 E1.4
-G0 Y+18.8 X-0.15 F1000
-G0 E-1.4
-G0 Y-9.4 X-0.075 F1000
-M808
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.075 F1000
-G0 E1.4
-G0 Y+18.8 X+0.15 F1000
-G0 E-1.4
-G0 Y-9.4 X+0.075 F1000
-M808
-M808 L70
-G0 Y-9.4 X-0.019 F1000
-G0 E1.4
-G0 Y+18.8 X-0.038 F1000
-G0 E-1.4
-G0 Y-9.4 X-0.019 F1000
-M808
-G90 ; Disable relative positioning
-; END One cycle of rotation
-;
-;
-;
-;
-;
-G91
-G0 Y-9.4 X-0.075 F1000
-G90
-G0 X23.3
-G91
-G0 E1.4
-G0 Y+18.8 X-0.15 F1000
-G0 E-1.4
-G0 Y-9.4 X-0.075 F1000
-G90
-
-G91 ; Relative positioning
-G0 Y-6.4 F1000
-G0 E7.15 F1000
-G0 Y+6.4 F1000
-G90
-M808
\ No newline at end of file
diff --git a/gcode/two_coil_rev.gcode b/gcode/two_coil_rev.gcode
deleted file mode 100644
index 860834f..0000000
--- a/gcode/two_coil_rev.gcode
+++ /dev/null
@@ -1,313 +0,0 @@
-; Tuple begin
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.07 F1000
-G0 E1.43
-G0 Y18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.07 F1000
-G0 E1.43
-G0 Y18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y-9.4 X-0.021 F1000
-G0 E1.43
-G0 Y18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-M117 Begin transition up
-G0 Y-12.1 F300
-G0 X+6.58 F50
-G0 E1.43 F50
-G0 Y+12.1 F50
-M117 End transition up
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.07 F1000
-G0 E1.43
-G0 Y-18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.07 F1000
-G0 E1.43
-G0 Y-18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y+9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y9.4 X-0.021 F1000
-G0 E1.43
-G0 Y-18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-G0 Y-8 F500
-G0 X+6.58 F300
-G0 E7.1 F500
-G0 Y+8 F500
-G90 ; Disable positioning
-; Tuple end
-; Pause the print
-M0 "QUESTION FOR OPERATOR"
-; Tuple begin
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.07 F1000
-G0 E1.43
-G0 Y-18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y+9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.07 F1000
-G0 E1.43
-G0 Y-18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y9.4 X-0.021 F1000
-G0 E1.43
-G0 Y-18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y+9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-M117 Begin transition up
-G0 Y-12.1 F300
-G0 X+6.58 F50
-G0 E1.43 F50
-G0 Y+12.1 F50
-M117 End transition up
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.07 F1000
-G0 E1.43
-G0 Y+18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.07 F1000
-G0 E1.43
-G0 Y+18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y-9.4 X-0.021 F1000
-G0 E1.43
-G0 Y+18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-G0 Y-8 F500
-G0 X+6.58 F300
-G0 E7.1 F500
-G0 Y+8 F500
-G90 ; Disable positioning
-; Tuple end
-M0 "QUESTION FOR OPERATOR"
-; Tuple begin
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.07 F1000
-G0 E1.43
-G0 Y+18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.07 F1000
-G0 E1.43
-G0 Y+18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y-9.4 X-0.021 F1000
-G0 E1.43
-G0 Y+18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-M117 Begin transition up
-G0 Y-12.1 F300
-G0 X+6.58 F50
-G0 E1.43 F50
-G0 Y+12.1 F50
-M117 End transition up
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.07 F1000
-G0 E1.43
-G0 Y-18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.07 F1000
-G0 E1.43
-G0 Y-18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y+9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y9.4 X-0.021 F1000
-G0 E1.43
-G0 Y-18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-G0 Y-8 F500
-G0 X+6.58 F300
-G0 E7.1 F500
-G0 Y+8 F500
-G90 ; Disable positioning
-; Tuple end
-M0 "QUESTION FOR OPERATOR"
-; Tuple begin
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y9.4 X-0.07 F1000
-G0 E1.43
-G0 Y-18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y9.4 X+0.07 F1000
-G0 E1.43
-G0 Y-18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y9.4 X-0.021 F1000
-G0 E1.43
-G0 Y-18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-M117 Begin transition up
-G0 Y-12.1 F300
-G0 X+6.58 F50
-G0 E1.43 F50
-G0 Y+12.1 F50
-M117 End transition up
-G90 ; Disable relative positioning
-
-G91 ; Relative positioning
-; BEGIN One cycle of rotation
-M808 L26
-G0 Y-9.4 X-0.07 F1000
-G0 E1.43
-G0 Y+18.8 X-0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.07 F1000
-M808
-; Print the coil
-M117 26/100
-; TOTAL COUNT 26
-M808 L19
-G0 Y-9.4 X+0.07 F1000
-G0 E1.43
-G0 Y+18.8 X+0.14 F1000
-G0 E-1.43
-G0 Y-9.4 X+0.07 F1000
-M808
-; Print the coil
-M117 45/100
-M808 L55
-G0 Y-9.4 X-0.021 F1000
-G0 E1.43
-G0 Y+18.8 X-0.042 F1000
-G0 E-1.43
-G0 Y-9.4 X-0.021 F1000
-M808
-M117 100/100
-G90 ; Disable relative positioning
-; Tuple end
\ No newline at end of file
diff --git a/gcodegenerator/gcodegenerator.lpi b/gcodegenerator/gcodegenerator.lpi
new file mode 100644
index 0000000..ee3afdd
--- /dev/null
+++ b/gcodegenerator/gcodegenerator.lpi
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
diff --git a/gcodegenerator/gcodegenerator.lps b/gcodegenerator/gcodegenerator.lps
new file mode 100644
index 0000000..1e3fc6b
--- /dev/null
+++ b/gcodegenerator/gcodegenerator.lps
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gcodegenerator/gcodegenerator.pas b/gcodegenerator/gcodegenerator.pas
new file mode 100644
index 0000000..0529c25
--- /dev/null
+++ b/gcodegenerator/gcodegenerator.pas
@@ -0,0 +1,654 @@
+program gcodegenerator;
+
+uses
+ SysUtils, StrUtils, Math;
+
+type
+ TPoint = record
+ X, Y: double;
+ end;
+
+type
+ TStatorParams = record
+ StatorName: String;
+ BaseDiameter: Double;
+ BaseRadius: Double;
+ NumberOfRays: Integer;
+ RayShape: string;
+ RayDiameter: Double;
+ RayWidth: Double;
+ RayHeight: Double;
+ RayLength: Double;
+
+ RayTopShape: string;
+ RayTopDiameter: Double;
+ RayTopWidth: Double;
+ RayTopHeight: Double;
+
+ RayCenterOffset: Double;
+ WireDiameter: Double;
+ NeedleDiameter: Double;
+ PathClearance: Double;
+
+ WorkSpeed :integer;
+ end;
+
+type
+ TLayer = record
+ Turns: Integer; // ���������� ������
+ StartZ: double; // ��������� ����������
+ EndZ: double; // �������� ����������
+ end;
+
+var
+ StartTime, EndTime, ExecutionTime: TDateTime;
+ InputFileName, OutputFileName, CoilGeometryFileName: string;
+ StatorParams: TStatorParams;
+ InFile, OutFile, CoilGeometryFile: TextFile;
+ Line: string;
+ CoilRadius,CoilWidth,CoilHeight :double;
+ CurrentZ: double;
+ coords: TPoint;
+ normalizecoords: TPoint;
+ Layers: array[1..10] of TLayer;
+ i, j, k: Integer;
+ CoilLength :double;
+ CurrentCoilTurns, CoilTurnsSum :Integer;
+ AngleBetweenRays :double;
+ RequiredSpacing: Double;
+ LayerNumber :Integer;
+ MaxLayers :Integer;
+ angle :double;
+ MaxDepth,MaxPath :double;
+ MoveForward:boolean;
+ OperationMode:string;
+
+
+ function ParseLine(Line: string): Boolean;
+ var
+ Parts: array of string;
+ Value: string;
+ TrimmedLine: string;
+ begin
+ TrimmedLine := Trim(Line); // ������� ������� � ������ � ����� ������
+ if Length(TrimmedLine) = 0 then
+ begin
+ exit(true); // ������ ������ - ����������
+ end
+ else if TrimmedLine[1] in [';','#'] then
+ begin
+ exit(true); // ������ ����������� - ����������
+ end;
+ Parts := SplitString(TrimmedLine, '='); // ���������� TrimmedLine
+ Result := Length(Parts) = 2;
+ if Result then
+ begin
+ Value := LowerCase(Trim(Parts[1])); // �������� � ������� ��������
+ case Trim(Parts[0]) of
+ 'stator_name': begin
+ StatorParams.StatorName := Value;
+ writeln('StatorName: ', StatorParams.StatorName);
+ writeln();
+ end;
+ 'Operation_Mode': begin
+ OperationMode := Value;
+ writeln('Operation Mode: ', OperationMode);
+ writeln();
+ end;
+ 'base_dia': begin
+ StatorParams.BaseDiameter := StrToFloat(Value);
+ writeln('Base Diameter: ', StatorParams.BaseDiameter:8:2);
+ writeln();
+ StatorParams.BaseRadius := StatorParams.BaseDiameter/2;
+ writeln('Base Radius: ', StatorParams.BaseRadius:8:2);
+ writeln();
+
+ end;
+ 'num_rays': begin
+ StatorParams.NumberOfRays := StrToInt(Value);
+ writeln('Number of Rays: ', StatorParams.NumberOfRays);
+ AngleBetweenRays := 360/StatorParams.NumberOfRays;
+ writeln('Angle Between Rays: ', AngleBetweenRays);
+ writeln();
+ end;
+ 'ray_shape': begin
+ if Pos(Value, 'circle, rect, superellipse') = 0 then
+ raise Exception.Create('Invalid value for ray_shape: ' + Value);
+ StatorParams.RayShape := Value;
+ writeln('Ray Shape: ', StatorParams.RayShape);
+ writeln();
+ end;
+ 'ray_dia': begin
+ StatorParams.RayDiameter := StrToFloat(Value);
+ writeln('Ray Diameter: ', StatorParams.RayDiameter:8:2);
+ writeln();
+ end;
+ 'ray_w': begin
+ StatorParams.RayWidth := StrToFloat(Value);
+ writeln('Ray Width: ', StatorParams.RayWidth:8:2);
+ writeln();
+ end;
+ 'ray_h': begin
+ StatorParams.RayHeight := StrToFloat(Value);
+ writeln('Ray Height: ', StatorParams.RayHeight:8:2);
+ writeln();
+ end;
+ 'ray_len': begin
+ StatorParams.RayLength := StrToFloat(Value);
+ writeln('Ray Length: ', StatorParams.RayLength:8:2);
+ writeln();
+ end;
+
+ 'raytop_shape': begin
+ if Pos(Value, 'circle, rect, superellipse') = 0 then
+ raise Exception.Create('Invalid value for ray_top: ' + Value);
+ StatorParams.RayTopShape := Value;
+ writeln('Ray Top Shape: ', StatorParams.RayTopShape);
+ end;
+
+ 'raytop_dia': begin
+ StatorParams.RayTopDiameter := StrToFloat(Value);
+ writeln('Ray Top Diameter: ', StatorParams.RayTopDiameter:8:2);
+ writeln();
+ end;
+ 'raytop_w': begin
+ StatorParams.RayTopWidth := StrToFloat(Value);
+ writeln('Ray Top Width: ', StatorParams.RayTopWidth:8:2);
+ writeln();
+ end;
+ 'raytop_h': begin
+ StatorParams.RayTopHeight := StrToFloat(Value);
+ writeln('Ray Top Height: ', StatorParams.RayTopHeight:8:2);
+ writeln();
+ end;
+
+ 'ray_offset': begin
+ StatorParams.RayCenterOffset := StrToFloat(Value);
+ writeln('Ray Center Offset: ', StatorParams.RayCenterOffset:8:2);
+ writeln();
+ end;
+ 'wire_diameter': begin
+ StatorParams.WireDiameter := StrToFloat(Value);
+ writeln('Wire Diameter: ', StatorParams.WireDiameter:8:2);
+ writeln();
+ end;
+ 'needle_diameter': begin
+ StatorParams.NeedleDiameter := StrToFloat(Value);
+ writeln('Needle Diameter: ', StatorParams.NeedleDiameter:8:2);
+ writeln();
+ end;
+ 'path_clearance': begin
+ StatorParams.PathClearance := StrToFloat(Value);
+ writeln('Path Clearance: ', StatorParams.PathClearance:8:2);
+ writeln();
+ end;
+ 'work_speed': begin
+ StatorParams.WorkSpeed := StrToInt(Value);
+ writeln('Work Speed: ', StatorParams.WorkSpeed);
+ writeln();
+ end;
+
+
+ else
+ Result := False;
+ end;
+ if not Result then
+ begin
+ writeln('Error: Unknown parameter: ', Parts[0]);
+ exit;
+ end;
+ end;
+ end;
+
+ procedure ReadInputFile();
+ Begin
+ // **Opening the input file**
+ AssignFile(InFile, InputFileName);
+ try
+ Reset(InFile); // **This line opens the file for reading**
+ while not EOF(InFile) do
+ begin
+ ReadLn(InFile, Line);
+ if Length(Line) > 0 then
+ if not ParseLine(Line) then
+ writeln('Error: Invalid line: ', Line);
+ end;
+ except
+ on E: Exception do
+ begin
+ writeln('Error opening or reading input file: ', E.Message);
+ Halt(1);
+ end;
+ end;
+ CloseFile(InFile);
+ end;
+
+ function CircleCoordinates(diameter, angleDegrees: Double): TPoint;
+ var
+ radius: Double;
+ angleRadians: Double;
+ begin
+ radius := diameter / 2;
+// angleRadians := -1*angleDegrees * PI / 180; // ������� �������� � �������
+ angleRadians := -1 * DegToRad(angleDegrees);
+
+ Result.X := radius * Cos(angleRadians);
+ Result.Y := radius * Sin(angleRadians);
+end;
+
+ function CalculateAngle(opposite, adjacent: Double): Double;
+ begin
+ if adjacent = 0 then
+ raise Exception.Create('Adjacent side cannot be zero');
+// CalculateAngle := ArcTan(opposite / adjacent) * 180 / PI;
+ CalculateAngle := RadToDeg(ArcTan(opposite / adjacent));
+ end;
+
+ function NormalizeZ(radius: Real; thetaDeg: Real): Real;
+var
+ thetaRad, alphaRad, xKas, yKas, mTang, bTang: Real;
+begin
+ // 1. �������������� ���� �� �������� � �������.
+ thetaRad := DegToRad(thetaDeg);
+
+ // 2. ���������� ��������� ����� ������� �� ���������� (������������ ������ 0,0).
+ xKas := radius * Cos(thetaRad);
+ yKas := radius * Sin(thetaRad);
+
+ // 3. ���������� ����, ����������������� ������-������� (�����������).
+ alphaRad := thetaRad + PI / 2;
+
+ // 4. ���������� �������� ������������ �����������.
+ mTang := Tan(alphaRad);
+
+ // 5. ���������� ���������� ����� ��������� ����������� (y = mTang * x + bTang).
+ bTang := yKas - mTang * xKas;
+
+ // 6. ���������� ���������� X ����� ����������� ����������� � ���� X (y = 0).
+ // 0 = mTang * x + bTang
+ // x = -bTang / mTang
+ if mTang = 0 then
+ begin
+ // ����������� ����������� ��� X - ��� ����� �����������. ���������� NaN.
+ NormalizeZ := NaN;
+ end
+ else
+ begin
+ NormalizeZ := -bTang / mTang;
+ end;
+end;
+
+ function DepthCheck(thickness, lineLength, angleDeg: double): double;
+ var
+ xIntersection, distanceToIntersection, radius: double;
+begin
+ xIntersection := (thickness/2 + thickness/2 * cos(DegToRad(angleDeg)))/sin(DegToRad(angleDeg));
+ distanceToIntersection := sqrt(sqr(xIntersection) + sqr(1.2));
+ radius := lineLength / (2 * tan(DegToRad(angleDeg) / 2));
+ DepthCheck := distanceToIntersection + radius;
+end;
+
+ function CalculateMaxPath(length, width, angleDegrees: double): double;
+ //������� ��������� ������������ ���������� ����� ������. ��� ����� �� ������ ������� ��
+ var
+ topLeftX, topLeftY, rotatedX, rotatedY, angleRadians, distance: double;
+begin
+ // ��������� ���������� �������� ������ ���� ��������������
+ topLeftX := -length;
+ topLeftY := width / 2;
+
+ // ����������� ���� � ������� (� ������ �������� �� ������� �������)
+ angleRadians := degToRad(-angleDegrees);
+
+ // ��������� ���������� ����������� ������� ������ ���� ������� ��������������
+ rotatedX := -length * cos(angleRadians) - (-width / 2) * sin(angleRadians);
+ rotatedY := -length * sin(angleRadians) + (-width / 2) * cos(angleRadians);
+
+ // ��������� ���������� ����� �������
+ distance := sqrt(sqr(rotatedX - topLeftX) + sqr(rotatedY - topLeftY));
+
+ // ���������� ���������
+ MaxPath := distance;
+end;
+
+ procedure CalculateCoilGeometry();
+ var
+ StartZ, EndZ: double;
+ begin
+ writeln('CalculateCoilGeometry');
+ AssignFile(CoilGeometryFile, CoilGeometryFileName);
+ try
+ Rewrite(CoilGeometryFile);
+ //�������, ������� ���� ����� ��������.
+ MaxPath:=CalculateMaxPath((StatorParams.RayLength+StatorParams.BaseRadius), StatorParams.RayWidth, AngleBetweenRays);
+ //writeln(CoilGeometryFile, ';MaxPath:', MaxPath);
+ //MaxLayers :=trunc(((MaxPath-RequiredSpacing)/2/StatorParams.WireDiameter));
+ MaxLayers :=round((MaxPath-StatorParams.NeedleDiameter)/2/(StatorParams.WireDiameter+RequiredSpacing));
+ if (MaxLayers mod 2 <> 0) then writeln(CoilGeometryFile, ';MaxLayers ', MaxLayers) else
+ begin
+ dec(MaxLayers);
+ writeln(CoilGeometryFile, ';�alculations resulted in MaxLayers=', MaxLayers+1, ' because it is even, MaxLayers=MaxLayers-1 and equal ',MaxLayers);
+ end;
+
+ MoveForward:=true;
+ for i := 1 to MaxLayers do
+ begin
+ write(CoilGeometryFile, ';Lair:', i, ' have ');
+ //������� ����� ������� � ���������� ������
+ //��� ����� ������� ����������� ���������� ����� ������. 2 �������� ������� + ������� ���� + 2 ������ ������������
+ RequiredSpacing:=StatorParams.PathClearance*2+(i-1)*StatorParams.WireDiameter*2+StatorParams.NeedleDiameter;
+ //��������� ����������� ����������, ������������ �� �����, ������������ ������� ����� ����������� ������. (���������� �� ������ �������)
+ MaxDepth:=DepthCheck(StatorParams.RayWidth, RequiredSpacing, AngleBetweenRays);
+ //writeln(OutFile, ';RayWidth ', StatorParams.RayWidth:0:5);
+ //writeln(OutFile, ';RequiredSpacing ', RequiredSpacing:0:5);
+ //writeln(OutFile, ';AngleBetweenRays ', AngleBetweenRays:0:5);
+ //writeln(CoilGeometryFile, ';MaxDepth ', MaxDepth:0:5);
+ //writeln(OutFile);
+ //���� ���������� ������� ������, ��� ������� ���������, ����� ����� ������� ����� ����� ����.
+ //���� ���������� ������� ������, ��� ������� + ����� ����, ���������� ����.
+ //����� ����� ������� ����� "������_��������� + �����_���� - �������)
+ If (MaxDepth < (StatorParams.BaseRadius)) then CoilLength:=StatorParams.RayLength else if (MaxDepth > (StatorParams.RayLength+StatorParams.BaseRadius)) then break
+ else CoilLength:=StatorParams.RayLength+StatorParams.BaseRadius-MaxDepth;
+ //writeln(CoilGeometryFile, '!!!');
+
+ write(CoilGeometryFile, CoilLength:0:5, 'mm ');
+ //CurrentCoilTurns := ceil(CoilLength/StatorParams.WireDiameter);
+ //������ �� ����� ������� ������� ���������� ������. � ���������� ������� ����� ������ �� �������.
+ CurrentCoilTurns := round(CoilLength/StatorParams.WireDiameter);
+ write(CoilGeometryFile, CurrentCoilTurns, ' Turns');
+ CoilTurnsSum := CoilTurnsSum+CurrentCoilTurns;
+
+
+ //����� ������ ����� ����� ����������� ���������� Z
+ //writeln(CoilGeometryFile,' StartZ=',CurrentZ:0:5);
+// if (MoveForward = false) then CurrentZ:=StatorParams.RayLength+StatorParams.BaseRadius-StatorParams.WireDiameter/2
+// else CurrentZ:=StatorParams.RayLength+StatorParams.BaseRadius-StatorParams.WireDiameter*(CurrentCoilTurns-0.5);
+ if (MoveForward = false) then StartZ:=StatorParams.RayLength+StatorParams.BaseRadius-StatorParams.WireDiameter/2
+ else StartZ:=StatorParams.RayLength+StatorParams.BaseRadius-StatorParams.WireDiameter*(CurrentCoilTurns-0.5);
+
+ write(CoilGeometryFile,' NewStartZ=',StartZ:0:5);
+
+ if (MoveForward = true) then EndZ:=StartZ+StatorParams.WireDiameter*CurrentCoilTurns
+ else EndZ:=StartZ-StatorParams.WireDiameter*CurrentCoilTurns;
+ writeln(CoilGeometryFile,' EndZ=',EndZ:0:5);
+ //Inc(LayerNumber);
+ CoilWidth:=CoilWidth+StatorParams.WireDiameter*2;
+ MoveForward:= not MoveForward;
+ //writeln(CoilGeometryFile,';MoveForward: ', MoveForward);
+ //writeln(CoilGeometryFile);
+ writeln(CoilGeometryFile, CurrentCoilTurns, ' ',StartZ:0:5, ' ',EndZ:0:5);
+ Layers[i].Turns := CurrentCoilTurns;
+ Layers[i].StartZ := StartZ;
+ Layers[i].EndZ := EndZ;
+ end;
+ writeln(CoilGeometryFile);
+ writeln(CoilGeometryFile,';CoilTurnsSum: ', CoilTurnsSum);
+
+
+
+ except
+ on E: Exception do
+ begin
+ writeln('Error writing to coil_geometry file: ', E.Message);
+ Halt(1);
+ end;
+ end;
+ CloseFile(CoilGeometryFile);
+ end;
+
+ procedure ReadCoilGeometry();
+ var
+// Parts: array of string;
+// Value: string;
+ TrimmedLine: string;
+ line: string;
+ count, i, turns: Integer;
+ startZ: float;
+ endZ: float;
+ spacePos: Integer;
+ err: Integer;
+ begin
+ writeln('ReadCoilGeometry');
+ AssignFile(CoilGeometryFile, CoilGeometryFileName);
+ try
+ Reset(CoilGeometryFile); // **This line opens the file for reading**
+ i := 0;
+ while not EOF(CoilGeometryFile) do
+ begin
+ //writeln('!!!');
+ ReadLn(CoilGeometryFile, Line);
+ if Length(Line) > 0 then
+ begin
+ TrimmedLine := Trim(Line); // ������� ������� � ������ � ����� ������
+ if (Length(TrimmedLine) = 0) then continue //exit() // ������ ������ - ����������
+ else if TrimmedLine[1] in [';','#'] then continue; // exit(); // ������ ����������� - ����������
+ inc(i);
+ spacePos := Pos(' ', TrimmedLine);
+ //writeln(spacePos);
+ //writeln('!', TrimmedLine);
+ Val(Copy(TrimmedLine, 1, spacePos - 1), turns, err);
+
+ spacePos := 1 + spacePos;
+ //writeln('? ',spacePos);
+ //i:=1;
+ TrimmedLine:=Copy(TrimmedLine, spacePos, Length(TrimmedLine));
+ spacePos := Pos(' ',TrimmedLine);
+ //writeln(spacePos);
+ //writeln('!!', TrimmedLine);
+ Val(Copy(TrimmedLine, 1, spacePos - 1), startZ, err);
+
+ TrimmedLine:=Copy(TrimmedLine, spacePos, Length(TrimmedLine));
+ //writeln('!!!', TrimmedLine);
+ spacePos := Pos(' ',TrimmedLine);
+ //writeln(spacePos);
+ Val(Copy(TrimmedLine, 1, Length(TrimmedLine)), endZ, err);
+ writeln('layer:',i,' turns:', turns,' startX:', startZ:0:3,' endX:', endZ:0:3);
+ Layers[i].Turns := turns;
+ Layers[i].StartZ := StartZ;
+ Layers[i].EndZ := EndZ;
+
+ //for i := 1 to CurrentCoilTurns do
+ //begin
+ // writeln(Layers[i].Turns,Layers[i].StartZ,Layers[i].EndZ);
+ //end;
+ //MaxLayers
+ //writeln();
+ end;
+ //if not ParseLine(Line) then
+ // writeln('Error: Invalid line: ', Line);
+ end;
+ MaxLayers:=i;
+ except
+ on E: Exception do
+ begin
+ writeln('Error opening or reading Coil Geometry File: ', E.Message);
+ Halt(1);
+ end;
+ end;
+ CloseFile(CoilGeometryFile);
+ end;
+
+begin
+ // Command line argument handling
+ StartTime := Now;
+ if ParamCount < 3 then
+ begin
+ Writeln('Usage: GCodeGenerator ');
+ Halt(1);
+ end;
+ InputFileName := ParamStr(1);
+ OutputFileName := ParamStr(2);
+ CoilGeometryFileName := ParamStr(3);
+
+ ReadInputFile();
+
+ // G-code generation
+ AssignFile(OutFile, OutputFileName);
+ try
+ Rewrite(OutFile);
+ // *** Your G-code generation logic here ***
+ writeln(OutFile, ';Generate G-code file for ',StatorParams.StatorName,' stator. At ',FormatDateTime('dd.mm.yyyy hh:nn:ss.zzz', StartTime));
+ writeln(OutFile, '; G-code for stator winding');
+ writeln(OutFile, 'G90 ; Absolute coordinate system');
+ writeln(OutFile, 'G1 Y-10');
+ writeln(OutFile, 'G28 X Y Z');
+ writeln(OutFile, 'G1 X0 Y0');
+ //writeln(OutFile, 'G28 O'); //Home all "untrusted" axes
+ writeln(OutFile);
+ // Move to center of ray along Y axis and reset coordinate
+ writeln(OutFile, 'G1 X', StatorParams.RayCenterOffset:0:2);
+ writeln(OutFile, 'G92 X0');
+
+ //������� ���� ����� � ���� ������� ����
+ CoilRadius:=(StatorParams.RayTopHeight/2+StatorParams.NeedleDiameter/2+StatorParams.PathClearance);
+ CoilWidth:=(StatorParams.RayTopWidth+StatorParams.NeedleDiameter+StatorParams.PathClearance*2);
+ CoilHeight:=(StatorParams.RayTopHeight+StatorParams.NeedleDiameter+StatorParams.PathClearance*2);
+ writeln(OutFile, ';CoilRadius = ', CoilRadius:0:3);
+ writeln(OutFile, ';CoilWidth = ', CoilWidth:0:3);
+ writeln(OutFile, ';CoilHeight = ', CoilHeight:0:3);
+ writeln(OutFile, 'G1 X', -1*CoilHeight/2:0:3, ' Y',-1*AngleBetweenRays/2:0:3);
+
+ //������������ � ��������� �������.
+ CurrentZ:=(StatorParams.BaseDiameter/2)+StatorParams.PathClearance;
+ writeln(OutFile, 'G1 Z', CurrentZ:0:2, ' F', StatorParams.WorkSpeed);
+ //����� �� ����� ��� ����, ����� ��������� ����� ���������
+ writeln(OutFile, 'M0');
+
+ if (OperationMode = 'auto') then CalculateCoilGeometry() else
+ if (OperationMode = 'manual') then ReadCoilGeometry() else
+ begin
+ writeln('Error determining operation mode.');
+ writeln('You should use auto or manual.');
+ Readln;
+ Halt(1);
+ end;
+
+ writeln();
+ writeln(OutFile, ';Information about layers');
+ writeln(OutFile, ';MaxLayers: ', MaxLayers);
+ for i := 1 to MaxLayers do
+ begin
+ writeln(OutFile, ';', i, ' ',Layers[i].Turns,' ',Layers[i].StartZ:0:5,' ',Layers[i].EndZ:0:5);
+ end;
+ Inc(LayerNumber);
+ //�������� ������ �������.
+ writeln(OutFile);
+ writeln(OutFile, ';Start winding');
+ //��������� �� ������ � ����
+ MoveForward:=true;
+ if (StatorParams.RayShape = 'circle') then
+ begin
+ for j := 0 to CurrentCoilTurns do
+ begin
+ for i := 0 to 360 do
+ begin
+ coords := CircleCoordinates(CoilRadius*2, i+180);
+// writeln(OutFile,'CoilRadius*2= ',CoilRadius*2:0:5,' X=', coords.X:0:3, ' Y=', coords.Y:0:5);
+ angle := CalculateAngle(coords.Y, CurrentZ);
+
+// writeln(OutFile, ';G1 X', coords.X:0:3, ' Y', angle:0:5,' Z', CurrentZ:0:5);
+ writeln(OutFile, 'G1 X', coords.X:0:3, ' Y', angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5);
+// writeln(OutFile);
+
+ CurrentZ:=CurrentZ+StatorParams.WireDiameter/360;
+ end;
+ writeln(OutFile, ';Next coil.');
+ end;
+ writeln(OutFile, ';Second coil');
+ Inc(LayerNumber);
+// RequiredSpacing:=StatorParams.RayWidth+StatorParams.NeedleDiameter+StatorParams.PathClearance*2+LayerNumber*StatorParams.WireDiameter*2;
+// writeln(OutFile, ';RequiredSpacing = ',RequiredSpacing:0:5);
+ RequiredSpacing:=StatorParams.RayTopWidth;
+ writeln(OutFile, ';RequiredSpacing = ',RequiredSpacing:0:5);
+ RequiredSpacing:=RequiredSpacing+StatorParams.NeedleDiameter;
+ writeln(OutFile, ';RequiredSpacing = ',RequiredSpacing:0:5);
+ RequiredSpacing:=RequiredSpacing+StatorParams.PathClearance*2+LayerNumber*StatorParams.WireDiameter*2;
+ writeln(OutFile, ';RequiredSpacing = ',RequiredSpacing:0:5);
+
+ CurrentZ:=RequiredSpacing/(2 * tan(AngleBetweenRays*PI/180/2));
+ writeln(OutFile, ';CurrentZ = ',CurrentZ:0:3);
+ end
+ else if (StatorParams.RayShape = 'rect') then
+ begin
+// writeln(OutFile, ';Rect? ');
+
+ for LayerNumber := 1 to MaxLayers do
+ begin
+ writeln(OutFile, ';Layer ', LayerNumber);
+ if (Layers[LayerNumber].StartZ > Layers[LayerNumber].EndZ) then CoilLength:=Layers[LayerNumber].StartZ-Layers[LayerNumber].EndZ
+ else CoilLength:=Layers[LayerNumber].EndZ-Layers[LayerNumber].StartZ;
+ writeln(OutFile, ';CoilLength ', CoilLength:0:5);
+ CurrentCoilTurns:=Layers[LayerNumber].Turns;
+ //writeln(OutFile, ';CurrentCoilTurns ', CurrentCoilTurns);
+ CoilTurnsSum := CoilTurnsSum+CurrentCoilTurns;
+ writeln(OutFile, ';CoilTurnsSum ', CoilTurnsSum);
+ CurrentZ:=Layers[LayerNumber].StartZ;
+ writeln(OutFile,'; NewZ=',CurrentZ:0:5);
+ //�������� ������.
+ writeln(OutFile, ';We make ',CurrentCoilTurns, ' turns on ', LayerNumber, ' layer.' );
+ writeln(OutFile);
+ for j := 1 to CurrentCoilTurns do
+ begin
+ writeln(OutFile,';Coil� = ',j);
+ writeln(OutFile,'M117 ',j);
+ //angle := CalculateAngle(CoilWidth/2, CurrentZ);
+ angle := AngleBetweenRays/2;
+
+ //Divide the path into 100 points
+ //Move from left-down to left-up
+ for k := 1 to 100 do
+ begin
+ angle := AngleBetweenRays/2;
+ angle := ((-1*angle)+2*(angle/100*k));
+ writeln(OutFile, 'G1 X', -1*CoilHeight/2:0:3, ' Y', angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5, ' ;CurrentZ= ',CurrentZ:0:5); // Top Left Corner
+ end;
+ if MoveForward then CurrentZ:=CurrentZ+StatorParams.WireDiameter/4 else CurrentZ:=CurrentZ-StatorParams.WireDiameter/4;
+
+ // angle := CalculateAngle(CoilWidth/2, CurrentZ);
+ angle := AngleBetweenRays/2;
+ writeln(OutFile, 'G1 X', CoilHeight/2:0:3, ' Y', angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5, ' ;CurrentZ= ',CurrentZ:0:5); // Top Right Corner
+ if MoveForward then CurrentZ:=CurrentZ+StatorParams.WireDiameter/4 else CurrentZ:=CurrentZ-StatorParams.WireDiameter/4;
+ //writeln(OutFile, 'M0');
+
+ //Divide the path into 100 points
+ //Move from left-down to rt-up
+ for k := 1 to 100 do
+ begin
+ angle := AngleBetweenRays/2;
+ angle := (angle-(2*(angle/100*k)));
+ writeln(OutFile, 'G1 X', CoilHeight/2:0:3, ' Y', angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5, ' ;CurrentZ= ',CurrentZ:0:5); // Bottom Right Corner
+ end;
+ if MoveForward then CurrentZ:=CurrentZ+StatorParams.WireDiameter/4 else CurrentZ:=CurrentZ-StatorParams.WireDiameter/4;
+ //writeln(OutFile, 'M0');
+
+ // angle := CalculateAngle(CoilWidth/2, CurrentZ);
+ angle := AngleBetweenRays/2;
+ writeln(OutFile, 'G1 X', -1*CoilHeight/2:0:3, ' Y', -angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5, ' ;CurrentZ= ',CurrentZ:0:5); // Bottom Left Corner
+ if MoveForward then CurrentZ:=CurrentZ+StatorParams.WireDiameter/4 else CurrentZ:=CurrentZ-StatorParams.WireDiameter/4;
+ //writeln(OutFile, 'M0');
+ end;
+
+ writeln(OutFile, 'M0');
+// writeln(OutFile, 'G91');
+// writeln(OutFile, 'G1 Y50');
+// writeln(OutFile, 'G90');
+ CoilWidth:=CoilWidth+StatorParams.WireDiameter*2;
+ MoveForward:= not MoveForward;
+ writeln(OutFile,';MoveForward: ', MoveForward);
+ end;
+ end;
+
+ except
+ on E: Exception do
+ begin
+ writeln('Error writing to output file: ', E.Message);
+ Halt(1);
+ end;
+ end;
+ CloseFile(OutFile);
+ EndTime := Now;
+ ExecutionTime := EndTime - StartTime;
+ writeln('G-code generated to: ', OutputFileName, ' in ', FormatFloat('0.000', ExecutionTime * 86400), ' seconds.');
+ writeln('Press Enter... ');
+ Readln;
+end.
diff --git a/gcodegenerator/input.txt b/gcodegenerator/input.txt
new file mode 100644
index 0000000..0ccab67
--- /dev/null
+++ b/gcodegenerator/input.txt
@@ -0,0 +1,36 @@
+# диаметр основания статора
+base_dia=37,8
+# количество лучей статора
+num_rays=1
+
+# форма луча статора (circle, rect, superellipse)
+ray_shape=rect
+# диаметр луча статора
+# ray_dia=5,0
+# ширина луча статора
+ray_w=2,4
+# высота луча статора
+ray_h=5
+# длина луча статора
+ray_len=9,0
+
+# форма вершины луча
+raytop_shape=circle
+# диаметр вершины луча
+raytop_dia=8,9
+# ширина вершины луча
+raytop_w=5,6
+# высота вершины луча
+raytop_h=14,0
+
+# смещение центра луча
+ray_offset=14,7
+# диаметр провода
+wire_diameter=0,25
+# диаметр иглы
+needle_diameter=1,25
+# зазор пути
+path_clearance=0,2
+
+# скорость намотки
+work_speed=2000
\ No newline at end of file
diff --git a/gcodegenerator/trident_input.txt b/gcodegenerator/trident_input.txt
new file mode 100644
index 0000000..9f6e3b3
--- /dev/null
+++ b/gcodegenerator/trident_input.txt
@@ -0,0 +1,44 @@
+# Имя статора
+stator_name=Plastic_72mm
+# Режим работы (auto, manual)
+Operation_Mode=manual
+# диаметр основания статора
+base_dia=37,8
+# количество лучей статора
+num_rays=24
+
+# форма луча статора (circle, rect, superellipse)
+ray_shape=rect
+# диаметр луча статора
+# ray_dia=5,0
+# ширина луча статора
+ray_w=2,4
+# высота луча статора
+ray_h=5
+# длина луча статора
+ray_len=9,0
+
+# форма вершины луча
+raytop_shape=rect
+
+# диаметр вершины луча
+# raytop_dia=8,9
+
+# ширина вершины луча
+raytop_w=5,6
+# высота вершины луча
+raytop_h=11,0
+
+# смещение центра луча
+ray_offset=14,7
+# диаметр провода
+wire_diameter=0,23
+# диаметр иглы
+needle_diameter=1,25
+
+# зазор пути
+path_clearance=0,2
+
+# скорость намотки
+work_speed=500
+# work_speed=20000
\ No newline at end of file
diff --git a/gcodegenerator/trident_run.bat b/gcodegenerator/trident_run.bat
new file mode 100644
index 0000000..90234d3
--- /dev/null
+++ b/gcodegenerator/trident_run.bat
@@ -0,0 +1 @@
+gcodegenerator_v4.exe trident_input.txt trident_output.gcode trident_coil.txt
\ No newline at end of file
diff --git a/src/3d_printed_parts/-stator_holder_new_printable.step1.SLDPRT b/src/3d_printed_parts/-stator_holder_new_printable.step1.SLDPRT
index a7988c9..774c99c 100644
Binary files a/src/3d_printed_parts/-stator_holder_new_printable.step1.SLDPRT and b/src/3d_printed_parts/-stator_holder_new_printable.step1.SLDPRT differ
diff --git a/src/3d_printed_parts/Display_case.STL b/src/3d_printed_parts/Display_case.STL
deleted file mode 100644
index b2f6ee3..0000000
Binary files a/src/3d_printed_parts/Display_case.STL and /dev/null differ
diff --git a/src/3d_printed_parts/Display_case_for_discount_display.SLDPRT b/src/3d_printed_parts/Display_case_for_discount_display.SLDPRT
new file mode 100644
index 0000000..3575197
Binary files /dev/null and b/src/3d_printed_parts/Display_case_for_discount_display.SLDPRT differ
diff --git a/src/3d_printed_parts/Display_stand.SLDPRT b/src/3d_printed_parts/Display_stand.SLDPRT
index 00aa7f7..ed41535 100644
Binary files a/src/3d_printed_parts/Display_stand.SLDPRT and b/src/3d_printed_parts/Display_stand.SLDPRT differ
diff --git a/src/3d_printed_parts/Display_stand.STL b/src/3d_printed_parts/Display_stand.STL
deleted file mode 100644
index 95deea6..0000000
Binary files a/src/3d_printed_parts/Display_stand.STL and /dev/null differ
diff --git a/src/3d_printed_parts/Electronics_cover.3mf b/src/3d_printed_parts/Electronics_cover.3mf
new file mode 100644
index 0000000..39e9003
Binary files /dev/null and b/src/3d_printed_parts/Electronics_cover.3mf differ
diff --git a/src/3d_printed_parts/Electronics_cover.SLDPRT b/src/3d_printed_parts/Electronics_cover.SLDPRT
index d2519d0..e376f59 100644
Binary files a/src/3d_printed_parts/Electronics_cover.SLDPRT and b/src/3d_printed_parts/Electronics_cover.SLDPRT differ
diff --git a/src/3d_printed_parts/Electronics_cover.STL b/src/3d_printed_parts/Electronics_cover.STL
deleted file mode 100644
index 3d19270..0000000
Binary files a/src/3d_printed_parts/Electronics_cover.STL and /dev/null differ
diff --git a/src/3d_printed_parts/Homing_template.SLDPRT b/src/3d_printed_parts/Homing_template.SLDPRT
new file mode 100644
index 0000000..00099dd
Binary files /dev/null and b/src/3d_printed_parts/Homing_template.SLDPRT differ
diff --git a/src/3d_printed_parts/Nut_spacer.SLDPRT b/src/3d_printed_parts/Nut_spacer.SLDPRT
new file mode 100644
index 0000000..5026aa1
Binary files /dev/null and b/src/3d_printed_parts/Nut_spacer.SLDPRT differ
diff --git a/src/3d_printed_parts/PCB_spacer.STL b/src/3d_printed_parts/PCB_spacer.STL
deleted file mode 100644
index df9e3ac..0000000
Binary files a/src/3d_printed_parts/PCB_spacer.STL and /dev/null differ
diff --git a/src/3d_printed_parts/Smart_controller_face_002.SLDPRT b/src/3d_printed_parts/Smart_controller_face_002.SLDPRT
new file mode 100644
index 0000000..d0c1dc5
Binary files /dev/null and b/src/3d_printed_parts/Smart_controller_face_002.SLDPRT differ
diff --git a/src/3d_printed_parts/Test_piptik.SLDPRT b/src/3d_printed_parts/Test_piptik.SLDPRT
new file mode 100644
index 0000000..92f8147
Binary files /dev/null and b/src/3d_printed_parts/Test_piptik.SLDPRT differ
diff --git a/src/3d_printed_parts/Test_piptik.STL b/src/3d_printed_parts/Test_piptik.STL
new file mode 100644
index 0000000..491b0be
Binary files /dev/null and b/src/3d_printed_parts/Test_piptik.STL differ
diff --git a/src/3d_printed_parts/a5275.SLDPRT b/src/3d_printed_parts/a5275.SLDPRT
index ca8371f..66cb609 100644
Binary files a/src/3d_printed_parts/a5275.SLDPRT and b/src/3d_printed_parts/a5275.SLDPRT differ
diff --git a/src/3d_printed_parts/a5275.STL b/src/3d_printed_parts/a5275.STL
deleted file mode 100644
index c2470c6..0000000
Binary files a/src/3d_printed_parts/a5275.STL and /dev/null differ
diff --git a/src/3d_printed_parts/bearing_holder_large.SLDPRT b/src/3d_printed_parts/bearing_holder_large.SLDPRT
index 5c0779c..7403390 100644
Binary files a/src/3d_printed_parts/bearing_holder_large.SLDPRT and b/src/3d_printed_parts/bearing_holder_large.SLDPRT differ
diff --git a/src/3d_printed_parts/bearing_holder_large.STL b/src/3d_printed_parts/bearing_holder_large.STL
deleted file mode 100644
index f8f5be8..0000000
Binary files a/src/3d_printed_parts/bearing_holder_large.STL and /dev/null differ
diff --git a/src/3d_printed_parts/bearing_holder_small_my.STL b/src/3d_printed_parts/bearing_holder_small_my.STL
deleted file mode 100644
index 7b7e350..0000000
Binary files a/src/3d_printed_parts/bearing_holder_small_my.STL and /dev/null differ
diff --git a/src/3d_printed_parts/brake.STL b/src/3d_printed_parts/brake.STL
deleted file mode 100644
index 22e23f0..0000000
Binary files a/src/3d_printed_parts/brake.STL and /dev/null differ
diff --git a/src/3d_printed_parts/brake_equipment.SLDPRT b/src/3d_printed_parts/brake_equipment.SLDPRT
new file mode 100644
index 0000000..22002ba
Binary files /dev/null and b/src/3d_printed_parts/brake_equipment.SLDPRT differ
diff --git a/src/3d_printed_parts/brake_handle.SLDPRT b/src/3d_printed_parts/brake_handle.SLDPRT
new file mode 100644
index 0000000..a842d46
Binary files /dev/null and b/src/3d_printed_parts/brake_handle.SLDPRT differ
diff --git a/src/3d_printed_parts/carrying_handle.STL b/src/3d_printed_parts/carrying_handle.STL
deleted file mode 100644
index ea1e5ab..0000000
Binary files a/src/3d_printed_parts/carrying_handle.STL and /dev/null differ
diff --git a/src/3d_printed_parts/crews_axis.SLDPRT b/src/3d_printed_parts/crews_axis.SLDPRT
index 69eaf8d..b6420d7 100644
Binary files a/src/3d_printed_parts/crews_axis.SLDPRT and b/src/3d_printed_parts/crews_axis.SLDPRT differ
diff --git a/src/3d_printed_parts/holder_for_injector_needle.SLDPRT b/src/3d_printed_parts/holder_for_injector_needle.SLDPRT
new file mode 100644
index 0000000..ded7c4f
Binary files /dev/null and b/src/3d_printed_parts/holder_for_injector_needle.SLDPRT differ
diff --git a/src/3d_printed_parts/holder_for_injector_needle.STL b/src/3d_printed_parts/holder_for_injector_needle.STL
new file mode 100644
index 0000000..2773b45
Binary files /dev/null and b/src/3d_printed_parts/holder_for_injector_needle.STL differ
diff --git a/src/3d_printed_parts/main_carriage.SLDPRT b/src/3d_printed_parts/main_carriage.SLDPRT
index 7912ee5..c3a5e99 100644
Binary files a/src/3d_printed_parts/main_carriage.SLDPRT and b/src/3d_printed_parts/main_carriage.SLDPRT differ
diff --git a/src/3d_printed_parts/main_carriage.STL b/src/3d_printed_parts/main_carriage.STL
index ee2191e..4af3a9d 100644
Binary files a/src/3d_printed_parts/main_carriage.STL and b/src/3d_printed_parts/main_carriage.STL differ
diff --git a/src/3d_printed_parts/main_platform_tmp2.SLDPRT b/src/3d_printed_parts/main_platform_tmp2.SLDPRT
index cc3b48a..7b84cdf 100644
Binary files a/src/3d_printed_parts/main_platform_tmp2.SLDPRT and b/src/3d_printed_parts/main_platform_tmp2.SLDPRT differ
diff --git a/src/3d_printed_parts/main_platform_tmp2.STL b/src/3d_printed_parts/main_platform_tmp2.STL
deleted file mode 100644
index 8470027..0000000
Binary files a/src/3d_printed_parts/main_platform_tmp2.STL and /dev/null differ
diff --git a/src/3d_printed_parts/main_platform_tmp3.SLDPRT b/src/3d_printed_parts/main_platform_tmp3.SLDPRT
new file mode 100644
index 0000000..4528b8c
Binary files /dev/null and b/src/3d_printed_parts/main_platform_tmp3.SLDPRT differ
diff --git a/src/3d_printed_parts/needle_holder.SLDPRT b/src/3d_printed_parts/needle_holder.SLDPRT
index 11bf323..09e7ae8 100644
Binary files a/src/3d_printed_parts/needle_holder.SLDPRT and b/src/3d_printed_parts/needle_holder.SLDPRT differ
diff --git a/src/3d_printed_parts/needle_holder.STL b/src/3d_printed_parts/needle_holder.STL
deleted file mode 100644
index 610043a..0000000
Binary files a/src/3d_printed_parts/needle_holder.STL and /dev/null differ
diff --git a/src/3d_printed_parts/needle_holder_for_075mm_tube.SLDPRT b/src/3d_printed_parts/needle_holder_for_075mm_tube.SLDPRT
new file mode 100644
index 0000000..04f5d3d
Binary files /dev/null and b/src/3d_printed_parts/needle_holder_for_075mm_tube.SLDPRT differ
diff --git a/src/3d_printed_parts/needle_holder_for_075mm_tube_tmp.SLDPRT b/src/3d_printed_parts/needle_holder_for_075mm_tube_tmp.SLDPRT
new file mode 100644
index 0000000..909875a
Binary files /dev/null and b/src/3d_printed_parts/needle_holder_for_075mm_tube_tmp.SLDPRT differ
diff --git a/src/3d_printed_parts/needle_holder_for_075mm_tube_tmp.STL b/src/3d_printed_parts/needle_holder_for_075mm_tube_tmp.STL
new file mode 100644
index 0000000..891afb0
Binary files /dev/null and b/src/3d_printed_parts/needle_holder_for_075mm_tube_tmp.STL differ
diff --git a/src/3d_printed_parts/needle_holder_spacer.SLDPRT b/src/3d_printed_parts/needle_holder_spacer.SLDPRT
new file mode 100644
index 0000000..01a139a
Binary files /dev/null and b/src/3d_printed_parts/needle_holder_spacer.SLDPRT differ
diff --git a/src/3d_printed_parts/needle_holder_spacer.STL b/src/3d_printed_parts/needle_holder_spacer.STL
new file mode 100644
index 0000000..a7b6ec3
Binary files /dev/null and b/src/3d_printed_parts/needle_holder_spacer.STL differ
diff --git a/src/3d_printed_parts/needle_holder_tmp.SLDPRT b/src/3d_printed_parts/needle_holder_tmp.SLDPRT
new file mode 100644
index 0000000..207c6ff
Binary files /dev/null and b/src/3d_printed_parts/needle_holder_tmp.SLDPRT differ
diff --git a/src/3d_printed_parts/needle_holder_top.SLDPRT b/src/3d_printed_parts/needle_holder_top.SLDPRT
index 5757729..5dae5db 100644
Binary files a/src/3d_printed_parts/needle_holder_top.SLDPRT and b/src/3d_printed_parts/needle_holder_top.SLDPRT differ
diff --git a/src/3d_printed_parts/needle_holder_top.STL b/src/3d_printed_parts/needle_holder_top.STL
index fa8ea4a..b1b5d2f 100644
Binary files a/src/3d_printed_parts/needle_holder_top.STL and b/src/3d_printed_parts/needle_holder_top.STL differ
diff --git a/src/3d_printed_parts/nut_holder.SLDPRT b/src/3d_printed_parts/nut_holder.SLDPRT
new file mode 100644
index 0000000..1156057
Binary files /dev/null and b/src/3d_printed_parts/nut_holder.SLDPRT differ
diff --git a/src/3d_printed_parts/opto_endstop_holder.SLDPRT b/src/3d_printed_parts/opto_endstop_holder.SLDPRT
new file mode 100644
index 0000000..850a141
Binary files /dev/null and b/src/3d_printed_parts/opto_endstop_holder.SLDPRT differ
diff --git a/src/3d_printed_parts/organizer_my.SLDPRT b/src/3d_printed_parts/organizer_my.SLDPRT
index d6e54ab..de4be81 100644
Binary files a/src/3d_printed_parts/organizer_my.SLDPRT and b/src/3d_printed_parts/organizer_my.SLDPRT differ
diff --git a/src/3d_printed_parts/organizer_my.STL b/src/3d_printed_parts/organizer_my.STL
deleted file mode 100644
index e4d6e07..0000000
Binary files a/src/3d_printed_parts/organizer_my.STL and /dev/null differ
diff --git a/src/3d_printed_parts/organizer_my_2.SLDPRT b/src/3d_printed_parts/organizer_my_2.SLDPRT
new file mode 100644
index 0000000..19eb3e7
Binary files /dev/null and b/src/3d_printed_parts/organizer_my_2.SLDPRT differ
diff --git a/src/3d_printed_parts/organizer_my_2.STL b/src/3d_printed_parts/organizer_my_2.STL
new file mode 100644
index 0000000..817c410
Binary files /dev/null and b/src/3d_printed_parts/organizer_my_2.STL differ
diff --git a/src/3d_printed_parts/organizer_tmp.STL b/src/3d_printed_parts/organizer_tmp.STL
deleted file mode 100644
index b1a7208..0000000
Binary files a/src/3d_printed_parts/organizer_tmp.STL and /dev/null differ
diff --git a/src/3d_printed_parts/pully1_my.SLDPRT b/src/3d_printed_parts/pully1_my.SLDPRT
index b4eecb7..6fc5faf 100644
Binary files a/src/3d_printed_parts/pully1_my.SLDPRT and b/src/3d_printed_parts/pully1_my.SLDPRT differ
diff --git a/src/3d_printed_parts/pully1_my.STL b/src/3d_printed_parts/pully1_my.STL
deleted file mode 100644
index 1fedc08..0000000
Binary files a/src/3d_printed_parts/pully1_my.STL and /dev/null differ
diff --git a/src/3d_printed_parts/rotary axis nut.SLDPRT b/src/3d_printed_parts/rotary axis nut.SLDPRT
new file mode 100644
index 0000000..8fb41b8
Binary files /dev/null and b/src/3d_printed_parts/rotary axis nut.SLDPRT differ
diff --git a/src/3d_printed_parts/rotary axis.SLDPRT b/src/3d_printed_parts/rotary axis.SLDPRT
new file mode 100644
index 0000000..5390329
Binary files /dev/null and b/src/3d_printed_parts/rotary axis.SLDPRT differ
diff --git a/src/3d_printed_parts/sensorPin240705.STL b/src/3d_printed_parts/sensorPin240705.STL
deleted file mode 100644
index 784df9e..0000000
Binary files a/src/3d_printed_parts/sensorPin240705.STL and /dev/null differ
diff --git a/src/3d_printed_parts/sensor_key2_240705.SLDPRT b/src/3d_printed_parts/sensor_key2_240705.SLDPRT
index 2d9b7fa..20a7f74 100644
Binary files a/src/3d_printed_parts/sensor_key2_240705.SLDPRT and b/src/3d_printed_parts/sensor_key2_240705.SLDPRT differ
diff --git a/src/3d_printed_parts/sensor_key2_240705.STL b/src/3d_printed_parts/sensor_key2_240705.STL
deleted file mode 100644
index 2498298..0000000
Binary files a/src/3d_printed_parts/sensor_key2_240705.STL and /dev/null differ
diff --git a/src/3d_printed_parts/smooth shaft_holder_tmp.STL b/src/3d_printed_parts/smooth shaft_holder_tmp.STL
deleted file mode 100644
index ca65625..0000000
Binary files a/src/3d_printed_parts/smooth shaft_holder_tmp.STL and /dev/null differ
diff --git a/src/3d_printed_parts/spacer.SLDPRT b/src/3d_printed_parts/spacer.SLDPRT
new file mode 100644
index 0000000..9ad0d69
Binary files /dev/null and b/src/3d_printed_parts/spacer.SLDPRT differ
diff --git a/src/3d_printed_parts/spring_cap.SLDPRT b/src/3d_printed_parts/spring_cap.SLDPRT
new file mode 100644
index 0000000..8c564c9
Binary files /dev/null and b/src/3d_printed_parts/spring_cap.SLDPRT differ
diff --git a/src/3d_printed_parts/tension_knob.SLDPRT b/src/3d_printed_parts/tension_knob.SLDPRT
new file mode 100644
index 0000000..97032e1
Binary files /dev/null and b/src/3d_printed_parts/tension_knob.SLDPRT differ
diff --git a/src/3d_printed_parts/tension_roller.SLDPRT b/src/3d_printed_parts/tension_roller.SLDPRT
new file mode 100644
index 0000000..192025b
Binary files /dev/null and b/src/3d_printed_parts/tension_roller.SLDPRT differ
diff --git a/src/3d_printed_parts/tension_roller_cheek.SLDPRT b/src/3d_printed_parts/tension_roller_cheek.SLDPRT
new file mode 100644
index 0000000..17d1cd3
Binary files /dev/null and b/src/3d_printed_parts/tension_roller_cheek.SLDPRT differ
diff --git a/src/3d_printed_parts/tension_system_base.SLDPRT b/src/3d_printed_parts/tension_system_base.SLDPRT
new file mode 100644
index 0000000..e81a188
Binary files /dev/null and b/src/3d_printed_parts/tension_system_base.SLDPRT differ
diff --git a/src/3d_printed_parts/weldroller_holder.SLDPRT b/src/3d_printed_parts/weldroller_holder.SLDPRT
index 25d07b1..9f493a0 100644
Binary files a/src/3d_printed_parts/weldroller_holder.SLDPRT and b/src/3d_printed_parts/weldroller_holder.SLDPRT differ
diff --git a/src/3d_printed_parts/weldroller_holder.STL b/src/3d_printed_parts/weldroller_holder.STL
deleted file mode 100644
index 418a04a..0000000
Binary files a/src/3d_printed_parts/weldroller_holder.STL and /dev/null differ
diff --git a/src/3d_printed_parts/x_axis_cariage.SLDPRT b/src/3d_printed_parts/x_axis_cariage.SLDPRT
new file mode 100644
index 0000000..967db9b
Binary files /dev/null and b/src/3d_printed_parts/x_axis_cariage.SLDPRT differ
diff --git a/src/3d_printed_parts/x_axis_cariage.STL b/src/3d_printed_parts/x_axis_cariage.STL
new file mode 100644
index 0000000..a48791f
Binary files /dev/null and b/src/3d_printed_parts/x_axis_cariage.STL differ
diff --git a/src/3d_printed_parts/Еще одна деталь для резинки.SLDPRT b/src/3d_printed_parts/Еще одна деталь для резинки.SLDPRT
new file mode 100644
index 0000000..44263bb
Binary files /dev/null and b/src/3d_printed_parts/Еще одна деталь для резинки.SLDPRT differ
diff --git a/src/3d_printed_parts/Еще одна деталь для резинки.STL b/src/3d_printed_parts/Еще одна деталь для резинки.STL
new file mode 100644
index 0000000..b30279e
Binary files /dev/null and b/src/3d_printed_parts/Еще одна деталь для резинки.STL differ
diff --git a/src/3d_printed_parts/Катушка_для_резинок.SLDPRT b/src/3d_printed_parts/Катушка_для_резинок.SLDPRT
new file mode 100644
index 0000000..a5cd0e3
Binary files /dev/null and b/src/3d_printed_parts/Катушка_для_резинок.SLDPRT differ
diff --git a/src/3d_printed_parts/Катушка_для_резинок.STL b/src/3d_printed_parts/Катушка_для_резинок.STL
new file mode 100644
index 0000000..611ac00
Binary files /dev/null and b/src/3d_printed_parts/Катушка_для_резинок.STL differ
diff --git a/src/3d_printed_parts/Крепеж кнопки останова.SLDPRT b/src/3d_printed_parts/Крепеж кнопки останова.SLDPRT
new file mode 100644
index 0000000..aa7964a
Binary files /dev/null and b/src/3d_printed_parts/Крепеж кнопки останова.SLDPRT differ
diff --git a/src/3d_printed_parts/Рычаг.SLDPRT b/src/3d_printed_parts/Рычаг.SLDPRT
new file mode 100644
index 0000000..787171f
Binary files /dev/null and b/src/3d_printed_parts/Рычаг.SLDPRT differ
diff --git a/src/3d_printed_parts/Рычаг.STL b/src/3d_printed_parts/Рычаг.STL
new file mode 100644
index 0000000..dd14cfc
Binary files /dev/null and b/src/3d_printed_parts/Рычаг.STL differ
diff --git a/src/3d_printed_parts/Часть для резинки.SLDPRT b/src/3d_printed_parts/Часть для резинки.SLDPRT
new file mode 100644
index 0000000..c554914
Binary files /dev/null and b/src/3d_printed_parts/Часть для резинки.SLDPRT differ
diff --git a/src/3d_printed_parts/Часть для резинки.STL b/src/3d_printed_parts/Часть для резинки.STL
new file mode 100644
index 0000000..4c471fa
Binary files /dev/null and b/src/3d_printed_parts/Часть для резинки.STL differ
diff --git a/src/Calc.SLDPRT b/src/Calc.SLDPRT
new file mode 100644
index 0000000..40bed2f
Binary files /dev/null and b/src/Calc.SLDPRT differ
diff --git a/src/Electronic_and_linear_parts/Emergency button 16mm.SLDPRT b/src/Electronic_and_linear_parts/Emergency button 16mm.SLDPRT
new file mode 100644
index 0000000..7f26831
Binary files /dev/null and b/src/Electronic_and_linear_parts/Emergency button 16mm.SLDPRT differ
diff --git a/src/Electronic_and_linear_parts/Opto_endstop_PCB.SLDPRT b/src/Electronic_and_linear_parts/Opto_endstop_PCB.SLDPRT
new file mode 100644
index 0000000..f528da8
Binary files /dev/null and b/src/Electronic_and_linear_parts/Opto_endstop_PCB.SLDPRT differ
diff --git a/src/Electronic_and_linear_parts/Opto_endstop_assemble.SLDASM b/src/Electronic_and_linear_parts/Opto_endstop_assemble.SLDASM
new file mode 100644
index 0000000..09a9078
Binary files /dev/null and b/src/Electronic_and_linear_parts/Opto_endstop_assemble.SLDASM differ
diff --git a/src/Electronic_and_linear_parts/Opto_endstop_main.SLDPRT b/src/Electronic_and_linear_parts/Opto_endstop_main.SLDPRT
new file mode 100644
index 0000000..c62d0b6
Binary files /dev/null and b/src/Electronic_and_linear_parts/Opto_endstop_main.SLDPRT differ
diff --git a/src/Electronic_and_linear_parts/ReprapDiscountFullGraphicSmartController-Robotale_Dummy.sldprt b/src/Electronic_and_linear_parts/ReprapDiscountFullGraphicSmartController-Robotale_Dummy.sldprt
new file mode 100644
index 0000000..327ee60
Binary files /dev/null and b/src/Electronic_and_linear_parts/ReprapDiscountFullGraphicSmartController-Robotale_Dummy.sldprt differ
diff --git a/src/Electronic_and_linear_parts/mgn9c rail.SLDPRT b/src/Electronic_and_linear_parts/mgn9c rail.SLDPRT
index e576340..e4dd963 100644
Binary files a/src/Electronic_and_linear_parts/mgn9c rail.SLDPRT and b/src/Electronic_and_linear_parts/mgn9c rail.SLDPRT differ
diff --git a/src/Electronic_and_linear_parts/rail_spacer.SLDPRT b/src/Electronic_and_linear_parts/rail_spacer.SLDPRT
new file mode 100644
index 0000000..4ab46cb
Binary files /dev/null and b/src/Electronic_and_linear_parts/rail_spacer.SLDPRT differ
diff --git a/src/Electronic_and_linear_parts/rail_spacer.STL b/src/Electronic_and_linear_parts/rail_spacer.STL
new file mode 100644
index 0000000..1876b89
Binary files /dev/null and b/src/Electronic_and_linear_parts/rail_spacer.STL differ
diff --git a/src/Other/Nut DIN 6923 (EN 1661).SLDPRT b/src/Other/Nut DIN 6923 (EN 1661).SLDPRT
new file mode 100644
index 0000000..5a64e1b
Binary files /dev/null and b/src/Other/Nut DIN 6923 (EN 1661).SLDPRT differ
diff --git a/src/Other/needle.SLDPRT b/src/Other/needle.SLDPRT
index 05d2517..45c3a72 100644
Binary files a/src/Other/needle.SLDPRT and b/src/Other/needle.SLDPRT differ
diff --git a/src/Other/pump needle.SLDPRT b/src/Other/pump needle.SLDPRT
new file mode 100644
index 0000000..b4cc190
Binary files /dev/null and b/src/Other/pump needle.SLDPRT differ
diff --git a/src/Other/threaded_stud_M3_150mm.SLDPRT b/src/Other/threaded_stud_M3_150mm.SLDPRT
new file mode 100644
index 0000000..b1163ba
Binary files /dev/null and b/src/Other/threaded_stud_M3_150mm.SLDPRT differ
diff --git a/src/Other/threaded_stud_M8х140mm.SLDPRT b/src/Other/threaded_stud_M8х140mm.SLDPRT
new file mode 100644
index 0000000..4a7526f
Binary files /dev/null and b/src/Other/threaded_stud_M8х140mm.SLDPRT differ
diff --git a/src/Other/wire_spool_2.SLDPRT b/src/Other/wire_spool_2.SLDPRT
new file mode 100644
index 0000000..cc9655c
Binary files /dev/null and b/src/Other/wire_spool_2.SLDPRT differ
diff --git a/src/Secondary_asms/Display_asm_main_001.SLDASM b/src/Secondary_asms/Display_asm_main_001.SLDASM
index dfec3cc..3d8caeb 100644
Binary files a/src/Secondary_asms/Display_asm_main_001.SLDASM and b/src/Secondary_asms/Display_asm_main_001.SLDASM differ
diff --git a/src/Secondary_asms/_asm_chelnok.SLDASM b/src/Secondary_asms/_asm_chelnok.SLDASM
index 6c519aa..7b4a209 100644
Binary files a/src/Secondary_asms/_asm_chelnok.SLDASM and b/src/Secondary_asms/_asm_chelnok.SLDASM differ
diff --git a/src/Secondary_asms/_asm_support.SLDASM b/src/Secondary_asms/_asm_support.SLDASM
index ed3a70f..012e435 100644
Binary files a/src/Secondary_asms/_asm_support.SLDASM and b/src/Secondary_asms/_asm_support.SLDASM differ
diff --git a/src/Secondary_asms/asm_holder.SLDASM b/src/Secondary_asms/asm_holder.SLDASM
index fce16a4..33e03e3 100644
Binary files a/src/Secondary_asms/asm_holder.SLDASM and b/src/Secondary_asms/asm_holder.SLDASM differ
diff --git a/src/Secondary_asms/asm_small_stator.SLDASM b/src/Secondary_asms/asm_small_stator.SLDASM
index 67d9fec..bc1313a 100644
Binary files a/src/Secondary_asms/asm_small_stator.SLDASM and b/src/Secondary_asms/asm_small_stator.SLDASM differ
diff --git a/src/Secondary_asms/tension_mechanism_asm.SLDASM b/src/Secondary_asms/tension_mechanism_asm.SLDASM
new file mode 100644
index 0000000..693055a
Binary files /dev/null and b/src/Secondary_asms/tension_mechanism_asm.SLDASM differ
diff --git a/src/Secondary_asms/Статор и подшипник.SLDASM b/src/Secondary_asms/Статор и подшипник.SLDASM
index d0b390b..b70aa80 100644
Binary files a/src/Secondary_asms/Статор и подшипник.SLDASM and b/src/Secondary_asms/Статор и подшипник.SLDASM differ
diff --git a/src/Test_003.SLDPRT b/src/Test_003.SLDPRT
new file mode 100644
index 0000000..956c5d3
Binary files /dev/null and b/src/Test_003.SLDPRT differ
diff --git a/src/Tmp/Rotor_for_calculations.SLDPRT b/src/Tmp/Rotor_for_calculations.SLDPRT
new file mode 100644
index 0000000..4b301be
Binary files /dev/null and b/src/Tmp/Rotor_for_calculations.SLDPRT differ
diff --git a/src/Tmp/Wire_path.SLDPRT b/src/Tmp/Wire_path.SLDPRT
index f879355..2225668 100644
Binary files a/src/Tmp/Wire_path.SLDPRT and b/src/Tmp/Wire_path.SLDPRT differ
diff --git a/src/Tmp/Wire_path_2.SLDPRT b/src/Tmp/Wire_path_2.SLDPRT
new file mode 100644
index 0000000..3acfa27
Binary files /dev/null and b/src/Tmp/Wire_path_2.SLDPRT differ
diff --git a/src/_main_asm.SLDASM b/src/_main_asm.SLDASM
index 048f67a..3c066ab 100644
Binary files a/src/_main_asm.SLDASM and b/src/_main_asm.SLDASM differ
diff --git a/src/_main_asm_with_new_tension_mechanism.SLDASM b/src/_main_asm_with_new_tension_mechanism.SLDASM
new file mode 100644
index 0000000..6bf2bea
Binary files /dev/null and b/src/_main_asm_with_new_tension_mechanism.SLDASM differ
diff --git a/src/coils_calculator.SLDPRT b/src/coils_calculator.SLDPRT
new file mode 100644
index 0000000..efb1736
Binary files /dev/null and b/src/coils_calculator.SLDPRT differ