Pārlūkot izejas kodu

Merge remote-tracking branch 'upstream/bugfix-2.0.x' into release_206

Scott Lahteine 3 gadus atpakaļ
vecāks
revīzija
5e5daf1ff2
100 mainītis faili ar 1445 papildinājumiem un 954 dzēšanām
  1. 4
    4
      .github/contributing.md
  2. 6
    11
      .github/issue_template.md
  3. 40
    0
      .github/lock.yml
  4. 14
    7
      .github/workflows/test-builds.yml
  5. 1
    1
      .gitignore
  6. 4
    4
      LICENSE
  7. 123
    51
      Marlin/Configuration.h
  8. 495
    130
      Marlin/Configuration_adv.h
  9. 68
    59
      Marlin/Makefile
  10. 14
    10
      Marlin/Marlin.ino
  11. 6
    6
      Marlin/Version.h
  12. 1
    1
      Marlin/lib/readme.txt
  13. 1
    2
      Marlin/src/HAL/AVR/HAL.cpp
  14. 9
    222
      Marlin/src/HAL/AVR/HAL.h
  15. 1
    1
      Marlin/src/HAL/AVR/HAL_SPI.cpp
  16. 17
    9
      Marlin/src/HAL/AVR/MarlinSerial.cpp
  17. 4
    4
      Marlin/src/HAL/AVR/MarlinSerial.h
  18. 1
    2
      Marlin/src/HAL/AVR/Servo.cpp
  19. 1
    1
      Marlin/src/HAL/AVR/ServoTimers.h
  20. 12
    5
      Marlin/src/HAL/AVR/eeprom.cpp
  21. 1
    1
      Marlin/src/HAL/AVR/endstop_interrupts.h
  22. 4
    4
      Marlin/src/HAL/AVR/fast_pwm.cpp
  23. 51
    1
      Marlin/src/HAL/AVR/fastio.cpp
  24. 1
    1
      Marlin/src/HAL/AVR/fastio.h
  25. 1
    1
      Marlin/src/HAL/AVR/fastio/fastio_1280.h
  26. 1
    1
      Marlin/src/HAL/AVR/fastio/fastio_1281.h
  27. 1
    1
      Marlin/src/HAL/AVR/fastio/fastio_168.h
  28. 1
    1
      Marlin/src/HAL/AVR/fastio/fastio_644.h
  29. 1
    1
      Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
  30. 1
    1
      Marlin/src/HAL/AVR/inc/Conditionals_LCD.h
  31. 1
    1
      Marlin/src/HAL/AVR/inc/Conditionals_adv.h
  32. 1
    1
      Marlin/src/HAL/AVR/inc/Conditionals_post.h
  33. 5
    13
      Marlin/src/HAL/AVR/inc/SanityCheck.h
  34. 1
    1
      Marlin/src/HAL/AVR/math.h
  35. 1
    1
      Marlin/src/HAL/AVR/pinsDebug.h
  36. 1
    1
      Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h
  37. 1
    1
      Marlin/src/HAL/AVR/pinsDebug_plus_70.h
  38. 1
    1
      Marlin/src/HAL/AVR/spi_pins.h
  39. 259
    0
      Marlin/src/HAL/AVR/timers.h
  40. 1
    1
      Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
  41. 1
    2
      Marlin/src/HAL/AVR/watchdog.cpp
  42. 1
    1
      Marlin/src/HAL/AVR/watchdog.h
  43. 1
    2
      Marlin/src/HAL/DUE/DebugMonitor.cpp
  44. 1
    1
      Marlin/src/HAL/DUE/HAL.cpp
  45. 4
    11
      Marlin/src/HAL/DUE/HAL.h
  46. 1
    1
      Marlin/src/HAL/DUE/HAL_SPI.cpp
  47. 1
    1
      Marlin/src/HAL/DUE/InterruptVectors.cpp
  48. 1
    1
      Marlin/src/HAL/DUE/InterruptVectors.h
  49. 1
    1
      Marlin/src/HAL/DUE/MarlinSerial.cpp
  50. 1
    1
      Marlin/src/HAL/DUE/MarlinSerial.h
  51. 3
    7
      Marlin/src/HAL/DUE/MarlinSerialUSB.cpp
  52. 1
    1
      Marlin/src/HAL/DUE/MarlinSerialUSB.h
  53. 1
    2
      Marlin/src/HAL/DUE/Servo.cpp
  54. 1
    2
      Marlin/src/HAL/DUE/Tone.cpp
  55. 1
    1
      Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp
  56. 1
    1
      Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp
  57. 1
    1
      Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp
  58. 1
    1
      Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp
  59. 1
    1
      Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h
  60. 112
    120
      Marlin/src/HAL/DUE/eeprom_flash.cpp
  61. 16
    21
      Marlin/src/HAL/DUE/eeprom_wired.cpp
  62. 18
    40
      Marlin/src/HAL/DUE/endstop_interrupts.h
  63. 2
    2
      Marlin/src/HAL/DUE/fastio.h
  64. 1
    1
      Marlin/src/HAL/DUE/fastio/G2_PWM.cpp
  65. 1
    1
      Marlin/src/HAL/DUE/fastio/G2_PWM.h
  66. 1
    1
      Marlin/src/HAL/DUE/fastio/G2_pins.h
  67. 1
    1
      Marlin/src/HAL/DUE/inc/Conditionals_LCD.h
  68. 1
    1
      Marlin/src/HAL/DUE/inc/Conditionals_adv.h
  69. 3
    3
      Marlin/src/HAL/DUE/inc/Conditionals_post.h
  70. 1
    1
      Marlin/src/HAL/DUE/inc/SanityCheck.h
  71. 1
    1
      Marlin/src/HAL/DUE/pinsDebug.h
  72. 1
    1
      Marlin/src/HAL/DUE/spi_pins.h
  73. 1
    3
      Marlin/src/HAL/DUE/timers.cpp
  74. 17
    7
      Marlin/src/HAL/DUE/timers.h
  75. 18
    0
      Marlin/src/HAL/DUE/upload_extra_script.py
  76. 0
    4
      Marlin/src/HAL/DUE/usb/conf_usb.h
  77. 1
    2
      Marlin/src/HAL/DUE/watchdog.cpp
  78. 1
    1
      Marlin/src/HAL/DUE/watchdog.h
  79. 1
    1
      Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp
  80. 1
    1
      Marlin/src/HAL/ESP32/FlushableHardwareSerial.h
  81. 16
    45
      Marlin/src/HAL/ESP32/HAL.cpp
  82. 3
    10
      Marlin/src/HAL/ESP32/HAL.h
  83. 4
    6
      Marlin/src/HAL/ESP32/HAL_SPI.cpp
  84. 2
    4
      Marlin/src/HAL/ESP32/Servo.cpp
  85. 1
    1
      Marlin/src/HAL/ESP32/Servo.h
  86. 1
    1
      Marlin/src/HAL/ESP32/WebSocketSerial.cpp
  87. 1
    1
      Marlin/src/HAL/ESP32/WebSocketSerial.h
  88. 9
    15
      Marlin/src/HAL/ESP32/eeprom.cpp
  89. 18
    40
      Marlin/src/HAL/ESP32/endstop_interrupts.h
  90. 1
    1
      Marlin/src/HAL/ESP32/fastio.h
  91. 1
    1
      Marlin/src/HAL/ESP32/i2s.cpp
  92. 1
    1
      Marlin/src/HAL/ESP32/i2s.h
  93. 1
    1
      Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h
  94. 1
    1
      Marlin/src/HAL/ESP32/inc/Conditionals_adv.h
  95. 1
    6
      Marlin/src/HAL/ESP32/inc/Conditionals_post.h
  96. 1
    1
      Marlin/src/HAL/ESP32/inc/SanityCheck.h
  97. 1
    1
      Marlin/src/HAL/ESP32/ota.cpp
  98. 1
    1
      Marlin/src/HAL/ESP32/ota.h
  99. 1
    1
      Marlin/src/HAL/ESP32/servotimers.h
  100. 0
    0
      Marlin/src/HAL/ESP32/spi_pins.h

+ 4
- 4
.github/contributing.md Parādīt failu

92
 
92
 
93
 #### Before Submitting a Feature Request
93
 #### Before Submitting a Feature Request
94
 
94
 
95
-* **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).
95
+* **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).
96
 * **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.
96
 * **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.
97
 
97
 
98
 #### How Do I Submit A (Good) Feature Request?
98
 #### How Do I Submit A (Good) Feature Request?
116
 
116
 
117
 ### Pull Requests
117
 ### Pull Requests
118
 
118
 
119
-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.
119
+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.
120
 
120
 
121
 * Fill in [the required template](pull_request_template.md).
121
 * Fill in [the required template](pull_request_template.md).
122
 * Don't include issue numbers in the PR title.
122
 * Don't include issue numbers in the PR title.
123
 * Include pictures, diagrams, and links to videos in your Pull Request to demonstrate your changes, if needed.
123
 * Include pictures, diagrams, and links to videos in your Pull Request to demonstrate your changes, if needed.
124
-* Follow the [Coding Standards](http://marlinfw.org/docs/development/coding_standards.html) posted on our website.
124
+* Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) posted on our website.
125
 * Document new code with clear and concise comments.
125
 * Document new code with clear and concise comments.
126
 * End all files with a newline.
126
 * End all files with a newline.
127
 
127
 
136
 
136
 
137
 ### C++ Coding Standards
137
 ### C++ Coding Standards
138
 
138
 
139
-* 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.
139
+* 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.
140
 
140
 
141
 ### Documentation
141
 ### Documentation
142
 
142
 

+ 6
- 11
.github/issue_template.md Parādīt failu

1
 # NO SUPPORT REQUESTS PLEASE
1
 # NO SUPPORT REQUESTS PLEASE
2
 
2
 
3
-Support Requests posted here will be automatically closed!
3
+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!
4
 
4
 
5
-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.
5
+Instead use one of the following options:
6
 
6
 
7
-For best results getting help with configuration and troubleshooting, please use the following resources:
7
+- The Marlin Firmware forum at https://reprap.org/forum/list.php?415
8
+- The MarlinFirmware Facebook Group at https://www.facebook.com/groups/1049718498464482/
9
+- The MarlinFirmware Discord Server at https://discord.gg/n5NJ59y.
8
 
10
 
9
-- RepRap.org Marlin Forum http://forums.reprap.org/list.php?415
10
-- Tom's 3D Forums https://discuss.toms3d.org/
11
-- Facebook Group "Marlin Firmware" https://www.facebook.com/groups/1049718498464482/
12
-- Facebook Group "Marlin Firmware for 3D Printers" https://www.facebook.com/groups/3Dtechtalk/
13
-- Marlin Configuration https://www.youtube.com/results?search_query=marlin+configuration on YouTube
14
-- Marlin Discord server. Join link: https://discord.gg/n5NJ59y
15
-
16
-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).
11
+Before filing an issue be sure to test the latest "bugfix" branch to see whether the issue is already addressed.

+ 40
- 0
.github/lock.yml Parādīt failu

1
+#
2
+# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
3
+#
4
+
5
+# Number of days of inactivity before a closed issue or pull request is locked
6
+daysUntilLock: 60
7
+
8
+# Skip issues and pull requests created before a given timestamp. Timestamp must
9
+# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
10
+skipCreatedBefore: false
11
+
12
+# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
13
+exemptLabels: [ 'no-locking' ]
14
+
15
+# Label to add before locking, such as `outdated`. Set to `false` to disable
16
+lockLabel: false
17
+
18
+# Comment to post before locking. Set to `false` to disable
19
+lockComment: >
20
+  This thread has been automatically locked since there has not been
21
+  any recent activity after it was closed. Please open a new issue for
22
+  related bugs.
23
+
24
+# Assign `resolved` as the reason for locking. Set to `false` to disable
25
+setLockReason: true
26
+
27
+# Limit to only `issues` or `pulls`
28
+# only: issues
29
+
30
+# Optionally, specify configuration settings just for `issues` or `pulls`
31
+# issues:
32
+#   exemptLabels:
33
+#     - help-wanted
34
+#   lockLabel: outdated
35
+
36
+# pulls:
37
+#   daysUntilLock: 30
38
+
39
+# Repository to extend settings from
40
+# _extends: repo

+ 14
- 7
.github/workflows/test-builds.yml Parādīt failu

58
         - STM32F103RE_btt
58
         - STM32F103RE_btt
59
         - STM32F103RE_btt_USB
59
         - STM32F103RE_btt_USB
60
         - STM32F103RC_fysetc
60
         - STM32F103RC_fysetc
61
+        - STM32F103RC_meeb
61
         - jgaurora_a5s_a1
62
         - jgaurora_a5s_a1
62
         - STM32F103VE_longer
63
         - STM32F103VE_longer
63
         - STM32F407VE_black
64
         - STM32F407VE_black
65
+        - STM32F401VE_STEVAL
66
+        - BIGTREE_BTT002
64
         - BIGTREE_SKR_PRO
67
         - BIGTREE_SKR_PRO
65
         - BIGTREE_GTR_V1_0
68
         - BIGTREE_GTR_V1_0
66
         - mks_robin
69
         - mks_robin
67
         - ARMED
70
         - ARMED
68
         - FYSETC_S6
71
         - FYSETC_S6
72
+        - STM32F070RB_malyan
73
+        - malyan_M300
74
+        - mks_robin_lite
75
+        - FLYF407ZG
76
+        - rumba32
77
+        - mks_robin_pro
78
+        - STM32F103RET6_creality
79
+        - LERDGEX
69
 
80
 
70
         # Put lengthy tests last
81
         # Put lengthy tests last
71
 
82
 
78
         #- STM32F7
89
         #- STM32F7
79
 
90
 
80
         # Non-working environment tests
91
         # Non-working environment tests
81
-
82
-        #- BIGTREE_BTT002
83
         #- at90usb1286_cdc
92
         #- at90usb1286_cdc
84
         #- at90usb1286_dfu
93
         #- at90usb1286_dfu
85
         #- STM32F103CB_malyan
94
         #- STM32F103CB_malyan
86
-        #- mks_robin_lite
87
         #- mks_robin_mini
95
         #- mks_robin_mini
88
         #- mks_robin_nano
96
         #- mks_robin_nano
89
 
97
 
97
 
105
 
98
     - name: Install PlatformIO
106
     - name: Install PlatformIO
99
       run: |
107
       run: |
100
-        pip install -U https://github.com/platformio/platformio-core/archive/master.zip
108
+        pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
101
         platformio update
109
         platformio update
102
 
110
 
103
     - name: Check out the PR
111
     - name: Check out the PR
106
     - name: Run ${{ matrix.test-platform }} Tests
114
     - name: Run ${{ matrix.test-platform }} Tests
107
       run: |
115
       run: |
108
         # Inline tests script
116
         # Inline tests script
109
-        [[ "$GITHUB_REPOSITORY" == "MarlinFirmware/Marlin" ]] || exit 0
110
         chmod +x buildroot/bin/*
117
         chmod +x buildroot/bin/*
111
-        chmod +x buildroot/share/tests/*
112
-        export PATH=./buildroot/bin/:./buildroot/share/tests/:${PATH}
118
+        chmod +x buildroot/tests/*
119
+        export PATH=./buildroot/bin/:./buildroot/tests/:${PATH}
113
         run_tests . ${{ matrix.test-platform }}
120
         run_tests . ${{ matrix.test-platform }}

+ 1
- 1
.gitignore Parādīt failu

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

+ 4
- 4
LICENSE Parādīt failu

3
                     GNU GENERAL PUBLIC LICENSE
3
                     GNU GENERAL PUBLIC LICENSE
4
                        Version 3, 29 June 2007
4
                        Version 3, 29 June 2007
5
 
5
 
6
- Copyright (c) 2007 Free Software Foundation, Inc. <http://fsf.org/>
6
+ Copyright (c) 2007 Free Software Foundation, Inc. <https://fsf.org/>
7
  Everyone is permitted to copy and distribute verbatim copies
7
  Everyone is permitted to copy and distribute verbatim copies
8
  of this license document, but changing it is not allowed.
8
  of this license document, but changing it is not allowed.
9
 
9
 
647
     GNU General Public License for more details.
647
     GNU General Public License for more details.
648
 
648
 
649
     You should have received a copy of the GNU General Public License
649
     You should have received a copy of the GNU General Public License
650
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
650
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
651
 
651
 
652
 Also add information on how to contact you by electronic and paper mail.
652
 Also add information on how to contact you by electronic and paper mail.
653
 
653
 
666
   You should also get your employer (if you work as a programmer) or school,
666
   You should also get your employer (if you work as a programmer) or school,
667
 if any, to sign a "copyright disclaimer" for the program, if necessary.
667
 if any, to sign a "copyright disclaimer" for the program, if necessary.
668
 For more information on this, and how to apply and follow the GNU GPL, see
668
 For more information on this, and how to apply and follow the GNU GPL, see
669
-<http://www.gnu.org/licenses/>.
669
+<https://www.gnu.org/licenses/>.
670
 
670
 
671
   The GNU General Public License does not permit incorporating your program
671
   The GNU General Public License does not permit incorporating your program
672
 into proprietary programs.  If your program is a subroutine library, you
672
 into proprietary programs.  If your program is a subroutine library, you
673
 may consider it more useful to permit linking proprietary applications with
673
 may consider it more useful to permit linking proprietary applications with
674
 the library.  If this is what you want to do, use the GNU Lesser General
674
 the library.  If this is what you want to do, use the GNU Lesser General
675
 Public License instead of this License.  But first, please read
675
 Public License instead of this License.  But first, please read
676
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
676
+<https://www.gnu.org/philosophy/why-not-lgpl.html>.
677
 
677
 

+ 123
- 51
Marlin/Configuration.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
36
  * Advanced settings can be found in Configuration_adv.h
36
  * Advanced settings can be found in Configuration_adv.h
37
  *
37
  *
38
  */
38
  */
39
-#define CONFIGURATION_H_VERSION 020005
39
+#define CONFIGURATION_H_VERSION 020006
40
 
40
 
41
 //===========================================================================
41
 //===========================================================================
42
 //============================= Getting Started =============================
42
 //============================= Getting Started =============================
45
 /**
45
 /**
46
  * Here are some standard links for getting your machine calibrated:
46
  * Here are some standard links for getting your machine calibrated:
47
  *
47
  *
48
- * http://reprap.org/wiki/Calibration
49
- * http://youtu.be/wAL9d7FgInk
48
+ * https://reprap.org/wiki/Calibration
49
+ * https://youtu.be/wAL9d7FgInk
50
  * http://calculator.josefprusa.cz
50
  * http://calculator.josefprusa.cz
51
- * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
52
- * http://www.thingiverse.com/thing:5573
51
+ * https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
52
+ * https://www.thingiverse.com/thing:5573
53
  * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
53
  * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
54
- * http://www.thingiverse.com/thing:298812
54
+ * https://www.thingiverse.com/thing:298812
55
  */
55
  */
56
 
56
 
57
 //===========================================================================
57
 //===========================================================================
135
 //#define CUSTOM_MACHINE_NAME "3D Printer"
135
 //#define CUSTOM_MACHINE_NAME "3D Printer"
136
 
136
 
137
 // Printer's unique ID, used by some programs to differentiate between machines.
137
 // Printer's unique ID, used by some programs to differentiate between machines.
138
-// Choose your own or use a service like http://www.uuidgenerator.net/version4
138
+// Choose your own or use a service like https://www.uuidgenerator.net/version4
139
 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
139
 //#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
140
 
140
 
141
 // @section extruder
141
 // @section extruder
142
 
142
 
143
 // This defines the number of extruders
143
 // This defines the number of extruders
144
-// :[1, 2, 3, 4, 5, 6, 7, 8]
144
+// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
145
 #define EXTRUDERS 1
145
 #define EXTRUDERS 1
146
 
146
 
147
 // Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc.
147
 // Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc.
148
-#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0
148
+#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75
149
 
149
 
150
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
150
 // For Cyclops or any "multi-extruder" that shares a single nozzle.
151
 //#define SINGLENOZZLE
151
 //#define SINGLENOZZLE
152
 
152
 
153
+// Save and restore temperature and fan speed on tool-change.
154
+// Set standby for the unselected tool with M104/106/109 T...
155
+#if ENABLED(SINGLENOZZLE)
156
+  //#define SINGLENOZZLE_STANDBY_TEMP
157
+  //#define SINGLENOZZLE_STANDBY_FAN
158
+#endif
159
+
153
 /**
160
 /**
154
  * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants.
161
  * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants.
155
  *
162
  *
326
   #define PSU_ACTIVE_HIGH false     // Set 'false' for ATX, 'true' for X-Box
333
   #define PSU_ACTIVE_HIGH false     // Set 'false' for ATX, 'true' for X-Box
327
 
334
 
328
   //#define PSU_DEFAULT_OFF         // Keep power off until enabled directly with M80
335
   //#define PSU_DEFAULT_OFF         // Keep power off until enabled directly with M80
329
-  //#define PSU_POWERUP_DELAY 100   // (ms) Delay for the PSU to warm up to full power
336
+  //#define PSU_POWERUP_DELAY 250   // (ms) Delay for the PSU to warm up to full power
330
 
337
 
331
   //#define AUTO_POWER_CONTROL      // Enable automatic control of the PS_ON pin
338
   //#define AUTO_POWER_CONTROL      // Enable automatic control of the PS_ON pin
332
   #if ENABLED(AUTO_POWER_CONTROL)
339
   #if ENABLED(AUTO_POWER_CONTROL)
364
  *   202 : 200k thermistor - Copymaster 3D
371
  *   202 : 200k thermistor - Copymaster 3D
365
  *     3 : Mendel-parts thermistor (4.7k pullup)
372
  *     3 : Mendel-parts thermistor (4.7k pullup)
366
  *     4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
373
  *     4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
367
- *     5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup)
374
+ *     5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan, J-Head, and E3D) (4.7k pullup)
368
  *   501 : 100K Zonestar (Tronxy X3A) Thermistor
375
  *   501 : 100K Zonestar (Tronxy X3A) Thermistor
376
+ *   502 : 100K Zonestar Thermistor used by hot bed in Zonestar Prusa P802M
369
  *   512 : 100k RPW-Ultra hotend thermistor (4.7k pullup)
377
  *   512 : 100k RPW-Ultra hotend thermistor (4.7k pullup)
370
  *     6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
378
  *     6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
371
  *     7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
379
  *     7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
373
  *     8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
381
  *     8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
374
  *     9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
382
  *     9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
375
  *    10 : 100k RS thermistor 198-961 (4.7k pullup)
383
  *    10 : 100k RS thermistor 198-961 (4.7k pullup)
376
- *    11 : 100k beta 3950 1% thermistor (4.7k pullup)
384
+ *    11 : 100k beta 3950 1% thermistor (Used in Keenovo AC silicone mats and most Wanhao i3 machines) (4.7k pullup)
377
  *    12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
385
  *    12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
378
  *    13 : 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
386
  *    13 : 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
379
  *    15 : 100k thermistor calibration for JGAurora A5 hotend
387
  *    15 : 100k thermistor calibration for JGAurora A5 hotend
380
  *    18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
388
  *    18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
381
  *    20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
389
  *    20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
382
  *    21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
390
  *    21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
391
+ *    22 : 100k (hotend) with 4.7k pullup to 3.3V and 220R to analog input (as in GTM32 Pro vB)
392
+ *    23 : 100k (bed) with 4.7k pullup to 3.3v and 220R to analog input (as in GTM32 Pro vB)
383
  *   201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
393
  *   201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
384
  *    60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
394
  *    60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
385
  *    61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
395
  *    61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
395
  *    52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
405
  *    52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
396
  *    55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
406
  *    55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
397
  *
407
  *
398
- *  1047 : Pt1000 with 4k7 pullup
408
+ *  1047 : Pt1000 with 4k7 pullup (E3D)
399
  *  1010 : Pt1000 with 1k pullup (non standard)
409
  *  1010 : Pt1000 with 1k pullup (non standard)
400
  *   147 : Pt100 with 4k7 pullup
410
  *   147 : Pt100 with 4k7 pullup
401
  *   110 : Pt100 with 1k pullup (non standard)
411
  *   110 : Pt100 with 1k pullup (non standard)
470
 #define BANG_MAX 255     // Limits current to nozzle while in bang-bang mode; 255=full current
480
 #define BANG_MAX 255     // Limits current to nozzle while in bang-bang mode; 255=full current
471
 #define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
481
 #define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
472
 #define PID_K1 0.95      // Smoothing factor within any PID loop
482
 #define PID_K1 0.95      // Smoothing factor within any PID loop
483
+
473
 #if ENABLED(PIDTEMP)
484
 #if ENABLED(PIDTEMP)
474
   //#define PID_EDIT_MENU         // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
485
   //#define PID_EDIT_MENU         // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
475
   //#define PID_AUTOTUNE_MENU     // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
486
   //#define PID_AUTOTUNE_MENU     // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
476
-  //#define PID_DEBUG             // Sends debug data to the serial port. Use 'M303 D' to toggle activation.
477
-  //#define PID_OPENLOOP 1        // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
478
-  //#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
479
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
487
   //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
480
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
488
                                   // Set/get with gcode: M301 E[extruder number, 0-2]
481
-  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
482
-                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
483
 
489
 
484
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
490
   // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
485
 
491
 
548
   // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
554
   // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
549
 #endif // PIDTEMPBED
555
 #endif // PIDTEMPBED
550
 
556
 
557
+#if EITHER(PIDTEMP, PIDTEMPBED)
558
+  //#define PID_DEBUG             // Sends debug data to the serial port. Use 'M303 D' to toggle activation.
559
+  //#define PID_OPENLOOP          // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
560
+  //#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
561
+  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
562
+                                  // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
563
+#endif
564
+
551
 // @section extruder
565
 // @section extruder
552
 
566
 
553
 /**
567
 /**
697
  * Enable if your probe or endstops falsely trigger due to noise.
711
  * Enable if your probe or endstops falsely trigger due to noise.
698
  *
712
  *
699
  * - Higher values may affect repeatability or accuracy of some bed probes.
713
  * - Higher values may affect repeatability or accuracy of some bed probes.
700
- * - To fix noise install a 100nF ceramic capacitor inline with the switch.
714
+ * - To fix noise install a 100nF ceramic capacitor in parallel with the switch.
701
  * - This feature is not required for common micro-switches mounted on PCBs
715
  * - This feature is not required for common micro-switches mounted on PCBs
702
  *   based on the Makerbot design, which already have the 100nF capacitor.
716
  *   based on the Makerbot design, which already have the 100nF capacitor.
703
  *
717
  *
705
  */
719
  */
706
 //#define ENDSTOP_NOISE_THRESHOLD 2
720
 //#define ENDSTOP_NOISE_THRESHOLD 2
707
 
721
 
722
+// Check for stuck or disconnected endstops during homing moves.
723
+//#define DETECT_BROKEN_ENDSTOP
724
+
708
 //=============================================================================
725
 //=============================================================================
709
 //============================== Movement Settings ============================
726
 //============================== Movement Settings ============================
710
 //=============================================================================
727
 //=============================================================================
798
  *
815
  *
799
  * See:
816
  * See:
800
  *   https://reprap.org/forum/read.php?1,739819
817
  *   https://reprap.org/forum/read.php?1,739819
801
- *   http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
818
+ *   https://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
802
  */
819
  */
803
 #if DISABLED(CLASSIC_JERK)
820
 #if DISABLED(CLASSIC_JERK)
804
   #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge
821
   #define JUNCTION_DEVIATION_MM 0.013 // (mm) Distance from real junction edge
822
+  #define JD_HANDLE_SMALL_SEGMENTS    // Use curvature estimation instead of just the junction angle
823
+                                      // for small segments (< 1mm) with large junction angles (> 135°).
805
 #endif
824
 #endif
806
 
825
 
807
 /**
826
 /**
820
 // @section probes
839
 // @section probes
821
 
840
 
822
 //
841
 //
823
-// See http://marlinfw.org/docs/configuration/probes.html
842
+// See https://marlinfw.org/docs/configuration/probes.html
824
 //
843
 //
825
 
844
 
826
 /**
845
 /**
827
- * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
828
- *
829
- * Enable this option for a probe connected to the Z Min endstop pin.
846
+ * Enable this option for a probe connected to the Z-MIN pin.
847
+ * The probe replaces the Z-MIN endstop and is used for Z homing.
848
+ * (Automatically enables USE_PROBE_FOR_Z_HOMING.)
830
  */
849
  */
831
 #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
850
 #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
832
 
851
 
852
+// Force the use of the probe for Z-axis homing
853
+//#define USE_PROBE_FOR_Z_HOMING
854
+
833
 /**
855
 /**
834
  * Z_MIN_PROBE_PIN
856
  * Z_MIN_PROBE_PIN
835
  *
857
  *
887
 //#define BLTOUCH
909
 //#define BLTOUCH
888
 
910
 
889
 /**
911
 /**
912
+ * Pressure sensor with a BLTouch-like interface
913
+ */
914
+//#define CREALITY_TOUCH
915
+
916
+/**
890
  * Touch-MI Probe by hotends.fr
917
  * Touch-MI Probe by hotends.fr
891
  *
918
  *
892
  * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed.
919
  * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed.
960
 
987
 
961
 // Most probes should stay away from the edges of the bed, but
988
 // Most probes should stay away from the edges of the bed, but
962
 // with NOZZLE_AS_PROBE this can be negative for a wider probing area.
989
 // with NOZZLE_AS_PROBE this can be negative for a wider probing area.
963
-#define MIN_PROBE_EDGE 10
990
+#define PROBING_MARGIN 10
964
 
991
 
965
 // X and Y axis travel speed (mm/m) between probes
992
 // X and Y axis travel speed (mm/m) between probes
966
 #define XY_PROBE_SPEED 8000
993
 #define XY_PROBE_SPEED 8000
1138
  *
1165
  *
1139
  * RAMPS-based boards use SERVO3_PIN for the first runout sensor.
1166
  * RAMPS-based boards use SERVO3_PIN for the first runout sensor.
1140
  * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
1167
  * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
1141
- * By default the firmware assumes HIGH=FILAMENT PRESENT.
1142
  */
1168
  */
1143
 //#define FILAMENT_RUNOUT_SENSOR
1169
 //#define FILAMENT_RUNOUT_SENSOR
1144
 #if ENABLED(FILAMENT_RUNOUT_SENSOR)
1170
 #if ENABLED(FILAMENT_RUNOUT_SENSOR)
1145
   #define NUM_RUNOUT_SENSORS   1     // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
1171
   #define NUM_RUNOUT_SENSORS   1     // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
1146
-  #define FIL_RUNOUT_INVERTING false // Set to true to invert the logic of the sensor.
1172
+  #define FIL_RUNOUT_STATE     LOW   // Pin state indicating that filament is NOT present.
1147
   #define FIL_RUNOUT_PULLUP          // Use internal pullup for filament runout pins.
1173
   #define FIL_RUNOUT_PULLUP          // Use internal pullup for filament runout pins.
1148
   //#define FIL_RUNOUT_PULLDOWN      // Use internal pulldown for filament runout pins.
1174
   //#define FIL_RUNOUT_PULLDOWN      // Use internal pulldown for filament runout pins.
1149
 
1175
 
1335
  */
1361
  */
1336
 //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
1362
 //#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
1337
 
1363
 
1338
-
1339
 // @section homing
1364
 // @section homing
1340
 
1365
 
1341
 // The center of the bed is at (X=0, Y=0)
1366
 // The center of the bed is at (X=0, Y=0)
1353
 //
1378
 //
1354
 // - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
1379
 // - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
1355
 // - If stepper drivers time out, it will need X and Y homing again before Z homing.
1380
 // - If stepper drivers time out, it will need X and Y homing again before Z homing.
1356
-// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
1381
+// - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
1357
 // - Prevent Z homing when the Z probe is outside bed area.
1382
 // - Prevent Z homing when the Z probe is outside bed area.
1358
 //
1383
 //
1359
 //#define Z_SAFE_HOMING
1384
 //#define Z_SAFE_HOMING
1360
 
1385
 
1361
 #if ENABLED(Z_SAFE_HOMING)
1386
 #if ENABLED(Z_SAFE_HOMING)
1362
-  #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2)    // X point for Z homing when homing all axes (G28).
1363
-  #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2)    // Y point for Z homing when homing all axes (G28).
1387
+  #define Z_SAFE_HOMING_X_POINT X_CENTER  // X point for Z homing
1388
+  #define Z_SAFE_HOMING_Y_POINT Y_CENTER  // Y point for Z homing
1364
 #endif
1389
 #endif
1365
 
1390
 
1366
 // Homing speeds (mm/m)
1391
 // Homing speeds (mm/m)
1499
 #if ENABLED(NOZZLE_PARK_FEATURE)
1524
 #if ENABLED(NOZZLE_PARK_FEATURE)
1500
   // Specify a park position as { X, Y, Z_raise }
1525
   // Specify a park position as { X, Y, Z_raise }
1501
   #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
1526
   #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 }
1527
+  //#define NOZZLE_PARK_X_ONLY          // X move only is required to park
1528
+  //#define NOZZLE_PARK_Y_ONLY          // Y move only is required to park
1529
+  #define NOZZLE_PARK_Z_RAISE_MIN   2   // (mm) Always raise Z by at least this distance
1502
   #define NOZZLE_PARK_XY_FEEDRATE 100   // (mm/s) X and Y axes feedrate (also used for delta Z axis)
1530
   #define NOZZLE_PARK_XY_FEEDRATE 100   // (mm/s) X and Y axes feedrate (also used for delta Z axis)
1503
-  #define NOZZLE_PARK_Z_FEEDRATE 5      // (mm/s) Z axis feedrate (not used for delta printers)
1531
+  #define NOZZLE_PARK_Z_FEEDRATE    5   // (mm/s) Z axis feedrate (not used for delta printers)
1504
 #endif
1532
 #endif
1505
 
1533
 
1506
 /**
1534
 /**
1567
 
1595
 
1568
   // Enable for a purge/clean station that's always at the gantry height (thus no Z move)
1596
   // Enable for a purge/clean station that's always at the gantry height (thus no Z move)
1569
   //#define NOZZLE_CLEAN_NO_Z
1597
   //#define NOZZLE_CLEAN_NO_Z
1598
+
1599
+  // Explicit wipe G-code script applies to a G12 with no arguments.
1600
+  //#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"
1601
+
1570
 #endif
1602
 #endif
1571
 
1603
 
1572
 /**
1604
 /**
1611
  *
1643
  *
1612
  * Select the language to display on the LCD. These languages are available:
1644
  * Select the language to display on the LCD. These languages are available:
1613
  *
1645
  *
1614
- *   en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, it, jp_kana,
1615
- *   ko_KR, nl, pl, pt, pt_br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test
1646
+ *   en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, hu, it,
1647
+ *   jp_kana, ko_KR, nl, pl, pt, pt_br, ro ru, sk, tr, uk, vi, zh_CN, zh_TW, test
1616
  *
1648
  *
1617
- * :{ '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' }
1649
+ * :{ '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' }
1618
  */
1650
  */
1619
 #define LCD_LANGUAGE en
1651
 #define LCD_LANGUAGE en
1620
 
1652
 
1636
  *  - Click the controller to view the LCD menu
1668
  *  - Click the controller to view the LCD menu
1637
  *  - The LCD will display Japanese, Western, or Cyrillic text
1669
  *  - The LCD will display Japanese, Western, or Cyrillic text
1638
  *
1670
  *
1639
- * See http://marlinfw.org/docs/development/lcd_language.html
1671
+ * See https://marlinfw.org/docs/development/lcd_language.html
1640
  *
1672
  *
1641
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1673
  * :['JAPANESE', 'WESTERN', 'CYRILLIC']
1642
  */
1674
  */
1763
 
1795
 
1764
 //
1796
 //
1765
 // RepRapDiscount Smart Controller.
1797
 // RepRapDiscount Smart Controller.
1766
-// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
1798
+// https://reprap.org/wiki/RepRapDiscount_Smart_Controller
1767
 //
1799
 //
1768
 // Note: Usually sold with a white PCB.
1800
 // Note: Usually sold with a white PCB.
1769
 //
1801
 //
1787
 
1819
 
1788
 //
1820
 //
1789
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
1821
 // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
1790
-// http://reprap.org/wiki/PanelOne
1822
+// https://reprap.org/wiki/PanelOne
1791
 //
1823
 //
1792
 //#define PANEL_ONE
1824
 //#define PANEL_ONE
1793
 
1825
 
1794
 //
1826
 //
1795
 // GADGETS3D G3D LCD/SD Controller
1827
 // GADGETS3D G3D LCD/SD Controller
1796
-// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
1828
+// https://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
1797
 //
1829
 //
1798
 // Note: Usually sold with a blue PCB.
1830
 // Note: Usually sold with a blue PCB.
1799
 //
1831
 //
1880
 
1912
 
1881
 //
1913
 //
1882
 // 2-wire Non-latching LCD SR from https://goo.gl/aJJ4sH
1914
 // 2-wire Non-latching LCD SR from https://goo.gl/aJJ4sH
1883
-// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD
1915
+// LCD configuration: https://reprap.org/wiki/SAV_3D_LCD
1884
 //
1916
 //
1885
 //#define SAV_3DLCD
1917
 //#define SAV_3DLCD
1886
 
1918
 
1902
 // IMPORTANT: The U8glib library is required for Graphical Display!
1934
 // IMPORTANT: The U8glib library is required for Graphical Display!
1903
 //            https://github.com/olikraus/U8glib_Arduino
1935
 //            https://github.com/olikraus/U8glib_Arduino
1904
 //
1936
 //
1937
+// NOTE: If the LCD is unresponsive you may need to reverse the plugs.
1938
+//
1905
 
1939
 
1906
 //
1940
 //
1907
 // RepRapDiscount FULL GRAPHIC Smart Controller
1941
 // RepRapDiscount FULL GRAPHIC Smart Controller
1908
-// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1942
+// https://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
1909
 //
1943
 //
1910
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1944
 //#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
1911
 
1945
 
1918
 //
1952
 //
1919
 // Activate one of these if you have a Panucatt Devices
1953
 // Activate one of these if you have a Panucatt Devices
1920
 // Viki 2.0 or mini Viki with Graphic LCD
1954
 // Viki 2.0 or mini Viki with Graphic LCD
1921
-// http://panucatt.com
1955
+// https://www.panucatt.com
1922
 //
1956
 //
1923
 //#define VIKI2
1957
 //#define VIKI2
1924
 //#define miniVIKI
1958
 //#define miniVIKI
1925
 
1959
 
1926
 //
1960
 //
1927
 // MakerLab Mini Panel with graphic
1961
 // MakerLab Mini Panel with graphic
1928
-// controller and SD support - http://reprap.org/wiki/Mini_panel
1962
+// controller and SD support - https://reprap.org/wiki/Mini_panel
1929
 //
1963
 //
1930
 //#define MINIPANEL
1964
 //#define MINIPANEL
1931
 
1965
 
1932
 //
1966
 //
1933
 // MaKr3d Makr-Panel with graphic controller and SD support.
1967
 // MaKr3d Makr-Panel with graphic controller and SD support.
1934
-// http://reprap.org/wiki/MaKr3d_MaKrPanel
1968
+// https://reprap.org/wiki/MaKr3d_MaKrPanel
1935
 //
1969
 //
1936
 //#define MAKRPANEL
1970
 //#define MAKRPANEL
1937
 
1971
 
1971
 //#define MKS_MINI_12864
2005
 //#define MKS_MINI_12864
1972
 
2006
 
1973
 //
2007
 //
2008
+// MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout.
2009
+// https://www.aliexpress.com/item/33018110072.html
2010
+//
2011
+//#define MKS_LCD12864
2012
+
2013
+//
1974
 // FYSETC variant of the MINI12864 graphic controller with SD support
2014
 // FYSETC variant of the MINI12864 graphic controller with SD support
1975
 // https://wiki.fysetc.com/Mini12864_Panel/
2015
 // https://wiki.fysetc.com/Mini12864_Panel/
1976
 //
2016
 //
2011
 
2051
 
2012
 //
2052
 //
2013
 // Silvergate GLCD controller
2053
 // Silvergate GLCD controller
2014
-// http://github.com/android444/Silvergate
2054
+// https://github.com/android444/Silvergate
2015
 //
2055
 //
2016
 //#define SILVER_GATE_GLCD_CONTROLLER
2056
 //#define SILVER_GATE_GLCD_CONTROLLER
2017
 
2057
 
2040
 
2080
 
2041
 //
2081
 //
2042
 // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER
2082
 // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER
2043
-// http://reprap.org/wiki/MKS_12864OLED
2083
+// https://reprap.org/wiki/MKS_12864OLED
2044
 //
2084
 //
2045
 // Tiny, but very sharp OLED display
2085
 // Tiny, but very sharp OLED display
2046
 //
2086
 //
2057
 //
2097
 //
2058
 //#define OVERLORD_OLED
2098
 //#define OVERLORD_OLED
2059
 
2099
 
2100
+//
2101
+// FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER with WS2812 RGB
2102
+// Where to find : https://www.aliexpress.com/item/4000345255731.html
2103
+//#define FYSETC_242_OLED_12864   // Uses the SSD1309 controller
2104
+
2060
 //=============================================================================
2105
 //=============================================================================
2061
 //========================== Extensible UI Displays ===========================
2106
 //========================== Extensible UI Displays ===========================
2062
 //=============================================================================
2107
 //=============================================================================
2063
 
2108
 
2064
 //
2109
 //
2065
 // DGUS Touch Display with DWIN OS. (Choose one.)
2110
 // DGUS Touch Display with DWIN OS. (Choose one.)
2111
+// ORIGIN : https://www.aliexpress.com/item/32993409517.html
2112
+// FYSETC : https://www.aliexpress.com/item/32961471929.html
2066
 //
2113
 //
2067
 //#define DGUS_LCD_UI_ORIGIN
2114
 //#define DGUS_LCD_UI_ORIGIN
2068
 //#define DGUS_LCD_UI_FYSETC
2115
 //#define DGUS_LCD_UI_FYSETC
2069
 //#define DGUS_LCD_UI_HIPRECY
2116
 //#define DGUS_LCD_UI_HIPRECY
2070
 
2117
 
2071
 //
2118
 //
2072
-// Touch-screen LCD for Malyan M200 printers
2119
+// Touch-screen LCD for Malyan M200/M300 printers
2073
 //
2120
 //
2074
 //#define MALYAN_LCD
2121
 //#define MALYAN_LCD
2075
 
2122
 
2085
 //
2132
 //
2086
 //#define EXTENSIBLE_UI
2133
 //#define EXTENSIBLE_UI
2087
 
2134
 
2135
+#if ENABLED(EXTENSIBLE_UI)
2136
+  //#define EXTUI_LOCAL_BEEPER // Enables use of local Beeper pin with external display
2137
+#endif
2138
+
2088
 //=============================================================================
2139
 //=============================================================================
2089
 //=============================== Graphical TFTs ==============================
2140
 //=============================== Graphical TFTs ==============================
2090
 //=============================================================================
2141
 //=============================================================================
2091
 
2142
 
2092
 //
2143
 //
2093
 // FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
2144
 // FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
2145
+// Upscaled 128x64 Marlin UI
2094
 //
2146
 //
2095
 //#define FSMC_GRAPHICAL_TFT
2147
 //#define FSMC_GRAPHICAL_TFT
2096
 
2148
 
2149
+//
2150
+// TFT LVGL UI
2151
+//
2152
+// Using default MKS icons and fonts from: https://git.io/JJvzK
2153
+// Just copy the 'assets' folder from the build directory to the
2154
+// root of your SD card, together with the compiled firmware.
2155
+//
2156
+//#define TFT_LVGL_UI_FSMC  // Robin nano v1.2 uses FSMC
2157
+//#define TFT_LVGL_UI_SPI   // Robin nano v2.0 uses SPI
2158
+
2159
+//
2160
+// Anycubic Mega TFT (AI3M)
2161
+//
2162
+//#define ANYCUBIC_TFT_MODEL
2163
+//#define ANYCUBIC_TFT_DEBUG
2164
+
2097
 //=============================================================================
2165
 //=============================================================================
2098
 //============================  Other Controllers  ============================
2166
 //============================  Other Controllers  ============================
2099
 //=============================================================================
2167
 //=============================================================================
2100
 
2168
 
2101
 //
2169
 //
2170
+// Ender-3 v2 OEM display. A DWIN display with Rotary Encoder.
2171
+//
2172
+//#define DWIN_CREALITY_LCD
2173
+
2174
+//
2102
 // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
2175
 // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
2103
 //
2176
 //
2104
 //#define TOUCH_BUTTONS
2177
 //#define TOUCH_BUTTONS
2114
 
2187
 
2115
 //
2188
 //
2116
 // RepRapWorld REPRAPWORLD_KEYPAD v1.1
2189
 // RepRapWorld REPRAPWORLD_KEYPAD v1.1
2117
-// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
2190
+// https://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
2118
 //
2191
 //
2119
 //#define REPRAPWORLD_KEYPAD
2192
 //#define REPRAPWORLD_KEYPAD
2120
 //#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
2193
 //#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
2151
 // then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis)
2224
 // then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis)
2152
 //#define TEMP_STAT_LEDS
2225
 //#define TEMP_STAT_LEDS
2153
 
2226
 
2154
-// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure
2227
+// SkeinForge sends the wrong arc G-codes when using Arc Point as fillet procedure
2155
 //#define SF_ARC_FIX
2228
 //#define SF_ARC_FIX
2156
 
2229
 
2157
 // Support for the BariCUDA Paste Extruder
2230
 // Support for the BariCUDA Paste Extruder
2164
 //#define PCA9632
2237
 //#define PCA9632
2165
 
2238
 
2166
 // Support for PCA9533 PWM LED driver
2239
 // Support for PCA9533 PWM LED driver
2167
-// https://github.com/mikeshub/SailfishRGB_LED
2168
 //#define PCA9533
2240
 //#define PCA9533
2169
 
2241
 
2170
 /**
2242
 /**

+ 495
- 130
Marlin/Configuration_adv.h
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 68
- 59
Marlin/Makefile Parādīt failu

14
 # Detailed instructions for using the makefile:
14
 # Detailed instructions for using the makefile:
15
 #
15
 #
16
 #  1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that
16
 #  1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that
17
-#     contains the Arduino installation (for example, under Mac OS X, this
17
+#     contains the Arduino installation (for example, under macOS, this
18
 #     might be /Applications/Arduino.app/Contents/Resources/Java).
18
 #     might be /Applications/Arduino.app/Contents/Resources/Java).
19
 #
19
 #
20
 #  2. Modify the line containing "UPLOAD_PORT" to refer to the filename
20
 #  2. Modify the line containing "UPLOAD_PORT" to refer to the filename
98
 ############
98
 ############
99
 # Try to automatically determine whether RELOC_WORKAROUND is needed based
99
 # Try to automatically determine whether RELOC_WORKAROUND is needed based
100
 # on GCC versions:
100
 # on GCC versions:
101
-#   http://www.avrfreaks.net/comment/1789106#comment-1789106
101
+#   https://www.avrfreaks.net/comment/1789106#comment-1789106
102
 
102
 
103
 CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ )
103
 CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ )
104
 CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ )
104
 CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ )
170
 else ifeq ($(HARDWARE_MOTHERBOARD),1101)
170
 else ifeq ($(HARDWARE_MOTHERBOARD),1101)
171
 # Velleman K8400 Controller (derived from 3Drag Controller)
171
 # Velleman K8400 Controller (derived from 3Drag Controller)
172
 else ifeq ($(HARDWARE_MOTHERBOARD),1102)
172
 else ifeq ($(HARDWARE_MOTHERBOARD),1102)
173
-# 2PrintBeta BAM&DICE with STK drivers
173
+# Velleman K8600 Controller (derived from 3Drag Controller)
174
 else ifeq ($(HARDWARE_MOTHERBOARD),1103)
174
 else ifeq ($(HARDWARE_MOTHERBOARD),1103)
175
-# 2PrintBeta BAM&DICE Due with STK drivers
175
+# 2PrintBeta BAM&DICE with STK drivers
176
 else ifeq ($(HARDWARE_MOTHERBOARD),1104)
176
 else ifeq ($(HARDWARE_MOTHERBOARD),1104)
177
-# MKS BASE v1.0
177
+# 2PrintBeta BAM&DICE Due with STK drivers
178
 else ifeq ($(HARDWARE_MOTHERBOARD),1105)
178
 else ifeq ($(HARDWARE_MOTHERBOARD),1105)
179
-# MKS v1.4 with A4982 stepper drivers
179
+# MKS BASE v1.0
180
 else ifeq ($(HARDWARE_MOTHERBOARD),1106)
180
 else ifeq ($(HARDWARE_MOTHERBOARD),1106)
181
-# MKS v1.5 with Allegro A4982 stepper drivers
181
+# MKS v1.4 with A4982 stepper drivers
182
 else ifeq ($(HARDWARE_MOTHERBOARD),1107)
182
 else ifeq ($(HARDWARE_MOTHERBOARD),1107)
183
-# MKS v1.6 with Allegro A4982 stepper drivers
183
+# MKS v1.5 with Allegro A4982 stepper drivers
184
 else ifeq ($(HARDWARE_MOTHERBOARD),1108)
184
 else ifeq ($(HARDWARE_MOTHERBOARD),1108)
185
-
186
-# MKS BASE 1.0 with Heroic HR4982 stepper drivers
185
+# MKS v1.6 with Allegro A4982 stepper drivers
187
 else ifeq ($(HARDWARE_MOTHERBOARD),1109)
186
 else ifeq ($(HARDWARE_MOTHERBOARD),1109)
188
-# MKS GEN v1.3 or 1.4
187
+# MKS BASE 1.0 with Heroic HR4982 stepper drivers
189
 else ifeq ($(HARDWARE_MOTHERBOARD),1110)
188
 else ifeq ($(HARDWARE_MOTHERBOARD),1110)
190
-# MKS GEN L
189
+# MKS GEN v1.3 or 1.4
191
 else ifeq ($(HARDWARE_MOTHERBOARD),1111)
190
 else ifeq ($(HARDWARE_MOTHERBOARD),1111)
192
-# zrib V2.0 control board (Chinese knock off RAMPS replica)
191
+# MKS GEN L
193
 else ifeq ($(HARDWARE_MOTHERBOARD),1112)
192
 else ifeq ($(HARDWARE_MOTHERBOARD),1112)
194
-# BigTreeTech or BIQU KFB2.0
193
+# zrib V2.0 control board (Chinese knock off RAMPS replica)
195
 else ifeq ($(HARDWARE_MOTHERBOARD),1113)
194
 else ifeq ($(HARDWARE_MOTHERBOARD),1113)
196
-# Felix 2.0+ Electronics Board (RAMPS like)
195
+# BigTreeTech or BIQU KFB2.0
197
 else ifeq ($(HARDWARE_MOTHERBOARD),1114)
196
 else ifeq ($(HARDWARE_MOTHERBOARD),1114)
198
-# Invent-A-Part RigidBoard
197
+# Felix 2.0+ Electronics Board (RAMPS like)
199
 else ifeq ($(HARDWARE_MOTHERBOARD),1115)
198
 else ifeq ($(HARDWARE_MOTHERBOARD),1115)
200
-# Invent-A-Part RigidBoard V2
199
+# Invent-A-Part RigidBoard
201
 else ifeq ($(HARDWARE_MOTHERBOARD),1116)
200
 else ifeq ($(HARDWARE_MOTHERBOARD),1116)
202
-# Sainsmart 2-in-1 board
201
+# Invent-A-Part RigidBoard V2
203
 else ifeq ($(HARDWARE_MOTHERBOARD),1117)
202
 else ifeq ($(HARDWARE_MOTHERBOARD),1117)
204
-# Ultimaker
203
+# Sainsmart 2-in-1 board
205
 else ifeq ($(HARDWARE_MOTHERBOARD),1118)
204
 else ifeq ($(HARDWARE_MOTHERBOARD),1118)
206
-# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
205
+# Ultimaker
207
 else ifeq ($(HARDWARE_MOTHERBOARD),1119)
206
 else ifeq ($(HARDWARE_MOTHERBOARD),1119)
207
+# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
208
+else ifeq ($(HARDWARE_MOTHERBOARD),1120)
208
   MCU ?= atmega1280
209
   MCU ?= atmega1280
209
 
210
 
210
 # Azteeg X3
211
 # Azteeg X3
211
-else ifeq ($(HARDWARE_MOTHERBOARD),1120)
212
-# Azteeg X3 Pro
213
 else ifeq ($(HARDWARE_MOTHERBOARD),1121)
212
 else ifeq ($(HARDWARE_MOTHERBOARD),1121)
214
-# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
213
+# Azteeg X3 Pro
215
 else ifeq ($(HARDWARE_MOTHERBOARD),1122)
214
 else ifeq ($(HARDWARE_MOTHERBOARD),1122)
216
-# Rumba
215
+# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
217
 else ifeq ($(HARDWARE_MOTHERBOARD),1123)
216
 else ifeq ($(HARDWARE_MOTHERBOARD),1123)
218
-# Raise3D Rumba
217
+# Rumba
219
 else ifeq ($(HARDWARE_MOTHERBOARD),1124)
218
 else ifeq ($(HARDWARE_MOTHERBOARD),1124)
220
-# Rapide Lite RL200 Rumba
219
+# Raise3D Rumba
221
 else ifeq ($(HARDWARE_MOTHERBOARD),1125)
220
 else ifeq ($(HARDWARE_MOTHERBOARD),1125)
222
-# Formbot T-Rex 2 Plus
221
+# Rapide Lite RL200 Rumba
223
 else ifeq ($(HARDWARE_MOTHERBOARD),1126)
222
 else ifeq ($(HARDWARE_MOTHERBOARD),1126)
224
-# Formbot T-Rex 3
223
+# Formbot T-Rex 2 Plus
225
 else ifeq ($(HARDWARE_MOTHERBOARD),1127)
224
 else ifeq ($(HARDWARE_MOTHERBOARD),1127)
226
-# Formbot Raptor
225
+# Formbot T-Rex 3
227
 else ifeq ($(HARDWARE_MOTHERBOARD),1128)
226
 else ifeq ($(HARDWARE_MOTHERBOARD),1128)
228
-# Formbot Raptor 2
227
+# Formbot Raptor
229
 else ifeq ($(HARDWARE_MOTHERBOARD),1129)
228
 else ifeq ($(HARDWARE_MOTHERBOARD),1129)
230
-# bq ZUM Mega 3D
229
+# Formbot Raptor 2
231
 else ifeq ($(HARDWARE_MOTHERBOARD),1130)
230
 else ifeq ($(HARDWARE_MOTHERBOARD),1130)
232
-# MakeBoard Mini v2.1.2 is a control board sold by MicroMake
231
+# bq ZUM Mega 3D
233
 else ifeq ($(HARDWARE_MOTHERBOARD),1131)
232
 else ifeq ($(HARDWARE_MOTHERBOARD),1131)
234
-# TriGorilla Anycubic version 1.3 based on RAMPS EFB
233
+# MakeBoard Mini v2.1.2 is a control board sold by MicroMake
235
 else ifeq ($(HARDWARE_MOTHERBOARD),1132)
234
 else ifeq ($(HARDWARE_MOTHERBOARD),1132)
236
-# TriGorilla Anycubic version 1.4 based on RAMPS EFB
235
+# TriGorilla Anycubic version 1.3 based on RAMPS EFB
237
 else ifeq ($(HARDWARE_MOTHERBOARD),1133)
236
 else ifeq ($(HARDWARE_MOTHERBOARD),1133)
238
-# TriGorilla Anycubic version 1.4 Rev 1.1
237
+# TriGorilla Anycubic version 1.4 based on RAMPS EFB
239
 else ifeq ($(HARDWARE_MOTHERBOARD),1134)
238
 else ifeq ($(HARDWARE_MOTHERBOARD),1134)
240
-# Creality: Ender-4, CR-8
239
+# TriGorilla Anycubic version 1.4 Rev 1.1
241
 else ifeq ($(HARDWARE_MOTHERBOARD),1135)
240
 else ifeq ($(HARDWARE_MOTHERBOARD),1135)
242
-# Creality: CR10S, CR20, CR-X
241
+# Creality: Ender-4, CR-8
243
 else ifeq ($(HARDWARE_MOTHERBOARD),1136)
242
 else ifeq ($(HARDWARE_MOTHERBOARD),1136)
244
-# Dagoma F5
243
+# Creality: CR10S, CR20, CR-X
245
 else ifeq ($(HARDWARE_MOTHERBOARD),1137)
244
 else ifeq ($(HARDWARE_MOTHERBOARD),1137)
246
-# FYSETC F6 1.3
245
+# Dagoma F5
247
 else ifeq ($(HARDWARE_MOTHERBOARD),1138)
246
 else ifeq ($(HARDWARE_MOTHERBOARD),1138)
248
-# FYSETC F6 1.5
247
+# FYSETC F6 1.3
249
 else ifeq ($(HARDWARE_MOTHERBOARD),1139)
248
 else ifeq ($(HARDWARE_MOTHERBOARD),1139)
250
-# Duplicator i3 Plus
249
+# FYSETC F6 1.5
251
 else ifeq ($(HARDWARE_MOTHERBOARD),1140)
250
 else ifeq ($(HARDWARE_MOTHERBOARD),1140)
252
-# VORON
251
+# Duplicator i3 Plus
253
 else ifeq ($(HARDWARE_MOTHERBOARD),1141)
252
 else ifeq ($(HARDWARE_MOTHERBOARD),1141)
254
-# TRONXY V3 1.0
253
+# VORON
255
 else ifeq ($(HARDWARE_MOTHERBOARD),1142)
254
 else ifeq ($(HARDWARE_MOTHERBOARD),1142)
256
-# Z-Bolt X Series
255
+# TRONXY V3 1.0
257
 else ifeq ($(HARDWARE_MOTHERBOARD),1143)
256
 else ifeq ($(HARDWARE_MOTHERBOARD),1143)
258
-# TT OSCAR
257
+# Z-Bolt X Series
259
 else ifeq ($(HARDWARE_MOTHERBOARD),1144)
258
 else ifeq ($(HARDWARE_MOTHERBOARD),1144)
260
-# Overlord/Overlord Pro
259
+# TT OSCAR
261
 else ifeq ($(HARDWARE_MOTHERBOARD),1145)
260
 else ifeq ($(HARDWARE_MOTHERBOARD),1145)
262
-# ADIMLab Gantry v1
261
+# Overlord/Overlord Pro
263
 else ifeq ($(HARDWARE_MOTHERBOARD),1146)
262
 else ifeq ($(HARDWARE_MOTHERBOARD),1146)
264
-# ADIMLab Gantry v2
263
+# ADIMLab Gantry v1
265
 else ifeq ($(HARDWARE_MOTHERBOARD),1147)
264
 else ifeq ($(HARDWARE_MOTHERBOARD),1147)
266
-# BIQU Tango V1
265
+# ADIMLab Gantry v2
267
 else ifeq ($(HARDWARE_MOTHERBOARD),1148)
266
 else ifeq ($(HARDWARE_MOTHERBOARD),1148)
268
-# MKS GEN L V2
267
+# BIQU Tango V1
269
 else ifeq ($(HARDWARE_MOTHERBOARD),1149)
268
 else ifeq ($(HARDWARE_MOTHERBOARD),1149)
270
-# Copymaster 3D
269
+# MKS GEN L V2
271
 else ifeq ($(HARDWARE_MOTHERBOARD),1150)
270
 else ifeq ($(HARDWARE_MOTHERBOARD),1150)
271
+# Copymaster 3D
272
+else ifeq ($(HARDWARE_MOTHERBOARD),1151)
273
+# Ortur 4
274
+else ifeq ($(HARDWARE_MOTHERBOARD),1152)
275
+# Tenlog D3 Hero
276
+else ifeq ($(HARDWARE_MOTHERBOARD),1153)
272
 
277
 
273
 #
278
 #
274
 # RAMBo and derivatives
279
 # RAMBo and derivatives
361
 else ifeq ($(HARDWARE_MOTHERBOARD),1502)
366
 else ifeq ($(HARDWARE_MOTHERBOARD),1502)
362
   HARDWARE_VARIANT ?= Sanguino
367
   HARDWARE_VARIANT ?= Sanguino
363
   MCU              ?= atmega644p
368
   MCU              ?= atmega644p
364
-# Melzi with ATmega1284 (MaKr3d version)
369
+# Melzi V2.0
365
 else ifeq ($(HARDWARE_MOTHERBOARD),1503)
370
 else ifeq ($(HARDWARE_MOTHERBOARD),1503)
366
   HARDWARE_VARIANT ?= Sanguino
371
   HARDWARE_VARIANT ?= Sanguino
367
   MCU              ?= atmega1284p
372
   MCU              ?= atmega1284p
368
-# Melzi Creality3D board (for CR-10 etc)
373
+# Melzi with ATmega1284 (MaKr3d version)
369
 else ifeq ($(HARDWARE_MOTHERBOARD),1504)
374
 else ifeq ($(HARDWARE_MOTHERBOARD),1504)
370
   HARDWARE_VARIANT ?= Sanguino
375
   HARDWARE_VARIANT ?= Sanguino
371
   MCU              ?= atmega1284p
376
   MCU              ?= atmega1284p
372
-# Melzi Malyan M150 board
377
+# Melzi Creality3D board (for CR-10 etc)
373
 else ifeq ($(HARDWARE_MOTHERBOARD),1505)
378
 else ifeq ($(HARDWARE_MOTHERBOARD),1505)
374
   HARDWARE_VARIANT ?= Sanguino
379
   HARDWARE_VARIANT ?= Sanguino
375
   MCU              ?= atmega1284p
380
   MCU              ?= atmega1284p
376
-# Tronxy X5S
381
+# Melzi Malyan M150 board
377
 else ifeq ($(HARDWARE_MOTHERBOARD),1506)
382
 else ifeq ($(HARDWARE_MOTHERBOARD),1506)
378
   HARDWARE_VARIANT ?= Sanguino
383
   HARDWARE_VARIANT ?= Sanguino
379
   MCU              ?= atmega1284p
384
   MCU              ?= atmega1284p
380
-# STB V1.1
385
+# Tronxy X5S
381
 else ifeq ($(HARDWARE_MOTHERBOARD),1507)
386
 else ifeq ($(HARDWARE_MOTHERBOARD),1507)
382
   HARDWARE_VARIANT ?= Sanguino
387
   HARDWARE_VARIANT ?= Sanguino
383
   MCU              ?= atmega1284p
388
   MCU              ?= atmega1284p
384
-# Azteeg X1
389
+# STB V1.1
385
 else ifeq ($(HARDWARE_MOTHERBOARD),1508)
390
 else ifeq ($(HARDWARE_MOTHERBOARD),1508)
386
   HARDWARE_VARIANT ?= Sanguino
391
   HARDWARE_VARIANT ?= Sanguino
387
   MCU              ?= atmega1284p
392
   MCU              ?= atmega1284p
388
-# Anet 1.0 (Melzi clone)
393
+# Azteeg X1
389
 else ifeq ($(HARDWARE_MOTHERBOARD),1509)
394
 else ifeq ($(HARDWARE_MOTHERBOARD),1509)
390
   HARDWARE_VARIANT ?= Sanguino
395
   HARDWARE_VARIANT ?= Sanguino
391
   MCU              ?= atmega1284p
396
   MCU              ?= atmega1284p
397
+# Anet 1.0 (Melzi clone)
398
+else ifeq ($(HARDWARE_MOTHERBOARD),1510)
399
+  HARDWARE_VARIANT ?= Sanguino
400
+  MCU              ?= atmega1284p
392
 
401
 
393
 #
402
 #
394
 # Other ATmega644P, ATmega644, ATmega1284P
403
 # Other ATmega644P, ATmega644, ATmega1284P
686
 
695
 
687
 else ifeq ($(HARDWARE_VARIANT), archim)
696
 else ifeq ($(HARDWARE_VARIANT), archim)
688
   CDEFS      += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSB_VID=0x27b1 -DUSB_PID=0x0001 -DUSBCON '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT="Archim"'
697
   CDEFS      += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSB_VID=0x27b1 -DUSB_PID=0x0001 -DUSBCON '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT="Archim"'
689
-  LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp UARTClass.cpp  USARTClass.cpp abi.cpp new.cpp watchdog.cpp CDC.cpp PluggableUSB.cpp  USBCore.cpp
698
+  LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp UARTClass.cpp  USARTClass.cpp abi.cpp new.cpp watchdog.cpp CDC.cpp PluggableUSB.cpp USBCore.cpp
690
   LIB_SRC    += cortex_handlers.c iar_calls_sam3.c syscalls_sam3.c dtostrf.c itoa.c
699
   LIB_SRC    += cortex_handlers.c iar_calls_sam3.c syscalls_sam3.c dtostrf.c itoa.c
691
 
700
 
692
   ifeq ($(U8GLIB), 1)
701
   ifeq ($(U8GLIB), 1)

+ 14
- 10
Marlin/Marlin.ino Parādīt failu

1
-/*
2
-================================================================================
1
+/*==============================================================================
3
 
2
 
4
   Marlin Firmware
3
   Marlin Firmware
5
 
4
 
6
-  (c) 2011-2019 MarlinFirmware
5
+  (c) 2011-2020 MarlinFirmware
7
   Portions of Marlin are (c) by their respective authors.
6
   Portions of Marlin are (c) by their respective authors.
8
   All code complies with GPLv2 and/or GPLv3
7
   All code complies with GPLv2 and/or GPLv3
9
 
8
 
12
 Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware.
11
 Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware.
13
 
12
 
14
 To configure Marlin you must edit Configuration.h and Configuration_adv.h
13
 To configure Marlin you must edit Configuration.h and Configuration_adv.h
15
-located in the root 'Marlin' folder. Check the config/examples folder to see if
16
-there's a more suitable starting-point for your specific hardware.
14
+located in the root 'Marlin' folder. Check our Configurations repository to
15
+see if there's a more suitable starting-point for your specific hardware.
17
 
16
 
18
 Before diving in, we recommend the following essential links:
17
 Before diving in, we recommend the following essential links:
19
 
18
 
20
 Marlin Firmware Official Website
19
 Marlin Firmware Official Website
21
 
20
 
22
-  - http://marlinfw.org/
21
+  - https://marlinfw.org/
23
     The official Marlin Firmware website contains the most up-to-date
22
     The official Marlin Firmware website contains the most up-to-date
24
     documentation. Contributions are always welcome!
23
     documentation. Contributions are always welcome!
25
 
24
 
26
 Configuration
25
 Configuration
27
 
26
 
27
+  - https://github.com/MarlinFirmware/Configurations
28
+    Example configurations for several printer models.
29
+
28
   - https://www.youtube.com/watch?v=3gwWVFtdg-4
30
   - https://www.youtube.com/watch?v=3gwWVFtdg-4
29
     A good 20-minute overview of Marlin configuration by Tom Sanladerer.
31
     A good 20-minute overview of Marlin configuration by Tom Sanladerer.
30
     (Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.)
32
     (Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.)
31
     Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin
33
     Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin
32
 
34
 
33
-  - http://marlinfw.org/docs/configuration/configuration.html
35
+  - https://marlinfw.org/docs/configuration/configuration.html
34
     Marlin's configuration options are explained in more detail here.
36
     Marlin's configuration options are explained in more detail here.
35
 
37
 
36
 Getting Help
38
 Getting Help
45
 
47
 
46
 Contributing
48
 Contributing
47
 
49
 
48
-  - http://marlinfw.org/docs/development/contributing.html
50
+  - https://marlinfw.org/docs/development/contributing.html
49
     If you'd like to contribute to Marlin, read this first!
51
     If you'd like to contribute to Marlin, read this first!
50
 
52
 
51
-  - http://marlinfw.org/docs/development/coding_standards.html
53
+  - https://marlinfw.org/docs/development/coding_standards.html
52
     Before submitting code get to know the Coding Standards.
54
     Before submitting code get to know the Coding Standards.
53
-*/
55
+
56
+
57
+------------------------------------------------------------------------------*/

+ 6
- 6
Marlin/Version.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
34
  * Verbose version identifier which should contain a reference to the location
34
  * Verbose version identifier which should contain a reference to the location
35
  * from where the binary was downloaded or the source code was compiled.
35
  * from where the binary was downloaded or the source code was compiled.
36
  */
36
  */
37
-//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)"
37
+//#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION
38
 
38
 
39
 /**
39
 /**
40
  * The STRING_DISTRIBUTION_DATE represents when the binary file was built,
40
  * The STRING_DISTRIBUTION_DATE represents when the binary file was built,
65
  * The WEBSITE_URL is the location where users can get more information such as
65
  * The WEBSITE_URL is the location where users can get more information such as
66
  * documentation about a specific Marlin release.
66
  * documentation about a specific Marlin release.
67
  */
67
  */
68
-//#define WEBSITE_URL "http://marlinfw.org"
68
+//#define WEBSITE_URL "https://marlinfw.org"
69
 
69
 
70
 /**
70
 /**
71
  * Set the vendor info the serial USB interface, if changable
71
  * Set the vendor info the serial USB interface, if changable
72
  * Currently only supported by DUE platform
72
  * Currently only supported by DUE platform
73
  */
73
  */
74
-//#define  USB_DEVICE_VENDOR_ID           0x0000
75
-//#define  USB_DEVICE_PRODUCT_ID          0x0000
76
-//#define  USB_DEVICE_MANUFACTURE_NAME    WEBSITE_URL
74
+//#define USB_DEVICE_VENDOR_ID           0x0000
75
+//#define USB_DEVICE_PRODUCT_ID          0x0000
76
+//#define USB_DEVICE_MANUFACTURE_NAME    WEBSITE_URL

+ 1
- 1
Marlin/lib/readme.txt Parādīt failu

33
 include paths and build them.
33
 include paths and build them.
34
 
34
 
35
 More information about PlatformIO Library Dependency Finder
35
 More information about PlatformIO Library Dependency Finder
36
-- http://docs.platformio.org/page/librarymanager/ldf.html
36
+- https://docs.platformio.org/page/librarymanager/ldf.html

+ 1
- 2
Marlin/src/HAL/AVR/HAL.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
-
23
 #ifdef __AVR__
22
 #ifdef __AVR__
24
 
23
 
25
 #include "../../inc/MarlinConfig.h"
24
 #include "../../inc/MarlinConfig.h"

+ 9
- 222
Marlin/src/HAL/AVR/HAL.h Parādīt failu

14
  * GNU General Public License for more details.
14
  * GNU General Public License for more details.
15
  *
15
  *
16
  * You should have received a copy of the GNU General Public License
16
  * You should have received a copy of the GNU General Public License
17
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
  */
18
  */
19
 #pragma once
19
 #pragma once
20
 
20
 
50
 // Defines
50
 // Defines
51
 // ------------------------
51
 // ------------------------
52
 
52
 
53
-//#define analogInputToDigitalPin(IO) IO
53
+// AVR PROGMEM extension for sprintf_P
54
+#define S_FMT "%S"
55
+
56
+// AVR PROGMEM extension for string define
57
+#define PGMSTR(NAM,STR) const char NAM[] PROGMEM = STR
54
 
58
 
55
 #ifndef CRITICAL_SECTION_START
59
 #ifndef CRITICAL_SECTION_START
56
   #define CRITICAL_SECTION_START()  unsigned char _sreg = SREG; cli()
60
   #define CRITICAL_SECTION_START()  unsigned char _sreg = SREG; cli()
60
 #define ENABLE_ISRS()  sei()
64
 #define ENABLE_ISRS()  sei()
61
 #define DISABLE_ISRS() cli()
65
 #define DISABLE_ISRS() cli()
62
 
66
 
63
-// On AVR this is in math.h?
64
-//#define square(x) ((x)*(x))
65
-
66
 // ------------------------
67
 // ------------------------
67
 // Types
68
 // Types
68
 // ------------------------
69
 // ------------------------
69
 
70
 
70
-typedef uint16_t hal_timer_t;
71
-#define HAL_TIMER_TYPE_MAX 0xFFFF
72
-
73
 typedef int8_t pin_t;
71
 typedef int8_t pin_t;
74
 
72
 
75
 #define SHARED_SERVOS HAS_SERVOS
73
 #define SHARED_SERVOS HAS_SERVOS
142
 }
140
 }
143
 #pragma GCC diagnostic pop
141
 #pragma GCC diagnostic pop
144
 
142
 
145
-// timers
146
-#define HAL_TIMER_RATE          ((F_CPU) / 8)    // i.e., 2MHz or 2.5MHz
147
-
148
-#define STEP_TIMER_NUM          1
149
-#define TEMP_TIMER_NUM          0
150
-#define PULSE_TIMER_NUM         STEP_TIMER_NUM
151
-
152
-#define TEMP_TIMER_FREQUENCY    ((F_CPU) / 64.0 / 256.0)
153
-
154
-#define STEPPER_TIMER_RATE      HAL_TIMER_RATE
155
-#define STEPPER_TIMER_PRESCALE  8
156
-#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double
157
-
158
-#define PULSE_TIMER_RATE       STEPPER_TIMER_RATE   // frequency of pulse timer
159
-#define PULSE_TIMER_PRESCALE   STEPPER_TIMER_PRESCALE
160
-#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
161
-
162
-#define ENABLE_STEPPER_DRIVER_INTERRUPT()  SBI(TIMSK1, OCIE1A)
163
-#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
164
-#define STEPPER_ISR_ENABLED()             TEST(TIMSK1, OCIE1A)
165
-
166
-#define ENABLE_TEMPERATURE_INTERRUPT()     SBI(TIMSK0, OCIE0B)
167
-#define DISABLE_TEMPERATURE_INTERRUPT()    CBI(TIMSK0, OCIE0B)
168
-#define TEMPERATURE_ISR_ENABLED()         TEST(TIMSK0, OCIE0B)
169
-
170
-FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
171
-  switch (timer_num) {
172
-    case STEP_TIMER_NUM:
173
-      // waveform generation = 0100 = CTC
174
-      SET_WGM(1, CTC_OCRnA);
175
-
176
-      // output mode = 00 (disconnected)
177
-      SET_COMA(1, NORMAL);
178
-
179
-      // Set the timer pre-scaler
180
-      // Generally we use a divider of 8, resulting in a 2MHz timer
181
-      // frequency on a 16MHz MCU. If you are going to change this, be
182
-      // sure to regenerate speed_lookuptable.h with
183
-      // create_speed_lookuptable.py
184
-      SET_CS(1, PRESCALER_8);  //  CS 2 = 1/8 prescaler
185
-
186
-      // Init Stepper ISR to 122 Hz for quick starting
187
-      // (F_CPU) / (STEPPER_TIMER_PRESCALE) / frequency
188
-      OCR1A = 0x4000;
189
-      TCNT1 = 0;
190
-      break;
191
-
192
-    case TEMP_TIMER_NUM:
193
-      // Use timer0 for temperature measurement
194
-      // Interleave temperature interrupt with millies interrupt
195
-      OCR0B = 128;
196
-      break;
197
-  }
198
-}
199
-
200
-#define TIMER_OCR_1             OCR1A
201
-#define TIMER_COUNTER_1         TCNT1
202
-
203
-#define TIMER_OCR_0             OCR0A
204
-#define TIMER_COUNTER_0         TCNT0
205
-
206
-#define _CAT(a,V...) a##V
207
-#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare)
208
-#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer)
209
-#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer)
210
-
211
-/**
212
- * On AVR there is no hardware prioritization and preemption of
213
- * interrupts, so this emulates it. The UART has first priority
214
- * (otherwise, characters will be lost due to UART overflow).
215
- * Then: Stepper, Endstops, Temperature, and -finally- all others.
216
- */
217
-#define HAL_timer_isr_prologue(TIMER_NUM)
218
-#define HAL_timer_isr_epilogue(TIMER_NUM)
219
-
220
-/* 18 cycles maximum latency */
221
-#define HAL_STEP_TIMER_ISR() \
222
-extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \
223
-extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
224
-void TIMER1_COMPA_vect() { \
225
-  __asm__ __volatile__ ( \
226
-    A("push r16")                      /* 2 Save R16 */ \
227
-    A("in r16, __SREG__")              /* 1 Get SREG */ \
228
-    A("push r16")                      /* 2 Save SREG into stack */ \
229
-    A("lds r16, %[timsk0]")            /* 2 Load into R0 the Temperature timer Interrupt mask register */ \
230
-    A("push r16")                      /* 2 Save TIMSK0 into the stack */ \
231
-    A("andi r16,~%[msk0]")             /* 1 Disable the temperature ISR */ \
232
-    A("sts %[timsk0], r16")            /* 2 And set the new value */ \
233
-    A("lds r16, %[timsk1]")            /* 2 Load into R0 the stepper timer Interrupt mask register [TIMSK1] */ \
234
-    A("andi r16,~%[msk1]")             /* 1 Disable the stepper ISR */ \
235
-    A("sts %[timsk1], r16")            /* 2 And set the new value */ \
236
-    A("push r16")                      /* 2 Save TIMSK1 into stack */ \
237
-    A("in r16, 0x3B")                  /* 1 Get RAMPZ register */ \
238
-    A("push r16")                      /* 2 Save RAMPZ into stack */ \
239
-    A("in r16, 0x3C")                  /* 1 Get EIND register */ \
240
-    A("push r0")                       /* C runtime can modify all the following registers without restoring them */ \
241
-    A("push r1")                       \
242
-    A("push r18")                      \
243
-    A("push r19")                      \
244
-    A("push r20")                      \
245
-    A("push r21")                      \
246
-    A("push r22")                      \
247
-    A("push r23")                      \
248
-    A("push r24")                      \
249
-    A("push r25")                      \
250
-    A("push r26")                      \
251
-    A("push r27")                      \
252
-    A("push r30")                      \
253
-    A("push r31")                      \
254
-    A("clr r1")                        /* C runtime expects this register to be 0 */ \
255
-    A("call TIMER1_COMPA_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */   \
256
-    A("pop r31")                       \
257
-    A("pop r30")                       \
258
-    A("pop r27")                       \
259
-    A("pop r26")                       \
260
-    A("pop r25")                       \
261
-    A("pop r24")                       \
262
-    A("pop r23")                       \
263
-    A("pop r22")                       \
264
-    A("pop r21")                       \
265
-    A("pop r20")                       \
266
-    A("pop r19")                       \
267
-    A("pop r18")                       \
268
-    A("pop r1")                        \
269
-    A("pop r0")                        \
270
-    A("out 0x3C, r16")                 /* 1 Restore EIND register */ \
271
-    A("pop r16")                       /* 2 Get the original RAMPZ register value */ \
272
-    A("out 0x3B, r16")                 /* 1 Restore RAMPZ register to its original value */ \
273
-    A("pop r16")                       /* 2 Get the original TIMSK1 value but with stepper ISR disabled */ \
274
-    A("ori r16,%[msk1]")               /* 1 Reenable the stepper ISR */ \
275
-    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 */ \
276
-    A("sts %[timsk1], r16")            /* 2 And restore the old value - This reenables the stepper ISR */ \
277
-    A("pop r16")                       /* 2 Get the temperature timer Interrupt mask register [TIMSK0] */ \
278
-    A("sts %[timsk0], r16")            /* 2 And restore the old value - This reenables the temperature ISR */ \
279
-    A("pop r16")                       /* 2 Get the old SREG value */ \
280
-    A("out __SREG__, r16")             /* 1 And restore the SREG value */ \
281
-    A("pop r16")                       /* 2 Restore R16 value */ \
282
-    A("reti")                          /* 4 Return from interrupt */ \
283
-    :                                   \
284
-    : [timsk0] "i" ((uint16_t)&TIMSK0), \
285
-      [timsk1] "i" ((uint16_t)&TIMSK1), \
286
-      [msk0] "M" ((uint8_t)(1<<OCIE0B)),\
287
-      [msk1] "M" ((uint8_t)(1<<OCIE1A)) \
288
-    : \
289
-  ); \
290
-} \
291
-void TIMER1_COMPA_vect_bottom()
292
-
293
-/* 14 cycles maximum latency */
294
-#define HAL_TEMP_TIMER_ISR() \
295
-extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \
296
-extern "C" void TIMER0_COMPB_vect_bottom()  asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
297
-void TIMER0_COMPB_vect() { \
298
-  __asm__ __volatile__ ( \
299
-    A("push r16")                       /* 2 Save R16 */ \
300
-    A("in r16, __SREG__")               /* 1 Get SREG */ \
301
-    A("push r16")                       /* 2 Save SREG into stack */ \
302
-    A("lds r16, %[timsk0]")             /* 2 Load into R0 the Temperature timer Interrupt mask register */ \
303
-    A("andi r16,~%[msk0]")              /* 1 Disable the temperature ISR */ \
304
-    A("sts %[timsk0], r16")             /* 2 And set the new value */ \
305
-    A("sei")                            /* 1 Enable global interrupts - It is safe, as the temperature ISR is disabled, so we cannot reenter it */    \
306
-    A("push r16")                       /* 2 Save TIMSK0 into stack */ \
307
-    A("in r16, 0x3B")                   /* 1 Get RAMPZ register */ \
308
-    A("push r16")                       /* 2 Save RAMPZ into stack */ \
309
-    A("in r16, 0x3C")                   /* 1 Get EIND register */ \
310
-    A("push r0")                        /* C runtime can modify all the following registers without restoring them */ \
311
-    A("push r1")                        \
312
-    A("push r18")                       \
313
-    A("push r19")                       \
314
-    A("push r20")                       \
315
-    A("push r21")                       \
316
-    A("push r22")                       \
317
-    A("push r23")                       \
318
-    A("push r24")                       \
319
-    A("push r25")                       \
320
-    A("push r26")                       \
321
-    A("push r27")                       \
322
-    A("push r30")                       \
323
-    A("push r31")                       \
324
-    A("clr r1")                         /* C runtime expects this register to be 0 */ \
325
-    A("call TIMER0_COMPB_vect_bottom")  /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */   \
326
-    A("pop r31")                        \
327
-    A("pop r30")                        \
328
-    A("pop r27")                        \
329
-    A("pop r26")                        \
330
-    A("pop r25")                        \
331
-    A("pop r24")                        \
332
-    A("pop r23")                        \
333
-    A("pop r22")                        \
334
-    A("pop r21")                        \
335
-    A("pop r20")                        \
336
-    A("pop r19")                        \
337
-    A("pop r18")                        \
338
-    A("pop r1")                         \
339
-    A("pop r0")                         \
340
-    A("out 0x3C, r16")                  /* 1 Restore EIND register */ \
341
-    A("pop r16")                        /* 2 Get the original RAMPZ register value */ \
342
-    A("out 0x3B, r16")                  /* 1 Restore RAMPZ register to its original value */ \
343
-    A("pop r16")                        /* 2 Get the original TIMSK0 value but with temperature ISR disabled */ \
344
-    A("ori r16,%[msk0]")                /* 1 Enable temperature ISR */ \
345
-    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 */ \
346
-    A("sts %[timsk0], r16")             /* 2 And restore the old value */ \
347
-    A("pop r16")                        /* 2 Get the old SREG */ \
348
-    A("out __SREG__, r16")              /* 1 And restore the SREG value */ \
349
-    A("pop r16")                        /* 2 Restore R16 */ \
350
-    A("reti")                           /* 4 Return from interrupt */ \
351
-    :                                   \
352
-    : [timsk0] "i"((uint16_t)&TIMSK0),  \
353
-      [msk0] "M" ((uint8_t)(1<<OCIE0B)) \
354
-    : \
355
-  ); \
356
-} \
357
-void TIMER0_COMPB_vect_bottom()
358
-
359
 // ADC
143
 // ADC
360
 #ifdef DIDR2
144
 #ifdef DIDR2
361
   #define HAL_ANALOG_SELECT(ind) do{ if (ind < 8) SBI(DIDR0, ind); else SBI(DIDR2, ind & 0x07); }while(0)
145
   #define HAL_ANALOG_SELECT(ind) do{ if (ind < 8) SBI(DIDR0, ind); else SBI(DIDR2, ind & 0x07); }while(0)
378
   #define HAL_START_ADC(ch) ADCSRB = 0; SET_ADMUX_ADCSRA(ch)
162
   #define HAL_START_ADC(ch) ADCSRB = 0; SET_ADMUX_ADCSRA(ch)
379
 #endif
163
 #endif
380
 
164
 
165
+#define HAL_ADC_VREF        5.0
381
 #define HAL_ADC_RESOLUTION 10
166
 #define HAL_ADC_RESOLUTION 10
382
 #define HAL_READ_ADC()  ADC
167
 #define HAL_READ_ADC()  ADC
383
 #define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
168
 #define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
395
 // AVR compatibility
180
 // AVR compatibility
396
 #define strtof strtod
181
 #define strtof strtod
397
 
182
 
183
+#define HAL_CAN_SET_PWM_FREQ   // This HAL supports PWM Frequency adjustment
184
+
398
 /**
185
 /**
399
  *  set_pwm_frequency
186
  *  set_pwm_frequency
400
  *  Sets the frequency of the timer corresponding to the provided pin
187
  *  Sets the frequency of the timer corresponding to the provided pin

+ 1
- 1
Marlin/src/HAL/AVR/HAL_SPI.cpp Parādīt failu

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

+ 17
- 9
Marlin/src/HAL/AVR/MarlinSerial.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 
22
 
43
   #include "MarlinSerial.h"
43
   #include "MarlinSerial.h"
44
   #include "../../MarlinCore.h"
44
   #include "../../MarlinCore.h"
45
 
45
 
46
+  #if ENABLED(DIRECT_STEPPING)
47
+    #include "../../feature/direct_stepping.h"
48
+  #endif
49
+
46
   template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
50
   template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
47
   template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_t MarlinSerial<Cfg>::tx_buffer = { 0 };
51
   template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_t MarlinSerial<Cfg>::tx_buffer = { 0 };
48
   template<typename Cfg> bool     MarlinSerial<Cfg>::_written = false;
52
   template<typename Cfg> bool     MarlinSerial<Cfg>::_written = false;
131
 
135
 
132
     static EmergencyParser::State emergency_state; // = EP_RESET
136
     static EmergencyParser::State emergency_state; // = EP_RESET
133
 
137
 
138
+    // This must read the R_UCSRA register before reading the received byte to detect error causes
139
+    if (Cfg::DROPPED_RX && B_DOR && !++rx_dropped_bytes) --rx_dropped_bytes;
140
+    if (Cfg::RX_OVERRUNS && B_DOR && !++rx_buffer_overruns) --rx_buffer_overruns;
141
+    if (Cfg::RX_FRAMING_ERRORS && B_FE && !++rx_framing_errors) --rx_framing_errors;
142
+
143
+    // Read the character from the USART
144
+    uint8_t c = R_UDR;
145
+
146
+    #if ENABLED(DIRECT_STEPPING)
147
+      if (page_manager.maybe_store_rxd_char(c)) return;
148
+    #endif
149
+
134
     // Get the tail - Nothing can alter its value while this ISR is executing, but there's
150
     // Get the tail - Nothing can alter its value while this ISR is executing, but there's
135
     // a chance that this ISR interrupted the main process while it was updating the index.
151
     // a chance that this ISR interrupted the main process while it was updating the index.
136
     // The backup mechanism ensures the correct value is always returned.
152
     // The backup mechanism ensures the correct value is always returned.
142
     // Get the next element
158
     // Get the next element
143
     ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1);
159
     ring_buffer_pos_t i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(Cfg::RX_SIZE - 1);
144
 
160
 
145
-    // This must read the R_UCSRA register before reading the received byte to detect error causes
146
-    if (Cfg::DROPPED_RX && B_DOR && !++rx_dropped_bytes) --rx_dropped_bytes;
147
-    if (Cfg::RX_OVERRUNS && B_DOR && !++rx_buffer_overruns) --rx_buffer_overruns;
148
-    if (Cfg::RX_FRAMING_ERRORS && B_FE && !++rx_framing_errors) --rx_framing_errors;
149
-
150
-    // Read the character from the USART
151
-    uint8_t c = R_UDR;
152
-
153
     if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c);
161
     if (Cfg::EMERGENCYPARSER) emergency_parser.update(emergency_state, c);
154
 
162
 
155
     // If the character is to be stored at the index just before the tail
163
     // If the character is to be stored at the index just before the tail

+ 4
- 4
Marlin/src/HAL/AVR/MarlinSerial.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
299
   template <uint8_t serial>
299
   template <uint8_t serial>
300
   struct MarlinInternalSerialCfg {
300
   struct MarlinInternalSerialCfg {
301
     static constexpr int PORT               = serial;
301
     static constexpr int PORT               = serial;
302
-    static constexpr unsigned int RX_SIZE   = 128;
303
-    static constexpr unsigned int TX_SIZE   = 48;
302
+    static constexpr unsigned int RX_SIZE   = DGUS_RX_BUFFER_SIZE;
303
+    static constexpr unsigned int TX_SIZE   = DGUS_TX_BUFFER_SIZE;
304
     static constexpr bool XONOFF            = false;
304
     static constexpr bool XONOFF            = false;
305
     static constexpr bool EMERGENCYPARSER   = false;
305
     static constexpr bool EMERGENCYPARSER   = false;
306
     static constexpr bool DROPPED_RX        = false;
306
     static constexpr bool DROPPED_RX        = false;
307
-    static constexpr bool RX_OVERRUNS       = HAS_DGUS_LCD && ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS);
307
+    static constexpr bool RX_OVERRUNS       = BOTH(HAS_DGUS_LCD, DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS);
308
     static constexpr bool RX_FRAMING_ERRORS = false;
308
     static constexpr bool RX_FRAMING_ERRORS = false;
309
     static constexpr bool MAX_RX_QUEUED     = false;
309
     static constexpr bool MAX_RX_QUEUED     = false;
310
   };
310
   };

+ 1
- 2
Marlin/src/HAL/AVR/Servo.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 
22
 
59
 
59
 
60
 #include <avr/interrupt.h>
60
 #include <avr/interrupt.h>
61
 
61
 
62
-#include "../shared/Marduino.h"
63
 #include "../shared/servo.h"
62
 #include "../shared/servo.h"
64
 #include "../shared/servo_private.h"
63
 #include "../shared/servo_private.h"
65
 
64
 

+ 1
- 1
Marlin/src/HAL/AVR/ServoTimers.h Parādīt failu

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

+ 12
- 5
Marlin/src/HAL/AVR/eeprom.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #ifdef __AVR__
22
 #ifdef __AVR__
25
 
25
 
26
 #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
26
 #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
27
 
27
 
28
+/**
29
+ * PersistentStore for Arduino-style EEPROM interface
30
+ * with implementations supplied by the framework.
31
+ */
32
+
28
 #include "../shared/eeprom_api.h"
33
 #include "../shared/eeprom_api.h"
29
 
34
 
30
-bool PersistentStore::access_start() { return true; }
35
+#ifndef MARLIN_EEPROM_SIZE
36
+  #define MARLIN_EEPROM_SIZE size_t(E2END + 1)
37
+#endif
38
+size_t PersistentStore::capacity()    { return MARLIN_EEPROM_SIZE; }
39
+bool PersistentStore::access_start()  { return true; }
31
 bool PersistentStore::access_finish() { return true; }
40
 bool PersistentStore::access_finish() { return true; }
32
 
41
 
33
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
42
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
46
     crc16(crc, &v, 1);
55
     crc16(crc, &v, 1);
47
     pos++;
56
     pos++;
48
     value++;
57
     value++;
49
-  };
58
+  }
50
   return false;
59
   return false;
51
 }
60
 }
52
 
61
 
61
   return false;  // always assume success for AVR's
70
   return false;  // always assume success for AVR's
62
 }
71
 }
63
 
72
 
64
-size_t PersistentStore::capacity() { return E2END + 1; }
65
-
66
 #endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE
73
 #endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE
67
 #endif // __AVR__
74
 #endif // __AVR__

+ 1
- 1
Marlin/src/HAL/AVR/endstop_interrupts.h Parādīt failu

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

+ 4
- 4
Marlin/src/HAL/AVR/fast_pwm.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #ifdef __AVR__
22
 #ifdef __AVR__
23
 
23
 
24
 #include "../../inc/MarlinConfigPre.h"
24
 #include "../../inc/MarlinConfigPre.h"
25
 
25
 
26
-#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_PWM
26
+#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
27
 
27
 
28
 #include "HAL.h"
28
 #include "HAL.h"
29
 
29
 
274
     else
274
     else
275
       top = *timer.ICRn; // top = ICRn
275
       top = *timer.ICRn; // top = ICRn
276
 
276
 
277
-    _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top / v_size)); // Scale 8/16-bit v to top value
277
+    _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top) / float(v_size)); // Scale 8/16-bit v to top value
278
   }
278
   }
279
 }
279
 }
280
 
280
 
281
-#endif // FAST_PWM_FAN || SPINDLE_LASER_PWM
281
+#endif // NEEDS_HARDWARE_PWM
282
 #endif // __AVR__
282
 #endif // __AVR__

+ 51
- 1
Marlin/src/HAL/AVR/fastio.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 
22
 
234
   }
234
   }
235
 }
235
 }
236
 
236
 
237
+#if 0
238
+/**
239
+ * Set Timer 5 PWM frequency in Hz, from 3.8Hz up to ~16MHz
240
+ * with a minimum resolution of 100 steps.
241
+ *
242
+ * DC values -1.0 to 1.0. Negative duty cycle inverts the pulse.
243
+ */
244
+uint16_t set_pwm_frequency_hz(const float &hz, const float dca, const float dcb, const float dcc) {
245
+  float count = 0;
246
+  if (hz > 0 && (dca || dcb || dcc)) {
247
+    count = float(F_CPU) / hz;            // 1x prescaler, TOP for 16MHz base freq.
248
+    uint16_t prescaler;                   // Range of 30.5Hz (65535) 64.5KHz (>31)
249
+
250
+         if (count >= 255. * 256.) { prescaler = 1024; SET_CS(5, PRESCALER_1024); }
251
+    else if (count >= 255. * 64.)  { prescaler = 256;  SET_CS(5,  PRESCALER_256); }
252
+    else if (count >= 255. * 8.)   { prescaler = 64;   SET_CS(5,   PRESCALER_64); }
253
+    else if (count >= 255.)        { prescaler = 8;    SET_CS(5,    PRESCALER_8); }
254
+    else                           { prescaler = 1;    SET_CS(5,    PRESCALER_1); }
255
+
256
+    count /= float(prescaler);
257
+    const float pwm_top = round(count);   // Get the rounded count
258
+
259
+    ICR5 = (uint16_t)pwm_top - 1;         // Subtract 1 for TOP
260
+    OCR5A = pwm_top * ABS(dca);          // Update and scale DCs
261
+    OCR5B = pwm_top * ABS(dcb);
262
+    OCR5C = pwm_top * ABS(dcc);
263
+    _SET_COM(5, A, dca ? (dca < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL); // Set compare modes
264
+    _SET_COM(5, B, dcb ? (dcb < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL);
265
+    _SET_COM(5, C, dcc ? (dcc < 0 ? COM_SET_CLEAR : COM_CLEAR_SET) : COM_NORMAL);
266
+
267
+    SET_WGM(5, FAST_PWM_ICRn);            // Fast PWM with ICR5 as TOP
268
+
269
+    //SERIAL_ECHOLNPGM("Timer 5 Settings:");
270
+    //SERIAL_ECHOLNPAIR("  Prescaler=", prescaler);
271
+    //SERIAL_ECHOLNPAIR("        TOP=", ICR5);
272
+    //SERIAL_ECHOLNPAIR("      OCR5A=", OCR5A);
273
+    //SERIAL_ECHOLNPAIR("      OCR5B=", OCR5B);
274
+    //SERIAL_ECHOLNPAIR("      OCR5C=", OCR5C);
275
+  }
276
+  else {
277
+    // Restore the default for Timer 5
278
+    SET_WGM(5, PWM_PC_8);                 // PWM 8-bit (Phase Correct)
279
+    SET_COMS(5, NORMAL, NORMAL, NORMAL);  // Do nothing
280
+    SET_CS(5, PRESCALER_64);              // 16MHz / 64 = 250KHz
281
+    OCR5A = OCR5B = OCR5C = 0;
282
+  }
283
+  return round(count);
284
+}
285
+#endif
286
+
237
 #endif // FASTIO_EXT_START
287
 #endif // FASTIO_EXT_START
238
 #endif // __AVR__
288
 #endif // __AVR__

+ 1
- 1
Marlin/src/HAL/AVR/fastio.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/fastio/fastio_1280.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/fastio/fastio_1281.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/fastio/fastio_168.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/fastio/fastio_644.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/inc/Conditionals_LCD.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/inc/Conditionals_adv.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/inc/Conditionals_post.h Parādīt failu

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

+ 5
- 13
Marlin/src/HAL/AVR/inc/SanityCheck.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
26
  */
26
  */
27
 
27
 
28
 /**
28
 /**
29
- * Digipot requirement
30
- */
31
- #if ENABLED(DIGIPOT_MCP4018)
32
-  #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
33
-    || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
34
-      #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
35
-  #endif
36
-#endif
37
-
38
-/**
39
  * Checks for FAST PWM
29
  * Checks for FAST PWM
40
  */
30
  */
41
 #if ENABLED(FAST_PWM_FAN) && (ENABLED(USE_OCR2A_AS_TOP) && defined(TCCR2))
31
 #if ENABLED(FAST_PWM_FAN) && (ENABLED(USE_OCR2A_AS_TOP) && defined(TCCR2))
51
   #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5)
41
   #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5)
52
     #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
42
     #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
53
   #endif
43
   #endif
44
+#elif defined(SPINDLE_LASER_FREQUENCY)
45
+  #error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_PWM."
54
 #endif
46
 #endif
55
 
47
 
56
 /**
48
 /**
57
  * The Trinamic library includes SoftwareSerial.h, leading to a compile error.
49
  * The Trinamic library includes SoftwareSerial.h, leading to a compile error.
58
  */
50
  */
59
-#if HAS_TRINAMIC_CONFIG && ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
51
+#if BOTH(HAS_TRINAMIC_CONFIG, ENDSTOP_INTERRUPTS_FEATURE)
60
   #error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
52
   #error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
61
 #endif
53
 #endif
62
 
54
 
63
-#if HAS_TMC_SW_SERIAL && ENABLED(MONITOR_DRIVER_STATUS)
55
+#if BOTH(HAS_TMC_SW_SERIAL, MONITOR_DRIVER_STATUS)
64
   #error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue."
56
   #error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue."
65
 #endif
57
 #endif

+ 1
- 1
Marlin/src/HAL/AVR/math.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/pinsDebug.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/pinsDebug_Teensyduino.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/pinsDebug_plus_70.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/AVR/spi_pins.h Parādīt failu

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

+ 259
- 0
Marlin/src/HAL/AVR/timers.h Parādīt failu

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
+ */
19
+#pragma once
20
+
21
+#include <stdint.h>
22
+
23
+// ------------------------
24
+// Types
25
+// ------------------------
26
+
27
+typedef uint16_t hal_timer_t;
28
+#define HAL_TIMER_TYPE_MAX 0xFFFF
29
+
30
+// ------------------------
31
+// Defines
32
+// ------------------------
33
+
34
+#define HAL_TIMER_RATE          ((F_CPU) / 8)    // i.e., 2MHz or 2.5MHz
35
+
36
+#ifndef STEP_TIMER_NUM
37
+  #define STEP_TIMER_NUM        1
38
+#endif
39
+#ifndef PULSE_TIMER_NUM
40
+  #define PULSE_TIMER_NUM       STEP_TIMER_NUM
41
+#endif
42
+#ifndef TEMP_TIMER_NUM
43
+  #define TEMP_TIMER_NUM        0
44
+#endif
45
+
46
+#define TEMP_TIMER_FREQUENCY    ((F_CPU) / 64.0 / 256.0)
47
+
48
+#define STEPPER_TIMER_RATE      HAL_TIMER_RATE
49
+#define STEPPER_TIMER_PRESCALE  8
50
+#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double
51
+
52
+#define PULSE_TIMER_RATE       STEPPER_TIMER_RATE   // frequency of pulse timer
53
+#define PULSE_TIMER_PRESCALE   STEPPER_TIMER_PRESCALE
54
+#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
55
+
56
+#define ENABLE_STEPPER_DRIVER_INTERRUPT()  SBI(TIMSK1, OCIE1A)
57
+#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
58
+#define STEPPER_ISR_ENABLED()             TEST(TIMSK1, OCIE1A)
59
+
60
+#define ENABLE_TEMPERATURE_INTERRUPT()     SBI(TIMSK0, OCIE0B)
61
+#define DISABLE_TEMPERATURE_INTERRUPT()    CBI(TIMSK0, OCIE0B)
62
+#define TEMPERATURE_ISR_ENABLED()         TEST(TIMSK0, OCIE0B)
63
+
64
+FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
65
+  switch (timer_num) {
66
+    case STEP_TIMER_NUM:
67
+      // waveform generation = 0100 = CTC
68
+      SET_WGM(1, CTC_OCRnA);
69
+
70
+      // output mode = 00 (disconnected)
71
+      SET_COMA(1, NORMAL);
72
+
73
+      // Set the timer pre-scaler
74
+      // Generally we use a divider of 8, resulting in a 2MHz timer
75
+      // frequency on a 16MHz MCU. If you are going to change this, be
76
+      // sure to regenerate speed_lookuptable.h with
77
+      // create_speed_lookuptable.py
78
+      SET_CS(1, PRESCALER_8);  //  CS 2 = 1/8 prescaler
79
+
80
+      // Init Stepper ISR to 122 Hz for quick starting
81
+      // (F_CPU) / (STEPPER_TIMER_PRESCALE) / frequency
82
+      OCR1A = 0x4000;
83
+      TCNT1 = 0;
84
+      break;
85
+
86
+    case TEMP_TIMER_NUM:
87
+      // Use timer0 for temperature measurement
88
+      // Interleave temperature interrupt with millies interrupt
89
+      OCR0B = 128;
90
+      break;
91
+  }
92
+}
93
+
94
+#define TIMER_OCR_1             OCR1A
95
+#define TIMER_COUNTER_1         TCNT1
96
+
97
+#define TIMER_OCR_0             OCR0A
98
+#define TIMER_COUNTER_0         TCNT0
99
+
100
+#define _CAT(a,V...) a##V
101
+#define HAL_timer_set_compare(timer, compare) (_CAT(TIMER_OCR_, timer) = compare)
102
+#define HAL_timer_get_compare(timer) _CAT(TIMER_OCR_, timer)
103
+#define HAL_timer_get_count(timer) _CAT(TIMER_COUNTER_, timer)
104
+
105
+/**
106
+ * On AVR there is no hardware prioritization and preemption of
107
+ * interrupts, so this emulates it. The UART has first priority
108
+ * (otherwise, characters will be lost due to UART overflow).
109
+ * Then: Stepper, Endstops, Temperature, and -finally- all others.
110
+ */
111
+#define HAL_timer_isr_prologue(TIMER_NUM)
112
+#define HAL_timer_isr_epilogue(TIMER_NUM)
113
+
114
+/* 18 cycles maximum latency */
115
+#ifndef HAL_STEP_TIMER_ISR
116
+
117
+#define HAL_STEP_TIMER_ISR() \
118
+extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \
119
+extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
120
+void TIMER1_COMPA_vect() { \
121
+  __asm__ __volatile__ ( \
122
+    A("push r16")                      /* 2 Save R16 */ \
123
+    A("in r16, __SREG__")              /* 1 Get SREG */ \
124
+    A("push r16")                      /* 2 Save SREG into stack */ \
125
+    A("lds r16, %[timsk0]")            /* 2 Load into R0 the Temperature timer Interrupt mask register */ \
126
+    A("push r16")                      /* 2 Save TIMSK0 into the stack */ \
127
+    A("andi r16,~%[msk0]")             /* 1 Disable the temperature ISR */ \
128
+    A("sts %[timsk0], r16")            /* 2 And set the new value */ \
129
+    A("lds r16, %[timsk1]")            /* 2 Load into R0 the stepper timer Interrupt mask register [TIMSK1] */ \
130
+    A("andi r16,~%[msk1]")             /* 1 Disable the stepper ISR */ \
131
+    A("sts %[timsk1], r16")            /* 2 And set the new value */ \
132
+    A("push r16")                      /* 2 Save TIMSK1 into stack */ \
133
+    A("in r16, 0x3B")                  /* 1 Get RAMPZ register */ \
134
+    A("push r16")                      /* 2 Save RAMPZ into stack */ \
135
+    A("in r16, 0x3C")                  /* 1 Get EIND register */ \
136
+    A("push r0")                       /* C runtime can modify all the following registers without restoring them */ \
137
+    A("push r1")                       \
138
+    A("push r18")                      \
139
+    A("push r19")                      \
140
+    A("push r20")                      \
141
+    A("push r21")                      \
142
+    A("push r22")                      \
143
+    A("push r23")                      \
144
+    A("push r24")                      \
145
+    A("push r25")                      \
146
+    A("push r26")                      \
147
+    A("push r27")                      \
148
+    A("push r30")                      \
149
+    A("push r31")                      \
150
+    A("clr r1")                        /* C runtime expects this register to be 0 */ \
151
+    A("call TIMER1_COMPA_vect_bottom") /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */   \
152
+    A("pop r31")                       \
153
+    A("pop r30")                       \
154
+    A("pop r27")                       \
155
+    A("pop r26")                       \
156
+    A("pop r25")                       \
157
+    A("pop r24")                       \
158
+    A("pop r23")                       \
159
+    A("pop r22")                       \
160
+    A("pop r21")                       \
161
+    A("pop r20")                       \
162
+    A("pop r19")                       \
163
+    A("pop r18")                       \
164
+    A("pop r1")                        \
165
+    A("pop r0")                        \
166
+    A("out 0x3C, r16")                 /* 1 Restore EIND register */ \
167
+    A("pop r16")                       /* 2 Get the original RAMPZ register value */ \
168
+    A("out 0x3B, r16")                 /* 1 Restore RAMPZ register to its original value */ \
169
+    A("pop r16")                       /* 2 Get the original TIMSK1 value but with stepper ISR disabled */ \
170
+    A("ori r16,%[msk1]")               /* 1 Reenable the stepper ISR */ \
171
+    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 */ \
172
+    A("sts %[timsk1], r16")            /* 2 And restore the old value - This reenables the stepper ISR */ \
173
+    A("pop r16")                       /* 2 Get the temperature timer Interrupt mask register [TIMSK0] */ \
174
+    A("sts %[timsk0], r16")            /* 2 And restore the old value - This reenables the temperature ISR */ \
175
+    A("pop r16")                       /* 2 Get the old SREG value */ \
176
+    A("out __SREG__, r16")             /* 1 And restore the SREG value */ \
177
+    A("pop r16")                       /* 2 Restore R16 value */ \
178
+    A("reti")                          /* 4 Return from interrupt */ \
179
+    :                                   \
180
+    : [timsk0] "i" ((uint16_t)&TIMSK0), \
181
+      [timsk1] "i" ((uint16_t)&TIMSK1), \
182
+      [msk0] "M" ((uint8_t)(1<<OCIE0B)),\
183
+      [msk1] "M" ((uint8_t)(1<<OCIE1A)) \
184
+    : \
185
+  ); \
186
+} \
187
+void TIMER1_COMPA_vect_bottom()
188
+
189
+#endif // HAL_STEP_TIMER_ISR
190
+
191
+#ifndef HAL_TEMP_TIMER_ISR
192
+
193
+/* 14 cycles maximum latency */
194
+#define HAL_TEMP_TIMER_ISR() \
195
+extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \
196
+extern "C" void TIMER0_COMPB_vect_bottom()  asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
197
+void TIMER0_COMPB_vect() { \
198
+  __asm__ __volatile__ ( \
199
+    A("push r16")                       /* 2 Save R16 */ \
200
+    A("in r16, __SREG__")               /* 1 Get SREG */ \
201
+    A("push r16")                       /* 2 Save SREG into stack */ \
202
+    A("lds r16, %[timsk0]")             /* 2 Load into R0 the Temperature timer Interrupt mask register */ \
203
+    A("andi r16,~%[msk0]")              /* 1 Disable the temperature ISR */ \
204
+    A("sts %[timsk0], r16")             /* 2 And set the new value */ \
205
+    A("sei")                            /* 1 Enable global interrupts - It is safe, as the temperature ISR is disabled, so we cannot reenter it */    \
206
+    A("push r16")                       /* 2 Save TIMSK0 into stack */ \
207
+    A("in r16, 0x3B")                   /* 1 Get RAMPZ register */ \
208
+    A("push r16")                       /* 2 Save RAMPZ into stack */ \
209
+    A("in r16, 0x3C")                   /* 1 Get EIND register */ \
210
+    A("push r0")                        /* C runtime can modify all the following registers without restoring them */ \
211
+    A("push r1")                        \
212
+    A("push r18")                       \
213
+    A("push r19")                       \
214
+    A("push r20")                       \
215
+    A("push r21")                       \
216
+    A("push r22")                       \
217
+    A("push r23")                       \
218
+    A("push r24")                       \
219
+    A("push r25")                       \
220
+    A("push r26")                       \
221
+    A("push r27")                       \
222
+    A("push r30")                       \
223
+    A("push r31")                       \
224
+    A("clr r1")                         /* C runtime expects this register to be 0 */ \
225
+    A("call TIMER0_COMPB_vect_bottom")  /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */   \
226
+    A("pop r31")                        \
227
+    A("pop r30")                        \
228
+    A("pop r27")                        \
229
+    A("pop r26")                        \
230
+    A("pop r25")                        \
231
+    A("pop r24")                        \
232
+    A("pop r23")                        \
233
+    A("pop r22")                        \
234
+    A("pop r21")                        \
235
+    A("pop r20")                        \
236
+    A("pop r19")                        \
237
+    A("pop r18")                        \
238
+    A("pop r1")                         \
239
+    A("pop r0")                         \
240
+    A("out 0x3C, r16")                  /* 1 Restore EIND register */ \
241
+    A("pop r16")                        /* 2 Get the original RAMPZ register value */ \
242
+    A("out 0x3B, r16")                  /* 1 Restore RAMPZ register to its original value */ \
243
+    A("pop r16")                        /* 2 Get the original TIMSK0 value but with temperature ISR disabled */ \
244
+    A("ori r16,%[msk0]")                /* 1 Enable temperature ISR */ \
245
+    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 */ \
246
+    A("sts %[timsk0], r16")             /* 2 And restore the old value */ \
247
+    A("pop r16")                        /* 2 Get the old SREG */ \
248
+    A("out __SREG__, r16")              /* 1 And restore the SREG value */ \
249
+    A("pop r16")                        /* 2 Restore R16 */ \
250
+    A("reti")                           /* 4 Return from interrupt */ \
251
+    :                                   \
252
+    : [timsk0] "i"((uint16_t)&TIMSK0),  \
253
+      [msk0] "M" ((uint8_t)(1<<OCIE0B)) \
254
+    : \
255
+  ); \
256
+} \
257
+void TIMER0_COMPB_vect_bottom()
258
+
259
+#endif // HAL_TEMP_TIMER_ISR

+ 1
- 1
Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp Parādīt failu

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

+ 1
- 2
Marlin/src/HAL/AVR/watchdog.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
-
23
 #ifdef __AVR__
22
 #ifdef __AVR__
24
 
23
 
25
 #include "../../inc/MarlinConfig.h"
24
 #include "../../inc/MarlinConfig.h"

+ 1
- 1
Marlin/src/HAL/AVR/watchdog.h Parādīt failu

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

+ 1
- 2
Marlin/src/HAL/DUE/DebugMonitor.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
-
23
 #ifdef ARDUINO_ARCH_SAM
22
 #ifdef ARDUINO_ARCH_SAM
24
 
23
 
25
 #include "../../core/macros.h"
24
 #include "../../core/macros.h"

+ 1
- 1
Marlin/src/HAL/DUE/HAL.cpp Parādīt failu

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

+ 4
- 11
Marlin/src/HAL/DUE/HAL.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
30
 #define CPU_32_BIT
30
 #define CPU_32_BIT
31
 
31
 
32
 #include "../shared/Marduino.h"
32
 #include "../shared/Marduino.h"
33
+#include "../shared/eeprom_if.h"
33
 #include "../shared/math_32bit.h"
34
 #include "../shared/math_32bit.h"
34
 #include "../shared/HAL_SPI.h"
35
 #include "../shared/HAL_SPI.h"
35
 #include "fastio.h"
36
 #include "fastio.h"
36
 #include "watchdog.h"
37
 #include "watchdog.h"
37
-#include "timers.h"
38
 
38
 
39
 #include <stdint.h>
39
 #include <stdint.h>
40
 
40
 
131
 uint8_t HAL_get_reset_source(); // get reset reason
131
 uint8_t HAL_get_reset_source(); // get reset reason
132
 
132
 
133
 //
133
 //
134
-// EEPROM
135
-//
136
-void eeprom_write_byte(uint8_t *pos, unsigned char value);
137
-uint8_t eeprom_read_byte(uint8_t *pos);
138
-void eeprom_read_block (void *__dst, const void *__src, size_t __n);
139
-void eeprom_update_block (const void *__src, void *__dst, size_t __n);
140
-
141
-//
142
 // ADC
134
 // ADC
143
 //
135
 //
144
 extern uint16_t HAL_adc_result;     // result of last ADC conversion
136
 extern uint16_t HAL_adc_result;     // result of last ADC conversion
151
 
143
 
152
 inline void HAL_adc_init() {}//todo
144
 inline void HAL_adc_init() {}//todo
153
 
145
 
154
-#define HAL_START_ADC(ch)   HAL_adc_start_conversion(ch)
146
+#define HAL_ADC_VREF         3.3
155
 #define HAL_ADC_RESOLUTION  10
147
 #define HAL_ADC_RESOLUTION  10
148
+#define HAL_START_ADC(ch)   HAL_adc_start_conversion(ch)
156
 #define HAL_READ_ADC()      HAL_adc_result
149
 #define HAL_READ_ADC()      HAL_adc_result
157
 #define HAL_ADC_READY()     true
150
 #define HAL_ADC_READY()     true
158
 
151
 

+ 1
- 1
Marlin/src/HAL/DUE/HAL_SPI.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/InterruptVectors.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/InterruptVectors.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/MarlinSerial.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/MarlinSerial.h Parādīt failu

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

+ 3
- 7
Marlin/src/HAL/DUE/MarlinSerialUSB.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 
22
 
73
 
73
 
74
   pending_char = udi_cdc_getc();
74
   pending_char = udi_cdc_getc();
75
 
75
 
76
-  #if ENABLED(EMERGENCY_PARSER)
77
-    emergency_parser.update(emergency_state, (char)pending_char);
78
-  #endif
76
+  TERN_(EMERGENCY_PARSER, emergency_parser.update(emergency_state, (char)pending_char));
79
 
77
 
80
   return pending_char;
78
   return pending_char;
81
 }
79
 }
97
 
95
 
98
   int c = udi_cdc_getc();
96
   int c = udi_cdc_getc();
99
 
97
 
100
-  #if ENABLED(EMERGENCY_PARSER)
101
-    emergency_parser.update(emergency_state, (char)c);
102
-  #endif
98
+  TERN_(EMERGENCY_PARSER, emergency_parser.update(emergency_state, (char)c));
103
 
99
 
104
   return c;
100
   return c;
105
 }
101
 }

+ 1
- 1
Marlin/src/HAL/DUE/MarlinSerialUSB.h Parādīt failu

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

+ 1
- 2
Marlin/src/HAL/DUE/Servo.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 
22
 
44
 
44
 
45
 #if HAS_SERVOS
45
 #if HAS_SERVOS
46
 
46
 
47
-#include "../shared/Marduino.h"
48
 #include "../shared/servo.h"
47
 #include "../shared/servo.h"
49
 #include "../shared/servo_private.h"
48
 #include "../shared/servo_private.h"
50
 
49
 

+ 1
- 2
Marlin/src/HAL/DUE/Tone.cpp Parādīt failu

18
  * GNU General Public License for more details.
18
  * GNU General Public License for more details.
19
  *
19
  *
20
  * You should have received a copy of the GNU General Public License
20
  * You should have received a copy of the GNU General Public License
21
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
22
  *
22
  *
23
  */
23
  */
24
 
24
 
31
 
31
 
32
 #include "../../inc/MarlinConfig.h"
32
 #include "../../inc/MarlinConfig.h"
33
 #include "HAL.h"
33
 #include "HAL.h"
34
-#include "timers.h"
35
 
34
 
36
 static pin_t tone_pin;
35
 static pin_t tone_pin;
37
 volatile static int32_t toggles;
36
 volatile static int32_t toggles;

+ 1
- 1
Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.h Parādīt failu

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

Marlin/src/HAL/DUE/EepromEmulation.cpp → Marlin/src/HAL/DUE/eeprom_flash.cpp Parādīt failu

1
 /**
1
 /**
2
  * Marlin 3D Printer Firmware
2
  * Marlin 3D Printer Firmware
3
- * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
  *
3
  *
5
- * Based on Sprinter and grbl.
6
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
4
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
5
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
6
+ * Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
7
+ * Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
7
  *
8
  *
8
  * This program is free software: you can redistribute it and/or modify
9
  * This program is free software: you can redistribute it and/or modify
9
  * it under the terms of the GNU General Public License as published by
10
  * it under the terms of the GNU General Public License as published by
16
  * GNU General Public License for more details.
17
  * GNU General Public License for more details.
17
  *
18
  *
18
  * You should have received a copy of the GNU General Public License
19
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
21
  *
21
  */
22
  */
23
+#ifdef ARDUINO_ARCH_SAM
24
+
25
+#include "../../inc/MarlinConfig.h"
26
+
27
+#if ENABLED(FLASH_EEPROM_EMULATION)
22
 
28
 
23
 /* EEPROM emulation over flash with reduced wear
29
 /* EEPROM emulation over flash with reduced wear
24
  *
30
  *
50
  *
56
  *
51
  */
57
  */
52
 
58
 
53
-#ifdef ARDUINO_ARCH_SAM
54
-
55
-#include "../../inc/MarlinConfig.h"
56
-
57
-#if ENABLED(FLASH_EEPROM_EMULATION)
58
-
59
-#include "../shared/Marduino.h"
60
-#include "../shared/eeprom_api.h"
59
+//#define EE_EMU_DEBUG
61
 
60
 
62
 #define EEPROMSize     4096
61
 #define EEPROMSize     4096
63
 #define PagesPerGroup   128
62
 #define PagesPerGroup   128
134
                curPage = 0,         // Current FLASH page inside the group
133
                curPage = 0,         // Current FLASH page inside the group
135
                curGroup = 0xFF;     // Current FLASH group
134
                curGroup = 0xFF;     // Current FLASH group
136
 
135
 
137
-//#define EE_EMU_DEBUG
138
-#ifdef EE_EMU_DEBUG
139
-  static void ee_Dump(int page,const void* data) {
136
+#define DEBUG_OUT ENABLED(EE_EMU_DEBUG)
137
+#include "../../core/debug_out.h"
138
+
139
+static void ee_Dump(const int page, const void* data) {
140
+
141
+  #ifdef EE_EMU_DEBUG
140
 
142
 
141
     const uint8_t* c = (const uint8_t*) data;
143
     const uint8_t* c = (const uint8_t*) data;
142
     char buffer[80];
144
     char buffer[80];
143
 
145
 
144
     sprintf_P(buffer, PSTR("Page: %d (0x%04x)\n"), page, page);
146
     sprintf_P(buffer, PSTR("Page: %d (0x%04x)\n"), page, page);
145
-    SERIAL_ECHO(buffer);
147
+    DEBUG_ECHO(buffer);
146
 
148
 
147
     char* p = &buffer[0];
149
     char* p = &buffer[0];
148
     for (int i = 0; i< PageSize; ++i) {
150
     for (int i = 0; i< PageSize; ++i) {
152
       if ((i & 0xF) == 0xF) {
154
       if ((i & 0xF) == 0xF) {
153
         *p++ = '\n';
155
         *p++ = '\n';
154
         *p = 0;
156
         *p = 0;
155
-        SERIAL_ECHO(buffer);
157
+        DEBUG_ECHO(buffer);
156
         p = &buffer[0];
158
         p = &buffer[0];
157
       }
159
       }
158
     }
160
     }
159
-  }
160
-#endif
161
+
162
+  #else
163
+    UNUSED(page);
164
+    UNUSED(data);
165
+  #endif
166
+}
161
 
167
 
162
 /* Flash Writing Protection Key */
168
 /* Flash Writing Protection Key */
163
 #define FWP_KEY    0x5Au
169
 #define FWP_KEY    0x5Au
170
   #define EEFC_ERROR_FLAGS  (EEFC_FSR_FLOCKE | EEFC_FSR_FCMDE)
176
   #define EEFC_ERROR_FLAGS  (EEFC_FSR_FLOCKE | EEFC_FSR_FCMDE)
171
 #endif
177
 #endif
172
 
178
 
173
-
174
 /**
179
 /**
175
  * Writes the contents of the specified page (no previous erase)
180
  * Writes the contents of the specified page (no previous erase)
176
  * @param page    (page #)
181
  * @param page    (page #)
177
  * @param data    (pointer to the data buffer)
182
  * @param data    (pointer to the data buffer)
178
  */
183
  */
179
 __attribute__ ((long_call, section (".ramfunc")))
184
 __attribute__ ((long_call, section (".ramfunc")))
180
-static bool ee_PageWrite(uint16_t page,const void* data) {
185
+static bool ee_PageWrite(uint16_t page, const void* data) {
181
 
186
 
182
   uint16_t i;
187
   uint16_t i;
183
-  uint32_t addrflash = ((uint32_t)getFlashStorage(page));
188
+  uint32_t addrflash = uint32_t(getFlashStorage(page));
184
 
189
 
185
   // Read the flash contents
190
   // Read the flash contents
186
   uint32_t pageContents[PageSize>>2];
191
   uint32_t pageContents[PageSize>>2];
195
   for (i = 0; i <PageSize >> 2; i++)
200
   for (i = 0; i <PageSize >> 2; i++)
196
     pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i]));
201
     pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i]));
197
 
202
 
198
-  #ifdef EE_EMU_DEBUG
199
-    SERIAL_ECHO_START();
200
-    SERIAL_ECHOLNPAIR("EEPROM PageWrite   ", page);
201
-    SERIAL_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
202
-    SERIAL_ECHOLNPAIR(" base address     ", (uint32_t)getFlashStorage(0));
203
-    SERIAL_FLUSH();
204
-  #endif
203
+  DEBUG_ECHO_START();
204
+  DEBUG_ECHOLNPAIR("EEPROM PageWrite   ", page);
205
+  DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
206
+  DEBUG_ECHOLNPAIR(" base address     ", (uint32_t)getFlashStorage(0));
207
+  DEBUG_FLUSH();
205
 
208
 
206
   // Get the page relative to the start of the EFC controller, and the EFC controller to use
209
   // Get the page relative to the start of the EFC controller, and the EFC controller to use
207
   Efc *efc;
210
   Efc *efc;
243
     // Reenable interrupts
246
     // Reenable interrupts
244
     __enable_irq();
247
     __enable_irq();
245
 
248
 
246
-    #ifdef EE_EMU_DEBUG
247
-      SERIAL_ECHO_START();
248
-      SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ", page);
249
-    #endif
249
+    DEBUG_ECHO_START();
250
+    DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ", page);
250
     return false;
251
     return false;
251
   }
252
   }
252
 
253
 
270
     // Reenable interrupts
271
     // Reenable interrupts
271
     __enable_irq();
272
     __enable_irq();
272
 
273
 
273
-    #ifdef EE_EMU_DEBUG
274
-      SERIAL_ECHO_START();
275
-      SERIAL_ECHOLNPAIR("EEPROM Write failure for page ", page);
276
-    #endif
274
+    DEBUG_ECHO_START();
275
+    DEBUG_ECHOLNPAIR("EEPROM Write failure for page ", page);
276
+
277
     return false;
277
     return false;
278
   }
278
   }
279
 
279
 
287
   if (memcmp(getFlashStorage(page),data,PageSize)) {
287
   if (memcmp(getFlashStorage(page),data,PageSize)) {
288
 
288
 
289
     #ifdef EE_EMU_DEBUG
289
     #ifdef EE_EMU_DEBUG
290
-      SERIAL_ECHO_START();
291
-      SERIAL_ECHOLNPAIR("EEPROM Verify Write failure for page ", page);
290
+      DEBUG_ECHO_START();
291
+      DEBUG_ECHOLNPAIR("EEPROM Verify Write failure for page ", page);
292
 
292
 
293
-      ee_Dump( page,(uint32_t *) addrflash);
294
-      ee_Dump(-page,data);
293
+      ee_Dump( page, (uint32_t *)addrflash);
294
+      ee_Dump(-page, data);
295
 
295
 
296
       // Calculate count of changed bits
296
       // Calculate count of changed bits
297
       uint32_t* p1 = (uint32_t*)addrflash;
297
       uint32_t* p1 = (uint32_t*)addrflash;
307
           }
307
           }
308
         }
308
         }
309
       }
309
       }
310
-      SERIAL_ECHOLNPAIR("--> Differing bits: ", count);
310
+      DEBUG_ECHOLNPAIR("--> Differing bits: ", count);
311
     #endif
311
     #endif
312
 
312
 
313
     return false;
313
     return false;
324
 static bool ee_PageErase(uint16_t page) {
324
 static bool ee_PageErase(uint16_t page) {
325
 
325
 
326
   uint16_t i;
326
   uint16_t i;
327
-  uint32_t addrflash = ((uint32_t)getFlashStorage(page));
327
+  uint32_t addrflash = uint32_t(getFlashStorage(page));
328
 
328
 
329
-  #ifdef EE_EMU_DEBUG
330
-    SERIAL_ECHO_START();
331
-    SERIAL_ECHOLNPAIR("EEPROM PageErase  ", page);
332
-    SERIAL_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
333
-    SERIAL_ECHOLNPAIR(" base address     ", (uint32_t)getFlashStorage(0));
334
-    SERIAL_FLUSH();
335
-  #endif
329
+  DEBUG_ECHO_START();
330
+  DEBUG_ECHOLNPAIR("EEPROM PageErase  ", page);
331
+  DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
332
+  DEBUG_ECHOLNPAIR(" base address     ", (uint32_t)getFlashStorage(0));
333
+  DEBUG_FLUSH();
336
 
334
 
337
   // Get the page relative to the start of the EFC controller, and the EFC controller to use
335
   // Get the page relative to the start of the EFC controller, and the EFC controller to use
338
   Efc *efc;
336
   Efc *efc;
373
     // Reenable interrupts
371
     // Reenable interrupts
374
     __enable_irq();
372
     __enable_irq();
375
 
373
 
376
-    #ifdef EE_EMU_DEBUG
377
-      SERIAL_ECHO_START();
378
-      SERIAL_ECHOLNPAIR("EEPROM Unlock failure for page ",page);
379
-    #endif
374
+    DEBUG_ECHO_START();
375
+    DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ",page);
376
+
380
     return false;
377
     return false;
381
   }
378
   }
382
 
379
 
398
     // Reenable interrupts
395
     // Reenable interrupts
399
     __enable_irq();
396
     __enable_irq();
400
 
397
 
401
-    #ifdef EE_EMU_DEBUG
402
-      SERIAL_ECHO_START();
403
-      SERIAL_ECHOLNPAIR("EEPROM Erase failure for page ",page);
404
-    #endif
398
+    DEBUG_ECHO_START();
399
+    DEBUG_ECHOLNPAIR("EEPROM Erase failure for page ",page);
400
+
405
     return false;
401
     return false;
406
   }
402
   }
407
 
403
 
415
   uint32_t * aligned_src = (uint32_t *) addrflash;
411
   uint32_t * aligned_src = (uint32_t *) addrflash;
416
   for (i = 0; i < PageSize >> 2; i++) {
412
   for (i = 0; i < PageSize >> 2; i++) {
417
     if (*aligned_src++ != 0xFFFFFFFF) {
413
     if (*aligned_src++ != 0xFFFFFFFF) {
418
-
419
-      #ifdef EE_EMU_DEBUG
420
-        SERIAL_ECHO_START();
421
-        SERIAL_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page);
422
-
423
-        ee_Dump( page,(uint32_t *) addrflash);
424
-      #endif
414
+      DEBUG_ECHO_START();
415
+      DEBUG_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page);
416
+      ee_Dump(page, (uint32_t *)addrflash);
425
       return false;
417
       return false;
426
     }
418
     }
427
   }
419
   }
428
 
420
 
429
   return true;
421
   return true;
430
 }
422
 }
431
-static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer = false) {
423
+
424
+static uint8_t ee_Read(uint32_t address, bool excludeRAMBuffer=false) {
432
 
425
 
433
   uint32_t baddr;
426
   uint32_t baddr;
434
   uint32_t blen;
427
   uint32_t blen;
511
   return 0xFF;
504
   return 0xFF;
512
 }
505
 }
513
 
506
 
514
-static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer = false) {
507
+static uint32_t ee_GetAddrRange(uint32_t address, bool excludeRAMBuffer=false) {
515
   uint32_t baddr,
508
   uint32_t baddr,
516
            blen,
509
            blen,
517
            nextAddr = 0xFFFF,
510
            nextAddr = 0xFFFF,
603
   return true;
596
   return true;
604
 }
597
 }
605
 
598
 
606
-static bool ee_Flush(uint32_t overrideAddress = 0xFFFFFFFF, uint8_t overrideData = 0xFF) {
599
+static bool ee_Flush(uint32_t overrideAddress = 0xFFFFFFFF, uint8_t overrideData=0xFF) {
607
 
600
 
608
   // Check if RAM buffer has something to be written
601
   // Check if RAM buffer has something to be written
609
   bool isEmpty = true;
602
   bool isEmpty = true;
929
   // If all groups seem to be used, default to first group
922
   // If all groups seem to be used, default to first group
930
   if (curGroup >= GroupCount) curGroup = 0;
923
   if (curGroup >= GroupCount) curGroup = 0;
931
 
924
 
932
-  #ifdef EE_EMU_DEBUG
933
-    SERIAL_ECHO_START();
934
-    SERIAL_ECHOLNPAIR("EEPROM Current Group: ",curGroup);
935
-    SERIAL_FLUSH();
936
-  #endif
925
+  DEBUG_ECHO_START();
926
+  DEBUG_ECHOLNPAIR("EEPROM Current Group: ",curGroup);
927
+  DEBUG_FLUSH();
937
 
928
 
938
   // Now, validate that all the other group pages are empty
929
   // Now, validate that all the other group pages are empty
939
   for (int grp = 0; grp < GroupCount; grp++) {
930
   for (int grp = 0; grp < GroupCount; grp++) {
941
 
932
 
942
     for (int page = 0; page < PagesPerGroup; page++) {
933
     for (int page = 0; page < PagesPerGroup; page++) {
943
       if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
934
       if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
944
-        #ifdef EE_EMU_DEBUG
945
-          SERIAL_ECHO_START();
946
-          SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
947
-          SERIAL_FLUSH();
948
-        #endif
935
+        DEBUG_ECHO_START();
936
+        DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
937
+        DEBUG_FLUSH();
949
         ee_PageErase(grp * PagesPerGroup + page);
938
         ee_PageErase(grp * PagesPerGroup + page);
950
       }
939
       }
951
     }
940
     }
955
   // and also validate that all the other ones are clean
944
   // and also validate that all the other ones are clean
956
   for (curPage = 0; curPage < PagesPerGroup; curPage++) {
945
   for (curPage = 0; curPage < PagesPerGroup; curPage++) {
957
     if (ee_IsPageClean(curGroup * PagesPerGroup + curPage)) {
946
     if (ee_IsPageClean(curGroup * PagesPerGroup + curPage)) {
958
-      #ifdef EE_EMU_DEBUG
959
-        ee_Dump(curGroup * PagesPerGroup + curPage, getFlashStorage(curGroup * PagesPerGroup + curPage));
960
-      #endif
947
+      ee_Dump(curGroup * PagesPerGroup + curPage, getFlashStorage(curGroup * PagesPerGroup + curPage));
961
       break;
948
       break;
962
     }
949
     }
963
   }
950
   }
964
 
951
 
965
-  #ifdef EE_EMU_DEBUG
966
-    SERIAL_ECHO_START();
967
-    SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage);
968
-    SERIAL_FLUSH();
969
-  #endif
952
+  DEBUG_ECHO_START();
953
+  DEBUG_ECHOLNPAIR("EEPROM Active page: ", curPage);
954
+  DEBUG_FLUSH();
970
 
955
 
971
   // Make sure the pages following the first clean one are also clean
956
   // Make sure the pages following the first clean one are also clean
972
   for (int page = curPage + 1; page < PagesPerGroup; page++) {
957
   for (int page = curPage + 1; page < PagesPerGroup; page++) {
973
     if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
958
     if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
974
-      #ifdef EE_EMU_DEBUG
975
-        SERIAL_ECHO_START();
976
-        SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
977
-        SERIAL_FLUSH();
978
-        ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
979
-      #endif
959
+      DEBUG_ECHO_START();
960
+      DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
961
+      DEBUG_FLUSH();
962
+      ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
980
       ee_PageErase(curGroup * PagesPerGroup + page);
963
       ee_PageErase(curGroup * PagesPerGroup + page);
981
     }
964
     }
982
   }
965
   }
983
 }
966
 }
984
 
967
 
985
-uint8_t eeprom_read_byte(uint8_t* addr) {
986
-  ee_Init();
987
-  return ee_Read((uint32_t)addr);
988
-}
968
+/* PersistentStore -----------------------------------------------------------*/
989
 
969
 
990
-void eeprom_write_byte(uint8_t* addr, uint8_t value) {
991
-  ee_Init();
992
-  ee_Write((uint32_t)addr, value);
993
-}
994
-
995
-void eeprom_update_block(const void* __src, void* __dst, size_t __n) {
996
-  uint8_t* dst = (uint8_t*)__dst;
997
-  const uint8_t* src = (const uint8_t*)__src;
998
-  while (__n--) {
999
-    eeprom_write_byte(dst, *src);
1000
-    ++dst;
1001
-    ++src;
1002
-  }
1003
-}
970
+#include "../shared/eeprom_api.h"
1004
 
971
 
1005
-void eeprom_read_block(void* __dst, const void* __src, size_t __n) {
1006
-  uint8_t* dst = (uint8_t*)__dst;
1007
-  uint8_t* src = (uint8_t*)__src;
1008
-  while (__n--) {
1009
-    *dst = eeprom_read_byte(src);
1010
-    ++dst;
1011
-    ++src;
972
+#ifndef MARLIN_EEPROM_SIZE
973
+  #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
974
+#endif
975
+size_t PersistentStore::capacity()    { return MARLIN_EEPROM_SIZE; }
976
+bool PersistentStore::access_start()  { ee_Init();  return true; }
977
+bool PersistentStore::access_finish() { ee_Flush(); return true; }
978
+
979
+bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
980
+  while (size--) {
981
+    uint8_t * const p = (uint8_t * const)pos;
982
+    uint8_t v = *value;
983
+    // EEPROM has only ~100,000 write cycles,
984
+    // so only write bytes that have changed!
985
+    if (v != ee_Read(uint32_t(p))) {
986
+      ee_Write(uint32_t(p), v);
987
+      delay(2);
988
+      if (ee_Read(uint32_t(p)) != v) {
989
+        SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
990
+        return true;
991
+      }
992
+    }
993
+    crc16(crc, &v, 1);
994
+    pos++;
995
+    value++;
1012
   }
996
   }
997
+  return false;
1013
 }
998
 }
1014
 
999
 
1015
-void eeprom_flush() {
1016
-  ee_Flush();
1000
+bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
1001
+  do {
1002
+    uint8_t c = ee_Read(uint32_t(pos));
1003
+    if (writing) *value = c;
1004
+    crc16(crc, &c, 1);
1005
+    pos++;
1006
+    value++;
1007
+  } while (--size);
1008
+  return false;
1017
 }
1009
 }
1018
 
1010
 
1019
 #endif // FLASH_EEPROM_EMULATION
1011
 #endif // FLASH_EEPROM_EMULATION
1020
-#endif // ARDUINO_ARCH_AVR
1012
+#endif // ARDUINO_ARCH_SAM

Marlin/src/HAL/DUE/eeprom.cpp → Marlin/src/HAL/DUE/eeprom_wired.cpp Parādīt failu

17
  * GNU General Public License for more details.
17
  * GNU General Public License for more details.
18
  *
18
  *
19
  * You should have received a copy of the GNU General Public License
19
  * You should have received a copy of the GNU General Public License
20
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
21
  *
21
  *
22
  */
22
  */
23
 #ifdef ARDUINO_ARCH_SAM
23
 #ifdef ARDUINO_ARCH_SAM
24
 
24
 
25
-#include "../../inc/MarlinConfigPre.h"
26
-
27
-#if ENABLED(EEPROM_SETTINGS)
28
-
29
 #include "../../inc/MarlinConfig.h"
25
 #include "../../inc/MarlinConfig.h"
30
-#include "../shared/eeprom_api.h"
31
 
26
 
32
-#if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION)
33
-  #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
34
-#endif
27
+#if USE_WIRED_EEPROM
35
 
28
 
36
-extern void eeprom_flush();
29
+/**
30
+ * PersistentStore for Arduino-style EEPROM interface
31
+ * with simple implementations supplied by Marlin.
32
+ */
37
 
33
 
38
-bool PersistentStore::access_start() { return true; }
34
+#include "../shared/eeprom_if.h"
35
+#include "../shared/eeprom_api.h"
39
 
36
 
40
-bool PersistentStore::access_finish() {
41
-  #if ENABLED(FLASH_EEPROM_EMULATION)
42
-    eeprom_flush();
43
-  #endif
44
-  return true;
45
-}
37
+#ifndef MARLIN_EEPROM_SIZE
38
+  #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
39
+#endif
40
+size_t PersistentStore::capacity()    { return MARLIN_EEPROM_SIZE; }
41
+bool PersistentStore::access_start()  { eeprom_init(); return true; }
42
+bool PersistentStore::access_finish() { return true; }
46
 
43
 
47
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
44
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
48
   while (size--) {
45
   while (size--) {
61
     crc16(crc, &v, 1);
58
     crc16(crc, &v, 1);
62
     pos++;
59
     pos++;
63
     value++;
60
     value++;
64
-  };
61
+  }
65
   return false;
62
   return false;
66
 }
63
 }
67
 
64
 
76
   return false;
73
   return false;
77
 }
74
 }
78
 
75
 
79
-size_t PersistentStore::capacity() { return E2END + 1; }
80
-
81
-#endif // EEPROM_SETTINGS
76
+#endif // USE_WIRED_EEPROM
82
 #endif // ARDUINO_ARCH_SAM
77
 #endif // ARDUINO_ARCH_SAM

+ 18
- 40
Marlin/src/HAL/DUE/endstop_interrupts.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
47
 
47
 
48
 void setup_endstop_interrupts() {
48
 void setup_endstop_interrupts() {
49
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
49
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
50
-  #if HAS_X_MAX
51
-    _ATTACH(X_MAX_PIN);
52
-  #endif
53
-  #if HAS_X_MIN
54
-    _ATTACH(X_MIN_PIN);
55
-  #endif
56
-  #if HAS_Y_MAX
57
-    _ATTACH(Y_MAX_PIN);
58
-  #endif
59
-  #if HAS_Y_MIN
60
-    _ATTACH(Y_MIN_PIN);
61
-  #endif
62
-  #if HAS_Z_MAX
63
-    _ATTACH(Z_MAX_PIN);
64
-  #endif
65
-  #if HAS_Z_MIN
66
-     _ATTACH(Z_MIN_PIN);
67
-  #endif
68
-  #if HAS_Z2_MAX
69
-    _ATTACH(Z2_MAX_PIN);
70
-  #endif
71
-  #if HAS_Z2_MIN
72
-    _ATTACH(Z2_MIN_PIN);
73
-  #endif
74
-  #if HAS_Z3_MAX
75
-    _ATTACH(Z3_MAX_PIN);
76
-  #endif
77
-  #if HAS_Z3_MIN
78
-    _ATTACH(Z3_MIN_PIN);
79
-  #endif
80
-  #if HAS_Z4_MAX
81
-    _ATTACH(Z4_MAX_PIN);
82
-  #endif
83
-  #if HAS_Z4_MIN
84
-    _ATTACH(Z4_MIN_PIN);
85
-  #endif
86
-  #if HAS_Z_MIN_PROBE_PIN
87
-    _ATTACH(Z_MIN_PROBE_PIN);
88
-  #endif
50
+  TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
51
+  TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
52
+  TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
53
+  TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
54
+  TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
55
+  TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
56
+  TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
57
+  TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
58
+  TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
59
+  TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
60
+  TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
61
+  TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
62
+  TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
63
+  TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
64
+  TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
65
+  TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
66
+  TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
89
 }
67
 }

+ 2
- 2
Marlin/src/HAL/DUE/fastio.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
174
 #define IS_OUTPUT(IO)        ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0)
174
 #define IS_OUTPUT(IO)        ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) != 0)
175
 
175
 
176
 // Shorthand
176
 // Shorthand
177
-#define OUT_WRITE(IO,V)       { SET_OUTPUT(IO); WRITE(IO,V); }
177
+#define OUT_WRITE(IO,V)      do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
178
 
178
 
179
 // digitalRead/Write wrappers
179
 // digitalRead/Write wrappers
180
 #define extDigitalRead(IO)    digitalRead(IO)
180
 #define extDigitalRead(IO)    digitalRead(IO)

+ 1
- 1
Marlin/src/HAL/DUE/fastio/G2_PWM.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/fastio/G2_PWM.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/fastio/G2_pins.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/inc/Conditionals_LCD.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/inc/Conditionals_adv.h Parādīt failu

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

+ 3
- 3
Marlin/src/HAL/DUE/inc/Conditionals_post.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/inc/SanityCheck.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/pinsDebug.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/DUE/spi_pins.h Parādīt failu

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

+ 1
- 3
Marlin/src/HAL/DUE/timers.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 
22
 
34
 #include "../../inc/MarlinConfig.h"
34
 #include "../../inc/MarlinConfig.h"
35
 #include "HAL.h"
35
 #include "HAL.h"
36
 
36
 
37
-#include "timers.h"
38
-
39
 // ------------------------
37
 // ------------------------
40
 // Local defines
38
 // Local defines
41
 // ------------------------
39
 // ------------------------

+ 17
- 7
Marlin/src/HAL/DUE/timers.h Parādīt failu

15
  * GNU General Public License for more details.
15
  * GNU General Public License for more details.
16
  *
16
  *
17
  * You should have received a copy of the GNU General Public License
17
  * You should have received a copy of the GNU General Public License
18
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19
  *
19
  *
20
  */
20
  */
21
 #pragma once
21
 #pragma once
40
 #define HAL_TIMER_RATE         ((F_CPU) / 2)    // frequency of timers peripherals
40
 #define HAL_TIMER_RATE         ((F_CPU) / 2)    // frequency of timers peripherals
41
 
41
 
42
 #ifndef STEP_TIMER_NUM
42
 #ifndef STEP_TIMER_NUM
43
-#define STEP_TIMER_NUM 2  // index of timer to use for stepper
43
+  #define STEP_TIMER_NUM        2  // Timer Index for Stepper
44
+#endif
45
+#ifndef PULSE_TIMER_NUM
46
+  #define PULSE_TIMER_NUM       STEP_TIMER_NUM
47
+#endif
48
+#ifndef TEMP_TIMER_NUM
49
+  #define TEMP_TIMER_NUM        4  // Timer Index for Temperature
50
+#endif
51
+#ifndef TONE_TIMER_NUM
52
+  #define TONE_TIMER_NUM        6  // index of timer to use for beeper tones
44
 #endif
53
 #endif
45
-#define TEMP_TIMER_NUM 4  // index of timer to use for temperature
46
-#define PULSE_TIMER_NUM STEP_TIMER_NUM
47
-#define TONE_TIMER_NUM 6  // index of timer to use for beeper tones
48
 
54
 
49
 #define TEMP_TIMER_FREQUENCY   1000 // temperature interrupt frequency
55
 #define TEMP_TIMER_FREQUENCY   1000 // temperature interrupt frequency
50
 
56
 
66
 #ifndef HAL_STEP_TIMER_ISR
72
 #ifndef HAL_STEP_TIMER_ISR
67
   #define HAL_STEP_TIMER_ISR() void TC2_Handler()
73
   #define HAL_STEP_TIMER_ISR() void TC2_Handler()
68
 #endif
74
 #endif
69
-#define HAL_TEMP_TIMER_ISR()  void TC4_Handler()
70
-#define HAL_TONE_TIMER_ISR()  void TC6_Handler()
75
+#ifndef HAL_TEMP_TIMER_ISR
76
+  #define HAL_TEMP_TIMER_ISR() void TC4_Handler()
77
+#endif
78
+#ifndef HAL_TONE_TIMER_ISR
79
+  #define HAL_TONE_TIMER_ISR() void TC6_Handler()
80
+#endif
71
 
81
 
72
 // ------------------------
82
 // ------------------------
73
 // Types
83
 // Types

+ 18
- 0
Marlin/src/HAL/DUE/upload_extra_script.py Parādīt failu

1
+#
2
+# Set upload_command
3
+#
4
+#  Windows: bossac.exe
5
+#  Other: leave unchanged
6
+#
7
+
8
+import platform
9
+current_OS = platform.system()
10
+
11
+if current_OS == 'Windows':
12
+
13
+	Import("env")
14
+
15
+	# Use bossac.exe on Windows
16
+	env.Replace(
17
+	    UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot"
18
+	)

+ 0
- 4
Marlin/src/HAL/DUE/usb/conf_usb.h Parādīt failu

78
 //! To define a Full speed device
78
 //! To define a Full speed device
79
 //#define USB_DEVICE_FULL_SPEED
79
 //#define USB_DEVICE_FULL_SPEED
80
 
80
 
81
-#if MB(ARCHIM1)
82
-  #define USB_DEVICE_FULL_SPEED
83
-#endif
84
-
85
 //! To authorize the High speed
81
 //! To authorize the High speed
86
 #ifndef USB_DEVICE_FULL_SPEED
82
 #ifndef USB_DEVICE_FULL_SPEED
87
   #if (UC3A3||UC3A4)
83
   #if (UC3A3||UC3A4)

+ 1
- 2
Marlin/src/HAL/DUE/watchdog.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
-
23
 #ifdef ARDUINO_ARCH_SAM
22
 #ifdef ARDUINO_ARCH_SAM
24
 
23
 
25
 #include "../../inc/MarlinConfig.h"
24
 #include "../../inc/MarlinConfig.h"

+ 1
- 1
Marlin/src/HAL/DUE/watchdog.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/ESP32/FlushableHardwareSerial.cpp Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/ESP32/FlushableHardwareSerial.h Parādīt failu

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

+ 16
- 45
Marlin/src/HAL/ESP32/HAL.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
-
23
 #ifdef ARDUINO_ARCH_ESP32
22
 #ifdef ARDUINO_ARCH_ESP32
24
 
23
 
25
-#include "HAL.h"
26
-#include "timers.h"
24
+#include "../../inc/MarlinConfig.h"
25
+
27
 #include <rom/rtc.h>
26
 #include <rom/rtc.h>
28
 #include <driver/adc.h>
27
 #include <driver/adc.h>
29
 #include <esp_adc_cal.h>
28
 #include <esp_adc_cal.h>
30
 #include <HardwareSerial.h>
29
 #include <HardwareSerial.h>
31
 
30
 
32
-#include "../../inc/MarlinConfigPre.h"
33
-
34
 #if ENABLED(WIFISUPPORT)
31
 #if ENABLED(WIFISUPPORT)
35
   #include <ESPAsyncWebServer.h>
32
   #include <ESPAsyncWebServer.h>
36
   #include "wifi.h"
33
   #include "wifi.h"
97
     esp3dlib.init();
94
     esp3dlib.init();
98
   #elif ENABLED(WIFISUPPORT)
95
   #elif ENABLED(WIFISUPPORT)
99
     wifi_init();
96
     wifi_init();
100
-    #if ENABLED(OTASUPPORT)
101
-      OTA_init();
102
-    #endif
97
+    TERN_(OTASUPPORT, OTA_init());
103
     #if ENABLED(WEBSUPPORT)
98
     #if ENABLED(WEBSUPPORT)
104
       spiffs_init();
99
       spiffs_init();
105
       web_init();
100
       web_init();
133
   #if BOTH(WIFISUPPORT, OTASUPPORT)
128
   #if BOTH(WIFISUPPORT, OTASUPPORT)
134
     OTA_handle();
129
     OTA_handle();
135
   #endif
130
   #endif
136
-  #if ENABLED(ESP3D_WIFISUPPORT)
137
-    esp3dlib.idletask();
138
-  #endif
131
+  TERN_(ESP3D_WIFISUPPORT, esp3dlib.idletask());
139
 }
132
 }
140
 
133
 
141
 void HAL_clear_reset_source() { }
134
 void HAL_clear_reset_source() { }
176
   adc1_config_width(ADC_WIDTH_12Bit);
169
   adc1_config_width(ADC_WIDTH_12Bit);
177
 
170
 
178
   // Configure channels only if used as (re-)configuring a pin for ADC that is used elsewhere might have adverse effects
171
   // Configure channels only if used as (re-)configuring a pin for ADC that is used elsewhere might have adverse effects
179
-  #if HAS_TEMP_ADC_0
180
-    adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db);
181
-  #endif
182
-  #if HAS_TEMP_ADC_1
183
-    adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db);
184
-  #endif
185
-  #if HAS_TEMP_ADC_2
186
-    adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db);
187
-  #endif
188
-  #if HAS_TEMP_ADC_3
189
-    adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db);
190
-  #endif
191
-  #if HAS_TEMP_ADC_4
192
-    adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db);
193
-  #endif
194
-  #if HAS_TEMP_ADC_5
195
-    adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db);
196
-  #endif
197
-  #if HAS_TEMP_ADC_6
198
-    adc2_set_attenuation(get_channel(TEMP_6_PIN), ADC_ATTEN_11db);
199
-  #endif
200
-  #if HAS_TEMP_ADC_7
201
-    adc3_set_attenuation(get_channel(TEMP_7_PIN), ADC_ATTEN_11db);
202
-  #endif
203
-  #if HAS_HEATED_BED
204
-    adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db);
205
-  #endif
206
-  #if HAS_TEMP_CHAMBER
207
-    adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db);
208
-  #endif
209
-  #if ENABLED(FILAMENT_WIDTH_SENSOR)
210
-    adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db);
211
-  #endif
172
+  TERN_(HAS_TEMP_ADC_0, adc1_set_attenuation(get_channel(TEMP_0_PIN), ADC_ATTEN_11db));
173
+  TERN_(HAS_TEMP_ADC_1, adc1_set_attenuation(get_channel(TEMP_1_PIN), ADC_ATTEN_11db));
174
+  TERN_(HAS_TEMP_ADC_2, adc1_set_attenuation(get_channel(TEMP_2_PIN), ADC_ATTEN_11db));
175
+  TERN_(HAS_TEMP_ADC_3, adc1_set_attenuation(get_channel(TEMP_3_PIN), ADC_ATTEN_11db));
176
+  TERN_(HAS_TEMP_ADC_4, adc1_set_attenuation(get_channel(TEMP_4_PIN), ADC_ATTEN_11db));
177
+  TERN_(HAS_TEMP_ADC_5, adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db));
178
+  TERN_(HAS_TEMP_ADC_6, adc2_set_attenuation(get_channel(TEMP_6_PIN), ADC_ATTEN_11db));
179
+  TERN_(HAS_TEMP_ADC_7, adc3_set_attenuation(get_channel(TEMP_7_PIN), ADC_ATTEN_11db));
180
+  TERN_(HAS_HEATED_BED, adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db));
181
+  TERN_(HAS_TEMP_CHAMBER, adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db));
182
+  TERN_(FILAMENT_WIDTH_SENSOR, adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db));
212
 
183
 
213
   // Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail.
184
   // Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail.
214
   // That's why we're not setting it up here.
185
   // That's why we're not setting it up here.

+ 3
- 10
Marlin/src/HAL/ESP32/HAL.h Parādīt failu

14
  * GNU General Public License for more details.
14
  * GNU General Public License for more details.
15
  *
15
  *
16
  * You should have received a copy of the GNU General Public License
16
  * You should have received a copy of the GNU General Public License
17
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
  */
18
  */
19
 #pragma once
19
 #pragma once
20
 
20
 
34
 #include "watchdog.h"
34
 #include "watchdog.h"
35
 #include "i2s.h"
35
 #include "i2s.h"
36
 
36
 
37
-#include "timers.h"
38
-
39
 #if ENABLED(WIFISUPPORT)
37
 #if ENABLED(WIFISUPPORT)
40
   #include "WebSocketSerial.h"
38
   #include "WebSocketSerial.h"
41
 #endif
39
 #endif
109
 
107
 
110
 void analogWrite(pin_t pin, int value);
108
 void analogWrite(pin_t pin, int value);
111
 
109
 
112
-// EEPROM
113
-void eeprom_write_byte(uint8_t *pos, unsigned char value);
114
-uint8_t eeprom_read_byte(uint8_t *pos);
115
-void eeprom_read_block (void *__dst, const void *__src, size_t __n);
116
-void eeprom_update_block (const void *__src, void *__dst, size_t __n);
117
-
118
 // ADC
110
 // ADC
119
 #define HAL_ANALOG_SELECT(pin)
111
 #define HAL_ANALOG_SELECT(pin)
120
 
112
 
121
 void HAL_adc_init();
113
 void HAL_adc_init();
122
 
114
 
123
-#define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
115
+#define HAL_ADC_VREF         3.3
124
 #define HAL_ADC_RESOLUTION  10
116
 #define HAL_ADC_RESOLUTION  10
117
+#define HAL_START_ADC(pin)  HAL_adc_start_conversion(pin)
125
 #define HAL_READ_ADC()      HAL_adc_result
118
 #define HAL_READ_ADC()      HAL_adc_result
126
 #define HAL_ADC_READY()     true
119
 #define HAL_ADC_READY()     true
127
 
120
 

+ 4
- 6
Marlin/src/HAL/ESP32/HAL_SPI.cpp Parādīt failu

17
  * GNU General Public License for more details.
17
  * GNU General Public License for more details.
18
  *
18
  *
19
  * You should have received a copy of the GNU General Public License
19
  * You should have received a copy of the GNU General Public License
20
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
21
  *
21
  *
22
  */
22
  */
23
-
24
 #ifdef ARDUINO_ARCH_ESP32
23
 #ifdef ARDUINO_ARCH_ESP32
25
 
24
 
26
-#include "HAL.h"
25
+#include "../../inc/MarlinConfig.h"
26
+
27
 #include "../shared/HAL_SPI.h"
27
 #include "../shared/HAL_SPI.h"
28
+
28
 #include <pins_arduino.h>
29
 #include <pins_arduino.h>
29
-#include "spi_pins.h"
30
 #include <SPI.h>
30
 #include <SPI.h>
31
 
31
 
32
-#include "../../core/macros.h"
33
-
34
 // ------------------------
32
 // ------------------------
35
 // Public Variables
33
 // Public Variables
36
 // ------------------------
34
 // ------------------------

+ 2
- 4
Marlin/src/HAL/ESP32/Servo.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #ifdef ARDUINO_ARCH_ESP32
22
 #ifdef ARDUINO_ARCH_ESP32
61
   if (attach(0) >= 0) {
61
   if (attach(0) >= 0) {
62
     write(value);
62
     write(value);
63
     safe_delay(servo_delay[channel]);
63
     safe_delay(servo_delay[channel]);
64
-    #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
65
-      detach();
66
-    #endif
64
+    TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
67
   }
65
   }
68
 }
66
 }
69
 #endif // HAS_SERVOS
67
 #endif // HAS_SERVOS

+ 1
- 1
Marlin/src/HAL/ESP32/Servo.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/ESP32/WebSocketSerial.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #ifdef ARDUINO_ARCH_ESP32
22
 #ifdef ARDUINO_ARCH_ESP32

+ 1
- 1
Marlin/src/HAL/ESP32/WebSocketSerial.h Parādīt failu

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

Marlin/src/HAL/ESP32/eeprom_impl.cpp → Marlin/src/HAL/ESP32/eeprom.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
-
23
 #ifdef ARDUINO_ARCH_ESP32
22
 #ifdef ARDUINO_ARCH_ESP32
24
 
23
 
25
 #include "../../inc/MarlinConfig.h"
24
 #include "../../inc/MarlinConfig.h"
26
 
25
 
27
-#if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
26
+#if ENABLED(EEPROM_SETTINGS)
28
 
27
 
29
 #include "../shared/eeprom_api.h"
28
 #include "../shared/eeprom_api.h"
30
-#include "EEPROM.h"
29
+#include <EEPROM.h>
31
 
30
 
32
-#define EEPROM_SIZE 4096
31
+#ifndef MARLIN_EEPROM_SIZE
32
+  #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
33
+#endif
34
+size_t PersistentStore::capacity()    { return MARLIN_EEPROM_SIZE; }
33
 
35
 
34
-bool PersistentStore::access_start() {
35
-  return EEPROM.begin(EEPROM_SIZE);
36
-}
37
-
38
-bool PersistentStore::access_finish() {
39
-  EEPROM.end();
40
-  return true;
41
-}
36
+bool PersistentStore::access_start()  { return EEPROM.begin(MARLIN_EEPROM_SIZE); }
37
+bool PersistentStore::access_finish() { EEPROM.end(); return true; }
42
 
38
 
43
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
39
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
44
   for (size_t i = 0; i < size; i++) {
40
   for (size_t i = 0; i < size; i++) {
57
   return false;
53
   return false;
58
 }
54
 }
59
 
55
 
60
-size_t PersistentStore::capacity() { return EEPROM_SIZE; }
61
-
62
 #endif // EEPROM_SETTINGS
56
 #endif // EEPROM_SETTINGS
63
 #endif // ARDUINO_ARCH_ESP32
57
 #endif // ARDUINO_ARCH_ESP32

+ 18
- 40
Marlin/src/HAL/ESP32/endstop_interrupts.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
42
 
42
 
43
 void setup_endstop_interrupts() {
43
 void setup_endstop_interrupts() {
44
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
44
   #define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
45
-  #if HAS_X_MAX
46
-    _ATTACH(X_MAX_PIN);
47
-  #endif
48
-  #if HAS_X_MIN
49
-    _ATTACH(X_MIN_PIN);
50
-  #endif
51
-  #if HAS_Y_MAX
52
-    _ATTACH(Y_MAX_PIN);
53
-  #endif
54
-  #if HAS_Y_MIN
55
-    _ATTACH(Y_MIN_PIN);
56
-  #endif
57
-  #if HAS_Z_MAX
58
-    _ATTACH(Z_MAX_PIN);
59
-  #endif
60
-  #if HAS_Z_MIN
61
-     _ATTACH(Z_MIN_PIN);
62
-  #endif
63
-  #if HAS_Z2_MAX
64
-    _ATTACH(Z2_MAX_PIN);
65
-  #endif
66
-  #if HAS_Z2_MIN
67
-    _ATTACH(Z2_MIN_PIN);
68
-  #endif
69
-  #if HAS_Z3_MAX
70
-    _ATTACH(Z3_MAX_PIN);
71
-  #endif
72
-  #if HAS_Z3_MIN
73
-    _ATTACH(Z3_MIN_PIN);
74
-  #endif
75
-  #if HAS_Z4_MAX
76
-    _ATTACH(Z4_MAX_PIN);
77
-  #endif
78
-  #if HAS_Z4_MIN
79
-    _ATTACH(Z4_MIN_PIN);
80
-  #endif
81
-  #if HAS_Z_MIN_PROBE_PIN
82
-    _ATTACH(Z_MIN_PROBE_PIN);
83
-  #endif
45
+  TERN_(HAS_X_MAX, _ATTACH(X_MAX_PIN));
46
+  TERN_(HAS_X_MIN, _ATTACH(X_MIN_PIN));
47
+  TERN_(HAS_Y_MAX, _ATTACH(Y_MAX_PIN));
48
+  TERN_(HAS_Y_MIN, _ATTACH(Y_MIN_PIN));
49
+  TERN_(HAS_Z_MAX, _ATTACH(Z_MAX_PIN));
50
+  TERN_(HAS_Z_MIN, _ATTACH(Z_MIN_PIN));
51
+  TERN_(HAS_X2_MAX, _ATTACH(X2_MAX_PIN));
52
+  TERN_(HAS_X2_MIN, _ATTACH(X2_MIN_PIN));
53
+  TERN_(HAS_Y2_MAX, _ATTACH(Y2_MAX_PIN));
54
+  TERN_(HAS_Y2_MIN, _ATTACH(Y2_MIN_PIN));
55
+  TERN_(HAS_Z2_MAX, _ATTACH(Z2_MAX_PIN));
56
+  TERN_(HAS_Z2_MIN, _ATTACH(Z2_MIN_PIN));
57
+  TERN_(HAS_Z3_MAX, _ATTACH(Z3_MAX_PIN));
58
+  TERN_(HAS_Z3_MIN, _ATTACH(Z3_MIN_PIN));
59
+  TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
60
+  TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
61
+  TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
84
 }
62
 }

+ 1
- 1
Marlin/src/HAL/ESP32/fastio.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/ESP32/i2s.cpp Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #ifdef ARDUINO_ARCH_ESP32
22
 #ifdef ARDUINO_ARCH_ESP32

+ 1
- 1
Marlin/src/HAL/ESP32/i2s.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/ESP32/inc/Conditionals_LCD.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/ESP32/inc/Conditionals_adv.h Parādīt failu

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

+ 1
- 6
Marlin/src/HAL/ESP32/inc/Conditionals_post.h Parādīt failu

16
  * GNU General Public License for more details.
16
  * GNU General Public License for more details.
17
  *
17
  *
18
  * You should have received a copy of the GNU General Public License
18
  * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
  *
20
  *
21
  */
21
  */
22
 #pragma once
22
 #pragma once
23
-
24
-// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
25
-#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
26
-  #define SDCARD_EEPROM_EMULATION
27
-#endif

+ 1
- 1
Marlin/src/HAL/ESP32/inc/SanityCheck.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/ESP32/ota.cpp Parādīt failu

14
  * GNU General Public License for more details.
14
  * GNU General Public License for more details.
15
  *
15
  *
16
  * You should have received a copy of the GNU General Public License
16
  * You should have received a copy of the GNU General Public License
17
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
  */
18
  */
19
 
19
 
20
 #ifdef ARDUINO_ARCH_ESP32
20
 #ifdef ARDUINO_ARCH_ESP32

+ 1
- 1
Marlin/src/HAL/ESP32/ota.h Parādīt failu

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

+ 1
- 1
Marlin/src/HAL/ESP32/servotimers.h Parādīt failu

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

+ 0
- 0
Marlin/src/HAL/ESP32/spi_pins.h Parādīt failu


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels

Notiek ielāde…
Atcelt
Saglabāt