Compare commits
596 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8decb59512 | |||
| c9e0a4d5ed | |||
| 9c8835148c | |||
| 13af4e1ef1 | |||
| 4869a3ffd9 | |||
| c2d0008d2a | |||
| 68ae15e2df | |||
| 91e4811534 | |||
| d2fab914cd | |||
| 846ec6c66b | |||
| d876b5ee3c | |||
| 98ae2ad60a | |||
| a261a5b9a6 | |||
| a7fcb495e4 | |||
| ea554a0609 | |||
| 08717d3f60 | |||
| 7b104a108f | |||
| 9133a2f0f5 | |||
| dff2104c96 | |||
| 163ca2783f | |||
| 16f28e747b | |||
| 3b7aadb359 | |||
| 9e8d561549 | |||
| b4a3e29fb6 | |||
| d2bda128ab | |||
| f8bbabfa31 | |||
| fc769ef023 | |||
| 9192ae5213 | |||
| 4c0e612376 | |||
| b9f7d721ed | |||
| b43d6ed5d3 | |||
| e824e16a41 | |||
| 0b72b8d819 | |||
| 37eb8bb1d5 | |||
| d2ff2adabd | |||
| f31cc84c2b | |||
| 8beec5eaa5 | |||
| 4e41ff32e1 | |||
| cf137cb73a | |||
| d5cc11d996 | |||
| d62a631467 | |||
| d6c3f45bda | |||
| 81760d6818 | |||
| 282f90c1b3 | |||
| 5de9fc556f | |||
| 3482e9632c | |||
| a6493e0cc8 | |||
| a08a7b3459 | |||
| bd4936330b | |||
| 4bb33a0cb9 | |||
| 83e38b3625 | |||
| 5b7bb3ea64 | |||
| f0b115a999 | |||
| cebed347f5 | |||
| a66b22c4f1 | |||
| fadaa2db09 | |||
| f8954ca79b | |||
| 4a3f69ad6d | |||
| 4bf13bea42 | |||
| 3a6bd6920e | |||
| 70ef7978b4 | |||
| 37bc552f3b | |||
| e310f20279 | |||
| 4708635f4f | |||
| f5d5b0a881 | |||
| 30f5dd339d | |||
| 556d716919 | |||
| 76afd5afc1 | |||
| 5c3bc2194a | |||
| 763cd7c5f2 | |||
| 11046b23a9 | |||
| 36b72926f3 | |||
| b35e16b1d8 | |||
| 767c87810b | |||
| 52b6c45451 | |||
| df5d08aec0 | |||
| 8c61606691 | |||
| e70bd3c785 | |||
| 83cc983276 | |||
| bbb8275d66 | |||
| 2afc2f268a | |||
| aa44542f76 | |||
| 248648708f | |||
| e2c0150fa8 | |||
| 4ef5372151 | |||
| a923771611 | |||
| 74ffa0cc3e | |||
| f2d585ac7f | |||
| 80cfdb182c | |||
| 39463268fb | |||
| a7b3989bca | |||
| 829212d76a | |||
| 0de4a70203 | |||
| febfb3218e | |||
| 4da46c5dd2 | |||
| 353ede8208 | |||
| 09de5e76a7 | |||
| 73b6ba8fe3 | |||
| 72b09fe4cb | |||
| e5ad13a8e2 | |||
| b122e46adb | |||
| 1a5866f5c6 | |||
| c7e62b33d1 | |||
| 1916d4e27f | |||
| ce55a7bd9b | |||
| 540120f863 | |||
| b99a26d6ab | |||
| 6528109176 | |||
| b94a0d036c | |||
| 7634ffe8e5 | |||
| 8bae8bbf7a | |||
| 5ce013f414 | |||
| da4a374b49 | |||
| 81b13456b1 | |||
| ee35fb07b0 | |||
| 99c991755a | |||
| a96ae85d88 | |||
| 45b9680c57 | |||
| 83cbed8527 | |||
| d36d9cb506 | |||
| 9e6981ea60 | |||
| 2c6f8a30f3 | |||
| 17a5a1f97d | |||
| a0815deb9a | |||
| 76a7ab6893 | |||
| 7cd56a57f9 | |||
| 56e2b60e6d | |||
| 8c15a093fd | |||
| 7901eb97ad | |||
| 7aaba66d4d | |||
| 5f0b9d429f | |||
| d34b62eafa | |||
| 3743980192 | |||
| 41d53a15f2 | |||
| f234fbf87f | |||
| 5c728d1fb1 | |||
| 162ea81894 | |||
| 97b9fe83ee | |||
| 9953230550 | |||
| 80bd10025b | |||
| 0876bcd027 | |||
| 3d7ac162fb | |||
| 68a2459808 | |||
| 21fddc1cc8 | |||
| 528a1ad3e0 | |||
| dabe374983 | |||
| 8ac0f14796 | |||
| 934fc52d06 | |||
| cf46d1880c | |||
| 4f159a94cd | |||
| b53e14c7f8 | |||
| 94e9f26544 | |||
| 9e87af70b7 | |||
| fe56f5d3a6 | |||
| 90e5826256 | |||
| bb73c335a5 | |||
| 4c1f76567c | |||
| d193c814d3 | |||
| 2cb252da4a | |||
| 9a04c32f7f | |||
| 3b8e9fdd25 | |||
| e0b045da49 | |||
| 4220491a23 | |||
| 3abe1fcf20 | |||
| 02ed020f3f | |||
| 934ac24ad8 | |||
| e2d8b2fc26 | |||
| 3e8483d389 | |||
| a9c529f004 | |||
| a664587219 | |||
| 1619838592 | |||
| 98a33d37c7 | |||
| 12a2e5ae1b | |||
| 9b472a02e9 | |||
| c84bea7110 | |||
| 20f71fafa7 | |||
| 056e5a430e | |||
| 21a604407d | |||
| deb076b9cd | |||
| b8e2ad9d8f | |||
| 0cd9643957 | |||
| 8c78315f71 | |||
| 35dad3fdfe | |||
| bebf5dc6ab | |||
| 2fd1c48e1a | |||
| 301727defc | |||
| 1afd53a933 | |||
| 381aeb94c6 | |||
| 4a36520820 | |||
| 430eedf5c0 | |||
| 793a851d10 | |||
| 2d609487ac | |||
| 295f50379f | |||
| ecfff5099a | |||
| 986344640f | |||
| 69f69606e6 | |||
| 2aa2e5487a | |||
| 23d9020a65 | |||
| 43d9d1ce1b | |||
| ed7f3b21c0 | |||
| b062a3b226 | |||
| 89b0143b09 | |||
| 0790a9d5df | |||
| e05ac66561 | |||
| 3b33f7ec03 | |||
| b94c75bcda | |||
| 8dc8906d78 | |||
| ab684dc484 | |||
| 37fb26b557 | |||
| 7397e5a41d | |||
| 4a9d380117 | |||
| 0ec1a54309 | |||
| ab6e68c312 | |||
| c509603530 | |||
| e5ce65c32b | |||
| 851257c44b | |||
| 1662e953fc | |||
| dde89795c9 | |||
| 6e69ff93ef | |||
| 01b7d6c413 | |||
| 58398832a1 | |||
| 29469a0615 | |||
| b4dd20c0eb | |||
| eab13752dd | |||
| ad60cdd030 | |||
| 78e111a4d0 | |||
| 5558729562 | |||
| 2d32f7c377 | |||
| bcbdac6f6c | |||
| acc8bf1c79 | |||
| 4f107e9fee | |||
| 7844f3fa4f | |||
| 2f3af438ee | |||
| 4483aa5b45 | |||
| 20e6b6315e | |||
| ca4248bdd5 | |||
| 4a5d8ba87e | |||
| 7a5d849857 | |||
| 95c23e55a4 | |||
| 94ce0d24d6 | |||
| cdea1b8460 | |||
| cc122bec82 | |||
| 6afaf0034c | |||
| 7f0d7e760b | |||
| 69004322f6 | |||
| 7441094a41 | |||
| 29a5006df9 | |||
| 1aca038daf | |||
| ce92eb46ec | |||
| c852e9c6a1 | |||
| 2b8db0c2e2 | |||
| 74f297c871 | |||
| 76411392b7 | |||
| 74c81117c3 | |||
| 6f04d8dc77 | |||
| ade05c045e | |||
| 5140726c70 | |||
| 5334a8f0ed | |||
| ee99eed3bf | |||
| 9a5f1d2f51 | |||
| 170df9040b | |||
| f0bc4274f8 | |||
| 20a704b154 | |||
| 30a70c480c | |||
| 1d5e9c7dee | |||
| b8ab2d4987 | |||
| ce796cec97 | |||
| ad4de747ad | |||
| 95c1b7fb31 | |||
| 29b742cfc4 | |||
| 57bda2ff3b | |||
| 228179e09b | |||
| c961f3ab2b | |||
| 3469cb9d24 | |||
| 6c09b83f30 | |||
| 17a1363f4d | |||
| 115350317c | |||
| 44c2682168 | |||
| 8b81aae870 | |||
| 72a2699b10 | |||
| b7c07f1329 | |||
| 2b9a62093a | |||
| 3385b4c280 | |||
| 7c1f82cd96 | |||
| 9ebfdc4a86 | |||
| 586313c2fb | |||
| 571783fc04 | |||
| 4af5229cee | |||
| e0dcc610da | |||
| 4aff10785e | |||
| d0e110d666 | |||
| 10ffb9cb68 | |||
| b303bb1e56 | |||
| e6a61b182f | |||
| 785b1da021 | |||
| a4d20031ec | |||
| 3c60145792 | |||
| f2940adcf1 | |||
| b5b9cc0b79 | |||
| 1d1eb97567 | |||
| 0103cffcd0 | |||
| 6fed66dd42 | |||
| c81416438d | |||
| c95825a0ff | |||
| b6284c9f01 | |||
| f84a97f51c | |||
| 563296fc8b | |||
| 13290e798b | |||
| 96e3dfed46 | |||
| cb6fd130ba | |||
| 11f90de873 | |||
| 9240ec89d0 | |||
| 8cf2a41f81 | |||
| 1f9fc665ec | |||
| bf1995140a | |||
| 7b21cd5d72 | |||
| 37fc32d972 | |||
| 9a6d4b5e56 | |||
| 1e0719dac5 | |||
| f2248f79d3 | |||
| 60d843b540 | |||
| 6d7d281559 | |||
| b3d462b890 | |||
| a7444021c6 | |||
| a93acbd35c | |||
| d978123289 | |||
| ee8dada752 | |||
| 7bc6261d2a | |||
| 013c3bcd82 | |||
| 2fc86ad836 | |||
| 082dc24865 | |||
| d7b6acc03d | |||
| a1dc2856de | |||
| 959be66cc2 | |||
| ae2843940f | |||
| 611ceedc1d | |||
| 38298076d6 | |||
| 1f0b8d6cd8 | |||
| e0d683baed | |||
| f4f75b6b12 | |||
| fb6dc90a85 | |||
| b99391c810 | |||
| d9fc4f3a99 | |||
| daeffbc944 | |||
| 87dde46fb0 | |||
| d96c6f867d | |||
| 1f2e6d5434 | |||
| 232b989d50 | |||
| d38261c908 | |||
| 3075bc3b7b | |||
| 842d0b1c9f | |||
| 042b238dd8 | |||
| c30904b631 | |||
| 225a71f4cd | |||
| 1d29a56344 | |||
| 320e00267d | |||
| 9869629b67 | |||
| 3da78e85bf | |||
| 11a4314261 | |||
| 65c19f82b9 | |||
| 0169cde8a4 | |||
| ab0173b7e6 | |||
| 95f81d2565 | |||
| 9c922f0eab | |||
| 35a03d66e5 | |||
| a4a0887fa7 | |||
| e7c9cf3e1d | |||
| 6710616a09 | |||
| 2064c83c66 | |||
| 2e97ad1f4b | |||
| 4f85f88ae3 | |||
| 181a57ae9b | |||
| 3ee1248cf2 | |||
| 68c3916d46 | |||
| e3bbacd8b9 | |||
| f915371248 | |||
| ea848aa891 | |||
| 5157849c60 | |||
| ca31f9789e | |||
| 78d3cf1de1 | |||
| 521e7eafce | |||
| 2d78a80cf6 | |||
| 5f32698da5 | |||
| 1845056014 | |||
| 0b8ec2aa74 | |||
| 578bdd4b20 | |||
| 6b6865d068 | |||
| 6c018eb770 | |||
| 5561bafbe6 | |||
| 75eee04972 | |||
| ee1d1faa52 | |||
| dbd3e10959 | |||
| fde330af5a | |||
| e8d953257e | |||
| cc86e9ecce | |||
| 5a6db519d6 | |||
| 98d09e5304 | |||
| d87a0ea7f7 | |||
| 0e2bd069d4 | |||
| feca9a33d5 | |||
| eec1aec071 | |||
| a97d1088f0 | |||
| a7317de3b4 | |||
| 06762db050 | |||
| 4f3ebea3a6 | |||
| fa88e0f054 | |||
| 2fd7c2b865 | |||
| ef0bd975cf | |||
| bdc14ddbd7 | |||
| 383e6f4646 | |||
| e37415c95b | |||
| a33112a4c0 | |||
| 7e8007f024 | |||
| f320c2a455 | |||
| 6eedeaedaf | |||
| 6b5e19cfc4 | |||
| 3dc437add4 | |||
| 5f96dffb9b | |||
| 6423b8031d | |||
| bbdad79ce5 | |||
| a2daee8f7a | |||
| 909e3ad116 | |||
| 556616c4f0 | |||
| 46e426ce96 | |||
| f5f6c37c17 | |||
| 08fe8a3076 | |||
| dabcea991f | |||
| 4a5bd47b6a | |||
| e5742a98df | |||
| 774cecc3b4 | |||
| 83b7e32ec4 | |||
| a22155bd96 | |||
| 1da947f548 | |||
| a3960dfa53 | |||
| bab1917311 | |||
| 49348716f5 | |||
| eb781afe7b | |||
| 39f53c3f8c | |||
| b5307aaaad | |||
| f5cf667c95 | |||
| 737095f852 | |||
| f56952c9e6 | |||
| ca5a7be5e8 | |||
| 582c5a36d7 | |||
| a8058729cc | |||
| a2f024ffe3 | |||
| e1d65cc5e0 | |||
| 75cda8d191 | |||
| af8dcc6ee8 | |||
| 2270bf41d7 | |||
| 489ef6e5e1 | |||
| cecc745844 | |||
| 5366362e47 | |||
| a1ecea60fd | |||
| 882421a03e | |||
| a36f72e886 | |||
| 247e989377 | |||
| 91ae676b9b | |||
| a955e06259 | |||
| 31683ce35b | |||
| d773570cd6 | |||
| 556da2b3fc | |||
| 9e19a6efe1 | |||
| f433b2c433 | |||
| bc0d7d7140 | |||
| 24f8831021 | |||
| 9a8fb80eed | |||
| ca12459b9c | |||
| e1ab911c35 | |||
| 58d4494365 | |||
| d502e5beaa | |||
| b4a95db7da | |||
| 02ba6f9f3a | |||
| dba0010607 | |||
| 90667f6114 | |||
| d6961b2626 | |||
| 07ebb8171f | |||
| 245db73929 | |||
| 9342dae8f0 | |||
| 1f84f50fd8 | |||
| 3326c749f8 | |||
| 0269106066 | |||
| 95d38a8e54 | |||
| dca6afc26e | |||
| 19684f23bc | |||
| 52a561399e | |||
| 0683e8a9a3 | |||
| 1bb4a042e2 | |||
| d10861e478 | |||
| cf7c86d581 | |||
| d99e150097 | |||
| 9e88eb6100 | |||
| 71d9a3e1df | |||
| 6575dcc803 | |||
| 2715e5ba1b | |||
| 9a570b23a3 | |||
| 1b091ecb87 | |||
| a75a5f8b2a | |||
| 80dd02fbdb | |||
| e6755450df | |||
| 9215bf791b | |||
| 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 |
@@ -0,0 +1,21 @@
|
||||
# Build artifacts
|
||||
buildroot/
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
*.exe
|
||||
|
||||
# Web assets
|
||||
*.min.js
|
||||
*.min.css
|
||||
|
||||
# Generated files
|
||||
__pycache__/
|
||||
*.pyc
|
||||
.DS_Store
|
||||
|
||||
# IDE files
|
||||
.vscode/
|
||||
.idea/
|
||||
@@ -7,7 +7,7 @@ contact_links:
|
||||
url: https://www.facebook.com/groups/1049718498464482
|
||||
about: Please ask and answer questions here.
|
||||
- name: 🕹 Marlin on Discord
|
||||
url: https://discord.gg/n5NJ59y
|
||||
url: https://discord.com/servers/marlin-firmware-461605380783472640
|
||||
about: Join the Discord server for support and discussion.
|
||||
- name: 🔗 Marlin Discussion Forum
|
||||
url: https://reprap.org/forum/list.php?415
|
||||
|
||||
@@ -43,7 +43,7 @@ We have a Message Board and a Facebook group where our knowledgable user communi
|
||||
|
||||
If chat is more your speed, you can join the MarlinFirmware Discord server:
|
||||
|
||||
* Use the link https://discord.gg/n5NJ59y to join up as a General User.
|
||||
* Use the link https://discord.com/servers/marlin-firmware-461605380783472640 to join up as a General User.
|
||||
* Even though our Discord is pretty active, it may take a while for community members to respond — please be patient!
|
||||
* Use the `#general` channel for general questions or discussion about Marlin.
|
||||
* Other channels exist for certain topics or are limited to Patrons. Check the channel list.
|
||||
|
||||
@@ -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
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
autolabel:
|
||||
name: Auto Label
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Auto Label for [BUG]
|
||||
uses: actions/github-script@v7
|
||||
|
||||
@@ -14,12 +14,12 @@ jobs:
|
||||
name: Bump Distribution Date
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
name: PR Bad Target
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# test-builds.yml
|
||||
# ci-build-tests.yml
|
||||
# Do test builds to catch compile errors
|
||||
#
|
||||
|
||||
name: CI
|
||||
name: CI - Build Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -14,6 +14,8 @@ on:
|
||||
- config/**
|
||||
- data/**
|
||||
- docs/**
|
||||
- test/**
|
||||
- Marlin/tests/**
|
||||
- '**/*.md'
|
||||
push:
|
||||
branches:
|
||||
@@ -23,21 +25,28 @@ on:
|
||||
- config/**
|
||||
- data/**
|
||||
- docs/**
|
||||
- test/**
|
||||
- Marlin/tests/**
|
||||
- '**/*.md'
|
||||
|
||||
jobs:
|
||||
test_builds:
|
||||
name: Run All Tests
|
||||
name: Build Test
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
test-platform:
|
||||
|
||||
# RP2040
|
||||
- SKR_Pico
|
||||
|
||||
# Native
|
||||
- linux_native
|
||||
- simulator_linux_release
|
||||
|
||||
# AVR
|
||||
- mega2560
|
||||
@@ -100,9 +109,9 @@ jobs:
|
||||
|
||||
# STM32F4
|
||||
- ARMED
|
||||
- BIGTREE_BTT002
|
||||
- BIGTREE_GTR_V1_0
|
||||
- BIGTREE_SKR_PRO
|
||||
- BTT_BTT002
|
||||
- BTT_GTR_V1_0
|
||||
- BTT_SKR_PRO
|
||||
- FLYF407ZG
|
||||
- FYSETC_S6
|
||||
- LERDGEK
|
||||
@@ -152,7 +161,7 @@ jobs:
|
||||
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') }}
|
||||
@@ -160,13 +169,13 @@ 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.9
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
architecture: 'x64'
|
||||
@@ -177,6 +186,13 @@ jobs:
|
||||
pio upgrade --dev
|
||||
pio pkg update --global
|
||||
|
||||
- name: Install Simulator dependencies
|
||||
run: |
|
||||
sudo apt-get install build-essential
|
||||
sudo apt-get install libsdl2-dev
|
||||
sudo apt-get install libsdl2-net-dev
|
||||
sudo apt-get install libglm-dev
|
||||
|
||||
- name: Run ${{ matrix.test-platform }} Tests
|
||||
run: |
|
||||
make tests-single-ci TEST_TARGET=${{ matrix.test-platform }}
|
||||
@@ -0,0 +1,73 @@
|
||||
#
|
||||
# ci-unit-tests.yml
|
||||
# Build and execute unit tests to catch functional issues in code
|
||||
#
|
||||
|
||||
name: CI - Unit Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
# Cannot be enabled on 2.1.x until it contains the unit test framework
|
||||
#- 2.1.x
|
||||
paths-ignore:
|
||||
- config/**
|
||||
- data/**
|
||||
- docs/**
|
||||
- '**/*.md'
|
||||
push:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
# Cannot be enabled on 2.1.x until it contains the unit test framework
|
||||
#- 2.1.x
|
||||
paths-ignore:
|
||||
- config/**
|
||||
- data/**
|
||||
- docs/**
|
||||
- '**/*.md'
|
||||
|
||||
jobs:
|
||||
# This runs all unit tests as a single job. While it should be possible to break this up into
|
||||
# multiple jobs, they currently run quickly and finish long before the compilation tests.
|
||||
run_unit_tests:
|
||||
name: Unit Test
|
||||
# These tests will only be able to run on the bugfix-2.1.x branch, until the next release
|
||||
# pulls them into additional branches.
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
- name: Select Python 3.9
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
pip install -U platformio
|
||||
pio upgrade --dev
|
||||
pio pkg update --global
|
||||
|
||||
- name: Run All Unit Tests
|
||||
run: |
|
||||
make unit-test-all-local
|
||||
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# ci-validate-boards.yml
|
||||
# Validate boards.h to make sure it's all set up correctly
|
||||
#
|
||||
|
||||
name: CI - Validate boards.h
|
||||
|
||||
# We can do the on: section as two items, one for pull requests and one for pushes...
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
paths:
|
||||
- 'Marlin/src/core/boards.h'
|
||||
push:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
paths:
|
||||
- 'Marlin/src/core/boards.h'
|
||||
|
||||
jobs:
|
||||
validate_pins_files:
|
||||
name: Validate boards.h
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Select Python 3.9
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Validate core/boards.h
|
||||
run: |
|
||||
make validate-boards -j
|
||||
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# ci-validate-pins.yml
|
||||
# Validate that all of the pins files are unchanged by pinsformat.py
|
||||
#
|
||||
|
||||
name: CI - Validate Pins Files
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
# Cannot be enabled on 2.1.x until it contains the unit test framework
|
||||
#- 2.1.x
|
||||
paths:
|
||||
- 'Marlin/src/pins/*/**'
|
||||
push:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
# Cannot be enabled on 2.1.x until it contains the unit test framework
|
||||
#- 2.1.x
|
||||
paths:
|
||||
- 'Marlin/src/pins/*/**'
|
||||
|
||||
jobs:
|
||||
validate_pins_files:
|
||||
name: Validate Pins Files
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Select Python 3.9
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Validate all pins files
|
||||
run: |
|
||||
make validate-pins -j
|
||||
@@ -13,7 +13,7 @@ on:
|
||||
|
||||
jobs:
|
||||
remove_label:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -32,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:
|
||||
|
||||
@@ -14,10 +14,10 @@ jobs:
|
||||
name: Close Stale Issues
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v8
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: |
|
||||
|
||||
@@ -14,18 +14,18 @@ jobs:
|
||||
name: Lock Closed Issues
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
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.
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
name: Unlock Reopened
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: OSDKDev/unlock-issues@v1.1
|
||||
|
||||
@@ -125,6 +125,7 @@ vc-fileutils.settings
|
||||
# Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Simulation files
|
||||
imgui.ini
|
||||
@@ -168,3 +169,6 @@ __pycache__
|
||||
tags
|
||||
*.logs
|
||||
*.bak
|
||||
.aider*
|
||||
!.aiderignore
|
||||
.env
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Marlin-specific settings for Zed
|
||||
*
|
||||
* For a full list of overridable settings, and general information on folder-specific settings,
|
||||
* see the documentation: https://zed.dev/docs/configuring-zed#settings-files
|
||||
*/
|
||||
{
|
||||
"languages": {
|
||||
"C": {
|
||||
"enable_language_server": false
|
||||
},
|
||||
"C++": {
|
||||
"enable_language_server": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,24 @@ SCRIPTS_DIR := buildroot/share/scripts
|
||||
CONTAINER_RT_BIN := docker
|
||||
CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio
|
||||
CONTAINER_IMAGE := marlin-dev
|
||||
UNIT_TEST_CONFIG ?= default
|
||||
|
||||
help:
|
||||
@echo "Tasks for local development:"
|
||||
@echo "make marlin : Build marlin for the configured board"
|
||||
@echo "make format-pins : Reformat all pins files"
|
||||
@echo "make marlin : Build Marlin for the configured board"
|
||||
@echo "make format-pins -j : Reformat all pins files (-j for parallel execution)"
|
||||
@echo "make validate-pins -j : Validate all pins files, fails if any require reformatting"
|
||||
@echo "make validate-boards -j : Validate boards.h and pins.h for standards compliance"
|
||||
@echo "make tests-single-ci : Run a single test from inside the CI"
|
||||
@echo "make tests-single-local : Run a single test locally"
|
||||
@echo "make tests-single-local-docker : Run a single test locally, using docker"
|
||||
@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 "make unit-test-single-local : Run unit tests for a single config locally"
|
||||
@echo "make unit-test-single-local-docker : Run unit tests for a single config locally, using docker"
|
||||
@echo "make unit-test-all-local : Run all code tests locally"
|
||||
@echo "make unit-test-all-local-docker : Run all code tests locally, using docker"
|
||||
@echo "make setup-local-docker : Setup local docker using buildx"
|
||||
@echo ""
|
||||
@echo "Options for testing:"
|
||||
@echo " TEST_TARGET Set when running tests-single-*, to select the"
|
||||
@@ -22,6 +29,9 @@ help:
|
||||
@echo " run on GitHub CI"
|
||||
@echo " ONLY_TEST Limit tests to only those that contain this, or"
|
||||
@echo " the index of the test (1-based)"
|
||||
@echo " UNIT_TEST_CONFIG Set the name of the config from the test folder, without"
|
||||
@echo " the leading number. Default is 'default'". Used with the
|
||||
@echo " unit-test-single-* tasks"
|
||||
@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!"
|
||||
@@ -43,23 +53,61 @@ 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)"
|
||||
$(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)"
|
||||
|
||||
tests-all-local:
|
||||
@python -c "import yaml" 2>/dev/null || (echo 'pyyaml module is not installed. Install it with "python -m pip install pyyaml"' && exit 1)
|
||||
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
|
||||
&& for TEST_TARGET in $$(python $(SCRIPTS_DIR)/get_test_targets.py) ; do \
|
||||
if [ "$$TEST_TARGET" = "linux_native" ] && [ "$$(uname)" = "Darwin" ]; then \
|
||||
echo "Skipping tests for $$TEST_TARGET on macOS" ; \
|
||||
continue ; \
|
||||
fi ; \
|
||||
echo "Running tests for $$TEST_TARGET" ; \
|
||||
run_tests . $$TEST_TARGET || exit 1 ; \
|
||||
sleep 5; \
|
||||
done
|
||||
|
||||
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)
|
||||
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
|
||||
|
||||
unit-test-single-local:
|
||||
platformio run -t marlin_$(UNIT_TEST_CONFIG) -e linux_native_test
|
||||
|
||||
unit-test-single-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 unit-test-single-local UNIT_TEST_CONFIG=$(UNIT_TEST_CONFIG)
|
||||
|
||||
unit-test-all-local:
|
||||
platformio run -t test-marlin -e linux_native_test
|
||||
|
||||
unit-test-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 unit-test-all-local
|
||||
|
||||
setup-local-docker:
|
||||
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
|
||||
$(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
|
||||
|
||||
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
|
||||
|
||||
.PHONY: $(PINS) format-pins validate-pins
|
||||
|
||||
$(PINS): %:
|
||||
@echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@
|
||||
@echo "Formatting $@"
|
||||
@python $(SCRIPTS_DIR)/pinsformat.py $< $@
|
||||
|
||||
format-pins: $(PINS)
|
||||
|
||||
validate-pins: format-pins
|
||||
@echo "Validating pins files"
|
||||
@git diff --exit-code || (git status && echo "\nError: Pins files are not formatted correctly. Run \"make format-pins\" to fix.\n" && exit 1)
|
||||
|
||||
BOARDS_FILE := Marlin/src/core/boards.h
|
||||
|
||||
.PHONY: validate-boards
|
||||
|
||||
validate-boards:
|
||||
@echo "Validating boards.h file"
|
||||
@python $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1)
|
||||
|
||||
+151
-77
@@ -50,7 +50,7 @@
|
||||
*
|
||||
* Calibration Guides: https://reprap.org/wiki/Calibration
|
||||
* https://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
|
||||
* https://web.archive.org/web/20220907014303/https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
|
||||
* https://web.archive.org/web/20220907014303/sites.google.com/site/repraplogphase/calibration-of-your-reprap
|
||||
* https://youtu.be/wAL9d7FgInk
|
||||
* https://teachingtechyt.github.io/calibration.html
|
||||
*
|
||||
@@ -61,7 +61,7 @@
|
||||
// @section info
|
||||
|
||||
// Author info of this build printed to the host during boot and M115
|
||||
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
|
||||
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Original author or contributor.
|
||||
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
|
||||
|
||||
// @section machine
|
||||
@@ -71,13 +71,15 @@
|
||||
#define MOTHERBOARD BOARD_RAMPS_14_EFB
|
||||
#endif
|
||||
|
||||
// @section serial
|
||||
|
||||
/**
|
||||
* Select the serial port on the board to use for communication with the host.
|
||||
* This allows the connection of wireless adapters (for instance) to non-default port pins.
|
||||
* Serial port -1 is the USB emulated serial port, if available.
|
||||
* Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader.
|
||||
*
|
||||
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
|
||||
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
*/
|
||||
#define SERIAL_PORT 0
|
||||
|
||||
@@ -99,19 +101,29 @@
|
||||
/**
|
||||
* Select a secondary serial port on the board to use for communication with the host.
|
||||
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
|
||||
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
|
||||
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
*/
|
||||
//#define SERIAL_PORT_2 -1
|
||||
//#define BAUDRATE_2 250000 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE
|
||||
|
||||
/**
|
||||
* Select a third serial port on the board to use for communication with the host.
|
||||
* Currently only supported for AVR, DUE, LPC1768/9 and STM32/STM32F1
|
||||
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
|
||||
* Currently supported for AVR, DUE, SAMD51, LPC1768/9, STM32/STM32F1/HC32, and Teensy 4.x
|
||||
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
*/
|
||||
//#define SERIAL_PORT_3 1
|
||||
//#define BAUDRATE_3 250000 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE
|
||||
|
||||
/**
|
||||
* Select a serial port to communicate with RS485 protocol
|
||||
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
*/
|
||||
//#define RS485_SERIAL_PORT 1
|
||||
#ifdef RS485_SERIAL_PORT
|
||||
//#define M485_PROTOCOL 1 // Check your host for protocol compatibility
|
||||
//#define RS485_BUS_BUFFER_SIZE 128
|
||||
#endif
|
||||
|
||||
// Enable the Bluetooth serial interface on AT90USB devices
|
||||
//#define BLUETOOTH
|
||||
|
||||
@@ -135,9 +147,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
|
||||
@@ -375,14 +387,15 @@
|
||||
* PRUSA_MMU1 : Průša MMU1 (The "multiplexer" version)
|
||||
* PRUSA_MMU2 : Průša MMU2
|
||||
* PRUSA_MMU2S : Průša MMU2S (Requires MK3S extruder with motion sensor, EXTRUDERS = 5)
|
||||
* PRUSA_MMU3 : Průša MMU3 (Requires MK3S extruder with motion sensor and MMU firmware version 3.x.x, EXTRUDERS = 5)
|
||||
* EXTENDABLE_EMU_MMU2 : MMU with configurable number of filaments (ERCF, SMuFF or similar with Průša MMU2 compatible firmware)
|
||||
* EXTENDABLE_EMU_MMU2S : MMUS with configurable number of filaments (ERCF, SMuFF or similar with Průša MMU2 compatible firmware)
|
||||
*
|
||||
* Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails.
|
||||
* See additional options in Configuration_adv.h.
|
||||
* :["PRUSA_MMU1", "PRUSA_MMU2", "PRUSA_MMU2S", "EXTENDABLE_EMU_MMU2", "EXTENDABLE_EMU_MMU2S"]
|
||||
* :["PRUSA_MMU1", "PRUSA_MMU2", "PRUSA_MMU2S", "PRUSA_MMU3", "EXTENDABLE_EMU_MMU2", "EXTENDABLE_EMU_MMU2S"]
|
||||
*/
|
||||
//#define MMU_MODEL PRUSA_MMU2
|
||||
//#define MMU_MODEL PRUSA_MMU3
|
||||
|
||||
// @section psu control
|
||||
|
||||
@@ -401,9 +414,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
|
||||
@@ -663,7 +685,7 @@
|
||||
* MPCTEMP : Predictive Model temperature control. (~1.8K without auto-tune)
|
||||
*/
|
||||
#define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning
|
||||
//#define MPCTEMP // ** EXPERIMENTAL ** See https://marlinfw.org/docs/features/model_predictive_control.html
|
||||
//#define MPCTEMP // See https://marlinfw.org/docs/features/model_predictive_control.html
|
||||
|
||||
#define PID_MAX 255 // Limit hotend current while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
|
||||
#define PID_K1 0.95 // Smoothing factor within any PID loop
|
||||
@@ -694,10 +716,13 @@
|
||||
* Use a physical model of the hotend to control temperature. When configured correctly this gives
|
||||
* better responsiveness and stability than PID and removes the need for PID_EXTRUSION_SCALING
|
||||
* and PID_FAN_SCALING. Enable MPC_AUTOTUNE and use M306 T to autotune the model.
|
||||
* @section mpctemp
|
||||
* @section mpc temp
|
||||
*/
|
||||
#if ENABLED(MPCTEMP)
|
||||
#define MPC_AUTOTUNE // Include a method to do MPC auto-tuning (~6.3K bytes of flash)
|
||||
#if ENABLED(MPC_AUTOTUNE)
|
||||
//#define MPC_AUTOTUNE_DEBUG // Enable MPC debug logging (~870 bytes of flash)
|
||||
#endif
|
||||
//#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1.3K bytes of flash)
|
||||
//#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash)
|
||||
|
||||
@@ -779,6 +804,40 @@
|
||||
//#define BED_LIMIT_SWITCHING // Keep the bed temperature within BED_HYSTERESIS of the target
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Peltier Bed - Heating and Cooling
|
||||
*
|
||||
* A Peltier device transfers heat from one side to the other in proportion to the amount of
|
||||
* current flowing through the device and the direction of current flow. So the same device
|
||||
* can both heat and cool.
|
||||
*
|
||||
* When "cooling" in addition to rejecting the heat transferred from the hot side to the cold
|
||||
* side, the dissipated power (voltage * current) must also be rejected. Be sure to set up a
|
||||
* fan that can be powered in sync with the Peltier unit.
|
||||
*
|
||||
* This feature is only set up to run in bang-bang mode because Peltiers don't handle PWM
|
||||
* well without filter circuitry.
|
||||
*
|
||||
* Since existing 3D printers are made to handle relatively high current for the heated bed,
|
||||
* we can use the heated bed power pins to control the Peltier power using the same G-codes
|
||||
* as the heated bed (M140, M190, etc.).
|
||||
*
|
||||
* A second GPIO pin is required to control current direction.
|
||||
* Two configurations are possible: Relay and H-Bridge
|
||||
*
|
||||
* (At this time only relay is supported. H-bridge requires 4 MOS switches configured in H-Bridge.)
|
||||
*
|
||||
* Power is handled by the bang-bang control loop: 0 or 255.
|
||||
* Cooling applications are more common than heating, so the pin states are commonly:
|
||||
* LOW = Heating = Relay Energized
|
||||
* HIGH = Cooling = Relay in "Normal" state
|
||||
*/
|
||||
//#define PELTIER_BED
|
||||
#if ENABLED(PELTIER_BED)
|
||||
#define PELTIER_DIR_PIN -1 // Relay control pin for Peltier
|
||||
#define PELTIER_DIR_HEAT_STATE LOW // The relay pin state that causes the Peltier to heat
|
||||
#endif
|
||||
|
||||
// Add 'M190 R T' for more gradual M190 R bed cooling.
|
||||
//#define BED_ANNEALING_GCODE
|
||||
|
||||
@@ -819,14 +878,16 @@
|
||||
// Lasko "MyHeat Personal Heater" (200w) modified with a Fotek SSR-10DA to control only the heating element
|
||||
// and placed inside the small Creality printer enclosure tent.
|
||||
//
|
||||
#define DEFAULT_chamberKp 37.04
|
||||
#define DEFAULT_chamberKi 1.40
|
||||
#define DEFAULT_chamberKp 37.04
|
||||
#define DEFAULT_chamberKi 1.40
|
||||
#define DEFAULT_chamberKd 655.17
|
||||
// M309 P37.04 I1.04 D655.17
|
||||
|
||||
// FIND YOUR OWN: "M303 E-2 C8 S50" to run autotune on the chamber at 50 degreesC for 8 cycles.
|
||||
#endif // PIDTEMPCHAMBER
|
||||
|
||||
// @section pid temp
|
||||
|
||||
#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER)
|
||||
//#define PID_OPENLOOP // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
|
||||
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
|
||||
@@ -882,7 +943,7 @@
|
||||
//============================= Mechanical Settings =========================
|
||||
//===========================================================================
|
||||
|
||||
// @section machine
|
||||
// @section kinematics
|
||||
|
||||
// Enable one of the options below for CoreXY, CoreXZ, or CoreYZ kinematics,
|
||||
// either in the usual order or reversed
|
||||
@@ -906,6 +967,15 @@
|
||||
// Enable for a belt style printer with endless "Z" motion
|
||||
//#define BELTPRINTER
|
||||
|
||||
// Articulated robot (arm). Joints are directly mapped to axes with no kinematics.
|
||||
//#define ARTICULATED_ROBOT_ARM
|
||||
|
||||
// For a hot wire cutter with parallel horizontal axes (X, I) where the heights of the two wire
|
||||
// ends are controlled by parallel axes (Y, J). Joints are directly mapped to axes (no kinematics).
|
||||
//#define FOAMCUTTER_XYUV
|
||||
|
||||
// @section polargraph
|
||||
|
||||
// Enable for Polargraph Kinematics
|
||||
//#define POLARGRAPH
|
||||
#if ENABLED(POLARGRAPH)
|
||||
@@ -1006,9 +1076,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
|
||||
@@ -1027,23 +1094,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
|
||||
@@ -1099,15 +1162,6 @@
|
||||
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
|
||||
#endif
|
||||
|
||||
// @section machine
|
||||
|
||||
// Articulated robot (arm). Joints are directly mapped to axes with no kinematics.
|
||||
//#define ARTICULATED_ROBOT_ARM
|
||||
|
||||
// For a hot wire cutter with parallel horizontal axes (X, I) where the heights of the two wire
|
||||
// ends are controlled by parallel axes (Y, J). Joints are directly mapped to axes (no kinematics).
|
||||
//#define FOAMCUTTER_XYUV
|
||||
|
||||
//===========================================================================
|
||||
//============================== Endstop Settings ===========================
|
||||
//===========================================================================
|
||||
@@ -1452,7 +1506,8 @@
|
||||
* A lightweight, solenoid-driven probe.
|
||||
* For information about this sensor https://github.com/bigtreetech/MicroProbe
|
||||
*
|
||||
* Also requires: PROBE_ENABLE_DISABLE
|
||||
* Also requires PROBE_ENABLE_DISABLE
|
||||
* With FT_MOTION requires ENDSTOP_INTERRUPTS_FEATURE
|
||||
*/
|
||||
//#define BIQU_MICROPROBE_V1 // Triggers HIGH
|
||||
//#define BIQU_MICROPROBE_V2 // Triggers LOW
|
||||
@@ -1591,7 +1646,8 @@
|
||||
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
|
||||
#define PROBING_MARGIN 10
|
||||
|
||||
// X and Y axis travel speed (mm/min) between probes
|
||||
// X and Y axis travel speed (mm/min) between probes.
|
||||
// Leave undefined to use the average of the current XY homing feedrate.
|
||||
#define XY_PROBE_FEEDRATE (133*60)
|
||||
|
||||
// Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2)
|
||||
@@ -1622,6 +1678,7 @@
|
||||
#define PROBE_TARE_DELAY 200 // (ms) Delay after tare before
|
||||
#define PROBE_TARE_STATE HIGH // State to write pin for tare
|
||||
//#define PROBE_TARE_PIN PA5 // Override default pin
|
||||
//#define PROBE_TARE_MENU // Display a menu item to tare the probe
|
||||
#if ENABLED(PROBE_ACTIVATION_SWITCH)
|
||||
//#define PROBE_TARE_ONLY_WHILE_INACTIVE // Fail to tare/probe if PROBE_ACTIVATION_SWITCH is active
|
||||
#endif
|
||||
@@ -1659,8 +1716,8 @@
|
||||
* probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD.
|
||||
* Only integer values >= 1 are valid here.
|
||||
*
|
||||
* 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.
|
||||
* 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 // (mm) Z Clearance for Deploy/Stow
|
||||
#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points
|
||||
@@ -1711,6 +1768,8 @@
|
||||
#define PROBING_BED_TEMP 50
|
||||
#endif
|
||||
|
||||
// @section stepper drivers
|
||||
|
||||
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
|
||||
// :{ 0:'Low', 1:'High' }
|
||||
#define X_ENABLE_ON 0
|
||||
@@ -1884,6 +1943,8 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @section filament runout sensors
|
||||
*
|
||||
* Filament Runout Sensors
|
||||
* Mechanical or opto endstops are used to check for the presence of filament.
|
||||
*
|
||||
@@ -1995,9 +2056,9 @@
|
||||
//#define FIL_MOTION8_PULLUP
|
||||
//#define FIL_MOTION8_PULLDOWN
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif // FILAMENT_MOTION_SENSOR
|
||||
#endif // FILAMENT_RUNOUT_DISTANCE_MM
|
||||
#endif // FILAMENT_RUNOUT_SENSOR
|
||||
|
||||
//===========================================================================
|
||||
//=============================== Bed Leveling ==============================
|
||||
@@ -2216,7 +2277,7 @@
|
||||
#if ENABLED(LCD_BED_TRAMMING)
|
||||
#define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets
|
||||
#define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at tramming points
|
||||
#define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between tramming points
|
||||
#define BED_TRAMMING_Z_HOP 4.0 // (mm) Z raise between tramming points
|
||||
//#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner
|
||||
//#define BED_TRAMMING_USE_PROBE
|
||||
#if ENABLED(BED_TRAMMING_USE_PROBE)
|
||||
@@ -2280,6 +2341,9 @@
|
||||
// Homing speeds (linear=mm/min, rotational=°/min)
|
||||
#define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (4*60) }
|
||||
|
||||
// Edit homing feedrates with M210 and MarlinUI menu items
|
||||
//#define EDITABLE_HOMING_FEEDRATE
|
||||
|
||||
// Validate that endstops are triggered on homing moves
|
||||
#define VALIDATE_HOMING_ENDSTOPS
|
||||
|
||||
@@ -2406,9 +2470,9 @@
|
||||
#define PREHEAT_2_TEMP_CHAMBER 35
|
||||
#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
|
||||
|
||||
// @section motion
|
||||
|
||||
/**
|
||||
* @section nozzle park
|
||||
*
|
||||
* Nozzle Park
|
||||
*
|
||||
* Park the nozzle at the given XYZ position on idle or G27.
|
||||
@@ -2431,6 +2495,8 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @section nozzle clean
|
||||
*
|
||||
* Clean Nozzle Feature
|
||||
*
|
||||
* Adds the G12 command to perform a nozzle cleaning process.
|
||||
@@ -2591,9 +2657,24 @@
|
||||
//#include "Configuration_Secure.h" // External file with PASSWORD_DEFAULT_VALUE
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
//============================= LCD and SD support ============================
|
||||
//=============================================================================
|
||||
// @section media
|
||||
|
||||
/**
|
||||
* SD CARD
|
||||
*
|
||||
* SD Card support is disabled by default. If your controller has an SD slot,
|
||||
* you must uncomment the following option or it won't work.
|
||||
*/
|
||||
//#define SDSUPPORT
|
||||
|
||||
/**
|
||||
* SD CARD: ENABLE CRC
|
||||
*
|
||||
* Use CRC checks and retries on the SD communication.
|
||||
*/
|
||||
#if ENABLED(SDSUPPORT)
|
||||
//#define SD_CHECK_AND_RETRY
|
||||
#endif
|
||||
|
||||
// @section interface
|
||||
|
||||
@@ -2634,27 +2715,12 @@
|
||||
#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
|
||||
|
||||
/**
|
||||
* SD CARD
|
||||
*
|
||||
* SD Card support is disabled by default. If your controller has an SD slot,
|
||||
* you must uncomment the following option or it won't work.
|
||||
*/
|
||||
//#define SDSUPPORT
|
||||
|
||||
/**
|
||||
* SD CARD: ENABLE CRC
|
||||
*
|
||||
* Use CRC checks and retries on the SD communication.
|
||||
*/
|
||||
//#define SD_CHECK_AND_RETRY
|
||||
|
||||
/**
|
||||
* LCD Menu Items
|
||||
*
|
||||
@@ -2783,7 +2849,7 @@
|
||||
|
||||
//
|
||||
// Original RADDS LCD Display+Encoder+SDCardReader
|
||||
// https://web.archive.org/web/20200719145306/http://doku.radds.org/dokumentation/lcd-display/
|
||||
// https://web.archive.org/web/20200719145306/doku.radds.org/dokumentation/lcd-display/
|
||||
//
|
||||
//#define RADDS_DISPLAY
|
||||
|
||||
@@ -2849,7 +2915,7 @@
|
||||
|
||||
//
|
||||
// Elefu RA Board Control Panel
|
||||
// https://web.archive.org/web/20140823033947/http://www.elefu.com/index.php?route=product/product&product_id=53
|
||||
// https://web.archive.org/web/20140823033947/www.elefu.com/index.php?route=product/product&product_id=53
|
||||
//
|
||||
//#define RA_CONTROL_PANEL
|
||||
|
||||
@@ -2981,7 +3047,7 @@
|
||||
|
||||
//
|
||||
// Cartesio UI
|
||||
// https://web.archive.org/web/20180605050442/http://mauk.cc/webshop/cartesio-shop/electronics/user-interface
|
||||
// https://web.archive.org/web/20180605050442/mauk.cc/webshop/cartesio-shop/electronics/user-interface
|
||||
//
|
||||
//#define CARTESIO_UI
|
||||
|
||||
@@ -3218,6 +3284,11 @@
|
||||
//
|
||||
//#define ANYCUBIC_LCD_VYPER
|
||||
|
||||
//
|
||||
// Sovol SV-06 Resistive Touch Screen
|
||||
//
|
||||
//#define SOVOL_SV06_RTS
|
||||
|
||||
//
|
||||
// 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
|
||||
//
|
||||
@@ -3389,6 +3460,8 @@
|
||||
* TFT_ROTATE_180, TFT_ROTATE_180_MIRROR_X, TFT_ROTATE_180_MIRROR_Y,
|
||||
* TFT_ROTATE_270, TFT_ROTATE_270_MIRROR_X, TFT_ROTATE_270_MIRROR_Y,
|
||||
* TFT_MIRROR_X, TFT_MIRROR_Y, TFT_NO_ROTATION
|
||||
*
|
||||
* :{ 'TFT_NO_ROTATION':'None', 'TFT_ROTATE_90':'90°', 'TFT_ROTATE_90_MIRROR_X':'90° (Mirror X)', 'TFT_ROTATE_90_MIRROR_Y':'90° (Mirror Y)', 'TFT_ROTATE_180':'180°', 'TFT_ROTATE_180_MIRROR_X':'180° (Mirror X)', 'TFT_ROTATE_180_MIRROR_Y':'180° (Mirror Y)', 'TFT_ROTATE_270':'270°', 'TFT_ROTATE_270_MIRROR_X':'270° (Mirror X)', 'TFT_ROTATE_270_MIRROR_Y':'270° (Mirror Y)', 'TFT_MIRROR_X':'Mirror X', 'TFT_MIRROR_Y':'Mirror Y' }
|
||||
*/
|
||||
//#define TFT_ROTATION TFT_NO_ROTATION
|
||||
|
||||
@@ -3413,8 +3486,9 @@
|
||||
#define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens
|
||||
#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.
|
||||
#if ANY(TFT_CLASSIC_UI, TFT_COLOR_UI)
|
||||
//#define NO_BACK_MENU_ITEM // Don't display a top menu item to go back to the parent menu
|
||||
#endif
|
||||
|
||||
#define TOUCH_SCREEN_CALIBRATION
|
||||
|
||||
|
||||
+268
-141
@@ -47,8 +47,9 @@
|
||||
* 2 = config.ini - File format for PlatformIO preprocessing.
|
||||
* 3 = schema.json - The entire configuration schema. (13 = pattern groups)
|
||||
* 4 = schema.yml - The entire configuration schema.
|
||||
* 5 = Config.h - Minimal configuration by popular demand.
|
||||
*/
|
||||
//#define CONFIG_EXPORT 2 // :[1:'JSON', 2:'config.ini', 3:'schema.json', 4:'schema.yml']
|
||||
//#define CONFIG_EXPORT 105 // :[1:'JSON', 2:'config.ini', 3:'schema.json', 4:'schema.yml', 5:'Config.h']
|
||||
|
||||
//===========================================================================
|
||||
//============================= Thermal Settings ============================
|
||||
@@ -202,7 +203,7 @@
|
||||
//
|
||||
#if DISABLED(PIDTEMPBED)
|
||||
#define BED_CHECK_INTERVAL 5000 // (ms) Interval between checks in bang-bang control
|
||||
#if ENABLED(BED_LIMIT_SWITCHING)
|
||||
#if ANY(BED_LIMIT_SWITCHING, PELTIER_BED)
|
||||
#define BED_HYSTERESIS 2 // (°C) Only set the relevant heater state when ABS(T-target) > BED_HYSTERESIS
|
||||
#endif
|
||||
#endif
|
||||
@@ -303,9 +304,9 @@
|
||||
* If you get false positives for "Thermal Runaway", increase
|
||||
* THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
|
||||
#define THERMAL_PROTECTION_PERIOD 40 // (seconds)
|
||||
#define THERMAL_PROTECTION_HYSTERESIS 4 // (°C)
|
||||
#if ALL(HAS_HOTEND, THERMAL_PROTECTION_HOTENDS)
|
||||
#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)
|
||||
@@ -334,7 +335,7 @@
|
||||
/**
|
||||
* Thermal Protection parameters for the bed are just as above for hotends.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_BED)
|
||||
#if TEMP_SENSOR_BED && ENABLED(THERMAL_PROTECTION_BED)
|
||||
#define THERMAL_PROTECTION_BED_PERIOD 20 // (seconds)
|
||||
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // (°C)
|
||||
|
||||
@@ -348,7 +349,7 @@
|
||||
/**
|
||||
* Thermal Protection parameters for the heated chamber.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
|
||||
#if TEMP_SENSOR_CHAMBER && ENABLED(THERMAL_PROTECTION_CHAMBER)
|
||||
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // (seconds)
|
||||
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // (°C)
|
||||
|
||||
@@ -362,7 +363,7 @@
|
||||
/**
|
||||
* Thermal Protection parameters for the laser cooler.
|
||||
*/
|
||||
#if ENABLED(THERMAL_PROTECTION_COOLER)
|
||||
#if TEMP_SENSOR_COOLER && ENABLED(THERMAL_PROTECTION_COOLER)
|
||||
#define THERMAL_PROTECTION_COOLER_PERIOD 10 // (seconds)
|
||||
#define THERMAL_PROTECTION_COOLER_HYSTERESIS 3 // (°C)
|
||||
|
||||
@@ -590,6 +591,8 @@
|
||||
// Use TEMP_SENSOR_SOC as a trigger for enabling the controller fan
|
||||
//#define CONTROLLER_FAN_MIN_SOC_TEMP 40 // (°C) Turn on the fan if the SoC reaches this temperature
|
||||
|
||||
#define CONTROLLER_FAN_BED_HEATING // Turn on the fan when heating the bed
|
||||
|
||||
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
|
||||
#if ENABLED(CONTROLLER_FAN_EDITABLE)
|
||||
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu
|
||||
@@ -604,6 +607,8 @@
|
||||
*/
|
||||
//#define FAN_KICKSTART_TIME 100 // (ms)
|
||||
//#define FAN_KICKSTART_POWER 180 // 64-255
|
||||
//#define FAN_KICKSTART_LINEAR // Set kickstart time linearly based on the speed, e.g., for 20% (51) it will be FAN_KICKSTART_TIME * 0.2.
|
||||
// Useful for quick speed up to low speed. Kickstart power must be set to 255.
|
||||
|
||||
// Some coolers may require a non-zero "off" state.
|
||||
//#define FAN_OFF_PWM 1
|
||||
@@ -1079,9 +1084,11 @@
|
||||
#define HOME_AFTER_G34
|
||||
#endif
|
||||
|
||||
//
|
||||
// Add the G35 command to read bed corners to help adjust screws. Requires a bed probe.
|
||||
//
|
||||
/**
|
||||
* Assisted Tramming
|
||||
*
|
||||
* Add the G35 command to measure bed corners and help adjust screws. Requires a bed probe.
|
||||
*/
|
||||
//#define ASSISTED_TRAMMING
|
||||
#if ENABLED(ASSISTED_TRAMMING)
|
||||
|
||||
@@ -1102,29 +1109,35 @@
|
||||
//#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment
|
||||
|
||||
/**
|
||||
* Screw thread:
|
||||
* M3: 30 = Clockwise, 31 = Counter-Clockwise
|
||||
* M4: 40 = Clockwise, 41 = Counter-Clockwise
|
||||
* M5: 50 = Clockwise, 51 = Counter-Clockwise
|
||||
* Screw Thread. Use one of the following defines:
|
||||
*
|
||||
* M3_CW = M3 Clockwise, M3_CCW = M3 Counter-Clockwise
|
||||
* M4_CW = M4 Clockwise, M4_CCW = M4 Counter-Clockwise
|
||||
* M5_CW = M5 Clockwise, M5_CCW = M5 Counter-Clockwise
|
||||
*
|
||||
* :{'M3_CW':'M3 Clockwise','M3_CCW':'M3 Counter-Clockwise','M4_CW':'M4 Clockwise','M4_CCW':'M4 Counter-Clockwise','M5_CW':'M5 Clockwise','M5_CCW':'M5 Counter-Clockwise'}
|
||||
*/
|
||||
#define TRAMMING_SCREW_THREAD 30
|
||||
#define TRAMMING_SCREW_THREAD M3_CW
|
||||
|
||||
#endif
|
||||
|
||||
// @section motion control
|
||||
|
||||
/**
|
||||
* Fixed-time-based Motion Control -- EXPERIMENTAL
|
||||
* Fixed-time-based Motion Control -- BETA FEATURE
|
||||
* Enable/disable and set parameters with G-code M493.
|
||||
* See ft_types.h for named values used by FTM options.
|
||||
*/
|
||||
//#define FT_MOTION
|
||||
#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_IS_DEFAULT_MOTION // Use FT Motion as the factory default?
|
||||
#define FTM_DEFAULT_DYNFREQ_MODE dynFreqMode_DISABLED // Default mode of dynamic frequency calculation. (DISABLED, Z_BASED, MASS_BASED)
|
||||
#define FTM_DEFAULT_SHAPER_X ftMotionShaper_NONE // Default shaper mode on X axis (NONE, ZV, ZVD, ZVDD, ZVDDD, EI, 2HEI, 3HEI, MZV)
|
||||
#define FTM_DEFAULT_SHAPER_Y ftMotionShaper_NONE // Default shaper mode on Y axis
|
||||
#define FTM_SHAPING_DEFAULT_FREQ_X 37.0f // (Hz) Default peak frequency used by input shapers
|
||||
#define FTM_SHAPING_DEFAULT_FREQ_Y 37.0f // (Hz) Default peak frequency used by input shapers
|
||||
#define FTM_LINEAR_ADV_DEFAULT_ENA false // Default linear advance enable (true) or disable (false)
|
||||
#define FTM_LINEAR_ADV_DEFAULT_K 0.0f // Default linear advance gain
|
||||
#define FTM_LINEAR_ADV_DEFAULT_K 0.0f // Default linear advance gain. (Acceleration-based scaling factor.)
|
||||
#define FTM_SHAPING_ZETA_X 0.1f // Zeta used by input shapers for X axis
|
||||
#define FTM_SHAPING_ZETA_Y 0.1f // Zeta used by input shapers for Y axis
|
||||
|
||||
@@ -1147,18 +1160,13 @@
|
||||
#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)
|
||||
|
||||
// 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
|
||||
@@ -1180,38 +1188,37 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Input Shaping -- EXPERIMENTAL
|
||||
* Input Shaping
|
||||
*
|
||||
* Zero Vibration (ZV) Input Shaping for X and/or Y movements.
|
||||
*
|
||||
* This option uses a lot of SRAM for the step buffer. The buffer size is
|
||||
* calculated automatically from SHAPING_FREQ_[XY], DEFAULT_AXIS_STEPS_PER_UNIT,
|
||||
* calculated automatically from SHAPING_FREQ_[XYZ], DEFAULT_AXIS_STEPS_PER_UNIT,
|
||||
* DEFAULT_MAX_FEEDRATE and ADAPTIVE_STEP_SMOOTHING. The default calculation can
|
||||
* be overridden by setting SHAPING_MIN_FREQ and/or SHAPING_MAX_FEEDRATE.
|
||||
* The higher the frequency and the lower the feedrate, the smaller the buffer.
|
||||
* If the buffer is too small at runtime, input shaping will have reduced
|
||||
* effectiveness during high speed movements.
|
||||
*
|
||||
* Tune with M593 D<factor> F<frequency>:
|
||||
*
|
||||
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes.
|
||||
* F<frequency> Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes.
|
||||
* T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet)
|
||||
* X<1> Set the given parameters only for the X axis.
|
||||
* Y<1> Set the given parameters only for the Y axis.
|
||||
* Tune with M593 D<factor> F<frequency>
|
||||
*/
|
||||
//#define INPUT_SHAPING_X
|
||||
//#define INPUT_SHAPING_Y
|
||||
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
|
||||
//#define INPUT_SHAPING_Z
|
||||
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z)
|
||||
#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.
|
||||
#if ENABLED(INPUT_SHAPING_Z)
|
||||
#define SHAPING_FREQ_Z 40.0 // (Hz) The default dominant resonant frequency on the Z axis.
|
||||
#define SHAPING_ZETA_Z 0.15 // Damping ratio of the Z axis (range: 0.0 = no damping to 1.0 = critical damping).
|
||||
#endif
|
||||
//#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
|
||||
@@ -1253,8 +1260,8 @@
|
||||
#define DISABLE_IDLE_E // Shut down all idle extruders
|
||||
|
||||
// Default Minimum Feedrates for printing and travel moves
|
||||
#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum feedrate. Set with M205 S.
|
||||
#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum travel feedrate. Set with M205 T.
|
||||
#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S.
|
||||
#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T.
|
||||
|
||||
// Minimum time that a segment needs to take as the buffer gets emptied
|
||||
#define DEFAULT_MINSEGMENTTIME 20000 // (µs) Set with M205 B.
|
||||
@@ -1270,11 +1277,11 @@
|
||||
* 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 // (%) 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
|
||||
|
||||
//
|
||||
@@ -1332,8 +1339,6 @@
|
||||
//#define CALIBRATION_SCRIPT_PRE "M117 Starting Auto-Calibration\nT0\nG28\nG12\nM117 Calibrating..."
|
||||
//#define CALIBRATION_SCRIPT_POST "M500\nM117 Calibration data saved"
|
||||
|
||||
#define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm
|
||||
|
||||
#define CALIBRATION_FEEDRATE_SLOW 60 // mm/min
|
||||
#define CALIBRATION_FEEDRATE_FAST 1200 // mm/min
|
||||
#define CALIBRATION_FEEDRATE_TRAVEL 3000 // mm/min
|
||||
@@ -1492,8 +1497,17 @@
|
||||
#define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Probe Offset Wizard
|
||||
* Add a Probe Z Offset calibration option to the LCD menu.
|
||||
* Use this helper to get a perfect 'M851 Z' probe offset.
|
||||
* When launched this powerful wizard:
|
||||
* - Measures the bed height at the configured position with the probe.
|
||||
* - Moves the nozzle to the same position for a "paper" measurement.
|
||||
* - The difference is used to set the probe Z offset.
|
||||
*/
|
||||
#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
|
||||
//#define PROBE_OFFSET_WIZARD
|
||||
#if ENABLED(PROBE_OFFSET_WIZARD)
|
||||
/**
|
||||
* Enable to init the Probe Z-Offset when starting the Wizard.
|
||||
@@ -1510,6 +1524,10 @@
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
|
||||
// Show Deploy / Stow Probe options in the Motion menu.
|
||||
#define PROBE_DEPLOY_STOW_MENU
|
||||
|
||||
// Add calibration in the Probe Offsets menu to compensate for X-axis twist.
|
||||
//#define X_AXIS_TWIST_COMPENSATION
|
||||
#if ENABLED(X_AXIS_TWIST_COMPENSATION)
|
||||
@@ -1524,8 +1542,6 @@
|
||||
#define XATC_Z_OFFSETS { 0, 0, 0 } // Z offsets for X axis sample points
|
||||
#endif
|
||||
|
||||
// Show Deploy / Stow Probe options in the Motion menu.
|
||||
#define PROBE_DEPLOY_STOW_MENU
|
||||
#endif
|
||||
|
||||
// Include a page of printer information in the LCD Main Menu
|
||||
@@ -1556,6 +1572,9 @@
|
||||
// BACK menu items keep the highlight at the top
|
||||
//#define TURBO_BACK_MENU_ITEM
|
||||
|
||||
// BACK menu items show "Back" instead of the previous menu name
|
||||
//#define GENERIC_BACK_MENU_ITEM
|
||||
|
||||
// Insert a menu for preheating at the top level to allow for quick access
|
||||
//#define PREHEAT_SHORTCUT_MENU_ITEM
|
||||
|
||||
@@ -1584,7 +1603,7 @@
|
||||
#if HAS_MARLINUI_U8GLIB
|
||||
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash.
|
||||
#endif
|
||||
#if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE)
|
||||
#if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, HAS_MARLINUI_HD44780)
|
||||
//#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup.
|
||||
#endif
|
||||
#endif
|
||||
@@ -1970,17 +1989,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.
|
||||
@@ -2229,13 +2237,20 @@
|
||||
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
|
||||
#endif
|
||||
|
||||
//
|
||||
// LCD Backlight Timeout
|
||||
// Requires a display with a controllable backlight
|
||||
//
|
||||
/**
|
||||
* 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 timeout with M255 S<minutes> and a menu item
|
||||
#define EDITABLE_DISPLAY_TIMEOUT // Edit sleep / backlight timeout with M255 S<minutes> and a menu item
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -2334,6 +2349,7 @@
|
||||
*
|
||||
* 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).
|
||||
* For better results also enable ADAPTIVE_STEP_SMOOTHING.
|
||||
*/
|
||||
//#define NONLINEAR_EXTRUSION
|
||||
|
||||
@@ -2561,27 +2577,28 @@
|
||||
//#define MINIMUM_STEPPER_PRE_DIR_DELAY 650
|
||||
|
||||
/**
|
||||
* Minimum stepper driver pulse width (in µs)
|
||||
* 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers
|
||||
* 0 : Minimum 500ns for LV8729, adjusted in stepper.h
|
||||
* 1 : Minimum for A4988 and A5984 stepper drivers
|
||||
* 2 : Minimum for DRV8825 stepper drivers
|
||||
* 3 : Minimum for TB6600 stepper drivers
|
||||
* 30 : Minimum for TB6560 stepper drivers
|
||||
* Minimum stepper driver pulse width (in ns)
|
||||
* If undefined, these defaults (from Conditionals-4-adv.h) apply:
|
||||
* 100 : Minimum for TMC2xxx stepper drivers
|
||||
* 500 : Minimum for LV8729
|
||||
* 1000 : Minimum for A4988 and A5984 stepper drivers
|
||||
* 2000 : Minimum for DRV8825 stepper drivers
|
||||
* 3000 : Minimum for TB6600 stepper drivers
|
||||
* 30000 : Minimum for TB6560 stepper drivers
|
||||
*
|
||||
* Override the default value based on the driver type set in Configuration.h.
|
||||
*/
|
||||
//#define MINIMUM_STEPPER_PULSE 2
|
||||
//#define MINIMUM_STEPPER_PULSE_NS 2000
|
||||
|
||||
/**
|
||||
* Maximum stepping rate (in Hz) the stepper driver allows
|
||||
* If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE)
|
||||
* If undefined, these defaults (from Conditionals-4-adv.h) apply:
|
||||
* 5000000 : Maximum for TMC2xxx stepper drivers
|
||||
* 1000000 : Maximum for LV8729 stepper driver
|
||||
* 500000 : Maximum for A4988 stepper driver
|
||||
* 250000 : Maximum for DRV8825 stepper driver
|
||||
* 150000 : Maximum for TB6600 stepper driver
|
||||
* 15000 : Maximum for TB6560 stepper driver
|
||||
* 500000 : Maximum for A4988 stepper driver
|
||||
* 250000 : Maximum for DRV8825 stepper driver
|
||||
* 150000 : Maximum for TB6600 stepper driver
|
||||
* 15000 : Maximum for TB6560 stepper driver
|
||||
*
|
||||
* Override the default value based on the driver type set in Configuration.h.
|
||||
*/
|
||||
@@ -2702,14 +2719,14 @@
|
||||
* 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.
|
||||
* Support is currently limited to some STM32 MCUs and all HC32 MCUs.
|
||||
* 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.
|
||||
* This can help to better align the output of commands like 'G29 O' Mesh Output.
|
||||
*
|
||||
* For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0.
|
||||
* Otherwise, adjust according to your client and font.
|
||||
@@ -2957,15 +2974,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
|
||||
|
||||
@@ -2977,9 +2991,9 @@
|
||||
|
||||
#if AXIS_IS_TMC_CONFIG(X)
|
||||
#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_CURRENT_HOME X_CURRENT // (mA) RMS current for homing. (Typically lower than *_CURRENT.)
|
||||
#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
|
||||
@@ -3187,6 +3201,13 @@
|
||||
//#define E7_HOLD_MULTIPLIER 0.5
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Use the homing current for all probing. (e.g., Current may be reduced to the
|
||||
* point where a collision makes the motor skip instead of damaging the bed,
|
||||
* though this is unlikely to save delicate probes from being damaged.
|
||||
*/
|
||||
//#define PROBING_USE_CURRENT_HOME
|
||||
|
||||
// @section tmc/spi
|
||||
|
||||
/**
|
||||
@@ -3451,7 +3472,7 @@
|
||||
/**
|
||||
* Step on both rising and falling edge signals (as with a square wave).
|
||||
*/
|
||||
//#define EDGE_STEPPING
|
||||
#define EDGE_STEPPING
|
||||
|
||||
/**
|
||||
* Enable M122 debugging command for TMC stepper drivers.
|
||||
@@ -3472,7 +3493,7 @@
|
||||
*/
|
||||
#define TMC_ADV() { }
|
||||
|
||||
#endif // HAS_TRINAMIC_CONFIG || HAS_TMC26X
|
||||
#endif // HAS_TRINAMIC_CONFIG
|
||||
|
||||
// @section i2cbus
|
||||
|
||||
@@ -3533,7 +3554,7 @@
|
||||
//#define PHOTOGRAPH_PIN 23
|
||||
|
||||
// Canon Hack Development Kit
|
||||
// https://web.archive.org/web/20200920094805/https://captain-slow.dk/2014/03/09/3d-printing-timelapses/
|
||||
// https://web.archive.org/web/20200920094805/captain-slow.dk/2014/03/09/3d-printing-timelapses/
|
||||
//#define CHDK_PIN 4
|
||||
|
||||
// Optional second move with delay to trigger the camera shutter
|
||||
@@ -3565,7 +3586,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.
|
||||
*
|
||||
@@ -4268,7 +4289,8 @@
|
||||
|
||||
/**
|
||||
* Instant freeze / unfreeze functionality
|
||||
* Potentially useful for emergency stop that allows being resumed.
|
||||
* Potentially useful for rapid stop that allows being resumed. Halts stepper movement.
|
||||
* Note this does NOT pause spindles, lasers, fans, heaters or any other auxiliary device.
|
||||
* @section interface
|
||||
*/
|
||||
//#define FREEZE_FEATURE
|
||||
@@ -4315,6 +4337,7 @@
|
||||
// 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
|
||||
|
||||
/**
|
||||
@@ -4348,7 +4371,7 @@
|
||||
* 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)
|
||||
#if ANY(WIFISUPPORT, ESP3D_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
|
||||
@@ -4384,58 +4407,81 @@
|
||||
//#define E_MUX0_PIN 40 // Always Required
|
||||
//#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs
|
||||
//#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs
|
||||
#elif HAS_PRUSA_MMU2
|
||||
// Serial port used for communication with MMU2.
|
||||
#define MMU2_SERIAL_PORT 2
|
||||
|
||||
// Use hardware reset for MMU if a pin is defined for it
|
||||
//#define MMU2_RST_PIN 23
|
||||
#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3
|
||||
// Common settings for MMU2/MMU2S/MMU3
|
||||
// Serial port used for communication with MMU2/MMU2S/MMU3.
|
||||
#define MMU_SERIAL_PORT 2
|
||||
#define MMU_BAUD 115200
|
||||
|
||||
// Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up)
|
||||
//#define MMU2_MODE_12V
|
||||
//#define MMU_RST_PIN 23 // Define this pin to use Hardware Reset for MMU2/MMU2S/MMU3
|
||||
|
||||
// G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout
|
||||
#define MMU2_FILAMENT_RUNOUT_SCRIPT "M600"
|
||||
//#define MMU_MENUS // Add an LCD menu for MMU2/MMU2S/MMU3
|
||||
|
||||
// Add an LCD menu for MMU2
|
||||
//#define MMU2_MENUS
|
||||
//#define MMU_DEBUG // Write debug info to serial output
|
||||
|
||||
// Settings for filament load / unload from the LCD menu.
|
||||
// This is for Průša MK3-style extruders. Customize for your hardware.
|
||||
#define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0
|
||||
#define MMU2_LOAD_TO_NOZZLE_SEQUENCE \
|
||||
{ 7.2, 1145 }, \
|
||||
{ 14.4, 871 }, \
|
||||
{ 36.0, 1393 }, \
|
||||
{ 14.4, 871 }, \
|
||||
{ 50.0, 198 }
|
||||
// Options pertaining to MMU2 and MMU2S
|
||||
#if HAS_PRUSA_MMU2
|
||||
// Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up)
|
||||
//#define MMU2_MODE_12V
|
||||
|
||||
#define MMU2_RAMMING_SEQUENCE \
|
||||
{ 1.0, 1000 }, \
|
||||
{ 1.0, 1500 }, \
|
||||
{ 2.0, 2000 }, \
|
||||
{ 1.5, 3000 }, \
|
||||
{ 2.5, 4000 }, \
|
||||
{ -15.0, 5000 }, \
|
||||
{ -14.0, 1200 }, \
|
||||
{ -6.0, 600 }, \
|
||||
{ 10.0, 700 }, \
|
||||
{ -10.0, 400 }, \
|
||||
{ -50.0, 2000 }
|
||||
// Settings for filament load / unload from the LCD menu.
|
||||
// This is for Průša MK3-style extruders. Customize for your hardware.
|
||||
#define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0
|
||||
|
||||
// G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout
|
||||
#define MMU2_FILAMENT_RUNOUT_SCRIPT "M600"
|
||||
|
||||
// MMU2 sequences use mm/min. Not compatible with MMU3, which use mm/sec.
|
||||
#define MMU2_LOAD_TO_NOZZLE_SEQUENCE \
|
||||
{ 4.4, 871 }, \
|
||||
{ 10.0, 1393 }, \
|
||||
{ 4.4, 871 }, \
|
||||
{ 10.0, 198 }
|
||||
|
||||
#define MMU2_RAMMING_SEQUENCE \
|
||||
{ 1.0, 1000 }, \
|
||||
{ 1.0, 1500 }, \
|
||||
{ 2.0, 2000 }, \
|
||||
{ 1.5, 3000 }, \
|
||||
{ 2.5, 4000 }, \
|
||||
{ -15.0, 5000 }, \
|
||||
{ -14.0, 1200 }, \
|
||||
{ -6.0, 600 }, \
|
||||
{ 10.0, 700 }, \
|
||||
{ -10.0, 400 }, \
|
||||
{ -50.0, 2000 }
|
||||
|
||||
#endif // HAS_PRUSA_MMU2
|
||||
|
||||
/**
|
||||
* Using a sensor like the MMU2S
|
||||
* This mode requires a MK3S extruder with a sensor at the extruder idler, like the MMU2S.
|
||||
* Options pertaining to MMU2S devices
|
||||
* Requires the MK3S extruder with a sensor at the extruder idler, like the MMU2S.
|
||||
* See https://help.prusa3d.com/guide/3b-mk3s-mk2-5s-extruder-upgrade_41560#42048, step 11
|
||||
*/
|
||||
#if HAS_PRUSA_MMU2S
|
||||
#define MMU2_C0_RETRY 5 // Number of retries (total time = timeout*retries)
|
||||
|
||||
/**
|
||||
* This is called after the filament runout sensor is triggered to check if
|
||||
* the filament has been loaded properly by moving the filament back and
|
||||
* forth to see if the filament runout sensor is going to get triggered
|
||||
* again, which should not occur if the filament is properly loaded.
|
||||
*
|
||||
* Thus, the MMU2_CAN_LOAD_SEQUENCE should contain some forward and
|
||||
* backward moves. The forward moves should be greater than the backward
|
||||
* moves.
|
||||
*
|
||||
* This is useless if your filament runout sensor is way behind the gears.
|
||||
* In that case use {0, MMU2_CAN_LOAD_FEEDRATE}
|
||||
*
|
||||
* Adjust MMU2_CAN_LOAD_SEQUENCE according to your setup.
|
||||
*/
|
||||
#define MMU2_CAN_LOAD_FEEDRATE 800 // (mm/min)
|
||||
#define MMU2_CAN_LOAD_SEQUENCE \
|
||||
{ 0.1, MMU2_CAN_LOAD_FEEDRATE }, \
|
||||
{ 60.0, MMU2_CAN_LOAD_FEEDRATE }, \
|
||||
{ -52.0, MMU2_CAN_LOAD_FEEDRATE }
|
||||
{ 5.0, MMU2_CAN_LOAD_FEEDRATE }, \
|
||||
{ 15.0, MMU2_CAN_LOAD_FEEDRATE }, \
|
||||
{ -10.0, MMU2_CAN_LOAD_FEEDRATE }
|
||||
|
||||
#define MMU2_CAN_LOAD_RETRACT 6.0 // (mm) Keep under the distance between Load Sequence values
|
||||
#define MMU2_CAN_LOAD_DEVIATION 0.8 // (mm) Acceptable deviation
|
||||
@@ -4446,10 +4492,90 @@
|
||||
|
||||
// Continue unloading if sensor detects filament after the initial unload move
|
||||
//#define MMU_IR_UNLOAD_MOVE
|
||||
#else
|
||||
|
||||
#elif HAS_PRUSA_MMU3
|
||||
|
||||
// MMU3 settings
|
||||
|
||||
#define MMU3_HAS_CUTTER // Enable cutter related functionality
|
||||
|
||||
#define MMU3_MAX_RETRIES 3 // Number of retries (total time = timeout*retries)
|
||||
|
||||
// As discussed with our PrusaSlicer profile specialist
|
||||
// - ToolChange shall not try to push filament into the very tip of the nozzle
|
||||
// to have some space for additional G-code to tune the extruded filament length
|
||||
// in the profile
|
||||
// Beware - this value is used to initialize the MMU logic layer - it will be sent to the MMU upon line up (written into its 8bit register 0x0b)
|
||||
// However - in the G-code we can get a request to set the extra load distance at runtime to something else (M708 A0xb Xsomething).
|
||||
// The printer intercepts such a call and sets its extra load distance to match the new value as well.
|
||||
#define MMU3_FILAMENT_SENSOR_E_POSITION 0 // (mm)
|
||||
#define _MMU3_LOAD_DISTANCE_PAST_GEARS 5 // (mm)
|
||||
#define MMU3_TOOL_CHANGE_LOAD_LENGTH (MMU3_FILAMENT_SENSOR_E_POSITION + _MMU3_LOAD_DISTANCE_PAST_GEARS) // (mm)
|
||||
|
||||
#define MMU3_LOAD_TO_NOZZLE_FEED_RATE 20.0 // (mm/s)
|
||||
|
||||
#define MMU3_VERIFY_LOAD_TO_NOZZLE_FEED_RATE 50.0 // (mm/s)
|
||||
#define _MMU3_VERIFY_LOAD_TO_NOZZLE_TWEAK -5.0 // (mm) Amount to adjust the length for verifying load-to-nozzle
|
||||
|
||||
// The first thing the MMU does is initialize its axis.
|
||||
// Meanwhile the E-motor will unload 20mm of filament in about 1 second.
|
||||
#define MMU3_RETRY_UNLOAD_TO_FINDA_LENGTH 80.0 // (mm)
|
||||
#define MMU3_RETRY_UNLOAD_TO_FINDA_FEED_RATE 80.0 // (mm/s)
|
||||
|
||||
// After loading a new filament, the printer will extrude this length of filament
|
||||
// then retract to the original position. This is used to check if the filament sensor
|
||||
// reading flickers or filament is jammed.
|
||||
#define _MMU_EXTRUDER_PTFE_LENGTH 42.3 // (mm)
|
||||
#define _MMU_EXTRUDER_HEATBREAK_LENGTH 17.7 // (mm)
|
||||
#define MMU3_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH (MMU3_FILAMENT_SENSOR_E_POSITION + _MMU_EXTRUDER_PTFE_LENGTH + _MMU_EXTRUDER_HEATBREAK_LENGTH + _MMU3_VERIFY_LOAD_TO_NOZZLE_TWEAK) // (mm)
|
||||
|
||||
/**
|
||||
* MMU1 Extruder Sensor
|
||||
* SpoolJoin Consumes All Filament -- EXPERIMENTAL
|
||||
*
|
||||
* SpoolJoin normally triggers when FINDA sensor untriggers while printing.
|
||||
* This is the default behaviour and it doesn't consume all the filament
|
||||
* before triggering a filament change. This leaves some filament in the
|
||||
* current slot and before switching to the next slot it is unloaded.
|
||||
*
|
||||
* Enabling this option will trigger the filament change when both FINDA
|
||||
* and Filament Runout Sensor triggers during the print and it allows the
|
||||
* filament in the current slot to be completely consumed before doing the
|
||||
* filament change. But this can cause problems as a little bit of filament
|
||||
* will be left between the extruder gears (thinking that the filament
|
||||
* sensor is triggered through the gears) and the end of the PTFE tube and
|
||||
* can cause filament load issues.
|
||||
*/
|
||||
//#define MMU3_SPOOL_JOIN_CONSUMES_ALL_FILAMENT
|
||||
|
||||
// MMU3 sequences use mm/sec. Not compatible with MMU2 which use mm/min.
|
||||
#define MMU3_LOAD_TO_NOZZLE_SEQUENCE \
|
||||
{ _MMU_EXTRUDER_PTFE_LENGTH, MMM_TO_MMS(810) }, /* (13.5 mm/s) Fast load ahead of heatbreak */ \
|
||||
{ _MMU_EXTRUDER_HEATBREAK_LENGTH, MMM_TO_MMS(198) } /* ( 3.3 mm/s) Slow load after heatbreak */
|
||||
|
||||
#define MMU3_RAMMING_SEQUENCE \
|
||||
{ 0.2816, MMM_TO_MMS(1339.0) }, \
|
||||
{ 0.3051, MMM_TO_MMS(1451.0) }, \
|
||||
{ 0.3453, MMM_TO_MMS(1642.0) }, \
|
||||
{ 0.3990, MMM_TO_MMS(1897.0) }, \
|
||||
{ 0.4761, MMM_TO_MMS(2264.0) }, \
|
||||
{ 0.5767, MMM_TO_MMS(2742.0) }, \
|
||||
{ 0.5691, MMM_TO_MMS(3220.0) }, \
|
||||
{ 0.1081, MMM_TO_MMS(3220.0) }, \
|
||||
{ 0.7644, MMM_TO_MMS(3635.0) }, \
|
||||
{ 0.8248, MMM_TO_MMS(3921.0) }, \
|
||||
{ 0.8483, MMM_TO_MMS(4033.0) }, \
|
||||
{ -15.0, MMM_TO_MMS(6000.0) }, \
|
||||
{ -24.5, MMM_TO_MMS(1200.0) }, \
|
||||
{ -7.0, MMM_TO_MMS( 600.0) }, \
|
||||
{ -3.5, MMM_TO_MMS( 360.0) }, \
|
||||
{ 20.0, MMM_TO_MMS( 454.0) }, \
|
||||
{ -20.0, MMM_TO_MMS( 303.0) }, \
|
||||
{ -35.0, MMM_TO_MMS(2000.0) }
|
||||
|
||||
#else // MMU2 (not MMU2S)
|
||||
|
||||
/**
|
||||
* MMU2 Extruder Sensor
|
||||
*
|
||||
* Support for a Průša (or other) IR Sensor to detect filament near the extruder
|
||||
* and make loading more reliable. Suitable for an extruder equipped with a filament
|
||||
@@ -4459,16 +4585,14 @@
|
||||
* move up to the gears. If no filament is detected, the MMU2 can make some more attempts.
|
||||
* If all attempts fail, a filament runout will be triggered.
|
||||
*/
|
||||
//#define MMU_EXTRUDER_SENSOR
|
||||
#if ENABLED(MMU_EXTRUDER_SENSOR)
|
||||
#define MMU_LOADING_ATTEMPTS_NR 5 // max. number of attempts to load filament if first load fail
|
||||
//#define MMU2_EXTRUDER_SENSOR
|
||||
#if ENABLED(MMU2_EXTRUDER_SENSOR)
|
||||
#define MMU2_LOADING_ATTEMPTS_NR 5 // Number of times to try loading filament before failure
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//#define MMU2_DEBUG // Write debug info to serial output
|
||||
|
||||
#endif // HAS_PRUSA_MMU2
|
||||
#endif // HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3
|
||||
|
||||
/**
|
||||
* Advanced Print Counter settings
|
||||
@@ -4531,3 +4655,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
|
||||
|
||||
+109
-78
@@ -187,6 +187,17 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1033)
|
||||
# RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1034)
|
||||
|
||||
# RAMPS 1.6+ (Power outputs: Hotend, Fan, Bed)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1035)
|
||||
# RAMPS 1.6+ (Power outputs: Hotend0, Hotend1, Bed)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1036)
|
||||
# RAMPS 1.6+ (Power outputs: Hotend, Fan0, Fan1)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1037)
|
||||
# RAMPS 1.6+ (Power outputs: Hotend0, Hotend1, Fan)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1038)
|
||||
# RAMPS 1.6+ (Power outputs: Spindle, Controller Fan)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1039)
|
||||
|
||||
#
|
||||
# RAMPS Derivatives - ATmega1280, ATmega2560
|
||||
#
|
||||
@@ -221,108 +232,113 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1112)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1113)
|
||||
# BigTreeTech or BIQU KFB2.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1114)
|
||||
# zrib V2.0 (Chinese RAMPS replica)
|
||||
# Zonestar zrib V2.0 (Chinese RAMPS replica)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1115)
|
||||
# zrib V5.2 (Chinese RAMPS replica)
|
||||
# Zonestar zrib V5.2 (Chinese RAMPS replica)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1116)
|
||||
# Felix 2.0+ Electronics Board (RAMPS like)
|
||||
# Zonestar zrib V5.3 (Chinese RAMPS replica)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1117)
|
||||
# Invent-A-Part RigidBoard
|
||||
# Felix 2.0+ Electronics Board (RAMPS like)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1118)
|
||||
# Invent-A-Part RigidBoard V2
|
||||
# Invent-A-Part RigidBoard
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1119)
|
||||
# Sainsmart 2-in-1 board
|
||||
# Invent-A-Part RigidBoard V2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1120)
|
||||
# Ultimaker
|
||||
# Sainsmart 2-in-1 board
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1121)
|
||||
# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
|
||||
# Ultimaker
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1122)
|
||||
# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1123)
|
||||
MCU ?= atmega1280
|
||||
PROG_MCU ?= m1280
|
||||
# Azteeg X3
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1123)
|
||||
# Azteeg X3 Pro
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1124)
|
||||
# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
|
||||
# Azteeg X3 Pro
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1125)
|
||||
# Rumba
|
||||
# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1126)
|
||||
# Raise3D N series Rumba derivative
|
||||
# Rumba
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1127)
|
||||
# Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
|
||||
# Raise3D N series Rumba derivative
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1128)
|
||||
# Formbot T-Rex 2 Plus
|
||||
# Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1129)
|
||||
# Formbot T-Rex 3
|
||||
# Formbot T-Rex 2 Plus
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1130)
|
||||
# Formbot Raptor
|
||||
# Formbot T-Rex 3
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1131)
|
||||
# Formbot Raptor 2
|
||||
# Formbot Raptor
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1132)
|
||||
# bq ZUM Mega 3D
|
||||
# Formbot Raptor 2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1133)
|
||||
# MakeBoard Mini v2.1.2 by MicroMake
|
||||
# bq ZUM Mega 3D
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1134)
|
||||
# TriGorilla Anycubic version 1.3-based on RAMPS EFB
|
||||
# MakeBoard Mini v2.1.2 by MicroMake
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1135)
|
||||
# ... Ver 1.4
|
||||
# TriGorilla Anycubic version 1.3-based on RAMPS EFB
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1136)
|
||||
# ... Rev 1.1 (new servo pin order)
|
||||
# ... Ver 1.4
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1137)
|
||||
# Creality: Ender-4, CR-8
|
||||
# ... Rev 1.1 (new servo pin order)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1138)
|
||||
# Creality: CR10S, CR20, CR-X
|
||||
# Creality: Ender-4, CR-8
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1139)
|
||||
# Dagoma F5
|
||||
# Creality: CR10S, CR20, CR-X
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1140)
|
||||
# FYSETC F6 1.3
|
||||
# Dagoma F5
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1141)
|
||||
# FYSETC F6 1.4
|
||||
# Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1142)
|
||||
# Wanhao Duplicator i3 Plus
|
||||
# FYSETC F6 1.3
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1143)
|
||||
# VORON Design
|
||||
# FYSETC F6 1.4
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1144)
|
||||
# Tronxy TRONXY-V3-1.0
|
||||
# Wanhao Duplicator i3 Plus
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1145)
|
||||
# Z-Bolt X Series
|
||||
# VORON Design
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1146)
|
||||
# TT OSCAR
|
||||
# Tronxy TRONXY-V3-1.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1147)
|
||||
# Overlord/Overlord Pro
|
||||
# Z-Bolt X Series
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1148)
|
||||
# ADIMLab Gantry v1
|
||||
# TT OSCAR
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1149)
|
||||
# ADIMLab Gantry v2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1150)
|
||||
# BIQU Tango V1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1151)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1150)
|
||||
# MKS GEN L V2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1152)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1151)
|
||||
# MKS GEN L V2.1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1153)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1152)
|
||||
# Copymaster 3D
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1154)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1153)
|
||||
# Ortur 4
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1155)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1154)
|
||||
# Tenlog D3 Hero IDEX printer
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1155)
|
||||
# Tenlog D3, D5, D6 IDEX Printer
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1156)
|
||||
# Tenlog D3,5,6 Pro IDEX printers
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1157)
|
||||
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1158)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1157)
|
||||
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1159)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1158)
|
||||
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1160)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1159)
|
||||
# Longer LK1 PRO / Alfawise U20 Pro (PRO version)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1161)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1160)
|
||||
# Longer LKx PRO / Alfawise Uxx Pro (PRO version)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1162)
|
||||
# Zonestar zrib V5.3 (Chinese RAMPS replica)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1163)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1161)
|
||||
# Pxmalion Core I3
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1162)
|
||||
# Panowin Cutlass (as found in the Panowin F1)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1163)
|
||||
# Kodama Bardo V1.x (as found in the Kodama Trinus)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1164)
|
||||
# XTLW MFF V1.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1165)
|
||||
# XTLW MFF V2.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1166)
|
||||
|
||||
|
||||
#
|
||||
# RAMBo and derivatives
|
||||
@@ -340,7 +356,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1203)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1204)
|
||||
# abee Scoovo X9H
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1205)
|
||||
# Rambo ThinkerV2
|
||||
# ThinkerV2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1206)
|
||||
|
||||
#
|
||||
@@ -383,30 +399,40 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1315)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1316)
|
||||
# Geeetech GT2560 Rev B for A10(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1317)
|
||||
# Geeetech GT2560 Rev B for A10(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1318)
|
||||
# Geeetech GT2560 Rev B for Mecreator2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1318)
|
||||
# Geeetech GT2560 Rev B for A20(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1319)
|
||||
# Geeetech GT2560 Rev B for A20(M/T/D)
|
||||
# Geeetech GT2560 Rev B for A10(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1320)
|
||||
# Einstart retrofit
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1321)
|
||||
# Wanhao 0ne+ i3 Mini
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1322)
|
||||
# Leapfrog Xeed 2015
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1323)
|
||||
# PICA Shield (original version)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1324)
|
||||
# PICA Shield (rev C or later)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1325)
|
||||
# Intamsys 4.0 (Funmat HT)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1326)
|
||||
# Malyan M180 Mainboard Version 2 (no display function, direct G-code only)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1327)
|
||||
# Geeetech GT2560 Rev B for A20(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1321)
|
||||
# Einstart retrofit
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1322)
|
||||
# Wanhao 0ne+ i3 Mini
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1323)
|
||||
# Overlord/Overlord Pro
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1324)
|
||||
# ADIMLab Gantry v1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1325)
|
||||
# ADIMLab Gantry v2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1326)
|
||||
# Leapfrog Xeed 2015
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1327)
|
||||
# PICA Shield (original version)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1328)
|
||||
# Mega controller & Protoneer CNC Shield V3.00
|
||||
# PICA Shield (rev C or later)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1329)
|
||||
# Intamsys 4.0 (Funmat HT)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1330)
|
||||
# Malyan M180 Mainboard Version 2 (no display function, direct G-code only)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1331)
|
||||
# Mega controller & Protoneer CNC Shield V3.00
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1332)
|
||||
# WEEDO 62A board (TINA2, Monoprice Cadet, etc.)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1333)
|
||||
# Geeetech GT2560 V4.1B for A10(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1334)
|
||||
|
||||
#
|
||||
# ATmega1281, ATmega2561
|
||||
@@ -440,7 +466,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1502)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega644p
|
||||
PROG_MCU ?= m644p
|
||||
# Melzi V2.0
|
||||
# Melzi V2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1503)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
@@ -450,36 +476,41 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1504)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# Melzi Creality3D board (for CR-10 etc)
|
||||
# Melzi Creality3D (for CR-10 etc)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1505)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# Melzi Malyan M150 board
|
||||
# Melzi Creality3D (for Ender-2)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1506)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# Tronxy X5S
|
||||
# Melzi Malyan M150
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1507)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# STB V1.1
|
||||
# Tronxy X5S
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1508)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# Azteeg X1
|
||||
# STB V1.1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1509)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# Anet 1.0 (Melzi clone)
|
||||
# Azteeg X1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1510)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# Anet 1.0 (Melzi clone)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1511)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# ZoneStar ZMIB V2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1511)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
@@ -995,7 +1026,7 @@ extcoff: $(TARGET).elf
|
||||
$(NM) -n $< > $@
|
||||
|
||||
# Link: create ELF output file from library.
|
||||
|
||||
LDFLAGS+= -Wl,-V
|
||||
$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
|
||||
$(Pecho) " CXX $@"
|
||||
$P $(CXX) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
|
||||
|
||||
+10
-3
@@ -41,7 +41,14 @@
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
//#define STRING_DISTRIBUTION_DATE "2024-01-31"
|
||||
//#define STRING_DISTRIBUTION_DATE "2024-11-04"
|
||||
|
||||
/**
|
||||
* The protocol for communication to the host. Protocol indicates communication
|
||||
* standards such as the use of ASCII, "echo:" and "error:" line prefixes, etc.
|
||||
* (Other behaviors are given by the firmware version and capabilities report.)
|
||||
*/
|
||||
//#define PROTOCOL_VERSION "1.0"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
@@ -68,8 +75,8 @@
|
||||
//#define WEBSITE_URL "marlinfw.org"
|
||||
|
||||
/**
|
||||
* Set the vendor info the serial USB interface, if changable
|
||||
* Currently only supported by DUE platform
|
||||
* Set the vendor info the serial USB interface, if changeable.
|
||||
* Currently only supported by DUE platform.
|
||||
*/
|
||||
//#define USB_DEVICE_VENDOR_ID 0x0000
|
||||
//#define USB_DEVICE_PRODUCT_ID 0x0000
|
||||
|
||||
@@ -129,11 +129,11 @@ typedef Servo hal_servo_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#if !WITHIN(MMU2_SERIAL_PORT, 0, 3)
|
||||
#error "MMU2_SERIAL_PORT must be from 0 to 3"
|
||||
#ifdef MMU_SERIAL_PORT
|
||||
#if !WITHIN(MMU_SERIAL_PORT, 0, 3)
|
||||
#error "MMU_SERIAL_PORT must be from 0 to 3"
|
||||
#endif
|
||||
#define MMU2_SERIAL mmuSerial
|
||||
#define MMU_SERIAL mmuSerial
|
||||
#endif
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
@@ -141,7 +141,7 @@ typedef Servo hal_servo_t;
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3."
|
||||
#endif
|
||||
#define LCD_SERIAL lcdSerial
|
||||
#if HAS_DGUS_LCD
|
||||
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
|
||||
#endif
|
||||
#endif
|
||||
@@ -159,7 +159,7 @@ typedef Servo hal_servo_t;
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
#define HAL_SENSITIVE_PINS 0, 1,
|
||||
#define HAL_SENSITIVE_PINS 0, 1
|
||||
|
||||
#ifdef __AVR_AT90USB1286__
|
||||
#define JTAG_DISABLE() do{ MCUCR = 0x80; MCUCR = 0x80; }while(0)
|
||||
|
||||
@@ -601,20 +601,20 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
|
||||
|
||||
#endif // SERIAL_PORT_3
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#ifdef MMU_SERIAL_PORT
|
||||
|
||||
ISR(SERIAL_REGNAME(USART, MMU2_SERIAL_PORT, _RX_vect)) {
|
||||
MarlinSerial<MMU2SerialCfg<MMU2_SERIAL_PORT>>::store_rxd_char();
|
||||
ISR(SERIAL_REGNAME(USART, MMU_SERIAL_PORT, _RX_vect)) {
|
||||
MarlinSerial<MMU2SerialCfg<MMU_SERIAL_PORT>>::store_rxd_char();
|
||||
}
|
||||
|
||||
ISR(SERIAL_REGNAME(USART, MMU2_SERIAL_PORT, _UDRE_vect)) {
|
||||
MarlinSerial<MMU2SerialCfg<MMU2_SERIAL_PORT>>::_tx_udr_empty_irq();
|
||||
ISR(SERIAL_REGNAME(USART, MMU_SERIAL_PORT, _UDRE_vect)) {
|
||||
MarlinSerial<MMU2SerialCfg<MMU_SERIAL_PORT>>::_tx_udr_empty_irq();
|
||||
}
|
||||
|
||||
template class MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> >;
|
||||
template class MarlinSerial< MMU2SerialCfg<MMU_SERIAL_PORT> >;
|
||||
MSerialMMU2 mmuSerial(MSerialMMU2::HasEmergencyParser);
|
||||
|
||||
#endif // MMU2_SERIAL_PORT
|
||||
#endif // MMU_SERIAL_PORT
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
|
||||
@@ -629,7 +629,7 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
|
||||
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
|
||||
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
|
||||
|
||||
#if HAS_DGUS_LCD
|
||||
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
|
||||
template<typename Cfg>
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
|
||||
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
static ring_buffer_pos_t available();
|
||||
static void write(const uint8_t c);
|
||||
static void flushTX();
|
||||
#if HAS_DGUS_LCD
|
||||
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
|
||||
static ring_buffer_pos_t get_tx_buffer_free();
|
||||
#endif
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
|
||||
#endif // !USBCON
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#ifdef MMU_SERIAL_PORT
|
||||
template <uint8_t serial>
|
||||
struct MMU2SerialCfg {
|
||||
static constexpr int PORT = serial;
|
||||
@@ -260,7 +260,7 @@
|
||||
static constexpr bool RX_OVERRUNS = false;
|
||||
};
|
||||
|
||||
typedef Serial1Class< MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> > > MSerialMMU2;
|
||||
typedef Serial1Class< MarlinSerial< MMU2SerialCfg<MMU_SERIAL_PORT> > > MSerialMMU2;
|
||||
extern MSerialMMU2 mmuSerial;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -345,6 +345,14 @@ void setup_endstop_interrupts() {
|
||||
pciSetup(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if USE_CALIBRATION
|
||||
#if (digitalPinToInterrupt(CALIBRATION_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(CALIBRATION_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(CALIBRATION_PIN), "CALIBRATION_PIN is not interrupt-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue.");
|
||||
pciSetup(CALIBRATION_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
|
||||
else {
|
||||
if (p == 32 || p == 128) continue; // Skip TIMER2 specific prescalers when not TIMER2
|
||||
const uint16_t rft = (F_CPU) / (p * f_desired);
|
||||
DEBUG_ECHOLNPGM("(Not Timer 2) F_CPU=" STRINGIFY(F_CPU), " prescaler=", p, " f_desired=", f_desired);
|
||||
DEBUG_ECHOLNPGM("(Not Timer 2) F_CPU=", STRINGIFY(F_CPU), " prescaler=", p, " f_desired=", f_desired);
|
||||
res_fast_temp = rft - 1;
|
||||
res_pc_temp = rft / 2;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
* Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 | E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx
|
||||
* Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 73 75 76 77 74 xx xx xx xx xx
|
||||
* Analog Input : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
*
|
||||
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
|
||||
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
|
||||
*/
|
||||
|
||||
#include "../fastio.h"
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
*
|
||||
* Logical Pin: 38 39 40 41 42 43 44 45 16 10 11 12 06 07 08 09 30 31 32 33 34 35 36 37 17 18 19 20 21 22 23 24 00 01 13 05 02 03 14 15 46 47 48 49 50 51 52 53 25 26 27 28 29 04
|
||||
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5
|
||||
*
|
||||
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
|
||||
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
|
||||
*/
|
||||
|
||||
#include "../fastio.h"
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
*
|
||||
* Logical Pin: 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07
|
||||
* Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
|
||||
*
|
||||
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
|
||||
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
|
||||
*/
|
||||
|
||||
#include "../fastio.h"
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
*
|
||||
* Logical Pin: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
* Port: B0 B1 B2 B3 B4 B5 B6 B7 D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 A7 A6 A5 A4 A3 A2 A1 A0
|
||||
*
|
||||
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
|
||||
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
|
||||
*/
|
||||
|
||||
/** ATMega644
|
||||
|
||||
@@ -26,10 +26,7 @@
|
||||
*
|
||||
* Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
|
||||
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
|
||||
* The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
|
||||
*
|
||||
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
|
||||
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
|
||||
* Logical pins 46-47 aren't supported by Teensyduino, but are supported below as E2 and E3
|
||||
*/
|
||||
|
||||
#include "../fastio.h"
|
||||
|
||||
@@ -22,7 +22,23 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* PWM print routines for Atmel 8 bit AVR CPUs
|
||||
* Pins Debugging for Atmel 8 bit AVR CPUs
|
||||
*
|
||||
* - NUMBER_PINS_TOTAL
|
||||
* - MULTI_NAME_PAD
|
||||
* - getPinByIndex(index)
|
||||
* - printPinNameByIndex(index)
|
||||
* - getPinIsDigitalByIndex(index)
|
||||
* - digitalPinToAnalogIndex(pin)
|
||||
* - getValidPinMode(pin)
|
||||
* - isValidPin(pin)
|
||||
* - isAnalogPin(pin)
|
||||
* - digitalRead_mod(pin)
|
||||
* - pwm_status(pin)
|
||||
* - printPinPWM(pin)
|
||||
* - printPinPort(pin)
|
||||
* - printPinNumber(pin)
|
||||
* - printPinAnalog(pin)
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
@@ -39,44 +55,44 @@
|
||||
#include "pinsDebug_Teensyduino.h"
|
||||
// Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
|
||||
// portModeRegister takes a different argument
|
||||
#define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
|
||||
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
|
||||
#define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
|
||||
#define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))
|
||||
#define digitalPinToTimer_DEBUG(P) digitalPinToTimer(P)
|
||||
#define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask(P)
|
||||
#define digitalPinToPort_DEBUG(P) digitalPinToPort(P)
|
||||
#define getValidPinMode(P) (*portModeRegister(P) & digitalPinToBitMask_DEBUG(P))
|
||||
|
||||
#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70
|
||||
|
||||
#include "pinsDebug_plus_70.h"
|
||||
#define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p)
|
||||
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p)
|
||||
#define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p)
|
||||
bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
|
||||
#define digitalPinToTimer_DEBUG(P) digitalPinToTimer_plus_70(P)
|
||||
#define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask_plus_70(P)
|
||||
#define digitalPinToPort_DEBUG(P) digitalPinToPort_plus_70(P)
|
||||
bool getValidPinMode(pin_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
|
||||
|
||||
#else
|
||||
|
||||
#define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
|
||||
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
|
||||
#define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
|
||||
bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
|
||||
#define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
|
||||
#define digitalPinToTimer_DEBUG(P) digitalPinToTimer(P)
|
||||
#define digitalPinToBitMask_DEBUG(P) digitalPinToBitMask(P)
|
||||
#define digitalPinToPort_DEBUG(P) digitalPinToPort(P)
|
||||
bool getValidPinMode(pin_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
|
||||
#define getPinByIndex(x) pgm_read_byte(&pin_array[x].pin)
|
||||
|
||||
#endif
|
||||
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
|
||||
#define isValidPin(P) (P >= 0 && P < NUMBER_PINS_TOTAL)
|
||||
#if AVR_ATmega1284_FAMILY
|
||||
#define IS_ANALOG(P) WITHIN(P, analogInputToDigitalPin(7), analogInputToDigitalPin(0))
|
||||
#define DIGITAL_PIN_TO_ANALOG_PIN(P) int(IS_ANALOG(P) ? (P) - analogInputToDigitalPin(7) : -1)
|
||||
#define isAnalogPin(P) WITHIN(P, analogInputToDigitalPin(7), analogInputToDigitalPin(0))
|
||||
#define digitalPinToAnalogIndex(P) int(isAnalogPin(P) ? (P) - analogInputToDigitalPin(7) : -1)
|
||||
#else
|
||||
#define _ANALOG1(P) WITHIN(P, analogInputToDigitalPin(0), analogInputToDigitalPin(7))
|
||||
#define _ANALOG2(P) WITHIN(P, analogInputToDigitalPin(8), analogInputToDigitalPin(15))
|
||||
#define IS_ANALOG(P) (_ANALOG1(P) || _ANALOG2(P))
|
||||
#define DIGITAL_PIN_TO_ANALOG_PIN(P) int(_ANALOG1(P) ? (P) - analogInputToDigitalPin(0) : _ANALOG2(P) ? (P) - analogInputToDigitalPin(8) + 8 : -1)
|
||||
#define isAnalogPin(P) (_ANALOG1(P) || _ANALOG2(P))
|
||||
#define digitalPinToAnalogIndex(P) int(_ANALOG1(P) ? (P) - analogInputToDigitalPin(0) : _ANALOG2(P) ? (P) - analogInputToDigitalPin(8) + 8 : -1)
|
||||
#endif
|
||||
#define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
|
||||
#define getPinByIndex(x) pgm_read_byte(&pin_array[x].pin)
|
||||
#define MULTI_NAME_PAD 26 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
void PRINT_ARRAY_NAME(uint8_t x) {
|
||||
PGM_P const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[x].name);
|
||||
void printPinNameByIndex(const uint8_t index) {
|
||||
PGM_P const name_mem_pointer = (PGM_P)pgm_read_ptr(&pin_array[index].name);
|
||||
for (uint8_t y = 0; y < MAX_NAME_LENGTH; ++y) {
|
||||
char temp_char = pgm_read_byte(name_mem_pointer + y);
|
||||
if (temp_char != 0)
|
||||
@@ -88,7 +104,7 @@ void PRINT_ARRAY_NAME(uint8_t x) {
|
||||
}
|
||||
}
|
||||
|
||||
#define GET_ARRAY_IS_DIGITAL(x) pgm_read_byte(&pin_array[x].is_digital)
|
||||
#define getPinIsDigitalByIndex(x) pgm_read_byte(&pin_array[x].is_digital)
|
||||
|
||||
#if defined(__AVR_ATmega1284P__) // 1284 IDE extensions set this to the number of
|
||||
#undef NUM_DIGITAL_PINS // digital only pins while all other CPUs have it
|
||||
@@ -109,7 +125,7 @@ void PRINT_ARRAY_NAME(uint8_t x) {
|
||||
* Print a pin's PWM status.
|
||||
* Return true if it's currently a PWM pin.
|
||||
*/
|
||||
bool pwm_status(uint8_t pin) {
|
||||
bool pwm_status(const uint8_t pin) {
|
||||
char buffer[20]; // for the sprintf statements
|
||||
|
||||
switch (digitalPinToTimer_DEBUG(pin)) {
|
||||
@@ -276,7 +292,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
|
||||
if (TEST(*TMSK, TOIE)) err_prob_interrupt();
|
||||
}
|
||||
|
||||
void pwm_details(uint8_t pin) {
|
||||
void printPinPWM(const uint8_t pin) {
|
||||
switch (digitalPinToTimer_DEBUG(pin)) {
|
||||
|
||||
#if ABTEST(0)
|
||||
@@ -347,7 +363,7 @@ void pwm_details(uint8_t pin) {
|
||||
#else
|
||||
UNUSED(print_is_also_tied);
|
||||
#endif
|
||||
} // pwm_details
|
||||
} // printPinPWM
|
||||
|
||||
#ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs
|
||||
int digitalRead_mod(const pin_t pin) { // same as digitalRead except the PWM stop section has been removed
|
||||
@@ -356,7 +372,7 @@ void pwm_details(uint8_t pin) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void print_port(const pin_t pin) { // print port number
|
||||
void printPinPort(const pin_t pin) { // print port number
|
||||
#ifdef digitalPinToPort_DEBUG
|
||||
uint8_t x;
|
||||
SERIAL_ECHOPGM(" Port: ");
|
||||
@@ -386,7 +402,7 @@ void print_port(const pin_t pin) { // print port number
|
||||
#endif
|
||||
}
|
||||
|
||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
|
||||
#undef ABTEST
|
||||
|
||||
@@ -102,7 +102,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
||||
|
||||
// digitalPinToBitMask(pin) is OK
|
||||
|
||||
#define digitalRead_mod(p) extDigitalRead(p) // Teensyduino's version of digitalRead doesn't
|
||||
#define digitalRead_mod(P) extDigitalRead(P) // Teensyduino's version of digitalRead doesn't
|
||||
// disable the PWMs so we can use it as is
|
||||
|
||||
// portModeRegister(pin) is OK
|
||||
|
||||
@@ -120,7 +120,7 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) {
|
||||
U8G_ATOMIC_END();
|
||||
}
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#if U8G_SPI_USE_MODE_3
|
||||
#define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_3
|
||||
#else
|
||||
#define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_0
|
||||
@@ -143,9 +143,9 @@ uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_CHIP_SELECT:
|
||||
#if ENABLED(FYSETC_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
#if U8G_SPI_USE_MODE_3 // LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
u8g_com_arduino_digital_write(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active
|
||||
u8g_com_arduino_digital_write(u8g, U8G_PI_CS, LOW);
|
||||
}
|
||||
|
||||
@@ -81,11 +81,11 @@ extern DefaultSerial4 MSerial3;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#if WITHIN(MMU2_SERIAL_PORT, 0, 3)
|
||||
#define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
|
||||
#ifdef MMU_SERIAL_PORT
|
||||
#if WITHIN(MMU_SERIAL_PORT, 0, 3)
|
||||
#define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
|
||||
#else
|
||||
#error "MMU2_SERIAL_PORT must be from 0 to 3."
|
||||
#error "MMU_SERIAL_PORT must be from 0 to 3."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -127,7 +127,7 @@ typedef Servo hal_servo_t;
|
||||
#define HAL_ADC_RESOLUTION 10
|
||||
|
||||
#ifndef analogInputToDigitalPin
|
||||
#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1)
|
||||
#define analogInputToDigitalPin(p) pin_t((p < 12U) ? (p) + 54U : -1)
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
static Flags<_Nbr_16timers> DisablePending; // ISR should disable the timer at the next timer reset
|
||||
|
||||
// ------------------------
|
||||
/// Interrupt handler for the TC0 channel 1.
|
||||
// Interrupt handler for the TC0 channel 1.
|
||||
// ------------------------
|
||||
void Servo_Handler(const timer16_Sequence_t, Tc*, const uint8_t);
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ void setup_endstop_interrupts() {
|
||||
TERN_(USE_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(USE_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(USE_Z_MIN_PROBE, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(USE_CALIBRATION, _ATTACH(CALIBRATION_PIN));
|
||||
TERN_(USE_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(USE_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(USE_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
#else
|
||||
#define G2_PWM_Z 0
|
||||
#endif
|
||||
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
|
||||
#if HAS_MOTOR_CURRENT_PWM_E
|
||||
#define G2_PWM_E 1
|
||||
#else
|
||||
#define G2_PWM_E 0
|
||||
|
||||
@@ -68,16 +68,15 @@
|
||||
* Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time
|
||||
* as the TMC2130 soft SPI the most common setup.
|
||||
*/
|
||||
#define _IS_HW_SPI(P) (defined(TMC_SPI_##P) && (TMC_SPI_##P == SD_MOSI_PIN || TMC_SPI_##P == SD_MISO_PIN || TMC_SPI_##P == SD_SCK_PIN))
|
||||
|
||||
#if HAS_MEDIA && HAS_DRIVER(TMC2130)
|
||||
#if ENABLED(TMC_USE_SW_SPI)
|
||||
#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(SOFTWARE_SPI)
|
||||
#define _IS_HW_SPI(P) (defined(TMC_SPI_##P) && (TMC_SPI_##P == SD_MOSI_PIN || TMC_SPI_##P == SD_MISO_PIN || TMC_SPI_##P == SD_SCK_PIN))
|
||||
#if DISABLED(SOFTWARE_SPI) && ENABLED(TMC_USE_SW_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
|
||||
#if ENABLED(SOFTWARE_SPI) && DISABLED(TMC_USE_SW_SPI)
|
||||
#error "DUE software SPI is required but is incompatible with TMC2130 hardware SPI. Enable TMC_USE_SW_SPI to fix."
|
||||
#endif
|
||||
#undef _IS_HW_SPI
|
||||
#endif
|
||||
|
||||
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
|
||||
|
||||
@@ -19,13 +19,26 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Support routines for Due
|
||||
*/
|
||||
|
||||
/**
|
||||
* Translation of routines & variables used by pinsDebug.h
|
||||
* Pins Debugging for DUE
|
||||
*
|
||||
* - NUMBER_PINS_TOTAL
|
||||
* - MULTI_NAME_PAD
|
||||
* - getPinByIndex(index)
|
||||
* - printPinNameByIndex(index)
|
||||
* - getPinIsDigitalByIndex(index)
|
||||
* - digitalPinToAnalogIndex(pin)
|
||||
* - getValidPinMode(pin)
|
||||
* - isValidPin(pin)
|
||||
* - isAnalogPin(pin)
|
||||
* - digitalRead_mod(pin)
|
||||
* - pwm_status(pin)
|
||||
* - printPinPWM(pin)
|
||||
* - printPinPort(pin)
|
||||
* - printPinNumber(pin)
|
||||
* - printPinAnalog(pin)
|
||||
*/
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
@@ -63,20 +76,20 @@
|
||||
|
||||
#define NUMBER_PINS_TOTAL PINS_COUNT
|
||||
|
||||
#define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin
|
||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||
#define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
|
||||
#define VALID_PIN(pin) (pin >= 0 && pin < int8_t(NUMBER_PINS_TOTAL))
|
||||
#define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0))
|
||||
#define IS_ANALOG(P) WITHIN(P, char(analogInputToDigitalPin(0)), char(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
|
||||
#define pwm_status(pin) (((g_pinStatus[pin] & 0xF) == PIN_STATUS_PWM) && \
|
||||
((g_APinDescription[pin].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM))
|
||||
#define digitalRead_mod(P) extDigitalRead(P) // AVR digitalRead disabled PWM before it read the pin
|
||||
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define getPinByIndex(x) pin_array[x].pin
|
||||
#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
|
||||
#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
|
||||
#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0))
|
||||
#define isAnalogPin(P) WITHIN(P, pin_t(analogInputToDigitalPin(0)), pin_t(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
|
||||
#define pwm_status(P) (((g_pinStatus[P] & 0xF) == PIN_STATUS_PWM) && \
|
||||
((g_APinDescription[P].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM))
|
||||
#define MULTI_NAME_PAD 14 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
bool GET_PINMODE(int8_t pin) { // 1: output, 0: input
|
||||
bool getValidPinMode(const pin_t pin) { // 1: output, 0: input
|
||||
volatile Pio* port = g_APinDescription[pin].pPort;
|
||||
uint32_t mask = g_APinDescription[pin].ulPin;
|
||||
uint8_t pin_status = g_pinStatus[pin] & 0xF;
|
||||
@@ -85,14 +98,14 @@ bool GET_PINMODE(int8_t pin) { // 1: output, 0: input
|
||||
|| pwm_status(pin));
|
||||
}
|
||||
|
||||
void pwm_details(int32_t pin) {
|
||||
void printPinPWM(const int32_t pin) {
|
||||
if (pwm_status(pin)) {
|
||||
uint32_t chan = g_APinDescription[pin].ulPWMChannel;
|
||||
SERIAL_ECHOPGM("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
|
||||
}
|
||||
}
|
||||
|
||||
void print_port(const pin_t) {}
|
||||
void printPinPort(const pin_t) {}
|
||||
|
||||
/**
|
||||
* DUE Board pin | PORT | Label
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
/**
|
||||
* Define SPI Pins: SCK, MISO, MOSI, SS
|
||||
*
|
||||
* Available chip select pins for HW SPI are 4 10 52 77
|
||||
* Available chip select pins for HW SPI are 4 10 52 77 87
|
||||
*/
|
||||
#if SDSS == 4 || SDSS == 10 || SDSS == 52 || SDSS == 77 || SDSS == 87
|
||||
#if SDSS == 4
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
#include <U8glib-HAL.h>
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#if U8G_SPI_USE_MODE_3
|
||||
#define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_3
|
||||
#else
|
||||
#define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_0
|
||||
@@ -96,15 +96,15 @@ uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_CHIP_SELECT:
|
||||
#if ENABLED(FYSETC_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 1); //set SCK to mode 3 idle state before CS goes active
|
||||
#if U8G_SPI_USE_MODE_3 // LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active
|
||||
u8g_SetPILevel_DUE(u8g, U8G_PI_CS, LOW);
|
||||
}
|
||||
else {
|
||||
u8g_SetPILevel_DUE(u8g, U8G_PI_CS, HIGH);
|
||||
u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 0); //set SCK to mode 0 idle state after CS goes inactive
|
||||
u8g_SetPILevel_DUE(u8g, U8G_PI_SCK, 0); // Set SCK to mode 0 idle state after CS goes inactive
|
||||
}
|
||||
#else
|
||||
u8g_SetPILevel_DUE(u8g, U8G_PI_CS, !arg_val);
|
||||
|
||||
@@ -11,7 +11,7 @@ if pioutil.is_pio_build():
|
||||
|
||||
if current_OS == 'Windows':
|
||||
|
||||
Import("env")
|
||||
env = pioutil.env
|
||||
|
||||
# Use bossac.exe on Windows
|
||||
env.Replace(
|
||||
|
||||
@@ -18,30 +18,30 @@ extern "C" {
|
||||
void sd_mmc_spi_mem_init() {
|
||||
}
|
||||
|
||||
Ctrl_status sd_mmc_spi_test_unit_ready() {
|
||||
#ifdef DISABLE_DUE_SD_MMC
|
||||
return CTRL_NO_PRESENT;
|
||||
#endif
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
return CTRL_GOOD;
|
||||
}
|
||||
|
||||
// NOTE: This function is defined as returning the address of the last block
|
||||
// in the card, which is cardSize() - 1
|
||||
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
*nb_sector = card.diskIODriver()->cardSize() - 1;
|
||||
return CTRL_GOOD;
|
||||
inline bool media_ready() {
|
||||
return IS_SD_MOUNTED() && IS_SD_INSERTED() && !IS_SD_FILE_OPEN() && !IS_SD_PRINTING();
|
||||
}
|
||||
|
||||
bool sd_mmc_spi_unload(bool) { return true; }
|
||||
|
||||
bool sd_mmc_spi_wr_protect() { return false; }
|
||||
|
||||
bool sd_mmc_spi_removal() {
|
||||
return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted());
|
||||
bool sd_mmc_spi_removal() { return !media_ready(); }
|
||||
|
||||
Ctrl_status sd_mmc_spi_test_unit_ready() {
|
||||
#ifdef DISABLE_DUE_SD_MMC
|
||||
return CTRL_NO_PRESENT;
|
||||
#endif
|
||||
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
|
||||
return CTRL_GOOD;
|
||||
}
|
||||
|
||||
// NOTE: This function is defined as returning the address of the last block
|
||||
// in the card, which is cardSize() - 1
|
||||
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
|
||||
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
|
||||
*nb_sector = card.diskIODriver()->cardSize() - 1;
|
||||
return CTRL_GOOD;
|
||||
}
|
||||
|
||||
#if ACCESS_USB == true
|
||||
@@ -61,8 +61,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
|
||||
#ifdef DISABLE_DUE_SD_MMC
|
||||
return CTRL_NO_PRESENT;
|
||||
#endif
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
|
||||
|
||||
#ifdef DEBUG_MMC
|
||||
{
|
||||
@@ -101,8 +100,7 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
|
||||
#ifdef DISABLE_DUE_SD_MMC
|
||||
return CTRL_NO_PRESENT;
|
||||
#endif
|
||||
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
|
||||
return CTRL_NO_PRESENT;
|
||||
if (sd_mmc_spi_removal()) return CTRL_NO_PRESENT;
|
||||
|
||||
#ifdef DEBUG_MMC
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
//!
|
||||
//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
|
||||
//!/
|
||||
extern void sd_mmc_spi_mem_init(void);
|
||||
void sd_mmc_spi_mem_init();
|
||||
|
||||
//!
|
||||
//! @brief This function tests the state of the SD_MMC memory and sends it to the Host.
|
||||
@@ -87,7 +87,7 @@ extern void sd_mmc_spi_mem_init(void);
|
||||
//! Media not present -> CTRL_NO_PRESENT
|
||||
//! Media has changed -> CTRL_BUSY
|
||||
//!/
|
||||
extern Ctrl_status sd_mmc_spi_test_unit_ready(void);
|
||||
Ctrl_status sd_mmc_spi_test_unit_ready();
|
||||
|
||||
//!
|
||||
//! @brief This function gives the address of the last valid sector.
|
||||
@@ -98,7 +98,7 @@ extern Ctrl_status sd_mmc_spi_test_unit_ready(void);
|
||||
//! Media ready -> CTRL_GOOD
|
||||
//! Media not present -> CTRL_NO_PRESENT
|
||||
//!/
|
||||
extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
|
||||
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
|
||||
|
||||
/*! \brief Unload/Load the SD/MMC card selected
|
||||
*
|
||||
@@ -109,7 +109,7 @@ extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
|
||||
*
|
||||
* \return \c true if unload/load done success.
|
||||
*/
|
||||
extern bool sd_mmc_spi_unload(bool unload);
|
||||
bool sd_mmc_spi_unload(bool unload);
|
||||
|
||||
//!
|
||||
//! @brief This function returns the write protected status of the memory.
|
||||
@@ -120,14 +120,14 @@ extern bool sd_mmc_spi_unload(bool unload);
|
||||
//!
|
||||
//! @return false -> the memory is not write-protected (always)
|
||||
//!/
|
||||
extern bool sd_mmc_spi_wr_protect(void);
|
||||
bool sd_mmc_spi_wr_protect();
|
||||
|
||||
//!
|
||||
//! @brief This function tells if the memory has been removed or not.
|
||||
//!
|
||||
//! @return false -> The memory isn't removed
|
||||
//!
|
||||
extern bool sd_mmc_spi_removal(void);
|
||||
bool sd_mmc_spi_removal();
|
||||
|
||||
//---- ACCESS DATA FUNCTIONS ----
|
||||
|
||||
@@ -147,7 +147,7 @@ extern bool sd_mmc_spi_removal(void);
|
||||
//! It is ready -> CTRL_GOOD
|
||||
//! A error occur -> CTRL_FAIL
|
||||
//!
|
||||
extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
|
||||
Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
|
||||
|
||||
//! This function initializes the SD/MMC memory for a write operation
|
||||
//!
|
||||
@@ -161,7 +161,7 @@ extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
|
||||
//! It is ready -> CTRL_GOOD
|
||||
//! An error occurs -> CTRL_FAIL
|
||||
//!
|
||||
extern Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector);
|
||||
Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector);
|
||||
|
||||
#endif // #if ACCESS_USB == true
|
||||
|
||||
|
||||
@@ -209,16 +209,17 @@ int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
#define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL
|
||||
|
||||
// https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/api-reference/peripherals/adc.html
|
||||
adc1_channel_t get_channel(int pin) {
|
||||
switch (pin) {
|
||||
case 39: return ADC1_CHANNEL(39);
|
||||
case 36: return ADC1_CHANNEL(36);
|
||||
case 35: return ADC1_CHANNEL(35);
|
||||
case 34: return ADC1_CHANNEL(34);
|
||||
case 33: return ADC1_CHANNEL(33);
|
||||
case 32: return ADC1_CHANNEL(32);
|
||||
case 39: return ADC1_CHANNEL_3;
|
||||
case 36: return ADC1_CHANNEL_0;
|
||||
case 35: return ADC1_CHANNEL_7;
|
||||
case 34: return ADC1_CHANNEL_6;
|
||||
case 33: return ADC1_CHANNEL_5;
|
||||
case 32: return ADC1_CHANNEL_4;
|
||||
case 37: return ADC1_CHANNEL_1;
|
||||
case 38: return ADC1_CHANNEL_2;
|
||||
}
|
||||
return ADC1_CHANNEL_MAX;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ void setup_endstop_interrupts() {
|
||||
TERN_(USE_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(USE_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(USE_Z_MIN_PROBE, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(USE_CALIBRATION, _ATTACH(CALIBRATION_PIN));
|
||||
TERN_(USE_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(USE_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(USE_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
// Set pin as output
|
||||
#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT)
|
||||
|
||||
// TODO: Store set modes in an array and use those to get the mode
|
||||
#define _IS_OUTPUT(IO) true
|
||||
#define _IS_INPUT(IO) true
|
||||
|
||||
// Set pin as input with pullup mode
|
||||
#define _PULLUP(IO, v) pinMode(IO, v ? INPUT_PULLUP : INPUT)
|
||||
|
||||
@@ -70,6 +74,9 @@
|
||||
// Set pin as output and init
|
||||
#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
|
||||
|
||||
#define IS_OUTPUT(IO) _IS_OUTPUT(IO)
|
||||
#define IS_INPUT(IO) _IS_INPUT(IO)
|
||||
|
||||
// digitalRead/Write wrappers
|
||||
#define extDigitalRead(IO) digitalRead(IO)
|
||||
#define extDigitalWrite(IO,V) digitalWrite(IO,V)
|
||||
|
||||
@@ -152,7 +152,7 @@ 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);
|
||||
const bool using_ftMotion = TERN0(FT_MOTION, ftMotion.cfg.active);
|
||||
|
||||
while (dma.rw_pos < DMA_SAMPLE_COUNT) {
|
||||
|
||||
|
||||
@@ -22,11 +22,15 @@
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include <WiFi.h>
|
||||
|
||||
#undef ENABLED
|
||||
#undef DISABLED
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ALL(WIFISUPPORT, OTASUPPORT)
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <ESPmDNS.h>
|
||||
#include <WiFiUdp.h>
|
||||
#include <ArduinoOTA.h>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#error "PINS_DEBUGGING is not yet supported for ESP32!"
|
||||
|
||||
/**
|
||||
* Pins Debugging for ESP32
|
||||
*
|
||||
* - NUMBER_PINS_TOTAL
|
||||
* - MULTI_NAME_PAD
|
||||
* - getPinByIndex(index)
|
||||
* - printPinNameByIndex(index)
|
||||
* - getPinIsDigitalByIndex(index)
|
||||
* - digitalPinToAnalogIndex(pin)
|
||||
* - getValidPinMode(pin)
|
||||
* - isValidPin(pin)
|
||||
* - isAnalogPin(pin)
|
||||
* - digitalRead_mod(pin)
|
||||
* - pwm_status(pin)
|
||||
* - printPinPWM(pin)
|
||||
* - printPinPort(pin)
|
||||
* - printPinNumber(pin)
|
||||
* - printPinAnalog(pin)
|
||||
*/
|
||||
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
||||
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
#define digitalRead_mod(P) extDigitalRead(P)
|
||||
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%02d"), P); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define getPinByIndex(x) pin_array[x].pin
|
||||
#define getPinIsDigitalByIndex(x) pin_array[x].is_digital
|
||||
#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
|
||||
#define digitalPinToAnalogIndex(P) int(P - analogInputToDigitalPin(0))
|
||||
#define isAnalogPin(P) WITHIN(P, pin_t(analogInputToDigitalPin(0)), pin_t(analogInputToDigitalPin(NUM_ANALOG_INPUTS - 1)))
|
||||
bool pwm_status(const pin_t) { return false; }
|
||||
|
||||
void printPinPort(const pin_t) {}
|
||||
|
||||
static bool getValidPinMode(const pin_t pin) {
|
||||
return isValidPin(pin) && !IS_INPUT(pin);
|
||||
}
|
||||
|
||||
void printPinPWM(const int32_t pin) {
|
||||
if (pwm_status(pin)) {
|
||||
//uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
|
||||
//SERIAL_ECHOPGM("PWM = ", duty);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
||||
config.counter_en = TIMER_PAUSE;
|
||||
config.alarm_en = TIMER_ALARM_EN;
|
||||
config.intr_type = TIMER_INTR_LEVEL;
|
||||
config.auto_reload = true;
|
||||
config.auto_reload = TIMER_AUTORELOAD_EN;
|
||||
|
||||
// Select and initialize the timer
|
||||
timer_init(timer.group, timer.idx, &config);
|
||||
|
||||
@@ -53,12 +53,11 @@ typedef uint64_t hal_timer_t;
|
||||
#if ENABLED(I2S_STEPPER_STREAM)
|
||||
#define STEPPER_TIMER_PRESCALE 1
|
||||
#define STEPPER_TIMER_RATE 250000 // 250khz, 4µs pulses of i2s word clock
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs // wrong would be 0.25
|
||||
#else
|
||||
#define STEPPER_TIMER_PRESCALE 40
|
||||
#define STEPPER_TIMER_RATE ((HAL_TIMER_RATE) / (STEPPER_TIMER_PRESCALE)) // frequency of stepper timer, 2MHz
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
||||
#endif
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
||||
|
||||
#define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts
|
||||
|
||||
|
||||
+30
-14
@@ -114,22 +114,19 @@
|
||||
// Misc. Functions
|
||||
//
|
||||
#ifndef analogInputToDigitalPin
|
||||
#define analogInputToDigitalPin(p) (p)
|
||||
#define analogInputToDigitalPin(p) pin_t(p)
|
||||
#endif
|
||||
|
||||
#define CRITICAL_SECTION_START \
|
||||
uint32_t primask = __get_PRIMASK(); \
|
||||
(void)__iCliRetVal()
|
||||
#define CRITICAL_SECTION_START() \
|
||||
const bool irqon = !__get_PRIMASK(); \
|
||||
__disable_irq(); \
|
||||
__DSB();
|
||||
#define CRITICAL_SECTION_END() \
|
||||
__DSB(); \
|
||||
if (irqon) __enable_irq();
|
||||
|
||||
#define CRITICAL_SECTION_END \
|
||||
if (!primask) \
|
||||
(void)__iSeiRetVal()
|
||||
|
||||
// Disable interrupts
|
||||
#define cli() noInterrupts()
|
||||
|
||||
// Enable interrupts
|
||||
#define sei() interrupts()
|
||||
#define cli() __disable_irq()
|
||||
#define sei() __enable_irq()
|
||||
|
||||
// bss_end alias
|
||||
#define __bss_end __bss_end__
|
||||
@@ -142,12 +139,31 @@
|
||||
// ADC
|
||||
//
|
||||
#define HAL_ADC_VREF_MV 3300
|
||||
#define HAL_ADC_RESOLUTION 10
|
||||
#define HAL_ADC_RESOLUTION 12
|
||||
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
//
|
||||
// Debug port disable
|
||||
// JTMS / SWDIO = PA13
|
||||
// JTCK / SWCLK = PA14
|
||||
// JTDI = PA15
|
||||
// JTDO = PB3
|
||||
// NJTRST = PB4
|
||||
//
|
||||
#define DBG_SWCLK _BV(0)
|
||||
#define DBG_SWDIO _BV(1)
|
||||
#define DBG_TDO _BV(2)
|
||||
#define DBG_TDI _BV(3)
|
||||
#define DBG_TRST _BV(4)
|
||||
#define DBG_ALL (DBG_SWCLK | DBG_SWDIO | DBG_TDO | DBG_TDI | DBG_TRST)
|
||||
|
||||
#define JTAGSWD_RESET() PORT_DebugPortSetting(DBG_ALL, Enable);
|
||||
#define JTAG_DISABLE() PORT_DebugPortSetting(DBG_TDO | DBG_TDI | DBG_TRST, Disable);
|
||||
#define JTAGSWD_DISABLE() PORT_DebugPortSetting(DBG_ALL, Disable);
|
||||
|
||||
//
|
||||
// MarlinHAL implementation
|
||||
//
|
||||
|
||||
@@ -123,6 +123,11 @@ void MarlinHAL::init() {
|
||||
|
||||
// Register min serial
|
||||
TERN_(POSTMORTEM_DEBUGGING, install_min_serial());
|
||||
|
||||
// warn if low memory after init
|
||||
if (freeMemory() < 1024) {
|
||||
SERIAL_WARN_MSG("HAL: low memory after init!\n");
|
||||
}
|
||||
}
|
||||
|
||||
void MarlinHAL::init_board() {}
|
||||
@@ -147,7 +152,31 @@ void MarlinHAL::delay_ms(const int ms) {
|
||||
delay(ms);
|
||||
}
|
||||
|
||||
void MarlinHAL::idletask() {}
|
||||
void MarlinHAL::idletask() {
|
||||
#if ENABLED(MARLIN_DEV_MODE)
|
||||
// check & print serial RX errors
|
||||
MSerialT *serials[] = { &MSerial1, &MSerial2 };
|
||||
for (int serial = 0; serial < 2; serial++) {
|
||||
usart_receive_error_t err = serials[serial]->getReceiveError();
|
||||
if (err != usart_receive_error_t::None) {
|
||||
// "Warning: MSerial[n] RX [Framing|Parity|Overrun] Error"
|
||||
SERIAL_WARN_START();
|
||||
SERIAL_ECHOPGM(" MSerial");
|
||||
SERIAL_ECHO(serial + 1);
|
||||
SERIAL_ECHOPGM(" RX ");
|
||||
switch(err) {
|
||||
case usart_receive_error_t::FramingError: SERIAL_ECHOPGM("Framing"); break;
|
||||
case usart_receive_error_t::ParityError: SERIAL_ECHOPGM("Parity"); break;
|
||||
case usart_receive_error_t::OverrunError: SERIAL_ECHOPGM("Overrun"); break;
|
||||
case usart_receive_error_t::RxDataDropped: SERIAL_ECHOPGM("DataDropped"); break;
|
||||
default: break;
|
||||
}
|
||||
SERIAL_ECHOPGM(" Error");
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t MarlinHAL::get_reset_source() {
|
||||
// Query reset cause from RMU
|
||||
@@ -203,7 +232,9 @@ int MarlinHAL::freeMemory() {
|
||||
return &top - _sbrk(0);
|
||||
}
|
||||
|
||||
void MarlinHAL::adc_init() {}
|
||||
void MarlinHAL::adc_init() {
|
||||
analogReadResolution(HAL_ADC_RESOLUTION);
|
||||
}
|
||||
|
||||
void MarlinHAL::adc_enable(const pin_t pin) {
|
||||
#if TEMP_SENSOR_SOC
|
||||
|
||||
@@ -46,14 +46,34 @@ constexpr bool serial_handles_emergency(int port) {
|
||||
//
|
||||
// Define serial ports
|
||||
//
|
||||
#define DEFINE_HWSERIAL_MARLIN(name, n) \
|
||||
|
||||
// serial port where RX and TX use IRQs
|
||||
#define DEFINE_IRQ_SERIAL_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 where RX uses DMA and TX uses IRQs
|
||||
// all serial ports use DMA1
|
||||
// since there are 4 USARTs and 4 DMA channels, we can use the USART number as the DMA channel
|
||||
#define DEFINE_DMA_SERIAL_MARLIN(name, n) \
|
||||
MSerialT name(serial_handles_emergency(n), \
|
||||
&USART##n##_config, \
|
||||
BOARD_USART##n##_TX_PIN, \
|
||||
BOARD_USART##n##_RX_PIN, \
|
||||
M4_DMA1, \
|
||||
((en_dma_channel_t)(n - 1))); // map USART1 to DMA channel 0, USART2 to DMA channel 1, etc.
|
||||
|
||||
#define DEFINE_SERIAL_MARLIN(name, n) TERN(SERIAL_DMA, DEFINE_DMA_SERIAL_MARLIN(name, n), DEFINE_IRQ_SERIAL_MARLIN(name, n))
|
||||
|
||||
DEFINE_SERIAL_MARLIN(MSerial1, 1);
|
||||
DEFINE_SERIAL_MARLIN(MSerial2, 2);
|
||||
|
||||
// TODO: remove this warning when SERIAL_DMA has been tested some more
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
#warning "SERIAL_DMA may be unstable on HC32F460."
|
||||
#endif
|
||||
|
||||
//
|
||||
// Serial port assertions
|
||||
|
||||
@@ -25,17 +25,42 @@
|
||||
#include <drivers/usart/Usart.h>
|
||||
|
||||
// Optionally set uart IRQ priority to reduce overflow errors
|
||||
// #define UART_IRQ_PRIO 1
|
||||
//#define UART_RX_IRQ_PRIO 1
|
||||
//#define UART_TX_IRQ_PRIO 1
|
||||
//#define UART_RX_DMA_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) {}
|
||||
MarlinSerial(
|
||||
struct usart_config_t *usart_device,
|
||||
gpio_pin_t tx_pin,
|
||||
gpio_pin_t rx_pin
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
, M4_DMA_TypeDef *dma_unit = nullptr,
|
||||
en_dma_channel_t rx_dma_channel = DmaCh0
|
||||
#endif
|
||||
) : Usart(usart_device, tx_pin, rx_pin) {
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
if (dma_unit != nullptr) {
|
||||
enableRxDma(dma_unit, rx_dma_channel);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef UART_IRQ_PRIO
|
||||
#if defined(UART_RX_IRQ_PRIO) || defined(UART_TX_IRQ_PRIO) || defined(UART_RX_DMA_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);
|
||||
#if defined(UART_RX_IRQ_PRIO)
|
||||
NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_RX_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_RX_IRQ_PRIO);
|
||||
#endif
|
||||
|
||||
#if defined(UART_TX_IRQ_PRIO)
|
||||
NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_TX_IRQ_PRIO);
|
||||
NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_TX_IRQ_PRIO);
|
||||
#endif
|
||||
|
||||
#if defined(UART_RX_DMA_IRQ_PRIO) && ENABLED(SERIAL_DMA)
|
||||
NVIC_SetPriority(c_dev()->dma.rx.rx_data_available_dma_btc.interrupt_number, UART_RX_DMA_IRQ_PRIO);
|
||||
#endif
|
||||
}
|
||||
|
||||
void begin(uint32_t baud) {
|
||||
@@ -47,7 +72,12 @@ struct MarlinSerial : public Usart {
|
||||
Usart::begin(baud, config);
|
||||
setPriority();
|
||||
}
|
||||
#endif
|
||||
|
||||
void begin(uint32_t baud, const stc_usart_uart_init_t *config, const bool rxNoiseFilter = true) {
|
||||
Usart::begin(baud, config, rxNoiseFilter);
|
||||
setPriority();
|
||||
}
|
||||
#endif // UART_RX_IRQ_PRIO || UART_TX_IRQ_PRIO || UART_RX_DMA_IRQ_PRIO
|
||||
};
|
||||
|
||||
typedef Serial1Class<MarlinSerial> MSerialT;
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* app_config.h is included by the hc32f460 arduino build script for every source file.
|
||||
* it is used to configure the arduino core (and ddl) automatically according
|
||||
* to the settings in Configuration.h and Configuration_adv.h.
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef _HC32_APP_CONFIG_H_
|
||||
#define _HC32_APP_CONFIG_H_
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
//
|
||||
// dev mode
|
||||
//
|
||||
#if ENABLED(MARLIN_DEV_MODE)
|
||||
#define __DEBUG 1
|
||||
#define __CORE_DEBUG 1
|
||||
#endif
|
||||
|
||||
//
|
||||
// Fault Handlers and Panic
|
||||
//
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
// disable arduino core fault handler, as we define our own
|
||||
#define CORE_DISABLE_FAULT_HANDLER 1
|
||||
#endif
|
||||
|
||||
// force-enable panic handler so that we can use our custom one (in MinSerial)
|
||||
#define PANIC_ENABLE 1
|
||||
|
||||
// use short filenames in ddl debug and core panic output
|
||||
#define __DEBUG_SHORT_FILENAMES 1
|
||||
#define __PANIC_SHORT_FILENAMES 1
|
||||
|
||||
// omit panic messages in core panic output
|
||||
#define __OMIT_PANIC_MESSAGE 1
|
||||
|
||||
//
|
||||
// Usart
|
||||
//
|
||||
|
||||
// disable serial globals (Serial1, Serial2, ...), as we define our own
|
||||
#define DISABLE_SERIAL_GLOBALS 1
|
||||
|
||||
// increase the size of the Usart buffers (both RX and TX)
|
||||
// NOTE:
|
||||
// the heap usage will increase by (SERIAL_BUFFER_SIZE - 64) * "number of serial ports used"
|
||||
// if running out of heap, the system may become unstable
|
||||
//#define SERIAL_BUFFER_SIZE 256
|
||||
|
||||
// enable support for Usart Clock Divider / Oversampling auto config
|
||||
#define USART_AUTO_CLKDIV_OS_CONFIG 1
|
||||
|
||||
// enable USART_RX_DMA_SUPPORT core option when SERIAL_DMA is enabled
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
#define USART_RX_DMA_SUPPORT 1
|
||||
#endif
|
||||
|
||||
//
|
||||
// Misc.
|
||||
//
|
||||
|
||||
// redirect printf to host serial
|
||||
#define REDIRECT_PRINTF_TO_SERIAL 1
|
||||
|
||||
// F_CPU must be known at compile time, but on HC32F460 it's not.
|
||||
// Thus we assume HCLK to be 200MHz, as that's what is configured in
|
||||
// 'core_hook_sysclock_init' in 'sysclock.cpp'.
|
||||
// If you face issues with this assumption, please double-check with the values
|
||||
// printed by 'MarlinHAL::HAL_clock_frequencies_dump'.
|
||||
// see also: HAL_TIMER_RATE in timers.h
|
||||
#define F_CPU 200000000 // 200MHz HCLK
|
||||
|
||||
#endif // _HC32_APP_CONFIG_H_
|
||||
@@ -40,9 +40,15 @@ void endstopIRQHandler() {
|
||||
CHECK(X_MAX);
|
||||
CHECK(X_MIN);
|
||||
|
||||
CHECK(X2_MAX);
|
||||
CHECK(X2_MIN);
|
||||
|
||||
CHECK(Y_MAX);
|
||||
CHECK(Y_MIN);
|
||||
|
||||
CHECK(Y2_MAX);
|
||||
CHECK(Y2_MIN);
|
||||
|
||||
CHECK(Z_MAX);
|
||||
CHECK(Z_MIN);
|
||||
|
||||
@@ -52,6 +58,9 @@ void endstopIRQHandler() {
|
||||
CHECK(Z3_MAX);
|
||||
CHECK(Z3_MIN);
|
||||
|
||||
CHECK(Z4_MAX);
|
||||
CHECK(Z4_MIN);
|
||||
|
||||
CHECK(Z_MIN_PROBE);
|
||||
|
||||
// Update endstops
|
||||
@@ -69,9 +78,15 @@ void setup_endstop_interrupts() {
|
||||
SETUP(X_MAX);
|
||||
SETUP(X_MIN);
|
||||
|
||||
SETUP(X2_MAX);
|
||||
SETUP(X2_MIN);
|
||||
|
||||
SETUP(Y_MAX);
|
||||
SETUP(Y_MIN);
|
||||
|
||||
SETUP(Y2_MAX);
|
||||
SETUP(Y2_MIN);
|
||||
|
||||
SETUP(Z_MAX);
|
||||
SETUP(Z_MIN);
|
||||
|
||||
@@ -81,14 +96,19 @@ void setup_endstop_interrupts() {
|
||||
SETUP(Z3_MAX);
|
||||
SETUP(Z3_MIN);
|
||||
|
||||
SETUP(Z4_MAX);
|
||||
SETUP(Z4_MIN);
|
||||
|
||||
SETUP(Z_MIN_PROBE);
|
||||
|
||||
SETUP(CALIBRATION);
|
||||
|
||||
#undef SETUP
|
||||
}
|
||||
|
||||
// Ensure 1 - 10 IRQs are registered
|
||||
// Disable some endstops if you encounter this error
|
||||
#define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_Y_MAX, USE_Y_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z_MIN_PROBE)
|
||||
#define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_X2_MAX, USE_X2_MIN, USE_Y_MAX, USE_Y_MIN, USE_Y2_MAX, USE_Y2_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z4_MAX, USE_Z4_MIN, USE_Z_MIN_PROBE, USE_CALIBRATION)
|
||||
#if ENDSTOPS_INTERRUPTS_COUNT > 10
|
||||
#error "Too many endstop interrupts! HC32F460 only supports 10 endstop interrupts."
|
||||
#elif ENDSTOPS_INTERRUPTS_COUNT == 0
|
||||
|
||||
@@ -20,6 +20,20 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include <core_util.h>
|
||||
|
||||
#if !defined(ARDUINO_CORE_VERSION_INT) || !defined(GET_VERSION_INT)
|
||||
// version macros were introduced in arduino core version 1.1.0
|
||||
// below that version, we polyfill them
|
||||
#define GET_VERSION_INT(major, minor, patch) ((major * 100000) + (minor * 1000) + patch)
|
||||
#define ARDUINO_CORE_VERSION_INT GET_VERSION_INT(1, 0, 0)
|
||||
#endif
|
||||
|
||||
#if ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 1, 0)
|
||||
// because we use app_config.h introduced in arduino core version 1.1.0, the
|
||||
// HAL is not compatible with older versions
|
||||
#error "The HC32 HAL is not compatible with Arduino Core versions < 1.1.0. Consider updating the Arduino Core."
|
||||
#endif
|
||||
|
||||
#ifndef BOARD_XTAL_FREQUENCY
|
||||
#error "BOARD_XTAL_FREQUENCY is required for HC32F460."
|
||||
@@ -74,3 +88,20 @@
|
||||
#error "HC32 HAL uses a custom panic handler. Do not define PANIC_USARTx_TX_PIN."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(SERIAL_DMA)
|
||||
#if !defined(USART_RX_DMA_SUPPORT)
|
||||
#error "SERIAL_DMA requires USART_RX_DMA_SUPPORT to be enabled in the arduino core."
|
||||
#endif
|
||||
|
||||
// Before arduino core version 1.2.0, USART_RX_DMA_SUPPORT did not implement
|
||||
// core_hook_usart_rx_irq, which is required for the emergency parser.
|
||||
// With 1.2.0, this was fixed (see https://github.com/shadow578/framework-arduino-hc32f46x/pull/25).
|
||||
#if ENABLED(EMERGENCY_PARSER) && ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 2, 0)
|
||||
#error "EMERGENCY_PARSER is not supported with SERIAL_DMA. Please disable either SERIAL_DMA or EMERGENCY_PARSER."
|
||||
#endif
|
||||
|
||||
#if ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 1, 0)
|
||||
#error "SERIAL_DMA is not supported with arduino core version < 1.1.0."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -18,41 +18,47 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Pins Debugging for HC32
|
||||
*
|
||||
* - NUMBER_PINS_TOTAL
|
||||
* - MULTI_NAME_PAD
|
||||
* - getPinByIndex(index)
|
||||
* - printPinNameByIndex(index)
|
||||
* - getPinIsDigitalByIndex(index)
|
||||
* - digitalPinToAnalogIndex(pin)
|
||||
* - getValidPinMode(pin)
|
||||
* - isValidPin(pin)
|
||||
* - isAnalogPin(pin)
|
||||
* - digitalRead_mod(pin)
|
||||
* - pwm_status(pin)
|
||||
* - printPinPWM(pin)
|
||||
* - printPinPort(pin)
|
||||
* - printPinNumber(pin)
|
||||
* - printPinAnalog(pin)
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "fastio.h"
|
||||
#include <drivers/timera/timera_pwm.h>
|
||||
|
||||
//
|
||||
// Translation of routines & variables used by pinsDebug.h
|
||||
//
|
||||
#ifndef BOARD_NR_GPIO_PINS
|
||||
#error "Expected BOARD_NR_GPIO_PINS not found."
|
||||
#endif
|
||||
|
||||
#define NUM_DIGITAL_PINS BOARD_NR_GPIO_PINS
|
||||
#define NUMBER_PINS_TOTAL BOARD_NR_GPIO_PINS
|
||||
#define VALID_PIN(pin) IS_GPIO_PIN(pin)
|
||||
#define isValidPin(P) IS_GPIO_PIN(P)
|
||||
|
||||
// Note: pin_array is defined in `Marlin/src/pins/pinsDebug.h`, and since this file is included
|
||||
// after it, it is available in this file as well.
|
||||
#define GET_ARRAY_PIN(p) pin_t(pin_array[p].pin)
|
||||
#define digitalRead_mod(p) extDigitalRead(p)
|
||||
#define PRINT_PIN(p) \
|
||||
do { \
|
||||
sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); \
|
||||
SERIAL_ECHO(buffer); \
|
||||
} while (0)
|
||||
#define PRINT_PIN_ANALOG(p) \
|
||||
do { \
|
||||
sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); \
|
||||
SERIAL_ECHO(buffer); \
|
||||
} while (0)
|
||||
#define PRINT_PORT(p) print_port(p)
|
||||
#define PRINT_ARRAY_NAME(x) \
|
||||
do { \
|
||||
sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); \
|
||||
SERIAL_ECHO(buffer); \
|
||||
} while (0)
|
||||
#define getPinByIndex(x) pin_t(pin_array[x].pin)
|
||||
#define digitalRead_mod(P) extDigitalRead(P)
|
||||
|
||||
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
|
||||
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
|
||||
#define MULTI_NAME_PAD 21 // Space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
@@ -71,14 +77,14 @@
|
||||
#define M43_NEVER_TOUCH(Q) (IS_HOST_USART_PIN(Q) || IS_OSC_PIN(Q))
|
||||
#endif
|
||||
|
||||
static pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) {
|
||||
if (!VALID_PIN(pin)) return -1;
|
||||
int8_t digitalPinToAnalogIndex(const pin_t pin) {
|
||||
if (!isValidPin(pin)) return -1;
|
||||
const int8_t adc_channel = int8_t(PIN_MAP[pin].adc_info.channel);
|
||||
return pin_t(adc_channel);
|
||||
}
|
||||
|
||||
static bool IS_ANALOG(pin_t pin) {
|
||||
if (!VALID_PIN(pin)) return false;
|
||||
bool isAnalogPin(pin_t pin) {
|
||||
if (!isValidPin(pin)) return false;
|
||||
|
||||
if (PIN_MAP[pin].adc_info.channel != ADC_PIN_INVALID)
|
||||
return _GET_MODE(pin) == INPUT_ANALOG && !M43_NEVER_TOUCH(pin);
|
||||
@@ -86,13 +92,13 @@ static bool IS_ANALOG(pin_t pin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool GET_PINMODE(const pin_t pin) {
|
||||
return VALID_PIN(pin) && !IS_INPUT(pin);
|
||||
bool getValidPinMode(const pin_t pin) {
|
||||
return isValidPin(pin) && !IS_INPUT(pin);
|
||||
}
|
||||
|
||||
static bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) {
|
||||
const pin_t pin = GET_ARRAY_PIN(array_pin);
|
||||
return (!IS_ANALOG(pin));
|
||||
bool getPinIsDigitalByIndex(const int16_t index) {
|
||||
const pin_t pin = getPinByIndex(index);
|
||||
return (!isAnalogPin(pin));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,7 +123,7 @@ bool pwm_status(const pin_t pin) {
|
||||
return timera_is_unit_initialized(unit) && timera_is_channel_active(unit, channel) && getPinMode(pin) == OUTPUT_PWM;
|
||||
}
|
||||
|
||||
void pwm_details(const pin_t pin) {
|
||||
void printPinPWM(const pin_t pin) {
|
||||
// Get timer assignment for pin
|
||||
timera_config_t *unit;
|
||||
en_timera_channel_t channel;
|
||||
@@ -161,7 +167,7 @@ void pwm_details(const pin_t pin) {
|
||||
}
|
||||
}
|
||||
|
||||
void print_port(pin_t pin) {
|
||||
void printPinPort(pin_t pin) {
|
||||
const char port = 'A' + char(pin >> 4); // Pin div 16
|
||||
const int16_t gbit = PIN_MAP[pin].bit_pos;
|
||||
char buffer[8];
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
fn \
|
||||
}
|
||||
|
||||
stc_sd_handle_t *handle;
|
||||
stc_sd_handle_t *handle = nullptr;
|
||||
|
||||
bool SDIO_Init() {
|
||||
// Configure SDIO pins
|
||||
@@ -66,36 +66,45 @@ bool SDIO_Init() {
|
||||
GPIO_SetFunc(BOARD_SDIO_CMD, Func_Sdio);
|
||||
GPIO_SetFunc(BOARD_SDIO_DET, Func_Sdio);
|
||||
|
||||
// If a handle is already initialized, free it before creating a new one
|
||||
// otherwise, we will leak memory, which will eventually crash the system
|
||||
if (handle != nullptr) {
|
||||
delete handle->pstcDmaInitCfg;
|
||||
delete handle->pstcCardInitCfg;
|
||||
delete handle;
|
||||
handle = nullptr;
|
||||
}
|
||||
|
||||
// Create DMA configuration
|
||||
stc_sdcard_dma_init_t *dmaConf = new stc_sdcard_dma_init_t;
|
||||
dmaConf->DMAx = SDIO_DMA_PERIPHERAL;
|
||||
dmaConf->enDmaCh = SDIO_DMA_CHANNEL;
|
||||
|
||||
// Create card configuration
|
||||
// This should be a fairly safe configuration for most cards
|
||||
stc_sdcard_init_t *cardConf = new stc_sdcard_init_t;
|
||||
cardConf->enBusWidth = SdiocBusWidth4Bit;
|
||||
cardConf->enClkFreq = SdiocClk400K;
|
||||
cardConf->enSpeedMode = SdiocNormalSpeedMode;
|
||||
cardConf->pstcInitCfg = nullptr;
|
||||
|
||||
// Create handle in DMA mode
|
||||
handle = new stc_sd_handle_t;
|
||||
handle->SDIOCx = SDIO_PERIPHERAL;
|
||||
handle->enDevMode = SdCardDmaMode;
|
||||
handle->pstcDmaInitCfg = dmaConf;
|
||||
|
||||
// Create card configuration
|
||||
// This should be a fairly safe configuration for most cards
|
||||
stc_sdcard_init_t cardConf = {
|
||||
.enBusWidth = SdiocBusWidth4Bit,
|
||||
.enClkFreq = SdiocClk400K,
|
||||
.enSpeedMode = SdiocNormalSpeedMode,
|
||||
//.pstcInitCfg = NULL,
|
||||
};
|
||||
//handle->pstcCardInitCfg = cardConf; // assigned in SDCARD_Init
|
||||
|
||||
// Initialize sd card
|
||||
en_result_t rc = SDCARD_Init(handle, &cardConf);
|
||||
en_result_t rc = SDCARD_Init(handle, cardConf);
|
||||
if (rc != Ok) printf("SDIO_Init() error (rc=%u)\n", rc);
|
||||
|
||||
return rc == Ok;
|
||||
}
|
||||
|
||||
bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
|
||||
CORE_ASSERT(handle != NULL, "SDIO not initialized");
|
||||
CORE_ASSERT(dst != NULL, "SDIO_ReadBlock dst is NULL");
|
||||
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
|
||||
CORE_ASSERT(dst != nullptr, "SDIO_ReadBlock dst is NULL", return false);
|
||||
|
||||
WITH_RETRY(SDIO_READ_RETRIES, {
|
||||
en_result_t rc = SDCARD_ReadBlocks(handle, block, 1, dst, SDIO_READ_TIMEOUT);
|
||||
@@ -107,8 +116,8 @@ bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
|
||||
}
|
||||
|
||||
bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
|
||||
CORE_ASSERT(handle != NULL, "SDIO not initialized");
|
||||
CORE_ASSERT(src != NULL, "SDIO_WriteBlock src is NULL");
|
||||
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
|
||||
CORE_ASSERT(src != nullptr, "SDIO_WriteBlock src is NULL", return false);
|
||||
|
||||
WITH_RETRY(SDIO_WRITE_RETRIES, {
|
||||
en_result_t rc = SDCARD_WriteBlocks(handle, block, 1, (uint8_t *)src, SDIO_WRITE_TIMEOUT);
|
||||
@@ -120,12 +129,12 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
|
||||
}
|
||||
|
||||
bool SDIO_IsReady() {
|
||||
CORE_ASSERT(handle != NULL, "SDIO not initialized");
|
||||
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false);
|
||||
return bool(handle->stcCardStatus.READY_FOR_DATA);
|
||||
}
|
||||
|
||||
uint32_t SDIO_GetCardSize() {
|
||||
CORE_ASSERT(handle != NULL, "SDIO not initialized");
|
||||
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return 0);
|
||||
|
||||
// Multiply number of blocks with block size to get size in bytes
|
||||
const uint64_t cardSizeBytes = uint64_t(handle->stcSdCardInfo.u32LogBlockNbr) * uint64_t(handle->stcSdCardInfo.u32LogBlockSize);
|
||||
|
||||
@@ -96,29 +96,44 @@ void core_hook_sysclock_init() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Setup clock divisors for sysclk = 200 MHz:
|
||||
// sysclk is now configured according to F_CPU (i.e., 200MHz PLL output)
|
||||
const uint32_t sysclock = F_CPU;
|
||||
|
||||
// Setup clock divisors for sysclk = 200 MHz
|
||||
// Note: PCLK1 is used for step+temp timers, and need to be kept at 50 MHz (until there is a better solution)
|
||||
stc_clk_sysclk_cfg_t sysClkConf = {
|
||||
constexpr stc_clk_sysclk_cfg_t sysClkConf = {
|
||||
.enHclkDiv = ClkSysclkDiv1, // HCLK = 200 MHz (CPU)
|
||||
.enExclkDiv = ClkSysclkDiv2, // EXCLK = 100 MHz (SDIO)
|
||||
.enPclk0Div = ClkSysclkDiv1, // PCLK0 = 200 MHz (Timer6 (not used))
|
||||
.enPclk0Div = ClkSysclkDiv2, // PCLK0 = 100 MHz (Timer6 (not used))
|
||||
.enPclk1Div = ClkSysclkDiv4, // PCLK1 = 50 MHz (USART, SPI, I2S, Timer0 (step+temp), TimerA (Servo))
|
||||
.enPclk2Div = ClkSysclkDiv4, // PCLK2 = 50 MHz (ADC)
|
||||
.enPclk3Div = ClkSysclkDiv4, // PCLK3 = 50 MHz (I2C, WDT)
|
||||
.enPclk2Div = ClkSysclkDiv8, // PCLK2 = 25 MHz (ADC)
|
||||
.enPclk3Div = ClkSysclkDiv8, // PCLK3 = 25 MHz (I2C, WDT)
|
||||
.enPclk4Div = ClkSysclkDiv2, // PCLK4 = 100 MHz (ADC ctl)
|
||||
};
|
||||
|
||||
#if ARDUINO_CORE_VERSION_INT >= GET_VERSION_INT(1, 2, 0)
|
||||
assert_system_clocks_valid<
|
||||
sysclock,
|
||||
sysClkConf.enHclkDiv,
|
||||
sysClkConf.enPclk0Div,
|
||||
sysClkConf.enPclk1Div,
|
||||
sysClkConf.enPclk2Div,
|
||||
sysClkConf.enPclk3Div,
|
||||
sysClkConf.enPclk4Div,
|
||||
sysClkConf.enExclkDiv
|
||||
>();
|
||||
#endif
|
||||
|
||||
sysclock_set_clock_dividers(&sysClkConf);
|
||||
|
||||
// Set power mode
|
||||
#define POWER_MODE_SYSTEM_CLOCK 200000000 // 200 MHz
|
||||
power_mode_update_pre(POWER_MODE_SYSTEM_CLOCK);
|
||||
power_mode_update_pre(sysclock);
|
||||
|
||||
// Switch to MPLL as sysclk source
|
||||
CLK_SetSysClkSource(CLKSysSrcMPLL);
|
||||
|
||||
// Set power mode
|
||||
power_mode_update_post(POWER_MODE_SYSTEM_CLOCK);
|
||||
#undef POWER_MODE_SYSTEM_CLOCK
|
||||
power_mode_update_post(sysclock);
|
||||
}
|
||||
|
||||
#endif // ARDUINO_ARCH_HC32
|
||||
|
||||
@@ -38,44 +38,48 @@ extern Timer0 step_timer;
|
||||
// Timer Configurations
|
||||
//
|
||||
|
||||
// TODO: some calculations (step irq min_step_rate) require the timer rate to be known at compile time
|
||||
// this is not possible with the HC32F460, as the timer rate depends on PCLK1
|
||||
// as a workaround, PCLK1 = 50MHz is assumed (check with clock dump in MarlinHAL::init())
|
||||
#define HAL_TIMER_RATE 50000000 // 50MHz
|
||||
// #define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY
|
||||
|
||||
// TODO: CYCLES_PER_MICROSECOND seems to be used by Marlin to calculate the number of cycles per microsecond in the timer ISRs
|
||||
// by default, it uses F_CPU, but since that is not known at compile time for HC32, we overwrite it here
|
||||
#undef CYCLES_PER_MICROSECOND
|
||||
#define CYCLES_PER_MICROSECOND (HAL_TIMER_RATE / 1000000UL)
|
||||
/**
|
||||
* HAL_TIMER_RATE must be known at compile time since it's used to calculate
|
||||
* STEPPER_TIMER_RATE, which is used in 'constexpr' calculations.
|
||||
* On the HC32F460 the timer rate depends on PCLK1, which is derived from the
|
||||
* system clock configured at runtime. As a workaround, we use the existing
|
||||
* assumption of a 200MHz clock, defining F_CPU as 200000000, then configure PCLK1
|
||||
* as F_CPU with a divider of 4 in 'sysclock.cpp::core_hook_sysclock_init'.
|
||||
*
|
||||
* If you face issues with this assumption, please double-check with the values
|
||||
* printed by 'MarlinHAL::HAL_clock_frequencies_dump'.
|
||||
*
|
||||
* TODO: If the 'constexpr' requirement is ever lifted, use TIMER0_BASE_FREQUENCY instead
|
||||
*/
|
||||
#define HAL_TIMER_RATE (F_CPU / 4) // i.e., 50MHz
|
||||
//#define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY
|
||||
|
||||
// Temperature timer
|
||||
#define TEMP_TIMER_NUM (&temp_timer)
|
||||
#define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02
|
||||
#define TEMP_TIMER_PRESCALE 16ul
|
||||
#define TEMP_TIMER_RATE 1000 // 1kHz
|
||||
#define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // Alias for Marlin
|
||||
#define TEMP_TIMER_NUM (&temp_timer)
|
||||
#define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02
|
||||
#define TEMP_TIMER_PRESCALE 16UL // 12.5MHz
|
||||
#define TEMP_TIMER_RATE 1000 // 1kHz
|
||||
#define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // 1kHz also
|
||||
|
||||
// Stepper timer
|
||||
#define STEP_TIMER_NUM (&step_timer)
|
||||
#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_01
|
||||
#define STEPPER_TIMER_PRESCALE 16ul
|
||||
#define STEP_TIMER_NUM (&step_timer)
|
||||
#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_00 // Top priority, nothing else uses it
|
||||
#define STEPPER_TIMER_PRESCALE 16UL // 12.5MHz
|
||||
|
||||
// TODO: STEPPER_TIMER_RATE seems to work fine like this, but requires further testing...
|
||||
#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz
|
||||
#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000)
|
||||
#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz
|
||||
#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000UL) // Integer 3
|
||||
|
||||
// Pulse timer (== stepper timer)
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
|
||||
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
|
||||
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
|
||||
|
||||
//
|
||||
// Channel aliases
|
||||
//
|
||||
#define MF_TIMER_TEMP TEMP_TIMER_NUM
|
||||
#define MF_TIMER_STEP STEP_TIMER_NUM
|
||||
#define MF_TIMER_PULSE PULSE_TIMER_NUM
|
||||
#define MF_TIMER_TEMP TEMP_TIMER_NUM
|
||||
#define MF_TIMER_STEP STEP_TIMER_NUM
|
||||
#define MF_TIMER_PULSE PULSE_TIMER_NUM
|
||||
|
||||
//
|
||||
// HAL functions
|
||||
|
||||
@@ -82,7 +82,7 @@ static inline uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, c
|
||||
}
|
||||
|
||||
static void u8g_sw_spi_shift_out(uint8_t val) {
|
||||
#if ANY(FYSETC_MINI_12864, MKS_MINI_12864)
|
||||
#if U8G_SPI_USE_MODE_3
|
||||
swSpiTransfer_mode_3(val, SPI_speed);
|
||||
#else
|
||||
swSpiTransfer_mode_0(val, SPI_speed);
|
||||
@@ -116,15 +116,15 @@ uint8_t u8g_com_HAL_HC32_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, voi
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_CHIP_SELECT:
|
||||
#if ANY(FYSETC_MINI_12864, MKS_MINI_12864) // This LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
WRITE(DOGLCD_SCK, HIGH); // Set SCK to mode 3 idle state before CS goes active
|
||||
#if U8G_SPI_USE_MODE_3 // This LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
WRITE(DOGLCD_SCK, HIGH); // Set SCK to mode 3 idle state before CS goes active
|
||||
WRITE(DOGLCD_CS, LOW);
|
||||
}
|
||||
else {
|
||||
WRITE(DOGLCD_CS, HIGH);
|
||||
WRITE(DOGLCD_SCK, LOW); // Set SCK to mode 0 idle state after CS goes inactive
|
||||
WRITE(DOGLCD_SCK, LOW); // Set SCK to mode 0 idle state after CS goes inactive
|
||||
}
|
||||
#else
|
||||
WRITE(DOGLCD_CS, !arg_val);
|
||||
|
||||
@@ -52,7 +52,7 @@ uint8_t MarlinHAL::active_ch = 0;
|
||||
|
||||
uint16_t MarlinHAL::adc_value() {
|
||||
const pin_t pin = analogInputToDigitalPin(active_ch);
|
||||
if (!VALID_PIN(pin)) return 0;
|
||||
if (!isValidPin(pin)) return 0;
|
||||
return uint16_t((Gpio::get(pin) >> 2) & 0x3FF); // return 10bit value as Marlin expects
|
||||
}
|
||||
|
||||
|
||||
@@ -49,28 +49,28 @@ extern "C" void delay(const int msec) {
|
||||
// IO functions
|
||||
// As defined by Arduino INPUT(0x0), OUTPUT(0x1), INPUT_PULLUP(0x2)
|
||||
void pinMode(const pin_t pin, const uint8_t mode) {
|
||||
if (!VALID_PIN(pin)) return;
|
||||
if (!isValidPin(pin)) return;
|
||||
Gpio::setMode(pin, mode);
|
||||
}
|
||||
|
||||
void digitalWrite(pin_t pin, uint8_t pin_status) {
|
||||
if (!VALID_PIN(pin)) return;
|
||||
if (!isValidPin(pin)) return;
|
||||
Gpio::set(pin, pin_status);
|
||||
}
|
||||
|
||||
bool digitalRead(pin_t pin) {
|
||||
if (!VALID_PIN(pin)) return false;
|
||||
if (!isValidPin(pin)) return false;
|
||||
return Gpio::get(pin);
|
||||
}
|
||||
|
||||
void analogWrite(pin_t pin, int pwm_value) { // 1 - 254: pwm_value, 0: LOW, 255: HIGH
|
||||
if (!VALID_PIN(pin)) return;
|
||||
if (!isValidPin(pin)) return;
|
||||
Gpio::set(pin, pwm_value);
|
||||
}
|
||||
|
||||
uint16_t analogRead(pin_t adc_pin) {
|
||||
if (!VALID_PIN(DIGITAL_PIN_TO_ANALOG_PIN(adc_pin))) return 0;
|
||||
return Gpio::get(DIGITAL_PIN_TO_ANALOG_PIN(adc_pin));
|
||||
if (!isValidPin(digitalPinToAnalogIndex(adc_pin))) return 0;
|
||||
return Gpio::get(digitalPinToAnalogIndex(adc_pin));
|
||||
}
|
||||
|
||||
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) {
|
||||
|
||||
@@ -37,7 +37,10 @@ Timer::Timer() {
|
||||
}
|
||||
|
||||
Timer::~Timer() {
|
||||
timer_delete(timerid);
|
||||
if (timerid != 0) {
|
||||
timer_delete(timerid);
|
||||
timerid = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) {
|
||||
|
||||
@@ -37,29 +37,29 @@ constexpr uint8_t NUM_ANALOG_INPUTS = 16;
|
||||
constexpr uint8_t analog_offset = NUM_DIGITAL_PINS - NUM_ANALOG_INPUTS;
|
||||
|
||||
// Get the digital pin for an analog index
|
||||
constexpr pin_t analogInputToDigitalPin(const int8_t p) {
|
||||
return (WITHIN(p, 0, NUM_ANALOG_INPUTS) ? analog_offset + p : P_NC);
|
||||
constexpr pin_t analogInputToDigitalPin(const int8_t a) {
|
||||
return (WITHIN(a, 0, NUM_ANALOG_INPUTS - 1) ? analog_offset + a : P_NC);
|
||||
}
|
||||
|
||||
// Get the analog index for a digital pin
|
||||
constexpr int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p) {
|
||||
return (WITHIN(p, analog_offset, NUM_DIGITAL_PINS) ? p - analog_offset : P_NC);
|
||||
constexpr int8_t digitalPinToAnalogIndex(const pin_t pin) {
|
||||
return (WITHIN(pin, analog_offset, NUM_DIGITAL_PINS - 1) ? pin - analog_offset : P_NC);
|
||||
}
|
||||
|
||||
// Return the index of a pin number
|
||||
constexpr int16_t GET_PIN_MAP_INDEX(const pin_t pin) { return pin; }
|
||||
|
||||
// Test whether the pin is valid
|
||||
constexpr bool VALID_PIN(const pin_t p) { return WITHIN(p, 0, NUM_DIGITAL_PINS); }
|
||||
constexpr bool isValidPin(const pin_t pin) { return WITHIN(pin, 0, NUM_DIGITAL_PINS - 1); }
|
||||
|
||||
// Test whether the pin is PWM
|
||||
constexpr bool PWM_PIN(const pin_t p) { return false; }
|
||||
constexpr bool PWM_PIN(const pin_t) { return false; }
|
||||
|
||||
// Test whether the pin is interruptible
|
||||
constexpr bool INTERRUPT_PIN(const pin_t p) { return false; }
|
||||
constexpr bool INTERRUPT_PIN(const pin_t) { return false; }
|
||||
|
||||
// Get the pin number at the given index
|
||||
constexpr pin_t GET_PIN_MAP_PIN(const int16_t ind) { return ind; }
|
||||
constexpr pin_t GET_PIN_MAP_PIN(const int16_t index) { return pin_t(index); }
|
||||
|
||||
// Parse a G-code word into a pin index
|
||||
int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#ifdef __PLAT_LINUX__
|
||||
#ifndef UNIT_TEST
|
||||
|
||||
//#define GPIO_LOGGING // Full GPIO and Positional Logging
|
||||
|
||||
@@ -135,4 +136,5 @@ int main() {
|
||||
read_serial.join();
|
||||
}
|
||||
|
||||
#endif // UNIT_TEST
|
||||
#endif // __PLAT_LINUX__
|
||||
|
||||
@@ -19,30 +19,50 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Support routines for X86_64
|
||||
*/
|
||||
|
||||
/**
|
||||
* Translation of routines & variables used by pinsDebug.h
|
||||
* Pins Debugging for Linux Native
|
||||
*
|
||||
* - NUMBER_PINS_TOTAL
|
||||
* - MULTI_NAME_PAD
|
||||
* - getPinByIndex(index)
|
||||
* - printPinNameByIndex(index)
|
||||
* - getPinIsDigitalByIndex(index)
|
||||
* - digitalPinToAnalogIndex(pin)
|
||||
* - getValidPinMode(pin)
|
||||
* - isValidPin(pin)
|
||||
* - isAnalogPin(pin)
|
||||
* - digitalRead_mod(pin)
|
||||
* - pwm_status(pin)
|
||||
* - printPinPWM(pin)
|
||||
* - printPinPort(pin)
|
||||
* - printPinNumber(pin)
|
||||
* - printPinAnalog(pin)
|
||||
*/
|
||||
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
||||
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
|
||||
#define digitalRead_mod(p) digitalRead(p)
|
||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
#define getPinByIndex(x) pin_array[x].pin
|
||||
|
||||
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
|
||||
// active ADC function/mode/code values for PINSEL registers
|
||||
constexpr int8_t ADC_pin_mode(pin_t pin) { return -1; }
|
||||
constexpr int8_t ADC_pin_mode(const pin_t) { return -1; }
|
||||
|
||||
int8_t get_pin_mode(const pin_t pin) { return VALID_PIN(pin) ? 0 : -1; }
|
||||
// The pin and index are the same on this platform
|
||||
bool getPinIsDigitalByIndex(const pin_t pin) {
|
||||
return (!isAnalogPin(pin) || get_pin_mode(pin) != ADC_pin_mode(pin));
|
||||
}
|
||||
|
||||
bool GET_PINMODE(const pin_t pin) {
|
||||
#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0)
|
||||
|
||||
#define digitalRead_mod(P) digitalRead(P)
|
||||
|
||||
int8_t get_pin_mode(const pin_t pin) { return isValidPin(pin) ? 0 : -1; }
|
||||
|
||||
bool getValidPinMode(const pin_t pin) {
|
||||
const int8_t pin_mode = get_pin_mode(pin);
|
||||
if (pin_mode == -1 || pin_mode == ADC_pin_mode(pin)) // Invalid pin or active analog pin
|
||||
return false;
|
||||
@@ -50,11 +70,11 @@ bool GET_PINMODE(const pin_t pin) {
|
||||
return (Gpio::getMode(pin) != 0); // Input/output state
|
||||
}
|
||||
|
||||
bool GET_ARRAY_IS_DIGITAL(const pin_t pin) {
|
||||
return (!IS_ANALOG(pin) || get_pin_mode(pin) != ADC_pin_mode(pin));
|
||||
}
|
||||
|
||||
void pwm_details(const pin_t pin) {}
|
||||
void printPinPWM(const pin_t) {}
|
||||
bool pwm_status(const pin_t) { return false; }
|
||||
|
||||
void print_port(const pin_t) {}
|
||||
void printPinPort(const pin_t) {}
|
||||
|
||||
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0)
|
||||
|
||||
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
|
||||
@@ -28,12 +28,6 @@
|
||||
// spiBeginTransaction.
|
||||
#endif
|
||||
|
||||
// Onboard SD
|
||||
//#define SD_SCK_PIN P0_07
|
||||
//#define SD_MISO_PIN P0_08
|
||||
//#define SD_MOSI_PIN P0_09
|
||||
//#define SD_SS_PIN P0_06
|
||||
|
||||
// External SD
|
||||
#ifndef SD_SCK_PIN
|
||||
#define SD_SCK_PIN 50
|
||||
|
||||
@@ -82,13 +82,13 @@ extern DefaultSerial1 USBSerial;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#if MMU2_SERIAL_PORT == -1
|
||||
#define MMU2_SERIAL USBSerial
|
||||
#elif WITHIN(MMU2_SERIAL_PORT, 0, 3)
|
||||
#define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
|
||||
#ifdef MMU_SERIAL_PORT
|
||||
#if MMU_SERIAL_PORT == -1
|
||||
#define MMU_SERIAL USBSerial
|
||||
#elif WITHIN(MMU_SERIAL_PORT, 0, 3)
|
||||
#define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
|
||||
#else
|
||||
#error "MMU2_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#error "MMU_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -100,7 +100,7 @@ extern DefaultSerial1 USBSerial;
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#endif
|
||||
#if HAS_DGUS_LCD
|
||||
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI)
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.available()
|
||||
#endif
|
||||
#endif
|
||||
@@ -137,12 +137,12 @@ extern DefaultSerial1 USBSerial;
|
||||
//
|
||||
|
||||
// Test whether the pin is valid
|
||||
constexpr bool VALID_PIN(const pin_t pin) {
|
||||
constexpr bool isValidPin(const pin_t pin) {
|
||||
return LPC176x::pin_is_valid(pin);
|
||||
}
|
||||
|
||||
// Get the analog index for a digital pin
|
||||
constexpr int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t pin) {
|
||||
constexpr int8_t digitalPinToAnalogIndex(const pin_t pin) {
|
||||
return (LPC176x::pin_is_valid(pin) && LPC176x::pin_has_adc(pin)) ? pin : -1;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ constexpr pin_t GET_PIN_MAP_PIN(const int16_t index) {
|
||||
// Parse a G-code word into a pin index
|
||||
int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
|
||||
// P0.6 thru P0.9 are for the onboard SD card
|
||||
#define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09,
|
||||
#define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09
|
||||
|
||||
// ------------------------
|
||||
// Defines
|
||||
|
||||
@@ -146,6 +146,12 @@ void setup_endstop_interrupts() {
|
||||
#endif
|
||||
_ATTACH(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
#if USE_CALIBRATION
|
||||
#if !LPC1768_PIN_INTERRUPT_M(CALIBRATION_PIN)
|
||||
#error "CALIBRATION_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
|
||||
#endif
|
||||
_ATTACH(CALIBRATION_PIN);
|
||||
#endif
|
||||
#if USE_I_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(I_MAX_PIN)
|
||||
#error "I_MAX_PIN is not INTERRUPT-capable. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
|
||||
|
||||
@@ -26,8 +26,10 @@
|
||||
|
||||
void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
if (!LPC176x::pin_is_valid(pin)) return;
|
||||
if (LPC176x::pwm_attach_pin(pin))
|
||||
LPC176x::pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size); // map 1-254 onto PWM range
|
||||
if (LPC176x::pwm_attach_pin(pin)) {
|
||||
const uint32_t duty = map(invert ? v_size - v : v, 0, v_size, 0, LPC176x::pwm_get_period(pin));
|
||||
LPC176x::pwm_write(pin, duty);
|
||||
}
|
||||
}
|
||||
|
||||
void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
#define _WRITE(IO,V) WRITE_PIN(IO,V)
|
||||
|
||||
/// toggle a pin
|
||||
#define _TOGGLE(IO) _WRITE(IO, !READ(IO))
|
||||
#define _TOGGLE(IO) LPC176x::gpio_toggle(IO)
|
||||
|
||||
/// set pin as input
|
||||
#define _SET_INPUT(IO) SET_DIR_INPUT(IO)
|
||||
|
||||
@@ -19,22 +19,35 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Support routines for LPC1768
|
||||
*/
|
||||
|
||||
/**
|
||||
* Translation of routines & variables used by pinsDebug.h
|
||||
* Pins Debugging for LPC1768/9
|
||||
*
|
||||
* - NUMBER_PINS_TOTAL
|
||||
* - MULTI_NAME_PAD
|
||||
* - getPinByIndex(index)
|
||||
* - printPinNameByIndex(index)
|
||||
* - getPinIsDigitalByIndex(index)
|
||||
* - digitalPinToAnalogIndex(pin)
|
||||
* - getValidPinMode(pin)
|
||||
* - isValidPin(pin)
|
||||
* - isAnalogPin(pin)
|
||||
* - digitalRead_mod(pin)
|
||||
* - pwm_status(pin)
|
||||
* - printPinPWM(pin)
|
||||
* - printPinPort(pin)
|
||||
* - printPinNumber(pin)
|
||||
* - printPinAnalog(pin)
|
||||
*/
|
||||
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
||||
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
|
||||
#define digitalRead_mod(p) extDigitalRead(p)
|
||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("P%d_%02d"), LPC176x::pin_port(p), LPC176x::pin_bit(p)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR("_A%d "), LPC176x::pin_get_adc_channel(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0)
|
||||
#define digitalRead_mod(P) extDigitalRead(P)
|
||||
#define getPinByIndex(x) pin_array[x].pin
|
||||
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("P%d_%02d"), LPC176x::pin_port(P), LPC176x::pin_bit(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR("_A%d "), LPC176x::pin_get_adc_channel(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define MULTI_NAME_PAD 17 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
// pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities
|
||||
@@ -42,15 +55,15 @@
|
||||
#define M43_NEVER_TOUCH(Q) ((Q) == P0_29 || (Q) == P0_30 || (Q) == P2_09) // USB pins
|
||||
#endif
|
||||
|
||||
bool GET_PINMODE(const pin_t pin) {
|
||||
bool getValidPinMode(const pin_t pin) {
|
||||
if (!LPC176x::pin_is_valid(pin) || LPC176x::pin_adc_enabled(pin)) // Invalid pin or active analog pin
|
||||
return false;
|
||||
|
||||
return LPC176x::gpio_direction(pin);
|
||||
}
|
||||
|
||||
#define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital)
|
||||
#define getPinIsDigitalByIndex(x) ((bool) pin_array[x].is_digital)
|
||||
|
||||
void print_port(const pin_t) {}
|
||||
void pwm_details(const pin_t) {}
|
||||
void printPinPort(const pin_t) {}
|
||||
void printPinPWM(const pin_t) {}
|
||||
bool pwm_status(const pin_t) { return false; }
|
||||
|
||||
@@ -28,12 +28,13 @@
|
||||
// spiBeginTransaction.
|
||||
#endif
|
||||
|
||||
/** onboard SD card */
|
||||
//#define SD_SCK_PIN P0_07
|
||||
//#define SD_MISO_PIN P0_08
|
||||
//#define SD_MOSI_PIN P0_09
|
||||
//#define SD_SS_PIN P0_06
|
||||
/** external */
|
||||
// Onboard SD
|
||||
//#define SD_SCK_PIN P0_07
|
||||
//#define SD_MISO_PIN P0_08
|
||||
//#define SD_MOSI_PIN P0_09
|
||||
//#define SD_SS_PIN P0_06
|
||||
|
||||
// External SD
|
||||
#ifndef SD_SCK_PIN
|
||||
#define SD_SCK_PIN P0_15
|
||||
#endif
|
||||
|
||||
@@ -132,7 +132,7 @@ uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t sck
|
||||
static uint8_t SPI_speed = 0;
|
||||
|
||||
static void u8g_sw_spi_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val) {
|
||||
#if ANY(FYSETC_MINI_12864, MKS_MINI_12864)
|
||||
#if U8G_SPI_USE_MODE_3
|
||||
swSpiTransfer_mode_3(val, SPI_speed, clockPin, -1, dataPin);
|
||||
#else
|
||||
swSpiTransfer_mode_0(val, SPI_speed, clockPin, -1, dataPin);
|
||||
@@ -160,15 +160,15 @@ uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val,
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_CHIP_SELECT:
|
||||
#if ANY(FYSETC_MINI_12864, MKS_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
u8g_SetPILevel(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active
|
||||
#if U8G_SPI_USE_MODE_3 // LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
u8g_SetPILevel(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active
|
||||
u8g_SetPILevel(u8g, U8G_PI_CS, LOW);
|
||||
}
|
||||
else {
|
||||
u8g_SetPILevel(u8g, U8G_PI_CS, HIGH);
|
||||
u8g_SetPILevel(u8g, U8G_PI_SCK, 0); // Set SCK to mode 0 idle state after CS goes inactive
|
||||
u8g_SetPILevel(u8g, U8G_PI_SCK, 0); // Set SCK to mode 0 idle state after CS goes inactive
|
||||
}
|
||||
#else
|
||||
u8g_SetPILevel(u8g, U8G_PI_CS, !arg_val);
|
||||
|
||||
@@ -13,9 +13,9 @@ if pioutil.is_pio_build():
|
||||
target_drive = "REARM"
|
||||
|
||||
import platform
|
||||
|
||||
current_OS = platform.system()
|
||||
Import("env")
|
||||
|
||||
env = pioutil.env
|
||||
|
||||
def print_error(e):
|
||||
print('\nUnable to find destination disk (%s)\n' \
|
||||
|
||||
@@ -87,11 +87,11 @@ extern MSerialT serial_stream_3;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#if WITHIN(MMU2_SERIAL_PORT, 0, 3)
|
||||
#define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
|
||||
#ifdef MMU_SERIAL_PORT
|
||||
#if WITHIN(MMU_SERIAL_PORT, 0, 3)
|
||||
#define MMU_SERIAL MSERIAL(MMU_SERIAL_PORT)
|
||||
#else
|
||||
#error "MMU2_SERIAL_PORT must be from 0 to 3. Please update your configuration."
|
||||
#error "MMU_SERIAL_PORT must be from 0 to 3. Please update your configuration."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "pinsDebug.h"
|
||||
|
||||
int8_t ADC_pin_mode(pin_t pin) { return -1; }
|
||||
int8_t ADC_pin_mode(const pin_t) { return -1; }
|
||||
|
||||
int8_t get_pin_mode(const pin_t pin) { return VALID_PIN(pin) ? 0 : -1; }
|
||||
int8_t get_pin_mode(const pin_t pin) { return isValidPin(pin) ? 0 : -1; }
|
||||
|
||||
bool GET_PINMODE(const pin_t pin) {
|
||||
bool getValidPinMode(const pin_t pin) {
|
||||
const int8_t pin_mode = get_pin_mode(pin);
|
||||
if (pin_mode == -1 || pin_mode == ADC_pin_mode(pin)) // Invalid pin or active analog pin
|
||||
return false;
|
||||
@@ -37,12 +37,13 @@ bool GET_PINMODE(const pin_t pin) {
|
||||
return (Gpio::getMode(pin) != 0); // Input/output state
|
||||
}
|
||||
|
||||
bool GET_ARRAY_IS_DIGITAL(const pin_t pin) {
|
||||
return !IS_ANALOG(pin) || get_pin_mode(pin) != ADC_pin_mode(pin);
|
||||
// The pin and index are the same on this platform
|
||||
bool getPinIsDigitalByIndex(const pin_t pin) {
|
||||
return !isAnalogPin(pin) || get_pin_mode(pin) != ADC_pin_mode(pin);
|
||||
}
|
||||
|
||||
void print_port(const pin_t) {}
|
||||
void pwm_details(const pin_t) {}
|
||||
void printPinPort(const pin_t) {}
|
||||
void printPinPWM(const pin_t) {}
|
||||
bool pwm_status(const pin_t) { return false; }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,30 +19,43 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support routines for X86_64
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Translation of routines & variables used by pinsDebug.h
|
||||
* Pins Debugging for x86_64
|
||||
*
|
||||
* - NUMBER_PINS_TOTAL
|
||||
* - MULTI_NAME_PAD
|
||||
* - getPinByIndex(index)
|
||||
* - printPinNameByIndex(index)
|
||||
* - getPinIsDigitalByIndex(index)
|
||||
* - digitalPinToAnalogIndex(pin)
|
||||
* - getValidPinMode(pin)
|
||||
* - isValidPin(pin)
|
||||
* - isAnalogPin(pin)
|
||||
* - digitalRead_mod(pin)
|
||||
* - pwm_status(pin)
|
||||
* - printPinPWM(pin)
|
||||
* - printPinPort(pin)
|
||||
* - printPinNumber(pin)
|
||||
* - printPinAnalog(pin)
|
||||
*/
|
||||
|
||||
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
|
||||
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
|
||||
#define digitalRead_mod(p) digitalRead(p)
|
||||
#define GET_ARRAY_PIN(p) pin_array[p].pin
|
||||
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
|
||||
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define isValidPin(P) (P >= 0 && P < pin_t(NUMBER_PINS_TOTAL))
|
||||
#define isAnalogPin(P) (digitalPinToAnalogIndex(P) >= 0)
|
||||
#define digitalRead_mod(P) digitalRead(P)
|
||||
#define getPinByIndex(x) pin_array[x].pin
|
||||
#define printPinNameByIndex(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinNumber(P) do{ sprintf_P(buffer, PSTR("%3d "), P); SERIAL_ECHO(buffer); }while(0)
|
||||
#define printPinAnalog(P) do{ sprintf_P(buffer, PSTR(" (A%2d) "), digitalPinToAnalogIndex(P)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
||||
|
||||
// Active ADC function/mode/code values for PINSEL registers
|
||||
int8_t ADC_pin_mode(pin_t pin);
|
||||
int8_t get_pin_mode(const pin_t pin);
|
||||
bool GET_PINMODE(const pin_t pin);
|
||||
bool GET_ARRAY_IS_DIGITAL(const pin_t pin);
|
||||
void print_port(const pin_t);
|
||||
void pwm_details(const pin_t);
|
||||
int8_t ADC_pin_mode(const pin_t);
|
||||
int8_t get_pin_mode(const pin_t);
|
||||
bool getValidPinMode(const pin_t);
|
||||
bool getPinIsDigitalByIndex(const pin_t);
|
||||
void printPinPort(const pin_t);
|
||||
void printPinPWM(const pin_t);
|
||||
bool pwm_status(const pin_t);
|
||||
|
||||
@@ -131,7 +131,7 @@ static uint8_t swSpiInit(const uint8_t spi_speed, const uint8_t clk_pin, const u
|
||||
}
|
||||
|
||||
static void u8g_sw_spi_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val) {
|
||||
#if ANY(FYSETC_MINI_12864, MKS_MINI_12864)
|
||||
#if U8G_SPI_USE_MODE_3
|
||||
swSpiTransfer_mode_3(val, SPI_speed, clockPin, -1, dataPin);
|
||||
#else
|
||||
swSpiTransfer_mode_0(val, SPI_speed, clockPin, -1, dataPin);
|
||||
@@ -159,15 +159,15 @@ uint8_t u8g_com_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_CHIP_SELECT:
|
||||
#if ANY(FYSETC_MINI_12864, MKS_MINI_12864) // LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
u8g_SetPILevel(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active
|
||||
#if U8G_SPI_USE_MODE_3 // LCD SPI is running mode 3 while SD card is running mode 0
|
||||
if (arg_val) { // SCK idle state needs to be set to the proper idle state before
|
||||
// the next chip select goes active
|
||||
u8g_SetPILevel(u8g, U8G_PI_SCK, 1); // Set SCK to mode 3 idle state before CS goes active
|
||||
u8g_SetPILevel(u8g, U8G_PI_CS, LOW);
|
||||
}
|
||||
else {
|
||||
u8g_SetPILevel(u8g, U8G_PI_CS, HIGH);
|
||||
u8g_SetPILevel(u8g, U8G_PI_SCK, 0); // Set SCK to mode 0 idle state after CS goes inactive
|
||||
u8g_SetPILevel(u8g, U8G_PI_SCK, 0); // Set SCK to mode 0 idle state after CS goes inactive
|
||||
}
|
||||
#else
|
||||
u8g_SetPILevel(u8g, U8G_PI_CS, !arg_val);
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include "HAL.h"
|
||||
//#include "usb_serial.h"
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../shared/Delay.h"
|
||||
|
||||
extern "C" {
|
||||
#include "pico/bootrom.h"
|
||||
#include "hardware/watchdog.h"
|
||||
}
|
||||
|
||||
#if HAS_SD_HOST_DRIVE
|
||||
#include "msc_sd.h"
|
||||
#include "usbd_cdc_if.h"
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
volatile uint16_t adc_result;
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial());
|
||||
|
||||
// HAL initialization task
|
||||
void MarlinHAL::init() {
|
||||
// Ensure F_CPU is a constant expression.
|
||||
// If the compiler breaks here, it means that delay code that should compute at compile time will not work.
|
||||
// So better safe than sorry here.
|
||||
constexpr int cpuFreq = F_CPU;
|
||||
UNUSED(cpuFreq);
|
||||
|
||||
#undef SDSS
|
||||
#define SDSS 2
|
||||
#define PIN_EXISTS_(P1,P2) (defined(P1##P2) && P1##P2 >= 0)
|
||||
#if HAS_MEDIA && DISABLED(SDIO_SUPPORT) && PIN_EXISTS_(SDSS,)
|
||||
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(LED)
|
||||
OUT_WRITE(LED_PIN, LOW);
|
||||
#endif
|
||||
|
||||
#if ENABLED(SRAM_EEPROM_EMULATION)
|
||||
// __HAL_RCC_PWR_CLK_ENABLE();
|
||||
// HAL_PWR_EnableBkUpAccess(); // Enable access to backup SRAM
|
||||
// __HAL_RCC_BKPSRAM_CLK_ENABLE();
|
||||
// LL_PWR_EnableBkUpRegulator(); // Enable backup regulator
|
||||
// while (!LL_PWR_IsActiveFlag_BRR()); // Wait until backup regulator is initialized
|
||||
#endif
|
||||
|
||||
HAL_timer_init();
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC
|
||||
USB_Hook_init();
|
||||
#endif
|
||||
|
||||
TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); // Install the min serial handler
|
||||
|
||||
TERN_(HAS_SD_HOST_DRIVE, MSC_SD_init()); // Enable USB SD card access
|
||||
|
||||
#if PIN_EXISTS(USB_CONNECT)
|
||||
OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
|
||||
delay_ms(1000); // Give OS time to notice
|
||||
WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t MarlinHAL::get_reset_source() {
|
||||
return watchdog_enable_caused_reboot() ? RST_WATCHDOG : 0;
|
||||
}
|
||||
|
||||
void MarlinHAL::reboot() { watchdog_reboot(0, 0, 1); }
|
||||
|
||||
// ------------------------
|
||||
// Watchdog Timer
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
|
||||
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
|
||||
|
||||
extern "C" {
|
||||
#include "hardware/watchdog.h"
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||
static_assert(WDT_TIMEOUT_US > 1000, "WDT Timout is too small, aborting");
|
||||
watchdog_enable(WDT_TIMEOUT_US/1000, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MarlinHAL::watchdog_refresh() {
|
||||
watchdog_update();
|
||||
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
|
||||
TOGGLE(LED_PIN); // heartbeat indicator
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
volatile bool MarlinHAL::adc_has_result = false;
|
||||
|
||||
void MarlinHAL::adc_init() {
|
||||
analogReadResolution(HAL_ADC_RESOLUTION);
|
||||
::adc_init();
|
||||
adc_fifo_setup(true, false, 1, false, false);
|
||||
irq_set_exclusive_handler(ADC_IRQ_FIFO, adc_exclusive_handler);
|
||||
irq_set_enabled(ADC_IRQ_FIFO, true);
|
||||
adc_irq_set_enabled(true);
|
||||
}
|
||||
|
||||
void MarlinHAL::adc_enable(const pin_t pin) {
|
||||
if (pin >= A0 && pin <= A3)
|
||||
adc_gpio_init(pin);
|
||||
else if (pin == HAL_ADC_MCU_TEMP_DUMMY_PIN)
|
||||
adc_set_temp_sensor_enabled(true);
|
||||
}
|
||||
|
||||
void MarlinHAL::adc_start(const pin_t pin) {
|
||||
adc_has_result = false;
|
||||
// Select an ADC input. 0...3 are GPIOs 26...29 respectively.
|
||||
adc_select_input(pin == HAL_ADC_MCU_TEMP_DUMMY_PIN ? 4 : pin - A0);
|
||||
adc_run(true);
|
||||
}
|
||||
|
||||
void MarlinHAL::adc_exclusive_handler() {
|
||||
adc_run(false); // Disable since we only want one result
|
||||
irq_clear(ADC_IRQ_FIFO); // Clear the IRQ
|
||||
|
||||
if (adc_fifo_get_level() >= 1) {
|
||||
adc_result = adc_fifo_get(); // Pop the result
|
||||
adc_fifo_drain();
|
||||
adc_has_result = true; // Signal the end of the conversion
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t MarlinHAL::adc_value() { return adc_result; }
|
||||
|
||||
// Reset the system to initiate a firmware flash
|
||||
void flashFirmware(const int16_t) { hal.reboot(); }
|
||||
|
||||
extern "C" {
|
||||
void * _sbrk(int incr);
|
||||
extern unsigned int __bss_end__; // end of bss section
|
||||
}
|
||||
|
||||
// Return free memory between end of heap (or end bss) and whatever is current
|
||||
int freeMemory() {
|
||||
int free_memory, heap_end = (int)_sbrk(0);
|
||||
return (int)&free_memory - (heap_end ?: (int)&__bss_end__);
|
||||
}
|
||||
|
||||
#endif // __PLAT_RP2040__
|
||||
@@ -0,0 +1,250 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define CPU_32_BIT
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU (XOSC_MHZ * 1000000UL)
|
||||
#endif
|
||||
|
||||
#include "arduino_extras.h"
|
||||
#include "../../core/macros.h"
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/math_32bit.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include "fastio.h"
|
||||
//#include "Servo.h"
|
||||
#include "watchdog.h"
|
||||
#include "MarlinSerial.h"
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// ------------------------
|
||||
// Serial ports
|
||||
// ------------------------
|
||||
|
||||
#include "../../core/serial_hook.h"
|
||||
typedef ForwardSerial1Class< decltype(Serial) > DefaultSerial1;
|
||||
extern DefaultSerial1 MSerial0;
|
||||
|
||||
#define _MSERIAL(X) MSerial##X
|
||||
#define MSERIAL(X) _MSERIAL(X)
|
||||
|
||||
#if SERIAL_PORT == -1
|
||||
#define MYSERIAL1 MSerial0
|
||||
#elif WITHIN(SERIAL_PORT, 0, 6)
|
||||
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
|
||||
#else
|
||||
#error "SERIAL_PORT must be from 0 to 6. You can also use -1 if the board supports Native USB."
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if SERIAL_PORT_2 == -1
|
||||
#define MYSERIAL2 MSerial0
|
||||
#elif WITHIN(SERIAL_PORT_2, 0, 6)
|
||||
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from 0 to 6. You can also use -1 if the board supports Native USB."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_3
|
||||
#if SERIAL_PORT_3 == -1
|
||||
#define MYSERIAL3 MSerial0
|
||||
#elif WITHIN(SERIAL_PORT_3, 0, 6)
|
||||
#define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
|
||||
#else
|
||||
#error "SERIAL_PORT_3 must be from 0 to 6. You can also use -1 if the board supports Native USB."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#if MMU2_SERIAL_PORT == -1
|
||||
#define MMU2_SERIAL MSerial0
|
||||
#elif WITHIN(MMU2_SERIAL_PORT, 0, 6)
|
||||
#define MMU2_SERIAL MSERIAL(MMU2_SERIAL_PORT)
|
||||
#else
|
||||
#error "MMU2_SERIAL_PORT must be from 0 to 6. You can also use -1 if the board supports Native USB."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
#if LCD_SERIAL_PORT == -1
|
||||
#define LCD_SERIAL MSerial0
|
||||
#elif WITHIN(LCD_SERIAL_PORT, 0, 6)
|
||||
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 6. You can also use -1 if the board supports Native USB."
|
||||
#endif
|
||||
#if HAS_DGUS_LCD
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ------------------------
|
||||
// Defines
|
||||
// ------------------------
|
||||
|
||||
/**
|
||||
* TODO: review this to return 1 for pins that are not analog input
|
||||
*/
|
||||
#ifndef analogInputToDigitalPin
|
||||
#define analogInputToDigitalPin(p) (p)
|
||||
#endif
|
||||
|
||||
#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
|
||||
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
|
||||
#define cli() __disable_irq()
|
||||
#define sei() __enable_irq()
|
||||
|
||||
// ------------------------
|
||||
// Types
|
||||
// ------------------------
|
||||
|
||||
template <bool, class L, class R> struct IFPIN { typedef R type; };
|
||||
template <class L, class R> struct IFPIN<true, L, R> { typedef L type; };
|
||||
typedef IFPIN<sizeof(pin_size_t) == 1, int8_t, int16_t>::type pin_t;
|
||||
|
||||
class libServo;
|
||||
typedef libServo hal_servo_t;
|
||||
#define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos()
|
||||
#define RESUME_SERVO_OUTPUT() libServo::resume_all_servos()
|
||||
|
||||
// ------------------------
|
||||
// ADC
|
||||
// ------------------------
|
||||
|
||||
#define HAL_ADC_VREF 3.3
|
||||
#ifdef ADC_RESOLUTION
|
||||
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
|
||||
#else
|
||||
#define HAL_ADC_RESOLUTION 12
|
||||
#endif
|
||||
// ADC index 4 is the MCU temperature
|
||||
#define HAL_ADC_MCU_TEMP_DUMMY_PIN 127
|
||||
|
||||
//
|
||||
// Pin Mapping for M42, M43, M226
|
||||
//
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
|
||||
#ifndef PLATFORM_M997_SUPPORT
|
||||
#define PLATFORM_M997_SUPPORT
|
||||
#endif
|
||||
void flashFirmware(const int16_t);
|
||||
|
||||
// Maple Compatibility
|
||||
typedef void (*systickCallback_t)(void);
|
||||
void systick_attach_callback(systickCallback_t cb);
|
||||
void HAL_SYSTICK_Callback();
|
||||
|
||||
extern volatile uint32_t systick_uptime_millis;
|
||||
|
||||
#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
|
||||
#define PWM_FREQUENCY 1000 // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency()
|
||||
|
||||
// ------------------------
|
||||
// Class Utilities
|
||||
// ------------------------
|
||||
|
||||
int freeMemory();
|
||||
|
||||
// ------------------------
|
||||
// MarlinHAL Class
|
||||
// ------------------------
|
||||
|
||||
class MarlinHAL {
|
||||
public:
|
||||
|
||||
// Earliest possible init, before setup()
|
||||
MarlinHAL() {}
|
||||
|
||||
// Watchdog
|
||||
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
|
||||
static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {});
|
||||
|
||||
static void init(); // Called early in setup()
|
||||
static void init_board() {} // Called less early in setup()
|
||||
static void reboot(); // Restart the firmware from 0x0
|
||||
|
||||
// Interrupts
|
||||
static bool isr_state() { return !__get_PRIMASK(); }
|
||||
static void isr_on() { __enable_irq(); }
|
||||
static void isr_off() { __disable_irq(); }
|
||||
|
||||
static void delay_ms(const int ms) { ::delay(ms); }
|
||||
|
||||
// Tasks, called from idle()
|
||||
static void idletask() {}
|
||||
|
||||
// Reset
|
||||
static uint8_t get_reset_source();
|
||||
static void clear_reset_source() {}
|
||||
|
||||
// Free SRAM
|
||||
static int freeMemory() { return ::freeMemory(); }
|
||||
|
||||
//
|
||||
// ADC Methods
|
||||
//
|
||||
|
||||
// Called by Temperature::init once at startup
|
||||
static void adc_init();
|
||||
|
||||
// Called by Temperature::init for each sensor at startup
|
||||
static void adc_enable(const pin_t pin);
|
||||
|
||||
// Begin ADC sampling on the given pin. Called from Temperature::isr!
|
||||
static void adc_start(const pin_t pin);
|
||||
|
||||
// This ADC runs a periodic task
|
||||
static void adc_exclusive_handler();
|
||||
|
||||
// Is the ADC ready for reading?
|
||||
static volatile bool adc_has_result;
|
||||
static bool adc_ready() { return adc_has_result; }
|
||||
|
||||
// The current value of the ADC register
|
||||
static uint16_t adc_value();
|
||||
|
||||
/**
|
||||
* Set the PWM duty cycle for the pin to the given value.
|
||||
* Optionally invert the duty cycle [default = false]
|
||||
* Optionally change the scale of the provided value to enable finer PWM duty control [default = 255]
|
||||
*/
|
||||
static void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);
|
||||
|
||||
/**
|
||||
* Set the frequency of the timer for the given pin as close as
|
||||
* possible to the provided desired frequency. Internally calculate
|
||||
* the required waveform generation mode, prescaler, and resolution
|
||||
* values and set timer registers accordingly.
|
||||
* NOTE that the frequency is applied to all pins on the timer (Ex OC3A, OC3B and OC3B)
|
||||
* NOTE that there are limitations, particularly if using TIMER2. (see Configuration_adv.h -> FAST_PWM_FAN Settings)
|
||||
*/
|
||||
static void set_pwm_frequency(const pin_t pin, const uint16_t f_desired);
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
|
||||
#include "../shared/HAL_MinSerial.h"
|
||||
|
||||
|
||||
static void TXBegin() {
|
||||
#if !WITHIN(SERIAL_PORT, -1, 2)
|
||||
#warning "Using POSTMORTEM_DEBUGGING requires a physical U(S)ART hardware in case of severe error."
|
||||
#warning "Disabling the severe error reporting feature currently because the used serial port is not a HW port."
|
||||
#else
|
||||
#if SERIAL_PORT == -1
|
||||
USBSerial.begin(BAUDRATE);
|
||||
#elif SERIAL_PORT == 0
|
||||
USBSerial.begin(BAUDRATE);
|
||||
#elif SERIAL_PORT == 1
|
||||
Serial1.begin(BAUDRATE);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void TX(char b){
|
||||
#if SERIAL_PORT == -1
|
||||
USBSerial
|
||||
#elif SERIAL_PORT == 0
|
||||
USBSerial
|
||||
#elif SERIAL_PORT == 1
|
||||
Serial1
|
||||
#endif
|
||||
.write(b);
|
||||
}
|
||||
|
||||
// A SW memory barrier, to ensure GCC does not overoptimize loops
|
||||
#define sw_barrier() __asm__ volatile("": : :"memory");
|
||||
|
||||
|
||||
void install_min_serial() {
|
||||
HAL_min_serial_init = &TXBegin;
|
||||
HAL_min_serial_out = &TX;
|
||||
}
|
||||
|
||||
#endif // POSTMORTEM_DEBUGGING
|
||||
#endif // __PLAT_RP2040__
|
||||
@@ -0,0 +1,228 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
static SPISettings spiConfig;
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(SOFTWARE_SPI)
|
||||
|
||||
// ------------------------
|
||||
// Software SPI
|
||||
// ------------------------
|
||||
|
||||
#include "../shared/Delay.h"
|
||||
|
||||
void spiBegin(void) {
|
||||
OUT_WRITE(SD_SS_PIN, HIGH);
|
||||
OUT_WRITE(SD_SCK_PIN, HIGH);
|
||||
SET_INPUT(SD_MISO_PIN);
|
||||
OUT_WRITE(SD_MOSI_PIN, HIGH);
|
||||
}
|
||||
|
||||
// Use function with compile-time value so we can actually reach the desired frequency
|
||||
// Need to adjust this a little bit: on a 72MHz clock, we have 14ns/clock
|
||||
// and we'll use ~3 cycles to jump to the method and going back, so it'll take ~40ns from the given clock here
|
||||
#define CALLING_COST_NS (3U * 1000000000U) / (F_CPU)
|
||||
void (*delaySPIFunc)();
|
||||
void delaySPI_125() { DELAY_NS(125 - CALLING_COST_NS); }
|
||||
void delaySPI_250() { DELAY_NS(250 - CALLING_COST_NS); }
|
||||
void delaySPI_500() { DELAY_NS(500 - CALLING_COST_NS); }
|
||||
void delaySPI_1000() { DELAY_NS(1000 - CALLING_COST_NS); }
|
||||
void delaySPI_2000() { DELAY_NS(2000 - CALLING_COST_NS); }
|
||||
void delaySPI_4000() { DELAY_NS(4000 - CALLING_COST_NS); }
|
||||
|
||||
void spiInit(uint8_t spiRate) {
|
||||
// Use datarates Marlin uses
|
||||
switch (spiRate) {
|
||||
case SPI_FULL_SPEED: delaySPIFunc = &delaySPI_125; break; // desired: 8,000,000 actual: ~1.1M
|
||||
case SPI_HALF_SPEED: delaySPIFunc = &delaySPI_125; break; // desired: 4,000,000 actual: ~1.1M
|
||||
case SPI_QUARTER_SPEED:delaySPIFunc = &delaySPI_250; break; // desired: 2,000,000 actual: ~890K
|
||||
case SPI_EIGHTH_SPEED: delaySPIFunc = &delaySPI_500; break; // desired: 1,000,000 actual: ~590K
|
||||
case SPI_SPEED_5: delaySPIFunc = &delaySPI_1000; break; // desired: 500,000 actual: ~360K
|
||||
case SPI_SPEED_6: delaySPIFunc = &delaySPI_2000; break; // desired: 250,000 actual: ~210K
|
||||
default: delaySPIFunc = &delaySPI_4000; break; // desired: 125,000 actual: ~123K
|
||||
}
|
||||
SPI.begin();
|
||||
}
|
||||
|
||||
// Begin SPI transaction, set clock, bit order, data mode
|
||||
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { /* do nothing */ }
|
||||
|
||||
uint8_t HAL_SPI_RP2040_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
|
||||
for (uint8_t bits = 8; bits--;) {
|
||||
WRITE(SD_SCK_PIN, LOW);
|
||||
WRITE(SD_MOSI_PIN, b & 0x80);
|
||||
|
||||
delaySPIFunc();
|
||||
WRITE(SD_SCK_PIN, HIGH);
|
||||
delaySPIFunc();
|
||||
|
||||
b <<= 1; // little setup time
|
||||
b |= (READ(SD_MISO_PIN) != 0);
|
||||
}
|
||||
DELAY_NS(125);
|
||||
return b;
|
||||
}
|
||||
|
||||
// Soft SPI receive byte
|
||||
uint8_t spiRec() {
|
||||
hal.isr_off(); // No interrupts during byte receive
|
||||
const uint8_t data = HAL_SPI_RP2040_SpiTransfer_Mode_3(0xFF);
|
||||
hal.isr_on(); // Enable interrupts
|
||||
return data;
|
||||
}
|
||||
|
||||
// Soft SPI read data
|
||||
void spiRead(uint8_t *buf, uint16_t nbyte) {
|
||||
for (uint16_t i = 0; i < nbyte; i++)
|
||||
buf[i] = spiRec();
|
||||
}
|
||||
|
||||
// Soft SPI send byte
|
||||
void spiSend(uint8_t data) {
|
||||
hal.isr_off(); // No interrupts during byte send
|
||||
HAL_SPI_RP2040_SpiTransfer_Mode_3(data); // Don't care what is received
|
||||
hal.isr_on(); // Enable interrupts
|
||||
}
|
||||
|
||||
// Soft SPI send block
|
||||
void spiSendBlock(uint8_t token, const uint8_t *buf) {
|
||||
spiSend(token);
|
||||
for (uint16_t i = 0; i < 512; i++)
|
||||
spiSend(buf[i]);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// ------------------------
|
||||
// Hardware SPI
|
||||
// ------------------------
|
||||
|
||||
/**
|
||||
* VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Begin SPI port setup
|
||||
*
|
||||
* @return Nothing
|
||||
*
|
||||
* @details Only configures SS pin since stm32duino creates and initialize the SPI object
|
||||
*/
|
||||
void spiBegin() {
|
||||
#if PIN_EXISTS(SD_SS)
|
||||
OUT_WRITE(SD_SS_PIN, HIGH);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Configure SPI for specified SPI speed
|
||||
void spiInit(uint8_t spiRate) {
|
||||
// Use datarates Marlin uses
|
||||
uint32_t clock;
|
||||
switch (spiRate) {
|
||||
case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000
|
||||
case SPI_HALF_SPEED: clock = 5000000; break;
|
||||
case SPI_QUARTER_SPEED: clock = 2500000; break;
|
||||
case SPI_EIGHTH_SPEED: clock = 1250000; break;
|
||||
case SPI_SPEED_5: clock = 625000; break;
|
||||
case SPI_SPEED_6: clock = 300000; break;
|
||||
default:
|
||||
clock = 4000000; // Default from the SPI library
|
||||
}
|
||||
spiConfig = SPISettings(clock, MSBFIRST, SPI_MODE0);
|
||||
|
||||
//SPI.setMISO(SD_MISO_PIN); //todo: implement? bad interface
|
||||
//SPI.setMOSI(SD_MOSI_PIN);
|
||||
//SPI.setSCLK(SD_SCK_PIN);
|
||||
|
||||
SPI.begin();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Receives a single byte from the SPI port.
|
||||
*
|
||||
* @return Byte received
|
||||
*
|
||||
* @details
|
||||
*/
|
||||
uint8_t spiRec() {
|
||||
uint8_t returnByte = SPI.transfer(0xFF);
|
||||
return returnByte;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Receive a number of bytes from the SPI port to a buffer
|
||||
*
|
||||
* @param buf Pointer to starting address of buffer to write to.
|
||||
* @param nbyte Number of bytes to receive.
|
||||
* @return Nothing
|
||||
*
|
||||
* @details Uses DMA
|
||||
*/
|
||||
void spiRead(uint8_t *buf, uint16_t nbyte) {
|
||||
if (nbyte == 0) return;
|
||||
memset(buf, 0xFF, nbyte);
|
||||
SPI.transfer(buf, nbyte);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a single byte on SPI port
|
||||
*
|
||||
* @param b Byte to send
|
||||
*
|
||||
* @details
|
||||
*/
|
||||
void spiSend(uint8_t b) {
|
||||
SPI.transfer(b);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write token and then write from 512 byte buffer to SPI (for SD card)
|
||||
*
|
||||
* @param buf Pointer with buffer start address
|
||||
* @return Nothing
|
||||
*
|
||||
* @details Use DMA
|
||||
*/
|
||||
void spiSendBlock(uint8_t token, const uint8_t *buf) {
|
||||
//uint8_t rxBuf[512];
|
||||
//SPI.transfer(token);
|
||||
SPI.transfer((uint8_t*)buf, 512); //implement? bad interface
|
||||
}
|
||||
|
||||
#endif // SOFTWARE_SPI
|
||||
|
||||
#endif // __PLAT_RP2040__
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "MarlinSerial.h"
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
#include "../../feature/e_parser.h"
|
||||
#endif
|
||||
|
||||
#define _IMPLEMENT_SERIAL(X) DefaultSerial##X MSerial##X(false, Serial##X)
|
||||
#define IMPLEMENT_SERIAL(X) _IMPLEMENT_SERIAL(X)
|
||||
#if WITHIN(SERIAL_PORT, 0, 3)
|
||||
IMPLEMENT_SERIAL(SERIAL_PORT);
|
||||
#endif
|
||||
|
||||
#endif // __PLAT_RP2040__
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
#include "../../feature/e_parser.h"
|
||||
#endif
|
||||
|
||||
#include "../../core/serial_hook.h"
|
||||
|
||||
#define Serial0 Serial
|
||||
#define _DECLARE_SERIAL(X) \
|
||||
typedef ForwardSerial1Class<decltype(Serial##X)> DefaultSerial##X; \
|
||||
extern DefaultSerial##X MSerial##X
|
||||
#define DECLARE_SERIAL(X) _DECLARE_SERIAL(X)
|
||||
|
||||
typedef ForwardSerial1Class<decltype(SerialUSB)> USBSerialType;
|
||||
extern USBSerialType USBSerial;
|
||||
|
||||
#define _MSERIAL(X) MSerial##X
|
||||
#define MSERIAL(X) _MSERIAL(X)
|
||||
|
||||
#if SERIAL_PORT == -1
|
||||
// #define MYSERIAL1 USBSerial this is already done in the HAL
|
||||
#elif WITHIN(SERIAL_PORT, 0, 3)
|
||||
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
|
||||
DECLARE_SERIAL(SERIAL_PORT);
|
||||
#else
|
||||
#error "SERIAL_PORT must be from 0 to 3, or -1 for Native USB."
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# RP2040 Hardware Interface
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_SERVOS
|
||||
|
||||
#include "Servo.h"
|
||||
|
||||
static uint_fast8_t servoCount = 0;
|
||||
static libServo *servos[NUM_SERVOS] = {0};
|
||||
constexpr millis_t servoDelay[] = SERVO_DELAY;
|
||||
static_assert(COUNT(servoDelay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||
|
||||
libServo::libServo()
|
||||
: delay(servoDelay[servoCount]),
|
||||
was_attached_before_pause(false),
|
||||
value_before_pause(0)
|
||||
{
|
||||
servos[servoCount++] = this;
|
||||
}
|
||||
|
||||
int8_t libServo::attach(const int pin) {
|
||||
if (servoCount >= MAX_SERVOS) return -1;
|
||||
if (pin > 0) servo_pin = pin;
|
||||
auto result = pico_servo.attach(servo_pin);
|
||||
return result;
|
||||
}
|
||||
|
||||
int8_t libServo::attach(const int pin, const int min, const int max) {
|
||||
if (servoCount >= MAX_SERVOS) return -1;
|
||||
if (pin > 0) servo_pin = pin;
|
||||
auto result = pico_servo.attach(servo_pin, min, max);
|
||||
return result;
|
||||
}
|
||||
|
||||
void libServo::move(const int value) {
|
||||
if (attach(0) >= 0) {
|
||||
pico_servo.write(value);
|
||||
safe_delay(delay);
|
||||
TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
|
||||
}
|
||||
}
|
||||
|
||||
void libServo::pause() {
|
||||
was_attached_before_pause = pico_servo.attached();
|
||||
if (was_attached_before_pause) {
|
||||
value_before_pause = pico_servo.read();
|
||||
pico_servo.detach();
|
||||
}
|
||||
}
|
||||
|
||||
void libServo::resume() {
|
||||
if (was_attached_before_pause) {
|
||||
attach();
|
||||
move(value_before_pause);
|
||||
}
|
||||
}
|
||||
|
||||
void libServo::pause_all_servos() {
|
||||
for (auto& servo : servos)
|
||||
if (servo) servo->pause();
|
||||
}
|
||||
|
||||
void libServo::resume_all_servos() {
|
||||
for (auto& servo : servos)
|
||||
if (servo) servo->resume();
|
||||
}
|
||||
|
||||
#endif // HAS_SERVOS
|
||||
#endif // __PLAT_RP2040__
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Servo.h>
|
||||
|
||||
#if 1
|
||||
|
||||
#include "../../core/millis_t.h"
|
||||
|
||||
// Inherit and expand on the official library
|
||||
class libServo {
|
||||
public:
|
||||
libServo();
|
||||
int8_t attach(const int pin = 0); // pin == 0 uses value from previous call
|
||||
int8_t attach(const int pin, const int min, const int max);
|
||||
void detach() { pico_servo.detach(); }
|
||||
int read() { return pico_servo.read(); }
|
||||
void move(const int value);
|
||||
|
||||
void pause();
|
||||
void resume();
|
||||
|
||||
static void pause_all_servos();
|
||||
static void resume_all_servos();
|
||||
static void setInterruptPriority(uint32_t preemptPriority, uint32_t subPriority);
|
||||
|
||||
private:
|
||||
Servo pico_servo;
|
||||
|
||||
int servo_pin = 0;
|
||||
millis_t delay = 0;
|
||||
|
||||
bool was_attached_before_pause;
|
||||
int value_before_pause;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
class libServo: public Servo {
|
||||
public:
|
||||
void move(const int value) {
|
||||
constexpr uint16_t servo_delay[] = SERVO_DELAY;
|
||||
static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||
|
||||
if (attach(servo_info[servoIndex].Pin.nbr) >= 0) { // try to reattach
|
||||
write(value);
|
||||
safe_delay(servo_delay[servoIndex]); // delay to allow servo to reach position
|
||||
TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
class libServo;
|
||||
typedef libServo hal_servo_t;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include <iostream>
|
||||
|
||||
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) {
|
||||
char format_string[20];
|
||||
snprintf(format_string, 20, "%%%d.%df", __width, __prec);
|
||||
sprintf(__s, format_string, __val);
|
||||
return __s;
|
||||
}
|
||||
|
||||
#endif // __PLAT_RP2040__
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// #include <stddef.h>
|
||||
// #include <stdint.h>
|
||||
// #include <math.h>
|
||||
// #include <cstring>
|
||||
|
||||
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s);
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
// NOTE: The Bigtreetech SKR Pico has an onboard W25Q16 flash module
|
||||
|
||||
// Use EEPROM.h for compatibility, for now.
|
||||
#include <EEPROM.h>
|
||||
|
||||
static bool eeprom_data_written = false;
|
||||
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
|
||||
#endif
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
EEPROM.begin(); // Avoid EEPROM.h warning (do nothing)
|
||||
eeprom_buffer_fill();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
if (eeprom_data_written) {
|
||||
TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT());
|
||||
hal.isr_off();
|
||||
eeprom_buffer_flush();
|
||||
hal.isr_on();
|
||||
TERN_(HAS_PAUSE_SERVO_OUTPUT, RESUME_SERVO_OUTPUT());
|
||||
eeprom_data_written = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
while (size--) {
|
||||
uint8_t v = *value;
|
||||
if (v != eeprom_buffered_read_byte(pos)) {
|
||||
eeprom_buffered_write_byte(pos, v);
|
||||
eeprom_data_written = true;
|
||||
}
|
||||
crc16(crc, &v, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
do {
|
||||
const uint8_t c = eeprom_buffered_read_byte(pos);
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
value++;
|
||||
} while (--size);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // FLASH_EEPROM_EMULATION
|
||||
#endif // __PLAT_RP2040__
|
||||
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if USE_WIRED_EEPROM
|
||||
|
||||
/**
|
||||
* PersistentStore for Arduino-style EEPROM interface
|
||||
* with simple implementations supplied by Marlin.
|
||||
*/
|
||||
|
||||
#include "../shared/eeprom_if.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
|
||||
#endif
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
|
||||
bool PersistentStore::access_start() { eeprom_init(); return true; }
|
||||
bool PersistentStore::access_finish() { return true; }
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
uint16_t written = 0;
|
||||
while (size--) {
|
||||
uint8_t v = *value;
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
|
||||
eeprom_write_byte(p, v);
|
||||
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
|
||||
if (eeprom_read_byte(p) != v) {
|
||||
SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
crc16(crc, &v, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
do {
|
||||
// Read from either external EEPROM, program flash or Backup SRAM
|
||||
const uint8_t c = eeprom_read_byte((uint8_t*)pos);
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
value++;
|
||||
} while (--size);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // USE_WIRED_EEPROM
|
||||
#endif // __PLAT_RP2040__
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../module/endstops.h"
|
||||
|
||||
// One ISR for all EXT-Interrupts
|
||||
void endstop_ISR() { endstops.update(); }
|
||||
|
||||
void setup_endstop_interrupts() {
|
||||
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
|
||||
TERN_(USE_X_MAX, _ATTACH(X_MAX_PIN));
|
||||
TERN_(USE_X_MIN, _ATTACH(X_MIN_PIN));
|
||||
TERN_(USE_Y_MAX, _ATTACH(Y_MAX_PIN));
|
||||
TERN_(USE_Y_MIN, _ATTACH(Y_MIN_PIN));
|
||||
TERN_(USE_Z_MAX, _ATTACH(Z_MAX_PIN));
|
||||
TERN_(HAS_Z_MIN_PIN, _ATTACH(Z_MIN_PIN));
|
||||
TERN_(USE_X2_MAX, _ATTACH(X2_MAX_PIN));
|
||||
TERN_(USE_X2_MIN, _ATTACH(X2_MIN_PIN));
|
||||
TERN_(USE_Y2_MAX, _ATTACH(Y2_MAX_PIN));
|
||||
TERN_(USE_Y2_MIN, _ATTACH(Y2_MIN_PIN));
|
||||
TERN_(USE_Z2_MAX, _ATTACH(Z2_MAX_PIN));
|
||||
TERN_(USE_Z2_MIN, _ATTACH(Z2_MIN_PIN));
|
||||
TERN_(USE_Z3_MAX, _ATTACH(Z3_MAX_PIN));
|
||||
TERN_(USE_Z3_MIN, _ATTACH(Z3_MIN_PIN));
|
||||
TERN_(USE_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(USE_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(USE_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(USE_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(USE_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(USE_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(USE_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(USE_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(USE_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
TERN_(USE_U_MAX, _ATTACH(U_MAX_PIN));
|
||||
TERN_(USE_U_MIN, _ATTACH(U_MIN_PIN));
|
||||
TERN_(USE_V_MAX, _ATTACH(V_MAX_PIN));
|
||||
TERN_(USE_V_MIN, _ATTACH(V_MIN_PIN));
|
||||
TERN_(USE_W_MAX, _ATTACH(W_MAX_PIN));
|
||||
TERN_(USE_W_MIN, _ATTACH(W_MIN_PIN));
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "../platforms.h"
|
||||
|
||||
#ifdef __PLAT_RP2040__
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#include "HAL.h"
|
||||
#include "pinDefinitions.h"
|
||||
|
||||
void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
analogWrite(pin, v);
|
||||
}
|
||||
|
||||
void MarlinHAL::set_pwm_frequency(const pin_t pin, const uint16_t f_desired) {
|
||||
mbed::PwmOut* pwm = digitalPinToPwm(pin);
|
||||
if (pwm != NULL) delete pwm;
|
||||
pwm = new mbed::PwmOut(digitalPinToPinName(pin));
|
||||
digitalPinToPwm(pin) = pwm;
|
||||
pwm->period_ms(1000 / f_desired);
|
||||
}
|
||||
|
||||
#endif // __PLAT_RP2040__
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user