Compare commits
1355 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0640bd0282 | |||
| 21ba70d587 | |||
| dcd405275c | |||
| 99f98890c2 | |||
| 5f0026893f | |||
| 4f943a73bc | |||
| e31923be8d | |||
| 395235a529 | |||
| 55848a4bd8 | |||
| 19e768d43d | |||
| 3c7cdcdc22 | |||
| e0d487e339 | |||
| defff1e4a8 | |||
| 05a6d48753 | |||
| b12eb33feb | |||
| 00749d8ef0 | |||
| 59d047c1d7 | |||
| fb6b62a01b | |||
| 1bb5791e64 | |||
| e47316c9d3 | |||
| 88c0688961 | |||
| aa9cad0cc6 | |||
| 0950527437 | |||
| b7306ef07f | |||
| 0fc3fea8df | |||
| b5677907d0 | |||
| 6f40d57e14 | |||
| 20f6a4582d | |||
| e0dba46271 | |||
| 2aaf66b789 | |||
| fdd85a529a | |||
| 477e36afab | |||
| 1068798465 | |||
| 4f375cd17d | |||
| 98159c0507 | |||
| ea345b1db7 | |||
| 51a0f7aaba | |||
| ab7f1a0608 | |||
| 201bbaacfc | |||
| 3929deed10 | |||
| 435981056e | |||
| e6f46f3832 | |||
| 1aea024589 | |||
| ce6a691999 | |||
| 10d73155b0 | |||
| 4b1b02a17d | |||
| f0bca012a5 | |||
| 56d355f8de | |||
| f5fc851925 | |||
| 7378905053 | |||
| 76b0df6ba1 | |||
| df8420aa62 | |||
| 72a047d549 | |||
| 3a511e4583 | |||
| e8d3ea803d | |||
| c5a4230a6a | |||
| 5249765508 | |||
| fdf83f1416 | |||
| e1b998e40a | |||
| 4277fcb32c | |||
| 9a4af6bd7c | |||
| 59265034ae | |||
| 0ac0324af2 | |||
| f38f2ace5a | |||
| b10831d58e | |||
| 817eb5a5ba | |||
| f36f91dfb5 | |||
| 172ea8c71c | |||
| da9748fb21 | |||
| be58e137c5 | |||
| 8519451161 | |||
| 7c1adff8ad | |||
| eca1509cb2 | |||
| 17b05c150c | |||
| bdf69db0a8 | |||
| ba48ce8586 | |||
| 5cce532a29 | |||
| a20eacaa48 | |||
| 4f042533a5 | |||
| 6e8da93c42 | |||
| bb33a26e62 | |||
| da2eaa6b09 | |||
| 8244284116 | |||
| db204c13f2 | |||
| 08d9aeff41 | |||
| aa1b4eded6 | |||
| 684692091e | |||
| ccca1ade2d | |||
| dc9e469c4c | |||
| ec028bf747 | |||
| 009920f393 | |||
| 666d95285b | |||
| b692d91ca3 | |||
| f4c31565bc | |||
| cf0604da07 | |||
| 55acb65e27 | |||
| 4f465c2d07 | |||
| 77519e9f14 | |||
| 22baf3356a | |||
| 360c553228 | |||
| b4d69527e6 | |||
| 4aba382b01 | |||
| 2c445743e9 | |||
| 6f38814541 | |||
| 7251850028 | |||
| 6eb268f63f | |||
| ae547c3044 | |||
| 23dd2cb6e7 | |||
| 8385cddd8d | |||
| ab5133514c | |||
| 75eb93140f | |||
| 8be7a0b131 | |||
| cd6468d6de | |||
| 822254291f | |||
| e29bf84f06 | |||
| 44800e9899 | |||
| 6e85c060a9 | |||
| 7c6d33b0d2 | |||
| 86b65e52c4 | |||
| 6310a00d7e | |||
| 6b93d20e4e | |||
| 909fac6d90 | |||
| 6c328ec096 | |||
| 1951d3a37a | |||
| aa7236e03c | |||
| 574153a810 | |||
| 3b30cc90f1 | |||
| f30b774f26 | |||
| 1063b3b2b8 | |||
| 93560836de | |||
| ff26b7446c | |||
| 7b6ad28a5d | |||
| 5d01a2f467 | |||
| 6e197d4a42 | |||
| a5b20fec2f | |||
| 348e989a50 | |||
| b19846aca1 | |||
| d951ba83e6 | |||
| 203a445bc1 | |||
| 9edefa645d | |||
| 4608e1f590 | |||
| 794f8f1329 | |||
| b1f3dfab28 | |||
| 2d6c84a817 | |||
| 23291a0466 | |||
| 83a1a70103 | |||
| 47f6fc1e07 | |||
| 88b34d2bb6 | |||
| f36fdc74ac | |||
| ff258d43e7 | |||
| d8ef6faa80 | |||
| 59eb77fd28 | |||
| dde0e9ee0a | |||
| 860d98a897 | |||
| 3abd307691 | |||
| 000818f5e4 | |||
| 1bbf55a7f7 | |||
| 298a357a43 | |||
| 44d2c5ef88 | |||
| 1600f7d4ee | |||
| 71a4c04dd5 | |||
| 0eef0ff0de | |||
| 1d0ee83e18 | |||
| db8631e49a | |||
| 2e295759f2 | |||
| d8582b7506 | |||
| 7f656b867f | |||
| 077fed1d88 | |||
| 152c5d2616 | |||
| 26c5bbc5a7 | |||
| 344e6b857a | |||
| 81e52138cc | |||
| a27a9b63e4 | |||
| 8b7c274db5 | |||
| 7bed539fdb | |||
| e990fd23f1 | |||
| 172ce67344 | |||
| a8d83aec89 | |||
| 38e5883d44 | |||
| e7c6abd767 | |||
| 9f7405b3f0 | |||
| d3f8111fe7 | |||
| ab43113f73 | |||
| d1a807fdf8 | |||
| 8df42a84a4 | |||
| 8f462b5717 | |||
| ace3e50898 | |||
| 68c1f05aeb | |||
| 1f770bb103 | |||
| e25567a5dd | |||
| 9951f28892 | |||
| 83ab68b36f | |||
| 80929c2637 | |||
| d786fb99e2 | |||
| a0fc5f7b52 | |||
| a6d39b7192 | |||
| ea87cd975d | |||
| 417a82fd95 | |||
| b781f76711 | |||
| 228d6050a4 | |||
| fd50f452ff | |||
| 6eedb64777 | |||
| 46776de90b | |||
| dfcef11bca | |||
| f1757f30cb | |||
| ddab1533c5 | |||
| 44c7f86f49 | |||
| 915c4b9ce2 | |||
| d7cc26cc17 | |||
| 5bc5ba7ee3 | |||
| 82df656cc7 | |||
| 51d09bb9c9 | |||
| 5a1f1305f0 | |||
| 3cf31205bc | |||
| 26a40373fc | |||
| 6b9e7defac | |||
| a63d9cc550 | |||
| 1e84cded98 | |||
| bb0cc1bbbc | |||
| 941ffea81c | |||
| 737cee4b8c | |||
| d3165cca4f | |||
| 2060ba3556 | |||
| e56ead5e1c | |||
| 4c93153194 | |||
| 8b9e68c32d | |||
| b2d3fffe74 | |||
| b5c5b175f1 | |||
| ecf19344f6 | |||
| b2473e57dd | |||
| d38aaa0c7e | |||
| 8696f98c3b | |||
| adee17847c | |||
| a7d82bd73b | |||
| de67c3f235 | |||
| 59a699063a | |||
| ff800e08fd | |||
| c0190eff00 | |||
| 4e445f2c55 | |||
| 9da817eae0 | |||
| a77e513443 | |||
| 664d386623 | |||
| 7cf4009838 | |||
| f8e30f49d7 | |||
| 5c087727a9 | |||
| 3b431f2f72 | |||
| e5b43d48ee | |||
| 8282d732c1 | |||
| 82f41d6e46 | |||
| b8c65078fc | |||
| 04419af419 | |||
| ed6a5ff7e5 | |||
| 956680104b | |||
| 3958ff8627 | |||
| 99b71c1dde | |||
| 73ddc762c8 | |||
| 7a5b3a1e6a | |||
| e2568d7589 | |||
| 0b1d754e7d | |||
| bbc2ee6da1 | |||
| 6ebf8ea230 | |||
| b96ceb4256 | |||
| b6dbc4c5c1 | |||
| 12b018e619 | |||
| 9b80e1e04a | |||
| bf6a1816b4 | |||
| 4f05a66ee1 | |||
| dcc9b0d437 | |||
| 622d100c30 | |||
| 74997a5251 | |||
| 50148f7185 | |||
| 8f57a3e28a | |||
| 2511e869e2 | |||
| aa612124f2 | |||
| 3e050fb35a | |||
| 3dee10636c | |||
| eb3bdb7550 | |||
| 33fdb9ab8b | |||
| 97c19de8b9 | |||
| 4e19c59ab3 | |||
| 9cf5b96971 | |||
| 0eed5e0667 | |||
| 69a710fef1 | |||
| d2613ce077 | |||
| f2e222b9e8 | |||
| a6ee4a0468 | |||
| d3b8f30818 | |||
| 2390f6d3ab | |||
| d8b1343279 | |||
| eacb6b6e8b | |||
| 7efffc1548 | |||
| 10e366ebd7 | |||
| 95590adf07 | |||
| be67acbd48 | |||
| 8d06cf7b84 | |||
| 216f9b45cc | |||
| 645b586041 | |||
| 1962c13455 | |||
| 069ec3f9a9 | |||
| 56035e9965 | |||
| 4e3b566f72 | |||
| d65c99f38b | |||
| 90c7d28055 | |||
| 8b684637bc | |||
| d2df00bfca | |||
| 25ec0fecfa | |||
| 227b96b28b | |||
| a2fc7da587 | |||
| a2c013c8c7 | |||
| f27196214b | |||
| aa616cd410 | |||
| 5926159890 | |||
| c9f88297b8 | |||
| 5cc87abb3a | |||
| 355dfed437 | |||
| 802ae73b13 | |||
| 549c814e8d | |||
| 564fbc8dec | |||
| 972248c333 | |||
| df44bcc5ae | |||
| 3293823642 | |||
| 24b302c001 | |||
| 4714fb8fcb | |||
| 2a54fd1444 | |||
| b0ff3a4c6d | |||
| 7aadfe32e7 | |||
| 8ce9306b27 | |||
| 438e894899 | |||
| 80682ec61e | |||
| deaa70c2cc | |||
| 7535c21894 | |||
| 8327667988 | |||
| b6b4bf0959 | |||
| d60619f8e5 | |||
| 658e1ebe5a | |||
| 54963cc898 | |||
| ad879a1f90 | |||
| 513f25d42c | |||
| 2559745f54 | |||
| 7326fe1136 | |||
| 97a43f0c2f | |||
| 279b73fecd | |||
| 87b655e59e | |||
| 677d490b5c | |||
| 6ee4ba6932 | |||
| 77cef3bef2 | |||
| 4a857f1af6 | |||
| 50a1352f7f | |||
| 1d0739d6d1 | |||
| 69a7d4e0a5 | |||
| 2fb35f7991 | |||
| 5fe15c7f10 | |||
| 094bebcc2d | |||
| abb15bc30a | |||
| 8e18e05d1d | |||
| aa80882bdf | |||
| e4466b55b5 | |||
| 60ea0f1222 | |||
| b60efb4230 | |||
| 2f4a42b313 | |||
| fff4d71ba5 | |||
| e1ab285435 | |||
| 26ebeadfaa | |||
| 30e4b85587 | |||
| 44edffa0a9 | |||
| 20b57f9d38 | |||
| ddf5d68815 | |||
| 298863c2d0 | |||
| 8e8787ad63 | |||
| 12151e62ee | |||
| efc1029226 | |||
| 1b09733e7c | |||
| d8ef9bda18 | |||
| 1b870377b1 | |||
| 267c247da7 | |||
| 95296191a2 | |||
| 8ab368559a | |||
| bb111b928b | |||
| 91abf07087 | |||
| e642a64b68 | |||
| 64f077fd2a | |||
| 5fefa200ba | |||
| 4388719c5d | |||
| 46c2841904 | |||
| 03904697ac | |||
| 9bd230cf64 | |||
| 309890cb8c | |||
| f9f0ee0f21 | |||
| 640526f0c8 | |||
| 9af9596f69 | |||
| 6e9093c288 | |||
| 0c4e9980fb | |||
| 13a3fb1acc | |||
| 343dd1c0b8 | |||
| 64029ef8a6 | |||
| 524f4ee0cf | |||
| 34aeaec553 | |||
| 0e4b6b373d | |||
| 193a0e9273 | |||
| 39cc36d3f1 | |||
| 87d3a1ae4d | |||
| 5289c4135a | |||
| dcd7949544 | |||
| 277eb16d67 | |||
| 41ba4e507e | |||
| c9980c0a5c | |||
| 3e9504d306 | |||
| 1b68ee82ce | |||
| 4bf0e15653 | |||
| b63a55666d | |||
| f02ca2a9a3 | |||
| 4fb3ce4739 | |||
| 704640bf98 | |||
| b48a77c88a | |||
| db6de76acb | |||
| 15be1cb9a9 | |||
| 4817c0d055 | |||
| 893092ff7f | |||
| 8b7c1e9cec | |||
| 393ceb28fc | |||
| d9cb7be444 | |||
| 5837f067cf | |||
| 5e5a177934 | |||
| 0b5b03d9dc | |||
| 9288d80613 | |||
| 6698db29de | |||
| 25e86a520d | |||
| a6f7cda23e | |||
| b0e282a74b | |||
| 46ed54cd8e | |||
| 9c870baf84 | |||
| 21249f7c3d | |||
| 471c2b5d5c | |||
| e792c2b234 | |||
| daa85f71e1 | |||
| 9850ba0cbd | |||
| c0a8275cb0 | |||
| 318c419f77 | |||
| 7e1232269a | |||
| 62d52d62dc | |||
| 77cf42588f | |||
| 50f6c645de | |||
| 7ade65d44b | |||
| a979c428ee | |||
| 6920769a9a | |||
| 410aa0716d | |||
| 445a7f65cd | |||
| e64cfb13b8 | |||
| e374d87ac4 | |||
| 2296d98845 | |||
| 9aac3d8773 | |||
| 6569b9ba56 | |||
| 7ab9abe4ef | |||
| 3357170b18 | |||
| 2e746f2b8b | |||
| 594c075377 | |||
| 8bb1e91afd | |||
| a12d1b21b5 | |||
| 5bed2f351a | |||
| 209560fcd2 | |||
| ec9d7b639d | |||
| 1c97c1582c | |||
| f06f4b40b8 | |||
| 3235beef6d | |||
| e5ab783b08 | |||
| 355ebec92d | |||
| fa157f08ff | |||
| 39a545b3f8 | |||
| 226fe192a1 | |||
| e9bc9a2ab4 | |||
| b22c87183f | |||
| fa44130734 | |||
| 9b3f27f02a | |||
| 1d5fb360cc | |||
| a7398a0459 | |||
| 91c5c2538a | |||
| 259cf1b0b2 | |||
| 2338632270 | |||
| 2a88a3fd33 | |||
| 84470f6b2a | |||
| 10d72f31c2 | |||
| e04902f589 | |||
| 31d0b77df7 | |||
| 9e82533eb9 | |||
| 4410aac60b | |||
| d63d08ef8b | |||
| 5911dc597a | |||
| 5c2ff6ed19 | |||
| 6efad5e495 | |||
| 5f708d47ce | |||
| 23dbaaf03b | |||
| 3b4b9c6d68 | |||
| 8df47d76c7 | |||
| be55a49946 | |||
| e05af35678 | |||
| 060d16d26b | |||
| 0976d22225 | |||
| 8dc10fb4c2 | |||
| 3571dd0ad6 | |||
| e17869ca20 | |||
| 1c3d06876e | |||
| 662105c1b6 | |||
| b8ddae61e2 | |||
| ece14af556 | |||
| b07a2aa23c | |||
| 88857e8028 | |||
| 8e808fcadc | |||
| da93a272a0 | |||
| fcd3b326e9 | |||
| 3d5b10735f | |||
| 94228d4522 | |||
| 22c968ee32 | |||
| f054f566b4 | |||
| 167058b61f | |||
| f835245ee1 | |||
| 98c7bde514 | |||
| 38110e220d | |||
| 75e4867d22 | |||
| 9239fcf0da | |||
| 73c5675485 | |||
| 381ebc043f | |||
| c7e0a49c94 | |||
| 067622fcc6 | |||
| ae256576e1 | |||
| cbfcce09fa | |||
| a21201a713 | |||
| 53f2f188f2 | |||
| a6e95c7d25 | |||
| 97e6663bb3 | |||
| e2ceb1b800 | |||
| 8c93295d62 | |||
| c26242a553 | |||
| b825bc87ae | |||
| dac5f20a01 | |||
| b211fa4e1f | |||
| a4954a68e0 | |||
| 355cba4aa7 | |||
| 2f0164b995 | |||
| e287e14354 | |||
| 5e63ba970d | |||
| 2a46ab288e | |||
| 7999249a5c | |||
| 0ec9a7f090 | |||
| a47c5c093d | |||
| 5a674a8e10 | |||
| bcb8722513 | |||
| 4c34b3ad9c | |||
| 1b8b5c4b06 | |||
| 451c1fb5f9 | |||
| 4e19ff75b6 | |||
| 94caabf89a | |||
| f365448338 | |||
| 3d1536a1b2 | |||
| 8ab426c3a4 | |||
| 33d28c24bf | |||
| ac70048945 | |||
| 40a4a716e1 | |||
| 802f147686 | |||
| 80a0f935a1 | |||
| de3c9bade6 | |||
| 7f8ff0a724 | |||
| 3a8923be74 | |||
| 723a34d9c7 | |||
| 2efd5b119d | |||
| b105e47cb5 | |||
| 0c2cefed8f | |||
| 41dcbe89dd | |||
| 70a64355f6 | |||
| aefd2a5c4b | |||
| e37a1ded0d | |||
| 3e28243076 | |||
| bbb94b8f68 | |||
| a277b43e30 | |||
| 8a994fb1b1 | |||
| 9ee92f1246 | |||
| ac2ac99e15 | |||
| 72e9534d11 | |||
| c1cc79176c | |||
| f25dccd6d1 | |||
| cd09a83cfa | |||
| 9bbc2df217 | |||
| 74d430cb97 | |||
| ca13f4c3dd | |||
| 9d4d53e2fd | |||
| 00896f1713 | |||
| c3a9e95a5f | |||
| 0afd25a010 | |||
| 5b87843fae | |||
| 386b74f8c2 | |||
| 2a963fb5d1 | |||
| d69c5317df | |||
| 367e1b54ba | |||
| 41e4de62b3 | |||
| 8a184a526a | |||
| 353c23b16e | |||
| 898f48e331 | |||
| 5851c2d36f | |||
| 9c00cff898 | |||
| f9b9df2497 | |||
| 52073f21c5 | |||
| 321f98f867 | |||
| 9721c77fb9 | |||
| 36771e9492 | |||
| 3f0b38ed5d | |||
| ca9734805c | |||
| 0067bb2840 | |||
| 2b12093589 | |||
| ddfe527ff2 | |||
| 54d48130f3 | |||
| 86c024ce98 | |||
| c7b07d20f2 | |||
| 356af7dcb0 | |||
| 11a724d8fc | |||
| d29bf49b66 | |||
| e337df2e98 | |||
| c0409b85e7 | |||
| e82e9073d6 | |||
| 69d1052010 | |||
| 6127154af3 | |||
| b94a1c6b9f | |||
| 405a2132f3 | |||
| 869d7f3703 | |||
| 101ba70517 | |||
| 5e14bb61de | |||
| 4817b39d98 | |||
| 6772e33ef6 | |||
| 385f1bb9e5 | |||
| 2a31c9f2ce | |||
| 5fa61c0ad3 | |||
| b3f59ec945 | |||
| b33739d493 | |||
| a1878cd1c0 | |||
| 0a18fb735e | |||
| 30887feae3 | |||
| 257b693ab0 | |||
| ab2ac1af71 | |||
| f1843211e6 | |||
| be5ca34215 | |||
| 06541ec885 | |||
| e9c72978c7 | |||
| 96ae53cf41 | |||
| 6172f150c2 | |||
| 3be9c19f12 | |||
| 8fd58cd6dc | |||
| 75e6f72c89 | |||
| ac76101ec3 | |||
| 75e6ead5fd | |||
| 6bd63d27b5 | |||
| f54e0fc90f | |||
| 0938c62b48 | |||
| 9d95b1b4df | |||
| 35d5a7bdff | |||
| 419c8969a7 | |||
| 25a11cd485 | |||
| 7f3406d47b | |||
| 2864ef8c7f | |||
| 534bbb81ff | |||
| 3e5485de92 | |||
| 9e147e9ac4 | |||
| 8ab2e420f6 | |||
| b4c53af07d | |||
| 6440904c1c | |||
| 97c21e9007 | |||
| 82cfdd4d8f | |||
| b2822a59f9 | |||
| a7e5c1bf19 | |||
| dd66d21749 | |||
| b370906031 | |||
| 804818b4d9 | |||
| dd841a3675 | |||
| 0fd2923a9f | |||
| 8b97da0e3d | |||
| db188934d1 | |||
| 24af9e1bf4 | |||
| 8443872d10 | |||
| 6827a162bb | |||
| 43d298a324 | |||
| 3497153cf1 | |||
| 16f8c4865a | |||
| 50bfcf4c3e | |||
| 622048ffb0 | |||
| 65a36948c0 | |||
| c6509076c4 | |||
| 2cbdc0ebb6 | |||
| 650e5274c4 | |||
| ce65c13a97 | |||
| 6ef71c3d5f | |||
| 936dfb965c | |||
| ffe3013bb5 | |||
| 7ef0650504 | |||
| e948f77cf9 | |||
| 08b0456d91 | |||
| 850e404838 | |||
| 936d00dda8 | |||
| 29eef360d0 | |||
| 894608f8a3 | |||
| ff06e1a030 | |||
| 15e009b6ca | |||
| 8b0bd44b1e | |||
| bfd396c13a | |||
| 48c5f3dddf | |||
| be7a9a07c5 | |||
| dfe670247d | |||
| af83c512b8 | |||
| 4eff18854b | |||
| 14482d2f2a | |||
| 9fc72422e4 | |||
| fee696db5d | |||
| 423b0f3a1e | |||
| 283d15a8d0 | |||
| e52c1a0882 | |||
| 5b69d67da9 | |||
| 51864fd365 | |||
| dc7c95e07b | |||
| a972c060d7 | |||
| 42aa10d263 | |||
| 4718c09c48 | |||
| 21591352d7 | |||
| 890e7a16a9 | |||
| a059e95463 | |||
| d6d6043548 | |||
| 03989824fa | |||
| 851f9f5399 | |||
| b7a16e4468 | |||
| f38b8c5bf8 | |||
| 60cb2bd4e7 | |||
| 8a3bc6be4d | |||
| b0173ccdb9 | |||
| 7afafb05b8 | |||
| c45798694f | |||
| 72de280c1e | |||
| 4d98e3f0a7 | |||
| e530c67349 | |||
| 2ad3ca5d8a | |||
| 37a6833d7e | |||
| a519b093b9 | |||
| b9809ea86c | |||
| 0873c667fa | |||
| 8c2907d10f | |||
| 9af67e2446 | |||
| e5904c4df8 | |||
| 76e90b93b7 | |||
| f63f1ff12c | |||
| 00e4ced58e | |||
| 1066b17457 | |||
| e927941c06 | |||
| 68aea9c01d | |||
| aaacef9441 | |||
| 4bc79ec877 | |||
| 186580b55f | |||
| 6be369f3ea | |||
| 7fc31a7940 | |||
| 11e376e920 | |||
| a3aa798f6d | |||
| 2065591daf | |||
| 61be28133d | |||
| 9248a90a4c | |||
| ce834bb78e | |||
| 5ef1e5ef60 | |||
| c7732db99d | |||
| f713f25fa5 | |||
| 2cb308fb53 | |||
| fc9ce65095 | |||
| 504d26341a | |||
| c6d430670a | |||
| 11c589c3ec | |||
| 678914be25 | |||
| d3bc877007 | |||
| 700549ee5d | |||
| ef94ddf53c | |||
| 3efe4aeef8 | |||
| 28deff01b8 | |||
| cca1cca3a5 | |||
| a2babb532d | |||
| 8c34233452 | |||
| b8066fb36f | |||
| 20f6676d63 | |||
| c28749a567 | |||
| df87278fce | |||
| 4be8d7720e | |||
| 760bf49a00 | |||
| 567941e341 | |||
| 57fff2e95e | |||
| 94c965fad6 | |||
| 6a3967ee33 | |||
| 534bffa7a9 | |||
| e1e1a0c344 | |||
| ab79933d1f | |||
| 69297b2d7b | |||
| 015839fc50 | |||
| d609489b22 | |||
| 167169e1bf | |||
| 395a9f59ac | |||
| 14663efe0d | |||
| ae5923a3d0 | |||
| 859248433f | |||
| 09c90c2f6c | |||
| 41e0955c27 | |||
| 232a10410d | |||
| 76c92a1fab | |||
| 312f63dbe8 | |||
| cf96109056 | |||
| dcec7178d1 | |||
| 3e78a01262 | |||
| 2ff967f3e6 | |||
| 1ff7d10c80 | |||
| 4cb45c10dd | |||
| abd6ba62b4 | |||
| f17bae1f70 | |||
| 8e0f3b7eba | |||
| 009a6104c5 | |||
| fcceed5be6 | |||
| 457489d7ac | |||
| 30b327d24c | |||
| 6c97c5595c | |||
| 553d5ca283 | |||
| e6e3132f79 | |||
| cd2ac3b759 | |||
| bfbf5f8200 | |||
| 814925d692 | |||
| 406ef69702 | |||
| 379926961c | |||
| 5b03f23fa2 | |||
| e3cedfa0ec | |||
| bb0508b6cf | |||
| 5c1888467f | |||
| 85777a56c6 | |||
| d1e8d4cd9d | |||
| 797d6a97e7 | |||
| b492e0878d | |||
| 98d362c2da | |||
| 80abc872f3 | |||
| e90cbf5c16 | |||
| ada836db29 | |||
| fc140c4962 | |||
| f4246dc8ff | |||
| 66faedb2b8 | |||
| bd776df8c1 | |||
| 05449cf6ee | |||
| 12f092c812 | |||
| 941943c167 | |||
| 5b11b33854 | |||
| a4a587a897 | |||
| ba1706a265 | |||
| c2c8aafda2 | |||
| 627afb29df | |||
| 61d00d8990 | |||
| f0f9fb7465 | |||
| 99592c8458 | |||
| 31514f453a | |||
| 134116b874 | |||
| 89c6e92b66 | |||
| e80958b631 | |||
| fe7e890b09 | |||
| a1632cfa0a | |||
| e687782875 | |||
| 1446b5f01d | |||
| efc6a9c1b8 | |||
| b3c36c98fd | |||
| 3c7bfe798d | |||
| 9651d01e1a | |||
| eb314373bb | |||
| 6c45fa7dcc | |||
| ece89bcf7a | |||
| afbc6e3e2f | |||
| 1e47c17b46 | |||
| ebe6719e12 | |||
| 80a232419d | |||
| 5fb0d401eb | |||
| ed04d0b6be | |||
| 786cdea124 | |||
| ee7163fd3a | |||
| a9f8e518bf | |||
| a18324bc8d | |||
| 254a11b083 | |||
| aeb6d465a4 | |||
| 325f09ea6c | |||
| d26c8cc5c8 | |||
| c7f04fbcc7 | |||
| 4171520729 | |||
| 41bfff14e2 | |||
| 424d0bae8b | |||
| 5c59ee4e93 | |||
| 37bc0fce62 | |||
| d5368461f9 | |||
| e907654d6a | |||
| 6c45d0fd81 | |||
| 8a51e2960c | |||
| 725d9d9a56 | |||
| 499bb85a95 | |||
| 90f5f82926 | |||
| 0c616700f3 | |||
| 6dcf42f1a7 | |||
| a1c65fd3d5 | |||
| 7b79f443ef | |||
| 907cafcbfd | |||
| 17f69f8ca2 | |||
| cfcd069501 | |||
| b8b7ef1902 | |||
| 42f7f9e013 | |||
| 0b49bddec2 | |||
| 7e028ec429 | |||
| 2e26a7c752 | |||
| 2e1b7d3a22 | |||
| 4c3dc8bf07 | |||
| 4857a3ba48 | |||
| 3d24c329af | |||
| 311f6aff72 | |||
| 8fb30aaed6 | |||
| 6cb9bb27fe | |||
| 43a95ae5ad | |||
| dd1a84b23f | |||
| d4270f15a9 | |||
| c61c0a9aeb | |||
| 062131554f | |||
| 3d043976f7 | |||
| 93da4e83f7 | |||
| 43c96eb31f | |||
| 7c95f762f2 | |||
| 92eb55f246 | |||
| 428be27893 | |||
| 8d5a37fb3d | |||
| 7769a22064 | |||
| d9da126776 | |||
| 499d5c3b24 | |||
| 7164fd499e | |||
| c10d763d98 | |||
| 4ebff8eaa5 | |||
| 09bc34f4dc | |||
| 4414825e0d | |||
| 50c2702ba5 | |||
| 9dda022705 | |||
| b3338ccb01 | |||
| 40bb0cbf7a | |||
| 26d20ebcfc | |||
| 824f71d503 | |||
| 445227c807 | |||
| 699aa35df6 | |||
| 570722a0fe | |||
| 0bc66bf22c | |||
| 896dfa0577 | |||
| e47029199e | |||
| 8326c1c279 | |||
| 979a6a6459 | |||
| 07f8da36d2 | |||
| dce665a083 | |||
| 7b09ab6bda | |||
| 5bdb4bbc5e | |||
| 634b7fa7d4 | |||
| 772275ab0c | |||
| 11e28f389e | |||
| 21217d53df | |||
| da8e946efb | |||
| dde8bb7c8b | |||
| 83263076dc | |||
| ec61b07836 | |||
| 57a51fd5db | |||
| fc89de6d8b | |||
| 6c9b5ab8e8 | |||
| 92011e3d8c | |||
| 7864b133a8 | |||
| 0b6b7c9c7e | |||
| f17a3c2474 | |||
| 5a72b6818e | |||
| 4cc5444144 | |||
| 51bc50214a | |||
| 748bf32388 | |||
| 5426fc1735 | |||
| 87d8223251 | |||
| b378deaf89 | |||
| f4b76b1ee7 | |||
| e94f79ccea | |||
| d91710e9aa | |||
| 761df686bd | |||
| 897bc2ac1f | |||
| 1c107b3949 | |||
| 5b270417ed | |||
| 2f55870edb | |||
| f7dacd1f50 | |||
| 28d72f48f1 | |||
| 76a610cf81 | |||
| 8d1d9040b6 | |||
| a17ffe1ece | |||
| 731c8e6372 | |||
| abb6b8ad54 | |||
| c2eff60d3f | |||
| 1419126721 | |||
| a453be7357 | |||
| 1d615e0a67 | |||
| 707707d71a | |||
| e556ab1dff | |||
| a27b08e6af | |||
| dac29e0f75 | |||
| 9128d9ab45 | |||
| 6bb05c4543 | |||
| b7dc4d9973 | |||
| c9e3caf928 | |||
| 4134a6b526 | |||
| 36cc03a9b4 | |||
| 2a41f0ff84 | |||
| e6d10f6ddd | |||
| 97e13a30ba | |||
| 45c74406cf | |||
| e1c5a43247 | |||
| efc198f952 | |||
| 7f0945d2b1 | |||
| 4406fba994 | |||
| 19b62c14f0 | |||
| d28f5d8a78 | |||
| 5d5ff36446 | |||
| b88957e0d4 | |||
| dd071a4a65 | |||
| 8db1197c9b | |||
| 82e662fc69 | |||
| 2c2b991b59 | |||
| 0dd0033b33 | |||
| ba0bd33c38 | |||
| b2c20a8c0f | |||
| ece7a2bf36 | |||
| d87845052d | |||
| ea74ceb791 | |||
| 04b07a6ecc | |||
| eb8af486d2 | |||
| bfe7fbe5c0 | |||
| 87b591bf53 | |||
| 6411d65c48 | |||
| 46752588b9 | |||
| 5938dae200 | |||
| c5e0f08e35 | |||
| 1e2ccca063 | |||
| e4937b0285 | |||
| 1aab9906e6 | |||
| 663ff7f92a | |||
| 9f295581f0 | |||
| c34d7a29a6 | |||
| 862def2ef4 | |||
| 6a5d3b580d | |||
| d336e413aa | |||
| 789b2928a8 | |||
| fc7d7f87b4 | |||
| 0282452cea | |||
| 9a305a467b | |||
| 90ccac4bcf | |||
| fff50d3958 | |||
| 2130f10de8 | |||
| ebda4663c3 | |||
| e2c3695e11 | |||
| 911079104e | |||
| 65a0212866 | |||
| 147d9d76fc | |||
| 9118e135f9 | |||
| 4288c4fb4f | |||
| 1919cb0d1e | |||
| e800743268 | |||
| 61db0fd102 | |||
| 9a9bbfc57c | |||
| a32f7b329c | |||
| ac33a378c0 | |||
| 445865ea03 | |||
| 4296a8b74e | |||
| 4a96433b7e | |||
| 8d69394ae1 | |||
| c74d4dede6 | |||
| 155aa62fb0 | |||
| a5fa586642 | |||
| 4ecd41ef90 | |||
| 1b41e1f645 | |||
| 65bd4c8c94 | |||
| 7ed0761e09 | |||
| 9657e7d3ee | |||
| 8206bb9bb9 | |||
| df91346188 | |||
| 6354b40231 | |||
| 7236109f2a | |||
| 515f05093f | |||
| b6d5886dce | |||
| 17f8a494bf | |||
| be17033762 | |||
| 89b93058e3 | |||
| 05b66234ae | |||
| 84a0a77c59 | |||
| d33ae33103 | |||
| 266ae8912a | |||
| 6b9ca16f36 | |||
| 74d6dee920 | |||
| d9c8072037 | |||
| bad432add7 | |||
| 46b32e4548 | |||
| ca99d67ede | |||
| 2c7a39bc0e | |||
| 0f1e8c195d | |||
| 5d6366d4e6 | |||
| 51587c4b43 | |||
| 9677f3f2f5 | |||
| fc2eaab7f3 | |||
| c6a7adc293 | |||
| 4cece2d72e | |||
| 2d71569138 | |||
| b2d3c8aedd | |||
| 50ab9c2e04 | |||
| f1e33afda4 | |||
| 78d8c598e1 | |||
| eb39d6e3e2 | |||
| 194f8b2f55 | |||
| 6f89db11f0 | |||
| 25114414cd | |||
| 3fe333143c | |||
| d013bddfa8 | |||
| 58556991da | |||
| 01e7e234c6 | |||
| 0cbe448edf | |||
| a3645ec921 | |||
| 71367fd518 | |||
| b0eae68f57 | |||
| 493f0b0c62 | |||
| f379a326cc | |||
| 33279a1e02 | |||
| ac959b12ee | |||
| 55c700d537 | |||
| f0d545b950 | |||
| 868e7db4ae | |||
| fb5e0ffe16 | |||
| 73ed0c63b4 | |||
| b3a97b5013 | |||
| 78af2b1444 | |||
| 082da23391 | |||
| b1a4788593 | |||
| b15e531464 | |||
| 44e657766e | |||
| 735405b2a4 | |||
| ffa901f373 | |||
| 361cbba113 | |||
| 5ed63a5724 | |||
| 5cbe0244c5 | |||
| 1f52c9f5df | |||
| af81cb4cbb | |||
| 0392329cb9 | |||
| 1d167a6874 | |||
| f4028fe088 | |||
| 002a06c507 | |||
| 2dfb7c212c | |||
| ad915b667e | |||
| 4ce228f2a0 | |||
| 2881f0a48d | |||
| d252d1b6a2 | |||
| 6d574883a0 | |||
| 82ca6248e2 | |||
| 26ffa558a3 | |||
| 3ff7515527 | |||
| 62d8e35adc | |||
| 34cfbc90cd | |||
| 85b967657e | |||
| c99bd69889 | |||
| ad5638f78c | |||
| e271521c39 | |||
| c2ea22da49 | |||
| ceb62fc7e1 | |||
| 48f7652143 | |||
| 850203fb3a | |||
| 3129260c44 | |||
| 3b4116e73b | |||
| 5e8892d6b5 | |||
| 76af9ac7c5 | |||
| ba5910ab6c | |||
| a83f6db679 | |||
| 2c309a8f7c | |||
| 22dbb2117c | |||
| 364f8fb613 | |||
| d7fda2fe49 | |||
| 1519b0e7c1 | |||
| 49599caade | |||
| 02f15f6775 | |||
| 52e20aeab3 | |||
| ea906e4da7 | |||
| c2ca85aeb2 | |||
| 11fc9564c9 | |||
| 8a0a5cfccc | |||
| b29dbbd5e4 | |||
| ebcd1aaf88 | |||
| 0e1f0efc4b | |||
| 6ce2b1ff4a | |||
| b3a38fd300 | |||
| 3c061a9f9a | |||
| dc2d215355 | |||
| 75badae2f8 | |||
| 94a4af1d7f | |||
| 5970fe72d1 | |||
| 01f452c37c | |||
| 47245675fc | |||
| e09b4ce4a5 | |||
| 13599a73c7 | |||
| e16743da45 | |||
| 43c24f0027 | |||
| 3843a5151a | |||
| 6c064bb7d6 | |||
| aad1acc418 | |||
| 3370329751 | |||
| f0fe26c411 | |||
| ffb5353294 | |||
| e806e6419a | |||
| d6f49c6626 | |||
| 55a87da036 | |||
| ffe0e2d19a | |||
| 99c4900a98 | |||
| a3abfeac47 | |||
| 7f4e4b1212 | |||
| 7852369987 | |||
| 00d358d92d | |||
| 13a06711ad | |||
| 4dc49f8424 | |||
| c2321b1cdd | |||
| 455a24f6ff | |||
| 238fb53617 | |||
| 6b6630e11b | |||
| d30e478f97 | |||
| 5a9e52a3e0 | |||
| 8606644343 | |||
| 0cd398c25d | |||
| a5737cba7c | |||
| 0fef9a2983 | |||
| 14a4257c7b | |||
| 56e2e331ed | |||
| 091f94a6bf | |||
| 4ec4ecff1a | |||
| f1a1c6873e | |||
| 2266c0780d | |||
| b213a45efb | |||
| 6f86c46fa6 | |||
| 1fbcbc05f6 | |||
| c262ea92e0 | |||
| b17bcd56da | |||
| 267f77b18b | |||
| 645096b87a | |||
| 40d95a4e23 | |||
| c06af63f87 | |||
| 15040821e0 | |||
| 2da4398fb5 | |||
| 67c9b1e332 | |||
| 37399e3cb5 | |||
| a7fb55ea6d | |||
| e51b5774db | |||
| 056350d9bf | |||
| 5996c3a907 | |||
| 0d48fd4b6b | |||
| 0e582bcfb7 | |||
| 68ae7c8d7a | |||
| ba29da56e0 | |||
| 0696dda470 | |||
| cbfca29522 | |||
| 233f824dd6 | |||
| b17e2d3dcd | |||
| 92fbea2906 | |||
| 94e90ca26c | |||
| 301958b3e0 | |||
| ee50dfaaf3 | |||
| b0ba5cae73 | |||
| 91841d75c9 | |||
| 445003dbb8 | |||
| f01a14e7d0 | |||
| 5a5dba6fc8 | |||
| ae676490c9 | |||
| 2819228d4f | |||
| 9a688d1456 | |||
| b63e82f309 | |||
| 539e0c2f31 | |||
| 60a4ca1182 | |||
| df42428281 | |||
| 2604742191 | |||
| b3407a371b | |||
| c33d99c5b2 | |||
| 7325035aac | |||
| f7a201b0d0 | |||
| 9c5957fc77 | |||
| bbb2b86c34 | |||
| 4da14b14f4 | |||
| 66db6c3acc | |||
| efd93169e5 | |||
| f1cccd65c2 | |||
| 192db2ab1b | |||
| 3b0127cf8e | |||
| 59ab971f81 | |||
| 11104f177b | |||
| 081bf1f879 | |||
| 9a364990d9 | |||
| e1e043d0d0 | |||
| a9487c9443 | |||
| 8d961b51cc | |||
| fe1fce5f56 | |||
| efb9ce24d9 | |||
| e2f07917ab | |||
| fe96376a73 | |||
| 47cae2929f | |||
| 5402eaf9bd | |||
| 911a87e006 | |||
| f04d1096d4 | |||
| 71396f77d3 | |||
| dca48f0e63 | |||
| a6dafb058e | |||
| a1e04942a2 | |||
| a20d0794e6 | |||
| 3279337f47 | |||
| 83b6bc8e05 | |||
| 6cb0fa4128 | |||
| 4b7f8ad9c6 | |||
| bb7e3f1d07 | |||
| c9bfe7004c | |||
| fa9e54146a | |||
| 0079166388 | |||
| 232f5d235d | |||
| 41cf1c9e6a | |||
| 2e61c1fb37 | |||
| a68084f417 | |||
| d5346a0689 | |||
| c45b668142 | |||
| ad0e5928f5 | |||
| 06ca56a13c | |||
| fbd021a756 | |||
| d99794f11d | |||
| c0f1052efb | |||
| bf7ecc761f | |||
| d0480c15ef | |||
| 771f42744a | |||
| 3a44157ee8 | |||
| a666ff1255 | |||
| 264f0960f7 | |||
| 232e8682d1 | |||
| 56ca47ab9d | |||
| 421dd62800 | |||
| 26dba44cd3 | |||
| 34b5041576 | |||
| 6c2e6ea38e | |||
| 1c4ed8b106 | |||
| 6e4a5cc8c6 | |||
| d35e2fda10 | |||
| 6ed52fb765 | |||
| 110afff415 | |||
| d92fa40c62 | |||
| faa270071d | |||
| 787fdc95bb | |||
| d66e9efac5 | |||
| 8908b15471 | |||
| ce507deb9f | |||
| a59066bca9 | |||
| 0446dd3ad8 | |||
| bef9791ea3 | |||
| 66bedc1a24 | |||
| 77769e284f | |||
| d14b068147 | |||
| 6876e79d42 | |||
| 7fcb5c1424 | |||
| 0cc4b08b93 | |||
| 267f3a03d9 | |||
| ae7c602031 | |||
| 3cd9af2409 | |||
| c095ee9ce9 |
@@ -0,0 +1,36 @@
|
||||
Thank you for submitting your feedback to the Marlin project.
|
||||
Please use one of the templates below to fill out this box.
|
||||
|
||||
------------------------------------------------------------
|
||||
### Feature Request
|
||||
Please put [FR] in the issue title: `[FR] Add-on that goes 'ping'`
|
||||
|
||||
------------------------------------------------------------
|
||||
### Compile Error
|
||||
When I compile with `FEATURE_X` I get an error:
|
||||
```
|
||||
Paste_the_error_text_here
|
||||
```
|
||||
|
||||
------------------------------------------------------------
|
||||
### Bug Report
|
||||
- Description: ---
|
||||
- Expected behaviour: ---
|
||||
- Actual behaviour: ---
|
||||
- Steps to reproduce:
|
||||
- Do this
|
||||
- Do that
|
||||
|
||||
Attach a ZIP of `Configuration.h` and `Configuration_adv.h` by dropping here.
|
||||
|
||||
------------------------------------------------------------
|
||||
### Bug Report Tips
|
||||
- When troubleshooting, use `M502` followed by `M500` to reset EEPROM to defaults.
|
||||
- Use `DEBUG_LEVELING_FEATURE` with `M111 S247` for detailed logging of homing/leveling.
|
||||
- Format text with: **bold**, _italic_, `code`.
|
||||
- Format C++ with three backticks, plus "cpp":
|
||||
```cpp
|
||||
void my_function(bool do_it) {
|
||||
// Hold this spot
|
||||
}
|
||||
```
|
||||
+17
-6
@@ -52,6 +52,7 @@ tags
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
*.ino.cpp
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
@@ -115,20 +116,30 @@ tags
|
||||
*.dSYM/
|
||||
*.su
|
||||
|
||||
#PlatformIO files/dirs
|
||||
# PlatformIO files/dirs
|
||||
.pio*
|
||||
.pioenvs
|
||||
.piolib
|
||||
.piolibdeps
|
||||
lib/readme.txt
|
||||
|
||||
#Visual Studio
|
||||
*.sln
|
||||
*.vcxproj
|
||||
*.vcxproj.filters
|
||||
Marlin/Release/
|
||||
Marlin/Debug/
|
||||
Marlin/__vm/
|
||||
Marlin/.vs/
|
||||
Release/
|
||||
Debug/
|
||||
__vm/
|
||||
.vs/
|
||||
vc-fileutils.settings
|
||||
|
||||
#VScode
|
||||
.vscode
|
||||
.vscode/c_cpp_properties.json
|
||||
|
||||
#cmake
|
||||
CMakeLists.txt
|
||||
Marlin/CMakeLists.txt
|
||||
CMakeListsPrivate.txt
|
||||
|
||||
#CLion
|
||||
cmake-build-*
|
||||
|
||||
+110
-163
@@ -1,4 +1,6 @@
|
||||
---
|
||||
dist: trusty
|
||||
sudo: true
|
||||
#
|
||||
language: c
|
||||
#
|
||||
notifications:
|
||||
@@ -11,7 +13,7 @@ before_install:
|
||||
#
|
||||
# Publish the buildroot script folder
|
||||
- chmod +x ${TRAVIS_BUILD_DIR}/buildroot/bin/*
|
||||
- ln -s ${TRAVIS_BUILD_DIR}/buildroot/bin/ ~/bin
|
||||
- export PATH=${TRAVIS_BUILD_DIR}/buildroot/bin/:${PATH}
|
||||
#
|
||||
# Start fb X server
|
||||
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
|
||||
@@ -50,6 +52,14 @@ install:
|
||||
- git clone https://github.com/teemuatlut/TMC2130Stepper.git
|
||||
- sudo mv TMC2130Stepper /usr/local/share/arduino/libraries/TMC2130Stepper
|
||||
#
|
||||
# Install: TMC2208 Stepper Motor Controller library
|
||||
- git clone https://github.com/teemuatlut/TMC2208Stepper.git
|
||||
- sudo mv TMC2208Stepper /usr/local/share/arduino/libraries/TMC2208Stepper
|
||||
#
|
||||
# Install: Adafruit Neopixel library
|
||||
- git clone https://github.com/adafruit/Adafruit_NeoPixel.git
|
||||
- sudo mv Adafruit_NeoPixel /usr/local/share/arduino/libraries/Adafruit_NeoPixel
|
||||
#
|
||||
before_script:
|
||||
#
|
||||
# Change current working directory to the build dir
|
||||
@@ -71,16 +81,74 @@ script:
|
||||
#
|
||||
- build_marlin
|
||||
#
|
||||
# Test heated bed temperature sensor
|
||||
#
|
||||
- opt_set TEMP_SENSOR_BED 1
|
||||
- build_marlin
|
||||
#
|
||||
# Test 2 extruders on basic RAMPS 1.4
|
||||
# Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4
|
||||
# Test a "Fix Mounted" Probe with Safe Homing, some arc options,
|
||||
# linear bed leveling, M48, leveling debug, and firmware retraction.
|
||||
#
|
||||
- opt_set MOTHERBOARD BOARD_RAMPS_14_EEB
|
||||
- opt_set EXTRUDERS 2
|
||||
- opt_set TEMP_SENSOR_0 -2
|
||||
- opt_set TEMP_SENSOR_1 1
|
||||
- opt_set TEMP_SENSOR_BED 1
|
||||
- opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS
|
||||
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
|
||||
- opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED
|
||||
- opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE
|
||||
- opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU
|
||||
- opt_set ABL_GRID_POINTS_X 16
|
||||
- opt_set ABL_GRID_POINTS_Y 16
|
||||
- opt_set_adv FANMUX0_PIN 53
|
||||
- build_marlin
|
||||
#
|
||||
# Test a probeless build of AUTO_BED_LEVELING_UBL
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable AUTO_BED_LEVELING_UBL DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT EEPROM_SETTINGS EEPROM_CHITCHAT G3D_PANEL
|
||||
- opt_enable_adv CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING NANODLP_Z_SYNC
|
||||
- build_marlin
|
||||
#
|
||||
# Add a Sled Z Probe, use UBL Cartesian moves
|
||||
#
|
||||
- opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE
|
||||
- opt_disable SEGMENT_LEVELED_MOVES
|
||||
- opt_enable_adv BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING
|
||||
- build_marlin
|
||||
#
|
||||
# Test a Servo Probe
|
||||
# ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
|
||||
- opt_set NUM_SERVOS 1
|
||||
- opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT
|
||||
- opt_enable_adv NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET
|
||||
- build_marlin
|
||||
#
|
||||
# Test MESH_BED_LEVELING feature, with LCD
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable MESH_BED_LEVELING G26_MESH_EDITING MESH_G28_REST_ORIGIN LCD_BED_LEVELING ULTIMAKERCONTROLLER
|
||||
- build_marlin
|
||||
#
|
||||
# Test MINIRAMBO for PWM_MOTOR_CURRENT
|
||||
# PROBE_MANUALLY feature, with LCD support,
|
||||
# ULTIMAKERCONTROLLER, FILAMENT_LCD_DISPLAY, FILAMENT_WIDTH_SENSOR,
|
||||
# PRINTCOUNTER, NOZZLE_PARK_FEATURE, NOZZLE_CLEAN_FEATURE, PCA9632,
|
||||
# Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS, BEZIER_CURVE_SUPPORT, EXPERIMENTAL_I2CBUS,
|
||||
# ADVANCED_PAUSE_FEATURE, PARK_HEAD_ON_PAUSE, LCD_INFO_MENU,
|
||||
# EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER,
|
||||
# INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT
|
||||
#
|
||||
- restore_configs
|
||||
- opt_set MOTHERBOARD BOARD_MINIRAMBO
|
||||
- opt_enable PROBE_MANUALLY AUTO_BED_LEVELING_BILINEAR G26_MESH_EDITING LCD_BED_LEVELING ULTIMAKERCONTROLLER
|
||||
- opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT
|
||||
- opt_enable ULTIMAKERCONTROLLER SDSUPPORT
|
||||
- opt_enable PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PCA9632 USE_XMAX_PLUG
|
||||
- opt_enable_adv BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS
|
||||
- opt_enable_adv ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE LCD_INFO_MENU M114_DETAIL
|
||||
- opt_set_adv PWM_MOTOR_CURRENT {1300,1300,1250}
|
||||
- opt_set_adv I2C_SLAVE_ADDRESS 63
|
||||
- build_marlin
|
||||
#
|
||||
# Test 5 extruders on AZTEEG_X3_PRO (can use any board with >=5 extruders defined)
|
||||
@@ -96,73 +164,6 @@ script:
|
||||
- opt_enable_adv LIN_ADVANCE
|
||||
- build_marlin
|
||||
#
|
||||
# Test PIDTEMPBED
|
||||
#
|
||||
- restore_configs
|
||||
- opt_set TEMP_SENSOR_BED 1
|
||||
- opt_enable PIDTEMPBED
|
||||
- build_marlin
|
||||
#
|
||||
# Test MAX6675
|
||||
#
|
||||
- restore_configs
|
||||
- opt_set TEMP_SENSOR_0 -2
|
||||
- build_marlin
|
||||
#
|
||||
# Test a "Fix Mounted" Probe along with Safe Homing
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING
|
||||
- build_marlin
|
||||
#
|
||||
# ...with AUTO_BED_LEVELING_LINEAR, Z_MIN_PROBE_REPEATABILITY_TEST, and DEBUG_LEVELING_FEATURE
|
||||
#
|
||||
- opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
|
||||
- opt_set ABL_GRID_POINTS_X 16
|
||||
- opt_set ABL_GRID_POINTS_Y 16
|
||||
- build_marlin
|
||||
#
|
||||
# Test a simple build of AUTO_BED_LEVELING_UBL
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable AUTO_BED_LEVELING_UBL UBL_G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT FIX_MOUNTED_PROBE EEPROM_SETTINGS G3D_PANEL
|
||||
- build_marlin
|
||||
#
|
||||
# Test a Sled Z Probe
|
||||
# ...with AUTO_BED_LEVELING_LINEAR, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, and EEPROM_CHITCHAT
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable Z_PROBE_SLED AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT
|
||||
- build_marlin
|
||||
#
|
||||
# Test a Servo Probe
|
||||
# ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
|
||||
- opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT
|
||||
- opt_enable_adv EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP
|
||||
- build_marlin
|
||||
#
|
||||
# Test MESH_BED_LEVELING feature, with LCD
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable MESH_BED_LEVELING MESH_G28_REST_ORIGIN LCD_BED_LEVELING ULTIMAKERCONTROLLER
|
||||
- build_marlin
|
||||
#
|
||||
# Test PROBE_MANUALLY feature, with LCD support
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable PROBE_MANUALLY AUTO_BED_LEVELING_BILINEAR LCD_BED_LEVELING ULTIMAKERCONTROLLER
|
||||
- build_marlin
|
||||
#
|
||||
# Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER,
|
||||
# INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT
|
||||
- build_marlin
|
||||
#
|
||||
# Mixing Extruder with 5 steppers
|
||||
#
|
||||
- restore_configs
|
||||
@@ -200,77 +201,31 @@ script:
|
||||
- opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER
|
||||
- build_marlin
|
||||
#
|
||||
# Test MINIRAMBO for PWM_MOTOR_CURRENT
|
||||
#
|
||||
- restore_configs
|
||||
- opt_set MOTHERBOARD BOARD_MINIRAMBO
|
||||
- build_marlin
|
||||
#
|
||||
# Test FILAMENT_CHANGE_FEATURE, PARK_HEAD_ON_PAUSE, and LCD_INFO_MENU
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable ULTIMAKERCONTROLLER
|
||||
- opt_enable_adv FILAMENT_CHANGE_FEATURE PARK_HEAD_ON_PAUSE LCD_INFO_MENU
|
||||
- build_marlin
|
||||
#
|
||||
# Enable filament sensor
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable FILAMENT_WIDTH_SENSOR
|
||||
- build_marlin
|
||||
#
|
||||
# Enable filament sensor with LCD display
|
||||
#
|
||||
- opt_enable ULTIMAKERCONTROLLER FILAMENT_LCD_DISPLAY
|
||||
- build_marlin
|
||||
#
|
||||
# Enable BEZIER_CURVE_SUPPORT, EXPERIMENTAL_I2CBUS, and I2C_SLAVE_ADDRESS
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable_adv BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS
|
||||
- opt_set_adv I2C_SLAVE_ADDRESS 63
|
||||
- build_marlin
|
||||
#
|
||||
# Enable COREXY
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable COREXY
|
||||
- build_marlin
|
||||
#
|
||||
# Enable COREYX (swapped)
|
||||
# Test many less common options
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable COREYX
|
||||
- opt_set_adv FAN_MIN_PWM 50
|
||||
- opt_set_adv FAN_KICKSTART_TIME 100
|
||||
- opt_set_adv XY_FREQUENCY_LIMIT 15
|
||||
- opt_enable_adv SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME
|
||||
- opt_enable_adv ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED ADVANCED_OK
|
||||
- opt_enable_adv VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL
|
||||
- opt_enable_adv EXTRA_FAN_SPEED FWERETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS
|
||||
- opt_enable_adv MENU_ADDAUTOSTART SDCARD_SORT_ALPHA
|
||||
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER
|
||||
- opt_enable FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR
|
||||
- opt_enable ENDSTOP_INTERRUPTS_FEATURE FAN_SOFT_PWM SDSUPPORT
|
||||
- opt_enable USE_XMAX_PLUG
|
||||
- build_marlin
|
||||
#
|
||||
# Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS
|
||||
- pins_set RAMPS X_MAX_PIN -1
|
||||
- opt_set_adv Z2_MAX_PIN 2
|
||||
- build_marlin
|
||||
#
|
||||
# Test PRINTCOUNTER
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable PRINTCOUNTER
|
||||
- build_marlin
|
||||
#
|
||||
# Test NOZZLE_PARK_FEATURE
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable NOZZLE_PARK_FEATURE
|
||||
- build_marlin
|
||||
#
|
||||
# Test NOZZLE_CLEAN_FEATURE
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable NOZZLE_CLEAN_FEATURE
|
||||
- build_marlin
|
||||
#
|
||||
#
|
||||
######## STANDARD LCD/PANELS ##############
|
||||
######## Other Standard LCD/Panels ##############
|
||||
#
|
||||
# ULTRA_LCD
|
||||
#
|
||||
@@ -284,12 +239,6 @@ script:
|
||||
- opt_enable DOGLCD
|
||||
- build_marlin
|
||||
#
|
||||
# ULTIMAKERCONTROLLER
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable ULTIMAKERCONTROLLER
|
||||
- build_marlin
|
||||
#
|
||||
# MAKRPANEL
|
||||
# Needs to use Melzi and Sanguino hardware
|
||||
#
|
||||
@@ -297,31 +246,29 @@ script:
|
||||
#- opt_enable MAKRPANEL
|
||||
#- build_marlin
|
||||
#
|
||||
# REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, and BABYSTEPPING
|
||||
# REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, BABYSTEPPING, RIGIDBOARD_V2, and DAC_MOTOR_CURRENT_DEFAULT
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING
|
||||
- opt_set MOTHERBOARD BOARD_RIGIDBOARD_V2
|
||||
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT
|
||||
- build_marlin
|
||||
#
|
||||
# G3D_PANEL
|
||||
# G3D_PANEL with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable G3D_PANEL SDSUPPORT
|
||||
- build_marlin
|
||||
#
|
||||
# Add SDCARD_SORT_ALPHA, test G3D_PANEL again
|
||||
#
|
||||
- opt_enable_adv SDCARD_SORT_ALPHA
|
||||
- opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES
|
||||
- opt_set_adv SDSORT_GCODE true
|
||||
- opt_set_adv SDSORT_USES_RAM true
|
||||
- opt_set_adv SDSORT_USES_STACK true
|
||||
- opt_set_adv SDSORT_CACHE_NAMES true
|
||||
- build_marlin
|
||||
#
|
||||
# REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
||||
# REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT
|
||||
- opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES
|
||||
- build_marlin
|
||||
#
|
||||
# REPRAPWORLD_KEYPAD
|
||||
@@ -371,21 +318,20 @@ script:
|
||||
######## Example Configurations ##############
|
||||
#
|
||||
# BQ Hephestos 2
|
||||
- restore_configs
|
||||
- use_example_configs Hephestos_2
|
||||
- build_marlin
|
||||
#- restore_configs
|
||||
#- use_example_configs Hephestos_2
|
||||
#- build_marlin
|
||||
#
|
||||
# Delta Config (generic)
|
||||
- restore_configs
|
||||
# Delta Config (generic) + ABL bilinear + PROBE_MANUALLY
|
||||
- use_example_configs delta/generic
|
||||
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU
|
||||
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY
|
||||
- build_marlin
|
||||
#
|
||||
# Delta Config (generic) + ABL + ALLEN_KEY
|
||||
# Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS
|
||||
#
|
||||
- use_example_configs delta/generic
|
||||
- opt_disable DISABLE_MIN_ENDSTOPS
|
||||
- opt_enable AUTO_BED_LEVELING_BILINEAR Z_PROBE_ALLEN_KEY
|
||||
- opt_enable AUTO_BED_LEVELING_UBL Z_PROBE_ALLEN_KEY EEPROM_SETTINGS EEPROM_CHITCHAT OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY
|
||||
- build_marlin
|
||||
#
|
||||
# Delta Config (FLSUN AC because it's complex)
|
||||
@@ -398,18 +344,19 @@ script:
|
||||
#- use_example_configs makibox
|
||||
#- build_marlin
|
||||
#
|
||||
# SCARA Config
|
||||
# SCARA with TMC2130
|
||||
#
|
||||
- use_example_configs SCARA
|
||||
- opt_enable AUTO_BED_LEVELING_BILINEAR FIX_MOUNTED_PROBE USE_ZMIN_PLUG EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER
|
||||
- opt_enable_adv HAVE_TMC2130 X_IS_TMC2130 Y_IS_TMC2130 Z_IS_TMC2130
|
||||
- opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG SENSORLESS_HOMING
|
||||
- build_marlin
|
||||
#
|
||||
# TMC2130 Config
|
||||
# TMC2208 Config
|
||||
#
|
||||
- restore_configs
|
||||
- opt_enable_adv HAVE_TMC2130 X_IS_TMC2130 Y_IS_TMC2130 Z_IS_TMC2130
|
||||
- build_marlin
|
||||
- opt_enable_adv AUTOMATIC_CURRENT_CONTROL STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING
|
||||
- opt_enable_adv HAVE_TMC2208 X_IS_TMC2208 Y_IS_TMC2208 Z_IS_TMC2208
|
||||
- opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG
|
||||
- build_marlin
|
||||
#
|
||||
# tvrrug Config need to check board type for sanguino atmega644p
|
||||
|
||||
+200
-113
@@ -31,48 +31,115 @@
|
||||
#define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
|
||||
|
||||
#if ENABLED(CARTESIO_UI)
|
||||
|
||||
#define DOGLCD
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#define DEFAULT_LCD_CONTRAST 90
|
||||
#define LCD_CONTRAST_MIN 60
|
||||
#define LCD_CONTRAST_MAX 140
|
||||
#endif
|
||||
|
||||
#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
|
||||
#define DOGLCD
|
||||
#elif ENABLED(MAKRPANEL)
|
||||
|
||||
#define U8GLIB_ST7565_64128N
|
||||
|
||||
#elif ENABLED(ZONESTAR_LCD)
|
||||
|
||||
#define REPRAPWORLD_KEYPAD
|
||||
#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
|
||||
#define ADC_KEYPAD
|
||||
#define ADC_KEY_NUM 8
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#define DEFAULT_LCD_CONTRAST 17
|
||||
#endif
|
||||
|
||||
#if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
||||
// this helps to implement ADC_KEYPAD menus
|
||||
#define ENCODER_PULSES_PER_STEP 1
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
#define ENCODER_FEEDRATE_DEADZONE 2
|
||||
#define REVERSE_MENU_DIRECTION
|
||||
|
||||
#elif ENABLED(ANET_FULL_GRAPHICS_LCD)
|
||||
|
||||
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
||||
|
||||
#elif ENABLED(BQ_LCD_SMART_CONTROLLER)
|
||||
|
||||
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
||||
|
||||
#elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
||||
|
||||
#define ULTRA_LCD //general LCD support, also 16x2
|
||||
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
|
||||
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
|
||||
|
||||
#if ENABLED(miniVIKI)
|
||||
#define LCD_CONTRAST_MIN 75
|
||||
#define LCD_CONTRAST_MAX 115
|
||||
#define DEFAULT_LCD_CONTRAST 95
|
||||
#define LCD_CONTRAST_MIN 75
|
||||
#define LCD_CONTRAST_MAX 115
|
||||
#define DEFAULT_LCD_CONTRAST 95
|
||||
#define U8GLIB_ST7565_64128N
|
||||
#elif ENABLED(VIKI2)
|
||||
#define DEFAULT_LCD_CONTRAST 40
|
||||
#define LCD_CONTRAST_MIN 0
|
||||
#define LCD_CONTRAST_MAX 255
|
||||
#define DEFAULT_LCD_CONTRAST 140
|
||||
#define U8GLIB_ST7565_64128N
|
||||
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
||||
#define LCD_CONTRAST_MIN 90
|
||||
#define LCD_CONTRAST_MAX 130
|
||||
#define LCD_CONTRAST_MIN 90
|
||||
#define LCD_CONTRAST_MAX 130
|
||||
#define DEFAULT_LCD_CONTRAST 110
|
||||
#define U8GLIB_LM6059_AF
|
||||
#define SD_DETECT_INVERTED
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#elif ENABLED(OLED_PANEL_TINYBOY2)
|
||||
|
||||
#if ENABLED(OLED_PANEL_TINYBOY2)
|
||||
#define U8GLIB_SSD1306
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#define REVERSE_ENCODER_DIRECTION
|
||||
#define REVERSE_MENU_DIRECTION
|
||||
|
||||
#elif ENABLED(RA_CONTROL_PANEL)
|
||||
|
||||
#define LCD_I2C_TYPE_PCA8574
|
||||
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
|
||||
#define ULTIPANEL
|
||||
|
||||
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
|
||||
|
||||
#define DOGLCD
|
||||
#define U8GLIB_ST7920
|
||||
#define ULTIPANEL
|
||||
|
||||
#elif ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_2_NOP
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_2_NOP
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_2_NOP
|
||||
#endif
|
||||
|
||||
#elif ENABLED(MKS_12864OLED)
|
||||
|
||||
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
||||
#define U8GLIB_SH1106
|
||||
|
||||
#elif ENABLED(MKS_12864OLED_SSD1306)
|
||||
|
||||
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
||||
#define U8GLIB_SSD1306
|
||||
|
||||
#elif ENABLED(MKS_MINI_12864)
|
||||
|
||||
#define MINIPANEL
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
|
||||
#define DOGLCD
|
||||
#define ULTIPANEL
|
||||
#define DEFAULT_LCD_CONTRAST 17
|
||||
#endif
|
||||
|
||||
// Generic support for SSD1306 / SH1106 OLED based LCDs.
|
||||
@@ -82,17 +149,18 @@
|
||||
#endif
|
||||
|
||||
#if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
|
||||
|
||||
#define ULTIMAKERCONTROLLER
|
||||
|
||||
#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602)
|
||||
|
||||
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
||||
#define LCD_WIDTH 16
|
||||
#define LCD_HEIGHT 2
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(BQ_LCD_SMART_CONTROLLER)
|
||||
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
||||
#ifndef LONG_FILENAME_HOST_SUPPORT
|
||||
#define LONG_FILENAME_HOST_SUPPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI) || ENABLED(SILVER_GATE_GLCD_CONTROLLER)
|
||||
#define DOGLCD
|
||||
#define U8GLIB_ST7920
|
||||
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
||||
@@ -101,24 +169,15 @@
|
||||
#if ENABLED(ULTIMAKERCONTROLLER) \
|
||||
|| ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
|
||||
|| ENABLED(G3D_PANEL) \
|
||||
|| ENABLED(RIGIDBOT_PANEL) \
|
||||
|| ENABLED(REPRAPWORLD_KEYPAD)
|
||||
|| ENABLED(RIGIDBOT_PANEL)
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
#if ENABLED(RA_CONTROL_PANEL)
|
||||
#define LCD_I2C_TYPE_PCA8574
|
||||
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
|
||||
#define DOGLCD
|
||||
#define U8GLIB_ST7920
|
||||
#define ULTIPANEL
|
||||
#if ENABLED(REPRAPWORLD_KEYPAD)
|
||||
#define NEWPANEL
|
||||
#if ENABLED(ULTIPANEL) && !defined(REPRAPWORLD_KEYPAD_MOVE_STEP)
|
||||
#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -126,54 +185,72 @@
|
||||
*/
|
||||
|
||||
#if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
|
||||
// This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
|
||||
// Make sure it is placed in the Arduino libraries directory.
|
||||
|
||||
// Note: This controller requires F.Malpartida's LiquidCrystal_I2C library
|
||||
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
|
||||
|
||||
#define LCD_I2C_TYPE_PCF8575
|
||||
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
|
||||
#if ENABLED(LCD_I2C_PANELOLU2)
|
||||
#elif ENABLED(LCD_I2C_PANELOLU2)
|
||||
|
||||
// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
|
||||
|
||||
#define LCD_I2C_TYPE_MCP23017
|
||||
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
|
||||
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
|
||||
#if ENABLED(LCD_I2C_VIKI)
|
||||
// This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
|
||||
// Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
|
||||
// Note: The pause/stop/resume LCD button pin should be connected to the Arduino
|
||||
// BTN_ENC pin (or set BTN_ENC to -1 if not used)
|
||||
#elif ENABLED(LCD_I2C_VIKI)
|
||||
|
||||
/**
|
||||
* Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
|
||||
*
|
||||
* This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
|
||||
* Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
|
||||
* Note: The pause/stop/resume LCD button pin should be connected to the Arduino
|
||||
* BTN_ENC pin (or set BTN_ENC to -1 if not used)
|
||||
*/
|
||||
#define LCD_I2C_TYPE_MCP23017
|
||||
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
|
||||
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
|
||||
#define ENCODER_FEEDRATE_DEADZONE 4
|
||||
|
||||
#ifndef ENCODER_PULSES_PER_STEP
|
||||
#define ENCODER_PULSES_PER_STEP 1
|
||||
#endif
|
||||
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM 2
|
||||
#endif
|
||||
#define STD_ENCODER_PULSES_PER_STEP 1
|
||||
#define STD_ENCODER_STEPS_PER_MENU_ITEM 2
|
||||
|
||||
#elif ENABLED(G3D_PANEL)
|
||||
|
||||
#define STD_ENCODER_PULSES_PER_STEP 2
|
||||
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
|
||||
#elif ENABLED(miniVIKI) || ENABLED(VIKI2) \
|
||||
|| ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
|
||||
|| ENABLED(OLED_PANEL_TINYBOY2) \
|
||||
|| ENABLED(BQ_LCD_SMART_CONTROLLER) \
|
||||
|| ENABLED(LCD_I2C_PANELOLU2) \
|
||||
|| ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
|
||||
#define STD_ENCODER_PULSES_PER_STEP 4
|
||||
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
#endif
|
||||
|
||||
// Set encoder detents for well-known controllers
|
||||
#if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) || ENABLED(OLED_PANEL_TINYBOY2) \
|
||||
|| ENABLED(BQ_LCD_SMART_CONTROLLER) || ENABLED(LCD_I2C_PANELOLU2) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
|
||||
#ifndef ENCODER_PULSES_PER_STEP
|
||||
#define ENCODER_PULSES_PER_STEP 4
|
||||
#endif
|
||||
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
#endif
|
||||
#ifndef STD_ENCODER_PULSES_PER_STEP
|
||||
#define STD_ENCODER_PULSES_PER_STEP 5
|
||||
#endif
|
||||
#ifndef STD_ENCODER_STEPS_PER_MENU_ITEM
|
||||
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
#endif
|
||||
#ifndef ENCODER_PULSES_PER_STEP
|
||||
#define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP
|
||||
#endif
|
||||
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM
|
||||
#endif
|
||||
#ifndef ENCODER_FEEDRATE_DEADZONE
|
||||
#define ENCODER_FEEDRATE_DEADZONE 6
|
||||
#endif
|
||||
|
||||
// Shift register panels
|
||||
@@ -184,7 +261,6 @@
|
||||
#if ENABLED(SAV_3DLCD)
|
||||
#define SR_LCD_2W_NL // Non latching 2 wire shift register
|
||||
#define ULTIPANEL
|
||||
#define NEWPANEL
|
||||
#endif
|
||||
|
||||
#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
|
||||
@@ -197,7 +273,7 @@
|
||||
#endif
|
||||
|
||||
#if ENABLED(ULTIPANEL)
|
||||
#define NEWPANEL //enable this if you have a click-encoder panel
|
||||
#define NEWPANEL // Disable this if you actually have no click-encoder panel
|
||||
#define ULTRA_LCD
|
||||
#ifndef LCD_WIDTH
|
||||
#define LCD_WIDTH 20
|
||||
@@ -205,14 +281,12 @@
|
||||
#ifndef LCD_HEIGHT
|
||||
#define LCD_HEIGHT 4
|
||||
#endif
|
||||
#else //no panel but just LCD
|
||||
#if ENABLED(ULTRA_LCD)
|
||||
#ifndef LCD_WIDTH
|
||||
#define LCD_WIDTH 16
|
||||
#endif
|
||||
#ifndef LCD_HEIGHT
|
||||
#define LCD_HEIGHT 2
|
||||
#endif
|
||||
#elif ENABLED(ULTRA_LCD) // no panel but just LCD
|
||||
#ifndef LCD_WIDTH
|
||||
#define LCD_WIDTH 16
|
||||
#endif
|
||||
#ifndef LCD_HEIGHT
|
||||
#define LCD_HEIGHT 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -237,15 +311,15 @@
|
||||
#define LCD_STR_FILAM_DIA "\xf8"
|
||||
#define LCD_STR_FILAM_MUL "\xa4"
|
||||
#else
|
||||
/* Custom characters defined in the first 8 characters of the LCD */
|
||||
#define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
|
||||
#define LCD_STR_DEGREE "\x01"
|
||||
#define LCD_STR_THERMOMETER "\x02"
|
||||
#define LCD_STR_UPLEVEL "\x03"
|
||||
// Custom characters defined in the first 8 characters of the LCD
|
||||
#define LCD_BEDTEMP_CHAR 0x00 // Print only as a char. This will have 'unexpected' results when used in a string!
|
||||
#define LCD_DEGREE_CHAR 0x01
|
||||
#define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation
|
||||
#define LCD_UPLEVEL_CHAR 0x03
|
||||
#define LCD_STR_REFRESH "\x04"
|
||||
#define LCD_STR_FOLDER "\x05"
|
||||
#define LCD_STR_FEEDRATE "\x06"
|
||||
#define LCD_STR_CLOCK "\x07"
|
||||
#define LCD_FEEDRATE_CHAR 0x06
|
||||
#define LCD_CLOCK_CHAR 0x07
|
||||
#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
|
||||
#endif
|
||||
|
||||
@@ -275,12 +349,20 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BOOTSCREEN_TIMEOUT
|
||||
// Boot screens
|
||||
#if DISABLED(ULTRA_LCD)
|
||||
#undef SHOW_BOOTSCREEN
|
||||
#elif !defined(BOOTSCREEN_TIMEOUT)
|
||||
#define BOOTSCREEN_TIMEOUT 2500
|
||||
#endif
|
||||
|
||||
#define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
|
||||
|
||||
// MK2 Multiplexer forces SINGLENOZZLE to be enabled
|
||||
#if ENABLED(MK2_MULTIPLEXER)
|
||||
#define SINGLENOZZLE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Extruders have some combination of stepper motors and hotends
|
||||
* so we separate these concepts into the defines:
|
||||
@@ -288,39 +370,38 @@
|
||||
* EXTRUDERS - Number of Selectable Tools
|
||||
* HOTENDS - Number of hotends, whether connected or separate
|
||||
* E_STEPPERS - Number of actual E stepper motors
|
||||
* E_MANUAL - Number of E steppers for LCD move options
|
||||
* TOOL_E_INDEX - Index to use when getting/setting the tool state
|
||||
*
|
||||
*/
|
||||
#if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder
|
||||
#define HOTENDS 1
|
||||
#define E_STEPPERS EXTRUDERS
|
||||
#define E_MANUAL EXTRUDERS
|
||||
#define TOOL_E_INDEX current_block->active_extruder
|
||||
#if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset
|
||||
#define HOTENDS 1
|
||||
#undef TEMP_SENSOR_1_AS_REDUNDANT
|
||||
#undef HOTEND_OFFSET_X
|
||||
#undef HOTEND_OFFSET_Y
|
||||
#elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends
|
||||
#define HOTENDS EXTRUDERS
|
||||
#define E_STEPPERS 1
|
||||
#define E_MANUAL 1
|
||||
#define TOOL_E_INDEX 0
|
||||
#ifndef HOTEND_OFFSET_Z
|
||||
#else // Two hotends
|
||||
#define HOTENDS EXTRUDERS
|
||||
#if ENABLED(SWITCHING_NOZZLE) && !defined(HOTEND_OFFSET_Z)
|
||||
#define HOTEND_OFFSET_Z { 0 }
|
||||
#endif
|
||||
#elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend
|
||||
#define HOTENDS 1
|
||||
#define E_STEPPERS MIXING_STEPPERS
|
||||
#define E_MANUAL 1
|
||||
#define TOOL_E_INDEX 0
|
||||
#else // One stepper, E axis, and hotend per tool
|
||||
#define HOTENDS EXTRUDERS
|
||||
#define E_STEPPERS EXTRUDERS
|
||||
#define E_MANUAL EXTRUDERS
|
||||
#define TOOL_E_INDEX current_block->active_extruder
|
||||
#endif
|
||||
|
||||
#if ENABLED(SWITCHING_EXTRUDER) || ENABLED(MIXING_EXTRUDER) // Unified E axis
|
||||
#if ENABLED(MIXING_EXTRUDER)
|
||||
#define E_STEPPERS MIXING_STEPPERS
|
||||
#else
|
||||
#define E_STEPPERS 1 // One E stepper
|
||||
#endif
|
||||
#define E_MANUAL 1
|
||||
#define TOOL_E_INDEX 0
|
||||
#else
|
||||
#define E_STEPPERS EXTRUDERS
|
||||
#define E_MANUAL EXTRUDERS
|
||||
#define TOOL_E_INDEX current_block->active_extruder
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Distinct E Factors – Disable by commenting out DISTINCT_E_FACTORS
|
||||
* DISTINCT_E_FACTORS affects how some E factors are accessed
|
||||
*/
|
||||
#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
|
||||
#define XYZE_N (XYZ + E_STEPPERS)
|
||||
@@ -343,8 +424,10 @@
|
||||
#define NUM_SERVOS (Z_ENDSTOP_SERVO_NR + 1)
|
||||
#endif
|
||||
#undef DEACTIVATE_SERVOS_AFTER_MOVE
|
||||
#undef SERVO_DELAY
|
||||
#define SERVO_DELAY 50
|
||||
#if NUM_SERVOS == 1
|
||||
#undef SERVO_DELAY
|
||||
#define SERVO_DELAY { 50 }
|
||||
#endif
|
||||
#ifndef BLTOUCH_DELAY
|
||||
#define BLTOUCH_DELAY 375
|
||||
#endif
|
||||
@@ -357,6 +440,10 @@
|
||||
#define BLTOUCH_RESET 160
|
||||
#define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING)
|
||||
|
||||
// Always disable probe pin inverting for BLTouch
|
||||
#undef Z_MIN_PROBE_ENDSTOP_INVERTING
|
||||
#define Z_MIN_PROBE_ENDSTOP_INVERTING false
|
||||
|
||||
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
||||
#undef Z_MIN_ENDSTOP_INVERTING
|
||||
#define Z_MIN_ENDSTOP_INVERTING false
|
||||
@@ -386,6 +473,6 @@
|
||||
|
||||
#define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
|
||||
#define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER))
|
||||
#define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED))
|
||||
#define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED))
|
||||
|
||||
#endif //CONDITIONALS_LCD_H
|
||||
#endif // CONDITIONALS_LCD_H
|
||||
|
||||
+412
-70
@@ -28,15 +28,45 @@
|
||||
#ifndef CONDITIONALS_POST_H
|
||||
#define CONDITIONALS_POST_H
|
||||
|
||||
#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
|
||||
#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
|
||||
#define IS_CARTESIAN !IS_KINEMATIC
|
||||
|
||||
/**
|
||||
* Axis lengths and center
|
||||
*/
|
||||
#define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS))
|
||||
#define Y_MAX_LENGTH (Y_MAX_POS - (Y_MIN_POS))
|
||||
#define Z_MAX_LENGTH (Z_MAX_POS - (Z_MIN_POS))
|
||||
#define X_CENTER float((X_MIN_POS + X_MAX_POS) * 0.5)
|
||||
#define Y_CENTER float((Y_MIN_POS + Y_MAX_POS) * 0.5)
|
||||
#define Z_CENTER float((Z_MIN_POS + Z_MAX_POS) * 0.5)
|
||||
|
||||
// Defined only if the sanity-check is bypassed
|
||||
#ifndef X_BED_SIZE
|
||||
#define X_BED_SIZE X_MAX_LENGTH
|
||||
#endif
|
||||
#ifndef Y_BED_SIZE
|
||||
#define Y_BED_SIZE Y_MAX_LENGTH
|
||||
#endif
|
||||
|
||||
// Require 0,0 bed center for Delta and SCARA
|
||||
#if IS_KINEMATIC
|
||||
#define BED_CENTER_AT_0_0
|
||||
#endif
|
||||
|
||||
// Define center values for future use
|
||||
#if ENABLED(BED_CENTER_AT_0_0)
|
||||
#define X_CENTER 0
|
||||
#define Y_CENTER 0
|
||||
#else
|
||||
#define X_CENTER ((X_BED_SIZE) / 2)
|
||||
#define Y_CENTER ((Y_BED_SIZE) / 2)
|
||||
#endif
|
||||
#define Z_CENTER ((Z_MIN_POS + Z_MAX_POS) / 2)
|
||||
|
||||
// Get the linear boundaries of the bed
|
||||
#define X_MIN_BED (X_CENTER - (X_BED_SIZE) / 2)
|
||||
#define X_MAX_BED (X_CENTER + (X_BED_SIZE) / 2)
|
||||
#define Y_MIN_BED (Y_CENTER - (Y_BED_SIZE) / 2)
|
||||
#define Y_MAX_BED (Y_CENTER + (Y_BED_SIZE) / 2)
|
||||
|
||||
/**
|
||||
* CoreXY, CoreXZ, and CoreYZ - and their reverse
|
||||
@@ -59,16 +89,19 @@
|
||||
#define CORE_AXIS_1 B_AXIS
|
||||
#define CORE_AXIS_2 C_AXIS
|
||||
#endif
|
||||
#if (ENABLED(COREYX) || ENABLED(COREZX) || ENABLED(COREZY))
|
||||
#if ENABLED(COREYX) || ENABLED(COREZX) || ENABLED(COREZY)
|
||||
#define CORESIGN(n) (-(n))
|
||||
#else
|
||||
#define CORESIGN(n) (n)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
|
||||
#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
|
||||
#define IS_CARTESIAN !IS_KINEMATIC
|
||||
/**
|
||||
* No adjustable bed on non-cartesians
|
||||
*/
|
||||
#if IS_KINEMATIC
|
||||
#undef LEVEL_BED_CORNERS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SCARA cannot use SLOWDOWN and requires QUICKHOME
|
||||
@@ -87,11 +120,11 @@
|
||||
#if ENABLED(DELTA)
|
||||
#define X_HOME_POS 0
|
||||
#else
|
||||
#define X_HOME_POS ((X_MAX_LENGTH) * (X_HOME_DIR) * 0.5)
|
||||
#define X_HOME_POS ((X_BED_SIZE) * (X_HOME_DIR) * 0.5)
|
||||
#endif
|
||||
#else
|
||||
#if ENABLED(DELTA)
|
||||
#define X_HOME_POS (X_MIN_POS + (X_MAX_LENGTH) * 0.5)
|
||||
#define X_HOME_POS (X_MIN_POS + (X_BED_SIZE) * 0.5)
|
||||
#else
|
||||
#define X_HOME_POS (X_HOME_DIR < 0 ? X_MIN_POS : X_MAX_POS)
|
||||
#endif
|
||||
@@ -103,11 +136,11 @@
|
||||
#if ENABLED(DELTA)
|
||||
#define Y_HOME_POS 0
|
||||
#else
|
||||
#define Y_HOME_POS ((Y_MAX_LENGTH) * (Y_HOME_DIR) * 0.5)
|
||||
#define Y_HOME_POS ((Y_BED_SIZE) * (Y_HOME_DIR) * 0.5)
|
||||
#endif
|
||||
#else
|
||||
#if ENABLED(DELTA)
|
||||
#define Y_HOME_POS (Y_MIN_POS + (Y_MAX_LENGTH) * 0.5)
|
||||
#define Y_HOME_POS (Y_MIN_POS + (Y_BED_SIZE) * 0.5)
|
||||
#else
|
||||
#define Y_HOME_POS (Y_HOME_DIR < 0 ? Y_MIN_POS : Y_MAX_POS)
|
||||
#endif
|
||||
@@ -151,10 +184,10 @@
|
||||
*/
|
||||
#if ENABLED(Z_SAFE_HOMING)
|
||||
#ifndef Z_SAFE_HOMING_X_POINT
|
||||
#define Z_SAFE_HOMING_X_POINT ((X_MIN_POS + X_MAX_POS) / 2)
|
||||
#define Z_SAFE_HOMING_X_POINT X_CENTER
|
||||
#endif
|
||||
#ifndef Z_SAFE_HOMING_Y_POINT
|
||||
#define Z_SAFE_HOMING_Y_POINT ((Y_MIN_POS + Y_MAX_POS) / 2)
|
||||
#define Z_SAFE_HOMING_Y_POINT Y_CENTER
|
||||
#endif
|
||||
#define X_TILT_FULCRUM Z_SAFE_HOMING_X_POINT
|
||||
#define Y_TILT_FULCRUM Z_SAFE_HOMING_Y_POINT
|
||||
@@ -170,6 +203,13 @@
|
||||
#define DEFAULT_KEEPALIVE_INTERVAL 2
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Provide a MAX_AUTORETRACT for older configs
|
||||
*/
|
||||
#if ENABLED(FWRETRACT) && !defined(MAX_AUTORETRACT)
|
||||
#define MAX_AUTORETRACT 99
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MAX_STEP_FREQUENCY differs for TOSHIBA
|
||||
*/
|
||||
@@ -187,13 +227,8 @@
|
||||
#define MICROSTEP16 HIGH,HIGH
|
||||
|
||||
/**
|
||||
* Advance calculated values
|
||||
* Override here because this is set in Configuration_adv.h
|
||||
*/
|
||||
#if ENABLED(ADVANCE)
|
||||
#define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI)
|
||||
#define STEPS_PER_CUBIC_MM_E (axis_steps_per_mm[E_AXIS_N] / (EXTRUSION_AREA))
|
||||
#endif
|
||||
|
||||
#if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
||||
#undef SD_DETECT_INVERTED
|
||||
#endif
|
||||
@@ -326,7 +361,7 @@
|
||||
#ifndef HOTEND_OFFSET_Y
|
||||
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
|
||||
#endif
|
||||
#if !defined(HOTEND_OFFSET_Z) && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER))
|
||||
#if !defined(HOTEND_OFFSET_Z) && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE))
|
||||
#define HOTEND_OFFSET_Z { 0 }
|
||||
#endif
|
||||
#endif
|
||||
@@ -343,29 +378,122 @@
|
||||
#define ARRAY_BY_HOTENDS(...) ARRAY_N(HOTENDS, __VA_ARGS__)
|
||||
#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
|
||||
|
||||
/**
|
||||
* X_DUAL_ENDSTOPS endstop reassignment
|
||||
*/
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
#if X_HOME_DIR > 0
|
||||
#if X2_USE_ENDSTOP == _XMIN_
|
||||
#define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
#define X2_MAX_PIN X_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _XMAX_
|
||||
#define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
|
||||
#define X2_MAX_PIN X_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _YMIN_
|
||||
#define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
|
||||
#define X2_MAX_PIN Y_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _YMAX_
|
||||
#define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
|
||||
#define X2_MAX_PIN Y_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZMIN_
|
||||
#define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
|
||||
#define X2_MAX_PIN Z_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZMAX_
|
||||
#define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
|
||||
#define X2_MAX_PIN Z_MAX_PIN
|
||||
#else
|
||||
#define X2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#define X2_MIN_ENDSTOP_INVERTING false
|
||||
#else
|
||||
#if X2_USE_ENDSTOP == _XMIN_
|
||||
#define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
#define X2_MIN_PIN X_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _XMAX_
|
||||
#define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
|
||||
#define X2_MIN_PIN X_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _YMIN_
|
||||
#define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
|
||||
#define X2_MIN_PIN Y_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _YMAX_
|
||||
#define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
|
||||
#define X2_MIN_PIN Y_MAX_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZMIN_
|
||||
#define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
|
||||
#define X2_MIN_PIN Z_MIN_PIN
|
||||
#elif X2_USE_ENDSTOP == _ZMAX_
|
||||
#define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
|
||||
#define X2_MIN_PIN Z_MAX_PIN
|
||||
#else
|
||||
#define X2_MIN_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#define X2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Is an endstop plug used for the X2 endstop?
|
||||
#define IS_X2_ENDSTOP(A,M) (ENABLED(X_DUAL_ENDSTOPS) && X2_USE_ENDSTOP == _##A##M##_)
|
||||
|
||||
/**
|
||||
* Y_DUAL_ENDSTOPS endstop reassignment
|
||||
*/
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
#if Y_HOME_DIR > 0
|
||||
#if Y2_USE_ENDSTOP == _XMIN_
|
||||
#define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
#define Y2_MAX_PIN X_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _XMAX_
|
||||
#define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
|
||||
#define Y2_MAX_PIN X_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YMIN_
|
||||
#define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
|
||||
#define Y2_MAX_PIN Y_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YMAX_
|
||||
#define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
|
||||
#define Y2_MAX_PIN Y_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZMIN_
|
||||
#define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
|
||||
#define Y2_MAX_PIN Z_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZMAX_
|
||||
#define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
|
||||
#define Y2_MAX_PIN Z_MAX_PIN
|
||||
#else
|
||||
#define Y2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#define Y2_MIN_ENDSTOP_INVERTING false
|
||||
#else
|
||||
#if Y2_USE_ENDSTOP == _XMIN_
|
||||
#define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
#define Y2_MIN_PIN X_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _XMAX_
|
||||
#define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
|
||||
#define Y2_MIN_PIN X_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YMIN_
|
||||
#define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
|
||||
#define Y2_MIN_PIN Y_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _YMAX_
|
||||
#define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
|
||||
#define Y2_MIN_PIN Y_MAX_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZMIN_
|
||||
#define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
|
||||
#define Y2_MIN_PIN Z_MIN_PIN
|
||||
#elif Y2_USE_ENDSTOP == _ZMAX_
|
||||
#define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
|
||||
#define Y2_MIN_PIN Z_MAX_PIN
|
||||
#else
|
||||
#define Y2_MIN_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#define Y2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Is an endstop plug used for the Y2 endstop or the bed probe?
|
||||
#define IS_Y2_ENDSTOP(A,M) (ENABLED(Y_DUAL_ENDSTOPS) && Y2_USE_ENDSTOP == _##A##M##_)
|
||||
|
||||
/**
|
||||
* Z_DUAL_ENDSTOPS endstop reassignment
|
||||
*/
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
#define _XMIN_ 100
|
||||
#define _YMIN_ 200
|
||||
#define _ZMIN_ 300
|
||||
#define _XMAX_ 101
|
||||
#define _YMAX_ 201
|
||||
#define _ZMAX_ 301
|
||||
#if Z2_USE_ENDSTOP == _XMIN_
|
||||
#define USE_XMIN_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _XMAX_
|
||||
#define USE_XMAX_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _YMIN_
|
||||
#define USE_YMIN_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _YMAX_
|
||||
#define USE_YMAX_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _ZMIN_
|
||||
#define USE_ZMIN_PLUG
|
||||
#elif Z2_USE_ENDSTOP == _ZMAX_
|
||||
#define USE_ZMAX_PLUG
|
||||
#endif
|
||||
#if Z_HOME_DIR > 0
|
||||
#if Z2_USE_ENDSTOP == _XMIN_
|
||||
#define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
@@ -388,6 +516,7 @@
|
||||
#else
|
||||
#define Z2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#define Z2_MIN_ENDSTOP_INVERTING false
|
||||
#else
|
||||
#if Z2_USE_ENDSTOP == _XMIN_
|
||||
#define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
|
||||
@@ -410,6 +539,7 @@
|
||||
#else
|
||||
#define Z2_MIN_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#define Z2_MAX_ENDSTOP_INVERTING false
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -506,12 +636,16 @@
|
||||
#define HAS_SOLENOID_4 (PIN_EXISTS(SOL4))
|
||||
|
||||
// Endstops and bed probe
|
||||
#define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_Z2_OR_PROBE(X,MIN))
|
||||
#define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_Z2_OR_PROBE(X,MAX))
|
||||
#define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_Z2_OR_PROBE(Y,MIN))
|
||||
#define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_Z2_OR_PROBE(Y,MAX))
|
||||
#define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_Z2_OR_PROBE(Z,MIN))
|
||||
#define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_Z2_OR_PROBE(Z,MAX))
|
||||
#define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_X2_ENDSTOP(X,MIN) && !IS_Y2_ENDSTOP(X,MIN) && !IS_Z2_OR_PROBE(X,MIN))
|
||||
#define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_X2_ENDSTOP(X,MAX) && !IS_Y2_ENDSTOP(X,MAX) && !IS_Z2_OR_PROBE(X,MAX))
|
||||
#define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_X2_ENDSTOP(Y,MIN) && !IS_Y2_ENDSTOP(Y,MIN) && !IS_Z2_OR_PROBE(Y,MIN))
|
||||
#define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_X2_ENDSTOP(Y,MAX) && !IS_Y2_ENDSTOP(Y,MAX) && !IS_Z2_OR_PROBE(Y,MAX))
|
||||
#define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_X2_ENDSTOP(Z,MIN) && !IS_Y2_ENDSTOP(Z,MIN) && !IS_Z2_OR_PROBE(Z,MIN))
|
||||
#define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_X2_ENDSTOP(Z,MAX) && !IS_Y2_ENDSTOP(Z,MAX) && !IS_Z2_OR_PROBE(Z,MAX))
|
||||
#define HAS_X2_MIN (PIN_EXISTS(X2_MIN))
|
||||
#define HAS_X2_MAX (PIN_EXISTS(X2_MAX))
|
||||
#define HAS_Y2_MIN (PIN_EXISTS(Y2_MIN))
|
||||
#define HAS_Y2_MAX (PIN_EXISTS(Y2_MAX))
|
||||
#define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
|
||||
#define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
|
||||
#define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
|
||||
@@ -579,7 +713,7 @@
|
||||
#define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
|
||||
#define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
|
||||
#define HAS_BUZZER (PIN_EXISTS(BEEPER) || ENABLED(LCD_USE_I2C_BUZZER))
|
||||
#define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT))
|
||||
#define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE))
|
||||
|
||||
// Digital control
|
||||
#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS)
|
||||
@@ -616,8 +750,18 @@
|
||||
#else
|
||||
#define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Heated bed requires settings
|
||||
*/
|
||||
#if HAS_HEATER_BED
|
||||
#define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, v)
|
||||
#ifndef MAX_BED_POWER
|
||||
#define MAX_BED_POWER 255
|
||||
#endif
|
||||
#ifndef HEATER_BED_INVERTING
|
||||
#define HEATER_BED_INVERTING false
|
||||
#endif
|
||||
#define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN, (v) ^ HEATER_BED_INVERTING)
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -645,6 +789,11 @@
|
||||
#endif
|
||||
#define WRITE_FAN_N(n, v) WRITE_FAN##n(v)
|
||||
|
||||
/**
|
||||
* Part Cooling fan multipliexer
|
||||
*/
|
||||
#define HAS_FANMUX PIN_EXISTS(FANMUX0)
|
||||
|
||||
/**
|
||||
* Servos and probes
|
||||
*/
|
||||
@@ -655,9 +804,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define PROBE_PIN_CONFIGURED (HAS_Z_MIN_PROBE_PIN || (HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)))
|
||||
|
||||
#define HAS_BED_PROBE (PROBE_SELECTED && PROBE_PIN_CONFIGURED && DISABLED(PROBE_MANUALLY))
|
||||
#define HAS_BED_PROBE (PROBE_SELECTED && DISABLED(PROBE_MANUALLY))
|
||||
|
||||
#if ENABLED(Z_PROBE_ALLEN_KEY)
|
||||
#define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST
|
||||
@@ -697,10 +844,75 @@
|
||||
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* XYZ Bed Skew Correction
|
||||
*/
|
||||
#if ENABLED(SKEW_CORRECTION)
|
||||
#define SKEW_FACTOR_MIN -1
|
||||
#define SKEW_FACTOR_MAX 1
|
||||
|
||||
#define _GET_SIDE(a,b,c) (SQRT(2*sq(a)+2*sq(b)-4*sq(c))*0.5)
|
||||
#define _SKEW_SIDE(a,b,c) tan(M_PI*0.5-acos((sq(a)-sq(b)-sq(c))/(2*c*b)))
|
||||
#define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(a,_GET_SIDE(a,b,c),c)
|
||||
|
||||
#ifndef XY_SKEW_FACTOR
|
||||
constexpr float XY_SKEW_FACTOR = (
|
||||
#if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD)
|
||||
_SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD)
|
||||
#else
|
||||
0.0
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
#ifndef XZ_SKEW_FACTOR
|
||||
#if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD)
|
||||
#define XZ_SIDE_AD XY_SIDE_AD
|
||||
#endif
|
||||
constexpr float XZ_SKEW_FACTOR = (
|
||||
#if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD)
|
||||
_SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD)
|
||||
#else
|
||||
0.0
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
#ifndef YZ_SKEW_FACTOR
|
||||
constexpr float YZ_SKEW_FACTOR = (
|
||||
#if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD)
|
||||
_SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD)
|
||||
#else
|
||||
0.0
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
#endif // SKEW_CORRECTION
|
||||
|
||||
/**
|
||||
* Heater & Fan Pausing
|
||||
*/
|
||||
#if FAN_COUNT == 0
|
||||
#undef PROBING_FANS_OFF
|
||||
#endif
|
||||
#define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF) || DELAY_BEFORE_PROBING > 0))
|
||||
#define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF))
|
||||
|
||||
/**
|
||||
* Only constrain Z on DELTA / SCARA machines
|
||||
*/
|
||||
#if IS_KINEMATIC
|
||||
#undef MIN_SOFTWARE_ENDSTOP_X
|
||||
#undef MIN_SOFTWARE_ENDSTOP_Y
|
||||
#undef MAX_SOFTWARE_ENDSTOP_X
|
||||
#undef MAX_SOFTWARE_ENDSTOP_Y
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Delta radius/rod trimmers/angle trimmers
|
||||
*/
|
||||
#if ENABLED(DELTA)
|
||||
#ifndef DELTA_PROBEABLE_RADIUS
|
||||
#define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS
|
||||
#endif
|
||||
#ifndef DELTA_CALIBRATION_RADIUS
|
||||
#define DELTA_CALIBRATION_RADIUS DELTA_PRINTABLE_RADIUS - 10
|
||||
#endif
|
||||
@@ -721,17 +933,103 @@
|
||||
/**
|
||||
* Set granular options based on the specific type of leveling
|
||||
*/
|
||||
#define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT))
|
||||
#define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
|
||||
#define HAS_ABL (ABL_PLANAR || ABL_GRID || ENABLED(AUTO_BED_LEVELING_UBL))
|
||||
#define HAS_LEVELING (HAS_ABL || ENABLED(MESH_BED_LEVELING))
|
||||
#define PLANNER_LEVELING (ABL_PLANAR || ABL_GRID || ENABLED(MESH_BED_LEVELING))
|
||||
#define UBL_SEGMENTED (ENABLED(AUTO_BED_LEVELING_UBL) && (ENABLED(DELTA) || ENABLED(SEGMENT_LEVELED_MOVES)))
|
||||
#define ABL_PLANAR (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT))
|
||||
#define ABL_GRID (ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR))
|
||||
#define OLDSCHOOL_ABL (ABL_PLANAR || ABL_GRID)
|
||||
#define HAS_ABL (OLDSCHOOL_ABL || ENABLED(AUTO_BED_LEVELING_UBL))
|
||||
#define HAS_LEVELING (HAS_ABL || ENABLED(MESH_BED_LEVELING))
|
||||
#define HAS_AUTOLEVEL (HAS_ABL && DISABLED(PROBE_MANUALLY))
|
||||
#define HAS_MESH (ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(MESH_BED_LEVELING))
|
||||
#define PLANNER_LEVELING (OLDSCHOOL_ABL || ENABLED(MESH_BED_LEVELING) || UBL_SEGMENTED || ENABLED(SKEW_CORRECTION))
|
||||
#define HAS_PROBING_PROCEDURE (HAS_ABL || ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST))
|
||||
#if HAS_PROBING_PROCEDURE
|
||||
#define PROBE_BED_WIDTH abs(RIGHT_PROBE_BED_POSITION - (LEFT_PROBE_BED_POSITION))
|
||||
#define PROBE_BED_HEIGHT abs(BACK_PROBE_BED_POSITION - (FRONT_PROBE_BED_POSITION))
|
||||
#endif
|
||||
|
||||
#if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH)
|
||||
#define LEVELED_SEGMENT_LENGTH 5
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Bed Probing rectangular bounds
|
||||
* These can be further constrained in code for Delta and SCARA
|
||||
*/
|
||||
#if ENABLED(DELTA)
|
||||
// Probing points may be verified at compile time within the radius
|
||||
// using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!")
|
||||
// so that may be added to SanityCheck.h in the future.
|
||||
#define _MIN_PROBE_X (X_CENTER - DELTA_PRINTABLE_RADIUS)
|
||||
#define _MIN_PROBE_Y (Y_CENTER - DELTA_PRINTABLE_RADIUS)
|
||||
#define _MAX_PROBE_X (X_CENTER + DELTA_PRINTABLE_RADIUS)
|
||||
#define _MAX_PROBE_Y (Y_CENTER + DELTA_PRINTABLE_RADIUS)
|
||||
#elif IS_SCARA
|
||||
#define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2)
|
||||
#define _MIN_PROBE_X (X_CENTER - (SCARA_PRINTABLE_RADIUS))
|
||||
#define _MIN_PROBE_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS))
|
||||
#define _MAX_PROBE_X (X_CENTER + SCARA_PRINTABLE_RADIUS)
|
||||
#define _MAX_PROBE_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS)
|
||||
#else
|
||||
// Boundaries for Cartesian probing based on bed limits
|
||||
#define _MIN_PROBE_X (max(X_MIN_BED, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define _MIN_PROBE_Y (max(Y_MIN_BED, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define _MAX_PROBE_X (min(X_MAX_BED, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define _MAX_PROBE_Y (min(Y_MAX_BED, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#endif
|
||||
|
||||
// Allow configuration to override these for special purposes
|
||||
#ifndef MIN_PROBE_X
|
||||
#define MIN_PROBE_X _MIN_PROBE_X
|
||||
#endif
|
||||
#ifndef MIN_PROBE_Y
|
||||
#define MIN_PROBE_Y _MIN_PROBE_Y
|
||||
#endif
|
||||
#ifndef MAX_PROBE_X
|
||||
#define MAX_PROBE_X _MAX_PROBE_X
|
||||
#endif
|
||||
#ifndef MAX_PROBE_Y
|
||||
#define MAX_PROBE_Y _MAX_PROBE_Y
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Default mesh area is an area with an inset margin on the print area.
|
||||
*/
|
||||
#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
#if IS_KINEMATIC
|
||||
// Probing points may be verified at compile time within the radius
|
||||
// using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!")
|
||||
// so that may be added to SanityCheck.h in the future.
|
||||
#define _MESH_MIN_X (MIN_PROBE_X + MESH_INSET)
|
||||
#define _MESH_MIN_Y (MIN_PROBE_Y + MESH_INSET)
|
||||
#define _MESH_MAX_X (MAX_PROBE_X - (MESH_INSET))
|
||||
#define _MESH_MAX_Y (MAX_PROBE_Y - (MESH_INSET))
|
||||
#else
|
||||
// Boundaries for Cartesian probing based on set limits
|
||||
#define _MESH_MIN_X (max(X_MIN_BED + MESH_INSET, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define _MESH_MIN_Y (max(Y_MIN_BED + MESH_INSET, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define _MESH_MAX_X (min(X_MAX_BED - (MESH_INSET), X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define _MESH_MAX_Y (min(Y_MAX_BED - (MESH_INSET), Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#endif
|
||||
/**
|
||||
* These may be overridden in Configuration if a smaller area is wanted
|
||||
*/
|
||||
#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
#ifndef MESH_MIN_X
|
||||
#define MESH_MIN_X _MESH_MIN_X
|
||||
#endif
|
||||
#ifndef MESH_MIN_Y
|
||||
#define MESH_MIN_Y _MESH_MIN_Y
|
||||
#endif
|
||||
#ifndef MESH_MAX_X
|
||||
#define MESH_MAX_X _MESH_MAX_X
|
||||
#endif
|
||||
#ifndef MESH_MAX_Y
|
||||
#define MESH_MAX_Y _MESH_MAX_Y
|
||||
#endif
|
||||
#endif
|
||||
#endif // MESH_BED_LEVELING || AUTO_BED_LEVELING_UBL
|
||||
|
||||
/**
|
||||
* Buzzer/Speaker
|
||||
*/
|
||||
@@ -751,6 +1049,18 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* VIKI2, miniVIKI, and AZSMZ_12864 require DOGLCD_SCK and DOGLCD_MOSI to be defined.
|
||||
*/
|
||||
#if ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(AZSMZ_12864)
|
||||
#ifndef DOGLCD_SCK
|
||||
#define DOGLCD_SCK SCK_PIN
|
||||
#endif
|
||||
#ifndef DOGLCD_MOSI
|
||||
#define DOGLCD_MOSI MOSI_PIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Z_HOMING_HEIGHT / Z_CLEARANCE_BETWEEN_PROBES
|
||||
*/
|
||||
@@ -770,20 +1080,6 @@
|
||||
#define MANUAL_PROBE_HEIGHT Z_HOMING_HEIGHT
|
||||
#endif
|
||||
|
||||
#if IS_KINEMATIC
|
||||
// Check for this in the code instead
|
||||
#define MIN_PROBE_X X_MIN_POS
|
||||
#define MAX_PROBE_X X_MAX_POS
|
||||
#define MIN_PROBE_Y Y_MIN_POS
|
||||
#define MAX_PROBE_Y Y_MAX_POS
|
||||
#else
|
||||
// Boundaries for probing based on set limits
|
||||
#define MIN_PROBE_X (max(X_MIN_POS, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define MAX_PROBE_X (min(X_MAX_POS, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define MIN_PROBE_Y (max(Y_MIN_POS, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
|
||||
#endif
|
||||
|
||||
// Stepper pulse duration, in cycles
|
||||
#define STEP_PULSE_CYCLES ((MINIMUM_STEPPER_PULSE) * CYCLES_PER_MICROSECOND)
|
||||
|
||||
@@ -794,7 +1090,7 @@
|
||||
// Updated G92 behavior shifts the workspace
|
||||
#define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS)
|
||||
// The home offset also shifts the coordinate space
|
||||
#define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) || ENABLED(DELTA))
|
||||
#define HAS_HOME_OFFSET (DISABLED(NO_WORKSPACE_OFFSETS) && DISABLED(DELTA))
|
||||
// Either offset yields extra calculations on all moves
|
||||
#define HAS_WORKSPACE_OFFSET (HAS_POSITION_SHIFT || HAS_HOME_OFFSET)
|
||||
// M206 doesn't apply to DELTA
|
||||
@@ -805,4 +1101,50 @@
|
||||
#define LCD_TIMEOUT_TO_STATUS 15000
|
||||
#endif
|
||||
|
||||
// Shorthand
|
||||
#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
|
||||
|
||||
// Add commands that need sub-codes to this list
|
||||
#define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS)
|
||||
|
||||
// Parking Extruder
|
||||
#if ENABLED(PARKING_EXTRUDER)
|
||||
#ifndef PARKING_EXTRUDER_GRAB_DISTANCE
|
||||
#define PARKING_EXTRUDER_GRAB_DISTANCE 0
|
||||
#endif
|
||||
#ifndef PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE
|
||||
#define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE HIGH
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Number of VFAT entries used. Each entry has 13 UTF-16 characters
|
||||
#if ENABLED(SCROLL_LONG_FILENAMES)
|
||||
#define MAX_VFAT_ENTRIES (5)
|
||||
#else
|
||||
#define MAX_VFAT_ENTRIES (2)
|
||||
#endif
|
||||
|
||||
// Set defaults for unspecified LED user colors
|
||||
#if ENABLED(LED_CONTROL_MENU)
|
||||
#ifndef LED_USER_PRESET_RED
|
||||
#define LED_USER_PRESET_RED 255
|
||||
#endif
|
||||
#ifndef LED_USER_PRESET_GREEN
|
||||
#define LED_USER_PRESET_GREEN 255
|
||||
#endif
|
||||
#ifndef LED_USER_PRESET_BLUE
|
||||
#define LED_USER_PRESET_BLUE 255
|
||||
#endif
|
||||
#ifndef LED_USER_PRESET_WHITE
|
||||
#define LED_USER_PRESET_WHITE 0
|
||||
#endif
|
||||
#ifndef LED_USER_PRESET_BRIGHTNESS
|
||||
#ifdef NEOPIXEL_BRIGHTNESS
|
||||
#define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS
|
||||
#else
|
||||
#define LED_USER_PRESET_BRIGHTNESS 255
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // CONDITIONALS_POST_H
|
||||
|
||||
+461
-255
File diff suppressed because it is too large
Load Diff
+609
-200
File diff suppressed because it is too large
Load Diff
+627
-652
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,346 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016, 2017 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef I2CPOSENC_H
|
||||
#define I2CPOSENC_H
|
||||
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if ENABLED(I2C_POSITION_ENCODERS)
|
||||
|
||||
#include "enum.h"
|
||||
#include "macros.h"
|
||||
#include "types.h"
|
||||
#include <Wire.h>
|
||||
|
||||
//=========== Advanced / Less-Common Encoder Configuration Settings ==========
|
||||
|
||||
#define I2CPE_EC_THRESH_PROPORTIONAL // if enabled adjusts the error correction threshold
|
||||
// proportional to the current speed of the axis allows
|
||||
// for very small error margin at low speeds without
|
||||
// stuttering due to reading latency at high speeds
|
||||
|
||||
#define I2CPE_DEBUG // enable encoder-related debug serial echos
|
||||
|
||||
#define I2CPE_REBOOT_TIME 5000 // time we wait for an encoder module to reboot
|
||||
// after changing address.
|
||||
|
||||
#define I2CPE_MAG_SIG_GOOD 0
|
||||
#define I2CPE_MAG_SIG_MID 1
|
||||
#define I2CPE_MAG_SIG_BAD 2
|
||||
#define I2CPE_MAG_SIG_NF 255
|
||||
|
||||
#define I2CPE_REQ_REPORT 0
|
||||
#define I2CPE_RESET_COUNT 1
|
||||
#define I2CPE_SET_ADDR 2
|
||||
#define I2CPE_SET_REPORT_MODE 3
|
||||
#define I2CPE_CLEAR_EEPROM 4
|
||||
|
||||
#define I2CPE_LED_PAR_MODE 10
|
||||
#define I2CPE_LED_PAR_BRT 11
|
||||
#define I2CPE_LED_PAR_RATE 14
|
||||
|
||||
#define I2CPE_REPORT_DISTANCE 0
|
||||
#define I2CPE_REPORT_STRENGTH 1
|
||||
#define I2CPE_REPORT_VERSION 2
|
||||
|
||||
// Default I2C addresses
|
||||
#define I2CPE_PRESET_ADDR_X 30
|
||||
#define I2CPE_PRESET_ADDR_Y 31
|
||||
#define I2CPE_PRESET_ADDR_Z 32
|
||||
#define I2CPE_PRESET_ADDR_E 33
|
||||
|
||||
#define I2CPE_DEF_AXIS X_AXIS
|
||||
#define I2CPE_DEF_ADDR I2CPE_PRESET_ADDR_X
|
||||
|
||||
// Error event counter; tracks how many times there is an error exceeding a certain threshold
|
||||
#define I2CPE_ERR_CNT_THRESH 3.00
|
||||
#define I2CPE_ERR_CNT_DEBOUNCE_MS 2000
|
||||
|
||||
#if ENABLED(I2CPE_ERR_ROLLING_AVERAGE)
|
||||
#define I2CPE_ERR_ARRAY_SIZE 32
|
||||
#endif
|
||||
|
||||
// Error Correction Methods
|
||||
#define I2CPE_ECM_NONE 0
|
||||
#define I2CPE_ECM_MICROSTEP 1
|
||||
#define I2CPE_ECM_PLANNER 2
|
||||
#define I2CPE_ECM_STALLDETECT 3
|
||||
|
||||
// Encoder types
|
||||
#define I2CPE_ENC_TYPE_ROTARY 0
|
||||
#define I2CPE_ENC_TYPE_LINEAR 1
|
||||
|
||||
// Parser
|
||||
#define I2CPE_PARSE_ERR 1
|
||||
#define I2CPE_PARSE_OK 0
|
||||
|
||||
#define LOOP_PE(VAR) LOOP_L_N(VAR, I2CPE_ENCODER_CNT)
|
||||
#define CHECK_IDX() do{ if (!WITHIN(idx, 0, I2CPE_ENCODER_CNT - 1)) return; }while(0)
|
||||
|
||||
extern const char axis_codes[XYZE];
|
||||
|
||||
typedef union {
|
||||
volatile int32_t val = 0;
|
||||
uint8_t bval[4];
|
||||
} i2cLong;
|
||||
|
||||
class I2CPositionEncoder {
|
||||
private:
|
||||
AxisEnum encoderAxis = I2CPE_DEF_AXIS;
|
||||
|
||||
uint8_t i2cAddress = I2CPE_DEF_ADDR,
|
||||
ecMethod = I2CPE_DEF_EC_METHOD,
|
||||
type = I2CPE_DEF_TYPE,
|
||||
H = I2CPE_MAG_SIG_NF; // Magnetic field strength
|
||||
|
||||
int encoderTicksPerUnit = I2CPE_DEF_ENC_TICKS_UNIT,
|
||||
stepperTicks = I2CPE_DEF_TICKS_REV,
|
||||
errorCount = 0,
|
||||
errorPrev = 0;
|
||||
|
||||
float ecThreshold = I2CPE_DEF_EC_THRESH;
|
||||
|
||||
bool homed = false,
|
||||
trusted = false,
|
||||
initialised = false,
|
||||
active = false,
|
||||
invert = false,
|
||||
ec = true;
|
||||
|
||||
int32_t zeroOffset = 0,
|
||||
lastPosition = 0,
|
||||
position;
|
||||
|
||||
millis_t lastPositionTime = 0,
|
||||
nextErrorCountTime = 0,
|
||||
lastErrorTime;
|
||||
|
||||
//double positionMm; //calculate
|
||||
|
||||
#if ENABLED(I2CPE_ERR_ROLLING_AVERAGE)
|
||||
uint8_t errIdx = 0;
|
||||
int err[I2CPE_ERR_ARRAY_SIZE] = { 0 };
|
||||
#endif
|
||||
|
||||
//float positionMm; //calculate
|
||||
|
||||
public:
|
||||
void init(const uint8_t address, const AxisEnum axis);
|
||||
void reset();
|
||||
|
||||
void update();
|
||||
|
||||
void set_homed();
|
||||
|
||||
int32_t get_raw_count();
|
||||
|
||||
FORCE_INLINE float mm_from_count(const int32_t count) {
|
||||
switch (type) {
|
||||
default: return -1;
|
||||
case I2CPE_ENC_TYPE_LINEAR:
|
||||
return count / encoderTicksPerUnit;
|
||||
case I2CPE_ENC_TYPE_ROTARY:
|
||||
return (count * stepperTicks) / (encoderTicksPerUnit * planner.axis_steps_per_mm[encoderAxis]);
|
||||
}
|
||||
}
|
||||
|
||||
FORCE_INLINE float get_position_mm() { return mm_from_count(get_position()); }
|
||||
FORCE_INLINE int32_t get_position() { return get_raw_count() - zeroOffset; }
|
||||
|
||||
int32_t get_axis_error_steps(const bool report);
|
||||
float get_axis_error_mm(const bool report);
|
||||
|
||||
void calibrate_steps_mm(const uint8_t iter);
|
||||
|
||||
bool passes_test(const bool report);
|
||||
|
||||
bool test_axis(void);
|
||||
|
||||
FORCE_INLINE int get_error_count(void) { return errorCount; }
|
||||
FORCE_INLINE void set_error_count(const int newCount) { errorCount = newCount; }
|
||||
|
||||
FORCE_INLINE uint8_t get_address() { return i2cAddress; }
|
||||
FORCE_INLINE void set_address(const uint8_t addr) { i2cAddress = addr; }
|
||||
|
||||
FORCE_INLINE bool get_active(void) { return active; }
|
||||
FORCE_INLINE void set_active(const bool a) { active = a; }
|
||||
|
||||
FORCE_INLINE void set_inverted(const bool i) { invert = i; }
|
||||
|
||||
FORCE_INLINE AxisEnum get_axis() { return encoderAxis; }
|
||||
|
||||
FORCE_INLINE bool get_ec_enabled() { return ec; }
|
||||
FORCE_INLINE void set_ec_enabled(const bool enabled) { ec = enabled; }
|
||||
|
||||
FORCE_INLINE uint8_t get_ec_method() { return ecMethod; }
|
||||
FORCE_INLINE void set_ec_method(const byte method) { ecMethod = method; }
|
||||
|
||||
FORCE_INLINE float get_ec_threshold() { return ecThreshold; }
|
||||
FORCE_INLINE void set_ec_threshold(const float newThreshold) { ecThreshold = newThreshold; }
|
||||
|
||||
FORCE_INLINE int get_encoder_ticks_mm() {
|
||||
switch (type) {
|
||||
default: return 0;
|
||||
case I2CPE_ENC_TYPE_LINEAR:
|
||||
return encoderTicksPerUnit;
|
||||
case I2CPE_ENC_TYPE_ROTARY:
|
||||
return (int)((encoderTicksPerUnit / stepperTicks) * planner.axis_steps_per_mm[encoderAxis]);
|
||||
}
|
||||
}
|
||||
|
||||
FORCE_INLINE int get_ticks_unit() { return encoderTicksPerUnit; }
|
||||
FORCE_INLINE void set_ticks_unit(const int ticks) { encoderTicksPerUnit = ticks; }
|
||||
|
||||
FORCE_INLINE uint8_t get_type() { return type; }
|
||||
FORCE_INLINE void set_type(const byte newType) { type = newType; }
|
||||
|
||||
FORCE_INLINE int get_stepper_ticks() { return stepperTicks; }
|
||||
FORCE_INLINE void set_stepper_ticks(const int ticks) { stepperTicks = ticks; }
|
||||
};
|
||||
|
||||
class I2CPositionEncodersMgr {
|
||||
private:
|
||||
static bool I2CPE_anyaxis;
|
||||
static uint8_t I2CPE_addr, I2CPE_idx;
|
||||
|
||||
public:
|
||||
|
||||
static void init(void);
|
||||
|
||||
// consider only updating one endoder per call / tick if encoders become too time intensive
|
||||
static void update(void) { LOOP_PE(i) encoders[i].update(); }
|
||||
|
||||
static void homed(const AxisEnum axis) {
|
||||
LOOP_PE(i)
|
||||
if (encoders[i].get_axis() == axis) encoders[i].set_homed();
|
||||
}
|
||||
|
||||
static void report_position(const int8_t idx, const bool units, const bool noOffset);
|
||||
|
||||
static void report_status(const int8_t idx) {
|
||||
CHECK_IDX();
|
||||
SERIAL_ECHOPAIR("Encoder ",idx);
|
||||
SERIAL_ECHOPGM(": ");
|
||||
encoders[idx].get_raw_count();
|
||||
encoders[idx].passes_test(true);
|
||||
}
|
||||
|
||||
static void report_error(const int8_t idx) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].get_axis_error_steps(true);
|
||||
}
|
||||
|
||||
static void test_axis(const int8_t idx) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].test_axis();
|
||||
}
|
||||
|
||||
static void calibrate_steps_mm(const int8_t idx, const int iterations) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].calibrate_steps_mm(iterations);
|
||||
}
|
||||
|
||||
static void change_module_address(const uint8_t oldaddr, const uint8_t newaddr);
|
||||
static void report_module_firmware(const uint8_t address);
|
||||
|
||||
static void report_error_count(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
SERIAL_ECHOPAIR("Error count on ", axis_codes[axis]);
|
||||
SERIAL_ECHOLNPAIR(" axis is ", encoders[idx].get_error_count());
|
||||
}
|
||||
|
||||
static void reset_error_count(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_error_count(0);
|
||||
SERIAL_ECHOPAIR("Error count on ", axis_codes[axis]);
|
||||
SERIAL_ECHOLNPGM(" axis has been reset.");
|
||||
}
|
||||
|
||||
static void enable_ec(const int8_t idx, const bool enabled, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_ec_enabled(enabled);
|
||||
SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]);
|
||||
SERIAL_ECHOPGM(" axis is ");
|
||||
serialprintPGM(encoders[idx].get_ec_enabled() ? PSTR("en") : PSTR("dis"));
|
||||
SERIAL_ECHOLNPGM("abled.");
|
||||
}
|
||||
|
||||
static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
encoders[idx].set_ec_threshold(newThreshold);
|
||||
SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]);
|
||||
SERIAL_ECHOPAIR_F(" axis set to ", newThreshold);
|
||||
SERIAL_ECHOLNPGM("mm.");
|
||||
}
|
||||
|
||||
static void get_ec_threshold(const int8_t idx, const AxisEnum axis) {
|
||||
CHECK_IDX();
|
||||
const float threshold = encoders[idx].get_ec_threshold();
|
||||
SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]);
|
||||
SERIAL_ECHOPAIR_F(" axis is ", threshold);
|
||||
SERIAL_ECHOLNPGM("mm.");
|
||||
}
|
||||
|
||||
static int8_t idx_from_axis(const AxisEnum axis) {
|
||||
LOOP_PE(i)
|
||||
if (encoders[i].get_axis() == axis) return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int8_t idx_from_addr(const uint8_t addr) {
|
||||
LOOP_PE(i)
|
||||
if (encoders[i].get_address() == addr) return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int8_t parse();
|
||||
|
||||
static void M860();
|
||||
static void M861();
|
||||
static void M862();
|
||||
static void M863();
|
||||
static void M864();
|
||||
static void M865();
|
||||
static void M866();
|
||||
static void M867();
|
||||
static void M868();
|
||||
static void M869();
|
||||
|
||||
static I2CPositionEncoder encoders[I2CPE_ENCODER_CNT];
|
||||
};
|
||||
|
||||
extern I2CPositionEncodersMgr I2CPEM;
|
||||
|
||||
FORCE_INLINE static void gcode_M860() { I2CPEM.M860(); }
|
||||
FORCE_INLINE static void gcode_M861() { I2CPEM.M861(); }
|
||||
FORCE_INLINE static void gcode_M862() { I2CPEM.M862(); }
|
||||
FORCE_INLINE static void gcode_M863() { I2CPEM.M863(); }
|
||||
FORCE_INLINE static void gcode_M864() { I2CPEM.M864(); }
|
||||
FORCE_INLINE static void gcode_M865() { I2CPEM.M865(); }
|
||||
FORCE_INLINE static void gcode_M866() { I2CPEM.M866(); }
|
||||
FORCE_INLINE static void gcode_M867() { I2CPEM.M867(); }
|
||||
FORCE_INLINE static void gcode_M868() { I2CPEM.M868(); }
|
||||
FORCE_INLINE static void gcode_M869() { I2CPEM.M869(); }
|
||||
|
||||
#endif //I2C_POSITION_ENCODERS
|
||||
#endif //I2CPOSENC_H
|
||||
@@ -61,6 +61,7 @@ extern size_t __heap_start, __heap_end, __flp;
|
||||
extern char __bss_end;
|
||||
|
||||
#include "Marlin.h"
|
||||
#include "gcode.h"
|
||||
#include "hex_print_routines.h"
|
||||
|
||||
//
|
||||
@@ -78,7 +79,7 @@ char* top_of_stack() {
|
||||
}
|
||||
|
||||
// Count the number of test bytes at the specified location.
|
||||
int16_t count_test_bytes(const uint8_t * const ptr) {
|
||||
int16_t count_test_bytes(const char * const ptr) {
|
||||
for (uint16_t i = 0; i < 32000; i++)
|
||||
if (((char) ptr[i]) != TEST_BYTE)
|
||||
return i - 1;
|
||||
@@ -100,13 +101,13 @@ int16_t count_test_bytes(const uint8_t * const ptr) {
|
||||
* the block. If so, it may indicate memory corruption due to a bad pointer.
|
||||
* Unexpected bytes are flagged in the right column.
|
||||
*/
|
||||
void dump_free_memory(const uint8_t *ptr, const uint8_t *sp) {
|
||||
void dump_free_memory(const char *ptr, const char *sp) {
|
||||
//
|
||||
// Start and end the dump on a nice 16 byte boundary
|
||||
// (even though the values are not 16-byte aligned).
|
||||
//
|
||||
ptr = (uint8_t *)((uint16_t)ptr & 0xFFF0); // Align to 16-byte boundary
|
||||
sp = (uint8_t *)((uint16_t)sp | 0x000F); // Align sp to the 15th byte (at or above sp)
|
||||
ptr = (char *)((uint16_t)ptr & 0xFFF0); // Align to 16-byte boundary
|
||||
sp = (char *)((uint16_t)sp | 0x000F); // Align sp to the 15th byte (at or above sp)
|
||||
|
||||
// Dump command main loop
|
||||
while (ptr < sp) {
|
||||
@@ -121,7 +122,7 @@ int16_t count_test_bytes(const uint8_t * const ptr) {
|
||||
SERIAL_CHAR('|'); // Point out non test bytes
|
||||
for (uint8_t i = 0; i < 16; i++) {
|
||||
char ccc = (char)ptr[i]; // cast to char before automatically casting to char on assignment, in case the compiler is broken
|
||||
if (&ptr[i] >= command_queue && &ptr[i] < &command_queue[BUFSIZE][MAX_CMD_SIZE]) { // Print out ASCII in the command buffer area
|
||||
if (&ptr[i] >= (const char*)command_queue && &ptr[i] < (const char*)(command_queue + sizeof(command_queue))) { // Print out ASCII in the command buffer area
|
||||
if (!WITHIN(ccc, ' ', 0x7E)) ccc = ' ';
|
||||
}
|
||||
else { // If not in the command buffer area, flag bytes that don't match the test byte
|
||||
@@ -129,7 +130,7 @@ int16_t count_test_bytes(const uint8_t * const ptr) {
|
||||
}
|
||||
SERIAL_CHAR(ccc);
|
||||
}
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
ptr += 16;
|
||||
safe_delay(25);
|
||||
idle();
|
||||
@@ -153,15 +154,14 @@ void M100_dump_routine(const char * const title, const char *start, const char *
|
||||
* Return the number of free bytes in the memory pool,
|
||||
* with other vital statistics defining the pool.
|
||||
*/
|
||||
void free_memory_pool_report(const char * const ptr, const uint16_t size) {
|
||||
int16_t max_cnt = -1;
|
||||
uint16_t block_cnt = 0;
|
||||
void free_memory_pool_report(char * const ptr, const int16_t size) {
|
||||
int16_t max_cnt = -1, block_cnt = 0;
|
||||
char *max_addr = NULL;
|
||||
// Find the longest block of test bytes in the buffer
|
||||
for (uint16_t i = 0; i < size; i++) {
|
||||
char * const addr = ptr + i;
|
||||
for (int16_t i = 0; i < size; i++) {
|
||||
char *addr = ptr + i;
|
||||
if (*addr == TEST_BYTE) {
|
||||
const uint16_t j = count_test_bytes(addr);
|
||||
const int16_t j = count_test_bytes(addr);
|
||||
if (j > 8) {
|
||||
SERIAL_ECHOPAIR("Found ", j);
|
||||
SERIAL_ECHOLNPAIR(" bytes free at ", hex_address(addr));
|
||||
@@ -189,19 +189,17 @@ void free_memory_pool_report(const char * const ptr, const uint16_t size) {
|
||||
* This is useful to check the correctness of the M100 D and the M100 F commands.
|
||||
*/
|
||||
void corrupt_free_memory(char *ptr, const uint16_t size) {
|
||||
if (code_seen('C')) {
|
||||
ptr += 8;
|
||||
const uint16_t near_top = top_of_stack() - ptr - 250, // -250 to avoid interrupt activity that's altered the stack.
|
||||
j = near_top / (size + 1);
|
||||
ptr += 8;
|
||||
const uint16_t near_top = top_of_stack() - ptr - 250, // -250 to avoid interrupt activity that's altered the stack.
|
||||
j = near_top / (size + 1);
|
||||
|
||||
SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
|
||||
for (uint16_t i = 1; i <= size; i++) {
|
||||
char * const addr = ptr + i * j;
|
||||
*addr = i;
|
||||
SERIAL_ECHOPAIR("\nCorrupting address: ", hex_address(addr));
|
||||
}
|
||||
SERIAL_EOL;
|
||||
SERIAL_ECHOLNPGM("Corrupting free memory block.\n");
|
||||
for (uint16_t i = 1; i <= size; i++) {
|
||||
char * const addr = ptr + i * j;
|
||||
*addr = i;
|
||||
SERIAL_ECHOPAIR("\nCorrupting address: ", hex_address(addr));
|
||||
}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
#endif // M100_FREE_MEMORY_CORRUPTOR
|
||||
|
||||
@@ -209,7 +207,7 @@ void free_memory_pool_report(const char * const ptr, const uint16_t size) {
|
||||
* M100 I
|
||||
* Init memory for the M100 tests. (Automatically applied on the first M100.)
|
||||
*/
|
||||
void init_free_memory(uint8_t *ptr, int16_t size) {
|
||||
void init_free_memory(char *ptr, int16_t size) {
|
||||
SERIAL_ECHOLNPGM("Initializing free memory block.\n\n");
|
||||
|
||||
size -= 250; // -250 to avoid interrupt activity that's altered the stack.
|
||||
@@ -225,11 +223,11 @@ void init_free_memory(uint8_t *ptr, int16_t size) {
|
||||
SERIAL_ECHO(size);
|
||||
SERIAL_ECHOLNPGM(" bytes of memory initialized.\n");
|
||||
|
||||
for (uint16_t i = 0; i < size; i++) {
|
||||
if ((char)ptr[i] != TEST_BYTE) {
|
||||
for (int16_t i = 0; i < size; i++) {
|
||||
if (ptr[i] != TEST_BYTE) {
|
||||
SERIAL_ECHOPAIR("? address : ", hex_address(ptr + i));
|
||||
SERIAL_ECHOLNPAIR("=", hex_byte(ptr[i]));
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,23 +246,23 @@ void gcode_M100() {
|
||||
|
||||
// Always init on the first invocation of M100
|
||||
static bool m100_not_initialized = true;
|
||||
if (m100_not_initialized || code_seen('I')) {
|
||||
if (m100_not_initialized || parser.seen('I')) {
|
||||
m100_not_initialized = false;
|
||||
init_free_memory(ptr, sp - ptr);
|
||||
}
|
||||
|
||||
#if ENABLED(M100_FREE_MEMORY_DUMPER)
|
||||
if (code_seen('D'))
|
||||
if (parser.seen('D'))
|
||||
return dump_free_memory(ptr, sp);
|
||||
#endif
|
||||
|
||||
if (code_seen('F'))
|
||||
if (parser.seen('F'))
|
||||
return free_memory_pool_report(ptr, sp - ptr);
|
||||
|
||||
#if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
|
||||
|
||||
if (code_seen('C'))
|
||||
return corrupt_free_memory(ptr, code_value_int());
|
||||
if (parser.seen('C'))
|
||||
return corrupt_free_memory(ptr, parser.value_int());
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -292,7 +290,7 @@ int check_for_free_memory_corruption(const char * const title) {
|
||||
// idle();
|
||||
safe_delay(20);
|
||||
#ifdef M100_FREE_MEMORY_DUMPER
|
||||
M100_dump_routine(" Memory corruption detected with sp<Heap\n", (char*)0x1B80, 0x21FF);
|
||||
M100_dump_routine(" Memory corruption detected with sp<Heap\n", (char*)0x1B80, (char*)0x21FF);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -323,7 +321,7 @@ int check_for_free_memory_corruption(const char * const title) {
|
||||
SERIAL_ECHOPGM(" return=");
|
||||
if (block_cnt == 1) {
|
||||
SERIAL_CHAR('0'); // if the block_cnt is 1, nothing has broken up the free memory
|
||||
SERIAL_EOL; // area and it is appropriate to say 'no corruption'.
|
||||
SERIAL_EOL(); // area and it is appropriate to say 'no corruption'.
|
||||
return 0;
|
||||
}
|
||||
SERIAL_ECHOLNPGM("true");
|
||||
|
||||
+29
-8
@@ -82,6 +82,13 @@ LIQUID_TWI2 ?= 0
|
||||
# this defines if Wire is needed
|
||||
WIRE ?= 0
|
||||
|
||||
# this defines if U8GLIB is needed (may require RELOC_WORKAROUND)
|
||||
U8GLIB ?= 1
|
||||
|
||||
# this defines whether to add a workaround for the avr-gcc relocation bug
|
||||
# https://www.stix.id.au/wiki/AVR_relocation_truncations_workaround
|
||||
RELOC_WORKAROUND ?= 1
|
||||
|
||||
############################################################################
|
||||
# Below here nothing should be changed...
|
||||
|
||||
@@ -270,6 +277,13 @@ ifeq ($(WIRE), 1)
|
||||
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire
|
||||
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
|
||||
endif
|
||||
ifeq ($(NEOPIXEL), 1)
|
||||
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
|
||||
endif
|
||||
ifeq ($(U8GLIB), 1)
|
||||
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
|
||||
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/utility
|
||||
endif
|
||||
|
||||
ifeq ($(HARDWARE_VARIANT), arduino)
|
||||
HARDWARE_SUB_VARIANT ?= mega
|
||||
@@ -290,13 +304,11 @@ ifeq ($(HARDWARE_VARIANT), Teensy)
|
||||
SRC = wiring.c
|
||||
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
|
||||
endif
|
||||
CXXSRC = WMath.cpp WString.cpp Print.cpp Marlin_main.cpp \
|
||||
MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp \
|
||||
SdFile.cpp SdVolume.cpp planner.cpp stepper.cpp \
|
||||
temperature.cpp cardreader.cpp configuration_store.cpp \
|
||||
watchdog.cpp SPI.cpp servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
|
||||
dac_mcp4728.cpp vector_3.cpp qr_solve.cpp endstops.cpp stopwatch.cpp utility.cpp \
|
||||
printcounter.cpp nozzle.cpp serial.cpp
|
||||
CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp Tone.cpp
|
||||
CXXSRC += $(wildcard *.cpp)
|
||||
ifeq ($(NEOPIXEL), 1)
|
||||
CXXSRC += Adafruit_NeoPixel.cpp
|
||||
endif
|
||||
ifeq ($(LIQUID_TWI2), 0)
|
||||
CXXSRC += LiquidCrystal.cpp
|
||||
else
|
||||
@@ -309,6 +321,15 @@ SRC += twi.c
|
||||
CXXSRC += Wire.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(U8GLIB), 1)
|
||||
SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c u8g_font_data.c
|
||||
endif
|
||||
|
||||
ifeq ($(RELOC_WORKAROUND), 1)
|
||||
LD_PREFIX=-nodefaultlibs
|
||||
LD_SUFFIX=-lm -lgcc -lc -lgcc -L$(ARDUINO_INSTALL_DIR)/hardware/tools/avr/avr/lib/avr6 -l$(MCU)
|
||||
endif
|
||||
|
||||
#Check for Arduino 1.0.0 or higher and use the correct source files for that version
|
||||
ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
|
||||
CXXSRC += main.cpp
|
||||
@@ -487,7 +508,7 @@ extcoff: $(TARGET).elf
|
||||
# Link: create ELF output file from library.
|
||||
$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
|
||||
$(Pecho) " CXX $@"
|
||||
$P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS)
|
||||
$P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
|
||||
|
||||
$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
|
||||
$(Pecho) " CC $<"
|
||||
|
||||
+175
-61
@@ -35,6 +35,10 @@
|
||||
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#ifdef DEBUG_GCODE_PARSER
|
||||
#include "gcode.h"
|
||||
#endif
|
||||
|
||||
#include "enum.h"
|
||||
#include "types.h"
|
||||
#include "fastio.h"
|
||||
@@ -48,7 +52,7 @@
|
||||
#endif
|
||||
|
||||
void idle(
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
bool no_stepper_sleep = false // pass true to keep steppers from disabling on timeout
|
||||
#endif
|
||||
);
|
||||
@@ -206,26 +210,21 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
|
||||
/**
|
||||
* Feedrate scaling and conversion
|
||||
*/
|
||||
extern int feedrate_percentage;
|
||||
extern float feedrate_mm_s;
|
||||
extern int16_t feedrate_percentage;
|
||||
|
||||
#define MMM_TO_MMS(MM_M) ((MM_M)/60.0)
|
||||
#define MMS_TO_MMM(MM_S) ((MM_S)*60.0)
|
||||
#define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01)
|
||||
|
||||
extern bool axis_relative_modes[];
|
||||
extern bool volumetric_enabled;
|
||||
extern int flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder
|
||||
extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
|
||||
extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
|
||||
extern bool axis_known_position[XYZ]; // axis[n].is_known
|
||||
extern bool axis_homed[XYZ]; // axis[n].is_homed
|
||||
extern bool axis_known_position[XYZ];
|
||||
extern bool axis_homed[XYZ];
|
||||
extern volatile bool wait_for_heatup;
|
||||
|
||||
#if HAS_RESUME_CONTINUE
|
||||
extern volatile bool wait_for_user;
|
||||
#endif
|
||||
|
||||
extern float current_position[NUM_AXIS];
|
||||
extern float current_position[XYZE], destination[XYZE];
|
||||
|
||||
// Workspace offsets
|
||||
#if HAS_WORKSPACE_OFFSET
|
||||
@@ -248,14 +247,14 @@ extern float current_position[NUM_AXIS];
|
||||
#define WORKSPACE_OFFSET(AXIS) 0
|
||||
#endif
|
||||
|
||||
#define LOGICAL_POSITION(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS))
|
||||
#define RAW_POSITION(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS))
|
||||
#define NATIVE_TO_LOGICAL(POS, AXIS) ((POS) + WORKSPACE_OFFSET(AXIS))
|
||||
#define LOGICAL_TO_NATIVE(POS, AXIS) ((POS) - WORKSPACE_OFFSET(AXIS))
|
||||
|
||||
#if HAS_POSITION_SHIFT || DISABLED(DELTA)
|
||||
#define LOGICAL_X_POSITION(POS) LOGICAL_POSITION(POS, X_AXIS)
|
||||
#define LOGICAL_Y_POSITION(POS) LOGICAL_POSITION(POS, Y_AXIS)
|
||||
#define RAW_X_POSITION(POS) RAW_POSITION(POS, X_AXIS)
|
||||
#define RAW_Y_POSITION(POS) RAW_POSITION(POS, Y_AXIS)
|
||||
#define LOGICAL_X_POSITION(POS) NATIVE_TO_LOGICAL(POS, X_AXIS)
|
||||
#define LOGICAL_Y_POSITION(POS) NATIVE_TO_LOGICAL(POS, Y_AXIS)
|
||||
#define RAW_X_POSITION(POS) LOGICAL_TO_NATIVE(POS, X_AXIS)
|
||||
#define RAW_Y_POSITION(POS) LOGICAL_TO_NATIVE(POS, Y_AXIS)
|
||||
#else
|
||||
#define LOGICAL_X_POSITION(POS) (POS)
|
||||
#define LOGICAL_Y_POSITION(POS) (POS)
|
||||
@@ -263,9 +262,8 @@ extern float current_position[NUM_AXIS];
|
||||
#define RAW_Y_POSITION(POS) (POS)
|
||||
#endif
|
||||
|
||||
#define LOGICAL_Z_POSITION(POS) LOGICAL_POSITION(POS, Z_AXIS)
|
||||
#define RAW_Z_POSITION(POS) RAW_POSITION(POS, Z_AXIS)
|
||||
#define RAW_CURRENT_POSITION(A) RAW_##A##_POSITION(current_position[A##_AXIS])
|
||||
#define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS)
|
||||
#define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS)
|
||||
|
||||
// Hotend Offsets
|
||||
#if HOTENDS > 1
|
||||
@@ -287,46 +285,81 @@ extern float soft_endstop_min[XYZ], soft_endstop_max[XYZ];
|
||||
void update_software_endstops(const AxisEnum axis);
|
||||
#endif
|
||||
|
||||
// GCode support for external objects
|
||||
bool code_seen(char);
|
||||
int code_value_int();
|
||||
int16_t code_value_temp_abs();
|
||||
int16_t code_value_temp_diff();
|
||||
|
||||
#if ENABLED(INCH_MODE_SUPPORT)
|
||||
float code_value_linear_units();
|
||||
float code_value_axis_units(const AxisEnum axis);
|
||||
float code_value_per_axis_unit(const AxisEnum axis);
|
||||
#else
|
||||
#define code_value_linear_units() code_value_float()
|
||||
#define code_value_axis_units(A) code_value_float()
|
||||
#define code_value_per_axis_unit(A) code_value_float()
|
||||
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
||||
#define MAX_COORDINATE_SYSTEMS 9
|
||||
extern float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ];
|
||||
bool select_coordinate_system(const int8_t _new);
|
||||
#endif
|
||||
|
||||
void report_current_position();
|
||||
|
||||
#if IS_KINEMATIC
|
||||
extern float delta[ABC];
|
||||
void inverse_kinematics(const float logical[XYZ]);
|
||||
void inverse_kinematics(const float raw[XYZ]);
|
||||
#endif
|
||||
|
||||
#if ENABLED(DELTA)
|
||||
extern float endstop_adj[ABC],
|
||||
extern float delta_height,
|
||||
delta_endstop_adj[ABC],
|
||||
delta_radius,
|
||||
delta_tower_angle_trim[ABC],
|
||||
delta_tower[ABC][2],
|
||||
delta_diagonal_rod,
|
||||
delta_calibration_radius,
|
||||
delta_diagonal_rod_2_tower[ABC],
|
||||
delta_segments_per_second,
|
||||
delta_tower_angle_trim[2],
|
||||
delta_clip_start_height;
|
||||
void recalc_delta_settings(float radius, float diagonal_rod);
|
||||
|
||||
void recalc_delta_settings();
|
||||
float delta_safe_distance_from_top();
|
||||
|
||||
#if ENABLED(DELTA_FAST_SQRT)
|
||||
float Q_rsqrt(const float number);
|
||||
#define _SQRT(n) (1.0f / Q_rsqrt(n))
|
||||
#else
|
||||
#define _SQRT(n) SQRT(n)
|
||||
#endif
|
||||
|
||||
// Macro to obtain the Z position of an individual tower
|
||||
#define DELTA_Z(V,T) V[Z_AXIS] + _SQRT( \
|
||||
delta_diagonal_rod_2_tower[T] - HYPOT2( \
|
||||
delta_tower[T][X_AXIS] - V[X_AXIS], \
|
||||
delta_tower[T][Y_AXIS] - V[Y_AXIS] \
|
||||
) \
|
||||
)
|
||||
|
||||
#define DELTA_IK(V) do { \
|
||||
delta[A_AXIS] = DELTA_Z(V, A_AXIS); \
|
||||
delta[B_AXIS] = DELTA_Z(V, B_AXIS); \
|
||||
delta[C_AXIS] = DELTA_Z(V, C_AXIS); \
|
||||
}while(0)
|
||||
|
||||
#elif IS_SCARA
|
||||
void forward_kinematics_SCARA(const float &a, const float &b);
|
||||
#endif
|
||||
|
||||
#if ENABLED(G26_MESH_VALIDATION)
|
||||
extern bool g26_debug_flag;
|
||||
#elif ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
constexpr bool g26_debug_flag = false;
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
#define _GET_MESH_X(I) (bilinear_start[X_AXIS] + (I) * bilinear_grid_spacing[X_AXIS])
|
||||
#define _GET_MESH_Y(J) (bilinear_start[Y_AXIS] + (J) * bilinear_grid_spacing[Y_AXIS])
|
||||
#elif ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
#define _GET_MESH_X(I) ubl.mesh_index_to_xpos(I)
|
||||
#define _GET_MESH_Y(J) ubl.mesh_index_to_ypos(J)
|
||||
#elif ENABLED(MESH_BED_LEVELING)
|
||||
#define _GET_MESH_X(I) mbl.index_to_xpos[I]
|
||||
#define _GET_MESH_Y(J) mbl.index_to_ypos[J]
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
extern int bilinear_grid_spacing[2], bilinear_start[2];
|
||||
extern float bilinear_grid_factor[2],
|
||||
z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
|
||||
float bilinear_z_offset(const float logical[XYZ]);
|
||||
void set_bed_leveling_enabled(bool enable=true);
|
||||
float bilinear_z_offset(const float raw[XYZ]);
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
@@ -335,22 +368,32 @@ int16_t code_value_temp_diff();
|
||||
#endif
|
||||
|
||||
#if HAS_LEVELING
|
||||
bool leveling_is_valid();
|
||||
void set_bed_leveling_enabled(const bool enable=true);
|
||||
void reset_bed_level();
|
||||
#endif
|
||||
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
void set_z_fade_height(const float zfh);
|
||||
void set_z_fade_height(const float zfh, const bool do_report=true);
|
||||
#endif
|
||||
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
extern float x_endstop_adj;
|
||||
#endif
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
extern float y_endstop_adj;
|
||||
#endif
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
extern float z_endstop_adj;
|
||||
#endif
|
||||
|
||||
#if HAS_BED_PROBE
|
||||
extern float zprobe_zoffset;
|
||||
void refresh_zprobe_zoffset(const bool no_babystep=false);
|
||||
#define DEPLOY_PROBE() set_probe_deployed(true)
|
||||
#define STOW_PROBE() set_probe_deployed(false)
|
||||
#else
|
||||
#define DEPLOY_PROBE()
|
||||
#define STOW_PROBE()
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
@@ -362,24 +405,31 @@ int16_t code_value_temp_diff();
|
||||
|
||||
#if FAN_COUNT > 0
|
||||
extern int16_t fanSpeeds[FAN_COUNT];
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
extern int16_t old_fanSpeeds[FAN_COUNT],
|
||||
new_fanSpeeds[FAN_COUNT];
|
||||
#endif
|
||||
#if ENABLED(PROBING_FANS_OFF)
|
||||
extern bool fans_paused;
|
||||
extern int16_t paused_fanSpeeds[FAN_COUNT];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(BARICUDA)
|
||||
extern int baricuda_valve_pressure;
|
||||
extern int baricuda_e_to_p_pressure;
|
||||
extern uint8_t baricuda_valve_pressure, baricuda_e_to_p_pressure;
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_WIDTH_SENSOR)
|
||||
extern bool filament_sensor; // Flag that filament sensor readings should control extrusion
|
||||
extern float filament_width_nominal, // Theoretical filament diameter i.e., 3.00 or 1.75
|
||||
filament_width_meas; // Measured filament diameter
|
||||
extern int8_t measurement_delay[]; // Ring buffer to delay measurement
|
||||
extern int filwidth_delay_index[2]; // Ring buffer indexes. Used by planner, temperature, and main code
|
||||
extern int meas_delay_cm; // Delay distance
|
||||
extern uint8_t meas_delay_cm; // Delay distance
|
||||
extern int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delay measurement
|
||||
filwidth_delay_index[2]; // Ring buffer indexes. Used by planner, temperature, and main code
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
extern FilamentChangeMenuResponse filament_change_menu_response;
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
extern AdvancedPauseMenuResponse advanced_pause_menu_response;
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
@@ -387,10 +437,15 @@ int16_t code_value_temp_diff();
|
||||
#endif
|
||||
|
||||
#if ENABLED(FWRETRACT)
|
||||
extern bool autoretract_enabled;
|
||||
extern bool retracted[EXTRUDERS]; // extruder[n].retracted
|
||||
extern float retract_length, retract_length_swap, retract_feedrate_mm_s, retract_zlift;
|
||||
extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate_mm_s;
|
||||
extern bool autoretract_enabled; // M209 S - Autoretract switch
|
||||
extern float retract_length, // M207 S - G10 Retract length
|
||||
retract_feedrate_mm_s, // M207 F - G10 Retract feedrate
|
||||
retract_zlift, // M207 Z - G10 Retract hop size
|
||||
retract_recover_length, // M208 S - G11 Recover length
|
||||
retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate
|
||||
swap_retract_length, // M207 W - G10 Swap Retract length
|
||||
swap_retract_recover_length, // M208 W - G11 Swap Recover length
|
||||
swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate
|
||||
#endif
|
||||
|
||||
// Print job timer
|
||||
@@ -403,15 +458,13 @@ int16_t code_value_temp_diff();
|
||||
// Handling multiple extruders pins
|
||||
extern uint8_t active_extruder;
|
||||
|
||||
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
||||
void print_heaterstates();
|
||||
#endif
|
||||
|
||||
#if ENABLED(MIXING_EXTRUDER)
|
||||
extern float mixing_factor[MIXING_STEPPERS];
|
||||
#endif
|
||||
|
||||
void calculate_volumetric_multipliers();
|
||||
inline void set_current_from_destination() { COPY(current_position, destination); }
|
||||
inline void set_destination_from_current() { COPY(destination, current_position); }
|
||||
void prepare_move_to_destination();
|
||||
|
||||
/**
|
||||
* Blocking movement and shorthand functions
|
||||
@@ -421,8 +474,69 @@ void do_blocking_move_to_x(const float &x, const float &fr_mm_s=0.0);
|
||||
void do_blocking_move_to_z(const float &z, const float &fr_mm_s=0.0);
|
||||
void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s=0.0);
|
||||
|
||||
#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE)
|
||||
bool axis_unhomed_error(const bool x, const bool y, const bool z);
|
||||
#define HAS_AXIS_UNHOMED_ERR ( \
|
||||
ENABLED(Z_PROBE_ALLEN_KEY) \
|
||||
|| ENABLED(Z_PROBE_SLED) \
|
||||
|| HAS_PROBING_PROCEDURE \
|
||||
|| HOTENDS > 1 \
|
||||
|| ENABLED(NOZZLE_CLEAN_FEATURE) \
|
||||
|| ENABLED(NOZZLE_PARK_FEATURE) \
|
||||
|| (ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(HOME_BEFORE_FILAMENT_CHANGE)) \
|
||||
|| HAS_M206_COMMAND \
|
||||
) || ENABLED(NO_MOTION_BEFORE_HOMING)
|
||||
|
||||
#if HAS_AXIS_UNHOMED_ERR
|
||||
bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true);
|
||||
#endif
|
||||
|
||||
#endif //MARLIN_H
|
||||
/**
|
||||
* position_is_reachable family of functions
|
||||
*/
|
||||
|
||||
#if IS_KINEMATIC // (DELTA or SCARA)
|
||||
|
||||
#if IS_SCARA
|
||||
extern const float L1, L2;
|
||||
#endif
|
||||
|
||||
inline bool position_is_reachable(const float &rx, const float &ry) {
|
||||
#if ENABLED(DELTA)
|
||||
return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS);
|
||||
#elif IS_SCARA
|
||||
#if MIDDLE_DEAD_ZONE_R > 0
|
||||
const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y);
|
||||
return R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) && R2 <= sq(L1 + L2);
|
||||
#else
|
||||
return HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y) <= sq(L1 + L2);
|
||||
#endif
|
||||
#else // CARTESIAN
|
||||
// To be migrated from MakerArm branch in future
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
|
||||
|
||||
// Both the nozzle and the probe must be able to reach the point.
|
||||
// This won't work on SCARA since the probe offset rotates with the arm.
|
||||
|
||||
return position_is_reachable(rx, ry)
|
||||
&& position_is_reachable(rx - (X_PROBE_OFFSET_FROM_EXTRUDER), ry - (Y_PROBE_OFFSET_FROM_EXTRUDER));
|
||||
}
|
||||
|
||||
#else // CARTESIAN
|
||||
|
||||
inline bool position_is_reachable(const float &rx, const float &ry) {
|
||||
// Add 0.001 margin to deal with float imprecision
|
||||
return WITHIN(rx, X_MIN_POS - 0.001, X_MAX_POS + 0.001)
|
||||
&& WITHIN(ry, Y_MIN_POS - 0.001, Y_MAX_POS + 0.001);
|
||||
}
|
||||
|
||||
inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
|
||||
// Add 0.001 margin to deal with float imprecision
|
||||
return WITHIN(rx, MIN_PROBE_X - 0.001, MAX_PROBE_X + 0.001)
|
||||
&& WITHIN(ry, MIN_PROBE_Y - 0.001, MAX_PROBE_Y + 0.001);
|
||||
}
|
||||
|
||||
#endif // CARTESIAN
|
||||
|
||||
#endif // MARLIN_H
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "Version.h"
|
||||
#include "Configuration.h"
|
||||
#include "Conditionals_LCD.h"
|
||||
#include "tmc_macros.h"
|
||||
#include "Configuration_adv.h"
|
||||
#include "pins.h"
|
||||
#ifndef USBCON
|
||||
|
||||
@@ -20,44 +20,33 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __SPI_H__
|
||||
#define __SPI_H__
|
||||
#ifndef __MARLIN_SPI_H__
|
||||
#define __MARLIN_SPI_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include "softspi.h"
|
||||
|
||||
template<uint8_t MisoPin, uint8_t MosiPin, uint8_t SckPin>
|
||||
class Spi {
|
||||
static SoftSPI<MisoPin, MosiPin, SckPin> softSpi;
|
||||
class SPI {
|
||||
static SoftSPI<MisoPin, MosiPin, SckPin> softSPI;
|
||||
public:
|
||||
inline __attribute__((always_inline))
|
||||
static void init() {
|
||||
softSpi.begin();
|
||||
}
|
||||
inline __attribute__((always_inline))
|
||||
static void send(uint8_t data) {
|
||||
softSpi.send(data);
|
||||
}
|
||||
inline __attribute__((always_inline))
|
||||
static uint8_t receive() {
|
||||
return softSpi.receive();
|
||||
}
|
||||
FORCE_INLINE static void init() { softSPI.begin(); }
|
||||
FORCE_INLINE static void send(uint8_t data) { softSPI.send(data); }
|
||||
FORCE_INLINE static uint8_t receive() { return softSPI.receive(); }
|
||||
};
|
||||
|
||||
|
||||
//hardware spi
|
||||
// Hardware SPI
|
||||
template<>
|
||||
class Spi<MISO_PIN, MOSI_PIN, SCK_PIN> {
|
||||
class SPI<MISO_PIN, MOSI_PIN, SCK_PIN> {
|
||||
public:
|
||||
inline __attribute__((always_inline))
|
||||
static void init() {
|
||||
FORCE_INLINE static void init() {
|
||||
OUT_WRITE(SCK_PIN, LOW);
|
||||
OUT_WRITE(MOSI_PIN, HIGH);
|
||||
SET_INPUT(MISO_PIN);
|
||||
WRITE(MISO_PIN, HIGH);
|
||||
}
|
||||
inline __attribute__((always_inline))
|
||||
static uint8_t receive() {
|
||||
FORCE_INLINE static uint8_t receive() {
|
||||
SPDR = 0;
|
||||
for (;!TEST(SPSR, SPIF););
|
||||
return SPDR;
|
||||
@@ -65,4 +54,4 @@ class Spi<MISO_PIN, MOSI_PIN, SCK_PIN> {
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // __MARLIN_SPI_H__
|
||||
+197
-59
@@ -27,15 +27,30 @@
|
||||
* Modified 23 November 2006 by David A. Mellis
|
||||
* Modified 28 September 2010 by Mark Sproul
|
||||
* Modified 14 February 2016 by Andreas Hardtung (added tx buffer)
|
||||
* Modified 01 October 2017 by Eduardo José Tagle (added XON/XOFF)
|
||||
*/
|
||||
|
||||
#include "MarlinSerial.h"
|
||||
#include "Marlin.h"
|
||||
|
||||
// Disable HardwareSerial.cpp to support chips without a UART (Attiny, etc.)
|
||||
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if !defined(USBCON) && (defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H))
|
||||
|
||||
#include "MarlinSerial.h"
|
||||
#include "Marlin.h"
|
||||
|
||||
struct ring_buffer_r {
|
||||
unsigned char buffer[RX_BUFFER_SIZE];
|
||||
volatile ring_buffer_pos_t head, tail;
|
||||
};
|
||||
|
||||
#if TX_BUFFER_SIZE > 0
|
||||
struct ring_buffer_t {
|
||||
unsigned char buffer[TX_BUFFER_SIZE];
|
||||
volatile uint8_t head, tail;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if UART_PRESENT(SERIAL_PORT)
|
||||
ring_buffer_r rx_buffer = { { 0 }, 0, 0 };
|
||||
#if TX_BUFFER_SIZE > 0
|
||||
@@ -44,6 +59,23 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
constexpr uint8_t XON_XOFF_CHAR_SENT = 0x80; // XON / XOFF Character was sent
|
||||
constexpr uint8_t XON_XOFF_CHAR_MASK = 0x1F; // XON / XOFF character to send
|
||||
// XON / XOFF character definitions
|
||||
constexpr uint8_t XON_CHAR = 17;
|
||||
constexpr uint8_t XOFF_CHAR = 19;
|
||||
uint8_t xon_xoff_state = XON_XOFF_CHAR_SENT | XON_CHAR;
|
||||
#endif
|
||||
|
||||
#if ENABLED(SERIAL_STATS_DROPPED_RX)
|
||||
uint8_t rx_dropped_bytes = 0;
|
||||
#endif
|
||||
|
||||
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
|
||||
ring_buffer_pos_t rx_max_enqueued = 0;
|
||||
#endif
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
|
||||
#include "stepper.h"
|
||||
@@ -136,20 +168,78 @@
|
||||
|
||||
#endif // EMERGENCY_PARSER
|
||||
|
||||
FORCE_INLINE void store_char(unsigned char c) {
|
||||
CRITICAL_SECTION_START;
|
||||
const uint8_t h = rx_buffer.head,
|
||||
i = (uint8_t)(h + 1) & (RX_BUFFER_SIZE - 1);
|
||||
FORCE_INLINE void store_rxd_char() {
|
||||
const ring_buffer_pos_t h = rx_buffer.head,
|
||||
i = (ring_buffer_pos_t)(h + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1);
|
||||
|
||||
// if we should be storing the received character into the location
|
||||
// just before the tail (meaning that the head would advance to the
|
||||
// current location of the tail), we're about to overflow the buffer
|
||||
// and so we don't write the character or advance the head.
|
||||
if (i != rx_buffer.tail) {
|
||||
rx_buffer.buffer[h] = c;
|
||||
rx_buffer.head = i;
|
||||
// If the character is to be stored at the index just before the tail
|
||||
// (such that the head would advance to the current tail), the buffer is
|
||||
// critical, so don't write the character or advance the head.
|
||||
const char c = M_UDRx;
|
||||
if (i != rx_buffer.tail) {
|
||||
rx_buffer.buffer[h] = c;
|
||||
rx_buffer.head = i;
|
||||
}
|
||||
else {
|
||||
#if ENABLED(SERIAL_STATS_DROPPED_RX)
|
||||
if (!++rx_dropped_bytes) ++rx_dropped_bytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
|
||||
// calculate count of bytes stored into the RX buffer
|
||||
ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(rx_buffer.head - rx_buffer.tail) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1);
|
||||
// Keep track of the maximum count of enqueued bytes
|
||||
NOLESS(rx_max_enqueued, rx_count);
|
||||
#endif
|
||||
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
|
||||
// for high speed transfers, we can use XON/XOFF protocol to do
|
||||
// software handshake and avoid overruns.
|
||||
if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) {
|
||||
|
||||
// calculate count of bytes stored into the RX buffer
|
||||
ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(rx_buffer.head - rx_buffer.tail) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1);
|
||||
|
||||
// if we are above 12.5% of RX buffer capacity, send XOFF before
|
||||
// we run out of RX buffer space .. We need 325 bytes @ 250kbits/s to
|
||||
// let the host react and stop sending bytes. This translates to 13mS
|
||||
// propagation time.
|
||||
if (rx_count >= (RX_BUFFER_SIZE) / 8) {
|
||||
// If TX interrupts are disabled and data register is empty,
|
||||
// just write the byte to the data register and be done. This
|
||||
// shortcut helps significantly improve the effective datarate
|
||||
// at high (>500kbit/s) bitrates, where interrupt overhead
|
||||
// becomes a slowdown.
|
||||
if (!TEST(M_UCSRxB, M_UDRIEx) && TEST(M_UCSRxA, M_UDREx)) {
|
||||
// Send an XOFF character
|
||||
M_UDRx = XOFF_CHAR;
|
||||
// clear the TXC bit -- "can be cleared by writing a one to its bit
|
||||
// location". This makes sure flush() won't return until the bytes
|
||||
// actually got written
|
||||
SBI(M_UCSRxA, M_TXCx);
|
||||
// And remember it was sent
|
||||
xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT;
|
||||
}
|
||||
else {
|
||||
// TX interrupts disabled, but buffer still not empty ... or
|
||||
// TX interrupts enabled. Reenable TX ints and schedule XOFF
|
||||
// character to be sent
|
||||
#if TX_BUFFER_SIZE > 0
|
||||
SBI(M_UCSRxB, M_UDRIEx);
|
||||
xon_xoff_state = XOFF_CHAR;
|
||||
#else
|
||||
// We are not using TX interrupts, we will have to send this manually
|
||||
while (!TEST(M_UCSRxA, M_UDREx)) {/* nada */}
|
||||
M_UDRx = XOFF_CHAR;
|
||||
// And remember we already sent it
|
||||
xon_xoff_state = XOFF_CHAR | XON_XOFF_CHAR_SENT;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
CRITICAL_SECTION_END;
|
||||
#endif // SERIAL_XON_XOFF
|
||||
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
emergency_parser(c);
|
||||
@@ -160,37 +250,41 @@
|
||||
|
||||
FORCE_INLINE void _tx_udr_empty_irq(void) {
|
||||
// If interrupts are enabled, there must be more data in the output
|
||||
// buffer. Send the next byte
|
||||
const uint8_t t = tx_buffer.tail,
|
||||
c = tx_buffer.buffer[t];
|
||||
tx_buffer.tail = (t + 1) & (TX_BUFFER_SIZE - 1);
|
||||
// buffer.
|
||||
|
||||
M_UDRx = c;
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
// Do a priority insertion of an XON/XOFF char, if needed.
|
||||
const uint8_t state = xon_xoff_state;
|
||||
if (!(state & XON_XOFF_CHAR_SENT)) {
|
||||
M_UDRx = state & XON_XOFF_CHAR_MASK;
|
||||
xon_xoff_state = state | XON_XOFF_CHAR_SENT;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{ // Send the next byte
|
||||
const uint8_t t = tx_buffer.tail, c = tx_buffer.buffer[t];
|
||||
tx_buffer.tail = (t + 1) & (TX_BUFFER_SIZE - 1);
|
||||
M_UDRx = c;
|
||||
}
|
||||
|
||||
// clear the TXC bit -- "can be cleared by writing a one to its bit
|
||||
// location". This makes sure flush() won't return until the bytes
|
||||
// actually got written
|
||||
SBI(M_UCSRxA, M_TXCx);
|
||||
|
||||
if (tx_buffer.head == tx_buffer.tail) {
|
||||
// Buffer empty, so disable interrupts
|
||||
// Disable interrupts if the buffer is empty
|
||||
if (tx_buffer.head == tx_buffer.tail)
|
||||
CBI(M_UCSRxB, M_UDRIEx);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef M_USARTx_UDRE_vect
|
||||
ISR(M_USARTx_UDRE_vect) {
|
||||
_tx_udr_empty_irq();
|
||||
}
|
||||
ISR(M_USARTx_UDRE_vect) { _tx_udr_empty_irq(); }
|
||||
#endif
|
||||
|
||||
#endif // TX_BUFFER_SIZE
|
||||
|
||||
#ifdef M_USARTx_RX_vect
|
||||
ISR(M_USARTx_RX_vect) {
|
||||
const unsigned char c = M_UDRx;
|
||||
store_char(c);
|
||||
}
|
||||
ISR(M_USARTx_RX_vect) { store_rxd_char(); }
|
||||
#endif
|
||||
|
||||
// Public Methods
|
||||
@@ -200,9 +294,9 @@
|
||||
bool useU2X = true;
|
||||
|
||||
#if F_CPU == 16000000UL && SERIAL_PORT == 0
|
||||
// hard-coded exception for compatibility with the bootloader shipped
|
||||
// with the Duemilanove and previous boards and the firmware on the 8U2
|
||||
// on the Uno and Mega 2560.
|
||||
// Hard-coded exception for compatibility with the bootloader shipped
|
||||
// with the Duemilanove and previous boards, and the firmware on the
|
||||
// 8U2 on the Uno and Mega 2560.
|
||||
if (baud == 57600) useU2X = false;
|
||||
#endif
|
||||
|
||||
@@ -237,8 +331,9 @@
|
||||
|
||||
void MarlinSerial::checkRx(void) {
|
||||
if (TEST(M_UCSRxA, M_RXCx)) {
|
||||
const uint8_t c = M_UDRx;
|
||||
store_char(c);
|
||||
CRITICAL_SECTION_START;
|
||||
store_rxd_char();
|
||||
CRITICAL_SECTION_END;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,51 +347,81 @@
|
||||
int MarlinSerial::read(void) {
|
||||
int v;
|
||||
CRITICAL_SECTION_START;
|
||||
const uint8_t t = rx_buffer.tail;
|
||||
const ring_buffer_pos_t t = rx_buffer.tail;
|
||||
if (rx_buffer.head == t)
|
||||
v = -1;
|
||||
else {
|
||||
v = rx_buffer.buffer[t];
|
||||
rx_buffer.tail = (uint8_t)(t + 1) & (RX_BUFFER_SIZE - 1);
|
||||
rx_buffer.tail = (ring_buffer_pos_t)(t + 1) & (RX_BUFFER_SIZE - 1);
|
||||
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) {
|
||||
// Get count of bytes in the RX buffer
|
||||
ring_buffer_pos_t rx_count = (ring_buffer_pos_t)(rx_buffer.head - rx_buffer.tail) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1);
|
||||
// When below 10% of RX buffer capacity, send XON before
|
||||
// running out of RX buffer bytes
|
||||
if (rx_count < (RX_BUFFER_SIZE) / 10) {
|
||||
xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT;
|
||||
CRITICAL_SECTION_END; // End critical section before returning!
|
||||
writeNoHandshake(XON_CHAR);
|
||||
return v;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
CRITICAL_SECTION_END;
|
||||
return v;
|
||||
}
|
||||
|
||||
uint8_t MarlinSerial::available(void) {
|
||||
ring_buffer_pos_t MarlinSerial::available(void) {
|
||||
CRITICAL_SECTION_START;
|
||||
const uint8_t h = rx_buffer.head,
|
||||
t = rx_buffer.tail;
|
||||
const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;
|
||||
CRITICAL_SECTION_END;
|
||||
return (uint8_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1);
|
||||
return (ring_buffer_pos_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1);
|
||||
}
|
||||
|
||||
void MarlinSerial::flush(void) {
|
||||
// RX
|
||||
// don't reverse this or there may be problems if the RX interrupt
|
||||
// occurs after reading the value of rx_buffer_head but before writing
|
||||
// the value to rx_buffer_tail; the previous value of rx_buffer_head
|
||||
// may be written to rx_buffer_tail, making it appear as if the buffer
|
||||
// were full, not empty.
|
||||
// Don't change this order of operations. If the RX interrupt occurs between
|
||||
// reading rx_buffer_head and updating rx_buffer_tail, the previous rx_buffer_head
|
||||
// may be written to rx_buffer_tail, making the buffer appear full rather than empty.
|
||||
CRITICAL_SECTION_START;
|
||||
rx_buffer.head = rx_buffer.tail;
|
||||
CRITICAL_SECTION_END;
|
||||
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XOFF_CHAR) {
|
||||
xon_xoff_state = XON_CHAR | XON_XOFF_CHAR_SENT;
|
||||
writeNoHandshake(XON_CHAR);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if TX_BUFFER_SIZE > 0
|
||||
uint8_t MarlinSerial::availableForWrite(void) {
|
||||
CRITICAL_SECTION_START;
|
||||
const uint8_t h = tx_buffer.head,
|
||||
t = tx_buffer.tail;
|
||||
const uint8_t h = tx_buffer.head, t = tx_buffer.tail;
|
||||
CRITICAL_SECTION_END;
|
||||
return (uint8_t)(TX_BUFFER_SIZE + h - t) & (TX_BUFFER_SIZE - 1);
|
||||
}
|
||||
|
||||
void MarlinSerial::write(const uint8_t c) {
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
const uint8_t state = xon_xoff_state;
|
||||
if (!(state & XON_XOFF_CHAR_SENT)) {
|
||||
// Send 2 chars: XON/XOFF, then a user-specified char
|
||||
writeNoHandshake(state & XON_XOFF_CHAR_MASK);
|
||||
xon_xoff_state = state | XON_XOFF_CHAR_SENT;
|
||||
}
|
||||
#endif
|
||||
writeNoHandshake(c);
|
||||
}
|
||||
|
||||
void MarlinSerial::writeNoHandshake(const uint8_t c) {
|
||||
_written = true;
|
||||
CRITICAL_SECTION_START;
|
||||
bool emty = (tx_buffer.head == tx_buffer.tail);
|
||||
CRITICAL_SECTION_END;
|
||||
|
||||
// If the buffer and the data register is empty, just write the byte
|
||||
// to the data register and be done. This shortcut helps
|
||||
// significantly improve the effective datarate at high (>
|
||||
@@ -320,7 +445,8 @@
|
||||
// space for us.
|
||||
if (TEST(M_UCSRxA, M_UDREx))
|
||||
_tx_udr_empty_irq();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// nop, the interrupt handler will free up space for us
|
||||
}
|
||||
}
|
||||
@@ -352,20 +478,32 @@
|
||||
}
|
||||
// If we get here, nothing is queued anymore (DRIE is disabled) and
|
||||
// the hardware finished tranmission (TXC is set).
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
void MarlinSerial::write(uint8_t c) {
|
||||
while (!TEST(M_UCSRxA, M_UDREx))
|
||||
;
|
||||
#else // TX_BUFFER_SIZE == 0
|
||||
|
||||
void MarlinSerial::write(const uint8_t c) {
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
// Do a priority insertion of an XON/XOFF char, if needed.
|
||||
const uint8_t state = xon_xoff_state;
|
||||
if (!(state & XON_XOFF_CHAR_SENT)) {
|
||||
writeNoHandshake(state & XON_XOFF_CHAR_MASK);
|
||||
xon_xoff_state = state | XON_XOFF_CHAR_SENT;
|
||||
}
|
||||
#endif
|
||||
writeNoHandshake(c);
|
||||
}
|
||||
|
||||
void MarlinSerial::writeNoHandshake(uint8_t c) {
|
||||
while (!TEST(M_UCSRxA, M_UDREx)) {/* nada */}
|
||||
M_UDRx = c;
|
||||
}
|
||||
#endif
|
||||
|
||||
// end NEW
|
||||
|
||||
/// imports from print.h
|
||||
#endif // TX_BUFFER_SIZE == 0
|
||||
|
||||
/**
|
||||
* Imports from print.h
|
||||
*/
|
||||
|
||||
void MarlinSerial::print(char c, int base) {
|
||||
print((long)c, base);
|
||||
|
||||
+34
-38
@@ -75,44 +75,31 @@
|
||||
#define BIN 2
|
||||
#define BYTE 0
|
||||
|
||||
// Define constants and variables for buffering serial data.
|
||||
// Use only 0 or powers of 2 greater than 1
|
||||
// : [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...]
|
||||
#ifndef RX_BUFFER_SIZE
|
||||
#define RX_BUFFER_SIZE 128
|
||||
#endif
|
||||
// 256 is the max TX buffer limit due to uint8_t head and tail.
|
||||
#ifndef TX_BUFFER_SIZE
|
||||
#define TX_BUFFER_SIZE 32
|
||||
#endif
|
||||
|
||||
#ifndef USBCON
|
||||
// Define constants and variables for buffering incoming serial data. We're
|
||||
// using a ring buffer (I think), in which rx_buffer_head is the index of the
|
||||
// location to which to write the next incoming character and rx_buffer_tail
|
||||
// is the index of the location from which to read.
|
||||
// 256 is the max limit due to uint8_t head and tail. Use only powers of 2. (...,16,32,64,128,256)
|
||||
#ifndef RX_BUFFER_SIZE
|
||||
#define RX_BUFFER_SIZE 128
|
||||
#endif
|
||||
#ifndef TX_BUFFER_SIZE
|
||||
#define TX_BUFFER_SIZE 32
|
||||
#endif
|
||||
#if !((RX_BUFFER_SIZE == 256) ||(RX_BUFFER_SIZE == 128) ||(RX_BUFFER_SIZE == 64) ||(RX_BUFFER_SIZE == 32) ||(RX_BUFFER_SIZE == 16) ||(RX_BUFFER_SIZE == 8) ||(RX_BUFFER_SIZE == 4) ||(RX_BUFFER_SIZE == 2))
|
||||
#error "RX_BUFFER_SIZE has to be a power of 2 and >= 2"
|
||||
#endif
|
||||
#if !((TX_BUFFER_SIZE == 256) ||(TX_BUFFER_SIZE == 128) ||(TX_BUFFER_SIZE == 64) ||(TX_BUFFER_SIZE == 32) ||(TX_BUFFER_SIZE == 16) ||(TX_BUFFER_SIZE == 8) ||(TX_BUFFER_SIZE == 4) ||(TX_BUFFER_SIZE == 2) ||(TX_BUFFER_SIZE == 0))
|
||||
#error TX_BUFFER_SIZE has to be a power of 2 or 0
|
||||
|
||||
#if RX_BUFFER_SIZE > 256
|
||||
typedef uint16_t ring_buffer_pos_t;
|
||||
#else
|
||||
typedef uint8_t ring_buffer_pos_t;
|
||||
#endif
|
||||
|
||||
struct ring_buffer_r {
|
||||
unsigned char buffer[RX_BUFFER_SIZE];
|
||||
volatile uint8_t head;
|
||||
volatile uint8_t tail;
|
||||
};
|
||||
|
||||
#if TX_BUFFER_SIZE > 0
|
||||
struct ring_buffer_t {
|
||||
unsigned char buffer[TX_BUFFER_SIZE];
|
||||
volatile uint8_t head;
|
||||
volatile uint8_t tail;
|
||||
};
|
||||
#if ENABLED(SERIAL_STATS_DROPPED_RX)
|
||||
extern uint8_t rx_dropped_bytes;
|
||||
#endif
|
||||
|
||||
#if UART_PRESENT(SERIAL_PORT)
|
||||
extern ring_buffer_r rx_buffer;
|
||||
#if TX_BUFFER_SIZE > 0
|
||||
extern ring_buffer_t tx_buffer;
|
||||
#endif
|
||||
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
|
||||
extern ring_buffer_pos_t rx_max_enqueued;
|
||||
#endif
|
||||
|
||||
class MarlinSerial { //: public Stream
|
||||
@@ -124,23 +111,32 @@
|
||||
static int peek(void);
|
||||
static int read(void);
|
||||
static void flush(void);
|
||||
static uint8_t available(void);
|
||||
static ring_buffer_pos_t available(void);
|
||||
static void checkRx(void);
|
||||
static void write(const uint8_t c);
|
||||
#if TX_BUFFER_SIZE > 0
|
||||
static uint8_t availableForWrite(void);
|
||||
static void flushTX(void);
|
||||
#endif
|
||||
static void writeNoHandshake(const uint8_t c);
|
||||
|
||||
#if ENABLED(SERIAL_STATS_DROPPED_RX)
|
||||
FORCE_INLINE static uint32_t dropped() { return rx_dropped_bytes; }
|
||||
#endif
|
||||
|
||||
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
|
||||
FORCE_INLINE static ring_buffer_pos_t rxMaxEnqueued() { return rx_max_enqueued; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
static void printNumber(unsigned long, const uint8_t);
|
||||
static void printFloat(double, uint8_t);
|
||||
|
||||
public:
|
||||
static FORCE_INLINE void write(const char* str) { while (*str) write(*str++); }
|
||||
static FORCE_INLINE void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); }
|
||||
static FORCE_INLINE void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); }
|
||||
static FORCE_INLINE void print(const char* str) { write(str); }
|
||||
FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); }
|
||||
FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); }
|
||||
FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); }
|
||||
FORCE_INLINE static void print(const char* str) { write(str); }
|
||||
|
||||
static void print(char, int = BYTE);
|
||||
static void print(unsigned char, int = BYTE);
|
||||
|
||||
+5873
-3604
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,349 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This module is off by default, but can be enabled to facilitate the display of
|
||||
* extra debug information during code development. It assumes the existence of a
|
||||
* Max7219 LED Matrix. A suitable device can be obtained on eBay similar to this:
|
||||
* http://www.ebay.com/itm/191781645249 for under $2.00 including shipping.
|
||||
*
|
||||
* Just connect up +5v and GND to give it power, then connect up the pins assigned
|
||||
* in Configuration_adv.h. For example, on the Re-ARM you could use:
|
||||
*
|
||||
* #define MAX7219_CLK_PIN 77
|
||||
* #define MAX7219_DIN_PIN 78
|
||||
* #define MAX7219_LOAD_PIN 79
|
||||
*
|
||||
* Max7219_init() is called automatically at startup, and then there are a number of
|
||||
* support functions available to control the LEDs in the 8x8 grid.
|
||||
*
|
||||
* void Max7219_init();
|
||||
* void Max7219_PutByte(uint8_t data);
|
||||
* void Max7219(uint8_t reg, uint8_t data);
|
||||
* void Max7219_LED_On(uint8_t col, uint8_t row);
|
||||
* void Max7219_LED_Off(uint8_t col, uint8_t row);
|
||||
* void Max7219_LED_Toggle(uint8_t col, uint8_t row);
|
||||
* void Max7219_Clear_Row(uint8_t row);
|
||||
* void Max7219_Clear_Column(uint8_t col);
|
||||
* void Max7219_Set_Row(uint8_t row, uint8_t val);
|
||||
* void Max7219_Set_2_Rows(uint8_t row, uint16_t val);
|
||||
* void Max7219_Set_4_Rows(uint8_t row, uint32_t val);
|
||||
* void Max7219_Set_Column(uint8_t col, uint8_t val);
|
||||
* void Max7219_idle_tasks();
|
||||
*/
|
||||
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if ENABLED(MAX7219_DEBUG)
|
||||
|
||||
#include "Max7219_Debug_LEDs.h"
|
||||
|
||||
#include "planner.h"
|
||||
#include "stepper.h"
|
||||
#include "Marlin.h"
|
||||
|
||||
static uint8_t LEDs[8] = { 0 };
|
||||
|
||||
#ifdef CPU_32_BIT
|
||||
#define MS_DELAY() delayMicroseconds(5) // 32-bit processors need a delay to stabilize the signal
|
||||
#else
|
||||
#define MS_DELAY() NOOP
|
||||
#endif
|
||||
|
||||
void Max7219_PutByte(uint8_t data) {
|
||||
CRITICAL_SECTION_START
|
||||
for (uint8_t i = 8; i--;) {
|
||||
MS_DELAY();
|
||||
WRITE(MAX7219_CLK_PIN, LOW); // tick
|
||||
MS_DELAY();
|
||||
WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit
|
||||
MS_DELAY();
|
||||
WRITE(MAX7219_CLK_PIN, HIGH); // tock
|
||||
MS_DELAY();
|
||||
data <<= 1;
|
||||
}
|
||||
CRITICAL_SECTION_END
|
||||
}
|
||||
|
||||
void Max7219(const uint8_t reg, const uint8_t data) {
|
||||
MS_DELAY();
|
||||
CRITICAL_SECTION_START
|
||||
WRITE(MAX7219_LOAD_PIN, LOW); // begin
|
||||
MS_DELAY();
|
||||
Max7219_PutByte(reg); // specify register
|
||||
MS_DELAY();
|
||||
Max7219_PutByte(data); // put data
|
||||
MS_DELAY();
|
||||
WRITE(MAX7219_LOAD_PIN, LOW); // and tell the chip to load the data
|
||||
MS_DELAY();
|
||||
WRITE(MAX7219_LOAD_PIN, HIGH);
|
||||
CRITICAL_SECTION_END
|
||||
MS_DELAY();
|
||||
}
|
||||
|
||||
void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on) {
|
||||
if (row > 7 || col > 7) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_LED_Set(", (int)row);
|
||||
SERIAL_ECHOPAIR(",", (int)col);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
if (TEST(LEDs[row], col) == on) return; // if LED is already on/off, leave alone
|
||||
if (on) SBI(LEDs[row], col); else CBI(LEDs[row], col);
|
||||
Max7219(8 - row, LEDs[row]);
|
||||
}
|
||||
|
||||
void Max7219_LED_On(const uint8_t col, const uint8_t row) {
|
||||
if (row > 7 || col > 7) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_LED_On(", (int)col);
|
||||
SERIAL_ECHOPAIR(",", (int)row);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
Max7219_LED_Set(col, row, true);
|
||||
}
|
||||
|
||||
void Max7219_LED_Off(const uint8_t col, const uint8_t row) {
|
||||
if (row > 7 || col > 7) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_LED_Off(", (int)row);
|
||||
SERIAL_ECHOPAIR(",", (int)col);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
Max7219_LED_Set(col, row, false);
|
||||
}
|
||||
|
||||
void Max7219_LED_Toggle(const uint8_t col, const uint8_t row) {
|
||||
if (row > 7 || col > 7) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_LED_Toggle(", (int)row);
|
||||
SERIAL_ECHOPAIR(",", (int)col);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
if (TEST(LEDs[row], col))
|
||||
Max7219_LED_Off(col, row);
|
||||
else
|
||||
Max7219_LED_On(col, row);
|
||||
}
|
||||
|
||||
void Max7219_Clear_Column(const uint8_t col) {
|
||||
if (col > 7) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_Clear_Column(", (int)col);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
LEDs[col] = 0;
|
||||
Max7219(8 - col, LEDs[col]);
|
||||
}
|
||||
|
||||
void Max7219_Clear_Row(const uint8_t row) {
|
||||
if (row > 7) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_Clear_Row(", (int)row);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
for (uint8_t c = 0; c <= 7; c++)
|
||||
Max7219_LED_Off(c, row);
|
||||
}
|
||||
|
||||
void Max7219_Set_Row(const uint8_t row, const uint8_t val) {
|
||||
if (row > 7) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_Set_Row(", (int)row);
|
||||
SERIAL_ECHOPAIR(",", (int)val);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
for (uint8_t b = 0; b <= 7; b++)
|
||||
if (TEST(val, b))
|
||||
Max7219_LED_On(7 - b, row);
|
||||
else
|
||||
Max7219_LED_Off(7 - b, row);
|
||||
}
|
||||
|
||||
void Max7219_Set_2_Rows(const uint8_t row, const uint16_t val) {
|
||||
if (row > 6) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_Set_2_Rows(", (int)row);
|
||||
SERIAL_ECHOPAIR(",", (int)val);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
Max7219_Set_Row(row + 1, (val >> 8) & 0xFF);
|
||||
Max7219_Set_Row(row + 0, (val ) & 0xFF);
|
||||
}
|
||||
|
||||
void Max7219_Set_4_Rows(const uint8_t row, const uint32_t val) {
|
||||
if (row > 4) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_Set_4_Rows(", (int)row);
|
||||
SERIAL_ECHOPAIR(",", (long)val);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
Max7219_Set_Row(row + 3, (val >> 24) & 0xFF);
|
||||
Max7219_Set_Row(row + 2, (val >> 16) & 0xFF);
|
||||
Max7219_Set_Row(row + 1, (val >> 8) & 0xFF);
|
||||
Max7219_Set_Row(row + 0, (val ) & 0xFF);
|
||||
}
|
||||
|
||||
void Max7219_Set_Column(const uint8_t col, const uint8_t val) {
|
||||
if (col > 7) {
|
||||
SERIAL_ECHOPAIR("??? Max7219_Column(", (int)col);
|
||||
SERIAL_ECHOPAIR(",", (int)val);
|
||||
SERIAL_ECHOLNPGM(")");
|
||||
return;
|
||||
}
|
||||
LEDs[col] = val;
|
||||
Max7219(8 - col, LEDs[col]);
|
||||
}
|
||||
|
||||
void Max7219_init() {
|
||||
uint8_t i, x, y;
|
||||
|
||||
SET_OUTPUT(MAX7219_DIN_PIN);
|
||||
SET_OUTPUT(MAX7219_CLK_PIN);
|
||||
|
||||
OUT_WRITE(MAX7219_LOAD_PIN, HIGH);
|
||||
delay(1);
|
||||
|
||||
//initiation of the max 7219
|
||||
Max7219(max7219_reg_scanLimit, 0x07);
|
||||
Max7219(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits)
|
||||
Max7219(max7219_reg_shutdown, 0x01); // not in shutdown mode
|
||||
Max7219(max7219_reg_displayTest, 0x00); // no display test
|
||||
Max7219(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set
|
||||
// range: 0x00 to 0x0F
|
||||
for (i = 0; i <= 7; i++) { // empty registers, turn all LEDs off
|
||||
LEDs[i] = 0x00;
|
||||
Max7219(i + 1, 0);
|
||||
}
|
||||
|
||||
for (x = 0; x <= 7; x++) // Do an aesthetically pleasing pattern to fully test
|
||||
for (y = 0; y <= 7; y++) { // the Max7219 module and LEDs. First, turn them
|
||||
Max7219_LED_On(x, y); // all on.
|
||||
delay(3);
|
||||
}
|
||||
|
||||
for (x = 0; x <= 7; x++) // Now, turn them all off.
|
||||
for (y = 0; y <= 7; y++) {
|
||||
Max7219_LED_Off(x, y);
|
||||
delay(3); // delay() is OK here. Max7219_init() is only called from
|
||||
} // setup() and nothing is running yet.
|
||||
|
||||
delay(150);
|
||||
|
||||
for (x = 8; x--;) // Now, do the same thing from the opposite direction
|
||||
for (y = 0; y <= 7; y++) {
|
||||
Max7219_LED_On(x, y);
|
||||
delay(2);
|
||||
}
|
||||
|
||||
for (x = 8; x--;)
|
||||
for (y = 0; y <= 7; y++) {
|
||||
Max7219_LED_Off(x, y);
|
||||
delay(2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* These are sample debug features to demonstrate the usage of the 8x8 LED Matrix for debug purposes.
|
||||
* There is very little CPU burden added to the system by displaying information within the idle()
|
||||
* task.
|
||||
*
|
||||
* But with that said, if your debugging can be facilitated by making calls into the library from
|
||||
* other places in the code, feel free to do it. The CPU burden for a few calls to toggle an LED
|
||||
* or clear a row is not very significant.
|
||||
*/
|
||||
void Max7219_idle_tasks() {
|
||||
#if MAX7219_DEBUG_STEPPER_HEAD || MAX7219_DEBUG_STEPPER_TAIL || MAX7219_DEBUG_STEPPER_QUEUE
|
||||
CRITICAL_SECTION_START
|
||||
#if MAX7219_DEBUG_STEPPER_HEAD || MAX7219_DEBUG_STEPPER_QUEUE
|
||||
const uint8_t head = planner.block_buffer_head;
|
||||
#endif
|
||||
#if MAX7219_DEBUG_STEPPER_TAIL || MAX7219_DEBUG_STEPPER_QUEUE
|
||||
const uint8_t tail = planner.block_buffer_tail;
|
||||
#endif
|
||||
CRITICAL_SECTION_END
|
||||
#endif
|
||||
|
||||
#if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE)
|
||||
static millis_t next_blink = 0;
|
||||
if (ELAPSED(millis(), next_blink)) {
|
||||
Max7219_LED_Toggle(7, 7);
|
||||
next_blink = millis() + 750;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MAX7219_DEBUG_STEPPER_HEAD
|
||||
static int16_t last_head_cnt = 0;
|
||||
if (last_head_cnt != head) {
|
||||
if (last_head_cnt < 8)
|
||||
Max7219_LED_Off(last_head_cnt, MAX7219_DEBUG_STEPPER_HEAD);
|
||||
else
|
||||
Max7219_LED_Off(last_head_cnt - 8, MAX7219_DEBUG_STEPPER_HEAD + 1);
|
||||
|
||||
last_head_cnt = head;
|
||||
if (head < 8)
|
||||
Max7219_LED_On(head, MAX7219_DEBUG_STEPPER_HEAD);
|
||||
else
|
||||
Max7219_LED_On(head - 8, MAX7219_DEBUG_STEPPER_HEAD + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MAX7219_DEBUG_STEPPER_TAIL
|
||||
static int16_t last_tail_cnt = 0;
|
||||
if (last_tail_cnt != tail) {
|
||||
if (last_tail_cnt < 8)
|
||||
Max7219_LED_Off(last_tail_cnt, MAX7219_DEBUG_STEPPER_TAIL);
|
||||
else
|
||||
Max7219_LED_Off(last_tail_cnt - 8, MAX7219_DEBUG_STEPPER_TAIL + 1);
|
||||
|
||||
last_tail_cnt = tail;
|
||||
if (tail < 8)
|
||||
Max7219_LED_On(tail, MAX7219_DEBUG_STEPPER_TAIL);
|
||||
else
|
||||
Max7219_LED_On(tail - 8, MAX7219_DEBUG_STEPPER_TAIL + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MAX7219_DEBUG_STEPPER_QUEUE
|
||||
static int16_t last_depth = 0;
|
||||
int16_t current_depth = head - tail;
|
||||
if (current_depth != last_depth) { // usually, no update will be needed.
|
||||
if (current_depth < 0) current_depth += BLOCK_BUFFER_SIZE;
|
||||
NOMORE(current_depth, BLOCK_BUFFER_SIZE);
|
||||
NOMORE(current_depth, 16); // if the BLOCK_BUFFER_SIZE is greater than 16, two lines
|
||||
// of LEDs is enough to see if the buffer is draining
|
||||
|
||||
const uint8_t st = min(current_depth, last_depth),
|
||||
en = max(current_depth, last_depth);
|
||||
if (current_depth < last_depth)
|
||||
for (uint8_t i = st; i <= en; i++) // clear the highest order LEDs
|
||||
Max7219_LED_Off(i / 2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1));
|
||||
else
|
||||
for (uint8_t i = st; i <= en; i++) // set the LEDs to current depth
|
||||
Max7219_LED_On(i / 2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1));
|
||||
|
||||
last_depth = current_depth;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // MAX7219_DEBUG
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This module is off by default, but can be enabled to facilitate the display of
|
||||
* extra debug information during code development. It assumes the existence of a
|
||||
* Max7219 LED Matrix. A suitable device can be obtained on eBay similar to this:
|
||||
* http://www.ebay.com/itm/191781645249 for under $2.00 including shipping.
|
||||
*
|
||||
* Just connect up +5v and GND to give it power, then connect up the pins assigned
|
||||
* in Configuration_adv.h. For example, on the Re-ARM you could use:
|
||||
*
|
||||
* #define MAX7219_CLK_PIN 77
|
||||
* #define MAX7219_DIN_PIN 78
|
||||
* #define MAX7219_LOAD_PIN 79
|
||||
*
|
||||
* Max7219_init() is called automatically at startup, and then there are a number of
|
||||
* support functions available to control the LEDs in the 8x8 grid.
|
||||
*
|
||||
* void Max7219_init();
|
||||
* void Max7219_PutByte(uint8_t data);
|
||||
* void Max7219(uint8_t reg, uint8_t data);
|
||||
* void Max7219_LED_Set(uint8_t row, uint8_t col, bool on);
|
||||
* void Max7219_LED_On(uint8_t col, uint8_t row);
|
||||
* void Max7219_LED_Off(uint8_t col, uint8_t row);
|
||||
* void Max7219_LED_Toggle(uint8_t row, uint8_t col);
|
||||
* void Max7219_Clear_Row(uint8_t row);
|
||||
* void Max7219_Clear_Column(uint8_t col);
|
||||
* void Max7219_Set_Row(uint8_t row, uint8_t val);
|
||||
* void Max7219_Set_2_Rows(uint8_t row, uint16_t val);
|
||||
* void Max7219_Set_4_Rows(uint8_t row, uint32_t val);
|
||||
* void Max7219_Set_Column(uint8_t col, uint8_t val);
|
||||
* void Max7219_idle_tasks();
|
||||
*/
|
||||
|
||||
#ifndef __MAX7219_DEBUG_LEDS_H__
|
||||
#define __MAX7219_DEBUG_LEDS_H__
|
||||
|
||||
//
|
||||
// define max7219 registers
|
||||
//
|
||||
#define max7219_reg_noop 0x00
|
||||
#define max7219_reg_digit0 0x01
|
||||
#define max7219_reg_digit1 0x02
|
||||
#define max7219_reg_digit2 0x03
|
||||
#define max7219_reg_digit3 0x04
|
||||
#define max7219_reg_digit4 0x05
|
||||
#define max7219_reg_digit5 0x06
|
||||
#define max7219_reg_digit6 0x07
|
||||
#define max7219_reg_digit7 0x08
|
||||
|
||||
#define max7219_reg_intensity 0x0A
|
||||
#define max7219_reg_displayTest 0x0F
|
||||
#define max7219_reg_decodeMode 0x09
|
||||
#define max7219_reg_scanLimit 0x0B
|
||||
#define max7219_reg_shutdown 0x0C
|
||||
|
||||
void Max7219_init();
|
||||
void Max7219_PutByte(uint8_t data);
|
||||
void Max7219(const uint8_t reg, const uint8_t data);
|
||||
void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on);
|
||||
void Max7219_LED_On(const uint8_t row, const uint8_t col);
|
||||
void Max7219_LED_Off(const uint8_t row, const uint8_t col);
|
||||
void Max7219_LED_Toggle(const uint8_t row, const uint8_t col);
|
||||
void Max7219_Clear_Row(const uint8_t row);
|
||||
void Max7219_Clear_Column(const uint8_t col);
|
||||
void Max7219_Set_Row(const uint8_t row, const uint8_t val);
|
||||
void Max7219_Set_Column(const uint8_t col, const uint8_t val);
|
||||
void Max7219_idle_tasks();
|
||||
|
||||
#endif // __MAX7219_DEBUG_LEDS_H__
|
||||
+763
-278
File diff suppressed because it is too large
Load Diff
+161
-175
@@ -26,19 +26,19 @@
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "Sd2Card.h"
|
||||
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
#include "watchdog.h"
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
#if DISABLED(SOFTWARE_SPI)
|
||||
// functions for hardware SPI
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// make sure SPCR rate is in expected bits
|
||||
#if (SPR0 != 0 || SPR1 != 1)
|
||||
#error "unexpected SPCR bits"
|
||||
@@ -52,34 +52,34 @@
|
||||
SPCR = _BV(SPE) | _BV(MSTR) | (spiRate >> 1);
|
||||
SPSR = spiRate & 1 || spiRate == 6 ? 0 : _BV(SPI2X);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** SPI receive a byte */
|
||||
static uint8_t spiRec() {
|
||||
SPDR = 0XFF;
|
||||
SPDR = 0xFF;
|
||||
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
|
||||
return SPDR;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** SPI read data - only one call so force inline */
|
||||
static inline __attribute__((always_inline))
|
||||
void spiRead(uint8_t* buf, uint16_t nbyte) {
|
||||
if (nbyte-- == 0) return;
|
||||
SPDR = 0XFF;
|
||||
SPDR = 0xFF;
|
||||
for (uint16_t i = 0; i < nbyte; i++) {
|
||||
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
|
||||
buf[i] = SPDR;
|
||||
SPDR = 0XFF;
|
||||
SPDR = 0xFF;
|
||||
}
|
||||
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
|
||||
buf[nbyte] = SPDR;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** SPI send a byte */
|
||||
static void spiSend(uint8_t b) {
|
||||
SPDR = b;
|
||||
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** SPI send block - only one call so force inline */
|
||||
static inline __attribute__((always_inline))
|
||||
void spiSendBlock(uint8_t token, const uint8_t* buf) {
|
||||
@@ -95,15 +95,16 @@
|
||||
//------------------------------------------------------------------------------
|
||||
#else // SOFTWARE_SPI
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** nop to tune soft SPI timing */
|
||||
#define nop asm volatile ("nop\n\t")
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Soft SPI receive byte */
|
||||
static uint8_t spiRec() {
|
||||
uint8_t data = 0;
|
||||
// no interrupts during byte receive - about 8 us
|
||||
cli();
|
||||
// output pin high - like sending 0XFF
|
||||
// output pin high - like sending 0xFF
|
||||
WRITE(SPI_MOSI_PIN, HIGH);
|
||||
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
@@ -123,13 +124,13 @@
|
||||
sei();
|
||||
return data;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Soft SPI read data */
|
||||
static void spiRead(uint8_t* buf, uint16_t nbyte) {
|
||||
for (uint16_t i = 0; i < nbyte; i++)
|
||||
buf[i] = spiRec();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Soft SPI send byte */
|
||||
static void spiSend(uint8_t data) {
|
||||
// no interrupts during byte send - about 8 us
|
||||
@@ -137,7 +138,7 @@
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
WRITE(SPI_SCK_PIN, LOW);
|
||||
|
||||
WRITE(SPI_MOSI_PIN, data & 0X80);
|
||||
WRITE(SPI_MOSI_PIN, data & 0x80);
|
||||
|
||||
data <<= 1;
|
||||
|
||||
@@ -153,7 +154,7 @@
|
||||
// enable interrupts
|
||||
sei();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Soft SPI send block */
|
||||
void spiSendBlock(uint8_t token, const uint8_t* buf) {
|
||||
spiSend(token);
|
||||
@@ -161,7 +162,7 @@
|
||||
spiSend(buf[i]);
|
||||
}
|
||||
#endif // SOFTWARE_SPI
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// send command and return error code. Return zero for OK
|
||||
uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) {
|
||||
// select card
|
||||
@@ -177,19 +178,19 @@ uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) {
|
||||
for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s);
|
||||
|
||||
// send CRC
|
||||
uint8_t crc = 0XFF;
|
||||
if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0
|
||||
if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA
|
||||
uint8_t crc = 0xFF;
|
||||
if (cmd == CMD0) crc = 0x95; // correct crc for CMD0 with arg 0
|
||||
if (cmd == CMD8) crc = 0x87; // correct crc for CMD8 with arg 0x1AA
|
||||
spiSend(crc);
|
||||
|
||||
// skip stuff byte for stop read
|
||||
if (cmd == CMD12) spiRec();
|
||||
|
||||
// wait for response
|
||||
for (uint8_t i = 0; ((status_ = spiRec()) & 0X80) && i != 0XFF; i++) { /* Intentionally left empty */ }
|
||||
for (uint8_t i = 0; ((status_ = spiRec()) & 0x80) && i != 0xFF; i++) { /* Intentionally left empty */ }
|
||||
return status_;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Determine the size of an SD flash memory card.
|
||||
*
|
||||
@@ -217,19 +218,20 @@ uint32_t Sd2Card::cardSize() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void Sd2Card::chipSelectHigh() {
|
||||
digitalWrite(chipSelectPin_, HIGH);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void Sd2Card::chipSelectLow() {
|
||||
#if DISABLED(SOFTWARE_SPI)
|
||||
spiInit(spiRate_);
|
||||
#endif // SOFTWARE_SPI
|
||||
digitalWrite(chipSelectPin_, LOW);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Erase a range of blocks.
|
||||
|
||||
/**
|
||||
* Erase a range of blocks.
|
||||
*
|
||||
* \param[in] firstBlock The address of the first block in the range.
|
||||
* \param[in] lastBlock The address of the last block in the range.
|
||||
@@ -239,12 +241,11 @@ void Sd2Card::chipSelectLow() {
|
||||
* either 0 or 1, depends on the card vendor. The card must support
|
||||
* single block erase.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::erase(uint32_t firstBlock, uint32_t lastBlock) {
|
||||
csd_t csd;
|
||||
if (!readCSD(&csd)) goto fail;
|
||||
if (!readCSD(&csd)) goto FAIL;
|
||||
// check for single block erase
|
||||
if (!csd.v1.erase_blk_en) {
|
||||
// erase size mask
|
||||
@@ -252,7 +253,7 @@ bool Sd2Card::erase(uint32_t firstBlock, uint32_t lastBlock) {
|
||||
if ((firstBlock & m) != 0 || ((lastBlock + 1) & m) != 0) {
|
||||
// error card can't erase specified area
|
||||
error(SD_CARD_ERROR_ERASE_SINGLE_BLOCK);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
}
|
||||
if (type_ != SD_CARD_TYPE_SDHC) {
|
||||
@@ -263,38 +264,38 @@ bool Sd2Card::erase(uint32_t firstBlock, uint32_t lastBlock) {
|
||||
|| cardCommand(CMD33, lastBlock)
|
||||
|| cardCommand(CMD38, 0)) {
|
||||
error(SD_CARD_ERROR_ERASE);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
if (!waitNotBusy(SD_ERASE_TIMEOUT)) {
|
||||
error(SD_CARD_ERROR_ERASE_TIMEOUT);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
chipSelectHigh();
|
||||
return true;
|
||||
fail:
|
||||
FAIL:
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Determine if card supports single block erase.
|
||||
|
||||
/**
|
||||
* Determine if card supports single block erase.
|
||||
*
|
||||
* \return The value one, true, is returned if single block erase is supported.
|
||||
* The value zero, false, is returned if single block erase is not supported.
|
||||
* \return true if single block erase is supported.
|
||||
* false if single block erase is not supported.
|
||||
*/
|
||||
bool Sd2Card::eraseSingleBlockEnable() {
|
||||
csd_t csd;
|
||||
return readCSD(&csd) ? csd.v1.erase_blk_en : false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Initialize an SD flash memory card.
|
||||
*
|
||||
* \param[in] sckRateID SPI clock rate selector. See setSckRate().
|
||||
* \param[in] chipSelectPin SD chip select pin number.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure. The reason for failure
|
||||
* can be determined by calling errorCode() and errorData().
|
||||
* \return true for success, false for failure.
|
||||
* The reason for failure can be determined by calling errorCode() and errorData().
|
||||
*/
|
||||
bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
||||
errorCode_ = type_ = 0;
|
||||
@@ -329,13 +330,13 @@ bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
||||
#endif // SOFTWARE_SPI
|
||||
|
||||
// must supply min of 74 clock cycles with CS high.
|
||||
for (uint8_t i = 0; i < 10; i++) spiSend(0XFF);
|
||||
for (uint8_t i = 0; i < 10; i++) spiSend(0xFF);
|
||||
|
||||
// command to go idle in SPI mode
|
||||
while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) {
|
||||
if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
|
||||
error(SD_CARD_ERROR_CMD0);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
}
|
||||
// check SD version
|
||||
@@ -345,29 +346,29 @@ bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
||||
else {
|
||||
// only need last byte of r7 response
|
||||
for (uint8_t i = 0; i < 4; i++) status_ = spiRec();
|
||||
if (status_ != 0XAA) {
|
||||
if (status_ != 0xAA) {
|
||||
error(SD_CARD_ERROR_CMD8);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
type(SD_CARD_TYPE_SD2);
|
||||
}
|
||||
// initialize card and send host supports SDHC if SD2
|
||||
arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0;
|
||||
arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0;
|
||||
|
||||
while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) {
|
||||
// check for timeout
|
||||
if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
|
||||
error(SD_CARD_ERROR_ACMD41);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
}
|
||||
// if SD2 read OCR register to check for SDHC card
|
||||
if (type() == SD_CARD_TYPE_SD2) {
|
||||
if (cardCommand(CMD58, 0)) {
|
||||
error(SD_CARD_ERROR_CMD58);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC);
|
||||
if ((spiRec() & 0xC0) == 0xC0) type(SD_CARD_TYPE_SDHC);
|
||||
// discard rest of ocr - contains allowed voltage range
|
||||
for (uint8_t i = 0; i < 3; i++) spiRec();
|
||||
}
|
||||
@@ -380,18 +381,17 @@ bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
||||
return true;
|
||||
#endif // SOFTWARE_SPI
|
||||
|
||||
fail:
|
||||
FAIL:
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Read a 512 byte block from an SD card.
|
||||
*
|
||||
* \param[in] blockNumber Logical block to be read.
|
||||
* \param[out] dst Pointer to the location that will receive the data.
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) {
|
||||
// use address if not SDHC card
|
||||
@@ -399,19 +399,18 @@ bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) {
|
||||
|
||||
#if ENABLED(SD_CHECK_AND_RETRY)
|
||||
uint8_t retryCnt = 3;
|
||||
do {
|
||||
if (!cardCommand(CMD17, blockNumber)) {
|
||||
if (readData(dst, 512)) return true;
|
||||
}
|
||||
else
|
||||
for(;;) {
|
||||
if (cardCommand(CMD17, blockNumber))
|
||||
error(SD_CARD_ERROR_CMD17);
|
||||
else if (readData(dst, 512))
|
||||
return true;
|
||||
|
||||
if (!--retryCnt) break;
|
||||
|
||||
chipSelectHigh();
|
||||
cardCommand(CMD12, 0); // Try sending a stop command, ignore the result.
|
||||
errorCode_ = 0;
|
||||
} while (true);
|
||||
}
|
||||
#else
|
||||
if (cardCommand(CMD17, blockNumber))
|
||||
error(SD_CARD_ERROR_CMD17);
|
||||
@@ -422,13 +421,13 @@ bool Sd2Card::readBlock(uint32_t blockNumber, uint8_t* dst) {
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Read one data block in a multiple block read sequence
|
||||
|
||||
/**
|
||||
* Read one data block in a multiple block read sequence
|
||||
*
|
||||
* \param[in] dst Pointer to the location for the data to be read.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::readData(uint8_t* dst) {
|
||||
chipSelectLow();
|
||||
@@ -436,62 +435,61 @@ bool Sd2Card::readData(uint8_t* dst) {
|
||||
}
|
||||
|
||||
#if ENABLED(SD_CHECK_AND_RETRY)
|
||||
static const uint16_t crctab[] PROGMEM = {
|
||||
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
|
||||
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
|
||||
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
|
||||
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
|
||||
0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
|
||||
0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
|
||||
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
|
||||
0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
|
||||
0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
|
||||
0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
|
||||
0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
|
||||
0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
|
||||
0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
|
||||
0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
|
||||
0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
|
||||
0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
|
||||
0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
|
||||
0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
|
||||
0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
|
||||
0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
|
||||
0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
|
||||
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
|
||||
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
|
||||
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
|
||||
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
|
||||
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
|
||||
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
|
||||
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
|
||||
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
|
||||
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
|
||||
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
|
||||
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
|
||||
};
|
||||
static uint16_t CRC_CCITT(const uint8_t* data, size_t n) {
|
||||
uint16_t crc = 0;
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
crc = pgm_read_word(&crctab[(crc >> 8 ^ data[i]) & 0XFF]) ^ (crc << 8);
|
||||
static const uint16_t crctab[] PROGMEM = {
|
||||
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
|
||||
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
|
||||
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
|
||||
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
|
||||
0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
|
||||
0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
|
||||
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
|
||||
0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
|
||||
0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
|
||||
0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
|
||||
0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
|
||||
0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
|
||||
0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
|
||||
0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
|
||||
0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
|
||||
0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
|
||||
0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
|
||||
0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
|
||||
0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
|
||||
0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
|
||||
0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
|
||||
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
|
||||
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
|
||||
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
|
||||
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
|
||||
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
|
||||
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
|
||||
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
|
||||
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
|
||||
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
|
||||
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
|
||||
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
|
||||
};
|
||||
static uint16_t CRC_CCITT(const uint8_t* data, size_t n) {
|
||||
uint16_t crc = 0;
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
crc = pgm_read_word(&crctab[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8);
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
#endif
|
||||
#endif // SD_CHECK_AND_RETRY
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Sd2Card::readData(uint8_t* dst, uint16_t count) {
|
||||
// wait for start block token
|
||||
uint16_t t0 = millis();
|
||||
while ((status_ = spiRec()) == 0XFF) {
|
||||
if (((uint16_t)millis() - t0) > SD_READ_TIMEOUT) {
|
||||
error(SD_CARD_ERROR_READ_TIMEOUT);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
}
|
||||
if (status_ != DATA_START_BLOCK) {
|
||||
error(SD_CARD_ERROR_READ);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
// transfer data
|
||||
spiRead(dst, count);
|
||||
@@ -503,7 +501,7 @@ bool Sd2Card::readData(uint8_t* dst, uint16_t count) {
|
||||
recvCrc |= spiRec();
|
||||
if (calcCrc != recvCrc) {
|
||||
error(SD_CARD_ERROR_CRC);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -515,67 +513,61 @@ bool Sd2Card::readData(uint8_t* dst, uint16_t count) {
|
||||
// Send an additional dummy byte, required by Toshiba Flash Air SD Card
|
||||
spiSend(0XFF);
|
||||
return true;
|
||||
fail:
|
||||
FAIL:
|
||||
chipSelectHigh();
|
||||
// Send an additional dummy byte, required by Toshiba Flash Air SD Card
|
||||
spiSend(0XFF);
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** read CID or CSR register */
|
||||
bool Sd2Card::readRegister(uint8_t cmd, void* buf) {
|
||||
uint8_t* dst = reinterpret_cast<uint8_t*>(buf);
|
||||
if (cardCommand(cmd, 0)) {
|
||||
error(SD_CARD_ERROR_READ_REG);
|
||||
goto fail;
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
return readData(dst, 16);
|
||||
fail:
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Start a read multiple blocks sequence.
|
||||
|
||||
/**
|
||||
* Start a read multiple blocks sequence.
|
||||
*
|
||||
* \param[in] blockNumber Address of first block in sequence.
|
||||
*
|
||||
* \note This function is used with readData() and readStop() for optimized
|
||||
* multiple block reads. SPI chipSelect must be low for the entire sequence.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::readStart(uint32_t blockNumber) {
|
||||
if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9;
|
||||
if (cardCommand(CMD18, blockNumber)) {
|
||||
error(SD_CARD_ERROR_CMD18);
|
||||
goto fail;
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
chipSelectHigh();
|
||||
return true;
|
||||
fail:
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** End a read multiple blocks sequence.
|
||||
|
||||
/**
|
||||
* End a read multiple blocks sequence.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::readStop() {
|
||||
chipSelectLow();
|
||||
if (cardCommand(CMD12, 0)) {
|
||||
error(SD_CARD_ERROR_CMD12);
|
||||
goto fail;
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
chipSelectHigh();
|
||||
return true;
|
||||
fail:
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Set the SPI clock rate.
|
||||
*
|
||||
@@ -596,70 +588,66 @@ bool Sd2Card::setSckRate(uint8_t sckRateID) {
|
||||
spiRate_ = sckRateID;
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// wait for card to go not busy
|
||||
bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) {
|
||||
uint16_t t0 = millis();
|
||||
while (spiRec() != 0XFF) {
|
||||
if (((uint16_t)millis() - t0) >= timeoutMillis) goto fail;
|
||||
}
|
||||
while (spiRec() != 0XFF)
|
||||
if (((uint16_t)millis() - t0) >= timeoutMillis) return false;
|
||||
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Writes a 512 byte block to an SD card.
|
||||
*
|
||||
* \param[in] blockNumber Logical block to be written.
|
||||
* \param[in] src Pointer to the location of the data to be written.
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) {
|
||||
// use address if not SDHC card
|
||||
if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9;
|
||||
if (cardCommand(CMD24, blockNumber)) {
|
||||
error(SD_CARD_ERROR_CMD24);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
if (!writeData(DATA_START_BLOCK, src)) goto fail;
|
||||
if (!writeData(DATA_START_BLOCK, src)) goto FAIL;
|
||||
|
||||
// wait for flash programming to complete
|
||||
if (!waitNotBusy(SD_WRITE_TIMEOUT)) {
|
||||
error(SD_CARD_ERROR_WRITE_TIMEOUT);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
// response is r2 so get and check two bytes for nonzero
|
||||
if (cardCommand(CMD13, 0) || spiRec()) {
|
||||
error(SD_CARD_ERROR_WRITE_PROGRAMMING);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
chipSelectHigh();
|
||||
return true;
|
||||
fail:
|
||||
FAIL:
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Write one data block in a multiple block write sequence
|
||||
|
||||
/**
|
||||
* Write one data block in a multiple block write sequence
|
||||
* \param[in] src Pointer to the location of the data to be written.
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::writeData(const uint8_t* src) {
|
||||
chipSelectLow();
|
||||
// wait for previous write to finish
|
||||
if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto fail;
|
||||
if (!writeData(WRITE_MULTIPLE_TOKEN, src)) goto fail;
|
||||
if (!waitNotBusy(SD_WRITE_TIMEOUT) || !writeData(WRITE_MULTIPLE_TOKEN, src)) {
|
||||
error(SD_CARD_ERROR_WRITE_MULTIPLE);
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
chipSelectHigh();
|
||||
return true;
|
||||
fail:
|
||||
error(SD_CARD_ERROR_WRITE_MULTIPLE);
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// send one block of data for write block or write multiple blocks
|
||||
bool Sd2Card::writeData(uint8_t token, const uint8_t* src) {
|
||||
spiSendBlock(token, src);
|
||||
@@ -670,15 +658,14 @@ bool Sd2Card::writeData(uint8_t token, const uint8_t* src) {
|
||||
status_ = spiRec();
|
||||
if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) {
|
||||
error(SD_CARD_ERROR_WRITE);
|
||||
goto fail;
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
fail:
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Start a write multiple blocks sequence.
|
||||
|
||||
/**
|
||||
* Start a write multiple blocks sequence.
|
||||
*
|
||||
* \param[in] blockNumber Address of first block in sequence.
|
||||
* \param[in] eraseCount The number of blocks to be pre-erased.
|
||||
@@ -686,44 +673,43 @@ fail:
|
||||
* \note This function is used with writeData() and writeStop()
|
||||
* for optimized multiple block writes.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::writeStart(uint32_t blockNumber, uint32_t eraseCount) {
|
||||
// send pre-erase count
|
||||
if (cardAcmd(ACMD23, eraseCount)) {
|
||||
error(SD_CARD_ERROR_ACMD23);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
// use address if not SDHC card
|
||||
if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9;
|
||||
if (cardCommand(CMD25, blockNumber)) {
|
||||
error(SD_CARD_ERROR_CMD25);
|
||||
goto fail;
|
||||
goto FAIL;
|
||||
}
|
||||
chipSelectHigh();
|
||||
return true;
|
||||
fail:
|
||||
FAIL:
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** End a write multiple blocks sequence.
|
||||
|
||||
/**
|
||||
* End a write multiple blocks sequence.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure.
|
||||
* \return true for success, false for failure.
|
||||
*/
|
||||
bool Sd2Card::writeStop() {
|
||||
chipSelectLow();
|
||||
if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto fail;
|
||||
if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto FAIL;
|
||||
spiSend(STOP_TRAN_TOKEN);
|
||||
if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto fail;
|
||||
if (!waitNotBusy(SD_WRITE_TIMEOUT)) goto FAIL;
|
||||
chipSelectHigh();
|
||||
return true;
|
||||
fail:
|
||||
FAIL:
|
||||
error(SD_CARD_ERROR_STOP_TRAN);
|
||||
chipSelectHigh();
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // SDSUPPORT
|
||||
|
||||
+86
-133
@@ -20,165 +20,119 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief Sd2Card class for V2 SD/SDHC cards
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arduino Sd2Card Library
|
||||
* Copyright (C) 2009 by William Greiman
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#ifndef _SD2CARD_H_
|
||||
#define _SD2CARD_H_
|
||||
|
||||
#include "Marlin.h"
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#ifndef Sd2Card_h
|
||||
#define Sd2Card_h
|
||||
/**
|
||||
* \file
|
||||
* \brief Sd2Card class for V2 SD/SDHC cards
|
||||
*/
|
||||
#include "SdFatConfig.h"
|
||||
#include "SdInfo.h"
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// SPI speed is F_CPU/2^(1 + index), 0 <= index <= 6
|
||||
/** Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate(). */
|
||||
uint8_t const SPI_FULL_SPEED = 0;
|
||||
/** Set SCK rate to F_CPU/4. See Sd2Card::setSckRate(). */
|
||||
uint8_t const SPI_HALF_SPEED = 1;
|
||||
/** Set SCK rate to F_CPU/8. See Sd2Card::setSckRate(). */
|
||||
uint8_t const SPI_QUARTER_SPEED = 2;
|
||||
/** Set SCK rate to F_CPU/16. See Sd2Card::setSckRate(). */
|
||||
uint8_t const SPI_EIGHTH_SPEED = 3;
|
||||
/** Set SCK rate to F_CPU/32. See Sd2Card::setSckRate(). */
|
||||
uint8_t const SPI_SIXTEENTH_SPEED = 4;
|
||||
//------------------------------------------------------------------------------
|
||||
/** init timeout ms */
|
||||
uint16_t const SD_INIT_TIMEOUT = 2000;
|
||||
/** erase timeout ms */
|
||||
uint16_t const SD_ERASE_TIMEOUT = 10000;
|
||||
/** read timeout ms */
|
||||
uint16_t const SD_READ_TIMEOUT = 300;
|
||||
/** write time out ms */
|
||||
uint16_t const SD_WRITE_TIMEOUT = 600;
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t const SPI_FULL_SPEED = 0, // Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate().
|
||||
SPI_HALF_SPEED = 1, // Set SCK rate to F_CPU/4. See Sd2Card::setSckRate().
|
||||
SPI_QUARTER_SPEED = 2, // Set SCK rate to F_CPU/8. See Sd2Card::setSckRate().
|
||||
SPI_EIGHTH_SPEED = 3, // Set SCK rate to F_CPU/16. See Sd2Card::setSckRate().
|
||||
SPI_SIXTEENTH_SPEED = 4; // Set SCK rate to F_CPU/32. See Sd2Card::setSckRate().
|
||||
|
||||
uint16_t const SD_INIT_TIMEOUT = 2000, // init timeout ms
|
||||
SD_ERASE_TIMEOUT = 10000, // erase timeout ms
|
||||
SD_READ_TIMEOUT = 300, // read timeout ms
|
||||
SD_WRITE_TIMEOUT = 600; // write time out ms
|
||||
|
||||
// SD card errors
|
||||
/** timeout error for command CMD0 (initialize card in SPI mode) */
|
||||
uint8_t const SD_CARD_ERROR_CMD0 = 0X1;
|
||||
/** CMD8 was not accepted - not a valid SD card*/
|
||||
uint8_t const SD_CARD_ERROR_CMD8 = 0X2;
|
||||
/** card returned an error response for CMD12 (write stop) */
|
||||
uint8_t const SD_CARD_ERROR_CMD12 = 0X3;
|
||||
/** card returned an error response for CMD17 (read block) */
|
||||
uint8_t const SD_CARD_ERROR_CMD17 = 0X4;
|
||||
/** card returned an error response for CMD18 (read multiple block) */
|
||||
uint8_t const SD_CARD_ERROR_CMD18 = 0X5;
|
||||
/** card returned an error response for CMD24 (write block) */
|
||||
uint8_t const SD_CARD_ERROR_CMD24 = 0X6;
|
||||
/** WRITE_MULTIPLE_BLOCKS command failed */
|
||||
uint8_t const SD_CARD_ERROR_CMD25 = 0X7;
|
||||
/** card returned an error response for CMD58 (read OCR) */
|
||||
uint8_t const SD_CARD_ERROR_CMD58 = 0X8;
|
||||
/** SET_WR_BLK_ERASE_COUNT failed */
|
||||
uint8_t const SD_CARD_ERROR_ACMD23 = 0X9;
|
||||
/** ACMD41 initialization process timeout */
|
||||
uint8_t const SD_CARD_ERROR_ACMD41 = 0XA;
|
||||
/** card returned a bad CSR version field */
|
||||
uint8_t const SD_CARD_ERROR_BAD_CSD = 0XB;
|
||||
/** erase block group command failed */
|
||||
uint8_t const SD_CARD_ERROR_ERASE = 0XC;
|
||||
/** card not capable of single block erase */
|
||||
uint8_t const SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0XD;
|
||||
/** Erase sequence timed out */
|
||||
uint8_t const SD_CARD_ERROR_ERASE_TIMEOUT = 0XE;
|
||||
/** card returned an error token instead of read data */
|
||||
uint8_t const SD_CARD_ERROR_READ = 0XF;
|
||||
/** read CID or CSD failed */
|
||||
uint8_t const SD_CARD_ERROR_READ_REG = 0X10;
|
||||
/** timeout while waiting for start of read data */
|
||||
uint8_t const SD_CARD_ERROR_READ_TIMEOUT = 0X11;
|
||||
/** card did not accept STOP_TRAN_TOKEN */
|
||||
uint8_t const SD_CARD_ERROR_STOP_TRAN = 0X12;
|
||||
/** card returned an error token as a response to a write operation */
|
||||
uint8_t const SD_CARD_ERROR_WRITE = 0X13;
|
||||
/** attempt to write protected block zero */
|
||||
uint8_t const SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0X14; // REMOVE - not used
|
||||
/** card did not go ready for a multiple block write */
|
||||
uint8_t const SD_CARD_ERROR_WRITE_MULTIPLE = 0X15;
|
||||
/** card returned an error to a CMD13 status check after a write */
|
||||
uint8_t const SD_CARD_ERROR_WRITE_PROGRAMMING = 0X16;
|
||||
/** timeout occurred during write programming */
|
||||
uint8_t const SD_CARD_ERROR_WRITE_TIMEOUT = 0X17;
|
||||
/** incorrect rate selected */
|
||||
uint8_t const SD_CARD_ERROR_SCK_RATE = 0X18;
|
||||
/** init() not called */
|
||||
uint8_t const SD_CARD_ERROR_INIT_NOT_CALLED = 0X19;
|
||||
/** crc check error */
|
||||
uint8_t const SD_CARD_ERROR_CRC = 0X20;
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t const SD_CARD_ERROR_CMD0 = 0X1, // timeout error for command CMD0 (initialize card in SPI mode)
|
||||
SD_CARD_ERROR_CMD8 = 0X2, // CMD8 was not accepted - not a valid SD card
|
||||
SD_CARD_ERROR_CMD12 = 0X3, // card returned an error response for CMD12 (write stop)
|
||||
SD_CARD_ERROR_CMD17 = 0X4, // card returned an error response for CMD17 (read block)
|
||||
SD_CARD_ERROR_CMD18 = 0X5, // card returned an error response for CMD18 (read multiple block)
|
||||
SD_CARD_ERROR_CMD24 = 0X6, // card returned an error response for CMD24 (write block)
|
||||
SD_CARD_ERROR_CMD25 = 0X7, // WRITE_MULTIPLE_BLOCKS command failed
|
||||
SD_CARD_ERROR_CMD58 = 0X8, // card returned an error response for CMD58 (read OCR)
|
||||
SD_CARD_ERROR_ACMD23 = 0X9, // SET_WR_BLK_ERASE_COUNT failed
|
||||
SD_CARD_ERROR_ACMD41 = 0XA, // ACMD41 initialization process timeout
|
||||
SD_CARD_ERROR_BAD_CSD = 0XB, // card returned a bad CSR version field
|
||||
SD_CARD_ERROR_ERASE = 0XC, // erase block group command failed
|
||||
SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0XD, // card not capable of single block erase
|
||||
SD_CARD_ERROR_ERASE_TIMEOUT = 0XE, // Erase sequence timed out
|
||||
SD_CARD_ERROR_READ = 0XF, // card returned an error token instead of read data
|
||||
SD_CARD_ERROR_READ_REG = 0x10, // read CID or CSD failed
|
||||
SD_CARD_ERROR_READ_TIMEOUT = 0x11, // timeout while waiting for start of read data
|
||||
SD_CARD_ERROR_STOP_TRAN = 0x12, // card did not accept STOP_TRAN_TOKEN
|
||||
SD_CARD_ERROR_WRITE = 0x13, // card returned an error token as a response to a write operation
|
||||
SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0x14, // REMOVE - not used ... attempt to write protected block zero
|
||||
SD_CARD_ERROR_WRITE_MULTIPLE = 0x15, // card did not go ready for a multiple block write
|
||||
SD_CARD_ERROR_WRITE_PROGRAMMING = 0x16, // card returned an error to a CMD13 status check after a write
|
||||
SD_CARD_ERROR_WRITE_TIMEOUT = 0x17, // timeout occurred during write programming
|
||||
SD_CARD_ERROR_SCK_RATE = 0x18, // incorrect rate selected
|
||||
SD_CARD_ERROR_INIT_NOT_CALLED = 0x19, // init() not called
|
||||
SD_CARD_ERROR_CRC = 0x20; // crc check error
|
||||
|
||||
// card types
|
||||
/** Standard capacity V1 SD card */
|
||||
uint8_t const SD_CARD_TYPE_SD1 = 1;
|
||||
/** Standard capacity V2 SD card */
|
||||
uint8_t const SD_CARD_TYPE_SD2 = 2;
|
||||
/** High Capacity SD card */
|
||||
uint8_t const SD_CARD_TYPE_SDHC = 3;
|
||||
uint8_t const SD_CARD_TYPE_SD1 = 1, // Standard capacity V1 SD card
|
||||
SD_CARD_TYPE_SD2 = 2, // Standard capacity V2 SD card
|
||||
SD_CARD_TYPE_SDHC = 3; // High Capacity SD card
|
||||
|
||||
/**
|
||||
* define SOFTWARE_SPI to use bit-bang SPI
|
||||
*/
|
||||
//------------------------------------------------------------------------------
|
||||
#if MEGA_SOFT_SPI && (defined(__AVR_ATmega1280__)||defined(__AVR_ATmega2560__))
|
||||
#if MEGA_SOFT_SPI
|
||||
#define SOFTWARE_SPI
|
||||
#elif USE_SOFTWARE_SPI
|
||||
#define SOFTWARE_SPI
|
||||
#endif // MEGA_SOFT_SPI
|
||||
//------------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
// SPI pin definitions - do not edit here - change in SdFatConfig.h
|
||||
//
|
||||
#if DISABLED(SOFTWARE_SPI)
|
||||
// hardware pin defs
|
||||
/** The default chip select pin for the SD card is SS. */
|
||||
#define SD_CHIP_SELECT_PIN SS_PIN
|
||||
#define SD_CHIP_SELECT_PIN SS_PIN // The default chip select pin for the SD card is SS.
|
||||
// The following three pins must not be redefined for hardware SPI.
|
||||
/** SPI Master Out Slave In pin */
|
||||
#define SPI_MOSI_PIN MOSI_PIN
|
||||
/** SPI Master In Slave Out pin */
|
||||
#define SPI_MISO_PIN MISO_PIN
|
||||
/** SPI Clock pin */
|
||||
#define SPI_SCK_PIN SCK_PIN
|
||||
|
||||
#define SPI_MOSI_PIN MOSI_PIN // SPI Master Out Slave In pin
|
||||
#define SPI_MISO_PIN MISO_PIN // SPI Master In Slave Out pin
|
||||
#define SPI_SCK_PIN SCK_PIN // SPI Clock pin
|
||||
#else // SOFTWARE_SPI
|
||||
|
||||
/** SPI chip select pin */
|
||||
#define SD_CHIP_SELECT_PIN SOFT_SPI_CS_PIN
|
||||
/** SPI Master Out Slave In pin */
|
||||
#define SPI_MOSI_PIN SOFT_SPI_MOSI_PIN
|
||||
/** SPI Master In Slave Out pin */
|
||||
#define SPI_MISO_PIN SOFT_SPI_MISO_PIN
|
||||
/** SPI Clock pin */
|
||||
#define SPI_SCK_PIN SOFT_SPI_SCK_PIN
|
||||
#define SD_CHIP_SELECT_PIN SOFT_SPI_CS_PIN // SPI chip select pin
|
||||
#define SPI_MOSI_PIN SOFT_SPI_MOSI_PIN // SPI Master Out Slave In pin
|
||||
#define SPI_MISO_PIN SOFT_SPI_MISO_PIN // SPI Master In Slave Out pin
|
||||
#define SPI_SCK_PIN SOFT_SPI_SCK_PIN // SPI Clock pin
|
||||
#endif // SOFTWARE_SPI
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \class Sd2Card
|
||||
* \brief Raw access to SD and SDHC flash memory cards.
|
||||
*/
|
||||
class Sd2Card {
|
||||
public:
|
||||
/** Construct an instance of Sd2Card. */
|
||||
public:
|
||||
|
||||
Sd2Card() : errorCode_(SD_CARD_ERROR_INIT_NOT_CALLED), type_(0) {}
|
||||
|
||||
uint32_t cardSize();
|
||||
bool erase(uint32_t firstBlock, uint32_t lastBlock);
|
||||
bool eraseSingleBlockEnable();
|
||||
|
||||
/**
|
||||
* Set SD error code.
|
||||
* \param[in] code value for error code.
|
||||
*/
|
||||
void error(uint8_t code) {errorCode_ = code;}
|
||||
|
||||
/**
|
||||
* \return error code for last error. See Sd2Card.h for a list of error codes.
|
||||
*/
|
||||
int errorCode() const {return errorCode_;}
|
||||
|
||||
/** \return error data for last error. */
|
||||
int errorData() const {return status_;}
|
||||
|
||||
/**
|
||||
* Initialize an SD flash memory card with default clock rate and chip
|
||||
* select pin. See sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin).
|
||||
@@ -188,6 +142,7 @@ class Sd2Card {
|
||||
bool init(uint8_t sckRateID = SPI_FULL_SPEED,
|
||||
uint8_t chipSelectPin = SD_CHIP_SELECT_PIN);
|
||||
bool readBlock(uint32_t block, uint8_t* dst);
|
||||
|
||||
/**
|
||||
* Read a card's CID register. The CID contains card identification
|
||||
* information such as Manufacturer ID, Product name, Product serial
|
||||
@@ -197,9 +152,8 @@ class Sd2Card {
|
||||
*
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool readCID(cid_t* cid) {
|
||||
return readRegister(CMD10, cid);
|
||||
}
|
||||
bool readCID(cid_t* cid) { return readRegister(CMD10, cid); }
|
||||
|
||||
/**
|
||||
* Read a card's CSD register. The CSD contains Card-Specific Data that
|
||||
* provides information regarding access to the card's contents.
|
||||
@@ -208,14 +162,14 @@ class Sd2Card {
|
||||
*
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool readCSD(csd_t* csd) {
|
||||
return readRegister(CMD9, csd);
|
||||
}
|
||||
bool readCSD(csd_t* csd) { return readRegister(CMD9, csd); }
|
||||
|
||||
bool readData(uint8_t* dst);
|
||||
bool readStart(uint32_t blockNumber);
|
||||
bool readStop();
|
||||
bool setSckRate(uint8_t sckRateID);
|
||||
/** Return the card type: SD V1, SD V2 or SDHC
|
||||
/**
|
||||
* Return the card type: SD V1, SD V2 or SDHC
|
||||
* \return 0 - SD V1, 1 - SD V2, or 3 - SDHC.
|
||||
*/
|
||||
int type() const {return type_;}
|
||||
@@ -223,13 +177,14 @@ class Sd2Card {
|
||||
bool writeData(const uint8_t* src);
|
||||
bool writeStart(uint32_t blockNumber, uint32_t eraseCount);
|
||||
bool writeStop();
|
||||
private:
|
||||
//----------------------------------------------------------------------------
|
||||
uint8_t chipSelectPin_;
|
||||
uint8_t errorCode_;
|
||||
uint8_t spiRate_;
|
||||
uint8_t status_;
|
||||
uint8_t type_;
|
||||
|
||||
private:
|
||||
uint8_t chipSelectPin_,
|
||||
errorCode_,
|
||||
spiRate_,
|
||||
status_,
|
||||
type_;
|
||||
|
||||
// private functions
|
||||
uint8_t cardAcmd(uint8_t cmd, uint32_t arg) {
|
||||
cardCommand(CMD55, 0);
|
||||
@@ -241,11 +196,9 @@ class Sd2Card {
|
||||
bool readRegister(uint8_t cmd, void* buf);
|
||||
void chipSelectHigh();
|
||||
void chipSelectLow();
|
||||
void type(uint8_t value) {type_ = value;}
|
||||
void type(uint8_t value) { type_ = value; }
|
||||
bool waitNotBusy(uint16_t timeoutMillis);
|
||||
bool writeData(uint8_t token, const uint8_t* src);
|
||||
};
|
||||
#endif // Sd2Card_h
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _SD2CARD_H_
|
||||
|
||||
+340
-437
File diff suppressed because it is too large
Load Diff
+229
-220
@@ -20,208 +20,196 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief SdBaseFile class
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arduino SdFat Library
|
||||
* Copyright (C) 2009 by William Greiman
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#ifndef _SDBASEFILE_H_
|
||||
#define _SDBASEFILE_H_
|
||||
|
||||
#ifndef SdBaseFile_h
|
||||
#define SdBaseFile_h
|
||||
/**
|
||||
* \file
|
||||
* \brief SdBaseFile class
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#include "SdFatConfig.h"
|
||||
#include "SdVolume.h"
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \struct filepos_t
|
||||
* \brief internal type for istream
|
||||
* do not use in user apps
|
||||
*/
|
||||
struct filepos_t {
|
||||
/** stream position */
|
||||
uint32_t position;
|
||||
/** cluster for position */
|
||||
uint32_t cluster;
|
||||
uint32_t position; // stream byte position
|
||||
uint32_t cluster; // cluster of position
|
||||
filepos_t() : position(0), cluster(0) {}
|
||||
};
|
||||
|
||||
// use the gnu style oflag in open()
|
||||
/** open() oflag for reading */
|
||||
uint8_t const O_READ = 0X01;
|
||||
/** open() oflag - same as O_IN */
|
||||
uint8_t const O_RDONLY = O_READ;
|
||||
/** open() oflag for write */
|
||||
uint8_t const O_WRITE = 0X02;
|
||||
/** open() oflag - same as O_WRITE */
|
||||
uint8_t const O_WRONLY = O_WRITE;
|
||||
/** open() oflag for reading and writing */
|
||||
uint8_t const O_RDWR = (O_READ | O_WRITE);
|
||||
/** open() oflag mask for access modes */
|
||||
uint8_t const O_ACCMODE = (O_READ | O_WRITE);
|
||||
/** The file offset shall be set to the end of the file prior to each write. */
|
||||
uint8_t const O_APPEND = 0X04;
|
||||
/** synchronous writes - call sync() after each write */
|
||||
uint8_t const O_SYNC = 0X08;
|
||||
/** truncate the file to zero length */
|
||||
uint8_t const O_TRUNC = 0X10;
|
||||
/** set the initial position at the end of the file */
|
||||
uint8_t const O_AT_END = 0X20;
|
||||
/** create the file if nonexistent */
|
||||
uint8_t const O_CREAT = 0X40;
|
||||
/** If O_CREAT and O_EXCL are set, open() shall fail if the file exists */
|
||||
uint8_t const O_EXCL = 0X80;
|
||||
uint8_t const O_READ = 0x01, // open() oflag for reading
|
||||
O_RDONLY = O_READ, // open() oflag - same as O_IN
|
||||
O_WRITE = 0x02, // open() oflag for write
|
||||
O_WRONLY = O_WRITE, // open() oflag - same as O_WRITE
|
||||
O_RDWR = (O_READ | O_WRITE), // open() oflag for reading and writing
|
||||
O_ACCMODE = (O_READ | O_WRITE), // open() oflag mask for access modes
|
||||
O_APPEND = 0x04, // The file offset shall be set to the end of the file prior to each write.
|
||||
O_SYNC = 0x08, // Synchronous writes - call sync() after each write
|
||||
O_TRUNC = 0x10, // Truncate the file to zero length
|
||||
O_AT_END = 0x20, // Set the initial position at the end of the file
|
||||
O_CREAT = 0x40, // Create the file if nonexistent
|
||||
O_EXCL = 0x80; // If O_CREAT and O_EXCL are set, open() shall fail if the file exists
|
||||
|
||||
// SdBaseFile class static and const definitions
|
||||
|
||||
// flags for ls()
|
||||
/** ls() flag to print modify date */
|
||||
uint8_t const LS_DATE = 1;
|
||||
/** ls() flag to print file size */
|
||||
uint8_t const LS_SIZE = 2;
|
||||
/** ls() flag for recursive list of subdirectories */
|
||||
uint8_t const LS_R = 4;
|
||||
uint8_t const LS_DATE = 1, // ls() flag to print modify date
|
||||
LS_SIZE = 2, // ls() flag to print file size
|
||||
LS_R = 4; // ls() flag for recursive list of subdirectories
|
||||
|
||||
|
||||
// flags for timestamp
|
||||
/** set the file's last access date */
|
||||
uint8_t const T_ACCESS = 1;
|
||||
/** set the file's creation date and time */
|
||||
uint8_t const T_CREATE = 2;
|
||||
/** Set the file's write date and time */
|
||||
uint8_t const T_WRITE = 4;
|
||||
// values for type_
|
||||
/** This file has not been opened. */
|
||||
uint8_t const FAT_FILE_TYPE_CLOSED = 0;
|
||||
/** A normal file */
|
||||
uint8_t const FAT_FILE_TYPE_NORMAL = 1;
|
||||
/** A FAT12 or FAT16 root directory */
|
||||
uint8_t const FAT_FILE_TYPE_ROOT_FIXED = 2;
|
||||
/** A FAT32 root directory */
|
||||
uint8_t const FAT_FILE_TYPE_ROOT32 = 3;
|
||||
/** A subdirectory file*/
|
||||
uint8_t const FAT_FILE_TYPE_SUBDIR = 4;
|
||||
/** Test value for directory type */
|
||||
uint8_t const FAT_FILE_TYPE_MIN_DIR = FAT_FILE_TYPE_ROOT_FIXED;
|
||||
uint8_t const T_ACCESS = 1, // Set the file's last access date
|
||||
T_CREATE = 2, // Set the file's creation date and time
|
||||
T_WRITE = 4; // Set the file's write date and time
|
||||
|
||||
/** date field for FAT directory entry
|
||||
// values for type_
|
||||
uint8_t const FAT_FILE_TYPE_CLOSED = 0, // This file has not been opened.
|
||||
FAT_FILE_TYPE_NORMAL = 1, // A normal file
|
||||
FAT_FILE_TYPE_ROOT_FIXED = 2, // A FAT12 or FAT16 root directory
|
||||
FAT_FILE_TYPE_ROOT32 = 3, // A FAT32 root directory
|
||||
FAT_FILE_TYPE_SUBDIR = 4, // A subdirectory file
|
||||
FAT_FILE_TYPE_MIN_DIR = FAT_FILE_TYPE_ROOT_FIXED; // Test value for directory type
|
||||
|
||||
/**
|
||||
* date field for FAT directory entry
|
||||
* \param[in] year [1980,2107]
|
||||
* \param[in] month [1,12]
|
||||
* \param[in] day [1,31]
|
||||
*
|
||||
* \return Packed date for dir_t entry.
|
||||
*/
|
||||
static inline uint16_t FAT_DATE(uint16_t year, uint8_t month, uint8_t day) {
|
||||
return (year - 1980) << 9 | month << 5 | day;
|
||||
}
|
||||
/** year part of FAT directory date field
|
||||
static inline uint16_t FAT_DATE(uint16_t year, uint8_t month, uint8_t day) { return (year - 1980) << 9 | month << 5 | day; }
|
||||
|
||||
/**
|
||||
* year part of FAT directory date field
|
||||
* \param[in] fatDate Date in packed dir format.
|
||||
*
|
||||
* \return Extracted year [1980,2107]
|
||||
*/
|
||||
static inline uint16_t FAT_YEAR(uint16_t fatDate) {
|
||||
return 1980 + (fatDate >> 9);
|
||||
}
|
||||
/** month part of FAT directory date field
|
||||
static inline uint16_t FAT_YEAR(uint16_t fatDate) { return 1980 + (fatDate >> 9); }
|
||||
|
||||
/**
|
||||
* month part of FAT directory date field
|
||||
* \param[in] fatDate Date in packed dir format.
|
||||
*
|
||||
* \return Extracted month [1,12]
|
||||
*/
|
||||
static inline uint8_t FAT_MONTH(uint16_t fatDate) {
|
||||
return (fatDate >> 5) & 0XF;
|
||||
}
|
||||
/** day part of FAT directory date field
|
||||
static inline uint8_t FAT_MONTH(uint16_t fatDate) { return (fatDate >> 5) & 0XF; }
|
||||
|
||||
/**
|
||||
* day part of FAT directory date field
|
||||
* \param[in] fatDate Date in packed dir format.
|
||||
*
|
||||
* \return Extracted day [1,31]
|
||||
*/
|
||||
static inline uint8_t FAT_DAY(uint16_t fatDate) {
|
||||
return fatDate & 0X1F;
|
||||
}
|
||||
/** time field for FAT directory entry
|
||||
static inline uint8_t FAT_DAY(uint16_t fatDate) { return fatDate & 0x1F; }
|
||||
|
||||
/**
|
||||
* time field for FAT directory entry
|
||||
* \param[in] hour [0,23]
|
||||
* \param[in] minute [0,59]
|
||||
* \param[in] second [0,59]
|
||||
*
|
||||
* \return Packed time for dir_t entry.
|
||||
*/
|
||||
static inline uint16_t FAT_TIME(uint8_t hour, uint8_t minute, uint8_t second) {
|
||||
return hour << 11 | minute << 5 | second >> 1;
|
||||
}
|
||||
/** hour part of FAT directory time field
|
||||
static inline uint16_t FAT_TIME(uint8_t hour, uint8_t minute, uint8_t second) { return hour << 11 | minute << 5 | second >> 1; }
|
||||
|
||||
/**
|
||||
* hour part of FAT directory time field
|
||||
* \param[in] fatTime Time in packed dir format.
|
||||
*
|
||||
* \return Extracted hour [0,23]
|
||||
*/
|
||||
static inline uint8_t FAT_HOUR(uint16_t fatTime) {
|
||||
return fatTime >> 11;
|
||||
}
|
||||
/** minute part of FAT directory time field
|
||||
static inline uint8_t FAT_HOUR(uint16_t fatTime) { return fatTime >> 11; }
|
||||
|
||||
/**
|
||||
* minute part of FAT directory time field
|
||||
* \param[in] fatTime Time in packed dir format.
|
||||
*
|
||||
* \return Extracted minute [0,59]
|
||||
*/
|
||||
static inline uint8_t FAT_MINUTE(uint16_t fatTime) {
|
||||
return (fatTime >> 5) & 0X3F;
|
||||
}
|
||||
/** second part of FAT directory time field
|
||||
static inline uint8_t FAT_MINUTE(uint16_t fatTime) { return (fatTime >> 5) & 0x3F; }
|
||||
|
||||
/**
|
||||
* second part of FAT directory time field
|
||||
* Note second/2 is stored in packed time.
|
||||
*
|
||||
* \param[in] fatTime Time in packed dir format.
|
||||
*
|
||||
* \return Extracted second [0,58]
|
||||
*/
|
||||
static inline uint8_t FAT_SECOND(uint16_t fatTime) {
|
||||
return 2 * (fatTime & 0X1F);
|
||||
}
|
||||
/** Default date for file timestamps is 1 Jan 2000 */
|
||||
static inline uint8_t FAT_SECOND(uint16_t fatTime) { return 2 * (fatTime & 0x1F); }
|
||||
|
||||
// Default date for file timestamps is 1 Jan 2000
|
||||
uint16_t const FAT_DEFAULT_DATE = ((2000 - 1980) << 9) | (1 << 5) | 1;
|
||||
/** Default time for file timestamp is 1 am */
|
||||
// Default time for file timestamp is 1 am
|
||||
uint16_t const FAT_DEFAULT_TIME = (1 << 11);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \class SdBaseFile
|
||||
* \brief Base class for SdFile with Print and C++ streams.
|
||||
*/
|
||||
class SdBaseFile {
|
||||
public:
|
||||
/** Create an instance. */
|
||||
SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {}
|
||||
SdBaseFile(const char* path, uint8_t oflag);
|
||||
~SdBaseFile() {if (isOpen()) close();}
|
||||
~SdBaseFile() { if (isOpen()) close(); }
|
||||
|
||||
/**
|
||||
* writeError is set to true if an error occurs during a write().
|
||||
* Set writeError to false before calling print() and/or write() and check
|
||||
* for true after calls to print() and/or write().
|
||||
*/
|
||||
bool writeError;
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// helpers for stream classes
|
||||
/** get position for streams
|
||||
|
||||
/**
|
||||
* get position for streams
|
||||
* \param[out] pos struct to receive position
|
||||
*/
|
||||
void getpos(filepos_t* pos);
|
||||
/** set position for streams
|
||||
|
||||
/**
|
||||
* set position for streams
|
||||
* \param[out] pos struct with value for new position
|
||||
*/
|
||||
void setpos(filepos_t* pos);
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
bool close();
|
||||
bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock);
|
||||
bool createContiguous(SdBaseFile* dirFile,
|
||||
const char* path, uint32_t size);
|
||||
/** \return The current cluster number for a file or directory. */
|
||||
uint32_t curCluster() const {return curCluster_;}
|
||||
/** \return The current position for a file or directory. */
|
||||
uint32_t curPosition() const {return curPosition_;}
|
||||
/** \return Current working directory */
|
||||
static SdBaseFile* cwd() {return cwd_;}
|
||||
/** Set the date/time callback function
|
||||
/**
|
||||
* \return The current cluster number for a file or directory.
|
||||
*/
|
||||
uint32_t curCluster() const { return curCluster_; }
|
||||
|
||||
/**
|
||||
* \return The current position for a file or directory.
|
||||
*/
|
||||
uint32_t curPosition() const { return curPosition_; }
|
||||
|
||||
/**
|
||||
* \return Current working directory
|
||||
*/
|
||||
static SdBaseFile* cwd() { return cwd_; }
|
||||
|
||||
/**
|
||||
* Set the date/time callback function
|
||||
*
|
||||
* \param[in] dateTime The user's call back function. The callback
|
||||
* function is of the form:
|
||||
@@ -252,35 +240,55 @@ class SdBaseFile {
|
||||
void (*dateTime)(uint16_t* date, uint16_t* time)) {
|
||||
dateTime_ = dateTime;
|
||||
}
|
||||
/** Cancel the date/time callback function. */
|
||||
static void dateTimeCallbackCancel() {dateTime_ = 0;}
|
||||
|
||||
/**
|
||||
* Cancel the date/time callback function.
|
||||
*/
|
||||
static void dateTimeCallbackCancel() { dateTime_ = 0; }
|
||||
bool dirEntry(dir_t* dir);
|
||||
static void dirName(const dir_t& dir, char* name);
|
||||
bool exists(const char* name);
|
||||
int16_t fgets(char* str, int16_t num, char* delim = 0);
|
||||
/** \return The total number of bytes in a file or directory. */
|
||||
uint32_t fileSize() const {return fileSize_;}
|
||||
/** \return The first cluster number for a file or directory. */
|
||||
uint32_t firstCluster() const {return firstCluster_;}
|
||||
bool getFilename(char* name);
|
||||
/** \return True if this is a directory else false. */
|
||||
bool isDir() const {return type_ >= FAT_FILE_TYPE_MIN_DIR;}
|
||||
/** \return True if this is a normal file else false. */
|
||||
bool isFile() const {return type_ == FAT_FILE_TYPE_NORMAL;}
|
||||
/** \return True if this is an open file/directory else false. */
|
||||
bool isOpen() const {return type_ != FAT_FILE_TYPE_CLOSED;}
|
||||
/** \return True if this is a subdirectory else false. */
|
||||
bool isSubDir() const {return type_ == FAT_FILE_TYPE_SUBDIR;}
|
||||
/** \return True if this is the root directory. */
|
||||
bool isRoot() const {
|
||||
return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32;
|
||||
}
|
||||
|
||||
/**
|
||||
* \return The total number of bytes in a file or directory.
|
||||
*/
|
||||
uint32_t fileSize() const { return fileSize_; }
|
||||
|
||||
/**
|
||||
* \return The first cluster number for a file or directory.
|
||||
*/
|
||||
uint32_t firstCluster() const { return firstCluster_; }
|
||||
|
||||
/**
|
||||
* \return True if this is a directory else false.
|
||||
*/
|
||||
bool isDir() const { return type_ >= FAT_FILE_TYPE_MIN_DIR; }
|
||||
|
||||
/**
|
||||
* \return True if this is a normal file else false.
|
||||
*/
|
||||
bool isFile() const { return type_ == FAT_FILE_TYPE_NORMAL; }
|
||||
|
||||
/**
|
||||
* \return True if this is an open file/directory else false.
|
||||
*/
|
||||
bool isOpen() const { return type_ != FAT_FILE_TYPE_CLOSED; }
|
||||
|
||||
/**
|
||||
* \return True if this is a subdirectory else false.
|
||||
*/
|
||||
bool isSubDir() const { return type_ == FAT_FILE_TYPE_SUBDIR; }
|
||||
|
||||
/**
|
||||
* \return True if this is the root directory.
|
||||
*/
|
||||
bool isRoot() const { return type_ == FAT_FILE_TYPE_ROOT_FIXED || type_ == FAT_FILE_TYPE_ROOT32; }
|
||||
|
||||
bool getFilename(char * const name);
|
||||
void ls(uint8_t flags = 0, uint8_t indent = 0);
|
||||
|
||||
bool mkdir(SdBaseFile* dir, const char* path, bool pFlag = true);
|
||||
// alias for backward compactability
|
||||
bool makeDir(SdBaseFile* dir, const char* path) {
|
||||
return mkdir(dir, path, false);
|
||||
}
|
||||
bool open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag);
|
||||
bool open(SdBaseFile* dirFile, const char* path, uint8_t oflag);
|
||||
bool open(const char* path, uint8_t oflag = O_READ);
|
||||
@@ -295,53 +303,58 @@ class SdBaseFile {
|
||||
int8_t readDir(dir_t* dir, char* longFilename);
|
||||
static bool remove(SdBaseFile* dirFile, const char* path);
|
||||
bool remove();
|
||||
/** Set the file's current position to zero. */
|
||||
void rewind() {seekSet(0);}
|
||||
|
||||
/**
|
||||
* Set the file's current position to zero.
|
||||
*/
|
||||
void rewind() { seekSet(0); }
|
||||
bool rename(SdBaseFile* dirFile, const char* newPath);
|
||||
bool rmdir();
|
||||
// for backward compatibility
|
||||
bool rmDir() {return rmdir();}
|
||||
bool rmRfStar();
|
||||
/** Set the files position to current position + \a pos. See seekSet().
|
||||
|
||||
/**
|
||||
* Set the files position to current position + \a pos. See seekSet().
|
||||
* \param[in] offset The new position in bytes from the current position.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool seekCur(int32_t offset) {
|
||||
return seekSet(curPosition_ + offset);
|
||||
}
|
||||
/** Set the files position to end-of-file + \a offset. See seekSet().
|
||||
bool seekCur(const int32_t offset) { return seekSet(curPosition_ + offset); }
|
||||
|
||||
/**
|
||||
* Set the files position to end-of-file + \a offset. See seekSet().
|
||||
* \param[in] offset The new position in bytes from end-of-file.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool seekEnd(int32_t offset = 0) {return seekSet(fileSize_ + offset);}
|
||||
bool seekSet(uint32_t pos);
|
||||
bool seekEnd(const int32_t offset = 0) { return seekSet(fileSize_ + offset); }
|
||||
bool seekSet(const uint32_t pos);
|
||||
bool sync();
|
||||
bool timestamp(SdBaseFile* file);
|
||||
bool timestamp(uint8_t flag, uint16_t year, uint8_t month, uint8_t day,
|
||||
uint8_t hour, uint8_t minute, uint8_t second);
|
||||
/** Type of file. You should use isFile() or isDir() instead of type()
|
||||
* if possible.
|
||||
|
||||
/**
|
||||
* Type of file. Use isFile() or isDir() instead of type() if possible.
|
||||
*
|
||||
* \return The file or directory type.
|
||||
*/
|
||||
uint8_t type() const {return type_;}
|
||||
uint8_t type() const { return type_; }
|
||||
bool truncate(uint32_t size);
|
||||
/** \return SdVolume that contains this file. */
|
||||
SdVolume* volume() const {return vol_;}
|
||||
|
||||
/**
|
||||
* \return SdVolume that contains this file.
|
||||
*/
|
||||
SdVolume* volume() const { return vol_; }
|
||||
int16_t write(const void* buf, uint16_t nbyte);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
private:
|
||||
// allow SdFat to set cwd_
|
||||
friend class SdFat;
|
||||
// global pointer to cwd dir
|
||||
static SdBaseFile* cwd_;
|
||||
friend class SdFat; // allow SdFat to set cwd_
|
||||
static SdBaseFile* cwd_; // global pointer to cwd dir
|
||||
|
||||
// data time callback function
|
||||
static void (*dateTime_)(uint16_t* date, uint16_t* time);
|
||||
|
||||
// bits defined in flags_
|
||||
// should be 0X0F
|
||||
static uint8_t const F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC);
|
||||
// sync of directory entry required
|
||||
static uint8_t const F_FILE_DIR_DIRTY = 0X80;
|
||||
static uint8_t const F_OFLAG = (O_ACCMODE | O_APPEND | O_SYNC), // should be 0x0F
|
||||
F_FILE_DIR_DIRTY = 0x80; // sync of directory entry required
|
||||
|
||||
// private data
|
||||
uint8_t flags_; // See above for definition of flags_ bits
|
||||
@@ -355,8 +368,11 @@ class SdBaseFile {
|
||||
uint32_t firstCluster_; // first cluster of file
|
||||
SdVolume* vol_; // volume where file is located
|
||||
|
||||
/** experimental don't use */
|
||||
bool openParent(SdBaseFile* dir);
|
||||
/**
|
||||
* EXPERIMENTAL - Don't use!
|
||||
*/
|
||||
//bool openParent(SdBaseFile* dir);
|
||||
|
||||
// private functions
|
||||
bool addCluster();
|
||||
bool addDirCluster();
|
||||
@@ -367,61 +383,48 @@ class SdBaseFile {
|
||||
bool open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag);
|
||||
bool openCachedEntry(uint8_t cacheIndex, uint8_t oflags);
|
||||
dir_t* readDirCache();
|
||||
//------------------------------------------------------------------------------
|
||||
// to be deleted
|
||||
static void printDirName(const dir_t& dir,
|
||||
uint8_t width, bool printSlash);
|
||||
//------------------------------------------------------------------------------
|
||||
// Deprecated functions - suppress cpplint warnings with NOLINT comment
|
||||
#if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN)
|
||||
|
||||
// Deprecated functions
|
||||
#if ALLOW_DEPRECATED_FUNCTIONS
|
||||
public:
|
||||
/** \deprecated Use:
|
||||
|
||||
/**
|
||||
* \deprecated Use:
|
||||
* bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock);
|
||||
* \param[out] bgnBlock the first block address for the file.
|
||||
* \param[out] endBlock the last block address for the file.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool contiguousRange(uint32_t& bgnBlock, uint32_t& endBlock) { // NOLINT
|
||||
bool contiguousRange(uint32_t& bgnBlock, uint32_t& endBlock) {
|
||||
return contiguousRange(&bgnBlock, &endBlock);
|
||||
}
|
||||
/** \deprecated Use:
|
||||
* bool createContiguous(SdBaseFile* dirFile,
|
||||
* const char* path, uint32_t size)
|
||||
* \param[in] dirFile The directory where the file will be created.
|
||||
* \param[in] path A path with a valid DOS 8.3 file name.
|
||||
* \param[in] size The desired file size.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool createContiguous(SdBaseFile& dirFile, // NOLINT
|
||||
const char* path, uint32_t size) {
|
||||
|
||||
/**
|
||||
* \deprecated Use:
|
||||
* bool createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size)
|
||||
* \param[in] dirFile The directory where the file will be created.
|
||||
* \param[in] path A path with a valid DOS 8.3 file name.
|
||||
* \param[in] size The desired file size.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool createContiguous(SdBaseFile& dirFile, const char* path, uint32_t size) {
|
||||
return createContiguous(&dirFile, path, size);
|
||||
}
|
||||
/** \deprecated Use:
|
||||
|
||||
/**
|
||||
* \deprecated Use:
|
||||
* static void dateTimeCallback(
|
||||
* void (*dateTime)(uint16_t* date, uint16_t* time));
|
||||
* \param[in] dateTime The user's call back function.
|
||||
*/
|
||||
static void dateTimeCallback(
|
||||
void (*dateTime)(uint16_t& date, uint16_t& time)) { // NOLINT
|
||||
void (*dateTime)(uint16_t &date, uint16_t &time)) {
|
||||
oldDateTime_ = dateTime;
|
||||
dateTime_ = dateTime ? oldToNew : 0;
|
||||
}
|
||||
/** \deprecated Use: bool dirEntry(dir_t* dir);
|
||||
* \param[out] dir Location for return of the file's directory entry.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool dirEntry(dir_t& dir) {return dirEntry(&dir);} // NOLINT
|
||||
/** \deprecated Use:
|
||||
* bool mkdir(SdBaseFile* dir, const char* path);
|
||||
* \param[in] dir An open SdFat instance for the directory that will contain
|
||||
* the new directory.
|
||||
* \param[in] path A path with a valid 8.3 DOS name for the new directory.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool mkdir(SdBaseFile& dir, const char* path) { // NOLINT
|
||||
return mkdir(&dir, path);
|
||||
}
|
||||
/** \deprecated Use:
|
||||
|
||||
/**
|
||||
* \deprecated Use:
|
||||
* bool open(SdBaseFile* dirFile, const char* path, uint8_t oflag);
|
||||
* \param[in] dirFile An open SdFat instance for the directory containing the
|
||||
* file to be opened.
|
||||
@@ -430,20 +433,23 @@ class SdBaseFile {
|
||||
* OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool open(SdBaseFile& dirFile, // NOLINT
|
||||
const char* path, uint8_t oflag) {
|
||||
bool open(SdBaseFile& dirFile, const char* path, uint8_t oflag) {
|
||||
return open(&dirFile, path, oflag);
|
||||
}
|
||||
/** \deprecated Do not use in new apps
|
||||
|
||||
/**
|
||||
* \deprecated Do not use in new apps
|
||||
* \param[in] dirFile An open SdFat instance for the directory containing the
|
||||
* file to be opened.
|
||||
* \param[in] path A path with a valid 8.3 DOS name for a file to be opened.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool open(SdBaseFile& dirFile, const char* path) { // NOLINT
|
||||
bool open(SdBaseFile& dirFile, const char* path) {
|
||||
return open(dirFile, path, O_RDWR);
|
||||
}
|
||||
/** \deprecated Use:
|
||||
|
||||
/**
|
||||
* \deprecated Use:
|
||||
* bool open(SdBaseFile* dirFile, uint16_t index, uint8_t oflag);
|
||||
* \param[in] dirFile An open SdFat instance for the directory.
|
||||
* \param[in] index The \a index of the directory entry for the file to be
|
||||
@@ -452,35 +458,39 @@ class SdBaseFile {
|
||||
* OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool open(SdBaseFile& dirFile, uint16_t index, uint8_t oflag) { // NOLINT
|
||||
bool open(SdBaseFile& dirFile, uint16_t index, uint8_t oflag) {
|
||||
return open(&dirFile, index, oflag);
|
||||
}
|
||||
/** \deprecated Use: bool openRoot(SdVolume* vol);
|
||||
|
||||
/**
|
||||
* \deprecated Use: bool openRoot(SdVolume* vol);
|
||||
* \param[in] vol The FAT volume containing the root directory to be opened.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool openRoot(SdVolume& vol) {return openRoot(&vol);} // NOLINT
|
||||
/** \deprecated Use: int8_t readDir(dir_t* dir);
|
||||
bool openRoot(SdVolume& vol) { return openRoot(&vol); }
|
||||
|
||||
/**
|
||||
* \deprecated Use: int8_t readDir(dir_t* dir);
|
||||
* \param[out] dir The dir_t struct that will receive the data.
|
||||
* \return bytes read for success zero for eof or -1 for failure.
|
||||
*/
|
||||
int8_t readDir(dir_t& dir, char* longFilename) {return readDir(&dir, longFilename);} // NOLINT
|
||||
/** \deprecated Use:
|
||||
int8_t readDir(dir_t& dir, char* longFilename) {
|
||||
return readDir(&dir, longFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
* \deprecated Use:
|
||||
* static uint8_t remove(SdBaseFile* dirFile, const char* path);
|
||||
* \param[in] dirFile The directory that contains the file.
|
||||
* \param[in] path The name of the file to be removed.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
static bool remove(SdBaseFile& dirFile, const char* path) { // NOLINT
|
||||
return remove(&dirFile, path);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
// rest are private
|
||||
static bool remove(SdBaseFile& dirFile, const char* path) { return remove(&dirFile, path); }
|
||||
|
||||
private:
|
||||
static void (*oldDateTime_)(uint16_t& date, uint16_t& time); // NOLINT
|
||||
static void oldToNew(uint16_t* date, uint16_t* time) {
|
||||
uint16_t d;
|
||||
uint16_t t;
|
||||
static void (*oldDateTime_)(uint16_t &date, uint16_t &time);
|
||||
static void oldToNew(uint16_t * const date, uint16_t * const time) {
|
||||
uint16_t d, t;
|
||||
oldDateTime_(d, t);
|
||||
*date = d;
|
||||
*time = t;
|
||||
@@ -488,5 +498,4 @@ class SdBaseFile {
|
||||
#endif // ALLOW_DEPRECATED_FUNCTIONS
|
||||
};
|
||||
|
||||
#endif // SdBaseFile_h
|
||||
#endif
|
||||
#endif // _SDBASEFILE_H_
|
||||
|
||||
+86
-99
@@ -21,114 +21,101 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* SdFatConfig.h
|
||||
* Arduino SdFat Library
|
||||
* Copyright (C) 2009 by William Greiman
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
|
||||
#ifndef _SDFATCONFIG_H_
|
||||
#define _SDFATCONFIG_H_
|
||||
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief configuration definitions
|
||||
* To use multiple SD cards set USE_MULTIPLE_CARDS nonzero.
|
||||
*
|
||||
* Using multiple cards costs 400 - 500 bytes of flash.
|
||||
*
|
||||
* Each card requires about 550 bytes of SRAM so use of a Mega is recommended.
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#define USE_MULTIPLE_CARDS 0
|
||||
|
||||
#ifndef SdFatConfig_h
|
||||
#define SdFatConfig_h
|
||||
#include <stdint.h>
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* To use multiple SD cards set USE_MULTIPLE_CARDS nonzero.
|
||||
*
|
||||
* Using multiple cards costs 400 - 500 bytes of flash.
|
||||
*
|
||||
* Each card requires about 550 bytes of SRAM so use of a Mega is recommended.
|
||||
*/
|
||||
#define USE_MULTIPLE_CARDS 0
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* Call flush for endl if ENDL_CALLS_FLUSH is nonzero
|
||||
*
|
||||
* The standard for iostreams is to call flush. This is very costly for
|
||||
* SdFat. Each call to flush causes 2048 bytes of I/O to the SD.
|
||||
*
|
||||
* SdFat has a single 512 byte buffer for SD I/O so it must write the current
|
||||
* data block to the SD, read the directory block from the SD, update the
|
||||
* directory entry, write the directory block to the SD and read the data
|
||||
* block back into the buffer.
|
||||
*
|
||||
* The SD flash memory controller is not designed for this many rewrites
|
||||
* so performance may be reduced by more than a factor of 100.
|
||||
*
|
||||
* If ENDL_CALLS_FLUSH is zero, you must call flush and/or close to force
|
||||
* all data to be written to the SD.
|
||||
*/
|
||||
#define ENDL_CALLS_FLUSH 0
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* Allow use of deprecated functions if ALLOW_DEPRECATED_FUNCTIONS is nonzero
|
||||
*/
|
||||
#define ALLOW_DEPRECATED_FUNCTIONS 1
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* Allow FAT12 volumes if FAT12_SUPPORT is nonzero.
|
||||
* FAT12 has not been well tested.
|
||||
*/
|
||||
#define FAT12_SUPPORT 0
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* SPI init rate for SD initialization commands. Must be 5 (F_CPU/64)
|
||||
* or 6 (F_CPU/128).
|
||||
*/
|
||||
#define SPI_SD_INIT_RATE 5
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* Set the SS pin high for hardware SPI. If SS is chip select for another SPI
|
||||
* device this will disable that device during the SD init phase.
|
||||
*/
|
||||
#define SET_SPI_SS_HIGH 1
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* Define MEGA_SOFT_SPI nonzero to use software SPI on Mega Arduinos.
|
||||
* Pins used are SS 10, MOSI 11, MISO 12, and SCK 13.
|
||||
*
|
||||
* MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used
|
||||
* on Mega Arduinos. Software SPI works well with GPS Shield V1.1
|
||||
* but many SD cards will fail with GPS Shield V1.0.
|
||||
*/
|
||||
#define MEGA_SOFT_SPI 0
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* Set USE_SOFTWARE_SPI nonzero to always use software SPI.
|
||||
*/
|
||||
#define USE_SOFTWARE_SPI 0
|
||||
// define software SPI pins so Mega can use unmodified 168/328 shields
|
||||
/** Software SPI chip select pin for the SD */
|
||||
#define SOFT_SPI_CS_PIN 10
|
||||
/** Software SPI Master Out Slave In pin */
|
||||
#define SOFT_SPI_MOSI_PIN 11
|
||||
/** Software SPI Master In Slave Out pin */
|
||||
#define SOFT_SPI_MISO_PIN 12
|
||||
/** Software SPI Clock pin */
|
||||
#define SOFT_SPI_SCK_PIN 13
|
||||
//------------------------------------------------------------------------------
|
||||
/**
|
||||
* The __cxa_pure_virtual function is an error handler that is invoked when
|
||||
* a pure virtual function is called.
|
||||
*/
|
||||
#define USE_CXA_PURE_VIRTUAL 1
|
||||
/**
|
||||
* Call flush for endl if ENDL_CALLS_FLUSH is nonzero
|
||||
*
|
||||
* The standard for iostreams is to call flush. This is very costly for
|
||||
* SdFat. Each call to flush causes 2048 bytes of I/O to the SD.
|
||||
*
|
||||
* SdFat has a single 512 byte buffer for SD I/O so it must write the current
|
||||
* data block to the SD, read the directory block from the SD, update the
|
||||
* directory entry, write the directory block to the SD and read the data
|
||||
* block back into the buffer.
|
||||
*
|
||||
* The SD flash memory controller is not designed for this many rewrites
|
||||
* so performance may be reduced by more than a factor of 100.
|
||||
*
|
||||
* If ENDL_CALLS_FLUSH is zero, you must call flush and/or close to force
|
||||
* all data to be written to the SD.
|
||||
*/
|
||||
#define ENDL_CALLS_FLUSH 0
|
||||
|
||||
/** Number of UTF-16 characters per entry */
|
||||
#define FILENAME_LENGTH 13
|
||||
/**
|
||||
* Allow use of deprecated functions if ALLOW_DEPRECATED_FUNCTIONS is nonzero
|
||||
*/
|
||||
#define ALLOW_DEPRECATED_FUNCTIONS 1
|
||||
|
||||
/**
|
||||
* Defines for long (vfat) filenames
|
||||
*/
|
||||
/** Number of VFAT entries used. Every entry has 13 UTF-16 characters */
|
||||
#define MAX_VFAT_ENTRIES (2)
|
||||
/** Total size of the buffer used to store the long filenames */
|
||||
#define LONG_FILENAME_LENGTH (FILENAME_LENGTH*MAX_VFAT_ENTRIES+1)
|
||||
#endif // SdFatConfig_h
|
||||
/**
|
||||
* Allow FAT12 volumes if FAT12_SUPPORT is nonzero.
|
||||
* FAT12 has not been well tested.
|
||||
*/
|
||||
#define FAT12_SUPPORT 0
|
||||
|
||||
/**
|
||||
* SPI init rate for SD initialization commands. Must be 5 (F_CPU/64)
|
||||
* or 6 (F_CPU/128).
|
||||
*/
|
||||
#define SPI_SD_INIT_RATE 5
|
||||
|
||||
#endif
|
||||
/**
|
||||
* Set the SS pin high for hardware SPI. If SS is chip select for another SPI
|
||||
* device this will disable that device during the SD init phase.
|
||||
*/
|
||||
#define SET_SPI_SS_HIGH 1
|
||||
|
||||
/**
|
||||
* Define MEGA_SOFT_SPI nonzero to use software SPI on Mega Arduinos.
|
||||
* Pins used are SS 10, MOSI 11, MISO 12, and SCK 13.
|
||||
*
|
||||
* MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used
|
||||
* on Mega Arduinos. Software SPI works well with GPS Shield V1.1
|
||||
* but many SD cards will fail with GPS Shield V1.0.
|
||||
*/
|
||||
#define MEGA_SOFT_SPI 0
|
||||
|
||||
// Set USE_SOFTWARE_SPI nonzero to ALWAYS use Software SPI.
|
||||
#define USE_SOFTWARE_SPI 0
|
||||
|
||||
// Define software SPI pins so Mega can use unmodified 168/328 shields
|
||||
#define SOFT_SPI_CS_PIN 10 // Software SPI chip select pin for the SD
|
||||
#define SOFT_SPI_MOSI_PIN 11 // Software SPI Master Out Slave In pin
|
||||
#define SOFT_SPI_MISO_PIN 12 // Software SPI Master In Slave Out pin
|
||||
#define SOFT_SPI_SCK_PIN 13 // Software SPI Clock pin
|
||||
|
||||
/**
|
||||
* The __cxa_pure_virtual function is an error handler that is invoked when
|
||||
* a pure virtual function is called.
|
||||
*/
|
||||
#define USE_CXA_PURE_VIRTUAL 1
|
||||
|
||||
/**
|
||||
* Defines for 8.3 and long (vfat) filenames
|
||||
*/
|
||||
|
||||
#define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry
|
||||
|
||||
// Total bytes needed to store a single long filename
|
||||
#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * MAX_VFAT_ENTRIES + 1)
|
||||
|
||||
#endif // _SDFATCONFIG_H_
|
||||
|
||||
+384
-424
@@ -20,35 +20,31 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief FAT file structures
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arduino SdFat Library
|
||||
* Copyright (C) 2009 by William Greiman
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#ifndef SdFatStructs_h
|
||||
#define SdFatStructs_h
|
||||
#ifndef SDFATSTRUCTS_H
|
||||
#define SDFATSTRUCTS_H
|
||||
|
||||
#define PACKED __attribute__((__packed__))
|
||||
/**
|
||||
* \file
|
||||
* \brief FAT file structures
|
||||
*/
|
||||
|
||||
/**
|
||||
* mostly from Microsoft document fatgen103.doc
|
||||
* http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx
|
||||
*/
|
||||
//------------------------------------------------------------------------------
|
||||
/** Value for byte 510 of boot block or MBR */
|
||||
uint8_t const BOOTSIG0 = 0X55;
|
||||
/** Value for byte 511 of boot block or MBR */
|
||||
uint8_t const BOOTSIG1 = 0XAA;
|
||||
/** Value for bootSignature field int FAT/FAT32 boot sector */
|
||||
uint8_t const EXTENDED_BOOT_SIG = 0X29;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
uint8_t const BOOTSIG0 = 0x55, // Value for byte 510 of boot block or MBR
|
||||
BOOTSIG1 = 0xAA, // Value for byte 511 of boot block or MBR
|
||||
EXTENDED_BOOT_SIG = 0x29; // Value for bootSignature field int FAT/FAT32 boot sector
|
||||
|
||||
/**
|
||||
* \struct partitionTable
|
||||
* \brief MBR partition table entry
|
||||
@@ -57,59 +53,58 @@ uint8_t const EXTENDED_BOOT_SIG = 0X29;
|
||||
* The MBR partition table has four entries.
|
||||
*/
|
||||
struct partitionTable {
|
||||
/**
|
||||
* Boot Indicator . Indicates whether the volume is the active
|
||||
* partition. Legal values include: 0X00. Do not use for booting.
|
||||
* 0X80 Active partition.
|
||||
*/
|
||||
/**
|
||||
* Boot Indicator . Indicates whether the volume is the active
|
||||
* partition. Legal values include: 0x00. Do not use for booting.
|
||||
* 0x80 Active partition.
|
||||
*/
|
||||
uint8_t boot;
|
||||
/**
|
||||
* Head part of Cylinder-head-sector address of the first block in
|
||||
* the partition. Legal values are 0-255. Only used in old PC BIOS.
|
||||
*/
|
||||
/**
|
||||
* Head part of Cylinder-head-sector address of the first block in
|
||||
* the partition. Legal values are 0-255. Only used in old PC BIOS.
|
||||
*/
|
||||
uint8_t beginHead;
|
||||
/**
|
||||
* Sector part of Cylinder-head-sector address of the first block in
|
||||
* the partition. Legal values are 1-63. Only used in old PC BIOS.
|
||||
*/
|
||||
/**
|
||||
* Sector part of Cylinder-head-sector address of the first block in
|
||||
* the partition. Legal values are 1-63. Only used in old PC BIOS.
|
||||
*/
|
||||
unsigned beginSector : 6;
|
||||
/** High bits cylinder for first block in partition. */
|
||||
/** High bits cylinder for first block in partition. */
|
||||
unsigned beginCylinderHigh : 2;
|
||||
/**
|
||||
* Combine beginCylinderLow with beginCylinderHigh. Legal values
|
||||
* are 0-1023. Only used in old PC BIOS.
|
||||
*/
|
||||
/**
|
||||
* Combine beginCylinderLow with beginCylinderHigh. Legal values
|
||||
* are 0-1023. Only used in old PC BIOS.
|
||||
*/
|
||||
uint8_t beginCylinderLow;
|
||||
/**
|
||||
* Partition type. See defines that begin with PART_TYPE_ for
|
||||
* some Microsoft partition types.
|
||||
*/
|
||||
/**
|
||||
* Partition type. See defines that begin with PART_TYPE_ for
|
||||
* some Microsoft partition types.
|
||||
*/
|
||||
uint8_t type;
|
||||
/**
|
||||
* head part of cylinder-head-sector address of the last sector in the
|
||||
* partition. Legal values are 0-255. Only used in old PC BIOS.
|
||||
*/
|
||||
/**
|
||||
* head part of cylinder-head-sector address of the last sector in the
|
||||
* partition. Legal values are 0-255. Only used in old PC BIOS.
|
||||
*/
|
||||
uint8_t endHead;
|
||||
/**
|
||||
* Sector part of cylinder-head-sector address of the last sector in
|
||||
* the partition. Legal values are 1-63. Only used in old PC BIOS.
|
||||
*/
|
||||
/**
|
||||
* Sector part of cylinder-head-sector address of the last sector in
|
||||
* the partition. Legal values are 1-63. Only used in old PC BIOS.
|
||||
*/
|
||||
unsigned endSector : 6;
|
||||
/** High bits of end cylinder */
|
||||
/** High bits of end cylinder */
|
||||
unsigned endCylinderHigh : 2;
|
||||
/**
|
||||
* Combine endCylinderLow with endCylinderHigh. Legal values
|
||||
* are 0-1023. Only used in old PC BIOS.
|
||||
*/
|
||||
/**
|
||||
* Combine endCylinderLow with endCylinderHigh. Legal values
|
||||
* are 0-1023. Only used in old PC BIOS.
|
||||
*/
|
||||
uint8_t endCylinderLow;
|
||||
/** Logical block address of the first block in the partition. */
|
||||
uint32_t firstSector;
|
||||
/** Length of the partition, in blocks. */
|
||||
uint32_t totalSectors;
|
||||
|
||||
uint32_t firstSector; // Logical block address of the first block in the partition.
|
||||
uint32_t totalSectors; // Length of the partition, in blocks.
|
||||
} PACKED;
|
||||
/** Type name for partitionTable */
|
||||
typedef struct partitionTable part_t;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
typedef struct partitionTable part_t; // Type name for partitionTable
|
||||
|
||||
/**
|
||||
* \struct masterBootRecord
|
||||
*
|
||||
@@ -118,22 +113,16 @@ typedef struct partitionTable part_t;
|
||||
* The first block of a storage device that is formatted with a MBR.
|
||||
*/
|
||||
struct masterBootRecord {
|
||||
/** Code Area for master boot program. */
|
||||
uint8_t codeArea[440];
|
||||
/** Optional Windows NT disk signature. May contain boot code. */
|
||||
uint32_t diskSignature;
|
||||
/** Usually zero but may be more boot code. */
|
||||
uint16_t usuallyZero;
|
||||
/** Partition tables. */
|
||||
part_t part[4];
|
||||
/** First MBR signature byte. Must be 0X55 */
|
||||
uint8_t mbrSig0;
|
||||
/** Second MBR signature byte. Must be 0XAA */
|
||||
uint8_t mbrSig1;
|
||||
uint8_t codeArea[440]; // Code Area for master boot program.
|
||||
uint32_t diskSignature; // Optional Windows NT disk signature. May contain boot code.
|
||||
uint16_t usuallyZero; // Usually zero but may be more boot code.
|
||||
part_t part[4]; // Partition tables.
|
||||
uint8_t mbrSig0; // First MBR signature byte. Must be 0x55
|
||||
uint8_t mbrSig1; // Second MBR signature byte. Must be 0xAA
|
||||
} PACKED;
|
||||
/** Type name for masterBootRecord */
|
||||
typedef struct masterBootRecord mbr_t;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \struct fat_boot
|
||||
*
|
||||
@@ -141,285 +130,280 @@ typedef struct masterBootRecord mbr_t;
|
||||
*
|
||||
*/
|
||||
struct fat_boot {
|
||||
/**
|
||||
* The first three bytes of the boot sector must be valid,
|
||||
* executable x 86-based CPU instructions. This includes a
|
||||
* jump instruction that skips the next nonexecutable bytes.
|
||||
*/
|
||||
/**
|
||||
* The first three bytes of the boot sector must be valid,
|
||||
* executable x 86-based CPU instructions. This includes a
|
||||
* jump instruction that skips the next nonexecutable bytes.
|
||||
*/
|
||||
uint8_t jump[3];
|
||||
/**
|
||||
* This is typically a string of characters that identifies
|
||||
* the operating system that formatted the volume.
|
||||
*/
|
||||
/**
|
||||
* This is typically a string of characters that identifies
|
||||
* the operating system that formatted the volume.
|
||||
*/
|
||||
char oemId[8];
|
||||
/**
|
||||
* The size of a hardware sector. Valid decimal values for this
|
||||
* field are 512, 1024, 2048, and 4096. For most disks used in
|
||||
* the United States, the value of this field is 512.
|
||||
*/
|
||||
/**
|
||||
* The size of a hardware sector. Valid decimal values for this
|
||||
* field are 512, 1024, 2048, and 4096. For most disks used in
|
||||
* the United States, the value of this field is 512.
|
||||
*/
|
||||
uint16_t bytesPerSector;
|
||||
/**
|
||||
* Number of sectors per allocation unit. This value must be a
|
||||
* power of 2 that is greater than 0. The legal values are
|
||||
* 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided.
|
||||
*/
|
||||
/**
|
||||
* Number of sectors per allocation unit. This value must be a
|
||||
* power of 2 that is greater than 0. The legal values are
|
||||
* 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided.
|
||||
*/
|
||||
uint8_t sectorsPerCluster;
|
||||
/**
|
||||
* The number of sectors preceding the start of the first FAT,
|
||||
* including the boot sector. The value of this field is always 1.
|
||||
*/
|
||||
/**
|
||||
* The number of sectors preceding the start of the first FAT,
|
||||
* including the boot sector. The value of this field is always 1.
|
||||
*/
|
||||
uint16_t reservedSectorCount;
|
||||
/**
|
||||
* The number of copies of the FAT on the volume.
|
||||
* The value of this field is always 2.
|
||||
*/
|
||||
/**
|
||||
* The number of copies of the FAT on the volume.
|
||||
* The value of this field is always 2.
|
||||
*/
|
||||
uint8_t fatCount;
|
||||
/**
|
||||
* For FAT12 and FAT16 volumes, this field contains the count of
|
||||
* 32-byte directory entries in the root directory. For FAT32 volumes,
|
||||
* this field must be set to 0. For FAT12 and FAT16 volumes, this
|
||||
* value should always specify a count that when multiplied by 32
|
||||
* results in a multiple of bytesPerSector. FAT16 volumes should
|
||||
* use the value 512.
|
||||
*/
|
||||
/**
|
||||
* For FAT12 and FAT16 volumes, this field contains the count of
|
||||
* 32-byte directory entries in the root directory. For FAT32 volumes,
|
||||
* this field must be set to 0. For FAT12 and FAT16 volumes, this
|
||||
* value should always specify a count that when multiplied by 32
|
||||
* results in a multiple of bytesPerSector. FAT16 volumes should
|
||||
* use the value 512.
|
||||
*/
|
||||
uint16_t rootDirEntryCount;
|
||||
/**
|
||||
* This field is the old 16-bit total count of sectors on the volume.
|
||||
* This count includes the count of all sectors in all four regions
|
||||
* of the volume. This field can be 0; if it is 0, then totalSectors32
|
||||
* must be nonzero. For FAT32 volumes, this field must be 0. For
|
||||
* FAT12 and FAT16 volumes, this field contains the sector count, and
|
||||
* totalSectors32 is 0 if the total sector count fits
|
||||
* (is less than 0x10000).
|
||||
*/
|
||||
/**
|
||||
* This field is the old 16-bit total count of sectors on the volume.
|
||||
* This count includes the count of all sectors in all four regions
|
||||
* of the volume. This field can be 0; if it is 0, then totalSectors32
|
||||
* must be nonzero. For FAT32 volumes, this field must be 0. For
|
||||
* FAT12 and FAT16 volumes, this field contains the sector count, and
|
||||
* totalSectors32 is 0 if the total sector count fits
|
||||
* (is less than 0x10000).
|
||||
*/
|
||||
uint16_t totalSectors16;
|
||||
/**
|
||||
* This dates back to the old MS-DOS 1.x media determination and is
|
||||
* no longer usually used for anything. 0xF8 is the standard value
|
||||
* for fixed (nonremovable) media. For removable media, 0xF0 is
|
||||
* frequently used. Legal values are 0xF0 or 0xF8-0xFF.
|
||||
*/
|
||||
/**
|
||||
* This dates back to the old MS-DOS 1.x media determination and is
|
||||
* no longer usually used for anything. 0xF8 is the standard value
|
||||
* for fixed (nonremovable) media. For removable media, 0xF0 is
|
||||
* frequently used. Legal values are 0xF0 or 0xF8-0xFF.
|
||||
*/
|
||||
uint8_t mediaType;
|
||||
/**
|
||||
* Count of sectors occupied by one FAT on FAT12/FAT16 volumes.
|
||||
* On FAT32 volumes this field must be 0, and sectorsPerFat32
|
||||
* contains the FAT size count.
|
||||
*/
|
||||
/**
|
||||
* Count of sectors occupied by one FAT on FAT12/FAT16 volumes.
|
||||
* On FAT32 volumes this field must be 0, and sectorsPerFat32
|
||||
* contains the FAT size count.
|
||||
*/
|
||||
uint16_t sectorsPerFat16;
|
||||
/** Sectors per track for interrupt 0x13. Not used otherwise. */
|
||||
uint16_t sectorsPerTrack;
|
||||
/** Number of heads for interrupt 0x13. Not used otherwise. */
|
||||
uint16_t headCount;
|
||||
/**
|
||||
* Count of hidden sectors preceding the partition that contains this
|
||||
* FAT volume. This field is generally only relevant for media
|
||||
* visible on interrupt 0x13.
|
||||
*/
|
||||
|
||||
uint16_t sectorsPerTrack; // Sectors per track for interrupt 0x13. Not used otherwise.
|
||||
uint16_t headCount; // Number of heads for interrupt 0x13. Not used otherwise.
|
||||
|
||||
/**
|
||||
* Count of hidden sectors preceding the partition that contains this
|
||||
* FAT volume. This field is generally only relevant for media
|
||||
* visible on interrupt 0x13.
|
||||
*/
|
||||
uint32_t hidddenSectors;
|
||||
/**
|
||||
* This field is the new 32-bit total count of sectors on the volume.
|
||||
* This count includes the count of all sectors in all four regions
|
||||
* of the volume. This field can be 0; if it is 0, then
|
||||
* totalSectors16 must be nonzero.
|
||||
*/
|
||||
/**
|
||||
* This field is the new 32-bit total count of sectors on the volume.
|
||||
* This count includes the count of all sectors in all four regions
|
||||
* of the volume. This field can be 0; if it is 0, then
|
||||
* totalSectors16 must be nonzero.
|
||||
*/
|
||||
uint32_t totalSectors32;
|
||||
/**
|
||||
* Related to the BIOS physical drive number. Floppy drives are
|
||||
* identified as 0x00 and physical hard disks are identified as
|
||||
* 0x80, regardless of the number of physical disk drives.
|
||||
* Typically, this value is set prior to issuing an INT 13h BIOS
|
||||
* call to specify the device to access. The value is only
|
||||
* relevant if the device is a boot device.
|
||||
*/
|
||||
/**
|
||||
* Related to the BIOS physical drive number. Floppy drives are
|
||||
* identified as 0x00 and physical hard disks are identified as
|
||||
* 0x80, regardless of the number of physical disk drives.
|
||||
* Typically, this value is set prior to issuing an INT 13h BIOS
|
||||
* call to specify the device to access. The value is only
|
||||
* relevant if the device is a boot device.
|
||||
*/
|
||||
uint8_t driveNumber;
|
||||
/** used by Windows NT - should be zero for FAT */
|
||||
uint8_t reserved1;
|
||||
/** 0X29 if next three fields are valid */
|
||||
uint8_t bootSignature;
|
||||
/**
|
||||
* A random serial number created when formatting a disk,
|
||||
* which helps to distinguish between disks.
|
||||
* Usually generated by combining date and time.
|
||||
*/
|
||||
|
||||
uint8_t reserved1; // used by Windows NT - should be zero for FAT
|
||||
uint8_t bootSignature; // 0x29 if next three fields are valid
|
||||
|
||||
/**
|
||||
* A random serial number created when formatting a disk,
|
||||
* which helps to distinguish between disks.
|
||||
* Usually generated by combining date and time.
|
||||
*/
|
||||
uint32_t volumeSerialNumber;
|
||||
/**
|
||||
* A field once used to store the volume label. The volume label
|
||||
* is now stored as a special file in the root directory.
|
||||
*/
|
||||
/**
|
||||
* A field once used to store the volume label. The volume label
|
||||
* is now stored as a special file in the root directory.
|
||||
*/
|
||||
char volumeLabel[11];
|
||||
/**
|
||||
* A field with a value of either FAT, FAT12 or FAT16,
|
||||
* depending on the disk format.
|
||||
*/
|
||||
/**
|
||||
* A field with a value of either FAT, FAT12 or FAT16,
|
||||
* depending on the disk format.
|
||||
*/
|
||||
char fileSystemType[8];
|
||||
/** X86 boot code */
|
||||
uint8_t bootCode[448];
|
||||
/** must be 0X55 */
|
||||
uint8_t bootSectorSig0;
|
||||
/** must be 0XAA */
|
||||
uint8_t bootSectorSig1;
|
||||
|
||||
uint8_t bootCode[448]; // X86 boot code
|
||||
uint8_t bootSectorSig0; // must be 0x55
|
||||
uint8_t bootSectorSig1; // must be 0xAA
|
||||
} PACKED;
|
||||
/** Type name for FAT Boot Sector */
|
||||
typedef struct fat_boot fat_boot_t;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
typedef struct fat_boot fat_boot_t; // Type name for FAT Boot Sector
|
||||
|
||||
/**
|
||||
* \struct fat32_boot
|
||||
*
|
||||
* \brief Boot sector for a FAT32 volume.
|
||||
*
|
||||
*/
|
||||
struct fat32_boot {
|
||||
/**
|
||||
* The first three bytes of the boot sector must be valid,
|
||||
* executable x 86-based CPU instructions. This includes a
|
||||
* jump instruction that skips the next nonexecutable bytes.
|
||||
*/
|
||||
/**
|
||||
* The first three bytes of the boot sector must be valid,
|
||||
* executable x 86-based CPU instructions. This includes a
|
||||
* jump instruction that skips the next nonexecutable bytes.
|
||||
*/
|
||||
uint8_t jump[3];
|
||||
/**
|
||||
* This is typically a string of characters that identifies
|
||||
* the operating system that formatted the volume.
|
||||
*/
|
||||
/**
|
||||
* This is typically a string of characters that identifies
|
||||
* the operating system that formatted the volume.
|
||||
*/
|
||||
char oemId[8];
|
||||
/**
|
||||
* The size of a hardware sector. Valid decimal values for this
|
||||
* field are 512, 1024, 2048, and 4096. For most disks used in
|
||||
* the United States, the value of this field is 512.
|
||||
*/
|
||||
/**
|
||||
* The size of a hardware sector. Valid decimal values for this
|
||||
* field are 512, 1024, 2048, and 4096. For most disks used in
|
||||
* the United States, the value of this field is 512.
|
||||
*/
|
||||
uint16_t bytesPerSector;
|
||||
/**
|
||||
* Number of sectors per allocation unit. This value must be a
|
||||
* power of 2 that is greater than 0. The legal values are
|
||||
* 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided.
|
||||
*/
|
||||
/**
|
||||
* Number of sectors per allocation unit. This value must be a
|
||||
* power of 2 that is greater than 0. The legal values are
|
||||
* 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided.
|
||||
*/
|
||||
uint8_t sectorsPerCluster;
|
||||
/**
|
||||
* The number of sectors preceding the start of the first FAT,
|
||||
* including the boot sector. Must not be zero
|
||||
*/
|
||||
/**
|
||||
* The number of sectors preceding the start of the first FAT,
|
||||
* including the boot sector. Must not be zero
|
||||
*/
|
||||
uint16_t reservedSectorCount;
|
||||
/**
|
||||
* The number of copies of the FAT on the volume.
|
||||
* The value of this field is always 2.
|
||||
*/
|
||||
/**
|
||||
* The number of copies of the FAT on the volume.
|
||||
* The value of this field is always 2.
|
||||
*/
|
||||
uint8_t fatCount;
|
||||
/**
|
||||
* FAT12/FAT16 only. For FAT32 volumes, this field must be set to 0.
|
||||
*/
|
||||
/**
|
||||
* FAT12/FAT16 only. For FAT32 volumes, this field must be set to 0.
|
||||
*/
|
||||
uint16_t rootDirEntryCount;
|
||||
/**
|
||||
* For FAT32 volumes, this field must be 0.
|
||||
*/
|
||||
/**
|
||||
* For FAT32 volumes, this field must be 0.
|
||||
*/
|
||||
uint16_t totalSectors16;
|
||||
/**
|
||||
* This dates back to the old MS-DOS 1.x media determination and is
|
||||
* no longer usually used for anything. 0xF8 is the standard value
|
||||
* for fixed (nonremovable) media. For removable media, 0xF0 is
|
||||
* frequently used. Legal values are 0xF0 or 0xF8-0xFF.
|
||||
*/
|
||||
/**
|
||||
* This dates back to the old MS-DOS 1.x media determination and is
|
||||
* no longer usually used for anything. 0xF8 is the standard value
|
||||
* for fixed (nonremovable) media. For removable media, 0xF0 is
|
||||
* frequently used. Legal values are 0xF0 or 0xF8-0xFF.
|
||||
*/
|
||||
uint8_t mediaType;
|
||||
/**
|
||||
* On FAT32 volumes this field must be 0, and sectorsPerFat32
|
||||
* contains the FAT size count.
|
||||
*/
|
||||
/**
|
||||
* On FAT32 volumes this field must be 0, and sectorsPerFat32
|
||||
* contains the FAT size count.
|
||||
*/
|
||||
uint16_t sectorsPerFat16;
|
||||
/** Sectors per track for interrupt 0x13. Not used otherwise. */
|
||||
uint16_t sectorsPerTrack;
|
||||
/** Number of heads for interrupt 0x13. Not used otherwise. */
|
||||
uint16_t headCount;
|
||||
/**
|
||||
* Count of hidden sectors preceding the partition that contains this
|
||||
* FAT volume. This field is generally only relevant for media
|
||||
* visible on interrupt 0x13.
|
||||
*/
|
||||
|
||||
uint16_t sectorsPerTrack; // Sectors per track for interrupt 0x13. Not used otherwise.
|
||||
uint16_t headCount; // Number of heads for interrupt 0x13. Not used otherwise.
|
||||
|
||||
/**
|
||||
* Count of hidden sectors preceding the partition that contains this
|
||||
* FAT volume. This field is generally only relevant for media
|
||||
* visible on interrupt 0x13.
|
||||
*/
|
||||
uint32_t hidddenSectors;
|
||||
/**
|
||||
* Contains the total number of sectors in the FAT32 volume.
|
||||
*/
|
||||
/**
|
||||
* Contains the total number of sectors in the FAT32 volume.
|
||||
*/
|
||||
uint32_t totalSectors32;
|
||||
/**
|
||||
* Count of sectors occupied by one FAT on FAT32 volumes.
|
||||
*/
|
||||
/**
|
||||
* Count of sectors occupied by one FAT on FAT32 volumes.
|
||||
*/
|
||||
uint32_t sectorsPerFat32;
|
||||
/**
|
||||
* This field is only defined for FAT32 media and does not exist on
|
||||
* FAT12 and FAT16 media.
|
||||
* Bits 0-3 -- Zero-based number of active FAT.
|
||||
* Only valid if mirroring is disabled.
|
||||
* Bits 4-6 -- Reserved.
|
||||
* Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs.
|
||||
* -- 1 means only one FAT is active; it is the one referenced
|
||||
* in bits 0-3.
|
||||
* Bits 8-15 -- Reserved.
|
||||
*/
|
||||
/**
|
||||
* This field is only defined for FAT32 media and does not exist on
|
||||
* FAT12 and FAT16 media.
|
||||
* Bits 0-3 -- Zero-based number of active FAT.
|
||||
* Only valid if mirroring is disabled.
|
||||
* Bits 4-6 -- Reserved.
|
||||
* Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs.
|
||||
* -- 1 means only one FAT is active; it is the one referenced
|
||||
* in bits 0-3.
|
||||
* Bits 8-15 -- Reserved.
|
||||
*/
|
||||
uint16_t fat32Flags;
|
||||
/**
|
||||
* FAT32 version. High byte is major revision number.
|
||||
* Low byte is minor revision number. Only 0.0 define.
|
||||
*/
|
||||
/**
|
||||
* FAT32 version. High byte is major revision number.
|
||||
* Low byte is minor revision number. Only 0.0 define.
|
||||
*/
|
||||
uint16_t fat32Version;
|
||||
/**
|
||||
* Cluster number of the first cluster of the root directory for FAT32.
|
||||
* This usually 2 but not required to be 2.
|
||||
*/
|
||||
/**
|
||||
* Cluster number of the first cluster of the root directory for FAT32.
|
||||
* This usually 2 but not required to be 2.
|
||||
*/
|
||||
uint32_t fat32RootCluster;
|
||||
/**
|
||||
* Sector number of FSINFO structure in the reserved area of the
|
||||
* FAT32 volume. Usually 1.
|
||||
*/
|
||||
/**
|
||||
* Sector number of FSINFO structure in the reserved area of the
|
||||
* FAT32 volume. Usually 1.
|
||||
*/
|
||||
uint16_t fat32FSInfo;
|
||||
/**
|
||||
* If nonzero, indicates the sector number in the reserved area
|
||||
* of the volume of a copy of the boot record. Usually 6.
|
||||
* No value other than 6 is recommended.
|
||||
*/
|
||||
/**
|
||||
* If nonzero, indicates the sector number in the reserved area
|
||||
* of the volume of a copy of the boot record. Usually 6.
|
||||
* No value other than 6 is recommended.
|
||||
*/
|
||||
uint16_t fat32BackBootBlock;
|
||||
/**
|
||||
* Reserved for future expansion. Code that formats FAT32 volumes
|
||||
* should always set all of the bytes of this field to 0.
|
||||
*/
|
||||
/**
|
||||
* Reserved for future expansion. Code that formats FAT32 volumes
|
||||
* should always set all of the bytes of this field to 0.
|
||||
*/
|
||||
uint8_t fat32Reserved[12];
|
||||
/**
|
||||
* Related to the BIOS physical drive number. Floppy drives are
|
||||
* identified as 0x00 and physical hard disks are identified as
|
||||
* 0x80, regardless of the number of physical disk drives.
|
||||
* Typically, this value is set prior to issuing an INT 13h BIOS
|
||||
* call to specify the device to access. The value is only
|
||||
* relevant if the device is a boot device.
|
||||
*/
|
||||
/**
|
||||
* Related to the BIOS physical drive number. Floppy drives are
|
||||
* identified as 0x00 and physical hard disks are identified as
|
||||
* 0x80, regardless of the number of physical disk drives.
|
||||
* Typically, this value is set prior to issuing an INT 13h BIOS
|
||||
* call to specify the device to access. The value is only
|
||||
* relevant if the device is a boot device.
|
||||
*/
|
||||
uint8_t driveNumber;
|
||||
/** used by Windows NT - should be zero for FAT */
|
||||
uint8_t reserved1;
|
||||
/** 0X29 if next three fields are valid */
|
||||
uint8_t bootSignature;
|
||||
/**
|
||||
* A random serial number created when formatting a disk,
|
||||
* which helps to distinguish between disks.
|
||||
* Usually generated by combining date and time.
|
||||
*/
|
||||
|
||||
uint8_t reserved1; // Used by Windows NT - should be zero for FAT
|
||||
uint8_t bootSignature; // 0x29 if next three fields are valid
|
||||
|
||||
/**
|
||||
* A random serial number created when formatting a disk,
|
||||
* which helps to distinguish between disks.
|
||||
* Usually generated by combining date and time.
|
||||
*/
|
||||
uint32_t volumeSerialNumber;
|
||||
/**
|
||||
* A field once used to store the volume label. The volume label
|
||||
* is now stored as a special file in the root directory.
|
||||
*/
|
||||
/**
|
||||
* A field once used to store the volume label. The volume label
|
||||
* is now stored as a special file in the root directory.
|
||||
*/
|
||||
char volumeLabel[11];
|
||||
/**
|
||||
* A text field with a value of FAT32.
|
||||
*/
|
||||
/**
|
||||
* A text field with a value of FAT32.
|
||||
*/
|
||||
char fileSystemType[8];
|
||||
/** X86 boot code */
|
||||
uint8_t bootCode[420];
|
||||
/** must be 0X55 */
|
||||
uint8_t bootSectorSig0;
|
||||
/** must be 0XAA */
|
||||
uint8_t bootSectorSig1;
|
||||
|
||||
uint8_t bootCode[420]; // X86 boot code
|
||||
uint8_t bootSectorSig0; // must be 0x55
|
||||
uint8_t bootSectorSig1; // must be 0xAA
|
||||
|
||||
} PACKED;
|
||||
/** Type name for FAT32 Boot Sector */
|
||||
typedef struct fat32_boot fat32_boot_t;
|
||||
//------------------------------------------------------------------------------
|
||||
/** Lead signature for a FSINFO sector */
|
||||
uint32_t const FSINFO_LEAD_SIG = 0x41615252;
|
||||
/** Struct signature for a FSINFO sector */
|
||||
uint32_t const FSINFO_STRUCT_SIG = 0x61417272;
|
||||
|
||||
typedef struct fat32_boot fat32_boot_t; // Type name for FAT32 Boot Sector
|
||||
|
||||
uint32_t const FSINFO_LEAD_SIG = 0x41615252, // 'AaRR' Lead signature for a FSINFO sector
|
||||
FSINFO_STRUCT_SIG = 0x61417272; // 'aArr' Struct signature for a FSINFO sector
|
||||
|
||||
/**
|
||||
* \struct fat32_fsinfo
|
||||
*
|
||||
@@ -427,12 +411,9 @@ uint32_t const FSINFO_STRUCT_SIG = 0x61417272;
|
||||
*
|
||||
*/
|
||||
struct fat32_fsinfo {
|
||||
/** must be 0X52, 0X52, 0X61, 0X41 */
|
||||
uint32_t leadSignature;
|
||||
/** must be zero */
|
||||
uint8_t reserved1[480];
|
||||
/** must be 0X72, 0X72, 0X41, 0X61 */
|
||||
uint32_t structSignature;
|
||||
uint32_t leadSignature; // must be 0x52, 0x52, 0x61, 0x41 'RRaA'
|
||||
uint8_t reserved1[480]; // must be zero
|
||||
uint32_t structSignature; // must be 0x72, 0x72, 0x41, 0x61 'rrAa'
|
||||
/**
|
||||
* Contains the last known free cluster count on the volume.
|
||||
* If the value is 0xFFFFFFFF, then the free count is unknown
|
||||
@@ -448,30 +429,22 @@ struct fat32_fsinfo {
|
||||
* should start looking at cluster 2.
|
||||
*/
|
||||
uint32_t nextFree;
|
||||
/** must be zero */
|
||||
uint8_t reserved2[12];
|
||||
/** must be 0X00, 0X00, 0X55, 0XAA */
|
||||
uint8_t tailSignature[4];
|
||||
|
||||
uint8_t reserved2[12]; // must be zero
|
||||
uint8_t tailSignature[4]; // must be 0x00, 0x00, 0x55, 0xAA
|
||||
} PACKED;
|
||||
/** Type name for FAT32 FSINFO Sector */
|
||||
typedef struct fat32_fsinfo fat32_fsinfo_t;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
typedef struct fat32_fsinfo fat32_fsinfo_t; // Type name for FAT32 FSINFO Sector
|
||||
|
||||
// End Of Chain values for FAT entries
|
||||
/** FAT12 end of chain value used by Microsoft. */
|
||||
uint16_t const FAT12EOC = 0XFFF;
|
||||
/** Minimum value for FAT12 EOC. Use to test for EOC. */
|
||||
uint16_t const FAT12EOC_MIN = 0XFF8;
|
||||
/** FAT16 end of chain value used by Microsoft. */
|
||||
uint16_t const FAT16EOC = 0XFFFF;
|
||||
/** Minimum value for FAT16 EOC. Use to test for EOC. */
|
||||
uint16_t const FAT16EOC_MIN = 0XFFF8;
|
||||
/** FAT32 end of chain value used by Microsoft. */
|
||||
uint32_t const FAT32EOC = 0X0FFFFFFF;
|
||||
/** Minimum value for FAT32 EOC. Use to test for EOC. */
|
||||
uint32_t const FAT32EOC_MIN = 0X0FFFFFF8;
|
||||
/** Mask a for FAT32 entry. Entries are 28 bits. */
|
||||
uint32_t const FAT32MASK = 0X0FFFFFFF;
|
||||
//------------------------------------------------------------------------------
|
||||
uint16_t const FAT12EOC = 0xFFF, // FAT12 end of chain value used by Microsoft.
|
||||
FAT12EOC_MIN = 0xFF8, // Minimum value for FAT12 EOC. Use to test for EOC.
|
||||
FAT16EOC = 0xFFFF, // FAT16 end of chain value used by Microsoft.
|
||||
FAT16EOC_MIN = 0xFFF8; // Minimum value for FAT16 EOC. Use to test for EOC.
|
||||
uint32_t const FAT32EOC = 0x0FFFFFFF, // FAT32 end of chain value used by Microsoft.
|
||||
FAT32EOC_MIN = 0x0FFFFFF8, // Minimum value for FAT32 EOC. Use to test for EOC.
|
||||
FAT32MASK = 0x0FFFFFFF; // Mask a for FAT32 entry. Entries are 28 bits.
|
||||
|
||||
/**
|
||||
* \struct directoryEntry
|
||||
* \brief FAT short directory entry
|
||||
@@ -503,54 +476,54 @@ uint32_t const FAT32MASK = 0X0FFFFFFF;
|
||||
* The valid time range is from Midnight 00:00:00 to 23:59:58.
|
||||
*/
|
||||
struct directoryEntry {
|
||||
/** Short 8.3 name.
|
||||
*
|
||||
* The first eight bytes contain the file name with blank fill.
|
||||
* The last three bytes contain the file extension with blank fill.
|
||||
*/
|
||||
/**
|
||||
* Short 8.3 name.
|
||||
*
|
||||
* The first eight bytes contain the file name with blank fill.
|
||||
* The last three bytes contain the file extension with blank fill.
|
||||
*/
|
||||
uint8_t name[11];
|
||||
/** Entry attributes.
|
||||
*
|
||||
* The upper two bits of the attribute byte are reserved and should
|
||||
* always be set to 0 when a file is created and never modified or
|
||||
* looked at after that. See defines that begin with DIR_ATT_.
|
||||
*/
|
||||
/**
|
||||
* Entry attributes.
|
||||
*
|
||||
* The upper two bits of the attribute byte are reserved and should
|
||||
* always be set to 0 when a file is created and never modified or
|
||||
* looked at after that. See defines that begin with DIR_ATT_.
|
||||
*/
|
||||
uint8_t attributes;
|
||||
/**
|
||||
* Reserved for use by Windows NT. Set value to 0 when a file is
|
||||
* created and never modify or look at it after that.
|
||||
*/
|
||||
/**
|
||||
* Reserved for use by Windows NT. Set value to 0 when a file is
|
||||
* created and never modify or look at it after that.
|
||||
*/
|
||||
uint8_t reservedNT;
|
||||
/**
|
||||
* The granularity of the seconds part of creationTime is 2 seconds
|
||||
* so this field is a count of tenths of a second and its valid
|
||||
* value range is 0-199 inclusive. (WHG note - seems to be hundredths)
|
||||
*/
|
||||
/**
|
||||
* The granularity of the seconds part of creationTime is 2 seconds
|
||||
* so this field is a count of tenths of a second and it's valid
|
||||
* value range is 0-199 inclusive. (WHG note - seems to be hundredths)
|
||||
*/
|
||||
uint8_t creationTimeTenths;
|
||||
/** Time file was created. */
|
||||
uint16_t creationTime;
|
||||
/** Date file was created. */
|
||||
uint16_t creationDate;
|
||||
/**
|
||||
* Last access date. Note that there is no last access time, only
|
||||
* a date. This is the date of last read or write. In the case of
|
||||
* a write, this should be set to the same date as lastWriteDate.
|
||||
*/
|
||||
|
||||
uint16_t creationTime; // Time file was created.
|
||||
uint16_t creationDate; // Date file was created.
|
||||
|
||||
/**
|
||||
* Last access date. Note that there is no last access time, only
|
||||
* a date. This is the date of last read or write. In the case of
|
||||
* a write, this should be set to the same date as lastWriteDate.
|
||||
*/
|
||||
uint16_t lastAccessDate;
|
||||
/**
|
||||
* High word of this entry's first cluster number (always 0 for a
|
||||
* FAT12 or FAT16 volume).
|
||||
*/
|
||||
/**
|
||||
* High word of this entry's first cluster number (always 0 for a
|
||||
* FAT12 or FAT16 volume).
|
||||
*/
|
||||
uint16_t firstClusterHigh;
|
||||
/** Time of last write. File creation is considered a write. */
|
||||
uint16_t lastWriteTime;
|
||||
/** Date of last write. File creation is considered a write. */
|
||||
uint16_t lastWriteDate;
|
||||
/** Low word of this entry's first cluster number. */
|
||||
uint16_t firstClusterLow;
|
||||
/** 32-bit unsigned holding this file's size in bytes. */
|
||||
uint32_t fileSize;
|
||||
|
||||
uint16_t lastWriteTime; // Time of last write. File creation is considered a write.
|
||||
uint16_t lastWriteDate; // Date of last write. File creation is considered a write.
|
||||
uint16_t firstClusterLow; // Low word of this entry's first cluster number.
|
||||
uint32_t fileSize; // 32-bit unsigned holding this file's size in bytes.
|
||||
} PACKED;
|
||||
|
||||
/**
|
||||
* \struct directoryVFATEntry
|
||||
* \brief VFAT long filename directory entry
|
||||
@@ -568,54 +541,36 @@ struct directoryVFATEntry {
|
||||
* bit 0-4: the position of this long filename block (first block is 1)
|
||||
*/
|
||||
uint8_t sequenceNumber;
|
||||
/** First set of UTF-16 characters */
|
||||
uint16_t name1[5];//UTF-16
|
||||
/** attributes (at the same location as in directoryEntry), always 0x0F */
|
||||
uint8_t attributes;
|
||||
/** Reserved for use by Windows NT. Always 0. */
|
||||
uint8_t reservedNT;
|
||||
/** Checksum of the short 8.3 filename, can be used to checked if the file system as modified by a not-long-filename aware implementation. */
|
||||
uint8_t checksum;
|
||||
/** Second set of UTF-16 characters */
|
||||
uint16_t name2[6];//UTF-16
|
||||
/** firstClusterLow is always zero for longFilenames */
|
||||
uint16_t firstClusterLow;
|
||||
/** Third set of UTF-16 characters */
|
||||
uint16_t name3[2];//UTF-16
|
||||
|
||||
uint16_t name1[5]; // First set of UTF-16 characters
|
||||
uint8_t attributes; // attributes (at the same location as in directoryEntry), always 0x0F
|
||||
uint8_t reservedNT; // Reserved for use by Windows NT. Always 0.
|
||||
uint8_t checksum; // Checksum of the short 8.3 filename, can be used to checked if the file system as modified by a not-long-filename aware implementation.
|
||||
uint16_t name2[6]; // Second set of UTF-16 characters
|
||||
uint16_t firstClusterLow; // firstClusterLow is always zero for longFilenames
|
||||
uint16_t name3[2]; // Third set of UTF-16 characters
|
||||
} PACKED;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Definitions for directory entries
|
||||
//
|
||||
/** Type name for directoryEntry */
|
||||
typedef struct directoryEntry dir_t;
|
||||
/** Type name for directoryVFATEntry */
|
||||
typedef struct directoryVFATEntry vfat_t;
|
||||
/** escape for name[0] = 0XE5 */
|
||||
uint8_t const DIR_NAME_0XE5 = 0X05;
|
||||
/** name[0] value for entry that is free after being "deleted" */
|
||||
uint8_t const DIR_NAME_DELETED = 0XE5;
|
||||
/** name[0] value for entry that is free and no allocated entries follow */
|
||||
uint8_t const DIR_NAME_FREE = 0X00;
|
||||
/** file is read-only */
|
||||
uint8_t const DIR_ATT_READ_ONLY = 0X01;
|
||||
/** File should hidden in directory listings */
|
||||
uint8_t const DIR_ATT_HIDDEN = 0X02;
|
||||
/** Entry is for a system file */
|
||||
uint8_t const DIR_ATT_SYSTEM = 0X04;
|
||||
/** Directory entry contains the volume label */
|
||||
uint8_t const DIR_ATT_VOLUME_ID = 0X08;
|
||||
/** Entry is for a directory */
|
||||
uint8_t const DIR_ATT_DIRECTORY = 0X10;
|
||||
/** Old DOS archive bit for backup support */
|
||||
uint8_t const DIR_ATT_ARCHIVE = 0X20;
|
||||
/** Test value for long name entry. Test is
|
||||
(d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME. */
|
||||
uint8_t const DIR_ATT_LONG_NAME = 0X0F;
|
||||
/** Test mask for long name entry */
|
||||
uint8_t const DIR_ATT_LONG_NAME_MASK = 0X3F;
|
||||
/** defined attribute bits */
|
||||
uint8_t const DIR_ATT_DEFINED_BITS = 0X3F;
|
||||
/** Directory entry is part of a long name
|
||||
typedef struct directoryEntry dir_t; // Type name for directoryEntry
|
||||
typedef struct directoryVFATEntry vfat_t; // Type name for directoryVFATEntry
|
||||
|
||||
uint8_t const DIR_NAME_0xE5 = 0x05, // escape for name[0] = 0xE5
|
||||
DIR_NAME_DELETED = 0xE5, // name[0] value for entry that is free after being "deleted"
|
||||
DIR_NAME_FREE = 0x00, // name[0] value for entry that is free and no allocated entries follow
|
||||
DIR_ATT_READ_ONLY = 0x01, // file is read-only
|
||||
DIR_ATT_HIDDEN = 0x02, // File should hidden in directory listings
|
||||
DIR_ATT_SYSTEM = 0x04, // Entry is for a system file
|
||||
DIR_ATT_VOLUME_ID = 0x08, // Directory entry contains the volume label
|
||||
DIR_ATT_DIRECTORY = 0x10, // Entry is for a directory
|
||||
DIR_ATT_ARCHIVE = 0x20, // Old DOS archive bit for backup support
|
||||
DIR_ATT_LONG_NAME = 0x0F, // Test value for long name entry. Test is (d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME.
|
||||
DIR_ATT_LONG_NAME_MASK = 0x3F, // Test mask for long name entry
|
||||
DIR_ATT_DEFINED_BITS = 0x3F; // defined attribute bits
|
||||
|
||||
/**
|
||||
* Directory entry is part of a long name
|
||||
* \param[in] dir Pointer to a directory entry.
|
||||
*
|
||||
* \return true if the entry is for part of a long name else false.
|
||||
@@ -623,9 +578,12 @@ uint8_t const DIR_ATT_DEFINED_BITS = 0X3F;
|
||||
static inline uint8_t DIR_IS_LONG_NAME(const dir_t* dir) {
|
||||
return (dir->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME;
|
||||
}
|
||||
|
||||
/** Mask for file/subdirectory tests */
|
||||
uint8_t const DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY);
|
||||
/** Directory entry is for a file
|
||||
|
||||
/**
|
||||
* Directory entry is for a file
|
||||
* \param[in] dir Pointer to a directory entry.
|
||||
*
|
||||
* \return true if the entry is for a normal file else false.
|
||||
@@ -633,7 +591,9 @@ uint8_t const DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY);
|
||||
static inline uint8_t DIR_IS_FILE(const dir_t* dir) {
|
||||
return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == 0;
|
||||
}
|
||||
/** Directory entry is for a subdirectory
|
||||
|
||||
/**
|
||||
* Directory entry is for a subdirectory
|
||||
* \param[in] dir Pointer to a directory entry.
|
||||
*
|
||||
* \return true if the entry is for a subdirectory else false.
|
||||
@@ -641,7 +601,9 @@ static inline uint8_t DIR_IS_FILE(const dir_t* dir) {
|
||||
static inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) {
|
||||
return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == DIR_ATT_DIRECTORY;
|
||||
}
|
||||
/** Directory entry is for a file or subdirectory
|
||||
|
||||
/**
|
||||
* Directory entry is for a file or subdirectory
|
||||
* \param[in] dir Pointer to a directory entry.
|
||||
*
|
||||
* \return true if the entry is for a normal file or subdirectory else false.
|
||||
@@ -649,7 +611,5 @@ static inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) {
|
||||
static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) {
|
||||
return (dir->attributes & DIR_ATT_VOLUME_ID) == 0;
|
||||
}
|
||||
#endif // SdFatStructs_h
|
||||
|
||||
|
||||
#endif
|
||||
#endif // SDFATSTRUCTS_H
|
||||
|
||||
+24
-24
@@ -26,13 +26,15 @@
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#include "SdFatUtil.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** Amount of free RAM
|
||||
#include "SdFatUtil.h"
|
||||
#include "serial.h"
|
||||
|
||||
/**
|
||||
* Amount of free RAM
|
||||
* \return The number of free bytes.
|
||||
*/
|
||||
#ifdef __arm__
|
||||
@@ -44,7 +46,8 @@ int SdFatUtil::FreeRam() {
|
||||
#else // __arm__
|
||||
extern char* __brkval;
|
||||
extern char __bss_end;
|
||||
/** Amount of free RAM
|
||||
/**
|
||||
* Amount of free RAM
|
||||
* \return The number of free bytes.
|
||||
*/
|
||||
int SdFatUtil::FreeRam() {
|
||||
@@ -53,8 +56,8 @@ int SdFatUtil::FreeRam() {
|
||||
}
|
||||
#endif // __arm
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/** %Print a string in flash memory.
|
||||
/**
|
||||
* %Print a string in flash memory.
|
||||
*
|
||||
* \param[in] pr Print object for output.
|
||||
* \param[in] str Pointer to string stored in flash memory.
|
||||
@@ -62,30 +65,27 @@ int SdFatUtil::FreeRam() {
|
||||
void SdFatUtil::print_P(PGM_P str) {
|
||||
for (uint8_t c; (c = pgm_read_byte(str)); str++) MYSERIAL.write(c);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** %Print a string in flash memory followed by a CR/LF.
|
||||
|
||||
/**
|
||||
* %Print a string in flash memory followed by a CR/LF.
|
||||
*
|
||||
* \param[in] pr Print object for output.
|
||||
* \param[in] str Pointer to string stored in flash memory.
|
||||
*/
|
||||
void SdFatUtil::println_P(PGM_P str) {
|
||||
print_P(str);
|
||||
MYSERIAL.println();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** %Print a string in flash memory to Serial.
|
||||
void SdFatUtil::println_P(PGM_P str) { print_P(str); MYSERIAL.println(); }
|
||||
|
||||
/**
|
||||
* %Print a string in flash memory to Serial.
|
||||
*
|
||||
* \param[in] str Pointer to string stored in flash memory.
|
||||
*/
|
||||
void SdFatUtil::SerialPrint_P(PGM_P str) {
|
||||
print_P(str);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** %Print a string in flash memory to Serial followed by a CR/LF.
|
||||
void SdFatUtil::SerialPrint_P(PGM_P str) { print_P(str); }
|
||||
|
||||
/**
|
||||
* %Print a string in flash memory to Serial followed by a CR/LF.
|
||||
*
|
||||
* \param[in] str Pointer to string stored in flash memory.
|
||||
*/
|
||||
void SdFatUtil::SerialPrintln_P(PGM_P str) {
|
||||
println_P(str);
|
||||
}
|
||||
#endif
|
||||
void SdFatUtil::SerialPrintln_P(PGM_P str) { println_P(str); }
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
||||
+3
-8
@@ -26,11 +26,8 @@
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#ifndef SdFatUtil_h
|
||||
#define SdFatUtil_h
|
||||
|
||||
#include "Marlin.h"
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#ifndef _SDFATUTIL_H_
|
||||
#define _SDFATUTIL_H_
|
||||
|
||||
/**
|
||||
* \file
|
||||
@@ -51,6 +48,4 @@ namespace SdFatUtil {
|
||||
|
||||
using namespace SdFatUtil; // NOLINT
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
||||
#endif // SdFatUtil_h
|
||||
#endif // _SDFATUTIL_H_
|
||||
|
||||
+26
-28
@@ -26,21 +26,24 @@
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "SdFile.h"
|
||||
/** Create a file object and open it in the current working directory.
|
||||
|
||||
/**
|
||||
* Create a file object and open it in the current working directory.
|
||||
*
|
||||
* \param[in] path A path with a valid 8.3 DOS name for a file to be opened.
|
||||
*
|
||||
* \param[in] oflag Values for \a oflag are constructed by a bitwise-inclusive
|
||||
* OR of open flags. see SdBaseFile::open(SdBaseFile*, const char*, uint8_t).
|
||||
*/
|
||||
SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) {
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Write data to an open file.
|
||||
SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) { }
|
||||
|
||||
/**
|
||||
* Write data to an open file.
|
||||
*
|
||||
* \note Data is moved to the cache but may not be written to the
|
||||
* storage device until sync() is called.
|
||||
@@ -55,41 +58,37 @@ SdFile::SdFile(const char* path, uint8_t oflag) : SdBaseFile(path, oflag) {
|
||||
* for a read-only file, device is full, a corrupt file system or an I/O error.
|
||||
*
|
||||
*/
|
||||
int16_t SdFile::write(const void* buf, uint16_t nbyte) {
|
||||
return SdBaseFile::write(buf, nbyte);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Write a byte to a file. Required by the Arduino Print class.
|
||||
int16_t SdFile::write(const void* buf, uint16_t nbyte) { return SdBaseFile::write(buf, nbyte); }
|
||||
|
||||
/**
|
||||
* Write a byte to a file. Required by the Arduino Print class.
|
||||
* \param[in] b the byte to be written.
|
||||
* Use writeError to check for errors.
|
||||
*/
|
||||
#if ARDUINO >= 100
|
||||
size_t SdFile::write(uint8_t b) {
|
||||
return SdBaseFile::write(&b, 1);
|
||||
}
|
||||
size_t SdFile::write(uint8_t b) { return SdBaseFile::write(&b, 1); }
|
||||
#else
|
||||
void SdFile::write(uint8_t b) {
|
||||
SdBaseFile::write(&b, 1);
|
||||
}
|
||||
void SdFile::write(uint8_t b) { SdBaseFile::write(&b, 1); }
|
||||
#endif
|
||||
//------------------------------------------------------------------------------
|
||||
/** Write a string to a file. Used by the Arduino Print class.
|
||||
|
||||
/**
|
||||
* Write a string to a file. Used by the Arduino Print class.
|
||||
* \param[in] str Pointer to the string.
|
||||
* Use writeError to check for errors.
|
||||
*/
|
||||
void SdFile::write(const char* str) {
|
||||
SdBaseFile::write(str, strlen(str));
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Write a PROGMEM string to a file.
|
||||
void SdFile::write(const char* str) { SdBaseFile::write(str, strlen(str)); }
|
||||
|
||||
/**
|
||||
* Write a PROGMEM string to a file.
|
||||
* \param[in] str Pointer to the PROGMEM string.
|
||||
* Use writeError to check for errors.
|
||||
*/
|
||||
void SdFile::write_P(PGM_P str) {
|
||||
for (uint8_t c; (c = pgm_read_byte(str)); str++) write(c);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
/** Write a PROGMEM string followed by CR/LF to a file.
|
||||
|
||||
/**
|
||||
* Write a PROGMEM string followed by CR/LF to a file.
|
||||
* \param[in] str Pointer to the PROGMEM string.
|
||||
* Use writeError to check for errors.
|
||||
*/
|
||||
@@ -98,5 +97,4 @@ void SdFile::writeln_P(PGM_P str) {
|
||||
write_P(PSTR("\r\n"));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif // SDSUPPORT
|
||||
|
||||
+9
-12
@@ -20,24 +20,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief SdFile class
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arduino SdFat Library
|
||||
* Copyright (C) 2009 by William Greiman
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
/**
|
||||
* \file
|
||||
* \brief SdFile class
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#ifndef _SDFILE_H_
|
||||
#define _SDFILE_H_
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#include "SdBaseFile.h"
|
||||
#include <Print.h>
|
||||
#ifndef SdFile_h
|
||||
#define SdFile_h
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \class SdFile
|
||||
* \brief SdBaseFile with Print.
|
||||
@@ -57,7 +56,5 @@ class SdFile : public SdBaseFile, public Print {
|
||||
void write_P(PGM_P str);
|
||||
void writeln_P(PGM_P str);
|
||||
};
|
||||
#endif // SdFile_h
|
||||
|
||||
|
||||
#endif
|
||||
#endif // _SDFILE_H_
|
||||
|
||||
+36
-58
@@ -26,12 +26,11 @@
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#ifndef _SDINFO_H_
|
||||
#define _SDINFO_H_
|
||||
|
||||
#ifndef SdInfo_h
|
||||
#define SdInfo_h
|
||||
#include <stdint.h>
|
||||
|
||||
// Based on the document:
|
||||
//
|
||||
// SD Specifications
|
||||
@@ -42,63 +41,43 @@
|
||||
// May 18, 2010
|
||||
//
|
||||
// http://www.sdcard.org/developers/tech/sdcard/pls/simplified_specs
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// SD card commands
|
||||
/** GO_IDLE_STATE - init card in spi mode if CS low */
|
||||
uint8_t const CMD0 = 0X00;
|
||||
/** SEND_IF_COND - verify SD Memory Card interface operating condition.*/
|
||||
uint8_t const CMD8 = 0X08;
|
||||
/** SEND_CSD - read the Card Specific Data (CSD register) */
|
||||
uint8_t const CMD9 = 0X09;
|
||||
/** SEND_CID - read the card identification information (CID register) */
|
||||
uint8_t const CMD10 = 0X0A;
|
||||
/** STOP_TRANSMISSION - end multiple block read sequence */
|
||||
uint8_t const CMD12 = 0X0C;
|
||||
/** SEND_STATUS - read the card status register */
|
||||
uint8_t const CMD13 = 0X0D;
|
||||
/** READ_SINGLE_BLOCK - read a single data block from the card */
|
||||
uint8_t const CMD17 = 0X11;
|
||||
/** READ_MULTIPLE_BLOCK - read a multiple data blocks from the card */
|
||||
uint8_t const CMD18 = 0X12;
|
||||
/** WRITE_BLOCK - write a single data block to the card */
|
||||
uint8_t const CMD24 = 0X18;
|
||||
/** WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION */
|
||||
uint8_t const CMD25 = 0X19;
|
||||
/** ERASE_WR_BLK_START - sets the address of the first block to be erased */
|
||||
uint8_t const CMD32 = 0X20;
|
||||
/** ERASE_WR_BLK_END - sets the address of the last block of the continuous
|
||||
range to be erased*/
|
||||
uint8_t const CMD33 = 0X21;
|
||||
/** ERASE - erase all previously selected blocks */
|
||||
uint8_t const CMD38 = 0X26;
|
||||
/** APP_CMD - escape for application specific command */
|
||||
uint8_t const CMD55 = 0X37;
|
||||
/** READ_OCR - read the OCR register of a card */
|
||||
uint8_t const CMD58 = 0X3A;
|
||||
/** SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be
|
||||
pre-erased before writing */
|
||||
uint8_t const ACMD23 = 0X17;
|
||||
/** SD_SEND_OP_COMD - Sends host capacity support information and
|
||||
activates the card's initialization process */
|
||||
uint8_t const ACMD41 = 0X29;
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t const CMD0 = 0x00, // GO_IDLE_STATE - init card in spi mode if CS low
|
||||
CMD8 = 0x08, // SEND_IF_COND - verify SD Memory Card interface operating condition
|
||||
CMD9 = 0x09, // SEND_CSD - read the Card Specific Data (CSD register)
|
||||
CMD10 = 0x0A, // SEND_CID - read the card identification information (CID register)
|
||||
CMD12 = 0x0C, // STOP_TRANSMISSION - end multiple block read sequence
|
||||
CMD13 = 0x0D, // SEND_STATUS - read the card status register
|
||||
CMD17 = 0x11, // READ_SINGLE_BLOCK - read a single data block from the card
|
||||
CMD18 = 0x12, // READ_MULTIPLE_BLOCK - read a multiple data blocks from the card
|
||||
CMD24 = 0x18, // WRITE_BLOCK - write a single data block to the card
|
||||
CMD25 = 0x19, // WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION
|
||||
CMD32 = 0x20, // ERASE_WR_BLK_START - sets the address of the first block to be erased
|
||||
CMD33 = 0x21, // ERASE_WR_BLK_END - sets the address of the last block of the continuous range to be erased*/
|
||||
CMD38 = 0x26, // ERASE - erase all previously selected blocks */
|
||||
CMD55 = 0x37, // APP_CMD - escape for application specific command */
|
||||
CMD58 = 0x3A, // READ_OCR - read the OCR register of a card */
|
||||
ACMD23 = 0x17, // SET_WR_BLK_ERASE_COUNT - Set the number of write blocks to be pre-erased before writing */
|
||||
ACMD41 = 0x29; // SD_SEND_OP_COMD - Sends host capacity support information and activates the card's initialization process */
|
||||
|
||||
/** status for card in the ready state */
|
||||
uint8_t const R1_READY_STATE = 0X00;
|
||||
uint8_t const R1_READY_STATE = 0x00;
|
||||
/** status for card in the idle state */
|
||||
uint8_t const R1_IDLE_STATE = 0X01;
|
||||
uint8_t const R1_IDLE_STATE = 0x01;
|
||||
/** status bit for illegal command */
|
||||
uint8_t const R1_ILLEGAL_COMMAND = 0X04;
|
||||
uint8_t const R1_ILLEGAL_COMMAND = 0x04;
|
||||
/** start data token for read or write single block*/
|
||||
uint8_t const DATA_START_BLOCK = 0XFE;
|
||||
uint8_t const DATA_START_BLOCK = 0xFE;
|
||||
/** stop token for write multiple blocks*/
|
||||
uint8_t const STOP_TRAN_TOKEN = 0XFD;
|
||||
uint8_t const STOP_TRAN_TOKEN = 0xFD;
|
||||
/** start data token for write multiple blocks*/
|
||||
uint8_t const WRITE_MULTIPLE_TOKEN = 0XFC;
|
||||
uint8_t const WRITE_MULTIPLE_TOKEN = 0xFC;
|
||||
/** mask for data response tokens after a write block operation */
|
||||
uint8_t const DATA_RES_MASK = 0X1F;
|
||||
uint8_t const DATA_RES_MASK = 0x1F;
|
||||
/** write data accepted token */
|
||||
uint8_t const DATA_RES_ACCEPTED = 0X05;
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t const DATA_RES_ACCEPTED = 0x05;
|
||||
|
||||
/** Card IDentification (CID) register */
|
||||
typedef struct CID {
|
||||
// byte 0
|
||||
@@ -134,7 +113,7 @@ typedef struct CID {
|
||||
/** CRC7 checksum */
|
||||
unsigned char crc : 7;
|
||||
} cid_t;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** CSD for version 1.00 cards */
|
||||
typedef struct CSDV1 {
|
||||
// byte 0
|
||||
@@ -196,14 +175,14 @@ typedef struct CSDV1 {
|
||||
unsigned char always1 : 1;
|
||||
unsigned char crc : 7;
|
||||
} csd1_t;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** CSD for version 2.00 cards */
|
||||
typedef struct CSDV2 {
|
||||
// byte 0
|
||||
unsigned char reserved1 : 6;
|
||||
unsigned char csd_ver : 2;
|
||||
// byte 1
|
||||
/** fixed to 0X0E */
|
||||
/** fixed to 0x0E */
|
||||
unsigned char taac;
|
||||
// byte 2
|
||||
/** fixed to 0 */
|
||||
@@ -278,12 +257,11 @@ typedef struct CSDV2 {
|
||||
/** checksum */
|
||||
unsigned char crc : 7;
|
||||
} csd2_t;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** union of old and new style CSD register */
|
||||
union csd_t {
|
||||
csd1_t v1;
|
||||
csd2_t v2;
|
||||
};
|
||||
#endif // SdInfo_h
|
||||
|
||||
#endif
|
||||
#endif // _SDINFO_H_
|
||||
|
||||
+82
-118
@@ -26,11 +26,12 @@
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "SdVolume.h"
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if !USE_MULTIPLE_CARDS
|
||||
// raw block cache
|
||||
uint32_t SdVolume::cacheBlockNumber_; // current block number
|
||||
@@ -39,7 +40,7 @@
|
||||
bool SdVolume::cacheDirty_; // cacheFlush() will write block if true
|
||||
uint32_t SdVolume::cacheMirrorBlock_; // mirror block for second FAT
|
||||
#endif // USE_MULTIPLE_CARDS
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// find a contiguous group of clusters
|
||||
bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) {
|
||||
// start of group
|
||||
@@ -73,14 +74,14 @@ bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) {
|
||||
// search the FAT for free clusters
|
||||
for (uint32_t n = 0;; n++, endCluster++) {
|
||||
// can't find space checked all clusters
|
||||
if (n >= clusterCount_) goto fail;
|
||||
if (n >= clusterCount_) return false;
|
||||
|
||||
// past end - start from beginning of FAT
|
||||
if (endCluster > fatEnd) {
|
||||
bgnCluster = endCluster = 2;
|
||||
}
|
||||
uint32_t f;
|
||||
if (!fatGet(endCluster, &f)) goto fail;
|
||||
if (!fatGet(endCluster, &f)) return false;
|
||||
|
||||
if (f != 0) {
|
||||
// cluster in use try next cluster as bgnCluster
|
||||
@@ -92,16 +93,16 @@ bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) {
|
||||
}
|
||||
}
|
||||
// mark end of chain
|
||||
if (!fatPutEOC(endCluster)) goto fail;
|
||||
if (!fatPutEOC(endCluster)) return false;
|
||||
|
||||
// link clusters
|
||||
while (endCluster > bgnCluster) {
|
||||
if (!fatPut(endCluster - 1, endCluster)) goto fail;
|
||||
if (!fatPut(endCluster - 1, endCluster)) return false;
|
||||
endCluster--;
|
||||
}
|
||||
if (*curCluster != 0) {
|
||||
// connect chains
|
||||
if (!fatPut(*curCluster, bgnCluster)) goto fail;
|
||||
if (!fatPut(*curCluster, bgnCluster)) return false;
|
||||
}
|
||||
// return first cluster number to caller
|
||||
*curCluster = bgnCluster;
|
||||
@@ -110,114 +111,97 @@ bool SdVolume::allocContiguous(uint32_t count, uint32_t* curCluster) {
|
||||
if (setStart) allocSearchStart_ = bgnCluster + 1;
|
||||
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
bool SdVolume::cacheFlush() {
|
||||
if (cacheDirty_) {
|
||||
if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) {
|
||||
goto fail;
|
||||
}
|
||||
if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data))
|
||||
return false;
|
||||
|
||||
// mirror FAT tables
|
||||
if (cacheMirrorBlock_) {
|
||||
if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) {
|
||||
goto fail;
|
||||
}
|
||||
if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data))
|
||||
return false;
|
||||
cacheMirrorBlock_ = 0;
|
||||
}
|
||||
cacheDirty_ = 0;
|
||||
}
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) {
|
||||
if (cacheBlockNumber_ != blockNumber) {
|
||||
if (!cacheFlush()) goto fail;
|
||||
if (!sdCard_->readBlock(blockNumber, cacheBuffer_.data)) goto fail;
|
||||
if (!cacheFlush()) return false;
|
||||
if (!sdCard_->readBlock(blockNumber, cacheBuffer_.data)) return false;
|
||||
cacheBlockNumber_ = blockNumber;
|
||||
}
|
||||
if (dirty) cacheDirty_ = true;
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// return the size in bytes of a cluster chain
|
||||
bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) {
|
||||
uint32_t s = 0;
|
||||
do {
|
||||
if (!fatGet(cluster, &cluster)) goto fail;
|
||||
if (!fatGet(cluster, &cluster)) return false;
|
||||
s += 512UL << clusterSizeShift_;
|
||||
} while (!isEOC(cluster));
|
||||
*size = s;
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Fetch a FAT entry
|
||||
bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) {
|
||||
uint32_t lba;
|
||||
if (cluster > (clusterCount_ + 1)) goto fail;
|
||||
if (cluster > (clusterCount_ + 1)) return false;
|
||||
if (FAT12_SUPPORT && fatType_ == 12) {
|
||||
uint16_t index = cluster;
|
||||
index += index >> 1;
|
||||
lba = fatStartBlock_ + (index >> 9);
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail;
|
||||
index &= 0X1FF;
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_READ)) return false;
|
||||
index &= 0x1FF;
|
||||
uint16_t tmp = cacheBuffer_.data[index];
|
||||
index++;
|
||||
if (index == 512) {
|
||||
if (!cacheRawBlock(lba + 1, CACHE_FOR_READ)) goto fail;
|
||||
if (!cacheRawBlock(lba + 1, CACHE_FOR_READ)) return false;
|
||||
index = 0;
|
||||
}
|
||||
tmp |= cacheBuffer_.data[index] << 8;
|
||||
*value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF;
|
||||
*value = cluster & 1 ? tmp >> 4 : tmp & 0xFFF;
|
||||
return true;
|
||||
}
|
||||
if (fatType_ == 16) {
|
||||
|
||||
if (fatType_ == 16)
|
||||
lba = fatStartBlock_ + (cluster >> 8);
|
||||
}
|
||||
else if (fatType_ == 32) {
|
||||
else if (fatType_ == 32)
|
||||
lba = fatStartBlock_ + (cluster >> 7);
|
||||
}
|
||||
else {
|
||||
goto fail;
|
||||
}
|
||||
if (lba != cacheBlockNumber_) {
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail;
|
||||
}
|
||||
if (fatType_ == 16) {
|
||||
*value = cacheBuffer_.fat16[cluster & 0XFF];
|
||||
}
|
||||
else {
|
||||
*value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
if (lba != cacheBlockNumber_ && !cacheRawBlock(lba, CACHE_FOR_READ))
|
||||
return false;
|
||||
|
||||
*value = (fatType_ == 16) ? cacheBuffer_.fat16[cluster & 0xFF] : (cacheBuffer_.fat32[cluster & 0x7F] & FAT32MASK);
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Store a FAT entry
|
||||
bool SdVolume::fatPut(uint32_t cluster, uint32_t value) {
|
||||
uint32_t lba;
|
||||
// error if reserved cluster
|
||||
if (cluster < 2) goto fail;
|
||||
if (cluster < 2) return false;
|
||||
|
||||
// error if not in FAT
|
||||
if (cluster > (clusterCount_ + 1)) goto fail;
|
||||
if (cluster > (clusterCount_ + 1)) return false;
|
||||
|
||||
if (FAT12_SUPPORT && fatType_ == 12) {
|
||||
uint16_t index = cluster;
|
||||
index += index >> 1;
|
||||
lba = fatStartBlock_ + (index >> 9);
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail;
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false;
|
||||
// mirror second FAT
|
||||
if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_;
|
||||
index &= 0X1FF;
|
||||
index &= 0x1FF;
|
||||
uint8_t tmp = value;
|
||||
if (cluster & 1) {
|
||||
tmp = (cacheBuffer_.data[index] & 0XF) | tmp << 4;
|
||||
@@ -227,62 +211,56 @@ bool SdVolume::fatPut(uint32_t cluster, uint32_t value) {
|
||||
if (index == 512) {
|
||||
lba++;
|
||||
index = 0;
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail;
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false;
|
||||
// mirror second FAT
|
||||
if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_;
|
||||
}
|
||||
tmp = value >> 4;
|
||||
if (!(cluster & 1)) {
|
||||
tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4;
|
||||
tmp = ((cacheBuffer_.data[index] & 0xF0)) | tmp >> 4;
|
||||
}
|
||||
cacheBuffer_.data[index] = tmp;
|
||||
return true;
|
||||
}
|
||||
if (fatType_ == 16) {
|
||||
|
||||
if (fatType_ == 16)
|
||||
lba = fatStartBlock_ + (cluster >> 8);
|
||||
}
|
||||
else if (fatType_ == 32) {
|
||||
else if (fatType_ == 32)
|
||||
lba = fatStartBlock_ + (cluster >> 7);
|
||||
}
|
||||
else {
|
||||
goto fail;
|
||||
}
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail;
|
||||
else
|
||||
return false;
|
||||
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) return false;
|
||||
|
||||
// store entry
|
||||
if (fatType_ == 16) {
|
||||
cacheBuffer_.fat16[cluster & 0XFF] = value;
|
||||
}
|
||||
else {
|
||||
cacheBuffer_.fat32[cluster & 0X7F] = value;
|
||||
}
|
||||
if (fatType_ == 16)
|
||||
cacheBuffer_.fat16[cluster & 0xFF] = value;
|
||||
else
|
||||
cacheBuffer_.fat32[cluster & 0x7F] = value;
|
||||
|
||||
// mirror second FAT
|
||||
if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_;
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// free a cluster chain
|
||||
bool SdVolume::freeChain(uint32_t cluster) {
|
||||
uint32_t next;
|
||||
|
||||
// clear free cluster location
|
||||
allocSearchStart_ = 2;
|
||||
|
||||
do {
|
||||
if (!fatGet(cluster, &next)) goto fail;
|
||||
uint32_t next;
|
||||
if (!fatGet(cluster, &next)) return false;
|
||||
|
||||
// free cluster
|
||||
if (!fatPut(cluster, 0)) goto fail;
|
||||
if (!fatPut(cluster, 0)) return false;
|
||||
|
||||
cluster = next;
|
||||
} while (!isEOC(cluster));
|
||||
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Volume free space in clusters.
|
||||
*
|
||||
* \return Count of free clusters for success or -1 if an error occurs.
|
||||
@@ -292,34 +270,28 @@ int32_t SdVolume::freeClusterCount() {
|
||||
uint16_t n;
|
||||
uint32_t todo = clusterCount_ + 2;
|
||||
|
||||
if (fatType_ == 16) {
|
||||
if (fatType_ == 16)
|
||||
n = 256;
|
||||
}
|
||||
else if (fatType_ == 32) {
|
||||
else if (fatType_ == 32)
|
||||
n = 128;
|
||||
}
|
||||
else {
|
||||
// put FAT12 here
|
||||
else // put FAT12 here
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (uint32_t lba = fatStartBlock_; todo; todo -= n, lba++) {
|
||||
if (!cacheRawBlock(lba, CACHE_FOR_READ)) return -1;
|
||||
NOMORE(n, todo);
|
||||
if (fatType_ == 16) {
|
||||
for (uint16_t i = 0; i < n; i++) {
|
||||
for (uint16_t i = 0; i < n; i++)
|
||||
if (cacheBuffer_.fat16[i] == 0) free++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (uint16_t i = 0; i < n; i++) {
|
||||
for (uint16_t i = 0; i < n; i++)
|
||||
if (cacheBuffer_.fat32[i] == 0) free++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return free;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Initialize a FAT volume.
|
||||
*
|
||||
* \param[in] dev The SD card where the volume is located.
|
||||
@@ -329,14 +301,12 @@ int32_t SdVolume::freeClusterCount() {
|
||||
* a MBR, Master Boot Record, or zero if the device is formatted as
|
||||
* a super floppy with the FAT boot sector in block zero.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure. Reasons for
|
||||
* failure include not finding a valid partition, not finding a valid
|
||||
* \return true for success, false for failure.
|
||||
* Reasons for failure include not finding a valid partition, not finding a valid
|
||||
* FAT file system in the specified partition or an I/O error.
|
||||
*/
|
||||
bool SdVolume::init(Sd2Card* dev, uint8_t part) {
|
||||
uint32_t totalBlocks;
|
||||
uint32_t volumeStartBlock = 0;
|
||||
uint32_t totalBlocks, volumeStartBlock = 0;
|
||||
fat32_boot_t* fbs;
|
||||
|
||||
sdCard_ = dev;
|
||||
@@ -344,30 +314,26 @@ bool SdVolume::init(Sd2Card* dev, uint8_t part) {
|
||||
allocSearchStart_ = 2;
|
||||
cacheDirty_ = 0; // cacheFlush() will write block if true
|
||||
cacheMirrorBlock_ = 0;
|
||||
cacheBlockNumber_ = 0XFFFFFFFF;
|
||||
cacheBlockNumber_ = 0xFFFFFFFF;
|
||||
|
||||
// if part == 0 assume super floppy with FAT boot sector in block zero
|
||||
// if part > 0 assume mbr volume with partition table
|
||||
if (part) {
|
||||
if (part > 4)goto fail;
|
||||
if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail;
|
||||
if (part > 4) return false;
|
||||
if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false;
|
||||
part_t* p = &cacheBuffer_.mbr.part[part - 1];
|
||||
if ((p->boot & 0X7F) != 0 ||
|
||||
p->totalSectors < 100 ||
|
||||
p->firstSector == 0) {
|
||||
// not a valid partition
|
||||
goto fail;
|
||||
}
|
||||
if ((p->boot & 0x7F) != 0 || p->totalSectors < 100 || p->firstSector == 0)
|
||||
return false; // not a valid partition
|
||||
volumeStartBlock = p->firstSector;
|
||||
}
|
||||
if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail;
|
||||
if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) return false;
|
||||
fbs = &cacheBuffer_.fbs32;
|
||||
if (fbs->bytesPerSector != 512 ||
|
||||
fbs->fatCount == 0 ||
|
||||
fbs->reservedSectorCount == 0 ||
|
||||
fbs->sectorsPerCluster == 0) {
|
||||
// not valid FAT volume
|
||||
goto fail;
|
||||
return false;
|
||||
}
|
||||
fatCount_ = fbs->fatCount;
|
||||
blocksPerCluster_ = fbs->sectorsPerCluster;
|
||||
@@ -375,7 +341,7 @@ bool SdVolume::init(Sd2Card* dev, uint8_t part) {
|
||||
clusterSizeShift_ = 0;
|
||||
while (blocksPerCluster_ != _BV(clusterSizeShift_)) {
|
||||
// error if not power of 2
|
||||
if (clusterSizeShift_++ > 7) goto fail;
|
||||
if (clusterSizeShift_++ > 7) return false;
|
||||
}
|
||||
blocksPerFat_ = fbs->sectorsPerFat16 ?
|
||||
fbs->sectorsPerFat16 : fbs->sectorsPerFat32;
|
||||
@@ -404,17 +370,15 @@ bool SdVolume::init(Sd2Card* dev, uint8_t part) {
|
||||
// FAT type is determined by cluster count
|
||||
if (clusterCount_ < 4085) {
|
||||
fatType_ = 12;
|
||||
if (!FAT12_SUPPORT) goto fail;
|
||||
if (!FAT12_SUPPORT) return false;
|
||||
}
|
||||
else if (clusterCount_ < 65525) {
|
||||
else if (clusterCount_ < 65525)
|
||||
fatType_ = 16;
|
||||
}
|
||||
else {
|
||||
rootDirStart_ = fbs->fat32RootCluster;
|
||||
fatType_ = 32;
|
||||
}
|
||||
return true;
|
||||
fail:
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
||||
+106
-122
@@ -20,20 +20,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief SdVolume class
|
||||
*/
|
||||
|
||||
/**
|
||||
* Arduino SdFat Library
|
||||
* Copyright (C) 2009 by William Greiman
|
||||
*
|
||||
* This file is part of the Arduino Sd2Card Library
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#ifndef SdVolume_h
|
||||
#define SdVolume_h
|
||||
/**
|
||||
* \file
|
||||
* \brief SdVolume class
|
||||
*/
|
||||
#ifndef _SDVOLUME_H_
|
||||
#define _SDVOLUME_H_
|
||||
|
||||
#include "SdFatConfig.h"
|
||||
#include "Sd2Card.h"
|
||||
#include "SdFatStructs.h"
|
||||
@@ -44,89 +44,81 @@
|
||||
* \brief Cache for an SD data block
|
||||
*/
|
||||
union cache_t {
|
||||
/** Used to access cached file data blocks. */
|
||||
uint8_t data[512];
|
||||
/** Used to access cached FAT16 entries. */
|
||||
uint16_t fat16[256];
|
||||
/** Used to access cached FAT32 entries. */
|
||||
uint32_t fat32[128];
|
||||
/** Used to access cached directory entries. */
|
||||
dir_t dir[16];
|
||||
/** Used to access a cached Master Boot Record. */
|
||||
mbr_t mbr;
|
||||
/** Used to access to a cached FAT boot sector. */
|
||||
fat_boot_t fbs;
|
||||
/** Used to access to a cached FAT32 boot sector. */
|
||||
fat32_boot_t fbs32;
|
||||
/** Used to access to a cached FAT32 FSINFO sector. */
|
||||
fat32_fsinfo_t fsinfo;
|
||||
uint8_t data[512]; // Used to access cached file data blocks.
|
||||
uint16_t fat16[256]; // Used to access cached FAT16 entries.
|
||||
uint32_t fat32[128]; // Used to access cached FAT32 entries.
|
||||
dir_t dir[16]; // Used to access cached directory entries.
|
||||
mbr_t mbr; // Used to access a cached Master Boot Record.
|
||||
fat_boot_t fbs; // Used to access to a cached FAT boot sector.
|
||||
fat32_boot_t fbs32; // Used to access to a cached FAT32 boot sector.
|
||||
fat32_fsinfo_t fsinfo; // Used to access to a cached FAT32 FSINFO sector.
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \class SdVolume
|
||||
* \brief Access FAT16 and FAT32 volumes on SD and SDHC cards.
|
||||
*/
|
||||
class SdVolume {
|
||||
public:
|
||||
/** Create an instance of SdVolume */
|
||||
// Create an instance of SdVolume
|
||||
SdVolume() : fatType_(0) {}
|
||||
/** Clear the cache and returns a pointer to the cache. Used by the WaveRP
|
||||
/**
|
||||
* Clear the cache and returns a pointer to the cache. Used by the WaveRP
|
||||
* recorder to do raw write to the SD card. Not for normal apps.
|
||||
* \return A pointer to the cache buffer or zero if an error occurs.
|
||||
*/
|
||||
cache_t* cacheClear() {
|
||||
if (!cacheFlush()) return 0;
|
||||
cacheBlockNumber_ = 0XFFFFFFFF;
|
||||
cacheBlockNumber_ = 0xFFFFFFFF;
|
||||
return &cacheBuffer_;
|
||||
}
|
||||
/** Initialize a FAT volume. Try partition one first then try super
|
||||
|
||||
/**
|
||||
* Initialize a FAT volume. Try partition one first then try super
|
||||
* floppy format.
|
||||
*
|
||||
* \param[in] dev The Sd2Card where the volume is located.
|
||||
*
|
||||
* \return The value one, true, is returned for success and
|
||||
* the value zero, false, is returned for failure. Reasons for
|
||||
* failure include not finding a valid partition, not finding a valid
|
||||
* FAT file system or an I/O error.
|
||||
* \return true for success, false for failure.
|
||||
* Reasons for failure include not finding a valid partition, not finding
|
||||
* a valid FAT file system or an I/O error.
|
||||
*/
|
||||
bool init(Sd2Card* dev) { return init(dev, 1) ? true : init(dev, 0);}
|
||||
bool init(Sd2Card* dev) { return init(dev, 1) ? true : init(dev, 0); }
|
||||
bool init(Sd2Card* dev, uint8_t part);
|
||||
|
||||
// inline functions that return volume info
|
||||
/** \return The volume's cluster size in blocks. */
|
||||
uint8_t blocksPerCluster() const {return blocksPerCluster_;}
|
||||
/** \return The number of blocks in one FAT. */
|
||||
uint32_t blocksPerFat() const {return blocksPerFat_;}
|
||||
/** \return The total number of clusters in the volume. */
|
||||
uint32_t clusterCount() const {return clusterCount_;}
|
||||
/** \return The shift count required to multiply by blocksPerCluster. */
|
||||
uint8_t clusterSizeShift() const {return clusterSizeShift_;}
|
||||
/** \return The logical block number for the start of file data. */
|
||||
uint32_t dataStartBlock() const {return dataStartBlock_;}
|
||||
/** \return The number of FAT structures on the volume. */
|
||||
uint8_t fatCount() const {return fatCount_;}
|
||||
/** \return The logical block number for the start of the first FAT. */
|
||||
uint32_t fatStartBlock() const {return fatStartBlock_;}
|
||||
/** \return The FAT type of the volume. Values are 12, 16 or 32. */
|
||||
uint8_t fatType() const {return fatType_;}
|
||||
uint8_t blocksPerCluster() const { return blocksPerCluster_; } //> \return The volume's cluster size in blocks.
|
||||
uint32_t blocksPerFat() const { return blocksPerFat_; } //> \return The number of blocks in one FAT.
|
||||
uint32_t clusterCount() const { return clusterCount_; } //> \return The total number of clusters in the volume.
|
||||
uint8_t clusterSizeShift() const { return clusterSizeShift_; } //> \return The shift count required to multiply by blocksPerCluster.
|
||||
uint32_t dataStartBlock() const { return dataStartBlock_; } //> \return The logical block number for the start of file data.
|
||||
uint8_t fatCount() const { return fatCount_; } //> \return The number of FAT structures on the volume.
|
||||
uint32_t fatStartBlock() const { return fatStartBlock_; } //> \return The logical block number for the start of the first FAT.
|
||||
uint8_t fatType() const { return fatType_; } //> \return The FAT type of the volume. Values are 12, 16 or 32.
|
||||
int32_t freeClusterCount();
|
||||
/** \return The number of entries in the root directory for FAT16 volumes. */
|
||||
uint32_t rootDirEntryCount() const {return rootDirEntryCount_;}
|
||||
/** \return The logical block number for the start of the root directory
|
||||
on FAT16 volumes or the first cluster number on FAT32 volumes. */
|
||||
uint32_t rootDirStart() const {return rootDirStart_;}
|
||||
/** Sd2Card object for this volume
|
||||
uint32_t rootDirEntryCount() const { return rootDirEntryCount_; } /** \return The number of entries in the root directory for FAT16 volumes. */
|
||||
|
||||
/**
|
||||
* \return The logical block number for the start of the root directory
|
||||
* on FAT16 volumes or the first cluster number on FAT32 volumes.
|
||||
*/
|
||||
uint32_t rootDirStart() const { return rootDirStart_; }
|
||||
|
||||
/**
|
||||
* Sd2Card object for this volume
|
||||
* \return pointer to Sd2Card object.
|
||||
*/
|
||||
Sd2Card* sdCard() {return sdCard_;}
|
||||
/** Debug access to FAT table
|
||||
Sd2Card* sdCard() { return sdCard_; }
|
||||
|
||||
/**
|
||||
* Debug access to FAT table
|
||||
*
|
||||
* \param[in] n cluster number.
|
||||
* \param[out] v value of entry
|
||||
* \return true for success or false for failure
|
||||
*/
|
||||
bool dbgFat(uint32_t n, uint32_t* v) {return fatGet(n, v);}
|
||||
//------------------------------------------------------------------------------
|
||||
bool dbgFat(uint32_t n, uint32_t* v) { return fatGet(n, v); }
|
||||
|
||||
private:
|
||||
// Allow SdBaseFile access to SdVolume private data.
|
||||
friend class SdBaseFile;
|
||||
@@ -136,19 +128,20 @@ class SdVolume {
|
||||
// value for dirty argument in cacheRawBlock to indicate write to cache
|
||||
static bool const CACHE_FOR_WRITE = true;
|
||||
|
||||
#if USE_MULTIPLE_CARDS
|
||||
cache_t cacheBuffer_; // 512 byte cache for device blocks
|
||||
uint32_t cacheBlockNumber_; // Logical number of block in the cache
|
||||
Sd2Card* sdCard_; // Sd2Card object for cache
|
||||
bool cacheDirty_; // cacheFlush() will write block if true
|
||||
uint32_t cacheMirrorBlock_; // block number for mirror FAT
|
||||
#else // USE_MULTIPLE_CARDS
|
||||
static cache_t cacheBuffer_; // 512 byte cache for device blocks
|
||||
static uint32_t cacheBlockNumber_; // Logical number of block in the cache
|
||||
static Sd2Card* sdCard_; // Sd2Card object for cache
|
||||
static bool cacheDirty_; // cacheFlush() will write block if true
|
||||
static uint32_t cacheMirrorBlock_; // block number for mirror FAT
|
||||
#endif // USE_MULTIPLE_CARDS
|
||||
#if USE_MULTIPLE_CARDS
|
||||
cache_t cacheBuffer_; // 512 byte cache for device blocks
|
||||
uint32_t cacheBlockNumber_; // Logical number of block in the cache
|
||||
Sd2Card* sdCard_; // Sd2Card object for cache
|
||||
bool cacheDirty_; // cacheFlush() will write block if true
|
||||
uint32_t cacheMirrorBlock_; // block number for mirror FAT
|
||||
#else
|
||||
static cache_t cacheBuffer_; // 512 byte cache for device blocks
|
||||
static uint32_t cacheBlockNumber_; // Logical number of block in the cache
|
||||
static Sd2Card* sdCard_; // Sd2Card object for cache
|
||||
static bool cacheDirty_; // cacheFlush() will write block if true
|
||||
static uint32_t cacheMirrorBlock_; // block number for mirror FAT
|
||||
#endif
|
||||
|
||||
uint32_t allocSearchStart_; // start cluster for alloc search
|
||||
uint8_t blocksPerCluster_; // cluster size in blocks
|
||||
uint32_t blocksPerFat_; // FAT size in blocks
|
||||
@@ -160,68 +153,59 @@ class SdVolume {
|
||||
uint8_t fatType_; // volume type (12, 16, OR 32)
|
||||
uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir
|
||||
uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
bool allocContiguous(uint32_t count, uint32_t* curCluster);
|
||||
uint8_t blockOfCluster(uint32_t position) const {
|
||||
return (position >> 9) & (blocksPerCluster_ - 1);
|
||||
}
|
||||
uint32_t clusterStartBlock(uint32_t cluster) const {
|
||||
return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);
|
||||
}
|
||||
uint32_t blockNumber(uint32_t cluster, uint32_t position) const {
|
||||
return clusterStartBlock(cluster) + blockOfCluster(position);
|
||||
}
|
||||
cache_t* cache() {return &cacheBuffer_;}
|
||||
uint32_t cacheBlockNumber() {return cacheBlockNumber_;}
|
||||
#if USE_MULTIPLE_CARDS
|
||||
bool cacheFlush();
|
||||
bool cacheRawBlock(uint32_t blockNumber, bool dirty);
|
||||
#else // USE_MULTIPLE_CARDS
|
||||
static bool cacheFlush();
|
||||
static bool cacheRawBlock(uint32_t blockNumber, bool dirty);
|
||||
#endif // USE_MULTIPLE_CARDS
|
||||
uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1); }
|
||||
uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_); }
|
||||
uint32_t blockNumber(uint32_t cluster, uint32_t position) const { return clusterStartBlock(cluster) + blockOfCluster(position); }
|
||||
|
||||
cache_t* cache() { return &cacheBuffer_; }
|
||||
uint32_t cacheBlockNumber() const { return cacheBlockNumber_; }
|
||||
|
||||
#if USE_MULTIPLE_CARDS
|
||||
bool cacheFlush();
|
||||
bool cacheRawBlock(uint32_t blockNumber, bool dirty);
|
||||
#else
|
||||
static bool cacheFlush();
|
||||
static bool cacheRawBlock(uint32_t blockNumber, bool dirty);
|
||||
#endif
|
||||
|
||||
// used by SdBaseFile write to assign cache to SD location
|
||||
void cacheSetBlockNumber(uint32_t blockNumber, bool dirty) {
|
||||
cacheDirty_ = dirty;
|
||||
cacheBlockNumber_ = blockNumber;
|
||||
}
|
||||
void cacheSetDirty() {cacheDirty_ |= CACHE_FOR_WRITE;}
|
||||
void cacheSetDirty() { cacheDirty_ |= CACHE_FOR_WRITE; }
|
||||
bool chainSize(uint32_t beginCluster, uint32_t* size);
|
||||
bool fatGet(uint32_t cluster, uint32_t* value);
|
||||
bool fatPut(uint32_t cluster, uint32_t value);
|
||||
bool fatPutEOC(uint32_t cluster) {
|
||||
return fatPut(cluster, 0x0FFFFFFF);
|
||||
}
|
||||
bool fatPutEOC(uint32_t cluster) { return fatPut(cluster, 0x0FFFFFFF); }
|
||||
bool freeChain(uint32_t cluster);
|
||||
bool isEOC(uint32_t cluster) const {
|
||||
if (FAT12_SUPPORT && fatType_ == 12) return cluster >= FAT12EOC_MIN;
|
||||
if (fatType_ == 16) return cluster >= FAT16EOC_MIN;
|
||||
return cluster >= FAT32EOC_MIN;
|
||||
}
|
||||
bool readBlock(uint32_t block, uint8_t* dst) {
|
||||
return sdCard_->readBlock(block, dst);
|
||||
}
|
||||
bool writeBlock(uint32_t block, const uint8_t* dst) {
|
||||
return sdCard_->writeBlock(block, dst);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
// Deprecated functions - suppress cpplint warnings with NOLINT comment
|
||||
#if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN)
|
||||
public:
|
||||
/** \deprecated Use: bool SdVolume::init(Sd2Card* dev);
|
||||
* \param[in] dev The SD card where the volume is located.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool init(Sd2Card& dev) {return init(&dev);} // NOLINT
|
||||
/** \deprecated Use: bool SdVolume::init(Sd2Card* dev, uint8_t vol);
|
||||
* \param[in] dev The SD card where the volume is located.
|
||||
* \param[in] part The partition to be used.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool init(Sd2Card& dev, uint8_t part) { // NOLINT
|
||||
return init(&dev, part);
|
||||
}
|
||||
#endif // ALLOW_DEPRECATED_FUNCTIONS
|
||||
bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst); }
|
||||
bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); }
|
||||
|
||||
// Deprecated functions
|
||||
#if ALLOW_DEPRECATED_FUNCTIONS
|
||||
public:
|
||||
/**
|
||||
* \deprecated Use: bool SdVolume::init(Sd2Card* dev);
|
||||
* \param[in] dev The SD card where the volume is located.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool init(Sd2Card& dev) { return init(&dev); }
|
||||
/**
|
||||
* \deprecated Use: bool SdVolume::init(Sd2Card* dev, uint8_t vol);
|
||||
* \param[in] dev The SD card where the volume is located.
|
||||
* \param[in] part The partition to be used.
|
||||
* \return true for success or false for failure.
|
||||
*/
|
||||
bool init(Sd2Card& dev, uint8_t part) { return init(&dev, part); }
|
||||
#endif // ALLOW_DEPRECATED_FUNCTIONS
|
||||
};
|
||||
#endif // SdVolume
|
||||
#endif
|
||||
|
||||
#endif // _SDVOLUME_H_
|
||||
|
||||
+4
-4
@@ -35,7 +35,7 @@
|
||||
/**
|
||||
* Marlin release version identifier
|
||||
*/
|
||||
#define SHORT_BUILD_VERSION "1.1.0"
|
||||
#define SHORT_BUILD_VERSION "1.1.8"
|
||||
|
||||
/**
|
||||
* Verbose version identifier which should contain a reference to the location
|
||||
@@ -48,7 +48,7 @@
|
||||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
#define STRING_DISTRIBUTION_DATE "2017-05-04 12:00"
|
||||
#define STRING_DISTRIBUTION_DATE "2017-12-25 12:00"
|
||||
|
||||
/**
|
||||
* Required minimum Configuration.h and Configuration_adv.h file versions.
|
||||
@@ -57,8 +57,8 @@
|
||||
* but not limited to: ADD, DELETE RENAME OR REPURPOSE any directive/option on
|
||||
* the configuration files.
|
||||
*/
|
||||
#define REQUIRED_CONFIGURATION_H_VERSION 010100
|
||||
#define REQUIRED_CONFIGURATION_ADV_H_VERSION 010100
|
||||
#define REQUIRED_CONFIGURATION_H_VERSION 010107
|
||||
#define REQUIRED_CONFIGURATION_ADV_H_VERSION 010107
|
||||
|
||||
/**
|
||||
* The protocol for communication to the host. Protocol indicates communication
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016, 2017 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BITMAP_FLAGS_H_
|
||||
#define _BITMAP_FLAGS_H_
|
||||
|
||||
#include "macros.h"
|
||||
|
||||
/**
|
||||
* These support functions allow the use of large bit arrays of flags that take very
|
||||
* little RAM. Currently they are limited to being 16x16 in size. Changing the declaration
|
||||
* to unsigned long will allow us to go to 32x32 if higher resolution meshes are needed
|
||||
* in the future.
|
||||
*/
|
||||
FORCE_INLINE void bitmap_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); }
|
||||
FORCE_INLINE void bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); }
|
||||
FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); }
|
||||
|
||||
#endif // _BITMAP_FLAGS_H_
|
||||
+9
-9
@@ -21,26 +21,26 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* blinkm.cpp - Library for controlling a BlinkM over i2c
|
||||
* Created by Tim Koster, August 21 2013.
|
||||
* blinkm.cpp - Control a BlinkM over i2c
|
||||
*/
|
||||
|
||||
#include "Marlin.h"
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if ENABLED(BLINKM)
|
||||
|
||||
#include "blinkm.h"
|
||||
#include "leds.h"
|
||||
#include <Wire.h>
|
||||
|
||||
void SendColors(byte red, byte grn, byte blu) {
|
||||
void blinkm_set_led_color(const LEDColor &color) {
|
||||
Wire.begin();
|
||||
Wire.beginTransmission(0x09);
|
||||
Wire.write('o'); //to disable ongoing script, only needs to be used once
|
||||
Wire.write('n');
|
||||
Wire.write(red);
|
||||
Wire.write(grn);
|
||||
Wire.write(blu);
|
||||
Wire.write(color.r);
|
||||
Wire.write(color.g);
|
||||
Wire.write(color.b);
|
||||
Wire.endTransmission();
|
||||
}
|
||||
|
||||
#endif //BLINKM
|
||||
|
||||
#endif // BLINKM
|
||||
|
||||
+9
-5
@@ -21,11 +21,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* blinkm.h - Library for controlling a BlinkM over i2c
|
||||
* Created by Tim Koster, August 21 2013.
|
||||
* blinkm.h - Control a BlinkM over i2c
|
||||
*/
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
#ifndef _BLINKM_H_
|
||||
#define _BLINKM_H_
|
||||
|
||||
void SendColors(byte red, byte grn, byte blu);
|
||||
struct LEDColor;
|
||||
typedef LEDColor LEDColor;
|
||||
|
||||
void blinkm_set_led_color(const LEDColor &color);
|
||||
|
||||
#endif // _BLINKM_H_
|
||||
|
||||
+122
-71
@@ -25,77 +25,128 @@
|
||||
|
||||
#define BOARD_UNKNOWN -1
|
||||
|
||||
#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
|
||||
#define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2
|
||||
#define BOARD_GEN7_13 12 // Gen7 v1.3
|
||||
#define BOARD_GEN7_14 13 // Gen7 v1.4
|
||||
#define BOARD_CNCONTROLS_11 111 // Cartesio CN Controls V11
|
||||
#define BOARD_CNCONTROLS_12 112 // Cartesio CN Controls V12
|
||||
#define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0
|
||||
#define BOARD_CHEAPTRONIC_V2 21 // Cheaptronic v2.0
|
||||
#define BOARD_SETHI 20 // Sethi 3D_1
|
||||
#define BOARD_MIGHTYBOARD_REVE 200 // Makerbot Mightyboard Revision E
|
||||
#define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2
|
||||
#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 (Power outputs: Hotend, Fan, Bed)
|
||||
#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed)
|
||||
#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1)
|
||||
#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan)
|
||||
#define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 (Power outputs: Spindle, Controller Fan)
|
||||
#define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like)
|
||||
#define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard
|
||||
#define BOARD_RIGIDBOARD_V2 52 // Invent-A-Part RigidBoard V2
|
||||
#define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Hotend, Fan, Bed)
|
||||
#define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed)
|
||||
#define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1)
|
||||
#define BOARD_RAMPS_14_EEF 46 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan)
|
||||
#define BOARD_RAMPS_14_SF 48 // RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
|
||||
#define BOARD_GEN6 5 // Gen6
|
||||
#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe
|
||||
#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2
|
||||
#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above
|
||||
#define BOARD_MELZI 63 // Melzi
|
||||
#define BOARD_STB_11 64 // STB V1.1
|
||||
#define BOARD_AZTEEG_X1 65 // Azteeg X1
|
||||
#define BOARD_MELZI_MAKR3D 66 // Melzi with ATmega1284 (MaKr3d version)
|
||||
#define BOARD_AZTEEG_X3 67 // Azteeg X3
|
||||
#define BOARD_AZTEEG_X3_PRO 68 // Azteeg X3 Pro
|
||||
#define BOARD_ULTIMAKER 7 // Ultimaker
|
||||
#define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
|
||||
#define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
|
||||
#define BOARD_3DRAG 77 // 3Drag Controller
|
||||
#define BOARD_K8200 78 // Velleman K8200 Controller (derived from 3Drag Controller)
|
||||
#define BOARD_K8400 79 // Velleman K8400 Controller (derived from 3Drag Controller)
|
||||
#define BOARD_TEENSYLU 8 // Teensylu
|
||||
#define BOARD_RUMBA 80 // Rumba
|
||||
#define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286)
|
||||
#define BOARD_PRINTRBOARD_REVF 811 // Printrboard Revision F (AT90USB1286)
|
||||
#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646)
|
||||
#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286)
|
||||
#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84 make
|
||||
#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286)
|
||||
#define BOARD_GEN3_PLUS 9 // Gen3+
|
||||
#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics
|
||||
#define BOARD_MEGATRONICS 70 // Megatronics
|
||||
#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0
|
||||
#define BOARD_MINITRONICS 702 // Minitronics v1.0/1.1
|
||||
#define BOARD_MEGATRONICS_3 703 // Megatronics v3.0
|
||||
#define BOARD_MEGATRONICS_31 704 // Megatronics v3.1
|
||||
#define BOARD_OMCA_A 90 // Alpha OMCA board
|
||||
#define BOARD_OMCA 91 // Final OMCA board
|
||||
#define BOARD_RAMBO 301 // Rambo
|
||||
#define BOARD_MINIRAMBO 302 // Mini-Rambo
|
||||
#define BOARD_SCOOVO_X9H 303 // abee Scoovo X9H
|
||||
#define BOARD_MEGACONTROLLER 310 // Mega controller
|
||||
#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3)
|
||||
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board
|
||||
#define BOARD_LEAPFROG 999 // Leapfrog
|
||||
#define BOARD_MKS_BASE 40 // MKS BASE 1.0
|
||||
#define BOARD_MKS_13 47 // MKS v1.3 or 1.4 (maybe higher)
|
||||
#define BOARD_SAINSMART_2IN1 49 // Sainsmart 2-in-1 board
|
||||
#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers
|
||||
#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers
|
||||
#define BOARD_BQ_ZUM_MEGA_3D 503 // bq ZUM Mega 3D
|
||||
//
|
||||
// RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560
|
||||
//
|
||||
|
||||
#define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2
|
||||
|
||||
#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 (Power outputs: Hotend, Fan, Bed)
|
||||
#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed)
|
||||
#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1)
|
||||
#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan)
|
||||
#define BOARD_RAMPS_13_SF 38 // RAMPS 1.3 (Power outputs: Spindle, Controller Fan)
|
||||
|
||||
#define BOARD_RAMPS_14_EFB 43 // RAMPS 1.4 (Power outputs: Hotend, Fan, Bed)
|
||||
#define BOARD_RAMPS_14_EEB 44 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed)
|
||||
#define BOARD_RAMPS_14_EFF 45 // RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1)
|
||||
#define BOARD_RAMPS_14_EEF 46 // RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan)
|
||||
#define BOARD_RAMPS_14_SF 48 // RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
|
||||
|
||||
#define BOARD_RAMPS_PLUS_EFB 143 // RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed)
|
||||
#define BOARD_RAMPS_PLUS_EEB 144 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed)
|
||||
#define BOARD_RAMPS_PLUS_EFF 145 // RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1)
|
||||
#define BOARD_RAMPS_PLUS_EEF 146 // RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan)
|
||||
#define BOARD_RAMPS_PLUS_SF 148 // RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan)
|
||||
|
||||
//
|
||||
// RAMPS Derivatives - ATmega1280, ATmega2560
|
||||
//
|
||||
|
||||
#define BOARD_3DRAG 77 // 3Drag Controller
|
||||
#define BOARD_K8200 78 // Velleman K8200 Controller (derived from 3Drag Controller)
|
||||
#define BOARD_K8400 79 // Velleman K8400 Controller (derived from 3Drag Controller)
|
||||
#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers
|
||||
#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers
|
||||
#define BOARD_MKS_BASE 40 // MKS BASE 1.0
|
||||
#define BOARD_MKS_13 47 // MKS v1.3 or 1.4 (maybe higher)
|
||||
#define BOARD_MKS_GEN_L 53 // MKS GEN L
|
||||
#define BOARD_ZRIB_V20 504 // zrib V2.0 control board (Chinese knock off RAMPS replica)
|
||||
#define BOARD_FELIX2 37 // Felix 2.0+ Electronics Board (RAMPS like)
|
||||
#define BOARD_RIGIDBOARD 42 // Invent-A-Part RigidBoard
|
||||
#define BOARD_RIGIDBOARD_V2 52 // Invent-A-Part RigidBoard V2
|
||||
#define BOARD_SAINSMART_2IN1 49 // Sainsmart 2-in-1 board
|
||||
#define BOARD_ULTIMAKER 7 // Ultimaker
|
||||
#define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
|
||||
#define BOARD_AZTEEG_X3 67 // Azteeg X3
|
||||
#define BOARD_AZTEEG_X3_PRO 68 // Azteeg X3 Pro
|
||||
#define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
|
||||
#define BOARD_RUMBA 80 // Rumba
|
||||
#define BOARD_BQ_ZUM_MEGA_3D 503 // bq ZUM Mega 3D
|
||||
#define BOARD_MAKEBOARD_MINI 431 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake
|
||||
|
||||
//
|
||||
// Other ATmega1280, ATmega2560
|
||||
//
|
||||
|
||||
#define BOARD_CNCONTROLS_11 111 // Cartesio CN Controls V11
|
||||
#define BOARD_CNCONTROLS_12 112 // Cartesio CN Controls V12
|
||||
#define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0
|
||||
#define BOARD_CHEAPTRONIC_V2 21 // Cheaptronic v2.0
|
||||
#define BOARD_MIGHTYBOARD_REVE 200 // Makerbot Mightyboard Revision E
|
||||
#define BOARD_MEGATRONICS 70 // Megatronics
|
||||
#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0
|
||||
#define BOARD_MEGATRONICS_3 703 // Megatronics v3.0
|
||||
#define BOARD_MEGATRONICS_31 704 // Megatronics v3.1
|
||||
#define BOARD_RAMBO 301 // Rambo
|
||||
#define BOARD_MINIRAMBO 302 // Mini-Rambo
|
||||
#define BOARD_MINIRAMBO_10A 303 // Mini-Rambo 1.0a
|
||||
#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3)
|
||||
#define BOARD_LEAPFROG 999 // Leapfrog
|
||||
#define BOARD_MEGACONTROLLER 310 // Mega controller
|
||||
#define BOARD_SCOOVO_X9H 321 // abee Scoovo X9H
|
||||
#define BOARD_GT2560_REV_A 74 // Geeetech GT2560 Rev. A
|
||||
#define BOARD_GT2560_REV_A_PLUS 75 // Geeetech GT2560 Rev. A+ (with auto level probe)
|
||||
|
||||
//
|
||||
// ATmega1281, ATmega2561
|
||||
//
|
||||
|
||||
#define BOARD_MINITRONICS 702 // Minitronics v1.0/1.1
|
||||
#define BOARD_SILVER_GATE 25 // Silvergate v1.0
|
||||
|
||||
//
|
||||
// Sanguinololu and Derivatives - ATmega644P, ATmega1284P
|
||||
//
|
||||
|
||||
#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2
|
||||
#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above
|
||||
#define BOARD_MELZI 63 // Melzi
|
||||
#define BOARD_MELZI_MAKR3D 66 // Melzi with ATmega1284 (MaKr3d version)
|
||||
#define BOARD_MELZI_CREALITY 89 // Melzi Creality3D board (for CR-10 etc)
|
||||
#define BOARD_STB_11 64 // STB V1.1
|
||||
#define BOARD_AZTEEG_X1 65 // Azteeg X1
|
||||
|
||||
//
|
||||
// Other ATmega644P, ATmega644, ATmega1284P
|
||||
//
|
||||
|
||||
#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics
|
||||
#define BOARD_GEN3_PLUS 9 // Gen3+
|
||||
#define BOARD_GEN6 5 // Gen6
|
||||
#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe
|
||||
#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
|
||||
#define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2
|
||||
#define BOARD_GEN7_13 12 // Gen7 v1.3
|
||||
#define BOARD_GEN7_14 13 // Gen7 v1.4
|
||||
#define BOARD_OMCA_A 90 // Alpha OMCA board
|
||||
#define BOARD_OMCA 91 // Final OMCA board
|
||||
#define BOARD_SETHI 20 // Sethi 3D_1
|
||||
#define BOARD_ANET_10 69 // Anet 1.0 (Melzi clone)
|
||||
|
||||
//
|
||||
// Teensyduino - AT90USB1286, AT90USB1286P
|
||||
//
|
||||
|
||||
#define BOARD_TEENSYLU 8 // Teensylu
|
||||
#define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286)
|
||||
#define BOARD_PRINTRBOARD_REVF 811 // Printrboard Revision F (AT90USB1286)
|
||||
#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646)
|
||||
#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286)
|
||||
#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286)
|
||||
#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make
|
||||
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board
|
||||
|
||||
#define MB(board) (MOTHERBOARD==BOARD_##board)
|
||||
|
||||
#endif //__BOARDS_H
|
||||
#endif // __BOARDS_H
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ class Buzzer {
|
||||
* @param duration Duration of the tone in milliseconds
|
||||
* @param frequency Frequency of the tone in hertz
|
||||
*/
|
||||
void tone(uint16_t const &duration, uint16_t const &frequency = 0) {
|
||||
void tone(const uint16_t &duration, const uint16_t &frequency = 0) {
|
||||
while (buffer.isFull()) {
|
||||
this->tick();
|
||||
thermalManager.manage_heater();
|
||||
|
||||
+119
-94
@@ -20,16 +20,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "cardreader.h"
|
||||
|
||||
#include "ultralcd.h"
|
||||
#include "stepper.h"
|
||||
#include "language.h"
|
||||
|
||||
#include "Marlin.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#define LONGEST_FILENAME (longFilename[0] ? longFilename : filename)
|
||||
|
||||
CardReader::CardReader() {
|
||||
@@ -44,8 +44,9 @@ CardReader::CardReader() {
|
||||
sdprinting = cardOK = saving = logging = false;
|
||||
filesize = 0;
|
||||
sdpos = 0;
|
||||
workDirDepth = 0;
|
||||
file_subcall_ctr = 0;
|
||||
|
||||
workDirDepth = 0;
|
||||
ZERO(workDirParents);
|
||||
|
||||
autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software.
|
||||
@@ -54,7 +55,7 @@ CardReader::CardReader() {
|
||||
//power to SD reader
|
||||
#if SDPOWER > -1
|
||||
OUT_WRITE(SDPOWER, HIGH);
|
||||
#endif //SDPOWER
|
||||
#endif // SDPOWER
|
||||
|
||||
next_autostart_ms = millis() + 5000;
|
||||
}
|
||||
@@ -73,9 +74,12 @@ char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters
|
||||
/**
|
||||
* Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
|
||||
* LS_Count - Add +1 to nrFiles for every file within the parent
|
||||
* LS_GetFilename - Get the filename of the file indexed by nrFiles
|
||||
* LS_GetFilename - Get the filename of the file indexed by nrFile_index
|
||||
* LS_SerialPrint - Print the full path and size of each file to serial output
|
||||
*/
|
||||
|
||||
uint16_t nrFile_index;
|
||||
|
||||
void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
|
||||
dir_t p;
|
||||
uint8_t cnt = 0;
|
||||
@@ -109,7 +113,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
||||
SdFile dir;
|
||||
if (!dir.open(parent, lfilename, O_READ)) {
|
||||
if (lsAction == LS_SerialPrint) {
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
|
||||
SERIAL_ECHOLN(lfilename);
|
||||
}
|
||||
@@ -129,7 +133,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
||||
|
||||
if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue;
|
||||
|
||||
switch (lsAction) {
|
||||
switch (lsAction) { // 1 based file count
|
||||
case LS_Count:
|
||||
nrFiles++;
|
||||
break;
|
||||
@@ -147,7 +151,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
|
||||
if (match != NULL) {
|
||||
if (strcasecmp(match, filename) == 0) return;
|
||||
}
|
||||
else if (cnt == nrFiles) return;
|
||||
else if (cnt == nrFile_index) return; // 0 based index
|
||||
cnt++;
|
||||
break;
|
||||
}
|
||||
@@ -208,8 +212,8 @@ void CardReader::ls() {
|
||||
// Open the sub-item as the new dive parent
|
||||
SdFile dir;
|
||||
if (!dir.open(diveDir, segment, O_READ)) {
|
||||
SERIAL_EOL;
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_EOL();
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
|
||||
SERIAL_ECHO(segment);
|
||||
break;
|
||||
@@ -220,7 +224,7 @@ void CardReader::ls() {
|
||||
|
||||
} // while i<pathLen
|
||||
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
#endif // LONG_FILENAME_HOST_SUPPORT
|
||||
@@ -239,32 +243,23 @@ void CardReader::initsd() {
|
||||
#endif
|
||||
) {
|
||||
//if (!card.init(SPI_HALF_SPEED,SDSS))
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL);
|
||||
}
|
||||
else if (!volume.init(&card)) {
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL);
|
||||
}
|
||||
else if (!root.openRoot(&volume)) {
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORLNPGM(MSG_SD_OPENROOT_FAIL);
|
||||
}
|
||||
else {
|
||||
cardOK = true;
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPGM(MSG_SD_CARD_OK);
|
||||
}
|
||||
workDir = root;
|
||||
curDir = &root;
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
presort();
|
||||
#endif
|
||||
/**
|
||||
if (!workDir.openRoot(&volume)) {
|
||||
SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
|
||||
}
|
||||
*/
|
||||
setroot();
|
||||
}
|
||||
|
||||
void CardReader::setroot() {
|
||||
@@ -310,57 +305,67 @@ void CardReader::openLogFile(char* name) {
|
||||
openFile(name, false);
|
||||
}
|
||||
|
||||
void CardReader::getAbsFilename(char *t) {
|
||||
uint8_t cnt = 0;
|
||||
*t = '/'; t++; cnt++;
|
||||
for (uint8_t i = 0; i < workDirDepth; i++) {
|
||||
workDirParents[i].getFilename(t); //SDBaseFile.getfilename!
|
||||
while (*t && cnt < MAXPATHNAMELENGTH) { t++; cnt++; } //crawl counter forward.
|
||||
}
|
||||
if (cnt < MAXPATHNAMELENGTH - (FILENAME_LENGTH))
|
||||
file.getFilename(t);
|
||||
else
|
||||
t[0] = 0;
|
||||
void appendAtom(SdFile &file, char *& dst, uint8_t &cnt) {
|
||||
file.getFilename(dst);
|
||||
while (*dst && cnt < MAXPATHNAMELENGTH) { dst++; cnt++; }
|
||||
if (cnt < MAXPATHNAMELENGTH) { *dst = '/'; dst++; cnt++; }
|
||||
}
|
||||
|
||||
void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
void CardReader::getAbsFilename(char *t) {
|
||||
*t++ = '/'; // Root folder
|
||||
uint8_t cnt = 1;
|
||||
|
||||
for (uint8_t i = 0; i < workDirDepth; i++) // Loop to current work dir
|
||||
appendAtom(workDirParents[i], t, cnt);
|
||||
|
||||
if (cnt < MAXPATHNAMELENGTH - (FILENAME_LENGTH)) {
|
||||
appendAtom(file, t, cnt);
|
||||
--t;
|
||||
}
|
||||
*t = '\0';
|
||||
}
|
||||
|
||||
void CardReader::openFile(char* name, const bool read, const bool subcall/*=false*/) {
|
||||
|
||||
if (!cardOK) return;
|
||||
|
||||
uint8_t doing = 0;
|
||||
if (isFileOpen()) { //replacing current file by new file, or subfile call
|
||||
if (push_current) {
|
||||
if (isFileOpen()) { // Replacing current file or doing a subroutine
|
||||
if (subcall) {
|
||||
if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
|
||||
SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
|
||||
kill(PSTR(MSG_KILLED));
|
||||
return;
|
||||
}
|
||||
|
||||
// Store current filename and position
|
||||
// Store current filename (based on workDirParents) and position
|
||||
getAbsFilename(proc_filenames[file_subcall_ctr]);
|
||||
filespos[file_subcall_ctr] = sdpos;
|
||||
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPAIR("SUBROUTINE CALL target:\"", name);
|
||||
SERIAL_ECHOPAIR("\" parent:\"", proc_filenames[file_subcall_ctr]);
|
||||
SERIAL_ECHOLNPAIR("\" pos", sdpos);
|
||||
filespos[file_subcall_ctr] = sdpos;
|
||||
file_subcall_ctr++;
|
||||
}
|
||||
else {
|
||||
else
|
||||
doing = 1;
|
||||
}
|
||||
}
|
||||
else { // Opening fresh file
|
||||
else if (subcall) { // Returning from a subcall?
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPGM("END SUBROUTINE");
|
||||
}
|
||||
else { // Opening fresh file
|
||||
doing = 2;
|
||||
file_subcall_ctr = 0; // Reset procedure depth in case user cancels print while in procedure
|
||||
}
|
||||
|
||||
if (doing) {
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM("Now ");
|
||||
SERIAL_ECHO(doing == 1 ? "doing" : "fresh");
|
||||
serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh"));
|
||||
SERIAL_ECHOLNPAIR(" file: ", name);
|
||||
}
|
||||
|
||||
@@ -380,8 +385,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
if (dirname_end != NULL && dirname_end > dirname_start) {
|
||||
char subdirname[FILENAME_LENGTH];
|
||||
strncpy(subdirname, dirname_start, dirname_end - dirname_start);
|
||||
subdirname[dirname_end - dirname_start] = 0;
|
||||
SERIAL_ECHOLN(subdirname);
|
||||
subdirname[dirname_end - dirname_start] = '\0';
|
||||
if (!myDir.open(curDir, subdirname, O_READ)) {
|
||||
SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
|
||||
SERIAL_PROTOCOL(subdirname);
|
||||
@@ -403,17 +407,15 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
}
|
||||
}
|
||||
}
|
||||
else { //relative path
|
||||
curDir = &workDir;
|
||||
}
|
||||
else
|
||||
curDir = &workDir; // Relative paths start in current directory
|
||||
|
||||
if (read) {
|
||||
if (file.open(curDir, fname, O_READ)) {
|
||||
filesize = file.fileSize();
|
||||
sdpos = 0;
|
||||
SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname);
|
||||
SERIAL_PROTOCOLLNPAIR(MSG_SD_SIZE, filesize);
|
||||
sdpos = 0;
|
||||
|
||||
SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED);
|
||||
getfilename(0, fname);
|
||||
lcd_setstatus(longFilename[0] ? longFilename : fname);
|
||||
@@ -421,14 +423,14 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
else {
|
||||
SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
|
||||
SERIAL_PROTOCOLCHAR('.');
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
else { //write
|
||||
if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
|
||||
SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname);
|
||||
SERIAL_PROTOCOLCHAR('.');
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
}
|
||||
else {
|
||||
saving = true;
|
||||
@@ -438,14 +440,14 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
|
||||
}
|
||||
}
|
||||
|
||||
void CardReader::removeFile(char* name) {
|
||||
void CardReader::removeFile(const char * const name) {
|
||||
if (!cardOK) return;
|
||||
|
||||
stopSDPrint();
|
||||
|
||||
SdFile myDir;
|
||||
curDir = &root;
|
||||
char *fname = name;
|
||||
const char *fname = name;
|
||||
|
||||
char *dirname_start, *dirname_end;
|
||||
if (name[0] == '/') {
|
||||
@@ -460,29 +462,23 @@ void CardReader::removeFile(char* name) {
|
||||
subdirname[dirname_end - dirname_start] = 0;
|
||||
SERIAL_ECHOLN(subdirname);
|
||||
if (!myDir.open(curDir, subdirname, O_READ)) {
|
||||
SERIAL_PROTOCOLPAIR("open failed, File: ", subdirname);
|
||||
SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, subdirname);
|
||||
SERIAL_PROTOCOLCHAR('.');
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
//SERIAL_ECHOLNPGM("dive ok");
|
||||
}
|
||||
|
||||
curDir = &myDir;
|
||||
dirname_start = dirname_end + 1;
|
||||
}
|
||||
else { // the remainder after all /fsa/fdsa/ is the filename
|
||||
else {
|
||||
fname = dirname_start;
|
||||
//SERIAL_ECHOLNPGM("remainder");
|
||||
//SERIAL_ECHOLN(fname);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // relative path
|
||||
else // Relative paths are rooted in the current directory
|
||||
curDir = &workDir;
|
||||
}
|
||||
|
||||
if (file.remove(curDir, fname)) {
|
||||
SERIAL_PROTOCOLPGM("File deleted:");
|
||||
@@ -506,14 +502,13 @@ void CardReader::getStatus() {
|
||||
SERIAL_PROTOCOLCHAR('/');
|
||||
SERIAL_PROTOCOLLN(filesize);
|
||||
}
|
||||
else {
|
||||
else
|
||||
SERIAL_PROTOCOLLNPGM(MSG_SD_NOT_PRINTING);
|
||||
}
|
||||
}
|
||||
|
||||
void CardReader::write_command(char *buf) {
|
||||
char* begin = buf;
|
||||
char* npos = 0;
|
||||
char* npos = NULL;
|
||||
char* end = buf + strlen(buf) - 1;
|
||||
|
||||
file.writeError = false;
|
||||
@@ -526,13 +521,13 @@ void CardReader::write_command(char *buf) {
|
||||
end[3] = '\0';
|
||||
file.write(begin);
|
||||
if (file.writeError) {
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE);
|
||||
}
|
||||
}
|
||||
|
||||
void CardReader::checkautostart(bool force) {
|
||||
if (!force && (!autostart_stilltocheck || ELAPSED(millis(), next_autostart_ms)))
|
||||
if (!force && (!autostart_stilltocheck || PENDING(millis(), next_autostart_ms)))
|
||||
return;
|
||||
|
||||
autostart_stilltocheck = false;
|
||||
@@ -595,7 +590,7 @@ void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) {
|
||||
#endif // SDSORT_CACHE_NAMES
|
||||
curDir = &workDir;
|
||||
lsAction = LS_GetFilename;
|
||||
nrFiles = nr;
|
||||
nrFile_index = nr;
|
||||
curDir->rewind();
|
||||
lsDive("", *curDir, match);
|
||||
}
|
||||
@@ -611,33 +606,34 @@ uint16_t CardReader::getnrfilenames() {
|
||||
}
|
||||
|
||||
void CardReader::chdir(const char * relpath) {
|
||||
SdFile newfile;
|
||||
SdFile newDir;
|
||||
SdFile *parent = &root;
|
||||
|
||||
if (workDir.isOpen()) parent = &workDir;
|
||||
|
||||
if (!newfile.open(*parent, relpath, O_READ)) {
|
||||
SERIAL_ECHO_START;
|
||||
if (!newDir.open(*parent, relpath, O_READ)) {
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR);
|
||||
SERIAL_ECHOLN(relpath);
|
||||
}
|
||||
else {
|
||||
workDir = newDir;
|
||||
if (workDirDepth < MAX_DIR_DEPTH)
|
||||
workDirParents[workDirDepth++] = *parent;
|
||||
workDir = newfile;
|
||||
workDirParents[workDirDepth++] = workDir;
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
presort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void CardReader::updir() {
|
||||
if (workDirDepth > 0) {
|
||||
workDir = workDirParents[--workDirDepth];
|
||||
int8_t CardReader::updir() {
|
||||
if (workDirDepth > 0) { // At least 1 dir has been saved
|
||||
workDir = --workDirDepth ? workDirParents[workDirDepth - 1] : root; // Use parent, or root if none
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
presort();
|
||||
#endif
|
||||
}
|
||||
return workDirDepth;
|
||||
}
|
||||
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
@@ -696,7 +692,7 @@ void CardReader::updir() {
|
||||
sortnames = new char*[fileCnt];
|
||||
#endif
|
||||
#elif ENABLED(SDSORT_USES_STACK)
|
||||
char sortnames[fileCnt][LONG_FILENAME_LENGTH];
|
||||
char sortnames[fileCnt][SORTED_LONGNAME_MAXLEN];
|
||||
#endif
|
||||
|
||||
// Folder sorting needs 1 bit per entry for flags.
|
||||
@@ -735,7 +731,12 @@ void CardReader::updir() {
|
||||
#endif
|
||||
#else
|
||||
// Copy filenames into the static array
|
||||
strcpy(sortnames[i], LONGEST_FILENAME);
|
||||
#if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH
|
||||
strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
|
||||
sortnames[i][SORTED_LONGNAME_MAXLEN - 1] = '\0';
|
||||
#else
|
||||
strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
|
||||
#endif
|
||||
#if ENABLED(SDSORT_CACHE_NAMES)
|
||||
strcpy(sortshort[i], filename);
|
||||
#endif
|
||||
@@ -826,12 +827,21 @@ void CardReader::updir() {
|
||||
#if ENABLED(SDSORT_DYNAMIC_RAM)
|
||||
sortnames = new char*[1];
|
||||
sortnames[0] = strdup(LONGEST_FILENAME); // malloc
|
||||
sortshort = new char*[1];
|
||||
sortshort[0] = strdup(filename); // malloc
|
||||
#if ENABLED(SDSORT_CACHE_NAMES)
|
||||
sortshort = new char*[1];
|
||||
sortshort[0] = strdup(filename); // malloc
|
||||
#endif
|
||||
isDir = new uint8_t[1];
|
||||
#else
|
||||
strcpy(sortnames[0], LONGEST_FILENAME);
|
||||
strcpy(sortshort[0], filename);
|
||||
#if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH
|
||||
strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
|
||||
sortnames[0][SORTED_LONGNAME_MAXLEN - 1] = '\0';
|
||||
#else
|
||||
strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
|
||||
#endif
|
||||
#if ENABLED(SDSORT_CACHE_NAMES)
|
||||
strcpy(sortshort[0], filename);
|
||||
#endif
|
||||
#endif
|
||||
isDir[0] = filenameIsDir ? 0x01 : 0x00;
|
||||
#endif
|
||||
@@ -860,6 +870,16 @@ void CardReader::updir() {
|
||||
|
||||
#endif // SDCARD_SORT_ALPHA
|
||||
|
||||
uint16_t CardReader::get_num_Files() {
|
||||
return
|
||||
#if ENABLED(SDCARD_SORT_ALPHA) && SDSORT_USES_RAM && SDSORT_CACHE_NAMES
|
||||
nrFiles // no need to access the SD card for filenames
|
||||
#else
|
||||
getnrfilenames()
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
void CardReader::printingHasFinished() {
|
||||
stepper.synchronize();
|
||||
file.close();
|
||||
@@ -871,15 +891,20 @@ void CardReader::printingHasFinished() {
|
||||
}
|
||||
else {
|
||||
sdprinting = false;
|
||||
if (SD_FINISHED_STEPPERRELEASE)
|
||||
enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
|
||||
#if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
|
||||
stepper.cleaning_buffer_counter = 1; // The command will fire from the Stepper ISR
|
||||
#endif
|
||||
print_job_timer.stop();
|
||||
if (print_job_timer.duration() > 60)
|
||||
enqueue_and_echo_commands_P(PSTR("M31"));
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
presort();
|
||||
#endif
|
||||
|
||||
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
|
||||
lcd_reselect_last_file();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif //SDSUPPORT
|
||||
#endif // SDSUPPORT
|
||||
|
||||
+34
-24
@@ -20,8 +20,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CARDREADER_H
|
||||
#define CARDREADER_H
|
||||
#ifndef _CARDREADER_H_
|
||||
#define _CARDREADER_H_
|
||||
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#define MAX_DIR_DEPTH 10 // Maximum folder depth
|
||||
|
||||
#include "SdFile.h"
|
||||
|
||||
#include "types.h"
|
||||
#include "enum.h"
|
||||
|
||||
@@ -40,13 +39,15 @@ public:
|
||||
|
||||
void initsd();
|
||||
void write_command(char *buf);
|
||||
//files auto[0-9].g on the sd card are performed in a row
|
||||
//this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset
|
||||
// Files auto[0-9].g on the sd card are performed in sequence.
|
||||
// This is to delay autostart and hence the initialisation of
|
||||
// the sd card to some seconds after the normal init, so the
|
||||
// device is available soon after a reset.
|
||||
|
||||
void checkautostart(bool x);
|
||||
void openFile(char* name, bool read, bool push_current=false);
|
||||
void openFile(char* name, const bool read, const bool subcall=false);
|
||||
void openLogFile(char* name);
|
||||
void removeFile(char* name);
|
||||
void removeFile(const char * const name);
|
||||
void closefile(bool store_location=false);
|
||||
void release();
|
||||
void openAndPrintFile(const char *name);
|
||||
@@ -66,9 +67,11 @@ public:
|
||||
|
||||
void ls();
|
||||
void chdir(const char *relpath);
|
||||
void updir();
|
||||
int8_t updir();
|
||||
void setroot();
|
||||
|
||||
uint16_t get_num_Files();
|
||||
|
||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||
void presort();
|
||||
void getfilename_sorted(const uint16_t nr);
|
||||
@@ -111,6 +114,12 @@ private:
|
||||
uint8_t sort_order[SDSORT_LIMIT];
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSORT_USES_RAM) && ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
|
||||
#define SORTED_LONGNAME_MAXLEN ((SDSORT_CACHE_VFATS) * (FILENAME_LENGTH) + 1)
|
||||
#else
|
||||
#define SORTED_LONGNAME_MAXLEN LONG_FILENAME_LENGTH
|
||||
#endif
|
||||
|
||||
// Cache filenames to speed up SD menus.
|
||||
#if ENABLED(SDSORT_USES_RAM)
|
||||
|
||||
@@ -120,10 +129,10 @@ private:
|
||||
char **sortshort, **sortnames;
|
||||
#else
|
||||
char sortshort[SDSORT_LIMIT][FILENAME_LENGTH];
|
||||
char sortnames[SDSORT_LIMIT][FILENAME_LENGTH];
|
||||
char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN];
|
||||
#endif
|
||||
#elif DISABLED(SDSORT_USES_STACK)
|
||||
char sortnames[SDSORT_LIMIT][FILENAME_LENGTH];
|
||||
char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN];
|
||||
#endif
|
||||
|
||||
// Folder sorting uses an isDir array when caching items.
|
||||
@@ -148,8 +157,7 @@ private:
|
||||
uint8_t file_subcall_ctr;
|
||||
uint32_t filespos[SD_PROCEDURE_DEPTH];
|
||||
char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH];
|
||||
uint32_t filesize;
|
||||
uint32_t sdpos;
|
||||
uint32_t filesize, sdpos;
|
||||
|
||||
millis_t next_autostart_ms;
|
||||
bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
|
||||
@@ -164,25 +172,27 @@ private:
|
||||
#endif
|
||||
};
|
||||
|
||||
extern CardReader card;
|
||||
|
||||
#define IS_SD_PRINTING (card.sdprinting)
|
||||
|
||||
#if PIN_EXISTS(SD_DETECT)
|
||||
#if ENABLED(SD_DETECT_INVERTED)
|
||||
#define IS_SD_INSERTED (READ(SD_DETECT_PIN) != 0)
|
||||
#define IS_SD_INSERTED (READ(SD_DETECT_PIN) == HIGH)
|
||||
#else
|
||||
#define IS_SD_INSERTED (READ(SD_DETECT_PIN) == 0)
|
||||
#define IS_SD_INSERTED (READ(SD_DETECT_PIN) == LOW)
|
||||
#endif
|
||||
#else
|
||||
//No card detect line? Assume the card is inserted.
|
||||
// No card detect line? Assume the card is inserted.
|
||||
#define IS_SD_INSERTED true
|
||||
#endif
|
||||
|
||||
extern CardReader card;
|
||||
|
||||
#endif // SDSUPPORT
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#define IS_SD_PRINTING (card.sdprinting)
|
||||
#define IS_SD_FILE_OPEN (card.isFileOpen())
|
||||
#else
|
||||
#define IS_SD_PRINTING (false)
|
||||
#define IS_SD_FILE_OPEN (false)
|
||||
#endif
|
||||
|
||||
#define IS_SD_PRINTING (false)
|
||||
|
||||
#endif //SDSUPPORT
|
||||
|
||||
#endif //__CARDREADER_H
|
||||
#endif // _CARDREADER_H_
|
||||
|
||||
+995
-523
File diff suppressed because it is too large
Load Diff
@@ -34,26 +34,46 @@ class MarlinSettings {
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
static bool load();
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system
|
||||
// That can store is enabled
|
||||
FORCE_INLINE static int16_t get_start_of_meshes() { return meshes_begin; }
|
||||
FORCE_INLINE static int16_t get_end_of_meshes() { return meshes_end; }
|
||||
static uint16_t calc_num_meshes();
|
||||
static void store_mesh(const int8_t slot);
|
||||
static void load_mesh(const int8_t slot, void * const into=NULL);
|
||||
|
||||
//static void delete_mesh(); // necessary if we have a MAT
|
||||
//static void defrag_meshes(); // "
|
||||
#endif
|
||||
#else
|
||||
FORCE_INLINE
|
||||
static bool load() { reset(); report(); return true; }
|
||||
#endif
|
||||
|
||||
#if DISABLED(DISABLE_M503)
|
||||
static void report(bool forReplay=false);
|
||||
static void report(const bool forReplay=false);
|
||||
#else
|
||||
FORCE_INLINE
|
||||
static void report(bool forReplay=false) { }
|
||||
static void report(const bool forReplay=false) { UNUSED(forReplay); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
static void postprocess();
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
static uint16_t eeprom_checksum;
|
||||
static bool eeprom_read_error, eeprom_write_error;
|
||||
static void write_data(int &pos, const uint8_t* value, uint16_t size);
|
||||
static void read_data(int &pos, uint8_t* value, uint16_t size);
|
||||
static bool eeprom_error;
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system
|
||||
// That can store is enabled
|
||||
static int16_t meshes_begin;
|
||||
const static int16_t meshes_end = E2END - 128; // 128 is a placeholder for the size of the MAT; the MAT will always
|
||||
// live at the very end of the eeprom
|
||||
|
||||
#endif
|
||||
|
||||
static void write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc);
|
||||
static void read_data(int &pos, uint8_t *value, uint16_t size, uint16_t *crc);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -114,13 +114,13 @@ uint16_t mcp4728_getVout(uint8_t channel) {
|
||||
/**
|
||||
* Returns DAC values as a 0-100 percentage of drive strength
|
||||
*/
|
||||
uint16_t mcp4728_getDrvPct(uint8_t channel) { return uint16_t(100.0 * mcp4728_values[channel] / (DAC_STEPPER_MAX) + 0.5); }
|
||||
uint8_t mcp4728_getDrvPct(uint8_t channel) { return uint8_t(100.0 * mcp4728_values[channel] / (DAC_STEPPER_MAX) + 0.5); }
|
||||
|
||||
/**
|
||||
* Receives all Drive strengths as 0-100 percent values, updates
|
||||
* DAC Values array and calls fastwrite to update the DAC.
|
||||
*/
|
||||
void mcp4728_setDrvPct(uint16_t pct[XYZE]) {
|
||||
void mcp4728_setDrvPct(uint8_t pct[XYZE]) {
|
||||
LOOP_XYZE(i) mcp4728_values[i] = 0.01 * pct[i] * (DAC_STEPPER_MAX);
|
||||
mcp4728_fastWrite();
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ uint8_t mcp4728_setGain_all(uint8_t value);
|
||||
uint16_t mcp4728_getValue(uint8_t channel);
|
||||
uint8_t mcp4728_fastWrite();
|
||||
uint8_t mcp4728_simpleCommand(byte simpleCommand);
|
||||
uint16_t mcp4728_getDrvPct(uint8_t channel);
|
||||
void mcp4728_setDrvPct(uint16_t pct[XYZE]);
|
||||
uint8_t mcp4728_getDrvPct(uint8_t channel);
|
||||
void mcp4728_setDrvPct(uint8_t pct[XYZE]);
|
||||
|
||||
#endif
|
||||
#endif // DAC_MCP4728_H
|
||||
|
||||
+39
-24
@@ -24,6 +24,7 @@
|
||||
|
||||
#if ENABLED(DIGIPOT_I2C) && ENABLED(DIGIPOT_MCP4018)
|
||||
|
||||
#include "enum.h"
|
||||
#include "Stream.h"
|
||||
#include "utility/twi.h"
|
||||
#include <SlowSoftI2CMaster.h> //https://github.com/stawel/SlowSoftI2CMaster
|
||||
@@ -33,36 +34,52 @@
|
||||
#define DIGIPOT_I2C_ADDRESS 0x2F
|
||||
|
||||
#define DIGIPOT_A4988_Rsx 0.250
|
||||
#define DIGIPOT_A4988_Vrefmax 5.0
|
||||
#define DIGIPOT_A4988_Vrefmax 1.666
|
||||
#define DIGIPOT_A4988_MAX_VALUE 127
|
||||
|
||||
#define DIGIPOT_A4988_Itripmax(Vref) ((Vref)/(8.0*DIGIPOT_A4988_Rsx))
|
||||
|
||||
#define DIGIPOT_A4988_FACTOR (DIGIPOT_A4988_MAX_VALUE/DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax))
|
||||
//TODO: MAX_CURRENT -0.5A ?? (currently set to 2A, max possible current 2.5A)
|
||||
#define DIGIPOT_A4988_MAX_CURRENT (DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax) - 0.5)
|
||||
#define DIGIPOT_A4988_FACTOR ((DIGIPOT_A4988_MAX_VALUE)/DIGIPOT_A4988_Itripmax(DIGIPOT_A4988_Vrefmax))
|
||||
#define DIGIPOT_A4988_MAX_CURRENT 2.0
|
||||
|
||||
static byte current_to_wiper(float current) {
|
||||
return byte(ceil(float((DIGIPOT_A4988_FACTOR * current))));
|
||||
static byte current_to_wiper(const float current) {
|
||||
const int16_t value = ceil(float(DIGIPOT_A4988_FACTOR) * current);
|
||||
return byte(constrain(value, 0, DIGIPOT_A4988_MAX_VALUE));
|
||||
}
|
||||
|
||||
static uint8_t sda_pins[DIGIPOT_I2C_NUM_CHANNELS] = {
|
||||
DIGIPOTS_I2C_SDA_X,
|
||||
DIGIPOTS_I2C_SDA_Y,
|
||||
DIGIPOTS_I2C_SDA_Z,
|
||||
DIGIPOTS_I2C_SDA_E0,
|
||||
DIGIPOTS_I2C_SDA_E1,
|
||||
const uint8_t sda_pins[DIGIPOT_I2C_NUM_CHANNELS] = {
|
||||
DIGIPOTS_I2C_SDA_X
|
||||
#if DIGIPOT_I2C_NUM_CHANNELS > 1
|
||||
, DIGIPOTS_I2C_SDA_Y
|
||||
#if DIGIPOT_I2C_NUM_CHANNELS > 2
|
||||
, DIGIPOTS_I2C_SDA_Z
|
||||
#if DIGIPOT_I2C_NUM_CHANNELS > 3
|
||||
, DIGIPOTS_I2C_SDA_E0
|
||||
#if DIGIPOT_I2C_NUM_CHANNELS > 4
|
||||
, DIGIPOTS_I2C_SDA_E1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = {
|
||||
SlowSoftI2CMaster { sda_pins[0], DIGIPOTS_I2C_SCL },
|
||||
SlowSoftI2CMaster { sda_pins[1], DIGIPOTS_I2C_SCL },
|
||||
SlowSoftI2CMaster { sda_pins[2], DIGIPOTS_I2C_SCL },
|
||||
SlowSoftI2CMaster { sda_pins[3], DIGIPOTS_I2C_SCL },
|
||||
SlowSoftI2CMaster { sda_pins[4], DIGIPOTS_I2C_SCL }
|
||||
SlowSoftI2CMaster { sda_pins[X_AXIS], DIGIPOTS_I2C_SCL }
|
||||
#if DIGIPOT_I2C_NUM_CHANNELS > 1
|
||||
, SlowSoftI2CMaster { sda_pins[Y_AXIS], DIGIPOTS_I2C_SCL }
|
||||
#if DIGIPOT_I2C_NUM_CHANNELS > 2
|
||||
, SlowSoftI2CMaster { sda_pins[Z_AXIS], DIGIPOTS_I2C_SCL }
|
||||
#if DIGIPOT_I2C_NUM_CHANNELS > 3
|
||||
, SlowSoftI2CMaster { sda_pins[E_AXIS], DIGIPOTS_I2C_SCL }
|
||||
#if DIGIPOT_I2C_NUM_CHANNELS > 4
|
||||
, SlowSoftI2CMaster { sda_pins[E_AXIS + 1], DIGIPOTS_I2C_SCL }
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
static void i2c_send(int channel, byte v) {
|
||||
static void i2c_send(const uint8_t channel, const byte v) {
|
||||
if (WITHIN(channel, 0, DIGIPOT_I2C_NUM_CHANNELS - 1)) {
|
||||
pots[channel].i2c_start(((DIGIPOT_I2C_ADDRESS) << 1) | I2C_WRITE);
|
||||
pots[channel].i2c_write(v);
|
||||
@@ -71,21 +88,19 @@ static void i2c_send(int channel, byte v) {
|
||||
}
|
||||
|
||||
// This is for the MCP4018 I2C based digipot
|
||||
void digipot_i2c_set_current(int channel, float current) {
|
||||
current = min(max(current, 0.0f), float(DIGIPOT_A4988_MAX_CURRENT));
|
||||
|
||||
i2c_send(channel, current_to_wiper(current));
|
||||
void digipot_i2c_set_current(uint8_t channel, float current) {
|
||||
i2c_send(channel, current_to_wiper(min(max(current, 0.0f), float(DIGIPOT_A4988_MAX_CURRENT))));
|
||||
}
|
||||
|
||||
void digipot_i2c_init() {
|
||||
const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
|
||||
static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS;
|
||||
|
||||
for (uint8_t i = 0; i < DIGIPOT_I2C_NUM_CHANNELS; i++)
|
||||
pots[i].i2c_init();
|
||||
|
||||
// setup initial currents as defined in Configuration_adv.h
|
||||
for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++)
|
||||
digipot_i2c_set_current(i, digipot_motor_current[i]);
|
||||
digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i]));
|
||||
}
|
||||
|
||||
#endif // DIGIPOT_I2C && DIGIPOT_MCP4018
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
#define DIGIPOT_I2C_MAX_CURRENT 2.5
|
||||
#endif
|
||||
|
||||
static byte current_to_wiper(float current) {
|
||||
return byte(ceil(float((DIGIPOT_I2C_FACTOR * current))));
|
||||
static byte current_to_wiper(const float current) {
|
||||
return byte(CEIL(float((DIGIPOT_I2C_FACTOR * current))));
|
||||
}
|
||||
|
||||
static void i2c_send(byte addr, byte a, byte b) {
|
||||
static void i2c_send(const byte addr, const byte a, const byte b) {
|
||||
Wire.beginTransmission(addr);
|
||||
Wire.write(a);
|
||||
Wire.write(b);
|
||||
@@ -49,7 +49,7 @@ static void i2c_send(byte addr, byte a, byte b) {
|
||||
}
|
||||
|
||||
// This is for the MCP4451 I2C based digipot
|
||||
void digipot_i2c_set_current(int channel, float current) {
|
||||
void digipot_i2c_set_current(uint8_t channel, float current) {
|
||||
current = min((float) max(current, 0.0f), DIGIPOT_I2C_MAX_CURRENT);
|
||||
// these addresses are specific to Azteeg X3 Pro, can be set to others,
|
||||
// In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1
|
||||
@@ -69,11 +69,11 @@ void digipot_i2c_set_current(int channel, float current) {
|
||||
}
|
||||
|
||||
void digipot_i2c_init() {
|
||||
const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
|
||||
static const float digipot_motor_current[] PROGMEM = DIGIPOT_I2C_MOTOR_CURRENTS;
|
||||
Wire.begin();
|
||||
// setup initial currents as defined in Configuration_adv.h
|
||||
for (int i = 0; i < COUNT(digipot_motor_current); i++)
|
||||
digipot_i2c_set_current(i, digipot_motor_current[i]);
|
||||
for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++)
|
||||
digipot_i2c_set_current(i, pgm_read_float(&digipot_motor_current[i]));
|
||||
}
|
||||
|
||||
#endif //DIGIPOT_I2C
|
||||
#endif // DIGIPOT_I2C
|
||||
|
||||
+199
-58
@@ -38,10 +38,8 @@
|
||||
#if ENABLED(START_BMPHIGH)
|
||||
#define START_BMPWIDTH 112
|
||||
#define START_BMPHEIGHT 38
|
||||
#define START_BMPBYTEWIDTH 14
|
||||
#define START_BMPBYTES 532 // START_BMPWIDTH * START_BMPHEIGHT / 8
|
||||
|
||||
const unsigned char start_bmp[START_BMPBYTES] PROGMEM = {
|
||||
const unsigned char start_bmp[] PROGMEM = {
|
||||
0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF,
|
||||
@@ -83,10 +81,8 @@
|
||||
#else
|
||||
#define START_BMPWIDTH 56
|
||||
#define START_BMPHEIGHT 19
|
||||
#define START_BMPBYTEWIDTH 7
|
||||
#define START_BMPBYTES 133 // START_BMPWIDTH * START_BMPHEIGHT / 8
|
||||
|
||||
const unsigned char start_bmp[START_BMPBYTES] PROGMEM = {
|
||||
const unsigned char start_bmp[] PROGMEM = {
|
||||
0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0x60, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF,
|
||||
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
|
||||
@@ -115,12 +111,55 @@
|
||||
// When only one extruder is selected, the "1" on the symbol will not
|
||||
// be displayed.
|
||||
|
||||
#define STATUS_SCREENWIDTH 115 // Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 // Height in pixels
|
||||
|
||||
#if HAS_TEMP_BED
|
||||
#if HOTENDS == 1
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
#if HOTENDS == 0
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x40, 0xF0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x40, 0x60, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x5E, 0x07, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x5F, 0x0F, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x4F, 0x0F, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x47, 0x0E, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x63, 0x0C, 0x60,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
|
||||
};
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x82, 0x00, 0x5E, 0xF7, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x5C, 0x63, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x58, 0x01, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x40, 0x60, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x10, 0x00, 0x40, 0xF0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x08, 0x00, 0x41, 0xF8, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x04, 0x00, 0x61, 0xF8, 0x60,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
|
||||
};
|
||||
#elif HOTENDS == 1
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
@@ -142,10 +181,7 @@
|
||||
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
@@ -167,10 +203,7 @@
|
||||
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
|
||||
};
|
||||
#elif HOTENDS == 2
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
@@ -192,10 +225,7 @@
|
||||
0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
@@ -217,10 +247,7 @@
|
||||
0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
|
||||
};
|
||||
#else
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
@@ -242,10 +269,7 @@
|
||||
0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
@@ -266,13 +290,53 @@
|
||||
0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0,
|
||||
0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00
|
||||
};
|
||||
#endif // Extruders
|
||||
#endif // HOTENDS
|
||||
#else
|
||||
#if HOTENDS == 1
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
#if HOTENDS == 0
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x07, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x0F, 0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x0F, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x0E, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0,
|
||||
0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0,
|
||||
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0,
|
||||
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5E, 0xF7, 0xA0,
|
||||
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x63, 0xA0,
|
||||
0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x01, 0xA0,
|
||||
0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x20,
|
||||
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0x20,
|
||||
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xF8, 0x20,
|
||||
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
#elif HOTENDS == 1
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
@@ -294,10 +358,7 @@
|
||||
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
@@ -319,10 +380,7 @@
|
||||
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
#elif HOTENDS == 2
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
@@ -344,10 +402,7 @@
|
||||
0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
@@ -369,10 +424,7 @@
|
||||
0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
#else
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen0_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x60,
|
||||
@@ -394,10 +446,7 @@
|
||||
0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
#define STATUS_SCREENWIDTH 115 //Width in pixels
|
||||
#define STATUS_SCREENHEIGHT 19 //Height in pixels
|
||||
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = { //AVR-GCC, WinAVR
|
||||
const unsigned char status_screen1_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0xF8, 0x60,
|
||||
@@ -418,5 +467,97 @@
|
||||
0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0,
|
||||
0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
#endif // Extruders
|
||||
#endif // HOTENDS
|
||||
#endif // HAS_TEMP_BED
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY)
|
||||
|
||||
const unsigned char cw_bmp[] PROGMEM = {
|
||||
0x03,0xF8,0x00, // 000000111111100000000000
|
||||
0x0F,0xF7,0x00, // 000011111111111000000000
|
||||
0x17,0x0F,0x00, // 000111100000111100000000
|
||||
0x38,0x07,0x00, // 001110000000011100000000
|
||||
0x38,0x03,0x80, // 001110000000001110000000
|
||||
0x70,0x03,0x80, // 011100000000001110000000
|
||||
0x70,0x0F,0xE0, // 011100000000111111100000
|
||||
0x70,0x07,0xC0, // 011100000000011111000000
|
||||
0x70,0x03,0x80, // 011100000000001110000000
|
||||
0x70,0x01,0x00, // 011100000000000100000000
|
||||
0x70,0x00,0x00, // 011100000000000000000000
|
||||
0x68,0x00,0x00, // 001110000000000000000000
|
||||
0x38,0x07,0x00, // 001110000000011100000000
|
||||
0x17,0x0F,0x00, // 000111100000111100000000
|
||||
0x0F,0xFE,0x00, // 000011111111111000000000
|
||||
0x03,0xF8,0x00 // 000000111111100000000000
|
||||
};
|
||||
|
||||
const unsigned char ccw_bmp[] PROGMEM = {
|
||||
0x00,0xFE,0x00, // 000000001111111000000000
|
||||
0x03,0xFF,0x80, // 000000111111111110000000
|
||||
0x07,0x83,0xC0, // 000001111000001111000000
|
||||
0x0E,0x01,0xC0, // 000011100000000111000000
|
||||
0x0E,0x00,0xE0, // 000011100000000011100000
|
||||
0x1C,0x00,0xE0, // 000111000000000011100000
|
||||
0x7F,0x00,0xE0, // 011111110000000011100000
|
||||
0x3E,0x00,0xE0, // 001111100000000011100000
|
||||
0x1C,0x00,0xE0, // 000111000000000011100000
|
||||
0x08,0x00,0xE0, // 000010000000000011100000
|
||||
0x00,0x00,0xE0, // 000000000000000011100000
|
||||
0x00,0x01,0xC0, // 000000000000000111000000
|
||||
0x0E,0x01,0xC0, // 000011100000000111000000
|
||||
0x0F,0x07,0x80, // 000011110000011110000000
|
||||
0x07,0xFF,0x00, // 000001111111111100000000
|
||||
0x01,0xFC,0x00 // 000000011111110000000000
|
||||
};
|
||||
|
||||
const unsigned char up_arrow_bmp[] PROGMEM = {
|
||||
0x04,0x00, // 000001000000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x1F,0x00, // 000111110000
|
||||
0x3F,0x80, // 001111111000
|
||||
0x7F,0xC0, // 011111111100
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00 // 000011100000
|
||||
};
|
||||
|
||||
const unsigned char down_arrow_bmp[] PROGMEM = {
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x7F,0xC0, // 011111111100
|
||||
0x3F,0x80, // 001111111000
|
||||
0x1F,0x00, // 000111110000
|
||||
0x0E,0x00, // 000011100000
|
||||
0x04,0x00 // 000001000000
|
||||
};
|
||||
|
||||
const unsigned char offset_bedline_bmp[] PROGMEM = {
|
||||
0xFF,0xFF,0xFF // 111111111111111111111111
|
||||
};
|
||||
|
||||
const unsigned char nozzle_bmp[] PROGMEM = {
|
||||
0x7F,0x80, // 0111111110000000
|
||||
0xFF,0xC0, // 1111111111000000
|
||||
0xFF,0xC0, // 1111111111000000
|
||||
0xFF,0xC0, // 1111111111000000
|
||||
0x7F,0x80, // 0111111110000000
|
||||
0x7F,0x80, // 0111111110000000
|
||||
0xFF,0xC0, // 1111111111000000
|
||||
0xFF,0xC0, // 1111111111000000
|
||||
0xFF,0xC0, // 1111111111000000
|
||||
0x3F,0x00, // 0011111100000000
|
||||
0x1E,0x00, // 0001111000000000
|
||||
0x0C,0x00 // 0000110000000000
|
||||
};
|
||||
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
|
||||
|
||||
+252
-164
@@ -32,167 +32,255 @@
|
||||
Max Font ascent = 8 descent=-1
|
||||
*/
|
||||
#include <U8glib.h>
|
||||
const u8g_fntpgm_uint8_t ISO10646_1_5x7[2592] U8G_SECTION(".progmem.ISO10646_1_5x7") = {
|
||||
0, 6, 9, 0, 254, 7, 1, 146, 3, 33, 32, 255, 255, 8, 255, 7,
|
||||
255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128,
|
||||
128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6,
|
||||
0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32,
|
||||
120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32,
|
||||
64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104,
|
||||
2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32,
|
||||
64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32,
|
||||
32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5,
|
||||
5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192,
|
||||
64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192,
|
||||
192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6,
|
||||
0, 0, 112, 136, 136, 136, 136, 136, 112, 3, 7, 7, 6, 1, 0, 64,
|
||||
192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112,
|
||||
128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240,
|
||||
5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7,
|
||||
6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0,
|
||||
112, 128, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16,
|
||||
32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136,
|
||||
112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 8, 112, 2, 5,
|
||||
5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192,
|
||||
192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64,
|
||||
32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1,
|
||||
0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136,
|
||||
8, 16, 32, 0, 32, 5, 7, 7, 6, 0, 0, 112, 136, 8, 104, 168,
|
||||
168, 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5,
|
||||
7, 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6,
|
||||
0, 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 240,
|
||||
136, 136, 136, 136, 136, 240, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240,
|
||||
128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128,
|
||||
5, 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7,
|
||||
6, 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0,
|
||||
128, 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16,
|
||||
16, 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144,
|
||||
136, 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7,
|
||||
7, 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0,
|
||||
0, 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136,
|
||||
136, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128,
|
||||
128, 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5,
|
||||
7, 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6,
|
||||
0, 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248,
|
||||
32, 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136,
|
||||
136, 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32,
|
||||
5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7,
|
||||
6, 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0,
|
||||
136, 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16,
|
||||
32, 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128,
|
||||
224, 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6,
|
||||
1, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32,
|
||||
80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128,
|
||||
64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6,
|
||||
0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112,
|
||||
128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136,
|
||||
120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6,
|
||||
0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112,
|
||||
136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136,
|
||||
136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3,
|
||||
8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7,
|
||||
6, 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0,
|
||||
192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168,
|
||||
168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5,
|
||||
6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136,
|
||||
136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8,
|
||||
5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0,
|
||||
0, 112, 128, 112, 8, 240, 4, 7, 7, 6, 0, 0, 64, 64, 224, 64,
|
||||
64, 64, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5,
|
||||
5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136,
|
||||
136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5,
|
||||
6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0,
|
||||
0, 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128,
|
||||
64, 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128,
|
||||
3, 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2,
|
||||
6, 0, 2, 104, 144, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 5, 7,
|
||||
7, 6, 0, 0, 32, 112, 168, 160, 168, 112, 32, 5, 7, 7, 6, 0,
|
||||
0, 48, 64, 64, 224, 64, 80, 168, 5, 5, 5, 6, 0, 0, 136, 112,
|
||||
80, 112, 136, 5, 7, 7, 6, 0, 0, 136, 80, 32, 248, 32, 248, 32,
|
||||
1, 7, 7, 6, 2, 0, 128, 128, 128, 0, 128, 128, 128, 5, 8, 8,
|
||||
6, 0, 0, 48, 72, 32, 80, 80, 32, 144, 96, 3, 1, 1, 6, 1,
|
||||
7, 160, 5, 7, 7, 6, 0, 0, 248, 136, 184, 184, 184, 136, 248, 5,
|
||||
7, 7, 6, 0, 1, 112, 8, 120, 136, 120, 0, 248, 5, 5, 5, 6,
|
||||
0, 1, 40, 80, 160, 80, 40, 5, 3, 3, 6, 0, 1, 248, 8, 8,
|
||||
2, 2, 2, 6, 2, 6, 64, 128, 5, 7, 7, 6, 0, 0, 248, 136,
|
||||
168, 136, 152, 168, 248, 5, 1, 1, 6, 0, 6, 248, 4, 4, 4, 6,
|
||||
0, 3, 96, 144, 144, 96, 5, 7, 7, 6, 0, 0, 32, 32, 248, 32,
|
||||
32, 0, 248, 4, 5, 5, 6, 0, 3, 96, 144, 32, 64, 240, 3, 5,
|
||||
5, 6, 0, 3, 224, 32, 224, 32, 224, 2, 2, 2, 6, 2, 6, 64,
|
||||
128, 5, 8, 8, 6, 0, 255, 136, 136, 136, 136, 152, 232, 128, 128, 5,
|
||||
7, 7, 6, 0, 0, 120, 152, 152, 120, 24, 24, 24, 2, 2, 2, 6,
|
||||
2, 2, 192, 192, 2, 2, 2, 6, 2, 255, 64, 128, 3, 5, 5, 6,
|
||||
0, 3, 64, 192, 64, 64, 224, 5, 7, 7, 6, 0, 1, 112, 136, 136,
|
||||
136, 112, 0, 248, 5, 5, 5, 6, 0, 1, 160, 80, 40, 80, 160, 5,
|
||||
7, 7, 6, 0, 0, 136, 144, 168, 88, 184, 8, 8, 5, 7, 7, 6,
|
||||
0, 0, 136, 144, 184, 72, 152, 32, 56, 5, 8, 8, 6, 0, 0, 192,
|
||||
64, 192, 72, 216, 56, 8, 8, 5, 7, 7, 6, 0, 0, 32, 0, 32,
|
||||
64, 128, 136, 112, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 248,
|
||||
136, 136, 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 248, 136, 136,
|
||||
5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, 248, 136, 136, 5, 8,
|
||||
8, 6, 0, 0, 104, 144, 0, 112, 136, 248, 136, 136, 5, 8, 8, 6,
|
||||
0, 0, 80, 0, 112, 136, 136, 248, 136, 136, 5, 8, 8, 6, 0, 0,
|
||||
32, 80, 32, 112, 136, 248, 136, 136, 5, 7, 7, 6, 0, 0, 56, 96,
|
||||
160, 184, 224, 160, 184, 5, 8, 8, 6, 0, 255, 112, 136, 128, 128, 136,
|
||||
112, 32, 96, 5, 8, 8, 6, 0, 0, 64, 32, 0, 248, 128, 240, 128,
|
||||
248, 5, 8, 8, 6, 0, 0, 8, 16, 0, 248, 128, 240, 128, 248, 5,
|
||||
8, 8, 6, 0, 0, 32, 80, 0, 248, 128, 240, 128, 248, 5, 7, 7,
|
||||
6, 0, 0, 80, 0, 248, 128, 240, 128, 248, 3, 8, 8, 6, 1, 0,
|
||||
128, 64, 0, 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 32, 64,
|
||||
0, 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 64, 160, 0, 224,
|
||||
64, 64, 64, 224, 3, 7, 7, 6, 1, 0, 160, 0, 224, 64, 64, 64,
|
||||
224, 5, 7, 7, 6, 0, 0, 112, 72, 72, 232, 72, 72, 112, 5, 8,
|
||||
8, 6, 0, 0, 104, 144, 0, 136, 200, 168, 152, 136, 5, 8, 8, 6,
|
||||
0, 0, 64, 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0,
|
||||
16, 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80,
|
||||
0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112,
|
||||
136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 80, 0, 112, 136, 136, 136,
|
||||
136, 112, 5, 5, 5, 6, 0, 1, 136, 80, 32, 80, 136, 5, 8, 8,
|
||||
6, 0, 255, 16, 112, 168, 168, 168, 168, 112, 64, 5, 8, 8, 6, 0,
|
||||
0, 64, 32, 136, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 16,
|
||||
32, 136, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0,
|
||||
136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 80, 0, 136, 136, 136,
|
||||
136, 136, 112, 5, 8, 8, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32,
|
||||
32, 5, 9, 9, 6, 0, 255, 192, 64, 112, 72, 72, 112, 64, 64, 224,
|
||||
4, 8, 8, 6, 1, 255, 96, 144, 144, 160, 144, 144, 224, 128, 5, 8,
|
||||
8, 6, 0, 0, 64, 32, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6,
|
||||
0, 0, 16, 32, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0,
|
||||
32, 80, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, 104, 144,
|
||||
0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, 0, 80, 0, 112, 8,
|
||||
120, 136, 120, 5, 8, 8, 6, 0, 0, 32, 80, 32, 112, 8, 120, 136,
|
||||
120, 5, 6, 6, 6, 0, 0, 208, 40, 120, 160, 168, 80, 5, 6, 6,
|
||||
6, 0, 255, 112, 128, 136, 112, 32, 96, 5, 8, 8, 6, 0, 0, 64,
|
||||
32, 0, 112, 136, 248, 128, 112, 5, 8, 8, 6, 0, 0, 16, 32, 0,
|
||||
112, 136, 248, 128, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136,
|
||||
248, 128, 112, 5, 7, 7, 6, 0, 0, 80, 0, 112, 136, 248, 128, 112,
|
||||
3, 8, 8, 6, 1, 0, 128, 64, 0, 64, 192, 64, 64, 224, 3, 8,
|
||||
8, 6, 1, 0, 32, 64, 0, 64, 192, 64, 64, 224, 3, 8, 8, 6,
|
||||
1, 0, 64, 160, 0, 64, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0,
|
||||
160, 0, 64, 192, 64, 64, 224, 5, 7, 7, 6, 0, 0, 160, 64, 160,
|
||||
16, 120, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 176, 200, 136,
|
||||
136, 136, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 136, 136, 112,
|
||||
5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 136, 136, 112, 5, 8,
|
||||
8, 6, 0, 0, 32, 80, 0, 112, 136, 136, 136, 112, 5, 8, 8, 6,
|
||||
0, 0, 104, 144, 0, 112, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0,
|
||||
80, 0, 112, 136, 136, 136, 112, 5, 5, 5, 6, 0, 1, 32, 0, 248,
|
||||
0, 32, 5, 7, 7, 6, 0, 255, 16, 112, 168, 168, 168, 112, 64, 5,
|
||||
8, 8, 6, 0, 0, 64, 32, 0, 136, 136, 136, 152, 104, 5, 8, 8,
|
||||
6, 0, 0, 16, 32, 0, 136, 136, 136, 152, 104, 5, 8, 8, 6, 0,
|
||||
0, 32, 80, 0, 136, 136, 136, 152, 104, 5, 7, 7, 6, 0, 0, 80,
|
||||
0, 136, 136, 136, 152, 104, 5, 9, 9, 6, 0, 255, 16, 32, 0, 136,
|
||||
136, 136, 248, 8, 112, 4, 7, 7, 6, 1, 255, 192, 64, 96, 80, 96,
|
||||
64, 224, 5, 8, 8, 6, 0, 255, 80, 0, 136, 136, 136, 120, 8, 112
|
||||
};
|
||||
|
||||
#if defined(__AVR__) && ENABLED(NOT_EXTENDED_ISO10646_1_5X7)
|
||||
|
||||
//
|
||||
// Reduced font (only symbols 32 - 127) - About 1400 bytes smaller
|
||||
//
|
||||
const u8g_fntpgm_uint8_t ISO10646_1_5x7[] U8G_SECTION(".progmem.ISO10646_1_5x7") = {
|
||||
0,6,9,0,254,7,1,146,3,33,32,127,255,7,255,7,
|
||||
255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
|
||||
128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
|
||||
0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
|
||||
120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
|
||||
64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
|
||||
2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
|
||||
64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
|
||||
32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
|
||||
5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
|
||||
64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
|
||||
192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
|
||||
0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64,
|
||||
192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
|
||||
128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
|
||||
5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
|
||||
6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
|
||||
112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
|
||||
32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
|
||||
112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5,
|
||||
5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
|
||||
192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
|
||||
32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
|
||||
0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
|
||||
8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168,
|
||||
168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,
|
||||
7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,
|
||||
0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240,
|
||||
136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240,
|
||||
128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,
|
||||
5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,
|
||||
6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,
|
||||
128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,
|
||||
16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,
|
||||
136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,
|
||||
7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,
|
||||
0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,
|
||||
136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,
|
||||
128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,
|
||||
7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,
|
||||
0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,
|
||||
32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,
|
||||
136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,
|
||||
5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,
|
||||
6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
|
||||
136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,
|
||||
32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,
|
||||
224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,
|
||||
1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,
|
||||
80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,
|
||||
64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,
|
||||
0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,
|
||||
128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,
|
||||
120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,
|
||||
0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,
|
||||
136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,
|
||||
136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,
|
||||
8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,
|
||||
6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,
|
||||
192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,
|
||||
168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,
|
||||
6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,
|
||||
136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,
|
||||
5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,
|
||||
0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64,
|
||||
64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5,
|
||||
5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,
|
||||
136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,
|
||||
6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,
|
||||
0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,
|
||||
64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,
|
||||
3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,
|
||||
6,0,2,104,144,0,0,0,6,0,0};
|
||||
|
||||
#else
|
||||
|
||||
//
|
||||
// Extended (original) font (symbols 32 - 255)
|
||||
//
|
||||
const u8g_fntpgm_uint8_t ISO10646_1_5x7[] U8G_SECTION(".progmem.ISO10646_1_5x7") = {
|
||||
0, 6, 9, 0, 254, 7, 1, 146, 3, 33, 32, 255, 255, 8, 255, 7,
|
||||
255, 0, 0, 0, 6, 0, 0, 1, 7, 7, 6, 2, 0, 128, 128, 128,
|
||||
128, 128, 0, 128, 3, 2, 2, 6, 1, 5, 160, 160, 5, 7, 7, 6,
|
||||
0, 0, 80, 80, 248, 80, 248, 80, 80, 5, 7, 7, 6, 0, 0, 32,
|
||||
120, 160, 112, 40, 240, 32, 5, 7, 7, 6, 0, 0, 192, 200, 16, 32,
|
||||
64, 152, 24, 5, 7, 7, 6, 0, 0, 96, 144, 160, 64, 168, 144, 104,
|
||||
2, 3, 3, 6, 1, 4, 192, 64, 128, 3, 7, 7, 6, 1, 0, 32,
|
||||
64, 128, 128, 128, 64, 32, 3, 7, 7, 6, 1, 0, 128, 64, 32, 32,
|
||||
32, 64, 128, 5, 5, 5, 6, 0, 1, 32, 168, 112, 168, 32, 5, 5,
|
||||
5, 6, 0, 1, 32, 32, 248, 32, 32, 2, 3, 3, 6, 2, 255, 192,
|
||||
64, 128, 5, 1, 1, 6, 0, 3, 248, 2, 2, 2, 6, 2, 0, 192,
|
||||
192, 5, 5, 5, 6, 0, 1, 8, 16, 32, 64, 128, 5, 7, 7, 6,
|
||||
0, 0, 112, 136, 136, 136, 136, 136, 112, 3, 7, 7, 6, 1, 0, 64,
|
||||
192, 64, 64, 64, 64, 224, 5, 7, 7, 6, 0, 0, 112, 136, 8, 112,
|
||||
128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 16, 32, 16, 8, 8, 240,
|
||||
5, 7, 7, 6, 0, 0, 16, 48, 80, 144, 248, 16, 16, 5, 7, 7,
|
||||
6, 0, 0, 248, 128, 240, 8, 8, 136, 112, 5, 7, 7, 6, 0, 0,
|
||||
112, 128, 128, 240, 136, 136, 112, 5, 7, 7, 6, 0, 0, 248, 8, 16,
|
||||
32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 112, 136, 136, 112, 136, 136,
|
||||
112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 120, 8, 8, 112, 2, 5,
|
||||
5, 6, 2, 0, 192, 192, 0, 192, 192, 2, 6, 6, 6, 2, 255, 192,
|
||||
192, 0, 192, 64, 128, 4, 7, 7, 6, 0, 0, 16, 32, 64, 128, 64,
|
||||
32, 16, 5, 3, 3, 6, 0, 2, 248, 0, 248, 4, 7, 7, 6, 1,
|
||||
0, 128, 64, 32, 16, 32, 64, 128, 5, 7, 7, 6, 0, 0, 112, 136,
|
||||
8, 16, 32, 0, 32, 5, 7, 7, 6, 0, 0, 112, 136, 8, 104, 168,
|
||||
168, 112, 5, 7, 7, 6, 0, 0, 112, 136, 136, 248, 136, 136, 136, 5,
|
||||
7, 7, 6, 0, 0, 240, 136, 136, 240, 136, 136, 240, 5, 7, 7, 6,
|
||||
0, 0, 112, 136, 128, 128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 240,
|
||||
136, 136, 136, 136, 136, 240, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240,
|
||||
128, 128, 248, 5, 7, 7, 6, 0, 0, 248, 128, 128, 240, 128, 128, 128,
|
||||
5, 7, 7, 6, 0, 0, 112, 136, 128, 184, 136, 136, 112, 5, 7, 7,
|
||||
6, 0, 0, 136, 136, 136, 248, 136, 136, 136, 1, 7, 7, 6, 2, 0,
|
||||
128, 128, 128, 128, 128, 128, 128, 5, 7, 7, 6, 0, 0, 56, 16, 16,
|
||||
16, 16, 144, 96, 5, 7, 7, 6, 0, 0, 136, 144, 160, 192, 160, 144,
|
||||
136, 5, 7, 7, 6, 0, 0, 128, 128, 128, 128, 128, 128, 248, 5, 7,
|
||||
7, 6, 0, 0, 136, 216, 168, 136, 136, 136, 136, 5, 7, 7, 6, 0,
|
||||
0, 136, 136, 200, 168, 152, 136, 136, 5, 7, 7, 6, 0, 0, 112, 136,
|
||||
136, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0, 240, 136, 136, 240, 128,
|
||||
128, 128, 5, 7, 7, 6, 0, 0, 112, 136, 136, 136, 168, 144, 104, 5,
|
||||
7, 7, 6, 0, 0, 240, 136, 136, 240, 160, 144, 136, 5, 7, 7, 6,
|
||||
0, 0, 120, 128, 128, 112, 8, 8, 240, 5, 7, 7, 6, 0, 0, 248,
|
||||
32, 32, 32, 32, 32, 32, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136,
|
||||
136, 136, 112, 5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 80, 32,
|
||||
5, 7, 7, 6, 0, 0, 136, 136, 136, 136, 136, 168, 80, 5, 7, 7,
|
||||
6, 0, 0, 136, 136, 80, 32, 80, 136, 136, 5, 7, 7, 6, 0, 0,
|
||||
136, 136, 136, 80, 32, 32, 32, 5, 7, 7, 6, 0, 0, 248, 8, 16,
|
||||
32, 64, 128, 248, 3, 7, 7, 6, 1, 0, 224, 128, 128, 128, 128, 128,
|
||||
224, 5, 5, 5, 6, 0, 1, 128, 64, 32, 16, 8, 3, 7, 7, 6,
|
||||
1, 0, 224, 32, 32, 32, 32, 32, 224, 5, 3, 3, 6, 0, 4, 32,
|
||||
80, 136, 5, 1, 1, 6, 0, 0, 248, 2, 2, 2, 6, 2, 5, 128,
|
||||
64, 5, 5, 5, 6, 0, 0, 112, 8, 120, 136, 120, 5, 7, 7, 6,
|
||||
0, 0, 128, 128, 176, 200, 136, 136, 240, 5, 5, 5, 6, 0, 0, 112,
|
||||
128, 128, 136, 112, 5, 7, 7, 6, 0, 0, 8, 8, 104, 152, 136, 136,
|
||||
120, 5, 5, 5, 6, 0, 0, 112, 136, 248, 128, 112, 5, 7, 7, 6,
|
||||
0, 0, 48, 72, 224, 64, 64, 64, 64, 5, 6, 6, 6, 0, 255, 112,
|
||||
136, 136, 120, 8, 112, 5, 7, 7, 6, 0, 0, 128, 128, 176, 200, 136,
|
||||
136, 136, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 3,
|
||||
8, 8, 6, 1, 255, 32, 0, 32, 32, 32, 32, 160, 64, 4, 7, 7,
|
||||
6, 0, 0, 128, 128, 144, 160, 192, 160, 144, 3, 7, 7, 6, 1, 0,
|
||||
192, 64, 64, 64, 64, 64, 224, 5, 5, 5, 6, 0, 0, 208, 168, 168,
|
||||
168, 168, 5, 5, 5, 6, 0, 0, 176, 200, 136, 136, 136, 5, 5, 5,
|
||||
6, 0, 0, 112, 136, 136, 136, 112, 5, 6, 6, 6, 0, 255, 240, 136,
|
||||
136, 240, 128, 128, 5, 6, 6, 6, 0, 255, 120, 136, 136, 120, 8, 8,
|
||||
5, 5, 5, 6, 0, 0, 176, 200, 128, 128, 128, 5, 5, 5, 6, 0,
|
||||
0, 112, 128, 112, 8, 240, 4, 7, 7, 6, 0, 0, 64, 64, 224, 64,
|
||||
64, 64, 48, 5, 5, 5, 6, 0, 0, 136, 136, 136, 152, 104, 5, 5,
|
||||
5, 6, 0, 0, 136, 136, 136, 80, 32, 5, 5, 5, 6, 0, 0, 136,
|
||||
136, 168, 168, 80, 5, 5, 5, 6, 0, 0, 136, 80, 32, 80, 136, 5,
|
||||
6, 6, 6, 0, 255, 136, 136, 136, 120, 8, 112, 5, 5, 5, 6, 0,
|
||||
0, 248, 16, 32, 64, 248, 3, 7, 7, 6, 1, 0, 32, 64, 64, 128,
|
||||
64, 64, 32, 1, 7, 7, 6, 2, 0, 128, 128, 128, 128, 128, 128, 128,
|
||||
3, 7, 7, 6, 1, 0, 128, 64, 64, 32, 64, 64, 128, 5, 2, 2,
|
||||
6, 0, 2, 104, 144, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, 1, 7, 7, 6, 2, 0, 128, 0, 128, 128, 128, 128, 128, 5, 7,
|
||||
7, 6, 0, 0, 32, 112, 168, 160, 168, 112, 32, 5, 7, 7, 6, 0,
|
||||
0, 48, 64, 64, 224, 64, 80, 168, 5, 5, 5, 6, 0, 0, 136, 112,
|
||||
80, 112, 136, 5, 7, 7, 6, 0, 0, 136, 80, 32, 248, 32, 248, 32,
|
||||
1, 7, 7, 6, 2, 0, 128, 128, 128, 0, 128, 128, 128, 5, 8, 8,
|
||||
6, 0, 0, 48, 72, 32, 80, 80, 32, 144, 96, 3, 1, 1, 6, 1,
|
||||
7, 160, 5, 7, 7, 6, 0, 0, 248, 136, 184, 184, 184, 136, 248, 5,
|
||||
7, 7, 6, 0, 1, 112, 8, 120, 136, 120, 0, 248, 5, 5, 5, 6,
|
||||
0, 1, 40, 80, 160, 80, 40, 5, 3, 3, 6, 0, 1, 248, 8, 8,
|
||||
2, 2, 2, 6, 2, 6, 64, 128, 5, 7, 7, 6, 0, 0, 248, 136,
|
||||
168, 136, 152, 168, 248, 5, 1, 1, 6, 0, 6, 248, 4, 4, 4, 6,
|
||||
0, 3, 96, 144, 144, 96, 5, 7, 7, 6, 0, 0, 32, 32, 248, 32,
|
||||
32, 0, 248, 4, 5, 5, 6, 0, 3, 96, 144, 32, 64, 240, 3, 5,
|
||||
5, 6, 0, 3, 224, 32, 224, 32, 224, 2, 2, 2, 6, 2, 6, 64,
|
||||
128, 5, 8, 8, 6, 0, 255, 136, 136, 136, 136, 152, 232, 128, 128, 5,
|
||||
7, 7, 6, 0, 0, 120, 152, 152, 120, 24, 24, 24, 2, 2, 2, 6,
|
||||
2, 2, 192, 192, 2, 2, 2, 6, 2, 255, 64, 128, 3, 5, 5, 6,
|
||||
0, 3, 64, 192, 64, 64, 224, 5, 7, 7, 6, 0, 1, 112, 136, 136,
|
||||
136, 112, 0, 248, 5, 5, 5, 6, 0, 1, 160, 80, 40, 80, 160, 5,
|
||||
7, 7, 6, 0, 0, 136, 144, 168, 88, 184, 8, 8, 5, 7, 7, 6,
|
||||
0, 0, 136, 144, 184, 72, 152, 32, 56, 5, 8, 8, 6, 0, 0, 192,
|
||||
64, 192, 72, 216, 56, 8, 8, 5, 7, 7, 6, 0, 0, 32, 0, 32,
|
||||
64, 128, 136, 112, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 248,
|
||||
136, 136, 5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 248, 136, 136,
|
||||
5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136, 248, 136, 136, 5, 8,
|
||||
8, 6, 0, 0, 104, 144, 0, 112, 136, 248, 136, 136, 5, 8, 8, 6,
|
||||
0, 0, 80, 0, 112, 136, 136, 248, 136, 136, 5, 8, 8, 6, 0, 0,
|
||||
32, 80, 32, 112, 136, 248, 136, 136, 5, 7, 7, 6, 0, 0, 56, 96,
|
||||
160, 184, 224, 160, 184, 5, 8, 8, 6, 0, 255, 112, 136, 128, 128, 136,
|
||||
112, 32, 96, 5, 8, 8, 6, 0, 0, 64, 32, 0, 248, 128, 240, 128,
|
||||
248, 5, 8, 8, 6, 0, 0, 8, 16, 0, 248, 128, 240, 128, 248, 5,
|
||||
8, 8, 6, 0, 0, 32, 80, 0, 248, 128, 240, 128, 248, 5, 7, 7,
|
||||
6, 0, 0, 80, 0, 248, 128, 240, 128, 248, 3, 8, 8, 6, 1, 0,
|
||||
128, 64, 0, 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 32, 64,
|
||||
0, 224, 64, 64, 64, 224, 3, 8, 8, 6, 1, 0, 64, 160, 0, 224,
|
||||
64, 64, 64, 224, 3, 7, 7, 6, 1, 0, 160, 0, 224, 64, 64, 64,
|
||||
224, 5, 7, 7, 6, 0, 0, 112, 72, 72, 232, 72, 72, 112, 5, 8,
|
||||
8, 6, 0, 0, 104, 144, 0, 136, 200, 168, 152, 136, 5, 8, 8, 6,
|
||||
0, 0, 64, 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0,
|
||||
16, 32, 112, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80,
|
||||
0, 112, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 112,
|
||||
136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 80, 0, 112, 136, 136, 136,
|
||||
136, 112, 5, 5, 5, 6, 0, 1, 136, 80, 32, 80, 136, 5, 8, 8,
|
||||
6, 0, 255, 16, 112, 168, 168, 168, 168, 112, 64, 5, 8, 8, 6, 0,
|
||||
0, 64, 32, 136, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 16,
|
||||
32, 136, 136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0,
|
||||
136, 136, 136, 136, 112, 5, 8, 8, 6, 0, 0, 80, 0, 136, 136, 136,
|
||||
136, 136, 112, 5, 8, 8, 6, 0, 0, 16, 32, 136, 80, 32, 32, 32,
|
||||
32, 5, 9, 9, 6, 0, 255, 192, 64, 112, 72, 72, 112, 64, 64, 224,
|
||||
4, 8, 8, 6, 1, 255, 96, 144, 144, 160, 144, 144, 224, 128, 5, 8,
|
||||
8, 6, 0, 0, 64, 32, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6,
|
||||
0, 0, 16, 32, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0,
|
||||
32, 80, 0, 112, 8, 120, 136, 120, 5, 8, 8, 6, 0, 0, 104, 144,
|
||||
0, 112, 8, 120, 136, 120, 5, 7, 7, 6, 0, 0, 80, 0, 112, 8,
|
||||
120, 136, 120, 5, 8, 8, 6, 0, 0, 32, 80, 32, 112, 8, 120, 136,
|
||||
120, 5, 6, 6, 6, 0, 0, 208, 40, 120, 160, 168, 80, 5, 6, 6,
|
||||
6, 0, 255, 112, 128, 136, 112, 32, 96, 5, 8, 8, 6, 0, 0, 64,
|
||||
32, 0, 112, 136, 248, 128, 112, 5, 8, 8, 6, 0, 0, 16, 32, 0,
|
||||
112, 136, 248, 128, 112, 5, 8, 8, 6, 0, 0, 32, 80, 0, 112, 136,
|
||||
248, 128, 112, 5, 7, 7, 6, 0, 0, 80, 0, 112, 136, 248, 128, 112,
|
||||
3, 8, 8, 6, 1, 0, 128, 64, 0, 64, 192, 64, 64, 224, 3, 8,
|
||||
8, 6, 1, 0, 32, 64, 0, 64, 192, 64, 64, 224, 3, 8, 8, 6,
|
||||
1, 0, 64, 160, 0, 64, 192, 64, 64, 224, 3, 7, 7, 6, 1, 0,
|
||||
160, 0, 64, 192, 64, 64, 224, 5, 7, 7, 6, 0, 0, 160, 64, 160,
|
||||
16, 120, 136, 112, 5, 8, 8, 6, 0, 0, 104, 144, 0, 176, 200, 136,
|
||||
136, 136, 5, 8, 8, 6, 0, 0, 64, 32, 0, 112, 136, 136, 136, 112,
|
||||
5, 8, 8, 6, 0, 0, 16, 32, 0, 112, 136, 136, 136, 112, 5, 8,
|
||||
8, 6, 0, 0, 32, 80, 0, 112, 136, 136, 136, 112, 5, 8, 8, 6,
|
||||
0, 0, 104, 144, 0, 112, 136, 136, 136, 112, 5, 7, 7, 6, 0, 0,
|
||||
80, 0, 112, 136, 136, 136, 112, 5, 5, 5, 6, 0, 1, 32, 0, 248,
|
||||
0, 32, 5, 7, 7, 6, 0, 255, 16, 112, 168, 168, 168, 112, 64, 5,
|
||||
8, 8, 6, 0, 0, 64, 32, 0, 136, 136, 136, 152, 104, 5, 8, 8,
|
||||
6, 0, 0, 16, 32, 0, 136, 136, 136, 152, 104, 5, 8, 8, 6, 0,
|
||||
0, 32, 80, 0, 136, 136, 136, 152, 104, 5, 7, 7, 6, 0, 0, 80,
|
||||
0, 136, 136, 136, 152, 104, 5, 9, 9, 6, 0, 255, 16, 32, 0, 136,
|
||||
136, 136, 248, 8, 112, 4, 7, 7, 6, 1, 255, 192, 64, 96, 80, 96,
|
||||
64, 224, 5, 8, 8, 6, 0, 255, 80, 0, 136, 136, 136, 120, 8, 112
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
Fontname: ISO10646_CZ
|
||||
Copyright: A. Hardtung, public domain
|
||||
Modified for Czech accents by Petr Zahradnik, http://www.zahradniksebavi.cz
|
||||
Capital A Height: 7, '1' Height: 7
|
||||
Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9
|
||||
Font Bounding box w= 6 h= 9 x= 0 y=-2
|
||||
Calculated Min Values x= 0 y=-1 dx= 0 dy= 0
|
||||
Pure Font ascent = 7 descent=-1
|
||||
X Font ascent = 7 descent=-1
|
||||
Max Font ascent = 8 descent=-1
|
||||
*/
|
||||
#include <U8glib.h>
|
||||
const u8g_fntpgm_uint8_t ISO10646_CZ[2832] U8G_SECTION(".progmem.ISO10646_CZ") = {
|
||||
0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7,
|
||||
255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
|
||||
128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
|
||||
0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
|
||||
120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
|
||||
64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
|
||||
2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
|
||||
64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
|
||||
32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
|
||||
5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
|
||||
64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
|
||||
192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
|
||||
0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64,
|
||||
192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
|
||||
128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
|
||||
5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
|
||||
6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
|
||||
112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
|
||||
32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
|
||||
112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5,
|
||||
5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
|
||||
192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
|
||||
32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
|
||||
0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
|
||||
8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168,
|
||||
168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,
|
||||
7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,
|
||||
0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240,
|
||||
136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240,
|
||||
128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,
|
||||
5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,
|
||||
6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,
|
||||
128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,
|
||||
16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,
|
||||
136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,
|
||||
7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,
|
||||
0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,
|
||||
136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,
|
||||
128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,
|
||||
7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,
|
||||
0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,
|
||||
32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,
|
||||
136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,
|
||||
5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,
|
||||
6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
|
||||
136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,
|
||||
32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,
|
||||
224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,
|
||||
1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,
|
||||
80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,
|
||||
64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,
|
||||
0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,
|
||||
128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,
|
||||
120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,
|
||||
0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,
|
||||
136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,
|
||||
136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,
|
||||
8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,
|
||||
6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,
|
||||
192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,
|
||||
168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,
|
||||
6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,
|
||||
136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,
|
||||
5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,
|
||||
0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64,
|
||||
64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5,
|
||||
5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,
|
||||
136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,
|
||||
6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,
|
||||
0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,
|
||||
64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,
|
||||
3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,
|
||||
6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0,
|
||||
0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,8,
|
||||
16,248,128,128,240,128,248,3,8,8,6,1,0,32,64,224,
|
||||
64,64,64,64,224,5,8,8,6,0,0,16,32,112,136,136,
|
||||
136,136,112,5,8,8,6,0,0,16,32,136,136,136,136,136,
|
||||
112,5,8,8,6,0,0,16,32,136,136,80,32,32,32,5,
|
||||
8,8,6,0,0,16,32,0,112,8,120,136,120,5,8,8,
|
||||
6,0,0,16,32,0,112,136,248,128,112,2,8,8,6,2,
|
||||
0,64,128,0,128,128,128,128,128,5,8,8,6,0,0,16,
|
||||
32,0,112,136,136,136,112,5,8,8,6,0,0,16,32,0,
|
||||
136,136,136,152,104,5,9,9,6,0,255,16,32,0,136,136,
|
||||
136,120,8,112,5,8,8,6,0,0,80,32,112,136,128,128,
|
||||
136,112,5,8,8,6,0,0,80,32,0,112,128,128,136,112,
|
||||
5,8,8,6,0,0,80,32,240,136,136,136,136,240,6,8,
|
||||
8,6,0,0,4,20,24,112,144,144,144,112,5,8,8,6,
|
||||
0,0,80,32,248,128,128,240,128,248,5,8,8,6,0,0,
|
||||
80,32,0,112,136,248,128,112,5,8,8,6,0,0,80,32,
|
||||
136,200,168,152,136,136,5,8,8,6,0,0,80,32,0,176,
|
||||
200,136,136,136,5,8,8,6,0,0,80,32,240,136,240,160,
|
||||
144,136,5,8,8,6,0,0,80,32,0,176,200,128,128,128,
|
||||
5,8,8,6,0,0,80,32,120,128,128,112,8,240,5,8,
|
||||
8,6,0,0,80,32,0,112,128,112,8,240,5,8,8,6,
|
||||
0,0,80,32,248,32,32,32,32,32,6,8,8,6,0,0,
|
||||
4,68,72,224,64,64,64,48,5,8,8,6,0,0,32,80,
|
||||
168,136,136,136,136,112,5,8,8,6,0,0,32,80,32,136,
|
||||
136,136,152,104,5,8,8,6,0,0,80,32,248,8,48,64,
|
||||
128,248,5,8,8,6,0,0,80,32,0,248,16,32,64,248,
|
||||
0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,
|
||||
0,0,1,7,7,6,2,0,128,0,128,128,128,128,128,5,
|
||||
7,7,6,0,0,32,112,168,160,168,112,32,5,7,7,6,
|
||||
0,0,48,64,64,224,64,80,168,5,5,5,6,0,0,136,
|
||||
112,80,112,136,5,7,7,6,0,0,136,80,32,248,32,248,
|
||||
32,1,7,7,6,2,0,128,128,128,0,128,128,128,5,8,
|
||||
8,6,0,0,48,72,32,80,80,32,144,96,3,1,1,6,
|
||||
1,7,160,5,7,7,6,0,0,248,136,184,184,184,136,248,
|
||||
5,7,7,6,0,1,112,8,120,136,120,0,248,5,5,5,
|
||||
6,0,1,40,80,160,80,40,5,3,3,6,0,1,248,8,
|
||||
8,2,2,2,6,2,6,64,128,5,7,7,6,0,0,248,
|
||||
136,168,136,152,168,248,5,1,1,6,0,6,248,4,4,4,
|
||||
6,0,3,96,144,144,96,5,7,7,6,0,0,32,32,248,
|
||||
32,32,0,248,4,5,5,6,0,3,96,144,32,64,240,3,
|
||||
5,5,6,0,3,224,32,224,32,224,2,2,2,6,2,6,
|
||||
64,128,5,8,8,6,0,255,136,136,136,136,152,232,128,128,
|
||||
5,7,7,6,0,0,120,152,152,120,24,24,24,2,2,2,
|
||||
6,2,2,192,192,2,2,2,6,2,255,64,128,3,5,5,
|
||||
6,0,3,64,192,64,64,224,5,7,7,6,0,1,112,136,
|
||||
136,136,112,0,248,5,5,5,6,0,1,160,80,40,80,160,
|
||||
5,7,7,6,0,0,136,144,168,88,184,8,8,5,7,7,
|
||||
6,0,0,136,144,184,72,152,32,56,5,8,8,6,0,0,
|
||||
192,64,192,72,216,56,8,8,5,7,7,6,0,0,32,0,
|
||||
32,64,128,136,112,5,8,8,6,0,0,64,32,0,112,136,
|
||||
248,136,136,5,8,8,6,0,0,16,32,0,112,136,248,136,
|
||||
136,5,8,8,6,0,0,32,80,0,112,136,248,136,136,5,
|
||||
8,8,6,0,0,104,144,0,112,136,248,136,136,5,8,8,
|
||||
6,0,0,80,0,112,136,136,248,136,136,5,8,8,6,0,
|
||||
0,32,80,32,112,136,248,136,136,5,7,7,6,0,0,56,
|
||||
96,160,184,224,160,184,5,8,8,6,0,255,112,136,128,128,
|
||||
136,112,32,96,5,8,8,6,0,0,64,32,0,248,128,240,
|
||||
128,248,5,8,8,6,0,0,8,16,0,248,128,240,128,248,
|
||||
5,8,8,6,0,0,32,80,0,248,128,240,128,248,5,7,
|
||||
7,6,0,0,80,0,248,128,240,128,248,3,8,8,6,1,
|
||||
0,128,64,0,224,64,64,64,224,3,8,8,6,1,0,32,
|
||||
64,0,224,64,64,64,224,3,8,8,6,1,0,64,160,0,
|
||||
224,64,64,64,224,3,7,7,6,1,0,160,0,224,64,64,
|
||||
64,224,5,9,9,6,0,255,80,32,112,136,128,184,136,136,
|
||||
112,5,8,8,6,0,0,104,144,0,136,200,168,152,136,5,
|
||||
8,8,6,0,0,64,32,112,136,136,136,136,112,5,8,8,
|
||||
6,0,0,16,32,112,136,136,136,136,112,5,8,8,6,0,
|
||||
0,32,80,0,112,136,136,136,112,5,8,8,6,0,0,104,
|
||||
144,0,112,136,136,136,112,5,8,8,6,0,0,80,0,112,
|
||||
136,136,136,136,112,5,5,5,6,0,1,136,80,32,80,136,
|
||||
5,8,8,6,0,255,16,112,168,168,168,168,112,64,5,8,
|
||||
8,6,0,0,64,32,136,136,136,136,136,112,5,8,8,6,
|
||||
0,0,16,32,136,136,136,136,136,112,5,8,8,6,0,0,
|
||||
32,80,0,136,136,136,136,112,5,8,8,6,0,0,80,0,
|
||||
136,136,136,136,136,112,1,7,7,6,2,0,128,0,128,128,
|
||||
128,128,128,5,9,9,6,0,255,120,128,128,112,8,8,240,
|
||||
32,96,4,8,8,6,1,255,96,144,144,160,144,144,224,128,
|
||||
5,8,8,6,0,0,64,32,0,112,8,120,136,120,5,8,
|
||||
8,6,0,0,16,32,0,112,8,120,136,120,5,8,8,6,
|
||||
0,0,32,80,0,112,8,120,136,120,5,8,8,6,0,0,
|
||||
104,144,0,112,8,120,136,120,5,7,7,6,0,0,80,0,
|
||||
112,8,120,136,120,5,8,8,6,0,0,32,80,32,112,8,
|
||||
120,136,120,5,6,6,6,0,0,208,40,120,160,168,80,5,
|
||||
7,7,6,0,255,112,128,128,136,112,32,96,5,8,8,6,
|
||||
0,0,64,32,0,112,136,248,128,112,5,8,8,6,0,0,
|
||||
16,32,0,112,136,248,128,112,5,8,8,6,0,0,32,80,
|
||||
0,112,136,248,128,112,5,7,7,6,0,0,80,0,112,136,
|
||||
248,128,112,3,8,8,6,1,0,128,64,0,64,192,64,64,
|
||||
224,3,8,8,6,1,0,32,64,0,64,192,64,64,224,3,
|
||||
8,8,6,1,0,64,160,0,64,192,64,64,224,3,7,7,
|
||||
6,1,0,160,0,64,192,64,64,224,5,8,8,6,0,255,
|
||||
80,32,112,136,136,120,8,112,5,8,8,6,0,0,104,144,
|
||||
0,176,200,136,136,136,5,8,8,6,0,0,64,32,0,112,
|
||||
136,136,136,112,5,8,8,6,0,0,16,32,0,112,136,136,
|
||||
136,112,5,8,8,6,0,0,32,80,0,112,136,136,136,112,
|
||||
5,8,8,6,0,0,104,144,0,112,136,136,136,112,5,7,
|
||||
7,6,0,0,80,0,112,136,136,136,112,5,5,5,6,0,
|
||||
1,32,0,248,0,32,5,7,7,6,0,255,16,112,168,168,
|
||||
168,112,64,5,8,8,6,0,0,64,32,0,136,136,136,152,
|
||||
104,5,8,8,6,0,0,16,32,0,136,136,136,152,104,5,
|
||||
8,8,6,0,0,32,80,0,136,136,136,152,104,5,7,7,
|
||||
6,0,0,80,0,136,136,136,152,104,1,5,5,6,2,0,
|
||||
128,128,128,128,128,5,7,7,6,0,255,112,128,112,8,240,
|
||||
32,96,5,8,8,6,0,255,80,0,136,136,136,120,8,112
|
||||
};
|
||||
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
Fontname: ISO10646_SK
|
||||
Copyright: A. Hardtung, modified by Roman Moravcik
|
||||
Capital A Height: 7, '1' Height: 7
|
||||
Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9
|
||||
Font Bounding box w= 6 h= 9 x= 0 y=-2
|
||||
Calculated Min Values x= 0 y=-1 dx= 0 dy= 0
|
||||
Pure Font ascent = 7 descent=-1
|
||||
X Font ascent = 7 descent=-1
|
||||
Max Font ascent = 8 descent=-1
|
||||
*/
|
||||
#include <U8glib.h>
|
||||
const u8g_fntpgm_uint8_t ISO10646_SK[2203] U8G_SECTION(".progmem.ISO10646_SK") = {
|
||||
0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7,
|
||||
255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
|
||||
128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
|
||||
0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
|
||||
120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
|
||||
64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
|
||||
2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
|
||||
64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
|
||||
32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
|
||||
5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
|
||||
64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
|
||||
192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
|
||||
0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64,
|
||||
192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
|
||||
128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
|
||||
5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
|
||||
6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
|
||||
112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
|
||||
32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
|
||||
112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5,
|
||||
5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
|
||||
192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
|
||||
32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
|
||||
0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
|
||||
8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168,
|
||||
168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,
|
||||
7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,
|
||||
0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240,
|
||||
136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240,
|
||||
128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,
|
||||
5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,
|
||||
6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,
|
||||
128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,
|
||||
16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,
|
||||
136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,
|
||||
7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,
|
||||
0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,
|
||||
136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,
|
||||
128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,
|
||||
7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,
|
||||
0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,
|
||||
32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,
|
||||
136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,
|
||||
5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,
|
||||
6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
|
||||
136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,
|
||||
32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,
|
||||
224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,
|
||||
1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,
|
||||
80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,
|
||||
64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,
|
||||
0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,
|
||||
128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,
|
||||
120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,
|
||||
0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,
|
||||
136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,
|
||||
136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,
|
||||
8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,
|
||||
6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,
|
||||
192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,
|
||||
168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,
|
||||
6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,
|
||||
136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,
|
||||
5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,
|
||||
0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64,
|
||||
64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5,
|
||||
5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,
|
||||
136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,
|
||||
6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,
|
||||
0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,
|
||||
64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,
|
||||
3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,
|
||||
6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0,
|
||||
0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,80,
|
||||
0,112,136,136,248,136,136,5,8,8,6,0,0,8,16,248,
|
||||
128,128,240,128,248,3,8,8,6,1,0,32,64,224,64,64,
|
||||
64,64,224,5,8,8,6,0,0,16,32,112,136,136,136,136,
|
||||
112,5,8,8,6,0,0,32,80,112,136,136,136,136,112,5,
|
||||
8,8,6,0,0,16,32,136,136,136,136,136,112,5,8,8,
|
||||
6,0,0,16,32,136,136,80,32,32,32,5,8,8,6,0,
|
||||
0,16,32,0,112,8,120,136,120,5,7,7,6,0,0,80,
|
||||
0,112,8,120,136,120,5,8,8,6,0,0,16,32,0,112,
|
||||
136,248,128,112,2,8,8,6,2,0,64,128,0,128,128,128,
|
||||
128,128,5,8,8,6,0,0,16,32,0,112,136,136,136,112,
|
||||
5,8,8,6,0,0,32,80,0,112,136,136,136,112,5,8,
|
||||
8,6,0,0,16,32,0,136,136,136,152,104,5,9,9,6,
|
||||
0,255,16,32,0,136,136,136,120,8,112,5,8,8,6,0,
|
||||
0,80,32,112,136,128,128,136,112,5,8,8,6,0,0,80,
|
||||
32,0,112,128,128,136,112,5,8,8,6,0,0,80,32,240,
|
||||
136,136,136,136,240,6,8,8,6,0,0,4,20,24,112,144,
|
||||
144,144,112,5,8,8,6,0,0,16,32,128,128,128,128,128,
|
||||
248,3,8,8,6,1,0,32,64,0,192,64,64,64,224,5,
|
||||
8,8,6,0,0,16,144,160,128,128,128,128,248,5,8,8,
|
||||
6,1,0,8,200,80,64,64,64,64,224,5,8,8,6,0,
|
||||
0,80,32,136,200,168,152,136,136,5,8,8,6,0,0,80,
|
||||
32,0,176,200,136,136,136,5,8,8,6,0,0,16,32,240,
|
||||
136,240,160,144,136,5,8,8,6,0,0,16,32,0,176,200,
|
||||
128,128,128,5,8,8,6,0,0,80,32,120,128,128,112,8,
|
||||
240,5,8,8,6,0,0,80,32,0,112,128,112,8,240,5,
|
||||
8,8,6,0,0,80,32,248,32,32,32,32,32,6,8,8,
|
||||
6,0,0,4,68,72,224,64,64,64,48,5,8,8,6,0,
|
||||
0,80,32,248,8,48,64,128,248,5,8,8,6,0,0,80,
|
||||
32,0,248,16,32,64,248,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
|
||||
0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
|
||||
6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
|
||||
0,0,6,0,0,0,0,0,6,0,0};
|
||||
+50
-10
@@ -111,7 +111,7 @@ void endstop_ISR(void) { endstop_ISR_worker(); }
|
||||
void setup_endstop_interrupts( void ) {
|
||||
|
||||
#if HAS_X_MAX
|
||||
#if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT) // if pin has an external interrupt
|
||||
#if digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT // if pin has an external interrupt
|
||||
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -121,7 +121,7 @@ void setup_endstop_interrupts( void ) {
|
||||
#endif
|
||||
|
||||
#if HAS_X_MIN
|
||||
#if (digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
#if digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT
|
||||
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -131,7 +131,7 @@ void setup_endstop_interrupts( void ) {
|
||||
#endif
|
||||
|
||||
#if HAS_Y_MAX
|
||||
#if (digitalPinToInterrupt(Y_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
#if digitalPinToInterrupt(Y_MAX_PIN) != NOT_AN_INTERRUPT
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -141,7 +141,7 @@ void setup_endstop_interrupts( void ) {
|
||||
#endif
|
||||
|
||||
#if HAS_Y_MIN
|
||||
#if (digitalPinToInterrupt(Y_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
#if digitalPinToInterrupt(Y_MIN_PIN) != NOT_AN_INTERRUPT
|
||||
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -151,7 +151,7 @@ void setup_endstop_interrupts( void ) {
|
||||
#endif
|
||||
|
||||
#if HAS_Z_MAX
|
||||
#if (digitalPinToInterrupt(Z_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
#if digitalPinToInterrupt(Z_MAX_PIN) != NOT_AN_INTERRUPT
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -161,7 +161,7 @@ void setup_endstop_interrupts( void ) {
|
||||
#endif
|
||||
|
||||
#if HAS_Z_MIN
|
||||
#if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
#if digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -170,8 +170,48 @@ void setup_endstop_interrupts( void ) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_X2_MAX
|
||||
#if (digitalPinToInterrupt(X2_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(X2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(X2_MAX_PIN) != NULL, "X2_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(X2_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_X2_MIN
|
||||
#if (digitalPinToInterrupt(X2_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(X2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(X2_MIN_PIN) != NULL, "X2_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(X2_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y2_MAX
|
||||
#if (digitalPinToInterrupt(Y2_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Y2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Y2_MAX_PIN) != NULL, "Y2_MAX_PIN is not interrupt-capable");
|
||||
pciSetup(Y2_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y2_MIN
|
||||
#if (digitalPinToInterrupt(Y2_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
attachInterrupt(digitalPinToInterrupt(Y2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
static_assert(digitalPinToPCICR(Y2_MIN_PIN) != NULL, "Y2_MIN_PIN is not interrupt-capable");
|
||||
pciSetup(Y2_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z2_MAX
|
||||
#if (digitalPinToInterrupt(Z2_MAX_PIN) != NOT_AN_INTERRUPT)
|
||||
#if digitalPinToInterrupt(Z2_MAX_PIN) != NOT_AN_INTERRUPT
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -181,7 +221,7 @@ void setup_endstop_interrupts( void ) {
|
||||
#endif
|
||||
|
||||
#if HAS_Z2_MIN
|
||||
#if (digitalPinToInterrupt(Z2_MIN_PIN) != NOT_AN_INTERRUPT)
|
||||
#if digitalPinToInterrupt(Z2_MIN_PIN) != NOT_AN_INTERRUPT
|
||||
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -191,7 +231,7 @@ void setup_endstop_interrupts( void ) {
|
||||
#endif
|
||||
|
||||
#if HAS_Z_MIN_PROBE_PIN
|
||||
#if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT)
|
||||
#if digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT
|
||||
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
|
||||
#else
|
||||
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
|
||||
@@ -203,4 +243,4 @@ void setup_endstop_interrupts( void ) {
|
||||
// If we arrive here without raising an assertion, each pin has either an EXT-interrupt or a PCI.
|
||||
}
|
||||
|
||||
#endif //_ENDSTOP_INTERRUPTS_H_
|
||||
#endif // _ENDSTOP_INTERRUPTS_H_
|
||||
|
||||
+139
-63
@@ -38,17 +38,10 @@ Endstops endstops;
|
||||
|
||||
// public:
|
||||
|
||||
bool Endstops::enabled = true,
|
||||
Endstops::enabled_globally =
|
||||
#if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
|
||||
(true)
|
||||
#else
|
||||
(false)
|
||||
#endif
|
||||
;
|
||||
bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load()
|
||||
volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
|
||||
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
|
||||
uint16_t
|
||||
#else
|
||||
byte
|
||||
@@ -74,6 +67,14 @@ void Endstops::init() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_X2_MIN
|
||||
#if ENABLED(ENDSTOPPULLUP_XMIN)
|
||||
SET_INPUT_PULLUP(X2_MIN_PIN);
|
||||
#else
|
||||
SET_INPUT(X2_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y_MIN
|
||||
#if ENABLED(ENDSTOPPULLUP_YMIN)
|
||||
SET_INPUT_PULLUP(Y_MIN_PIN);
|
||||
@@ -82,6 +83,14 @@ void Endstops::init() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y2_MIN
|
||||
#if ENABLED(ENDSTOPPULLUP_YMIN)
|
||||
SET_INPUT_PULLUP(Y2_MIN_PIN);
|
||||
#else
|
||||
SET_INPUT(Y2_MIN_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z_MIN
|
||||
#if ENABLED(ENDSTOPPULLUP_ZMIN)
|
||||
SET_INPUT_PULLUP(Z_MIN_PIN);
|
||||
@@ -106,6 +115,14 @@ void Endstops::init() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_X2_MAX
|
||||
#if ENABLED(ENDSTOPPULLUP_XMAX)
|
||||
SET_INPUT_PULLUP(X2_MAX_PIN);
|
||||
#else
|
||||
SET_INPUT(X2_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y_MAX
|
||||
#if ENABLED(ENDSTOPPULLUP_YMAX)
|
||||
SET_INPUT_PULLUP(Y_MAX_PIN);
|
||||
@@ -114,6 +131,14 @@ void Endstops::init() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Y2_MAX
|
||||
#if ENABLED(ENDSTOPPULLUP_YMAX)
|
||||
SET_INPUT_PULLUP(Y2_MAX_PIN);
|
||||
#else
|
||||
SET_INPUT(Y2_MAX_PIN);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_Z_MAX
|
||||
#if ENABLED(ENDSTOPPULLUP_ZMAX)
|
||||
SET_INPUT_PULLUP(Z_MAX_PIN);
|
||||
@@ -161,7 +186,7 @@ void Endstops::report_state() {
|
||||
#define ENDSTOP_HIT_TEST_Y() _ENDSTOP_HIT_TEST(Y,'Y')
|
||||
#define ENDSTOP_HIT_TEST_Z() _ENDSTOP_HIT_TEST(Z,'Z')
|
||||
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
|
||||
ENDSTOP_HIT_TEST_X();
|
||||
ENDSTOP_HIT_TEST_Y();
|
||||
@@ -171,7 +196,7 @@ void Endstops::report_state() {
|
||||
#define P_AXIS Z_AXIS
|
||||
if (TEST(endstop_hit_bits, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P');
|
||||
#endif
|
||||
SERIAL_EOL;
|
||||
SERIAL_EOL();
|
||||
|
||||
#if ENABLED(ULTRA_LCD)
|
||||
lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP);
|
||||
@@ -192,37 +217,45 @@ void Endstops::report_state() {
|
||||
|
||||
void Endstops::M119() {
|
||||
SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT);
|
||||
#define ES_REPORT(AXIS) do{ \
|
||||
SERIAL_PROTOCOLPGM(MSG_##AXIS); \
|
||||
SERIAL_PROTOCOLLN(((READ(AXIS##_PIN)^AXIS##_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); \
|
||||
}while(0)
|
||||
#if HAS_X_MIN
|
||||
SERIAL_PROTOCOLPGM(MSG_X_MIN);
|
||||
SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
|
||||
ES_REPORT(X_MIN);
|
||||
#endif
|
||||
#if HAS_X2_MIN
|
||||
ES_REPORT(X2_MIN);
|
||||
#endif
|
||||
#if HAS_X_MAX
|
||||
SERIAL_PROTOCOLPGM(MSG_X_MAX);
|
||||
SERIAL_PROTOCOLLN(((READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
|
||||
ES_REPORT(X_MAX);
|
||||
#endif
|
||||
#if HAS_X2_MAX
|
||||
ES_REPORT(X2_MAX);
|
||||
#endif
|
||||
#if HAS_Y_MIN
|
||||
SERIAL_PROTOCOLPGM(MSG_Y_MIN);
|
||||
SERIAL_PROTOCOLLN(((READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
|
||||
ES_REPORT(Y_MIN);
|
||||
#endif
|
||||
#if HAS_Y2_MIN
|
||||
ES_REPORT(Y2_MIN);
|
||||
#endif
|
||||
#if HAS_Y_MAX
|
||||
SERIAL_PROTOCOLPGM(MSG_Y_MAX);
|
||||
SERIAL_PROTOCOLLN(((READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
|
||||
ES_REPORT(Y_MAX);
|
||||
#endif
|
||||
#if HAS_Y2_MAX
|
||||
ES_REPORT(Y2_MAX);
|
||||
#endif
|
||||
#if HAS_Z_MIN
|
||||
SERIAL_PROTOCOLPGM(MSG_Z_MIN);
|
||||
SERIAL_PROTOCOLLN(((READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
|
||||
ES_REPORT(Z_MIN);
|
||||
#endif
|
||||
#if HAS_Z2_MIN
|
||||
SERIAL_PROTOCOLPGM(MSG_Z2_MIN);
|
||||
SERIAL_PROTOCOLLN(((READ(Z2_MIN_PIN)^Z2_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
|
||||
ES_REPORT(Z2_MIN);
|
||||
#endif
|
||||
#if HAS_Z_MAX
|
||||
SERIAL_PROTOCOLPGM(MSG_Z_MAX);
|
||||
SERIAL_PROTOCOLLN(((READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
|
||||
ES_REPORT(Z_MAX);
|
||||
#endif
|
||||
#if HAS_Z2_MAX
|
||||
SERIAL_PROTOCOLPGM(MSG_Z2_MAX);
|
||||
SERIAL_PROTOCOLLN(((READ(Z2_MAX_PIN)^Z2_MAX_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN));
|
||||
ES_REPORT(Z2_MAX);
|
||||
#endif
|
||||
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
||||
SERIAL_PROTOCOLPGM(MSG_Z_PROBE);
|
||||
@@ -234,9 +267,27 @@ void Endstops::M119() {
|
||||
#endif
|
||||
} // Endstops::M119
|
||||
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
void Endstops::test_dual_x_endstops(const EndstopEnum es1, const EndstopEnum es2) {
|
||||
byte x_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for X, bit 1 for X2
|
||||
if (x_test && stepper.current_block->steps[X_AXIS] > 0) {
|
||||
SBI(endstop_hit_bits, X_MIN);
|
||||
if (!stepper.performing_homing || (x_test == 0x3)) //if not performing home or if both endstops were trigged during homing...
|
||||
stepper.kill_current_block();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
void Endstops::test_dual_y_endstops(const EndstopEnum es1, const EndstopEnum es2) {
|
||||
byte y_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for Y, bit 1 for Y2
|
||||
if (y_test && stepper.current_block->steps[Y_AXIS] > 0) {
|
||||
SBI(endstop_hit_bits, Y_MIN);
|
||||
if (!stepper.performing_homing || (y_test == 0x3)) //if not performing home or if both endstops were trigged during homing...
|
||||
stepper.kill_current_block();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
|
||||
// Pass the result of the endstop test
|
||||
void Endstops::test_dual_z_endstops(const EndstopEnum es1, const EndstopEnum es2) {
|
||||
byte z_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for Z, bit 1 for Z2
|
||||
if (z_test && stepper.current_block->steps[Z_AXIS] > 0) {
|
||||
@@ -245,7 +296,6 @@ void Endstops::M119() {
|
||||
stepper.kill_current_block();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Check endstops - Called from ISR!
|
||||
@@ -254,7 +304,7 @@ void Endstops::update() {
|
||||
#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
|
||||
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
|
||||
#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
|
||||
#define _ENDSTOP_HIT(AXIS) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MIN))
|
||||
#define _ENDSTOP_HIT(AXIS, MINMAX) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MINMAX))
|
||||
|
||||
// UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status
|
||||
#define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
|
||||
@@ -264,19 +314,19 @@ void Endstops::update() {
|
||||
#define UPDATE_ENDSTOP(AXIS,MINMAX) do { \
|
||||
UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \
|
||||
if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX)) && stepper.current_block->steps[_AXIS(AXIS)] > 0) { \
|
||||
_ENDSTOP_HIT(AXIS); \
|
||||
_ENDSTOP_HIT(AXIS, MINMAX); \
|
||||
stepper.endstop_triggered(_AXIS(AXIS)); \
|
||||
} \
|
||||
} while(0)
|
||||
}while(0)
|
||||
|
||||
#if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ)
|
||||
// If G38 command is active check Z_MIN_PROBE for ALL movement
|
||||
if (G38_move) {
|
||||
UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
|
||||
if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) {
|
||||
if (stepper.current_block->steps[_AXIS(X)] > 0) { _ENDSTOP_HIT(X); stepper.endstop_triggered(_AXIS(X)); }
|
||||
else if (stepper.current_block->steps[_AXIS(Y)] > 0) { _ENDSTOP_HIT(Y); stepper.endstop_triggered(_AXIS(Y)); }
|
||||
else if (stepper.current_block->steps[_AXIS(Z)] > 0) { _ENDSTOP_HIT(Z); stepper.endstop_triggered(_AXIS(Z)); }
|
||||
if (stepper.current_block->steps[_AXIS(X)] > 0) { _ENDSTOP_HIT(X, MIN); stepper.endstop_triggered(_AXIS(X)); }
|
||||
else if (stepper.current_block->steps[_AXIS(Y)] > 0) { _ENDSTOP_HIT(Y, MIN); stepper.endstop_triggered(_AXIS(Y)); }
|
||||
else if (stepper.current_block->steps[_AXIS(Z)] > 0) { _ENDSTOP_HIT(Z, MIN); stepper.endstop_triggered(_AXIS(Z)); }
|
||||
G38_endstop_hit = true;
|
||||
}
|
||||
}
|
||||
@@ -364,18 +414,36 @@ void Endstops::update() {
|
||||
/**
|
||||
* Check and update endstops according to conditions
|
||||
*/
|
||||
|
||||
if (X_MOVE_TEST) {
|
||||
if (stepper.motor_direction(X_AXIS_HEAD)) {
|
||||
if (X_MIN_TEST) { // -direction
|
||||
#if HAS_X_MIN
|
||||
UPDATE_ENDSTOP(X, MIN);
|
||||
if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction
|
||||
#if HAS_X_MIN
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
UPDATE_ENDSTOP_BIT(X, MIN);
|
||||
#if HAS_X2_MIN
|
||||
UPDATE_ENDSTOP_BIT(X2, MIN);
|
||||
#else
|
||||
COPY_BIT(current_endstop_bits, X_MIN, X2_MIN);
|
||||
#endif
|
||||
test_dual_x_endstops(X_MIN, X2_MIN);
|
||||
#else
|
||||
if (X_MIN_TEST) UPDATE_ENDSTOP(X, MIN);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (X_MAX_TEST) { // +direction
|
||||
else { // +direction
|
||||
#if HAS_X_MAX
|
||||
UPDATE_ENDSTOP(X, MAX);
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
UPDATE_ENDSTOP_BIT(X, MAX);
|
||||
#if HAS_X2_MAX
|
||||
UPDATE_ENDSTOP_BIT(X2, MAX);
|
||||
#else
|
||||
COPY_BIT(current_endstop_bits, X_MAX, X2_MAX);
|
||||
#endif
|
||||
test_dual_x_endstops(X_MAX, X2_MAX);
|
||||
#else
|
||||
if (X_MIN_TEST) UPDATE_ENDSTOP(X, MAX);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -383,12 +451,32 @@ void Endstops::update() {
|
||||
if (Y_MOVE_TEST) {
|
||||
if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction
|
||||
#if HAS_Y_MIN
|
||||
UPDATE_ENDSTOP(Y, MIN);
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
UPDATE_ENDSTOP_BIT(Y, MIN);
|
||||
#if HAS_Y2_MIN
|
||||
UPDATE_ENDSTOP_BIT(Y2, MIN);
|
||||
#else
|
||||
COPY_BIT(current_endstop_bits, Y_MIN, Y2_MIN);
|
||||
#endif
|
||||
test_dual_y_endstops(Y_MIN, Y2_MIN);
|
||||
#else
|
||||
UPDATE_ENDSTOP(Y, MIN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else { // +direction
|
||||
#if HAS_Y_MAX
|
||||
UPDATE_ENDSTOP(Y, MAX);
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
UPDATE_ENDSTOP_BIT(Y, MAX);
|
||||
#if HAS_Y2_MAX
|
||||
UPDATE_ENDSTOP_BIT(Y2, MAX);
|
||||
#else
|
||||
COPY_BIT(current_endstop_bits, Y_MAX, Y2_MAX);
|
||||
#endif
|
||||
test_dual_y_endstops(Y_MAX, Y2_MAX);
|
||||
#else
|
||||
UPDATE_ENDSTOP(Y, MAX);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -397,27 +485,21 @@ void Endstops::update() {
|
||||
if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up.
|
||||
#if HAS_Z_MIN
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
|
||||
UPDATE_ENDSTOP_BIT(Z, MIN);
|
||||
#if HAS_Z2_MIN
|
||||
UPDATE_ENDSTOP_BIT(Z2, MIN);
|
||||
#else
|
||||
COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN);
|
||||
#endif
|
||||
|
||||
test_dual_z_endstops(Z_MIN, Z2_MIN);
|
||||
|
||||
#else // !Z_DUAL_ENDSTOPS
|
||||
|
||||
#else
|
||||
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
||||
if (z_probe_enabled) UPDATE_ENDSTOP(Z, MIN);
|
||||
#else
|
||||
UPDATE_ENDSTOP(Z, MIN);
|
||||
#endif
|
||||
|
||||
#endif // !Z_DUAL_ENDSTOPS
|
||||
|
||||
#endif // HAS_Z_MIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// When closing the gap check the enabled probe
|
||||
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
||||
@@ -429,27 +511,21 @@ void Endstops::update() {
|
||||
}
|
||||
else { // Z +direction. Gantry up, bed down.
|
||||
#if HAS_Z_MAX
|
||||
|
||||
// Check both Z dual endstops
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
|
||||
UPDATE_ENDSTOP_BIT(Z, MAX);
|
||||
#if HAS_Z2_MAX
|
||||
UPDATE_ENDSTOP_BIT(Z2, MAX);
|
||||
#else
|
||||
COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX);
|
||||
#endif
|
||||
|
||||
test_dual_z_endstops(Z_MAX, Z2_MAX);
|
||||
|
||||
// If this pin is not hijacked for the bed probe
|
||||
// then it belongs to the Z endstop
|
||||
#elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN
|
||||
|
||||
UPDATE_ENDSTOP(Z, MAX);
|
||||
|
||||
#endif // !Z_MIN_PROBE_PIN...
|
||||
#endif // Z_MAX_PIN
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+17
-2
@@ -28,6 +28,7 @@
|
||||
#define ENDSTOPS_H
|
||||
|
||||
#include "enum.h"
|
||||
#include "MarlinConfig.h"
|
||||
|
||||
class Endstops {
|
||||
|
||||
@@ -36,14 +37,22 @@ class Endstops {
|
||||
static bool enabled, enabled_globally;
|
||||
static volatile char endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
|
||||
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
|
||||
static uint16_t
|
||||
#else
|
||||
static byte
|
||||
#endif
|
||||
current_endstop_bits, old_endstop_bits;
|
||||
|
||||
Endstops() {};
|
||||
Endstops() {
|
||||
enable_globally(
|
||||
#if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
|
||||
true
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize the endstop pins
|
||||
@@ -85,6 +94,12 @@ class Endstops {
|
||||
|
||||
private:
|
||||
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
static void test_dual_x_endstops(const EndstopEnum es1, const EndstopEnum es2);
|
||||
#endif
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
static void test_dual_y_endstops(const EndstopEnum es1, const EndstopEnum es2);
|
||||
#endif
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
static void test_dual_z_endstops(const EndstopEnum es1, const EndstopEnum es2);
|
||||
#endif
|
||||
|
||||
+54
-33
@@ -34,23 +34,29 @@
|
||||
* between X_AXIS and X Head movement, like CoreXY bots
|
||||
*/
|
||||
enum AxisEnum {
|
||||
NO_AXIS = -1,
|
||||
X_AXIS = 0,
|
||||
A_AXIS = 0,
|
||||
Y_AXIS = 1,
|
||||
B_AXIS = 1,
|
||||
Z_AXIS = 2,
|
||||
C_AXIS = 2,
|
||||
E_AXIS = 3,
|
||||
X_HEAD = 4,
|
||||
Y_HEAD = 5,
|
||||
Z_HEAD = 6,
|
||||
ALL_AXES = 100
|
||||
NO_AXIS = -1,
|
||||
X_AXIS = 0,
|
||||
A_AXIS = 0,
|
||||
Y_AXIS = 1,
|
||||
B_AXIS = 1,
|
||||
Z_AXIS = 2,
|
||||
C_AXIS = 2,
|
||||
E_AXIS = 3,
|
||||
X_HEAD = 4,
|
||||
Y_HEAD = 5,
|
||||
Z_HEAD = 6,
|
||||
ALL_AXES = 100
|
||||
};
|
||||
|
||||
#define LOOP_XYZ(VAR) for (uint8_t VAR=X_AXIS; VAR<=Z_AXIS; VAR++)
|
||||
#define LOOP_XYZE(VAR) for (uint8_t VAR=X_AXIS; VAR<=E_AXIS; VAR++)
|
||||
#define LOOP_XYZE_N(VAR) for (uint8_t VAR=X_AXIS; VAR<XYZE_N; VAR++)
|
||||
#define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=S; VAR<=N; VAR++)
|
||||
#define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=S; VAR<N; VAR++)
|
||||
#define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N)
|
||||
#define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N)
|
||||
|
||||
#define LOOP_NA(VAR) LOOP_L_N(VAR, NUM_AXIS)
|
||||
#define LOOP_XYZ(VAR) LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS)
|
||||
#define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_AXIS)
|
||||
#define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N)
|
||||
|
||||
typedef enum {
|
||||
LINEARUNIT_MM,
|
||||
@@ -87,6 +93,10 @@ enum EndstopEnum {
|
||||
X_MAX,
|
||||
Y_MAX,
|
||||
Z_MAX,
|
||||
X2_MIN,
|
||||
X2_MAX,
|
||||
Y2_MIN,
|
||||
Y2_MAX,
|
||||
Z2_MIN,
|
||||
Z2_MAX
|
||||
};
|
||||
@@ -108,25 +118,25 @@ enum EndstopEnum {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
enum FilamentChangeMenuResponse {
|
||||
FILAMENT_CHANGE_RESPONSE_WAIT_FOR,
|
||||
FILAMENT_CHANGE_RESPONSE_EXTRUDE_MORE,
|
||||
FILAMENT_CHANGE_RESPONSE_RESUME_PRINT
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
enum AdvancedPauseMenuResponse {
|
||||
ADVANCED_PAUSE_RESPONSE_WAIT_FOR,
|
||||
ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE,
|
||||
ADVANCED_PAUSE_RESPONSE_RESUME_PRINT
|
||||
};
|
||||
|
||||
#if ENABLED(ULTIPANEL)
|
||||
enum FilamentChangeMessage {
|
||||
FILAMENT_CHANGE_MESSAGE_INIT,
|
||||
FILAMENT_CHANGE_MESSAGE_UNLOAD,
|
||||
FILAMENT_CHANGE_MESSAGE_INSERT,
|
||||
FILAMENT_CHANGE_MESSAGE_LOAD,
|
||||
FILAMENT_CHANGE_MESSAGE_EXTRUDE,
|
||||
FILAMENT_CHANGE_MESSAGE_OPTION,
|
||||
FILAMENT_CHANGE_MESSAGE_RESUME,
|
||||
FILAMENT_CHANGE_MESSAGE_STATUS,
|
||||
FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE,
|
||||
FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT
|
||||
enum AdvancedPauseMessage {
|
||||
ADVANCED_PAUSE_MESSAGE_INIT,
|
||||
ADVANCED_PAUSE_MESSAGE_UNLOAD,
|
||||
ADVANCED_PAUSE_MESSAGE_INSERT,
|
||||
ADVANCED_PAUSE_MESSAGE_LOAD,
|
||||
ADVANCED_PAUSE_MESSAGE_EXTRUDE,
|
||||
ADVANCED_PAUSE_MESSAGE_OPTION,
|
||||
ADVANCED_PAUSE_MESSAGE_RESUME,
|
||||
ADVANCED_PAUSE_MESSAGE_STATUS,
|
||||
ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE,
|
||||
ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
@@ -161,12 +171,23 @@ enum LCDViewAction {
|
||||
LCDVIEW_CALL_NO_REDRAW
|
||||
};
|
||||
|
||||
/**
|
||||
* Dual X Carriage modes. A Dual Nozzle can also do duplication.
|
||||
*/
|
||||
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
|
||||
enum DualXMode {
|
||||
DXC_FULL_CONTROL_MODE,
|
||||
DXC_AUTO_PARK_MODE,
|
||||
DXC_FULL_CONTROL_MODE, // DUAL_X_CARRIAGE only
|
||||
DXC_AUTO_PARK_MODE, // DUAL_X_CARRIAGE only
|
||||
DXC_DUPLICATION_MODE
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Workspace planes only apply to G2/G3 moves
|
||||
* (and "canned cycles" - not a current feature)
|
||||
*/
|
||||
#if ENABLED(CNC_WORKSPACE_PLANES)
|
||||
enum WorkspacePlane { PLANE_XY, PLANE_ZX, PLANE_YZ };
|
||||
#endif
|
||||
|
||||
#endif // __ENUM_H__
|
||||
|
||||
+466
-260
File diff suppressed because it is too large
Load Diff
+613
-197
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
This is an example configuration for the CL-260 Ultimaker 2 clone.
|
||||
Change Z_MAX_POS to 300 for the CL-260MAX.
|
||||
|
||||
(The printer is available on AliExpress; be aware that this is not a beginner's
|
||||
printer -- it needs tweaking and some parts replaced before being decent.)
|
||||
|
||||
The printer comes with a quite old Marlin, the sources are available here:
|
||||
http://www.thingiverse.com/thing:1635830/ and I recommend replacing them.
|
||||
|
||||
The setting "works" for my printer and the extruder using my calibration value.
|
||||
You might want to tweak some settings, e.g enable EEPROM, increase default Z speed, adjust homing speeds,...
|
||||
|
||||
Have fun!
|
||||
--
|
||||
tobi
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+461
-255
File diff suppressed because it is too large
Load Diff
+613
-197
File diff suppressed because it is too large
Load Diff
+501
-288
File diff suppressed because it is too large
Load Diff
+634
-202
File diff suppressed because it is too large
Load Diff
+7
@@ -5,11 +5,18 @@ NOTE: The look and feel of the Hephestos 2 while navigating the LCD menu will ch
|
||||
|
||||
## Changelog
|
||||
* 2016/03/01 - Initial release
|
||||
|
||||
* 2016/03/21 - Activated 4-point auto leveling by default
|
||||
Updated miscellaneous z-probe values
|
||||
|
||||
* 2016/06/21 - Disabled hot bed related options
|
||||
Activated software endstops
|
||||
SD printing now disables the heater when finished
|
||||
|
||||
* 2016/07/13 - Update the `DEFAULT_AXIS_STEPS_PER_UNIT` for the Z axis
|
||||
Increased the `DEFAULT_XYJERK`
|
||||
|
||||
* 2016/12/13 - Configuration updated.
|
||||
|
||||
* 2017/07/06 - Configuration updated to the latest Marlin version.
|
||||
Added support for the official BQ heated bed kit.
|
||||
+459
-253
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1782
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+100
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tongue-in-cheek placeholder for a more Marlin-specific bitmap
|
||||
* The joke is that every "CR-10" has different branding!
|
||||
* Made using The Gimp and...
|
||||
* - http://www.digole.com/tools/PicturetoC_Hex_converter.php
|
||||
*/
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
|
||||
#define CUSTOM_BOOTSCREEN_BMPWIDTH 54
|
||||
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
|
||||
|
||||
const unsigned char custom_start_bmp[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x3F, 0xF8, 0x00, 0x00,
|
||||
0x00, 0x00, 0x03, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0x0F, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3F, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x0F, 0xF0,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0xF8,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8,
|
||||
0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
|
||||
0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0,
|
||||
0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
|
||||
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00,
|
||||
0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x7F, 0xFC, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x1F, 0x80, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFE, 0x3F, 0xF8,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8,
|
||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
|
||||
0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xC0,
|
||||
0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE, 0x00,
|
||||
0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xE0, 0x00,
|
||||
0x00, 0x00, 0x07, 0xFF, 0xFC, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+466
-260
File diff suppressed because it is too large
Load Diff
+612
-203
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
# Configuration for Malyan M150 hobbyking printer
|
||||
# config without automatic bed level sensor
|
||||
# or in other words, "as stock"
|
||||
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Custom Bitmap for splashscreen
|
||||
*
|
||||
* You may use one of the following tools to generate the C++ bitmap array from
|
||||
* a black and white image:
|
||||
*
|
||||
* - http://www.marlinfw.org/tools/u8glib/converter.html
|
||||
* - http://www.digole.com/tools/PicturetoC_Hex_converter.php
|
||||
*/
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#define CUSTOM_BOOTSCREEN_TIMEOUT 1000
|
||||
#define CUSTOM_BOOTSCREEN_BMPWIDTH 128
|
||||
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64
|
||||
|
||||
const unsigned char custom_start_bmp[1024] PROGMEM = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x07,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x1f,0xc0,0x00,0x0f,0xe0,0x7c,0x03,0xe0,0x78,0x1c,0x07,0x81,0xe0,0xf0,0x3e,0x0e
|
||||
,0x7f,0xe0,0x00,0x3f,0xf0,0x7e,0x07,0xe0,0xfc,0x1c,0x03,0x81,0xc1,0xf8,0x3f,0x0e
|
||||
,0x7f,0xf8,0x00,0x7f,0xf0,0x7e,0x07,0xe0,0xfc,0x1c,0x03,0xc3,0xc1,0xf8,0x3f,0x0e
|
||||
,0x7b,0xfe,0x01,0xfe,0xf0,0x7f,0x0f,0xe1,0xfe,0x1c,0x01,0xc3,0x83,0xfc,0x3f,0x8e
|
||||
,0x7c,0xff,0x87,0xf9,0xf0,0x77,0x0e,0xe1,0xfe,0x1c,0x01,0xe7,0x83,0xfc,0x3b,0x8e
|
||||
,0x7f,0x7f,0xcf,0xf7,0xf0,0x77,0x9e,0xe1,0xce,0x1c,0x00,0xe7,0x03,0x9c,0x3b,0xce
|
||||
,0x7f,0x9f,0xff,0xcf,0xf0,0x73,0x9c,0xe3,0xcf,0x1c,0x00,0xff,0x07,0x9e,0x39,0xce
|
||||
,0x7f,0xe7,0xff,0x3f,0xf0,0x73,0xfc,0xe3,0x87,0x1c,0x00,0x7e,0x07,0x0e,0x39,0xee
|
||||
,0x7f,0xfb,0xfe,0xff,0xf0,0x71,0xf8,0xe3,0x87,0x1c,0x00,0x7e,0x0f,0x0f,0x38,0xee
|
||||
,0x7f,0xfc,0xf9,0xff,0xf0,0x71,0xf8,0xe7,0xff,0x9c,0x00,0x3c,0x0f,0xff,0x38,0xfe
|
||||
,0x7f,0xff,0x27,0xff,0xf0,0x70,0xf0,0xe7,0xff,0x9c,0x00,0x3c,0x0f,0xff,0x38,0x7e
|
||||
,0x7f,0xff,0xdf,0xff,0xf0,0x70,0xf0,0xef,0xff,0xdc,0x00,0x3c,0x1f,0xff,0xb8,0x7e
|
||||
,0x7f,0xdf,0xff,0xdf,0xf0,0x70,0x60,0xef,0x03,0xdf,0xf8,0x3c,0x1e,0x07,0xb8,0x3e
|
||||
,0x7f,0xc7,0xff,0x1f,0xf0,0x70,0x60,0xee,0x01,0xdf,0xf8,0x3c,0x1c,0x03,0xb8,0x3e
|
||||
,0x7f,0xc3,0xfe,0x1f,0xf0,0x70,0x00,0xee,0x01,0xdf,0xf8,0x3c,0x1c,0x03,0xb8,0x1e
|
||||
,0x7f,0xc3,0xfe,0x1f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x7f,0xc3,0xde,0x1f,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
|
||||
,0x7f,0xc3,0xde,0x1f,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
|
||||
,0x7f,0xc3,0xde,0x1f,0xf0,0x7c,0x3f,0xfa,0xfb,0xff,0xff,0xff,0xfd,0x7a,0xbf,0xfe
|
||||
,0x7f,0xc3,0xde,0x1f,0xf0,0x7d,0x9f,0xfb,0xff,0xff,0xff,0xff,0xff,0x7e,0xf7,0xfe
|
||||
,0x7f,0xc3,0xde,0x1f,0xf0,0x7d,0x93,0x1a,0x8a,0x18,0xe3,0x8c,0x45,0x1a,0xa2,0xde
|
||||
,0x3f,0xc3,0xde,0x0f,0xf0,0x7c,0x2d,0xca,0xca,0xd6,0xe9,0x24,0xcd,0x6a,0xb6,0xbe
|
||||
,0x1f,0x83,0xde,0x07,0xe0,0x7d,0xa3,0x6a,0x9a,0xd6,0xe9,0x26,0x65,0x6a,0xb6,0x3e
|
||||
,0x06,0x03,0xde,0x01,0x80,0x7d,0x91,0x0a,0x8a,0xd8,0xe3,0x8c,0x45,0x1a,0xb3,0x7e
|
||||
,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xfe,0xef,0xff,0xff,0xff,0xff,0x7e
|
||||
,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xf1,0xef,0xff,0xff,0xff,0xfe,0xfe
|
||||
,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
|
||||
,0x00,0x03,0xde,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe
|
||||
,0x00,0x03,0xde,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x01,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
# Micromake C1
|
||||
|
||||
### In the folder "basic"
|
||||
Configuration files for Micromake C1 without mods
|
||||
- English LCD 2X16 Characters
|
||||
- Motors 16 STEPS
|
||||
- No heated bed
|
||||
- No probe, etc.
|
||||
- Like a standard C1 as shipped by Micromake.
|
||||
|
||||
### In the folder "enhanced"
|
||||
Configuration files for Micromake C1 with…
|
||||
- 128 STEPS configured with jumper on the motherboard (all open for 128 Steps).
|
||||
- Capacitive Probe (Adjust offsets at your convenience)
|
||||
- French language with no accents for Japanese LCD.
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user