Compare commits
539 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 515a06d4b8 | |||
| 812da8d902 | |||
| 311bfc99f3 | |||
| a3434de2e6 | |||
| 2bf56b00d4 | |||
| c31d9e717b | |||
| d9d7820b0d | |||
| 9343247e07 | |||
| 351a1a1332 | |||
| 7e9868d762 | |||
| d1cf817660 | |||
| c91771a51e | |||
| a337a43bfd | |||
| 77f93e0b8c | |||
| 7dc7195696 | |||
| 56773bd80e | |||
| 1dec9831d3 | |||
| 390f1f7c69 | |||
| d30fcb8fff | |||
| 17dfe8edc9 | |||
| 7b6b6e1c3e | |||
| 60f2837a98 | |||
| ef5fb390ec | |||
| 87e94f4563 | |||
| 017a9032f1 | |||
| 466282f322 | |||
| 17594298e1 | |||
| 0b9f487ab9 | |||
| d3e1a92b84 | |||
| cd357b0278 | |||
| d0d229e380 | |||
| eb897e65a1 | |||
| 825ebfd5fe | |||
| 3ee3964bec | |||
| aecfb257e9 | |||
| 896a6a93af | |||
| 075f96d2bf | |||
| 05896551f1 | |||
| ea6a891038 | |||
| 983aee5718 | |||
| c913020dc2 | |||
| a50490b11f | |||
| 4b01c901bc | |||
| c1be36bc66 | |||
| e0222d3e01 | |||
| c0264ae787 | |||
| 3a2c50c199 | |||
| 3b4adac579 | |||
| d36b3fbf9d | |||
| bca40e07e3 | |||
| 9a1c993719 | |||
| 504219817c | |||
| 4f2b7271bd | |||
| ec6f9dd5c8 | |||
| e6cda9932b | |||
| b9cfbaa8d4 | |||
| 3fd175af8e | |||
| a9e72b2a2c | |||
| ecde3a3158 | |||
| c8d51c2723 | |||
| d609bb4671 | |||
| 982b425792 | |||
| 9e879a5b1f | |||
| 9974327d33 | |||
| 4eba643ae1 | |||
| 8d7be79108 | |||
| 76b5688304 | |||
| 1e8fbb7bbb | |||
| 20c6a6233b | |||
| 1d295f7983 | |||
| 669814d0d4 | |||
| 4aa48beb37 | |||
| 371fb5a256 | |||
| 0829a511f0 | |||
| a3c78c4510 | |||
| a3211253a0 | |||
| 2c8e7bd5a5 | |||
| 005d6879d9 | |||
| 3dd22349a9 | |||
| e61a84a717 | |||
| d8e73d3036 | |||
| b12340b1d5 | |||
| ec46a59539 | |||
| 5003681414 | |||
| d9396929aa | |||
| 1dee4d92c6 | |||
| 9364cbb4b5 | |||
| 755b661c2d | |||
| 7f4792e47c | |||
| e6837b2b8d | |||
| 9e21330d7a | |||
| c476e62a6f | |||
| 4c5d7831c1 | |||
| 9a5cfb3f26 | |||
| 5a87bea762 | |||
| d62f45bdc1 | |||
| f9d5ee04b4 | |||
| ef04680cc5 | |||
| 1c6cfc3ffe | |||
| 0266e7fe53 | |||
| 610ea0a9d3 | |||
| 70d942a184 | |||
| 5639237e2b | |||
| 541bd26cd7 | |||
| 7a4d601f4d | |||
| bf8675b44a | |||
| ebea672240 | |||
| ce8535f01c | |||
| 0ba4cd2b3b | |||
| afc2dd6cab | |||
| 5768b42c39 | |||
| ee8630c282 | |||
| 01094ea6aa | |||
| 6c1fd1f69c | |||
| 4f65466161 | |||
| 9b3119393f | |||
| 8594e9462c | |||
| 16acb57b22 | |||
| 04c8a3138e | |||
| 38560378fc | |||
| ffbf4a6a90 | |||
| a215bc2ca3 | |||
| cbc674ff99 | |||
| 97546bf55b | |||
| ed1391ee5d | |||
| 7fbd9ec5f4 | |||
| 63989023b8 | |||
| e668d5afd7 | |||
| a2228276bb | |||
| 3ef192e7c7 | |||
| 5fea79fd07 | |||
| 18e65f5eb4 | |||
| 5ed6bf65ba | |||
| d79bcef802 | |||
| f1a53407e7 | |||
| 4309e6ab76 | |||
| 0c3d1cf566 | |||
| aa7d571486 | |||
| 604d3e8fad | |||
| 22fc07d72b | |||
| dd3b5a10a0 | |||
| 416f94f03a | |||
| 204de723f1 | |||
| 80cd89d8f7 | |||
| 624226c91d | |||
| 3adf73a2cd | |||
| eb7b207e4c | |||
| d7e45367af | |||
| 388c7018c4 | |||
| da96607b65 | |||
| fb49645b32 | |||
| 7d751a20b1 | |||
| 9f7d5bbc86 | |||
| 0df25b1008 | |||
| cef623b7d2 | |||
| 12434e78e4 | |||
| 2200607989 | |||
| c31381183b | |||
| 76dce41580 | |||
| 1f1ca34ea6 | |||
| 8d4ab15748 | |||
| 745577693d | |||
| 3019af1c93 | |||
| 8916e6f826 | |||
| b2fd631d82 | |||
| cadef64418 | |||
| ab3497161a | |||
| 46f370ae3c | |||
| 0f43ac79f6 | |||
| ef92b6c369 | |||
| f44f9eb9f8 | |||
| 854f3315af | |||
| 1d46e67de2 | |||
| 85ded0b9bd | |||
| cb291e8d00 | |||
| 25caae1e8c | |||
| 12d7995a18 | |||
| 320b7a9ac3 | |||
| a533e9e637 | |||
| f6ecdae972 | |||
| 477b70eccf | |||
| b2dd2dc217 | |||
| b106f59eb4 | |||
| 38f483c4a6 | |||
| f4eafed188 | |||
| 5987a5464b | |||
| 3a888e956b | |||
| 4cddc61eda | |||
| 2a8c00bdeb | |||
| 4ae2a76492 | |||
| a5d097abe6 | |||
| 5e0a8d2124 | |||
| 994aa9f692 | |||
| 6e67ad51b7 | |||
| 52693f72af | |||
| 991f433ac1 | |||
| 54b7da18cb | |||
| f8771e9ad5 | |||
| be1dee7caf | |||
| 68b7802fc1 | |||
| 6d407767e7 | |||
| 4a9e102c2e | |||
| 1ac6428c82 | |||
| 7c159a20e5 | |||
| 5b74e25108 | |||
| f02fa6339f | |||
| 3b6f1bff8b | |||
| 1d615717e8 | |||
| 99c570212d | |||
| 13e82fa44a | |||
| 95878df30d | |||
| 5d1ede08aa | |||
| 2203505182 | |||
| 06dc7f4f52 | |||
| e6f1b074df | |||
| f605c045e3 | |||
| 2d97f082e5 | |||
| ba91fa09b7 | |||
| 1aeee2cd1f | |||
| 4e23e52a89 | |||
| 88cf3cb1e0 | |||
| 59d26e463a | |||
| cc641d796d | |||
| 9d324f7b1f | |||
| 654e7a84ff | |||
| d903a5ef43 | |||
| 15f26b4021 | |||
| 10d80eb894 | |||
| 858954baad | |||
| 3840663410 | |||
| bd36644d85 | |||
| c485f513d7 | |||
| 06b9e40042 | |||
| 7603023928 | |||
| dbf81f40de | |||
| bb557e5195 | |||
| 89fdfcfaf9 | |||
| d9a388bab8 | |||
| b44e68e2ab | |||
| 0f09554929 | |||
| 18b0dbb501 | |||
| fa8d2bd108 | |||
| d1ebaba71d | |||
| 71e0275a4c | |||
| 205b0a679e | |||
| 3029a6b1aa | |||
| 342048b1df | |||
| ec060f979f | |||
| 56ac5d03ed | |||
| ec7ab5a277 | |||
| 2c5468ce33 | |||
| dbdb2ecdf7 | |||
| c18294d83c | |||
| 401ba6613b | |||
| 19617b79db | |||
| eeacf76cfd | |||
| 738584d342 | |||
| f69effd2eb | |||
| 67d7562609 | |||
| 0ede16cd5a | |||
| 4a89ef6273 | |||
| 145ab7b1ec | |||
| 3f9c2f89fc | |||
| 00298e6681 | |||
| 68ab7f6bb7 | |||
| 7ab63cde62 | |||
| b90133813a | |||
| 75da3555ee | |||
| 8bce9dec90 | |||
| fef74398e4 | |||
| 775c6bb20e | |||
| 06710e54de | |||
| 81cfa23882 | |||
| f3fd9e28f5 | |||
| b94a335493 | |||
| 01aa87c307 | |||
| 473817f2f4 | |||
| a1c3a2b03a | |||
| bdfe4a108c | |||
| 10fe229aad | |||
| dfec58e5dc | |||
| 6c04cf40f4 | |||
| fe7203ee55 | |||
| 483b8dcc05 | |||
| a41e16ffee | |||
| 425af4240b | |||
| 4a4c1db606 | |||
| 2b1375c8ea | |||
| 065440891b | |||
| d58168a03f | |||
| 8cf936ccb1 | |||
| d5d45e85e4 | |||
| 0d4f41fb6d | |||
| 1c1c473910 | |||
| dde878db04 | |||
| 1a42c38e0e | |||
| e695c473af | |||
| bd6eb83250 | |||
| c484228c56 | |||
| f265fb5943 | |||
| b17d3d3e9c | |||
| c53844ff91 | |||
| e393c7fa0e | |||
| b55678a7d0 | |||
| fe8266b591 | |||
| 3d8e3c3c9a | |||
| 61349dc6d3 | |||
| 95821b07b1 | |||
| d62ee95d28 | |||
| b962014087 | |||
| 921198e81c | |||
| 3457952854 | |||
| f4228cc4c1 | |||
| dabcd65903 | |||
| 8fa4f5a40f | |||
| b95aa36b01 | |||
| 7a96a082b7 | |||
| b78f0012e9 | |||
| e958b6da9e | |||
| 86338ca835 | |||
| 8a110b80bf | |||
| 9a12f06f19 | |||
| 7d334775d0 | |||
| 0a86a5f39c | |||
| e7cf0e12ea | |||
| e41df97c42 | |||
| 20a26d5053 | |||
| 924d7769ec | |||
| 8ff937c7d8 | |||
| ae695e8309 | |||
| e98e307d17 | |||
| bd872a7a98 | |||
| fd3de02a37 | |||
| 1bee537a09 | |||
| ded942a4e4 | |||
| bf61e52390 | |||
| 2d9262cc5a | |||
| 993cc9463e | |||
| c2376d62e2 | |||
| f3473495d0 | |||
| c5b267162c | |||
| 8322848c35 | |||
| 61cb98dc0f | |||
| 2b1666fcb0 | |||
| 6ae2cde663 | |||
| cc8f7c83da | |||
| 20445b8e83 | |||
| 12881d5576 | |||
| b88cb86069 | |||
| 3d3be15665 | |||
| 0142783836 | |||
| 006768ab58 | |||
| 376673df28 | |||
| f830756356 | |||
| 1fceb7c580 | |||
| 5287cfbb59 | |||
| f345f60f73 | |||
| e2c8015199 | |||
| aed577271f | |||
| f50ca52c57 | |||
| 36e66bdd9f | |||
| 19869d3a7d | |||
| c8118c3a58 | |||
| 7fe07dc4ce | |||
| 3e8a5b6151 | |||
| 28bc19720a | |||
| a8cb89b3da | |||
| df2251e23e | |||
| 31154278b3 | |||
| 613b4105a2 | |||
| 10e06e1970 | |||
| c751dcfcf9 | |||
| 178938d957 | |||
| a8313c3b7e | |||
| dc26531207 | |||
| c74e6ad868 | |||
| a62eec4ae3 | |||
| 235ad4dd9d | |||
| d06923d0e7 | |||
| 7f59b65fc8 | |||
| 884a3249fe | |||
| d159ec5c90 | |||
| 7c43f4e696 | |||
| 7c8ea8e0e0 | |||
| 573eae8d95 | |||
| bf0acc9611 | |||
| ddc310fc4b | |||
| 10782c770d | |||
| b2758208c7 | |||
| bf5612c0ed | |||
| 9a6c2635ee | |||
| 3341683db2 | |||
| 0bdbf52bc6 | |||
| e4e85e39b3 | |||
| 0621594442 | |||
| dba613fadd | |||
| 5ac4ebad78 | |||
| cb044d989c | |||
| 0d42196d11 | |||
| cac742009c | |||
| 76f938309e | |||
| 24cf29b6a8 | |||
| 41a6f2bc8d | |||
| e0767f8675 | |||
| 5523c12cfd | |||
| a6c8afc5a9 | |||
| cb8df74a9c | |||
| 050439ccba | |||
| 6907df0bd6 | |||
| 5a259a7266 | |||
| b082f1a2b8 | |||
| c666b492c4 | |||
| aa0671fb32 | |||
| f82d0109e4 | |||
| 2a88e76002 | |||
| b25f523aca | |||
| 046439a5a1 | |||
| bcd07c2c91 | |||
| e9b04ada1d | |||
| ff5eb5de29 | |||
| fd62c42faa | |||
| 089d075c8f | |||
| 45a6e9614e | |||
| 9e6d0ea610 | |||
| c345087b41 | |||
| 8de007021a | |||
| f72588595b | |||
| 797ea5efa7 | |||
| 156e7c1c54 | |||
| b8b1aa345c | |||
| b0ece8f8df | |||
| 4b0b00c8da | |||
| 6d3122d4e8 | |||
| 0f27e38eb9 | |||
| 6156050024 | |||
| cacbe005b5 | |||
| caca5636ce | |||
| 6a35ab6557 | |||
| 87de4c134b | |||
| 7944628400 | |||
| 251a84b741 | |||
| d695e5f7bc | |||
| 4744997c16 | |||
| 5bd39ba73f | |||
| 7f887f2342 | |||
| e7e77d9612 | |||
| a7a3abb9bf | |||
| 6f68da5be4 | |||
| e9b9d634c4 | |||
| 6d301a282e | |||
| 61591fd233 | |||
| e97d82f77b | |||
| b58d5dabf8 | |||
| 047bce0cdd | |||
| c81e217334 | |||
| 9cd341c2c3 | |||
| f0ad1e9b70 | |||
| 414b1f8327 | |||
| e68320ee2b | |||
| 7fa643a11e | |||
| 375e724dee | |||
| 6c0f4bbafd | |||
| 4cab75115f | |||
| 014609ad87 | |||
| f7a3172c20 | |||
| b799f7d1f3 | |||
| f3851408fe | |||
| 03cf2b577b | |||
| b3b6f23320 | |||
| 821ba43131 | |||
| 31bf73b89b | |||
| 229ea71421 | |||
| f085e2ca93 | |||
| db98f06110 | |||
| bbb5aacc48 | |||
| 91ab18d1d2 | |||
| 273cbc6871 | |||
| 596d1ff104 | |||
| 896492442c | |||
| b9e58cd3ea | |||
| d961dbae8d | |||
| be031e1850 | |||
| 15dfbabc9c | |||
| 102de7dac3 | |||
| 7338a2fec8 | |||
| d56136f06c | |||
| 34a0c9d143 | |||
| 11f98adcce | |||
| 209fadd2e6 | |||
| 8fa6a4da2e | |||
| 4613f85bb7 | |||
| e1121a4cd0 | |||
| 20fec98f70 | |||
| adfc787a45 | |||
| 86be9a85d0 | |||
| f6de698fc8 | |||
| edc7379546 | |||
| ab8af7fa9c | |||
| fb74caebb5 | |||
| 88cdf487b4 | |||
| be91eaed2c | |||
| b5a08c2518 | |||
| b02ea02dbb | |||
| d69ce77503 | |||
| d1803ec044 | |||
| f2665e597f | |||
| db5ead4230 | |||
| f7d5188b2f | |||
| 1d17c34e12 | |||
| 49ead19d00 | |||
| 7e7dcb8692 | |||
| cf50240e82 | |||
| 79f6d9bdac | |||
| 6af6060aa0 | |||
| 2bac7835e8 | |||
| fd41757aef | |||
| f338f65bdf | |||
| 867f5e9069 | |||
| 88f5e2c639 | |||
| ca0209b868 | |||
| 4f691e622f | |||
| fecadaca82 | |||
| 709def5e7b | |||
| a5e4b4bd7d | |||
| a817794444 | |||
| ffef8f1b29 | |||
| 205a679959 | |||
| b956001d81 | |||
| 1dd3c9e73f | |||
| 8d74a63e4b | |||
| 27fd97a8bb | |||
| 4d89db5209 | |||
| f66323ecfb | |||
| 863198a73f | |||
| ad112b4d3d | |||
| c088081c00 | |||
| 06d46a0ef9 | |||
| 27e68a61fa | |||
| 4e31fa66e2 |
+8
-2
@@ -1,12 +1,14 @@
|
||||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[{*.patch,syntax_test_*}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[{*.c,*.cpp,*.h,*.ino,*.py,Makefile}]
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
|
||||
[{*.c,*.cpp,*.h,*.ino}]
|
||||
@@ -18,6 +20,10 @@ indent_size = 2
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
# Two spaces at the end of the line means newline in Markdown
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[{*.py}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
name: 🪲 Report a bug
|
||||
description: Create a bug report to help improve Marlin Firmware
|
||||
title: "[BUG] (bug summary)"
|
||||
labels: ["Bug: Potential ?"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
@@ -109,8 +110,13 @@ body:
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Add-ons
|
||||
description: Please list any hardware add-ons that could be involved.
|
||||
label: LCD/Controller
|
||||
description: Some Marlin behaviors are determined by the controller. Describe your LCD/Controller model and version.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Other add-ons
|
||||
description: Please list any other hardware add-ons that could be involved.
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: ✨ Request a feature
|
||||
description: Request a new Marlin Firmware feature
|
||||
title: "[FR] (feature summary)"
|
||||
labels: 'T: Feature Request'
|
||||
labels: ["T: Feature Request"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
||||
@@ -28,15 +28,9 @@ Project maintainers are responsible for clarifying the standards of acceptable b
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [marlinfirmware@github.com](mailto:marlinfirmware@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by following GitHub's [reporting abuse or spam article](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
|
||||
|
||||
## Attribution
|
||||
|
||||
|
||||
@@ -26,11 +26,12 @@ The following is a set of guidelines for contributing to Marlin, hosted by the [
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project and everyone participating in it is governed by the [Marlin Code of Conduct](code_of_conduct.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [marlinfirmware@github.com](mailto:marlinfirmware@github.com).
|
||||
This project and everyone participating in it is governed by the [Marlin Code of Conduct](code_of_conduct.md). By participating, you are expected to uphold this code. Please report unacceptable behavior by following GitHub's [reporting abuse or spam article](https://docs.github.com/en/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam).
|
||||
|
||||
## I don't want to read this whole thing I just have a question!!!
|
||||
|
||||
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
|
||||
> [!NOTE]
|
||||
> Please don't file an issue to ask a question. You'll get faster results by using the resources below.
|
||||
|
||||
We have a Message Board and a Facebook group where our knowledgable user community can provide helpful advice if you have questions.
|
||||
|
||||
@@ -55,7 +56,8 @@ This section guides you through submitting a Bug Report for Marlin. Following th
|
||||
|
||||
Before creating a Bug Report, please test the "nightly" development branch, as you might find out that you don't need to create one. When you are creating a Bug Report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](ISSUE_TEMPLATE/bug_report.yml), the information it asks for helps us resolve issues faster.
|
||||
|
||||
> **Note:** Regressions can happen. If you find a **Closed** issue that seems like your issue, go ahead and open a new issue and include a link to the original issue in the body of your new one. All you need to create a link is the issue number, preceded by #. For example, #8888.
|
||||
> [!NOTE]
|
||||
> Regressions can happen. If you find a **Closed** issue that seems like your issue, go ahead and open a new issue and include a link to the original issue in the body of your new one. All you need to create a link is the issue number, preceded by #. For example, #8888.
|
||||
|
||||
#### How Do I Submit A (Good) Bug Report?
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
|
||||
#
|
||||
|
||||
# Number of days of inactivity before a closed issue or pull request is locked
|
||||
daysUntilLock: 60
|
||||
|
||||
# Skip issues and pull requests created before a given timestamp. Timestamp must
|
||||
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
|
||||
skipCreatedBefore: false
|
||||
|
||||
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
|
||||
exemptLabels: [ 'no-locking' ]
|
||||
|
||||
# Label to add before locking, such as `outdated`. Set to `false` to disable
|
||||
lockLabel: false
|
||||
|
||||
# Comment to post before locking. Set to `false` to disable
|
||||
lockComment: >
|
||||
This thread has been automatically locked since there has not been
|
||||
any recent activity after it was closed. Please open a new issue for
|
||||
related bugs.
|
||||
|
||||
# Assign `resolved` as the reason for locking. Set to `false` to disable
|
||||
setLockReason: true
|
||||
|
||||
# Limit to only `issues` or `pulls`
|
||||
# only: issues
|
||||
|
||||
# Optionally, specify configuration settings just for `issues` or `pulls`
|
||||
# issues:
|
||||
# exemptLabels:
|
||||
# - help-wanted
|
||||
# lockLabel: outdated
|
||||
|
||||
# pulls:
|
||||
# daysUntilLock: 30
|
||||
|
||||
# Repository to extend settings from
|
||||
# _extends: repo
|
||||
@@ -0,0 +1,41 @@
|
||||
#
|
||||
# auto-label.yml
|
||||
# - Find all open issues without a label and a title containing "[BUG]".
|
||||
# - Apply the label "Bug: Potential ?" to these issues.
|
||||
#
|
||||
|
||||
name: Label Old Bugs
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 8 * * *"
|
||||
|
||||
jobs:
|
||||
autolabel:
|
||||
name: Auto Label
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Auto Label for [BUG]
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
// Get all open issues in this repository
|
||||
const issueList = await github.rest.issues.listForRepo({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open'
|
||||
});
|
||||
// Filter issues without labels that have a title containing '[BUG]'.
|
||||
const matchingIssues = issueList.data.filter(
|
||||
issue => issue.title.includes('[BUG]') && issue.labels.length === 0
|
||||
);
|
||||
// Process the first 50
|
||||
for (const issue of matchingIssues.slice(0, 50)) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
labels: ['Bug: Potential ?']
|
||||
});
|
||||
}
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Check out bugfix-2.0.x
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: bugfix-2.0.x
|
||||
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
exit 0
|
||||
|
||||
- name: Check out bugfix-2.1.x
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: bugfix-2.1.x
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ on:
|
||||
- 1.0.x
|
||||
- 1.1.x
|
||||
- 2.0.x
|
||||
- 2.1.x
|
||||
|
||||
jobs:
|
||||
bad_target:
|
||||
|
||||
@@ -23,6 +23,7 @@ jobs:
|
||||
- "S: Please Merge"
|
||||
- "S: Please Test"
|
||||
- "help wanted"
|
||||
- "Bug: Potential ?"
|
||||
- "Needs: Discussion"
|
||||
- "Needs: Documentation"
|
||||
- "Needs: More Data"
|
||||
@@ -31,7 +32,7 @@ jobs:
|
||||
- "Needs: Work"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Remove Labels
|
||||
uses: actions-ecosystem/action-remove-labels@v1
|
||||
with:
|
||||
|
||||
@@ -17,12 +17,24 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.'
|
||||
days-before-stale: 60
|
||||
days-before-close: 10
|
||||
stale-issue-message: |
|
||||
Greetings from the Marlin AutoBot!
|
||||
This issue has had no activity for the last 90 days.
|
||||
Do you still see this issue with the latest `bugfix-2.1.x` code?
|
||||
Please add a reply within 14 days or this issue will be automatically closed.
|
||||
To keep a confirmed issue open we can also add a "Bug: Confirmed" tag.
|
||||
|
||||
Disclaimer: This is an open community project with lots of activity and limited
|
||||
resources. The main project contributors will do a bug sweep ahead of the next
|
||||
release, but any skilled member of the community may jump in at any time to fix
|
||||
this issue. That can take a while depending on our busy lives so please be patient,
|
||||
and take advantage of other resources such as the MarlinFirmware Discord to help
|
||||
solve the issue.
|
||||
days-before-stale: 90
|
||||
days-before-close: 14
|
||||
stale-issue-label: 'stale-closing-soon'
|
||||
exempt-all-assignees: true
|
||||
exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: More Data,Needs: Discussion,Needs: Documentation,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking'
|
||||
|
||||
@@ -17,15 +17,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v2
|
||||
- uses: dessant/lock-threads@v5
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
process-only: 'issues'
|
||||
issue-lock-inactive-days: '60'
|
||||
issue-exclude-created-before: ''
|
||||
issue-exclude-labels: 'no-locking'
|
||||
issue-lock-labels: ''
|
||||
issue-lock-comment: >
|
||||
issue-inactive-days: '60'
|
||||
exclude-issue-created-before: ''
|
||||
exclude-any-issue-labels: 'no-locking'
|
||||
add-issue-labels: ''
|
||||
issue-comment: >
|
||||
This issue has been automatically locked since there
|
||||
has not been any recent activity after it was closed.
|
||||
Please open a new issue for related bugs.
|
||||
|
||||
@@ -9,6 +9,7 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
- 2.1.x
|
||||
paths-ignore:
|
||||
- config/**
|
||||
- data/**
|
||||
@@ -17,6 +18,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
- 2.1.x
|
||||
paths-ignore:
|
||||
- config/**
|
||||
- data/**
|
||||
@@ -118,6 +120,7 @@ jobs:
|
||||
|
||||
# STM32H7
|
||||
- BTT_SKR_SE_BX
|
||||
- STM32H743VI_btt
|
||||
|
||||
# STM32F1 (Maple)
|
||||
- jgaurora_a5s_a1_maple
|
||||
@@ -133,6 +136,12 @@ jobs:
|
||||
#- STM32F103RC_btt_maple
|
||||
#- STM32F103RE_creality_maple
|
||||
|
||||
# STM32G0
|
||||
- STM32G0B1RE_btt
|
||||
|
||||
# HC32
|
||||
- HC32F460C_aquila_101
|
||||
|
||||
# LPC176x - Lengthy tests
|
||||
- LPC1768
|
||||
- LPC1769
|
||||
@@ -140,10 +149,10 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
@@ -151,16 +160,16 @@ jobs:
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
- name: Select Python 3.7
|
||||
uses: actions/setup-python@v3
|
||||
- name: Select Python 3.9
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax.
|
||||
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
|
||||
python-version: '3.9'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
|
||||
Vendored
+1
@@ -6,6 +6,7 @@
|
||||
"platformio.platformio-ide"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"ms-vscode-remote.remote-containers",
|
||||
"ms-vscode.cpptools-extension-pack"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,12 +5,14 @@ CONTAINER_IMAGE := marlin-dev
|
||||
|
||||
help:
|
||||
@echo "Tasks for local development:"
|
||||
@echo "* tests-single-ci: Run a single test from inside the CI"
|
||||
@echo "* tests-single-local: Run a single test locally"
|
||||
@echo "* tests-single-local-docker: Run a single test locally, using docker"
|
||||
@echo "* tests-all-local: Run all tests locally"
|
||||
@echo "* tests-all-local-docker: Run all tests locally, using docker"
|
||||
@echo "* setup-local-docker: Build the local docker image"
|
||||
@echo "make marlin : Build marlin for the configured board"
|
||||
@echo "make format-pins : Reformat all pins files"
|
||||
@echo "make tests-single-ci : Run a single test from inside the CI"
|
||||
@echo "make tests-single-local : Run a single test locally"
|
||||
@echo "make tests-single-local-docker : Run a single test locally, using docker"
|
||||
@echo "make tests-all-local : Run all tests locally"
|
||||
@echo "make tests-all-local-docker : Run all tests locally, using docker"
|
||||
@echo "make setup-local-docker : Build the local docker image"
|
||||
@echo ""
|
||||
@echo "Options for testing:"
|
||||
@echo " TEST_TARGET Set when running tests-single-*, to select the"
|
||||
@@ -23,37 +25,41 @@ help:
|
||||
@echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value"
|
||||
@echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
|
||||
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
|
||||
.PHONY: help
|
||||
|
||||
marlin:
|
||||
./buildroot/bin/mftest -a
|
||||
.PHONY: marlin
|
||||
|
||||
tests-single-ci:
|
||||
export GIT_RESET_HARD=true
|
||||
$(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) PLATFORMIO_BUILD_FLAGS=-DGITHUB_ACTION
|
||||
.PHONY: tests-single-ci
|
||||
|
||||
tests-single-local:
|
||||
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi
|
||||
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
|
||||
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
|
||||
&& run_tests . $(TEST_TARGET) "$(ONLY_TEST)"
|
||||
.PHONY: tests-single-local
|
||||
|
||||
tests-single-local-docker:
|
||||
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
|
||||
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
|
||||
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
|
||||
.PHONY: tests-single-local-docker
|
||||
|
||||
tests-all-local:
|
||||
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
|
||||
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
|
||||
&& for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
|
||||
.PHONY: tests-all-local
|
||||
|
||||
tests-all-local-docker:
|
||||
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
|
||||
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
|
||||
.PHONY: tests-all-local-docker
|
||||
|
||||
setup-local-docker:
|
||||
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
|
||||
.PHONY: setup-local-docker
|
||||
|
||||
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
|
||||
|
||||
$(PINS): %:
|
||||
@echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@
|
||||
|
||||
format-pins: $(PINS)
|
||||
|
||||
+130
-83
@@ -135,9 +135,9 @@
|
||||
* Options: A4988, A5984, DRV8825, LV8729, TB6560, TB6600, TMC2100,
|
||||
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
|
||||
* TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
|
||||
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
|
||||
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
|
||||
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
|
||||
* TMC2660, TMC2660_STANDALONE, TMC5130, TMC5130_STANDALONE,
|
||||
* TMC5160, TMC5160_STANDALONE
|
||||
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
|
||||
*/
|
||||
#define X_DRIVER_TYPE A4988
|
||||
#define Y_DRIVER_TYPE A4988
|
||||
@@ -244,7 +244,8 @@
|
||||
#if ENABLED(SWITCHING_NOZZLE)
|
||||
#define SWITCHING_NOZZLE_SERVO_NR 0
|
||||
//#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second
|
||||
#define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo)
|
||||
#define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // A pair of angles for { E0, E1 }.
|
||||
// For Dual Servo use two pairs: { { lower, raise }, { lower, raise } }
|
||||
#define SWITCHING_NOZZLE_SERVO_DWELL 2500 // Dwell time to wait for servo to make physical move
|
||||
#endif
|
||||
|
||||
@@ -400,9 +401,18 @@
|
||||
//#define PS_OFF_SOUND // Beep 1s when power off
|
||||
#define PSU_ACTIVE_STATE LOW // Set 'LOW' for ATX, 'HIGH' for X-Box
|
||||
|
||||
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
|
||||
//#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power
|
||||
//#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay
|
||||
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
|
||||
//#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power
|
||||
//#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay
|
||||
|
||||
//#define PSU_OFF_REDUNDANT // Second pin for redundant power control
|
||||
//#define PSU_OFF_REDUNDANT_INVERTED // Redundant pin state is the inverse of PSU_ACTIVE_STATE
|
||||
|
||||
//#define PS_ON1_PIN 6 // Redundant pin required to enable power in combination with PS_ON_PIN
|
||||
|
||||
//#define PS_ON_EDM_PIN 8 // External Device Monitoring pins for external power control relay feedback. Fault on mismatch.
|
||||
//#define PS_ON1_EDM_PIN 9
|
||||
#define PS_EDM_RESPONSE 250 // (ms) Time to allow for relay action
|
||||
|
||||
//#define POWER_OFF_TIMER // Enable M81 D<seconds> to power off after a delay
|
||||
//#define POWER_OFF_WAIT_FOR_COOLDOWN // Enable M81 S to power off only after cooldown
|
||||
@@ -412,11 +422,12 @@
|
||||
|
||||
//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
|
||||
#if ENABLED(AUTO_POWER_CONTROL)
|
||||
#define AUTO_POWER_FANS // Turn on PSU if fans need power
|
||||
#define AUTO_POWER_E_FANS
|
||||
#define AUTO_POWER_CONTROLLERFAN
|
||||
#define AUTO_POWER_CHAMBER_FAN
|
||||
#define AUTO_POWER_COOLER_FAN
|
||||
#define AUTO_POWER_FANS // Turn on PSU for fans
|
||||
#define AUTO_POWER_E_FANS // Turn on PSU for E Fans
|
||||
#define AUTO_POWER_CONTROLLERFAN // Turn on PSU for Controller Fan
|
||||
#define AUTO_POWER_CHAMBER_FAN // Turn on PSU for Chamber Fan
|
||||
#define AUTO_POWER_COOLER_FAN // Turn on PSU for Cooler Fan
|
||||
#define AUTO_POWER_SPINDLE_LASER // Turn on PSU for Spindle/Laser
|
||||
#define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration
|
||||
//#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time.
|
||||
#endif
|
||||
@@ -465,6 +476,7 @@
|
||||
* 13 : 100kΩ Hisens up to 300°C - for "Simple ONE" & "All In ONE" hotend - beta 3950, 1%
|
||||
* 14 : 100kΩ (R25), 4092K (beta25), 4.7kΩ pull-up, bed thermistor as used in Ender-5 S1
|
||||
* 15 : 100kΩ Calibrated for JGAurora A5 hotend
|
||||
* 17 : 100kΩ Dagoma NTC white thermistor
|
||||
* 18 : 200kΩ ATC Semitec 204GT-2 Dagoma.Fr - MKS_Base_DKU001327
|
||||
* 22 : 100kΩ GTM32 Pro vB - hotend - 4.7kΩ pullup to 3.3V and 220Ω to analog input
|
||||
* 23 : 100kΩ GTM32 Pro vB - bed - 4.7kΩ pullup to 3.3v and 220Ω to analog input
|
||||
@@ -476,6 +488,7 @@
|
||||
* 68 : PT100 Smplifier board from Dyze Design
|
||||
* 70 : 100kΩ bq Hephestos 2
|
||||
* 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32
|
||||
* 666 : 200kΩ Einstart S custom thermistor with 10k pullup.
|
||||
* 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor
|
||||
*
|
||||
* ================================================================
|
||||
@@ -509,10 +522,10 @@
|
||||
* ================================================================
|
||||
* SPI RTD/Thermocouple Boards
|
||||
* ================================================================
|
||||
* -5 : MAX31865 with Pt100/Pt1000, 2, 3, or 4-wire (only for sensors 0-1)
|
||||
* -5 : MAX31865 with Pt100/Pt1000, 2, 3, or 4-wire (only for sensors 0-2 and bed)
|
||||
* NOTE: You must uncomment/set the MAX31865_*_OHMS_n defines below.
|
||||
* -3 : MAX31855 with Thermocouple, -200°C to +700°C (only for sensors 0-1)
|
||||
* -2 : MAX6675 with Thermocouple, 0°C to +700°C (only for sensors 0-1)
|
||||
* -3 : MAX31855 with Thermocouple, -200°C to +700°C (only for sensors 0-2 and bed)
|
||||
* -2 : MAX6675 with Thermocouple, 0°C to +700°C (only for sensors 0-2 and bed)
|
||||
*
|
||||
* NOTE: Ensure TEMP_n_CS_PIN is set in your pins file for each TEMP_SENSOR_n using an SPI Thermocouple. By default,
|
||||
* Hardware SPI on the default serial bus is used. If you have also set TEMP_n_SCK_PIN and TEMP_n_MISO_PIN,
|
||||
@@ -662,7 +675,7 @@
|
||||
//#define MPCTEMP // ** EXPERIMENTAL ** See https://marlinfw.org/docs/features/model_predictive_control.html
|
||||
|
||||
#define PID_MAX 255 // Limit hotend current while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
|
||||
#define PID_K1 0.95 // Smoothing factor within any PID loop
|
||||
#define PID_K1 0.95 // Smoothing factor within any PID loop
|
||||
|
||||
#if ENABLED(PIDTEMP)
|
||||
//#define PID_DEBUG // Print PID debug data to the serial port. Use 'M303 D' to toggle activation.
|
||||
@@ -775,6 +788,9 @@
|
||||
//#define BED_LIMIT_SWITCHING // Keep the bed temperature within BED_HYSTERESIS of the target
|
||||
#endif
|
||||
|
||||
// Add 'M190 R T' for more gradual M190 R bed cooling.
|
||||
//#define BED_ANNEALING_GCODE
|
||||
|
||||
//===========================================================================
|
||||
//==================== PID > Chamber Temperature Control ====================
|
||||
//===========================================================================
|
||||
@@ -885,8 +901,16 @@
|
||||
//#define COREYX
|
||||
//#define COREZX
|
||||
//#define COREZY
|
||||
//#define MARKFORGED_XY // MarkForged. See https://reprap.org/forum/read.php?152,504042
|
||||
|
||||
//
|
||||
// MarkForged Kinematics
|
||||
// See https://reprap.org/forum/read.php?152,504042
|
||||
//
|
||||
//#define MARKFORGED_XY
|
||||
//#define MARKFORGED_YX
|
||||
#if ANY(MARKFORGED_XY, MARKFORGED_YX)
|
||||
//#define MARKFORGED_INVERSE // Enable for an inverted Markforged kinematics belt path
|
||||
#endif
|
||||
|
||||
// Enable for a belt style printer with endless "Z" motion
|
||||
//#define BELTPRINTER
|
||||
@@ -943,7 +967,7 @@
|
||||
// Distance between bed and nozzle Z home position
|
||||
#define DELTA_HEIGHT 250.00 // (mm) Get this value from G33 auto calibrate
|
||||
|
||||
#define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } // Get these values from G33 auto calibrate
|
||||
#define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } // (mm) Get these values from G33 auto calibrate
|
||||
|
||||
// Horizontal distance bridged by diagonal push rods when effector is centered.
|
||||
#define DELTA_RADIUS 124.0 // (mm) Get this value from G33 auto calibrate
|
||||
@@ -951,11 +975,11 @@
|
||||
// Trim adjustments for individual towers
|
||||
// tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0
|
||||
// measured in degrees anticlockwise looking from above the printer
|
||||
#define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } // Get these values from G33 auto calibrate
|
||||
#define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } // (mm) Get these values from G33 auto calibrate
|
||||
|
||||
// Delta radius and diagonal rod adjustments (mm)
|
||||
//#define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 }
|
||||
//#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 }
|
||||
// Delta radius and diagonal rod adjustments
|
||||
//#define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 } // (mm)
|
||||
//#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 } // (mm)
|
||||
#endif
|
||||
|
||||
// @section scara
|
||||
@@ -991,9 +1015,6 @@
|
||||
// Radius around the center where the arm cannot reach
|
||||
#define MIDDLE_DEAD_ZONE_R 0 // (mm)
|
||||
|
||||
#define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
|
||||
#define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
|
||||
|
||||
#elif ENABLED(MP_SCARA)
|
||||
|
||||
#define SCARA_OFFSET_THETA1 12 // degrees
|
||||
@@ -1012,23 +1033,19 @@
|
||||
#define DEFAULT_SEGMENTS_PER_SECOND 200
|
||||
|
||||
// Length of inner and outer support arms. Measure arm lengths precisely.
|
||||
#define TPARA_LINKAGE_1 120 // (mm)
|
||||
#define TPARA_LINKAGE_2 120 // (mm)
|
||||
#define TPARA_LINKAGE_1 120 // (mm)
|
||||
#define TPARA_LINKAGE_2 120 // (mm)
|
||||
|
||||
// SCARA tower offset (position of Tower relative to bed zero position)
|
||||
// This needs to be reasonably accurate as it defines the printbed position in the SCARA space.
|
||||
#define TPARA_OFFSET_X 0 // (mm)
|
||||
#define TPARA_OFFSET_Y 0 // (mm)
|
||||
#define TPARA_OFFSET_Z 0 // (mm)
|
||||
// TPARA tower offset (position of Tower relative to bed zero position)
|
||||
// This needs to be reasonably accurate as it defines the printbed position in the TPARA space.
|
||||
#define TPARA_OFFSET_X 0 // (mm)
|
||||
#define TPARA_OFFSET_Y 0 // (mm)
|
||||
#define TPARA_OFFSET_Z 0 // (mm)
|
||||
|
||||
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
|
||||
|
||||
// Radius around the center where the arm cannot reach
|
||||
#define MIDDLE_DEAD_ZONE_R 0 // (mm)
|
||||
|
||||
// Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/
|
||||
#define THETA_HOMING_OFFSET 0
|
||||
#define PSI_HOMING_OFFSET 0
|
||||
#endif
|
||||
|
||||
// @section polar
|
||||
@@ -1216,11 +1233,16 @@
|
||||
|
||||
/**
|
||||
* Default Axis Steps Per Unit (linear=steps/mm, rotational=steps/°)
|
||||
* Override with M92
|
||||
* Override with M92 (when enabled below)
|
||||
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 }
|
||||
|
||||
/**
|
||||
* Enable support for M92. Disable to save at least ~530 bytes of flash.
|
||||
*/
|
||||
#define EDITABLE_STEPS_PER_UNIT
|
||||
|
||||
/**
|
||||
* Default Max Feed Rate (linear=mm/s, rotational=°/s)
|
||||
* Override with M203
|
||||
@@ -1271,6 +1293,7 @@
|
||||
#define DEFAULT_XJERK 10.0
|
||||
#define DEFAULT_YJERK 10.0
|
||||
#define DEFAULT_ZJERK 0.3
|
||||
#define DEFAULT_EJERK 5.0
|
||||
//#define DEFAULT_IJERK 0.3
|
||||
//#define DEFAULT_JJERK 0.3
|
||||
//#define DEFAULT_KJERK 0.3
|
||||
@@ -1286,8 +1309,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define DEFAULT_EJERK 5.0 // May be used by Linear Advance
|
||||
|
||||
/**
|
||||
* Junction Deviation Factor
|
||||
*
|
||||
@@ -1415,6 +1436,29 @@
|
||||
//#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Bed Distance Sensor
|
||||
*
|
||||
* Measures the distance from bed to nozzle with accuracy of 0.01mm.
|
||||
* For information about this sensor https://github.com/markniu/Bed_Distance_sensor
|
||||
* Uses I2C port, so it requires I2C library markyue/Panda_SoftMasterI2C.
|
||||
*/
|
||||
//#define BD_SENSOR
|
||||
#if ENABLED(BD_SENSOR)
|
||||
//#define BD_SENSOR_PROBE_NO_STOP // Probe bed without stopping at each probe point
|
||||
#endif
|
||||
|
||||
/**
|
||||
* BIQU MicroProbe
|
||||
*
|
||||
* A lightweight, solenoid-driven probe.
|
||||
* For information about this sensor https://github.com/bigtreetech/MicroProbe
|
||||
*
|
||||
* Also requires: PROBE_ENABLE_DISABLE
|
||||
*/
|
||||
//#define BIQU_MICROPROBE_V1 // Triggers HIGH
|
||||
//#define BIQU_MICROPROBE_V2 // Triggers LOW
|
||||
|
||||
// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
|
||||
//#define SOLENOID_PROBE
|
||||
|
||||
@@ -1513,7 +1557,7 @@
|
||||
*
|
||||
* Tune and Adjust
|
||||
* - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc.
|
||||
* - PROBE_OFFSET_WIZARD (configuration_adv.h) can be used for setting the Z offset.
|
||||
* - PROBE_OFFSET_WIZARD (Configuration_adv.h) can be used for setting the Z offset.
|
||||
*
|
||||
* Assuming the typical work area orientation:
|
||||
* - Probe to RIGHT of the Nozzle has a Positive X offset
|
||||
@@ -1620,16 +1664,21 @@
|
||||
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
|
||||
* But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle.
|
||||
*/
|
||||
#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow
|
||||
#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points
|
||||
#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes
|
||||
//#define Z_AFTER_PROBING 5 // Z position after probing is done
|
||||
#define Z_CLEARANCE_DEPLOY_PROBE 10 // (mm) Z Clearance for Deploy/Stow
|
||||
#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points
|
||||
#define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes
|
||||
#define Z_PROBE_ERROR_TOLERANCE 3 // (mm) Tolerance for early trigger (<= -probe.offset.z + ZPET)
|
||||
//#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done
|
||||
|
||||
#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
|
||||
#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping
|
||||
|
||||
// For M851 give a range for adjusting the Z probe offset
|
||||
#define Z_PROBE_OFFSET_RANGE_MIN -20
|
||||
#define Z_PROBE_OFFSET_RANGE_MAX 20
|
||||
// For M851 provide ranges for adjusting the X, Y, and Z probe offsets
|
||||
//#define PROBE_OFFSET_XMIN -50 // (mm)
|
||||
//#define PROBE_OFFSET_XMAX 50 // (mm)
|
||||
//#define PROBE_OFFSET_YMIN -50 // (mm)
|
||||
//#define PROBE_OFFSET_YMAX 50 // (mm)
|
||||
//#define PROBE_OFFSET_ZMIN -20 // (mm)
|
||||
//#define PROBE_OFFSET_ZMAX 20 // (mm)
|
||||
|
||||
// Enable the M48 repeatability test to test probe accuracy
|
||||
//#define Z_MIN_PROBE_REPEATABILITY_TEST
|
||||
@@ -1734,10 +1783,13 @@
|
||||
*/
|
||||
//#define Z_IDLE_HEIGHT Z_HOME_POS
|
||||
|
||||
//#define Z_CLEARANCE_FOR_HOMING 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
|
||||
// Be sure to have this much clearance over your Z_MAX_POS to prevent grinding.
|
||||
//#define Z_CLEARANCE_FOR_HOMING 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
|
||||
// You'll need this much clearance above Z_MAX_POS to avoid grinding.
|
||||
|
||||
//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing (if Z was homed)
|
||||
//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing (if Z was homed)
|
||||
//#define XY_AFTER_HOMING { 10, 10 } // (mm) Move to an XY position after homing (and raising Z)
|
||||
|
||||
//#define EVENT_GCODE_AFTER_HOMING "M300 P440 S200" // Commands to run after G28 (and move to XY_AFTER_HOMING)
|
||||
|
||||
// Direction of endstops when homing; 1=MAX, -1=MIN
|
||||
// :[-1,1]
|
||||
@@ -1993,6 +2045,12 @@
|
||||
//#define AUTO_BED_LEVELING_UBL
|
||||
//#define MESH_BED_LEVELING
|
||||
|
||||
/**
|
||||
* Commands to execute at the end of G29 probing.
|
||||
* Useful to retract or move the Z probe out of the way.
|
||||
*/
|
||||
//#define EVENT_GCODE_AFTER_G29 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
|
||||
|
||||
/**
|
||||
* Normally G28 leaves leveling disabled on completion. Enable one of
|
||||
* these options to restore the prior leveling state or to always enable
|
||||
@@ -2010,19 +2068,10 @@
|
||||
#define LEVELING_BED_TEMP 50
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Bed Distance Sensor
|
||||
*
|
||||
* Measures the distance from bed to nozzle with accuracy of 0.01mm.
|
||||
* For information about this sensor https://github.com/markniu/Bed_Distance_sensor
|
||||
* Uses I2C port, so it requires I2C library markyue/Panda_SoftMasterI2C.
|
||||
*/
|
||||
//#define BD_SENSOR
|
||||
|
||||
/**
|
||||
* Enable detailed logging of G28, G29, M48, etc.
|
||||
* Turn on with the command 'M111 S32'.
|
||||
* NOTE: Requires a lot of PROGMEM!
|
||||
* NOTE: Requires a lot of flash!
|
||||
*/
|
||||
//#define DEBUG_LEVELING_FEATURE
|
||||
|
||||
@@ -2198,12 +2247,6 @@
|
||||
#define BED_TRAMMING_LEVELING_ORDER { LF, RF, RB, LB }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Commands to execute at the end of G29 probing.
|
||||
* Useful to retract or move the Z probe out of the way.
|
||||
*/
|
||||
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
|
||||
|
||||
// @section homing
|
||||
|
||||
// The center of the bed is at (X=0, Y=0)
|
||||
@@ -2231,8 +2274,8 @@
|
||||
//#define Z_SAFE_HOMING
|
||||
|
||||
#if ENABLED(Z_SAFE_HOMING)
|
||||
#define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
|
||||
#define Z_SAFE_HOMING_Y_POINT Y_CENTER // Y point for Z homing
|
||||
#define Z_SAFE_HOMING_X_POINT X_CENTER // (mm) X point for Z homing
|
||||
#define Z_SAFE_HOMING_Y_POINT Y_CENTER // (mm) Y point for Z homing
|
||||
//#define Z_SAFE_HOMING_POINT_ABSOLUTE // Ignore home offsets (M206) for Z homing position
|
||||
#endif
|
||||
|
||||
@@ -2317,7 +2360,7 @@
|
||||
*/
|
||||
//#define EEPROM_SETTINGS // Persistent storage with M500 and M501
|
||||
//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
|
||||
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
|
||||
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save flash.
|
||||
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
//#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
|
||||
@@ -2593,9 +2636,9 @@
|
||||
#define DISPLAY_CHARSET_HD44780 JAPANESE
|
||||
|
||||
/**
|
||||
* Info Screen Style (0:Classic, 1:Průša)
|
||||
* Info Screen Style (0:Classic, 1:Průša, 2:CNC)
|
||||
*
|
||||
* :[0:'Classic', 1:'Průša']
|
||||
* :[0:'Classic', 1:'Průša', 2:'CNC']
|
||||
*/
|
||||
#define LCD_INFO_SCREEN_STYLE 0
|
||||
|
||||
@@ -2984,14 +3027,19 @@
|
||||
//#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight.
|
||||
|
||||
//
|
||||
// BigTreeTech Mini 12864 V1.0 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight.
|
||||
// https://github.com/bigtreetech/MINI-12864/tree/master/mini12864_v1.0
|
||||
// BigTreeTech Mini 12864 V1.0 / V2.0 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight.
|
||||
// https://github.com/bigtreetech/MINI-12864
|
||||
//
|
||||
//#define BTT_MINI_12864_V1
|
||||
//#define BTT_MINI_12864
|
||||
|
||||
//
|
||||
// BEEZ MINI 12864 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight.
|
||||
//
|
||||
//#define BEEZ_MINI_12864
|
||||
|
||||
//
|
||||
// Factory display for Creality CR-10 / CR-7 / Ender-3
|
||||
// https://www.aliexpress.com/item/32833148327.html
|
||||
// https://marlinfw.org/docs/hardware/controllers.html#cr10_stockdisplay
|
||||
//
|
||||
// Connect to EXP1 on RAMPS and compatible boards.
|
||||
//
|
||||
@@ -3003,14 +3051,14 @@
|
||||
//#define ENDER2_STOCKDISPLAY
|
||||
|
||||
//
|
||||
// ANET and Tronxy Graphical Controller
|
||||
//
|
||||
// Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
|
||||
// A clone of the RepRapDiscount full graphics display but with
|
||||
// different pins/wiring (see pins_ANET_10.h). Enable one of these.
|
||||
// ANET and Tronxy 128×64 Full Graphics Controller as used on Anet A6
|
||||
//
|
||||
//#define ANET_FULL_GRAPHICS_LCD
|
||||
//#define ANET_FULL_GRAPHICS_LCD_ALT_WIRING
|
||||
|
||||
//
|
||||
// GUCOCO CTC 128×64 Full Graphics Controller as used on GUCOCO CTC A10S
|
||||
//
|
||||
//#define CTC_A10S_A13
|
||||
|
||||
//
|
||||
// AZSMZ 12864 LCD with SD
|
||||
@@ -3368,7 +3416,6 @@
|
||||
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
|
||||
|
||||
//#define DISABLE_ENCODER // Disable the click encoder, if any
|
||||
//#define TOUCH_IDLE_SLEEP_MINS 5 // (minutes) Display Sleep after a period of inactivity. Set with M255 S.
|
||||
|
||||
#define TOUCH_SCREEN_CALIBRATION
|
||||
|
||||
|
||||
+274
-152
@@ -304,8 +304,8 @@
|
||||
* THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
|
||||
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
|
||||
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
|
||||
#define THERMAL_PROTECTION_PERIOD 40 // (seconds)
|
||||
#define THERMAL_PROTECTION_HYSTERESIS 4 // (°C)
|
||||
|
||||
//#define ADAPTIVE_FAN_SLOWING // Slow down the part-cooling fan if the temperature drops
|
||||
#if ENABLED(ADAPTIVE_FAN_SLOWING)
|
||||
@@ -327,50 +327,50 @@
|
||||
* and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set
|
||||
* below 2.
|
||||
*/
|
||||
#define WATCH_TEMP_PERIOD 40 // Seconds
|
||||
#define WATCH_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#define WATCH_TEMP_PERIOD 40 // (seconds)
|
||||
#define WATCH_TEMP_INCREASE 2 // (°C)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Thermal Protection parameters for the bed are just as above for hotends.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_BED)
|
||||
#define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
|
||||
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
|
||||
#define THERMAL_PROTECTION_BED_PERIOD 20 // (seconds)
|
||||
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // (°C)
|
||||
|
||||
/**
|
||||
* As described above, except for the bed (M140/M190/M303).
|
||||
*/
|
||||
#define WATCH_BED_TEMP_PERIOD 60 // Seconds
|
||||
#define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#define WATCH_BED_TEMP_PERIOD 60 // (seconds)
|
||||
#define WATCH_BED_TEMP_INCREASE 2 // (°C)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Thermal Protection parameters for the heated chamber.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
|
||||
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
|
||||
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius
|
||||
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // (seconds)
|
||||
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // (°C)
|
||||
|
||||
/**
|
||||
* Heated chamber watch settings (M141/M191).
|
||||
*/
|
||||
#define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds
|
||||
#define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius
|
||||
#define WATCH_CHAMBER_TEMP_PERIOD 60 // (seconds)
|
||||
#define WATCH_CHAMBER_TEMP_INCREASE 2 // (°C)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Thermal Protection parameters for the laser cooler.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_COOLER)
|
||||
#define THERMAL_PROTECTION_COOLER_PERIOD 10 // Seconds
|
||||
#define THERMAL_PROTECTION_COOLER_HYSTERESIS 3 // Degrees Celsius
|
||||
#define THERMAL_PROTECTION_COOLER_PERIOD 10 // (seconds)
|
||||
#define THERMAL_PROTECTION_COOLER_HYSTERESIS 3 // (°C)
|
||||
|
||||
/**
|
||||
* Laser cooling watch settings (M143/M193).
|
||||
*/
|
||||
#define WATCH_COOLER_TEMP_PERIOD 60 // Seconds
|
||||
#define WATCH_COOLER_TEMP_INCREASE 3 // Degrees Celsius
|
||||
#define WATCH_COOLER_TEMP_PERIOD 60 // (seconds)
|
||||
#define WATCH_COOLER_TEMP_INCREASE 3 // (°C)
|
||||
#endif
|
||||
|
||||
#if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER)
|
||||
@@ -459,7 +459,7 @@
|
||||
#define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0
|
||||
|
||||
#else
|
||||
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed)
|
||||
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power-loss due to cooling = Kf * (fan_speed)
|
||||
#define DEFAULT_Kf 10 // A constant value added to the PID-tuner
|
||||
#define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING
|
||||
#endif
|
||||
@@ -564,6 +564,8 @@
|
||||
#define TEMP_SENSOR_AD8495_OFFSET 0.0
|
||||
#define TEMP_SENSOR_AD8495_GAIN 1.0
|
||||
|
||||
// @section fans
|
||||
|
||||
/**
|
||||
* Controller Fan
|
||||
* To cool down the stepper drivers and MOSFETs.
|
||||
@@ -667,8 +669,6 @@
|
||||
//#define NUM_REDUNDANT_FANS 1 // Number of sequential fans to synchronize with Fan 0
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
|
||||
/**
|
||||
* Extruder cooling fans
|
||||
*
|
||||
@@ -745,6 +745,7 @@
|
||||
#define FANMUX2_PIN -1
|
||||
|
||||
/**
|
||||
* @section caselight
|
||||
* M355 Case Light on-off / brightness
|
||||
*/
|
||||
//#define CASE_LIGHT_ENABLE
|
||||
@@ -767,7 +768,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// @section homing
|
||||
// @section endstops
|
||||
|
||||
// If you want endstops to stay on (by default) even when not homing
|
||||
// enable this option. Override at any time with M120, M121.
|
||||
@@ -784,6 +785,8 @@
|
||||
//#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1
|
||||
#endif
|
||||
|
||||
// @section idex
|
||||
|
||||
/**
|
||||
* Dual X Carriage
|
||||
*
|
||||
@@ -833,6 +836,8 @@
|
||||
//#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X"
|
||||
#endif
|
||||
|
||||
// @section multi stepper
|
||||
|
||||
/**
|
||||
* Multi-Stepper / Multi-Endstop
|
||||
*
|
||||
@@ -904,6 +909,8 @@
|
||||
//#define INVERT_E1_VS_E0_DIR // E direction signals are opposites
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
|
||||
// Activate a solenoid on the active extruder with M380. Disable all with M381.
|
||||
// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid.
|
||||
//#define EXT_SOLENOID
|
||||
@@ -1114,42 +1121,62 @@
|
||||
#if ENABLED(FT_MOTION)
|
||||
#define FTM_DEFAULT_MODE ftMotionMode_DISABLED // Default mode of fixed time control. (Enums in ft_types.h)
|
||||
#define FTM_DEFAULT_DYNFREQ_MODE dynFreqMode_DISABLED // Default mode of dynamic frequency calculation. (Enums in ft_types.h)
|
||||
#define FTM_SHAPING_DEFAULT_X_FREQ 37.0f // (Hz) Default peak frequency used by input shapers.
|
||||
#define FTM_SHAPING_DEFAULT_Y_FREQ 37.0f // (Hz) Default peak frequency used by input shapers.
|
||||
#define FTM_LINEAR_ADV_DEFAULT_ENA false // Default linear advance enable (true) or disable (false).
|
||||
#define FTM_LINEAR_ADV_DEFAULT_K 0.0f // Default linear advance gain.
|
||||
#define FTM_SHAPING_ZETA 0.1f // Zeta used by input shapers.
|
||||
#define FTM_SHAPING_V_TOL 0.05f // Vibration tolerance used by EI input shapers.
|
||||
#define FTM_SHAPING_DEFAULT_X_FREQ 37.0f // (Hz) Default peak frequency used by input shapers
|
||||
#define FTM_SHAPING_DEFAULT_Y_FREQ 37.0f // (Hz) Default peak frequency used by input shapers
|
||||
#define FTM_LINEAR_ADV_DEFAULT_ENA false // Default linear advance enable (true) or disable (false)
|
||||
#define FTM_LINEAR_ADV_DEFAULT_K 0.0f // Default linear advance gain
|
||||
#define FTM_SHAPING_ZETA_X 0.1f // Zeta used by input shapers for X axis
|
||||
#define FTM_SHAPING_ZETA_Y 0.1f // Zeta used by input shapers for Y axis
|
||||
|
||||
#define FTM_SHAPING_V_TOL_X 0.05f // Vibration tolerance used by EI input shapers for X axis
|
||||
#define FTM_SHAPING_V_TOL_Y 0.05f // Vibration tolerance used by EI input shapers for Y axis
|
||||
|
||||
//#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters
|
||||
|
||||
/**
|
||||
* Advanced configuration
|
||||
*/
|
||||
#define FTM_BATCH_SIZE 100 // Batch size for trajectory generation;
|
||||
#define FTM_WINDOW_SIZE 200 // Window size for trajectory generation.
|
||||
#define FTM_FS 1000 // (Hz) Frequency for trajectory generation. (1 / FTM_TS)
|
||||
#define FTM_TS 0.001f // (s) Time step for trajectory generation. (1 / FTM_FS)
|
||||
#define FTM_STEPPER_FS 20000 // (Hz) Frequency for stepper I/O update.
|
||||
#define FTM_MIN_TICKS ((STEPPER_TIMER_RATE) / (FTM_STEPPER_FS)) // Minimum stepper ticks between steps.
|
||||
#define FTM_MIN_SHAPE_FREQ 10 // Minimum shaping frequency.
|
||||
#define FTM_ZMAX 100 // Maximum delays for shaping functions (even numbers only!).
|
||||
// Calculate as:
|
||||
// 1/2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for ZV.
|
||||
// (FTM_FS / FTM_MIN_SHAPE_FREQ) for ZVD, MZV.
|
||||
// 3/2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for 2HEI.
|
||||
// 2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for 3HEI.
|
||||
#define FTM_STEPS_PER_UNIT_TIME 20 // Interpolated stepper commands per unit time.
|
||||
// Calculate as (FTM_STEPPER_FS / FTM_FS).
|
||||
#define FTM_CTS_COMPARE_VAL 10 // Comparison value used in interpolation algorithm.
|
||||
// Calculate as (FTM_STEPS_PER_UNIT_TIME / 2).
|
||||
// These values may be configured to adjust duration of loop().
|
||||
#define FTM_STEPS_PER_LOOP 60 // Number of stepper commands to generate each loop().
|
||||
#define FTM_POINTS_PER_LOOP 100 // Number of trajectory points to generate each loop().
|
||||
#define FTM_UNIFIED_BWS // DON'T DISABLE unless you use Ulendo FBS (not implemented)
|
||||
#if ENABLED(FTM_UNIFIED_BWS)
|
||||
#define FTM_BW_SIZE 100 // Unified Window and Batch size with a ratio of 2
|
||||
#else
|
||||
#define FTM_WINDOW_SIZE 200 // Custom Window size for trajectory generation needed by Ulendo FBS
|
||||
#define FTM_BATCH_SIZE 100 // Custom Batch size for trajectory generation needed by Ulendo FBS
|
||||
#endif
|
||||
|
||||
// This value may be configured to adjust duration to consume the command buffer.
|
||||
// Try increasing this value if stepper motion is not smooth.
|
||||
#define FTM_STEPPERCMD_BUFF_SIZE 1000 // Size of the stepper command buffers.
|
||||
#define FTM_FS 1000 // (Hz) Frequency for trajectory generation. (Reciprocal of FTM_TS)
|
||||
#define FTM_TS 0.001f // (s) Time step for trajectory generation. (Reciprocal of FTM_FS)
|
||||
|
||||
//#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters.
|
||||
// These values may be configured to adjust the duration of loop().
|
||||
#define FTM_STEPS_PER_LOOP 60 // Number of stepper commands to generate each loop()
|
||||
#define FTM_POINTS_PER_LOOP 100 // Number of trajectory points to generate each loop()
|
||||
|
||||
#if DISABLED(COREXY)
|
||||
#define FTM_STEPPER_FS 20000 // (Hz) Frequency for stepper I/O update
|
||||
|
||||
// Use this to adjust the time required to consume the command buffer.
|
||||
// Try increasing this value if stepper motion is choppy.
|
||||
#define FTM_STEPPERCMD_BUFF_SIZE 3000 // Size of the stepper command buffers
|
||||
// (FTM_STEPS_PER_LOOP * FTM_POINTS_PER_LOOP) is a good start
|
||||
// If you run out of memory, fall back to 3000 and increase progressively
|
||||
#else
|
||||
// CoreXY motion needs a larger buffer size. These values are based on our testing.
|
||||
#define FTM_STEPPER_FS 30000
|
||||
#define FTM_STEPPERCMD_BUFF_SIZE 6000
|
||||
#endif
|
||||
|
||||
#define FTM_STEPS_PER_UNIT_TIME (FTM_STEPPER_FS / FTM_FS) // Interpolated stepper commands per unit time
|
||||
#define FTM_CTS_COMPARE_VAL (FTM_STEPS_PER_UNIT_TIME / 2) // Comparison value used in interpolation algorithm
|
||||
#define FTM_MIN_TICKS ((STEPPER_TIMER_RATE) / (FTM_STEPPER_FS)) // Minimum stepper ticks between steps
|
||||
|
||||
#define FTM_MIN_SHAPE_FREQ 10 // Minimum shaping frequency
|
||||
#define FTM_RATIO (FTM_FS / FTM_MIN_SHAPE_FREQ) // Factor for use in FTM_ZMAX. DON'T CHANGE.
|
||||
#define FTM_ZMAX (FTM_RATIO * 2) // Maximum delays for shaping functions (even numbers only!)
|
||||
// Calculate as:
|
||||
// ZV : FTM_RATIO / 2
|
||||
// ZVD, MZV : FTM_RATIO
|
||||
// 2HEI : FTM_RATIO * 3 / 2
|
||||
// 3HEI : FTM_RATIO * 2
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1177,14 +1204,14 @@
|
||||
//#define INPUT_SHAPING_Y
|
||||
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
|
||||
#if ENABLED(INPUT_SHAPING_X)
|
||||
#define SHAPING_FREQ_X 40 // (Hz) The default dominant resonant frequency on the X axis.
|
||||
#define SHAPING_ZETA_X 0.15f // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping).
|
||||
#define SHAPING_FREQ_X 40.0 // (Hz) The default dominant resonant frequency on the X axis.
|
||||
#define SHAPING_ZETA_X 0.15 // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping).
|
||||
#endif
|
||||
#if ENABLED(INPUT_SHAPING_Y)
|
||||
#define SHAPING_FREQ_Y 40 // (Hz) The default dominant resonant frequency on the Y axis.
|
||||
#define SHAPING_ZETA_Y 0.15f // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping).
|
||||
#define SHAPING_FREQ_Y 40.0 // (Hz) The default dominant resonant frequency on the Y axis.
|
||||
#define SHAPING_ZETA_Y 0.15 // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping).
|
||||
#endif
|
||||
//#define SHAPING_MIN_FREQ 20 // By default the minimum of the shaping frequencies. Override to affect SRAM usage.
|
||||
//#define SHAPING_MIN_FREQ 20.0 // (Hz) By default the minimum of the shaping frequencies. Override to affect SRAM usage.
|
||||
//#define SHAPING_MAX_STEPRATE 10000 // By default the maximum total step rate of the shaped axes. Override to affect SRAM usage.
|
||||
//#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters.
|
||||
#endif
|
||||
@@ -1243,18 +1270,13 @@
|
||||
* XY Frequency limit
|
||||
* Reduce resonance by limiting the frequency of small zigzag infill moves.
|
||||
* See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html
|
||||
* Use M201 F<freq> G<min%> to change limits at runtime.
|
||||
* Use M201 F<freq> S<min%> to change limits at runtime.
|
||||
*/
|
||||
//#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F<hertz>.
|
||||
#ifdef XY_FREQUENCY_LIMIT
|
||||
#define XY_FREQUENCY_MIN_PERCENT 5 // (percent) Minimum FR percentage to apply. Set with M201 G<min%>.
|
||||
#define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 S<min%>.
|
||||
#endif
|
||||
|
||||
// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
|
||||
// of the buffer and all stops. This should not be much greater than zero and should only be changed
|
||||
// if unwanted behavior is observed on a user's machine when running at very slow speeds.
|
||||
#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s)
|
||||
|
||||
//
|
||||
// Backlash Compensation
|
||||
// Adds extra movement to axes on direction-changes to account for backlash.
|
||||
@@ -1320,7 +1342,7 @@
|
||||
#define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm
|
||||
#define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm
|
||||
|
||||
// Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM).
|
||||
// Uncomment to enable reporting (required for "G425 V", but consumes flash).
|
||||
//#define CALIBRATION_REPORTING
|
||||
|
||||
// The true location and dimension the cube/bolt/washer on the bed.
|
||||
@@ -1452,6 +1474,7 @@
|
||||
#if IS_ULTIPANEL
|
||||
#define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position"
|
||||
#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen
|
||||
//#define ULTIPANEL_FLOWPERCENT // Encoder sets the flow percentage on the Status Screen
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1469,11 +1492,6 @@
|
||||
#define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
|
||||
#endif
|
||||
|
||||
//
|
||||
// LCD Backlight Timeout
|
||||
//
|
||||
//#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight
|
||||
|
||||
#if HAS_BED_PROBE && ANY(HAS_MARLINUI_MENU, HAS_TFT_LVGL_UI)
|
||||
//#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu
|
||||
#if ENABLED(PROBE_OFFSET_WIZARD)
|
||||
@@ -1516,8 +1534,24 @@
|
||||
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
|
||||
#endif
|
||||
|
||||
// Add 50/100mm moves to MarlinUI even with a smaller bed
|
||||
//#define LARGE_MOVE_ITEMS
|
||||
/**
|
||||
* MarlinUI "Move Axis" menu distances. Comma-separated list.
|
||||
* Values are displayed as-defined, so always use plain numbers here.
|
||||
* Axis moves <= 1/2 the axis length and Extruder moves <= EXTRUDE_MAXLENGTH
|
||||
* will be shown in the move submenus.
|
||||
*/
|
||||
|
||||
#define MANUAL_MOVE_DISTANCE_MM 10, 1.0, 0.1 // (mm)
|
||||
//#define MANUAL_MOVE_DISTANCE_MM 100, 50, 10, 1.0, 0.1 // (mm)
|
||||
//#define MANUAL_MOVE_DISTANCE_MM 500, 100, 50, 10, 1.0, 0.1 // (mm)
|
||||
|
||||
// Manual move distances for INCH_MODE_SUPPORT
|
||||
#define MANUAL_MOVE_DISTANCE_IN 0.100, 0.010, 0.001 // (in)
|
||||
//#define MANUAL_MOVE_DISTANCE_IN 1.000, 0.500, 0.100, 0.010, 0.001 // (in)
|
||||
//#define MANUAL_MOVE_DISTANCE_IN 5.000, 1.000, 0.500, 0.100, 0.010, 0.001 // (in)
|
||||
|
||||
// Manual move distances for rotational axes
|
||||
#define MANUAL_MOVE_DISTANCE_DEG 90, 45, 22.5, 5, 1 // (°)
|
||||
|
||||
// BACK menu items keep the highlight at the top
|
||||
//#define TURBO_BACK_MENU_ITEM
|
||||
@@ -1562,6 +1596,10 @@
|
||||
//#define SOUND_MENU_ITEM // Add a mute option to the LCD menu
|
||||
#define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
//#define DOUBLE_LCD_FRAMERATE // Not recommended for slow boards.
|
||||
#endif
|
||||
|
||||
// The timeout to return to the status screen from sub-menus
|
||||
//#define LCD_TIMEOUT_TO_STATUS 15000 // (ms)
|
||||
|
||||
@@ -1608,6 +1646,15 @@
|
||||
|
||||
#endif // HAS_DISPLAY
|
||||
|
||||
#if HAS_FEEDRATE_EDIT
|
||||
#define SPEED_EDIT_MIN 10 // (%) Feedrate percentage edit range minimum
|
||||
#define SPEED_EDIT_MAX 999 // (%) Feedrate percentage edit range maximum
|
||||
#endif
|
||||
#if HAS_FLOW_EDIT
|
||||
#define FLOW_EDIT_MIN 10 // (%) Flow percentage edit range minimum
|
||||
#define FLOW_EDIT_MAX 999 // (%) Flow percentage edit range maximum
|
||||
#endif
|
||||
|
||||
// Add 'M73' to set print job progress, overrides Marlin's built-in estimate
|
||||
//#define SET_PROGRESS_MANUALLY
|
||||
#if ENABLED(SET_PROGRESS_MANUALLY)
|
||||
@@ -1698,19 +1745,25 @@
|
||||
*/
|
||||
//#define POWER_LOSS_RECOVERY
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
|
||||
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
|
||||
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
|
||||
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
|
||||
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
|
||||
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
|
||||
#define PLR_ENABLED_DEFAULT false // Power-Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
|
||||
//#define PLR_BED_THRESHOLD BED_MAXTEMP // (°C) Skip user confirmation at or above this bed temperature (0 to disable)
|
||||
|
||||
//#define POWER_LOSS_PIN 44 // Pin to detect power-loss. Set to -1 to disable default pin on boards without module, or comment to use board default.
|
||||
//#define POWER_LOSS_STATE HIGH // State of pin indicating power-loss
|
||||
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
|
||||
//#define POWER_LOSS_PULLDOWN
|
||||
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
|
||||
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
|
||||
|
||||
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power-loss with UPS)
|
||||
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
|
||||
|
||||
// Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card,
|
||||
// especially with "vase mode" printing. Set too high and vases cannot be continued.
|
||||
#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
|
||||
#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
|
||||
|
||||
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power-loss
|
||||
#if ENABLED(BACKUP_POWER_SUPPLY)
|
||||
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail
|
||||
#endif
|
||||
|
||||
// Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled!
|
||||
//#define POWER_LOSS_RECOVER_ZHOME
|
||||
@@ -1746,9 +1799,10 @@
|
||||
|
||||
// SD Card Sorting options
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
#define SDSORT_REVERSE false // Default to sorting file names in reverse order.
|
||||
#define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each.
|
||||
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
|
||||
#define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 G-code.
|
||||
#define SDSORT_FOLDERS -1 // -1=above 0=none 1=below
|
||||
#define SDSORT_GCODE false // Enable G-code M34 to set sorting behaviors: M34 S<-1|0|1> F<-1|0|1>
|
||||
#define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting.
|
||||
#define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
|
||||
#define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option.
|
||||
@@ -1916,17 +1970,6 @@
|
||||
// Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese.
|
||||
//#define USE_SMALL_INFOFONT
|
||||
|
||||
/**
|
||||
* Graphical Display Sleep
|
||||
*
|
||||
* The U8G library provides sleep / wake functions for SH1106, SSD1306,
|
||||
* SSD1309, and some other DOGM displays.
|
||||
* Enable this option to save energy and prevent OLED pixel burn-in.
|
||||
* Adds the menu item Configuration > LCD Timeout (m) to set a wait period
|
||||
* from 0 (disabled) to 99 minutes.
|
||||
*/
|
||||
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen. Set with M255 S.
|
||||
|
||||
/**
|
||||
* ST7920-based LCDs can emulate a 16 x 4 character display using
|
||||
* the ST7920 character-generator for very fast screen updates.
|
||||
@@ -1967,7 +2010,10 @@
|
||||
//#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap
|
||||
//#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap
|
||||
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames
|
||||
|
||||
// Only one STATUS_HEAT_* option can be enabled
|
||||
//#define STATUS_HEAT_PERCENT // Show heating in a progress bar
|
||||
//#define STATUS_HEAT_POWER // Show heater output power as a vertical bar
|
||||
|
||||
// Frivolous Game Options
|
||||
//#define MARLIN_BRICKOUT
|
||||
@@ -2172,6 +2218,22 @@
|
||||
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Display Sleep
|
||||
* Enable this option to save energy and prevent OLED pixel burn-in.
|
||||
*/
|
||||
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen
|
||||
|
||||
/**
|
||||
* LCD Backlight Timeout
|
||||
* Requires a display with a controllable backlight
|
||||
*/
|
||||
//#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight
|
||||
|
||||
#if defined(DISPLAY_SLEEP_MINUTES) || defined(LCD_BACKLIGHT_TIMEOUT_MINS)
|
||||
#define EDITABLE_DISPLAY_TIMEOUT // Edit sleep / backlight timeout with M255 S<minutes> and a menu item
|
||||
#endif
|
||||
|
||||
//
|
||||
// ADC Button Debounce
|
||||
//
|
||||
@@ -2260,10 +2322,17 @@
|
||||
#endif
|
||||
//#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L.
|
||||
//#define LA_DEBUG // Print debug information to serial during operation. Disable for production use.
|
||||
//#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
|
||||
//#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz.
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Nonlinear Extrusion Control
|
||||
*
|
||||
* Control extrusion rate based on instantaneous extruder velocity. Can be used to correct for
|
||||
* underextrusion at high extruder speeds that are otherwise well-behaved (i.e., not skipping).
|
||||
*/
|
||||
//#define NONLINEAR_EXTRUSION
|
||||
|
||||
// @section leveling
|
||||
|
||||
/**
|
||||
@@ -2347,6 +2416,8 @@
|
||||
|
||||
#endif
|
||||
|
||||
// @section probes
|
||||
|
||||
/**
|
||||
* Thermal Probe Compensation
|
||||
*
|
||||
@@ -2409,7 +2480,7 @@
|
||||
|
||||
// Height above Z=0.0 to raise the nozzle. Lowering this can help the probe to heat faster.
|
||||
// Note: The Z=0.0 offset is determined by the probe Z offset (e.g., as set with M851 Z).
|
||||
#define PTC_PROBE_HEATING_OFFSET 0.5
|
||||
#define PTC_PROBE_HEATING_OFFSET 0.5 // (mm)
|
||||
#endif
|
||||
#endif // PTC_PROBE || PTC_BED || PTC_HOTEND
|
||||
|
||||
@@ -2464,6 +2535,8 @@
|
||||
#define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move.
|
||||
#endif
|
||||
|
||||
// @section motion
|
||||
|
||||
// Moves (or segments) with fewer steps than this will be joined with the next move
|
||||
#define MIN_STEPS_PER_SEGMENT 6
|
||||
|
||||
@@ -2519,10 +2592,9 @@
|
||||
//================================= Buffers =================================
|
||||
//===========================================================================
|
||||
|
||||
// @section motion
|
||||
// @section gcode
|
||||
|
||||
// The number of linear moves that can be in the planner at once.
|
||||
// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g., 8, 16, 32)
|
||||
#if ALL(HAS_MEDIA, DIRECT_STEPPING)
|
||||
#define BLOCK_BUFFER_SIZE 8
|
||||
#elif HAS_MEDIA
|
||||
@@ -2604,11 +2676,13 @@
|
||||
//#define FULL_REPORT_TO_HOST_FEATURE // Auto-report the machine status like Grbl CNC
|
||||
#endif
|
||||
|
||||
// Bad Serial-connections can miss a received command by sending an 'ok'
|
||||
// Therefore some clients abort after 30 seconds in a timeout.
|
||||
// Some other clients start sending commands while receiving a 'wait'.
|
||||
// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
|
||||
//#define NO_TIMEOUTS 1000 // Milliseconds
|
||||
/**
|
||||
* Bad Serial-connections can miss a received command by sending an 'ok'
|
||||
* Therefore some clients abort after 30 seconds in a timeout.
|
||||
* Some other clients start sending commands while receiving a 'wait'.
|
||||
* This "wait" is only sent when the buffer is empty. 1 second is a good value here.
|
||||
*/
|
||||
//#define NO_TIMEOUTS 1000 // (ms)
|
||||
|
||||
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
|
||||
//#define ADVANCED_OK
|
||||
@@ -2620,6 +2694,15 @@
|
||||
// For serial echo, the number of digits after the decimal point
|
||||
//#define SERIAL_FLOAT_PRECISION 4
|
||||
|
||||
/**
|
||||
* This feature is EXPERIMENTAL so use with caution and test thoroughly.
|
||||
* Enable this option to receive data on the serial ports via the onboard DMA
|
||||
* controller for more stable and reliable high-speed serial communication.
|
||||
* Only some STM32 MCUs are currently supported.
|
||||
* Note: This has no effect on emulated USB serial ports.
|
||||
*/
|
||||
//#define SERIAL_DMA
|
||||
|
||||
/**
|
||||
* Set the number of proportional font spaces required to fill up a typical character space.
|
||||
* This can help to better align the output of commands like `G29 O` Mesh Output.
|
||||
@@ -2640,6 +2723,8 @@
|
||||
*/
|
||||
//#define EXTRA_FAN_SPEED
|
||||
|
||||
// @section gcode
|
||||
|
||||
/**
|
||||
* Firmware-based and LCD-controlled retract
|
||||
*
|
||||
@@ -2674,6 +2759,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// @section tool change
|
||||
|
||||
/**
|
||||
* Universal tool change settings.
|
||||
* Applies to all types of extruders except where explicitly noted.
|
||||
@@ -2754,7 +2841,21 @@
|
||||
* - Switch to a different nozzle on an extruder jam
|
||||
*/
|
||||
#define TOOLCHANGE_MIGRATION_FEATURE
|
||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||
// Override toolchange settings
|
||||
// By default tool migration uses regular toolchange settings.
|
||||
// With a prime tower, tool-change swapping/priming occur inside the bed.
|
||||
// When migrating to a new unprimed tool you can set override values below.
|
||||
//#define MIGRATION_ZRAISE 0 // (mm)
|
||||
|
||||
// Longer prime to clean out
|
||||
//#define MIGRATION_FS_EXTRA_PRIME 0 // (mm) Extra priming length
|
||||
//#define MIGRATION_FS_WIPE_RETRACT 0 // (mm) Retract before cooling for less stringing, better wipe, etc.
|
||||
|
||||
// Cool after prime to reduce stringing
|
||||
//#define MIGRATION_FS_FAN_SPEED 255 // 0-255
|
||||
//#define MIGRATION_FS_FAN_TIME 0 // (seconds)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -2767,6 +2868,9 @@
|
||||
#define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/min)
|
||||
//#define TOOLCHANGE_PARK_X_ONLY // X axis only move
|
||||
//#define TOOLCHANGE_PARK_Y_ONLY // Y axis only move
|
||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||
//#define TOOLCHANGE_MIGRATION_DO_PARK // Force park (or no-park) on migration
|
||||
#endif
|
||||
#endif
|
||||
#endif // HAS_MULTI_EXTRUDER
|
||||
|
||||
@@ -2828,6 +2932,7 @@
|
||||
|
||||
//#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
|
||||
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
|
||||
#define CONFIGURE_FILAMENT_CHANGE // Add M603 G-code and menu items. Requires ~1.3K bytes of flash.
|
||||
#endif
|
||||
|
||||
// @section tmc_smart
|
||||
@@ -2848,15 +2953,12 @@
|
||||
* Some boards have simple jumper connections! See your board's documentation.
|
||||
* - These drivers can also be used with Hardware Serial.
|
||||
*
|
||||
* The TMC26XStepper library is required for TMC26X stepper drivers.
|
||||
* https://github.com/MarlinFirmware/TMC26XStepper
|
||||
*
|
||||
* The TMCStepper library is required for other TMC stepper drivers.
|
||||
* https://github.com/teemuatlut/TMCStepper
|
||||
*
|
||||
* @section tmc/config
|
||||
*/
|
||||
#if HAS_TRINAMIC_CONFIG || HAS_TMC26X
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
|
||||
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
|
||||
|
||||
@@ -2870,7 +2972,7 @@
|
||||
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
|
||||
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing
|
||||
#define X_MICROSTEPS 16 // 0..256
|
||||
#define X_RSENSE 0.11 // Multiplied x1000 for TMC26X
|
||||
#define X_RSENSE 0.11
|
||||
#define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ...
|
||||
//#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis
|
||||
//#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis
|
||||
@@ -3363,7 +3465,7 @@
|
||||
*/
|
||||
#define TMC_ADV() { }
|
||||
|
||||
#endif // HAS_TRINAMIC_CONFIG || HAS_TMC26X
|
||||
#endif // HAS_TRINAMIC_CONFIG
|
||||
|
||||
// @section i2cbus
|
||||
|
||||
@@ -3376,9 +3478,8 @@
|
||||
/**
|
||||
* TWI/I2C BUS
|
||||
*
|
||||
* This feature is an EXPERIMENTAL feature so it shall not be used on production
|
||||
* machines. Enabling this will allow you to send and receive I2C data from slave
|
||||
* devices on the bus.
|
||||
* This feature is EXPERIMENTAL but may be useful for custom I2C peripherals.
|
||||
* Enable this to send and receive I2C data from slave devices on the bus.
|
||||
*
|
||||
* ; Example #1
|
||||
* ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
|
||||
@@ -3457,7 +3558,7 @@
|
||||
* Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and
|
||||
* to set spindle speed, spindle direction, and laser power.
|
||||
*
|
||||
* SuperPid is a router/spindle speed controller used in the CNC milling community.
|
||||
* SuperPID is a router/spindle speed controller used in the CNC milling community.
|
||||
* Marlin can be used to turn the spindle on and off. It can also be used to set
|
||||
* the spindle speed from 5,000 to 30,000 RPM.
|
||||
*
|
||||
@@ -3735,38 +3836,6 @@
|
||||
*/
|
||||
//#define CNC_COORDINATE_SYSTEMS
|
||||
|
||||
// @section reporting
|
||||
|
||||
/**
|
||||
* Auto-report fan speed with M123 S<seconds>
|
||||
* Requires fans with tachometer pins
|
||||
*/
|
||||
//#define AUTO_REPORT_FANS
|
||||
|
||||
/**
|
||||
* Auto-report temperatures with M155 S<seconds>
|
||||
*/
|
||||
#define AUTO_REPORT_TEMPERATURES
|
||||
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
|
||||
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Auto-report position with M154 S<seconds>
|
||||
*/
|
||||
//#define AUTO_REPORT_POSITION
|
||||
#if ENABLED(AUTO_REPORT_POSITION)
|
||||
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Include capabilities in M115 output
|
||||
*/
|
||||
#define EXTENDED_CAPABILITIES_REPORT
|
||||
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
||||
//#define M115_GEOMETRY_REPORT
|
||||
#endif
|
||||
|
||||
// @section security
|
||||
|
||||
/**
|
||||
@@ -3802,19 +3871,57 @@
|
||||
* Use 'M200 [T<extruder>] L<limit>' to override and 'M502' to reset.
|
||||
* A non-zero value activates Volume-based Extrusion Limiting.
|
||||
*/
|
||||
#define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 // (mm^3/sec)
|
||||
#define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 // (mm^3/sec)
|
||||
#define VOLUMETRIC_EXTRUDER_LIMIT_MAX 20 // (mm^3/sec)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// @section reporting
|
||||
|
||||
// Extra options for the M114 "Current Position" report
|
||||
/**
|
||||
* Extra options for the M114 "Current Position" report
|
||||
*/
|
||||
//#define M114_DETAIL // Use 'M114` for details to check planner calculations
|
||||
//#define M114_REALTIME // Real current position based on forward kinematics
|
||||
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
|
||||
|
||||
/**
|
||||
* Auto-report fan speed with M123 S<seconds>
|
||||
* Requires fans with tachometer pins
|
||||
*/
|
||||
//#define AUTO_REPORT_FANS
|
||||
|
||||
//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)
|
||||
|
||||
/**
|
||||
* Auto-report temperatures with M155 S<seconds>
|
||||
*/
|
||||
#define AUTO_REPORT_TEMPERATURES
|
||||
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
|
||||
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Auto-report position with M154 S<seconds>
|
||||
*/
|
||||
//#define AUTO_REPORT_POSITION
|
||||
#if ENABLED(AUTO_REPORT_POSITION)
|
||||
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M115 - Report capabilites. Disable to save ~1150 bytes of flash.
|
||||
* Some hosts (and serial TFT displays) rely on this feature.
|
||||
*/
|
||||
#define CAPABILITIES_REPORT
|
||||
#if ENABLED(CAPABILITIES_REPORT)
|
||||
// Include capabilities in M115 output
|
||||
#define EXTENDED_CAPABILITIES_REPORT
|
||||
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
||||
//#define M115_GEOMETRY_REPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// @section gcode
|
||||
|
||||
/**
|
||||
@@ -3826,7 +3933,9 @@
|
||||
//#define GCODE_QUOTED_STRINGS // Support for quoted string parameters
|
||||
#endif
|
||||
|
||||
// Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
|
||||
/**
|
||||
* Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
|
||||
*/
|
||||
//#define MEATPACK_ON_SERIAL_PORT_1
|
||||
//#define MEATPACK_ON_SERIAL_PORT_2
|
||||
|
||||
@@ -3834,6 +3943,12 @@
|
||||
|
||||
//#define REPETIER_GCODE_M360 // Add commands originally from Repetier FW
|
||||
|
||||
/**
|
||||
* Enable M111 debug flags 1=ECHO, 2=INFO, 4=ERRORS (unimplemented).
|
||||
* Disable to save some flash. Some hosts (Repetier Host) may rely on this feature.
|
||||
*/
|
||||
#define DEBUG_FLAGS_GCODE
|
||||
|
||||
/**
|
||||
* Enable this option for a leaner build of Marlin that removes
|
||||
* workspace offsets to slightly optimize performance.
|
||||
@@ -3861,8 +3976,6 @@
|
||||
//#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
|
||||
#endif
|
||||
|
||||
// @section gcode
|
||||
|
||||
/**
|
||||
* Startup commands
|
||||
*
|
||||
@@ -4194,6 +4307,8 @@
|
||||
// row. By default idle() is profiled so this shows how "idle" the processor is.
|
||||
// See class CodeProfiler.
|
||||
//#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multi-stepping 1 to 128 on this LED matrix row.
|
||||
//#define MAX7219_DEBUG_SLOWDOWN 6 // Count (mod 16) how many times SLOWDOWN has reduced print speed.
|
||||
//#define MAX7219_REINIT_ON_POWERUP // Re-initialize MAX7129 when power supply turns on
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -4218,13 +4333,17 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* WiFi Support (Espressif ESP32 WiFi)
|
||||
* Native ESP32 board with WiFi or add-on ESP32 WiFi-101 module
|
||||
*/
|
||||
//#define WIFISUPPORT // Marlin embedded WiFi management
|
||||
//#define WIFISUPPORT // Marlin embedded WiFi management. Not needed for simple WiFi serial port.
|
||||
//#define ESP3D_WIFISUPPORT // ESP3D Library WiFi management (https://github.com/luc-github/ESP3DLib)
|
||||
|
||||
#if ANY(WIFISUPPORT, ESP3D_WIFISUPPORT)
|
||||
//#define WEBSUPPORT // Start a webserver (which may include auto-discovery)
|
||||
/**
|
||||
* Extras for an ESP32-based motherboard with WIFISUPPORT
|
||||
* These options don't apply to add-on WiFi modules based on ESP32 WiFi101.
|
||||
*/
|
||||
#if ENABLED(WIFISUPPORT)
|
||||
//#define WEBSUPPORT // Start a webserver (which may include auto-discovery) using SPIFFS
|
||||
//#define OTASUPPORT // Support over-the-air firmware updates
|
||||
//#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host
|
||||
|
||||
@@ -4406,3 +4525,6 @@
|
||||
|
||||
// Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR.
|
||||
//#define OPTIBOOT_RESET_REASON
|
||||
|
||||
// Shrink the build for smaller boards by sacrificing some serial feedback
|
||||
//#define MARLIN_SMALL_BUILD
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Marlin Firmware
|
||||
|
||||
(c) 2011-2020 MarlinFirmware
|
||||
(c) 2011-2024 MarlinFirmware
|
||||
Portions of Marlin are (c) by their respective authors.
|
||||
All code complies with GPLv2 and/or GPLv3
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
//#define STRING_DISTRIBUTION_DATE "2023-08-04"
|
||||
//#define STRING_DISTRIBUTION_DATE "2024-04-08"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
|
||||
@@ -3,10 +3,50 @@
|
||||
# config.ini - Options to apply before the build
|
||||
#
|
||||
[config:base]
|
||||
#
|
||||
# ini_use_config - A comma-separated list of actions to apply to the Configuration files.
|
||||
# The actions will be applied in the listed order.
|
||||
# - none
|
||||
# Ignore this file and don't apply any configuration options
|
||||
#
|
||||
# - base
|
||||
# Just apply the options in config:base to the configuration
|
||||
#
|
||||
# - minimal
|
||||
# Just apply the options in config:minimal to the configuration
|
||||
#
|
||||
# - all
|
||||
# Apply all 'config:*' sections in this file to the configuration
|
||||
#
|
||||
# - another.ini
|
||||
# Load another INI file with a path relative to this config.ini file (i.e., within Marlin/)
|
||||
#
|
||||
# - https://me.myserver.com/path/to/configs
|
||||
# Fetch configurations from any URL.
|
||||
#
|
||||
# - example/Creality/Ender-5 Plus @ bugfix-2.1.x
|
||||
# Fetch example configuration files from the MarlinFirmware/Configurations repository
|
||||
# https://raw.githubusercontent.com/MarlinFirmware/Configurations/bugfix-2.1.x/config/examples/Creality/Ender-5%20Plus/
|
||||
#
|
||||
# - example/default @ release-2.0.9.7
|
||||
# Fetch default configuration files from the MarlinFirmware/Configurations repository
|
||||
# https://raw.githubusercontent.com/MarlinFirmware/Configurations/release-2.0.9.7/config/default/
|
||||
#
|
||||
# - [disable]
|
||||
# Comment out all #defines in both Configuration.h and Configuration_adv.h. This is useful
|
||||
# to start with a clean slate before applying any config: options, so only the options explicitly
|
||||
# set in config.ini will be enabled in the configuration.
|
||||
#
|
||||
# - [flatten] (Not yet implemented)
|
||||
# Produce a flattened set of Configuration.h and Configuration_adv.h files with only the enabled
|
||||
# #defines and no comments. A clean look, but context-free.
|
||||
#
|
||||
ini_use_config = none
|
||||
|
||||
# Load all config: sections in this file
|
||||
;ini_use_config = all
|
||||
# Disable everything and apply subsequent config:base options
|
||||
;ini_use_config = [disable], base
|
||||
# Load config file relative to Marlin/
|
||||
;ini_use_config = another.ini
|
||||
# Download configurations from GitHub
|
||||
|
||||
@@ -81,6 +81,12 @@ void MarlinHAL::init() {
|
||||
#if HAS_SERVO_3
|
||||
OUT_WRITE(SERVO3_PIN, LOW);
|
||||
#endif
|
||||
#if HAS_SERVO_4
|
||||
OUT_WRITE(SERVO4_PIN, LOW);
|
||||
#endif
|
||||
#if HAS_SERVO_5
|
||||
OUT_WRITE(SERVO5_PIN, LOW);
|
||||
#endif
|
||||
|
||||
init_pwm_timers(); // Init user timers to default frequency - 1000HZ
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -119,7 +119,6 @@ void spiBegin() {
|
||||
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
|
||||
}
|
||||
|
||||
|
||||
/** begin spi transaction */
|
||||
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) {
|
||||
// Based on Arduino SPI library
|
||||
@@ -175,7 +174,6 @@ void spiBegin() {
|
||||
SPSR = clockDiv | 0x01;
|
||||
}
|
||||
|
||||
|
||||
#else // SOFTWARE_SPI || FORCE_SOFT_SPI
|
||||
|
||||
// ------------------------
|
||||
|
||||
@@ -37,10 +37,6 @@
|
||||
#include "../../core/types.h"
|
||||
#include "../../core/serial_hook.h"
|
||||
|
||||
#ifndef SERIAL_PORT
|
||||
#define SERIAL_PORT 0
|
||||
#endif
|
||||
|
||||
#ifndef USBCON
|
||||
|
||||
// The presence of the UBRRH register is used to detect a UART.
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
|
||||
static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval)
|
||||
|
||||
|
||||
/************ static functions common to all instances ***********************/
|
||||
|
||||
static inline void handle_interrupts(const timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) {
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
|
||||
#endif
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
|
||||
bool PersistentStore::access_start() { return true; }
|
||||
bool PersistentStore::access_finish() { return true; }
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
uint16_t written = 0;
|
||||
while (size--) {
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
|
||||
uint8_t v = *value;
|
||||
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
|
||||
eeprom_write_byte(p, v);
|
||||
@@ -61,7 +61,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
do {
|
||||
uint8_t c = eeprom_read_byte((uint8_t*)pos);
|
||||
const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
|
||||
@@ -91,7 +91,6 @@ void endstop_ISR() { endstops.update(); }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// Install Pin change interrupt for a pin. Can be called multiple times.
|
||||
void pciSetup(const int8_t pin) {
|
||||
if (digitalPinHasPCICR(pin)) {
|
||||
|
||||
@@ -679,7 +679,6 @@
|
||||
#define PF7_PWM 0
|
||||
#define PF7_DDR DDRF
|
||||
|
||||
|
||||
/**
|
||||
* Some of the pin mapping functions of the Teensduino extension to the Arduino IDE
|
||||
* do not function the same as the other Arduino extensions.
|
||||
|
||||
@@ -20,3 +20,7 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifndef SERIAL_PORT
|
||||
#define SERIAL_PORT 0
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -163,7 +163,6 @@ bool pwm_status(uint8_t pin) {
|
||||
SERIAL_ECHO_SP(2);
|
||||
} // pwm_status
|
||||
|
||||
|
||||
const volatile uint8_t* const PWM_other[][3] PROGMEM = {
|
||||
{ &TCCR0A, &TCCR0B, &TIMSK0 },
|
||||
{ &TCCR1A, &TCCR1B, &TIMSK1 },
|
||||
@@ -181,7 +180,6 @@ const volatile uint8_t* const PWM_other[][3] PROGMEM = {
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
|
||||
|
||||
#ifdef TIMER0A
|
||||
@@ -217,7 +215,6 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#define TCCR_A(T) pgm_read_word(&PWM_other[T][0])
|
||||
#define TCCR_B(T) pgm_read_word(&PWM_other[T][1])
|
||||
#define TIMSK(T) pgm_read_word(&PWM_other[T][2])
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* AVR LCD-specific defines
|
||||
*/
|
||||
|
||||
uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
|
||||
#define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_AVR_sw_sp_fn
|
||||
@@ -120,7 +120,6 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) {
|
||||
U8G_ATOMIC_END();
|
||||
}
|
||||
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_3
|
||||
#else
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
#if ANY(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI)
|
||||
#if ANY(SOFTWARE_SPI, FORCE_SOFT_SPI)
|
||||
|
||||
// ------------------------
|
||||
// Software SPI
|
||||
|
||||
@@ -474,7 +474,6 @@ void MarlinSerial<Cfg>::flushTX() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If not using the USB port as serial port
|
||||
#if defined(SERIAL_PORT) && SERIAL_PORT >= 0
|
||||
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT> >;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
|
||||
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -959,14 +958,14 @@ static void ee_Init() {
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
|
||||
#endif
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
|
||||
bool PersistentStore::access_start() { ee_Init(); return true; }
|
||||
bool PersistentStore::access_finish() { ee_Flush(); return true; }
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
uint16_t written = 0;
|
||||
while (size--) {
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
|
||||
uint8_t v = *value;
|
||||
if (v != ee_Read(uint32_t(p))) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
|
||||
ee_Write(uint32_t(p), v);
|
||||
@@ -985,7 +984,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
do {
|
||||
uint8_t c = ee_Read(uint32_t(pos));
|
||||
uint8_t c = ee_Read(uint32_t(REAL_EEPROM_ADDR(pos)));
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
|
||||
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -37,14 +36,14 @@
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
|
||||
#endif
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
|
||||
bool PersistentStore::access_start() { eeprom_init(); return true; }
|
||||
bool PersistentStore::access_finish() { return true; }
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
uint16_t written = 0;
|
||||
while (size--) {
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
|
||||
uint8_t v = *value;
|
||||
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
|
||||
eeprom_write_byte(p, v);
|
||||
@@ -63,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
do {
|
||||
uint8_t c = eeprom_read_byte((uint8_t*)pos);
|
||||
const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
|
||||
@@ -49,7 +49,6 @@ extern volatile uint32_t *SODR_A, *SODR_B, *CODR_A, *CODR_B;
|
||||
|
||||
#define PWM_MAP_INIT_ROW(IO,ZZ) { ZZ == 'A' ? SODR_A : SODR_B, ZZ == 'A' ? CODR_A : CODR_B, 1 << _PIN(IO) }
|
||||
|
||||
|
||||
#define PWM_MAP_INIT { PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_X_PIN, 'B'), \
|
||||
PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Y_PIN, 'B'), \
|
||||
PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Z_PIN, 'B'), \
|
||||
|
||||
@@ -168,7 +168,6 @@ const G2_PinDescription G2_g_APinDescription[] = {
|
||||
{ PIOB, PIO_PB21, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 52
|
||||
{ PIOB, PIO_PB14, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 53
|
||||
|
||||
|
||||
// 54 .. 65 - Analog pins
|
||||
// ----------------------
|
||||
{ PIOA, PIO_PA16X1_AD7, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC7, NOT_ON_PWM, NOT_ON_TIMER }, // AD0
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -72,10 +72,10 @@
|
||||
|
||||
#if HAS_MEDIA && HAS_DRIVER(TMC2130)
|
||||
#if ENABLED(TMC_USE_SW_SPI)
|
||||
#if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
|
||||
#if DISABLED(SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
|
||||
#error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."
|
||||
#endif
|
||||
#elif ENABLED(DUE_SOFTWARE_SPI)
|
||||
#elif ENABLED(SOFTWARE_SPI)
|
||||
#error "DUE software SPI is required but is incompatible with TMC2130 hardware SPI. Enable TMC_USE_SW_SPI to fix."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#define SD_MOSI_PIN 75
|
||||
#else
|
||||
// defaults
|
||||
#define DUE_SOFTWARE_SPI
|
||||
#define SOFTWARE_SPI
|
||||
#ifndef SD_SCK_PIN
|
||||
#define SD_SCK_PIN 52
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* DUE (SAM3X8E) LCD-specific defines
|
||||
*/
|
||||
|
||||
uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
|
||||
uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
|
||||
uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
|
||||
|
||||
#define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_DUE_sw_spi_fn
|
||||
#define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn
|
||||
#define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_DUE_ST7920_sw_spi_fn
|
||||
@@ -0,0 +1,29 @@
|
||||
# USB Files Source Documentation
|
||||
|
||||
## Source
|
||||
|
||||
We sourced the USB files in Marlin from the Atmel ASF (Advanced Software Framework). The framework provides a variety of examples which were utilized in this project.
|
||||
|
||||
Atmel doesn't provide these files in a source repository but they can be extracted from ASF, which can be downloaded from Atmel.
|
||||
|
||||
[Advanced Software Framework](https://www.microchip.com/en-us/tools-resources/develop/libraries/advanced-software-framework)
|
||||
|
||||
## Modifications
|
||||
|
||||
The files are mostly unmodified except for minor cosmetic changes but some more significant changes were needed.
|
||||
|
||||
The changes that prompted the addition of this README file are listed below. Other changes may have been made prior to this.
|
||||
|
||||
1. Modified `uotghs_device_due.c` to resolve race conditions that could leave interrupts asserted when freezing the peripheral clock, resulting in hangs and watchdog resets due to the ensuing interrupt storm.
|
||||
|
||||
## Version Information
|
||||
|
||||
We don't know the exact version of ASF used as the source. However, the copyright information in the files indicates they are from 2015.
|
||||
|
||||
## Upgrade Considerations
|
||||
|
||||
We looked at the ASF 3.52.0 files released in 2022 but saw no immediate benefits to justify an upgrade. It's important to note that the files in Marlin don't follow the same folder structure as the files in ASF, which complicates the process of comparing and applying updated files.
|
||||
|
||||
When these files are updated it's important to carefully compare them to Marlin's versions so any improvements in the Marlin sources are brought forward.
|
||||
|
||||
It would be best to make Marlin's directory structure align with ASF or at least document the source of each file to ease future updates.
|
||||
@@ -142,7 +142,6 @@
|
||||
*/
|
||||
#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack())
|
||||
|
||||
|
||||
/**
|
||||
* \brief Set aligned boundary.
|
||||
*/
|
||||
@@ -283,7 +282,6 @@ typedef double F64; //!< 64-bit floating-point number.
|
||||
typedef uint32_t iram_size_t;
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \name Status Types
|
||||
*/
|
||||
//! @{
|
||||
@@ -291,7 +289,6 @@ typedef bool Status_bool_t; //!< Boolean status.
|
||||
typedef U8 Status_t; //!< 8-bit-coded status.
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \name Aliasing Aggregate Types
|
||||
*/
|
||||
//! @{
|
||||
@@ -462,7 +459,6 @@ typedef struct
|
||||
#endif
|
||||
//! @}
|
||||
|
||||
|
||||
#ifndef __ASSEMBLY__ // not for assembling.
|
||||
|
||||
//! \name Optimization Control
|
||||
@@ -581,7 +577,6 @@ typedef struct
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \name Zero-Bit Counting
|
||||
*
|
||||
* Under GCC, __builtin_clz and __builtin_ctz behave like macros when
|
||||
@@ -692,7 +687,6 @@ typedef struct
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \name Bit Reversing
|
||||
*/
|
||||
//! @{
|
||||
@@ -732,7 +726,6 @@ typedef struct
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \name Alignment
|
||||
*/
|
||||
//! @{
|
||||
@@ -798,7 +791,6 @@ typedef struct
|
||||
*/
|
||||
#define Long_call(addr) ((*(void (*)(void))(addr))())
|
||||
|
||||
|
||||
/*! \name MCU Endianism Handling
|
||||
* ARM is MCU little endianism.
|
||||
*/
|
||||
@@ -868,7 +860,6 @@ typedef struct
|
||||
#define CPU_TO_BE32(x) swap32(x)
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \name Endianism Conversion
|
||||
*
|
||||
* The same considerations as for clz and ctz apply here but GCC's
|
||||
@@ -955,7 +946,6 @@ typedef struct
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \name Target Abstraction
|
||||
*/
|
||||
//! @{
|
||||
@@ -997,7 +987,6 @@ typedef U8 Byte; //!< 8-bit unsigned integer.
|
||||
|
||||
#endif // #ifndef __ASSEMBLY__
|
||||
|
||||
|
||||
#ifdef __ICCARM__
|
||||
#define SHORTENUM __packed
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
#define LUN_0_NAME "\"SD/MMC Card\""
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \name Actions Associated with Memory Accesses
|
||||
*
|
||||
* Write here the action to associate with each memory access.
|
||||
@@ -112,5 +111,4 @@
|
||||
#define GLOBAL_WR_PROTECT false //!< Management of a global write protection.
|
||||
//! @}
|
||||
|
||||
|
||||
#endif // _CONF_ACCESS_H_
|
||||
|
||||
@@ -96,5 +96,4 @@
|
||||
// - UPLL frequency: 480MHz
|
||||
// - USB clock: 480 / 1 = 480MHz
|
||||
|
||||
|
||||
#endif /* CONF_CLOCK_H_INCLUDED */
|
||||
|
||||
@@ -88,7 +88,6 @@
|
||||
#endif
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* USB Device Callbacks definitions (Optional)
|
||||
* @{
|
||||
@@ -150,7 +149,6 @@
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* USB Interface Configuration
|
||||
* @{
|
||||
@@ -210,7 +208,6 @@
|
||||
//@}
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* Configuration of MSC interface
|
||||
* @{
|
||||
@@ -245,7 +242,6 @@
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* Description of Composite Device
|
||||
* @{
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
#endif
|
||||
#include "ctrl_access.h"
|
||||
|
||||
|
||||
//_____ D E F I N I T I O N S ______________________________________________
|
||||
|
||||
#ifdef FREERTOS_USED
|
||||
@@ -112,7 +111,6 @@ static xSemaphoreHandle ctrl_access_semphr = NULL;
|
||||
|
||||
#endif // FREERTOS_USED
|
||||
|
||||
|
||||
#if MAX_LUN
|
||||
|
||||
/*! \brief Initializes an entry of the LUN descriptor table.
|
||||
@@ -242,17 +240,14 @@ static const struct
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if GLOBAL_WR_PROTECT == true
|
||||
bool g_wr_protect;
|
||||
#endif
|
||||
|
||||
|
||||
/*! \name Control Interface
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
#ifdef FREERTOS_USED
|
||||
|
||||
bool ctrl_access_init(void)
|
||||
@@ -270,7 +265,6 @@ bool ctrl_access_init(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*! \brief Locks accesses to LUNs.
|
||||
*
|
||||
* \return \c true if the access was successfully locked, else \c false.
|
||||
@@ -288,7 +282,6 @@ static bool ctrl_access_lock(void)
|
||||
|
||||
#endif // FREERTOS_USED
|
||||
|
||||
|
||||
U8 get_nb_lun(void)
|
||||
{
|
||||
#if MEM_USB == ENABLE
|
||||
@@ -309,13 +302,11 @@ U8 get_nb_lun(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
U8 get_cur_lun(void)
|
||||
{
|
||||
return LUN_ID_0;
|
||||
}
|
||||
|
||||
|
||||
Ctrl_status mem_test_unit_ready(U8 lun)
|
||||
{
|
||||
Ctrl_status status;
|
||||
@@ -337,7 +328,6 @@ Ctrl_status mem_test_unit_ready(U8 lun)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector)
|
||||
{
|
||||
Ctrl_status status;
|
||||
@@ -359,7 +349,6 @@ Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
U8 mem_sector_size(U8 lun)
|
||||
{
|
||||
U8 sector_size;
|
||||
@@ -381,7 +370,6 @@ U8 mem_sector_size(U8 lun)
|
||||
return sector_size;
|
||||
}
|
||||
|
||||
|
||||
bool mem_unload(U8 lun, bool unload)
|
||||
{
|
||||
bool unloaded;
|
||||
@@ -433,7 +421,6 @@ bool mem_wr_protect(U8 lun)
|
||||
return wr_protect;
|
||||
}
|
||||
|
||||
|
||||
bool mem_removal(U8 lun)
|
||||
{
|
||||
bool removal;
|
||||
@@ -458,7 +445,6 @@ bool mem_removal(U8 lun)
|
||||
return removal;
|
||||
}
|
||||
|
||||
|
||||
const char *mem_name(U8 lun)
|
||||
{
|
||||
#if MAX_LUN==0
|
||||
@@ -475,17 +461,14 @@ const char *mem_name(U8 lun)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
#if ACCESS_USB == true
|
||||
|
||||
/*! \name MEM <-> USB Interface
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector)
|
||||
{
|
||||
Ctrl_status status;
|
||||
@@ -505,7 +488,6 @@ Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector)
|
||||
{
|
||||
Ctrl_status status;
|
||||
@@ -525,19 +507,16 @@ Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // ACCESS_USB == true
|
||||
|
||||
|
||||
#if ACCESS_MEM_TO_RAM == true
|
||||
|
||||
/*! \name MEM <-> RAM Interface
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram)
|
||||
{
|
||||
Ctrl_status status;
|
||||
@@ -564,7 +543,6 @@ Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram)
|
||||
{
|
||||
Ctrl_status status;
|
||||
@@ -591,19 +569,16 @@ Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // ACCESS_MEM_TO_RAM == true
|
||||
|
||||
|
||||
#if ACCESS_STREAM == true
|
||||
|
||||
/*! \name Streaming MEM <-> MEM Interface
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
#if ACCESS_MEM_TO_MEM == true
|
||||
|
||||
#include "fat.h"
|
||||
@@ -625,21 +600,18 @@ Ctrl_status stream_mem_to_mem(U8 src_lun, U32 src_addr, U8 dest_lun, U32 dest_ad
|
||||
|
||||
#endif // ACCESS_MEM_TO_MEM == true
|
||||
|
||||
|
||||
Ctrl_status stream_state(U8 id)
|
||||
{
|
||||
UNUSED(id);
|
||||
return CTRL_GOOD;
|
||||
}
|
||||
|
||||
|
||||
U16 stream_stop(U8 id)
|
||||
{
|
||||
UNUSED(id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // ACCESS_STREAM
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
* Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CTRL_ACCESS_H_
|
||||
#define _CTRL_ACCESS_H_
|
||||
|
||||
@@ -89,7 +88,6 @@ typedef enum
|
||||
CTRL_BUSY = FAIL + 2 //!< Memory not initialized or changed.
|
||||
} Ctrl_status;
|
||||
|
||||
|
||||
// FYI: Each Logical Unit Number (LUN) corresponds to a memory.
|
||||
|
||||
// Check LUN defines.
|
||||
@@ -136,7 +134,6 @@ typedef enum
|
||||
#define LUN_ID_USB (MAX_LUN) //!< First dynamic LUN (USB host mass storage).
|
||||
//! @}
|
||||
|
||||
|
||||
// Include LUN header files.
|
||||
#if LUN_0 == ENABLE
|
||||
#include LUN_0_INCLUDE
|
||||
@@ -166,13 +163,11 @@ typedef enum
|
||||
#include LUN_USB_INCLUDE
|
||||
#endif
|
||||
|
||||
|
||||
// Check the configuration of write protection in conf_access.h.
|
||||
#ifndef GLOBAL_WR_PROTECT
|
||||
#error GLOBAL_WR_PROTECT must be defined as true or false in conf_access.h
|
||||
#endif
|
||||
|
||||
|
||||
#if GLOBAL_WR_PROTECT == true
|
||||
|
||||
//! Write protect.
|
||||
@@ -180,7 +175,6 @@ extern bool g_wr_protect;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*! \name Control Interface
|
||||
*/
|
||||
//! @{
|
||||
@@ -279,7 +273,6 @@ extern const char *mem_name(U8 lun);
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
#if ACCESS_USB == true
|
||||
|
||||
/*! \name MEM <-> USB Interface
|
||||
@@ -310,7 +303,6 @@ extern Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector);
|
||||
|
||||
#endif // ACCESS_USB == true
|
||||
|
||||
|
||||
#if ACCESS_MEM_TO_RAM == true
|
||||
|
||||
/*! \name MEM <-> RAM Interface
|
||||
@@ -341,7 +333,6 @@ extern Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram);
|
||||
|
||||
#endif // ACCESS_MEM_TO_RAM == true
|
||||
|
||||
|
||||
#if ACCESS_STREAM == true
|
||||
|
||||
/*! \name Streaming MEM <-> MEM Interface
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
|
||||
#include "preprocessor.h"
|
||||
|
||||
|
||||
//! Maximal number of repetitions supported by MREPEAT.
|
||||
#define MREPEAT_LIMIT 256
|
||||
|
||||
|
||||
@@ -128,7 +128,6 @@ static inline void osc_enable(uint32_t ul_id) {
|
||||
pmc_switch_sclk_to_32kxtal(PMC_OSC_BYPASS);
|
||||
break;
|
||||
|
||||
|
||||
case OSC_MAINCK_4M_RC:
|
||||
pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_4_MHz);
|
||||
break;
|
||||
@@ -141,7 +140,6 @@ static inline void osc_enable(uint32_t ul_id) {
|
||||
pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_12_MHz);
|
||||
break;
|
||||
|
||||
|
||||
case OSC_MAINCK_XTAL:
|
||||
pmc_switch_mainck_to_xtal(PMC_OSC_XTAL/*,
|
||||
pmc_us_to_moscxtst(BOARD_OSC_STARTUP_US,
|
||||
|
||||
@@ -51,5 +51,4 @@
|
||||
#include "stringz.h"
|
||||
#include "mrepeat.h"
|
||||
|
||||
|
||||
#endif // _PREPROCESSOR_H_
|
||||
|
||||
@@ -86,7 +86,6 @@ enum scsi_sbc_mode {
|
||||
SCSI_MS_MODE_CACHING = 0x08, //!< Caching mode page
|
||||
};
|
||||
|
||||
|
||||
//! \name SBC-2 Device-Specific Parameter
|
||||
//@{
|
||||
#define SCSI_MS_SBC_WP 0x80 //!< Write Protected
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
* Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SD_MMC_SPI_MEM_H_
|
||||
#define _SD_MMC_SPI_MEM_H_
|
||||
|
||||
@@ -63,17 +62,14 @@
|
||||
#error sd_mmc_spi_mem.h is #included although SD_MMC_SPI_MEM is disabled
|
||||
#endif
|
||||
|
||||
|
||||
#include "ctrl_access.h"
|
||||
|
||||
|
||||
//_____ D E F I N I T I O N S ______________________________________________
|
||||
|
||||
#define SD_MMC_REMOVED 0
|
||||
#define SD_MMC_INSERTED 1
|
||||
#define SD_MMC_REMOVING 2
|
||||
|
||||
|
||||
//---- CONTROL FUNCTIONS ----
|
||||
//!
|
||||
//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
|
||||
@@ -133,7 +129,6 @@ extern bool sd_mmc_spi_wr_protect(void);
|
||||
//!
|
||||
extern bool sd_mmc_spi_removal(void);
|
||||
|
||||
|
||||
//---- ACCESS DATA FUNCTIONS ----
|
||||
|
||||
#if ACCESS_USB == true
|
||||
|
||||
@@ -212,7 +212,6 @@ extern "C" {
|
||||
#define CONFIG_USBCLK_DIV
|
||||
#endif
|
||||
|
||||
|
||||
extern void sysclk_enable_usb(void);
|
||||
extern void sysclk_disable_usb(void);
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ static usb_iface_desc_t UDC_DESC_STORAGE *udc_ptr_iface;
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
//! \name Internal structure to store the USB device main strings
|
||||
//! @{
|
||||
|
||||
|
||||
@@ -685,6 +685,4 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
|
||||
} \endcode
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#endif // _UDC_H_
|
||||
|
||||
@@ -213,7 +213,6 @@ void udd_send_remotewakeup(void);
|
||||
*/
|
||||
void udd_set_setup_payload( uint8_t *payload, uint16_t payload_size );
|
||||
|
||||
|
||||
/**
|
||||
* \name Endpoint Management
|
||||
*
|
||||
|
||||
@@ -457,7 +457,6 @@ void udi_cdc_data_sof_notify(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// ------------------------
|
||||
//------- Internal routines to control serial line
|
||||
|
||||
@@ -520,7 +519,6 @@ static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask)
|
||||
udi_cdc_ctrl_state_notify(port, ep_comm);
|
||||
}
|
||||
|
||||
|
||||
static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep)
|
||||
{
|
||||
#if UDI_CDC_PORT_NB == 1 // To optimize code
|
||||
@@ -542,7 +540,6 @@ static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
|
||||
{
|
||||
uint8_t port;
|
||||
@@ -578,11 +575,9 @@ static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n,
|
||||
udi_cdc_ctrl_state_notify(port, ep);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------
|
||||
//------- Internal routines to process data transfer
|
||||
|
||||
|
||||
static bool udi_cdc_rx_start(uint8_t port)
|
||||
{
|
||||
irqflags_t flags;
|
||||
@@ -632,7 +627,6 @@ static bool udi_cdc_rx_start(uint8_t port)
|
||||
udi_cdc_data_received);
|
||||
}
|
||||
|
||||
|
||||
static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
|
||||
{
|
||||
uint8_t buf_sel_trans;
|
||||
@@ -668,7 +662,6 @@ static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_
|
||||
udi_cdc_rx_start(port);
|
||||
}
|
||||
|
||||
|
||||
static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
|
||||
{
|
||||
uint8_t port;
|
||||
@@ -700,7 +693,6 @@ static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t
|
||||
udi_cdc_tx_send(port);
|
||||
}
|
||||
|
||||
|
||||
static void udi_cdc_tx_send(uint8_t port)
|
||||
{
|
||||
irqflags_t flags;
|
||||
@@ -780,11 +772,9 @@ static void udi_cdc_tx_send(uint8_t port)
|
||||
udi_cdc_data_sent);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------
|
||||
//------- Application interface
|
||||
|
||||
|
||||
//------- Application interface
|
||||
|
||||
void udi_cdc_ctrl_signal_dcd(bool b_set)
|
||||
|
||||
@@ -106,7 +106,6 @@ typedef struct {
|
||||
usb_ep_desc_t ep_notify;
|
||||
} udi_cdc_comm_desc_t;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Data Class interface descriptor
|
||||
*
|
||||
@@ -121,7 +120,6 @@ typedef struct {
|
||||
usb_ep_desc_t ep_out;
|
||||
} udi_cdc_data_desc_t;
|
||||
|
||||
|
||||
//! CDC communication endpoints size for all speeds
|
||||
#define UDI_CDC_COMM_EP_SIZE 64
|
||||
//! CDC data endpoints size for FS speed (8B, 16B, 32B, 64B)
|
||||
|
||||
@@ -109,7 +109,6 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {
|
||||
.bNumConfigurations = 1
|
||||
};
|
||||
|
||||
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
//! USB Device Qualifier Descriptor for HS
|
||||
COMPILER_WORD_ALIGNED
|
||||
|
||||
@@ -93,7 +93,6 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {
|
||||
.bNumConfigurations = 1
|
||||
};
|
||||
|
||||
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
//! USB Device Qualifier Descriptor for HS
|
||||
COMPILER_WORD_ALIGNED
|
||||
@@ -147,7 +146,6 @@ UDC_DESC_STORAGE udc_desc_t udc_desc_hs = {
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* \name UDC structures which contains all USB Device definitions
|
||||
*/
|
||||
|
||||
@@ -86,7 +86,6 @@ UDC_DESC_STORAGE udi_api_t udi_api_msc = {
|
||||
};
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup udi_msc_group
|
||||
* \defgroup udi_msc_group_internal Implementation of UDI MSC
|
||||
@@ -137,7 +136,6 @@ volatile bool udi_msc_b_reset_trans = true;
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \name Internal routines
|
||||
*/
|
||||
@@ -190,7 +188,6 @@ static void udi_msc_cbw_received(udd_ep_status_t status,
|
||||
static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag);
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \name Routines to process small data packet
|
||||
*/
|
||||
@@ -217,7 +214,6 @@ static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent,
|
||||
udd_ep_id_t ep);
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \name Routines to process CSW packet
|
||||
*/
|
||||
@@ -250,7 +246,6 @@ static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent,
|
||||
udd_ep_id_t ep);
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \name Routines manage sense data
|
||||
*/
|
||||
@@ -307,7 +302,6 @@ static void udi_msc_sense_fail_cdb_invalid(void);
|
||||
static void udi_msc_sense_command_invalid(void);
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \name Routines manage SCSI Commands
|
||||
*/
|
||||
|
||||
@@ -116,6 +116,23 @@
|
||||
//#define dbg_print printf
|
||||
#define dbg_print(...)
|
||||
|
||||
// Marlin modification: Redefine the otg_freeze_clock and otg_unfreeze_clock macros
|
||||
// to add memory barriers to ensure that any accesses to USB registers aren't re-ordered
|
||||
// to occur while the clock is frozen.
|
||||
#undef otg_freeze_clock
|
||||
#undef otg_unfreeze_clock
|
||||
|
||||
#define otg_freeze_clock() do { \
|
||||
__DSB(); \
|
||||
Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK); \
|
||||
} while (0)
|
||||
|
||||
#define otg_unfreeze_clock() \
|
||||
do { \
|
||||
Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK); \
|
||||
__DSB(); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* \ingroup udd_group
|
||||
* \defgroup udd_udphs_group USB On-The-Go High-Speed Port for device mode (UOTGHS)
|
||||
@@ -276,7 +293,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* \name Power management routine.
|
||||
*/
|
||||
@@ -293,7 +309,6 @@ static bool udd_b_idle;
|
||||
//! State of sleep manager
|
||||
static bool udd_b_sleep_initialized = false;
|
||||
|
||||
|
||||
/*! \brief Authorize or not the CPU powerdown mode
|
||||
*
|
||||
* \param b_enable true to authorize idle mode
|
||||
@@ -321,7 +336,6 @@ static void udd_sleep_mode(bool b_idle)
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \name Control endpoint low level management routine.
|
||||
*
|
||||
@@ -393,7 +407,6 @@ static void udd_ctrl_send_zlp_out(void);
|
||||
//! \brief Call callback associated to setup request
|
||||
static void udd_ctrl_endofrequest(void);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Main interrupt routine for control endpoint
|
||||
*
|
||||
@@ -405,7 +418,6 @@ static bool udd_ctrl_interrupt(void);
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \name Management of bulk/interrupt/isochronous endpoints
|
||||
*
|
||||
@@ -443,7 +455,6 @@ typedef struct {
|
||||
uint8_t stall_requested:1;
|
||||
} udd_ep_job_t;
|
||||
|
||||
|
||||
//! Array to register a job on bulk/interrupt/isochronous endpoint
|
||||
static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP];
|
||||
|
||||
@@ -505,7 +516,6 @@ static bool udd_ep_interrupt(void);
|
||||
#endif // (0!=USB_DEVICE_MAX_EP)
|
||||
//@}
|
||||
|
||||
|
||||
// ------------------------
|
||||
//--- INTERNAL ROUTINES TO MANAGED GLOBAL EVENTS
|
||||
|
||||
@@ -611,6 +621,18 @@ ISR(UDD_USB_INT_FUN)
|
||||
// The wakeup interrupt is automatic acked when a suspend occur
|
||||
udd_disable_wake_up_interrupt();
|
||||
udd_enable_suspend_interrupt();
|
||||
|
||||
// Marlin modification: The RESET, SOF, and MSOF interrupts were previously
|
||||
// enabled in udd_attach, which caused a race condition where they could
|
||||
// be raised and unclearable with the clock is frozen. They are now
|
||||
// enabled here, after the clock has been unfrozen in response to the wake
|
||||
// interrupt.
|
||||
udd_enable_reset_interrupt();
|
||||
udd_enable_sof_interrupt();
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
udd_enable_msof_interrupt();
|
||||
#endif
|
||||
|
||||
udd_sleep_mode(true); // Enter in IDLE mode
|
||||
#ifdef UDC_RESUME_EVENT
|
||||
UDC_RESUME_EVENT();
|
||||
@@ -642,13 +664,11 @@ udd_interrupt_sof_end:
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool udd_include_vbus_monitoring(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void udd_enable(void)
|
||||
{
|
||||
irqflags_t flags;
|
||||
@@ -735,7 +755,6 @@ void udd_enable(void)
|
||||
cpu_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
||||
void udd_disable(void)
|
||||
{
|
||||
irqflags_t flags;
|
||||
@@ -776,6 +795,27 @@ void udd_disable(void)
|
||||
cpu_irq_restore(flags);
|
||||
}
|
||||
|
||||
// Marlin modification: The original implementation did not use a memory
|
||||
// barrier between disabling and clearing interrupts. This sometimes
|
||||
// allowed interrupts to remain raised and unclearable after the clock
|
||||
// was frozen. This helper was added to ensure that memory barriers
|
||||
// are used consistently from all places where interrupts are disabled.
|
||||
static void disable_and_ack_sync_interrupts()
|
||||
{
|
||||
// Disable USB line events
|
||||
udd_disable_reset_interrupt();
|
||||
udd_disable_sof_interrupt();
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
udd_disable_msof_interrupt();
|
||||
#endif
|
||||
__DSB();
|
||||
udd_ack_reset();
|
||||
udd_ack_sof();
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
udd_ack_msof();
|
||||
#endif
|
||||
__DSB();
|
||||
}
|
||||
|
||||
void udd_attach(void)
|
||||
{
|
||||
@@ -796,17 +836,16 @@ void udd_attach(void)
|
||||
udd_attach_device();
|
||||
|
||||
// Enable USB line events
|
||||
udd_enable_reset_interrupt();
|
||||
udd_enable_suspend_interrupt();
|
||||
udd_enable_wake_up_interrupt();
|
||||
udd_enable_sof_interrupt();
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
udd_enable_msof_interrupt();
|
||||
#endif
|
||||
// Reset following interrupts flag
|
||||
udd_ack_reset();
|
||||
udd_ack_sof();
|
||||
udd_ack_msof();
|
||||
|
||||
// Marlin modification: The RESET, SOF, and MSOF interrupts were previously
|
||||
// enabled here, which caused a race condition where they could be raised
|
||||
// and unclearable with the clock is frozen. They are now enabled in the
|
||||
// wake interrupt handler, after the clock has been unfrozen. They are now
|
||||
// explicitly disabled here to ensure that they cannot be raised before
|
||||
// the clock is frozen.
|
||||
disable_and_ack_sync_interrupts();
|
||||
|
||||
// The first suspend interrupt must be forced
|
||||
// The first suspend interrupt is not detected else raise it
|
||||
@@ -817,18 +856,22 @@ void udd_attach(void)
|
||||
cpu_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
||||
void udd_detach(void)
|
||||
{
|
||||
otg_unfreeze_clock();
|
||||
|
||||
// Detach device from the bus
|
||||
udd_detach_device();
|
||||
|
||||
// Marlin modification: Added the explicit disabling of the RESET, SOF, and
|
||||
// MSOF interrupts here, to ensure that they cannot be raised after the
|
||||
// clock is frozen.
|
||||
disable_and_ack_sync_interrupts();
|
||||
|
||||
otg_freeze_clock();
|
||||
udd_sleep_mode(false);
|
||||
}
|
||||
|
||||
|
||||
bool udd_is_high_speed(void)
|
||||
{
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
@@ -838,7 +881,6 @@ bool udd_is_high_speed(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void udd_set_address(uint8_t address)
|
||||
{
|
||||
udd_disable_address();
|
||||
@@ -846,13 +888,11 @@ void udd_set_address(uint8_t address)
|
||||
udd_enable_address();
|
||||
}
|
||||
|
||||
|
||||
uint8_t udd_getaddress(void)
|
||||
{
|
||||
return udd_get_configured_address();
|
||||
}
|
||||
|
||||
|
||||
uint16_t udd_get_frame_number(void)
|
||||
{
|
||||
return udd_frame_number();
|
||||
@@ -875,14 +915,12 @@ void udd_send_remotewakeup(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void udd_set_setup_payload(uint8_t *payload, uint16_t payload_size)
|
||||
{
|
||||
udd_g_ctrlreq.payload = payload;
|
||||
udd_g_ctrlreq.payload_size = payload_size;
|
||||
}
|
||||
|
||||
|
||||
#if (0 != USB_DEVICE_MAX_EP)
|
||||
bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes,
|
||||
uint16_t MaxEndpointSize)
|
||||
@@ -1006,7 +1044,6 @@ bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void udd_ep_free(udd_ep_id_t ep)
|
||||
{
|
||||
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
|
||||
@@ -1019,14 +1056,12 @@ void udd_ep_free(udd_ep_id_t ep)
|
||||
udd_ep_job[ep_index - 1].stall_requested = false;
|
||||
}
|
||||
|
||||
|
||||
bool udd_ep_is_halted(udd_ep_id_t ep)
|
||||
{
|
||||
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
|
||||
return Is_udd_endpoint_stall_requested(ep_index);
|
||||
}
|
||||
|
||||
|
||||
bool udd_ep_set_halt(udd_ep_id_t ep)
|
||||
{
|
||||
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
|
||||
@@ -1067,7 +1102,6 @@ bool udd_ep_set_halt(udd_ep_id_t ep)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool udd_ep_clear_halt(udd_ep_id_t ep)
|
||||
{
|
||||
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
|
||||
@@ -1108,7 +1142,6 @@ bool udd_ep_clear_halt(udd_ep_id_t ep)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket,
|
||||
uint8_t * buf, iram_size_t buf_size,
|
||||
udd_callback_trans_t callback)
|
||||
@@ -1175,7 +1208,6 @@ bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket,
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void udd_ep_abort(udd_ep_id_t ep)
|
||||
{
|
||||
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
|
||||
@@ -1204,7 +1236,6 @@ void udd_ep_abort(udd_ep_id_t ep)
|
||||
udd_ep_abort_job(ep);
|
||||
}
|
||||
|
||||
|
||||
bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
|
||||
udd_callback_halt_cleared_t callback)
|
||||
{
|
||||
@@ -1239,7 +1270,6 @@ bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
|
||||
}
|
||||
#endif // (0 != USB_DEVICE_MAX_EP)
|
||||
|
||||
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
|
||||
void udd_test_mode_j(void)
|
||||
@@ -1248,20 +1278,17 @@ void udd_test_mode_j(void)
|
||||
udd_enable_hs_test_mode_j();
|
||||
}
|
||||
|
||||
|
||||
void udd_test_mode_k(void)
|
||||
{
|
||||
udd_enable_hs_test_mode();
|
||||
udd_enable_hs_test_mode_k();
|
||||
}
|
||||
|
||||
|
||||
void udd_test_mode_se0_nak(void)
|
||||
{
|
||||
udd_enable_hs_test_mode();
|
||||
}
|
||||
|
||||
|
||||
void udd_test_mode_packet(void)
|
||||
{
|
||||
uint8_t i;
|
||||
@@ -1305,8 +1332,6 @@ void udd_test_mode_packet(void)
|
||||
}
|
||||
#endif // USB_DEVICE_HS_SUPPORT
|
||||
|
||||
|
||||
|
||||
// ------------------------
|
||||
//--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT
|
||||
|
||||
@@ -1356,7 +1381,6 @@ static void udd_ctrl_init(void)
|
||||
udd_ep_control_state = UDD_EPCTRL_SETUP;
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_setup_received(void)
|
||||
{
|
||||
irqflags_t flags;
|
||||
@@ -1418,7 +1442,6 @@ static void udd_ctrl_setup_received(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_in_sent(void)
|
||||
{
|
||||
static bool b_shortpacket = false;
|
||||
@@ -1502,7 +1525,6 @@ static void udd_ctrl_in_sent(void)
|
||||
cpu_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_out_received(void)
|
||||
{
|
||||
irqflags_t flags;
|
||||
@@ -1593,7 +1615,6 @@ static void udd_ctrl_out_received(void)
|
||||
cpu_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_underflow(void)
|
||||
{
|
||||
if (Is_udd_out_received(0))
|
||||
@@ -1610,7 +1631,6 @@ static void udd_ctrl_underflow(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_overflow(void)
|
||||
{
|
||||
if (Is_udd_in_send(0))
|
||||
@@ -1626,7 +1646,6 @@ static void udd_ctrl_overflow(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_stall_data(void)
|
||||
{
|
||||
// Stall all packets on IN & OUT control endpoint
|
||||
@@ -1634,7 +1653,6 @@ static void udd_ctrl_stall_data(void)
|
||||
udd_enable_stall_handshake(0);
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_send_zlp_in(void)
|
||||
{
|
||||
irqflags_t flags;
|
||||
@@ -1652,7 +1670,6 @@ static void udd_ctrl_send_zlp_in(void)
|
||||
cpu_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_send_zlp_out(void)
|
||||
{
|
||||
irqflags_t flags;
|
||||
@@ -1668,7 +1685,6 @@ static void udd_ctrl_send_zlp_out(void)
|
||||
cpu_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
||||
static void udd_ctrl_endofrequest(void)
|
||||
{
|
||||
// If a callback is registered then call it
|
||||
@@ -1677,7 +1693,6 @@ static void udd_ctrl_endofrequest(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static bool udd_ctrl_interrupt(void)
|
||||
{
|
||||
|
||||
@@ -1728,7 +1743,6 @@ static bool udd_ctrl_interrupt(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------
|
||||
//--- INTERNAL ROUTINES TO MANAGED THE BULK/INTERRUPT/ISOCHRONOUS ENDPOINTS
|
||||
|
||||
@@ -1743,7 +1757,6 @@ static void udd_ep_job_table_reset(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void udd_ep_job_table_kill(void)
|
||||
{
|
||||
uint8_t i;
|
||||
@@ -1754,7 +1767,6 @@ static void udd_ep_job_table_kill(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void udd_ep_abort_job(udd_ep_id_t ep)
|
||||
{
|
||||
ep &= USB_EP_ADDR_MASK;
|
||||
@@ -1763,7 +1775,6 @@ static void udd_ep_abort_job(udd_ep_id_t ep)
|
||||
udd_ep_finish_job(&udd_ep_job[ep - 1], true, ep);
|
||||
}
|
||||
|
||||
|
||||
static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_num)
|
||||
{
|
||||
if (ptr_job->busy == false) {
|
||||
@@ -1834,7 +1845,6 @@ static void udd_ep_trans_done(udd_ep_id_t ep)
|
||||
udd_dma_ctrl |= UOTGHS_DEVDMACONTROL_END_BUFFIT |
|
||||
UOTGHS_DEVDMACONTROL_CHANN_ENB;
|
||||
|
||||
|
||||
// Disable IRQs to have a short sequence
|
||||
// between read of EOT_STA and DMA enable
|
||||
flags = cpu_irq_save();
|
||||
@@ -2043,6 +2053,12 @@ static bool udd_ep_interrupt(void)
|
||||
dbg_print("I ");
|
||||
udd_disable_in_send_interrupt(ep);
|
||||
// One bank is free then send a ZLP
|
||||
|
||||
// Marlin modification: Add a barrier to ensure in_send is disabled
|
||||
// before it is cleared. This was not an observed problem, but
|
||||
// other interrupts were seen to misbehave without this barrier.
|
||||
__DSB();
|
||||
|
||||
udd_ack_in_send(ep);
|
||||
udd_ack_fifocon(ep);
|
||||
udd_ep_finish_job(ptr_job, false, ep);
|
||||
|
||||
@@ -129,7 +129,6 @@ extern "C" {
|
||||
#define Is_udd_vbus_transition() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUSTI))
|
||||
//! @}
|
||||
|
||||
|
||||
//! @name UOTGHS device attach control
|
||||
//! These macros manage the UOTGHS Device attach.
|
||||
//! @{
|
||||
@@ -141,7 +140,6 @@ extern "C" {
|
||||
#define Is_udd_detached() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_DETACH))
|
||||
//! @}
|
||||
|
||||
|
||||
//! @name UOTGHS device bus events control
|
||||
//! These macros manage the UOTGHS Device bus events.
|
||||
//! @{
|
||||
@@ -246,7 +244,6 @@ extern "C" {
|
||||
#define udd_get_configured_address() (Rd_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_UADD_Msk))
|
||||
//! @}
|
||||
|
||||
|
||||
//! @name UOTGHS Device endpoint drivers
|
||||
//! These macros manage the common features of the endpoints.
|
||||
//! @{
|
||||
@@ -330,7 +327,6 @@ extern "C" {
|
||||
#define udd_data_toggle(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_DTSEQ_Msk))
|
||||
//! @}
|
||||
|
||||
|
||||
//! @name UOTGHS Device control endpoint
|
||||
//! These macros control the endpoints.
|
||||
//! @{
|
||||
@@ -530,7 +526,6 @@ extern "C" {
|
||||
//! Tests if IN sending interrupt is enabled
|
||||
#define Is_udd_in_send_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_TXINE))
|
||||
|
||||
|
||||
//! Get 64-, 32-, 16- or 8-bit access to FIFO data register of selected endpoint.
|
||||
//! @param ep Endpoint of which to access FIFO data register
|
||||
//! @param scale Data scale in bits: 64, 32, 16 or 8
|
||||
@@ -652,7 +647,6 @@ typedef struct {
|
||||
//! @}
|
||||
//! @}
|
||||
|
||||
|
||||
/// @cond 0
|
||||
/**INDENT-OFF**/
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
//! \ingroup usb_group
|
||||
//! \defgroup otg_group UOTGHS OTG Driver
|
||||
//! UOTGHS low-level driver for OTG features
|
||||
@@ -74,7 +73,6 @@ bool otg_dual_enable(void);
|
||||
*/
|
||||
void otg_dual_disable(void);
|
||||
|
||||
|
||||
//! @name UOTGHS OTG ID pin management
|
||||
//! The ID pin come from the USB OTG connector (A and B receptable) and
|
||||
//! allows to select the USB mode host or device.
|
||||
|
||||
@@ -374,7 +374,6 @@ typedef struct {
|
||||
uint8_t bNumDeviceCaps;
|
||||
} usb_dev_bos_desc_t;
|
||||
|
||||
|
||||
/**
|
||||
* \brief USB Device Capabilities - USB 2.0 Extension Descriptor structure
|
||||
*
|
||||
@@ -411,7 +410,6 @@ typedef struct {
|
||||
uint8_t iFunction; //!< Index of string descriptor
|
||||
} usb_association_desc_t;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Standard USB configuration descriptor structure
|
||||
*/
|
||||
@@ -426,7 +424,6 @@ typedef struct {
|
||||
uint8_t bMaxPower;
|
||||
} usb_conf_desc_t;
|
||||
|
||||
|
||||
#define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set
|
||||
#define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered
|
||||
#define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered
|
||||
@@ -475,7 +472,6 @@ typedef struct {
|
||||
uint8_t bInterval;
|
||||
} usb_ep_desc_t;
|
||||
|
||||
|
||||
/**
|
||||
* \brief A standard USB string descriptor structure
|
||||
*/
|
||||
|
||||
@@ -168,7 +168,6 @@ COMPILER_PACK_SET(1)
|
||||
//! \name USB CDC Descriptors
|
||||
//@{
|
||||
|
||||
|
||||
//! CDC Header Functional Descriptor
|
||||
typedef struct {
|
||||
uint8_t bFunctionLength;
|
||||
@@ -203,7 +202,6 @@ typedef struct {
|
||||
uint8_t bSlaveInterface0;
|
||||
} usb_cdc_union_desc_t;
|
||||
|
||||
|
||||
//! \name USB CDC Call Management Capabilities
|
||||
//@{
|
||||
//! Device handles call management itself
|
||||
@@ -278,7 +276,6 @@ typedef struct {
|
||||
//@}
|
||||
//@}
|
||||
|
||||
|
||||
//! \name USB CDC notification message
|
||||
//@{
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#ifndef _USB_PROTOCOL_MSC_H_
|
||||
#define _USB_PROTOCOL_MSC_H_
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup usb_protocol_group
|
||||
* \defgroup usb_msc_protocol USB Mass Storage Class (MSC) protocol definitions
|
||||
@@ -89,7 +88,6 @@
|
||||
#define MSC_PROTOCOL_BULK 0x50 //!< Bulk-only
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \brief MSC USB requests (bRequest)
|
||||
*/
|
||||
@@ -98,7 +96,6 @@ enum usb_reqid_msc {
|
||||
USB_REQ_MSC_GET_MAX_LUN = 0xFE //!< Get Max LUN
|
||||
};
|
||||
|
||||
|
||||
COMPILER_PACK_SET(1)
|
||||
|
||||
/**
|
||||
@@ -122,7 +119,6 @@ struct usb_msc_cbw {
|
||||
#define USB_CBW_LEN_MASK 0x1F //!< Valid bits in bCBWCBLength
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* \name A Command Status Wrapper (CSW).
|
||||
*/
|
||||
|
||||
@@ -175,7 +175,7 @@ uint8_t MarlinHAL::get_reset_source() { return rtc_get_reset_reason(1); }
|
||||
|
||||
void MarlinHAL::reboot() { ESP.restart(); }
|
||||
|
||||
void _delay_ms(int delay_ms) { delay(delay_ms); }
|
||||
void _delay_ms(const int ms) { delay(ms); }
|
||||
|
||||
// return free memory between end of heap (or end bss) and whatever is current
|
||||
int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
* Copyright (c) 2017 Victor Perez
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -31,24 +31,28 @@
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
|
||||
#endif
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
|
||||
|
||||
bool PersistentStore::access_start() { return EEPROM.begin(MARLIN_EEPROM_SIZE); }
|
||||
bool PersistentStore::access_finish() { EEPROM.end(); return true; }
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
EEPROM.write(pos++, value[i]);
|
||||
const int p = REAL_EEPROM_ADDR(pos);
|
||||
EEPROM.write(p, value[i]);
|
||||
crc16(crc, &value[i], 1);
|
||||
++pos;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
uint8_t c = EEPROM.read(pos++);
|
||||
const int p = REAL_EEPROM_ADDR(pos);
|
||||
uint8_t c = EEPROM.read(p);
|
||||
if (writing) value[i] = c;
|
||||
crc16(crc, &c, 1);
|
||||
++pos;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
#include <freertos/queue.h>
|
||||
#include "../../module/stepper.h"
|
||||
|
||||
#if ENABLED(FT_MOTION)
|
||||
#include "../../module/ft_motion.h"
|
||||
#endif
|
||||
|
||||
#define DMA_BUF_COUNT 8 // number of DMA buffers to store data
|
||||
#define DMA_BUF_LEN 4092 // maximum size in bytes
|
||||
#define I2S_SAMPLE_SIZE 4 // 4 bytes, 32 bits per sample
|
||||
@@ -134,8 +138,8 @@ static void IRAM_ATTR i2s_intr_handler_default(void *arg) {
|
||||
|
||||
if (high_priority_task_awoken == pdTRUE) portYIELD_FROM_ISR();
|
||||
|
||||
// clear interrupt
|
||||
I2S0.int_clr.val = I2S0.int_st.val; //clear pending interrupt
|
||||
// Clear pending interrupt
|
||||
I2S0.int_clr.val = I2S0.int_st.val;
|
||||
}
|
||||
|
||||
void stepperTask(void *parameter) {
|
||||
@@ -148,29 +152,43 @@ void stepperTask(void *parameter) {
|
||||
xQueueReceive(dma.queue, &dma.current, portMAX_DELAY);
|
||||
dma.rw_pos = 0;
|
||||
|
||||
const bool using_ftMotion = TERN0(FT_MOTION, ftMotion.cfg.mode);
|
||||
|
||||
while (dma.rw_pos < DMA_SAMPLE_COUNT) {
|
||||
if (!nextMainISR) {
|
||||
Stepper::pulse_phase_isr();
|
||||
nextMainISR = Stepper::block_phase_isr();
|
||||
}
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
else if (!nextAdvanceISR) {
|
||||
Stepper::advance_isr();
|
||||
nextAdvanceISR = Stepper::la_interval;
|
||||
|
||||
#if ENABLED(FT_MOTION)
|
||||
|
||||
if (using_ftMotion) {
|
||||
if (!nextMainISR) stepper.ftMotion_stepper();
|
||||
nextMainISR = 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
else
|
||||
i2s_push_sample();
|
||||
|
||||
nextMainISR--;
|
||||
if (!using_ftMotion) {
|
||||
if (!nextMainISR) {
|
||||
Stepper::pulse_phase_isr();
|
||||
nextMainISR = Stepper::block_phase_isr();
|
||||
}
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
else if (!nextAdvanceISR) {
|
||||
Stepper::advance_isr();
|
||||
nextAdvanceISR = Stepper::la_interval;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
i2s_push_sample();
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
|
||||
nextAdvanceISR = Stepper::la_interval;
|
||||
nextMainISR--;
|
||||
|
||||
if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
|
||||
nextAdvanceISR--;
|
||||
#endif
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
|
||||
nextAdvanceISR = Stepper::la_interval;
|
||||
|
||||
if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
|
||||
nextAdvanceISR--;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,3 +20,7 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if ANY(MKS_MINI_12864, FYSETC_MINI_12864_2_1)
|
||||
#define U8G_HW_SPI_ESP32 1
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* ESP32 LCD-specific defines
|
||||
*/
|
||||
|
||||
uint8_t u8g_esp32_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
|
||||
#define U8G_COM_HAL_HW_SPI_FN u8g_esp32_hw_spi_fn
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ANY(MKS_MINI_12864, FYSETC_MINI_12864_2_1)
|
||||
#if U8G_HW_SPI_ESP32
|
||||
|
||||
#include <U8glib-HAL.h>
|
||||
#include "../shared/HAL_SPI.h"
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
static SPISettings spiConfig;
|
||||
|
||||
|
||||
#ifndef LCD_SPI_SPEED
|
||||
#ifdef SD_SPI_SPEED
|
||||
#define LCD_SPI_SPEED SD_SPI_SPEED // Assume SPI speed shared with SD
|
||||
@@ -50,7 +49,7 @@ static SPISettings spiConfig;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
|
||||
uint8_t u8g_esp32_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
|
||||
static uint8_t msgInitCount = 2; // Ignore all messages until 2nd U8G_COM_MSG_INIT
|
||||
|
||||
#if ENABLED(PAUSE_LCD_FOR_BUSY_SD)
|
||||
@@ -101,6 +100,5 @@ uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif // MKS_MINI_12864 || FYSETC_MINI_12864_2_1
|
||||
|
||||
#endif // U8G_HW_SPI_ESP32
|
||||
#endif // ARDUINO_ARCH_ESP32
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO_ARCH_HC32
|
||||
|
||||
#include "HAL.h"
|
||||
#include <core_hooks.h>
|
||||
#include <drivers/panic/panic.h>
|
||||
|
||||
//
|
||||
// Emergency Parser
|
||||
//
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
|
||||
extern "C" void core_hook_usart_rx_irq(uint8_t ch, uint8_t usart) {
|
||||
// Only handle receive on host serial ports
|
||||
if (false
|
||||
#ifdef SERIAL_PORT
|
||||
|| usart != SERIAL_PORT
|
||||
#endif
|
||||
#ifdef SERIAL_PORT_2
|
||||
|| usart != SERIAL_PORT_2
|
||||
#endif
|
||||
#ifdef SERIAL_PORT_3
|
||||
|| usart != SERIAL_PORT_3
|
||||
#endif
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Submit character to emergency parser
|
||||
if (MYSERIAL1.emergency_parser_enabled())
|
||||
emergency_parser.update(MYSERIAL1.emergency_state, ch);
|
||||
}
|
||||
|
||||
#endif // EMERGENCY_PARSER
|
||||
#endif // ARDUINO_ARCH_HC32
|
||||
@@ -0,0 +1,154 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* HAL for HC32F460 based boards
|
||||
*
|
||||
* Note: MarlinHAL class is in MarlinHAL.h/cpp
|
||||
*/
|
||||
|
||||
#define CPU_32_BIT
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "../../core/macros.h"
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
|
||||
#include "fastio.h"
|
||||
#include "timers.h"
|
||||
#include "MarlinSerial.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
//
|
||||
// Serial Ports
|
||||
//
|
||||
#define _MSERIAL(X) MSerial##X
|
||||
#define MSERIAL(X) _MSERIAL(X)
|
||||
#define NUM_UARTS 4
|
||||
|
||||
#if SERIAL_PORT == -1
|
||||
#error "USB Serial is not supported on HC32F460"
|
||||
#elif WITHIN(SERIAL_PORT, 1, NUM_UARTS)
|
||||
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
|
||||
#else
|
||||
#define MYSERIAL1 MSERIAL(1) // Dummy port
|
||||
static_assert(false, "SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ".")
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#error "USB Serial is not supported on HC32F460"
|
||||
#elif WITHIN(SERIAL_PORT_2, 1, NUM_UARTS)
|
||||
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
|
||||
#else
|
||||
#define MYSERIAL2 MSERIAL(1) // Dummy port
|
||||
static_assert(false, "SERIAL_PORT_2 must be from 1 to " STRINGIFY(NUM_UARTS) ".")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_3
|
||||
#if SERIAL_PORT_3 == -1
|
||||
#error "USB Serial is not supported on HC32F460"
|
||||
#elif WITHIN(SERIAL_PORT_3, 1, NUM_UARTS)
|
||||
#define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
|
||||
#else
|
||||
#define MYSERIAL3 MSERIAL(1) // Dummy port
|
||||
static_assert(false, "SERIAL_PORT_3 must be from 1 to " STRINGIFY(NUM_UARTS) ".")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
#if LCD_SERIAL_PORT == -1
|
||||
#error "USB Serial is not supported on HC32F460"
|
||||
#elif WITHIN(LCD_SERIAL_PORT, 1, NUM_UARTS)
|
||||
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
|
||||
#else
|
||||
#define LCD_SERIAL MSERIAL(1) // Dummy port
|
||||
static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ".")
|
||||
#endif
|
||||
|
||||
#if HAS_DGUS_LCD
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Emergency Parser
|
||||
//
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
extern "C" void usart_rx_irq_hook(uint8_t ch, uint8_t usart);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Misc. Defines
|
||||
//
|
||||
#define square(x) ((x) * (x))
|
||||
|
||||
#ifndef strncpy_P
|
||||
#define strncpy_P(dest, src, num) strncpy((dest), (src), (num))
|
||||
#endif
|
||||
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
#ifndef analogInputToDigitalPin
|
||||
#define analogInputToDigitalPin(p) (p)
|
||||
#endif
|
||||
|
||||
#define CRITICAL_SECTION_START \
|
||||
uint32_t primask = __get_PRIMASK(); \
|
||||
(void)__iCliRetVal()
|
||||
|
||||
#define CRITICAL_SECTION_END \
|
||||
if (!primask) \
|
||||
(void)__iSeiRetVal()
|
||||
|
||||
// Disable interrupts
|
||||
#define cli() noInterrupts()
|
||||
|
||||
// Enable interrupts
|
||||
#define sei() interrupts()
|
||||
|
||||
// bss_end alias
|
||||
#define __bss_end __bss_end__
|
||||
|
||||
// Fix bug in pgm_read_ptr
|
||||
#undef pgm_read_ptr
|
||||
#define pgm_read_ptr(addr) (*(addr))
|
||||
|
||||
//
|
||||
// ADC
|
||||
//
|
||||
#define HAL_ADC_VREF_MV 3300
|
||||
#define HAL_ADC_RESOLUTION 10
|
||||
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
//
|
||||
// MarlinHAL implementation
|
||||
//
|
||||
#include "MarlinHAL.h"
|
||||
@@ -0,0 +1,278 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* HAL for HC32F460, based heavily on the legacy implementation and STM32F1
|
||||
*/
|
||||
#ifdef ARDUINO_ARCH_HC32
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "HAL.h" // Includes MarlinHAL.h
|
||||
#include <IWatchdog.h>
|
||||
#include <AsyncAnalogRead.h>
|
||||
|
||||
#if TEMP_SENSOR_SOC
|
||||
#include <OnChipTemperature.h>
|
||||
#endif
|
||||
|
||||
extern "C" char *_sbrk(int incr);
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
// From MinSerial.cpp
|
||||
extern void install_min_serial();
|
||||
#endif
|
||||
|
||||
#if ENABLED(MARLIN_DEV_MODE)
|
||||
inline void HAL_clock_frequencies_dump() {
|
||||
// 1. dump all clock frequencies
|
||||
update_system_clock_frequencies();
|
||||
SERIAL_ECHOPGM(
|
||||
"-- clocks dump -- \nSYS=", SYSTEM_CLOCK_FREQUENCIES.system,
|
||||
"\nHCLK=", SYSTEM_CLOCK_FREQUENCIES.hclk,
|
||||
"\nPCLK0=", SYSTEM_CLOCK_FREQUENCIES.pclk0,
|
||||
"\nPCLK1=", SYSTEM_CLOCK_FREQUENCIES.pclk1,
|
||||
"\nPCLK2=", SYSTEM_CLOCK_FREQUENCIES.pclk2,
|
||||
"\nPCLK3=", SYSTEM_CLOCK_FREQUENCIES.pclk3,
|
||||
"\nPCLK4=", SYSTEM_CLOCK_FREQUENCIES.pclk4,
|
||||
"\nEXCLK=", SYSTEM_CLOCK_FREQUENCIES.exclk,
|
||||
"\nF_CPU=", F_CPU
|
||||
);
|
||||
|
||||
// 2. dump current system clock source
|
||||
en_clk_sys_source_t clkSrc = CLK_GetSysClkSource();
|
||||
SERIAL_ECHOPGM("\nSYSCLK=");
|
||||
switch (clkSrc) {
|
||||
case ClkSysSrcHRC: SERIAL_ECHOPGM("HRC"); break;
|
||||
case ClkSysSrcMRC: SERIAL_ECHOPGM("MRC"); break;
|
||||
case ClkSysSrcLRC: SERIAL_ECHOPGM("LRC"); break;
|
||||
case ClkSysSrcXTAL: SERIAL_ECHOPGM("XTAL"); break;
|
||||
case ClkSysSrcXTAL32: SERIAL_ECHOPGM("XTAL32"); break;
|
||||
case CLKSysSrcMPLL: SERIAL_ECHOPGM("MPLL");
|
||||
|
||||
// 3. if MPLL is used, dump MPLL settings:
|
||||
// (derived from CLK_SetPllSource and CLK_MpllConfig)
|
||||
// source
|
||||
switch (M4_SYSREG->CMU_PLLCFGR_f.PLLSRC) {
|
||||
case ClkPllSrcXTAL: SERIAL_ECHOPGM(",XTAL"); break;
|
||||
case ClkPllSrcHRC: SERIAL_ECHOPGM(",HRC"); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
// PLL multipliers and dividers
|
||||
SERIAL_ECHOPGM(
|
||||
"\nP=", M4_SYSREG->CMU_PLLCFGR_f.MPLLP + 1UL,
|
||||
"\nQ=", M4_SYSREG->CMU_PLLCFGR_f.MPLLQ + 1UL,
|
||||
"\nR=", M4_SYSREG->CMU_PLLCFGR_f.MPLLR + 1UL,
|
||||
"\nN=", M4_SYSREG->CMU_PLLCFGR_f.MPLLN + 1UL,
|
||||
"\nM=", M4_SYSREG->CMU_PLLCFGR_f.MPLLM + 1UL
|
||||
);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
// Done
|
||||
SERIAL_ECHOPGM("\n--\n");
|
||||
}
|
||||
#endif // MARLIN_DEV_MODE
|
||||
|
||||
//
|
||||
// MarlinHAL class implementation
|
||||
//
|
||||
|
||||
pin_t MarlinHAL::last_adc_pin;
|
||||
|
||||
#if TEMP_SENSOR_SOC
|
||||
float MarlinHAL::soc_temp = 0;
|
||||
#endif
|
||||
|
||||
MarlinHAL::MarlinHAL() {}
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
TERN_(USE_WATCHDOG, WDT.begin(5000)); // Reset on 5 second timeout
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
TERN_(USE_WATCHDOG, WDT.reload());
|
||||
}
|
||||
|
||||
void MarlinHAL::init() {
|
||||
NVIC_SetPriorityGrouping(0x3);
|
||||
|
||||
// Print clock frequencies to host serial
|
||||
TERN_(MARLIN_DEV_MODE, HAL_clock_frequencies_dump());
|
||||
|
||||
// Register min serial
|
||||
TERN_(POSTMORTEM_DEBUGGING, install_min_serial());
|
||||
}
|
||||
|
||||
void MarlinHAL::init_board() {}
|
||||
|
||||
void MarlinHAL::reboot() {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
bool MarlinHAL::isr_state() {
|
||||
return !__get_PRIMASK();
|
||||
}
|
||||
|
||||
void MarlinHAL::isr_on() {
|
||||
__enable_irq();
|
||||
}
|
||||
|
||||
void MarlinHAL::isr_off() {
|
||||
__disable_irq();
|
||||
}
|
||||
|
||||
void MarlinHAL::delay_ms(const int ms) {
|
||||
delay(ms);
|
||||
}
|
||||
|
||||
void MarlinHAL::idletask() {}
|
||||
|
||||
uint8_t MarlinHAL::get_reset_source() {
|
||||
// Query reset cause from RMU
|
||||
stc_rmu_rstcause_t rstCause;
|
||||
RMU_GetResetCause(&rstCause);
|
||||
|
||||
// Map reset cause code to those expected by Marlin
|
||||
// - Reset causes are flags, so multiple can be set
|
||||
TERN_(MARLIN_DEV_MODE, printf("-- Reset Cause -- \n"));
|
||||
uint8_t cause = 0;
|
||||
#define MAP_CAUSE(from, to) \
|
||||
if (rstCause.from == Set) { \
|
||||
TERN_(MARLIN_DEV_MODE, printf(" - " STRINGIFY(from) "\n")); \
|
||||
cause |= to; \
|
||||
}
|
||||
|
||||
// Power on
|
||||
MAP_CAUSE(enPowerOn, RST_POWER_ON) // Power on reset
|
||||
|
||||
// External
|
||||
MAP_CAUSE(enRstPin, RST_EXTERNAL) // Reset pin
|
||||
MAP_CAUSE(enPvd1, RST_EXTERNAL) // Program voltage detection reset
|
||||
MAP_CAUSE(enPvd2, RST_EXTERNAL) // "
|
||||
|
||||
// Brown out
|
||||
MAP_CAUSE(enBrownOut, RST_BROWN_OUT) // Brown out reset
|
||||
|
||||
// Wdt
|
||||
MAP_CAUSE(enWdt, RST_WATCHDOG) // Watchdog reset
|
||||
MAP_CAUSE(enSwdt, RST_WATCHDOG) // Special WDT reset
|
||||
|
||||
// Software
|
||||
MAP_CAUSE(enPowerDown, RST_SOFTWARE) // MCU power down (?)
|
||||
MAP_CAUSE(enSoftware, RST_SOFTWARE) // Software reset (e.g. NVIC_SystemReset())
|
||||
|
||||
// Misc.
|
||||
MAP_CAUSE(enMpuErr, RST_BACKUP) // MPU error
|
||||
MAP_CAUSE(enRamParityErr, RST_BACKUP) // RAM parity error
|
||||
MAP_CAUSE(enRamEcc, RST_BACKUP) // RAM ecc error
|
||||
MAP_CAUSE(enClkFreqErr, RST_BACKUP) // Clock frequency failure
|
||||
MAP_CAUSE(enXtalErr, RST_BACKUP) // XTAL failure
|
||||
|
||||
#undef MAP_CAUSE
|
||||
return cause;
|
||||
}
|
||||
|
||||
void MarlinHAL::clear_reset_source() {
|
||||
RMU_ClrResetFlag();
|
||||
}
|
||||
|
||||
int MarlinHAL::freeMemory() {
|
||||
volatile char top;
|
||||
return &top - _sbrk(0);
|
||||
}
|
||||
|
||||
void MarlinHAL::adc_init() {}
|
||||
|
||||
void MarlinHAL::adc_enable(const pin_t pin) {
|
||||
#if TEMP_SENSOR_SOC
|
||||
if (pin == TEMP_SOC_PIN) {
|
||||
// Start OTS, min. 1s between reads
|
||||
ChipTemperature.begin();
|
||||
ChipTemperature.setMinimumReadDeltaMillis(1000);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Just set pin mode to analog
|
||||
pinMode(pin, INPUT_ANALOG);
|
||||
}
|
||||
|
||||
void MarlinHAL::adc_start(const pin_t pin) {
|
||||
MarlinHAL::last_adc_pin = pin;
|
||||
|
||||
#if TEMP_SENSOR_SOC
|
||||
if (pin == TEMP_SOC_PIN) {
|
||||
// Read OTS
|
||||
float temp;
|
||||
if (ChipTemperature.read(temp))
|
||||
MarlinHAL::soc_temp = temp;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
CORE_ASSERT(IS_GPIO_PIN(pin), "adc_start: invalid pin")
|
||||
|
||||
analogReadAsync(pin);
|
||||
}
|
||||
|
||||
bool MarlinHAL::adc_ready() {
|
||||
#if TEMP_SENSOR_SOC
|
||||
if (MarlinHAL::last_adc_pin == TEMP_SOC_PIN) return true;
|
||||
#endif
|
||||
|
||||
CORE_ASSERT(IS_GPIO_PIN(MarlinHAL::last_adc_pin), "adc_ready: invalid pin")
|
||||
|
||||
return getAnalogReadComplete(MarlinHAL::last_adc_pin);
|
||||
}
|
||||
|
||||
uint16_t MarlinHAL::adc_value() {
|
||||
#if TEMP_SENSOR_SOC
|
||||
if (MarlinHAL::last_adc_pin == TEMP_SOC_PIN)
|
||||
return OTS_FLOAT_TO_ADC_READING(MarlinHAL::soc_temp);
|
||||
#endif
|
||||
|
||||
// Read conversion result
|
||||
CORE_ASSERT(IS_GPIO_PIN(MarlinHAL::last_adc_pin), "adc_value: invalid pin")
|
||||
|
||||
return getAnalogReadValue(MarlinHAL::last_adc_pin);
|
||||
}
|
||||
|
||||
void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t value, const uint16_t scale, const bool invert) {
|
||||
// Invert value if requested
|
||||
const uint16_t val = invert ? scale - value : value;
|
||||
|
||||
// AnalogWrite the value, core handles the rest
|
||||
// Pin mode should be set by Marlin by calling SET_PWM() before calling this function
|
||||
analogWriteScaled(pin, val, scale);
|
||||
}
|
||||
|
||||
void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
|
||||
// TODO set_pwm_frequency is not implemented yet
|
||||
panic("set_pwm_frequency is not implemented yet\n");
|
||||
}
|
||||
|
||||
void flashFirmware(const int16_t) { MarlinHAL::reboot(); }
|
||||
|
||||
#endif // ARDUINO_ARCH_HC32
|
||||
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <core_types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef gpio_pin_t pin_t;
|
||||
|
||||
#if TEMP_SENSOR_SOC
|
||||
/**
|
||||
* Convert ots measurement float to uint16_t for adc_value()
|
||||
*
|
||||
* @note returns float as integer in degrees C * 10, if T > 0
|
||||
*/
|
||||
#define OTS_FLOAT_TO_ADC_READING(T) ((T) > 0 ? ((uint16_t)((T) * 10.0f)) : 0)
|
||||
|
||||
/**
|
||||
* Convert adc_value() uint16_t to ots measurement float
|
||||
*
|
||||
* @note see OTS_FLOAT_TO_ADC_READING for inverse
|
||||
*
|
||||
* @note RAW is oversampled by OVERSAMPLENR, so we need to divide first
|
||||
*/
|
||||
#define TEMP_SOC_SENSOR(RAW) ((float)(((RAW) / OVERSAMPLENR) / 10))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* HAL class for Marlin on HC32F460
|
||||
*/
|
||||
class MarlinHAL {
|
||||
public:
|
||||
// Earliest possible init, before setup()
|
||||
MarlinHAL();
|
||||
|
||||
// Watchdog
|
||||
static void watchdog_init();
|
||||
static void watchdog_refresh();
|
||||
|
||||
static void init(); // Called early in setup()
|
||||
static void init_board(); // Called less early in setup()
|
||||
static void reboot(); // Restart the firmware from 0x0
|
||||
|
||||
// Interrupts
|
||||
static bool isr_state();
|
||||
static void isr_on();
|
||||
static void isr_off();
|
||||
|
||||
static void delay_ms(const int ms);
|
||||
|
||||
// Tasks, called from idle()
|
||||
static void idletask();
|
||||
|
||||
// Reset
|
||||
static uint8_t get_reset_source();
|
||||
static void clear_reset_source();
|
||||
|
||||
// Free SRAM
|
||||
static int freeMemory();
|
||||
|
||||
//
|
||||
// ADC Methods
|
||||
//
|
||||
|
||||
// Called by Temperature::init once at startup
|
||||
static void adc_init();
|
||||
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin);
|
||||
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
static bool adc_ready();
|
||||
|
||||
// The current value of the ADC register
|
||||
static uint16_t adc_value();
|
||||
|
||||
/**
|
||||
* Set the PWM duty cycle for the pin to the given value.
|
||||
* Optionally invert the duty cycle [default = false]
|
||||
* Optionally change the maximum size of the provided value to enable finer PWM duty control [default = 255]
|
||||
* The timer must be pre-configured with set_pwm_frequency() if the default frequency is not desired.
|
||||
*/
|
||||
static void set_pwm_duty(const pin_t pin, const uint16_t value, const uint16_t scale = 255, const bool invert = false);
|
||||
|
||||
/**
|
||||
* Set the frequency of the timer for the given pin.
|
||||
* All Timer PWM pins run at the same frequency.
|
||||
*/
|
||||
static void set_pwm_frequency(const pin_t pin, const uint16_t f_desired);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Pin number of the last pin that was used with adc_start()
|
||||
*/
|
||||
static pin_t last_adc_pin;
|
||||
|
||||
#if TEMP_SENSOR_SOC
|
||||
/**
|
||||
* On-chip temperature sensor value
|
||||
*/
|
||||
static float soc_temp;
|
||||
#endif
|
||||
};
|
||||
|
||||
// M997: Trigger a firmware update from SD card (after upload).
|
||||
// On HC32F460, a reboot is enough to do this.
|
||||
#ifndef PLATFORM_M997_SUPPORT
|
||||
#define PLATFORM_M997_SUPPORT
|
||||
#endif
|
||||
|
||||
void flashFirmware(const int16_t);
|
||||
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef ARDUINO_ARCH_HC32
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "MarlinSerial.h"
|
||||
#include <drivers/usart/Usart.h>
|
||||
|
||||
/**
|
||||
* Not every MarlinSerial instance should handle emergency parsing, as
|
||||
* it would not make sense to parse G-Code from TMC responses
|
||||
*/
|
||||
constexpr bool serial_handles_emergency(int port) {
|
||||
return false
|
||||
#ifdef SERIAL_PORT
|
||||
|| (SERIAL_PORT) == port
|
||||
#endif
|
||||
#ifdef SERIAL_PORT_2
|
||||
|| (SERIAL_PORT_2) == port
|
||||
#endif
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
|| (LCD_SERIAL_PORT) == port
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
//
|
||||
// Define serial ports
|
||||
//
|
||||
#define DEFINE_HWSERIAL_MARLIN(name, n) \
|
||||
MSerialT name(serial_handles_emergency(n), \
|
||||
&USART##n##_config, \
|
||||
BOARD_USART##n##_TX_PIN, \
|
||||
BOARD_USART##n##_RX_PIN);
|
||||
|
||||
DEFINE_HWSERIAL_MARLIN(MSerial1, 1);
|
||||
DEFINE_HWSERIAL_MARLIN(MSerial2, 2);
|
||||
|
||||
//
|
||||
// Serial port assertions
|
||||
//
|
||||
|
||||
// Check the type of each serial port by passing it to a template function.
|
||||
// HardwareSerial is known to sometimes hang the controller when an error occurs,
|
||||
// so this case will fail the static assert. All other classes are assumed to be ok.
|
||||
template <typename T>
|
||||
constexpr bool IsSerialClassAllowed(const T &) { return true; }
|
||||
constexpr bool IsSerialClassAllowed(const HardwareSerial &) { return false; }
|
||||
constexpr bool IsSerialClassAllowed(const Usart &) { return false; }
|
||||
|
||||
// If you encounter this error, replace SerialX with MSerialX, for example MSerial3.
|
||||
#define CHECK_CFG_SERIAL(A) static_assert(IsSerialClassAllowed(A), STRINGIFY(A) " is defined incorrectly");
|
||||
#define CHECK_AXIS_SERIAL(A) static_assert(IsSerialClassAllowed(A##_HARDWARE_SERIAL), STRINGIFY(A) "_HARDWARE_SERIAL must be defined in the form MSerial1, rather than Serial1");
|
||||
|
||||
// Non-TMC ports were already validated in HAL.h, so do not require verbose error messages.
|
||||
#ifdef MYSERIAL1
|
||||
CHECK_CFG_SERIAL(MYSERIAL1);
|
||||
#endif
|
||||
#ifdef MYSERIAL2
|
||||
CHECK_CFG_SERIAL(MYSERIAL2);
|
||||
#endif
|
||||
#ifdef LCD_SERIAL
|
||||
CHECK_CFG_SERIAL(LCD_SERIAL);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(X)
|
||||
CHECK_AXIS_SERIAL(X);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(X2)
|
||||
CHECK_AXIS_SERIAL(X2);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(Y)
|
||||
CHECK_AXIS_SERIAL(Y);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(Y2)
|
||||
CHECK_AXIS_SERIAL(Y2);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(Z)
|
||||
CHECK_AXIS_SERIAL(Z);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(Z2)
|
||||
CHECK_AXIS_SERIAL(Z2);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(Z3)
|
||||
CHECK_AXIS_SERIAL(Z3);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(Z4)
|
||||
CHECK_AXIS_SERIAL(Z4);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(I)
|
||||
CHECK_AXIS_SERIAL(I);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(J)
|
||||
CHECK_AXIS_SERIAL(J);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(K)
|
||||
CHECK_AXIS_SERIAL(K);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E0)
|
||||
CHECK_AXIS_SERIAL(E0);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E1)
|
||||
CHECK_AXIS_SERIAL(E1);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E2)
|
||||
CHECK_AXIS_SERIAL(E2);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E3)
|
||||
CHECK_AXIS_SERIAL(E3);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E4)
|
||||
CHECK_AXIS_SERIAL(E4);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E5)
|
||||
CHECK_AXIS_SERIAL(E5);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E6)
|
||||
CHECK_AXIS_SERIAL(E6);
|
||||
#endif
|
||||
#if AXIS_HAS_HW_SERIAL(E7)
|
||||
CHECK_AXIS_SERIAL(E7);
|
||||
#endif
|
||||
|
||||
#endif // ARDUINO_ARCH_HC32
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../core/serial_hook.h"
|
||||
#include <drivers/usart/Usart.h>
|
||||
|
||||
// Optionally set uart IRQ priority to reduce overflow errors
|
||||
// #define UART_IRQ_PRIO 1
|
||||
|
||||
struct MarlinSerial : public Usart {
|
||||
MarlinSerial(struct usart_config_t *usart_device, gpio_pin_t tx_pin, gpio_pin_t rx_pin) : Usart(usart_device, tx_pin, rx_pin) {}
|
||||
|
||||
#ifdef UART_IRQ_PRIO
|
||||
void setPriority() {
|
||||
NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_IRQ_PRIO);
|
||||
}
|
||||
|
||||
void begin(uint32_t baud) {
|
||||
Usart::begin(baud);
|
||||
setPriority();
|
||||
}
|
||||
|
||||
void begin(uint32_t baud, uint8_t config) {
|
||||
Usart::begin(baud, config);
|
||||
setPriority();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef Serial1Class<MarlinSerial> MSerialT;
|
||||
|
||||
extern MSerialT MSerial1;
|
||||
extern MSerialT MSerial2;
|
||||
@@ -0,0 +1,151 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO_ARCH_HC32
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include <drivers/panic/panic.h>
|
||||
|
||||
#if ANY(POSTMORTEM_DEBUGGING, PANIC_ENABLE)
|
||||
|
||||
#include <drivers/usart/usart_sync.h>
|
||||
|
||||
//
|
||||
// Shared by both panic and PostMortem debugging
|
||||
//
|
||||
static void minserial_begin() {
|
||||
#if !WITHIN(SERIAL_PORT, 1, 3)
|
||||
#warning "MinSerial requires a physical UART port for output."
|
||||
#warning "Disabling MinSerial because the used serial port is not a HW port."
|
||||
#else
|
||||
|
||||
// Prepare usart_sync configuration
|
||||
const stc_usart_uart_init_t usart_config = {
|
||||
.enClkMode = UsartIntClkCkNoOutput,
|
||||
.enClkDiv = UsartClkDiv_1,
|
||||
.enDataLength = UsartDataBits8,
|
||||
.enDirection = UsartDataLsbFirst,
|
||||
.enStopBit = UsartOneStopBit,
|
||||
.enParity = UsartParityNone,
|
||||
.enSampleMode = UsartSampleBit8,
|
||||
.enDetectMode = UsartStartBitFallEdge,
|
||||
.enHwFlow = UsartRtsEnable,
|
||||
};
|
||||
|
||||
// Initializes usart_sync driver
|
||||
#define __USART_SYNC_INIT(port_no, baud, config) \
|
||||
usart_sync_init(M4_USART##port_no, \
|
||||
BOARD_USART##port_no##_TX_PIN, \
|
||||
baud, \
|
||||
config);
|
||||
#define USART_SYNC_INIT(port_no, baud, config) __USART_SYNC_INIT(port_no, baud, config)
|
||||
|
||||
// This will reset the baudrate to what is defined in Configuration.h,
|
||||
// ignoring any changes made with e.g. M575.
|
||||
// keeping the dynamic baudrate would require re-calculating the baudrate
|
||||
// using the register values, which is a pain...
|
||||
|
||||
// TODO: retain dynamic baudrate in MinSerial init
|
||||
// -> see USART_SetBaudrate(), needs to be inverted
|
||||
USART_SYNC_INIT(SERIAL_PORT, BAUDRATE, &usart_config);
|
||||
|
||||
#undef USART_SYNC_INIT
|
||||
#undef __USART_SYNC_INIT
|
||||
#endif
|
||||
}
|
||||
|
||||
static void minserial_putc(char c) {
|
||||
#if WITHIN(SERIAL_PORT, 1, 3)
|
||||
#define __USART_SYNC_PUTC(port_no, ch) usart_sync_putc(M4_USART##port_no, ch);
|
||||
#define USART_SYNC_PUTC(port_no, ch) __USART_SYNC_PUTC(port_no, ch)
|
||||
|
||||
USART_SYNC_PUTC(SERIAL_PORT, c);
|
||||
|
||||
#undef USART_SYNC_PUTC
|
||||
#undef __USART_SYNC_PUTC
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Panic only
|
||||
//
|
||||
#ifdef PANIC_ENABLE
|
||||
|
||||
void panic_begin() {
|
||||
minserial_begin();
|
||||
panic_puts("\n\nPANIC:\n");
|
||||
}
|
||||
|
||||
void panic_puts(const char *str) {
|
||||
while (*str) minserial_putc(*str++);
|
||||
}
|
||||
|
||||
#endif // PANIC_ENABLE
|
||||
|
||||
//
|
||||
// PostMortem debugging only
|
||||
//
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
|
||||
#include "../shared/MinSerial.h"
|
||||
#include <drivers/panic/fault_handlers.h>
|
||||
|
||||
void fault_handlers_init() {
|
||||
// Enable cpu traps:
|
||||
// - Divide by zero
|
||||
// - Unaligned access
|
||||
SCB->CCR |= SCB_CCR_DIV_0_TRP_Msk; //| SCB_CCR_UNALIGN_TRP_Msk;
|
||||
}
|
||||
|
||||
void install_min_serial() {
|
||||
HAL_min_serial_init = &minserial_begin;
|
||||
HAL_min_serial_out = &minserial_putc;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
__attribute__((naked)) void JumpHandler_ASM() {
|
||||
__asm__ __volatile__(
|
||||
"b CommonHandler_ASM\n");
|
||||
}
|
||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) HardFault_Handler();
|
||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) BusFault_Handler();
|
||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) UsageFault_Handler();
|
||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) MemManage_Handler();
|
||||
void __attribute__((naked, alias("JumpHandler_ASM"), nothrow)) NMI_Handler();
|
||||
}
|
||||
|
||||
#endif // POSTMORTEM_DEBUGGING
|
||||
#endif // POSTMORTEM_DEBUGGING || PANIC_ENABLE
|
||||
|
||||
//
|
||||
// Panic_end is always required to print the '!!' to the host
|
||||
//
|
||||
void panic_end() {
|
||||
// Print '!!' to signal error to host
|
||||
// Do it 10x so it's not missed
|
||||
for (uint_fast8_t i = 10; i--;) panic_printf("\n!!\n");
|
||||
|
||||
// Then, reset the board
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
#endif // ARDUINO_ARCH_HC32
|
||||
@@ -0,0 +1,110 @@
|
||||
# HC32F460 HAL
|
||||
|
||||
This document provides notes on the HAL for the HC32F460 MCU.
|
||||
|
||||
## Adding support for a new board
|
||||
|
||||
The HC32F460 HAL is designed to be generic enough for any HC32F460-based board. Adding support for a new HC32F460-based board will require the following steps:
|
||||
|
||||
1. Follow [the usual instructions](https://marlinfw.org/docs/development/boards.html#adding-a-new-board) to add a new board to Marlin. (i.e., Add a pins file, edit `boards.h` and `pins.h`, etc.)
|
||||
2. Determine the flash size your board uses:
|
||||
- Examine the board's main processor. (Refer the naming key in `hc32.ini`.)
|
||||
- Extend the `HC32F460C_common` base env for 256K, or `HC32F460E_common` for 512K.
|
||||
3. Determine your board's application start address (see [below](#finding-the-application-start-address))
|
||||
4. Set `board_build.ld_args.flash_start` to the app start address once you've found it. If your board doesn't use a bootloader, you may be able to use the "ICSP" header or DFU. This document will be updated once we have more information about flashing without a bootloader.
|
||||
|
||||
### Finding the application start address
|
||||
|
||||
If the board contains a bootloader you'll need to find the application address. This is the address the bootloader jumps to after it's done. You can find this address in a few different ways:
|
||||
|
||||
#### 1. Using log messages
|
||||
|
||||
If you're lucky, the bootloader may print the app start address on the serial output during boot. To check for this, use your favorite serial monitor to observe the serial output when you power on the board. Look for a message like "Jumping to 0xC000" or "GotoApp->addr=0xC000". This line would be printed before Marlin's "start" message.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
[...]
|
||||
version 1.2
|
||||
sdio init success!
|
||||
Disk init
|
||||
Tips ------ None Firmware file
|
||||
GotoApp->addr=0xC000
|
||||
|
||||
start
|
||||
[...]
|
||||
```
|
||||
|
||||
#### 2. Using published source code
|
||||
|
||||
If the vendor has published Marlin source code that includes the bootloader, you can search the bootloader source code for the address. Begin your search with the following steps:
|
||||
|
||||
1. Find the code that sets the vector table offset
|
||||
|
||||
The vector table offset is usually set using a line like this:
|
||||
|
||||
```c
|
||||
SCB->VTOR = ((uint32_t) APP_START_ADDRESS & SCB_VTOR_TBLOFF_Msk);
|
||||
```
|
||||
|
||||
Just searching for `SCB->VTOR` should yield some results. From there, you just need to look at the value that's assigned to it. The example uses `APP_START_ADDRESS`.
|
||||
|
||||
> [!NOTE]
|
||||
> Some vendors publish incomplete source code. But they sometimes leave version control related files in the repo, which can contain previous version of files that were removed. Find these by including folders like `.git` or `.svn` in your search.
|
||||
|
||||
> [!NOTE]
|
||||
> The example is based on the [Voxelab-64/Aquila_X2](https://github.com/Voxelab-64/Aquila_X2/blob/d1f23adf96920996b979bc31023d1dce236d05db/firmware/Sources/.svn/pristine/ec/ec82bcb480b511906bc3e6658450e3a803ab9813.svn-base#L96) which actually includes deleted files in its repo.
|
||||
|
||||
2. Using a linker script
|
||||
|
||||
If the repository contains a linker script, look at the memory regions, specifically a region named `FLASH` or similar. The `ORIGIN` of that region will be the application start address.
|
||||
|
||||
**Example:**
|
||||
|
||||
```ld
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx): ORIGIN = 0x0000C000, LENGTH = 512K
|
||||
OTP (rx): ORIGIN = 0x03000C00, LENGTH = 1020
|
||||
RAM (rwx): ORIGIN = 0x1FFF8000, LENGTH = 188K
|
||||
RET_RAM (rwx): ORIGIN = 0x200F0000, LENGTH = 4K
|
||||
}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> This example is based on [Voxelab-64/Aquila_X2](https://github.com/Voxelab-64/Aquila_X2/blob/d1f23adf96920996b979bc31023d1dce236d05db/firmware/Sources/main/hdsc32core/hc32f46x_flash.ld#L55)
|
||||
|
||||
## Documentation on the HC32F460
|
||||
|
||||
Due to uncertain licensing (w/r/t STMicro), documentation for the HC32F460 is only available upon request. Documentation includes the following:
|
||||
|
||||
- Datasheet, user manual, reference manual
|
||||
- Application notes for the DDL
|
||||
- DDL source code
|
||||
- IDE support packages (Keil, IAR, ...) including .svd files
|
||||
- Programming software
|
||||
- Emulator / debugger drivers
|
||||
- Development board documentation and schematics
|
||||
- Errata documents
|
||||
- (Limited) sales information
|
||||
- Full Voxelab firmware source code
|
||||
- Documents in Chinese or English (machine translated)
|
||||
|
||||
Contact me on Discord (@shadow578) if you need it.
|
||||
|
||||
## Dependencies
|
||||
|
||||
This HAL depends on the following projects:
|
||||
|
||||
- [shadow578/platform-hc32f46x](https://github.com/shadow578/platform-hc32f46x) (PlatformIO platform for HC32F46x)
|
||||
- [shadow578/framework-arduino-hc32f46x](https://github.com/shadow578/framework-arduino-hc32f46x) (Arduino framework for HC32F46x)
|
||||
- [shadow578/framework-hc32f46x-ddl](https://github.com/shadow578/framework-hc32f46x-ddl) (HC32F46x DDL framework)
|
||||
|
||||
## Credits
|
||||
|
||||
This HAL wouldn't be possible without the following projects:
|
||||
|
||||
- [Voxelab-64/Aquila_X2](https://github.com/Voxelab-64/Aquila_X2) (original implementation)
|
||||
- [alexqzd/Marlin-H32](https://github.com/alexqzd/Marlin-H32) (misc. fixes to the original implementation)
|
||||
- [kgoveas/Arduino-Core-Template](https://github.com/kgoveas/Arduino-Core-Template) (template for Arduino headers)
|
||||
- [stm32duino/Arduino_Core_STM32](https://github.com/stm32duino/Arduino_Core_STM32) (misc. Arduino functions)
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO_ARCH_HC32
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_SERVOS
|
||||
|
||||
#include "Servo.h"
|
||||
|
||||
static uint8_t servoCount = 0;
|
||||
static MarlinServo *servos[NUM_SERVOS] = {0};
|
||||
|
||||
constexpr uint32_t servoDelays[] = SERVO_DELAY;
|
||||
static_assert(COUNT(servoDelays) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||
|
||||
//
|
||||
// MarlinServo impl
|
||||
//
|
||||
MarlinServo::MarlinServo() {
|
||||
this->channel = servoCount++;
|
||||
servos[this->channel] = this;
|
||||
}
|
||||
|
||||
int8_t MarlinServo::attach(const pin_t apin) {
|
||||
// Use last pin if pin not given
|
||||
if (apin >= 0) this->pin = apin;
|
||||
|
||||
// If attached, do nothing but no fail
|
||||
if (this->servo.attached()) return 0;
|
||||
|
||||
// Attach
|
||||
const uint8_t rc = this->servo.attach(this->pin);
|
||||
return rc == INVALID_SERVO ? -1 : rc;
|
||||
}
|
||||
|
||||
void MarlinServo::detach() {
|
||||
this->servo.detach();
|
||||
}
|
||||
|
||||
bool MarlinServo::attached() {
|
||||
return this->servo.attached();
|
||||
}
|
||||
|
||||
void MarlinServo::write(servo_angle_t angle) {
|
||||
this->angle = angle;
|
||||
this->servo.write(angle);
|
||||
}
|
||||
|
||||
void MarlinServo::move(servo_angle_t angle) {
|
||||
// Attach with pin=-1 to use last pin attach() was called with
|
||||
if (attach(-1) < 0) return; // Attach failed
|
||||
|
||||
write(angle);
|
||||
safe_delay(servoDelays[this->channel]);
|
||||
TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
|
||||
}
|
||||
|
||||
servo_angle_t MarlinServo::read() {
|
||||
return TERN(OPTIMISTIC_SERVO_READ, this->angle, this->servo.read());
|
||||
}
|
||||
|
||||
#endif // HAS_SERVOS
|
||||
#endif // ARDUINO_ARCH_HC32
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user