Compare commits
208 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7406e233a | |||
| 8a12d0155c | |||
| 68a7a3f88f | |||
| 6ecf52f196 | |||
| eec9c800c9 | |||
| 41a469208a | |||
| a59766195c | |||
| 2b4a89eafe | |||
| 26f5c32872 | |||
| 21d2d22a6f | |||
| 4407ff31ec | |||
| 1f322b565f | |||
| 1d4f928342 | |||
| ff201e6552 | |||
| 460e243693 | |||
| 740f652b6a | |||
| 54c9358964 | |||
| e197695f4c | |||
| eb0c4682d5 | |||
| 0da862fd1e | |||
| 0a8672ae6c | |||
| 31413a7d77 | |||
| 639b1f64c6 | |||
| 7d9bd3a97c | |||
| f26b8bf8ef | |||
| c1ff38c7a0 | |||
| 15b6159f6a | |||
| 04d0d9431b | |||
| a5e1d4c50a | |||
| e88fabafc8 | |||
| c6b5bf7c00 | |||
| 167672dcd7 | |||
| a93146b71d | |||
| d99185be24 | |||
| c5126de559 | |||
| c16ae2451d | |||
| e340a61e52 | |||
| af59056c09 | |||
| 4b0b6e22a7 | |||
| 2bb9e0d58e | |||
| 52eefa90e1 | |||
| 12da2e9288 | |||
| 22c5bd7eae | |||
| 62057d3204 | |||
| 00075990d0 | |||
| 6a880280e4 | |||
| b523ddf1b2 | |||
| c814fe98d7 | |||
| a65e4edb1c | |||
| 310ff23676 | |||
| 7894cd9d6a | |||
| 0b787e8ed3 | |||
| 79789571bc | |||
| e092a02d77 | |||
| 66d94aad21 | |||
| 86fe4fde40 | |||
| 956f7d32fb | |||
| be0f1088f0 | |||
| 66e32cb0fa | |||
| a62dc7c70c | |||
| 0e4348c718 | |||
| 1397cf0eaa | |||
| eb352b11b9 | |||
| 6c2249451e | |||
| a7ade2d63e | |||
| c1b53d63fc | |||
| e438c77c6a | |||
| 8ccc601218 | |||
| b934a4c612 | |||
| cb31a99319 | |||
| ecc138fc9e | |||
| 1e749e4f48 | |||
| 38f4d8abfc | |||
| e039d51d18 | |||
| d1e9f53cb8 | |||
| 64ebb78892 | |||
| f1ab24d0ae | |||
| 84b9de9a19 | |||
| 30eb2aa869 | |||
| 672d0d4448 | |||
| 04fe50936e | |||
| 11c701af9b | |||
| ba95e85e53 | |||
| 918a9cf3d1 | |||
| 8e24b34160 | |||
| 9d32bc3153 | |||
| 3bf768f925 | |||
| 726a38712e | |||
| 4a17589496 | |||
| 198ef1e474 | |||
| 9e43ec9dcd | |||
| 1a9e8c047b | |||
| e43f4207a0 | |||
| 5f4ec82544 | |||
| 2a88cc0fcd | |||
| 505ab1bb62 | |||
| 659b4172aa | |||
| a5b57a09fd | |||
| 6e90272783 | |||
| 9d6b4a2e97 | |||
| 3cea0a00b1 | |||
| 81a6834876 | |||
| df40181357 | |||
| 6237a6a6d3 | |||
| 23a26e4033 | |||
| 492d91791c | |||
| 0a6c58ea71 | |||
| 4c8c02f66f | |||
| b038078541 | |||
| 43b43491ab | |||
| a1d4942f76 | |||
| 3bcbd3259f | |||
| 60f8287208 | |||
| b37d13af72 | |||
| 12eb1e0829 | |||
| 5c47476e0c | |||
| 60b6df4542 | |||
| e633ef895d | |||
| a0a963fe1d | |||
| a8419738be | |||
| 7501d253c7 | |||
| d9ccf0a144 | |||
| bd27490adb | |||
| ac4fefa49a | |||
| 6a05702c20 | |||
| 9188f57938 | |||
| 1a131d17b6 | |||
| 4a73fa18d8 | |||
| fe745fdef0 | |||
| 5b2071448f | |||
| 633fb5f941 | |||
| 741eb0c3e9 | |||
| bf38ef23e5 | |||
| 91cf4eb977 | |||
| 01bb11b415 | |||
| 0ff3035f3a | |||
| 2dcfa140e9 | |||
| 367c11dfa2 | |||
| d507ea117e | |||
| 3905234b0d | |||
| 6fc284231c | |||
| a0d28f1770 | |||
| aca0d3dba5 | |||
| d4fd39f05f | |||
| 42be79b3a2 | |||
| 5844128a77 | |||
| 8aaf64d917 | |||
| 5005c7b64c | |||
| bb5dbd13a8 | |||
| 696ae3cc14 | |||
| 9d623160a6 | |||
| 3d3898145a | |||
| 3b3dbcbeb4 | |||
| fc87834cc0 | |||
| c58c5b09ab | |||
| 2ee39b62f3 | |||
| fd082df077 | |||
| aaf5bf0218 | |||
| fb54d06582 | |||
| 5eeb6e0bca | |||
| b0e974e208 | |||
| d6cc851c67 | |||
| 14603112a4 | |||
| a52dfc0373 | |||
| 3e1dd0d640 | |||
| 2e121014b0 | |||
| cbf8622670 | |||
| 80810f1b18 | |||
| 29d3f6a024 | |||
| 80d09044f7 | |||
| 11c41600a3 | |||
| 416fb66118 | |||
| 2af7657214 | |||
| f31d3c6749 | |||
| c53af0df0b | |||
| cec7836959 | |||
| e4a8c693b0 | |||
| 7ff5e02f6b | |||
| f7cb1ce3f4 | |||
| 577831bf1a | |||
| 6cb1a4a48b | |||
| 3da29b4a04 | |||
| 6ee34331b7 | |||
| e2353be24f | |||
| 46e282bd6d | |||
| 6fa930f043 | |||
| b19f745659 | |||
| febf7e54fe | |||
| 88f36ac82f | |||
| 02f5e2de9c | |||
| 6567e0e0aa | |||
| fc50018b06 | |||
| 32e6767b5a | |||
| f22307a0af | |||
| 877e10205b | |||
| 8b8defeacc | |||
| f5daefb09d | |||
| 1fdad42c5f | |||
| 591fa8b753 | |||
| f7fff4d455 | |||
| 283aca50ba | |||
| 1bc9a530bd | |||
| 01797f74dc | |||
| ff07c2b375 | |||
| 90289b0ca0 | |||
| 19838d97be | |||
| c4873a64ec | |||
| 7ce4a7f641 |
@@ -0,0 +1,169 @@
|
||||
name: 🪲 Report a bug
|
||||
description: Create a bug report to help improve Marlin Firmware
|
||||
title: "[BUG] (bug summary)"
|
||||
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.0.x/.github/code_of_conduct.md). You are expected to comply with it, including treating everyone with respect.
|
||||
|
||||
- Test with the [`bugfix-2.0.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.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.0.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.0.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.0.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.
|
||||
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: Add-ons
|
||||
description: Please list any 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: >-
|
||||
## Other things to include
|
||||
|
||||
Please also be sure to include these items to help with troubleshooting:
|
||||
|
||||
* **A ZIP file** containing your `Configuration.h` and `Configuration_adv.h`.
|
||||
(Please don't paste lengthy configuration text here.)
|
||||
* **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.
|
||||
|
||||
If you've made any other modifications to the firmware, please describe them in detail in the space provided.
|
||||
|
||||
When pasting formatted text into the box below don't forget to put ` ``` ` (on its own line) before and after to make it readable.
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional information & file uploads
|
||||
@@ -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.gg/n5NJ59y
|
||||
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!
|
||||
@@ -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.0.x` branch](https://github.com/MarlinFirmware/Marlin/archive/bugfix-2.0.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.
|
||||
@@ -50,13 +50,13 @@ If chat is more your speed, you can join the MarlinFirmware Discord server:
|
||||
|
||||
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.md), the information it asks for helps us resolve issues faster.
|
||||
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.md).
|
||||
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:
|
||||
|
||||
@@ -88,12 +88,12 @@ Include details about your configuration and environment:
|
||||
|
||||
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](#before-submitting-a-suggestion) 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-enhancement-suggestion). Fill in [the template](issue_template.md), including the steps that you imagine you would take if the feature you're requesting existed.
|
||||
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%3Aissue)** 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.
|
||||
* **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?
|
||||
|
||||
@@ -116,7 +116,7 @@ Unsure where to begin contributing to Marlin? You can start by looking through t
|
||||
|
||||
### Pull Requests
|
||||
|
||||
Pull Requests should always be targeted to working branches (e.g., `bugfix-1.1.x` and/or `bugfix-2.0.x`) and never to release branches (e.g., `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.
|
||||
Pull Requests should always be targeted to working branches (e.g., `bugfix-2.0.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.
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<!--
|
||||
|
||||
Have you read Marlin's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/.github/code_of_conduct.md
|
||||
|
||||
Do you want to ask a question? Are you looking for support? Please don't post here. Instead use one of the following options:
|
||||
|
||||
- The Marlin Firmware forum at https://reprap.org/forum/list.php?415
|
||||
- The MarlinFirmware Facebook Group at https://www.facebook.com/groups/1049718498464482/
|
||||
- The MarlinFirmware Discord Server at https://discord.gg/n5NJ59y.
|
||||
|
||||
Before filing an issue be sure to test the latest "bugfix" branch to see whether the issue is already addressed.
|
||||
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
<!-- Description of the bug or requested feature -->
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
<!-- If this is a Bug Report, please describe the steps needed to reproduce the issue -->
|
||||
|
||||
1. [First Step]
|
||||
2. [Second Step]
|
||||
3. [and so on...]
|
||||
|
||||
**Expected behavior:** [What you expect to happen]
|
||||
|
||||
**Actual behavior:** [What actually happens]
|
||||
|
||||
#### Additional Information
|
||||
|
||||
* Include a ZIP file containing your `Configuration.h` and `Configuration_adv.h` files.
|
||||
* Provide pictures or links to videos that clearly demonstrate the issue.
|
||||
* See [How Can I Contribute](#how-can-i-contribute) for additional guidelines.
|
||||
@@ -1,23 +1,33 @@
|
||||
### Requirements
|
||||
<!--
|
||||
|
||||
* Filling out this template is required. Pull Requests without a clear description may be closed at the maintainers' discretion.
|
||||
Submitting a Pull Request
|
||||
|
||||
- Please fill out all sections of this form. You can delete the helpful comments.
|
||||
- Pull Requests without clear information will take longer and may even be rejected.
|
||||
- We get a high volume of submissions so please be patient during review.
|
||||
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
<!--
|
||||
|
||||
We must be able to understand your proposed change from this description. If we can't understand what the code will do from this description, the Pull Request may be closed at the maintainers' discretion. Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code recently, so please walk us through the concepts.
|
||||
Clearly describe the submitted changes with lots of details. Include images where helpful. Initial reviewers may not be familiar with the subject, so be as thorough as possible. You can use MarkDown syntax to improve readability with bullet lists, code blocks, and so on. PREVIEW and fix up formatting before submitting.
|
||||
|
||||
-->
|
||||
|
||||
### Requirements
|
||||
|
||||
<!-- Does this PR require a specific board, LCD, etc.? -->
|
||||
|
||||
### Benefits
|
||||
|
||||
<!-- What does this fix or improve? -->
|
||||
<!-- What does this PR fix or improve? -->
|
||||
|
||||
### Configurations
|
||||
|
||||
<!-- Attach any Configuration.h, Configuration_adv.h, or platformio.ini files needed to compile/test your Pull Request. -->
|
||||
<!-- Attach Configurations ZIP and any other files needed to test this PR. -->
|
||||
|
||||
### Related Issues
|
||||
|
||||
<!-- Whether this fixes a bug or fulfills a feature request, please list any related Issues here. -->
|
||||
<!-- Does this PR fix a bug or fulfill a Feature Request? Link related Issues here. -->
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# 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-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Check out bugfix-2.0.x
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: bugfix-2.0.x
|
||||
|
||||
- name: Bump Distribution Date
|
||||
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
|
||||
@@ -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-latest
|
||||
|
||||
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.0.x` branch and be careful to target `bugfix-2.0.x` when resubmitting the PR.
|
||||
|
||||
It may help to set your fork's default branch to `bugfix-2.0.x`.
|
||||
|
||||
See [this page](http://marlinfw.org/docs/development/getting_started_pull_requests.html) for full instructions.
|
||||
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# 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-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
label:
|
||||
- "S: Don't Merge"
|
||||
- "S: Hold for 2.1"
|
||||
- "S: Please Merge"
|
||||
- "S: Please Test"
|
||||
- "help wanted"
|
||||
- "Needs: Discussion"
|
||||
- "Needs: Documentation"
|
||||
- "Needs: More Data"
|
||||
- "Needs: Patch"
|
||||
- "Needs: Testing"
|
||||
- "Needs: Work"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Remove Labels
|
||||
uses: actions-ecosystem/action-remove-labels@v1
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
labels: ${{ matrix.label }}
|
||||
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# 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-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.'
|
||||
days-before-stale: 60
|
||||
days-before-close: 10
|
||||
stale-issue-label: 'stale-closing-soon'
|
||||
exempt-all-assignees: true
|
||||
exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: Discussion,Needs: Documentation,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking'
|
||||
@@ -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-latest
|
||||
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v2
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
process-only: 'issues'
|
||||
issue-lock-inactive-days: '60'
|
||||
issue-exclude-created-before: ''
|
||||
issue-exclude-labels: 'no-locking'
|
||||
issue-lock-labels: ''
|
||||
issue-lock-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: ''
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
#- STM32F103RC_btt_maple
|
||||
- STM32F103RC_btt_USB_maple
|
||||
- STM32F103RC_fysetc_maple
|
||||
- STM32F103RC_meeb
|
||||
- STM32F103RC_meeb_maple
|
||||
- jgaurora_a5s_a1_maple
|
||||
- STM32F103VE_longer_maple
|
||||
#- mks_robin_maple
|
||||
@@ -76,6 +76,7 @@ jobs:
|
||||
- STM32F103RE_btt
|
||||
- STM32F103RE_btt_USB
|
||||
- STM32F103RE_creality
|
||||
- STM32F401RC_creality
|
||||
- STM32F103VE_longer
|
||||
- STM32F407VE_black
|
||||
- STM32F401VE_STEVAL
|
||||
@@ -137,8 +138,9 @@ jobs:
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
pip install -U https://github.com/platformio/platformio-core/archive/v5.2.5.zip
|
||||
platformio update
|
||||
pip install -U platformio
|
||||
pio upgrade --dev
|
||||
pio pkg update --global
|
||||
|
||||
- name: Run ${{ matrix.test-platform }} Tests
|
||||
run: |
|
||||
|
||||
@@ -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-latest
|
||||
|
||||
steps:
|
||||
- uses: OSDKDev/unlock-issues@v1.1
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
+100
-119
@@ -150,20 +150,43 @@
|
||||
//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
|
||||
|
||||
/**
|
||||
* Define the number of coordinated axes.
|
||||
* See https://github.com/DerAndere1/Marlin/wiki
|
||||
* Each axis gets its own stepper control and endstop:
|
||||
* Stepper Drivers
|
||||
*
|
||||
* Steppers: *_STEP_PIN, *_ENABLE_PIN, *_DIR_PIN, *_ENABLE_ON
|
||||
* Endstops: *_STOP_PIN, USE_*MIN_PLUG, USE_*MAX_PLUG
|
||||
* Axes: *_MIN_POS, *_MAX_POS, INVERT_*_DIR
|
||||
* Planner: DEFAULT_AXIS_STEPS_PER_UNIT, DEFAULT_MAX_FEEDRATE
|
||||
* DEFAULT_MAX_ACCELERATION, AXIS_RELATIVE_MODES,
|
||||
* MICROSTEP_MODES, MANUAL_FEEDRATE
|
||||
* These settings allow Marlin to tune stepper driver timing and enable advanced options for
|
||||
* stepper drivers that support them. You may also override timing options in Configuration_adv.h.
|
||||
*
|
||||
* :[3, 4, 5, 6, 7, 8, 9]
|
||||
* Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers.
|
||||
*
|
||||
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
|
||||
* TB6560, TB6600, TMC2100,
|
||||
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
|
||||
* TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
|
||||
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
|
||||
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
|
||||
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
|
||||
*/
|
||||
//#define NUM_AXES 3
|
||||
#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
|
||||
//#define Z3_DRIVER_TYPE A4988
|
||||
//#define Z4_DRIVER_TYPE A4988
|
||||
//#define I_DRIVER_TYPE A4988
|
||||
//#define J_DRIVER_TYPE A4988
|
||||
//#define K_DRIVER_TYPE A4988
|
||||
//#define U_DRIVER_TYPE A4988
|
||||
//#define V_DRIVER_TYPE A4988
|
||||
//#define W_DRIVER_TYPE A4988
|
||||
#define E0_DRIVER_TYPE A4988
|
||||
//#define E1_DRIVER_TYPE A4988
|
||||
//#define E2_DRIVER_TYPE A4988
|
||||
//#define E3_DRIVER_TYPE A4988
|
||||
//#define E4_DRIVER_TYPE A4988
|
||||
//#define E5_DRIVER_TYPE A4988
|
||||
//#define E6_DRIVER_TYPE A4988
|
||||
//#define E7_DRIVER_TYPE A4988
|
||||
|
||||
/**
|
||||
* Additional Axis Settings
|
||||
@@ -182,27 +205,27 @@
|
||||
*
|
||||
* Regardless of these settings the axes are internally named I, J, K, U, V, W.
|
||||
*/
|
||||
#if NUM_AXES >= 4
|
||||
#ifdef I_DRIVER_TYPE
|
||||
#define AXIS4_NAME 'A' // :['A', 'B', 'C', 'U', 'V', 'W']
|
||||
#define AXIS4_ROTATES
|
||||
#endif
|
||||
#if NUM_AXES >= 5
|
||||
#ifdef J_DRIVER_TYPE
|
||||
#define AXIS5_NAME 'B' // :['B', 'C', 'U', 'V', 'W']
|
||||
#define AXIS5_ROTATES
|
||||
#endif
|
||||
#if NUM_AXES >= 6
|
||||
#ifdef K_DRIVER_TYPE
|
||||
#define AXIS6_NAME 'C' // :['C', 'U', 'V', 'W']
|
||||
#define AXIS6_ROTATES
|
||||
#endif
|
||||
#if NUM_AXES >= 7
|
||||
#ifdef U_DRIVER_TYPE
|
||||
#define AXIS7_NAME 'U' // :['U', 'V', 'W']
|
||||
//#define AXIS7_ROTATES
|
||||
#endif
|
||||
#if NUM_AXES >= 8
|
||||
#ifdef V_DRIVER_TYPE
|
||||
#define AXIS8_NAME 'V' // :['V', 'W']
|
||||
//#define AXIS8_ROTATES
|
||||
#endif
|
||||
#if NUM_AXES >= 9
|
||||
#ifdef W_DRIVER_TYPE
|
||||
#define AXIS9_NAME 'W' // :['W']
|
||||
//#define AXIS9_ROTATES
|
||||
#endif
|
||||
@@ -619,8 +642,6 @@
|
||||
#define PID_K1 0.95 // Smoothing factor within any PID loop
|
||||
|
||||
#if ENABLED(PIDTEMP)
|
||||
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
|
||||
//#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
|
||||
//#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
|
||||
// Set/get with gcode: M301 E[extruder number, 0-2]
|
||||
|
||||
@@ -645,6 +666,9 @@
|
||||
* for PID_EXTRUSION_SCALING and PID_FAN_SCALING. Use M306 to autotune the model.
|
||||
*/
|
||||
#if ENABLED(MPCTEMP)
|
||||
//#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1300 bytes of flash)
|
||||
//#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash)
|
||||
|
||||
#define MPC_MAX BANG_MAX // (0..255) Current to nozzle while MPC is active.
|
||||
#define MPC_HEATER_POWER { 40.0f } // (W) Heat cartridge powers.
|
||||
|
||||
@@ -664,15 +688,16 @@
|
||||
//#define MPC_FAN_0_ACTIVE_HOTEND
|
||||
#endif
|
||||
|
||||
#define FILAMENT_HEAT_CAPACITY_PERMM 5.6e-3f // 0.0056 J/K/mm for 1.75mm PLA (0.0149 J/K/mm for 2.85mm PLA).
|
||||
//#define FILAMENT_HEAT_CAPACITY_PERMM 3.6e-3f // 0.0036 J/K/mm for 1.75mm PETG (0.0094 J/K/mm for 2.85mm PETG).
|
||||
#define FILAMENT_HEAT_CAPACITY_PERMM { 5.6e-3f } // 0.0056 J/K/mm for 1.75mm PLA (0.0149 J/K/mm for 2.85mm PLA).
|
||||
//#define FILAMENT_HEAT_CAPACITY_PERMM { 3.6e-3f } // 0.0036 J/K/mm for 1.75mm PETG (0.0094 J/K/mm for 2.85mm PETG).
|
||||
|
||||
// Advanced options
|
||||
#define MPC_SMOOTHING_FACTOR 0.5f // (0.0...1.0) Noisy temperature sensors may need a lower value for stabilization.
|
||||
#define MPC_MIN_AMBIENT_CHANGE 1.0f // (K/s) Modeled ambient temperature rate of change, when correcting model inaccuracies.
|
||||
#define MPC_STEADYSTATE 0.5f // (K/s) Temperature change rate for steady state logic to be enforced.
|
||||
|
||||
#define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center just above the surface.
|
||||
#define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center at first layer height.
|
||||
#define MPC_TUNING_END_Z 10.0f // (mm) M306 Autotuning final Z position.
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
@@ -767,6 +792,9 @@
|
||||
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
|
||||
#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)
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
@@ -936,47 +964,6 @@
|
||||
#define W_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.
|
||||
|
||||
/**
|
||||
* Stepper Drivers
|
||||
*
|
||||
* These settings allow Marlin to tune stepper driver timing and enable advanced options for
|
||||
* stepper drivers that support them. You may also override timing options in Configuration_adv.h.
|
||||
*
|
||||
* A4988 is assumed for unspecified drivers.
|
||||
*
|
||||
* Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers.
|
||||
*
|
||||
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
|
||||
* TB6560, TB6600, TMC2100,
|
||||
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
|
||||
* TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
|
||||
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
|
||||
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
|
||||
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
|
||||
*/
|
||||
#define X_DRIVER_TYPE A4988
|
||||
#define Y_DRIVER_TYPE A4988
|
||||
#define Z_DRIVER_TYPE A4988
|
||||
//#define X2_DRIVER_TYPE A4988
|
||||
//#define Y2_DRIVER_TYPE A4988
|
||||
//#define Z2_DRIVER_TYPE A4988
|
||||
//#define Z3_DRIVER_TYPE A4988
|
||||
//#define Z4_DRIVER_TYPE A4988
|
||||
//#define I_DRIVER_TYPE A4988
|
||||
//#define J_DRIVER_TYPE A4988
|
||||
//#define K_DRIVER_TYPE A4988
|
||||
//#define U_DRIVER_TYPE A4988
|
||||
//#define V_DRIVER_TYPE A4988
|
||||
//#define W_DRIVER_TYPE A4988
|
||||
#define E0_DRIVER_TYPE A4988
|
||||
//#define E1_DRIVER_TYPE A4988
|
||||
//#define E2_DRIVER_TYPE A4988
|
||||
//#define E3_DRIVER_TYPE A4988
|
||||
//#define E4_DRIVER_TYPE A4988
|
||||
//#define E5_DRIVER_TYPE A4988
|
||||
//#define E6_DRIVER_TYPE A4988
|
||||
//#define E7_DRIVER_TYPE A4988
|
||||
|
||||
// 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.
|
||||
//#define ENDSTOP_INTERRUPTS_FEATURE
|
||||
@@ -1969,7 +1956,7 @@
|
||||
* M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
|
||||
*/
|
||||
//#define EEPROM_SETTINGS // Persistent storage with M500 and M501
|
||||
//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release!
|
||||
//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
|
||||
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
|
||||
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
@@ -2000,7 +1987,7 @@
|
||||
// @section temperature
|
||||
|
||||
//
|
||||
// Preheat Constants - Up to 5 are supported without changes
|
||||
// Preheat Constants - Up to 6 are supported without changes
|
||||
//
|
||||
#define PREHEAT_1_LABEL "PLA"
|
||||
#define PREHEAT_1_TEMP_HOTEND 180
|
||||
@@ -2700,38 +2687,38 @@
|
||||
//========================== Extensible UI Displays ===========================
|
||||
//=============================================================================
|
||||
|
||||
//
|
||||
// DGUS Touch Display with DWIN OS. (Choose one.)
|
||||
// ORIGIN : https://www.aliexpress.com/item/32993409517.html
|
||||
// FYSETC : https://www.aliexpress.com/item/32961471929.html
|
||||
// MKS : https://www.aliexpress.com/item/1005002008179262.html
|
||||
//
|
||||
// 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 (Marlin DWIN_SET)
|
||||
// - Download https://github.com/coldtobi/Marlin_DGUS_Resources
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// FYSETC (Supplier default)
|
||||
// - Download https://github.com/FYSETC/FYSTLCD-2.0
|
||||
// - Copy the downloaded SCREEN folder to the SD card.
|
||||
//
|
||||
// HIPRECY (Supplier default)
|
||||
// - Download https://github.com/HiPrecy/Touch-Lcd-LEO
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// MKS (MKS-H43) (Supplier default)
|
||||
// - Download https://github.com/makerbase-mks/MKS-H43
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// RELOADED (T5UID1)
|
||||
// - Download https://github.com/Desuuuu/DGUS-reloaded/releases
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
/**
|
||||
* DGUS Touch Display with DWIN OS. (Choose one.)
|
||||
* ORIGIN : https://www.aliexpress.com/item/32993409517.html
|
||||
* FYSETC : https://www.aliexpress.com/item/32961471929.html
|
||||
* MKS : https://www.aliexpress.com/item/1005002008179262.html
|
||||
*
|
||||
* 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 (Marlin DWIN_SET)
|
||||
* - Download https://github.com/coldtobi/Marlin_DGUS_Resources
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* FYSETC (Supplier default)
|
||||
* - Download https://github.com/FYSETC/FYSTLCD-2.0
|
||||
* - Copy the downloaded SCREEN folder to the SD card.
|
||||
*
|
||||
* HIPRECY (Supplier default)
|
||||
* - Download https://github.com/HiPrecy/Touch-Lcd-LEO
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* MKS (MKS-H43) (Supplier default)
|
||||
* - Download https://github.com/makerbase-mks/MKS-H43
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*
|
||||
* RELOADED (T5UID1)
|
||||
* - Download https://github.com/Desuuuu/DGUS-reloaded/releases
|
||||
* - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
*/
|
||||
//#define DGUS_LCD_UI_ORIGIN
|
||||
//#define DGUS_LCD_UI_FYSETC
|
||||
//#define DGUS_LCD_UI_HIPRECY
|
||||
@@ -2745,9 +2732,6 @@
|
||||
// Touch-screen LCD for Malyan M200/M300 printers
|
||||
//
|
||||
//#define MALYAN_LCD
|
||||
#if ENABLED(MALYAN_LCD)
|
||||
#define LCD_SERIAL_PORT 1 // Default is 1 for Malyan M200
|
||||
#endif
|
||||
|
||||
//
|
||||
// Touch UI for FTDI EVE (FT800/FT810) displays
|
||||
@@ -2761,7 +2745,6 @@
|
||||
//#define ANYCUBIC_LCD_I3MEGA
|
||||
//#define ANYCUBIC_LCD_CHIRON
|
||||
#if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
|
||||
#define LCD_SERIAL_PORT 3 // Default is 3 for Anycubic
|
||||
//#define ANYCUBIC_LCD_DEBUG
|
||||
#endif
|
||||
|
||||
@@ -2769,9 +2752,6 @@
|
||||
// 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
|
||||
//
|
||||
//#define NEXTION_TFT
|
||||
#if ENABLED(NEXTION_TFT)
|
||||
#define LCD_SERIAL_PORT 1 // Default is 1 for Nextion
|
||||
#endif
|
||||
|
||||
//
|
||||
// Third-party or vendor-customized controller interfaces.
|
||||
@@ -3046,30 +3026,31 @@
|
||||
// Support for Adafruit NeoPixel LED driver
|
||||
//#define NEOPIXEL_LED
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
|
||||
//#define NEOPIXEL_PIN 4 // LED driving pin
|
||||
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
|
||||
//#define NEOPIXEL2_PIN 5
|
||||
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
|
||||
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
|
||||
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
|
||||
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
|
||||
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW, NEO_RGBW, NEO_GRB, NEO_RBG, etc.
|
||||
// See https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.h
|
||||
//#define NEOPIXEL_PIN 4 // LED driving pin
|
||||
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
|
||||
//#define NEOPIXEL2_PIN 5
|
||||
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
|
||||
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
|
||||
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
|
||||
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
|
||||
|
||||
// Support for second Adafruit NeoPixel LED driver controlled with M150 S1 ...
|
||||
//#define NEOPIXEL2_SEPARATE
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
#define NEOPIXEL2_PIXELS 15 // Number of LEDs in the second strip
|
||||
#define NEOPIXEL2_BRIGHTNESS 127 // Initial brightness (0-255)
|
||||
#define NEOPIXEL2_STARTUP_TEST // Cycle through colors at startup
|
||||
#define NEOPIXEL2_PIXELS 15 // Number of LEDs in the second strip
|
||||
#define NEOPIXEL2_BRIGHTNESS 127 // Initial brightness (0-255)
|
||||
#define NEOPIXEL2_STARTUP_TEST // Cycle through colors at startup
|
||||
#else
|
||||
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
|
||||
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
|
||||
#endif
|
||||
|
||||
// Use some of the NeoPixel LEDs for static (background) lighting
|
||||
//#define NEOPIXEL_BKGD_INDEX_FIRST 0 // Index of the first background LED
|
||||
//#define NEOPIXEL_BKGD_INDEX_LAST 5 // Index of the last background LED
|
||||
//#define NEOPIXEL_BKGD_INDEX_FIRST 0 // Index of the first background LED
|
||||
//#define NEOPIXEL_BKGD_INDEX_LAST 5 // Index of the last background LED
|
||||
//#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
|
||||
//#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off
|
||||
//#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
+124
-97
@@ -249,20 +249,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Laser Coolant Flow Meter
|
||||
//
|
||||
//#define LASER_COOLANT_FLOW_METER
|
||||
#if ENABLED(LASER_COOLANT_FLOW_METER)
|
||||
#define FLOWMETER_PIN 20 // Requires an external interrupt-enabled pin (e.g., RAMPS 2,3,18,19,20,21)
|
||||
#define FLOWMETER_PPL 5880 // (pulses/liter) Flow meter pulses-per-liter on the input pin
|
||||
#define FLOWMETER_INTERVAL 1000 // (ms) Flow rate calculation interval in milliseconds
|
||||
#define FLOWMETER_SAFETY // Prevent running the laser without the minimum flow rate set below
|
||||
#if ENABLED(FLOWMETER_SAFETY)
|
||||
#define FLOWMETER_MIN_LITERS_PER_MINUTE 1.5 // (liters/min) Minimum flow required when enabled
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Thermal Protection provides additional protection to your printer from damage
|
||||
* and fire. Marlin always includes safe min and max temperature ranges which
|
||||
@@ -620,7 +606,6 @@
|
||||
#define E7_AUTO_FAN_PIN -1
|
||||
#define CHAMBER_AUTO_FAN_PIN -1
|
||||
#define COOLER_AUTO_FAN_PIN -1
|
||||
#define COOLER_FAN_PIN -1
|
||||
|
||||
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
|
||||
#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed
|
||||
@@ -714,73 +699,6 @@
|
||||
//#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Dual Steppers / Dual Endstops
|
||||
*
|
||||
* This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes.
|
||||
*
|
||||
* For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to
|
||||
* spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop
|
||||
* set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug
|
||||
* that should be used for the second endstop. Extra endstops will appear in the output of 'M119'.
|
||||
*
|
||||
* Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors
|
||||
* this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error
|
||||
* in X2. Dual endstop offsets can be set at runtime with 'M666 X<offset> Y<offset> Z<offset>'.
|
||||
*/
|
||||
|
||||
//#define X_DUAL_STEPPER_DRIVERS
|
||||
#if ENABLED(X_DUAL_STEPPER_DRIVERS)
|
||||
//#define INVERT_X2_VS_X_DIR // Enable if X2 direction signal is opposite to X
|
||||
//#define X_DUAL_ENDSTOPS
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
#define X2_USE_ENDSTOP _XMAX_
|
||||
#define X2_ENDSTOP_ADJUSTMENT 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//#define Y_DUAL_STEPPER_DRIVERS
|
||||
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
|
||||
//#define INVERT_Y2_VS_Y_DIR // Enable if Y2 direction signal is opposite to Y
|
||||
//#define Y_DUAL_ENDSTOPS
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
#define Y2_USE_ENDSTOP _YMAX_
|
||||
#define Y2_ENDSTOP_ADJUSTMENT 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// For Z set the number of stepper drivers
|
||||
//
|
||||
#define NUM_Z_STEPPER_DRIVERS 1 // (1-4) Z options change based on how many
|
||||
|
||||
#if NUM_Z_STEPPER_DRIVERS > 1
|
||||
// Enable if Z motor direction signals are the opposite of Z1
|
||||
//#define INVERT_Z2_VS_Z_DIR
|
||||
//#define INVERT_Z3_VS_Z_DIR
|
||||
//#define INVERT_Z4_VS_Z_DIR
|
||||
|
||||
//#define Z_MULTI_ENDSTOPS
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#define Z2_USE_ENDSTOP _XMAX_
|
||||
#define Z2_ENDSTOP_ADJUSTMENT 0
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 3
|
||||
#define Z3_USE_ENDSTOP _YMAX_
|
||||
#define Z3_ENDSTOP_ADJUSTMENT 0
|
||||
#endif
|
||||
#if NUM_Z_STEPPER_DRIVERS >= 4
|
||||
#define Z4_USE_ENDSTOP _ZMAX_
|
||||
#define Z4_ENDSTOP_ADJUSTMENT 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Drive the E axis with two synchronized steppers
|
||||
//#define E_DUAL_STEPPER_DRIVERS
|
||||
#if ENABLED(E_DUAL_STEPPER_DRIVERS)
|
||||
//#define INVERT_E1_VS_E0_DIR // Enable if the E motors need opposite DIR states
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Dual X Carriage
|
||||
*
|
||||
@@ -831,6 +749,77 @@
|
||||
//#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Multi-Stepper / Multi-Endstop
|
||||
*
|
||||
* When X2_DRIVER_TYPE is defined, this indicates that the X and X2 motors work in tandem.
|
||||
* The following explanations for X also apply to Y and Z multi-stepper setups.
|
||||
* Endstop offsets may be changed by 'M666 X<offset> Y<offset> Z<offset>' and stored to EEPROM.
|
||||
*
|
||||
* - Enable INVERT_X2_VS_X_DIR if the X2 motor requires an opposite DIR signal from X.
|
||||
*
|
||||
* - Enable X_DUAL_ENDSTOPS if the second motor has its own endstop, with adjustable offset.
|
||||
*
|
||||
* - Extra endstops are included in the output of 'M119'.
|
||||
*
|
||||
* - Set X_DUAL_ENDSTOP_ADJUSTMENT to the known error in the X2 endstop.
|
||||
* Applied to the X2 motor on 'G28' / 'G28 X'.
|
||||
* Get the offset by homing X and measuring the error.
|
||||
* Also set with 'M666 X<offset>' and stored to EEPROM with 'M500'.
|
||||
*
|
||||
* - Use X2_USE_ENDSTOP to set the endstop plug by name. (_XMIN_, _XMAX_, _YMIN_, _YMAX_, _ZMIN_, _ZMAX_)
|
||||
*/
|
||||
#if HAS_X2_STEPPER && DISABLED(DUAL_X_CARRIAGE)
|
||||
//#define INVERT_X2_VS_X_DIR // X2 direction signal is the opposite of X
|
||||
//#define X_DUAL_ENDSTOPS // X2 has its own endstop
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
#define X2_USE_ENDSTOP _XMAX_ // X2 endstop board plug. Don't forget to enable USE_*_PLUG.
|
||||
#define X2_ENDSTOP_ADJUSTMENT 0 // X2 offset relative to X endstop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_DUAL_Y_STEPPERS
|
||||
//#define INVERT_Y2_VS_Y_DIR // Y2 direction signal is the opposite of Y
|
||||
//#define Y_DUAL_ENDSTOPS // Y2 has its own endstop
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
#define Y2_USE_ENDSTOP _YMAX_ // Y2 endstop board plug. Don't forget to enable USE_*_PLUG.
|
||||
#define Y2_ENDSTOP_ADJUSTMENT 0 // Y2 offset relative to Y endstop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Multi-Z steppers
|
||||
//
|
||||
#ifdef Z2_DRIVER_TYPE
|
||||
//#define INVERT_Z2_VS_Z_DIR // Z2 direction signal is the opposite of Z
|
||||
|
||||
//#define Z_MULTI_ENDSTOPS // Other Z axes have their own endstops
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#define Z2_USE_ENDSTOP _XMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG.
|
||||
#define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Y endstop
|
||||
#endif
|
||||
#ifdef Z3_DRIVER_TYPE
|
||||
//#define INVERT_Z3_VS_Z_DIR // Z3 direction signal is the opposite of Z
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#define Z3_USE_ENDSTOP _YMAX_ // Z3 endstop board plug. Don't forget to enable USE_*_PLUG.
|
||||
#define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Y endstop
|
||||
#endif
|
||||
#endif
|
||||
#ifdef Z4_DRIVER_TYPE
|
||||
//#define INVERT_Z4_VS_Z_DIR // Z4 direction signal is the opposite of Z
|
||||
#if ENABLED(Z_MULTI_ENDSTOPS)
|
||||
#define Z4_USE_ENDSTOP _ZMAX_ // Z4 endstop board plug. Don't forget to enable USE_*_PLUG.
|
||||
#define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Y endstop
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Drive the E axis with two synchronized steppers
|
||||
//#define E_DUAL_STEPPER_DRIVERS
|
||||
#if ENABLED(E_DUAL_STEPPER_DRIVERS)
|
||||
//#define INVERT_E1_VS_E0_DIR // E direction signals are opposites
|
||||
#endif
|
||||
|
||||
// Activate a solenoid on the active extruder with M380. Disable all with M381.
|
||||
// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid.
|
||||
//#define EXT_SOLENOID
|
||||
@@ -934,9 +923,12 @@
|
||||
*/
|
||||
//#define Z_STEPPER_AUTO_ALIGN
|
||||
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
||||
// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
|
||||
// If not defined, probe limits will be used.
|
||||
// Override with 'M422 S<index> X<pos> Y<pos>'
|
||||
/**
|
||||
* Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
|
||||
* These positions are machine-relative and do not shift with the M206 home offset!
|
||||
* If not defined, probe limits will be used.
|
||||
* Override with 'M422 S<index> X<pos> Y<pos>'.
|
||||
*/
|
||||
//#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
|
||||
|
||||
/**
|
||||
@@ -964,7 +956,7 @@
|
||||
|
||||
/**
|
||||
* Z Stepper positions for more rapid convergence in bed alignment.
|
||||
* Requires NUM_Z_STEPPER_DRIVERS to be 3 or 4.
|
||||
* Requires 3 or 4 Z steppers.
|
||||
*
|
||||
* Define Stepper XY positions for Z1, Z2, Z3... corresponding to the screw
|
||||
* positions in the bed carriage, with one position per Z stepper in stepper
|
||||
@@ -1348,6 +1340,7 @@
|
||||
|
||||
#if ANY(HAS_DISPLAY, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
|
||||
//#define SOUND_MENU_ITEM // Add a mute option to the LCD menu
|
||||
#define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state
|
||||
#endif
|
||||
|
||||
#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
|
||||
@@ -1689,14 +1682,25 @@
|
||||
//#define XYZ_NO_FRAME
|
||||
#define XYZ_HOLLOW_FRAME
|
||||
|
||||
// A bigger font is available for edit items. Costs 3120 bytes of PROGMEM.
|
||||
// A bigger font is available for edit items. Costs 3120 bytes of flash.
|
||||
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
|
||||
//#define USE_BIG_EDIT_FONT
|
||||
|
||||
// A smaller font may be used on the Info Screen. Costs 2434 bytes of PROGMEM.
|
||||
// A smaller font may be used on the Info Screen. Costs 2434 bytes of flash.
|
||||
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
|
||||
//#define USE_SMALL_INFOFONT
|
||||
|
||||
/**
|
||||
* Graphical Display Sleep
|
||||
*
|
||||
* The U8G library provides sleep / wake functions for SH1106, SSD1306,
|
||||
* SSD1309, and some other DOGM displays.
|
||||
* Enable this option to save energy and prevent OLED pixel burn-in.
|
||||
* Adds the menu item Configuration > LCD Timeout (m) to set a wait period
|
||||
* from 0 (disabled) to 99 minutes.
|
||||
*/
|
||||
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen
|
||||
|
||||
/**
|
||||
* ST7920-based LCDs can emulate a 16 x 4 character display using
|
||||
* the ST7920 character-generator for very fast screen updates.
|
||||
@@ -1738,7 +1742,7 @@
|
||||
//#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap
|
||||
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames
|
||||
//#define STATUS_HEAT_PERCENT // Show heating in a progress bar
|
||||
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of PROGMEM.
|
||||
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash.
|
||||
|
||||
// Frivolous Game Options
|
||||
//#define MARLIN_BRICKOUT
|
||||
@@ -1763,7 +1767,6 @@
|
||||
// Additional options for DGUS / DWIN displays
|
||||
//
|
||||
#if HAS_DGUS_LCD
|
||||
#define LCD_SERIAL_PORT 3
|
||||
#define LCD_BAUDRATE 115200
|
||||
|
||||
#define DGUS_RX_BUFFER_SIZE 128
|
||||
@@ -2299,7 +2302,7 @@
|
||||
#define BUFSIZE 4
|
||||
|
||||
// Transmission to Host Buffer Size
|
||||
// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
|
||||
// To save 386 bytes of flash (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
|
||||
// To buffer a simple "ok" you need 4 bytes.
|
||||
// For ADVANCED_OK (M105) you need 32 bytes.
|
||||
// For debug-echo: 128 bytes for the optimal speed.
|
||||
@@ -2450,7 +2453,7 @@
|
||||
|
||||
/**
|
||||
* Extra G-code to run while executing tool-change commands. Can be used to use an additional
|
||||
* stepper motor (I axis, see option NUM_AXES in Configuration.h) to drive the tool-changer.
|
||||
* stepper motor (e.g., I axis in Configuration.h) to drive the tool-changer.
|
||||
*/
|
||||
//#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0
|
||||
//#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10" // Extra G-code to run while executing tool-change command T1
|
||||
@@ -2484,12 +2487,16 @@
|
||||
#define TOOLCHANGE_FS_FAN_SPEED 255 // 0-255
|
||||
#define TOOLCHANGE_FS_FAN_TIME 10 // (seconds)
|
||||
|
||||
// Swap uninitialized extruder (using TOOLCHANGE_FS_PRIME_SPEED feedrate)
|
||||
// (May break filament if not retracted beforehand.)
|
||||
//#define TOOLCHANGE_FS_INIT_BEFORE_SWAP
|
||||
// Use TOOLCHANGE_FS_PRIME_SPEED feedrate the first time each extruder is primed
|
||||
//#define TOOLCHANGE_FS_SLOW_FIRST_PRIME
|
||||
|
||||
// Prime on the first T0 (For other tools use TOOLCHANGE_FS_INIT_BEFORE_SWAP)
|
||||
// Enable with M217 V1 before printing to avoid unwanted priming on host connect
|
||||
/**
|
||||
* Prime T0 the first time T0 is sent to the printer:
|
||||
* [ Power-On -> T0 { Activate & Prime T0 } -> T1 { Retract T0, Activate & Prime T1 } ]
|
||||
* If disabled, no priming on T0 until switching back to T0 from another extruder:
|
||||
* [ Power-On -> T0 { T0 Activated } -> T1 { Activate & Prime T1 } -> T0 { Retract T1, Activate & Prime T0 } ]
|
||||
* Enable with M217 V1 before printing to avoid unwanted priming on host connect.
|
||||
*/
|
||||
//#define TOOLCHANGE_FS_PRIME_FIRST_USED
|
||||
|
||||
/**
|
||||
@@ -2866,6 +2873,7 @@
|
||||
#define U_RSENSE 0.11
|
||||
#define U_CHAIN_POS -1
|
||||
//#define U_INTERPOLATE true
|
||||
//#define U_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(V)
|
||||
@@ -2875,6 +2883,7 @@
|
||||
#define V_RSENSE 0.11
|
||||
#define V_CHAIN_POS -1
|
||||
//#define V_INTERPOLATE true
|
||||
//#define V_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(W)
|
||||
@@ -2884,6 +2893,7 @@
|
||||
#define W_RSENSE 0.11
|
||||
#define W_CHAIN_POS -1
|
||||
//#define W_INTERPOLATE true
|
||||
//#define W_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
#if AXIS_IS_TMC(E0)
|
||||
@@ -3745,6 +3755,20 @@
|
||||
#define I2C_AMMETER_SHUNT_RESISTOR 0.1 // (Ohms) Calibration shunt resistor value
|
||||
#endif
|
||||
|
||||
//
|
||||
// Laser Coolant Flow Meter
|
||||
//
|
||||
//#define LASER_COOLANT_FLOW_METER
|
||||
#if ENABLED(LASER_COOLANT_FLOW_METER)
|
||||
#define FLOWMETER_PIN 20 // Requires an external interrupt-enabled pin (e.g., RAMPS 2,3,18,19,20,21)
|
||||
#define FLOWMETER_PPL 5880 // (pulses/liter) Flow meter pulses-per-liter on the input pin
|
||||
#define FLOWMETER_INTERVAL 1000 // (ms) Flow rate calculation interval in milliseconds
|
||||
#define FLOWMETER_SAFETY // Prevent running the laser without the minimum flow rate set below
|
||||
#if ENABLED(FLOWMETER_SAFETY)
|
||||
#define FLOWMETER_MIN_LITERS_PER_MINUTE 1.5 // (liters/min) Minimum flow required when enabled
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // SPINDLE_FEATURE || LASER_FEATURE
|
||||
|
||||
@@ -3858,6 +3882,9 @@
|
||||
* Auto-report temperatures with M155 S<seconds>
|
||||
*/
|
||||
#define AUTO_REPORT_TEMPERATURES
|
||||
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
|
||||
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Auto-report position with M154 S<seconds>
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
//#define STRING_DISTRIBUTION_DATE "2022-04-03"
|
||||
//#define STRING_DISTRIBUTION_DATE "2022-05-29"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "HAL.h"
|
||||
#include <avr/wdt.h>
|
||||
|
||||
#ifdef USBCON
|
||||
DefaultSerial1 MSerial0(false, Serial);
|
||||
@@ -88,6 +89,62 @@ void MarlinHAL::reboot() {
|
||||
#endif
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include <avr/wdt.h>
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s.
|
||||
void MarlinHAL::watchdog_init() {
|
||||
#if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S)
|
||||
#define WDTO_NS WDTO_8S
|
||||
#else
|
||||
#define WDTO_NS WDTO_4S
|
||||
#endif
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
// Enable the watchdog timer, but only for the interrupt.
|
||||
// Take care, as this requires the correct order of operation, with interrupts disabled.
|
||||
// See the datasheet of any AVR chip for details.
|
||||
wdt_reset();
|
||||
cli();
|
||||
_WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE);
|
||||
_WD_CONTROL_REG = _BV(WDIE) | (WDTO_NS & 0x07) | ((WDTO_NS & 0x08) << 2); // WDTO_NS directly does not work. bit 0-2 are consecutive in the register but the highest value bit is at bit 5
|
||||
// So worked for up to WDTO_2S
|
||||
sei();
|
||||
wdt_reset();
|
||||
#else
|
||||
wdt_enable(WDTO_NS); // The function handles the upper bit correct.
|
||||
#endif
|
||||
//delay(10000); // test it!
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//=================================== ISR ===================================
|
||||
//===========================================================================
|
||||
|
||||
// Watchdog timer interrupt, called if main program blocks >4sec and manual reset is enabled.
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
ISR(WDT_vect) {
|
||||
sei(); // With the interrupt driven serial we need to allow interrupts.
|
||||
SERIAL_ERROR_MSG(STR_WATCHDOG_FIRED);
|
||||
minkill(); // interrupt-safe final kill and infinite loop
|
||||
}
|
||||
#endif
|
||||
|
||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
||||
// first watchdog_init or AVR will go into emergency procedures.
|
||||
void MarlinHAL::watchdog_refresh() { wdt_reset(); }
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
// ------------------------
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../../sd/SdFatUtil.h"
|
||||
|
||||
@@ -19,16 +19,18 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* HAL for Arduino AVR
|
||||
*/
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "math.h"
|
||||
|
||||
#ifdef USBCON
|
||||
#include <HardwareSerial.h>
|
||||
#else
|
||||
#define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion
|
||||
#include "MarlinSerial.h"
|
||||
#endif
|
||||
|
||||
@@ -164,7 +166,7 @@ typedef Servo hal_servo_t;
|
||||
#define strtof strtod
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
@@ -186,6 +188,10 @@ 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
|
||||
@@ -229,7 +235,7 @@ public:
|
||||
SBI(DIDR0, ch);
|
||||
}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch) {
|
||||
#ifdef MUX5
|
||||
ADCSRB = ch > 7 ? _BV(MUX5) : 0;
|
||||
|
||||
@@ -25,6 +25,30 @@
|
||||
* Test AVR-specific configuration values for errors at compile-time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check for common serial pin conflicts
|
||||
*/
|
||||
#define CHECK_SERIAL_PIN(N) ( \
|
||||
X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \
|
||||
|| X_MIN_PIN == N || Y_MIN_PIN == N || Z_MIN_PIN == N \
|
||||
|| X_MAX_PIN == N || Y_MAX_PIN == N || Z_MAX_PIN == N \
|
||||
|| X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \
|
||||
|| X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \
|
||||
|| X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
|
||||
)
|
||||
#if CONF_SERIAL_IS(0) // D0-D1. No known conflicts.
|
||||
#endif
|
||||
#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
|
||||
#error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
|
||||
#endif
|
||||
#if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
|
||||
#error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
|
||||
#endif
|
||||
#if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
|
||||
#error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
|
||||
#endif
|
||||
#undef CHECK_SERIAL_PIN
|
||||
|
||||
/**
|
||||
* Checks for FAST PWM
|
||||
*/
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
#define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
void PRINT_ARRAY_NAME(uint8_t x) {
|
||||
char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
|
||||
const char * const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name);
|
||||
LOOP_L_N(y, MAX_NAME_LENGTH) {
|
||||
char temp_char = pgm_read_byte(name_mem_pointer + y);
|
||||
if (temp_char != 0)
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef __AVR__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s.
|
||||
void watchdog_init() {
|
||||
#if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S)
|
||||
#define WDTO_NS WDTO_8S
|
||||
#else
|
||||
#define WDTO_NS WDTO_4S
|
||||
#endif
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
// Enable the watchdog timer, but only for the interrupt.
|
||||
// Take care, as this requires the correct order of operation, with interrupts disabled.
|
||||
// See the datasheet of any AVR chip for details.
|
||||
wdt_reset();
|
||||
cli();
|
||||
_WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE);
|
||||
_WD_CONTROL_REG = _BV(WDIE) | (WDTO_NS & 0x07) | ((WDTO_NS & 0x08) << 2); // WDTO_NS directly does not work. bit 0-2 are consecutive in the register but the highest value bit is at bit 5
|
||||
// So worked for up to WDTO_2S
|
||||
sei();
|
||||
wdt_reset();
|
||||
#else
|
||||
wdt_enable(WDTO_NS); // The function handles the upper bit correct.
|
||||
#endif
|
||||
//delay(10000); // test it!
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//=================================== ISR ===================================
|
||||
//===========================================================================
|
||||
|
||||
// Watchdog timer interrupt, called if main program blocks >4sec and manual reset is enabled.
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
ISR(WDT_vect) {
|
||||
sei(); // With the interrupt driven serial we need to allow interrupts.
|
||||
SERIAL_ERROR_MSG(STR_WATCHDOG_FIRED);
|
||||
minkill(); // interrupt-safe final kill and infinite loop
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
#endif // __AVR__
|
||||
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <avr/wdt.h>
|
||||
|
||||
// Initialize watchdog with a 4 second interrupt time
|
||||
void watchdog_init();
|
||||
|
||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
||||
// first watchdog_init or AVR will go into emergency procedures.
|
||||
inline void HAL_watchdog_refresh() { wdt_reset(); }
|
||||
+106
-4
@@ -25,7 +25,7 @@
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "HAL.h"
|
||||
#include "../../MarlinCore.h"
|
||||
|
||||
#include <Wire.h>
|
||||
#include "usb/usb_task.h"
|
||||
@@ -40,14 +40,15 @@ uint16_t MarlinHAL::adc_result;
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial());
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
extern void install_min_serial();
|
||||
#endif
|
||||
|
||||
void MarlinHAL::init() {
|
||||
// Initialize the USB stack
|
||||
#if ENABLED(SDSUPPORT)
|
||||
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
|
||||
#endif
|
||||
usb_task_init();
|
||||
usb_task_init(); // Initialize the USB stack
|
||||
TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler
|
||||
}
|
||||
|
||||
@@ -72,6 +73,103 @@ uint8_t MarlinHAL::get_reset_source() {
|
||||
|
||||
void MarlinHAL::reboot() { rstc_start_software_reset(RSTC); }
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
// Initialize watchdog - On SAM3X, Watchdog was already configured
|
||||
// and enabled or disabled at startup, so no need to reconfigure it
|
||||
// here.
|
||||
void MarlinHAL::watchdog_init() { WDT_Restart(WDT); } // Reset watchdog to start clean
|
||||
|
||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
||||
// first watchdog_init or AVR will go into emergency procedures.
|
||||
void MarlinHAL::watchdog_refresh() { watchdogReset(); }
|
||||
|
||||
#endif
|
||||
|
||||
// Override Arduino runtime to either config or disable the watchdog
|
||||
//
|
||||
// We need to configure the watchdog as soon as possible in the boot
|
||||
// process, because watchdog initialization at hardware reset on SAM3X8E
|
||||
// is unreliable, and there is risk of unintended resets if we delay
|
||||
// that initialization to a later time.
|
||||
void watchdogSetup() {
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
// 4 seconds timeout
|
||||
uint32_t timeout = TERN(WATCHDOG_DURATION_8S, 8000, 4000);
|
||||
|
||||
// Calculate timeout value in WDT counter ticks: This assumes
|
||||
// the slow clock is running at 32.768 kHz watchdog
|
||||
// frequency is therefore 32768 / 128 = 256 Hz
|
||||
timeout = (timeout << 8) / 1000;
|
||||
if (timeout == 0)
|
||||
timeout = 1;
|
||||
else if (timeout > 0xFFF)
|
||||
timeout = 0xFFF;
|
||||
|
||||
// We want to enable the watchdog with the specified timeout
|
||||
uint32_t value =
|
||||
WDT_MR_WDV(timeout) | // With the specified timeout
|
||||
WDT_MR_WDD(timeout) | // and no invalid write window
|
||||
#if !(SAMV70 || SAMV71 || SAME70 || SAMS70)
|
||||
WDT_MR_WDRPROC | // WDT fault resets processor only - We want
|
||||
// to keep PIO controller state
|
||||
#endif
|
||||
WDT_MR_WDDBGHLT | // WDT stops in debug state.
|
||||
WDT_MR_WDIDLEHLT; // WDT stops in idle state.
|
||||
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
// We enable the watchdog timer, but only for the interrupt.
|
||||
|
||||
// Configure WDT to only trigger an interrupt
|
||||
value |= WDT_MR_WDFIEN; // Enable WDT fault interrupt.
|
||||
|
||||
// Disable WDT interrupt (just in case, to avoid triggering it!)
|
||||
NVIC_DisableIRQ(WDT_IRQn);
|
||||
|
||||
// We NEED memory barriers to ensure Interrupts are actually disabled!
|
||||
// ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the )
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Initialize WDT with the given parameters
|
||||
WDT_Enable(WDT, value);
|
||||
|
||||
// Configure and enable WDT interrupt.
|
||||
NVIC_ClearPendingIRQ(WDT_IRQn);
|
||||
NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups
|
||||
NVIC_EnableIRQ(WDT_IRQn);
|
||||
|
||||
#else
|
||||
|
||||
// a WDT fault triggers a reset
|
||||
value |= WDT_MR_WDRSTEN;
|
||||
|
||||
// Initialize WDT with the given parameters
|
||||
WDT_Enable(WDT, value);
|
||||
|
||||
#endif
|
||||
|
||||
// Reset the watchdog
|
||||
WDT_Restart(WDT);
|
||||
|
||||
#else
|
||||
|
||||
// Make sure to completely disable the Watchdog
|
||||
WDT_Disable(WDT);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
extern "C" {
|
||||
extern unsigned int _ebss; // end of bss section
|
||||
}
|
||||
@@ -82,6 +180,10 @@ int freeMemory() {
|
||||
return (int)&free_memory - (heap_end ?: (int)&_ebss);
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Serial Ports
|
||||
// ------------------------
|
||||
|
||||
// Forward the default serial ports
|
||||
#if USING_HW_SERIAL0
|
||||
DefaultSerial1 MSerial0(false, Serial);
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -115,8 +114,8 @@ typedef Servo hal_servo_t;
|
||||
//
|
||||
// Interrupts
|
||||
//
|
||||
#define sei() noInterrupts()
|
||||
#define cli() interrupts()
|
||||
#define sei() interrupts()
|
||||
#define cli() noInterrupts()
|
||||
|
||||
#define CRITICAL_SECTION_START() const bool _irqon = hal.isr_state(); hal.isr_off()
|
||||
#define CRITICAL_SECTION_END() if (_irqon) hal.isr_on()
|
||||
@@ -176,9 +175,13 @@ public:
|
||||
// Earliest possible init, before setup()
|
||||
MarlinHAL() {}
|
||||
|
||||
static void init(); // Called early in setup()
|
||||
static void init_board(); // Called less early in setup()
|
||||
static void reboot(); // Software reset
|
||||
// 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
|
||||
|
||||
// Interrupts
|
||||
static bool isr_state() { return !__get_PRIMASK(); }
|
||||
@@ -209,7 +212,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch) { adc_result = analogRead(ch); }
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
/**
|
||||
* HAL for Arduino Due and compatible (SAM3X8E)
|
||||
*
|
||||
* For ARDUINO_ARCH_SAM
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
|
||||
#include "../shared/HAL_MinSerial.h"
|
||||
#include "../shared/MinSerial.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -199,8 +199,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
for (i = 0; i <PageSize >> 2; i++)
|
||||
pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i]));
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM PageWrite ", page);
|
||||
DEBUG_ECHO_MSG("EEPROM PageWrite ", page);
|
||||
DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash);
|
||||
DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0));
|
||||
DEBUG_FLUSH();
|
||||
@@ -245,8 +244,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
// Reenable interrupts
|
||||
__enable_irq();
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ", page);
|
||||
DEBUG_ECHO_MSG("EEPROM Unlock failure for page ", page);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -270,8 +268,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
// Reenable interrupts
|
||||
__enable_irq();
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Write failure for page ", page);
|
||||
DEBUG_ECHO_MSG("EEPROM Write failure for page ", page);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -286,8 +283,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
if (memcmp(getFlashStorage(page),data,PageSize)) {
|
||||
|
||||
#ifdef EE_EMU_DEBUG
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Verify Write failure for page ", page);
|
||||
DEBUG_ECHO_MSG("EEPROM Verify Write failure for page ", page);
|
||||
|
||||
ee_Dump( page, (uint32_t *)addrflash);
|
||||
ee_Dump(-page, data);
|
||||
@@ -325,8 +321,7 @@ static bool ee_PageErase(uint16_t page) {
|
||||
uint16_t i;
|
||||
uint32_t addrflash = uint32_t(getFlashStorage(page));
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM PageErase ", page);
|
||||
DEBUG_ECHO_MSG("EEPROM PageErase ", page);
|
||||
DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash);
|
||||
DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0));
|
||||
DEBUG_FLUSH();
|
||||
@@ -370,8 +365,7 @@ static bool ee_PageErase(uint16_t page) {
|
||||
// Reenable interrupts
|
||||
__enable_irq();
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ",page);
|
||||
DEBUG_ECHO_MSG("EEPROM Unlock failure for page ",page);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -394,8 +388,7 @@ static bool ee_PageErase(uint16_t page) {
|
||||
// Reenable interrupts
|
||||
__enable_irq();
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Erase failure for page ",page);
|
||||
DEBUG_ECHO_MSG("EEPROM Erase failure for page ",page);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -410,8 +403,7 @@ static bool ee_PageErase(uint16_t page) {
|
||||
uint32_t * aligned_src = (uint32_t *) addrflash;
|
||||
for (i = 0; i < PageSize >> 2; i++) {
|
||||
if (*aligned_src++ != 0xFFFFFFFF) {
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Verify Erase failure for page ",page);
|
||||
DEBUG_ECHO_MSG("EEPROM Verify Erase failure for page ",page);
|
||||
ee_Dump(page, (uint32_t *)addrflash);
|
||||
return false;
|
||||
}
|
||||
@@ -921,8 +913,7 @@ static void ee_Init() {
|
||||
// If all groups seem to be used, default to first group
|
||||
if (curGroup >= GroupCount) curGroup = 0;
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Current Group: ",curGroup);
|
||||
DEBUG_ECHO_MSG("EEPROM Current Group: ",curGroup);
|
||||
DEBUG_FLUSH();
|
||||
|
||||
// Now, validate that all the other group pages are empty
|
||||
@@ -931,8 +922,7 @@ static void ee_Init() {
|
||||
|
||||
for (int page = 0; page < PagesPerGroup; page++) {
|
||||
if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on group ", grp);
|
||||
DEBUG_ECHO_MSG("EEPROM Page ", page, " not clean on group ", grp);
|
||||
DEBUG_FLUSH();
|
||||
ee_PageErase(grp * PagesPerGroup + page);
|
||||
}
|
||||
@@ -948,15 +938,13 @@ static void ee_Init() {
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Active page: ", curPage);
|
||||
DEBUG_ECHO_MSG("EEPROM Active page: ", curPage);
|
||||
DEBUG_FLUSH();
|
||||
|
||||
// Make sure the pages following the first clean one are also clean
|
||||
for (int page = curPage + 1; page < PagesPerGroup; page++) {
|
||||
if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on active group ", curGroup);
|
||||
DEBUG_ECHO_MSG("EEPROM Page ", page, " not clean on active group ", curGroup);
|
||||
DEBUG_FLUSH();
|
||||
ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
|
||||
ee_PageErase(curGroup * PagesPerGroup + page);
|
||||
|
||||
@@ -25,6 +25,30 @@
|
||||
* Test Arduino Due specific configuration values for errors at compile-time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check for common serial pin conflicts
|
||||
*/
|
||||
#define CHECK_SERIAL_PIN(N) ( \
|
||||
X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \
|
||||
|| X_MIN_PIN == N || Y_MIN_PIN == N || Z_MIN_PIN == N \
|
||||
|| X_MAX_PIN == N || Y_MAX_PIN == N || Z_MAX_PIN == N \
|
||||
|| X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \
|
||||
|| X_DIR_PIN == N || Y_DIR_PIN == N || Z_DIR_PIN == N \
|
||||
|| X_ENA_PIN == N || Y_ENA_PIN == N || Z_ENA_PIN == N \
|
||||
)
|
||||
#if CONF_SERIAL_IS(0) // D0-D1. No known conflicts.
|
||||
#endif
|
||||
#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
|
||||
#error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
|
||||
#endif
|
||||
#if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
|
||||
#error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
|
||||
#endif
|
||||
#if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
|
||||
#error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
|
||||
#endif
|
||||
#undef CHECK_SERIAL_PIN
|
||||
|
||||
/**
|
||||
* HARDWARE VS. SOFTWARE SPI COMPATIBILITY
|
||||
*
|
||||
|
||||
@@ -86,7 +86,6 @@ bool GET_PINMODE(int8_t pin) { // 1: output, 0: input
|
||||
|| pwm_status(pin));
|
||||
}
|
||||
|
||||
|
||||
void pwm_details(int32_t pin) {
|
||||
if (pwm_status(pin)) {
|
||||
uint32_t chan = g_APinDescription[pin].ulPWMChannel;
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../../MarlinCore.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
// Override Arduino runtime to either config or disable the watchdog
|
||||
//
|
||||
// We need to configure the watchdog as soon as possible in the boot
|
||||
// process, because watchdog initialization at hardware reset on SAM3X8E
|
||||
// is unreliable, and there is risk of unintended resets if we delay
|
||||
// that initialization to a later time.
|
||||
void watchdogSetup() {
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
// 4 seconds timeout
|
||||
uint32_t timeout = TERN(WATCHDOG_DURATION_8S, 8000, 4000);
|
||||
|
||||
// Calculate timeout value in WDT counter ticks: This assumes
|
||||
// the slow clock is running at 32.768 kHz watchdog
|
||||
// frequency is therefore 32768 / 128 = 256 Hz
|
||||
timeout = (timeout << 8) / 1000;
|
||||
if (timeout == 0)
|
||||
timeout = 1;
|
||||
else if (timeout > 0xFFF)
|
||||
timeout = 0xFFF;
|
||||
|
||||
// We want to enable the watchdog with the specified timeout
|
||||
uint32_t value =
|
||||
WDT_MR_WDV(timeout) | // With the specified timeout
|
||||
WDT_MR_WDD(timeout) | // and no invalid write window
|
||||
#if !(SAMV70 || SAMV71 || SAME70 || SAMS70)
|
||||
WDT_MR_WDRPROC | // WDT fault resets processor only - We want
|
||||
// to keep PIO controller state
|
||||
#endif
|
||||
WDT_MR_WDDBGHLT | // WDT stops in debug state.
|
||||
WDT_MR_WDIDLEHLT; // WDT stops in idle state.
|
||||
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
// We enable the watchdog timer, but only for the interrupt.
|
||||
|
||||
// Configure WDT to only trigger an interrupt
|
||||
value |= WDT_MR_WDFIEN; // Enable WDT fault interrupt.
|
||||
|
||||
// Disable WDT interrupt (just in case, to avoid triggering it!)
|
||||
NVIC_DisableIRQ(WDT_IRQn);
|
||||
|
||||
// We NEED memory barriers to ensure Interrupts are actually disabled!
|
||||
// ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the )
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Initialize WDT with the given parameters
|
||||
WDT_Enable(WDT, value);
|
||||
|
||||
// Configure and enable WDT interrupt.
|
||||
NVIC_ClearPendingIRQ(WDT_IRQn);
|
||||
NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups
|
||||
NVIC_EnableIRQ(WDT_IRQn);
|
||||
|
||||
#else
|
||||
|
||||
// a WDT fault triggers a reset
|
||||
value |= WDT_MR_WDRSTEN;
|
||||
|
||||
// Initialize WDT with the given parameters
|
||||
WDT_Enable(WDT, value);
|
||||
|
||||
#endif
|
||||
|
||||
// Reset the watchdog
|
||||
WDT_Restart(WDT);
|
||||
|
||||
#else
|
||||
|
||||
// Make sure to completely disable the Watchdog
|
||||
WDT_Disable(WDT);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
// Initialize watchdog - On SAM3X, Watchdog was already configured
|
||||
// and enabled or disabled at startup, so no need to reconfigure it
|
||||
// here.
|
||||
void watchdog_init() {
|
||||
// Reset watchdog to start clean
|
||||
WDT_Restart(WDT);
|
||||
}
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
#endif
|
||||
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// Arduino Due core now has watchdog support
|
||||
|
||||
#include "HAL.h"
|
||||
|
||||
// Initialize watchdog with a 4 second interrupt time
|
||||
void watchdog_init();
|
||||
|
||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
||||
// first watchdog_init or AVR will go into emergency procedures.
|
||||
inline void HAL_watchdog_refresh() { watchdogReset(); }
|
||||
@@ -179,6 +179,31 @@ void _delay_ms(int delay_ms) { delay(delay_ms); }
|
||||
// return free memory between end of heap (or end bss) and whatever is current
|
||||
int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||
|
||||
extern "C" {
|
||||
esp_err_t esp_task_wdt_reset();
|
||||
}
|
||||
|
||||
void watchdogSetup() {
|
||||
// do whatever. don't remove this function.
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
// Reset watchdog.
|
||||
void MarlinHAL::watchdog_refresh() { esp_task_wdt_reset(); }
|
||||
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// ADC
|
||||
// ------------------------
|
||||
@@ -244,7 +269,8 @@ void MarlinHAL::adc_start(const pin_t pin) {
|
||||
const adc1_channel_t chan = get_channel(pin);
|
||||
uint32_t mv;
|
||||
esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv);
|
||||
adc_result = mv * 1023.0f / float(ADC_REFERENCE_VOLTAGE) / 1000.0f;
|
||||
|
||||
adc_result = mv * isr_float_t(1023) / isr_float_t(ADC_REFERENCE_VOLTAGE) / isr_float_t(1000);
|
||||
|
||||
// Change the attenuation level based on the new reading
|
||||
adc_atten_t atten;
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "../shared/HAL_SPI.h"
|
||||
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "i2s.h"
|
||||
|
||||
#if ENABLED(WIFISUPPORT)
|
||||
@@ -74,6 +73,7 @@
|
||||
// Types
|
||||
// ------------------------
|
||||
|
||||
typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs.
|
||||
typedef int16_t pin_t;
|
||||
|
||||
class Servo;
|
||||
@@ -88,7 +88,7 @@ typedef Servo hal_servo_t;
|
||||
//
|
||||
void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration=0);
|
||||
void noTone(const pin_t _pin);
|
||||
|
||||
int8_t get_pwm_channel(const pin_t pin, const uint32_t freq, const uint16_t res);
|
||||
void analogWrite(const pin_t pin, const uint16_t value, const uint32_t freq=PWM_FREQUENCY, const uint16_t res=8);
|
||||
|
||||
//
|
||||
@@ -171,9 +171,13 @@ public:
|
||||
// Earliest possible init, before setup()
|
||||
MarlinHAL() {}
|
||||
|
||||
static void init() {} // Called early in setup()
|
||||
static void init_board(); // Called less early in setup()
|
||||
static void reboot(); // Restart the firmware
|
||||
// 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
|
||||
|
||||
// Interrupts
|
||||
static portMUX_TYPE spinlock;
|
||||
@@ -205,7 +209,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -23,24 +23,17 @@
|
||||
*/
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#if EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1)
|
||||
|
||||
#include <U8glib-HAL.h>
|
||||
#include "Arduino.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "HAL.h"
|
||||
#include "SPI.h"
|
||||
|
||||
static SPISettings spiConfig;
|
||||
|
||||
#define MDOGLCD_MOSI 23
|
||||
#define MDOGLCD_SCK 18
|
||||
#define MLCD_RESET_PIN 0
|
||||
#define MLCD_PINS_DC 4
|
||||
#define MDOGLCD_CS 21
|
||||
#define MDOGLCD_A0 4
|
||||
|
||||
#ifndef LCD_SPI_SPEED
|
||||
#ifdef SD_SPI_SPEED
|
||||
@@ -61,24 +54,24 @@ uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt
|
||||
case U8G_COM_MSG_STOP: break;
|
||||
|
||||
case U8G_COM_MSG_INIT:
|
||||
OUT_WRITE(MDOGLCD_CS, HIGH);
|
||||
OUT_WRITE(MDOGLCD_A0, HIGH);
|
||||
OUT_WRITE(MLCD_RESET_PIN, HIGH);
|
||||
OUT_WRITE(DOGLCD_CS, HIGH);
|
||||
OUT_WRITE(DOGLCD_A0, HIGH);
|
||||
OUT_WRITE(LCD_RESET_PIN, HIGH);
|
||||
u8g_Delay(5);
|
||||
spiBegin();
|
||||
spiInit(LCD_SPI_SPEED);
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
|
||||
WRITE(MDOGLCD_A0, arg_val ? HIGH : LOW);
|
||||
WRITE(DOGLCD_A0, arg_val ? HIGH : LOW);
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_CHIP_SELECT: /* arg_val == 0 means HIGH level of U8G_PI_CS */
|
||||
WRITE(MDOGLCD_CS, arg_val ? LOW : HIGH);
|
||||
WRITE(DOGLCD_CS, arg_val ? LOW : HIGH);
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_RESET:
|
||||
WRITE(MLCD_RESET_PIN, arg_val);
|
||||
WRITE(LCD_RESET_PIN, arg_val);
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_WRITE_BYTE:
|
||||
@@ -96,5 +89,6 @@ uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif // FYSETC_MINI_12864_2_1
|
||||
#endif // EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1)
|
||||
|
||||
#endif // ARDUINO_ARCH_ESP32
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
void watchdogSetup() {
|
||||
// do whatever. don't remove this function.
|
||||
}
|
||||
|
||||
void watchdog_init() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
#endif // ARDUINO_ARCH_ESP32
|
||||
@@ -28,6 +28,7 @@
|
||||
#endif
|
||||
|
||||
#include HAL_PATH(.,HAL.h)
|
||||
extern MarlinHAL hal;
|
||||
|
||||
#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
|
||||
|
||||
@@ -44,7 +45,3 @@
|
||||
#ifndef PGMSTR
|
||||
#define PGMSTR(NAM,STR) const char NAM[] = STR
|
||||
#endif
|
||||
|
||||
inline void watchdog_refresh() {
|
||||
TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
@@ -29,12 +31,10 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "hardware/Clock.h"
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "serial.h"
|
||||
|
||||
// ------------------------
|
||||
@@ -106,9 +106,13 @@ public:
|
||||
// Earliest possible init, before setup()
|
||||
MarlinHAL() {}
|
||||
|
||||
// Watchdog
|
||||
static void watchdog_init() {}
|
||||
static void watchdog_refresh() {}
|
||||
|
||||
static void init() {} // Called early in setup()
|
||||
static void init_board() {} // Called less early in setup()
|
||||
static void reboot(); // Reset the application state and GPIO
|
||||
static void reboot(); // Reset the application state and GPIO
|
||||
|
||||
// Interrupts
|
||||
static bool isr_state() { return true; }
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef __PLAT_LINUX__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||
|
||||
void watchdog_init() {}
|
||||
void HAL_watchdog_refresh() {}
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __PLAT_LINUX__
|
||||
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
void watchdog_init();
|
||||
void HAL_watchdog_refresh();
|
||||
@@ -25,10 +25,6 @@
|
||||
#include "../shared/Delay.h"
|
||||
#include "../../../gcode/parser.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
#include "watchdog.h"
|
||||
#endif
|
||||
|
||||
DefaultSerial1 USBSerial(false, UsbSerial);
|
||||
|
||||
uint32_t MarlinHAL::adc_result = 0;
|
||||
@@ -61,9 +57,7 @@ uint8_t MarlinHAL::get_reset_source() {
|
||||
return RST_POWER_ON;
|
||||
}
|
||||
|
||||
void MarlinHAL::clear_reset_source() {
|
||||
TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag());
|
||||
}
|
||||
void MarlinHAL::clear_reset_source() { watchdog_clear_timeout_flag(); }
|
||||
|
||||
void flashFirmware(const int16_t) {
|
||||
delay(500); // Give OS time to disconnect
|
||||
@@ -72,6 +66,52 @@ void flashFirmware(const int16_t) {
|
||||
hal.reboot();
|
||||
}
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include <lpc17xx_wdt.h>
|
||||
|
||||
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
// We enable the watchdog timer, but only for the interrupt.
|
||||
|
||||
// Configure WDT to only trigger an interrupt
|
||||
// Disable WDT interrupt (just in case, to avoid triggering it!)
|
||||
NVIC_DisableIRQ(WDT_IRQn);
|
||||
|
||||
// We NEED memory barriers to ensure Interrupts are actually disabled!
|
||||
// ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the )
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Configure WDT to only trigger an interrupt
|
||||
// Initialize WDT with the given parameters
|
||||
WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_INT_ONLY);
|
||||
|
||||
// Configure and enable WDT interrupt.
|
||||
NVIC_ClearPendingIRQ(WDT_IRQn);
|
||||
NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups
|
||||
NVIC_EnableIRQ(WDT_IRQn);
|
||||
#else
|
||||
WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET);
|
||||
#endif
|
||||
WDT_Start(WDT_TIMEOUT_US);
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
WDT_Feed();
|
||||
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
||||
TOGGLE(LED_PIN); // heartbeat indicator
|
||||
#endif
|
||||
}
|
||||
|
||||
// Timeout state
|
||||
bool MarlinHAL::watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); }
|
||||
void MarlinHAL::watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); }
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
// For M42/M43, scan command line for pin code
|
||||
// return index into pin map array if found and the pin is valid.
|
||||
// return dval if not found or not a valid pin.
|
||||
|
||||
@@ -38,7 +38,6 @@ extern "C" volatile uint32_t _millis;
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "MarlinSerial.h"
|
||||
|
||||
#include <adc.h>
|
||||
@@ -177,7 +176,7 @@ void flashFirmware(const int16_t);
|
||||
#define CPU_ST7920_DELAY_3 750
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
@@ -199,9 +198,9 @@ public:
|
||||
// Earliest possible init, before setup()
|
||||
MarlinHAL() {}
|
||||
|
||||
static void init(); // Called early in setup()
|
||||
static void init(); // Called early in setup()
|
||||
static void init_board() {} // Called less early in setup()
|
||||
static void reboot(); // Restart the firmware from 0x0
|
||||
static void reboot(); // Restart the firmware from 0x0
|
||||
|
||||
// Interrupts
|
||||
static bool isr_state() { return !__get_PRIMASK(); }
|
||||
@@ -210,6 +209,12 @@ public:
|
||||
|
||||
static void delay_ms(const int ms) { _delay_ms(ms); }
|
||||
|
||||
// Watchdog
|
||||
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
|
||||
static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {});
|
||||
static bool watchdog_timed_out() IF_DISABLED(USE_WATCHDOG, { return false; });
|
||||
static void watchdog_clear_timeout_flag() IF_DISABLED(USE_WATCHDOG, {});
|
||||
|
||||
// Tasks, called from idle()
|
||||
static void idletask();
|
||||
|
||||
@@ -234,7 +239,7 @@ public:
|
||||
FilteredADC::enable_channel(pin);
|
||||
}
|
||||
|
||||
// Begin ADC sampling on the given pin
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static uint32_t adc_result;
|
||||
static void adc_start(const pin_t pin) {
|
||||
adc_result = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
|
||||
#include "../shared/HAL_MinSerial.h"
|
||||
#include "../shared/MinSerial.h"
|
||||
#include <debug_frmwrk.h>
|
||||
|
||||
static void TX(char c) { _DBC(c); }
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#define MARLIN_EEPROM_SIZE 0x8000 // 32KB
|
||||
#define MARLIN_EEPROM_SIZE 0x8000 // 32K
|
||||
#endif
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef TARGET_LPC1768
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include <lpc17xx_wdt.h>
|
||||
#include "watchdog.h"
|
||||
|
||||
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||
|
||||
void watchdog_init() {
|
||||
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
||||
// We enable the watchdog timer, but only for the interrupt.
|
||||
|
||||
// Configure WDT to only trigger an interrupt
|
||||
// Disable WDT interrupt (just in case, to avoid triggering it!)
|
||||
NVIC_DisableIRQ(WDT_IRQn);
|
||||
|
||||
// We NEED memory barriers to ensure Interrupts are actually disabled!
|
||||
// ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the )
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
// Configure WDT to only trigger an interrupt
|
||||
// Initialize WDT with the given parameters
|
||||
WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_INT_ONLY);
|
||||
|
||||
// Configure and enable WDT interrupt.
|
||||
NVIC_ClearPendingIRQ(WDT_IRQn);
|
||||
NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups
|
||||
NVIC_EnableIRQ(WDT_IRQn);
|
||||
#else
|
||||
WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET);
|
||||
#endif
|
||||
WDT_Start(WDT_TIMEOUT_US);
|
||||
}
|
||||
|
||||
void HAL_watchdog_refresh() {
|
||||
WDT_Feed();
|
||||
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
||||
TOGGLE(LED_PIN); // heartbeat indicator
|
||||
#endif
|
||||
}
|
||||
|
||||
// Timeout state
|
||||
bool watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); }
|
||||
void watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); }
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
#endif // TARGET_LPC1768
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
void watchdog_init();
|
||||
void HAL_watchdog_refresh();
|
||||
|
||||
bool watchdog_timed_out();
|
||||
void watchdog_clear_timeout_flag();
|
||||
@@ -45,7 +45,6 @@ uint8_t _getc();
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
#include "serial.h"
|
||||
|
||||
// ------------------------
|
||||
@@ -186,7 +185,7 @@ constexpr inline char* strstr_constexpr(char* str, const char* target) {
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
@@ -208,6 +207,10 @@ 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
|
||||
@@ -242,7 +245,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch);
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const uint8_t ch);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void u8g_SetPinOutput(uint8_t internal_pin_number){SET_DIR_OUTPUT(internal_pin_number);}
|
||||
void u8g_SetPinInput(uint8_t internal_pin_number){SET_DIR_INPUT(internal_pin_number);}
|
||||
void u8g_SetPinLevel(uint8_t pin, uint8_t pin_status){WRITE_PIN(pin, pin_status);}
|
||||
uint8_t u8g_GetPinLevel(uint8_t pin){return READ_PIN(pin);}
|
||||
void usleep(uint64_t microsec){
|
||||
assert(false); // why we here?
|
||||
}
|
||||
|
||||
void u8g_SetPinOutput(uint8_t internal_pin_number) { SET_DIR_OUTPUT(internal_pin_number); }
|
||||
void u8g_SetPinInput(uint8_t internal_pin_number) { SET_DIR_INPUT(internal_pin_number); }
|
||||
void u8g_SetPinLevel(uint8_t pin, uint8_t pin_status) { WRITE_PIN(pin, pin_status); }
|
||||
uint8_t u8g_GetPinLevel(uint8_t pin) { return READ_PIN(pin); }
|
||||
void usleep(uint64_t microsec) { assert(false); /* why we here? */ }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define WDT_TIMEOUT 4000000 // 4 second timeout
|
||||
|
||||
void watchdog_init();
|
||||
void HAL_watchdog_refresh();
|
||||
@@ -203,6 +203,40 @@ enum ADCIndex {
|
||||
ADC_COUNT
|
||||
};
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT_REG TERN(WATCHDOG_DURATION_8S, WDT_CONFIG_PER_CYC8192, WDT_CONFIG_PER_CYC4096) // 4 or 8 second timeout
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
// The low-power oscillator used by the WDT runs at 32,768 Hz with
|
||||
// a 1:32 prescale, thus 1024 Hz, though probably not super precise.
|
||||
|
||||
// Setup WDT clocks
|
||||
MCLK->APBAMASK.bit.OSC32KCTRL_ = true;
|
||||
MCLK->APBAMASK.bit.WDT_ = true;
|
||||
OSC32KCTRL->OSCULP32K.bit.EN1K = true; // Enable out 1K (this is what WDT uses)
|
||||
|
||||
WDT->CTRLA.bit.ENABLE = false; // Disable watchdog for config
|
||||
SYNC(WDT->SYNCBUSY.bit.ENABLE);
|
||||
|
||||
WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt
|
||||
WDT->CONFIG.reg = WDT_TIMEOUT_REG; // Set a 4s or 8s period for chip reset
|
||||
|
||||
hal.watchdog_refresh();
|
||||
|
||||
WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode
|
||||
SYNC(WDT->SYNCBUSY.bit.ENABLE);
|
||||
}
|
||||
|
||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
||||
// first watchdog_init or SAMD will go into emergency procedures.
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
SYNC(WDT->SYNCBUSY.bit.CLEAR); // Test first if previous is 'ongoing' to save time waiting for command execution
|
||||
WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// Types
|
||||
// ------------------------
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#ifdef ADAFRUIT_GRAND_CENTRAL_M4
|
||||
#include "MarlinSerial_AGCM4.h"
|
||||
@@ -157,6 +156,10 @@ 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
|
||||
@@ -190,7 +193,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const uint8_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef __SAMD51__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
#define WDT_TIMEOUT_REG TERN(WATCHDOG_DURATION_8S, WDT_CONFIG_PER_CYC8192, WDT_CONFIG_PER_CYC4096) // 4 or 8 second timeout
|
||||
|
||||
void watchdog_init() {
|
||||
// The low-power oscillator used by the WDT runs at 32,768 Hz with
|
||||
// a 1:32 prescale, thus 1024 Hz, though probably not super precise.
|
||||
|
||||
// Setup WDT clocks
|
||||
MCLK->APBAMASK.bit.OSC32KCTRL_ = true;
|
||||
MCLK->APBAMASK.bit.WDT_ = true;
|
||||
OSC32KCTRL->OSCULP32K.bit.EN1K = true; // Enable out 1K (this is what WDT uses)
|
||||
|
||||
WDT->CTRLA.bit.ENABLE = false; // Disable watchdog for config
|
||||
SYNC(WDT->SYNCBUSY.bit.ENABLE);
|
||||
|
||||
WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt
|
||||
WDT->CONFIG.reg = WDT_TIMEOUT_REG; // Set a 4s or 8s period for chip reset
|
||||
|
||||
HAL_watchdog_refresh();
|
||||
|
||||
WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode
|
||||
SYNC(WDT->SYNCBUSY.bit.ENABLE);
|
||||
}
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
#endif // __SAMD51__
|
||||
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// Initialize watchdog with a 4 second interrupt time
|
||||
void watchdog_init();
|
||||
|
||||
// Reset watchdog. MUST be called at least every 4 seconds after the
|
||||
// first watchdog_init or SAMD will go into emergency procedures.
|
||||
inline void HAL_watchdog_refresh() {
|
||||
SYNC(WDT->SYNCBUSY.bit.CLEAR); // Test first if previous is 'ongoing' to save time waiting for command execution
|
||||
WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY;
|
||||
}
|
||||
@@ -24,14 +24,13 @@
|
||||
|
||||
#ifdef HAL_STM32
|
||||
|
||||
#include "HAL.h"
|
||||
#include "usb_serial.h"
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../shared/Delay.h"
|
||||
|
||||
#include "usb_serial.h"
|
||||
|
||||
#ifdef USBCON
|
||||
DefaultSerial1 MSerial0(false, SerialUSB);
|
||||
DefaultSerial1 MSerialUSB(false, SerialUSB);
|
||||
#endif
|
||||
|
||||
#if ENABLED(SRAM_EEPROM_EMULATION)
|
||||
@@ -141,6 +140,29 @@ uint8_t MarlinHAL::get_reset_source() {
|
||||
|
||||
void MarlinHAL::clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||
|
||||
#include <IWatchdog.h>
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
IF_DISABLED(DISABLE_WATCHDOG_INIT, IWatchdog.begin(WDT_TIMEOUT_US));
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
IWatchdog.reload();
|
||||
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
||||
TOGGLE(LED_PIN); // heartbeat indicator
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
extern unsigned int _ebss; // end of bss section
|
||||
}
|
||||
|
||||
+40
-25
@@ -30,7 +30,6 @@
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
#include "Servo.h"
|
||||
#include "watchdog.h"
|
||||
#include "MarlinSerial.h"
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
@@ -51,57 +50,67 @@
|
||||
#include <USBSerial.h>
|
||||
#include "../../core/serial_hook.h"
|
||||
typedef ForwardSerial1Class< decltype(SerialUSB) > DefaultSerial1;
|
||||
extern DefaultSerial1 MSerial0;
|
||||
extern DefaultSerial1 MSerialUSB;
|
||||
#endif
|
||||
|
||||
#define _MSERIAL(X) MSerial##X
|
||||
#define MSERIAL(X) _MSERIAL(X)
|
||||
|
||||
#if SERIAL_PORT == -1
|
||||
#define MYSERIAL1 MSerial0
|
||||
#elif WITHIN(SERIAL_PORT, 1, 6)
|
||||
#if WITHIN(SERIAL_PORT, 1, 6)
|
||||
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
|
||||
#elif !defined(USBCON)
|
||||
#error "SERIAL_PORT must be from 1 to 6."
|
||||
#elif SERIAL_PORT == -1
|
||||
#define MYSERIAL1 MSerialUSB
|
||||
#else
|
||||
#error "SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB."
|
||||
#error "SERIAL_PORT must be from 1 to 6, or -1 for Native USB."
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL2 MSerial0
|
||||
#elif WITHIN(SERIAL_PORT_2, 1, 6)
|
||||
#if WITHIN(SERIAL_PORT_2, 1, 6)
|
||||
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
|
||||
#elif !defined(USBCON)
|
||||
#error "SERIAL_PORT must be from 1 to 6."
|
||||
#elif SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL2 MSerialUSB
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from 1 to 6. You can also use -1 if the board supports Native USB."
|
||||
#error "SERIAL_PORT_2 must be from 1 to 6, or -1 for Native USB."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_3
|
||||
#if SERIAL_PORT_3 == -1
|
||||
#define MYSERIAL3 MSerial0
|
||||
#elif WITHIN(SERIAL_PORT_3, 1, 6)
|
||||
#if WITHIN(SERIAL_PORT_3, 1, 6)
|
||||
#define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
|
||||
#elif !defined(USBCON)
|
||||
#error "SERIAL_PORT must be from 1 to 6."
|
||||
#elif SERIAL_PORT_3 == -1
|
||||
#define MYSERIAL3 MSerialUSB
|
||||
#else
|
||||
#error "SERIAL_PORT_3 must be from 1 to 6. You can also use -1 if the board supports Native USB."
|
||||
#error "SERIAL_PORT_3 must be from 1 to 6, or -1 for Native USB."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#if MMU2_SERIAL_PORT == -1
|
||||
#define MMU2_SERIAL MSerial0
|
||||
#elif WITHIN(MMU2_SERIAL_PORT, 1, 6)
|
||||
#if WITHIN(MMU2_SERIAL_PORT, 1, 6)
|
||||
#define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
|
||||
#elif !defined(USBCON)
|
||||
#error "SERIAL_PORT must be from 1 to 6."
|
||||
#elif MMU2_SERIAL_PORT == -1
|
||||
#define MMU2_SERIAL MSerialUSB
|
||||
#else
|
||||
#error "MMU2_SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB."
|
||||
#error "MMU2_SERIAL_PORT must be from 1 to 6, or -1 for Native USB."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
#if LCD_SERIAL_PORT == -1
|
||||
#define LCD_SERIAL MSerial0
|
||||
#elif WITHIN(LCD_SERIAL_PORT, 1, 6)
|
||||
#if WITHIN(LCD_SERIAL_PORT, 1, 6)
|
||||
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
|
||||
#elif !defined(USBCON)
|
||||
#error "SERIAL_PORT must be from 1 to 6."
|
||||
#elif LCD_SERIAL_PORT == -1
|
||||
#define LCD_SERIAL MSerialUSB
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be from 1 to 6. You can also use -1 if the board supports Native USB."
|
||||
#error "LCD_SERIAL_PORT must be from 1 to 6, or -1 for Native USB."
|
||||
#endif
|
||||
#if HAS_DGUS_LCD
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
@@ -127,6 +136,8 @@
|
||||
// Types
|
||||
// ------------------------
|
||||
|
||||
typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs.
|
||||
|
||||
#ifdef STM32G0B1xx
|
||||
typedef int32_t pin_t;
|
||||
#else
|
||||
@@ -206,9 +217,13 @@ public:
|
||||
// Earliest possible init, before setup()
|
||||
MarlinHAL() {}
|
||||
|
||||
static void init(); // Called early in setup()
|
||||
// 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
|
||||
static void reboot(); // Restart the firmware from 0x0
|
||||
|
||||
// Interrupts
|
||||
static bool isr_state() { return !__get_PRIMASK(); }
|
||||
@@ -241,7 +256,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) { pinMode(pin, INPUT); }
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin) { adc_result = analogRead(pin); }
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
|
||||
#include "../shared/HAL_MinSerial.h"
|
||||
#include "watchdog.h"
|
||||
#include "../shared/MinSerial.h"
|
||||
|
||||
/* Instruction Synchronization Barrier */
|
||||
#define isb() __asm__ __volatile__ ("isb" : : : "memory")
|
||||
@@ -120,7 +119,7 @@ static void TX(char c) {
|
||||
#if WITHIN(SERIAL_PORT, 1, 6)
|
||||
constexpr uint32_t usart_sr_txe = _BV(7);
|
||||
while (!(regs->SR & usart_sr_txe)) {
|
||||
TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
|
||||
hal.watchdog_refresh();
|
||||
sw_barrier();
|
||||
}
|
||||
regs->DR = c;
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
auto sd2card = diskIODriver();
|
||||
// single block
|
||||
if (blkLen == 1) {
|
||||
watchdog_refresh();
|
||||
hal.watchdog_refresh();
|
||||
sd2card->writeBlock(blkAddr, pBuf);
|
||||
return true;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
// multi block optimization
|
||||
sd2card->writeStart(blkAddr, blkLen);
|
||||
while (blkLen--) {
|
||||
watchdog_refresh();
|
||||
hal.watchdog_refresh();
|
||||
sd2card->writeData(pBuf);
|
||||
pBuf += BLOCK_SIZE;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
auto sd2card = diskIODriver();
|
||||
// single block
|
||||
if (blkLen == 1) {
|
||||
watchdog_refresh();
|
||||
hal.watchdog_refresh();
|
||||
sd2card->readBlock(blkAddr, pBuf);
|
||||
return true;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
// multi block optimization
|
||||
sd2card->readStart(blkAddr);
|
||||
while (blkLen--) {
|
||||
watchdog_refresh();
|
||||
hal.watchdog_refresh();
|
||||
sd2card->readData(pBuf);
|
||||
pBuf += BLOCK_SIZE;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,6 @@
|
||||
// make a list of the Arduino pin numbers in the Port/Pin order
|
||||
//
|
||||
|
||||
#define _PIN_ADD_2(NAME_ALPHA, ARDUINO_NUM) { {NAME_ALPHA}, ARDUINO_NUM },
|
||||
#define _PIN_ADD(NAME_ALPHA, ARDUINO_NUM) { NAME_ALPHA, ARDUINO_NUM },
|
||||
#define PIN_ADD(NAME) _PIN_ADD(#NAME, NAME)
|
||||
|
||||
@@ -108,7 +107,11 @@ const XrefInfo pin_xref[] PROGMEM = {
|
||||
/**
|
||||
* Translation of routines & variables used by pinsDebug.h
|
||||
*/
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
||||
|
||||
#if PA0 >= NUM_DIGITAL_PINS
|
||||
#define HAS_HIGH_ANALOG_PINS 1
|
||||
#endif
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS)
|
||||
#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL)
|
||||
#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads
|
||||
#define PRINT_PIN(Q)
|
||||
@@ -164,17 +167,20 @@ bool GET_PINMODE(const pin_t 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;
|
||||
int8_t digital_pin_to_analog_pin(const pin_t Ard_num) {
|
||||
if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_FIRST + NUM_ANALOG_INPUTS - 1))
|
||||
return Ard_num - NUM_ANALOG_FIRST;
|
||||
|
||||
const uint32_t ind = digitalPinToAnalogInput(Ard_num);
|
||||
return (ind < NUM_ANALOG_INPUTS) ? ind : -1;
|
||||
}
|
||||
|
||||
bool IS_ANALOG(const pin_t Ard_num) {
|
||||
return get_pin_mode(Ard_num) == MODE_PIN_ANALOG;
|
||||
}
|
||||
|
||||
bool is_digital(const pin_t x) {
|
||||
const uint8_t pin_mode = get_pin_mode(pin_array[x].pin);
|
||||
bool is_digital(const pin_t Ard_num) {
|
||||
const uint8_t pin_mode = get_pin_mode(pin_array[Ard_num].pin);
|
||||
return pin_mode == MODE_PIN_INPUT || pin_mode == MODE_PIN_OUTPUT;
|
||||
}
|
||||
|
||||
@@ -200,10 +206,15 @@ void port_print(const pin_t Ard_num) {
|
||||
SERIAL_ECHO_SP(7);
|
||||
|
||||
// Print number to be used with M42
|
||||
sprintf_P(buffer, PSTR(" M42 P%d "), Ard_num);
|
||||
SERIAL_ECHO(buffer);
|
||||
if (Ard_num < 10) SERIAL_CHAR(' ');
|
||||
if (Ard_num < 100) SERIAL_CHAR(' ');
|
||||
int calc_p = Ard_num % (NUM_DIGITAL_PINS + 1);
|
||||
if (Ard_num > NUM_DIGITAL_PINS && calc_p > 7) calc_p += 8;
|
||||
SERIAL_ECHOPGM(" M42 P", calc_p);
|
||||
SERIAL_CHAR(' ');
|
||||
if (calc_p < 100) {
|
||||
SERIAL_CHAR(' ');
|
||||
if (calc_p < 10)
|
||||
SERIAL_CHAR(' ');
|
||||
}
|
||||
}
|
||||
|
||||
bool pwm_status(const pin_t Ard_num) {
|
||||
@@ -225,19 +236,19 @@ void pwm_details(const pin_t Ard_num) {
|
||||
case 'D' : alt_all = GPIOD->AFR[ind]; break;
|
||||
#ifdef PE_0
|
||||
case 'E' : alt_all = GPIOE->AFR[ind]; break;
|
||||
#elif defined (PF_0)
|
||||
#elif defined(PF_0)
|
||||
case 'F' : alt_all = GPIOF->AFR[ind]; break;
|
||||
#elif defined (PG_0)
|
||||
#elif defined(PG_0)
|
||||
case 'G' : alt_all = GPIOG->AFR[ind]; break;
|
||||
#elif defined (PH_0)
|
||||
#elif defined(PH_0)
|
||||
case 'H' : alt_all = GPIOH->AFR[ind]; break;
|
||||
#elif defined (PI_0)
|
||||
#elif defined(PI_0)
|
||||
case 'I' : alt_all = GPIOI->AFR[ind]; break;
|
||||
#elif defined (PJ_0)
|
||||
#elif defined(PJ_0)
|
||||
case 'J' : alt_all = GPIOJ->AFR[ind]; break;
|
||||
#elif defined (PK_0)
|
||||
#elif defined(PK_0)
|
||||
case 'K' : alt_all = GPIOK->AFR[ind]; break;
|
||||
#elif defined (PL_0)
|
||||
#elif defined(PL_0)
|
||||
case 'L' : alt_all = GPIOL->AFR[ind]; break;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ bool SDIO_Init() {
|
||||
|
||||
uint8_t retry_Cnt = retryCnt;
|
||||
for (;;) {
|
||||
TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
|
||||
hal.watchdog_refresh();
|
||||
status = (bool) HAL_SD_Init(&hsd);
|
||||
if (!status) break;
|
||||
if (!--retry_Cnt) return false; // return failing status if retries are exhausted
|
||||
@@ -219,7 +219,7 @@ bool SDIO_Init() {
|
||||
#if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined
|
||||
retry_Cnt = retryCnt;
|
||||
for (;;) {
|
||||
TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
|
||||
hal.watchdog_refresh();
|
||||
if (!HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B)) break; // some cards are only 1 bit wide so a pass here is not required
|
||||
if (!--retry_Cnt) break;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ bool SDIO_Init() {
|
||||
SD_LowLevel_Init();
|
||||
retry_Cnt = retryCnt;
|
||||
for (;;) {
|
||||
TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
|
||||
hal.watchdog_refresh();
|
||||
status = (bool) HAL_SD_Init(&hsd);
|
||||
if (!status) break;
|
||||
if (!--retry_Cnt) return false; // return failing status if retries are exhausted
|
||||
@@ -243,7 +243,7 @@ bool SDIO_Init() {
|
||||
static bool SDIO_ReadWriteBlock_DMA(uint32_t block, const uint8_t *src, uint8_t *dst) {
|
||||
if (HAL_SD_GetCardState(&hsd) != HAL_SD_CARD_TRANSFER) return false;
|
||||
|
||||
TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
|
||||
hal.watchdog_refresh();
|
||||
|
||||
HAL_StatusTypeDef ret;
|
||||
if (src) {
|
||||
|
||||
@@ -303,16 +303,16 @@ enum TimerPurpose { TP_SERIAL, TP_TONE, TP_SERVO, TP_STEP, TP_TEMP };
|
||||
// This cannot yet account for timers used for PWM output, such as for fans.
|
||||
static constexpr struct { TimerPurpose p; int t; } timers_in_use[] = {
|
||||
#if HAS_TMC_SW_SERIAL
|
||||
{TP_SERIAL, get_timer_num_from_base_address(timer_serial[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h
|
||||
{ TP_SERIAL, get_timer_num_from_base_address(timer_serial[0]) }, // Set in variant.h, or as a define in platformio.h if not present in variant.h
|
||||
#endif
|
||||
#if ENABLED(SPEAKER)
|
||||
{TP_TONE, get_timer_num_from_base_address(timer_tone[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h
|
||||
{ TP_TONE, get_timer_num_from_base_address(timer_tone[0]) }, // Set in variant.h, or as a define in platformio.h if not present in variant.h
|
||||
#endif
|
||||
#if HAS_SERVOS
|
||||
{TP_SERVO, get_timer_num_from_base_address(timer_servo[0])}, // Set in variant.h, or as a define in platformio.h if not present in variant.h
|
||||
{ TP_SERVO, get_timer_num_from_base_address(timer_servo[0]) }, // Set in variant.h, or as a define in platformio.h if not present in variant.h
|
||||
#endif
|
||||
{TP_STEP, STEP_TIMER},
|
||||
{TP_TEMP, TEMP_TIMER},
|
||||
{ TP_STEP, STEP_TIMER },
|
||||
{ TP_TEMP, TEMP_TIMER },
|
||||
};
|
||||
|
||||
static constexpr bool verify_no_timer_conflicts() {
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef HAL_STM32
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "watchdog.h"
|
||||
#include <IWatchdog.h>
|
||||
|
||||
void watchdog_init() {
|
||||
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||
IWatchdog.begin(WDT_TIMEOUT_US);
|
||||
#endif
|
||||
}
|
||||
|
||||
void HAL_watchdog_refresh() {
|
||||
IWatchdog.reload();
|
||||
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
||||
TOGGLE(LED_PIN); // heartbeat indicator
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
#endif // HAL_STM32
|
||||
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
void watchdog_init();
|
||||
void HAL_watchdog_refresh();
|
||||
@@ -83,6 +83,7 @@
|
||||
// ------------------------
|
||||
|
||||
#if defined(SERIAL_USB) && !HAS_SD_HOST_DRIVE
|
||||
|
||||
USBSerial SerialUSB;
|
||||
DefaultSerial1 MSerial0(true, SerialUSB);
|
||||
|
||||
@@ -112,6 +113,47 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include <libmaple/iwdg.h>
|
||||
|
||||
void watchdogSetup() {
|
||||
// do whatever. don't remove this function.
|
||||
}
|
||||
|
||||
/**
|
||||
* The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0).
|
||||
*/
|
||||
#define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout
|
||||
|
||||
/**
|
||||
* @brief Initialize the independent hardware watchdog.
|
||||
*
|
||||
* @return No return
|
||||
*
|
||||
* @details The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0).
|
||||
*/
|
||||
void MarlinHAL::watchdog_init() {
|
||||
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||
iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Reset watchdog. MUST be called every 4 or 8 seconds after the
|
||||
// first watchdog_init or the STM32F1 will reset.
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
||||
TOGGLE(LED_PIN); // heartbeat indicator
|
||||
#endif
|
||||
iwdg_feed();
|
||||
}
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
// ------------------------
|
||||
// ADC
|
||||
// ------------------------
|
||||
@@ -211,6 +253,10 @@ void MarlinHAL::idletask() {
|
||||
|
||||
void MarlinHAL::reboot() { nvic_sys_reset(); }
|
||||
|
||||
// ------------------------
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
extern "C" {
|
||||
extern unsigned int _ebss; // end of bss section
|
||||
}
|
||||
@@ -243,9 +289,9 @@ extern "C" {
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// ------------------------
|
||||
// ADC
|
||||
//
|
||||
// ------------------------
|
||||
|
||||
enum ADCIndex : uint8_t {
|
||||
OPTITEM(HAS_TEMP_ADC_0, TEMP_0)
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "../shared/HAL_SPI.h"
|
||||
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <util/atomic.h>
|
||||
@@ -247,6 +246,10 @@ 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
|
||||
@@ -280,7 +283,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) { pinMode(pin, INPUT_ANALOG); }
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
|
||||
#include "../shared/HAL_MinSerial.h"
|
||||
#include "watchdog.h"
|
||||
#include "../shared/MinSerial.h"
|
||||
|
||||
#include <libmaple/usart.h>
|
||||
#include <libmaple/rcc.h>
|
||||
@@ -82,7 +81,7 @@ static void TX(char c) {
|
||||
#if WITHIN(SERIAL_PORT, 1, 6)
|
||||
struct usart_dev* dev = MYSERIAL1.c_dev();
|
||||
while (!(dev->regs->SR & USART_SR_TXE)) {
|
||||
TERN_(USE_WATCHDOG, HAL_watchdog_refresh());
|
||||
hal.watchdog_refresh();
|
||||
sw_barrier();
|
||||
}
|
||||
dev->regs->DR = c;
|
||||
@@ -30,7 +30,7 @@ SPIClass TFT_SPI::SPIx(1);
|
||||
|
||||
void TFT_SPI::Init() {
|
||||
#if PIN_EXISTS(TFT_RESET)
|
||||
OUT_WRITE(TFT_RST_PIN, HIGH);
|
||||
OUT_WRITE(TFT_RESET_PIN, HIGH);
|
||||
delay(100);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
|
||||
*/
|
||||
|
||||
#ifdef __STM32F1__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include <libmaple/iwdg.h>
|
||||
#include "watchdog.h"
|
||||
|
||||
/**
|
||||
* The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0).
|
||||
*/
|
||||
#define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout
|
||||
|
||||
void HAL_watchdog_refresh() {
|
||||
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
||||
TOGGLE(LED_PIN); // heartbeat indicator
|
||||
#endif
|
||||
iwdg_feed();
|
||||
}
|
||||
|
||||
void watchdogSetup() {
|
||||
// do whatever. don't remove this function.
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialized the independent hardware watchdog.
|
||||
*
|
||||
* @return No return
|
||||
*
|
||||
* @details The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0).
|
||||
*/
|
||||
void watchdog_init() {
|
||||
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||
iwdg_init(IWDG_PRE_256, STM32F1_WD_RELOAD);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
#endif // __STM32F1__
|
||||
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
|
||||
*/
|
||||
|
||||
#include <libmaple/iwdg.h>
|
||||
|
||||
// Initialize watchdog with a 4 or 8 second countdown time
|
||||
void watchdog_init();
|
||||
|
||||
// Reset watchdog. MUST be called every 4 or 8 seconds after the
|
||||
// first watchdog_init or the STM32F1 will reset.
|
||||
void HAL_watchdog_refresh();
|
||||
@@ -44,25 +44,6 @@
|
||||
#endif
|
||||
USBSerialType USBSerial(false, SerialUSB);
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// ------------------------
|
||||
|
||||
extern "C" {
|
||||
extern char __bss_end;
|
||||
extern char __heap_start;
|
||||
extern void* __brkval;
|
||||
|
||||
int freeMemory() {
|
||||
int free_memory;
|
||||
if ((int)__brkval == 0)
|
||||
free_memory = ((int)&free_memory) - ((int)&__bss_end);
|
||||
else
|
||||
free_memory = ((int)&free_memory) - ((int)__brkval);
|
||||
return free_memory;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// MarlinHAL Class
|
||||
// ------------------------
|
||||
@@ -81,7 +62,31 @@ uint8_t MarlinHAL::get_reset_source() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
WDOG_TOVALH = 0;
|
||||
WDOG_TOVALL = WDT_TIMEOUT_MS;
|
||||
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
// Watchdog refresh sequence
|
||||
WDOG_REFRESH = 0xA602;
|
||||
WDOG_REFRESH = 0xB480;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
void MarlinHAL::adc_init() {
|
||||
analog_init();
|
||||
@@ -102,4 +107,23 @@ void MarlinHAL::adc_start(const pin_t pin) {
|
||||
|
||||
uint16_t MarlinHAL::adc_value() { return ADC0_RA; }
|
||||
|
||||
// ------------------------
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
extern "C" {
|
||||
extern char __bss_end;
|
||||
extern char __heap_start;
|
||||
extern void* __brkval;
|
||||
|
||||
int freeMemory() {
|
||||
int free_memory;
|
||||
if ((int)__brkval == 0)
|
||||
free_memory = ((int)&free_memory) - ((int)&__bss_end);
|
||||
else
|
||||
free_memory = ((int)&free_memory) - ((int)__brkval);
|
||||
return free_memory;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __MK20DX256__
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "../shared/HAL_SPI.h"
|
||||
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -135,6 +134,10 @@ 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
|
||||
@@ -166,7 +169,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t ch) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given channel. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t ch);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef __MK20DX256__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout
|
||||
|
||||
void watchdog_init() {
|
||||
WDOG_TOVALH = 0;
|
||||
WDOG_TOVALL = WDT_TIMEOUT_MS;
|
||||
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
|
||||
}
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
#endif // __MK20DX256__
|
||||
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "HAL.h"
|
||||
|
||||
// Arduino Due core now has watchdog support
|
||||
|
||||
void watchdog_init();
|
||||
|
||||
inline void HAL_watchdog_refresh() {
|
||||
// Watchdog refresh sequence
|
||||
WDOG_REFRESH = 0xA602;
|
||||
WDOG_REFRESH = 0xB480;
|
||||
}
|
||||
@@ -43,33 +43,12 @@
|
||||
|
||||
USBSerialType USBSerial(false, SerialUSB);
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// ------------------------
|
||||
|
||||
extern "C" {
|
||||
extern char __bss_end;
|
||||
extern char __heap_start;
|
||||
extern void* __brkval;
|
||||
|
||||
int freeMemory() {
|
||||
int free_memory;
|
||||
if ((int)__brkval == 0)
|
||||
free_memory = ((int)&free_memory) - ((int)&__bss_end);
|
||||
else
|
||||
free_memory = ((int)&free_memory) - ((int)__brkval);
|
||||
return free_memory;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// MarlinHAL Class
|
||||
// ------------------------
|
||||
|
||||
void MarlinHAL::reboot() { _reboot_Teensyduino_(); }
|
||||
|
||||
// Reset
|
||||
|
||||
uint8_t MarlinHAL::get_reset_source() {
|
||||
switch (RCM_SRS0) {
|
||||
case 128: return RST_POWER_ON; break;
|
||||
@@ -82,7 +61,31 @@ uint8_t MarlinHAL::get_reset_source() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
WDOG_TOVALH = 0;
|
||||
WDOG_TOVALL = WDT_TIMEOUT_MS;
|
||||
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
// Watchdog refresh sequence
|
||||
WDOG_REFRESH = 0xA602;
|
||||
WDOG_REFRESH = 0xB480;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
int8_t MarlinHAL::adc_select;
|
||||
|
||||
@@ -131,4 +134,23 @@ uint16_t MarlinHAL::adc_value() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
extern "C" {
|
||||
extern char __bss_end;
|
||||
extern char __heap_start;
|
||||
extern void* __brkval;
|
||||
|
||||
int freeMemory() {
|
||||
int free_memory;
|
||||
if ((int)__brkval == 0)
|
||||
free_memory = ((int)&free_memory) - ((int)&__bss_end);
|
||||
else
|
||||
free_memory = ((int)&free_memory) - ((int)__brkval);
|
||||
return free_memory;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __MK64FX512__ || __MK66FX1M0__
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "../shared/HAL_SPI.h"
|
||||
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <util/atomic.h>
|
||||
@@ -118,7 +117,7 @@ typedef int8_t pin_t;
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
@@ -140,6 +139,10 @@ 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
|
||||
@@ -173,7 +176,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout
|
||||
|
||||
void watchdog_init() {
|
||||
WDOG_TOVALH = 0;
|
||||
WDOG_TOVALL = WDT_TIMEOUT_MS;
|
||||
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
|
||||
}
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
|
||||
#endif // __MK64FX512__ || __MK66FX1M0__
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
void watchdog_init();
|
||||
|
||||
inline void HAL_watchdog_refresh() {
|
||||
// Watchdog refresh sequence
|
||||
WDOG_REFRESH = 0xA602;
|
||||
WDOG_REFRESH = 0xB480;
|
||||
}
|
||||
@@ -44,25 +44,6 @@
|
||||
#endif
|
||||
USBSerialType USBSerial(false, SerialUSB);
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// ------------------------
|
||||
|
||||
#define __bss_end _ebss
|
||||
|
||||
extern "C" {
|
||||
extern char __bss_end;
|
||||
extern char __heap_start;
|
||||
extern void* __brkval;
|
||||
|
||||
// Doesn't work on Teensy 4.x
|
||||
uint32_t freeMemory() {
|
||||
uint32_t free_memory;
|
||||
free_memory = ((uint32_t)&free_memory) - (((uint32_t)__brkval) ?: ((uint32_t)&__bss_end));
|
||||
return free_memory;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// FastIO
|
||||
// ------------------------
|
||||
@@ -97,7 +78,34 @@ void MarlinHAL::clear_reset_source() {
|
||||
SRC_SRSR = reset_source;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT TERN(WATCHDOG_DURATION_8S, 8, 4) // 4 or 8 second timeout
|
||||
|
||||
constexpr uint8_t timeoutval = (WDT_TIMEOUT - 0.5f) / 0.5f;
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
CCM_CCGR3 |= CCM_CCGR3_WDOG1(3); // enable WDOG1 clocks
|
||||
WDOG1_WMCR = 0; // disable power down PDE
|
||||
WDOG1_WCR |= WDOG_WCR_SRS | WDOG_WCR_WT(timeoutval);
|
||||
WDOG1_WCR |= WDOG_WCR_WDE | WDOG_WCR_WDT | WDOG_WCR_SRE;
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
// Watchdog refresh sequence
|
||||
WDOG1_WSR = 0x5555;
|
||||
WDOG1_WSR = 0xAAAA;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
int8_t MarlinHAL::adc_select;
|
||||
|
||||
@@ -180,4 +188,23 @@ uint16_t MarlinHAL::adc_value() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#define __bss_end _ebss
|
||||
|
||||
extern "C" {
|
||||
extern char __bss_end;
|
||||
extern char __heap_start;
|
||||
extern void* __brkval;
|
||||
|
||||
// Doesn't work on Teensy 4.x
|
||||
uint32_t freeMemory() {
|
||||
uint32_t free_memory;
|
||||
free_memory = ((uint32_t)&free_memory) - (((uint32_t)__brkval) ?: ((uint32_t)&__bss_end));
|
||||
return free_memory;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __IMXRT1062__
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "../shared/HAL_SPI.h"
|
||||
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <util/atomic.h>
|
||||
@@ -140,7 +139,7 @@ typedef int8_t pin_t;
|
||||
bool is_output(pin_t pin);
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// Free Memory Accessor
|
||||
// ------------------------
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
@@ -162,6 +161,10 @@ 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
|
||||
@@ -195,7 +198,7 @@ public:
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin) {}
|
||||
|
||||
// Begin ADC sampling on the given channel
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef __IMXRT1062__
|
||||
|
||||
/**
|
||||
* HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A)
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
#define WDT_TIMEOUT TERN(WATCHDOG_DURATION_8S, 8, 4) // 4 or 8 second timeout
|
||||
|
||||
constexpr uint8_t timeoutval = (WDT_TIMEOUT - 0.5f) / 0.5f;
|
||||
|
||||
void watchdog_init() {
|
||||
CCM_CCGR3 |= CCM_CCGR3_WDOG1(3); // enable WDOG1 clocks
|
||||
WDOG1_WMCR = 0; // disable power down PDE
|
||||
WDOG1_WCR |= WDOG_WCR_SRS | WDOG_WCR_WT(timeoutval);
|
||||
WDOG1_WCR |= WDOG_WCR_WDE | WDOG_WCR_WDT | WDOG_WCR_SRE;
|
||||
}
|
||||
|
||||
void HAL_watchdog_refresh() {
|
||||
// Watchdog refresh sequence
|
||||
WDOG1_WSR = 0x5555;
|
||||
WDOG1_WSR = 0xAAAA;
|
||||
}
|
||||
|
||||
#endif // USE_WATCHDOG
|
||||
#endif // __IMXRT1062__
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A)
|
||||
*/
|
||||
|
||||
void watchdog_init();
|
||||
|
||||
void HAL_watchdog_refresh();
|
||||
@@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "HAL_MinSerial.h"
|
||||
#include "MinSerial.h"
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "unwinder.h"
|
||||
#include "unwmemaccess.h"
|
||||
|
||||
#include "../HAL_MinSerial.h"
|
||||
#include "../MinSerial.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
// Dump a backtrace entry
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
#include "exception_hook.h"
|
||||
#include "../backtrace/backtrace.h"
|
||||
#include "../HAL_MinSerial.h"
|
||||
#include "../MinSerial.h"
|
||||
|
||||
#define HW_REG(X) (*((volatile unsigned long *)(X)))
|
||||
|
||||
@@ -221,7 +221,7 @@ bool resume_from_fault() {
|
||||
// So we'll just need to refresh the watchdog for a while and then stop for the system to reboot
|
||||
uint32_t last = start;
|
||||
while (PENDING(last, end)) {
|
||||
watchdog_refresh();
|
||||
hal.watchdog_refresh();
|
||||
while (millis() == last) { /* nada */ }
|
||||
last = millis();
|
||||
MinSerial::TX('.');
|
||||
|
||||
+24
-15
@@ -97,7 +97,7 @@
|
||||
#include "feature/host_actions.h"
|
||||
#endif
|
||||
|
||||
#if USE_BEEPER
|
||||
#if HAS_BEEPER
|
||||
#include "libs/buzzer.h"
|
||||
#endif
|
||||
|
||||
@@ -271,6 +271,7 @@ bool wait_for_heatup = true;
|
||||
while (wait_for_user && !(ms && ELAPSED(millis(), ms)))
|
||||
idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep));
|
||||
wait_for_user = false;
|
||||
while (ui.button_pressed()) safe_delay(50);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -320,6 +321,10 @@ bool pin_is_protected(const pin_t pin) {
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
bool printer_busy() {
|
||||
return planner.movesplanned() || printingIsActive();
|
||||
}
|
||||
|
||||
/**
|
||||
* A Print Job exists when the timer is running or SD is printing
|
||||
*/
|
||||
@@ -412,7 +417,9 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
||||
if (do_reset_timeout) gcode.reset_stepper_timeout(ms);
|
||||
|
||||
if (gcode.stepper_max_timed_out(ms)) {
|
||||
SERIAL_ERROR_MSG(STR_KILL_INACTIVE_TIME, parser.command_ptr);
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOPGM(STR_KILL_PRE);
|
||||
SERIAL_ECHOLNPGM(STR_KILL_INACTIVE_TIME, parser.command_ptr);
|
||||
kill();
|
||||
}
|
||||
|
||||
@@ -441,7 +448,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
||||
TERN_(DISABLE_INACTIVE_W, stepper.disable_axis(W_AXIS));
|
||||
TERN_(DISABLE_INACTIVE_E, stepper.disable_e_steppers());
|
||||
|
||||
TERN_(AUTO_BED_LEVELING_UBL, ubl.steppers_were_disabled());
|
||||
TERN_(AUTO_BED_LEVELING_UBL, bedlevel.steppers_were_disabled());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -473,7 +480,9 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
||||
// KILL the machine
|
||||
// ----------------------------------------------------------------
|
||||
if (killCount >= KILL_DELAY) {
|
||||
SERIAL_ERROR_MSG(STR_KILL_BUTTON);
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOPGM(STR_KILL_PRE);
|
||||
SERIAL_ECHOLNPGM(STR_KILL_BUTTON);
|
||||
kill();
|
||||
}
|
||||
#endif
|
||||
@@ -822,7 +831,7 @@ void idle(bool no_stepper_sleep/*=false*/) {
|
||||
TERN_(PRINTCOUNTER, print_job_timer.tick());
|
||||
|
||||
// Update the Beeper queue
|
||||
TERN_(USE_BEEPER, buzzer.tick());
|
||||
TERN_(HAS_BEEPER, buzzer.tick());
|
||||
|
||||
// Handle UI input / draw events
|
||||
TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update());
|
||||
@@ -881,7 +890,7 @@ void kill(FSTR_P const lcd_error/*=nullptr*/, FSTR_P const lcd_component/*=nullp
|
||||
// Echo the LCD message to serial for extra context
|
||||
if (lcd_error) { SERIAL_ECHO_START(); SERIAL_ECHOLNF(lcd_error); }
|
||||
|
||||
#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
|
||||
#if HAS_DISPLAY
|
||||
ui.kill_screen(lcd_error ?: GET_TEXT_F(MSG_KILLED), lcd_component ?: FPSTR(NUL_STR));
|
||||
#else
|
||||
UNUSED(lcd_error); UNUSED(lcd_component);
|
||||
@@ -925,18 +934,18 @@ void minkill(const bool steppers_off/*=false*/) {
|
||||
|
||||
// Wait for both KILL and ENC to be released
|
||||
while (TERN0(HAS_KILL, kill_state()) || TERN0(SOFT_RESET_ON_KILL, ui.button_pressed()))
|
||||
watchdog_refresh();
|
||||
hal.watchdog_refresh();
|
||||
|
||||
// Wait for either KILL or ENC to be pressed again
|
||||
while (TERN1(HAS_KILL, !kill_state()) && TERN1(SOFT_RESET_ON_KILL, !ui.button_pressed()))
|
||||
watchdog_refresh();
|
||||
hal.watchdog_refresh();
|
||||
|
||||
// Reboot the board
|
||||
hal.reboot();
|
||||
|
||||
#else
|
||||
|
||||
for (;;) watchdog_refresh(); // Wait for RESET button or power-cycle
|
||||
for (;;) hal.watchdog_refresh(); // Wait for RESET button or power-cycle
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -1282,7 +1291,7 @@ void setup() {
|
||||
calibrate_delay_loop();
|
||||
|
||||
// Init buzzer pin(s)
|
||||
#if USE_BEEPER
|
||||
#if HAS_BEEPER
|
||||
SETUP_RUN(buzzer.init());
|
||||
#endif
|
||||
|
||||
@@ -1552,7 +1561,7 @@ void setup() {
|
||||
#endif
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
SETUP_RUN(watchdog_init()); // Reinit watchdog after hal.get_reset_source call
|
||||
SETUP_RUN(hal.watchdog_init()); // Reinit watchdog after hal.get_reset_source call
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
|
||||
@@ -1568,10 +1577,6 @@ void setup() {
|
||||
SETUP_RUN(hostui.prompt_end());
|
||||
#endif
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)
|
||||
SETUP_RUN(test_tmc_connection());
|
||||
#endif
|
||||
|
||||
#if HAS_DRIVER_SAFE_POWER_PROTECT
|
||||
SETUP_RUN(stepper_driver_backward_report());
|
||||
#endif
|
||||
@@ -1629,6 +1634,10 @@ void setup() {
|
||||
SETUP_RUN(easythreed_ui.init());
|
||||
#endif
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG && DISABLED(PSU_DEFAULT_OFF)
|
||||
SETUP_RUN(test_tmc_connection());
|
||||
#endif
|
||||
|
||||
marlin_state = MF_RUNNING;
|
||||
|
||||
SETUP_LOG("setup() completed.");
|
||||
|
||||
@@ -61,6 +61,8 @@ bool printJobOngoing();
|
||||
bool printingIsPaused();
|
||||
void startOrResumeJob();
|
||||
|
||||
bool printer_busy();
|
||||
|
||||
extern bool wait_for_heatup;
|
||||
|
||||
#if HAS_RESUME_CONTINUE
|
||||
|
||||
+35
-32
@@ -228,33 +228,33 @@
|
||||
#define BOARD_RAMPS_14_RE_ARM_EFF 2002 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1)
|
||||
#define BOARD_RAMPS_14_RE_ARM_EEF 2003 // Re-ARM with RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan)
|
||||
#define BOARD_RAMPS_14_RE_ARM_SF 2004 // Re-ARM with RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
|
||||
#define BOARD_MKS_SBASE 2005 // MKS-Sbase (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_MKS_SBASE 2005 // MKS-Sbase
|
||||
#define BOARD_AZSMZ_MINI 2006 // AZSMZ Mini
|
||||
#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4 (Power outputs: Hotend, Fan, Bed)
|
||||
#define BOARD_SELENA_COMPACT 2008 // Selena Compact (Power outputs: Hotend0, Hotend1, Bed0, Bed1, Fan0, Fan1)
|
||||
#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0 (Power outputs: Hotend0, Fan, Bed, SPI Driver)
|
||||
#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_BIQU_BQ111_A4 2007 // BIQU BQ111-A4
|
||||
#define BOARD_SELENA_COMPACT 2008 // Selena Compact
|
||||
#define BOARD_BIQU_B300_V1_0 2009 // BIQU B300_V1.0
|
||||
#define BOARD_MKS_SGEN_L 2010 // MKS-SGen-L
|
||||
#define BOARD_GMARSH_X6_REV1 2011 // GMARSH X6, revision 1 prototype
|
||||
#define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1
|
||||
#define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3
|
||||
#define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4
|
||||
|
||||
//
|
||||
// LPC1769 ARM Cortex M3
|
||||
//
|
||||
|
||||
#define BOARD_MKS_SGEN 2500 // MKS-SGen (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini (Power outputs: Hotend0, Bed, Fan)
|
||||
#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi (Power outputs: Hotend0, Bed, Fan)
|
||||
#define BOARD_MKS_SGEN 2500 // MKS-SGen
|
||||
#define BOARD_AZTEEG_X5_GT 2501 // Azteeg X5 GT
|
||||
#define BOARD_AZTEEG_X5_MINI 2502 // Azteeg X5 Mini
|
||||
#define BOARD_AZTEEG_X5_MINI_WIFI 2503 // Azteeg X5 Mini Wifi
|
||||
#define BOARD_COHESION3D_REMIX 2504 // Cohesion3D ReMix
|
||||
#define BOARD_COHESION3D_MINI 2505 // Cohesion3D Mini
|
||||
#define BOARD_SMOOTHIEBOARD 2506 // Smoothieboard
|
||||
#define BOARD_TH3D_EZBOARD 2507 // TH3D EZBoard v1.0
|
||||
#define BOARD_BTT_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_MKS_SGEN_L_V2 2509 // MKS SGEN_L V2 (Power outputs: Hotend0, Hotend1, Bed, Fan)
|
||||
#define BOARD_BTT_SKR_E3_TURBO 2510 // BigTreeTech SKR E3 Turbo (Power outputs: Hotend0, Hotend1, Bed, Fan0, Fan1)
|
||||
#define BOARD_FLY_CDY 2511 // FLYmaker FLY CDY (Power outputs: Hotend0, Hotend1, Hotend2, Bed, Fan0, Fan1, Fan2)
|
||||
#define BOARD_BTT_SKR_V1_4_TURBO 2508 // BigTreeTech SKR v1.4 TURBO
|
||||
#define BOARD_MKS_SGEN_L_V2 2509 // MKS SGEN_L V2
|
||||
#define BOARD_BTT_SKR_E3_TURBO 2510 // BigTreeTech SKR E3 Turbo
|
||||
#define BOARD_FLY_CDY 2511 // FLYmaker FLY CDY
|
||||
|
||||
//
|
||||
// SAM3X8E ARM Cortex M3
|
||||
@@ -280,8 +280,8 @@
|
||||
#define BOARD_RAMPS4DUE_EFF 3017 // RAMPS4DUE (Power outputs: Hotend, Fan0, Fan1)
|
||||
#define BOARD_RAMPS4DUE_EEF 3018 // RAMPS4DUE (Power outputs: Hotend0, Hotend1, Fan)
|
||||
#define BOARD_RAMPS4DUE_SF 3019 // RAMPS4DUE (Power outputs: Spindle, Controller Fan)
|
||||
#define BOARD_RURAMPS4D_11 3020 // RuRAMPS4Duo v1.1 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed)
|
||||
#define BOARD_RURAMPS4D_13 3021 // RuRAMPS4Duo v1.3 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed)
|
||||
#define BOARD_RURAMPS4D_11 3020 // RuRAMPS4Duo v1.1
|
||||
#define BOARD_RURAMPS4D_13 3021 // RuRAMPS4Duo v1.3
|
||||
#define BOARD_ULTRATRONICS_PRO 3022 // ReprapWorld Ultratronics Pro V1.0
|
||||
#define BOARD_ARCHIM1 3023 // UltiMachine Archim1 (with DRV8825 drivers)
|
||||
#define BOARD_ARCHIM2 3024 // UltiMachine Archim2 (with TMC2130 drivers)
|
||||
@@ -293,7 +293,7 @@
|
||||
// SAM3X8C ARM Cortex M3
|
||||
//
|
||||
|
||||
#define BOARD_PRINTRBOARD_G2 3100 // PRINTRBOARD G2
|
||||
#define BOARD_PRINTRBOARD_G2 3100 // Printrboard G2
|
||||
#define BOARD_ADSK 3101 // Arduino DUE Shield Kit (ADSK)
|
||||
|
||||
//
|
||||
@@ -352,19 +352,20 @@
|
||||
#define BOARD_CREALITY_V431_D 4049 // Creality v4.3.1d (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_CREALITY_V452 4050 // Creality v4.5.2 (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_CREALITY_V453 4051 // Creality v4.5.3 (STM32F103RC / STM32F103RE)
|
||||
#define BOARD_CREALITY_V24S1 4052 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender 7
|
||||
#define BOARD_CREALITY_V24S1_301 4053 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) as found in the Ender 3 S1
|
||||
#define BOARD_TRIGORILLA_PRO 4054 // Trigorilla Pro (STM32F103ZE)
|
||||
#define BOARD_FLY_MINI 4055 // FLYmaker FLY MINI (STM32F103RC)
|
||||
#define BOARD_FLSUN_HISPEED 4056 // FLSUN HiSpeedV1 (STM32F103VE)
|
||||
#define BOARD_BEAST 4057 // STM32F103RE Libmaple-based controller
|
||||
#define BOARD_MINGDA_MPX_ARM_MINI 4058 // STM32F103ZE Mingda MD-16
|
||||
#define BOARD_GTM32_PRO_VD 4059 // STM32F103VE controller
|
||||
#define BOARD_ZONESTAR_ZM3E2 4060 // Zonestar ZM3E2 (STM32F103RC)
|
||||
#define BOARD_ZONESTAR_ZM3E4 4061 // Zonestar ZM3E4 V1 (STM32F103VC)
|
||||
#define BOARD_ZONESTAR_ZM3E4V2 4062 // Zonestar ZM3E4 V2 (STM32F103VC)
|
||||
#define BOARD_ERYONE_ERY32_MINI 4063 // Eryone Ery32 mini (STM32F103VE)
|
||||
#define BOARD_PANDA_PI_V29 4064 // Panda Pi V2.9 - Standalone (STM32F103RC)
|
||||
#define BOARD_CREALITY_V24S1 4052 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7
|
||||
#define BOARD_CREALITY_V24S1_301 4053 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1
|
||||
#define BOARD_CREALITY_V25S1 4054 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
|
||||
#define BOARD_TRIGORILLA_PRO 4055 // Trigorilla Pro (STM32F103ZE)
|
||||
#define BOARD_FLY_MINI 4056 // FLYmaker FLY MINI (STM32F103RC)
|
||||
#define BOARD_FLSUN_HISPEED 4057 // FLSUN HiSpeedV1 (STM32F103VE)
|
||||
#define BOARD_BEAST 4058 // STM32F103RE Libmaple-based controller
|
||||
#define BOARD_MINGDA_MPX_ARM_MINI 4059 // STM32F103ZE Mingda MD-16
|
||||
#define BOARD_GTM32_PRO_VD 4060 // STM32F103VE controller
|
||||
#define BOARD_ZONESTAR_ZM3E2 4061 // Zonestar ZM3E2 (STM32F103RC)
|
||||
#define BOARD_ZONESTAR_ZM3E4 4062 // Zonestar ZM3E4 V1 (STM32F103VC)
|
||||
#define BOARD_ZONESTAR_ZM3E4V2 4063 // Zonestar ZM3E4 V2 (STM32F103VC)
|
||||
#define BOARD_ERYONE_ERY32_MINI 4064 // Eryone Ery32 mini (STM32F103VE)
|
||||
#define BOARD_PANDA_PI_V29 4065 // Panda Pi V2.9 - Standalone (STM32F103RC)
|
||||
|
||||
//
|
||||
// ARM Cortex-M4F
|
||||
@@ -417,6 +418,7 @@
|
||||
#define BOARD_MKS_EAGLE 4237 // MKS Eagle (STM32F407VE)
|
||||
#define BOARD_ARTILLERY_RUBY 4238 // Artillery Ruby (STM32F401RC)
|
||||
#define BOARD_FYSETC_SPIDER_V2_2 4239 // FYSETC Spider V2.2 (STM32F446VE)
|
||||
#define BOARD_CREALITY_V24S1_301F4 4240 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
|
||||
|
||||
//
|
||||
// ARM Cortex M7
|
||||
@@ -441,6 +443,7 @@
|
||||
#define BOARD_PANDA_ZHU 6006 // Panda_ZHU
|
||||
#define BOARD_PANDA_M4 6007 // Panda_M4
|
||||
#define BOARD_MKS_TINYBEE 6008 // MKS TinyBee based on ESP32 (with I2S stepper stream)
|
||||
#define BOARD_ENWI_ESPNP 6009 // enwi ESPNP based on ESP32 (with I2S stepper stream)
|
||||
|
||||
//
|
||||
// SAMD51 ARM Cortex M4
|
||||
|
||||
@@ -67,11 +67,11 @@
|
||||
#define AXIS_DRIVER_TYPE_V(T) _AXIS_DRIVER_TYPE(V,T)
|
||||
#define AXIS_DRIVER_TYPE_W(T) _AXIS_DRIVER_TYPE(W,T)
|
||||
|
||||
#define AXIS_DRIVER_TYPE_X2(T) (EITHER(X_DUAL_STEPPER_DRIVERS, DUAL_X_CARRIAGE) && _AXIS_DRIVER_TYPE(X2,T))
|
||||
#define AXIS_DRIVER_TYPE_Y2(T) (ENABLED(Y_DUAL_STEPPER_DRIVERS) && _AXIS_DRIVER_TYPE(Y2,T))
|
||||
#define AXIS_DRIVER_TYPE_Z2(T) (NUM_Z_STEPPER_DRIVERS >= 2 && _AXIS_DRIVER_TYPE(Z2,T))
|
||||
#define AXIS_DRIVER_TYPE_Z3(T) (NUM_Z_STEPPER_DRIVERS >= 3 && _AXIS_DRIVER_TYPE(Z3,T))
|
||||
#define AXIS_DRIVER_TYPE_Z4(T) (NUM_Z_STEPPER_DRIVERS >= 4 && _AXIS_DRIVER_TYPE(Z4,T))
|
||||
#define AXIS_DRIVER_TYPE_X2(T) (HAS_X2_STEPPER && _AXIS_DRIVER_TYPE(X2,T))
|
||||
#define AXIS_DRIVER_TYPE_Y2(T) (HAS_DUAL_Y_STEPPERS && _AXIS_DRIVER_TYPE(Y2,T))
|
||||
#define AXIS_DRIVER_TYPE_Z2(T) (NUM_Z_STEPPERS >= 2 && _AXIS_DRIVER_TYPE(Z2,T))
|
||||
#define AXIS_DRIVER_TYPE_Z3(T) (NUM_Z_STEPPERS >= 3 && _AXIS_DRIVER_TYPE(Z3,T))
|
||||
#define AXIS_DRIVER_TYPE_Z4(T) (NUM_Z_STEPPERS >= 4 && _AXIS_DRIVER_TYPE(Z4,T))
|
||||
|
||||
#define AXIS_DRIVER_TYPE_E(N,T) (E_STEPPERS > N && _AXIS_DRIVER_TYPE(E##N,T))
|
||||
#define AXIS_DRIVER_TYPE_E0(T) AXIS_DRIVER_TYPE_E(0,T)
|
||||
|
||||
@@ -199,16 +199,20 @@
|
||||
#define STR_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108"
|
||||
#define STR_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume"
|
||||
|
||||
#define STR_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999"
|
||||
#define STR_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999"
|
||||
#define STR_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: "
|
||||
#define STR_KILL_BUTTON "!! KILL caused by KILL button/pin"
|
||||
#define STR_STOP_PRE "!! STOP called because of "
|
||||
#define STR_STOP_POST " error - restart with M999"
|
||||
#define STR_STOP_BLTOUCH "BLTouch"
|
||||
#define STR_STOP_UNHOMED "unhomed"
|
||||
#define STR_KILL_PRE "!! KILL caused by "
|
||||
#define STR_KILL_INACTIVE_TIME "too much inactive time - current command: "
|
||||
#define STR_KILL_BUTTON "KILL button/pin"
|
||||
|
||||
// temperature.cpp strings
|
||||
#define STR_PID_AUTOTUNE_START "PID Autotune start"
|
||||
#define STR_PID_BAD_HEATER_ID "PID Autotune failed! Bad heater id"
|
||||
#define STR_PID_TEMP_TOO_HIGH "PID Autotune failed! Temperature too high"
|
||||
#define STR_PID_TIMEOUT "PID Autotune failed! timeout"
|
||||
#define STR_PID_AUTOTUNE "PID Autotune"
|
||||
#define STR_PID_AUTOTUNE_START " start"
|
||||
#define STR_PID_BAD_HEATER_ID " failed! Bad heater id"
|
||||
#define STR_PID_TEMP_TOO_HIGH " failed! Temperature too high"
|
||||
#define STR_PID_TIMEOUT " failed! timeout"
|
||||
#define STR_BIAS " bias: "
|
||||
#define STR_D_COLON " d: "
|
||||
#define STR_T_MIN " min: "
|
||||
@@ -219,7 +223,7 @@
|
||||
#define STR_KP " Kp: "
|
||||
#define STR_KI " Ki: "
|
||||
#define STR_KD " Kd: "
|
||||
#define STR_PID_AUTOTUNE_FINISHED "PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
|
||||
#define STR_PID_AUTOTUNE_FINISHED " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
|
||||
#define STR_PID_DEBUG " PID_DEBUG "
|
||||
#define STR_PID_DEBUG_INPUT ": Input "
|
||||
#define STR_PID_DEBUG_OUTPUT " Output "
|
||||
@@ -228,6 +232,14 @@
|
||||
#define STR_PID_DEBUG_DTERM " dTerm "
|
||||
#define STR_PID_DEBUG_CTERM " cTerm "
|
||||
#define STR_INVALID_EXTRUDER_NUM " - Invalid extruder number !"
|
||||
#define STR_MPC_AUTOTUNE "MPC Autotune"
|
||||
#define STR_MPC_AUTOTUNE_START " start for " STR_E
|
||||
#define STR_MPC_AUTOTUNE_INTERRUPTED " interrupted!"
|
||||
#define STR_MPC_AUTOTUNE_FINISHED " finished! Put the constants below into Configuration.h"
|
||||
#define STR_MPC_COOLING_TO_AMBIENT "Cooling to ambient"
|
||||
#define STR_MPC_HEATING_PAST_200 "Heating to over 200C"
|
||||
#define STR_MPC_MEASURING_AMBIENT "Measuring ambient heatloss at "
|
||||
#define STR_MPC_TEMPERATURE_ERROR "Temperature error"
|
||||
|
||||
#define STR_HEATER_BED "bed"
|
||||
#define STR_HEATER_CHAMBER "chamber"
|
||||
@@ -303,6 +315,7 @@
|
||||
#define STR_MATERIAL_HEATUP "Material heatup parameters"
|
||||
#define STR_LCD_CONTRAST "LCD Contrast"
|
||||
#define STR_LCD_BRIGHTNESS "LCD Brightness"
|
||||
#define STR_DISPLAY_SLEEP "Display Sleep"
|
||||
#define STR_UI_LANGUAGE "UI Language"
|
||||
#define STR_Z_PROBE_OFFSET "Z-Probe Offset"
|
||||
#define STR_TEMPERATURE_UNITS "Temperature Units"
|
||||
|
||||
+25
-16
@@ -82,11 +82,11 @@
|
||||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
#define NO_INLINE __attribute__((noinline))
|
||||
#define _UNUSED __attribute__((unused))
|
||||
#define _O0 __attribute__((optimize("O0")))
|
||||
#define _Os __attribute__((optimize("Os")))
|
||||
#define _O1 __attribute__((optimize("O1")))
|
||||
#define _O2 __attribute__((optimize("O2")))
|
||||
#define _O3 __attribute__((optimize("O3")))
|
||||
#define __O0 __attribute__((optimize("O0")))
|
||||
#define __Os __attribute__((optimize("Os")))
|
||||
#define __O1 __attribute__((optimize("O1")))
|
||||
#define __O2 __attribute__((optimize("O2")))
|
||||
#define __O3 __attribute__((optimize("O3")))
|
||||
|
||||
#define IS_CONSTEXPR(...) __builtin_constant_p(__VA_ARGS__) // Only valid solution with C++14. Should use std::is_constant_evaluated() in C++20 instead
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+')
|
||||
#define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+')
|
||||
#define COUNT(a) (sizeof(a)/sizeof(*a))
|
||||
#define ZERO(a) memset(a,0,sizeof(a))
|
||||
#define ZERO(a) memset((void*)a,0,sizeof(a))
|
||||
#define COPY(a,b) do{ \
|
||||
static_assert(sizeof(a[0]) == sizeof(b[0]), "COPY: '" STRINGIFY(a) "' and '" STRINGIFY(b) "' types (sizes) don't match!"); \
|
||||
memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \
|
||||
@@ -712,13 +712,22 @@
|
||||
#define RREPEAT2_S(S,N,OP,V...) EVAL1024(_RREPEAT2(S,SUB##S(N),OP,V))
|
||||
#define RREPEAT2(N,OP,V...) RREPEAT2_S(0,N,OP,V)
|
||||
|
||||
// See https://github.com/swansontec/map-macro
|
||||
#define MAP_OUT
|
||||
#define MAP_END(...)
|
||||
#define MAP_GET_END() 0, MAP_END
|
||||
#define MAP_NEXT0(test, next, ...) next MAP_OUT
|
||||
#define MAP_NEXT1(test, next) MAP_NEXT0 (test, next, 0)
|
||||
#define MAP_NEXT(test, next) MAP_NEXT1 (MAP_GET_END test, next)
|
||||
#define MAP0(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP1) (f, peek, __VA_ARGS__)
|
||||
#define MAP1(f, x, peek, ...) f(x) MAP_NEXT (peek, MAP0) (f, peek, __VA_ARGS__)
|
||||
#define MAP(f, ...) EVAL512 (MAP1 (f, __VA_ARGS__, (), 0))
|
||||
// Call OP(A) with each item as an argument
|
||||
#define _MAP(_MAP_OP,A,V...) \
|
||||
_MAP_OP(A) \
|
||||
IF_ELSE(HAS_ARGS(V)) \
|
||||
( DEFER2(__MAP)()(_MAP_OP,V) ) \
|
||||
( /* Do nothing */ )
|
||||
#define __MAP() _MAP
|
||||
|
||||
#define MAP(OP,V...) EVAL(_MAP(OP,V))
|
||||
|
||||
// Emit a list of OP(A) with the given items
|
||||
#define _MAPLIST(_MAP_OP,A,V...) \
|
||||
_MAP_OP(A) \
|
||||
IF_ELSE(HAS_ARGS(V)) \
|
||||
( , DEFER2(__MAPLIST)()(_MAP_OP,V) ) \
|
||||
( /* Do nothing */ )
|
||||
#define __MAPLIST() _MAPLIST
|
||||
|
||||
#define MAPLIST(OP,V...) EVAL(_MAPLIST(OP,V))
|
||||
|
||||
@@ -45,6 +45,7 @@ typedef const char Language_Str[];
|
||||
|
||||
// Set unused languages equal to each other so the
|
||||
// compiler can optimize away the conditionals.
|
||||
#define LCD_LANGUAGE_1 LCD_LANGUAGE
|
||||
#ifndef LCD_LANGUAGE_2
|
||||
#define LCD_LANGUAGE_2 LCD_LANGUAGE
|
||||
#endif
|
||||
|
||||
@@ -30,20 +30,15 @@
|
||||
uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE;
|
||||
|
||||
// Commonly-used strings in serial output
|
||||
PGMSTR(NUL_STR, ""); PGMSTR(SP_P_STR, " P"); PGMSTR(SP_T_STR, " T");
|
||||
PGMSTR(X_STR, "X"); PGMSTR(Y_STR, "Y"); PGMSTR(Z_STR, "Z"); PGMSTR(E_STR, "E");
|
||||
PGMSTR(U_STR, STR_U); PGMSTR(V_STR, STR_V); PGMSTR(W_STR, STR_W);
|
||||
PGMSTR(X_LBL, "X:"); PGMSTR(Y_LBL, "Y:"); PGMSTR(Z_LBL, "Z:"); PGMSTR(E_LBL, "E:");
|
||||
PGMSTR(U_LBL, STR_U ":"); PGMSTR(V_LBL, STR_V ":"); PGMSTR(W_LBL, STR_W ":");
|
||||
PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C");
|
||||
PGMSTR(SP_X_STR, " X"); PGMSTR(SP_Y_STR, " Y"); PGMSTR(SP_Z_STR, " Z"); PGMSTR(SP_E_STR, " E");
|
||||
PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMSTR(SP_E_LBL, " E:");
|
||||
PGMSTR(I_STR, STR_I); PGMSTR(J_STR, STR_J); PGMSTR(K_STR, STR_K);
|
||||
PGMSTR(I_LBL, STR_I ":"); PGMSTR(J_LBL, STR_J ":"); PGMSTR(K_LBL, STR_K ":");
|
||||
PGMSTR(SP_I_STR, " " STR_I); PGMSTR(SP_J_STR, " " STR_J); PGMSTR(SP_K_STR, " " STR_K);
|
||||
PGMSTR(SP_U_STR, " " STR_U); PGMSTR(SP_V_STR, " " STR_V); PGMSTR(SP_W_STR, " " STR_W);
|
||||
PGMSTR(SP_I_LBL, " " STR_I ":"); PGMSTR(SP_J_LBL, " " STR_J ":"); PGMSTR(SP_K_LBL, " " STR_K ":");
|
||||
PGMSTR(SP_U_LBL, " " STR_U ":"); PGMSTR(SP_V_LBL, " " STR_V ":"); PGMSTR(SP_W_LBL, " " STR_W ":");
|
||||
PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C");
|
||||
PGMSTR(SP_P_STR, " P"); PGMSTR(SP_T_STR, " T"); PGMSTR(NUL_STR, "");
|
||||
|
||||
#define _N_STR(N) PGMSTR(N##_STR, STR_##N);
|
||||
#define _N_LBL(N) PGMSTR(N##_LBL, STR_##N ":");
|
||||
#define _SP_N_STR(N) PGMSTR(SP_##N##_STR, STR_##N ":");
|
||||
#define _SP_N_LBL(N) PGMSTR(SP_##N##_LBL, " " STR_##N ":");
|
||||
MAP(_N_STR, LOGICAL_AXIS_NAMES); MAP(_SP_N_STR, LOGICAL_AXIS_NAMES);
|
||||
MAP(_N_LBL, LOGICAL_AXIS_NAMES); MAP(_SP_N_LBL, LOGICAL_AXIS_NAMES);
|
||||
|
||||
// Hook Meatpack if it's enabled on the first leaf
|
||||
#if ENABLED(MEATPACK_ON_SERIAL_PORT_1)
|
||||
|
||||
@@ -28,14 +28,6 @@
|
||||
#include "../feature/meatpack.h"
|
||||
#endif
|
||||
|
||||
// Commonly-used strings in serial output
|
||||
extern const char NUL_STR[], SP_P_STR[], SP_T_STR[],
|
||||
SP_A_STR[], SP_B_STR[], SP_C_STR[],
|
||||
SP_X_STR[], SP_Y_STR[], SP_Z_STR[], SP_I_STR[], SP_J_STR[], SP_K_STR[], SP_U_STR[], SP_V_STR[], SP_W_STR[], SP_E_STR[],
|
||||
SP_X_LBL[], SP_Y_LBL[], SP_Z_LBL[], SP_I_LBL[], SP_J_LBL[], SP_K_LBL[], SP_U_LBL[], SP_V_LBL[], SP_W_LBL[], SP_E_LBL[],
|
||||
X_STR[], Y_STR[], Z_STR[], I_STR[], J_STR[], K_STR[], U_STR[], V_STR[], W_STR[], E_STR[],
|
||||
X_LBL[], Y_LBL[], Z_LBL[], I_LBL[], J_LBL[], K_LBL[], U_LBL[], V_LBL[], W_LBL[], E_LBL[];
|
||||
|
||||
//
|
||||
// Debugging flags for use by M111
|
||||
//
|
||||
@@ -351,3 +343,32 @@ inline void print_pos(const xyz_pos_t &xyz, FSTR_P const prefix=nullptr, FSTR_P
|
||||
|
||||
#define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, F(" " STRINGIFY(VAR) "="), F(" : " SUFFIX "\n")); }while(0)
|
||||
#define SERIAL_XYZ(PREFIX,V...) do { print_pos(V, F(PREFIX)); }while(0)
|
||||
|
||||
//
|
||||
// Commonly-used strings in serial output
|
||||
//
|
||||
|
||||
#define _N_STR(N) N##_STR
|
||||
#define _N_LBL(N) N##_LBL
|
||||
#define _N_STR_A(N) _N_STR(N)[]
|
||||
#define _N_LBL_A(N) _N_LBL(N)[]
|
||||
#define _SP_N_STR(N) SP_##N##_STR
|
||||
#define _SP_N_LBL(N) SP_##N##_LBL
|
||||
#define _SP_N_STR_A(N) _SP_N_STR(N)[]
|
||||
#define _SP_N_LBL_A(N) _SP_N_LBL(N)[]
|
||||
|
||||
extern const char SP_A_STR[], SP_B_STR[], SP_C_STR[], SP_P_STR[], SP_T_STR[], NUL_STR[],
|
||||
MAPLIST(_N_STR_A, LOGICAL_AXIS_NAMES), MAPLIST(_SP_N_STR_A, LOGICAL_AXIS_NAMES),
|
||||
MAPLIST(_N_LBL_A, LOGICAL_AXIS_NAMES), MAPLIST(_SP_N_LBL_A, LOGICAL_AXIS_NAMES);
|
||||
|
||||
PGM_P const SP_AXIS_LBL[] PROGMEM = { MAPLIST(_SP_N_LBL, LOGICAL_AXIS_NAMES) };
|
||||
PGM_P const SP_AXIS_STR[] PROGMEM = { MAPLIST(_SP_N_STR, LOGICAL_AXIS_NAMES) };
|
||||
|
||||
#undef _N_STR
|
||||
#undef _N_LBL
|
||||
#undef _N_STR_A
|
||||
#undef _N_LBL_A
|
||||
#undef _SP_N_STR
|
||||
#undef _SP_N_LBL
|
||||
#undef _SP_N_STR_A
|
||||
#undef _SP_N_LBL_A
|
||||
|
||||
@@ -43,7 +43,9 @@ public:
|
||||
}
|
||||
|
||||
constexpr SerialMask(const uint8_t mask) : mask(mask) {}
|
||||
constexpr SerialMask(const SerialMask & other) : mask(other.mask) {} // Can't use = default here since not all framework support this
|
||||
constexpr SerialMask(const SerialMask &rs) : mask(rs.mask) {} // Can't use = default here since not all frameworks support this
|
||||
|
||||
SerialMask& operator=(const SerialMask &rs) { mask = rs.mask; return *this; }
|
||||
|
||||
static constexpr uint8_t All = 0xFF;
|
||||
};
|
||||
@@ -298,7 +300,7 @@ struct MultiSerial : public SerialBase< MultiSerial< REPEAT(NUM_SERIAL, _S_NAME)
|
||||
// Build the actual serial object depending on current configuration
|
||||
#define Serial1Class TERN(SERIAL_RUNTIME_HOOK, RuntimeSerial, BaseSerial)
|
||||
#define ForwardSerial1Class TERN(SERIAL_RUNTIME_HOOK, RuntimeSerial, ForwardSerial)
|
||||
#ifdef HAS_MULTI_SERIAL
|
||||
#if HAS_MULTI_SERIAL
|
||||
#define Serial2Class ConditionalSerial
|
||||
#if NUM_SERIAL >= 3
|
||||
#define Serial3Class ConditionalSerial
|
||||
|
||||
+63
-3
@@ -39,20 +39,28 @@ struct IF<true, L, R> { typedef L type; };
|
||||
#define NUM_AXIS_GANG(V...) GANG_N(NUM_AXES, V)
|
||||
#define NUM_AXIS_CODE(V...) CODE_N(NUM_AXES, V)
|
||||
#define NUM_AXIS_LIST(V...) LIST_N(NUM_AXES, V)
|
||||
#define NUM_AXIS_LIST_1(V) LIST_N_1(NUM_AXES, V)
|
||||
#define NUM_AXIS_ARRAY(V...) { NUM_AXIS_LIST(V) }
|
||||
#define NUM_AXIS_ARRAY_1(V) { NUM_AXIS_LIST_1(V) }
|
||||
#define NUM_AXIS_ARGS(T...) NUM_AXIS_LIST(T x, T y, T z, T i, T j, T k, T u, T v, T w)
|
||||
#define NUM_AXIS_ELEM(O) NUM_AXIS_LIST(O.x, O.y, O.z, O.i, O.j, O.k, O.u, O.v, O.w)
|
||||
#define NUM_AXIS_DEFS(T,V) NUM_AXIS_LIST(T x=V, T y=V, T z=V, T i=V, T j=V, T k=V, T u=V, T v=V, T w=V)
|
||||
#define MAIN_AXIS_NAMES NUM_AXIS_LIST(X, Y, Z, I, J, K, U, V, W)
|
||||
#define MAIN_AXIS_MAP(F) MAP(F, MAIN_AXIS_NAMES)
|
||||
#define STR_AXES_MAIN NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
|
||||
|
||||
#define LOGICAL_AXIS_GANG(E,V...) NUM_AXIS_GANG(V) GANG_ITEM_E(E)
|
||||
#define LOGICAL_AXIS_CODE(E,V...) NUM_AXIS_CODE(V) CODE_ITEM_E(E)
|
||||
#define LOGICAL_AXIS_LIST(E,V...) NUM_AXIS_LIST(V) LIST_ITEM_E(E)
|
||||
#define LOGICAL_AXIS_LIST_1(V) NUM_AXIS_LIST_1(V) LIST_ITEM_E(V)
|
||||
#define LOGICAL_AXIS_ARRAY(E,V...) { LOGICAL_AXIS_LIST(E,V) }
|
||||
#define LOGICAL_AXIS_ARRAY_1(V) { LOGICAL_AXIS_LIST_1(V) }
|
||||
#define LOGICAL_AXIS_ARGS(T...) LOGICAL_AXIS_LIST(T e, T x, T y, T z, T i, T j, T k, T u, T v, T w)
|
||||
#define LOGICAL_AXIS_ELEM(O) LOGICAL_AXIS_LIST(O.e, O.x, O.y, O.z, O.i, O.j, O.k, O.u, O.v, O.w)
|
||||
#define LOGICAL_AXIS_DECL(T,V) LOGICAL_AXIS_LIST(T e=V, T x=V, T y=V, T z=V, T i=V, T j=V, T k=V, T u=V, T v=V, T w=V)
|
||||
|
||||
#define LOGICAL_AXES_STRING LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
|
||||
#define LOGICAL_AXIS_NAMES LOGICAL_AXIS_LIST(E, X, Y, Z, I, J, K, U, V, W)
|
||||
#define LOGICAL_AXIS_MAP(F) MAP(F, LOGICAL_AXIS_NAMES)
|
||||
#define STR_AXES_LOGICAL LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
|
||||
|
||||
#define XYZ_GANG(V...) GANG_N(PRIMARY_LINEAR_AXES, V)
|
||||
#define XYZ_CODE(V...) CODE_N(PRIMARY_LINEAR_AXES, V)
|
||||
@@ -76,6 +84,59 @@ struct IF<true, L, R> { typedef L type; };
|
||||
|
||||
#define AXIS_COLLISION(L) (AXIS4_NAME == L || AXIS5_NAME == L || AXIS6_NAME == L || AXIS7_NAME == L || AXIS8_NAME == L || AXIS9_NAME == L)
|
||||
|
||||
// General Flags for some number of states
|
||||
template<size_t N>
|
||||
struct Flags {
|
||||
typedef typename IF<(N>8), uint16_t, uint8_t>::type bits_t;
|
||||
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; } N8;
|
||||
typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1; } N16;
|
||||
union {
|
||||
bits_t b;
|
||||
typename IF<(N>8), N16, N8>::type flag;
|
||||
};
|
||||
void reset() { b = 0; }
|
||||
void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
|
||||
void set(const int n) { b |= (bits_t)_BV(n); }
|
||||
void clear(const int n) { b &= ~(bits_t)_BV(n); }
|
||||
bool test(const int n) const { return TEST(b, n); }
|
||||
bool operator[](const int n) { return test(n); }
|
||||
bool operator[](const int n) const { return test(n); }
|
||||
int size() const { return sizeof(b); }
|
||||
};
|
||||
|
||||
// Specialization for a single bool flag
|
||||
template<>
|
||||
struct Flags<1> {
|
||||
bool b;
|
||||
void reset() { b = false; }
|
||||
void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
|
||||
void set(const int) { b = true; }
|
||||
void clear(const int) { b = false; }
|
||||
bool test(const int) const { return b; }
|
||||
bool operator[](const int) { return b; }
|
||||
bool operator[](const int) const { return b; }
|
||||
int size() const { return sizeof(b); }
|
||||
};
|
||||
|
||||
typedef Flags<8> flags_8_t;
|
||||
typedef Flags<16> flags_16_t;
|
||||
|
||||
// Flags for some axis states, with per-axis aliases xyzijkuvwe
|
||||
typedef struct AxisFlags {
|
||||
union {
|
||||
struct Flags<LOGICAL_AXES> flags;
|
||||
struct { bool LOGICAL_AXIS_LIST(e:1, x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1); };
|
||||
};
|
||||
void reset() { flags.reset(); }
|
||||
void set(const int n) { flags.set(n); }
|
||||
void set(const int n, const bool onoff) { flags.set(n, onoff); }
|
||||
void clear(const int n) { flags.clear(n); }
|
||||
bool test(const int n) const { return flags.test(n); }
|
||||
bool operator[](const int n) { return flags[n]; }
|
||||
bool operator[](const int n) const { return flags[n]; }
|
||||
int size() const { return sizeof(flags); }
|
||||
} axis_flags_t;
|
||||
|
||||
//
|
||||
// Enumerated axis indices
|
||||
//
|
||||
@@ -120,7 +181,6 @@ enum AxisEnum : uint8_t {
|
||||
};
|
||||
|
||||
typedef IF<(NUM_AXIS_ENUMS > 8), uint16_t, uint8_t>::type axis_bits_t;
|
||||
typedef IF<(NUM_AXES > 8), uint16_t, uint8_t>::type linear_axis_bits_t;
|
||||
|
||||
//
|
||||
// Loop over axes
|
||||
|
||||
@@ -126,16 +126,16 @@ void safe_delay(millis_t ms) {
|
||||
#if ABL_PLANAR
|
||||
SERIAL_ECHOPGM("ABL Adjustment");
|
||||
LOOP_NUM_AXES(a) {
|
||||
SERIAL_CHAR(' ', AXIS_CHAR(a));
|
||||
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_STR[a]));
|
||||
serial_offset(planner.get_axis_position_mm(AxisEnum(a)) - current_position[a]);
|
||||
}
|
||||
#else
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
SERIAL_ECHOPGM("UBL Adjustment Z");
|
||||
const float rz = ubl.get_z_correction(current_position);
|
||||
const float rz = bedlevel.get_z_correction(current_position);
|
||||
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
SERIAL_ECHOPGM("ABL Adjustment Z");
|
||||
const float rz = bbl.get_z_correction(current_position);
|
||||
const float rz = bedlevel.get_z_correction(current_position);
|
||||
#endif
|
||||
SERIAL_ECHO(ftostr43sign(rz, '+'));
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
@@ -156,11 +156,11 @@ void safe_delay(millis_t ms) {
|
||||
SERIAL_ECHOPGM("Mesh Bed Leveling");
|
||||
if (planner.leveling_active) {
|
||||
SERIAL_ECHOLNPGM(" (enabled)");
|
||||
SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(mbl.get_z(current_position), '+'));
|
||||
SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(bedlevel.get_z(current_position), '+'));
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
if (planner.z_fade_height) {
|
||||
SERIAL_ECHOPGM(" (", ftostr43sign(
|
||||
mbl.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+'
|
||||
bedlevel.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+'
|
||||
));
|
||||
SERIAL_CHAR(')');
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ constexpr uint8_t ui8_to_percent(const uint8_t i) { return (int(i) * 100 + 127)
|
||||
|
||||
// Axis names for G-code parsing, reports, etc.
|
||||
const xyze_char_t axis_codes LOGICAL_AXIS_ARRAY('E', 'X', 'Y', 'Z', AXIS4_NAME, AXIS5_NAME, AXIS6_NAME, AXIS7_NAME, AXIS8_NAME, AXIS9_NAME);
|
||||
#if NUM_AXES <= XYZ
|
||||
#if NUM_AXES <= XYZ && !HAS_EXTRUDERS
|
||||
#define AXIS_CHAR(A) ((char)('X' + A))
|
||||
#define IAXIS_CHAR AXIS_CHAR
|
||||
#else
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "adc_mcp3426.h"
|
||||
|
||||
// Read the ADC value from MCP342X on a specific channel
|
||||
int16_t MCP3426::ReadValue(uint8_t channel, uint8_t gain) {
|
||||
int16_t MCP3426::ReadValue(uint8_t channel, uint8_t gain, uint8_t address) {
|
||||
Error = false;
|
||||
|
||||
#if PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM)
|
||||
@@ -44,7 +44,7 @@ int16_t MCP3426::ReadValue(uint8_t channel, uint8_t gain) {
|
||||
|
||||
Wire.begin(); // No address joins the BUS as the master
|
||||
|
||||
Wire.beginTransmission(I2C_ADDRESS(MCP342X_ADC_I2C_ADDRESS));
|
||||
Wire.beginTransmission(I2C_ADDRESS(address));
|
||||
|
||||
// Continuous Conversion Mode, 16 bit, Channel 1, Gain x4
|
||||
// 26 = 0b00011000
|
||||
@@ -75,7 +75,7 @@ int16_t MCP3426::ReadValue(uint8_t channel, uint8_t gain) {
|
||||
uint8_t buffer[len] = {};
|
||||
|
||||
do {
|
||||
Wire.requestFrom(I2C_ADDRESS(MCP342X_ADC_I2C_ADDRESS), len);
|
||||
Wire.requestFrom(I2C_ADDRESS(address), len);
|
||||
if (Wire.available() != len) {
|
||||
Error = true;
|
||||
return 0;
|
||||
|
||||
@@ -29,12 +29,9 @@
|
||||
#include <stdint.h>
|
||||
#include <Wire.h>
|
||||
|
||||
// Address of MCP342X chip
|
||||
#define MCP342X_ADC_I2C_ADDRESS 104
|
||||
|
||||
class MCP3426 {
|
||||
public:
|
||||
int16_t ReadValue(uint8_t channel, uint8_t gain);
|
||||
int16_t ReadValue(uint8_t channel, uint8_t gain, uint8_t address);
|
||||
bool Error;
|
||||
};
|
||||
|
||||
|
||||
@@ -162,32 +162,37 @@ int32_t Backlash::get_applied_steps(const AxisEnum axis) {
|
||||
}
|
||||
|
||||
class Backlash::StepAdjuster {
|
||||
xyz_long_t applied_steps;
|
||||
public:
|
||||
StepAdjuster() {
|
||||
LOOP_NUM_AXES(axis) applied_steps[axis] = backlash.get_applied_steps((AxisEnum)axis);
|
||||
}
|
||||
~StepAdjuster() {
|
||||
// after backlash compensation parameter changes, ensure applied step count does not change
|
||||
LOOP_NUM_AXES(axis) residual_error[axis] += backlash.get_applied_steps((AxisEnum)axis) - applied_steps[axis];
|
||||
}
|
||||
private:
|
||||
xyz_long_t applied_steps;
|
||||
public:
|
||||
StepAdjuster() {
|
||||
LOOP_NUM_AXES(axis) applied_steps[axis] = backlash.get_applied_steps((AxisEnum)axis);
|
||||
}
|
||||
~StepAdjuster() {
|
||||
// after backlash compensation parameter changes, ensure applied step count does not change
|
||||
LOOP_NUM_AXES(axis) residual_error[axis] += backlash.get_applied_steps((AxisEnum)axis) - applied_steps[axis];
|
||||
}
|
||||
};
|
||||
|
||||
void Backlash::set_correction_uint8(const uint8_t v) {
|
||||
StepAdjuster adjuster;
|
||||
correction = v;
|
||||
}
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
|
||||
void Backlash::set_distance_mm(const AxisEnum axis, const float v) {
|
||||
StepAdjuster adjuster;
|
||||
distance_mm[axis] = v;
|
||||
}
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
void Backlash::set_smoothing_mm(const float v) {
|
||||
void Backlash::set_correction_uint8(const uint8_t v) {
|
||||
StepAdjuster adjuster;
|
||||
smoothing_mm = v;
|
||||
correction = v;
|
||||
}
|
||||
|
||||
void Backlash::set_distance_mm(const AxisEnum axis, const float v) {
|
||||
StepAdjuster adjuster;
|
||||
distance_mm[axis] = v;
|
||||
}
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
void Backlash::set_smoothing_mm(const float v) {
|
||||
StepAdjuster adjuster;
|
||||
smoothing_mm = v;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "../../../lcd/extui/ui_api.h"
|
||||
#endif
|
||||
|
||||
LevelingBilinear bbl;
|
||||
LevelingBilinear bedlevel;
|
||||
|
||||
xy_pos_t LevelingBilinear::grid_spacing,
|
||||
LevelingBilinear::grid_start;
|
||||
@@ -258,8 +258,8 @@ void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values /*= NULL*
|
||||
);
|
||||
}
|
||||
}
|
||||
#endif // ABL_BILINEAR_SUBDIVISION
|
||||
|
||||
#endif // ABL_BILINEAR_SUBDIVISION
|
||||
|
||||
// Refresh after other values have been updated
|
||||
void LevelingBilinear::refresh_bed_level() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user