Compare commits
798 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f471eab1a2 | ||
|
9b13ae2399 | ||
|
06f36dc746 | ||
|
98eca9cb23 | ||
|
6268795003 | ||
|
b4f0922a7c | ||
|
aef613acd3 | ||
|
9ecfa1d252 | ||
|
e0bed1e344 | ||
|
d21fa25ab8 | ||
|
0dc1a58b24 | ||
|
f2ca70e232 | ||
|
a6bed22839 | ||
|
efd67cf80d | ||
|
15204470a8 | ||
|
48358d6a5c | ||
|
d7abb891cd | ||
|
52a44eb200 | ||
|
9b1c0a75e1 | ||
|
d75e7784e5 | ||
|
0e60c8b7e0 | ||
|
018c7b1cf4 | ||
|
af1d603374 | ||
|
884308f964 | ||
|
7269990413 | ||
|
2a90d93b17 | ||
|
6e284f8823 | ||
|
a2349fc411 | ||
|
a3964b2b40 | ||
|
226ee7c1f3 | ||
|
2c12171f46 | ||
|
d034a9c295 | ||
|
d2c7104bb3 | ||
|
570c7e8638 | ||
|
cc4578a3d3 | ||
|
1db84be66a | ||
|
77c9668fe2 | ||
|
22cf9b444e | ||
|
97798d1e47 | ||
|
f4b808456a | ||
|
6264736968 | ||
|
7a5f103bcf | ||
|
1a8307b196 | ||
|
13a1c86ae8 | ||
|
15656201d2 | ||
|
f3e372cb4c | ||
|
c781ecc437 | ||
|
daa8fff6c6 | ||
|
d481bba327 | ||
|
32b08ae04c | ||
|
f00a0356c7 | ||
|
9871800874 | ||
|
39c2c038be | ||
|
285d6488a3 | ||
|
eecbd09a46 | ||
|
8d4e4ac115 | ||
|
b77a5d4c8d | ||
|
c3b8b3e7e6 | ||
|
7123b15801 | ||
|
8a2f13d657 | ||
|
251d9fc1d7 | ||
|
5eeb9650b5 | ||
|
c0addd1d33 | ||
|
05b57278d4 | ||
|
aa3ec2fbfd | ||
|
4468516aa2 | ||
|
95d006b406 | ||
|
5b057b4bcf | ||
|
77af48e547 | ||
|
0f7f709aad | ||
|
a8c0e11cb1 | ||
|
0556da85b0 | ||
|
93652e5c6f | ||
|
f3fc1d15a3 | ||
|
3148060550 | ||
|
5f08864d1f | ||
|
184fc36a08 | ||
|
281ed99868 | ||
|
2cc4a1b326 | ||
|
c5bd08755c | ||
|
99f58f63f2 | ||
|
c2a674d2c1 | ||
|
feffc19867 | ||
|
f637e1c501 | ||
|
78240a279b | ||
|
656034d2d9 | ||
|
39a81d167e | ||
|
cb1570d162 | ||
|
8cb646cc20 | ||
|
3cccb21dc9 | ||
|
7f4a49cc44 | ||
|
e0c439fe91 | ||
|
49e233e06f | ||
|
b662dd1f92 | ||
|
700cae43ab | ||
|
1c74c6e7ac | ||
|
757a9477db | ||
|
59d43408f6 | ||
|
1d8941d008 | ||
|
17f853d99c | ||
|
6f9f25dbb2 | ||
|
0273a68587 | ||
|
58a26fcaac | ||
|
489aca03ff | ||
|
f32e19e1c6 | ||
|
57bd04b6ce | ||
|
396df93220 | ||
|
9b76b58b79 | ||
|
9fffed7160 | ||
|
fd136d5501 | ||
|
89ec1c71f0 | ||
|
fc2020c6ec | ||
|
f97635de36 | ||
|
a0a57406a2 | ||
|
5efef86cfa | ||
|
20c747753d | ||
|
08a9c61587 | ||
|
0d91b07797 | ||
|
b033da1782 | ||
|
4dcd872be5 | ||
|
7e9e2a7435 | ||
|
0b84194127 | ||
|
efd9329c81 | ||
|
5cbb820e29 | ||
|
5a0166489e | ||
|
692c9a6312 | ||
|
545d14f9a5 | ||
|
7b9e01eb2b | ||
|
8562f0ec44 | ||
|
6f59d8171f | ||
|
d29a9014f2 | ||
|
205d867e4b | ||
|
84f9490149 | ||
|
1fd4258423 | ||
|
e8a55972a7 | ||
|
aef413202e | ||
|
cbc7dadf42 | ||
|
c508ecc414 | ||
|
384a31765f | ||
|
0f2c4fc40b | ||
|
66a274452c | ||
|
12f8168d1e | ||
|
2142e1dae4 | ||
|
8d21ea55a2 | ||
|
a0da7e8a1f | ||
|
e2452d6c57 | ||
|
5173a3140d | ||
|
e44f2b7d2d | ||
|
ed78f7f4e6 | ||
|
aa198e41dd | ||
|
18b38fb58a | ||
|
5d79d8fad6 | ||
|
e7a746966d | ||
|
555f35d46f | ||
|
de77dfcbbd | ||
|
af08f16efc | ||
|
01a0f3a8cf | ||
|
f80bcdcc5c | ||
|
1ead7ce681 | ||
|
dffa56463e | ||
|
ae98d2e5ea | ||
|
5b1ef638ee | ||
|
f3be03da20 | ||
|
64128a5bcb | ||
|
0018c94a79 | ||
|
d48cb11537 | ||
|
d9f7de7a24 | ||
|
3d102a77ca | ||
|
492d70424d | ||
|
24dbeceb45 | ||
|
cabd538fdd | ||
|
9cf1c3cf05 | ||
|
c3ae221a10 | ||
|
7626d859a6 | ||
|
360311f232 | ||
|
433eedd50f | ||
|
46c53f6730 | ||
|
2b9ae0cc33 | ||
|
433a27e475 | ||
|
1de265ea5d | ||
|
854ce63358 | ||
|
170f77fada | ||
|
72b99bf1ba | ||
|
1a8583f4fc | ||
|
49e8defda1 | ||
|
e5c4e77eb0 | ||
|
8dd3f38ae9 | ||
|
044a7db370 | ||
|
8cecc626c6 | ||
|
ee26fd0e05 | ||
|
a7ea6b5925 | ||
|
2b8a804997 | ||
|
908335367e | ||
|
a7415a052e | ||
|
f51e07b196 | ||
|
5f35c539ce | ||
|
59503c6bbb | ||
|
0309fce1fd | ||
|
f6d211f779 | ||
|
f179e25cc6 | ||
|
5b478cd5f6 | ||
|
e852732ea8 | ||
|
c9718e1ec0 | ||
|
30158424e9 | ||
|
5f6d9e9f42 | ||
|
b108741a8e | ||
|
b4904cc53e | ||
|
2c6fe45847 | ||
|
fed72e4607 | ||
|
c3a4e6b3c8 | ||
|
5bfc5c1010 | ||
|
1112d66fef | ||
|
61b574f2ce | ||
|
522cdd5272 | ||
|
641bae625b | ||
|
d10e20d6d2 | ||
|
b18aa933d1 | ||
|
0f519ebf85 | ||
|
031f17b4f3 | ||
|
036f763eaa | ||
|
d137f307eb | ||
|
66048a5f27 | ||
|
b8c32e24d8 | ||
|
99d51af90f | ||
|
f47ece0725 | ||
|
975089a954 | ||
|
995230f597 | ||
|
adf7072fa8 | ||
|
40cb7cf8d6 | ||
|
d0c0630c1f | ||
|
11c829fb28 | ||
|
e0dda61501 | ||
|
a185ce22cf | ||
|
2a4ee1a482 | ||
|
3a82b8a251 | ||
|
765b2b43f6 | ||
|
2e602b9b88 | ||
|
5d3e75905d | ||
|
eacb660e4b | ||
|
021ceeba0b | ||
|
25a131b942 | ||
|
b4c025a451 | ||
|
604a01cd1a | ||
|
064f91e9b0 | ||
|
34c9f64925 | ||
|
060b705dab | ||
|
262cd757fc | ||
|
dc4d2165f2 | ||
|
bcd2a483da | ||
|
d338872e85 | ||
|
2c30b75268 | ||
|
3deb54d0fd | ||
|
9ae6351a02 | ||
|
b7f95dc8d4 | ||
|
99647fa940 | ||
|
ea3df94213 | ||
|
a37580e4e8 | ||
|
b3fd03198a | ||
|
71b8a22d96 | ||
|
669b68497c | ||
|
6014dd9c7b | ||
|
5a54ba8316 | ||
|
be8e8260e2 | ||
|
5d8ca7c944 | ||
|
0e8e215d4e | ||
|
6cf95509cd | ||
|
ded719cc14 | ||
|
2630eefcc4 | ||
|
2b54a9c0ff | ||
|
bb1eb39ecb | ||
|
8b818f4ae5 | ||
|
4d113c2efd | ||
|
ab9609146f | ||
|
e7a25a45e6 | ||
|
023eaabc1c | ||
|
03d7fbd755 | ||
|
89898181bd | ||
|
e705a7724e | ||
|
5b593da04d | ||
|
9c4f9bc62a | ||
|
84d1619127 | ||
|
1386e78369 | ||
|
224371dfc6 | ||
|
033043218e | ||
|
fcbd99d941 | ||
|
209e5c27ca | ||
|
92eb819aee | ||
|
de4eed33e4 | ||
|
59ad93560e | ||
|
50e52c0fdb | ||
|
e679fafaaf | ||
|
6de25804eb | ||
|
ded8ee0a1d | ||
|
44d54a0d01 | ||
|
6e1c997a0a | ||
|
17c9450f0c | ||
|
d6a87aa75b | ||
|
64acb9fe78 | ||
|
22bf774d61 | ||
|
e2a790b759 | ||
|
ee1c1034e5 | ||
|
b661795ae5 | ||
|
6d96c221bd | ||
|
a596faf4e5 | ||
|
3ee27e7e35 | ||
|
6cf2cf7bd4 | ||
|
54416f780d | ||
|
9d73fcb959 | ||
|
f434915ad6 | ||
|
bbce951666 | ||
|
8a4fec9460 | ||
|
3a83516232 | ||
|
03344a0947 | ||
|
72d7bbbbf6 | ||
|
253f91765d | ||
|
4c7f8696ab | ||
|
f94de97cdb | ||
|
bae19a3737 | ||
|
cc3abcd2c5 | ||
|
9e18a543fa | ||
|
13bccd8441 | ||
|
5af3dbdb30 | ||
|
9f43452fbd | ||
|
61364906b3 | ||
|
105fd73c28 | ||
|
b4b69c0de3 | ||
|
a37be7236b | ||
|
bba7c0069f | ||
|
8916b05cb4 | ||
|
99028376e6 | ||
|
c2796fbf3b | ||
|
37777a78bf | ||
|
0da0aa9b2e | ||
|
9ffd3ed2e4 | ||
|
1176c10860 | ||
|
2e9f819d5f | ||
|
19353fc98c | ||
|
b21d62543f | ||
|
a42ecb843e | ||
|
93ff2cb086 | ||
|
086fa0f0a7 | ||
|
5e97f37a78 | ||
|
c14b162b9e | ||
|
61c000d96f | ||
|
c06a183f28 | ||
|
d1db17c6f5 | ||
|
d336a4d71b | ||
|
796309c903 | ||
|
53df1dfe4d | ||
|
6769718264 | ||
|
7704d84419 | ||
|
9b0e196ba2 | ||
|
fd594ab176 | ||
|
8cadcf6bb6 | ||
|
22fdfa9629 | ||
|
a0ebe7c8ff | ||
|
125c5bc345 | ||
|
95f27cf339 | ||
|
02ae4bc9b9 | ||
|
6bf2be66ed | ||
|
d8ef23eda7 | ||
|
73ef26a106 | ||
|
d51e70083d | ||
|
dc5ae16861 | ||
|
0aa87af82f | ||
|
0be98b98a7 | ||
|
f7ce107ac6 | ||
|
3f772df568 | ||
|
caa6ec0519 | ||
|
30665737dc | ||
|
0c401bddad | ||
|
eb0d80cb19 | ||
|
e62486a610 | ||
|
51d954a4fd | ||
|
416234f43a | ||
|
9ddb4de70a | ||
|
9741be5966 | ||
|
ecb625a666 | ||
|
de7f6c425b | ||
|
718227a94c | ||
|
bb12ebcca6 | ||
|
2e14bf15dd | ||
|
11070b79a3 | ||
|
4219ae9106 | ||
|
f803d74bc9 | ||
|
f0bca66d45 | ||
|
b3c8d9bec8 | ||
|
4a7d3a336b | ||
|
65e39116cb | ||
|
0c97a2afdc | ||
|
9c19d4705e | ||
|
be55401e3c | ||
|
c612b56bc1 | ||
|
8385be25cd | ||
|
2a323d0a8e | ||
|
c544711f14 | ||
|
a348f8e02c | ||
|
42d9b4c91f | ||
|
7d0efb452a | ||
|
418743cf6a | ||
|
eafd0ed765 | ||
|
0c0f84b659 | ||
|
166324fc7b | ||
|
3924545912 | ||
|
86e78410d6 | ||
|
157c60c93b | ||
|
d7f3228ec6 | ||
|
c56ac0c34a | ||
|
e71fa2b649 | ||
|
fefde2a644 | ||
|
a668a9d302 | ||
|
e3c294dc9b | ||
|
dc67705049 | ||
|
e0fa6ed4f8 | ||
|
a4cd654e48 | ||
|
06b963d9ea | ||
|
a36a6685ae | ||
|
83b8a0f2ac | ||
|
1866f51d08 | ||
|
4b2fdbeeb1 | ||
|
eeac85642f | ||
|
0bbe85d3e7 | ||
|
0af762d609 | ||
|
b567717762 | ||
|
2b2a8355c9 | ||
|
ac64d6915f | ||
|
1bee38a1c1 | ||
|
4e54fa2320 | ||
|
eba0ae4ee1 | ||
|
d49a26bcc6 | ||
|
a2759bc245 | ||
|
f642d8b79e | ||
|
bc773e9c96 | ||
|
ffde284288 | ||
|
e3b05dd6c2 | ||
|
8e84d24737 | ||
|
981191660d | ||
|
245b6e0884 | ||
|
c753071961 | ||
|
22ef6362ae | ||
|
80f8ec94aa | ||
|
381c5908b4 | ||
|
fbb5732dee | ||
|
90ed772590 | ||
|
3e559d5c1c | ||
|
eb8649ba42 | ||
|
99f917c022 | ||
|
55cf3bd5ee | ||
|
776ededca4 | ||
|
b16a72a7e6 | ||
|
f9809ca75a | ||
|
e402f43c02 | ||
|
2aad79fa15 | ||
|
89e84fec61 | ||
|
8d34a99d8f | ||
|
15cf97f0d5 | ||
|
c158d8023e | ||
|
bc68664c3b | ||
|
924e4f95c8 | ||
|
35df24e1cb | ||
|
74b0133bc9 | ||
|
12581bcc44 | ||
|
c7c56ac45f | ||
|
603b65e843 | ||
|
2e5e5c4a1d | ||
|
bcc31f68c6 | ||
|
f8f68f9259 | ||
|
7773504afa | ||
|
6b73b6c966 | ||
|
29dde9be2b | ||
|
b6cb56f396 | ||
|
8283f1577a | ||
|
0e9eb5f6ce | ||
|
61d0b08298 | ||
|
b57f73a488 | ||
|
40b99d8084 | ||
|
c944e4fc60 | ||
|
eebab93358 | ||
|
0074ea5e0b | ||
|
e190684fe6 | ||
|
69c1e79c30 | ||
|
b3a3d81406 | ||
|
f1161a9a5f | ||
|
95f0970d85 | ||
|
31a3cc6278 | ||
|
6e7c20e78e | ||
|
165ae139d5 | ||
|
42eb2347d4 | ||
|
3ab6789807 | ||
|
5054dc6ea2 | ||
|
ee54cd4bd7 | ||
|
399a240f84 | ||
|
fef76a76a3 | ||
|
a5459a68a6 | ||
|
b44d4746c8 | ||
|
6f9194eb29 | ||
|
6b2370fd7c | ||
|
ee64081696 | ||
|
a35c234ce1 | ||
|
5026797310 | ||
|
8334e92b6f | ||
|
8cf15e8546 | ||
|
7ae099f2be | ||
|
6d191d12c9 | ||
|
e213246ab9 | ||
|
650e1dd1d2 | ||
|
87cc387321 | ||
|
a7cfdeef21 | ||
|
3750ab5c8b | ||
|
a0704cb14f | ||
|
cad2f69687 | ||
|
31fbec9a00 | ||
|
b1c5afaf3c | ||
|
bc459a76f4 | ||
|
dd8ac689c3 | ||
|
24f0613b9f | ||
|
00b27b1aa7 | ||
|
f76b063e58 | ||
|
c746b1a2ae | ||
|
be13220e32 | ||
|
78c2eb6876 | ||
|
fea4e06484 | ||
|
91f11e0d41 | ||
|
573b8a62d9 | ||
|
eafb94e72d | ||
|
69b44c2309 | ||
|
e9a1c10b34 | ||
|
304a926b0a | ||
|
1bb61f27e9 | ||
|
091bdb79e6 | ||
|
968c3b7e4e | ||
|
ed14d14819 | ||
|
cae391bb48 | ||
|
2753b4eeaa | ||
|
6d05da0e5e | ||
|
4235e23c7b | ||
|
cd01421ac3 | ||
|
aa13c78458 | ||
|
b1c5dd985e | ||
|
3109a297d6 | ||
|
b878127ea0 | ||
|
6ea6556d09 | ||
|
2b37a71eba | ||
|
e3ae76d76d | ||
|
b24508907e | ||
|
ec3daadf43 | ||
|
ae76011e75 | ||
|
34066c1717 | ||
|
19fe3d5e79 | ||
|
ec518e6e7b | ||
|
003ce25acf | ||
|
3e5d867276 | ||
|
b1bcb387fa | ||
|
0fbd8c52bb | ||
|
08895e6cb0 | ||
|
38e775496a | ||
|
47631167f9 | ||
|
185e0dc7b7 | ||
|
bcf6ca59df | ||
|
1ba694cebb | ||
|
906fa05bd6 | ||
|
651f15f833 | ||
|
ef41c1f452 | ||
|
8050813d32 | ||
|
25e7e2fce0 | ||
|
a0f7f0e9e2 | ||
|
f3e0bc7a4b | ||
|
49ff1e837a | ||
|
4f8191b481 | ||
|
927a1a1738 | ||
|
f2f23e8097 | ||
|
cce585f6ca | ||
|
5bfb465ab4 | ||
|
ce7bbafb8f | ||
|
5ffc4bfe3a | ||
|
3ecc99e95d | ||
|
f22c5d3cc6 | ||
|
d8df8e0eed | ||
|
e38958f256 | ||
|
d7c77403fd | ||
|
c8898b5ca0 | ||
|
781257bc64 | ||
|
dec083dcc1 | ||
|
cdd9507493 | ||
|
dba877311e | ||
|
31fd3be6eb | ||
|
2b4284df81 | ||
|
d84e2d6e29 | ||
|
56355159c6 | ||
|
a7135d429b | ||
|
3b0a40cd5d | ||
|
83c74802f8 | ||
|
adc17933cd | ||
|
68c52673d6 | ||
|
2aa35577f2 | ||
|
14ffc66c45 | ||
|
2ea0832e0f | ||
|
ab050878e9 | ||
|
707a04022e | ||
|
d12c357793 | ||
|
ddf8668e16 | ||
|
3491e49c5f | ||
|
d322e495b2 | ||
|
5d80f7006a | ||
|
3e7a9e5d20 | ||
|
33e8769226 | ||
|
59842edbcb | ||
|
507e1e436e | ||
|
b27447ef48 | ||
|
c9a3ba99be | ||
|
967942460e | ||
|
bfa257902e | ||
|
3f103c91f0 | ||
|
2fd9971f41 | ||
|
a3063a9392 | ||
|
d8a02bbbdb | ||
|
76d4a395d1 | ||
|
c515bfb5fb | ||
|
83430be580 | ||
|
9bd9f91722 | ||
|
e6ef43e51a | ||
|
16bca67f2d | ||
|
d65eea550c | ||
|
46080b367a | ||
|
317afae37c | ||
|
930a608236 | ||
|
6e3c45580c | ||
|
e3df7d7bc8 | ||
|
c1fca91103 | ||
|
d3c56a76e7 | ||
|
4194cdda5b | ||
|
f5f999d7bf | ||
|
b4b607681c | ||
|
1e75eba27b | ||
|
f3f3d202ac | ||
|
c90fa530db | ||
|
aeb8097cbc | ||
|
04bea72787 | ||
|
ce95f56ac8 | ||
|
aff45fd455 | ||
|
c8f28d9d09 | ||
|
f3697e5e02 | ||
|
557ba20ff4 | ||
|
dd0e5c26d1 | ||
|
c9a3f41152 | ||
|
d13ffa0aba | ||
|
fb0be29604 | ||
|
7ca1550775 | ||
|
665a71b471 | ||
|
9268a4b28c | ||
|
529bbfad10 | ||
|
e7945c2277 | ||
|
5ee91c73ed | ||
|
2116e4202b | ||
|
19521d16cd | ||
|
057302b936 | ||
|
d62619c9c8 | ||
|
9c80a89597 | ||
|
00834ef03d | ||
|
5b7b065b96 | ||
|
a739af823f | ||
|
493eb446b7 | ||
|
1b45b3802a | ||
|
7898307d78 | ||
|
8da8aa140f | ||
|
4572af2bce | ||
|
6dc17f0e6e | ||
|
3fcf3f69ca | ||
|
a9fd2769f3 | ||
|
9adaf92674 | ||
|
e75c3b6c54 | ||
|
61f2bb1228 | ||
|
d1502f74ea | ||
|
83f9413196 | ||
|
cdc3e18d99 | ||
|
55a6315862 | ||
|
cf447a5442 | ||
|
7597b4fb40 | ||
|
7cd0f2a32a | ||
|
4dae5890e9 | ||
|
738ae4be33 | ||
|
e573611021 | ||
|
f60965a107 | ||
|
3995e8373c | ||
|
ddc82b84e2 | ||
|
87a943756a | ||
|
8e28731f96 | ||
|
cdbd438a04 | ||
|
3220c49f1b | ||
|
94e67a036a | ||
|
c977e82074 | ||
|
9878a5ab58 | ||
|
2de914c38c | ||
|
49b05ba989 | ||
|
85fa8c55c9 | ||
|
57eef65d9c | ||
|
894c954e8f | ||
|
046bac6769 | ||
|
765720e98b | ||
|
26a244325b | ||
|
f7d28ce1d6 | ||
|
c85633b47f | ||
|
6861b1ec82 | ||
|
003cb20b9f | ||
|
f1f622de01 | ||
|
dbb8f3db09 | ||
|
5d7c72db5a | ||
|
755adb8973 | ||
|
0977429138 | ||
|
1dfa6cbc80 | ||
|
e3998dc3df | ||
|
b6e1838fa6 | ||
|
908caba735 | ||
|
121f3b1096 | ||
|
9e373617dc | ||
|
5298fa357c | ||
|
2c15bc5d39 | ||
|
159f9c85a6 | ||
|
1d1f318752 | ||
|
40a9d82ae9 | ||
|
72c28d3462 | ||
|
ed224ca7d8 | ||
|
02e131b5fd | ||
|
5afb5e03b0 | ||
|
52a23b969b | ||
|
afcc7ea22b | ||
|
c463b81819 | ||
|
f688c7d20d | ||
|
0167bba371 | ||
|
7004fb702d | ||
|
2f2dd3322d | ||
|
31d3a781a8 | ||
|
a7fd6b68be | ||
|
6a1e78e614 | ||
|
770edea577 | ||
|
08a51b2820 | ||
|
ac11c689f7 | ||
|
f3e199fcd2 | ||
|
ffcbe68570 | ||
|
06e965e29c | ||
|
e865cc0249 | ||
|
5d8d03da03 | ||
|
0b3da61ac7 | ||
|
a24eb691fb | ||
|
c5c8ef436c | ||
|
83309c1ac8 | ||
|
ec2f4f512e | ||
|
ad991734c4 | ||
|
03184e1c31 | ||
|
cca5844ba9 | ||
|
45d3866f97 | ||
|
94edfc0a8f | ||
|
9fa9eebe51 | ||
|
4518506559 | ||
|
c1fb84e1a6 | ||
|
ea34aa2d3e | ||
|
d6cb657c85 | ||
|
0df9f30f14 | ||
|
d3e902af76 | ||
|
0b3420a012 | ||
|
5cf0975913 | ||
|
db90a180c2 | ||
|
d174d610bd | ||
|
e69e56ea52 | ||
|
0c66c713b6 | ||
|
95230c9792 | ||
|
7eea0ac6de | ||
|
b19a1f602a | ||
|
789235b925 | ||
|
00722c3294 | ||
|
cb4e3889ec | ||
|
76ec7040f1 | ||
|
b41365b495 | ||
|
6e18af6f81 | ||
|
12bc28bc8c | ||
|
3fa3be1f31 | ||
|
a468701511 | ||
|
f67cd07328 | ||
|
5cbdf51b4a | ||
|
7378afc6d8 | ||
|
7957408497 | ||
|
53fc13ba7f | ||
|
a0ea7cbf26 | ||
|
6310e023a7 | ||
|
5f594ce5d3 | ||
|
64a7dfbe7d | ||
|
5d0e94c11c | ||
|
0ca1170b6d | ||
|
addc91a409 | ||
|
450f329f05 | ||
|
1f72b4f65b | ||
|
50195ec990 | ||
|
2d9557cf40 | ||
|
5625ceec7d | ||
|
888e9cb60b | ||
|
d00f6cbe12 | ||
|
8abef30a75 | ||
|
158b26b875 |
12
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
12
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -110,6 +110,18 @@ body:
|
||||
label: Add-ons
|
||||
description: Please list any hardware add-ons that could be involved.
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Bed Leveling
|
||||
description: What kind of bed leveling compensation are you using?
|
||||
options:
|
||||
- UBL Bilinear mesh
|
||||
- ABL Bilinear mesh
|
||||
- ABL Linear grid
|
||||
- ABL 3-point
|
||||
- MBL Manual Bed Leveling
|
||||
- No Bed Leveling
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Your Slicer
|
||||
|
1
.github/workflows/bump-date.yml
vendored
1
.github/workflows/bump-date.yml
vendored
@@ -28,6 +28,7 @@ jobs:
|
||||
# Inline Bump Script
|
||||
DIST=$( date +"%Y-%m-%d" )
|
||||
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
|
||||
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \
|
||||
git config user.name "${GITHUB_ACTOR}" && \
|
||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
|
||||
git add . && \
|
||||
|
6
.github/workflows/check-pr.yml
vendored
6
.github/workflows/check-pr.yml
vendored
@@ -6,7 +6,8 @@
|
||||
name: PR Bad Target
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
branches:
|
||||
- 1.0.x
|
||||
- 1.1.x
|
||||
@@ -20,9 +21,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: peter-evans/close-pull@v1
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
with:
|
||||
delete-branch: false
|
||||
comment: >
|
||||
Thanks for your contribution! Unfortunately we can't accept PRs directed at release branches. We make patches to the bugfix branches and only later do we push them out as releases.
|
||||
|
||||
|
72
.github/workflows/test-builds.yml
vendored
72
.github/workflows/test-builds.yml
vendored
@@ -36,9 +36,11 @@ jobs:
|
||||
# Base Environments
|
||||
|
||||
- DUE
|
||||
- DUE_archim
|
||||
- esp32
|
||||
- linux_native
|
||||
- mega2560
|
||||
- at90usb1286_dfu
|
||||
- teensy31
|
||||
- teensy35
|
||||
- teensy41
|
||||
@@ -46,21 +48,34 @@ jobs:
|
||||
|
||||
# Extended AVR Environments
|
||||
|
||||
- FYSETC_F6_13
|
||||
- FYSETC_F6
|
||||
- mega1280
|
||||
- rambo
|
||||
- sanguino1284p
|
||||
- sanguino644p
|
||||
|
||||
# Extended STM32 Environments
|
||||
# STM32F1 (Maple) Environments
|
||||
|
||||
#- STM32F103RC_btt_maple
|
||||
- STM32F103RC_btt_USB_maple
|
||||
- STM32F103RC_fysetc_maple
|
||||
- STM32F103RC_meeb
|
||||
- jgaurora_a5s_a1_maple
|
||||
- STM32F103VE_longer_maple
|
||||
#- mks_robin_maple
|
||||
- mks_robin_lite_maple
|
||||
- mks_robin_pro_maple
|
||||
#- mks_robin_nano35_maple
|
||||
#- STM32F103RET6_creality_maple
|
||||
- STM32F103VE_ZM3E4V2_USB_maple
|
||||
|
||||
# STM32 (ST) Environments
|
||||
|
||||
- STM32F103RC_btt
|
||||
- STM32F103RC_btt_USB
|
||||
#- STM32F103RC_btt_USB
|
||||
- STM32F103RE_btt
|
||||
- STM32F103RE_btt_USB
|
||||
- STM32F103RC_fysetc
|
||||
- STM32F103RC_meeb
|
||||
- jgaurora_a5s_a1
|
||||
- STM32F103RET6_creality
|
||||
- STM32F103VE_longer
|
||||
- STM32F407VE_black
|
||||
- STM32F401VE_STEVAL
|
||||
@@ -68,40 +83,54 @@ jobs:
|
||||
- BIGTREE_SKR_PRO
|
||||
- BIGTREE_GTR_V1_0
|
||||
- mks_robin
|
||||
- mks_robin_stm32
|
||||
- ARMED
|
||||
- FYSETC_S6
|
||||
- STM32F070CB_malyan
|
||||
- STM32F070RB_malyan
|
||||
- malyan_M300
|
||||
- mks_robin_lite
|
||||
- FLYF407ZG
|
||||
- rumba32
|
||||
- mks_robin_pro
|
||||
- STM32F103RET6_creality
|
||||
- LERDGEX
|
||||
- LERDGEK
|
||||
- mks_robin_nano35
|
||||
- NUCLEO_F767ZI
|
||||
- REMRAM_V1
|
||||
- BTT_SKR_SE_BX
|
||||
- chitu_f103
|
||||
- Index_Mobo_Rev03
|
||||
|
||||
# Put lengthy tests last
|
||||
|
||||
- LPC1768
|
||||
- LPC1769
|
||||
|
||||
# STM32 with non-STM framework. both broken for now. they should use HAL_STM32 which is working.
|
||||
|
||||
#- STM32F4
|
||||
#- STM32F7
|
||||
|
||||
# Non-working environment tests
|
||||
#- at90usb1286_cdc
|
||||
#- at90usb1286_dfu
|
||||
#- STM32F103CB_malyan
|
||||
#- STM32F103RE
|
||||
#- mks_robin_mini
|
||||
|
||||
steps:
|
||||
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
- name: Select Python 3.7
|
||||
uses: actions/setup-python@v1
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax.
|
||||
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
|
||||
@@ -111,13 +140,6 @@ jobs:
|
||||
pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
|
||||
platformio update
|
||||
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run ${{ matrix.test-platform }} Tests
|
||||
run: |
|
||||
# Inline tests script
|
||||
chmod +x buildroot/bin/*
|
||||
chmod +x buildroot/tests/*
|
||||
export PATH=./buildroot/bin/:./buildroot/tests/:${PATH}
|
||||
run_tests . ${{ matrix.test-platform }}
|
||||
make tests-single-ci TEST_TARGET=${{ matrix.test-platform }}
|
||||
|
18
.gitignore
vendored
18
.gitignore
vendored
@@ -22,12 +22,16 @@
|
||||
# Generated files
|
||||
_Version.h
|
||||
bdf2u8g
|
||||
marlin_config.json
|
||||
mczip.h
|
||||
*.gen
|
||||
*.sublime-workspace
|
||||
|
||||
#
|
||||
# OS
|
||||
#
|
||||
applet/
|
||||
*.DS_Store
|
||||
.DS_Store
|
||||
|
||||
#
|
||||
# Misc
|
||||
@@ -143,10 +147,16 @@ vc-fileutils.settings
|
||||
.vscode/launch.json
|
||||
.vscode/*.db
|
||||
|
||||
# cmake
|
||||
#Simulation
|
||||
imgui.ini
|
||||
eeprom.dat
|
||||
spi_flash.bin
|
||||
|
||||
#cmake
|
||||
CMakeLists.txt
|
||||
src/CMakeLists.txt
|
||||
CMakeListsPrivate.txt
|
||||
build/
|
||||
|
||||
# CLion
|
||||
cmake-build-*
|
||||
@@ -163,7 +173,3 @@ __pycache__
|
||||
|
||||
# IOLogger logs
|
||||
*_log.csv
|
||||
|
||||
# Simulation / Native
|
||||
eeprom.dat
|
||||
imgui.ini
|
||||
|
@@ -35,7 +35,7 @@
|
||||
*
|
||||
* Advanced settings can be found in Configuration_adv.h
|
||||
*/
|
||||
#define CONFIGURATION_H_VERSION 020008
|
||||
#define CONFIGURATION_H_VERSION 02000903
|
||||
|
||||
//===========================================================================
|
||||
//============================= Getting Started =============================
|
||||
@@ -94,6 +94,11 @@
|
||||
|
||||
// @section machine
|
||||
|
||||
// Choose the name from boards.h that matches your setup
|
||||
#ifndef MOTHERBOARD
|
||||
#define MOTHERBOARD BOARD_RAMPS_14_EFB
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -105,14 +110,9 @@
|
||||
#define SERIAL_PORT 0
|
||||
|
||||
/**
|
||||
* 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]
|
||||
*/
|
||||
//#define SERIAL_PORT_2 -1
|
||||
|
||||
/**
|
||||
* This setting determines the communication speed of the printer.
|
||||
* Serial Port Baud Rate
|
||||
* This is the default communication speed for all serial ports.
|
||||
* Set the baud rate defaults for additional serial ports below.
|
||||
*
|
||||
* 250000 works in most cases, but you might try a lower speed if
|
||||
* you commonly experience drop-outs during host printing.
|
||||
@@ -121,15 +121,27 @@
|
||||
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
|
||||
*/
|
||||
#define BAUDRATE 250000
|
||||
//#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate
|
||||
|
||||
/**
|
||||
* 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]
|
||||
*/
|
||||
//#define SERIAL_PORT_2 -1
|
||||
//#define BAUDRATE_2 250000 // 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]
|
||||
*/
|
||||
//#define SERIAL_PORT_3 1
|
||||
//#define BAUDRATE_3 250000 // Enable to override BAUDRATE
|
||||
|
||||
// Enable the Bluetooth serial interface on AT90USB devices
|
||||
//#define BLUETOOTH
|
||||
|
||||
// Choose the name from boards.h that matches your setup
|
||||
#ifndef MOTHERBOARD
|
||||
#define MOTHERBOARD BOARD_RAMPS_14_EFB
|
||||
#endif
|
||||
|
||||
// Name displayed in the LCD "Ready" message and Info menu
|
||||
//#define CUSTOM_MACHINE_NAME "3D Printer"
|
||||
|
||||
@@ -137,6 +149,45 @@
|
||||
// Choose your own or use a service like https://www.uuidgenerator.net/version4
|
||||
//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
|
||||
|
||||
/**
|
||||
* Define the number of coordinated linear axes.
|
||||
* See https://github.com/DerAndere1/Marlin/wiki
|
||||
* Each linear axis gets its own stepper control and endstop:
|
||||
*
|
||||
* Steppers: *_STEP_PIN, *_ENABLE_PIN, *_DIR_PIN, *_ENABLE_ON
|
||||
* Endstops: *_STOP_PIN, USE_*MIN_PLUG, USE_*MAX_PLUG
|
||||
* Axes: *_MIN_POS, *_MAX_POS, INVERT_*_DIR
|
||||
* Planner: DEFAULT_AXIS_STEPS_PER_UNIT, DEFAULT_MAX_FEEDRATE
|
||||
* DEFAULT_MAX_ACCELERATION, AXIS_RELATIVE_MODES,
|
||||
* MICROSTEP_MODES, MANUAL_FEEDRATE
|
||||
*
|
||||
* :[3, 4, 5, 6]
|
||||
*/
|
||||
//#define LINEAR_AXES 3
|
||||
|
||||
/**
|
||||
* Axis codes for additional axes:
|
||||
* This defines the axis code that is used in G-code commands to
|
||||
* reference a specific axis.
|
||||
* 'A' for rotational axis parallel to X
|
||||
* 'B' for rotational axis parallel to Y
|
||||
* 'C' for rotational axis parallel to Z
|
||||
* 'U' for secondary linear axis parallel to X
|
||||
* 'V' for secondary linear axis parallel to Y
|
||||
* 'W' for secondary linear axis parallel to Z
|
||||
* Regardless of the settings, firmware-internal axis IDs are
|
||||
* I (AXIS4), J (AXIS5), K (AXIS6).
|
||||
*/
|
||||
#if LINEAR_AXES >= 4
|
||||
#define AXIS4_NAME 'A' // :['A', 'B', 'C', 'U', 'V', 'W']
|
||||
#endif
|
||||
#if LINEAR_AXES >= 5
|
||||
#define AXIS5_NAME 'B' // :['A', 'B', 'C', 'U', 'V', 'W']
|
||||
#endif
|
||||
#if LINEAR_AXES >= 6
|
||||
#define AXIS6_NAME 'C' // :['A', 'B', 'C', 'U', 'V', 'W']
|
||||
#endif
|
||||
|
||||
// @section extruder
|
||||
|
||||
// This defines the number of extruders
|
||||
@@ -209,7 +260,6 @@
|
||||
|
||||
#define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders
|
||||
#define PARKING_EXTRUDER_GRAB_DISTANCE 1 // (mm) Distance to move beyond the parking point to grab the extruder
|
||||
//#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381
|
||||
|
||||
#if ENABLED(PARKING_EXTRUDER)
|
||||
|
||||
@@ -291,6 +341,7 @@
|
||||
#define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
|
||||
//#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
|
||||
//#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD
|
||||
//#define MIXING_PRESETS // Assign 8 default V-tool presets for 2 or 3 MIXING_STEPPERS
|
||||
#if ENABLED(GRADIENT_MIX)
|
||||
//#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias
|
||||
#endif
|
||||
@@ -315,6 +366,9 @@
|
||||
//#define PSU_NAME "Power Supply"
|
||||
|
||||
#if ENABLED(PSU_CONTROL)
|
||||
//#define MKS_PWC // Using the MKS PWC add-on
|
||||
//#define PS_OFF_CONFIRM // Confirm dialog when power off
|
||||
//#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
|
||||
@@ -344,70 +398,93 @@
|
||||
// @section temperature
|
||||
|
||||
/**
|
||||
* --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
|
||||
* --NORMAL IS 4.7kΩ PULLUP!-- 1kΩ pullup can be used on hotend sensor, using correct resistor and table
|
||||
*
|
||||
* Temperature sensors available:
|
||||
*
|
||||
* -5 : PT100 / PT1000 with MAX31865 (only for sensors 0-1)
|
||||
* -3 : thermocouple with MAX31855 (only for sensors 0-1)
|
||||
* -2 : thermocouple with MAX6675 (only for sensors 0-1)
|
||||
* -4 : thermocouple with AD8495
|
||||
* -1 : thermocouple with AD595
|
||||
* SPI RTD/Thermocouple Boards - IMPORTANT: Read the NOTE below!
|
||||
* -------
|
||||
* -5 : MAX31865 with Pt100/Pt1000, 2, 3, or 4-wire (only for sensors 0-1)
|
||||
* NOTE: You must uncomment/set the MAX31865_*_OHMS_n defines below.
|
||||
* -3 : MAX31855 with Thermocouple, -200°C to +700°C (only for sensors 0-1)
|
||||
* -2 : MAX6675 with Thermocouple, 0°C to +700°C (only for sensors 0-1)
|
||||
*
|
||||
* NOTE: Ensure TEMP_n_CS_PIN is set in your pins file for each TEMP_SENSOR_n using an SPI Thermocouple. By default,
|
||||
* Hardware SPI on the default serial bus is used. If you have also set TEMP_n_SCK_PIN and TEMP_n_MISO_PIN,
|
||||
* Software SPI will be used on those ports instead. You can force Hardware SPI on the default bus in the
|
||||
* Configuration_adv.h file. At this time, separate Hardware SPI buses for sensors are not supported.
|
||||
*
|
||||
* Analog Themocouple Boards
|
||||
* -------
|
||||
* -4 : AD8495 with Thermocouple
|
||||
* -1 : AD595 with Thermocouple
|
||||
*
|
||||
* Analog Thermistors - 4.7kΩ pullup - Normal
|
||||
* -------
|
||||
* 1 : 100kΩ EPCOS - Best choice for EPCOS thermistors
|
||||
* 331 : 100kΩ Same as #1, but 3.3V scaled for MEGA
|
||||
* 332 : 100kΩ Same as #1, but 3.3V scaled for DUE
|
||||
* 2 : 200kΩ ATC Semitec 204GT-2
|
||||
* 202 : 200kΩ Copymaster 3D
|
||||
* 3 : ???Ω Mendel-parts thermistor
|
||||
* 4 : 10kΩ Generic Thermistor !! DO NOT use for a hotend - it gives bad resolution at high temp. !!
|
||||
* 5 : 100kΩ ATC Semitec 104GT-2/104NT-4-R025H42G - Used in ParCan, J-Head, and E3D, SliceEngineering 300°C
|
||||
* 501 : 100kΩ Zonestar - Tronxy X3A
|
||||
* 502 : 100kΩ Zonestar - used by hot bed in Zonestar Průša P802M
|
||||
* 512 : 100kΩ RPW-Ultra hotend
|
||||
* 6 : 100kΩ EPCOS - Not as accurate as table #1 (created using a fluke thermocouple)
|
||||
* 7 : 100kΩ Honeywell 135-104LAG-J01
|
||||
* 71 : 100kΩ Honeywell 135-104LAF-J01
|
||||
* 8 : 100kΩ Vishay 0603 SMD NTCS0603E3104FXT
|
||||
* 9 : 100kΩ GE Sensing AL03006-58.2K-97-G1
|
||||
* 10 : 100kΩ RS PRO 198-961
|
||||
* 11 : 100kΩ Keenovo AC silicone mats, most Wanhao i3 machines - beta 3950, 1%
|
||||
* 12 : 100kΩ Vishay 0603 SMD NTCS0603E3104FXT (#8) - calibrated for Makibox hot bed
|
||||
* 13 : 100kΩ Hisens up to 300°C - for "Simple ONE" & "All In ONE" hotend - beta 3950, 1%
|
||||
* 15 : 100kΩ Calibrated for JGAurora A5 hotend
|
||||
* 18 : 200kΩ ATC Semitec 204GT-2 Dagoma.Fr - MKS_Base_DKU001327
|
||||
* 22 : 100kΩ GTM32 Pro vB - hotend - 4.7kΩ pullup to 3.3V and 220Ω to analog input
|
||||
* 23 : 100kΩ GTM32 Pro vB - bed - 4.7kΩ pullup to 3.3v and 220Ω to analog input
|
||||
* 30 : 100kΩ Kis3d Silicone heating mat 200W/300W with 6mm precision cast plate (EN AW 5083) NTC100K - beta 3950
|
||||
* 60 : 100kΩ Maker's Tool Works Kapton Bed Thermistor - beta 3950
|
||||
* 61 : 100kΩ Formbot/Vivedino 350°C Thermistor - beta 3950
|
||||
* 66 : 4.7MΩ Dyze Design High Temperature Thermistor
|
||||
* 67 : 500kΩ SliceEngineering 450°C Thermistor
|
||||
* 70 : 100kΩ bq Hephestos 2
|
||||
* 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32
|
||||
* 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor
|
||||
*
|
||||
* Analog Thermistors - 1kΩ pullup - Atypical, and requires changing out the 4.7kΩ pullup for 1kΩ.
|
||||
* ------- (but gives greater accuracy and more stable PID)
|
||||
* 51 : 100kΩ EPCOS (1kΩ pullup)
|
||||
* 52 : 200kΩ ATC Semitec 204GT-2 (1kΩ pullup)
|
||||
* 55 : 100kΩ ATC Semitec 104GT-2 - Used in ParCan & J-Head (1kΩ pullup)
|
||||
*
|
||||
* Analog Thermistors - 10kΩ pullup - Atypical
|
||||
* -------
|
||||
* 99 : 100kΩ Found on some Wanhao i3 machines with a 10kΩ pull-up resistor
|
||||
*
|
||||
* Analog RTDs (Pt100/Pt1000)
|
||||
* -------
|
||||
* 110 : Pt100 with 1kΩ pullup (atypical)
|
||||
* 147 : Pt100 with 4.7kΩ pullup
|
||||
* 1010 : Pt1000 with 1kΩ pullup (atypical)
|
||||
* 1047 : Pt1000 with 4.7kΩ pullup (E3D)
|
||||
* 20 : Pt100 with circuit in the Ultimainboard V2.x with mainboard ADC reference voltage = INA826 amplifier-board supply voltage.
|
||||
* NOTE: (1) Must use an ADC input with no pullup. (2) Some INA826 amplifiers are unreliable at 3.3V so consider using sensor 147, 110, or 21.
|
||||
* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v ADC reference voltage (STM32, LPC176x....) and 5V INA826 amplifier board supply.
|
||||
* NOTE: ADC pins are not 5V tolerant. Not recommended because it's possible to damage the CPU by going over 500°C.
|
||||
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
|
||||
*
|
||||
* Custom/Dummy/Other Thermal Sensors
|
||||
* ------
|
||||
* 0 : not used
|
||||
* 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
|
||||
* 331 : (3.3V scaled thermistor 1 table for MEGA)
|
||||
* 332 : (3.3V scaled thermistor 1 table for DUE)
|
||||
* 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
|
||||
* 202 : 200k thermistor - Copymaster 3D
|
||||
* 3 : Mendel-parts thermistor (4.7k pullup)
|
||||
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
|
||||
* 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan, J-Head, and E3D) (4.7k pullup)
|
||||
* 501 : 100K Zonestar (Tronxy X3A) Thermistor
|
||||
* 502 : 100K Zonestar Thermistor used by hot bed in Zonestar Průša P802M
|
||||
* 512 : 100k RPW-Ultra hotend thermistor (4.7k pullup)
|
||||
* 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
|
||||
* 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
|
||||
* 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
|
||||
* 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
|
||||
* 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
|
||||
* 10 : 100k RS thermistor 198-961 (4.7k pullup)
|
||||
* 11 : 100k beta 3950 1% thermistor (Used in Keenovo AC silicone mats and most Wanhao i3 machines) (4.7k pullup)
|
||||
* 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
|
||||
* 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
|
||||
* 15 : 100k thermistor calibration for JGAurora A5 hotend
|
||||
* 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
|
||||
* 20 : Pt100 with circuit in the Ultimainboard V2.x with mainboard ADC reference voltage = INA826 amplifier-board supply voltage.
|
||||
* NOTES: (1) Must use an ADC input with no pullup. (2) Some INA826 amplifiers are unreliable at 3.3V so consider using sensor 147, 110, or 21.
|
||||
* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v ADC reference voltage (STM32, LPC176x....) and 5V INA826 amplifier board supply.
|
||||
* NOTE: ADC pins are not 5V tolerant. Not recommended because it's possible to damage the CPU by going over 500°C.
|
||||
* 22 : 100k (hotend) with 4.7k pullup to 3.3V and 220R to analog input (as in GTM32 Pro vB)
|
||||
* 23 : 100k (bed) with 4.7k pullup to 3.3v and 220R to analog input (as in GTM32 Pro vB)
|
||||
* 30 : Kis3d Silicone heating mat 200W/300W with 6mm precision cast plate (EN AW 5083) NTC100K / B3950 (4.7k pullup)
|
||||
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
|
||||
* 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
|
||||
* 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
|
||||
* 66 : 4.7M High Temperature thermistor from Dyze Design
|
||||
* 67 : 450C thermistor from SliceEngineering
|
||||
* 70 : the 100K thermistor found in the bq Hephestos 2
|
||||
* 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor
|
||||
* 99 : 100k thermistor with a 10K pull-up resistor (found on some Wanhao i3 machines)
|
||||
*
|
||||
* 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k.
|
||||
* (but gives greater accuracy and more stable PID)
|
||||
* 51 : 100k thermistor - EPCOS (1k pullup)
|
||||
* 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
|
||||
* 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
|
||||
*
|
||||
* 1047 : Pt1000 with 4k7 pullup (E3D)
|
||||
* 1010 : Pt1000 with 1k pullup (non standard)
|
||||
* 147 : Pt100 with 4k7 pullup
|
||||
* 110 : Pt100 with 1k pullup (non standard)
|
||||
*
|
||||
* 1000 : Custom - Specify parameters in Configuration_adv.h
|
||||
*
|
||||
* Use these for Testing or Development purposes. NEVER for production machine.
|
||||
* !!! Use these for Testing or Development purposes. NEVER for production machine. !!!
|
||||
* 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below.
|
||||
* 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below.
|
||||
*
|
||||
*/
|
||||
#define TEMP_SENSOR_0 1
|
||||
#define TEMP_SENSOR_1 0
|
||||
@@ -421,6 +498,8 @@
|
||||
#define TEMP_SENSOR_PROBE 0
|
||||
#define TEMP_SENSOR_CHAMBER 0
|
||||
#define TEMP_SENSOR_COOLER 0
|
||||
#define TEMP_SENSOR_BOARD 0
|
||||
#define TEMP_SENSOR_REDUNDANT 0
|
||||
|
||||
// Dummy thermistor constant temperature readings, for use with 998 and 999
|
||||
#define DUMMY_THERMISTOR_998_VALUE 25
|
||||
@@ -428,15 +507,10 @@
|
||||
|
||||
// Resistor values when using MAX31865 sensors (-5) on TEMP_SENSOR_0 / 1
|
||||
//#define MAX31865_SENSOR_OHMS_0 100 // (Ω) Typically 100 or 1000 (PT100 or PT1000)
|
||||
//#define MAX31865_CALIBRATION_OHMS_0 430 // (Ω) Typically 430 for AdaFruit PT100; 4300 for AdaFruit PT1000
|
||||
//#define MAX31865_CALIBRATION_OHMS_0 430 // (Ω) Typically 430 for Adafruit PT100; 4300 for Adafruit PT1000
|
||||
//#define MAX31865_SENSOR_OHMS_1 100
|
||||
//#define MAX31865_CALIBRATION_OHMS_1 430
|
||||
|
||||
// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings
|
||||
// from the two sensors differ too much the print will be aborted.
|
||||
//#define TEMP_SENSOR_1_AS_REDUNDANT
|
||||
#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
|
||||
|
||||
#define TEMP_RESIDENCY_TIME 10 // (seconds) Time to wait for hotend to "settle" in M109
|
||||
#define TEMP_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
|
||||
@@ -449,6 +523,22 @@
|
||||
#define TEMP_CHAMBER_WINDOW 1 // (°C) Temperature proximity for the "temperature reached" timer
|
||||
#define TEMP_CHAMBER_HYSTERESIS 3 // (°C) Temperature proximity considered "close enough" to the target
|
||||
|
||||
/**
|
||||
* Redundant Temperature Sensor (TEMP_SENSOR_REDUNDANT)
|
||||
*
|
||||
* Use a temp sensor as a redundant sensor for another reading. Select an unused temperature sensor, and another
|
||||
* sensor you'd like it to be redundant for. If the two thermistors differ by TEMP_SENSOR_REDUNDANT_MAX_DIFF (°C),
|
||||
* the print will be aborted. Whichever sensor is selected will have its normal functions disabled; i.e. selecting
|
||||
* the Bed sensor (-1) will disable bed heating/monitoring.
|
||||
*
|
||||
* For selecting source/target use: COOLER, PROBE, BOARD, CHAMBER, BED, E0, E1, E2, E3, E4, E5, E6, E7
|
||||
*/
|
||||
#if TEMP_SENSOR_REDUNDANT
|
||||
#define TEMP_SENSOR_REDUNDANT_SOURCE E1 // The sensor that will provide the redundant reading.
|
||||
#define TEMP_SENSOR_REDUNDANT_TARGET E0 // The sensor that we are providing a redundant reading for.
|
||||
#define TEMP_SENSOR_REDUNDANT_MAX_DIFF 10 // (°C) Temperature difference that will trigger a print abort.
|
||||
#endif
|
||||
|
||||
// Below this temperature the heater will be switched off
|
||||
// because it probably indicates a broken thermistor wire.
|
||||
#define HEATER_0_MINTEMP 5
|
||||
@@ -504,8 +594,8 @@
|
||||
// Set/get with gcode: M301 E[extruder number, 0-2]
|
||||
|
||||
#if ENABLED(PID_PARAMS_PER_HOTEND)
|
||||
// Specify between 1 and HOTENDS values per array.
|
||||
// If fewer than EXTRUDER values are provided, the last element will be repeated.
|
||||
// Specify up to one value per hotend here, according to your setup.
|
||||
// If there are fewer values, the last one applies to the remaining hotends.
|
||||
#define DEFAULT_Kp_LIST { 22.20, 22.20 }
|
||||
#define DEFAULT_Ki_LIST { 1.08, 1.08 }
|
||||
#define DEFAULT_Kd_LIST { 114.00, 114.00 }
|
||||
@@ -666,6 +756,17 @@
|
||||
//#define COREZX
|
||||
//#define COREZY
|
||||
//#define MARKFORGED_XY // MarkForged. See https://reprap.org/forum/read.php?152,504042
|
||||
//#define MARKFORGED_YX
|
||||
|
||||
// Enable for a belt style printer with endless "Z" motion
|
||||
//#define BELTPRINTER
|
||||
|
||||
// Enable for Polargraph Kinematics
|
||||
//#define POLARGRAPH
|
||||
#if ENABLED(POLARGRAPH)
|
||||
#define POLARGRAPH_MAX_BELT_LEN 1035.0
|
||||
#define POLAR_SEGMENTS_PER_SECOND 5
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
//============================== Endstop Settings ===========================
|
||||
@@ -679,20 +780,32 @@
|
||||
#define USE_XMIN_PLUG
|
||||
#define USE_YMIN_PLUG
|
||||
#define USE_ZMIN_PLUG
|
||||
//#define USE_IMIN_PLUG
|
||||
//#define USE_JMIN_PLUG
|
||||
//#define USE_KMIN_PLUG
|
||||
//#define USE_XMAX_PLUG
|
||||
//#define USE_YMAX_PLUG
|
||||
//#define USE_ZMAX_PLUG
|
||||
//#define USE_IMAX_PLUG
|
||||
//#define USE_JMAX_PLUG
|
||||
//#define USE_KMAX_PLUG
|
||||
|
||||
// Enable pullup for all endstops to prevent a floating state
|
||||
#define ENDSTOPPULLUPS
|
||||
#if DISABLED(ENDSTOPPULLUPS)
|
||||
// Disable ENDSTOPPULLUPS to set pullups individually
|
||||
//#define ENDSTOPPULLUP_XMAX
|
||||
//#define ENDSTOPPULLUP_YMAX
|
||||
//#define ENDSTOPPULLUP_ZMAX
|
||||
//#define ENDSTOPPULLUP_XMIN
|
||||
//#define ENDSTOPPULLUP_YMIN
|
||||
//#define ENDSTOPPULLUP_ZMIN
|
||||
//#define ENDSTOPPULLUP_IMIN
|
||||
//#define ENDSTOPPULLUP_JMIN
|
||||
//#define ENDSTOPPULLUP_KMIN
|
||||
//#define ENDSTOPPULLUP_XMAX
|
||||
//#define ENDSTOPPULLUP_YMAX
|
||||
//#define ENDSTOPPULLUP_ZMAX
|
||||
//#define ENDSTOPPULLUP_IMAX
|
||||
//#define ENDSTOPPULLUP_JMAX
|
||||
//#define ENDSTOPPULLUP_KMAX
|
||||
//#define ENDSTOPPULLUP_ZMIN_PROBE
|
||||
#endif
|
||||
|
||||
@@ -700,12 +813,18 @@
|
||||
//#define ENDSTOPPULLDOWNS
|
||||
#if DISABLED(ENDSTOPPULLDOWNS)
|
||||
// Disable ENDSTOPPULLDOWNS to set pulldowns individually
|
||||
//#define ENDSTOPPULLDOWN_XMAX
|
||||
//#define ENDSTOPPULLDOWN_YMAX
|
||||
//#define ENDSTOPPULLDOWN_ZMAX
|
||||
//#define ENDSTOPPULLDOWN_XMIN
|
||||
//#define ENDSTOPPULLDOWN_YMIN
|
||||
//#define ENDSTOPPULLDOWN_ZMIN
|
||||
//#define ENDSTOPPULLDOWN_IMIN
|
||||
//#define ENDSTOPPULLDOWN_JMIN
|
||||
//#define ENDSTOPPULLDOWN_KMIN
|
||||
//#define ENDSTOPPULLDOWN_XMAX
|
||||
//#define ENDSTOPPULLDOWN_YMAX
|
||||
//#define ENDSTOPPULLDOWN_ZMAX
|
||||
//#define ENDSTOPPULLDOWN_IMAX
|
||||
//#define ENDSTOPPULLDOWN_JMAX
|
||||
//#define ENDSTOPPULLDOWN_KMAX
|
||||
//#define ENDSTOPPULLDOWN_ZMIN_PROBE
|
||||
#endif
|
||||
|
||||
@@ -713,9 +832,15 @@
|
||||
#define X_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Y_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define I_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define J_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define K_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define I_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define J_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define K_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
|
||||
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.
|
||||
|
||||
/**
|
||||
@@ -744,6 +869,9 @@
|
||||
//#define Z2_DRIVER_TYPE A4988
|
||||
//#define Z3_DRIVER_TYPE A4988
|
||||
//#define Z4_DRIVER_TYPE A4988
|
||||
//#define I_DRIVER_TYPE A4988
|
||||
//#define J_DRIVER_TYPE A4988
|
||||
//#define K_DRIVER_TYPE A4988
|
||||
#define E0_DRIVER_TYPE A4988
|
||||
//#define E1_DRIVER_TYPE A4988
|
||||
//#define E2_DRIVER_TYPE A4988
|
||||
@@ -797,14 +925,14 @@
|
||||
/**
|
||||
* Default Axis Steps Per Unit (steps/mm)
|
||||
* Override with M92
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 }
|
||||
|
||||
/**
|
||||
* Default Max Feed Rate (mm/s)
|
||||
* Override with M203
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 }
|
||||
|
||||
@@ -817,7 +945,7 @@
|
||||
* Default Max Acceleration (change/s) change = mm/s
|
||||
* (Maximum start speed for accelerated moves)
|
||||
* Override with M201
|
||||
* X, Y, Z, E0 [, E1[, E2...]]
|
||||
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
|
||||
*/
|
||||
#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 }
|
||||
|
||||
@@ -851,6 +979,9 @@
|
||||
#define DEFAULT_XJERK 10.0
|
||||
#define DEFAULT_YJERK 10.0
|
||||
#define DEFAULT_ZJERK 0.3
|
||||
//#define DEFAULT_IJERK 0.3
|
||||
//#define DEFAULT_JJERK 0.3
|
||||
//#define DEFAULT_KJERK 0.3
|
||||
|
||||
//#define TRAVEL_EXTRA_XYJERK 0.0 // Additional jerk allowance for all travel moves
|
||||
|
||||
@@ -990,7 +1121,7 @@
|
||||
#endif
|
||||
|
||||
// Duet Smart Effector (for delta printers) - https://bit.ly/2ul5U7J
|
||||
// When the pin is defined you can use M672 to set/reset the probe sensivity.
|
||||
// When the pin is defined you can use M672 to set/reset the probe sensitivity.
|
||||
//#define DUET_SMART_EFFECTOR
|
||||
#if ENABLED(DUET_SMART_EFFECTOR)
|
||||
#define SMART_EFFECTOR_MOD_PIN -1 // Connect a GPIO pin to the Smart Effector MOD pin
|
||||
@@ -1090,6 +1221,15 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Probe Enable / Disable
|
||||
* The probe only provides a triggered signal when enabled.
|
||||
*/
|
||||
//#define PROBE_ENABLE_DISABLE
|
||||
#if ENABLED(PROBE_ENABLE_DISABLE)
|
||||
//#define PROBE_ENABLE_PIN -1 // Override the default pin here
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Multiple Probing
|
||||
*
|
||||
@@ -1149,7 +1289,8 @@
|
||||
//#define WAIT_FOR_HOTEND // Wait for hotend to heat back up between probes (to improve accuracy & prevent cold extrude)
|
||||
#endif
|
||||
//#define PROBING_FANS_OFF // Turn fans off when probing
|
||||
//#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing
|
||||
//#define PROBING_ESTEPPERS_OFF // Turn all extruder steppers off when probing
|
||||
//#define PROBING_STEPPERS_OFF // Turn all steppers off (unless needed to hold position) when probing (including extruders)
|
||||
//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors
|
||||
|
||||
// Require minimum nozzle and/or bed temperature for probing
|
||||
@@ -1165,12 +1306,18 @@
|
||||
#define Y_ENABLE_ON 0
|
||||
#define Z_ENABLE_ON 0
|
||||
#define E_ENABLE_ON 0 // For all extruders
|
||||
//#define I_ENABLE_ON 0
|
||||
//#define J_ENABLE_ON 0
|
||||
//#define K_ENABLE_ON 0
|
||||
|
||||
// Disable axis steppers immediately when they're not being stepped.
|
||||
// WARNING: When motors turn off there is a chance of losing position accuracy!
|
||||
#define DISABLE_X false
|
||||
#define DISABLE_Y false
|
||||
#define DISABLE_Z false
|
||||
//#define DISABLE_I false
|
||||
//#define DISABLE_J false
|
||||
//#define DISABLE_K false
|
||||
|
||||
// Turn off the display blinking that warns about possible accuracy reduction
|
||||
//#define DISABLE_REDUCED_ACCURACY_WARNING
|
||||
@@ -1186,6 +1333,9 @@
|
||||
#define INVERT_X_DIR false
|
||||
#define INVERT_Y_DIR true
|
||||
#define INVERT_Z_DIR false
|
||||
//#define INVERT_I_DIR false
|
||||
//#define INVERT_J_DIR false
|
||||
//#define INVERT_K_DIR false
|
||||
|
||||
// @section extruder
|
||||
|
||||
@@ -1221,6 +1371,9 @@
|
||||
#define X_HOME_DIR -1
|
||||
#define Y_HOME_DIR -1
|
||||
#define Z_HOME_DIR -1
|
||||
//#define I_HOME_DIR -1
|
||||
//#define J_HOME_DIR -1
|
||||
//#define K_HOME_DIR -1
|
||||
|
||||
// @section machine
|
||||
|
||||
@@ -1235,6 +1388,12 @@
|
||||
#define X_MAX_POS X_BED_SIZE
|
||||
#define Y_MAX_POS Y_BED_SIZE
|
||||
#define Z_MAX_POS 200
|
||||
//#define I_MIN_POS 0
|
||||
//#define I_MAX_POS 50
|
||||
//#define J_MIN_POS 0
|
||||
//#define J_MAX_POS 50
|
||||
//#define K_MIN_POS 0
|
||||
//#define K_MAX_POS 50
|
||||
|
||||
/**
|
||||
* Software Endstops
|
||||
@@ -1251,6 +1410,9 @@
|
||||
#define MIN_SOFTWARE_ENDSTOP_X
|
||||
#define MIN_SOFTWARE_ENDSTOP_Y
|
||||
#define MIN_SOFTWARE_ENDSTOP_Z
|
||||
#define MIN_SOFTWARE_ENDSTOP_I
|
||||
#define MIN_SOFTWARE_ENDSTOP_J
|
||||
#define MIN_SOFTWARE_ENDSTOP_K
|
||||
#endif
|
||||
|
||||
// Max software endstops constrain movement within maximum coordinate bounds
|
||||
@@ -1259,6 +1421,9 @@
|
||||
#define MAX_SOFTWARE_ENDSTOP_X
|
||||
#define MAX_SOFTWARE_ENDSTOP_Y
|
||||
#define MAX_SOFTWARE_ENDSTOP_Z
|
||||
#define MAX_SOFTWARE_ENDSTOP_I
|
||||
#define MAX_SOFTWARE_ENDSTOP_J
|
||||
#define MAX_SOFTWARE_ENDSTOP_K
|
||||
#endif
|
||||
|
||||
#if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
|
||||
@@ -1491,6 +1656,8 @@
|
||||
//#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used
|
||||
// as the Z-Height correction value.
|
||||
|
||||
//#define UBL_MESH_WIZARD // Run several commands in a row to get a complete mesh
|
||||
|
||||
#elif ENABLED(MESH_BED_LEVELING)
|
||||
|
||||
//===========================================================================
|
||||
@@ -1568,16 +1735,17 @@
|
||||
//#define MANUAL_X_HOME_POS 0
|
||||
//#define MANUAL_Y_HOME_POS 0
|
||||
//#define MANUAL_Z_HOME_POS 0
|
||||
//#define MANUAL_I_HOME_POS 0
|
||||
//#define MANUAL_J_HOME_POS 0
|
||||
//#define MANUAL_K_HOME_POS 0
|
||||
|
||||
// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
|
||||
//
|
||||
// With this feature enabled:
|
||||
//
|
||||
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled.
|
||||
// - If stepper drivers time out, it will need X and Y homing again before Z homing.
|
||||
// - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
|
||||
// - Prevent Z homing when the Z probe is outside bed area.
|
||||
//
|
||||
/**
|
||||
* Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
|
||||
*
|
||||
* - Moves the Z probe (or nozzle) to a defined XY point before Z homing.
|
||||
* - Allows Z homing only when XY positions are known and trusted.
|
||||
* - If stepper drivers sleep, XY homing may be required again before Z homing.
|
||||
*/
|
||||
//#define Z_SAFE_HOMING
|
||||
|
||||
#if ENABLED(Z_SAFE_HOMING)
|
||||
@@ -1669,6 +1837,7 @@
|
||||
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
//#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
|
||||
//#define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build.
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -1810,11 +1979,20 @@
|
||||
/**
|
||||
* Print Job Timer
|
||||
*
|
||||
* Automatically start and stop the print job timer on M104/M109/M190.
|
||||
* Automatically start and stop the print job timer on M104/M109/M140/M190/M141/M191.
|
||||
* The print job timer will only be stopped if the bed/chamber target temp is
|
||||
* below BED_MINTEMP/CHAMBER_MINTEMP.
|
||||
*
|
||||
* M104 (hotend, no wait) - high temp = none, low temp = stop timer
|
||||
* M109 (hotend, wait) - high temp = start timer, low temp = stop timer
|
||||
* M190 (bed, wait) - high temp = start timer, low temp = none
|
||||
* M104 (hotend, no wait) - high temp = none, low temp = stop timer
|
||||
* M109 (hotend, wait) - high temp = start timer, low temp = stop timer
|
||||
* M140 (bed, no wait) - high temp = none, low temp = stop timer
|
||||
* M190 (bed, wait) - high temp = start timer, low temp = none
|
||||
* M141 (chamber, no wait) - high temp = none, low temp = stop timer
|
||||
* M191 (chamber, wait) - high temp = start timer, low temp = none
|
||||
*
|
||||
* For M104/M109, high temp is anything over EXTRUDE_MINTEMP / 2.
|
||||
* For M140/M190, high temp is anything over BED_MINTEMP.
|
||||
* For M141/M191, high temp is anything over CHAMBER_MINTEMP.
|
||||
*
|
||||
* The timer can also be controlled with the following commands:
|
||||
*
|
||||
@@ -1883,10 +2061,10 @@
|
||||
*
|
||||
* Select the language to display on the LCD. These languages are available:
|
||||
*
|
||||
* en, an, bg, ca, cz, da, de, el, el_gr, es, eu, fi, fr, gl, hr, hu, it,
|
||||
* en, an, bg, ca, cz, da, de, el, el_CY, es, eu, fi, fr, gl, hr, hu, it,
|
||||
* jp_kana, ko_KR, nl, pl, pt, pt_br, ro, ru, sk, sv, tr, uk, vi, zh_CN, zh_TW
|
||||
*
|
||||
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el_gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'sv':'Swedish', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)' }
|
||||
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek (Greece)', 'el_CY':'Greek (Cyprus)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'hu':'Hungarian', 'it':'Italian', 'jp_kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt_br':'Portuguese (Brazilian)', 'ro':'Romanian', 'ru':'Russian', 'sk':'Slovak', 'sv':'Swedish', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)' }
|
||||
*/
|
||||
#define LCD_LANGUAGE en
|
||||
|
||||
@@ -1998,6 +2176,7 @@
|
||||
// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
|
||||
//
|
||||
//#define INDIVIDUAL_AXIS_HOMING_MENU
|
||||
//#define INDIVIDUAL_AXIS_HOMING_SUBMENU
|
||||
|
||||
//
|
||||
// SPEAKER/BUZZER
|
||||
@@ -2207,6 +2386,11 @@
|
||||
//#define VIKI2
|
||||
//#define miniVIKI
|
||||
|
||||
//
|
||||
// Alfawise Ex8 printer LCD marked as WYH L12864 COG
|
||||
//
|
||||
//#define WYH_L12864
|
||||
|
||||
//
|
||||
// MakerLab Mini Panel with graphic
|
||||
// controller and SD support - https://reprap.org/wiki/Mini_panel
|
||||
@@ -2254,11 +2438,17 @@
|
||||
//
|
||||
//#define MKS_MINI_12864
|
||||
|
||||
//
|
||||
// MKS MINI12864 V3 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight.
|
||||
//
|
||||
//#define MKS_MINI_12864_V3
|
||||
|
||||
//
|
||||
// MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout.
|
||||
// https://www.aliexpress.com/item/33018110072.html
|
||||
//
|
||||
//#define MKS_LCD12864
|
||||
//#define MKS_LCD12864A
|
||||
//#define MKS_LCD12864B
|
||||
|
||||
//
|
||||
// FYSETC variant of the MINI12864 graphic controller with SD support
|
||||
@@ -2270,6 +2460,11 @@
|
||||
//#define FYSETC_MINI_12864_2_1 // Type A/B. NeoPixel RGB Backlight
|
||||
//#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight.
|
||||
|
||||
//
|
||||
// BigTreeTech Mini 12864 V1.0 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight.
|
||||
//
|
||||
//#define BTT_MINI_12864_V1
|
||||
|
||||
//
|
||||
// Factory display for Creality CR-10
|
||||
// https://www.aliexpress.com/item/32833148327.html
|
||||
@@ -2373,12 +2568,39 @@
|
||||
// DGUS Touch Display with DWIN OS. (Choose one.)
|
||||
// ORIGIN : https://www.aliexpress.com/item/32993409517.html
|
||||
// FYSETC : https://www.aliexpress.com/item/32961471929.html
|
||||
// MKS : https://www.aliexpress.com/item/1005002008179262.html
|
||||
//
|
||||
// Flash display with DGUS Displays for Marlin:
|
||||
// - Format the SD card to FAT32 with an allocation size of 4kb.
|
||||
// - Download files as specified for your type of display.
|
||||
// - Plug the microSD card into the back of the display.
|
||||
// - Boot the display and wait for the update to complete.
|
||||
//
|
||||
// ORIGIN (Marlin DWIN_SET)
|
||||
// - Download https://github.com/coldtobi/Marlin_DGUS_Resources
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// FYSETC (Supplier default)
|
||||
// - Download https://github.com/FYSETC/FYSTLCD-2.0
|
||||
// - Copy the downloaded SCREEN folder to the SD card.
|
||||
//
|
||||
// HIPRECY (Supplier default)
|
||||
// - Download https://github.com/HiPrecy/Touch-Lcd-LEO
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// MKS (MKS-H43) (Supplier default)
|
||||
// - Download https://github.com/makerbase-mks/MKS-H43
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
// RELOADED (T5UID1)
|
||||
// - Download https://github.com/Desuuuu/DGUS-reloaded/releases
|
||||
// - Copy the downloaded DWIN_SET folder to the SD card.
|
||||
//
|
||||
//#define DGUS_LCD_UI_ORIGIN
|
||||
//#define DGUS_LCD_UI_FYSETC
|
||||
//#define DGUS_LCD_UI_HIPRECY
|
||||
|
||||
//#define DGUS_LCD_UI_MKS
|
||||
//#define DGUS_LCD_UI_RELOADED
|
||||
#if ENABLED(DGUS_LCD_UI_MKS)
|
||||
#define USE_MKS_GREEN_UI
|
||||
#endif
|
||||
@@ -2435,32 +2657,32 @@
|
||||
*/
|
||||
|
||||
//
|
||||
// 480x320, 3.5", SPI Display From MKS
|
||||
// Normally used in MKS Robin Nano V2
|
||||
// 480x320, 3.5", SPI Display with Rotary Encoder from MKS
|
||||
// Usually paired with MKS Robin Nano V2 & V3
|
||||
//
|
||||
//#define MKS_TS35_V2_0
|
||||
|
||||
//
|
||||
// 320x240, 2.4", FSMC Display From MKS
|
||||
// Normally used in MKS Robin Nano V1.2
|
||||
// Usually paired with MKS Robin Nano V1.2
|
||||
//
|
||||
//#define MKS_ROBIN_TFT24
|
||||
|
||||
//
|
||||
// 320x240, 2.8", FSMC Display From MKS
|
||||
// Normally used in MKS Robin Nano V1.2
|
||||
// Usually paired with MKS Robin Nano V1.2
|
||||
//
|
||||
//#define MKS_ROBIN_TFT28
|
||||
|
||||
//
|
||||
// 320x240, 3.2", FSMC Display From MKS
|
||||
// Normally used in MKS Robin Nano V1.2
|
||||
// Usually paired with MKS Robin Nano V1.2
|
||||
//
|
||||
//#define MKS_ROBIN_TFT32
|
||||
|
||||
//
|
||||
// 480x320, 3.5", FSMC Display From MKS
|
||||
// Normally used in MKS Robin Nano V1.2
|
||||
// Usually paired with MKS Robin Nano V1.2
|
||||
//
|
||||
//#define MKS_ROBIN_TFT35
|
||||
|
||||
@@ -2471,7 +2693,7 @@
|
||||
|
||||
//
|
||||
// 320x240, 3.2", FSMC Display From MKS
|
||||
// Normally used in MKS Robin
|
||||
// Usually paired with MKS Robin
|
||||
//
|
||||
//#define MKS_ROBIN_TFT_V1_1R
|
||||
|
||||
@@ -2501,10 +2723,15 @@
|
||||
//#define ANET_ET5_TFT35
|
||||
|
||||
//
|
||||
// 1024x600, 7", RGB Stock Display from BIQU-BX
|
||||
// 1024x600, 7", RGB Stock Display with Rotary Encoder from BIQU-BX
|
||||
//
|
||||
//#define BIQU_BX_TFT70
|
||||
|
||||
//
|
||||
// 480x320, 3.5", SPI Stock Display with Rotary Encoder from BIQU B1 SE Series
|
||||
//
|
||||
//#define BTT_TFT35_SPI_V1_0
|
||||
|
||||
//
|
||||
// Generic TFT with detailed options
|
||||
//
|
||||
@@ -2521,6 +2748,7 @@
|
||||
//#define TFT_RES_320x240
|
||||
//#define TFT_RES_480x272
|
||||
//#define TFT_RES_480x320
|
||||
//#define TFT_RES_1024x600
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -2558,16 +2786,22 @@
|
||||
//
|
||||
// Ender-3 v2 OEM display. A DWIN display with Rotary Encoder.
|
||||
//
|
||||
//#define DWIN_CREALITY_LCD
|
||||
//#define DWIN_CREALITY_LCD // Creality UI
|
||||
//#define DWIN_CREALITY_LCD_ENHANCED // Enhanced UI
|
||||
//#define DWIN_CREALITY_LCD_JYERSUI // Jyers UI by Jacob Myers
|
||||
//#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation)
|
||||
//#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation)
|
||||
|
||||
//
|
||||
// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
|
||||
// Touch Screen Settings
|
||||
//
|
||||
//#define TOUCH_SCREEN
|
||||
#if ENABLED(TOUCH_SCREEN)
|
||||
#define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens
|
||||
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
|
||||
|
||||
//#define TOUCH_IDLE_SLEEP 300 // (secs) Turn off the TFT backlight if set (5mn)
|
||||
|
||||
#define TOUCH_SCREEN_CALIBRATION
|
||||
|
||||
//#define TOUCH_CALIBRATION_X 12316
|
||||
@@ -2592,6 +2826,11 @@
|
||||
//#define REPRAPWORLD_KEYPAD
|
||||
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
|
||||
|
||||
//
|
||||
// EasyThreeD ET-4000+ with button input and status LED
|
||||
//
|
||||
//#define EASYTHREED_UI
|
||||
|
||||
//=============================================================================
|
||||
//=============================== Extra Features ==============================
|
||||
//=============================================================================
|
||||
@@ -2602,9 +2841,6 @@
|
||||
// :[1,2,3,4,5,6,7,8]
|
||||
//#define NUM_M106_FANS 1
|
||||
|
||||
// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino
|
||||
//#define FAST_PWM_FAN
|
||||
|
||||
// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
|
||||
// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
|
||||
// is too low, you should also increment SOFT_PWM_SCALE.
|
||||
@@ -2675,7 +2911,7 @@
|
||||
//#define NEOPIXEL_LED
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
|
||||
#define NEOPIXEL_PIN 4 // LED driving pin
|
||||
//#define NEOPIXEL_PIN 4 // LED driving pin
|
||||
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
|
||||
//#define NEOPIXEL2_PIN 5
|
||||
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)
|
||||
@@ -2693,10 +2929,11 @@
|
||||
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
|
||||
#endif
|
||||
|
||||
// Use a single NeoPixel LED for static (background) lighting
|
||||
//#define NEOPIXEL_BKGD_LED_INDEX 0 // Index of the LED to use
|
||||
//#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
|
||||
//#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off
|
||||
// Use some of the NeoPixel LEDs for static (background) lighting
|
||||
//#define NEOPIXEL_BKGD_INDEX_FIRST 0 // Index of the first background LED
|
||||
//#define NEOPIXEL_BKGD_INDEX_LAST 5 // Index of the last background LED
|
||||
//#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
|
||||
//#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -2721,9 +2958,9 @@
|
||||
* Set this manually if there are extra servos needing manual control.
|
||||
* Set to 0 to turn off servo support.
|
||||
*/
|
||||
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
|
||||
//#define NUM_SERVOS 3 // Note: Servo index starts with 0 for M280-M282 commands
|
||||
|
||||
// (ms) Delay before the next move will start, to give the servo time to reach its target angle.
|
||||
// (ms) Delay before the next move will start, to give the servo time to reach its target angle.
|
||||
// 300ms is a good value but you can try less delay.
|
||||
// If the servo can't reach the requested position, increase it.
|
||||
#define SERVO_DELAY { 300 }
|
||||
@@ -2733,3 +2970,6 @@
|
||||
|
||||
// Edit servo angles with M281 and save to EEPROM with M500
|
||||
//#define EDITABLE_SERVO_ANGLES
|
||||
|
||||
// Disable servo with M282 to reduce power consumption, noise, and heat when not in use
|
||||
//#define SERVO_DETACH_GCODE
|
||||
|
File diff suppressed because it is too large
Load Diff
167
Marlin/Makefile
167
Marlin/Makefile
@@ -110,7 +110,7 @@ LIQUID_TWI2 ?= 0
|
||||
WIRE ?= 0
|
||||
|
||||
# This defines if Tone is needed (i.e SPEAKER is defined in Configuration.h)
|
||||
# Disabling this (and SPEAKER) saves approximatively 350 bytes of memory.
|
||||
# Disabling this (and SPEAKER) saves approximately 350 bytes of memory.
|
||||
TONE ?= 1
|
||||
|
||||
# This defines if U8GLIB is needed (may require RELOC_WORKAROUND)
|
||||
@@ -191,6 +191,134 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1034)
|
||||
# RAMPS Derivatives - ATmega1280, ATmega2560
|
||||
#
|
||||
|
||||
# 3Drag Controller
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1100)
|
||||
# Velleman K8200 Controller (derived from 3Drag Controller)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1101)
|
||||
# Velleman K8400 Controller (derived from 3Drag Controller)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1102)
|
||||
# Velleman K8600 Controller (Vertex Nano)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1103)
|
||||
# Velleman K8800 Controller (Vertex Delta)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1104)
|
||||
# 2PrintBeta BAM&DICE with STK drivers
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1105)
|
||||
# 2PrintBeta BAM&DICE Due with STK drivers
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1106)
|
||||
# MKS BASE v1.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1107)
|
||||
# MKS BASE v1.4 with Allegro A4982 stepper drivers
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1108)
|
||||
# MKS BASE v1.5 with Allegro A4982 stepper drivers
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1109)
|
||||
# MKS BASE v1.6 with Allegro A4982 stepper drivers
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1110)
|
||||
# MKS BASE 1.0 with Heroic HR4982 stepper drivers
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1111)
|
||||
# MKS GEN v1.3 or 1.4
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1112)
|
||||
# MKS GEN L
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1113)
|
||||
# BigTreeTech or BIQU KFB2.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1114)
|
||||
# zrib V2.0 (Chinese RAMPS replica)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1115)
|
||||
# zrib V5.2 (Chinese RAMPS replica)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1116)
|
||||
# Felix 2.0+ Electronics Board (RAMPS like)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1117)
|
||||
# Invent-A-Part RigidBoard
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1118)
|
||||
# Invent-A-Part RigidBoard V2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1119)
|
||||
# Sainsmart 2-in-1 board
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1120)
|
||||
# Ultimaker
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1121)
|
||||
# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1122)
|
||||
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)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1125)
|
||||
# Rumba
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1126)
|
||||
# Raise3D N series Rumba derivative
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1127)
|
||||
# Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1128)
|
||||
# Formbot T-Rex 2 Plus
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1129)
|
||||
# Formbot T-Rex 3
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1130)
|
||||
# Formbot Raptor
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1131)
|
||||
# Formbot Raptor 2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1132)
|
||||
# bq ZUM Mega 3D
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1133)
|
||||
# MakeBoard Mini v2.1.2 by MicroMake
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1134)
|
||||
# TriGorilla Anycubic version 1.3-based on RAMPS EFB
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1135)
|
||||
# ... Ver 1.4
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1136)
|
||||
# ... Rev 1.1 (new servo pin order)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1137)
|
||||
# Creality: Ender-4, CR-8
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1138)
|
||||
# Creality: CR10S, CR20, CR-X
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1139)
|
||||
# Dagoma F5
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1140)
|
||||
# FYSETC F6 1.3
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1141)
|
||||
# FYSETC F6 1.4
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1142)
|
||||
# Wanhao Duplicator i3 Plus
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1143)
|
||||
# VORON Design
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1144)
|
||||
# Tronxy TRONXY-V3-1.0
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1145)
|
||||
# Z-Bolt X Series
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1146)
|
||||
# TT OSCAR
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1147)
|
||||
# Overlord/Overlord Pro
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1148)
|
||||
# ADIMLab Gantry v1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1149)
|
||||
# ADIMLab Gantry v2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1150)
|
||||
# BIQU Tango V1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1151)
|
||||
# MKS GEN L V2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1152)
|
||||
# MKS GEN L V2.1
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1153)
|
||||
# Copymaster 3D
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1154)
|
||||
# Ortur 4
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1155)
|
||||
# Tenlog D3 Hero IDEX printer
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1156)
|
||||
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1157)
|
||||
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1158)
|
||||
# Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1159)
|
||||
# Longer LK1 PRO / Alfawise U20 Pro (PRO version)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1160)
|
||||
# Longer LKx PRO / Alfawise Uxx Pro (PRO version)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1161)
|
||||
|
||||
|
||||
# 3Drag Controller
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1100)
|
||||
# Velleman K8200 Controller (derived from 3Drag Controller)
|
||||
@@ -358,20 +486,38 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1311)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1312)
|
||||
# Mega controller
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1313)
|
||||
# Geeetech GT2560 Rev B for Mecreator2
|
||||
# Geeetech GT2560 Rev A
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1314)
|
||||
# Geeetech GT2560 Rev. A
|
||||
# Geeetech GT2560 Rev A+ (with auto level probe)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1315)
|
||||
# Geeetech GT2560 Rev. A+ (with auto level probe)
|
||||
# Geeetech GT2560 Rev B
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1316)
|
||||
# Geeetech GT2560 Rev B for A10(M/D)
|
||||
# Geeetech GT2560 Rev B for A10(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1317)
|
||||
# Geeetech GT2560 Rev B for A20(M/D)
|
||||
# Geeetech GT2560 Rev B for A10(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1318)
|
||||
# Einstart retrofit
|
||||
# Geeetech GT2560 Rev B for Mecreator2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1319)
|
||||
# Wanhao 0ne+ i3 Mini
|
||||
# Geeetech GT2560 Rev B for A20(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 gcode only)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1327)
|
||||
# Geeetech GT2560 Rev B for A20(M/T/D)
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1328)
|
||||
# Mega controller & Protoneer CNC Shield V3.00
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1329)
|
||||
|
||||
#
|
||||
# ATmega1281, ATmega2561
|
||||
@@ -445,6 +591,11 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1510)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
# ZoneStar ZMIB V2
|
||||
else ifeq ($(HARDWARE_MOTHERBOARD),1511)
|
||||
HARDWARE_VARIANT ?= Sanguino
|
||||
MCU ?= atmega1284p
|
||||
PROG_MCU ?= m1284p
|
||||
|
||||
#
|
||||
# Other ATmega644P, ATmega644, ATmega1284P
|
||||
|
@@ -28,7 +28,7 @@
|
||||
/**
|
||||
* Marlin release version identifier
|
||||
*/
|
||||
//#define SHORT_BUILD_VERSION "2.0.8"
|
||||
//#define SHORT_BUILD_VERSION "2.0.9.3"
|
||||
|
||||
/**
|
||||
* Verbose version identifier which should contain a reference to the location
|
||||
@@ -41,7 +41,7 @@
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
//#define STRING_DISTRIBUTION_DATE "2021-04-30"
|
||||
//#define STRING_DISTRIBUTION_DATE "2021-12-25"
|
||||
|
||||
/**
|
||||
* Defines a generic printer name to be output to the LCD after booting Marlin.
|
||||
|
@@ -35,12 +35,31 @@
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
//uint8_t MCUSR;
|
||||
// Don't initialize/override variable (which would happen in .init4)
|
||||
uint8_t reset_reason __attribute__((section(".noinit")));
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// ------------------------
|
||||
|
||||
__attribute__((naked)) // Don't output function pro- and epilogue
|
||||
__attribute__((used)) // Output the function, even if "not used"
|
||||
__attribute__((section(".init3"))) // Put in an early user definable section
|
||||
void HAL_save_reset_reason() {
|
||||
#if ENABLED(OPTIBOOT_RESET_REASON)
|
||||
__asm__ __volatile__(
|
||||
A("STS %0, r2")
|
||||
: "=m"(reset_reason)
|
||||
);
|
||||
#else
|
||||
reset_reason = MCUSR;
|
||||
#endif
|
||||
|
||||
// Clear within 16ms since WDRF bit enables a 16ms watchdog timer -> Boot loop
|
||||
MCUSR = 0;
|
||||
wdt_disable();
|
||||
}
|
||||
|
||||
void HAL_init() {
|
||||
// Init Servo Pins
|
||||
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
|
||||
|
@@ -39,6 +39,19 @@
|
||||
#include <avr/interrupt.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
//
|
||||
// Default graphical display delays
|
||||
//
|
||||
#if F_CPU >= 20000000
|
||||
#define CPU_ST7920_DELAY_1 150
|
||||
#define CPU_ST7920_DELAY_2 0
|
||||
#define CPU_ST7920_DELAY_3 150
|
||||
#elif F_CPU == 16000000
|
||||
#define CPU_ST7920_DELAY_1 125
|
||||
#define CPU_ST7920_DELAY_2 0
|
||||
#define CPU_ST7920_DELAY_3 188
|
||||
#endif
|
||||
|
||||
#ifndef pgm_read_ptr
|
||||
// Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for
|
||||
// Windows Subsystem for Linux on Windows 10 as of 10/18/2019
|
||||
@@ -78,7 +91,7 @@ typedef int8_t pin_t;
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
//extern uint8_t MCUSR;
|
||||
extern uint8_t reset_reason;
|
||||
|
||||
// Serial ports
|
||||
#ifdef USBCON
|
||||
@@ -93,28 +106,35 @@ typedef int8_t pin_t;
|
||||
#define MYSERIAL1 TERN(BLUETOOTH, btSerial, MSerial0)
|
||||
#else
|
||||
#if !WITHIN(SERIAL_PORT, -1, 3)
|
||||
#error "SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#error "SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
|
||||
#endif
|
||||
#define MYSERIAL1 customizedSerial1
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
#if !WITHIN(SERIAL_PORT_2, -1, 3)
|
||||
#error "SERIAL_PORT_2 must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#error "SERIAL_PORT_2 must be from 0 to 3, or -1 for USB Serial."
|
||||
#endif
|
||||
#define MYSERIAL2 customizedSerial2
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_3
|
||||
#if !WITHIN(SERIAL_PORT_3, -1, 3)
|
||||
#error "SERIAL_PORT_3 must be from 0 to 3, or -1 for USB Serial."
|
||||
#endif
|
||||
#define MYSERIAL3 customizedSerial3
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
#if !WITHIN(MMU2_SERIAL_PORT, -1, 3)
|
||||
#error "MMU2_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#error "MMU2_SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
|
||||
#endif
|
||||
#define MMU2_SERIAL mmuSerial
|
||||
#endif
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
#if !WITHIN(LCD_SERIAL_PORT, -1, 3)
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
|
||||
#endif
|
||||
#define LCD_SERIAL lcdSerial
|
||||
#if HAS_DGUS_LCD
|
||||
@@ -132,21 +152,19 @@ void HAL_init();
|
||||
|
||||
//void _delay_ms(const int delay);
|
||||
|
||||
inline void HAL_clear_reset_source() { MCUSR = 0; }
|
||||
inline uint8_t HAL_get_reset_source() { return MCUSR; }
|
||||
inline void HAL_clear_reset_source() { }
|
||||
inline uint8_t HAL_get_reset_source() { return reset_reason; }
|
||||
|
||||
void HAL_reboot();
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
|
||||
extern "C" int freeMemory();
|
||||
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// ADC
|
||||
#ifdef DIDR2
|
||||
@@ -179,7 +197,7 @@ inline void HAL_adc_init() {
|
||||
#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)
|
||||
@@ -203,7 +221,7 @@ void set_pwm_frequency(const pin_t pin, int f_desired);
|
||||
|
||||
/**
|
||||
* set_pwm_duty
|
||||
* Sets the PWM duty cycle of the provided pin to the provided value
|
||||
* Set the PWM duty cycle of the provided pin to the provided value
|
||||
* Optionally allows inverting the duty cycle [default = false]
|
||||
* Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
|
||||
*/
|
||||
|
@@ -34,7 +34,9 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
void spiBegin() {
|
||||
OUT_WRITE(SD_SS_PIN, HIGH);
|
||||
#if PIN_EXISTS(SD_SS)
|
||||
OUT_WRITE(SD_SS_PIN, HIGH);
|
||||
#endif
|
||||
SET_OUTPUT(SD_SCK_PIN);
|
||||
SET_INPUT(SD_MISO_PIN);
|
||||
SET_OUTPUT(SD_MOSI_PIN);
|
||||
@@ -74,7 +76,8 @@ void spiBegin() {
|
||||
#elif defined(PRR0)
|
||||
PRR0
|
||||
#endif
|
||||
, PRSPI);
|
||||
, PRSPI
|
||||
);
|
||||
|
||||
SPCR = _BV(SPE) | _BV(MSTR) | (spiRate >> 1);
|
||||
SPSR = spiRate & 1 || spiRate == 6 ? 0 : _BV(SPI2X);
|
||||
|
26
Marlin/src/HAL/AVR/MarlinSPI.h
Normal file
26
Marlin/src/HAL/AVR/MarlinSPI.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
using MarlinSPI = SPIClass;
|
@@ -567,7 +567,7 @@ ISR(SERIAL_REGNAME(USART, SERIAL_PORT, _UDRE_vect)) {
|
||||
|
||||
// Because of the template definition above, it's required to instantiate the template to have all methods generated
|
||||
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT> >;
|
||||
MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
|
||||
MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
|
||||
@@ -582,7 +582,24 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
|
||||
|
||||
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT_2> >;
|
||||
MSerialT2 customizedSerial2(MSerialT2::HasEmergencyParser);
|
||||
#endif
|
||||
|
||||
#endif // SERIAL_PORT_2
|
||||
|
||||
#ifdef SERIAL_PORT_3
|
||||
|
||||
// Hookup ISR handlers
|
||||
ISR(SERIAL_REGNAME(USART, SERIAL_PORT_3, _RX_vect)) {
|
||||
MarlinSerial<MarlinSerialCfg<SERIAL_PORT_3>>::store_rxd_char();
|
||||
}
|
||||
|
||||
ISR(SERIAL_REGNAME(USART, SERIAL_PORT_3, _UDRE_vect)) {
|
||||
MarlinSerial<MarlinSerialCfg<SERIAL_PORT_3>>::_tx_udr_empty_irq();
|
||||
}
|
||||
|
||||
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT_3> >;
|
||||
MSerialT3 customizedSerial3(MSerialT3::HasEmergencyParser);
|
||||
|
||||
#endif // SERIAL_PORT_3
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
|
||||
@@ -595,8 +612,9 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
|
||||
}
|
||||
|
||||
template class MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> >;
|
||||
MSerialT3 mmuSerial(MSerialT3::HasEmergencyParser);
|
||||
#endif
|
||||
MSerialMMU2 mmuSerial(MSerialMMU2::HasEmergencyParser);
|
||||
|
||||
#endif // MMU2_SERIAL_PORT
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
|
||||
@@ -609,7 +627,7 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
|
||||
}
|
||||
|
||||
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
|
||||
MSerialT4 lcdSerial(MSerialT4::HasEmergencyParser);
|
||||
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
|
||||
|
||||
#if HAS_DGUS_LCD
|
||||
template<typename Cfg>
|
||||
@@ -622,13 +640,13 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // LCD_SERIAL_PORT
|
||||
|
||||
#endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H)
|
||||
|
||||
// For AT90USB targets use the UART for BT interfacing
|
||||
#if defined(USBCON) && ENABLED(BLUETOOTH)
|
||||
MSerialT5 bluetoothSerial(false);
|
||||
MSerialBT bluetoothSerial(false);
|
||||
#endif
|
||||
|
||||
#endif // __AVR__
|
||||
|
@@ -238,14 +238,19 @@
|
||||
static constexpr bool MAX_RX_QUEUED = ENABLED(SERIAL_STATS_MAX_RX_QUEUED);
|
||||
};
|
||||
|
||||
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT> > > MSerialT;
|
||||
extern MSerialT customizedSerial1;
|
||||
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT> > > MSerialT1;
|
||||
extern MSerialT1 customizedSerial1;
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT_2> > > MSerialT2;
|
||||
extern MSerialT2 customizedSerial2;
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_3
|
||||
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT_3> > > MSerialT3;
|
||||
extern MSerialT3 customizedSerial3;
|
||||
#endif
|
||||
|
||||
#endif // !USBCON
|
||||
|
||||
#ifdef MMU2_SERIAL_PORT
|
||||
@@ -262,8 +267,8 @@
|
||||
static constexpr bool RX_OVERRUNS = false;
|
||||
};
|
||||
|
||||
typedef Serial1Class< MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> > > MSerialT3;
|
||||
extern MSerialT3 mmuSerial;
|
||||
typedef Serial1Class< MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> > > MSerialMMU2;
|
||||
extern MSerialMMU2 mmuSerial;
|
||||
#endif
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
@@ -281,12 +286,12 @@
|
||||
static constexpr bool RX_OVERRUNS = BOTH(HAS_DGUS_LCD, SERIAL_STATS_RX_BUFFER_OVERRUNS);
|
||||
};
|
||||
|
||||
typedef Serial1Class< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialT4;
|
||||
extern MSerialT4 lcdSerial;
|
||||
typedef Serial1Class< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialLCD;
|
||||
extern MSerialLCD lcdSerial;
|
||||
#endif
|
||||
|
||||
// Use the UART for Bluetooth in AT90USB configurations
|
||||
#if defined(USBCON) && ENABLED(BLUETOOTH)
|
||||
typedef Serial1Class<HardwareSerial> MSerialT5;
|
||||
extern MSerialT5 bluetoothSerial;
|
||||
typedef Serial1Class<HardwareSerial> MSerialBT;
|
||||
extern MSerialBT bluetoothSerial;
|
||||
#endif
|
||||
|
@@ -168,6 +168,51 @@ void setup_endstop_interrupts() {
|
||||
pciSetup(Z_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_I_MAX
|
||||
#if (digitalPinToInterrupt(I_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(I_MAX_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(I_MAX_PIN), "I_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(I_MAX_PIN);
|
||||
#endif
|
||||
#elif HAS_I_MIN
|
||||
#if (digitalPinToInterrupt(I_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(I_MIN_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(I_MIN_PIN), "I_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(I_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_J_MAX
|
||||
#if (digitalPinToInterrupt(J_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(J_MAX_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(J_MAX_PIN), "J_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(J_MAX_PIN);
|
||||
#endif
|
||||
#elif HAS_J_MIN
|
||||
#if (digitalPinToInterrupt(J_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(J_MIN_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(J_MIN_PIN), "J_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(J_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_K_MAX
|
||||
#if (digitalPinToInterrupt(K_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(K_MAX_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(K_MAX_PIN), "K_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(K_MAX_PIN);
|
||||
#endif
|
||||
#elif HAS_K_MIN
|
||||
#if (digitalPinToInterrupt(K_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(K_MIN_PIN);
|
||||
#else
|
||||
static_assert(digitalPinHasPCICR(K_MIN_PIN), "K_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(K_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_X2_MAX
|
||||
#if (digitalPinToInterrupt(X2_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
_ATTACH(X2_MAX_PIN);
|
||||
@@ -256,6 +301,5 @@ void setup_endstop_interrupts() {
|
||||
pciSetup(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
|
||||
}
|
||||
|
@@ -22,11 +22,10 @@
|
||||
#ifdef __AVR__
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
#include "HAL.h"
|
||||
|
||||
#if NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
|
||||
|
||||
#include "HAL.h"
|
||||
|
||||
struct Timer {
|
||||
volatile uint8_t* TCCRnQ[3]; // max 3 TCCR registers per timer
|
||||
volatile uint16_t* OCRnQ[3]; // max 3 OCR registers per timer
|
||||
@@ -55,8 +54,8 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
case TIMER1A: case TIMER1B:
|
||||
#endif
|
||||
break;
|
||||
#if defined(TCCR2) || defined(TCCR2A)
|
||||
#ifdef TCCR2
|
||||
#if HAS_TCCR2 || defined(TCCR2A)
|
||||
#if HAS_TCCR2
|
||||
case TIMER2: {
|
||||
Timer timer = {
|
||||
/*TCCRnQ*/ { &TCCR2, nullptr, nullptr },
|
||||
@@ -153,7 +152,7 @@ Timer get_pwm_timer(const pin_t pin) {
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
Timer timer = get_pwm_timer(pin);
|
||||
if (timer.n == 0) return; // Don't proceed if protected timer or not recognised
|
||||
if (timer.n == 0) return; // Don't proceed if protected timer or not recognized
|
||||
uint16_t size;
|
||||
if (timer.n == 2) size = 255; else size = 65535;
|
||||
|
||||
@@ -201,16 +200,10 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
res = res_temp_fast;
|
||||
j = i;
|
||||
// Set the Wave Generation Mode to FAST PWM
|
||||
if (timer.n == 2) {
|
||||
wgm = (
|
||||
#if ENABLED(USE_OCR2A_AS_TOP)
|
||||
WGM2_FAST_PWM_OCR2A
|
||||
#else
|
||||
WGM2_FAST_PWM
|
||||
#endif
|
||||
);
|
||||
}
|
||||
else wgm = WGM_FAST_PWM_ICRn;
|
||||
if (timer.n == 2)
|
||||
wgm = TERN(USE_OCR2A_AS_TOP, WGM2_FAST_PWM_OCR2A, WGM2_FAST_PWM);
|
||||
else
|
||||
wgm = WGM_FAST_PWM_ICRn;
|
||||
}
|
||||
// If PHASE CORRECT values are closes to desired f
|
||||
else if (f_phase_diff < f_diff) {
|
||||
@@ -218,16 +211,10 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
res = res_temp_phase_correct;
|
||||
j = i;
|
||||
// Set the Wave Generation Mode to PWM PHASE CORRECT
|
||||
if (timer.n == 2) {
|
||||
wgm = (
|
||||
#if ENABLED(USE_OCR2A_AS_TOP)
|
||||
WGM2_PWM_PC_OCR2A
|
||||
#else
|
||||
WGM2_PWM_PC
|
||||
#endif
|
||||
);
|
||||
}
|
||||
else wgm = WGM_PWM_PC_ICRn;
|
||||
if (timer.n == 2)
|
||||
wgm = TERN(USE_OCR2A_AS_TOP, WGM2_PWM_PC_OCR2A, WGM2_FAST_PWM);
|
||||
else
|
||||
wgm = WGM_PWM_PC_ICRn;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -235,48 +222,39 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
_SET_CSn(timer.TCCRnQ, j);
|
||||
|
||||
if (timer.n == 2) {
|
||||
#if ENABLED(USE_OCR2A_AS_TOP)
|
||||
_SET_OCRnQ(timer.OCRnQ, 0, res); // Set OCR2A value (TOP) = res
|
||||
#endif
|
||||
TERN_(USE_OCR2A_AS_TOP, _SET_OCRnQ(timer.OCRnQ, 0, res)); // Set OCR2A value (TOP) = res
|
||||
}
|
||||
else
|
||||
_SET_ICRn(timer.ICRn, res); // Set ICRn value (TOP) = res
|
||||
}
|
||||
|
||||
#endif // NEEDS_HARDWARE_PWM
|
||||
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
// If v is 0 or v_size (max), digitalWrite to LOW or HIGH.
|
||||
// Note that digitalWrite also disables pwm output for us (sets COM bit to 0)
|
||||
if (v == 0)
|
||||
digitalWrite(pin, invert);
|
||||
else if (v == v_size)
|
||||
digitalWrite(pin, !invert);
|
||||
else {
|
||||
Timer timer = get_pwm_timer(pin);
|
||||
if (timer.n == 0) return; // Don't proceed if protected timer or not recognised
|
||||
// Set compare output mode to CLEAR -> SET or SET -> CLEAR (if inverted)
|
||||
_SET_COMnQ(timer.TCCRnQ, (timer.q
|
||||
#ifdef TCCR2
|
||||
+ (timer.q == 2) // COM20 is on bit 4 of TCCR2, thus requires q + 1 in the macro
|
||||
#endif
|
||||
), COM_CLEAR_SET + invert
|
||||
);
|
||||
#if NEEDS_HARDWARE_PWM
|
||||
|
||||
uint16_t top;
|
||||
if (timer.n == 2) { // if TIMER2
|
||||
top = (
|
||||
#if ENABLED(USE_OCR2A_AS_TOP)
|
||||
*timer.OCRnQ[0] // top = OCR2A
|
||||
#else
|
||||
255 // top = 0xFF (max)
|
||||
#endif
|
||||
);
|
||||
// If v is 0 or v_size (max), digitalWrite to LOW or HIGH.
|
||||
// Note that digitalWrite also disables pwm output for us (sets COM bit to 0)
|
||||
if (v == 0)
|
||||
digitalWrite(pin, invert);
|
||||
else if (v == v_size)
|
||||
digitalWrite(pin, !invert);
|
||||
else {
|
||||
Timer timer = get_pwm_timer(pin);
|
||||
if (timer.n == 0) return; // Don't proceed if protected timer or not recognized
|
||||
// Set compare output mode to CLEAR -> SET or SET -> CLEAR (if inverted)
|
||||
_SET_COMnQ(timer.TCCRnQ, timer.q TERN_(HAS_TCCR2, + (timer.q == 2)), COM_CLEAR_SET + invert); // COM20 is on bit 4 of TCCR2, so +1 for q==2
|
||||
const uint16_t top = timer.n == 2 ? TERN(USE_OCR2A_AS_TOP, *timer.OCRnQ[0], 255) : *timer.ICRn;
|
||||
_SET_OCRnQ(timer.OCRnQ, timer.q, uint16_t(uint32_t(v) * top / v_size)); // Scale 8/16-bit v to top value
|
||||
}
|
||||
else
|
||||
top = *timer.ICRn; // top = ICRn
|
||||
|
||||
_SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top) / float(v_size)); // Scale 8/16-bit v to top value
|
||||
}
|
||||
#else
|
||||
|
||||
analogWrite(pin, v);
|
||||
UNUSED(v_size);
|
||||
UNUSED(invert);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // NEEDS_HARDWARE_PWM
|
||||
#endif // __AVR__
|
||||
|
@@ -267,11 +267,11 @@ uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb
|
||||
SET_WGM(5, FAST_PWM_ICRn); // Fast PWM with ICR5 as TOP
|
||||
|
||||
//SERIAL_ECHOLNPGM("Timer 5 Settings:");
|
||||
//SERIAL_ECHOLNPAIR(" Prescaler=", prescaler);
|
||||
//SERIAL_ECHOLNPAIR(" TOP=", ICR5);
|
||||
//SERIAL_ECHOLNPAIR(" OCR5A=", OCR5A);
|
||||
//SERIAL_ECHOLNPAIR(" OCR5B=", OCR5B);
|
||||
//SERIAL_ECHOLNPAIR(" OCR5C=", OCR5C);
|
||||
//SERIAL_ECHOLNPGM(" Prescaler=", prescaler);
|
||||
//SERIAL_ECHOLNPGM(" TOP=", ICR5);
|
||||
//SERIAL_ECHOLNPGM(" OCR5A=", OCR5A);
|
||||
//SERIAL_ECHOLNPGM(" OCR5B=", OCR5B);
|
||||
//SERIAL_ECHOLNPGM(" OCR5C=", OCR5C);
|
||||
}
|
||||
else {
|
||||
// Restore the default for Timer 5
|
||||
|
@@ -211,32 +211,32 @@ enum ClockSource2 : char {
|
||||
|
||||
// Set Clock Select bits
|
||||
// Ex: SET_CS3(PRESCALER_64);
|
||||
#ifdef TCCR2
|
||||
#define HAS_TCCR2 1
|
||||
#endif
|
||||
#define _SET_CS(T,V) (TCCR##T##B = (TCCR##T##B & ~(0x7 << CS##T##0)) | ((int(V) & 0x7) << CS##T##0))
|
||||
#define _SET_CS0(V) _SET_CS(0,V)
|
||||
#define _SET_CS1(V) _SET_CS(1,V)
|
||||
#ifdef TCCR2
|
||||
#define _SET_CS2(V) (TCCR2 = (TCCR2 & ~(0x7 << CS20)) | (int(V) << CS20))
|
||||
#else
|
||||
#define _SET_CS2(V) _SET_CS(2,V)
|
||||
#endif
|
||||
#define _SET_CS3(V) _SET_CS(3,V)
|
||||
#define _SET_CS4(V) _SET_CS(4,V)
|
||||
#define _SET_CS5(V) _SET_CS(5,V)
|
||||
#define SET_CS0(V) _SET_CS0(CS_##V)
|
||||
#define SET_CS1(V) _SET_CS1(CS_##V)
|
||||
#ifdef TCCR2
|
||||
|
||||
#if HAS_TCCR2
|
||||
#define _SET_CS2(V) (TCCR2 = (TCCR2 & ~(0x7 << CS20)) | (int(V) << CS20))
|
||||
#define SET_CS2(V) _SET_CS2(CS2_##V)
|
||||
#else
|
||||
#define _SET_CS2(V) _SET_CS(2,V)
|
||||
#define SET_CS2(V) _SET_CS2(CS_##V)
|
||||
#endif
|
||||
|
||||
#define SET_CS3(V) _SET_CS3(CS_##V)
|
||||
#define SET_CS4(V) _SET_CS4(CS_##V)
|
||||
#define SET_CS5(V) _SET_CS5(CS_##V)
|
||||
#define SET_CS(T,V) SET_CS##T(V)
|
||||
// Runtime (see set_pwm_frequency)
|
||||
#define _SET_CSn(TCCRnQ, V) do{ \
|
||||
(*(TCCRnQ)[1] = (*(TCCRnQ[1]) & ~(0x7 << 0)) | ((int(V) & 0x7) << 0)); \
|
||||
}while(0)
|
||||
#define _SET_CSn(TCCRnQ, V) (*(TCCRnQ)[1] = (*(TCCRnQ[1]) & ~(0x7 << 0)) | ((int(V) & 0x7) << 0))
|
||||
|
||||
// Set Compare Mode bits
|
||||
// Ex: SET_COMS(4,CLEAR_SET,CLEAR_SET,CLEAR_SET);
|
||||
@@ -247,21 +247,15 @@ enum ClockSource2 : char {
|
||||
#define SET_COMC(T,V) SET_COM(T,C,V)
|
||||
#define SET_COMS(T,V1,V2,V3) do{ SET_COMA(T,V1); SET_COMB(T,V2); SET_COMC(T,V3); }while(0)
|
||||
// Runtime (see set_pwm_duty)
|
||||
#define _SET_COMnQ(TCCRnQ, Q, V) do{ \
|
||||
(*(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << (6-2*(Q)))) | (int(V) << (6-2*(Q)))); \
|
||||
}while(0)
|
||||
#define _SET_COMnQ(TCCRnQ, Q, V) (*(TCCRnQ)[0] = (*(TCCRnQ)[0] & ~(0x3 << (6-2*(Q)))) | (int(V) << (6-2*(Q))))
|
||||
|
||||
// Set OCRnQ register
|
||||
// Runtime (see set_pwm_duty):
|
||||
#define _SET_OCRnQ(OCRnQ, Q, V) do{ \
|
||||
(*(OCRnQ)[(Q)] = (0x0000) | (int(V) & 0xFFFF)); \
|
||||
}while(0)
|
||||
#define _SET_OCRnQ(OCRnQ, Q, V) (*(OCRnQ)[Q] = int(V) & 0xFFFF)
|
||||
|
||||
// Set ICRn register (one per timer)
|
||||
// Runtime (see set_pwm_frequency)
|
||||
#define _SET_ICRn(ICRn, V) do{ \
|
||||
(*(ICRn) = (0x0000) | (int(V) & 0xFFFF)); \
|
||||
}while(0)
|
||||
#define _SET_ICRn(ICRn, V) (*(ICRn) = int(V) & 0xFFFF)
|
||||
|
||||
// Set Noise Canceler bit
|
||||
// Ex: SET_ICNC(2,1)
|
||||
@@ -284,7 +278,7 @@ enum ClockSource2 : char {
|
||||
* PWM availability macros
|
||||
*/
|
||||
|
||||
// Determine which harware PWMs are already in use
|
||||
// Determine which hardware PWMs are already in use
|
||||
#define _PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == E6_AUTO_FAN_PIN || P == E7_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN || P == COOLER_AUTO_FAN_PIN)
|
||||
#if PIN_EXISTS(CONTROLLER_FAN)
|
||||
#define PWM_CHK_FAN_B(P) (_PWM_CHK_FAN_B(P) || P == CONTROLLER_FAN_PIN)
|
||||
|
@@ -28,14 +28,14 @@
|
||||
/**
|
||||
* Checks for FAST PWM
|
||||
*/
|
||||
#if ENABLED(FAST_PWM_FAN) && (ENABLED(USE_OCR2A_AS_TOP) && defined(TCCR2))
|
||||
#if ALL(FAST_PWM_FAN, USE_OCR2A_AS_TOP, HAS_TCCR2)
|
||||
#error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Sanity checks for Spindle / Laser PWM
|
||||
*/
|
||||
#if ENABLED(SPINDLE_LASER_PWM)
|
||||
#if ENABLED(SPINDLE_LASER_USE_PWM)
|
||||
#include "../ServoTimers.h" // Needed to check timer availability (_useTimer3)
|
||||
#if SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13)
|
||||
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt."
|
||||
@@ -43,7 +43,7 @@
|
||||
#error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
|
||||
#endif
|
||||
#elif defined(SPINDLE_LASER_FREQUENCY)
|
||||
#error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_PWM."
|
||||
#error "SPINDLE_LASER_FREQUENCY requires SPINDLE_LASER_USE_PWM."
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@@ -2,6 +2,9 @@
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
@@ -38,7 +41,7 @@
|
||||
// portModeRegister takes a different argument
|
||||
#define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
|
||||
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
|
||||
#define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p)
|
||||
#define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
|
||||
#define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))
|
||||
|
||||
#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70
|
||||
@@ -99,7 +102,7 @@ void PRINT_ARRAY_NAME(uint8_t x) {
|
||||
return true; \
|
||||
} else return false
|
||||
|
||||
|
||||
#define ABTEST(N) defined(TCCR##N##A) && defined(COM##N##A1)
|
||||
|
||||
/**
|
||||
* Print a pin's PWM status.
|
||||
@@ -110,7 +113,7 @@ static bool pwm_status(uint8_t pin) {
|
||||
|
||||
switch (digitalPinToTimer_DEBUG(pin)) {
|
||||
|
||||
#if defined(TCCR0A) && defined(COM0A1)
|
||||
#if ABTEST(0)
|
||||
#ifdef TIMER0A
|
||||
#if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs
|
||||
PWM_CASE(0, A);
|
||||
@@ -119,20 +122,20 @@ static bool pwm_status(uint8_t pin) {
|
||||
PWM_CASE(0, B);
|
||||
#endif
|
||||
|
||||
#if defined(TCCR1A) && defined(COM1A1)
|
||||
#if ABTEST(1)
|
||||
PWM_CASE(1, A);
|
||||
PWM_CASE(1, B);
|
||||
#if defined(COM1C1) && defined(TIMER1C)
|
||||
PWM_CASE(1, C);
|
||||
#endif
|
||||
#if defined(COM1C1) && defined(TIMER1C)
|
||||
PWM_CASE(1, C);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(TCCR2A) && defined(COM2A1)
|
||||
#if ABTEST(2)
|
||||
PWM_CASE(2, A);
|
||||
PWM_CASE(2, B);
|
||||
#endif
|
||||
|
||||
#if defined(TCCR3A) && defined(COM3A1)
|
||||
#if ABTEST(3)
|
||||
PWM_CASE(3, A);
|
||||
PWM_CASE(3, B);
|
||||
#ifdef COM3C1
|
||||
@@ -146,7 +149,7 @@ static bool pwm_status(uint8_t pin) {
|
||||
PWM_CASE(4, C);
|
||||
#endif
|
||||
|
||||
#if defined(TCCR5A) && defined(COM5A1)
|
||||
#if ABTEST(5)
|
||||
PWM_CASE(5, A);
|
||||
PWM_CASE(5, B);
|
||||
PWM_CASE(5, C);
|
||||
@@ -163,16 +166,16 @@ static bool pwm_status(uint8_t pin) {
|
||||
const volatile uint8_t* const PWM_other[][3] PROGMEM = {
|
||||
{ &TCCR0A, &TCCR0B, &TIMSK0 },
|
||||
{ &TCCR1A, &TCCR1B, &TIMSK1 },
|
||||
#if defined(TCCR2A) && defined(COM2A1)
|
||||
#if ABTEST(2)
|
||||
{ &TCCR2A, &TCCR2B, &TIMSK2 },
|
||||
#endif
|
||||
#if defined(TCCR3A) && defined(COM3A1)
|
||||
#if ABTEST(3)
|
||||
{ &TCCR3A, &TCCR3B, &TIMSK3 },
|
||||
#endif
|
||||
#ifdef TCCR4A
|
||||
{ &TCCR4A, &TCCR4B, &TIMSK4 },
|
||||
#endif
|
||||
#if defined(TCCR5A) && defined(COM5A1)
|
||||
#if ABTEST(5)
|
||||
{ &TCCR5A, &TCCR5B, &TIMSK5 },
|
||||
#endif
|
||||
};
|
||||
@@ -192,11 +195,11 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
|
||||
{ (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, 0 },
|
||||
#endif
|
||||
|
||||
#if defined(TCCR2A) && defined(COM2A1)
|
||||
#if ABTEST(2)
|
||||
{ &OCR2A, &OCR2B, 0 },
|
||||
#endif
|
||||
|
||||
#if defined(TCCR3A) && defined(COM3A1)
|
||||
#if ABTEST(3)
|
||||
#ifdef COM3C1
|
||||
{ (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, (const uint8_t*)&OCR3C },
|
||||
#else
|
||||
@@ -208,7 +211,7 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
|
||||
{ (const uint8_t*)&OCR4A, (const uint8_t*)&OCR4B, (const uint8_t*)&OCR4C },
|
||||
#endif
|
||||
|
||||
#if defined(TCCR5A) && defined(COM5A1)
|
||||
#if ABTEST(5)
|
||||
{ (const uint8_t*)&OCR5A, (const uint8_t*)&OCR5B, (const uint8_t*)&OCR5C },
|
||||
#endif
|
||||
};
|
||||
@@ -235,9 +238,9 @@ static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin");
|
||||
|
||||
inline void com_print(const uint8_t N, const uint8_t Z) {
|
||||
const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
|
||||
SERIAL_ECHOPAIR(" COM", AS_CHAR('0' + N));
|
||||
SERIAL_ECHOPGM(" COM", AS_DIGIT(N));
|
||||
SERIAL_CHAR(Z);
|
||||
SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
|
||||
SERIAL_ECHOPGM(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03));
|
||||
}
|
||||
|
||||
void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - WGM bit layout
|
||||
@@ -247,7 +250,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
|
||||
uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1))));
|
||||
if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
|
||||
|
||||
SERIAL_ECHOPAIR(" TIMER", AS_CHAR(T + '0'));
|
||||
SERIAL_ECHOPGM(" TIMER", AS_DIGIT(T));
|
||||
SERIAL_CHAR(L);
|
||||
SERIAL_ECHO_SP(3);
|
||||
|
||||
@@ -259,14 +262,14 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
|
||||
const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A');
|
||||
PWM_PRINT(*OCRVAL16);
|
||||
}
|
||||
SERIAL_ECHOPAIR(" WGM: ", WGM);
|
||||
SERIAL_ECHOPGM(" WGM: ", WGM);
|
||||
com_print(T,L);
|
||||
SERIAL_ECHOPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
|
||||
SERIAL_ECHOPAIR(" TCCR", AS_CHAR(T + '0'), "A: ", *TCCRA);
|
||||
SERIAL_ECHOPAIR(" TCCR", AS_CHAR(T + '0'), "B: ", *TCCRB);
|
||||
SERIAL_ECHOPGM(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
|
||||
SERIAL_ECHOPGM(" TCCR", AS_DIGIT(T), "A: ", *TCCRA);
|
||||
SERIAL_ECHOPGM(" TCCR", AS_DIGIT(T), "B: ", *TCCRB);
|
||||
|
||||
const uint8_t *TMSK = (uint8_t*)TIMSK(T);
|
||||
SERIAL_ECHOPAIR(" TIMSK", AS_CHAR(T + '0'), ": ", *TMSK);
|
||||
SERIAL_ECHOPGM(" TIMSK", AS_DIGIT(T), ": ", *TMSK);
|
||||
|
||||
const uint8_t OCIE = L - 'A' + 1;
|
||||
if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); }
|
||||
@@ -278,7 +281,7 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N -
|
||||
static void pwm_details(uint8_t pin) {
|
||||
switch (digitalPinToTimer_DEBUG(pin)) {
|
||||
|
||||
#if defined(TCCR0A) && defined(COM0A1)
|
||||
#if ABTEST(0)
|
||||
#ifdef TIMER0A
|
||||
#if !AVR_AT90USB1286_FAMILY // not available in Teensyduino type IDEs
|
||||
case TIMER0A: timer_prefix(0, 'A', 3); break;
|
||||
@@ -287,7 +290,7 @@ static void pwm_details(uint8_t pin) {
|
||||
case TIMER0B: timer_prefix(0, 'B', 3); break;
|
||||
#endif
|
||||
|
||||
#if defined(TCCR1A) && defined(COM1A1)
|
||||
#if ABTEST(1)
|
||||
case TIMER1A: timer_prefix(1, 'A', 4); break;
|
||||
case TIMER1B: timer_prefix(1, 'B', 4); break;
|
||||
#if defined(COM1C1) && defined(TIMER1C)
|
||||
@@ -295,12 +298,12 @@ static void pwm_details(uint8_t pin) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(TCCR2A) && defined(COM2A1)
|
||||
#if ABTEST(2)
|
||||
case TIMER2A: timer_prefix(2, 'A', 3); break;
|
||||
case TIMER2B: timer_prefix(2, 'B', 3); break;
|
||||
#endif
|
||||
|
||||
#if defined(TCCR3A) && defined(COM3A1)
|
||||
#if ABTEST(3)
|
||||
case TIMER3A: timer_prefix(3, 'A', 4); break;
|
||||
case TIMER3B: timer_prefix(3, 'B', 4); break;
|
||||
#ifdef COM3C1
|
||||
@@ -314,7 +317,7 @@ static void pwm_details(uint8_t pin) {
|
||||
case TIMER4C: timer_prefix(4, 'C', 4); break;
|
||||
#endif
|
||||
|
||||
#if defined(TCCR5A) && defined(COM5A1)
|
||||
#if ABTEST(5)
|
||||
case TIMER5A: timer_prefix(5, 'A', 4); break;
|
||||
case TIMER5B: timer_prefix(5, 'B', 4); break;
|
||||
case TIMER5C: timer_prefix(5, 'C', 4); break;
|
||||
@@ -348,7 +351,6 @@ static void pwm_details(uint8_t pin) {
|
||||
#endif
|
||||
} // pwm_details
|
||||
|
||||
|
||||
#ifndef digitalRead_mod // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs
|
||||
int digitalRead_mod(const int8_t pin) { // same as digitalRead except the PWM stop section has been removed
|
||||
const uint8_t port = digitalPinToPort_DEBUG(pin);
|
||||
@@ -393,3 +395,6 @@ static void pwm_details(uint8_t pin) {
|
||||
#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)
|
||||
|
||||
#undef ABTEST
|
||||
|
@@ -2,6 +2,9 @@
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
|
@@ -2,6 +2,9 @@
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
|
@@ -34,14 +34,14 @@ typedef uint16_t hal_timer_t;
|
||||
|
||||
#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz
|
||||
|
||||
#ifndef STEP_TIMER_NUM
|
||||
#define STEP_TIMER_NUM 1
|
||||
#ifndef MF_TIMER_STEP
|
||||
#define MF_TIMER_STEP 1
|
||||
#endif
|
||||
#ifndef PULSE_TIMER_NUM
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#ifndef MF_TIMER_PULSE
|
||||
#define MF_TIMER_PULSE MF_TIMER_STEP
|
||||
#endif
|
||||
#ifndef TEMP_TIMER_NUM
|
||||
#define TEMP_TIMER_NUM 0
|
||||
#ifndef MF_TIMER_TEMP
|
||||
#define MF_TIMER_TEMP 0
|
||||
#endif
|
||||
|
||||
#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0)
|
||||
@@ -64,7 +64,7 @@ typedef uint16_t hal_timer_t;
|
||||
|
||||
FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
|
||||
switch (timer_num) {
|
||||
case STEP_TIMER_NUM:
|
||||
case MF_TIMER_STEP:
|
||||
// waveform generation = 0100 = CTC
|
||||
SET_WGM(1, CTC_OCRnA);
|
||||
|
||||
@@ -84,7 +84,7 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
|
||||
TCNT1 = 0;
|
||||
break;
|
||||
|
||||
case TEMP_TIMER_NUM:
|
||||
case MF_TIMER_TEMP:
|
||||
// Use timer0 for temperature measurement
|
||||
// Interleave temperature interrupt with millies interrupt
|
||||
OCR0B = 128;
|
||||
@@ -109,8 +109,8 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
|
||||
* (otherwise, characters will be lost due to UART overflow).
|
||||
* Then: Stepper, Endstops, Temperature, and -finally- all others.
|
||||
*/
|
||||
#define HAL_timer_isr_prologue(TIMER_NUM)
|
||||
#define HAL_timer_isr_epilogue(TIMER_NUM)
|
||||
#define HAL_timer_isr_prologue(T)
|
||||
#define HAL_timer_isr_epilogue(T)
|
||||
|
||||
/* 18 cycles maximum latency */
|
||||
#ifndef HAL_STEP_TIMER_ISR
|
||||
|
@@ -62,10 +62,10 @@
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/Delay.h"
|
||||
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
|
||||
uint8_t u8g_bitData, u8g_bitNotData, u8g_bitClock, u8g_bitNotClock;
|
||||
volatile uint8_t *u8g_outData, *u8g_outClock;
|
||||
static uint8_t u8g_bitData, u8g_bitNotData, u8g_bitClock, u8g_bitNotClock;
|
||||
static volatile uint8_t *u8g_outData, *u8g_outClock;
|
||||
|
||||
static void u8g_com_arduino_init_shift_out(uint8_t dataPin, uint8_t clockPin) {
|
||||
u8g_outData = portOutputRegister(digitalPinToPort(dataPin));
|
||||
|
@@ -50,13 +50,12 @@ extern DefaultSerial4 MSerial3;
|
||||
#define _MSERIAL(X) MSerial##X
|
||||
#define MSERIAL(X) _MSERIAL(X)
|
||||
|
||||
// Define MYSERIAL1/2 before MarlinSerial includes!
|
||||
#if SERIAL_PORT == -1 || ENABLED(EMERGENCY_PARSER)
|
||||
#define MYSERIAL1 customizedSerial1
|
||||
#elif WITHIN(SERIAL_PORT, 0, 3)
|
||||
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
|
||||
#else
|
||||
#error "The required SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#error "The required SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_2
|
||||
@@ -65,7 +64,17 @@ extern DefaultSerial4 MSerial3;
|
||||
#elif WITHIN(SERIAL_PORT_2, 0, 3)
|
||||
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
|
||||
#else
|
||||
#error "SERIAL_PORT_2 must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#error "SERIAL_PORT_2 must be from 0 to 3, or -1 for USB Serial."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_3
|
||||
#if SERIAL_PORT_3 == -1 || ENABLED(EMERGENCY_PARSER)
|
||||
#define MYSERIAL3 customizedSerial3
|
||||
#elif WITHIN(SERIAL_PORT_3, 0, 3)
|
||||
#define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
|
||||
#else
|
||||
#error "SERIAL_PORT_3 must be from 0 to 3, or -1 for USB Serial."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -78,12 +87,10 @@ extern DefaultSerial4 MSerial3;
|
||||
#endif
|
||||
|
||||
#ifdef LCD_SERIAL_PORT
|
||||
#if LCD_SERIAL_PORT == -1
|
||||
#define LCD_SERIAL lcdSerial
|
||||
#elif WITHIN(LCD_SERIAL_PORT, 0, 3)
|
||||
#if WITHIN(LCD_SERIAL_PORT, 0, 3)
|
||||
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -137,6 +144,11 @@ inline void HAL_adc_init() {}//todo
|
||||
void HAL_adc_start_conversion(const uint8_t ch);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
//
|
||||
// PWM
|
||||
//
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
//
|
||||
// Pin Map
|
||||
//
|
||||
@@ -161,16 +173,14 @@ void HAL_init();
|
||||
//
|
||||
void _delay_ms(const int delay);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
|
||||
int freeMemory();
|
||||
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@@ -240,7 +240,7 @@
|
||||
}
|
||||
|
||||
// all the others
|
||||
static uint32_t spiDelayCyclesX4 = 4 * (F_CPU) / 1000000; // 4µs => 125khz
|
||||
static uint16_t spiDelayNS = 4000; // 4000ns => 125khz
|
||||
|
||||
static uint8_t spiTransferX(uint8_t b) { // using Mode 0
|
||||
int bits = 8;
|
||||
@@ -249,12 +249,12 @@
|
||||
b <<= 1; // little setup time
|
||||
|
||||
WRITE(SD_SCK_PIN, HIGH);
|
||||
DELAY_CYCLES(spiDelayCyclesX4);
|
||||
DELAY_NS(spiDelayNS);
|
||||
|
||||
b |= (READ(SD_MISO_PIN) != 0);
|
||||
|
||||
WRITE(SD_SCK_PIN, LOW);
|
||||
DELAY_CYCLES(spiDelayCyclesX4);
|
||||
DELAY_NS(spiDelayNS);
|
||||
} while (--bits);
|
||||
return b;
|
||||
}
|
||||
@@ -437,7 +437,7 @@
|
||||
} while (--todo);
|
||||
}
|
||||
|
||||
// Pointers to generic functions for block tranfers
|
||||
// Pointers to generic functions for block transfers
|
||||
static pfnSpiTxBlock spiTxBlock = (pfnSpiTxBlock)spiTxBlockX;
|
||||
static pfnSpiRxBlock spiRxBlock = (pfnSpiRxBlock)spiRxBlockX;
|
||||
|
||||
@@ -510,7 +510,7 @@
|
||||
spiRxBlock = (pfnSpiRxBlock)spiRxBlockX;
|
||||
break;
|
||||
default:
|
||||
spiDelayCyclesX4 = ((F_CPU) / 1000000) >> (6 - spiRate) << 2; // spiRate of 2 gives the maximum error with current CPU
|
||||
spiDelayNS = 4000 >> (6 - spiRate); // spiRate of 2 gives the maximum error with current CPU
|
||||
spiTransferTx = (pfnSpiTransfer)spiTransferX;
|
||||
spiTransferRx = (pfnSpiTransfer)spiTransferX;
|
||||
spiTxBlock = (pfnSpiTxBlock)spiTxBlockX;
|
||||
@@ -594,18 +594,14 @@
|
||||
SPI_Configure(SPI0, ID_SPI0, SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_MR_PS);
|
||||
SPI_Enable(SPI0);
|
||||
|
||||
SET_OUTPUT(DAC0_SYNC);
|
||||
SET_OUTPUT(DAC0_SYNC_PIN);
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
SET_OUTPUT(DAC1_SYNC);
|
||||
WRITE(DAC1_SYNC, HIGH);
|
||||
OUT_WRITE(DAC1_SYNC_PIN, HIGH);
|
||||
#endif
|
||||
SET_OUTPUT(SPI_EEPROM1_CS);
|
||||
SET_OUTPUT(SPI_EEPROM2_CS);
|
||||
SET_OUTPUT(SPI_FLASH_CS);
|
||||
WRITE(DAC0_SYNC, HIGH);
|
||||
WRITE(SPI_EEPROM1_CS, HIGH);
|
||||
WRITE(SPI_EEPROM2_CS, HIGH);
|
||||
WRITE(SPI_FLASH_CS, HIGH);
|
||||
WRITE(DAC0_SYNC_PIN, HIGH);
|
||||
OUT_WRITE(SPI_EEPROM1_CS_PIN, HIGH);
|
||||
OUT_WRITE(SPI_EEPROM2_CS_PIN, HIGH);
|
||||
OUT_WRITE(SPI_FLASH_CS_PIN, HIGH);
|
||||
WRITE(SD_SS_PIN, HIGH);
|
||||
|
||||
OUT_WRITE(SDSS, LOW);
|
||||
|
26
Marlin/src/HAL/DUE/MarlinSPI.h
Normal file
26
Marlin/src/HAL/DUE/MarlinSPI.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
using MarlinSPI = SPIClass;
|
@@ -478,7 +478,7 @@ void MarlinSerial<Cfg>::flushTX() {
|
||||
// If not using the USB port as serial port
|
||||
#if defined(SERIAL_PORT) && SERIAL_PORT >= 0
|
||||
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT> >;
|
||||
MSerialT customizedSerial1(MarlinSerialCfg<SERIAL_PORT>::EMERGENCYPARSER);
|
||||
MSerialT1 customizedSerial1(MarlinSerialCfg<SERIAL_PORT>::EMERGENCYPARSER);
|
||||
#endif
|
||||
|
||||
#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0
|
||||
@@ -486,4 +486,9 @@ void MarlinSerial<Cfg>::flushTX() {
|
||||
MSerialT2 customizedSerial2(MarlinSerialCfg<SERIAL_PORT_2>::EMERGENCYPARSER);
|
||||
#endif
|
||||
|
||||
#if defined(SERIAL_PORT_3) && SERIAL_PORT_3 >= 0
|
||||
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT_3> >;
|
||||
MSerialT3 customizedSerial3(MarlinSerialCfg<SERIAL_PORT_3>::EMERGENCYPARSER);
|
||||
#endif
|
||||
|
||||
#endif // ARDUINO_ARCH_SAM
|
||||
|
@@ -141,11 +141,16 @@ struct MarlinSerialCfg {
|
||||
};
|
||||
|
||||
#if defined(SERIAL_PORT) && SERIAL_PORT >= 0
|
||||
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT> > > MSerialT;
|
||||
extern MSerialT customizedSerial1;
|
||||
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT> > > MSerialT1;
|
||||
extern MSerialT1 customizedSerial1;
|
||||
#endif
|
||||
|
||||
#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0
|
||||
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT_2> > > MSerialT2;
|
||||
extern MSerialT2 customizedSerial2;
|
||||
#endif
|
||||
|
||||
#if defined(SERIAL_PORT_3) && SERIAL_PORT_3 >= 0
|
||||
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT_3> > > MSerialT3;
|
||||
extern MSerialT3 customizedSerial3;
|
||||
#endif
|
||||
|
@@ -19,13 +19,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
|
||||
/**
|
||||
* MarlinSerial_Due.cpp - Hardware serial library for Arduino DUE
|
||||
* Copyright (c) 2017 Eduardo José Tagle. All right reserved
|
||||
* Based on MarlinSerial for AVR, copyright (c) 2006 Nicholas Zambetti. All right reserved.
|
||||
*/
|
||||
#ifdef ARDUINO_ARCH_SAM
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
@@ -65,7 +65,7 @@ int MarlinSerialUSB::peek() {
|
||||
|
||||
pending_char = udi_cdc_getc();
|
||||
|
||||
TERN_(EMERGENCY_PARSER, emergency_parser.update(static_cast<MSerialT*>(this)->emergency_state, (char)pending_char));
|
||||
TERN_(EMERGENCY_PARSER, emergency_parser.update(static_cast<MSerialT1*>(this)->emergency_state, (char)pending_char));
|
||||
|
||||
return pending_char;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ int MarlinSerialUSB::read() {
|
||||
|
||||
int c = udi_cdc_getc();
|
||||
|
||||
TERN_(EMERGENCY_PARSER, emergency_parser.update(static_cast<MSerialT*>(this)->emergency_state, (char)c));
|
||||
TERN_(EMERGENCY_PARSER, emergency_parser.update(static_cast<MSerialT1*>(this)->emergency_state, (char)c));
|
||||
|
||||
return c;
|
||||
}
|
||||
@@ -129,10 +129,13 @@ size_t MarlinSerialUSB::write(const uint8_t c) {
|
||||
|
||||
// Preinstantiate
|
||||
#if SERIAL_PORT == -1
|
||||
MSerialT customizedSerial1(TERN0(EMERGENCY_PARSER, true));
|
||||
MSerialT1 customizedSerial1(TERN0(EMERGENCY_PARSER, true));
|
||||
#endif
|
||||
#if SERIAL_PORT_2 == -1
|
||||
MSerialT customizedSerial2(TERN0(EMERGENCY_PARSER, true));
|
||||
MSerialT2 customizedSerial2(TERN0(EMERGENCY_PARSER, true));
|
||||
#endif
|
||||
#if SERIAL_PORT_3 == -1
|
||||
MSerialT3 customizedSerial3(TERN0(EMERGENCY_PARSER, true));
|
||||
#endif
|
||||
|
||||
#endif // HAS_USB_SERIAL
|
||||
|
@@ -27,11 +27,9 @@
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#if HAS_USB_SERIAL
|
||||
|
||||
#include <WString.h>
|
||||
#include "../../core/serial_hook.h"
|
||||
|
||||
#include <WString.h>
|
||||
|
||||
struct MarlinSerialUSB {
|
||||
void begin(const long);
|
||||
@@ -50,14 +48,18 @@ struct MarlinSerialUSB {
|
||||
FORCE_INLINE int rxMaxEnqueued() { return 0; }
|
||||
#endif
|
||||
};
|
||||
typedef Serial1Class<MarlinSerialUSB> MSerialT;
|
||||
|
||||
#if SERIAL_PORT == -1
|
||||
extern MSerialT customizedSerial1;
|
||||
typedef Serial1Class<MarlinSerialUSB> MSerialT1;
|
||||
extern MSerialT1 customizedSerial1;
|
||||
#endif
|
||||
|
||||
#if SERIAL_PORT_2 == -1
|
||||
extern MSerialT customizedSerial2;
|
||||
typedef Serial1Class<MarlinSerialUSB> MSerialT2;
|
||||
extern MSerialT2 customizedSerial2;
|
||||
#endif
|
||||
|
||||
#endif // HAS_USB_SERIAL
|
||||
#if SERIAL_PORT_3 == -1
|
||||
typedef Serial1Class<MarlinSerialUSB> MSerialT3;
|
||||
extern MSerialT3 customizedSerial3;
|
||||
#endif
|
||||
|
@@ -38,17 +38,17 @@ volatile static int32_t toggles;
|
||||
void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration) {
|
||||
tone_pin = _pin;
|
||||
toggles = 2 * frequency * duration / 1000;
|
||||
HAL_timer_start(TONE_TIMER_NUM, 2 * frequency);
|
||||
HAL_timer_start(MF_TIMER_TONE, 2 * frequency);
|
||||
}
|
||||
|
||||
void noTone(const pin_t _pin) {
|
||||
HAL_timer_disable_interrupt(TONE_TIMER_NUM);
|
||||
HAL_timer_disable_interrupt(MF_TIMER_TONE);
|
||||
extDigitalWrite(_pin, LOW);
|
||||
}
|
||||
|
||||
HAL_TONE_TIMER_ISR() {
|
||||
static uint8_t pin_state = 0;
|
||||
HAL_timer_isr_prologue(TONE_TIMER_NUM);
|
||||
HAL_timer_isr_prologue(MF_TIMER_TONE);
|
||||
|
||||
if (toggles) {
|
||||
toggles--;
|
||||
|
@@ -20,7 +20,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Based on u8g_com_msp430_hw_spi.c
|
||||
*
|
||||
@@ -60,7 +59,7 @@
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB
|
||||
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
|
||||
#include "../../../MarlinCore.h"
|
||||
|
||||
|
@@ -57,12 +57,12 @@
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(U8GLIB_ST7920)
|
||||
#if IS_U8GLIB_ST7920
|
||||
|
||||
#include "../../../inc/MarlinConfig.h"
|
||||
#include "../../shared/Delay.h"
|
||||
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
|
||||
#include "u8g_com_HAL_DUE_sw_spi_shared.h"
|
||||
|
||||
@@ -182,5 +182,5 @@ uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va
|
||||
}
|
||||
#endif // LIGHTWEIGHT_UI
|
||||
|
||||
#endif // U8GLIB_ST7920
|
||||
#endif // IS_U8GLIB_ST7920
|
||||
#endif // ARDUINO_ARCH_SAM
|
||||
|
@@ -57,14 +57,14 @@
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920)
|
||||
#if HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920
|
||||
|
||||
#include "u8g_com_HAL_DUE_sw_spi_shared.h"
|
||||
|
||||
#include "../../shared/Marduino.h"
|
||||
#include "../../shared/Delay.h"
|
||||
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_3
|
||||
@@ -141,5 +141,5 @@ uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif // HAS_MARLINUI_U8GLIB && !U8GLIB_ST7920
|
||||
#endif // HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920
|
||||
#endif // ARDUINO_ARCH_SAM
|
||||
|
@@ -62,7 +62,7 @@
|
||||
#include "../../../inc/MarlinConfig.h"
|
||||
#include "../../shared/Delay.h"
|
||||
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
|
||||
#include "u8g_com_HAL_DUE_sw_spi_shared.h"
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "../../../inc/MarlinConfigPre.h"
|
||||
#include "../../shared/Marduino.h"
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
|
||||
void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index);
|
||||
void u8g_SetPILevel_DUE(u8g_t *u8g, uint8_t pin_index, uint8_t level);
|
||||
|
@@ -200,9 +200,9 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
pageContents[i] = (((uint32_t*)data)[i]) | (~(pageContents[i] ^ ((uint32_t*)data)[i]));
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM PageWrite ", page);
|
||||
DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
|
||||
DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
|
||||
DEBUG_ECHOLNPGM("EEPROM PageWrite ", page);
|
||||
DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash);
|
||||
DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0));
|
||||
DEBUG_FLUSH();
|
||||
|
||||
// Get the page relative to the start of the EFC controller, and the EFC controller to use
|
||||
@@ -246,7 +246,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
__enable_irq();
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ", page);
|
||||
DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ", page);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
__enable_irq();
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Write failure for page ", page);
|
||||
DEBUG_ECHOLNPGM("EEPROM Write failure for page ", page);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
|
||||
#ifdef EE_EMU_DEBUG
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Verify Write failure for page ", page);
|
||||
DEBUG_ECHOLNPGM("EEPROM Verify Write failure for page ", page);
|
||||
|
||||
ee_Dump( page, (uint32_t *)addrflash);
|
||||
ee_Dump(-page, data);
|
||||
@@ -306,7 +306,7 @@ static bool ee_PageWrite(uint16_t page, const void *data) {
|
||||
}
|
||||
}
|
||||
}
|
||||
DEBUG_ECHOLNPAIR("--> Differing bits: ", count);
|
||||
DEBUG_ECHOLNPGM("--> Differing bits: ", count);
|
||||
#endif
|
||||
|
||||
return false;
|
||||
@@ -326,9 +326,9 @@ static bool ee_PageErase(uint16_t page) {
|
||||
uint32_t addrflash = uint32_t(getFlashStorage(page));
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM PageErase ", page);
|
||||
DEBUG_ECHOLNPAIR(" in FLASH address ", (uint32_t)addrflash);
|
||||
DEBUG_ECHOLNPAIR(" base address ", (uint32_t)getFlashStorage(0));
|
||||
DEBUG_ECHOLNPGM("EEPROM PageErase ", page);
|
||||
DEBUG_ECHOLNPGM(" in FLASH address ", (uint32_t)addrflash);
|
||||
DEBUG_ECHOLNPGM(" base address ", (uint32_t)getFlashStorage(0));
|
||||
DEBUG_FLUSH();
|
||||
|
||||
// Get the page relative to the start of the EFC controller, and the EFC controller to use
|
||||
@@ -371,7 +371,7 @@ static bool ee_PageErase(uint16_t page) {
|
||||
__enable_irq();
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Unlock failure for page ",page);
|
||||
DEBUG_ECHOLNPGM("EEPROM Unlock failure for page ",page);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -395,7 +395,7 @@ static bool ee_PageErase(uint16_t page) {
|
||||
__enable_irq();
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Erase failure for page ",page);
|
||||
DEBUG_ECHOLNPGM("EEPROM Erase failure for page ",page);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -411,7 +411,7 @@ static bool ee_PageErase(uint16_t page) {
|
||||
for (i = 0; i < PageSize >> 2; i++) {
|
||||
if (*aligned_src++ != 0xFFFFFFFF) {
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Verify Erase failure for page ",page);
|
||||
DEBUG_ECHOLNPGM("EEPROM Verify Erase failure for page ",page);
|
||||
ee_Dump(page, (uint32_t *)addrflash);
|
||||
return false;
|
||||
}
|
||||
@@ -922,7 +922,7 @@ static void ee_Init() {
|
||||
if (curGroup >= GroupCount) curGroup = 0;
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Current Group: ",curGroup);
|
||||
DEBUG_ECHOLNPGM("EEPROM Current Group: ",curGroup);
|
||||
DEBUG_FLUSH();
|
||||
|
||||
// Now, validate that all the other group pages are empty
|
||||
@@ -932,7 +932,7 @@ static void ee_Init() {
|
||||
for (int page = 0; page < PagesPerGroup; page++) {
|
||||
if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
|
||||
DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on group ", grp);
|
||||
DEBUG_FLUSH();
|
||||
ee_PageErase(grp * PagesPerGroup + page);
|
||||
}
|
||||
@@ -949,14 +949,14 @@ static void ee_Init() {
|
||||
}
|
||||
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Active page: ", curPage);
|
||||
DEBUG_ECHOLNPGM("EEPROM Active page: ", curPage);
|
||||
DEBUG_FLUSH();
|
||||
|
||||
// Make sure the pages following the first clean one are also clean
|
||||
for (int page = curPage + 1; page < PagesPerGroup; page++) {
|
||||
if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
|
||||
DEBUG_ECHO_START();
|
||||
DEBUG_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
|
||||
DEBUG_ECHOLNPGM("EEPROM Page ", page, " not clean on active group ", curGroup);
|
||||
DEBUG_FLUSH();
|
||||
ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
|
||||
ee_PageErase(curGroup * PagesPerGroup + page);
|
||||
|
@@ -64,4 +64,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@
|
||||
* For ARDUINO_ARCH_SAM
|
||||
* Note the code here was specifically crafted by disassembling what GCC produces
|
||||
* out of it, so GCC is able to optimize it out as much as possible to the least
|
||||
* amount of instructions. Be very carefull if you modify them, as "clean code"
|
||||
* amount of instructions. Be very careful if you modify them, as "clean code"
|
||||
* leads to less efficient compiled code!!
|
||||
*/
|
||||
|
||||
|
@@ -2,6 +2,9 @@
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
@@ -64,6 +67,7 @@
|
||||
#define 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 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 ? 1 : 0)
|
||||
@@ -86,7 +90,7 @@ bool GET_PINMODE(int8_t pin) { // 1: output, 0: input
|
||||
void pwm_details(int32_t pin) {
|
||||
if (pwm_status(pin)) {
|
||||
uint32_t chan = g_APinDescription[pin].ulPWMChannel;
|
||||
SERIAL_ECHOPAIR("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
|
||||
SERIAL_ECHOPGM("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@
|
||||
// Private Variables
|
||||
// ------------------------
|
||||
|
||||
const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
|
||||
const tTimerConfig timer_config[NUM_HARDWARE_TIMERS] = {
|
||||
{ TC0, 0, TC0_IRQn, 3}, // 0 - [servo timer5]
|
||||
{ TC0, 1, TC1_IRQn, 0}, // 1
|
||||
{ TC0, 2, TC2_IRQn, 2}, // 2 - stepper
|
||||
@@ -66,9 +66,9 @@ const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
|
||||
*/
|
||||
|
||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
||||
Tc *tc = TimerConfig[timer_num].pTimerRegs;
|
||||
IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
|
||||
uint32_t channel = TimerConfig[timer_num].channel;
|
||||
Tc *tc = timer_config[timer_num].pTimerRegs;
|
||||
IRQn_Type irq = timer_config[timer_num].IRQ_Id;
|
||||
uint32_t channel = timer_config[timer_num].channel;
|
||||
|
||||
// Disable interrupt, just in case it was already enabled
|
||||
NVIC_DisableIRQ(irq);
|
||||
@@ -86,7 +86,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
||||
|
||||
pmc_set_writeprotect(false);
|
||||
pmc_enable_periph_clk((uint32_t)irq);
|
||||
NVIC_SetPriority(irq, TimerConfig [timer_num].priority);
|
||||
NVIC_SetPriority(irq, timer_config[timer_num].priority);
|
||||
|
||||
// wave mode, reset counter on match with RC,
|
||||
TC_Configure(tc, channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK1);
|
||||
@@ -105,12 +105,12 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
||||
}
|
||||
|
||||
void HAL_timer_enable_interrupt(const uint8_t timer_num) {
|
||||
IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
|
||||
IRQn_Type irq = timer_config[timer_num].IRQ_Id;
|
||||
NVIC_EnableIRQ(irq);
|
||||
}
|
||||
|
||||
void HAL_timer_disable_interrupt(const uint8_t timer_num) {
|
||||
IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
|
||||
IRQn_Type irq = timer_config[timer_num].IRQ_Id;
|
||||
NVIC_DisableIRQ(irq);
|
||||
|
||||
// We NEED memory barriers to ensure Interrupts are actually disabled!
|
||||
@@ -125,7 +125,7 @@ static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) {
|
||||
}
|
||||
|
||||
bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
|
||||
IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
|
||||
IRQn_Type irq = timer_config[timer_num].IRQ_Id;
|
||||
return NVIC_GetEnabledIRQ(irq);
|
||||
}
|
||||
|
||||
|
@@ -37,35 +37,35 @@ typedef uint32_t hal_timer_t;
|
||||
|
||||
#define HAL_TIMER_RATE ((F_CPU) / 2) // frequency of timers peripherals
|
||||
|
||||
#ifndef STEP_TIMER_NUM
|
||||
#define STEP_TIMER_NUM 2 // Timer Index for Stepper
|
||||
#ifndef MF_TIMER_STEP
|
||||
#define MF_TIMER_STEP 2 // Timer Index for Stepper
|
||||
#endif
|
||||
#ifndef PULSE_TIMER_NUM
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#ifndef MF_TIMER_PULSE
|
||||
#define MF_TIMER_PULSE MF_TIMER_STEP
|
||||
#endif
|
||||
#ifndef TEMP_TIMER_NUM
|
||||
#define TEMP_TIMER_NUM 4 // Timer Index for Temperature
|
||||
#ifndef MF_TIMER_TEMP
|
||||
#define MF_TIMER_TEMP 4 // Timer Index for Temperature
|
||||
#endif
|
||||
#ifndef TONE_TIMER_NUM
|
||||
#define TONE_TIMER_NUM 6 // index of timer to use for beeper tones
|
||||
#ifndef MF_TIMER_TONE
|
||||
#define MF_TIMER_TONE 6 // index of timer to use for beeper tones
|
||||
#endif
|
||||
|
||||
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
|
||||
|
||||
#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
||||
#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US)
|
||||
#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
||||
#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US)
|
||||
|
||||
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
|
||||
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
|
||||
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
|
||||
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
|
||||
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
|
||||
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
|
||||
|
||||
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM)
|
||||
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM)
|
||||
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM)
|
||||
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
|
||||
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
|
||||
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
|
||||
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP)
|
||||
|
||||
#ifndef HAL_STEP_TIMER_ISR
|
||||
#define HAL_STEP_TIMER_ISR() void TC2_Handler()
|
||||
@@ -92,7 +92,7 @@ typedef struct {
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
extern const tTimerConfig TimerConfig[];
|
||||
extern const tTimerConfig timer_config[];
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
@@ -101,17 +101,17 @@ extern const tTimerConfig TimerConfig[];
|
||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||
|
||||
FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
|
||||
const tTimerConfig * const pConfig = &TimerConfig[timer_num];
|
||||
const tTimerConfig * const pConfig = &timer_config[timer_num];
|
||||
pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC = compare;
|
||||
}
|
||||
|
||||
FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
|
||||
const tTimerConfig * const pConfig = &TimerConfig[timer_num];
|
||||
const tTimerConfig * const pConfig = &timer_config[timer_num];
|
||||
return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_RC;
|
||||
}
|
||||
|
||||
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
||||
const tTimerConfig * const pConfig = &TimerConfig[timer_num];
|
||||
const tTimerConfig * const pConfig = &timer_config[timer_num];
|
||||
return pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_CV;
|
||||
}
|
||||
|
||||
@@ -120,9 +120,9 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num);
|
||||
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
|
||||
|
||||
FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
|
||||
const tTimerConfig * const pConfig = &TimerConfig[timer_num];
|
||||
const tTimerConfig * const pConfig = &timer_config[timer_num];
|
||||
// Reading the status register clears the interrupt flag
|
||||
pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_SR;
|
||||
}
|
||||
|
||||
#define HAL_timer_isr_epilogue(TIMER_NUM)
|
||||
#define HAL_timer_isr_epilogue(T)
|
||||
|
@@ -4,15 +4,16 @@
|
||||
# Windows: bossac.exe
|
||||
# Other: leave unchanged
|
||||
#
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
import platform
|
||||
current_OS = platform.system()
|
||||
|
||||
import platform
|
||||
current_OS = platform.system()
|
||||
if current_OS == 'Windows':
|
||||
|
||||
if current_OS == 'Windows':
|
||||
Import("env")
|
||||
|
||||
Import("env")
|
||||
|
||||
# Use bossac.exe on Windows
|
||||
env.Replace(
|
||||
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
|
||||
)
|
||||
# Use bossac.exe on Windows
|
||||
env.Replace(
|
||||
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
|
||||
)
|
||||
|
@@ -71,7 +71,7 @@
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
/**
|
||||
* \page arduino_due_x_board_info "Arduino Due/X - Board informations"
|
||||
* \page arduino_due_x_board_info "Arduino Due/X - Board information"
|
||||
* This page lists several definition related to the board description.
|
||||
*
|
||||
*/
|
||||
|
@@ -74,7 +74,7 @@
|
||||
#define SD_MMC_REMOVING 2
|
||||
|
||||
|
||||
//---- CONTROL FONCTIONS ----
|
||||
//---- CONTROL FUNCTIONS ----
|
||||
//!
|
||||
//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
|
||||
//!/
|
||||
@@ -134,7 +134,7 @@ extern bool sd_mmc_spi_wr_protect(void);
|
||||
extern bool sd_mmc_spi_removal(void);
|
||||
|
||||
|
||||
//---- ACCESS DATA FONCTIONS ----
|
||||
//---- ACCESS DATA FUNCTIONS ----
|
||||
|
||||
#if ACCESS_USB == true
|
||||
// Standard functions for open in read/write mode the device
|
||||
|
@@ -90,7 +90,7 @@ typedef struct {
|
||||
//! This buffer must be word align for DATA IN phase (use prefix COMPILER_WORD_ALIGNED for buffer)
|
||||
uint8_t *payload;
|
||||
|
||||
//! Size of buffer to send or fill, and content the number of byte transfered
|
||||
//! Size of buffer to send or fill, and content the number of byte transferred
|
||||
uint16_t payload_size;
|
||||
|
||||
//! Callback called after reception of ZLP from setup request
|
||||
@@ -132,10 +132,10 @@ typedef void (*udd_callback_halt_cleared_t)(void);
|
||||
*
|
||||
* \param status UDD_EP_TRANSFER_OK, if transfer is complete
|
||||
* \param status UDD_EP_TRANSFER_ABORT, if transfer is aborted
|
||||
* \param n number of data transfered
|
||||
* \param n number of data transferred
|
||||
*/
|
||||
typedef void (*udd_callback_trans_t) (udd_ep_status_t status,
|
||||
iram_size_t nb_transfered, udd_ep_id_t ep);
|
||||
iram_size_t nb_transferred, udd_ep_id_t ep);
|
||||
|
||||
/**
|
||||
* \brief Authorizes the VBUS event
|
||||
@@ -303,7 +303,7 @@ bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
|
||||
* The driver uses a specific DMA USB to transfer data
|
||||
* from internal RAM to endpoint, if this one is available.
|
||||
* When the transfer is finished or aborted (stall, reset, ...), the \a callback is called.
|
||||
* The \a callback returns the transfer status and eventually the number of byte transfered.
|
||||
* The \a callback returns the transfer status and eventually the number of byte transferred.
|
||||
* Note: The control endpoint is not authorized.
|
||||
*
|
||||
* \param ep The ID of the endpoint to use
|
||||
|
@@ -162,7 +162,7 @@ static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep);
|
||||
*
|
||||
* \param status UDD_EP_TRANSFER_OK, if transfer finished
|
||||
* \param status UDD_EP_TRANSFER_ABORT, if transfer aborted
|
||||
* \param n number of data transfered
|
||||
* \param n number of data transferred
|
||||
*/
|
||||
static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep);
|
||||
|
||||
@@ -200,7 +200,7 @@ static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_
|
||||
*
|
||||
* \param status UDD_EP_TRANSFER_OK, if transfer finished
|
||||
* \param status UDD_EP_TRANSFER_ABORT, if transfer aborted
|
||||
* \param n number of data transfered
|
||||
* \param n number of data transferred
|
||||
*/
|
||||
static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep);
|
||||
|
||||
|
@@ -106,7 +106,7 @@ extern "C" {
|
||||
*/
|
||||
//@{
|
||||
# if UDI_CDC_PORT_NB > 2
|
||||
# error USBB, UDP, UDPHS and UOTGHS interfaces have not enought endpoints.
|
||||
# error USBB, UDP, UDPHS and UOTGHS interfaces have not enough endpoints.
|
||||
# endif
|
||||
#define UDI_CDC_DATA_EP_IN_0 (1 | USB_EP_DIR_IN) // TX
|
||||
#define UDI_CDC_DATA_EP_OUT_0 (2 | USB_EP_DIR_OUT) // RX
|
||||
|
@@ -173,7 +173,7 @@ static void udi_msc_cbw_wait(void);
|
||||
*
|
||||
* \param status UDD_EP_TRANSFER_OK, if transfer is finished
|
||||
* \param status UDD_EP_TRANSFER_ABORT, if transfer is aborted
|
||||
* \param nb_received number of data transfered
|
||||
* \param nb_received number of data transferred
|
||||
*/
|
||||
static void udi_msc_cbw_received(udd_ep_status_t status,
|
||||
iram_size_t nb_received, udd_ep_id_t ep);
|
||||
@@ -211,7 +211,7 @@ static void udi_msc_data_send(uint8_t * buffer, uint8_t buf_size);
|
||||
*
|
||||
* \param status UDD_EP_TRANSFER_OK, if transfer finish
|
||||
* \param status UDD_EP_TRANSFER_ABORT, if transfer aborted
|
||||
* \param nb_sent number of data transfered
|
||||
* \param nb_sent number of data transferred
|
||||
*/
|
||||
static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent,
|
||||
udd_ep_id_t ep);
|
||||
@@ -244,7 +244,7 @@ void udi_msc_csw_send(void);
|
||||
*
|
||||
* \param status UDD_EP_TRANSFER_OK, if transfer is finished
|
||||
* \param status UDD_EP_TRANSFER_ABORT, if transfer is aborted
|
||||
* \param nb_sent number of data transfered
|
||||
* \param nb_sent number of data transferred
|
||||
*/
|
||||
static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent,
|
||||
udd_ep_id_t ep);
|
||||
@@ -463,7 +463,7 @@ uint8_t udi_msc_getsetting(void)
|
||||
static void udi_msc_cbw_invalid(void)
|
||||
{
|
||||
if (!udi_msc_b_cbw_invalid)
|
||||
return; // Don't re-stall endpoint if error reseted by setup
|
||||
return; // Don't re-stall endpoint if error reset by setup
|
||||
udd_ep_set_halt(UDI_MSC_EP_OUT);
|
||||
// If stall cleared then re-stall it. Only Setup MSC Reset can clear it
|
||||
udd_ep_wait_stall_clear(UDI_MSC_EP_OUT, udi_msc_cbw_invalid);
|
||||
@@ -472,7 +472,7 @@ static void udi_msc_cbw_invalid(void)
|
||||
static void udi_msc_csw_invalid(void)
|
||||
{
|
||||
if (!udi_msc_b_cbw_invalid)
|
||||
return; // Don't re-stall endpoint if error reseted by setup
|
||||
return; // Don't re-stall endpoint if error reset by setup
|
||||
udd_ep_set_halt(UDI_MSC_EP_IN);
|
||||
// If stall cleared then re-stall it. Only Setup MSC Reset can clear it
|
||||
udd_ep_wait_stall_clear(UDI_MSC_EP_IN, udi_msc_csw_invalid);
|
||||
|
@@ -325,7 +325,7 @@ static void udd_sleep_mode(bool b_idle)
|
||||
/**
|
||||
* \name Control endpoint low level management routine.
|
||||
*
|
||||
* This function performs control endpoint mangement.
|
||||
* This function performs control endpoint management.
|
||||
* It handle the SETUP/DATA/HANDSHAKE phases of a control transaction.
|
||||
*/
|
||||
//@{
|
||||
@@ -397,9 +397,9 @@ static void udd_ctrl_endofrequest(void);
|
||||
/**
|
||||
* \brief Main interrupt routine for control endpoint
|
||||
*
|
||||
* This switchs control endpoint events to correct sub function.
|
||||
* This switches control endpoint events to correct sub function.
|
||||
*
|
||||
* \return \c 1 if an event about control endpoint is occured, otherwise \c 0.
|
||||
* \return \c 1 if an event about control endpoint is occurred, otherwise \c 0.
|
||||
*/
|
||||
static bool udd_ctrl_interrupt(void);
|
||||
|
||||
@@ -410,7 +410,7 @@ static bool udd_ctrl_interrupt(void);
|
||||
* \name Management of bulk/interrupt/isochronous endpoints
|
||||
*
|
||||
* The UDD manages the data transfer on endpoints:
|
||||
* - Start data tranfer on endpoint with USB Device DMA
|
||||
* - Start data transfer on endpoint with USB Device DMA
|
||||
* - Send a ZLP packet if requested
|
||||
* - Call callback registered to signal end of transfer
|
||||
* The transfer abort and stall feature are supported.
|
||||
@@ -431,7 +431,7 @@ typedef struct {
|
||||
uint8_t *buf;
|
||||
//! Size of buffer to send or fill
|
||||
iram_size_t buf_size;
|
||||
//!< Size of data transfered
|
||||
//!< Size of data transferred
|
||||
iram_size_t buf_cnt;
|
||||
//!< Size of data loaded (or prepared for DMA) last time
|
||||
iram_size_t buf_load;
|
||||
@@ -486,7 +486,7 @@ static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_n
|
||||
|
||||
#ifdef UDD_EP_DMA_SUPPORTED
|
||||
/**
|
||||
* \brief Start the next transfer if necessary or complet the job associated.
|
||||
* \brief Start the next transfer if necessary or complete the job associated.
|
||||
*
|
||||
* \param ep endpoint number without direction flag
|
||||
*/
|
||||
@@ -496,9 +496,9 @@ static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_n
|
||||
/**
|
||||
* \brief Main interrupt routine for bulk/interrupt/isochronous endpoints
|
||||
*
|
||||
* This switchs endpoint events to correct sub function.
|
||||
* This switches endpoint events to correct sub function.
|
||||
*
|
||||
* \return \c 1 if an event about bulk/interrupt/isochronous endpoints has occured, otherwise \c 0.
|
||||
* \return \c 1 if an event about bulk/interrupt/isochronous endpoints has occurred, otherwise \c 0.
|
||||
*/
|
||||
static bool udd_ep_interrupt(void);
|
||||
|
||||
@@ -520,7 +520,7 @@ static bool udd_ep_interrupt(void);
|
||||
*
|
||||
* Note:
|
||||
* Here, the global interrupt mask is not clear when an USB interrupt is enabled
|
||||
* because this one can not be occured during the USB ISR (=during INTX is masked).
|
||||
* because this one can not be occurred during the USB ISR (=during INTX is masked).
|
||||
* See Technical reference $3.8.3 Masking interrupt requests in peripheral modules.
|
||||
*/
|
||||
#ifdef UHD_ENABLE
|
||||
@@ -787,7 +787,7 @@ void udd_attach(void)
|
||||
udd_sleep_mode(true);
|
||||
otg_unfreeze_clock();
|
||||
|
||||
// This section of clock check can be improved with a chek of
|
||||
// This section of clock check can be improved with a check of
|
||||
// USB clock source via sysclk()
|
||||
// Check USB clock because the source can be a PLL
|
||||
while (!Is_otg_clock_usable());
|
||||
@@ -803,7 +803,7 @@ void udd_attach(void)
|
||||
#ifdef USB_DEVICE_HS_SUPPORT
|
||||
udd_enable_msof_interrupt();
|
||||
#endif
|
||||
// Reset following interupts flag
|
||||
// Reset following interrupts flag
|
||||
udd_ack_reset();
|
||||
udd_ack_sof();
|
||||
udd_ack_msof();
|
||||
@@ -902,7 +902,7 @@ bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes,
|
||||
}
|
||||
dbg_print("alloc(%x, %d) ", ep, MaxEndpointSize);
|
||||
|
||||
// Bank choise
|
||||
// Bank choice
|
||||
switch (bmAttributes & USB_EP_TYPE_MASK) {
|
||||
case USB_EP_TYPE_ISOCHRONOUS:
|
||||
nb_bank = UDD_ISOCHRONOUS_NB_BANK(ep);
|
||||
@@ -1228,7 +1228,7 @@ bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
|
||||
|
||||
if (Is_udd_endpoint_stall_requested(ep)
|
||||
|| ptr_job->stall_requested) {
|
||||
// Endpoint halted then registes the callback
|
||||
// Endpoint halted then registers the callback
|
||||
ptr_job->busy = true;
|
||||
ptr_job->call_nohalt = callback;
|
||||
} else {
|
||||
@@ -1386,7 +1386,7 @@ static void udd_ctrl_setup_received(void)
|
||||
|
||||
// Decode setup request
|
||||
if (udc_process_setup() == false) {
|
||||
// Setup request unknow then stall it
|
||||
// Setup request unknown then stall it
|
||||
udd_ctrl_stall_data();
|
||||
udd_ack_setup_received(0);
|
||||
return;
|
||||
@@ -1447,7 +1447,7 @@ static void udd_ctrl_in_sent(void)
|
||||
udd_ctrl_prev_payload_buf_cnt += udd_ctrl_payload_buf_cnt;
|
||||
if ((udd_g_ctrlreq.req.wLength == udd_ctrl_prev_payload_buf_cnt)
|
||||
|| b_shortpacket) {
|
||||
// All data requested are transfered or a short packet has been sent
|
||||
// All data requested are transferred or a short packet has been sent
|
||||
// then it is the end of data phase.
|
||||
// Generate an OUT ZLP for handshake phase.
|
||||
udd_ctrl_send_zlp_out();
|
||||
@@ -1516,7 +1516,7 @@ static void udd_ctrl_out_received(void)
|
||||
// End of SETUP request:
|
||||
// - Data IN Phase aborted,
|
||||
// - or last Data IN Phase hidden by ZLP OUT sending quiclky,
|
||||
// - or ZLP OUT received normaly.
|
||||
// - or ZLP OUT received normally.
|
||||
udd_ctrl_endofrequest();
|
||||
} else {
|
||||
// Protocol error during SETUP request
|
||||
@@ -1544,7 +1544,7 @@ static void udd_ctrl_out_received(void)
|
||||
(udd_ctrl_prev_payload_buf_cnt +
|
||||
udd_ctrl_payload_buf_cnt))) {
|
||||
// End of reception because it is a short packet
|
||||
// Before send ZLP, call intermediat calback
|
||||
// Before send ZLP, call intermediate callback
|
||||
// in case of data receiv generate a stall
|
||||
udd_g_ctrlreq.payload_size = udd_ctrl_payload_buf_cnt;
|
||||
if (NULL != udd_g_ctrlreq.over_under_run) {
|
||||
@@ -1565,7 +1565,7 @@ static void udd_ctrl_out_received(void)
|
||||
if (udd_g_ctrlreq.payload_size == udd_ctrl_payload_buf_cnt) {
|
||||
// Overrun then request a new payload buffer
|
||||
if (!udd_g_ctrlreq.over_under_run) {
|
||||
// No callback availabled to request a new payload buffer
|
||||
// No callback available to request a new payload buffer
|
||||
udd_ctrl_stall_data();
|
||||
// Ack reception of OUT to replace NAK by a STALL
|
||||
udd_ack_out_received(0);
|
||||
@@ -1805,7 +1805,7 @@ static void udd_ep_trans_done(udd_ep_id_t ep)
|
||||
// transfer size of UDD_ENDPOINT_MAX_TRANS Bytes
|
||||
next_trans = UDD_ENDPOINT_MAX_TRANS;
|
||||
|
||||
// Set 0 to tranfer the maximum
|
||||
// Set 0 to transfer the maximum
|
||||
udd_dma_ctrl = UOTGHS_DEVDMACONTROL_BUFF_LENGTH(0);
|
||||
} else {
|
||||
udd_dma_ctrl = UOTGHS_DEVDMACONTROL_BUFF_LENGTH(next_trans);
|
||||
@@ -1850,7 +1850,7 @@ static void udd_ep_trans_done(udd_ep_id_t ep)
|
||||
}
|
||||
cpu_irq_restore(flags);
|
||||
|
||||
// Here a ZLP has been recieved
|
||||
// Here a ZLP has been received
|
||||
// and the DMA transfer must be not started.
|
||||
// It is the end of transfer
|
||||
ptr_job->buf_size = ptr_job->buf_cnt;
|
||||
@@ -1991,13 +1991,13 @@ static bool udd_ep_interrupt(void)
|
||||
}
|
||||
dbg_print("dma%x: ", ep);
|
||||
udd_disable_endpoint_dma_interrupt(ep);
|
||||
// Save number of data no transfered
|
||||
// Save number of data no transferred
|
||||
nb_remaining = (udd_endpoint_dma_get_status(ep) &
|
||||
UOTGHS_DEVDMASTATUS_BUFF_COUNT_Msk)
|
||||
>> UOTGHS_DEVDMASTATUS_BUFF_COUNT_Pos;
|
||||
if (nb_remaining) {
|
||||
// Transfer no complete (short packet or ZLP) then:
|
||||
// Update number of data transfered
|
||||
// Update number of data transferred
|
||||
ptr_job->buf_cnt -= nb_remaining;
|
||||
// Set transfer complete to stop the transfer
|
||||
ptr_job->buf_size = ptr_job->buf_cnt;
|
||||
@@ -2056,7 +2056,7 @@ static bool udd_ep_interrupt(void)
|
||||
udd_disable_endpoint_interrupt(ep);
|
||||
|
||||
Assert(ptr_job->stall_requested);
|
||||
// A stall has been requested during backgound transfer
|
||||
// A stall has been requested during background transfer
|
||||
ptr_job->stall_requested = false;
|
||||
udd_disable_endpoint_bank_autoswitch(ep);
|
||||
udd_enable_stall_handshake(ep);
|
||||
|
@@ -130,7 +130,7 @@ struct usb_msc_cbw {
|
||||
struct usb_msc_csw {
|
||||
le32_t dCSWSignature; //!< Must contain 'USBS'
|
||||
le32_t dCSWTag; //!< Same as dCBWTag
|
||||
le32_t dCSWDataResidue; //!< Number of bytes not transfered
|
||||
le32_t dCSWDataResidue; //!< Number of bytes not transferred
|
||||
uint8_t bCSWStatus; //!< Status code
|
||||
};
|
||||
|
||||
|
@@ -28,6 +28,10 @@
|
||||
#include <esp_adc_cal.h>
|
||||
#include <HardwareSerial.h>
|
||||
|
||||
#if ENABLED(USE_ESP32_TASK_WDT)
|
||||
#include <esp_task_wdt.h>
|
||||
#endif
|
||||
|
||||
#if ENABLED(WIFISUPPORT)
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include "wifi.h"
|
||||
@@ -90,8 +94,24 @@ volatile int numPWMUsed = 0,
|
||||
|
||||
#endif
|
||||
|
||||
void HAL_init_board() {
|
||||
#if ENABLED(USE_ESP32_EXIO)
|
||||
HardwareSerial YSerial2(2);
|
||||
|
||||
void Write_EXIO(uint8_t IO, uint8_t v) {
|
||||
if (ISRS_ENABLED()) {
|
||||
DISABLE_ISRS();
|
||||
YSerial2.write(0x80 | (((char)v) << 5) | (IO - 100));
|
||||
ENABLE_ISRS();
|
||||
}
|
||||
else
|
||||
YSerial2.write(0x80 | (((char)v) << 5) | (IO - 100));
|
||||
}
|
||||
#endif
|
||||
|
||||
void HAL_init_board() {
|
||||
#if ENABLED(USE_ESP32_TASK_WDT)
|
||||
esp_task_wdt_init(10, true);
|
||||
#endif
|
||||
#if ENABLED(ESP3D_WIFISUPPORT)
|
||||
esp3dlib.init();
|
||||
#elif ENABLED(WIFISUPPORT)
|
||||
@@ -127,7 +147,11 @@ void HAL_init_board() {
|
||||
// Initialize the i2s peripheral only if the I2S stepper stream is enabled.
|
||||
// The following initialization is performed after Serial1 and Serial2 are defined as
|
||||
// their native pins might conflict with the i2s stream even when they are remapped.
|
||||
TERN_(I2S_STEPPER_STREAM, i2s_init());
|
||||
#if ENABLED(USE_ESP32_EXIO)
|
||||
YSerial2.begin(460800 * 3, SERIAL_8N1, 16, 17);
|
||||
#elif ENABLED(I2S_STEPPER_STREAM)
|
||||
i2s_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
void HAL_idletask() {
|
||||
@@ -252,7 +276,7 @@ void analogWrite(pin_t pin, int value) {
|
||||
idx = numPWMUsed;
|
||||
pwmPins[idx] = pin;
|
||||
// Start timer on first use
|
||||
if (idx == 0) HAL_timer_start(PWM_TIMER_NUM, PWM_TIMER_FREQUENCY);
|
||||
if (idx == 0) HAL_timer_start(MF_TIMER_PWM, PWM_TIMER_FREQUENCY);
|
||||
|
||||
++numPWMUsed;
|
||||
}
|
||||
@@ -263,7 +287,7 @@ void analogWrite(pin_t pin, int value) {
|
||||
|
||||
// Handle PWM timer interrupt
|
||||
HAL_PWM_TIMER_ISR() {
|
||||
HAL_timer_isr_prologue(PWM_TIMER_NUM);
|
||||
HAL_timer_isr_prologue(MF_TIMER_PWM);
|
||||
|
||||
static uint8_t count = 0;
|
||||
|
||||
@@ -277,7 +301,7 @@ HAL_PWM_TIMER_ISR() {
|
||||
// 128 for 7 Bit resolution
|
||||
count = (count + 1) & 0x7F;
|
||||
|
||||
HAL_timer_isr_epilogue(PWM_TIMER_NUM);
|
||||
HAL_timer_isr_epilogue(MF_TIMER_PWM);
|
||||
}
|
||||
|
||||
#endif // ARDUINO_ARCH_ESP32
|
||||
|
@@ -105,16 +105,14 @@ void HAL_reboot();
|
||||
|
||||
void _delay_ms(int delay);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
|
||||
int freeMemory();
|
||||
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
void analogWrite(pin_t pin, int value);
|
||||
|
||||
@@ -131,6 +129,10 @@ void HAL_adc_init();
|
||||
|
||||
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
||||
|
||||
// PWM
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
// Pin Map
|
||||
#define GET_PIN_MAP_PIN(index) index
|
||||
#define GET_PIN_MAP_INDEX(pin) pin
|
||||
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval)
|
||||
@@ -142,6 +144,10 @@ void HAL_idletask();
|
||||
inline void HAL_init() {}
|
||||
void HAL_init_board();
|
||||
|
||||
#if ENABLED(USE_ESP32_EXIO)
|
||||
void Write_EXIO(uint8_t IO, uint8_t v);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Delay in cycles (used by DELAY_NS / DELAY_US)
|
||||
//
|
||||
|
@@ -53,11 +53,9 @@ static SPISettings spiConfig;
|
||||
// ------------------------
|
||||
|
||||
void spiBegin() {
|
||||
#if !PIN_EXISTS(SD_SS)
|
||||
#error "SD_SS_PIN not defined!"
|
||||
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_SS)
|
||||
OUT_WRITE(SD_SS_PIN, HIGH);
|
||||
#endif
|
||||
|
||||
OUT_WRITE(SD_SS_PIN, HIGH);
|
||||
}
|
||||
|
||||
void spiInit(uint8_t spiRate) {
|
||||
|
26
Marlin/src/HAL/ESP32/MarlinSPI.h
Normal file
26
Marlin/src/HAL/ESP32/MarlinSPI.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
using MarlinSPI = SPIClass;
|
@@ -38,16 +38,16 @@ volatile static int32_t toggles;
|
||||
void tone(const pin_t _pin, const unsigned int frequency, const unsigned long duration) {
|
||||
tone_pin = _pin;
|
||||
toggles = 2 * frequency * duration / 1000;
|
||||
HAL_timer_start(TONE_TIMER_NUM, 2 * frequency);
|
||||
HAL_timer_start(MF_TIMER_TONE, 2 * frequency);
|
||||
}
|
||||
|
||||
void noTone(const pin_t _pin) {
|
||||
HAL_timer_disable_interrupt(TONE_TIMER_NUM);
|
||||
HAL_timer_disable_interrupt(MF_TIMER_TONE);
|
||||
WRITE(_pin, LOW);
|
||||
}
|
||||
|
||||
HAL_TONE_TIMER_ISR() {
|
||||
HAL_timer_isr_prologue(TONE_TIMER_NUM);
|
||||
HAL_timer_isr_prologue(MF_TIMER_TONE);
|
||||
|
||||
if (toggles) {
|
||||
toggles--;
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include "wifi.h"
|
||||
#include <ESPAsyncWebServer.h>
|
||||
|
||||
MSerialT webSocketSerial(false);
|
||||
MSerialWebSocketT webSocketSerial(false);
|
||||
AsyncWebSocket ws("/ws"); // TODO Move inside the class.
|
||||
|
||||
// RingBuffer impl
|
||||
|
@@ -81,5 +81,5 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef Serial1Class<WebSocketSerial> MSerialT;
|
||||
extern MSerialT webSocketSerial;
|
||||
typedef Serial1Class<WebSocketSerial> MSerialWebSocketT;
|
||||
extern MSerialWebSocketT webSocketSerial;
|
||||
|
@@ -59,4 +59,10 @@ void setup_endstop_interrupts() {
|
||||
TERN_(HAS_Z4_MAX, _ATTACH(Z4_MAX_PIN));
|
||||
TERN_(HAS_Z4_MIN, _ATTACH(Z4_MIN_PIN));
|
||||
TERN_(HAS_Z_MIN_PROBE_PIN, _ATTACH(Z_MIN_PROBE_PIN));
|
||||
TERN_(HAS_I_MAX, _ATTACH(I_MAX_PIN));
|
||||
TERN_(HAS_I_MIN, _ATTACH(I_MIN_PIN));
|
||||
TERN_(HAS_J_MAX, _ATTACH(J_MAX_PIN));
|
||||
TERN_(HAS_J_MIN, _ATTACH(J_MIN_PIN));
|
||||
TERN_(HAS_K_MAX, _ATTACH(K_MAX_PIN));
|
||||
TERN_(HAS_K_MIN, _ATTACH(K_MIN_PIN));
|
||||
}
|
||||
|
6
Marlin/src/HAL/ESP32/esp32.csv
Normal file
6
Marlin/src/HAL/ESP32/esp32.csv
Normal file
@@ -0,0 +1,6 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, 0x9000, 0x5000,
|
||||
otadata, data, ota, 0xe000, 0x2000,
|
||||
app0, app, ota_0, 0x10000, 0x180000,
|
||||
app1, app, ota_1, 0x190000, 0x180000,
|
||||
spiffs, data, spiffs, 0x310000, 0xF0000,
|
|
@@ -40,13 +40,19 @@
|
||||
// Set pin as input with pullup mode
|
||||
#define _PULLUP(IO, v) pinMode(IO, v ? INPUT_PULLUP : INPUT)
|
||||
|
||||
// Read a pin wrapper
|
||||
#define READ(IO) (IS_I2S_EXPANDER_PIN(IO) ? i2s_state(I2S_EXPANDER_PIN_INDEX(IO)) : digitalRead(IO))
|
||||
#if ENABLED(USE_ESP32_EXIO)
|
||||
// Read a pin wrapper
|
||||
#define READ(IO) digitalRead(IO)
|
||||
// Write to a pin wrapper
|
||||
#define WRITE(IO, v) (IO >= 100 ? Write_EXIO(IO, v) : digitalWrite(IO, v))
|
||||
#else
|
||||
// Read a pin wrapper
|
||||
#define READ(IO) (IS_I2S_EXPANDER_PIN(IO) ? i2s_state(I2S_EXPANDER_PIN_INDEX(IO)) : digitalRead(IO))
|
||||
// Write to a pin wrapper
|
||||
#define WRITE(IO, v) (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
|
||||
#endif
|
||||
|
||||
// Write to a pin wrapper
|
||||
#define WRITE(IO, v) (IS_I2S_EXPANDER_PIN(IO) ? i2s_write(I2S_EXPANDER_PIN_INDEX(IO), v) : digitalWrite(IO, v))
|
||||
|
||||
// Set pin as input wrapper
|
||||
// Set pin as input wrapper (0x80 | (v << 5) | (IO - 100))
|
||||
#define SET_INPUT(IO) _SET_INPUT(IO)
|
||||
|
||||
// Set pin as input with pullup wrapper
|
||||
|
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if DISABLED(USE_ESP32_EXIO)
|
||||
|
||||
#include "i2s.h"
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
@@ -62,12 +64,9 @@ uint32_t i2s_port_data = 0;
|
||||
#define I2S_EXIT_CRITICAL() portEXIT_CRITICAL(&i2s_spinlock[i2s_num])
|
||||
|
||||
static inline void gpio_matrix_out_check(uint32_t gpio, uint32_t signal_idx, bool out_inv, bool oen_inv) {
|
||||
//if pin = -1, do not need to configure
|
||||
if (gpio != -1) {
|
||||
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio], PIN_FUNC_GPIO);
|
||||
gpio_set_direction((gpio_num_t)gpio, (gpio_mode_t)GPIO_MODE_DEF_OUTPUT);
|
||||
gpio_matrix_out(gpio, signal_idx, out_inv, oen_inv);
|
||||
}
|
||||
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio], PIN_FUNC_GPIO);
|
||||
gpio_set_direction((gpio_num_t)gpio, (gpio_mode_t)GPIO_MODE_DEF_OUTPUT);
|
||||
gpio_matrix_out(gpio, signal_idx, out_inv, oen_inv);
|
||||
}
|
||||
|
||||
static esp_err_t i2s_reset_fifo(i2s_port_t i2s_num) {
|
||||
@@ -254,13 +253,7 @@ int i2s_init() {
|
||||
|
||||
I2S0.fifo_conf.dscr_en = 0;
|
||||
|
||||
I2S0.conf_chan.tx_chan_mod = (
|
||||
#if ENABLED(I2S_STEPPER_SPLIT_STREAM)
|
||||
4
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
);
|
||||
I2S0.conf_chan.tx_chan_mod = TERN(I2S_STEPPER_SPLIT_STREAM, 4, 0);
|
||||
I2S0.fifo_conf.tx_fifo_mod = 0;
|
||||
I2S0.conf.tx_mono = 0;
|
||||
|
||||
@@ -311,9 +304,16 @@ int i2s_init() {
|
||||
xTaskCreatePinnedToCore(stepperTask, "StepperTask", 10000, nullptr, 1, nullptr, CONFIG_ARDUINO_RUNNING_CORE); // run I2S stepper task on same core as rest of Marlin
|
||||
|
||||
// Route the i2s pins to the appropriate GPIO
|
||||
gpio_matrix_out_check(I2S_DATA, I2S0O_DATA_OUT23_IDX, 0, 0);
|
||||
gpio_matrix_out_check(I2S_BCK, I2S0O_BCK_OUT_IDX, 0, 0);
|
||||
gpio_matrix_out_check(I2S_WS, I2S0O_WS_OUT_IDX, 0, 0);
|
||||
// If a pin is not defined, no need to configure
|
||||
#if defined(I2S_DATA) && I2S_DATA >= 0
|
||||
gpio_matrix_out_check(I2S_DATA, I2S0O_DATA_OUT23_IDX, 0, 0);
|
||||
#endif
|
||||
#if defined(I2S_BCK) && I2S_BCK >= 0
|
||||
gpio_matrix_out_check(I2S_BCK, I2S0O_BCK_OUT_IDX, 0, 0);
|
||||
#endif
|
||||
#if defined(I2S_WS) && I2S_WS >= 0
|
||||
gpio_matrix_out_check(I2S_WS, I2S0O_WS_OUT_IDX, 0, 0);
|
||||
#endif
|
||||
|
||||
// Start the I2S peripheral
|
||||
return i2s_start(I2S_NUM_0);
|
||||
@@ -340,4 +340,5 @@ void i2s_push_sample() {
|
||||
dma.current[dma.rw_pos++] = i2s_port_data;
|
||||
}
|
||||
|
||||
#endif // !USE_ESP32_EXIO
|
||||
#endif // ARDUINO_ARCH_ESP32
|
||||
|
@@ -2,6 +2,9 @@
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
|
@@ -41,7 +41,7 @@
|
||||
|
||||
static timg_dev_t *TG[2] = {&TIMERG0, &TIMERG1};
|
||||
|
||||
const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
|
||||
const tTimerConfig timer_config[NUM_HARDWARE_TIMERS] = {
|
||||
{ TIMER_GROUP_0, TIMER_0, STEPPER_TIMER_PRESCALE, stepTC_Handler }, // 0 - Stepper
|
||||
{ TIMER_GROUP_0, TIMER_1, TEMP_TIMER_PRESCALE, tempTC_Handler }, // 1 - Temperature
|
||||
{ TIMER_GROUP_1, TIMER_0, PWM_TIMER_PRESCALE, pwmTC_Handler }, // 2 - PWM
|
||||
@@ -53,7 +53,7 @@ const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
|
||||
// ------------------------
|
||||
|
||||
void IRAM_ATTR timer_isr(void *para) {
|
||||
const tTimerConfig& timer = TimerConfig[(int)para];
|
||||
const tTimerConfig& timer = timer_config[(int)para];
|
||||
|
||||
// Retrieve the interrupt status and the counter value
|
||||
// from the timer that reported the interrupt
|
||||
@@ -82,7 +82,7 @@ void IRAM_ATTR timer_isr(void *para) {
|
||||
* @param frequency frequency of the timer
|
||||
*/
|
||||
void HAL_timer_start(const uint8_t timer_num, uint32_t frequency) {
|
||||
const tTimerConfig timer = TimerConfig[timer_num];
|
||||
const tTimerConfig timer = timer_config[timer_num];
|
||||
|
||||
timer_config_t config;
|
||||
config.divider = timer.divider;
|
||||
@@ -115,7 +115,7 @@ void HAL_timer_start(const uint8_t timer_num, uint32_t frequency) {
|
||||
* @param count threshold at which the interrupt is triggered
|
||||
*/
|
||||
void HAL_timer_set_compare(const uint8_t timer_num, hal_timer_t count) {
|
||||
const tTimerConfig timer = TimerConfig[timer_num];
|
||||
const tTimerConfig timer = timer_config[timer_num];
|
||||
timer_set_alarm_value(timer.group, timer.idx, count);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ void HAL_timer_set_compare(const uint8_t timer_num, hal_timer_t count) {
|
||||
* @return the timer current threshold for the alarm to be triggered
|
||||
*/
|
||||
hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
|
||||
const tTimerConfig timer = TimerConfig[timer_num];
|
||||
const tTimerConfig timer = timer_config[timer_num];
|
||||
|
||||
uint64_t alarm_value;
|
||||
timer_get_alarm_value(timer.group, timer.idx, &alarm_value);
|
||||
@@ -139,7 +139,7 @@ hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
|
||||
* @return the current counter of the alarm
|
||||
*/
|
||||
hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
||||
const tTimerConfig timer = TimerConfig[timer_num];
|
||||
const tTimerConfig timer = timer_config[timer_num];
|
||||
uint64_t counter_value;
|
||||
timer_get_counter_value(timer.group, timer.idx, &counter_value);
|
||||
return counter_value;
|
||||
@@ -150,7 +150,7 @@ hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
||||
* @param timer_num timer number to enable interrupts on
|
||||
*/
|
||||
void HAL_timer_enable_interrupt(const uint8_t timer_num) {
|
||||
//const tTimerConfig timer = TimerConfig[timer_num];
|
||||
//const tTimerConfig timer = timer_config[timer_num];
|
||||
//timer_enable_intr(timer.group, timer.idx);
|
||||
}
|
||||
|
||||
@@ -159,12 +159,12 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num) {
|
||||
* @param timer_num timer number to disable interrupts on
|
||||
*/
|
||||
void HAL_timer_disable_interrupt(const uint8_t timer_num) {
|
||||
//const tTimerConfig timer = TimerConfig[timer_num];
|
||||
//const tTimerConfig timer = timer_config[timer_num];
|
||||
//timer_disable_intr(timer.group, timer.idx);
|
||||
}
|
||||
|
||||
bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
|
||||
const tTimerConfig timer = TimerConfig[timer_num];
|
||||
const tTimerConfig timer = timer_config[timer_num];
|
||||
return TG[timer.group]->int_ena.val | BIT(timer_num);
|
||||
}
|
||||
|
||||
|
@@ -32,20 +32,20 @@
|
||||
typedef uint64_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFFFFFFFFFULL
|
||||
|
||||
#ifndef STEP_TIMER_NUM
|
||||
#define STEP_TIMER_NUM 0 // Timer Index for Stepper
|
||||
#ifndef MF_TIMER_STEP
|
||||
#define MF_TIMER_STEP 0 // Timer Index for Stepper
|
||||
#endif
|
||||
#ifndef PULSE_TIMER_NUM
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#ifndef MF_TIMER_PULSE
|
||||
#define MF_TIMER_PULSE MF_TIMER_STEP
|
||||
#endif
|
||||
#ifndef TEMP_TIMER_NUM
|
||||
#define TEMP_TIMER_NUM 1 // Timer Index for Temperature
|
||||
#ifndef MF_TIMER_TEMP
|
||||
#define MF_TIMER_TEMP 1 // Timer Index for Temperature
|
||||
#endif
|
||||
#ifndef PWM_TIMER_NUM
|
||||
#define PWM_TIMER_NUM 2 // index of timer to use for PWM outputs
|
||||
#ifndef MF_TIMER_PWM
|
||||
#define MF_TIMER_PWM 2 // index of timer to use for PWM outputs
|
||||
#endif
|
||||
#ifndef TONE_TIMER_NUM
|
||||
#define TONE_TIMER_NUM 3 // index of timer for beeper tones
|
||||
#ifndef MF_TIMER_TONE
|
||||
#define MF_TIMER_TONE 3 // index of timer for beeper tones
|
||||
#endif
|
||||
|
||||
#define HAL_TIMER_RATE APB_CLK_FREQ // frequency of timer peripherals
|
||||
@@ -79,12 +79,12 @@ typedef uint64_t hal_timer_t;
|
||||
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
|
||||
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
|
||||
|
||||
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM)
|
||||
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM)
|
||||
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM)
|
||||
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
|
||||
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
|
||||
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
|
||||
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP)
|
||||
|
||||
#ifndef HAL_TEMP_TIMER_ISR
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
|
||||
@@ -121,7 +121,7 @@ typedef struct {
|
||||
// Public Variables
|
||||
// ------------------------
|
||||
|
||||
extern const tTimerConfig TimerConfig[];
|
||||
extern const tTimerConfig timer_config[];
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
@@ -136,5 +136,5 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num);
|
||||
void HAL_timer_disable_interrupt(const uint8_t timer_num);
|
||||
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
|
||||
|
||||
#define HAL_timer_isr_prologue(TIMER_NUM)
|
||||
#define HAL_timer_isr_epilogue(TIMER_NUM)
|
||||
#define HAL_timer_isr_prologue(T)
|
||||
#define HAL_timer_isr_epilogue(T)
|
||||
|
@@ -25,7 +25,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
esp_err_t esp_task_wdt_reset();
|
||||
esp_err_t esp_task_wdt_reset();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ void wifi_init() {
|
||||
|
||||
MDNS.addService("http", "tcp", 80);
|
||||
|
||||
SERIAL_ECHOLNPAIR("Successfully connected to WiFi with SSID '" WIFI_SSID "', hostname: '" WIFI_HOSTNAME "', IP address: ", WiFi.localIP().toString().c_str());
|
||||
SERIAL_ECHOLNPGM("Successfully connected to WiFi with SSID '" WIFI_SSID "', hostname: '" WIFI_HOSTNAME "', IP address: ", WiFi.localIP().toString().c_str());
|
||||
}
|
||||
|
||||
#endif // WIFISUPPORT
|
||||
|
@@ -63,9 +63,9 @@ uint8_t _getc();
|
||||
extern MSerialT usb_serial;
|
||||
#define MYSERIAL1 usb_serial
|
||||
|
||||
#define ST7920_DELAY_1 DELAY_NS(600)
|
||||
#define ST7920_DELAY_2 DELAY_NS(750)
|
||||
#define ST7920_DELAY_3 DELAY_NS(750)
|
||||
#define CPU_ST7920_DELAY_1 600
|
||||
#define CPU_ST7920_DELAY_2 750
|
||||
#define CPU_ST7920_DELAY_3 750
|
||||
|
||||
//
|
||||
// Interrupts
|
||||
@@ -79,16 +79,14 @@ extern MSerialT usb_serial;
|
||||
inline void HAL_init() {}
|
||||
|
||||
// Utility functions
|
||||
#pragma GCC diagnostic push
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
|
||||
int freeMemory();
|
||||
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// ADC
|
||||
#define HAL_ADC_VREF 5.0
|
||||
@@ -103,6 +101,9 @@ void HAL_adc_enable_channel(const uint8_t ch);
|
||||
void HAL_adc_start_conversion(const uint8_t ch);
|
||||
uint16_t HAL_adc_get_result();
|
||||
|
||||
// PWM
|
||||
inline void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t=255, const bool=false) { analogWrite(pin, v); }
|
||||
|
||||
// Reset source
|
||||
inline void HAL_clear_reset_source(void) {}
|
||||
inline uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
|
||||
|
26
Marlin/src/HAL/LINUX/MarlinSPI.h
Normal file
26
Marlin/src/HAL/LINUX/MarlinSPI.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
using MarlinSPI = SPIClass;
|
@@ -40,7 +40,7 @@ struct GpioEvent {
|
||||
pin_type pin_id;
|
||||
GpioEvent::Type event;
|
||||
|
||||
GpioEvent(uint64_t timestamp, pin_type pin_id, GpioEvent::Type event){
|
||||
GpioEvent(uint64_t timestamp, pin_type pin_id, GpioEvent::Type event) {
|
||||
this->timestamp = timestamp;
|
||||
this->pin_id = pin_id;
|
||||
this->event = event;
|
||||
|
@@ -54,7 +54,7 @@ void Heater::update() {
|
||||
}
|
||||
|
||||
void Heater::interrupt(GpioEvent ev) {
|
||||
// ununsed
|
||||
// unused
|
||||
}
|
||||
|
||||
#endif // __PLAT_LINUX__
|
||||
|
@@ -51,7 +51,7 @@ void LinearAxis::update() {
|
||||
}
|
||||
|
||||
void LinearAxis::interrupt(GpioEvent ev) {
|
||||
if (ev.pin_id == step_pin && !Gpio::pin_map[enable_pin].value){
|
||||
if (ev.pin_id == step_pin && !Gpio::pin_map[enable_pin].value) {
|
||||
if (ev.event == GpioEvent::RISE) {
|
||||
last_update = ev.timestamp;
|
||||
position += -1 + 2 * Gpio::pin_map[dir_pin].value;
|
||||
|
@@ -52,7 +52,7 @@ public:
|
||||
return (*(intptr_t*)timerid);
|
||||
}
|
||||
|
||||
static void handler(int sig, siginfo_t *si, void *uc){
|
||||
static void handler(int sig, siginfo_t *si, void *uc) {
|
||||
Timer* _this = (Timer*)si->si_value.sival_ptr;
|
||||
_this->avg_error += (Clock::nanos() - _this->start_time) - _this->period; //high_resolution_clock is also limited in precision, but best we have
|
||||
_this->avg_error /= 2; //very crude precision analysis (actually within +-500ns usually)
|
||||
|
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
// Emulating RAMPS
|
||||
#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
||||
#if ENABLED(SPINDLE_LASER_USE_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
||||
#error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
||||
#endif
|
||||
|
||||
|
@@ -25,43 +25,6 @@
|
||||
|
||||
#include "../../../gcode/parser.h"
|
||||
|
||||
uint8_t analog_offset = NUM_DIGITAL_PINS - NUM_ANALOG_INPUTS;
|
||||
|
||||
// Get the digital pin for an analog index
|
||||
pin_t analogInputToDigitalPin(const int8_t p) {
|
||||
return (WITHIN(p, 0, NUM_ANALOG_INPUTS) ? analog_offset + p : P_NC);
|
||||
}
|
||||
|
||||
// Return the index of a pin number
|
||||
int16_t GET_PIN_MAP_INDEX(const pin_t pin) {
|
||||
return pin;
|
||||
}
|
||||
|
||||
// Test whether the pin is valid
|
||||
bool VALID_PIN(const pin_t p) {
|
||||
return WITHIN(p, 0, NUM_DIGITAL_PINS);
|
||||
}
|
||||
|
||||
// Get the analog index for a digital pin
|
||||
int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p) {
|
||||
return (WITHIN(p, analog_offset, NUM_DIGITAL_PINS) ? p - analog_offset : P_NC);
|
||||
}
|
||||
|
||||
// Test whether the pin is PWM
|
||||
bool PWM_PIN(const pin_t p) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test whether the pin is interruptable
|
||||
bool INTERRUPT_PIN(const pin_t p) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the pin number at the given index
|
||||
pin_t GET_PIN_MAP_PIN(const int16_t ind) {
|
||||
return ind;
|
||||
}
|
||||
|
||||
int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) {
|
||||
return parser.intval(code, dval);
|
||||
}
|
||||
|
@@ -34,26 +34,32 @@ constexpr uint8_t NUM_ANALOG_INPUTS = 16;
|
||||
|
||||
#define HAL_SENSITIVE_PINS
|
||||
|
||||
constexpr uint8_t analog_offset = NUM_DIGITAL_PINS - NUM_ANALOG_INPUTS;
|
||||
|
||||
// Get the digital pin for an analog index
|
||||
pin_t analogInputToDigitalPin(const int8_t p);
|
||||
|
||||
// Return the index of a pin number
|
||||
int16_t GET_PIN_MAP_INDEX(const pin_t pin);
|
||||
|
||||
// Test whether the pin is valid
|
||||
bool VALID_PIN(const pin_t p);
|
||||
constexpr pin_t analogInputToDigitalPin(const int8_t p) {
|
||||
return (WITHIN(p, 0, NUM_ANALOG_INPUTS) ? analog_offset + p : P_NC);
|
||||
}
|
||||
|
||||
// Get the analog index for a digital pin
|
||||
int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p);
|
||||
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);
|
||||
}
|
||||
|
||||
// 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); }
|
||||
|
||||
// Test whether the pin is PWM
|
||||
bool PWM_PIN(const pin_t p);
|
||||
constexpr bool PWM_PIN(const pin_t p) { return false; }
|
||||
|
||||
// Test whether the pin is interruptable
|
||||
bool INTERRUPT_PIN(const pin_t p);
|
||||
// Test whether the pin is interruptible
|
||||
constexpr bool INTERRUPT_PIN(const pin_t p) { return false; }
|
||||
|
||||
// Get the pin number at the given index
|
||||
pin_t GET_PIN_MAP_PIN(const int16_t ind);
|
||||
constexpr pin_t GET_PIN_MAP_PIN(const int16_t ind) { return ind; }
|
||||
|
||||
// Parse a G-code word into a pin index
|
||||
int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
|
||||
|
@@ -2,6 +2,9 @@
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
@@ -16,6 +19,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __PLAT_LINUX__
|
||||
|
||||
//#define GPIO_LOGGING // Full GPIO and Positional Logging
|
||||
|
@@ -2,6 +2,9 @@
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
@@ -34,6 +37,7 @@
|
||||
#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
|
||||
|
||||
// active ADC function/mode/code values for PINSEL registers
|
||||
|
@@ -37,14 +37,14 @@ typedef uint32_t hal_timer_t;
|
||||
|
||||
#define HAL_TIMER_RATE ((SystemCoreClock) / 4) // frequency of timers peripherals
|
||||
|
||||
#ifndef STEP_TIMER_NUM
|
||||
#define STEP_TIMER_NUM 0 // Timer Index for Stepper
|
||||
#ifndef MF_TIMER_STEP
|
||||
#define MF_TIMER_STEP 0 // Timer Index for Stepper
|
||||
#endif
|
||||
#ifndef PULSE_TIMER_NUM
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#ifndef MF_TIMER_PULSE
|
||||
#define MF_TIMER_PULSE MF_TIMER_STEP
|
||||
#endif
|
||||
#ifndef TEMP_TIMER_NUM
|
||||
#define TEMP_TIMER_NUM 1 // Timer Index for Temperature
|
||||
#ifndef MF_TIMER_TEMP
|
||||
#define MF_TIMER_TEMP 1 // Timer Index for Temperature
|
||||
#endif
|
||||
|
||||
#define TEMP_TIMER_RATE 1000000
|
||||
@@ -58,12 +58,12 @@ typedef uint32_t hal_timer_t;
|
||||
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
|
||||
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
|
||||
|
||||
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM)
|
||||
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM)
|
||||
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM)
|
||||
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
|
||||
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
|
||||
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
|
||||
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP)
|
||||
|
||||
#ifndef HAL_STEP_TIMER_ISR
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler()
|
||||
@@ -77,7 +77,6 @@ typedef uint32_t hal_timer_t;
|
||||
#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler()
|
||||
#define HAL_PWM_TIMER_IRQn
|
||||
|
||||
|
||||
void HAL_timer_init();
|
||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||
|
||||
@@ -93,5 +92,5 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num);
|
||||
void HAL_timer_disable_interrupt(const uint8_t timer_num);
|
||||
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
|
||||
|
||||
#define HAL_timer_isr_prologue(TIMER_NUM)
|
||||
#define HAL_timer_isr_epilogue(TIMER_NUM)
|
||||
#define HAL_timer_isr_prologue(T)
|
||||
#define HAL_timer_isr_epilogue(T)
|
||||
|
@@ -50,15 +50,9 @@ extern "C" volatile uint32_t _millis;
|
||||
//
|
||||
// Default graphical display delays
|
||||
//
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_NS(600)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_NS(750)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_NS(750)
|
||||
#endif
|
||||
#define CPU_ST7920_DELAY_1 600
|
||||
#define CPU_ST7920_DELAY_2 750
|
||||
#define CPU_ST7920_DELAY_3 750
|
||||
|
||||
typedef ForwardSerial1Class< decltype(UsbSerial) > DefaultSerial1;
|
||||
extern DefaultSerial1 USBSerial;
|
||||
@@ -84,6 +78,16 @@ extern DefaultSerial1 USBSerial;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_PORT_3
|
||||
#if SERIAL_PORT_3 == -1
|
||||
#define MYSERIAL3 USBSerial
|
||||
#elif WITHIN(SERIAL_PORT_3, 0, 3)
|
||||
#define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
|
||||
#else
|
||||
#error "SERIAL_PORT_3 must be from 0 to 3. 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 USBSerial
|
||||
@@ -103,7 +107,7 @@ extern DefaultSerial1 USBSerial;
|
||||
#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
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() MSerial0.available()
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.available()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -119,16 +123,14 @@ extern DefaultSerial1 USBSerial;
|
||||
//
|
||||
// Utility functions
|
||||
//
|
||||
#pragma GCC diagnostic push
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
|
||||
int freeMemory();
|
||||
|
||||
#if GCC_VERSION <= 50000
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
//
|
||||
// ADC API
|
||||
@@ -152,17 +154,17 @@ int freeMemory();
|
||||
|
||||
using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
|
||||
extern uint32_t HAL_adc_reading;
|
||||
[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
|
||||
[[gnu::always_inline]] inline void HAL_adc_start_conversion(const pin_t pin) {
|
||||
HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
||||
}
|
||||
[[gnu::always_inline]] inline uint16_t HAL_read_adc() {
|
||||
[[gnu::always_inline]] inline uint16_t HAL_adc_get_result() {
|
||||
return HAL_adc_reading;
|
||||
}
|
||||
|
||||
#define HAL_adc_init()
|
||||
#define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin)
|
||||
#define HAL_START_ADC(pin) HAL_start_adc(pin)
|
||||
#define HAL_READ_ADC() HAL_read_adc()
|
||||
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
||||
#define HAL_READ_ADC() HAL_adc_get_result()
|
||||
#define HAL_ADC_READY() (true)
|
||||
|
||||
// Test whether the pin is valid
|
||||
@@ -188,7 +190,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,
|
||||
|
||||
#define HAL_IDLETASK 1
|
||||
void HAL_idletask();
|
||||
|
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
#ifdef TARGET_LPC1768
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "HAL.h"
|
||||
|
||||
#if ENABLED(POSTMORTEM_DEBUGGING)
|
||||
|
@@ -66,11 +66,7 @@
|
||||
|
||||
#include <SoftwareSPI.h>
|
||||
|
||||
#ifndef HAL_SPI_SPEED
|
||||
#define HAL_SPI_SPEED SPI_FULL_SPEED
|
||||
#endif
|
||||
|
||||
static uint8_t SPI_speed = HAL_SPI_SPEED;
|
||||
static uint8_t SPI_speed = SPI_FULL_SPEED;
|
||||
|
||||
static uint8_t spiTransfer(uint8_t b) {
|
||||
return swSpiTransfer(b, SPI_speed, SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN);
|
||||
@@ -106,15 +102,13 @@
|
||||
|
||||
#else
|
||||
|
||||
#ifndef HAL_SPI_SPEED
|
||||
#ifdef SD_SPI_SPEED
|
||||
#define HAL_SPI_SPEED SD_SPI_SPEED
|
||||
#else
|
||||
#define HAL_SPI_SPEED SPI_FULL_SPEED
|
||||
#endif
|
||||
#ifdef SD_SPI_SPEED
|
||||
#define INIT_SPI_SPEED SD_SPI_SPEED
|
||||
#else
|
||||
#define INIT_SPI_SPEED SPI_FULL_SPEED
|
||||
#endif
|
||||
|
||||
void spiBegin() { spiInit(HAL_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0
|
||||
void spiBegin() { spiInit(INIT_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0
|
||||
|
||||
void spiInit(uint8_t spiRate) {
|
||||
#if SD_MISO_PIN == BOARD_SPI1_MISO_PIN
|
||||
|
@@ -26,9 +26,9 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if USING_HW_SERIAL0
|
||||
MarlinSerial _MSerial(LPC_UART0);
|
||||
MSerialT MSerial0(true, _MSerial);
|
||||
extern "C" void UART0_IRQHandler() { _MSerial.IRQHandler(); }
|
||||
MarlinSerial _MSerial0(LPC_UART0);
|
||||
MSerialT MSerial0(true, _MSerial0);
|
||||
extern "C" void UART0_IRQHandler() { _MSerial0.IRQHandler(); }
|
||||
#endif
|
||||
#if USING_HW_SERIAL1
|
||||
MarlinSerial _MSerial1((LPC_UART_TypeDef *) LPC_UART1);
|
||||
@@ -52,7 +52,7 @@
|
||||
// Need to figure out which serial port we are and react in consequence (Marlin does not have CONTAINER_OF macro)
|
||||
if (false) {}
|
||||
#if USING_HW_SERIAL0
|
||||
else if (this == &_MSerial) emergency_parser.update(MSerial0.emergency_state, c);
|
||||
else if (this == &_MSerial0) emergency_parser.update(MSerial0.emergency_state, c);
|
||||
#endif
|
||||
#if USING_HW_SERIAL1
|
||||
else if (this == &_MSerial1) emergency_parser.update(MSerial1.emergency_state, c);
|
||||
|
@@ -46,6 +46,8 @@ public:
|
||||
|
||||
void end() {}
|
||||
|
||||
uint8_t availableForWrite(void) { /* flushTX(); */ return TX_BUFFER_SIZE; }
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
bool recv_callback(const char c) override;
|
||||
#endif
|
||||
@@ -60,8 +62,8 @@ extern MSerialT MSerial1;
|
||||
extern MSerialT MSerial2;
|
||||
extern MSerialT MSerial3;
|
||||
|
||||
// Consequently, we can't use a RuntimeSerial either. The workaround would be to use a RuntimeSerial<ForwardSerial<MarlinSerial>> type here
|
||||
// Right now, let's ignore this until it's actually required.
|
||||
// Consequently, we can't use a RuntimeSerial either. The workaround would be to use
|
||||
// a RuntimeSerial<ForwardSerial<MarlinSerial>> type here. Ignore for now until it's actually required.
|
||||
#if ENABLED(SERIAL_RUNTIME_HOOK)
|
||||
#error "SERIAL_RUNTIME_HOOK is not yet supported for LPC176x."
|
||||
#endif
|
||||
|
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
|
||||
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
|
||||
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -20,12 +19,19 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of EEPROM settings in SD Card
|
||||
*/
|
||||
|
||||
#ifdef TARGET_LPC1768
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDCARD_EEPROM_EMULATION)
|
||||
|
||||
//#define DEBUG_SD_EEPROM_EMULATION
|
||||
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#include <chanfs/diskio.h>
|
||||
@@ -38,9 +44,11 @@ FATFS fat_fs;
|
||||
FIL eeprom_file;
|
||||
bool eeprom_file_open = false;
|
||||
|
||||
#define EEPROM_FILENAME "eeprom.dat"
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM
|
||||
#endif
|
||||
|
||||
size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
@@ -50,7 +58,7 @@ bool PersistentStore::access_start() {
|
||||
MSC_Release_Lock();
|
||||
return false;
|
||||
}
|
||||
FRESULT res = f_open(&eeprom_file, "eeprom.dat", FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
|
||||
FRESULT res = f_open(&eeprom_file, EEPROM_FILENAME, FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
|
||||
if (res) MSC_Release_Lock();
|
||||
|
||||
if (res == FR_OK) {
|
||||
@@ -81,18 +89,20 @@ bool PersistentStore::access_finish() {
|
||||
// This extra chit-chat goes away soon, but is helpful for now
|
||||
// to see errors that are happening in read_data / write_data
|
||||
static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) {
|
||||
PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
|
||||
SERIAL_CHAR(' ');
|
||||
SERIAL_ECHOPGM_P(rw_str);
|
||||
SERIAL_ECHOLNPAIR("_data(", pos, ",", value, ",", size, ", ...)");
|
||||
if (total) {
|
||||
SERIAL_ECHOPGM(" f_");
|
||||
SERIAL_ECHOPGM_P(rw_str);
|
||||
SERIAL_ECHOPAIR("()=", s, "\n size=", size, "\n bytes_");
|
||||
SERIAL_ECHOLNPAIR_P(write ? PSTR("written=") : PSTR("read="), total);
|
||||
}
|
||||
else
|
||||
SERIAL_ECHOLNPAIR(" f_lseek()=", s);
|
||||
#if ENABLED(DEBUG_SD_EEPROM_EMULATION)
|
||||
FSTR_P const rw_str = write ? F("write") : F("read");
|
||||
SERIAL_CHAR(' ');
|
||||
SERIAL_ECHOF(rw_str);
|
||||
SERIAL_ECHOLNPGM("_data(", pos, ",", *value, ",", size, ", ...)");
|
||||
if (total) {
|
||||
SERIAL_ECHOPGM(" f_");
|
||||
SERIAL_ECHOF(rw_str);
|
||||
SERIAL_ECHOPGM("()=", s, "\n size=", size, "\n bytes_");
|
||||
SERIAL_ECHOLNF(write ? F("written=") : F("read="), total);
|
||||
}
|
||||
else
|
||||
SERIAL_ECHOLNPGM(" f_lseek()=", s);
|
||||
#endif
|
||||
}
|
||||
|
||||
// File function return codes for type FRESULT. This goes away soon, but
|
||||
|
@@ -122,4 +122,37 @@ void setup_endstop_interrupts() {
|
||||
#endif
|
||||
_ATTACH(Z_MIN_PROBE_PIN);
|
||||
#endif
|
||||
#if HAS_I_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(I_MAX_PIN)
|
||||
#error "I_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(I_MAX_PIN);
|
||||
#elif HAS_I_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(I_MIN_PIN)
|
||||
#error "I_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(I_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_J_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(J_MAX_PIN)
|
||||
#error "J_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(J_MAX_PIN);
|
||||
#elif HAS_J_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(J_MIN_PIN)
|
||||
#error "J_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(J_MIN_PIN);
|
||||
#endif
|
||||
#if HAS_K_MAX
|
||||
#if !LPC1768_PIN_INTERRUPT_M(K_MAX_PIN)
|
||||
#error "K_MAX_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(K_MAX_PIN);
|
||||
#elif HAS_K_MIN
|
||||
#if !LPC1768_PIN_INTERRUPT_M(K_MIN_PIN)
|
||||
#error "K_MIN_PIN is not INTERRUPT-capable."
|
||||
#endif
|
||||
_ATTACH(K_MIN_PIN);
|
||||
#endif
|
||||
}
|
||||
|
@@ -22,18 +22,20 @@
|
||||
#ifdef TARGET_LPC1768
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
#include <pwm.h>
|
||||
|
||||
void 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 NEEDS_HARDWARE_PWM // Specific meta-flag for features that mandate PWM
|
||||
|
||||
#include <pwm.h>
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
LPC176x::pwm_set_frequency(pin, f_desired);
|
||||
}
|
||||
|
||||
void set_pwm_frequency(const pin_t pin, int f_desired) {
|
||||
LPC176x::pwm_set_frequency(pin, f_desired);
|
||||
}
|
||||
#endif
|
||||
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
|
||||
LPC176x::pwm_write_ratio(pin, invert ? 1.0f - (float)v / v_size : (float)v / v_size);
|
||||
}
|
||||
|
||||
#endif // NEEDS_HARDWARE_PWM
|
||||
#endif // TARGET_LPC1768
|
||||
|
@@ -67,7 +67,7 @@ static_assert(!(NUM_SERVOS && ENABLED(FAST_PWM_FAN)), "BLTOUCH and Servos are in
|
||||
* Test LPC176x-specific configuration values for errors at compile-time.
|
||||
*/
|
||||
|
||||
//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
||||
//#if ENABLED(SPINDLE_LASER_USE_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
|
||||
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
||||
//#endif
|
||||
|
||||
@@ -144,9 +144,9 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
|
||||
#error "Serial port pins (2) conflict with Z4 pins!"
|
||||
#elif ANY_RX(2, X_DIR_PIN, Y_DIR_PIN)
|
||||
#error "Serial port pins (2) conflict with other pins!"
|
||||
#elif Y_HOME_DIR < 0 && IS_TX2(Y_STOP_PIN)
|
||||
#elif Y_HOME_TO_MIN && IS_TX2(Y_STOP_PIN)
|
||||
#error "Serial port pins (2) conflict with Y endstop pin!"
|
||||
#elif HAS_CUSTOM_PROBE_PIN && IS_TX2(Z_MIN_PROBE_PIN)
|
||||
#elif USES_Z_MIN_PROBE_PIN && IS_TX2(Z_MIN_PROBE_PIN)
|
||||
#error "Serial port pins (2) conflict with probe pin!"
|
||||
#elif ANY_TX(2, X_ENABLE_PIN, Y_ENABLE_PIN) || ANY_RX(2, X_DIR_PIN, Y_DIR_PIN)
|
||||
#error "Serial port pins (2) conflict with X/Y stepper pins!"
|
||||
@@ -237,7 +237,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
|
||||
#define PIN_IS_SCL2(P) (P##_PIN == P0_11)
|
||||
#if PIN_IS_SDA2(Y_STOP)
|
||||
#error "i2c SDA2 overlaps with Y endstop pin!"
|
||||
#elif HAS_CUSTOM_PROBE_PIN && PIN_IS_SDA2(Z_MIN_PROBE)
|
||||
#elif USES_Z_MIN_PROBE_PIN && PIN_IS_SDA2(Z_MIN_PROBE)
|
||||
#error "i2c SDA2 overlaps with Z probe pin!"
|
||||
#elif PIN_IS_SDA2(X_ENABLE) || PIN_IS_SDA2(Y_ENABLE)
|
||||
#error "i2c SDA2 overlaps with X/Y ENABLE pin!"
|
||||
|
@@ -117,7 +117,7 @@ void HAL_init() {
|
||||
PinCfg.Pinmode = 2; // no pull-up/pull-down
|
||||
PINSEL_ConfigPin(&PinCfg);
|
||||
// now set CLKOUT_EN bit
|
||||
LPC_SC->CLKOUTCFG |= (1<<8);
|
||||
SBI(LPC_SC->CLKOUTCFG, 8);
|
||||
#endif
|
||||
|
||||
USB_Init(); // USB Initialization
|
||||
|
@@ -2,6 +2,9 @@
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
@@ -33,8 +36,9 @@
|
||||
#define PRINT_PORT(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("%d.%02d"), LPC176x::pin_port(p), LPC176x::pin_bit(p)); SERIAL_ECHO(buffer); }while(0)
|
||||
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
|
||||
#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 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
|
||||
#ifndef M43_NEVER_TOUCH
|
||||
@@ -48,6 +52,4 @@ bool GET_PINMODE(const pin_t pin) {
|
||||
return LPC176x::gpio_direction(pin);
|
||||
}
|
||||
|
||||
bool GET_ARRAY_IS_DIGITAL(const pin_t pin) {
|
||||
return (!LPC176x::pin_has_adc(pin) || !LPC176x::pin_adc_enabled(pin));
|
||||
}
|
||||
#define GET_ARRAY_IS_DIGITAL(x) ((bool) pin_array[x].is_digital)
|
||||
|
@@ -26,39 +26,22 @@
|
||||
|
||||
#include "tft_spi.h"
|
||||
|
||||
//TFT_SPI tft;
|
||||
|
||||
SPIClass TFT_SPI::SPIx(1);
|
||||
|
||||
#define TFT_CS_H WRITE(TFT_CS_PIN, HIGH)
|
||||
#define TFT_CS_L WRITE(TFT_CS_PIN, LOW)
|
||||
|
||||
#define TFT_DC_H WRITE(TFT_DC_PIN, HIGH)
|
||||
#define TFT_DC_L WRITE(TFT_DC_PIN, LOW)
|
||||
|
||||
#define TFT_RST_H WRITE(TFT_RESET_PIN, HIGH)
|
||||
#define TFT_RST_L WRITE(TFT_RESET_PIN, LOW)
|
||||
|
||||
#define TFT_BLK_H WRITE(TFT_BACKLIGHT_PIN, HIGH)
|
||||
#define TFT_BLK_L WRITE(TFT_BACKLIGHT_PIN, LOW)
|
||||
|
||||
void TFT_SPI::Init() {
|
||||
#if PIN_EXISTS(TFT_RESET)
|
||||
SET_OUTPUT(TFT_RESET_PIN);
|
||||
TFT_RST_H;
|
||||
OUT_WRITE(TFT_RESET_PIN, HIGH);
|
||||
delay(100);
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
||||
SET_OUTPUT(TFT_BACKLIGHT_PIN);
|
||||
TFT_BLK_H;
|
||||
OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
||||
#endif
|
||||
|
||||
SET_OUTPUT(TFT_DC_PIN);
|
||||
SET_OUTPUT(TFT_CS_PIN);
|
||||
|
||||
TFT_DC_H;
|
||||
TFT_CS_H;
|
||||
WRITE(TFT_DC_PIN, HIGH);
|
||||
WRITE(TFT_CS_PIN, HIGH);
|
||||
|
||||
/**
|
||||
* STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz
|
||||
@@ -97,7 +80,7 @@ void TFT_SPI::Init() {
|
||||
void TFT_SPI::DataTransferBegin(uint16_t DataSize) {
|
||||
SPIx.setDataSize(DataSize);
|
||||
SPIx.begin();
|
||||
TFT_CS_L;
|
||||
WRITE(TFT_CS_PIN, LOW);
|
||||
}
|
||||
|
||||
uint32_t TFT_SPI::GetID() {
|
||||
@@ -116,7 +99,7 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) {
|
||||
SPIx.setDataSize(DATASIZE_8BIT);
|
||||
SPIx.setClock(SPI_CLOCK_DIV64);
|
||||
SPIx.begin();
|
||||
TFT_CS_L;
|
||||
WRITE(TFT_CS_PIN, LOW);
|
||||
WriteReg(Reg);
|
||||
|
||||
LOOP_L_N(i, 4) {
|
||||
@@ -131,21 +114,15 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) {
|
||||
return data >> 7;
|
||||
}
|
||||
|
||||
bool TFT_SPI::isBusy() {
|
||||
return false;
|
||||
}
|
||||
bool TFT_SPI::isBusy() { return false; }
|
||||
|
||||
void TFT_SPI::Abort() {
|
||||
DataTransferEnd();
|
||||
}
|
||||
void TFT_SPI::Abort() { DataTransferEnd(); }
|
||||
|
||||
void TFT_SPI::Transmit(uint16_t Data) {
|
||||
SPIx.transfer(Data);
|
||||
}
|
||||
void TFT_SPI::Transmit(uint16_t Data) { SPIx.transfer(Data); }
|
||||
|
||||
void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) {
|
||||
DataTransferBegin(DATASIZE_16BIT); //16
|
||||
TFT_DC_H;
|
||||
DataTransferBegin(DATASIZE_16BIT);
|
||||
WRITE(TFT_DC_PIN, HIGH);
|
||||
SPIx.dmaSend(Data, Count, MemoryIncrease);
|
||||
DataTransferEnd();
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "../../../inc/MarlinConfig.h"
|
||||
|
||||
#if HAS_TFT_XPT2046 || HAS_TOUCH_BUTTONS
|
||||
#if HAS_TFT_XPT2046 || HAS_RES_TOUCH_BUTTONS
|
||||
|
||||
#include "xpt2046.h"
|
||||
#include <SPI.h>
|
||||
|
@@ -54,7 +54,7 @@ enum XPTCoordinate : uint8_t {
|
||||
XPT2046_Z2 = 0x40 | XPT2046_CONTROL | XPT2046_DFR_MODE,
|
||||
};
|
||||
|
||||
#if !defined(XPT2046_Z1_THRESHOLD)
|
||||
#ifndef XPT2046_Z1_THRESHOLD
|
||||
#define XPT2046_Z1_THRESHOLD 10
|
||||
#endif
|
||||
|
||||
|
@@ -40,7 +40,7 @@ void HAL_timer_init() {
|
||||
|
||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
||||
switch (timer_num) {
|
||||
case 0:
|
||||
case MF_TIMER_STEP:
|
||||
LPC_TIM0->MCR = _BV(SBIT_MR0I) | _BV(SBIT_MR0R); // Match on MR0, reset on MR0, interrupts when NVIC enables them
|
||||
LPC_TIM0->MR0 = uint32_t(STEPPER_TIMER_RATE) / frequency; // Match value (period) to set frequency
|
||||
LPC_TIM0->TCR = _BV(SBIT_CNTEN); // Counter Enable
|
||||
@@ -49,7 +49,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
||||
NVIC_EnableIRQ(TIMER0_IRQn);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case MF_TIMER_TEMP:
|
||||
LPC_TIM1->MCR = _BV(SBIT_MR0I) | _BV(SBIT_MR0R); // Match on MR0, reset on MR0, interrupts when NVIC enables them
|
||||
LPC_TIM1->MR0 = uint32_t(TEMP_TIMER_RATE) / frequency;
|
||||
LPC_TIM1->TCR = _BV(SBIT_CNTEN); // Counter Enable
|
||||
|
@@ -60,17 +60,17 @@ typedef uint32_t hal_timer_t;
|
||||
|
||||
#define HAL_TIMER_RATE ((F_CPU) / 4) // frequency of timers peripherals
|
||||
|
||||
#ifndef STEP_TIMER_NUM
|
||||
#define STEP_TIMER_NUM 0 // Timer Index for Stepper
|
||||
#ifndef MF_TIMER_STEP
|
||||
#define MF_TIMER_STEP 0 // Timer Index for Stepper
|
||||
#endif
|
||||
#ifndef PULSE_TIMER_NUM
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#ifndef MF_TIMER_PULSE
|
||||
#define MF_TIMER_PULSE MF_TIMER_STEP
|
||||
#endif
|
||||
#ifndef TEMP_TIMER_NUM
|
||||
#define TEMP_TIMER_NUM 1 // Timer Index for Temperature
|
||||
#ifndef MF_TIMER_TEMP
|
||||
#define MF_TIMER_TEMP 1 // Timer Index for Temperature
|
||||
#endif
|
||||
#ifndef PWM_TIMER_NUM
|
||||
#define PWM_TIMER_NUM 3 // Timer Index for PWM
|
||||
#ifndef MF_TIMER_PWM
|
||||
#define MF_TIMER_PWM 3 // Timer Index for PWM
|
||||
#endif
|
||||
|
||||
#define TEMP_TIMER_RATE 1000000
|
||||
@@ -84,23 +84,23 @@ typedef uint32_t hal_timer_t;
|
||||
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
|
||||
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
|
||||
|
||||
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(STEP_TIMER_NUM)
|
||||
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(STEP_TIMER_NUM)
|
||||
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM)
|
||||
#define ENABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_STEP)
|
||||
#define DISABLE_STEPPER_DRIVER_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_STEP)
|
||||
#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(MF_TIMER_STEP)
|
||||
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(MF_TIMER_TEMP)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP)
|
||||
|
||||
#ifndef HAL_STEP_TIMER_ISR
|
||||
#define HAL_STEP_TIMER_ISR() _HAL_TIMER_ISR(STEP_TIMER_NUM)
|
||||
#define HAL_STEP_TIMER_ISR() _HAL_TIMER_ISR(MF_TIMER_STEP)
|
||||
#endif
|
||||
#ifndef HAL_TEMP_TIMER_ISR
|
||||
#define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM)
|
||||
#define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(MF_TIMER_TEMP)
|
||||
#endif
|
||||
|
||||
// Timer references by index
|
||||
#define STEP_TIMER_PTR _HAL_TIMER(STEP_TIMER_NUM)
|
||||
#define TEMP_TIMER_PTR _HAL_TIMER(TEMP_TIMER_NUM)
|
||||
#define STEP_TIMER_PTR _HAL_TIMER(MF_TIMER_STEP)
|
||||
#define TEMP_TIMER_PTR _HAL_TIMER(MF_TIMER_TEMP)
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
@@ -110,38 +110,38 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||
|
||||
FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
|
||||
switch (timer_num) {
|
||||
case 0: STEP_TIMER_PTR->MR0 = compare; break; // Stepper Timer Match Register 0
|
||||
case 1: TEMP_TIMER_PTR->MR0 = compare; break; // Temp Timer Match Register 0
|
||||
case MF_TIMER_STEP: STEP_TIMER_PTR->MR0 = compare; break; // Stepper Timer Match Register 0
|
||||
case MF_TIMER_TEMP: TEMP_TIMER_PTR->MR0 = compare; break; // Temp Timer Match Register 0
|
||||
}
|
||||
}
|
||||
|
||||
FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) {
|
||||
switch (timer_num) {
|
||||
case 0: return STEP_TIMER_PTR->MR0; // Stepper Timer Match Register 0
|
||||
case 1: return TEMP_TIMER_PTR->MR0; // Temp Timer Match Register 0
|
||||
case MF_TIMER_STEP: return STEP_TIMER_PTR->MR0; // Stepper Timer Match Register 0
|
||||
case MF_TIMER_TEMP: return TEMP_TIMER_PTR->MR0; // Temp Timer Match Register 0
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
|
||||
switch (timer_num) {
|
||||
case 0: return STEP_TIMER_PTR->TC; // Stepper Timer Count
|
||||
case 1: return TEMP_TIMER_PTR->TC; // Temp Timer Count
|
||||
case MF_TIMER_STEP: return STEP_TIMER_PTR->TC; // Stepper Timer Count
|
||||
case MF_TIMER_TEMP: return TEMP_TIMER_PTR->TC; // Temp Timer Count
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
FORCE_INLINE static void HAL_timer_enable_interrupt(const uint8_t timer_num) {
|
||||
switch (timer_num) {
|
||||
case 0: NVIC_EnableIRQ(TIMER0_IRQn); break; // Enable interrupt handler
|
||||
case 1: NVIC_EnableIRQ(TIMER1_IRQn); break; // Enable interrupt handler
|
||||
case MF_TIMER_STEP: NVIC_EnableIRQ(TIMER0_IRQn); break; // Enable interrupt handler
|
||||
case MF_TIMER_TEMP: NVIC_EnableIRQ(TIMER1_IRQn); break; // Enable interrupt handler
|
||||
}
|
||||
}
|
||||
|
||||
FORCE_INLINE static void HAL_timer_disable_interrupt(const uint8_t timer_num) {
|
||||
switch (timer_num) {
|
||||
case 0: NVIC_DisableIRQ(TIMER0_IRQn); break; // Disable interrupt handler
|
||||
case 1: NVIC_DisableIRQ(TIMER1_IRQn); break; // Disable interrupt handler
|
||||
case MF_TIMER_STEP: NVIC_DisableIRQ(TIMER0_IRQn); break; // Disable interrupt handler
|
||||
case MF_TIMER_TEMP: NVIC_DisableIRQ(TIMER1_IRQn); break; // Disable interrupt handler
|
||||
}
|
||||
|
||||
// We NEED memory barriers to ensure Interrupts are actually disabled!
|
||||
@@ -157,17 +157,17 @@ FORCE_INLINE static bool NVIC_GetEnableIRQ(IRQn_Type IRQn) {
|
||||
|
||||
FORCE_INLINE static bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
|
||||
switch (timer_num) {
|
||||
case 0: return NVIC_GetEnableIRQ(TIMER0_IRQn); // Check if interrupt is enabled or not
|
||||
case 1: return NVIC_GetEnableIRQ(TIMER1_IRQn); // Check if interrupt is enabled or not
|
||||
case MF_TIMER_STEP: return NVIC_GetEnableIRQ(TIMER0_IRQn); // Check if interrupt is enabled or not
|
||||
case MF_TIMER_TEMP: return NVIC_GetEnableIRQ(TIMER1_IRQn); // Check if interrupt is enabled or not
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
|
||||
switch (timer_num) {
|
||||
case 0: SBI(STEP_TIMER_PTR->IR, SBIT_CNTEN); break;
|
||||
case 1: SBI(TEMP_TIMER_PTR->IR, SBIT_CNTEN); break;
|
||||
case MF_TIMER_STEP: SBI(STEP_TIMER_PTR->IR, SBIT_CNTEN); break;
|
||||
case MF_TIMER_TEMP: SBI(TEMP_TIMER_PTR->IR, SBIT_CNTEN); break;
|
||||
}
|
||||
}
|
||||
|
||||
#define HAL_timer_isr_epilogue(TIMER_NUM)
|
||||
#define HAL_timer_isr_epilogue(T)
|
||||
|
@@ -59,7 +59,7 @@
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB
|
||||
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
#include "../../shared/HAL_SPI.h"
|
||||
|
||||
#ifndef LCD_SPI_SPEED
|
||||
|
@@ -79,7 +79,7 @@
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB
|
||||
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
|
||||
#define I2C_SLA (0x3C*2)
|
||||
//#define I2C_CMD_MODE 0x080
|
||||
|
@@ -59,7 +59,7 @@
|
||||
|
||||
#if HAS_MARLINUI_U8GLIB
|
||||
|
||||
#include <U8glib.h>
|
||||
#include <U8glib-HAL.h>
|
||||
#include "../../shared/HAL_SPI.h"
|
||||
#include "../../shared/Delay.h"
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user