This commit is contained in:
Adam Bissen 2020-10-06 19:33:37 -05:00
commit 4f755578b1
1774 changed files with 89990 additions and 22172 deletions

2
.github/FUNDING.yml vendored
View File

@ -1,3 +1,3 @@
github: [thinkyhead] github: [thinkyhead]
patreon: thinkyhead patreon: thinkyhead
custom: ["http://www.thinkyhead.com/donate-to-marlin"] custom: ["https://www.thinkyhead.com/donate-to-marlin"]

View File

@ -34,16 +34,15 @@ This project and everyone participating in it is governed by the [Marlin Code of
We have a Message Board and a Facebook group where our knowledgable user community can provide helpful advice if you have questions. We have a Message Board and a Facebook group where our knowledgable user community can provide helpful advice if you have questions.
* [Marlin RepRap forum](http://forums.reprap.org/list.php?415) * [Marlin RepRap forum](https://reprap.org/forum/list.php?415)
* [MarlinFirmware on Facebook](https://www.facebook.com/groups/1049718498464482/) * [MarlinFirmware on Facebook](https://www.facebook.com/groups/1049718498464482/)
If chat is more your speed, you can join the MarlinFirmware Slack team: If chat is more your speed, you can join the MarlinFirmware Discord server:
* Join the Marlin Slack Team * Use the link https://discord.gg/n5NJ59y to join up as a General User.
* To obtain group access, please [send a request](http://www.thinkyhead.com/contact/9) to @thinkyhead. * Even though our Discord is pretty active, it may take a while for community members to respond — please be patient!
* Even though Slack is a chat service, sometimes it takes several hours for community members to respond — please be patient!
* Use the `#general` channel for general questions or discussion about Marlin. * Use the `#general` channel for general questions or discussion about Marlin.
* Other channels exist for certain topics. Check the channel list. * Other channels exist for certain topics or are limited to Patrons. Check the channel list.
## How Can I Contribute? ## How Can I Contribute?
@ -93,7 +92,7 @@ Before creating a suggestion, please check [this list](#before-submitting-a-sugg
#### Before Submitting a Feature Request #### Before Submitting a Feature Request
* **Check the [Marlin website](http://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](http://marlinfw.org/docs/configuration/configuration.html). * **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%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.
#### How Do I Submit A (Good) Feature Request? #### How Do I Submit A (Good) Feature Request?
@ -117,12 +116,12 @@ Unsure where to begin contributing to Marlin? You can start by looking through t
### Pull Requests ### 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](http://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-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.
* Fill in [the required template](pull_request_template.md). * Fill in [the required template](pull_request_template.md).
* Don't include issue numbers in the PR title. * Don't include issue numbers in the PR title.
* Include pictures, diagrams, and links to videos in your Pull Request to demonstrate your changes, if needed. * Include pictures, diagrams, and links to videos in your Pull Request to demonstrate your changes, if needed.
* Follow the [Coding Standards](http://marlinfw.org/docs/development/coding_standards.html) posted on our website. * Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) posted on our website.
* Document new code with clear and concise comments. * Document new code with clear and concise comments.
* End all files with a newline. * End all files with a newline.
@ -137,7 +136,7 @@ Pull Requests should always be targeted to working branches (e.g., `bugfix-1.1.x
### C++ Coding Standards ### C++ Coding Standards
* Please read and follow the [Coding Standards](http://marlinfw.org/docs/development/coding_standards.html) posted on our website. Failure to follow these guidelines will delay evaluation and acceptance of Pull Requests. * Please read and follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) posted on our website. Failure to follow these guidelines will delay evaluation and acceptance of Pull Requests.
### Documentation ### Documentation

View File

@ -1,16 +1,11 @@
# NO SUPPORT REQUESTS PLEASE # NO SUPPORT REQUESTS PLEASE
Support Requests posted here will be automatically closed! Do you want to ask a question? Are you looking for support? Please don't post here. Support Requests posted here will be automatically closed!
This Issue Queue is for Marlin bug reports and development-related issues, and we prefer not to handle user-support questions here. See https://github.com/MarlinFirmware/Marlin/blob/1.1.x/.github/contributing.md#i-dont-want-to-read-this-whole-thing-i-just-have-a-question. Instead use one of the following options:
For best results getting help with configuration and troubleshooting, please use the following resources: - 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.
- RepRap.org Marlin Forum http://forums.reprap.org/list.php?415 Before filing an issue be sure to test the latest "bugfix" branch to see whether the issue is already addressed.
- Tom's 3D Forums https://discuss.toms3d.org/
- Facebook Group "Marlin Firmware" https://www.facebook.com/groups/1049718498464482/
- Facebook Group "Marlin Firmware for 3D Printers" https://www.facebook.com/groups/3Dtechtalk/
- Marlin Configuration https://www.youtube.com/results?search_query=marlin+configuration on YouTube
- Marlin Discord server. Join link: https://discord.gg/n5NJ59y
After seeking help from the community, if the consensus points to to a bug in Marlin, then you should post a Bug Report at https://github.com/MarlinFirmware/Marlin/issues/new/choose).

40
.github/lock.yml vendored Normal file
View File

@ -0,0 +1,40 @@
#
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
#
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 60
# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: [ 'no-locking' ]
# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false
# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: true
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated
# pulls:
# daysUntilLock: 30
# Repository to extend settings from
# _extends: repo

View File

@ -14,6 +14,10 @@ We must be able to understand your proposed change from this description. If we
<!-- What does this fix or improve? --> <!-- What does this fix or improve? -->
### Configurations
<!-- Attach any Configuration.h, Configuration_adv.h, or platformio.ini files needed to compile/test your Pull Request. -->
### Related Issues ### Related Issues
<!-- Whether this fixes a bug or fulfills a feature request, please list any related Issues here. --> <!-- Whether this fixes a bug or fulfills a feature request, please list any related Issues here. -->

View File

@ -1,7 +0,0 @@
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.

View File

@ -11,6 +11,8 @@ on:
jobs: jobs:
bump_date: bump_date:
name: Bump Distribution Date
if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -24,7 +26,6 @@ jobs:
- name: Bump Distribution Date - name: Bump Distribution Date
run: | run: |
# Inline Bump Script # Inline Bump Script
[[ "$GITHUB_REPOSITORY" == "MarlinFirmware/Marlin" ]] || exit 0
DIST=$( date +"%Y-%m-%d" ) 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/src/inc/Version.h" && \
git config user.name "${GITHUB_ACTOR}" && \ git config user.name "${GITHUB_ACTOR}" && \

View File

@ -1,6 +1,6 @@
# #
# comment-pr.yml # check-pr.yml
# Add a comment to any PR directed to a release branch # Close PRs directed at release branches
# #
name: PR Bad Target name: PR Bad Target
@ -14,14 +14,20 @@ on:
jobs: jobs:
bad_target: bad_target:
name: PR Bad Target name: PR Bad Target
if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: peter-evans/close-pull@v1
- uses: harupy/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
filename: bad-target.md delete-branch: false
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.

27
.github/workflows/close-stale.yml vendored Normal file
View File

@ -0,0 +1,27 @@
#
# 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 is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.'
days-before-stale: 30
days-before-close: 5
stale-issue-label: 'stale-closing-soon'
exempt-issue-labels: 'T: Feature Request'

32
.github/workflows/lock-closed.yml vendored Normal file
View File

@ -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: ''

View File

@ -9,7 +9,14 @@ on:
pull_request: pull_request:
branches: branches:
- bugfix-2.0.x - bugfix-2.0.x
- dev-2.1.x paths-ignore:
- config/**
- data/**
- docs/**
- '**/*.md'
push:
branches:
- bugfix-2.0.x
paths-ignore: paths-ignore:
- config/** - config/**
- data/** - data/**
@ -18,6 +25,8 @@ on:
jobs: jobs:
test_builds: test_builds:
name: Run All Tests
if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -49,14 +58,27 @@ jobs:
- STM32F103RE_btt - STM32F103RE_btt
- STM32F103RE_btt_USB - STM32F103RE_btt_USB
- STM32F103RC_fysetc - STM32F103RC_fysetc
- STM32F103RC_meeb
- jgaurora_a5s_a1 - jgaurora_a5s_a1
- STM32F103VE_longer - STM32F103VE_longer
- STM32F407VE_black - STM32F407VE_black
- STM32F401VE_STEVAL
- BIGTREE_BTT002
- BIGTREE_SKR_PRO - BIGTREE_SKR_PRO
- BIGTREE_GTR_V1_0 - BIGTREE_GTR_V1_0
- mks_robin - mks_robin
- mks_robin_stm32
- ARMED - ARMED
- FYSETC_S6 - FYSETC_S6
- STM32F070RB_malyan
- malyan_M300
- mks_robin_lite
- FLYF407ZG
- rumba32
- mks_robin_pro
- STM32F103RET6_creality
- LERDGEX
- mks_robin_nano35
# Put lengthy tests last # Put lengthy tests last
@ -69,14 +91,10 @@ jobs:
#- STM32F7 #- STM32F7
# Non-working environment tests # Non-working environment tests
#- BIGTREE_BTT002
#- at90usb1286_cdc #- at90usb1286_cdc
#- at90usb1286_dfu #- at90usb1286_dfu
#- STM32F103CB_malyan #- STM32F103CB_malyan
#- mks_robin_lite
#- mks_robin_mini #- mks_robin_mini
#- mks_robin_nano
steps: steps:
@ -88,7 +106,7 @@ jobs:
- name: Install PlatformIO - name: Install PlatformIO
run: | run: |
pip install -U https://github.com/platformio/platformio-core/archive/master.zip pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
platformio update platformio update
- name: Check out the PR - name: Check out the PR
@ -97,8 +115,7 @@ jobs:
- name: Run ${{ matrix.test-platform }} Tests - name: Run ${{ matrix.test-platform }} Tests
run: | run: |
# Inline tests script # Inline tests script
[[ "$GITHUB_REPOSITORY" == "MarlinFirmware/Marlin" ]] || exit 0
chmod +x buildroot/bin/* chmod +x buildroot/bin/*
chmod +x buildroot/share/tests/* chmod +x buildroot/tests/*
export PATH=./buildroot/bin/:./buildroot/share/tests/:${PATH} export PATH=./buildroot/bin/:./buildroot/tests/:${PATH}
run_tests . ${{ matrix.test-platform }} run_tests . ${{ matrix.test-platform }}

22
.github/workflows/unlock-reopened.yml vendored Normal file
View File

@ -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 }}"

2
.gitignore vendored
View File

@ -16,7 +16,7 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# #
# Our automatic versioning scheme generates the following file # Our automatic versioning scheme generates the following file

View File

@ -3,7 +3,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (c) 2007 Free Software Foundation, Inc. <http://fsf.org/> Copyright (c) 2007 Free Software Foundation, Inc. <https://www.fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -647,7 +647,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -666,12 +666,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>. <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>. <https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -36,7 +36,7 @@
* Advanced settings can be found in Configuration_adv.h * Advanced settings can be found in Configuration_adv.h
* *
*/ */
#define CONFIGURATION_H_VERSION 020005 #define CONFIGURATION_H_VERSION 020006
//=========================================================================== //===========================================================================
//============================= Getting Started ============================= //============================= Getting Started =============================
@ -45,13 +45,13 @@
/** /**
* Here are some standard links for getting your machine calibrated: * Here are some standard links for getting your machine calibrated:
* *
* http://reprap.org/wiki/Calibration * https://reprap.org/wiki/Calibration
* http://youtu.be/wAL9d7FgInk * https://youtu.be/wAL9d7FgInk
* http://calculator.josefprusa.cz * http://calculator.josefprusa.cz
* http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide * https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
* http://www.thingiverse.com/thing:5573 * https://www.thingiverse.com/thing:5573
* https://sites.google.com/site/repraplogphase/calibration-of-your-reprap * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
* http://www.thingiverse.com/thing:298812 * https://www.thingiverse.com/thing:298812
*/ */
//=========================================================================== //===========================================================================
@ -140,13 +140,13 @@
#define CUSTOM_MACHINE_NAME "SKR i3" #define CUSTOM_MACHINE_NAME "SKR i3"
// Printer's unique ID, used by some programs to differentiate between machines. // Printer's unique ID, used by some programs to differentiate between machines.
// Choose your own or use a service like http://www.uuidgenerator.net/version4 // Choose your own or use a service like https://www.uuidgenerator.net/version4
//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
// @section extruder // @section extruder
// This defines the number of extruders // This defines the number of extruders
// :[1, 2, 3, 4, 5, 6, 7, 8] // :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#define EXTRUDERS 1 #define EXTRUDERS 1
// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. // Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc.
@ -155,6 +155,13 @@
// For Cyclops or any "multi-extruder" that shares a single nozzle. // For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE //#define SINGLENOZZLE
// Save and restore temperature and fan speed on tool-change.
// Set standby for the unselected tool with M104/106/109 T...
#if ENABLED(SINGLENOZZLE)
//#define SINGLENOZZLE_STANDBY_TEMP
//#define SINGLENOZZLE_STANDBY_FAN
#endif
/** /**
* Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants.
* *
@ -175,7 +182,7 @@
#endif #endif
/** /**
* Prusa Multi-Material Unit v2 * Průša Multi-Material Unit v2
* *
* Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails.
* Requires EXTRUDERS = 5 * Requires EXTRUDERS = 5
@ -233,8 +240,8 @@
#elif ENABLED(MAGNETIC_PARKING_EXTRUDER) #elif ENABLED(MAGNETIC_PARKING_EXTRUDER)
#define MPE_FAST_SPEED 9000 // (mm/m) Speed for travel before last distance point #define MPE_FAST_SPEED 9000 // (mm/min) Speed for travel before last distance point
#define MPE_SLOW_SPEED 4500 // (mm/m) Speed for last distance travel to park and couple #define MPE_SLOW_SPEED 4500 // (mm/min) Speed for last distance travel to park and couple
#define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point #define MPE_TRAVEL_DISTANCE 10 // (mm) Last distance point
#define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling #define MPE_COMPENSATION 0 // Offset Compensation -1 , 0 , 1 (multiplier) only for coupling
@ -282,8 +289,8 @@
#if ENABLED(PRIME_BEFORE_REMOVE) #if ENABLED(PRIME_BEFORE_REMOVE)
#define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length #define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length
#define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length #define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length
#define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/min) Extruder prime feedrate
#define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/min) Extruder retract feedrate
#endif #endif
#elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching #define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching
@ -328,10 +335,10 @@
//#define PSU_NAME "Power Supply" //#define PSU_NAME "Power Supply"
#if ENABLED(PSU_CONTROL) #if ENABLED(PSU_CONTROL)
#define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box #define PSU_ACTIVE_STATE LOW // Set 'LOW' for ATX, 'HIGH' for X-Box
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
//#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
#if ENABLED(AUTO_POWER_CONTROL) #if ENABLED(AUTO_POWER_CONTROL)
@ -369,8 +376,9 @@
* 202 : 200k thermistor - Copymaster 3D * 202 : 200k thermistor - Copymaster 3D
* 3 : Mendel-parts thermistor (4.7k pullup) * 3 : Mendel-parts thermistor (4.7k pullup)
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
* 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan, J-Head, and E3D) (4.7k pullup)
* 501 : 100K Zonestar (Tronxy X3A) Thermistor * 501 : 100K Zonestar (Tronxy X3A) Thermistor
* 502 : 100K Zonestar Thermistor used by hot bed in Zonestar Průša P802M
* 512 : 100k RPW-Ultra hotend thermistor (4.7k pullup) * 512 : 100k RPW-Ultra hotend thermistor (4.7k pullup)
* 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
* 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
@ -378,13 +386,15 @@
* 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
* 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
* 10 : 100k RS thermistor 198-961 (4.7k pullup) * 10 : 100k RS thermistor 198-961 (4.7k pullup)
* 11 : 100k beta 3950 1% thermistor (4.7k pullup) * 11 : 100k beta 3950 1% thermistor (Used in Keenovo AC silicone mats and most Wanhao i3 machines) (4.7k pullup)
* 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
* 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
* 15 : 100k thermistor calibration for JGAurora A5 hotend * 15 : 100k thermistor calibration for JGAurora A5 hotend
* 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 * 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
* 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR) * 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....) * 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
* 22 : 100k (hotend) with 4.7k pullup to 3.3V and 220R to analog input (as in GTM32 Pro vB)
* 23 : 100k (bed) with 4.7k pullup to 3.3v and 220R to analog input (as in GTM32 Pro vB)
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x * 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
* 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
* 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup * 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
@ -400,7 +410,7 @@
* 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
* 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
* *
* 1047 : Pt1000 with 4k7 pullup * 1047 : Pt1000 with 4k7 pullup (E3D)
* 1010 : Pt1000 with 1k pullup (non standard) * 1010 : Pt1000 with 1k pullup (non standard)
* 147 : Pt100 with 4k7 pullup * 147 : Pt100 with 4k7 pullup
* 110 : Pt100 with 1k pullup (non standard) * 110 : Pt100 with 1k pullup (non standard)
@ -468,23 +478,19 @@
//=========================================================================== //===========================================================================
//============================= PID Settings ================================ //============================= PID Settings ================================
//=========================================================================== //===========================================================================
// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning // PID Tuning Guide here: https://reprap.org/wiki/PID_Tuning
// Comment the following line to disable PID and enable bang-bang. // Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP #define PIDTEMP
#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current #define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current
#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#define PID_K1 0.95 // Smoothing factor within any PID loop #define PID_K1 0.95 // Smoothing factor within any PID loop
#if ENABLED(PIDTEMP) #if ENABLED(PIDTEMP)
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) //#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_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
//#define PID_DEBUG // Sends debug data to the serial port. Use 'M303 D' to toggle activation.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#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_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) //#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] // Set/get with gcode: M301 E[extruder number, 0-2]
#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.
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
@ -583,6 +589,14 @@
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#endif // PIDTEMPBED #endif // PIDTEMPBED
#if EITHER(PIDTEMP, PIDTEMPBED)
//#define PID_DEBUG // Sends debug data to the serial port. Use 'M303 D' to toggle activation.
//#define PID_OPENLOOP // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#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.
#endif
// @section extruder // @section extruder
/** /**
@ -732,7 +746,7 @@
* Enable if your probe or endstops falsely trigger due to noise. * Enable if your probe or endstops falsely trigger due to noise.
* *
* - Higher values may affect repeatability or accuracy of some bed probes. * - Higher values may affect repeatability or accuracy of some bed probes.
* - To fix noise install a 100nF ceramic capacitor inline with the switch. * - To fix noise install a 100nF ceramic capacitor in parallel with the switch.
* - This feature is not required for common micro-switches mounted on PCBs * - This feature is not required for common micro-switches mounted on PCBs
* based on the Makerbot design, which already have the 100nF capacitor. * based on the Makerbot design, which already have the 100nF capacitor.
* *
@ -740,6 +754,9 @@
*/ */
//#define ENDSTOP_NOISE_THRESHOLD 2 //#define ENDSTOP_NOISE_THRESHOLD 2
// Check for stuck or disconnected endstops during homing moves.
//#define DETECT_BROKEN_ENDSTOP
//============================================================================= //=============================================================================
//============================== Movement Settings ============================ //============================== Movement Settings ============================
//============================================================================= //=============================================================================
@ -833,10 +850,12 @@
* *
* See: * See:
* https://reprap.org/forum/read.php?1,739819 * https://reprap.org/forum/read.php?1,739819
* http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html * https://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
*/ */
#if DISABLED(CLASSIC_JERK) #if DISABLED(CLASSIC_JERK)
#define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge
#define JD_HANDLE_SMALL_SEGMENTS // Use curvature estimation instead of just the junction angle
// for small segments (< 1mm) with large junction angles (> 135°).
#endif #endif
/** /**
@ -855,16 +874,19 @@
// @section probes // @section probes
// //
// See http://marlinfw.org/docs/configuration/probes.html // See https://marlinfw.org/docs/configuration/probes.html
// //
/** /**
* Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN * Enable this option for a probe connected to the Z-MIN pin.
* * The probe replaces the Z-MIN endstop and is used for Z homing.
* Enable this option for a probe connected to the Z Min endstop pin. * (Automatically enables USE_PROBE_FOR_Z_HOMING.)
*/ */
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
// Force the use of the probe for Z-axis homing
//#define USE_PROBE_FOR_Z_HOMING
/** /**
* Z_MIN_PROBE_PIN * Z_MIN_PROBE_PIN
* *
@ -921,6 +943,11 @@
*/ */
#define BLTOUCH #define BLTOUCH
/**
* Pressure sensor with a BLTouch-like interface
*/
//#define CREALITY_TOUCH
/** /**
* Touch-MI Probe by hotends.fr * Touch-MI Probe by hotends.fr
* *
@ -972,38 +999,48 @@
// //
/** /**
* Z Probe to nozzle (X,Y) offset, relative to (0, 0). * Nozzle-to-Probe offsets { X, Y, Z }
* *
* In the following example the X and Y offsets are both positive: * - Use a caliper or ruler to measure the distance from the tip of
* the Nozzle to the center-point of the Probe in the X and Y axes.
* - For the Z offset use your best known value and adjust at runtime.
* - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc.
* *
* #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } * Assuming the typical work area orientation:
* - Probe to RIGHT of the Nozzle has a Positive X offset
* - Probe to LEFT of the Nozzle has a Negative X offset
* - Probe in BACK of the Nozzle has a Positive Y offset
* - Probe in FRONT of the Nozzle has a Negative Y offset
*
* Some examples:
* #define NOZZLE_TO_PROBE_OFFSET { 10, 10, -1 } // Example "1"
* #define NOZZLE_TO_PROBE_OFFSET {-10, 5, -1 } // Example "2"
* #define NOZZLE_TO_PROBE_OFFSET { 5, -5, -1 } // Example "3"
* #define NOZZLE_TO_PROBE_OFFSET {-15,-10, -1 } // Example "4"
* *
* +-- BACK ---+ * +-- BACK ---+
* | | * | [+] |
* L | (+) P | R <-- probe (20,20) * L | 1 | R <-- Example "1" (right+, back+)
* E | | I * E | 2 | I <-- Example "2" ( left-, back+)
* F | (-) N (+) | G <-- nozzle (10,10) * F |[-] N [+]| G <-- Nozzle
* T | | H * T | 3 | H <-- Example "3" (right+, front-)
* | (-) | T * | 4 | T <-- Example "4" ( left-, front-)
* | | * | [-] |
* O-- FRONT --+ * O-- FRONT --+
* (0,0)
*
* Specify a Probe position as { X, Y, Z }
*/ */
#define NOZZLE_TO_PROBE_OFFSET { -33, -37, -1 } #define NOZZLE_TO_PROBE_OFFSET { -33, -37, -1 }
// Most probes should stay away from the edges of the bed, but // Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area. // with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define MIN_PROBE_EDGE 10 #define PROBING_MARGIN 10
// X and Y axis travel speed (mm/m) between probes // X and Y axis travel speed (mm/min) between probes
#define XY_PROBE_SPEED 8000 #define XY_PROBE_SPEED (133*60)
// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) // Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2)
#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
// Feedrate (mm/m) for the "accurate" probe of each point // Feedrate (mm/min) for the "accurate" probe of each point
#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
/** /**
@ -1074,18 +1111,18 @@
#define Z_ENABLE_ON 0 #define Z_ENABLE_ON 0
#define E_ENABLE_ON 0 // For all extruders #define E_ENABLE_ON 0 // For all extruders
// Disables axis stepper immediately when it's not being used. // Disable axis steppers immediately when they're not being stepped.
// WARNING: When motors turn off there is a chance of losing position accuracy! // WARNING: When motors turn off there is a chance of losing position accuracy!
#define DISABLE_X false #define DISABLE_X false
#define DISABLE_Y false #define DISABLE_Y false
#define DISABLE_Z false #define DISABLE_Z false
// Warn on display about possibly reduced accuracy // Turn off the display blinking that warns about possible accuracy reduction
//#define DISABLE_REDUCED_ACCURACY_WARNING //#define DISABLE_REDUCED_ACCURACY_WARNING
// @section extruder // @section extruder
#define DISABLE_E false // For all extruders #define DISABLE_E false // Disable the extruder when not stepping
#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled #define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled
// @section machine // @section machine
@ -1173,12 +1210,12 @@
* *
* RAMPS-based boards use SERVO3_PIN for the first runout sensor. * RAMPS-based boards use SERVO3_PIN for the first runout sensor.
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
* By default the firmware assumes HIGH=FILAMENT PRESENT.
*/ */
//#define FILAMENT_RUNOUT_SENSOR //#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
#define FIL_RUNOUT_INVERTING false // Set to true to invert the logic of the sensor. #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
@ -1370,7 +1407,6 @@
*/ */
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
// @section homing // @section homing
// The center of the bed is at (X=0, Y=0) // The center of the bed is at (X=0, Y=0)
@ -1388,17 +1424,17 @@
// //
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. // - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
// - If stepper drivers time out, it will need X and Y homing again before Z homing. // - If stepper drivers time out, it will need X and Y homing again before Z homing.
// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
// - Prevent Z homing when the Z probe is outside bed area. // - Prevent Z homing when the Z probe is outside bed area.
// //
#define Z_SAFE_HOMING #define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING) #if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). #define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
#define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). #define Z_SAFE_HOMING_Y_POINT Y_CENTER // Y point for Z homing
#endif #endif
// Homing speeds (mm/m) // Homing speeds (mm/min)
#define HOMING_FEEDRATE_XY (50*60) #define HOMING_FEEDRATE_XY (50*60)
#define HOMING_FEEDRATE_Z (4*60) #define HOMING_FEEDRATE_Z (4*60)
@ -1533,6 +1569,9 @@
#if ENABLED(NOZZLE_PARK_FEATURE) #if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z_raise } // Specify a park position as { X, Y, Z_raise }
#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
//#define NOZZLE_PARK_X_ONLY // X move only is required to park
//#define NOZZLE_PARK_Y_ONLY // Y move only is required to park
#define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance
#define NOZZLE_PARK_XY_FEEDRATE 80 // (mm/s) X and Y axes feedrate (also used for delta Z axis) #define NOZZLE_PARK_XY_FEEDRATE 80 // (mm/s) X and Y axes feedrate (also used for delta Z axis)
#define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers)
#endif #endif
@ -1599,8 +1638,15 @@
// Move the nozzle to the initial position after cleaning // Move the nozzle to the initial position after cleaning
#define NOZZLE_CLEAN_GOBACK #define NOZZLE_CLEAN_GOBACK
// Enable for a purge/clean station that's always at the gantry height (thus no Z move) // For a purge/clean station that's always at the gantry height (thus no Z move)
//#define NOZZLE_CLEAN_NO_Z //#define NOZZLE_CLEAN_NO_Z
// For a purge/clean station mounted on the X axis
//#define NOZZLE_CLEAN_NO_Y
// Explicit wipe G-code script applies to a G12 with no arguments.
//#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0"
#endif #endif
/** /**
@ -1634,6 +1680,37 @@
*/ */
#define PRINTCOUNTER #define PRINTCOUNTER
/**
* Password
*
* Set a numerical password for the printer which can be requested:
*
* - When the printer boots up
* - Upon opening the 'Print from Media' Menu
* - When SD printing is completed or aborted
*
* The following G-codes can be used:
*
* M510 - Lock Printer. Blocks all commands except M511.
* M511 - Unlock Printer.
* M512 - Set, Change and Remove Password.
*
* If you forget the password and get locked out you'll need to re-flash
* the firmware with the feature disabled, reset EEPROM, and (optionally)
* re-flash the firmware again with this feature enabled.
*/
//#define PASSWORD_FEATURE
#if ENABLED(PASSWORD_FEATURE)
#define PASSWORD_LENGTH 4 // (#) Number of digits (1-9). 3 or 4 is recommended
#define PASSWORD_ON_STARTUP
#define PASSWORD_UNLOCK_GCODE // Unlock with the M511 P<password> command. Disable to prevent brute-force attack.
#define PASSWORD_CHANGE_GCODE // Change the password with M512 P<old> S<new>.
//#define PASSWORD_ON_SD_PRINT_MENU // This does not prevent gcodes from running
//#define PASSWORD_AFTER_SD_PRINT_END
//#define PASSWORD_AFTER_SD_PRINT_ABORT
//#include "Configuration_Secure.h" // External file with PASSWORD_DEFAULT_VALUE
#endif
//============================================================================= //=============================================================================
//============================= LCD and SD support ============================ //============================= LCD and SD support ============================
//============================================================================= //=============================================================================
@ -1645,10 +1722,10 @@
* *
* Select the language to display on the LCD. These languages are available: * Select the language to display on the LCD. These languages are available:
* *
* en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana, * en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, hu, it,
* ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test * jp_kana, ko_KR, nl, pl, pt, pt_br, ro, ru, sk, tr, uk, vi, zh_CN, zh_TW, test
* *
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' }
*/ */
#define LCD_LANGUAGE en #define LCD_LANGUAGE en
@ -1670,16 +1747,16 @@
* - Click the controller to view the LCD menu * - Click the controller to view the LCD menu
* - The LCD will display Japanese, Western, or Cyrillic text * - The LCD will display Japanese, Western, or Cyrillic text
* *
* See http://marlinfw.org/docs/development/lcd_language.html * See https://marlinfw.org/docs/development/lcd_language.html
* *
* :['JAPANESE', 'WESTERN', 'CYRILLIC'] * :['JAPANESE', 'WESTERN', 'CYRILLIC']
*/ */
#define DISPLAY_CHARSET_HD44780 JAPANESE #define DISPLAY_CHARSET_HD44780 JAPANESE
/** /**
* Info Screen Style (0:Classic, 1:Prusa) * Info Screen Style (0:Classic, 1:Průša)
* *
* :[0:'Classic', 1:'Prusa'] * :[0:'Classic', 1:'Průša']
*/ */
#define LCD_INFO_SCREEN_STYLE 0 #define LCD_INFO_SCREEN_STYLE 0
@ -1797,7 +1874,7 @@
// //
// RepRapDiscount Smart Controller. // RepRapDiscount Smart Controller.
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // https://reprap.org/wiki/RepRapDiscount_Smart_Controller
// //
// Note: Usually sold with a white PCB. // Note: Usually sold with a white PCB.
// //
@ -1821,13 +1898,13 @@
// //
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne // https://reprap.org/wiki/PanelOne
// //
//#define PANEL_ONE //#define PANEL_ONE
// //
// GADGETS3D G3D LCD/SD Controller // GADGETS3D G3D LCD/SD Controller
// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel // https://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
// //
// Note: Usually sold with a blue PCB. // Note: Usually sold with a blue PCB.
// //
@ -1914,7 +1991,7 @@
// //
// 2-wire Non-latching LCD SR from https://goo.gl/aJJ4sH // 2-wire Non-latching LCD SR from https://goo.gl/aJJ4sH
// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD // LCD configuration: https://reprap.org/wiki/SAV_3D_LCD
// //
//#define SAV_3DLCD //#define SAV_3DLCD
@ -1936,10 +2013,12 @@
// IMPORTANT: The U8glib library is required for Graphical Display! // IMPORTANT: The U8glib library is required for Graphical Display!
// https://github.com/olikraus/U8glib_Arduino // https://github.com/olikraus/U8glib_Arduino
// //
// NOTE: If the LCD is unresponsive you may need to reverse the plugs.
//
// //
// RepRapDiscount FULL GRAPHIC Smart Controller // RepRapDiscount FULL GRAPHIC Smart Controller
// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller // https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
// //
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
@ -1952,20 +2031,20 @@
// //
// Activate one of these if you have a Panucatt Devices // Activate one of these if you have a Panucatt Devices
// Viki 2.0 or mini Viki with Graphic LCD // Viki 2.0 or mini Viki with Graphic LCD
// http://panucatt.com // https://www.panucatt.com
// //
//#define VIKI2 //#define VIKI2
//#define miniVIKI //#define miniVIKI
// //
// MakerLab Mini Panel with graphic // MakerLab Mini Panel with graphic
// controller and SD support - http://reprap.org/wiki/Mini_panel // controller and SD support - https://reprap.org/wiki/Mini_panel
// //
//#define MINIPANEL //#define MINIPANEL
// //
// MaKr3d Makr-Panel with graphic controller and SD support. // MaKr3d Makr-Panel with graphic controller and SD support.
// http://reprap.org/wiki/MaKr3d_MaKrPanel // https://reprap.org/wiki/MaKr3d_MaKrPanel
// //
//#define MAKRPANEL //#define MAKRPANEL
@ -2008,6 +2087,12 @@
// //
//#define MKS_MINI_12864 //#define MKS_MINI_12864
//
// MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout.
// https://www.aliexpress.com/item/33018110072.html
//
//#define MKS_LCD12864
// //
// FYSETC variant of the MINI12864 graphic controller with SD support // FYSETC variant of the MINI12864 graphic controller with SD support
// https://wiki.fysetc.com/Mini12864_Panel/ // https://wiki.fysetc.com/Mini12864_Panel/
@ -2015,7 +2100,7 @@
//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default //#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default
//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) //#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on)
//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight //#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight
//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight //#define FYSETC_MINI_12864_2_1 // Type A/B. NeoPixel RGB Backlight
//#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight. //#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight.
// //
@ -2049,7 +2134,7 @@
// //
// Silvergate GLCD controller // Silvergate GLCD controller
// http://github.com/android444/Silvergate // https://github.com/android444/Silvergate
// //
//#define SILVER_GATE_GLCD_CONTROLLER //#define SILVER_GATE_GLCD_CONTROLLER
@ -2078,13 +2163,20 @@
// //
// MKS OLED 1.3" 128×64 FULL GRAPHICS CONTROLLER // MKS OLED 1.3" 128×64 FULL GRAPHICS CONTROLLER
// http://reprap.org/wiki/MKS_12864OLED // https://reprap.org/wiki/MKS_12864OLED
// //
// Tiny, but very sharp OLED display // Tiny, but very sharp OLED display
// //
//#define MKS_12864OLED // Uses the SH1106 controller (default) //#define MKS_12864OLED // Uses the SH1106 controller (default)
//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller //#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller
//
// Zonestar OLED 128×64 FULL GRAPHICS CONTROLLER
//
//#define ZONESTAR_12864LCD // Graphical (DOGM) with ST7920 controller
//#define ZONESTAR_12864OLED // 1.3" OLED with SH1106 controller (default)
//#define ZONESTAR_12864OLED_SSD1306 // 0.96" OLED with SSD1306 controller
// //
// Einstart S OLED SSD1306 // Einstart S OLED SSD1306
// //
@ -2095,19 +2187,26 @@
// //
//#define OVERLORD_OLED //#define OVERLORD_OLED
//
// FYSETC OLED 2.42" 128×64 FULL GRAPHICS CONTROLLER with WS2812 RGB
// Where to find : https://www.aliexpress.com/item/4000345255731.html
//#define FYSETC_242_OLED_12864 // Uses the SSD1309 controller
//============================================================================= //=============================================================================
//========================== Extensible UI Displays =========================== //========================== Extensible UI Displays ===========================
//============================================================================= //=============================================================================
// //
// DGUS Touch Display with DWIN OS. (Choose one.) // DGUS Touch Display with DWIN OS. (Choose one.)
// ORIGIN : https://www.aliexpress.com/item/32993409517.html
// FYSETC : https://www.aliexpress.com/item/32961471929.html
// //
//#define DGUS_LCD_UI_ORIGIN //#define DGUS_LCD_UI_ORIGIN
//#define DGUS_LCD_UI_FYSETC //#define DGUS_LCD_UI_FYSETC
//#define DGUS_LCD_UI_HIPRECY //#define DGUS_LCD_UI_HIPRECY
// //
// Touch-screen LCD for Malyan M200 printers // Touch-screen LCD for Malyan M200/M300 printers
// //
//#define MALYAN_LCD //#define MALYAN_LCD
@ -2117,42 +2216,96 @@
// //
//#define TOUCH_UI_FTDI_EVE //#define TOUCH_UI_FTDI_EVE
//
// Touch-screen LCD for Anycubic printers
//
//#define ANYCUBIC_LCD_I3MEGA
//#define ANYCUBIC_LCD_CHIRON
#if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
#define ANYCUBIC_LCD_SERIAL_PORT 3
//#define ANYCUBIC_LCD_DEBUG
#endif
// //
// Third-party or vendor-customized controller interfaces. // Third-party or vendor-customized controller interfaces.
// Sources should be installed in 'src/lcd/extensible_ui'. // Sources should be installed in 'src/lcd/extensible_ui'.
// //
//#define EXTENSIBLE_UI //#define EXTENSIBLE_UI
#if ENABLED(EXTENSIBLE_UI)
//#define EXTUI_LOCAL_BEEPER // Enables use of local Beeper pin with external display
#endif
//============================================================================= //=============================================================================
//=============================== Graphical TFTs ============================== //=============================== Graphical TFTs ==============================
//============================================================================= //=============================================================================
//
// TFT display with optional touch screen
// Color Marlin UI with standard menu system
//
//#define TFT_320x240
//#define TFT_320x240_SPI
//#define TFT_480x320
//#define TFT_480x320_SPI
//
// Skip autodetect and force specific TFT driver
// Mandatory for SPI screens with no MISO line
// Available drivers are: ST7735, ST7789, ST7796, R61505, ILI9328, ILI9341, ILI9488
//
//#define TFT_DRIVER AUTO
//
// SPI display (MKS Robin Nano V2.0, MKS Gen L V2.0)
// Upscaled 128x64 Marlin UI
//
//#define SPI_GRAPHICAL_TFT
// //
// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.) // FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
// Upscaled 128x64 Marlin UI
// //
//#define FSMC_GRAPHICAL_TFT //#define FSMC_GRAPHICAL_TFT
//
// TFT LVGL UI
//
// Using default MKS icons and fonts from: https://git.io/JJvzK
// Just copy the 'assets' folder from the build directory to the
// root of your SD card, together with the compiled firmware.
//
//#define TFT_LVGL_UI_FSMC // Robin nano v1.2 uses FSMC
//#define TFT_LVGL_UI_SPI // Robin nano v2.0 uses SPI
//============================================================================= //=============================================================================
//============================ Other Controllers ============================ //============================ Other Controllers ============================
//============================================================================= //=============================================================================
//
// Ender-3 v2 OEM display. A DWIN display with Rotary Encoder.
//
//#define DWIN_CREALITY_LCD
// //
// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
// //
//#define TOUCH_BUTTONS //#define TOUCH_SCREEN
#if ENABLED(TOUCH_BUTTONS) #if ENABLED(TOUCH_SCREEN)
#define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens #define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
#define XPT2046_X_CALIBRATION 12316 #define TOUCH_SCREEN_CALIBRATION
#define XPT2046_Y_CALIBRATION -8981
#define XPT2046_X_OFFSET -43 //#define XPT2046_X_CALIBRATION 12316
#define XPT2046_Y_OFFSET 257 //#define XPT2046_Y_CALIBRATION -8981
//#define XPT2046_X_OFFSET -43
//#define XPT2046_Y_OFFSET 257
#endif #endif
// //
// RepRapWorld REPRAPWORLD_KEYPAD v1.1 // RepRapWorld REPRAPWORLD_KEYPAD v1.1
// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 // https://reprapworld.com/products/electronics/ramps/keypad_v1_0_fully_assembled/
// //
//#define REPRAPWORLD_KEYPAD //#define REPRAPWORLD_KEYPAD
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press //#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
@ -2163,6 +2316,10 @@
// @section extras // @section extras
// Set number of user-controlled fans. Disable to use all board-defined fans.
// :[1,2,3,4,5,6,7,8]
//#define NUM_M106_FANS 1
// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino // Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
//#define FAST_PWM_FAN //#define FAST_PWM_FAN
@ -2189,7 +2346,7 @@
// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) // then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis)
//#define TEMP_STAT_LEDS //#define TEMP_STAT_LEDS
// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure // SkeinForge sends the wrong arc G-codes when using Arc Point as fillet procedure
//#define SF_ARC_FIX //#define SF_ARC_FIX
// Support for the BariCUDA Paste Extruder // Support for the BariCUDA Paste Extruder
@ -2202,7 +2359,6 @@
//#define PCA9632 //#define PCA9632
// Support for PCA9533 PWM LED driver // Support for PCA9533 PWM LED driver
// https://github.com/mikeshub/SailfishRGB_LED
//#define PCA9533 //#define PCA9533
/** /**
@ -2214,13 +2370,13 @@
* Adds the M150 command to set the LED (or LED strip) color. * Adds the M150 command to set the LED (or LED strip) color.
* If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
* luminance values can be set from 0 to 255. * luminance values can be set from 0 to 255.
* For Neopixel LED an overall brightness parameter is also available. * For NeoPixel LED an overall brightness parameter is also available.
* *
* *** CAUTION *** * *** CAUTION ***
* LED Strips require a MOSFET Chip between PWM lines and LEDs, * LED Strips require a MOSFET Chip between PWM lines and LEDs,
* as the Arduino cannot handle the current the LEDs will require. * as the Arduino cannot handle the current the LEDs will require.
* Failure to follow this precaution can destroy your Arduino! * Failure to follow this precaution can destroy your Arduino!
* NOTE: A separate 5V power supply is required! The Neopixel LED needs * NOTE: A separate 5V power supply is required! The NeoPixel LED needs
* more current than the Arduino 5V linear regulator can produce. * more current than the Arduino 5V linear regulator can produce.
* *** CAUTION *** * *** CAUTION ***
* *
@ -2237,19 +2393,29 @@
//#define RGB_LED_W_PIN -1 //#define RGB_LED_W_PIN -1
#endif #endif
// Support for Adafruit Neopixel LED driver // Support for Adafruit NeoPixel LED driver
//#define NEOPIXEL_LED //#define NEOPIXEL_LED
#if ENABLED(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_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 NEOPIXEL_PIN 4 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5 //#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #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_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_BRIGHTNESS 127 // Initial brightness (0-255)
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
// Use a single Neopixel LED for static (background) lighting // 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
#else
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
#endif
// Use a single NeoPixel LED for static (background) lighting
//#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use //#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use
//#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W //#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@
# Detailed instructions for using the makefile: # Detailed instructions for using the makefile:
# #
# 1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that # 1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that
# contains the Arduino installation (for example, under Mac OS X, this # contains the Arduino installation (for example, under macOS, this
# might be /Applications/Arduino.app/Contents/Resources/Java). # might be /Applications/Arduino.app/Contents/Resources/Java).
# #
# 2. Modify the line containing "UPLOAD_PORT" to refer to the filename # 2. Modify the line containing "UPLOAD_PORT" to refer to the filename
@ -98,7 +98,7 @@ NEOPIXEL ?= 0
############ ############
# Try to automatically determine whether RELOC_WORKAROUND is needed based # Try to automatically determine whether RELOC_WORKAROUND is needed based
# on GCC versions: # on GCC versions:
# http://www.avrfreaks.net/comment/1789106#comment-1789106 # https://www.avrfreaks.net/comment/1789106#comment-1789106
CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ ) CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ )
CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ ) CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ )
@ -170,105 +170,110 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1100)
else ifeq ($(HARDWARE_MOTHERBOARD),1101) else ifeq ($(HARDWARE_MOTHERBOARD),1101)
# Velleman K8400 Controller (derived from 3Drag Controller) # Velleman K8400 Controller (derived from 3Drag Controller)
else ifeq ($(HARDWARE_MOTHERBOARD),1102) else ifeq ($(HARDWARE_MOTHERBOARD),1102)
# 2PrintBeta BAM&DICE with STK drivers # Velleman K8600 Controller (derived from 3Drag Controller)
else ifeq ($(HARDWARE_MOTHERBOARD),1103) else ifeq ($(HARDWARE_MOTHERBOARD),1103)
# 2PrintBeta BAM&DICE Due with STK drivers # 2PrintBeta BAM&DICE with STK drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1104) else ifeq ($(HARDWARE_MOTHERBOARD),1104)
# MKS BASE v1.0 # 2PrintBeta BAM&DICE Due with STK drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1105) else ifeq ($(HARDWARE_MOTHERBOARD),1105)
# MKS v1.4 with A4982 stepper drivers # MKS BASE v1.0
else ifeq ($(HARDWARE_MOTHERBOARD),1106) else ifeq ($(HARDWARE_MOTHERBOARD),1106)
# MKS v1.5 with Allegro A4982 stepper drivers # MKS v1.4 with A4982 stepper drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1107) else ifeq ($(HARDWARE_MOTHERBOARD),1107)
# MKS v1.6 with Allegro A4982 stepper drivers # MKS v1.5 with Allegro A4982 stepper drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1108) else ifeq ($(HARDWARE_MOTHERBOARD),1108)
# MKS v1.6 with Allegro A4982 stepper drivers
# MKS BASE 1.0 with Heroic HR4982 stepper drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1109) else ifeq ($(HARDWARE_MOTHERBOARD),1109)
# MKS GEN v1.3 or 1.4 # MKS BASE 1.0 with Heroic HR4982 stepper drivers
else ifeq ($(HARDWARE_MOTHERBOARD),1110) else ifeq ($(HARDWARE_MOTHERBOARD),1110)
# MKS GEN L # MKS GEN v1.3 or 1.4
else ifeq ($(HARDWARE_MOTHERBOARD),1111) else ifeq ($(HARDWARE_MOTHERBOARD),1111)
# zrib V2.0 control board (Chinese knock off RAMPS replica) # MKS GEN L
else ifeq ($(HARDWARE_MOTHERBOARD),1112) else ifeq ($(HARDWARE_MOTHERBOARD),1112)
# BigTreeTech or BIQU KFB2.0 # zrib V2.0 control board (Chinese knock off RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1113) else ifeq ($(HARDWARE_MOTHERBOARD),1113)
# Felix 2.0+ Electronics Board (RAMPS like) # BigTreeTech or BIQU KFB2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1114) else ifeq ($(HARDWARE_MOTHERBOARD),1114)
# Invent-A-Part RigidBoard # Felix 2.0+ Electronics Board (RAMPS like)
else ifeq ($(HARDWARE_MOTHERBOARD),1115) else ifeq ($(HARDWARE_MOTHERBOARD),1115)
# Invent-A-Part RigidBoard V2 # Invent-A-Part RigidBoard
else ifeq ($(HARDWARE_MOTHERBOARD),1116) else ifeq ($(HARDWARE_MOTHERBOARD),1116)
# Sainsmart 2-in-1 board # Invent-A-Part RigidBoard V2
else ifeq ($(HARDWARE_MOTHERBOARD),1117) else ifeq ($(HARDWARE_MOTHERBOARD),1117)
# Ultimaker # Sainsmart 2-in-1 board
else ifeq ($(HARDWARE_MOTHERBOARD),1118) else ifeq ($(HARDWARE_MOTHERBOARD),1118)
# Ultimaker (Older electronics. Pre 1.5.4. This is rare) # Ultimaker
else ifeq ($(HARDWARE_MOTHERBOARD),1119) else ifeq ($(HARDWARE_MOTHERBOARD),1119)
# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
else ifeq ($(HARDWARE_MOTHERBOARD),1120)
MCU ?= atmega1280 MCU ?= atmega1280
# Azteeg X3 # Azteeg X3
else ifeq ($(HARDWARE_MOTHERBOARD),1120)
# Azteeg X3 Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1121) else ifeq ($(HARDWARE_MOTHERBOARD),1121)
# Ultimainboard 2.x (Uses TEMP_SENSOR 20) # Azteeg X3 Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1122) else ifeq ($(HARDWARE_MOTHERBOARD),1122)
# Rumba # Ultimainboard 2.x (Uses TEMP_SENSOR 20)
else ifeq ($(HARDWARE_MOTHERBOARD),1123) else ifeq ($(HARDWARE_MOTHERBOARD),1123)
# Raise3D Rumba # Rumba
else ifeq ($(HARDWARE_MOTHERBOARD),1124) else ifeq ($(HARDWARE_MOTHERBOARD),1124)
# Rapide Lite RL200 Rumba # Raise3D Rumba
else ifeq ($(HARDWARE_MOTHERBOARD),1125) else ifeq ($(HARDWARE_MOTHERBOARD),1125)
# Formbot T-Rex 2 Plus # Rapide Lite RL200 Rumba
else ifeq ($(HARDWARE_MOTHERBOARD),1126) else ifeq ($(HARDWARE_MOTHERBOARD),1126)
# Formbot T-Rex 3 # Formbot T-Rex 2 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1127) else ifeq ($(HARDWARE_MOTHERBOARD),1127)
# Formbot Raptor # Formbot T-Rex 3
else ifeq ($(HARDWARE_MOTHERBOARD),1128) else ifeq ($(HARDWARE_MOTHERBOARD),1128)
# Formbot Raptor 2 # Formbot Raptor
else ifeq ($(HARDWARE_MOTHERBOARD),1129) else ifeq ($(HARDWARE_MOTHERBOARD),1129)
# bq ZUM Mega 3D # Formbot Raptor 2
else ifeq ($(HARDWARE_MOTHERBOARD),1130) else ifeq ($(HARDWARE_MOTHERBOARD),1130)
# MakeBoard Mini v2.1.2 is a control board sold by MicroMake # bq ZUM Mega 3D
else ifeq ($(HARDWARE_MOTHERBOARD),1131) else ifeq ($(HARDWARE_MOTHERBOARD),1131)
# TriGorilla Anycubic version 1.3 based on RAMPS EFB # MakeBoard Mini v2.1.2 is a control board sold by MicroMake
else ifeq ($(HARDWARE_MOTHERBOARD),1132) else ifeq ($(HARDWARE_MOTHERBOARD),1132)
# TriGorilla Anycubic version 1.4 based on RAMPS EFB # TriGorilla Anycubic version 1.3 based on RAMPS EFB
else ifeq ($(HARDWARE_MOTHERBOARD),1133) else ifeq ($(HARDWARE_MOTHERBOARD),1133)
# TriGorilla Anycubic version 1.4 Rev 1.1 # TriGorilla Anycubic version 1.4 based on RAMPS EFB
else ifeq ($(HARDWARE_MOTHERBOARD),1134) else ifeq ($(HARDWARE_MOTHERBOARD),1134)
# Creality: Ender-4, CR-8 # TriGorilla Anycubic version 1.4 Rev 1.1
else ifeq ($(HARDWARE_MOTHERBOARD),1135) else ifeq ($(HARDWARE_MOTHERBOARD),1135)
# Creality: CR10S, CR20, CR-X # Creality: Ender-4, CR-8
else ifeq ($(HARDWARE_MOTHERBOARD),1136) else ifeq ($(HARDWARE_MOTHERBOARD),1136)
# Dagoma F5 # Creality: CR10S, CR20, CR-X
else ifeq ($(HARDWARE_MOTHERBOARD),1137) else ifeq ($(HARDWARE_MOTHERBOARD),1137)
# FYSETC F6 1.3 # Dagoma F5
else ifeq ($(HARDWARE_MOTHERBOARD),1138) else ifeq ($(HARDWARE_MOTHERBOARD),1138)
# FYSETC F6 1.5 # FYSETC F6 1.3
else ifeq ($(HARDWARE_MOTHERBOARD),1139) else ifeq ($(HARDWARE_MOTHERBOARD),1139)
# Duplicator i3 Plus # FYSETC F6 1.5
else ifeq ($(HARDWARE_MOTHERBOARD),1140) else ifeq ($(HARDWARE_MOTHERBOARD),1140)
# VORON # Duplicator i3 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1141) else ifeq ($(HARDWARE_MOTHERBOARD),1141)
# TRONXY V3 1.0 # VORON
else ifeq ($(HARDWARE_MOTHERBOARD),1142) else ifeq ($(HARDWARE_MOTHERBOARD),1142)
# Z-Bolt X Series # TRONXY V3 1.0
else ifeq ($(HARDWARE_MOTHERBOARD),1143) else ifeq ($(HARDWARE_MOTHERBOARD),1143)
# TT OSCAR # Z-Bolt X Series
else ifeq ($(HARDWARE_MOTHERBOARD),1144) else ifeq ($(HARDWARE_MOTHERBOARD),1144)
# Overlord/Overlord Pro # TT OSCAR
else ifeq ($(HARDWARE_MOTHERBOARD),1145) else ifeq ($(HARDWARE_MOTHERBOARD),1145)
# ADIMLab Gantry v1 # Overlord/Overlord Pro
else ifeq ($(HARDWARE_MOTHERBOARD),1146) else ifeq ($(HARDWARE_MOTHERBOARD),1146)
# ADIMLab Gantry v2 # ADIMLab Gantry v1
else ifeq ($(HARDWARE_MOTHERBOARD),1147) else ifeq ($(HARDWARE_MOTHERBOARD),1147)
# BIQU Tango V1 # ADIMLab Gantry v2
else ifeq ($(HARDWARE_MOTHERBOARD),1148) else ifeq ($(HARDWARE_MOTHERBOARD),1148)
# MKS GEN L V2 # BIQU Tango V1
else ifeq ($(HARDWARE_MOTHERBOARD),1149) else ifeq ($(HARDWARE_MOTHERBOARD),1149)
# Copymaster 3D # MKS GEN L V2
else ifeq ($(HARDWARE_MOTHERBOARD),1150) else ifeq ($(HARDWARE_MOTHERBOARD),1150)
# Copymaster 3D
else ifeq ($(HARDWARE_MOTHERBOARD),1151)
# Ortur 4
else ifeq ($(HARDWARE_MOTHERBOARD),1152)
# Tenlog D3 Hero
else ifeq ($(HARDWARE_MOTHERBOARD),1153)
# #
# RAMBo and derivatives # RAMBo and derivatives
@ -361,34 +366,38 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1501)
else ifeq ($(HARDWARE_MOTHERBOARD),1502) else ifeq ($(HARDWARE_MOTHERBOARD),1502)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega644p MCU ?= atmega644p
# Melzi with ATmega1284 (MaKr3d version) # Melzi V2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1503) else ifeq ($(HARDWARE_MOTHERBOARD),1503)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
# Melzi Creality3D board (for CR-10 etc) # Melzi with ATmega1284 (MaKr3d version)
else ifeq ($(HARDWARE_MOTHERBOARD),1504) else ifeq ($(HARDWARE_MOTHERBOARD),1504)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
# Melzi Malyan M150 board # Melzi Creality3D board (for CR-10 etc)
else ifeq ($(HARDWARE_MOTHERBOARD),1505) else ifeq ($(HARDWARE_MOTHERBOARD),1505)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
# Tronxy X5S # Melzi Malyan M150 board
else ifeq ($(HARDWARE_MOTHERBOARD),1506) else ifeq ($(HARDWARE_MOTHERBOARD),1506)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
# STB V1.1 # Tronxy X5S
else ifeq ($(HARDWARE_MOTHERBOARD),1507) else ifeq ($(HARDWARE_MOTHERBOARD),1507)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
# Azteeg X1 # STB V1.1
else ifeq ($(HARDWARE_MOTHERBOARD),1508) else ifeq ($(HARDWARE_MOTHERBOARD),1508)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
# Anet 1.0 (Melzi clone) # Azteeg X1
else ifeq ($(HARDWARE_MOTHERBOARD),1509) else ifeq ($(HARDWARE_MOTHERBOARD),1509)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p MCU ?= atmega1284p
# Anet 1.0 (Melzi clone)
else ifeq ($(HARDWARE_MOTHERBOARD),1510)
HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega1284p
# #
# Other ATmega644P, ATmega644, ATmega1284P # Other ATmega644P, ATmega644, ATmega1284P

View File

@ -1,9 +1,8 @@
/* /*==============================================================================
================================================================================
Marlin Firmware Marlin Firmware
(c) 2011-2019 MarlinFirmware (c) 2011-2020 MarlinFirmware
Portions of Marlin are (c) by their respective authors. Portions of Marlin are (c) by their respective authors.
All code complies with GPLv2 and/or GPLv3 All code complies with GPLv2 and/or GPLv3
@ -12,30 +11,33 @@
Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware. Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware.
To configure Marlin you must edit Configuration.h and Configuration_adv.h To configure Marlin you must edit Configuration.h and Configuration_adv.h
located in the root 'Marlin' folder. Check the config/examples folder to see if located in the root 'Marlin' folder. Check our Configurations repository to
there's a more suitable starting-point for your specific hardware. see if there's a more suitable starting-point for your specific hardware.
Before diving in, we recommend the following essential links: Before diving in, we recommend the following essential links:
Marlin Firmware Official Website Marlin Firmware Official Website
- http://marlinfw.org/ - https://marlinfw.org/
The official Marlin Firmware website contains the most up-to-date The official Marlin Firmware website contains the most up-to-date
documentation. Contributions are always welcome! documentation. Contributions are always welcome!
Configuration Configuration
- https://github.com/MarlinFirmware/Configurations
Example configurations for several printer models.
- https://www.youtube.com/watch?v=3gwWVFtdg-4 - https://www.youtube.com/watch?v=3gwWVFtdg-4
A good 20-minute overview of Marlin configuration by Tom Sanladerer. A good 20-minute overview of Marlin configuration by Tom Sanladerer.
(Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.) (Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.)
Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin
- http://marlinfw.org/docs/configuration/configuration.html - https://marlinfw.org/docs/configuration/configuration.html
Marlin's configuration options are explained in more detail here. Marlin's configuration options are explained in more detail here.
Getting Help Getting Help
- http://forums.reprap.org/list.php?415 - https://reprap.org/forum/list.php?415
The Marlin Discussion Forum is a great place to get help from other Marlin The Marlin Discussion Forum is a great place to get help from other Marlin
users who may have experienced similar issues to your own. users who may have experienced similar issues to your own.
@ -45,9 +47,11 @@ Getting Help
Contributing Contributing
- http://marlinfw.org/docs/development/contributing.html - https://marlinfw.org/docs/development/contributing.html
If you'd like to contribute to Marlin, read this first! If you'd like to contribute to Marlin, read this first!
- http://marlinfw.org/docs/development/coding_standards.html - https://marlinfw.org/docs/development/coding_standards.html
Before submitting code get to know the Coding Standards. Before submitting code get to know the Coding Standards.
*/
------------------------------------------------------------------------------*/

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -28,20 +28,20 @@
/** /**
* Marlin release version identifier * Marlin release version identifier
*/ */
//#define SHORT_BUILD_VERSION "2.0.5.3" //#define SHORT_BUILD_VERSION "2.0.6.1"
/** /**
* Verbose version identifier which should contain a reference to the location * Verbose version identifier which should contain a reference to the location
* from where the binary was downloaded or the source code was compiled. * from where the binary was downloaded or the source code was compiled.
*/ */
//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" //#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION
/** /**
* The STRING_DISTRIBUTION_DATE represents when the binary file was built, * The STRING_DISTRIBUTION_DATE represents when the binary file was built,
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
//#define STRING_DISTRIBUTION_DATE "2020-01-31" //#define STRING_DISTRIBUTION_DATE "2020-07-09"
/** /**
* Defines a generic printer name to be output to the LCD after booting Marlin. * Defines a generic printer name to be output to the LCD after booting Marlin.
@ -65,7 +65,7 @@
* The WEBSITE_URL is the location where users can get more information such as * The WEBSITE_URL is the location where users can get more information such as
* documentation about a specific Marlin release. * documentation about a specific Marlin release.
*/ */
//#define WEBSITE_URL "http://marlinfw.org" //#define WEBSITE_URL "https://marlinfw.org"
/** /**
* Set the vendor info the serial USB interface, if changable * Set the vendor info the serial USB interface, if changable

View File

@ -33,4 +33,4 @@ PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them. include paths and build them.
More information about PlatformIO Library Dependency Finder More information about PlatformIO Library Dependency Finder
- http://docs.platformio.org/page/librarymanager/ldf.html - https://docs.platformio.org/page/librarymanager/ldf.html

View File

@ -16,10 +16,9 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#ifdef __AVR__ #ifdef __AVR__
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"

View File

@ -14,7 +14,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#pragma once #pragma once
@ -50,7 +50,11 @@
// Defines // Defines
// ------------------------ // ------------------------
//#define analogInputToDigitalPin(IO) IO // AVR PROGMEM extension for sprintf_P
#define S_FMT "%S"
// AVR PROGMEM extension for string define
#define PGMSTR(NAM,STR) const char NAM[] PROGMEM = STR
#ifndef CRITICAL_SECTION_START #ifndef CRITICAL_SECTION_START
#define CRITICAL_SECTION_START() unsigned char _sreg = SREG; cli() #define CRITICAL_SECTION_START() unsigned char _sreg = SREG; cli()
@ -60,16 +64,10 @@
#define ENABLE_ISRS() sei() #define ENABLE_ISRS() sei()
#define DISABLE_ISRS() cli() #define DISABLE_ISRS() cli()
// On AVR this is in math.h?
//#define square(x) ((x)*(x))
// ------------------------ // ------------------------
// Types // Types
// ------------------------ // ------------------------
typedef uint16_t hal_timer_t;
#define HAL_TIMER_TYPE_MAX 0xFFFF
typedef int8_t pin_t; typedef int8_t pin_t;
#define SHARED_SERVOS HAS_SERVOS #define SHARED_SERVOS HAS_SERVOS
@ -122,6 +120,17 @@ typedef int8_t pin_t;
#define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.get_tx_buffer_free #define DGUS_SERIAL_GET_TX_BUFFER_FREE DGUS_SERIAL.get_tx_buffer_free
#endif #endif
#ifdef ANYCUBIC_LCD_SERIAL_PORT
#if !WITHIN(ANYCUBIC_LCD_SERIAL_PORT, -1, 3)
#error "ANYCUBIC_LCD_SERIAL_PORT must be from -1 to 3. Please update your configuration."
#elif ANYCUBIC_LCD_SERIAL_PORT == SERIAL_PORT
#error "ANYCUBIC_LCD_SERIAL_PORT must be different than SERIAL_PORT. Please update your configuration."
#elif defined(SERIAL_PORT_2) && ANYCUBIC_LCD_SERIAL_PORT == SERIAL_PORT_2
#error "ANYCUBIC_LCD_SERIAL_PORT must be different than SERIAL_PORT_2. Please update your configuration."
#endif
#define ANYCUBIC_LCD_SERIAL anycubicLcdSerial
#endif
// ------------------------ // ------------------------
// Public functions // Public functions
// ------------------------ // ------------------------
@ -142,220 +151,6 @@ extern "C" {
} }
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
// timers
#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz
#define STEP_TIMER_NUM 1
#define TEMP_TIMER_NUM 0
#define PULSE_TIMER_NUM STEP_TIMER_NUM
#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0)
#define STEPPER_TIMER_RATE HAL_TIMER_RATE
#define STEPPER_TIMER_PRESCALE 8
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A)
#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
#define STEPPER_ISR_ENABLED() TEST(TIMSK1, OCIE1A)
#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B)
#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B)
#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B)
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
switch (timer_num) {
case STEP_TIMER_NUM:
// waveform generation = 0100 = CTC
SET_WGM(1, CTC_OCRnA);
// output mode = 00 (disconnected)
SET_COMA(1, NORMAL);
// Set the timer pre-scaler
// Generally we use a divider of 8, resulting in a 2MHz timer
// frequency on a 16MHz MCU. If you are going to change this, be
// sure to regenerate speed_lookuptable.h with
// create_speed_lookuptable.py
SET_CS(1, PRESCALER_8); // CS 2 = 1/8 prescaler
// Init Stepper ISR to 122 Hz for quick starting
// (F_CPU) / (STEPPER_TIMER_PRESCALE) / frequency
OCR1A = 0x4000;
TCNT1 = 0;
break;
case TEMP_TIMER_NUM:
// Use timer0 for temperature measurement
// Interleave temperature interrupt with millies interrupt
OCR0B = 128;
break;
}
}
#define TIMER_OCR_1 OCR1A
#define TIMER_COUNTER_1 TCNT1
#define TIMER_OCR_0 OCR0A
#define TIMER_COUNTER_0 TCNT0
#define _CAT(a,V...) a##V
#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare)
#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer)
#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer)
/**
* On AVR there is no hardware prioritization and preemption of
* interrupts, so this emulates it. The UART has first priority
* (otherwise, characters will be lost due to UART overflow).
* Then: Stepper, Endstops, Temperature, and -finally- all others.
*/
#define HAL_timer_isr_prologue(TIMER_NUM)
#define HAL_timer_isr_epilogue(TIMER_NUM)
/* 18 cycles maximum latency */
#define HAL_STEP_TIMER_ISR() \
extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
void TIMER1_COMPA_vect() { \
__asm__ __volatile__ ( \
A("push r16") /* 2 Save R16 */ \
A("in r16, __SREG__") /* 1 Get SREG */ \
A("push r16") /* 2 Save SREG into stack */ \
A("lds r16, %[timsk0]") /* 2 Load into R0 the Temperature timer Interrupt mask register */ \
A("push r16") /* 2 Save TIMSK0 into the stack */ \
A("andi r16,~%[msk0]") /* 1 Disable the temperature ISR */ \
A("sts %[timsk0], r16") /* 2 And set the new value */ \
A("lds r16, %[timsk1]") /* 2 Load into R0 the stepper timer Interrupt mask register [TIMSK1] */ \
A("andi r16,~%[msk1]") /* 1 Disable the stepper ISR */ \
A("sts %[timsk1], r16") /* 2 And set the new value */ \
A("push r16") /* 2 Save TIMSK1 into stack */ \
A("in r16, 0x3B") /* 1 Get RAMPZ register */ \
A("push r16") /* 2 Save RAMPZ into stack */ \
A("in r16, 0x3C") /* 1 Get EIND register */ \
A("push r0") /* C runtime can modify all the following registers without restoring them */ \
A("push r1") \
A("push r18") \
A("push r19") \
A("push r20") \
A("push r21") \
A("push r22") \
A("push r23") \
A("push r24") \
A("push r25") \
A("push r26") \
A("push r27") \
A("push r30") \
A("push r31") \
A("clr r1") /* C runtime expects this register to be 0 */ \
A("call TIMER1_COMPA_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \
A("pop r31") \
A("pop r30") \
A("pop r27") \
A("pop r26") \
A("pop r25") \
A("pop r24") \
A("pop r23") \
A("pop r22") \
A("pop r21") \
A("pop r20") \
A("pop r19") \
A("pop r18") \
A("pop r1") \
A("pop r0") \
A("out 0x3C, r16") /* 1 Restore EIND register */ \
A("pop r16") /* 2 Get the original RAMPZ register value */ \
A("out 0x3B, r16") /* 1 Restore RAMPZ register to its original value */ \
A("pop r16") /* 2 Get the original TIMSK1 value but with stepper ISR disabled */ \
A("ori r16,%[msk1]") /* 1 Reenable the stepper ISR */ \
A("cli") /* 1 Disable global interrupts - Reenabling Stepper ISR can reenter amd temperature can reenter, and we want that, if it happens, after this ISR has ended */ \
A("sts %[timsk1], r16") /* 2 And restore the old value - This reenables the stepper ISR */ \
A("pop r16") /* 2 Get the temperature timer Interrupt mask register [TIMSK0] */ \
A("sts %[timsk0], r16") /* 2 And restore the old value - This reenables the temperature ISR */ \
A("pop r16") /* 2 Get the old SREG value */ \
A("out __SREG__, r16") /* 1 And restore the SREG value */ \
A("pop r16") /* 2 Restore R16 value */ \
A("reti") /* 4 Return from interrupt */ \
: \
: [timsk0] "i" ((uint16_t)&TIMSK0), \
[timsk1] "i" ((uint16_t)&TIMSK1), \
[msk0] "M" ((uint8_t)(1<<OCIE0B)),\
[msk1] "M" ((uint8_t)(1<<OCIE1A)) \
: \
); \
} \
void TIMER1_COMPA_vect_bottom()
/* 14 cycles maximum latency */
#define HAL_TEMP_TIMER_ISR() \
extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER0_COMPB_vect_bottom() asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
void TIMER0_COMPB_vect() { \
__asm__ __volatile__ ( \
A("push r16") /* 2 Save R16 */ \
A("in r16, __SREG__") /* 1 Get SREG */ \
A("push r16") /* 2 Save SREG into stack */ \
A("lds r16, %[timsk0]") /* 2 Load into R0 the Temperature timer Interrupt mask register */ \
A("andi r16,~%[msk0]") /* 1 Disable the temperature ISR */ \
A("sts %[timsk0], r16") /* 2 And set the new value */ \
A("sei") /* 1 Enable global interrupts - It is safe, as the temperature ISR is disabled, so we cannot reenter it */ \
A("push r16") /* 2 Save TIMSK0 into stack */ \
A("in r16, 0x3B") /* 1 Get RAMPZ register */ \
A("push r16") /* 2 Save RAMPZ into stack */ \
A("in r16, 0x3C") /* 1 Get EIND register */ \
A("push r0") /* C runtime can modify all the following registers without restoring them */ \
A("push r1") \
A("push r18") \
A("push r19") \
A("push r20") \
A("push r21") \
A("push r22") \
A("push r23") \
A("push r24") \
A("push r25") \
A("push r26") \
A("push r27") \
A("push r30") \
A("push r31") \
A("clr r1") /* C runtime expects this register to be 0 */ \
A("call TIMER0_COMPB_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \
A("pop r31") \
A("pop r30") \
A("pop r27") \
A("pop r26") \
A("pop r25") \
A("pop r24") \
A("pop r23") \
A("pop r22") \
A("pop r21") \
A("pop r20") \
A("pop r19") \
A("pop r18") \
A("pop r1") \
A("pop r0") \
A("out 0x3C, r16") /* 1 Restore EIND register */ \
A("pop r16") /* 2 Get the original RAMPZ register value */ \
A("out 0x3B, r16") /* 1 Restore RAMPZ register to its original value */ \
A("pop r16") /* 2 Get the original TIMSK0 value but with temperature ISR disabled */ \
A("ori r16,%[msk0]") /* 1 Enable temperature ISR */ \
A("cli") /* 1 Disable global interrupts - We must do this, as we will reenable the temperature ISR, and we don't want to reenter this handler until the current one is done */ \
A("sts %[timsk0], r16") /* 2 And restore the old value */ \
A("pop r16") /* 2 Get the old SREG */ \
A("out __SREG__, r16") /* 1 And restore the SREG value */ \
A("pop r16") /* 2 Restore R16 */ \
A("reti") /* 4 Return from interrupt */ \
: \
: [timsk0] "i"((uint16_t)&TIMSK0), \
[msk0] "M" ((uint8_t)(1<<OCIE0B)) \
: \
); \
} \
void TIMER0_COMPB_vect_bottom()
// ADC // ADC
#ifdef DIDR2 #ifdef DIDR2
#define HAL_ANALOG_SELECT(ind) do{ if (ind < 8) SBI(DIDR0, ind); else SBI(DIDR2, ind & 0x07); }while(0) #define HAL_ANALOG_SELECT(ind) do{ if (ind < 8) SBI(DIDR0, ind); else SBI(DIDR2, ind & 0x07); }while(0)
@ -378,6 +173,7 @@ inline void HAL_adc_init() {
#define HAL_START_ADC(ch) ADCSRB = 0; SET_ADMUX_ADCSRA(ch) #define HAL_START_ADC(ch) ADCSRB = 0; SET_ADMUX_ADCSRA(ch)
#endif #endif
#define HAL_ADC_VREF 5.0
#define HAL_ADC_RESOLUTION 10 #define HAL_ADC_RESOLUTION 10
#define HAL_READ_ADC() ADC #define HAL_READ_ADC() ADC
#define HAL_ADC_READY() !TEST(ADCSRA, ADSC) #define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
@ -395,6 +191,8 @@ inline void HAL_adc_init() {
// AVR compatibility // AVR compatibility
#define strtof strtod #define strtof strtod
#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
/** /**
* set_pwm_frequency * set_pwm_frequency
* Sets the frequency of the timer corresponding to the provided pin * Sets the frequency of the timer corresponding to the provided pin

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
@ -43,6 +43,10 @@
#include "MarlinSerial.h" #include "MarlinSerial.h"
#include "../../MarlinCore.h" #include "../../MarlinCore.h"
#if ENABLED(DIRECT_STEPPING)
#include "../../feature/direct_stepping.h"
#endif
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } }; template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_t MarlinSerial<Cfg>::tx_buffer = { 0 }; template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_t MarlinSerial<Cfg>::tx_buffer = { 0 };
template<typename Cfg> bool MarlinSerial<Cfg>::_written = false; template<typename Cfg> bool MarlinSerial<Cfg>::_written = false;
@ -131,6 +135,18 @@
static EmergencyParser::State emergency_state; // = EP_RESET static EmergencyParser::State emergency_state; // = EP_RESET
// This must read the R_UCSRA register before reading the received byte to detect error causes
if (Cfg::DROPPED_RX && B_DOR && !++rx_dropped_bytes) --rx_dropped_bytes;
if (Cfg::RX_OVERRUNS && B_DOR && !++rx_buffer_overruns) --rx_buffer_overruns;
if (Cfg::RX_FRAMING_ERRORS && B_FE && !++rx_framing_errors) --rx_framing_errors;
// Read the character from the USART
uint8_t c = R_UDR;
#if ENABLED(DIRECT_STEPPING)
if (page_manager.maybe_store_rxd_char(c)) return;
#endif
// Get the tail - Nothing can alter its value while this ISR is executing, but there's // Get the tail - Nothing can alter its value while this ISR is executing, but there's
// a chance that this ISR interrupted the main process while it was updating the index. // a chance that this ISR interrupted the main process while it was updating the index.
// The backup mechanism ensures the correct value is always returned. // The backup mechanism ensures the correct value is always returned.
@ -142,14 +158,6 @@
// Get the next element // Get the next element
ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1); ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1);
// This must read the R_UCSRA register before reading the received byte to detect error causes
if (Cfg::DROPPED_RX && B_DOR && !++rx_dropped_bytes) --rx_dropped_bytes;
if (Cfg::RX_OVERRUNS && B_DOR && !++rx_buffer_overruns) --rx_buffer_overruns;
if (Cfg::RX_FRAMING_ERRORS && B_FE && !++rx_framing_errors) --rx_framing_errors;
// Read the character from the USART
uint8_t c = R_UDR;
if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c); if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c);
// If the character is to be stored at the index just before the tail // If the character is to be stored at the index just before the tail
@ -784,6 +792,24 @@
#endif #endif
#ifdef ANYCUBIC_LCD_SERIAL_PORT
ISR(SERIAL_REGNAME(USART,ANYCUBIC_LCD_SERIAL_PORT,_RX_vect)) {
MarlinSerial<AnycubicLcdSerialCfg<ANYCUBIC_LCD_SERIAL_PORT>>::store_rxd_char();
}
ISR(SERIAL_REGNAME(USART,ANYCUBIC_LCD_SERIAL_PORT,_UDRE_vect)) {
MarlinSerial<AnycubicLcdSerialCfg<ANYCUBIC_LCD_SERIAL_PORT>>::_tx_udr_empty_irq();
}
// Preinstantiate
template class MarlinSerial<AnycubicLcdSerialCfg<ANYCUBIC_LCD_SERIAL_PORT>>;
// Instantiate
MarlinSerial<AnycubicLcdSerialCfg<ANYCUBIC_LCD_SERIAL_PORT>> anycubicLcdSerial;
#endif
// For AT90USB targets use the UART for BT interfacing // For AT90USB targets use the UART for BT interfacing
#if defined(USBCON) && ENABLED(BLUETOOTH) #if defined(USBCON) && ENABLED(BLUETOOTH)
HardwareSerial bluetoothSerial; HardwareSerial bluetoothSerial;

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -299,12 +299,12 @@
template <uint8_t serial> template <uint8_t serial>
struct MarlinInternalSerialCfg { struct MarlinInternalSerialCfg {
static constexpr int PORT = serial; static constexpr int PORT = serial;
static constexpr unsigned int RX_SIZE = 128; static constexpr unsigned int RX_SIZE = DGUS_RX_BUFFER_SIZE;
static constexpr unsigned int TX_SIZE = 48; static constexpr unsigned int TX_SIZE = DGUS_TX_BUFFER_SIZE;
static constexpr bool XONOFF = false; static constexpr bool XONOFF = false;
static constexpr bool EMERGENCYPARSER = false; static constexpr bool EMERGENCYPARSER = false;
static constexpr bool DROPPED_RX = false; static constexpr bool DROPPED_RX = false;
static constexpr bool RX_OVERRUNS = HAS_DGUS_LCD && ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS); static constexpr bool RX_OVERRUNS = BOTH(HAS_DGUS_LCD, DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS);
static constexpr bool RX_FRAMING_ERRORS = false; static constexpr bool RX_FRAMING_ERRORS = false;
static constexpr bool MAX_RX_QUEUED = false; static constexpr bool MAX_RX_QUEUED = false;
}; };
@ -312,6 +312,23 @@
extern MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>> internalDgusSerial; extern MarlinSerial<MarlinInternalSerialCfg<DGUS_SERIAL_PORT>> internalDgusSerial;
#endif #endif
#ifdef ANYCUBIC_LCD_SERIAL_PORT
template <uint8_t serial>
struct AnycubicLcdSerialCfg {
static constexpr int PORT = serial;
static constexpr unsigned int RX_SIZE = 64;
static constexpr unsigned int TX_SIZE = 128;
static constexpr bool XONOFF = false;
static constexpr bool EMERGENCYPARSER = false;
static constexpr bool DROPPED_RX = false;
static constexpr bool RX_OVERRUNS = false;
static constexpr bool RX_FRAMING_ERRORS = false;
static constexpr bool MAX_RX_QUEUED = false;
};
extern MarlinSerial<AnycubicLcdSerialCfg<ANYCUBIC_LCD_SERIAL_PORT>> anycubicLcdSerial;
#endif
// Use the UART for Bluetooth in AT90USB configurations // Use the UART for Bluetooth in AT90USB configurations
#if defined(USBCON) && ENABLED(BLUETOOTH) #if defined(USBCON) && ENABLED(BLUETOOTH)
extern HardwareSerial bluetoothSerial; extern HardwareSerial bluetoothSerial;

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
@ -59,7 +59,6 @@
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include "../shared/Marduino.h"
#include "../shared/servo.h" #include "../shared/servo.h"
#include "../shared/servo_private.h" #include "../shared/servo_private.h"

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -59,11 +59,13 @@
// Say which 16 bit timers can be used and in what order // Say which 16 bit timers can be used and in what order
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
//#define _useTimer1 //#define _useTimer1
#define _useTimer3
#define _useTimer4 #define _useTimer4
#if !HAS_MOTOR_CURRENT_PWM #if NUM_SERVOS > SERVOS_PER_TIMER
#define _useTimer3
#if !HAS_MOTOR_CURRENT_PWM && SERVOS > 2 * SERVOS_PER_TIMER
#define _useTimer5 // Timer 5 is used for motor current PWM and can't be used for servos. #define _useTimer5 // Timer 5 is used for motor current PWM and can't be used for servos.
#endif #endif
#endif
#elif defined(__AVR_ATmega32U4__) #elif defined(__AVR_ATmega32U4__)
#define _useTimer3 #define _useTimer3
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) #elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#ifdef __AVR__ #ifdef __AVR__
@ -25,8 +25,17 @@
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE) #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
/**
* PersistentStore for Arduino-style EEPROM interface
* with implementations supplied by the framework.
*/
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
bool PersistentStore::access_start() { return true; } bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; } bool PersistentStore::access_finish() { return true; }
@ -46,7 +55,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
crc16(crc, &v, 1); crc16(crc, &v, 1);
pos++; pos++;
value++; value++;
}; }
return false; return false;
} }
@ -61,7 +70,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false; // always assume success for AVR's return false; // always assume success for AVR's
} }
size_t PersistentStore::capacity() { return E2END + 1; }
#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE #endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE
#endif // __AVR__ #endif // __AVR__

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,14 +16,14 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#ifdef __AVR__ #ifdef __AVR__
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM #if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
#include "HAL.h" #include "HAL.h"
@ -274,9 +274,9 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255
else else
top = *timer.ICRn; // top = ICRn top = *timer.ICRn; // top = ICRn
_SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top / v_size)); // Scale 8/16-bit v to top value _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top) / float(v_size)); // Scale 8/16-bit v to top value
} }
} }
#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM #endif // NEEDS_HARDWARE_PWM
#endif // __AVR__ #endif // __AVR__

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
@ -234,5 +234,55 @@ uint8_t extDigitalRead(const int8_t pin) {
} }
} }
#if 0
/**
* Set Timer 5 PWM frequency in Hz, from 3.8Hz up to ~16MHz
* with a minimum resolution of 100 steps.
*
* DC values -1.0 to 1.0. Negative duty cycle inverts the pulse.
*/
uint16_t set_pwm_frequency_hz(const float &hz, const float dca, const float dcb, const float dcc) {
float count = 0;
if (hz > 0 && (dca || dcb || dcc)) {
count = float(F_CPU) / hz; // 1x prescaler, TOP for 16MHz base freq.
uint16_t prescaler; // Range of 30.5Hz (65535) 64.5KHz (>31)
if (count >= 255. * 256.) { prescaler = 1024; SET_CS(5, PRESCALER_1024); }
else if (count >= 255. * 64.) { prescaler = 256; SET_CS(5, PRESCALER_256); }
else if (count >= 255. * 8.) { prescaler = 64; SET_CS(5, PRESCALER_64); }
else if (count >= 255.) { prescaler = 8; SET_CS(5, PRESCALER_8); }
else { prescaler = 1; SET_CS(5, PRESCALER_1); }
count /= float(prescaler);
const float pwm_top = round(count); // Get the rounded count
ICR5 = (uint16_t)pwm_top - 1; // Subtract 1 for TOP
OCR5A = pwm_top * ABS(dca); // Update and scale DCs
OCR5B = pwm_top * ABS(dcb);
OCR5C = pwm_top * ABS(dcc);
_SET_COM(5, A, dca ? (dca < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL); // Set compare modes
_SET_COM(5, B, dcb ? (dcb < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL);
_SET_COM(5, C, dcc ? (dcc < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL);
SET_WGM(5, FAST_PWM_ICRn); // Fast PWM with ICR5 as TOP
//SERIAL_ECHOLNPGM("Timer 5 Settings:");
//SERIAL_ECHOLNPAIR(" Prescaler=", prescaler);
//SERIAL_ECHOLNPAIR(" TOP=", ICR5);
//SERIAL_ECHOLNPAIR(" OCR5A=", OCR5A);
//SERIAL_ECHOLNPAIR(" OCR5B=", OCR5B);
//SERIAL_ECHOLNPAIR(" OCR5C=", OCR5C);
}
else {
// Restore the default for Timer 5
SET_WGM(5, PWM_PC_8); // PWM 8-bit (Phase Correct)
SET_COMS(5, NORMAL, NORMAL, NORMAL); // Do nothing
SET_CS(5, PRESCALER_64); // 16MHz / 64 = 250KHz
OCR5A = OCR5B = OCR5C = 0;
}
return round(count);
}
#endif
#endif // FASTIO_EXT_START #endif // FASTIO_EXT_START
#endif // __AVR__ #endif // __AVR__

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -57,7 +57,7 @@
* *
* Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW); * Now you can simply SET_OUTPUT(PIN); WRITE(PIN, HIGH); WRITE(PIN, LOW);
* *
* Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html * Why double up on these macros? see https://gcc.gnu.org/onlinedocs/cpp/Stringification.html
*/ */
#define _READ(IO) TEST(DIO ## IO ## _RPORT, DIO ## IO ## _PIN) #define _READ(IO) TEST(DIO ## IO ## _RPORT, DIO ## IO ## _PIN)

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,11 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/AVR."
#endif

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -25,16 +25,6 @@
* Test AVR-specific configuration values for errors at compile-time. * Test AVR-specific configuration values for errors at compile-time.
*/ */
/**
* Digipot requirement
*/
#if ENABLED(DIGIPOT_MCP4018)
#if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
|| !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
#error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
#endif
#endif
/** /**
* Checks for FAST PWM * Checks for FAST PWM
*/ */
@ -46,20 +36,23 @@
* Sanity checks for Spindle / Laser PWM * Sanity checks for Spindle / Laser PWM
*/ */
#if ENABLED(SPINDLE_LASER_PWM) #if ENABLED(SPINDLE_LASER_PWM)
#include "../ServoTimers.h" // Needed to check timer availability (_useTimer3)
#if SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13) #if SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13)
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt." #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt."
#elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5) #elif NUM_SERVOS > 0 && defined(_useTimer3) && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5)
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system." #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
#endif #endif
#elif defined(SPINDLE_LASER_FREQUENCY)
#error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_PWM."
#endif #endif
/** /**
* The Trinamic library includes SoftwareSerial.h, leading to a compile error. * The Trinamic library includes SoftwareSerial.h, leading to a compile error.
*/ */
#if HAS_TRINAMIC_CONFIG && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) #if BOTH(HAS_TRINAMIC_CONFIG, ENDSTOP_INTERRUPTS_FEATURE)
#error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue." #error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
#endif #endif
#if HAS_TMC_SW_SERIAL && ENABLED(MONITOR_DRIVER_STATUS) #if BOTH(HAS_TMC_SW_SERIAL, MONITOR_DRIVER_STATUS)
#error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue." #error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue."
#endif #endif

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

259
Marlin/src/HAL/AVR/timers.h Normal file
View File

@ -0,0 +1,259 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
*
* 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 <stdint.h>
// ------------------------
// Types
// ------------------------
typedef uint16_t hal_timer_t;
#define HAL_TIMER_TYPE_MAX 0xFFFF
// ------------------------
// Defines
// ------------------------
#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz
#ifndef STEP_TIMER_NUM
#define STEP_TIMER_NUM 1
#endif
#ifndef PULSE_TIMER_NUM
#define PULSE_TIMER_NUM STEP_TIMER_NUM
#endif
#ifndef TEMP_TIMER_NUM
#define TEMP_TIMER_NUM 0
#endif
#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0)
#define STEPPER_TIMER_RATE HAL_TIMER_RATE
#define STEPPER_TIMER_PRESCALE 8
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A)
#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
#define STEPPER_ISR_ENABLED() TEST(TIMSK1, OCIE1A)
#define ENABLE_TEMPERATURE_INTERRUPT() SBI(TIMSK0, OCIE0B)
#define DISABLE_TEMPERATURE_INTERRUPT() CBI(TIMSK0, OCIE0B)
#define TEMPERATURE_ISR_ENABLED() TEST(TIMSK0, OCIE0B)
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
switch (timer_num) {
case STEP_TIMER_NUM:
// waveform generation = 0100 = CTC
SET_WGM(1, CTC_OCRnA);
// output mode = 00 (disconnected)
SET_COMA(1, NORMAL);
// Set the timer pre-scaler
// Generally we use a divider of 8, resulting in a 2MHz timer
// frequency on a 16MHz MCU. If you are going to change this, be
// sure to regenerate speed_lookuptable.h with
// create_speed_lookuptable.py
SET_CS(1, PRESCALER_8); // CS 2 = 1/8 prescaler
// Init Stepper ISR to 122 Hz for quick starting
// (F_CPU) / (STEPPER_TIMER_PRESCALE) / frequency
OCR1A = 0x4000;
TCNT1 = 0;
break;
case TEMP_TIMER_NUM:
// Use timer0 for temperature measurement
// Interleave temperature interrupt with millies interrupt
OCR0B = 128;
break;
}
}
#define TIMER_OCR_1 OCR1A
#define TIMER_COUNTER_1 TCNT1
#define TIMER_OCR_0 OCR0A
#define TIMER_COUNTER_0 TCNT0
#define _CAT(a,V...) a##V
#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare)
#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer)
#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer)
/**
* On AVR there is no hardware prioritization and preemption of
* interrupts, so this emulates it. The UART has first priority
* (otherwise, characters will be lost due to UART overflow).
* Then: Stepper, Endstops, Temperature, and -finally- all others.
*/
#define HAL_timer_isr_prologue(TIMER_NUM)
#define HAL_timer_isr_epilogue(TIMER_NUM)
/* 18 cycles maximum latency */
#ifndef HAL_STEP_TIMER_ISR
#define HAL_STEP_TIMER_ISR() \
extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
void TIMER1_COMPA_vect() { \
__asm__ __volatile__ ( \
A("push r16") /* 2 Save R16 */ \
A("in r16, __SREG__") /* 1 Get SREG */ \
A("push r16") /* 2 Save SREG into stack */ \
A("lds r16, %[timsk0]") /* 2 Load into R0 the Temperature timer Interrupt mask register */ \
A("push r16") /* 2 Save TIMSK0 into the stack */ \
A("andi r16,~%[msk0]") /* 1 Disable the temperature ISR */ \
A("sts %[timsk0], r16") /* 2 And set the new value */ \
A("lds r16, %[timsk1]") /* 2 Load into R0 the stepper timer Interrupt mask register [TIMSK1] */ \
A("andi r16,~%[msk1]") /* 1 Disable the stepper ISR */ \
A("sts %[timsk1], r16") /* 2 And set the new value */ \
A("push r16") /* 2 Save TIMSK1 into stack */ \
A("in r16, 0x3B") /* 1 Get RAMPZ register */ \
A("push r16") /* 2 Save RAMPZ into stack */ \
A("in r16, 0x3C") /* 1 Get EIND register */ \
A("push r0") /* C runtime can modify all the following registers without restoring them */ \
A("push r1") \
A("push r18") \
A("push r19") \
A("push r20") \
A("push r21") \
A("push r22") \
A("push r23") \
A("push r24") \
A("push r25") \
A("push r26") \
A("push r27") \
A("push r30") \
A("push r31") \
A("clr r1") /* C runtime expects this register to be 0 */ \
A("call TIMER1_COMPA_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \
A("pop r31") \
A("pop r30") \
A("pop r27") \
A("pop r26") \
A("pop r25") \
A("pop r24") \
A("pop r23") \
A("pop r22") \
A("pop r21") \
A("pop r20") \
A("pop r19") \
A("pop r18") \
A("pop r1") \
A("pop r0") \
A("out 0x3C, r16") /* 1 Restore EIND register */ \
A("pop r16") /* 2 Get the original RAMPZ register value */ \
A("out 0x3B, r16") /* 1 Restore RAMPZ register to its original value */ \
A("pop r16") /* 2 Get the original TIMSK1 value but with stepper ISR disabled */ \
A("ori r16,%[msk1]") /* 1 Reenable the stepper ISR */ \
A("cli") /* 1 Disable global interrupts - Reenabling Stepper ISR can reenter amd temperature can reenter, and we want that, if it happens, after this ISR has ended */ \
A("sts %[timsk1], r16") /* 2 And restore the old value - This reenables the stepper ISR */ \
A("pop r16") /* 2 Get the temperature timer Interrupt mask register [TIMSK0] */ \
A("sts %[timsk0], r16") /* 2 And restore the old value - This reenables the temperature ISR */ \
A("pop r16") /* 2 Get the old SREG value */ \
A("out __SREG__, r16") /* 1 And restore the SREG value */ \
A("pop r16") /* 2 Restore R16 value */ \
A("reti") /* 4 Return from interrupt */ \
: \
: [timsk0] "i" ((uint16_t)&TIMSK0), \
[timsk1] "i" ((uint16_t)&TIMSK1), \
[msk0] "M" ((uint8_t)(1<<OCIE0B)),\
[msk1] "M" ((uint8_t)(1<<OCIE1A)) \
: \
); \
} \
void TIMER1_COMPA_vect_bottom()
#endif // HAL_STEP_TIMER_ISR
#ifndef HAL_TEMP_TIMER_ISR
/* 14 cycles maximum latency */
#define HAL_TEMP_TIMER_ISR() \
extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER0_COMPB_vect_bottom() asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
void TIMER0_COMPB_vect() { \
__asm__ __volatile__ ( \
A("push r16") /* 2 Save R16 */ \
A("in r16, __SREG__") /* 1 Get SREG */ \
A("push r16") /* 2 Save SREG into stack */ \
A("lds r16, %[timsk0]") /* 2 Load into R0 the Temperature timer Interrupt mask register */ \
A("andi r16,~%[msk0]") /* 1 Disable the temperature ISR */ \
A("sts %[timsk0], r16") /* 2 And set the new value */ \
A("sei") /* 1 Enable global interrupts - It is safe, as the temperature ISR is disabled, so we cannot reenter it */ \
A("push r16") /* 2 Save TIMSK0 into stack */ \
A("in r16, 0x3B") /* 1 Get RAMPZ register */ \
A("push r16") /* 2 Save RAMPZ into stack */ \
A("in r16, 0x3C") /* 1 Get EIND register */ \
A("push r0") /* C runtime can modify all the following registers without restoring them */ \
A("push r1") \
A("push r18") \
A("push r19") \
A("push r20") \
A("push r21") \
A("push r22") \
A("push r23") \
A("push r24") \
A("push r25") \
A("push r26") \
A("push r27") \
A("push r30") \
A("push r31") \
A("clr r1") /* C runtime expects this register to be 0 */ \
A("call TIMER0_COMPB_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \
A("pop r31") \
A("pop r30") \
A("pop r27") \
A("pop r26") \
A("pop r25") \
A("pop r24") \
A("pop r23") \
A("pop r22") \
A("pop r21") \
A("pop r20") \
A("pop r19") \
A("pop r18") \
A("pop r1") \
A("pop r0") \
A("out 0x3C, r16") /* 1 Restore EIND register */ \
A("pop r16") /* 2 Get the original RAMPZ register value */ \
A("out 0x3B, r16") /* 1 Restore RAMPZ register to its original value */ \
A("pop r16") /* 2 Get the original TIMSK0 value but with temperature ISR disabled */ \
A("ori r16,%[msk0]") /* 1 Enable temperature ISR */ \
A("cli") /* 1 Disable global interrupts - We must do this, as we will reenable the temperature ISR, and we don't want to reenter this handler until the current one is done */ \
A("sts %[timsk0], r16") /* 2 And restore the old value */ \
A("pop r16") /* 2 Get the old SREG */ \
A("out __SREG__, r16") /* 1 And restore the SREG value */ \
A("pop r16") /* 2 Restore R16 */ \
A("reti") /* 4 Return from interrupt */ \
: \
: [timsk0] "i"((uint16_t)&TIMSK0), \
[msk0] "M" ((uint8_t)(1<<OCIE0B)) \
: \
); \
} \
void TIMER0_COMPB_vect_bottom()
#endif // HAL_TEMP_TIMER_ISR

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,10 +16,9 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#ifdef __AVR__ #ifdef __AVR__
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,10 +16,9 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#ifdef ARDUINO_ARCH_SAM #ifdef ARDUINO_ARCH_SAM
#include "../../core/macros.h" #include "../../core/macros.h"

View File

@ -14,7 +14,8 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/ */
/** /**

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -30,11 +30,11 @@
#define CPU_32_BIT #define CPU_32_BIT
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "../shared/eeprom_if.h"
#include "../shared/math_32bit.h" #include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h" #include "../shared/HAL_SPI.h"
#include "fastio.h" #include "fastio.h"
#include "watchdog.h" #include "watchdog.h"
#include "timers.h"
#include <stdint.h> #include <stdint.h>
@ -130,14 +130,6 @@ void sei(); // Enable interrupts
void HAL_clear_reset_source(); // clear reset reason void HAL_clear_reset_source(); // clear reset reason
uint8_t HAL_get_reset_source(); // get reset reason uint8_t HAL_get_reset_source(); // get reset reason
//
// EEPROM
//
void eeprom_write_byte(uint8_t *pos, unsigned char value);
uint8_t eeprom_read_byte(uint8_t *pos);
void eeprom_read_block (void *__dst, const void *__src, size_t __n);
void eeprom_update_block (const void *__src, void *__dst, size_t __n);
// //
// ADC // ADC
// //
@ -151,8 +143,9 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion
inline void HAL_adc_init() {}//todo inline void HAL_adc_init() {}//todo
#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch) #define HAL_ADC_VREF 3.3
#define HAL_ADC_RESOLUTION 10 #define HAL_ADC_RESOLUTION 10
#define HAL_START_ADC(ch) HAL_adc_start_conversion(ch)
#define HAL_READ_ADC() HAL_adc_result #define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true #define HAL_ADC_READY() true

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
@ -73,9 +73,7 @@ int MarlinSerialUSB::peek() {
pending_char = udi_cdc_getc(); pending_char = udi_cdc_getc();
#if ENABLED(EMERGENCY_PARSER) TERN_(EMERGENCY_PARSER, emergency_parser.update(emergency_state, (char)pending_char));
emergency_parser.update(emergency_state, (char)pending_char);
#endif
return pending_char; return pending_char;
} }
@ -97,9 +95,7 @@ int MarlinSerialUSB::read() {
int c = udi_cdc_getc(); int c = udi_cdc_getc();
#if ENABLED(EMERGENCY_PARSER) TERN_(EMERGENCY_PARSER, emergency_parser.update(emergency_state, (char)c));
emergency_parser.update(emergency_state, (char)c);
#endif
return c; return c;
} }

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
@ -44,7 +44,6 @@
#if HAS_SERVOS #if HAS_SERVOS
#include "../shared/Marduino.h"
#include "../shared/servo.h" #include "../shared/servo.h"
#include "../shared/servo_private.h" #include "../shared/servo_private.h"

View File

@ -18,20 +18,19 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
/** /**
* Description: Tone function for Arduino Due and compatible (SAM3X8E) * Description: Tone function for Arduino Due and compatible (SAM3X8E)
* Derived from http://forum.arduino.cc/index.php?topic=136500.msg2903012#msg2903012 * Derived from https://forum.arduino.cc/index.php?topic=136500.msg2903012#msg2903012
*/ */
#ifdef ARDUINO_ARCH_SAM #ifdef ARDUINO_ARCH_SAM
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "HAL.h" #include "HAL.h"
#include "timers.h"
static pin_t tone_pin; static pin_t tone_pin;
volatile static int32_t toggles; volatile static int32_t toggles;

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -1,9 +1,10 @@
/** /**
* Marlin 3D Printer Firmware * Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* *
* Based on Sprinter and grbl. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -16,9 +17,14 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#ifdef ARDUINO_ARCH_SAM
#include "../../inc/MarlinConfig.h"
#if ENABLED(FLASH_EEPROM_EMULATION)
/* EEPROM emulation over flash with reduced wear /* EEPROM emulation over flash with reduced wear
* *
@ -50,14 +56,7 @@
* *
*/ */
#ifdef ARDUINO_ARCH_SAM //#define EE_EMU_DEBUG
#include "../../inc/MarlinConfig.h"
#if ENABLED(FLASH_EEPROM_EMULATION)
#include "../shared/Marduino.h"
#include "../shared/eeprom_api.h"
#define EEPROMSize 4096 #define EEPROMSize 4096
#define PagesPerGroup 128 #define PagesPerGroup 128
@ -134,15 +133,18 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes
curPage = 0, // Current FLASH page inside the group curPage = 0, // Current FLASH page inside the group
curGroup = 0xFF; // Current FLASH group curGroup = 0xFF; // Current FLASH group
//#define EE_EMU_DEBUG #define DEBUG_OUT ENABLED(EE_EMU_DEBUG)
#include "../../core/debug_out.h"
static void ee_Dump(const int page, const void* data) {
#ifdef EE_EMU_DEBUG #ifdef EE_EMU_DEBUG
static void ee_Dump(int page,const void* data) {
const uint8_t* c = (const uint8_t*) data; const uint8_t* c = (const uint8_t*) data;
char buffer[80]; char buffer[80];
sprintf_P(buffer, PSTR("Page: %d (0x%04x)\n"), page, page); sprintf_P(buffer, PSTR("Page: %d (0x%04x)\n"), page, page);
SERIAL_ECHO(buffer); DEBUG_ECHO(buffer);
char* p = &buffer[0]; char* p = &buffer[0];
for (int i = 0; i< PageSize; ++i) { for (int i = 0; i< PageSize; ++i) {
@ -152,12 +154,16 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes
if ((i & 0xF) == 0xF) { if ((i & 0xF) == 0xF) {
*p++ = '\n'; *p++ = '\n';
*p = 0; *p = 0;
SERIAL_ECHO(buffer); DEBUG_ECHO(buffer);
p = &buffer[0]; p = &buffer[0];
} }
} }
}
#else
UNUSED(page);
UNUSED(data);
#endif #endif
}
/* Flash Writing Protection Key */ /* Flash Writing Protection Key */
#define FWP_KEY 0x5Au #define FWP_KEY 0x5Au
@ -170,7 +176,6 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes
#define EEFC_ERROR_FLAGS (EEFC_FSR_FLOCKE | EEFC_FSR_FCMDE) #define EEFC_ERROR_FLAGS (EEFC_FSR_FLOCKE | EEFC_FSR_FCMDE)
#endif #endif
/** /**
* Writes the contents of the specified page (no previous erase) * Writes the contents of the specified page (no previous erase)
* @param page (page #) * @param page (page #)
@ -180,7 +185,7 @@ __attribute__ ((long_call, section (".ramfunc")))
static bool ee_PageWrite(uint16_t page, const void* data) { static bool ee_PageWrite(uint16_t page, const void* data) {
uint16_t i; uint16_t i;
uint32_t addrflash = ((uint32_t)getFlashStorage(page)); uint32_t addrflash = uint32_t(getFlashStorage(page));
// Read the flash contents // Read the flash contents
uint32_t pageContents[PageSize>>2]; uint32_t pageContents[PageSize>>2];
@ -195,13 +200,11 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
for (i = 0; i <PageSize >> 2; i++) for (i = 0; i <PageSize >> 2; i++)
pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i])); pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i]));
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM PageWrite ", page);
SERIAL_ECHOLNPAIR("EEPROM PageWrite ", page); DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
SERIAL_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash); DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
SERIAL_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0)); DEBUG_FLUSH();
SERIAL_FLUSH();
#endif
// Get the page relative to the start of the EFC controller, and the EFC controller to use // Get the page relative to the start of the EFC controller, and the EFC controller to use
Efc *efc; Efc *efc;
@ -243,10 +246,8 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
// Reenable interrupts // Reenable interrupts
__enable_irq(); __enable_irq();
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ", page);
SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ", page);
#endif
return false; return false;
} }
@ -270,10 +271,9 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
// Reenable interrupts // Reenable interrupts
__enable_irq(); __enable_irq();
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM Write failure for page ", page);
SERIAL_ECHOLNPAIR("EEPROM Write failure for page ", page);
#endif
return false; return false;
} }
@ -287,8 +287,8 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
if (memcmp(getFlashStorage(page),data,PageSize)) { if (memcmp(getFlashStorage(page),data,PageSize)) {
#ifdef EE_EMU_DEBUG #ifdef EE_EMU_DEBUG
SERIAL_ECHO_START(); DEBUG_ECHO_START();
SERIAL_ECHOLNPAIR("EEPROM Verify Write failure for page ", page); DEBUG_ECHOLNPAIR("EEPROM Verify Write failure for page ", page);
ee_Dump( page, (uint32_t *)addrflash); ee_Dump( page, (uint32_t *)addrflash);
ee_Dump(-page, data); ee_Dump(-page, data);
@ -307,7 +307,7 @@ static bool ee_PageWrite(uint16_t page,const void* data) {
} }
} }
} }
SERIAL_ECHOLNPAIR("--> Differing bits: ", count); DEBUG_ECHOLNPAIR("--> Differing bits: ", count);
#endif #endif
return false; return false;
@ -324,15 +324,13 @@ __attribute__ ((long_call, section (".ramfunc")))
static bool ee_PageErase(uint16_t page) { static bool ee_PageErase(uint16_t page) {
uint16_t i; uint16_t i;
uint32_t addrflash = ((uint32_t)getFlashStorage(page)); uint32_t addrflash = uint32_t(getFlashStorage(page));
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM PageErase ", page);
SERIAL_ECHOLNPAIR("EEPROM PageErase ", page); DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
SERIAL_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash); DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
SERIAL_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0)); DEBUG_FLUSH();
SERIAL_FLUSH();
#endif
// Get the page relative to the start of the EFC controller, and the EFC controller to use // Get the page relative to the start of the EFC controller, and the EFC controller to use
Efc *efc; Efc *efc;
@ -373,10 +371,9 @@ static bool ee_PageErase(uint16_t page) {
// Reenable interrupts // Reenable interrupts
__enable_irq(); __enable_irq();
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ",page);
SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ",page);
#endif
return false; return false;
} }
@ -398,10 +395,9 @@ static bool ee_PageErase(uint16_t page) {
// Reenable interrupts // Reenable interrupts
__enable_irq(); __enable_irq();
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM Erase failure for page ",page);
SERIAL_ECHOLNPAIR("EEPROM Erase failure for page ",page);
#endif
return false; return false;
} }
@ -415,19 +411,16 @@ static bool ee_PageErase(uint16_t page) {
uint32_t * aligned_src = (uint32_t *) addrflash; uint32_t * aligned_src = (uint32_t *) addrflash;
for (i = 0; i < PageSize >> 2; i++) { for (i = 0; i < PageSize >> 2; i++) {
if (*aligned_src++ != 0xFFFFFFFF) { if (*aligned_src++ != 0xFFFFFFFF) {
DEBUG_ECHO_START();
#ifdef EE_EMU_DEBUG DEBUG_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page);
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page);
ee_Dump(page, (uint32_t *)addrflash); ee_Dump(page, (uint32_t *)addrflash);
#endif
return false; return false;
} }
} }
return true; return true;
} }
static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer=false) { static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer=false) {
uint32_t baddr; uint32_t baddr;
@ -929,11 +922,9 @@ static void ee_Init() {
// If all groups seem to be used, default to first group // If all groups seem to be used, default to first group
if (curGroup >= GroupCount) curGroup = 0; if (curGroup >= GroupCount) curGroup = 0;
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM Current Group: ",curGroup);
SERIAL_ECHOLNPAIR("EEPROM Current Group: ",curGroup); DEBUG_FLUSH();
SERIAL_FLUSH();
#endif
// Now, validate that all the other group pages are empty // Now, validate that all the other group pages are empty
for (int grp = 0; grp < GroupCount; grp++) { for (int grp = 0; grp < GroupCount; grp++) {
@ -941,11 +932,9 @@ static void ee_Init() {
for (int page = 0; page < PagesPerGroup; page++) { for (int page = 0; page < PagesPerGroup; page++) {
if (!ee_IsPageClean(grp * PagesPerGroup + page)) { if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp); DEBUG_FLUSH();
SERIAL_FLUSH();
#endif
ee_PageErase(grp * PagesPerGroup + page); ee_PageErase(grp * PagesPerGroup + page);
} }
} }
@ -955,66 +944,69 @@ static void ee_Init() {
// and also validate that all the other ones are clean // and also validate that all the other ones are clean
for (curPage = 0; curPage < PagesPerGroup; curPage++) { for (curPage = 0; curPage < PagesPerGroup; curPage++) {
if (ee_IsPageClean(curGroup * PagesPerGroup + curPage)) { if (ee_IsPageClean(curGroup * PagesPerGroup + curPage)) {
#ifdef EE_EMU_DEBUG
ee_Dump(curGroup * PagesPerGroup + curPage, getFlashStorage(curGroup * PagesPerGroup + curPage)); ee_Dump(curGroup * PagesPerGroup + curPage, getFlashStorage(curGroup * PagesPerGroup + curPage));
#endif
break; break;
} }
} }
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM Active page: ", curPage);
SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage); DEBUG_FLUSH();
SERIAL_FLUSH();
#endif
// Make sure the pages following the first clean one are also clean // Make sure the pages following the first clean one are also clean
for (int page = curPage + 1; page < PagesPerGroup; page++) { for (int page = curPage + 1; page < PagesPerGroup; page++) {
if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) { if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
#ifdef EE_EMU_DEBUG DEBUG_ECHO_START();
SERIAL_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup); DEBUG_FLUSH();
SERIAL_FLUSH();
ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page)); ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
#endif
ee_PageErase(curGroup * PagesPerGroup + page); ee_PageErase(curGroup * PagesPerGroup + page);
} }
} }
} }
uint8_t eeprom_read_byte(uint8_t* addr) { /* PersistentStore -----------------------------------------------------------*/
ee_Init();
return ee_Read((uint32_t)addr); #include "../shared/eeprom_api.h"
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
bool PersistentStore::access_start() { ee_Init(); return true; }
bool PersistentStore::access_finish() { ee_Flush(); return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
uint8_t * const p = (uint8_t * const)pos;
uint8_t v = *value;
// EEPROM has only ~100,000 write cycles,
// so only write bytes that have changed!
if (v != ee_Read(uint32_t(p))) {
ee_Write(uint32_t(p), v);
delay(2);
if (ee_Read(uint32_t(p)) != v) {
SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
return true;
}
}
crc16(crc, &v, 1);
pos++;
value++;
}
return false;
} }
void eeprom_write_byte(uint8_t* addr, uint8_t value) { bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
ee_Init(); do {
ee_Write((uint32_t)addr, value); uint8_t c = ee_Read(uint32_t(pos));
} if (writing) *value = c;
crc16(crc, &c, 1);
void eeprom_update_block(const void* __src, void* __dst, size_t __n) { pos++;
uint8_t* dst = (uint8_t*)__dst; value++;
const uint8_t* src = (const uint8_t*)__src; } while (--size);
while (__n--) { return false;
eeprom_write_byte(dst, *src);
++dst;
++src;
}
}
void eeprom_read_block(void* __dst, const void* __src, size_t __n) {
uint8_t* dst = (uint8_t*)__dst;
uint8_t* src = (uint8_t*)__src;
while (__n--) {
*dst = eeprom_read_byte(src);
++dst;
++src;
}
}
void eeprom_flush() {
ee_Flush();
} }
#endif // FLASH_EEPROM_EMULATION #endif // FLASH_EEPROM_EMULATION
#endif // ARDUINO_ARCH_AVR #endif // ARDUINO_ARCH_SAM

View File

@ -17,32 +17,29 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#ifdef ARDUINO_ARCH_SAM #ifdef ARDUINO_ARCH_SAM
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(EEPROM_SETTINGS)
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if USE_WIRED_EEPROM
/**
* PersistentStore for Arduino-style EEPROM interface
* with simple implementations supplied by Marlin.
*/
#include "../shared/eeprom_if.h"
#include "../shared/eeprom_api.h" #include "../shared/eeprom_api.h"
#if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION) #ifndef MARLIN_EEPROM_SIZE
#define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp) #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif #endif
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
extern void eeprom_flush(); bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() {
#if ENABLED(FLASH_EEPROM_EMULATION)
eeprom_flush();
#endif
return true;
}
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) { while (size--) {
@ -61,7 +58,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
crc16(crc, &v, 1); crc16(crc, &v, 1);
pos++; pos++;
value++; value++;
}; }
return false; return false;
} }
@ -76,7 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false; return false;
} }
size_t PersistentStore::capacity() { return E2END + 1; } #endif // USE_WIRED_EEPROM
#endif // EEPROM_SETTINGS
#endif // ARDUINO_ARCH_SAM #endif // ARDUINO_ARCH_SAM

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -47,43 +47,21 @@ void endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts() { void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE) #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
#if HAS_X_MAX TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
_ATTACH(X_MAX_PIN); TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
#endif TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
#if HAS_X_MIN TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
_ATTACH(X_MIN_PIN); TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
#endif TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
#if HAS_Y_MAX TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
_ATTACH(Y_MAX_PIN); TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
#endif TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
#if HAS_Y_MIN TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
_ATTACH(Y_MIN_PIN); TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
#endif TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
#if HAS_Z_MAX TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
_ATTACH(Z_MAX_PIN); TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
#endif TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
#if HAS_Z_MIN TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
_ATTACH(Z_MIN_PIN); TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
#endif
#if HAS_Z2_MAX
_ATTACH(Z2_MAX_PIN);
#endif
#if HAS_Z2_MIN
_ATTACH(Z2_MIN_PIN);
#endif
#if HAS_Z3_MAX
_ATTACH(Z3_MAX_PIN);
#endif
#if HAS_Z3_MIN
_ATTACH(Z3_MIN_PIN);
#endif
#if HAS_Z4_MAX
_ATTACH(Z4_MAX_PIN);
#endif
#if HAS_Z4_MIN
_ATTACH(Z4_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
_ATTACH(Z_MIN_PROBE_PIN);
#endif
} }

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -58,7 +58,7 @@
* *
* Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW); * Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW);
* *
* Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html * Why double up on these macros? see https://gcc.gnu.org/onlinedocs/cpp/Stringification.html
*/ */
// Read a pin // Read a pin
@ -174,7 +174,7 @@
#define IS_OUTPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0) #define IS_OUTPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0)
// Shorthand // Shorthand
#define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); } #define OUT_WRITE(IO,V) do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
// digitalRead/Write wrappers // digitalRead/Write wrappers
#define extDigitalRead(IO) digitalRead(IO) #define extDigitalRead(IO) digitalRead(IO)

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,11 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
#if HAS_SPI_TFT || HAS_FSMC_TFT
#error "Sorry! TFT displays are not available for HAL/DUE."
#endif

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,13 +16,13 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
#if USE_FALLBACK_EEPROM #if USE_FALLBACK_EEPROM
#undef SRAM_EEPROM_EMULATION
#undef SDCARD_EEPROM_EMULATION
#define FLASH_EEPROM_EMULATION #define FLASH_EEPROM_EMULATION
#elif EITHER(I2C_EEPROM, SPI_EEPROM)
#define USE_SHARED_EEPROM 1
#endif #endif

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -52,8 +52,8 @@
#endif #endif
#endif #endif
#if ENABLED(FAST_PWM_FAN) #if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "FAST_PWM_FAN is not yet implemented for this platform." #error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on DUE."
#endif #endif
#if HAS_TMC_SW_SERIAL #if HAS_TMC_SW_SERIAL

View File

@ -13,7 +13,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once

View File

@ -16,7 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
@ -34,8 +34,6 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "HAL.h" #include "HAL.h"
#include "timers.h"
// ------------------------ // ------------------------
// Local defines // Local defines
// ------------------------ // ------------------------

View File

@ -15,7 +15,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once #pragma once
@ -40,11 +40,17 @@ typedef uint32_t hal_timer_t;
#define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals #define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals
#ifndef STEP_TIMER_NUM #ifndef STEP_TIMER_NUM
#define STEP_TIMER_NUM 2 // index of timer to use for stepper #define STEP_TIMER_NUM 2 // Timer Index for Stepper
#endif #endif
#define TEMP_TIMER_NUM 4 // index of timer to use for temperature #ifndef PULSE_TIMER_NUM
#define PULSE_TIMER_NUM STEP_TIMER_NUM #define PULSE_TIMER_NUM STEP_TIMER_NUM
#endif
#ifndef TEMP_TIMER_NUM
#define TEMP_TIMER_NUM 4 // Timer Index for Temperature
#endif
#ifndef TONE_TIMER_NUM
#define TONE_TIMER_NUM 6 // index of timer to use for beeper tones #define TONE_TIMER_NUM 6 // index of timer to use for beeper tones
#endif
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency #define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
@ -66,8 +72,12 @@ typedef uint32_t hal_timer_t;
#ifndef HAL_STEP_TIMER_ISR #ifndef HAL_STEP_TIMER_ISR
#define HAL_STEP_TIMER_ISR() void TC2_Handler() #define HAL_STEP_TIMER_ISR() void TC2_Handler()
#endif #endif
#ifndef HAL_TEMP_TIMER_ISR
#define HAL_TEMP_TIMER_ISR() void TC4_Handler() #define HAL_TEMP_TIMER_ISR() void TC4_Handler()
#endif
#ifndef HAL_TONE_TIMER_ISR
#define HAL_TONE_TIMER_ISR() void TC6_Handler() #define HAL_TONE_TIMER_ISR() void TC6_Handler()
#endif
// ------------------------ // ------------------------
// Types // Types

View File

@ -0,0 +1,18 @@
#
# Set upload_command
#
# Windows: bossac.exe
# Other: leave unchanged
#
import platform
current_OS = platform.system()
if current_OS == 'Windows':
Import("env")
# Use bossac.exe on Windows
env.Replace(
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot"
)

View File

@ -43,7 +43,7 @@
#pragma once #pragma once
/** /**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
/** /**
@ -93,5 +93,5 @@
#define USB_VBOF_GPIO (PIO_PB10_IDX) #define USB_VBOF_GPIO (PIO_PB10_IDX)
#define USB_VBOF_FLAGS (PIO_PERIPH_A | PIO_DEFAULT) #define USB_VBOF_FLAGS (PIO_PERIPH_A | PIO_DEFAULT)
/*! Active level of the USB_VBOF output pin. */ /*! Active level of the USB_VBOF output pin. */
#define USB_VBOF_ACTIVE_LEVEL LOW #define USB_VBOF_ACTIVE_STATE LOW
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef UTILS_COMPILER_H #ifndef UTILS_COMPILER_H

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _CONF_ACCESS_H_ #ifndef _CONF_ACCESS_H_

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef CONF_CLOCK_H_INCLUDED #ifndef CONF_CLOCK_H_INCLUDED

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _CONF_USB_H_ #ifndef _CONF_USB_H_
@ -78,10 +78,6 @@
//! To define a Full speed device //! To define a Full speed device
//#define USB_DEVICE_FULL_SPEED //#define USB_DEVICE_FULL_SPEED
#if MB(ARCHIM1)
#define USB_DEVICE_FULL_SPEED
#endif
//! To authorize the High speed //! To authorize the High speed
#ifndef USB_DEVICE_FULL_SPEED #ifndef USB_DEVICE_FULL_SPEED
#if (UC3A3||UC3A4) #if (UC3A3||UC3A4)

View File

@ -53,7 +53,7 @@
* *
******************************************************************************/ ******************************************************************************/
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifdef ARDUINO_ARCH_SAM #ifdef ARDUINO_ARCH_SAM

View File

@ -53,7 +53,7 @@
* *
******************************************************************************/ ******************************************************************************/
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef CHIP_GENCLK_H_INCLUDED #ifndef CHIP_GENCLK_H_INCLUDED

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _MREPEAT_H_ #ifndef _MREPEAT_H_

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef CHIP_OSC_H_INCLUDED #ifndef CHIP_OSC_H_INCLUDED

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef CHIP_PLL_H_INCLUDED #ifndef CHIP_PLL_H_INCLUDED

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _PREPROCESSOR_H_ #ifndef _PREPROCESSOR_H_

View File

@ -52,7 +52,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _SBC_PROTOCOL_H_ #ifndef _SBC_PROTOCOL_H_
#define _SBC_PROTOCOL_H_ #define _SBC_PROTOCOL_H_

View File

@ -42,7 +42,7 @@
* *
******************************************************************************/ ******************************************************************************/
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */

View File

@ -45,7 +45,7 @@
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _SPC_PROTOCOL_H_ #ifndef _SPC_PROTOCOL_H_
#define _SPC_PROTOCOL_H_ #define _SPC_PROTOCOL_H_

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifndef _STRINGZ_H_ #ifndef _STRINGZ_H_

View File

@ -41,7 +41,7 @@
* *
*/ */
/* /*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
*/ */
#ifdef ARDUINO_ARCH_SAM #ifdef ARDUINO_ARCH_SAM

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