Compare commits
775 Commits
latest
...
openi6x-2.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d2f54c2d6 | |||
| f48d357492 | |||
| 367700ab81 | |||
| 4706422da2 | |||
| 235cf4f7ad | |||
| d51977eb68 | |||
| c9534df0ba | |||
| b7040cebbe | |||
| f0fcd8ef09 | |||
| 8baf62a3f7 | |||
| 4a9e891b25 | |||
| a919688895 | |||
| 5466309bff | |||
| cf0921b49f | |||
| fd7039dd11 | |||
| 3ad862b97c | |||
| 0ec4be28ef | |||
| e99e8b4d13 | |||
| 8e9dd6066e | |||
| 32418dbe8f | |||
| b98022f066 | |||
| b7f07b8ba2 | |||
| 77a032effa | |||
| efa63ec80d | |||
| d02ddfd2c1 | |||
| 8ffacf0437 | |||
| 7bff6c5c10 | |||
| 524532e84b | |||
| 09d4500482 | |||
| 0a597df51b | |||
| 34954190b6 | |||
| 15b50b0de3 | |||
| 3a633cec7f | |||
| bb3c68b1b4 | |||
| 41791f34e2 | |||
| a6430ddb24 | |||
| 9cacfb0df2 | |||
| 91e8418631 | |||
| 3eab877f54 | |||
| bec94560d7 | |||
| c861ac899e | |||
| 97d9f1c19d | |||
| 70a24b992d | |||
| b6b24dcf94 | |||
| 14888fdc3a | |||
| 7f2a5cafd3 | |||
| c935e0b5cf | |||
| 9bd0397f83 | |||
| 68195be6d9 | |||
| d0bf6310e3 | |||
| b434750207 | |||
| 5627957dbd | |||
| f7e573fff9 | |||
| 17d3cc2801 | |||
| 9660f70308 | |||
| 559b2af2e8 | |||
| 24c8653790 | |||
| d976bb0dec | |||
| 0fde774398 | |||
| 60baf50708 | |||
| 0ef6cc2ca8 | |||
| 2e1c8dc366 | |||
| ef1d6d0b32 | |||
| 33f08f01a4 | |||
| 8a0e6f5005 | |||
| 2b4a6ace18 | |||
| d97ed48069 | |||
| 76c6c4a7ff | |||
| ed930033de | |||
| 65f2929525 | |||
| 6a5ec7b803 | |||
| ec4da489b3 | |||
| d49cc03892 | |||
| 9eae3f02aa | |||
| 16e665e05f | |||
| 900fb616df | |||
| 9af695ed0e | |||
| a933cc9299 | |||
| 40628f5dca | |||
| 6c76ebe5ec | |||
| a2a9a00774 | |||
| 4eb8f7310e | |||
| 5d1e179e03 | |||
| 80a2ae5b7d | |||
| 05a8dc9983 | |||
| bb47d974f7 | |||
| 350c18b68e | |||
| c812a8140a | |||
| a1d4c9b1cb | |||
| 1c3a7397bc | |||
| 0c3ee642cd | |||
| 068265a7c1 | |||
| 8daccf079a | |||
| d57a77b103 | |||
| d1cb47dd30 | |||
| 7fce538ac1 | |||
| 6752c3c1f6 | |||
| baa5ed36f3 | |||
| 6a5e87c40b | |||
| ec6d70f198 | |||
| 7994ec402f | |||
| f5180b01df | |||
| e931b4f212 | |||
| 088bdfff11 | |||
| 641ac61119 | |||
| 680a3e3b54 | |||
| 177a00f1c4 | |||
| d82393c9cb | |||
| 45d3abd883 | |||
| 6aac5b6555 | |||
| d519064f6e | |||
| 13db3d3ef9 | |||
| 315e585353 | |||
| efabd68aee | |||
| dd67c8f56c | |||
| c4347e3e8d | |||
| 57c8905177 | |||
| 663e857f54 | |||
| 39272da5d0 | |||
| c698bb0e1e | |||
| 3551a8cdbe | |||
| e75fd9b657 | |||
| 4b7a8b03a4 | |||
| e8d6d2a720 | |||
| 529b3e6ed9 | |||
| a7b6614d81 | |||
| 36aecef4cf | |||
| 7d901ad7a0 | |||
| 3a7312f85d | |||
| 023e96b79e | |||
| f14b715b79 | |||
| e1e8177aa9 | |||
| b1c9798365 | |||
| 90f968e2f5 | |||
| b047c748f2 | |||
| 98c73ea7bb | |||
| e482d3dc03 | |||
| 84d80625f4 | |||
| cf3f78e27d | |||
| 368d77b446 | |||
| a025433a3c | |||
| 12948100b2 | |||
| c268229a16 | |||
| 9686955ac0 | |||
| 6306a89b38 | |||
| ab51eaa00c | |||
| d74f533eca | |||
| 3ff3020ba9 | |||
| 3dffcf7e55 | |||
| 859b002c49 | |||
| 7c5d6f5a02 | |||
| fd5c4711cd | |||
| faef96eeaa | |||
| 614c202824 | |||
| 8b21998ed4 | |||
| 5cccfe1b68 | |||
| dfa722036f | |||
| 2efe7d62f3 | |||
| 18c6f98d31 | |||
| a533acf529 | |||
| e778aec12f | |||
| ad918726a3 | |||
| 68db045da1 | |||
| eb118683e8 | |||
| 0bcc458ec2 | |||
| 21dc245974 | |||
| 30d6006110 | |||
| dd919defa6 | |||
| 60dca26963 | |||
| dd06512823 | |||
| 690445c9c0 | |||
| c4c3390465 | |||
| f75ce7bf52 | |||
| 1b7daf89ba | |||
| 3041b1ee04 | |||
| edebfb9306 | |||
| f26283d836 | |||
| 6536089586 | |||
| 7d54485e60 | |||
| bc37064a8d | |||
| 52bd029303 | |||
| 68e39fd029 | |||
| 31a30bf683 | |||
| 29849b0c48 | |||
| b82bf9d940 | |||
| 2e1435f22a | |||
| ba6e108f03 | |||
| 3a1c59e6d6 | |||
| c7831e4ebc | |||
| 10675c4048 | |||
| babaeb0bb0 | |||
| ea611b46c7 | |||
| a328f218cc | |||
| 08ed0191cb | |||
| 49b7497750 | |||
| a4a2ee5cb6 | |||
| 8b31041cdc | |||
| 0db1af3a90 | |||
| f43cba34c9 | |||
| 0bd2c23fda | |||
| ba7c9a768c | |||
| 52f2616736 | |||
| 4315f93a5e | |||
| 60b2cb981e | |||
| 56ad701183 | |||
| 4d11bba9ad | |||
| 3939780d4f | |||
| ebefeb7afb | |||
| c5e76d3f6d | |||
| febd1fc49c | |||
| 2b196c3938 | |||
| 4ed536a8c6 | |||
| cbfa4fc81b | |||
| d7308a27a1 | |||
| 60321620e9 | |||
| 72cfcd4b95 | |||
| 464d0c4340 | |||
| 6ed15b39b4 | |||
| 8c1052dc88 | |||
| 57cf1119b9 | |||
| 2379fc4c53 | |||
| 151db8fa49 | |||
| 3a962fb165 | |||
| b9961e711e | |||
| a13f6f8316 | |||
| e0acedb9a2 | |||
| 473e1ce669 | |||
| 22a953218d | |||
| ab10aec41c | |||
| afe8eb68bd | |||
| 7874bc1a28 | |||
| 0a09e0686d | |||
| 77ae8165e2 | |||
| 7ca6373851 | |||
| f1d600cfe3 | |||
| c28396f145 | |||
| a2c0b76dc0 | |||
| 34eb0042d8 | |||
| adfead46c5 | |||
| 5cc5df9a40 | |||
| 12eabec625 | |||
| 034ae1f4fa | |||
| f5662368f3 | |||
| bb1ef6b959 | |||
| 2ff8343d23 | |||
| 458aa445dd | |||
| 106ef955e4 | |||
| 334a52d8fc | |||
| 07d8112e22 | |||
| 23b973e3a5 | |||
| e33b334a4d | |||
| 82b5209ee9 | |||
| 6f980ce98c | |||
| 0e3b97135e | |||
| feabfa8fbb | |||
| 4627f83996 | |||
| 304eedf856 | |||
| 49f5da2d28 | |||
| f2bf93a1d2 | |||
| 78773476a0 | |||
| 508101d481 | |||
| 4a9aa62d5a | |||
| 2abe68bb72 | |||
| 64ddd7d4e1 | |||
| adca844879 | |||
| 6d32c44539 | |||
| 2f106e6497 | |||
| 9e05244ef6 | |||
| 227b0ca02a | |||
| 4dba99481e | |||
| 68f70c8054 | |||
| e4b3ca1f6a | |||
| c38b4c9b2d | |||
| 670d5dee05 | |||
| 195aab5635 | |||
| e264d4d9c7 | |||
| 2ad10f29b0 | |||
| 78ceda4511 | |||
| a11fc238f7 | |||
| 8657d738db | |||
| b8fd920b47 | |||
| fdce008662 | |||
| fd13f124d6 | |||
| 09724157a4 | |||
| a5a80b1106 | |||
| ed6f3f1327 | |||
| 313cb11a87 | |||
| 9798668b63 | |||
| 6c390e5a7d | |||
| c53ec0c3b5 | |||
| c639f11011 | |||
| 2df74c181e | |||
| 82268a3e64 | |||
| ff2d27b1b0 | |||
| 3539f83991 | |||
| 0b1fb163d2 | |||
| 6e5bf4cd34 | |||
| dfb5d7ba92 | |||
| e273c921d2 | |||
| 72548da279 | |||
| 994c8f7fc3 | |||
| 7dd6418ed0 | |||
| f9988352a2 | |||
| a7053bd993 | |||
| bb9ebd0473 | |||
| cbb6368d48 | |||
| 92f76f73b2 | |||
| 54921372b1 | |||
| 1c4971fef7 | |||
| 585c7b8dc1 | |||
| 6babc010b4 | |||
| aa6f9d89aa | |||
| 73292995c8 | |||
| 404953ddfd | |||
| dade98c82f | |||
| d28c8fc011 | |||
| 70561a159e | |||
| 579985087b | |||
| 375f0186f1 | |||
| 43705a0f3c | |||
| 6bc0db45e3 | |||
| d3744477b3 | |||
| 2b593e2956 | |||
| cd85f46740 | |||
| f2d1eb2308 | |||
| d4046d68e6 | |||
| af7274f78d | |||
| 0af5d26bb1 | |||
| 30498c7c44 | |||
| 837a2e7ea3 | |||
| bddca0c7dd | |||
| 7afedd8f05 | |||
| d71d6dac4e | |||
| b84ac75beb | |||
| f4344e7a98 | |||
| 40de080eeb | |||
| 58efa39ac5 | |||
| 8114825294 | |||
| 4c6c419503 | |||
| 7aa093f6f7 | |||
| dd304c9b0e | |||
| 5661c58ae4 | |||
| 51a5d8c625 | |||
| d5aab13de0 | |||
| bb1c8276a2 | |||
| 6d8f29378b | |||
| 8b57b3fdc0 | |||
| 2dee6452e1 | |||
| d4a7e1baf1 | |||
| 58221d9f55 | |||
| 20819991f4 | |||
| 7426c69239 | |||
| 307465a6ec | |||
| 6492d02d77 | |||
| efa8706042 | |||
| f061d49f60 | |||
| dd0e3aea0d | |||
| 55accee9c1 | |||
| 33eb2ed832 | |||
| 31dbb62927 | |||
| 6a37008076 | |||
| 26db4812c1 | |||
| cd3dd658eb | |||
| ede5a6bcb5 | |||
| ef20534c0f | |||
| 763d373e68 | |||
| 6aa2bb8168 | |||
| b106639258 | |||
| 13b82503e0 | |||
| 7bd7ed17a5 | |||
| f415076c77 | |||
| f51c578845 | |||
| 03dcdaf38c | |||
| f6350fea01 | |||
| f2c6fbffa0 | |||
| 6834e7387f | |||
| 57a270e5fb | |||
| 5985c1762a | |||
| 787f3e5850 | |||
| 57fd7a8a20 | |||
| 71f823d9c8 | |||
| 7df416da03 | |||
| c942195d36 | |||
| 699727cbc9 | |||
| 324dae967a | |||
| 21b6f96b28 | |||
| 68bdb9e6ae | |||
| 2de6b43e1a | |||
| 1a1ec3164f | |||
| 7c1864b382 | |||
| 046364ea35 | |||
| d7a6a1bc17 | |||
| 19b0fe60fd | |||
| cdb7ca08d7 | |||
| 65e81f6820 | |||
| f1f135f61f | |||
| 69ad4f6eaf | |||
| 4775d87b7c | |||
| beb198fb2e | |||
| a568454a55 | |||
| 3a95e7debe | |||
| f730b23d7c | |||
| baa4d28d22 | |||
| 194d351972 | |||
| 587c99302c | |||
| a0ff01edbb | |||
| 69afe82e7e | |||
| 157b92d79f | |||
| 8480c30462 | |||
| 0c38727322 | |||
| 02cd8c9e08 | |||
| 10dfed5d10 | |||
| 46a2dd61f8 | |||
| ad780c30ec | |||
| ff7d71e753 | |||
| 8066d5ca45 | |||
| bcbb36bc8a | |||
| 29aa4534aa | |||
| ad2e2dd8e7 | |||
| 244fd86e10 | |||
| d8c4c36b37 | |||
| 793fd3de76 | |||
| da3cfa0563 | |||
| d8e1b25dcf | |||
| 0937701490 | |||
| 44f33a0f3a | |||
| 233b909196 | |||
| d9a262ac79 | |||
| 73807dd683 | |||
| 1894ce9471 | |||
| ca39bd2804 | |||
| 66f4c7d570 | |||
| c41367cedf | |||
| 223017680f | |||
| 9b0fd2792a | |||
| 3d4648c6f6 | |||
| d82962fdc3 | |||
| bda5bbbcbb | |||
| fbdd1b0a5d | |||
| d3c7804f77 | |||
| ad9865b982 | |||
| d0776ec945 | |||
| 0c5d4f55a7 | |||
| c72c18cd7d | |||
| 7178884f1c | |||
| ad660c51d1 | |||
| bc61c9d65b | |||
| 51f0059769 | |||
| 520760c292 | |||
| 363888d2b4 | |||
| 1a1c75ec2d | |||
| 87a862c8e4 | |||
| ec062b81c6 | |||
| 2dcf1dad8d | |||
| defb98b444 | |||
| aab19bafcf | |||
| a9b6fa9530 | |||
| 69b2a5bd74 | |||
| d1cda7c5bc | |||
| 68f3f9009a | |||
| daef3fbae8 | |||
| 92667b8524 | |||
| dbdb3306bc | |||
| 1f4160f063 | |||
| 002cac465e | |||
| cbadc37bae | |||
| 7599c493f9 | |||
| f308a16fe3 | |||
| 2c65d47f59 | |||
| 5f45ac411c | |||
| ac8e5d452f | |||
| 550c1d7ded | |||
| 140d699456 | |||
| 76d7ebb0c6 | |||
| 11663ae817 | |||
| d3550ebbbd | |||
| eb390b339a | |||
| 955cb7f851 | |||
| 194bc1d10a | |||
| 50db772fe1 | |||
| 6d8816a601 | |||
| 0d10b809e5 | |||
| e8b7a87d69 | |||
| 22563fdccf | |||
| f8c0fe2ee6 | |||
| 5f054d963a | |||
| 79089010cf | |||
| c0036b876e | |||
| dc969e7715 | |||
| e5c09d404a | |||
| f580933670 | |||
| 49f7f280e8 | |||
| a94373779f | |||
| e76a2a0855 | |||
| b50687e766 | |||
| 8c9936ff88 | |||
| 7d8f2e6870 | |||
| 7144c4080d | |||
| b718b8f066 | |||
| 003e7cb5eb | |||
| a94fca57f7 | |||
| d8abc4f56c | |||
| 3909a30de0 | |||
| 454da140c8 | |||
| 519795d4d0 | |||
| d7ef1d79bb | |||
| 78ca8f06f5 | |||
| 23f99ded22 | |||
| 1873e2d74a | |||
| 95a8c5b3e5 | |||
| 2c37760dfe | |||
| 1427b07e82 | |||
| 1721f6bbd6 | |||
| 88e2c98b5e | |||
| f1d84e62ca | |||
| b1dd38a730 | |||
| 50068accf4 | |||
| fec8404f2a | |||
| a867c66960 | |||
| 10df817334 | |||
| 554bf8e7ed | |||
| 437fce00cb | |||
| 980a718f02 | |||
| 720849363a | |||
| 6d3d6d370b | |||
| bcfde29ca2 | |||
| 9cd7fd4355 | |||
| 9e6b96826b | |||
| 359be8240e | |||
| 5d48391bd9 | |||
| d5b9e3f564 | |||
| 2d2537a379 | |||
| ccc2599c11 | |||
| e266d1cf3f | |||
| 3e4e396ef8 | |||
| 6b27d7140b | |||
| 6524524cd6 | |||
| 38259e2b8e | |||
| 533d587df6 | |||
| 70659d1bbd | |||
| dceea44867 | |||
| 5675b3278e | |||
| e80214c318 | |||
| 3f316abb6c | |||
| a2ff7a19d1 | |||
| 7f6b307404 | |||
| bbb1266cc3 | |||
| 73be86d09b | |||
| 66c2eb22d5 | |||
| 2471fb3d25 | |||
| af50c720d1 | |||
| 8639796258 | |||
| 1e8bde309b | |||
| fb428984c7 | |||
| 65afc5aeb2 | |||
| dded11c6a8 | |||
| 5586485708 | |||
| 0bda125e51 | |||
| b71fd642e4 | |||
| e4b406f3f2 | |||
| a13ad9f98e | |||
| d246865130 | |||
| 87181c9fff | |||
| 6301acecd0 | |||
| 7997b97fc0 | |||
| e9e4f4cec4 | |||
| 603172faba | |||
| 0616ee16d5 | |||
| 60ef33b13c | |||
| 8b17eb6922 | |||
| 91b4cd800c | |||
| 546145bdf7 | |||
| e290b6bc37 | |||
| 8c1b3cf7c1 | |||
| 0eff5958be | |||
| efc15cd855 | |||
| e7bc2b24f5 | |||
| 216775051b | |||
| fa6a2d8375 | |||
| ce57cd0a08 | |||
| 308b4c5dc2 | |||
| 4af5b51024 | |||
| a225c681ef | |||
| 6c865775c1 | |||
| 3d3859122a | |||
| 0a2c00e92a | |||
| cd110f2bc7 | |||
| b0ff5ac281 | |||
| 573564dba5 | |||
| 5c15d8c0f6 | |||
| 61d3304888 | |||
| 584dfebe08 | |||
| 8c02feabf9 | |||
| c245116abc | |||
| eb547df41a | |||
| 8d92bc2eb4 | |||
| 11f6ac1750 | |||
| d0cb395307 | |||
| 0b39f768e1 | |||
| 91b2771f04 | |||
| 174dd0411f | |||
| b09dfc3ae8 | |||
| 62fa9bf88a | |||
| 9533fb2031 | |||
| 9911be0aba | |||
| 3c1de930f4 | |||
| f311667271 | |||
| 1667d67b65 | |||
| 388116a73e | |||
| 46d4f67080 | |||
| f353f661e5 | |||
| 57522773f1 | |||
| 0e6ba30aa8 | |||
| 5fdca53e83 | |||
| b1b8951df2 | |||
| 634f6ec6b8 | |||
| ba3c530889 | |||
| b18f1f5de0 | |||
| 39d5901abd | |||
| 586b3b8fb6 | |||
| c3096c22bc | |||
| 9371aca098 | |||
| d1b0c3674d | |||
| f3ead55347 | |||
| bb26df472d | |||
| 3e15ec9dcd | |||
| b68bb52971 | |||
| 84d4443f18 | |||
| 3ef02803d4 | |||
| c7029ca136 | |||
| efa36713fa | |||
| b9e9ee394d | |||
| b5377a16bc | |||
| 176015d5b3 | |||
| 59c06d0f23 | |||
| 4550b16512 | |||
| bf8d42b3f5 | |||
| 7700b280d9 | |||
| bfc40c406c | |||
| 9df252490e | |||
| 244d6c041e | |||
| 3a345eb5c2 | |||
| 14bf19bd78 | |||
| cad8df9a6a | |||
| 777e75af23 | |||
| 6d2780065f | |||
| 3b0c363c11 | |||
| aa03c7de44 | |||
| 15da9219f7 | |||
| 4a38181a70 | |||
| 4f8b6dc2ad | |||
| def148df15 | |||
| 14f45cbe12 | |||
| 48d753809d | |||
| f7e264001e | |||
| 4328367155 | |||
| d609a52ca2 | |||
| 49ca6f737d | |||
| 21bdc20906 | |||
| ad9b4ca68a | |||
| 0b7962c6e4 | |||
| 2d6c37c622 | |||
| aee793fb4d | |||
| 304f765e58 | |||
| a295625e58 | |||
| 7c0fa35317 | |||
| 3d9e38c8c8 | |||
| b786fa86b2 | |||
| a3c7c142cf | |||
| 347dc02c18 | |||
| 72b14cbef6 | |||
| ebee8ea729 | |||
| e51da758ea | |||
| c855760b38 | |||
| a982ffb7a7 | |||
| 5dc00608dc | |||
| 89353eda6a | |||
| 456ec40959 | |||
| ad1194671a | |||
| 594f9facbe | |||
| 89be9a6ff8 | |||
| 5e1499e8d0 | |||
| b4138515d2 | |||
| 66cb7791a0 | |||
| 52d8654ad2 | |||
| c0e50bc767 | |||
| 15ccf61ae7 | |||
| 3fab9104c3 | |||
| a7e611b054 | |||
| 4fe1c16b91 | |||
| 82f949ee48 | |||
| 083ae4127b | |||
| ded430d4a1 | |||
| ac519245bb | |||
| eb81636337 | |||
| c0d64ace98 | |||
| 82f787e889 | |||
| 3a67e84c41 | |||
| 706daf27ad | |||
| cd954a4316 | |||
| 9a19975fec | |||
| 0c59088b2f | |||
| 808bb43149 | |||
| 10e89bcb21 | |||
| 11a01b7910 | |||
| 1bb564eadf | |||
| b0b0117185 | |||
| 30b418fd5d | |||
| 1625d58d00 | |||
| 1368f19f23 | |||
| 09e3a81479 | |||
| 9889681c93 | |||
| 3702f67c9f | |||
| 32ea418841 | |||
| e7678f0dff | |||
| 74050d1f9a | |||
| 1b9d302f9c | |||
| 423cef3384 | |||
| f1657bf059 | |||
| 8635906ec2 | |||
| 1675fa1b96 | |||
| ac7210c92d | |||
| fecb71a50c | |||
| 1e40235bc4 | |||
| 556595fa84 | |||
| 156a90302a | |||
| d7a1f59cdb | |||
| 842c8b417b | |||
| 567f312c5f | |||
| a6da50aa1c | |||
| 35bebc9bbd | |||
| cfd5a8bb64 | |||
| 8443a05152 | |||
| 419929f5a6 | |||
| 511e34a025 | |||
| 35fda853ae | |||
| 03a8b68011 | |||
| 1715725d3e | |||
| 273cc54189 | |||
| d01288a73d | |||
| aac4957fc4 | |||
| 9214909d36 | |||
| 642a453fbf | |||
| 8ee824e02d | |||
| 0263691084 | |||
| 1ed1225123 | |||
| d36b177d20 | |||
| e009b88261 | |||
| 6e33f777bb | |||
| 7b371203ae | |||
| 7297bc8c21 | |||
| 572d585571 | |||
| 6f54bb3142 | |||
| 4df2f462e6 | |||
| 893b31e9ea | |||
| 726c33bbd6 | |||
| 7ab6edd608 | |||
| c921404082 | |||
| 5d9c549776 | |||
| 3711ac7376 | |||
| 8861f9169b | |||
| 1c69edf85e | |||
| 77b652ca53 | |||
| 7268d0036b | |||
| 5feae54108 | |||
| ad602d8316 | |||
| e61776f642 | |||
| 4a101b6d28 | |||
| 9d1f1b1048 | |||
| 2b9630f869 | |||
| 1fcb0d524b | |||
| d29e48f9dd | |||
| 3cfcde5e53 | |||
| d0de86c8e4 | |||
| dfa00cfa2b |
@@ -2,68 +2,87 @@
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference
|
||||
version: 2.1
|
||||
|
||||
# Define a job to be invoked later in a workflow.
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
||||
jobs:
|
||||
build-elrsv2:
|
||||
machine: true
|
||||
steps:
|
||||
- checkout
|
||||
- run: docker run -it -e "BOARD_NAME=I6X" -e "CMAKE_FLAGS=PCB=I6X HELI=NO GVARS=NO LUA_COMPILER=NO MULTIMODULE=NO DEBUG=NO PCBI6_ELRSV2=YES" -v $PWD:/opentx vitass/opentx-fw-build
|
||||
- store_artifacts:
|
||||
path: opentx-i6x-2.3.0.bin
|
||||
destination: ./artifacts/opentx-i6x-elrsv2-<< pipeline.git.tag >>.bin
|
||||
build-gvars:
|
||||
machine: true
|
||||
steps:
|
||||
- checkout
|
||||
- run: docker run -it -e "BOARD_NAME=I6X" -e "CMAKE_FLAGS=PCB=I6X HELI=NO GVARS=YES LUA_COMPILER=NO MULTIMODULE=NO DEBUG=NO" -v $PWD:/opentx vitass/opentx-fw-build
|
||||
- store_artifacts:
|
||||
path: opentx-i6x-2.3.0.bin
|
||||
destination: ./artifacts/opentx-i6x-gvars-<< pipeline.git.tag >>.bin
|
||||
build-heli:
|
||||
machine: true
|
||||
steps:
|
||||
- checkout
|
||||
- run: docker run -it -e "BOARD_NAME=I6X" -e "CMAKE_FLAGS=PCB=I6X HELI=YES GVARS=YES LUA_COMPILER=NO MULTIMODULE=NO DEBUG=NO" -v $PWD:/opentx vitass/opentx-fw-build
|
||||
- store_artifacts:
|
||||
path: opentx-i6x-2.3.0.bin
|
||||
destination: ./artifacts/opentx-i6x-heli-<< pipeline.git.tag >>.bin
|
||||
publish-github-release:
|
||||
build-std:
|
||||
docker:
|
||||
- image: cibuilds/github:0.13
|
||||
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ./artifacts
|
||||
- run:
|
||||
name: "Publish Release on GitHub"
|
||||
command: |
|
||||
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete latest ./artifacts/
|
||||
# Invoke jobs via workflows
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
||||
- checkout
|
||||
- run: |
|
||||
python3 ./tools/build-flysky.py -bI6X -tALL $PWD/
|
||||
- store_artifacts:
|
||||
path: output
|
||||
|
||||
build-std-dfplayer:
|
||||
docker:
|
||||
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
python3 ./tools/build-flysky.py -bI6X_DFPLAYER -tALL $PWD/
|
||||
- store_artifacts:
|
||||
path: output
|
||||
|
||||
build-heli:
|
||||
docker:
|
||||
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
python3 ./tools/build-flysky.py -bI6X_HELI -tALL $PWD/
|
||||
- store_artifacts:
|
||||
path: output
|
||||
|
||||
build-heli-dfplayer:
|
||||
docker:
|
||||
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
python3 ./tools/build-flysky.py -bI6X_HELI_DFPLAYER -tALL $PWD/
|
||||
- store_artifacts:
|
||||
path: output
|
||||
|
||||
build-en:
|
||||
docker:
|
||||
- image: ajjjjjjjj/opentx-docker-i6x:1.4.0
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
python3 ./tools/build-flysky.py -bI6X_DFPLAYER -bI6X_HELI -bI6X -tEN $PWD/
|
||||
- store_artifacts:
|
||||
path: output
|
||||
|
||||
workflows:
|
||||
openi6x-workflow:
|
||||
openi6x-release-workflow:
|
||||
jobs:
|
||||
- build-elrsv2
|
||||
# filters:
|
||||
# branches:
|
||||
# ignore: /.*/
|
||||
# tags:
|
||||
# only: /.*-release$/
|
||||
- build-gvars
|
||||
# filters:
|
||||
# branches:
|
||||
# ignore: /.*/
|
||||
# tags:
|
||||
# only: /.*-release$/
|
||||
- build-heli
|
||||
# filters:
|
||||
# branches:
|
||||
# ignore: /.*/
|
||||
# tags:
|
||||
# only: /.*-release$/
|
||||
- publish-github-release:
|
||||
requires:
|
||||
- build-elrsv2
|
||||
- build-gvars
|
||||
- build-heli
|
||||
- build-en:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- master
|
||||
- /.*-maintenance/
|
||||
- build-std:
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /.*-maintenance/
|
||||
- build-std-dfplayer:
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /.*-maintenance/
|
||||
- build-heli:
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /.*-maintenance/
|
||||
- build-heli-dfplayer:
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /.*-maintenance/
|
||||
|
||||
@@ -26,6 +26,5 @@ A clear and concise description of what you expected to happen.
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**General information**
|
||||
- OpenTX version (e.g. 2.1.23 or N123)
|
||||
- Hardware (e.g. Frsky X9D+ or 9X Pro)
|
||||
- OpenTX Companion (e.g. 2.1.23 on Ubuntu 16.04)
|
||||
- OpenI6X version (e.g. 1.8.0)
|
||||
- Hardware (e.g. external module model)
|
||||
|
||||
@@ -20,3 +20,4 @@ radio/src/CmakeFiles/*
|
||||
build.sh
|
||||
firm.sh
|
||||
flash.sh
|
||||
*.patch
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
project(OpenTX)
|
||||
|
||||
set(VERSION_MAJOR "2")
|
||||
set(VERSION_MINOR "3")
|
||||
set(VERSION_MINOR "0")
|
||||
set(VERSION_REVISION "0")
|
||||
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
||||
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
|
||||
@@ -9,7 +9,7 @@ set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFI
|
||||
set(SDCARD_REVISION "0018")
|
||||
set(SDCARD_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}V${SDCARD_REVISION})
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
cmake_policy(SET CMP0020 NEW)
|
||||
cmake_policy(SET CMP0023 OLD)
|
||||
if(POLICY CMP0042)
|
||||
|
||||
@@ -1,52 +1,57 @@
|
||||
# FlySky i6x port of OpenTX
|
||||

|
||||
[](https://github.com/OpenI6X/opentx/releases/latest)
|
||||
[](https://github.com/OpenI6X/opentx/releases)
|
||||
[](https://discord.gg/3vKfYNTVa2)
|
||||
|
||||
This is a port of OpenTX for the venerable Flysky I6X RC radio transmitter. You can find the latest build and some instructions and videos contributed by fellow early adopters in the [RCGroups thread](https://www.rcgroups.com/forums/showthread.php?3916435-FlySky-I6X-port-of-OpenTX)
|
||||

|
||||
|
||||
## Implemented features
|
||||
# Custom OpenTX / EdgeTX for Flysky FS-i6X
|
||||
|
||||
* AFHDS2A protocol
|
||||
* PPM out
|
||||
* CRSF working with ExpressLRS and Crossfire modules at rates from 115k to 3.75M bauds, CRSFshot enabled
|
||||
* Telemetry
|
||||
* Audio tones, alarms and vario custom implementation (Janek)
|
||||
* USB (To enable on standard cable: General Settings > USB Detect set to "Once") (Janek)
|
||||
* Joystick mode (Janek)
|
||||
* Mass Storage to backup/restore eeprom (Janek)
|
||||
* ExpressLRS V1.x configuration in model setup
|
||||
|
||||
## Users Telegram group
|
||||
Join our [Discord](https://discord.gg/3vKfYNTVa2), [RCGroups](https://www.rcgroups.com/forums/showthread.php?3916435-FlySky-I6X-port-of-OpenTX) or [Telegram](https://t.me/otx_flysky_i6x) to contribute, discuss or get help.<br>
|
||||
|
||||
https://t.me/otx_flysky_i6x
|
||||
## Instructions
|
||||
|
||||
## Navigation:
|
||||
- [FlySky i6X user interface](https://github.com/OpenI6X/opentx/wiki/Manual) and other differences to official EdgeTX/OpenTX devices.<br>
|
||||
- [EdgeTX manual](https://manual.edgetx.org/bw-radios)
|
||||
- [How to install, upgrade or restore firmware](https://github.com/OpenI6X/opentx/wiki/Flashing-&-Upgrading)<br>
|
||||
- [Developers guide, how to build](https://github.com/OpenI6X/opentx/wiki/Development)<br>
|
||||
- [Modifications](https://github.com/OpenI6X/opentx/wiki/Modifications)<br>
|
||||
|
||||
| Key | Function |
|
||||
| --- | --- |
|
||||
| UP | Hold for stats |
|
||||
| DOWN | Hold for telemetry |
|
||||
| OK | Hold for Model menu |
|
||||
| CANCEL | EXIT. Hold for graceful shutdown (Needed to save timers) |
|
||||
| BIND | Go RIGHT. Go to next PAGE. Hold for general menu. |
|
||||
| RIGHT POT | Scroll right or left |
|
||||
## Comparison
|
||||
|
||||
## ST-Link pinout
|
||||
| Feature | FlySky i6X | OpenTX i6X |
|
||||
|---------------------------|------------|------------------------------|
|
||||
| Channels | 6/10 | 16 |
|
||||
| Mixers | 3 | 32 |
|
||||
| Models | 20 | 16 / unlimited<sup>[1]</sup> |
|
||||
| Protocols | AFHDS, AFHDS2A, PPM | AFHDS2A + 16Ch modes, PPM, CRSF (CRSFshot) |
|
||||
| Trainer | PPM | SBUS, PPM |
|
||||
| Timers | _ | ✓ |
|
||||
| Voice annoucements | _ | ✓<sup>[2]</sup> |
|
||||
| Variometer | _ | ✓ |
|
||||
| ExpressLRS ready | _ | ✓ Configurator built-in (no need for LUA) |
|
||||
| Adjustable screen brightness | _ | ✓<sup>[3]</sup> |
|
||||
| USB Modes | Joystick | Joystick, Storage, Serial (Telemetry mirror, Debug) |
|
||||
| AUX Serial port | _ | ✓ SBUS Trainer, Telemetry mirror, Debug |
|
||||
| FlySky FS-HZCZ03-ADJ Digital Gimbal support | _ | ✓<sup>[4]</sup> |
|
||||
| Languages | EN, CN | PL, EN, CZ, DE, ES, FI, FR, IT, NL, PT, SE |
|
||||
|
||||

|
||||
<sub>[1] Unlimited by using USB mass storage mode eeprom backup/restore.</sub><br>
|
||||
<sub>[2] By adding DFPlayer, see [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#dfplayer) in wiki.</sub><br>
|
||||
<sub>[3] By wiring 2 pads, see [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#adjustable-backlight-level) in wiki.</sub><br>
|
||||
<sub>[4] See [instructions](https://github.com/OpenI6X/opentx/wiki/Modifications#flysky-fs-hzcz03-adj-gimbal) in wiki.</sub>
|
||||
|
||||
## Credits
|
||||
|
||||
## Linux instructions
|
||||
### Compile
|
||||
`docker run --rm -it -e "BOARD_NAME=I6X" -e "CMAKE_FLAGS=PCB=I6X HELI=NO GVARS=NO LUA_COMPILER=NO MULTIMODULE=NO DEBUG=YES" -v $PWD:/opentx vitass/opentx-fw-build`
|
||||
|
||||
### Flash
|
||||
`sudo st-flash write <file_to_flash>.bin 0x08000000`
|
||||
|
||||
### Debug tty:
|
||||
`sudo cat /dev/ttyUSB0 115200`
|
||||
|
||||
## Contributors
|
||||
|
||||
* Janek (@ajjjjjjjj) ongoing collaboration.
|
||||
* All the RF code was taken from the great KotelloRC's erfly6: Er9X for i6 and i6x. You can find his project here: https://bitbucket.org/KotelloRC/erfly6/src/master/
|
||||
* ADC code taken from OpenGround: https://github.com/fishpepper/OpenGround
|
||||
* This work is based on Jakub's (qba667) work and is forked from his repo.
|
||||
* All the contributors of OpenTX.
|
||||
* Janek ([ajjjjjjjj](https://github.com/ajjjjjjjj)), continues Kuba's and Mariano's work, added sound, USB, ExpressLRS V2/V3 configuration, telemetry mirror, SBUS trainer, new/fixed drivers, ports, bugfixes.
|
||||
* Mariano ([marianomd](https://github.com/marianomd)), continued Kuba's work and made it up to useable condition! Added gimbals, buttons, AFHDS2A, PPM, CRSF.
|
||||
* Kuba ([qba667](https://github.com/qba667)), started this work and made this project possible, it is forked from his repo.
|
||||
* Wilhelm ([wimalopaan](https://github.com/wimalopaan)) added 16 channels SBUS16 / IBUS16 modes.
|
||||
* Rafael ([rafolg](https://github.com/rafolg)), ported FlySky Hall Gimbal support from EdgeTX.
|
||||
* Tom ([tmcadam](https://github.com/tmcadam)) fixed AFHDS2A PWM mode selection.
|
||||
* The internal RF code was taken from the great KotelloRC's [erfly6: Er9X for i6 and i6x](https://bitbucket.org/KotelloRC/erfly6/src/master/).
|
||||
* Some of the internal RF fixes are a result of analysing [pascallanger's](https://github.com/pascallanger) [DIY-Multiprotocol-TX-Module](https://github.com/pascallanger/DIY-Multiprotocol-TX-Module).
|
||||
* ExpressLRS configurator is based on elrsV2/V3.lua from [ExpressLRS](https://github.com/ExpressLRS/ExpressLRS).
|
||||
* Some of the ports are from [EdgeTX](https://github.com/EdgeTX/edgetx/).
|
||||
* ADC code taken from [OpenGround](https://github.com/fishpepper/OpenGround).
|
||||
* All the contributors of [OpenTX](https://github.com/opentx/opentx/).
|
||||
|
||||
@@ -161,24 +161,24 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||
if (func <= FuncInstantTrim) {
|
||||
return QString("%1").arg(param);
|
||||
}
|
||||
else if (func==FuncLogs) {
|
||||
else if (func == FuncLogs) {
|
||||
return QString("%1").arg(param/10.0) + tr("s");
|
||||
}
|
||||
else if (func==FuncPlaySound) {
|
||||
else if (func == FuncPlaySound) {
|
||||
CustomFunctionData::populatePlaySoundParams(qs);
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
return qs.at(param);
|
||||
else
|
||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if (func==FuncPlayHaptic) {
|
||||
else if (func == FuncPlayHaptic) {
|
||||
CustomFunctionData::populateHapticParams(qs);
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
return qs.at(param);
|
||||
else
|
||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if (func==FuncReset) {
|
||||
else if (func == FuncReset) {
|
||||
QComboBox cb;
|
||||
CustomFunctionData::populateResetParams(model, &cb);
|
||||
int pos = cb.findData(param);
|
||||
@@ -187,11 +187,11 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||
else
|
||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
|
||||
else if (func == FuncVolume || func == FuncPlayValue || func == FuncBacklight) {
|
||||
RawSource item(param);
|
||||
return item.toString(model);
|
||||
}
|
||||
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
|
||||
else if (func == FuncPlayPrompt || func == FuncPlayBoth) {
|
||||
if ( getCurrentFirmware()->getCapability(VoicesAsNumbers)) {
|
||||
return QString("%1").arg(param);
|
||||
}
|
||||
@@ -199,7 +199,7 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||
return paramarm;
|
||||
}
|
||||
}
|
||||
else if ((func>=FuncAdjustGV1) && (func<FuncCount)) {
|
||||
else if (func >= FuncAdjustGV1 && func < FuncCount) {
|
||||
switch (adjustMode) {
|
||||
case FUNC_ADJUST_GVAR_CONSTANT:
|
||||
return tr("Value ")+QString("%1").arg(param);
|
||||
@@ -207,8 +207,17 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||
case FUNC_ADJUST_GVAR_GVAR:
|
||||
return RawSource(param).toString();
|
||||
case FUNC_ADJUST_GVAR_INCDEC:
|
||||
if (param==0) return tr("Decr:") + " -1";
|
||||
else return tr("Incr:") + " +1";
|
||||
float val;
|
||||
QString unit;
|
||||
if (IS_ARM(getCurrentBoard())) {
|
||||
val = param * model->gvarData[func - FuncAdjustGV1].multiplierGet();
|
||||
unit = model->gvarData[func - FuncAdjustGV1].unitToString();
|
||||
}
|
||||
else {
|
||||
val = param;
|
||||
unit = "";
|
||||
}
|
||||
return QString("Increment: %1%2").arg(val).arg(unit);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
@@ -230,11 +239,12 @@ QString CustomFunctionData::repeatToString() const
|
||||
|
||||
QString CustomFunctionData::enabledToString() const
|
||||
{
|
||||
if ((func>=FuncOverrideCH1 && func<=FuncOverrideCH32) ||
|
||||
(func>=FuncAdjustGV1 && func<=FuncAdjustGVLast) ||
|
||||
(func==FuncReset) ||
|
||||
(func>=FuncSetTimer1 && func<=FuncSetTimer2) ||
|
||||
(func==FuncVolume) ||
|
||||
if ((func >= FuncOverrideCH1 && func <= FuncOverrideCH32) ||
|
||||
(func >= FuncAdjustGV1 && func <= FuncAdjustGVLast) ||
|
||||
(func == FuncReset) ||
|
||||
(func >= FuncSetTimer1 && func <= FuncSetTimer2) ||
|
||||
(func == FuncVolume) ||
|
||||
(func == FuncBacklight) ||
|
||||
(func <= FuncInstantTrim)) {
|
||||
if (!enabled) {
|
||||
return tr("DISABLED");
|
||||
@@ -248,7 +258,7 @@ void CustomFunctionData::convert(RadioDataConversionState & cstate)
|
||||
cstate.setComponent(tr("CFN"), 8);
|
||||
cstate.setSubComp(nameToString(cstate.subCompIdx, (cstate.toModel() ? false : true)));
|
||||
swtch.convert(cstate);
|
||||
if (func == FuncVolume || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) {
|
||||
if (func == FuncVolume || func == FuncBacklight || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) {
|
||||
param = RawSource(param).convert(cstate.withComponentField("PARAM")).toValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,11 @@ class SensorData {
|
||||
TELEM_CELL_INDEX_4,
|
||||
TELEM_CELL_INDEX_5,
|
||||
TELEM_CELL_INDEX_6,
|
||||
// TELEM_CELL_INDEX_7, // PCBI6X: uses RAM and I don't think someone will use 8S with i6X
|
||||
// TELEM_CELL_INDEX_8,
|
||||
TELEM_CELL_INDEX_HIGHEST,
|
||||
TELEM_CELL_INDEX_DELTA,
|
||||
TELEM_CELL_INDEX_LAST = TELEM_CELL_INDEX_DELTA
|
||||
};
|
||||
|
||||
enum
|
||||
|
||||
@@ -425,8 +425,16 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
fswtchParam[i]->setDecimals(model->gvarData[gvidx].prec);
|
||||
fswtchParam[i]->setSingleStep(model->gvarData[gvidx].multiplierGet());
|
||||
fswtchParam[i]->setSuffix(model->gvarData[gvidx].unitToString());
|
||||
fswtchParam[i]->setMinimum(model->gvarData[gvidx].getMinPrec());
|
||||
fswtchParam[i]->setMaximum(model->gvarData[gvidx].getMaxPrec());
|
||||
if (cfn.adjustMode==FUNC_ADJUST_GVAR_INCDEC) {
|
||||
double rng = abs(model->gvarData[gvidx].getMax() - model->gvarData[gvidx].getMin());
|
||||
rng *= model->gvarData[gvidx].multiplierGet();
|
||||
fswtchParam[i]->setMinimum(-rng);
|
||||
fswtchParam[i]->setMaximum(rng);
|
||||
}
|
||||
else {
|
||||
fswtchParam[i]->setMinimum(model->gvarData[gvidx].getMinPrec());
|
||||
fswtchParam[i]->setMaximum(model->gvarData[gvidx].getMaxPrec());
|
||||
}
|
||||
fswtchParam[i]->setValue(cfn.param * model->gvarData[gvidx].multiplierGet());
|
||||
}
|
||||
else {
|
||||
@@ -709,28 +717,28 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, uint function, unsi
|
||||
{
|
||||
QStringList qs;
|
||||
b->setModel(new QStandardItemModel(b)); // clear combo box but not any shared item model
|
||||
if (function==FuncPlaySound) {
|
||||
if (function == FuncPlaySound) {
|
||||
CustomFunctionData::populatePlaySoundParams(qs);
|
||||
b->addItems(qs);
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
else if (function==FuncPlayHaptic) {
|
||||
else if (function == FuncPlayHaptic) {
|
||||
CustomFunctionData::populateHapticParams(qs);
|
||||
b->addItems(qs);
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
else if (function==FuncReset) {
|
||||
else if (function == FuncReset) {
|
||||
CustomFunctionData::populateResetParams(model, b, value);
|
||||
}
|
||||
else if (function==FuncVolume) {
|
||||
else if (function == FuncVolume || function == FuncBacklight) {
|
||||
b->setModel(rawSrcInputsItemModel);
|
||||
b->setCurrentIndex(b->findData(value));
|
||||
}
|
||||
else if (function==FuncPlayValue) {
|
||||
else if (function == FuncPlayValue) {
|
||||
b->setModel(rawSrcAllItemModel);
|
||||
b->setCurrentIndex(b->findData(value));
|
||||
}
|
||||
else if (function>=FuncAdjustGV1 && function<=FuncAdjustGVLast) {
|
||||
else if (function >= FuncAdjustGV1 && function <= FuncAdjustGVLast) {
|
||||
switch (adjustmode) {
|
||||
case 1:
|
||||
b->setModel(rawSrcInputsItemModel);
|
||||
|
||||
@@ -1,381 +0,0 @@
|
||||
EESchema-LIBRARY Version 2.3 Date: 06/01/2017 11:42:37
|
||||
#encoding utf-8
|
||||
#
|
||||
# +BATT
|
||||
#
|
||||
DEF +BATT #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -50 20 H I C CNN
|
||||
F1 "+BATT" 0 100 30 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
X +BATT 1 0 0 0 U 20 20 0 0 W N
|
||||
C 0 60 20 0 1 0 N
|
||||
P 3 0 1 0 0 0 0 40 0 40 N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# +HF
|
||||
#
|
||||
DEF +HF #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -50 20 H I C CNN
|
||||
F1 "+HF" 0 100 50 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
X +BATT 1 0 0 0 U 20 20 0 0 W N
|
||||
C 0 60 20 0 1 0 N
|
||||
P 3 0 1 0 0 0 0 40 0 40 N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# 4016
|
||||
#
|
||||
DEF 4016 U 0 0 Y Y 4 F N
|
||||
F0 "U" 200 -149 40 H V C CNN
|
||||
F1 "4016" 200 150 40 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS 4066
|
||||
DRAW
|
||||
P 3 0 1 0 -100 -150 0 -50 0 -50 N
|
||||
P 4 0 1 0 -100 0 100 100 100 -100 -100 0 N
|
||||
P 4 0 1 0 -100 100 100 0 -100 -100 -100 100 N
|
||||
X V- 7 0 -250 200 U 30 30 0 1 W
|
||||
X V+ 14 0 250 200 D 30 30 0 1 W
|
||||
X I/O 1 -300 0 200 R 40 40 1 1 P
|
||||
X O/I 2 300 0 200 L 40 40 1 1 P
|
||||
X ON 13 -300 -150 200 R 40 40 1 1 I
|
||||
X O/I 3 300 0 200 L 40 40 2 1 P
|
||||
X I/O 4 -300 0 200 R 40 40 2 1 P
|
||||
X ON 5 -300 -150 200 R 40 40 2 1 I
|
||||
X ON 6 -300 -150 200 R 40 40 3 1 I
|
||||
X I/O 8 -300 0 200 R 40 40 3 1 P
|
||||
X O/I 9 300 0 200 L 40 40 3 1 P
|
||||
X O/I 10 300 0 200 L 40 40 4 1 P
|
||||
X I/O 11 -300 0 200 R 40 40 4 1 P
|
||||
X ON 12 -300 -150 200 R 40 40 4 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# 7805
|
||||
#
|
||||
DEF 7805 U 0 30 N Y 1 F N
|
||||
F0 "U" 150 -196 60 H V C CNN
|
||||
F1 "7805" 0 200 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS LM7805 LM7812 78L05
|
||||
DRAW
|
||||
S -200 -150 200 150 0 1 0 N
|
||||
X VI VI -400 50 200 R 40 40 1 1 I
|
||||
X VO VO 400 50 200 L 40 40 1 1 w
|
||||
X GND GND 0 -250 100 U 40 40 1 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# C
|
||||
#
|
||||
DEF C C 0 10 N Y 1 F N
|
||||
F0 "C" 0 100 40 H V L CNN
|
||||
F1 "C" 6 -85 40 H V L CNN
|
||||
F2 "~" 38 -150 30 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
SM*
|
||||
C?
|
||||
C1-1
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 20 -80 -30 80 -30 N
|
||||
P 2 0 1 20 -80 30 80 30 N
|
||||
X ~ 1 0 200 170 D 40 40 1 1 P
|
||||
X ~ 2 0 -200 170 U 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# CONN_1
|
||||
#
|
||||
DEF ~CONN_1 P 0 30 N N 1 F N
|
||||
F0 "P" 80 0 40 H V L CNN
|
||||
F1 "CONN_1" 0 55 30 H I C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
C 0 0 31 0 1 0 N
|
||||
P 2 0 1 0 -30 0 -50 0 N
|
||||
X 1 1 -150 0 100 R 60 60 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# DIODESCH
|
||||
#
|
||||
DEF DIODESCH D 0 40 N N 1 F N
|
||||
F0 "D" 0 100 40 H V C CNN
|
||||
F1 "DIODESCH" 0 -100 40 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
D?
|
||||
S*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 3 0 1 0 -50 50 50 0 -50 -50 F
|
||||
P 6 0 1 8 75 25 75 50 50 50 50 -50 25 -50 25 -25 N
|
||||
X A 1 -200 0 150 R 40 40 1 1 P
|
||||
X K 2 200 0 150 L 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# GND
|
||||
#
|
||||
DEF ~GND #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 0 30 H I C CNN
|
||||
F1 "GND" 0 -70 30 H I C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
P 4 0 1 0 -50 0 0 -50 50 0 -50 0 N
|
||||
X GND 1 0 0 0 U 30 30 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# LED
|
||||
#
|
||||
DEF LED D 0 40 Y N 1 F N
|
||||
F0 "D" 0 100 50 H V C CNN
|
||||
F1 "LED" 0 -100 50 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
$FPLIST
|
||||
LED-3MM
|
||||
LED-5MM
|
||||
LED-10MM
|
||||
LED-0603
|
||||
LED-0805
|
||||
LED-1206
|
||||
LEDV
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 0 50 50 50 -50 N
|
||||
P 3 0 1 0 -50 50 50 0 -50 -50 F
|
||||
P 3 0 1 0 65 -40 110 -80 105 -55 N
|
||||
P 3 0 1 0 80 -25 125 -65 120 -40 N
|
||||
X A 1 -200 0 150 R 40 40 1 1 P
|
||||
X K 2 200 0 150 L 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# LM2903
|
||||
#
|
||||
DEF LM2903 U 0 20 Y Y 2 F N
|
||||
F0 "U" 150 150 60 H V C CNN
|
||||
F1 "LM2903" 200 -200 60 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS LM293 LM393 LM193
|
||||
DRAW
|
||||
P 4 0 1 0 -200 200 200 0 -200 -200 -200 200 N
|
||||
X ~ 1 500 0 300 L 40 40 1 1 C
|
||||
X _ 2 -500 -100 300 R 40 40 1 1 I
|
||||
X + 3 -500 100 300 R 40 40 1 1 I
|
||||
X V- 4 -100 -400 250 U 40 40 1 1 W
|
||||
X V+ 8 -100 400 250 D 40 40 1 1 W
|
||||
X V- 4 -100 -400 250 U 40 40 2 1 W
|
||||
X + 5 -500 100 300 R 40 40 2 1 I
|
||||
X _ 6 -500 -100 300 R 40 40 2 1 I
|
||||
X ~ 7 500 0 300 L 40 40 2 1 C
|
||||
X V+ 8 -100 400 250 D 40 40 2 1 W
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# MOS_N
|
||||
#
|
||||
DEF MOS_N Q 0 0 N Y 1 F N
|
||||
F0 "Q" 10 170 60 H V R CNN
|
||||
F1 "MOS_N" 10 -150 60 H V R CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS MOSFET_N
|
||||
DRAW
|
||||
P 2 0 1 8 -50 -100 -50 100 N
|
||||
P 2 0 1 10 0 -150 0 150 N
|
||||
P 2 0 1 0 100 -100 0 -100 N
|
||||
P 2 0 1 0 100 100 0 100 N
|
||||
P 3 0 1 8 100 -100 100 0 50 0 N
|
||||
P 5 0 1 8 50 30 50 -30 0 0 50 30 50 30 N
|
||||
X D D 100 200 100 D 40 40 1 1 P
|
||||
X G G -200 0 150 R 40 40 1 1 I
|
||||
X S S 100 -200 100 U 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# MOS_P
|
||||
#
|
||||
DEF MOS_P Q 0 40 Y N 1 F N
|
||||
F0 "Q" 0 190 60 H V R CNN
|
||||
F1 "MOS_P" 0 -180 60 H V R CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
ALIAS MOSFET_P
|
||||
DRAW
|
||||
P 2 0 1 8 -50 -100 -50 100 N
|
||||
P 2 0 1 10 0 -150 0 150 N
|
||||
P 2 0 1 8 30 0 0 0 N
|
||||
P 2 0 1 0 100 -100 0 -100 N
|
||||
P 2 0 1 0 100 100 0 100 N
|
||||
P 3 0 1 0 80 0 100 0 100 -100 N
|
||||
P 5 0 1 8 30 40 30 -30 80 0 30 40 30 40 N
|
||||
X D D 100 200 100 D 40 40 1 1 P
|
||||
X G G -200 0 150 R 40 40 1 1 I
|
||||
X S S 100 -200 100 U 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# POT
|
||||
#
|
||||
DEF POT RV 0 40 Y N 1 F N
|
||||
F0 "RV" 0 -100 50 H V C CNN
|
||||
F1 "POT" 0 0 50 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
S -150 50 150 -50 0 1 0 N
|
||||
P 3 0 1 0 0 50 -20 70 20 70 F
|
||||
X 1 1 -250 0 100 R 40 40 1 1 P
|
||||
X 2 2 0 150 80 D 40 40 1 1 P
|
||||
X 3 3 250 0 100 L 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# R
|
||||
#
|
||||
DEF R R 0 0 N Y 1 F N
|
||||
F0 "R" 80 0 40 V V C CNN
|
||||
F1 "R" 7 1 40 V V C CNN
|
||||
F2 "~" -70 0 30 V V C CNN
|
||||
F3 "~" 0 0 30 H V C CNN
|
||||
$FPLIST
|
||||
R?
|
||||
SM0603
|
||||
SM0805
|
||||
R?-*
|
||||
SM1206
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -40 150 40 -150 0 1 12 N
|
||||
X ~ 1 0 250 100 D 60 60 1 1 P
|
||||
X ~ 2 0 -250 100 U 60 60 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# SPEAKER
|
||||
#
|
||||
DEF SPEAKER SP 0 0 N Y 1 F N
|
||||
F0 "SP" -100 250 70 H V C CNN
|
||||
F1 "SPEAKER" -100 -250 70 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
P 4 0 0 0 100 150 250 300 250 -300 100 -150 N
|
||||
P 5 0 0 0 -100 150 100 150 100 -150 -100 -150 -100 150 F
|
||||
X 1 1 -300 100 200 R 40 40 1 1 I
|
||||
X 2 2 -300 -100 200 R 40 40 1 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# SPST
|
||||
#
|
||||
DEF SPST SW 0 0 N Y 1 F N
|
||||
F0 "SW" 0 100 70 H V C CNN
|
||||
F1 "SPST" 0 -100 70 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
C -150 0 50 0 0 0 N
|
||||
C 150 0 50 0 0 0 N
|
||||
P 2 0 0 0 -100 0 100 100 N
|
||||
X 1 1 -500 0 300 R 70 70 1 1 I
|
||||
X 2 2 500 0 300 L 70 70 1 1 I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# SW
|
||||
#
|
||||
DEF SW SW 0 40 N N 1 F N
|
||||
F0 "SW" 0 100 50 H V C CNN
|
||||
F1 "SW" 0 0 50 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
P 2 0 1 0 -100 0 100 50 N
|
||||
X 1 1 -300 0 200 R 60 60 0 1 P I
|
||||
X 2 2 300 0 200 L 60 60 0 1 P I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# SW_PUSH
|
||||
#
|
||||
DEF SW_PUSH SW 0 40 N N 1 F N
|
||||
F0 "SW" 150 110 50 H V C CNN
|
||||
F1 "SW_PUSH" 0 -80 50 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
S -170 50 170 60 0 1 0 N
|
||||
P 4 0 1 0 -40 60 -30 90 30 90 40 60 N
|
||||
X 1 1 -300 0 200 R 60 60 0 1 P I
|
||||
X 2 2 300 0 200 L 60 60 0 1 P I
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# TLP290
|
||||
#
|
||||
DEF TLP290 IC 0 40 Y Y 1 F N
|
||||
F0 "IC" -213 178 40 H V C CNN
|
||||
F1 "TLP290" 149 -184 40 H V C CNN
|
||||
F2 "SOP4" -164 -174 29 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
C -175 -100 5 0 1 0 N
|
||||
C -175 100 5 0 1 0 N
|
||||
S -250 150 250 -150 0 1 10 f
|
||||
P 2 0 1 10 -200 25 -150 25 N
|
||||
P 2 0 1 0 -175 -25 -175 -100 N
|
||||
P 2 0 1 0 -175 25 -175 100 N
|
||||
P 2 0 1 10 -125 -25 -75 -25 N
|
||||
P 2 0 1 0 100 25 175 100 N
|
||||
P 2 0 1 0 175 -100 100 -25 F
|
||||
P 2 0 1 0 175 -100 250 -100 N
|
||||
P 2 0 1 0 175 100 250 100 N
|
||||
P 3 0 1 0 -250 100 -100 100 -100 25 N
|
||||
P 3 0 1 0 -100 -25 -100 -100 -250 -100 N
|
||||
P 3 0 1 20 100 75 100 -75 100 -75 N
|
||||
P 4 0 1 10 -175 25 -200 -25 -150 -25 -175 25 F
|
||||
P 4 0 1 10 -100 -25 -125 25 -75 25 -100 -25 F
|
||||
P 4 0 1 0 -20 10 1 30 1 10 31 40 N
|
||||
P 4 0 1 0 31 40 11 30 21 20 31 40 N
|
||||
P 5 0 1 0 120 -65 140 -45 160 -85 120 -65 120 -65 F
|
||||
P 7 0 1 0 -20 -30 1 -10 1 -30 31 0 11 -10 21 -20 31 0 N
|
||||
X ~ 1 -350 100 100 R 40 40 1 1 P
|
||||
X ~ 2 -350 -100 100 R 40 40 1 1 P
|
||||
X ~ 3 350 -100 100 L 40 40 1 1 P
|
||||
X ~ 4 350 100 100 L 40 40 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# VCC
|
||||
#
|
||||
DEF VCC #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 100 30 H I C CNN
|
||||
F1 "VCC" 0 100 30 H V C CNN
|
||||
F2 "~" 0 0 60 H V C CNN
|
||||
F3 "~" 0 0 60 H V C CNN
|
||||
DRAW
|
||||
X VCC 1 0 0 0 U 20 20 0 0 W N
|
||||
C 0 50 20 0 1 0 N
|
||||
P 3 0 1 0 0 0 0 30 0 30 N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
#End Library
|
||||
@@ -1,42 +0,0 @@
|
||||
update=07/01/2017 00:36:05
|
||||
last_client=eeschema
|
||||
[eeschema]
|
||||
version=1
|
||||
LibDir=
|
||||
NetFmtName=
|
||||
RptD_X=0
|
||||
RptD_Y=100
|
||||
RptLab=1
|
||||
LabSize=60
|
||||
[eeschema/libraries]
|
||||
LibName1=power
|
||||
LibName2=device
|
||||
LibName3=transistors
|
||||
LibName4=conn
|
||||
LibName5=linear
|
||||
LibName6=regul
|
||||
LibName7=74xx
|
||||
LibName8=cmos4000
|
||||
LibName9=adc-dac
|
||||
LibName10=memory
|
||||
LibName11=xilinx
|
||||
LibName12=special
|
||||
LibName13=microcontrollers
|
||||
LibName14=dsp
|
||||
LibName15=microchip
|
||||
LibName16=analog_switches
|
||||
LibName17=motorola
|
||||
LibName18=texas
|
||||
LibName19=intel
|
||||
LibName20=audio
|
||||
LibName21=interface
|
||||
LibName22=digital-audio
|
||||
LibName23=philips
|
||||
LibName24=display
|
||||
LibName25=cypress
|
||||
LibName26=siliconi
|
||||
LibName27=opto
|
||||
LibName28=atmel
|
||||
LibName29=contrib
|
||||
LibName30=valves
|
||||
LibName31=MEGA2560
|
||||
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 213 KiB |
|
After Width: | Height: | Size: 250 KiB |
|
After Width: | Height: | Size: 165 KiB |
@@ -3,7 +3,8 @@ include(Bitmaps)
|
||||
|
||||
set(PCB_TYPES X7 XLITE X9D X9D+ X9E X10 X12S SKY9X 9XRPRO AR9X I6X)
|
||||
set(GUI_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL)
|
||||
set(TTS_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL RU)
|
||||
#set(TTS_LANGUAGES CZ DE EN ES FR IT PT SK SE PL HU NL RU)
|
||||
set(TTS_LANGUAGES EN) # i6X dfplayer
|
||||
|
||||
set(PCB "X9D+" CACHE STRING "Radio type, one of: ${PCB_TYPES}")
|
||||
set_property(CACHE PCB PROPERTY STRINGS ${PCB_TYPES})
|
||||
@@ -11,8 +12,6 @@ set(TRANSLATIONS "EN" CACHE STRING "Radio language, one of: ${GUI_LANGUAGES}")
|
||||
set_property(CACHE TRANSLATIONS PROPERTY STRINGS ${GUI_LANGUAGES})
|
||||
set(SPLASH "DEFAULT" CACHE STRING "Splash (DEFAULT/OFF/FRSKY)")
|
||||
set_property(CACHE SPLASH PROPERTY STRINGS DEFAULT OFF FRSKY)
|
||||
set(PPM_UNIT "PERCENT_PREC1" CACHE STRING "PPM display unit (US/PERCENT_PREC1/PERCENT_PREC0)")
|
||||
set_property(CACHE PPM_UNIT PROPERTY STRINGS US PERCENT_PREC1 PERCENT_PREC0)
|
||||
set(DEFAULT_MODE "" CACHE STRING "Default sticks mode")
|
||||
set(FONT "STD" CACHE STRING "Choose font : STD or SQT5")
|
||||
set_property(CACHE FONT PROPERTY STRINGS SQT5)
|
||||
@@ -31,6 +30,7 @@ option(AUTOSOURCE "Automatic source detection in menus" ON)
|
||||
option(AUTOSWITCH "Automatic switch detection in menus" ON)
|
||||
option(SEMIHOSTING "Enable debugger semihosting" OFF)
|
||||
option(JITTER_MEASURE "Enable ADC jitter measurement" OFF)
|
||||
option(WATCHDOG "Enable hardware Watchdog" ON)
|
||||
option(WATCHDOG_DISABLED "Disable hardware Watchdog" OFF)
|
||||
if(SDL_FOUND)
|
||||
option(SIMU_AUDIO "Enable simulator audio." ON)
|
||||
@@ -47,7 +47,8 @@ option(FRSKY_STICKS "Reverse sticks for FrSky sticks" OFF)
|
||||
option(NANO "Use nano newlib and binalloc")
|
||||
option(NIGHTLY_BUILD_WARNING "Warn this is a nightly build" OFF)
|
||||
option(MODULE_R9M_FLEX_FW "Add R9M options for non certified firmwwares" OFF)
|
||||
option(PXX2 "Enable PXX v2 support" OFF)
|
||||
option(EXTPWR_INVERT "Enable inverted pwr enable on PC13" OFF)
|
||||
option(CRSF_FULLDUPLEX "Enable CRSF full duplex mode with RX on PA15" OFF)
|
||||
|
||||
# since we reset all default CMAKE compiler flags for firmware builds, provide an alternate way for user to specify additional flags.
|
||||
set(FIRMWARE_C_FLAGS "" CACHE STRING "Additional flags for firmware target c compiler (note: all CMAKE_C_FLAGS[_*] are ignored for firmware/bootloader).")
|
||||
@@ -238,6 +239,14 @@ if(JITTER_MEASURE)
|
||||
add_definitions(-DJITTER_MEASURE)
|
||||
endif()
|
||||
|
||||
if(ASTERISK)
|
||||
add_definitions(-DASTERISK)
|
||||
endif()
|
||||
|
||||
if(WATCHDOG)
|
||||
add_definitions(-DWATCHDOG)
|
||||
endif()
|
||||
|
||||
if(WATCHDOG_DISABLED)
|
||||
add_definitions(-DWATCHDOG_DISABLED)
|
||||
endif()
|
||||
@@ -263,14 +272,6 @@ if(SHUTDOWN_CONFIRMATION)
|
||||
add_definitions(-DSHUTDOWN_CONFIRMATION)
|
||||
endif()
|
||||
|
||||
if(PPM_UNIT STREQUAL US)
|
||||
add_definitions(-DPPM_UNIT_US)
|
||||
elseif(PPM_UNIT STREQUAL PERCENT_PREC1)
|
||||
add_definitions(-DPPM_UNIT_PERCENT_PREC1)
|
||||
else()
|
||||
add_definitions(-DPPM_UNIT_PERCENT_PREC0)
|
||||
endif()
|
||||
|
||||
if(PPM_CENTER_ADJUSTABLE)
|
||||
add_definitions(-DPPM_CENTER_ADJUSTABLE)
|
||||
endif()
|
||||
@@ -325,8 +326,12 @@ if(MODULE_R9M_FLEX_FW)
|
||||
add_definitions(-DMODULE_R9M_FLEX_FW)
|
||||
endif()
|
||||
|
||||
if(PXX2)
|
||||
add_definitions(-DPXX2)
|
||||
if(EXTPWR_INVERT)
|
||||
add_definitions(-DEXTPWR_INVERT)
|
||||
endif()
|
||||
|
||||
if(CRSF_FULLDUPLEX)
|
||||
add_definitions(-DCRSF_FULLDUPLEX)
|
||||
endif()
|
||||
|
||||
set(SRC
|
||||
@@ -339,7 +344,7 @@ set(SRC
|
||||
mixer_scheduler.cpp
|
||||
stamp.cpp
|
||||
timers.cpp
|
||||
trainer_input.cpp
|
||||
trainer.cpp
|
||||
)
|
||||
|
||||
if(GUI)
|
||||
@@ -370,10 +375,8 @@ foreach(FILE ${PULSES_SRC})
|
||||
set(SRC ${SRC} pulses/${FILE})
|
||||
endforeach()
|
||||
|
||||
add_definitions(-DCORRECT_NEGATIVE_SHIFTS)
|
||||
|
||||
if(NOT MSVC)
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Wall -Wno-strict-aliasing -Wformat -Wreturn-type -Wunused -Wuninitialized -Wunknown-pragmas -Wno-switch -Wtype-limits")
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Wall -Wno-address-of-packed-member -Wno-strict-aliasing -Wformat -Wreturn-type -Wunused -Wuninitialized -Wunknown-pragmas -Wno-switch -Wtype-limits")
|
||||
if(WARNINGS_AS_ERRORS)
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Werror")
|
||||
endif(WARNINGS_AS_ERRORS)
|
||||
@@ -441,14 +444,14 @@ if(NOT MSVC)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -o <OBJECT> <SOURCE>")
|
||||
|
||||
set(COMMON_FLAGS "-mcpu=${MCU} -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=firmware.lst -O${OPT} -gdwarf-2 -DHSE_VALUE=${HSE_VALUE} -fno-exceptions -fdata-sections -ffunction-sections ${WARNING_FLAGS}")
|
||||
set(COMMON_FLAGS "-mcpu=${MCU} -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=firmware.lst -O${OPT} -flto=auto -gdwarf-2 -DHSE_VALUE=${HSE_VALUE} -fno-exceptions -fdata-sections -ffunction-sections ${WARNING_FLAGS}")
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} ${FPU_FLAGS}")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} -Wimplicit")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}")
|
||||
|
||||
# these are in addition to CMAKE_CXX_FLAGS
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-lm -T${RADIO_SRC_DIRECTORY}/${LINKER_SCRIPT} -Wl,-Map=firmware.map,--cref,--no-warn-mismatch,--gc-sections")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-lm -T${RADIO_SRC_DIRECTORY}/${LINKER_SCRIPT} -Wl,-Map=firmware.map,--cref,--no-warn-mismatch,--no-warn-rwx-segments,--gc-sections")
|
||||
|
||||
if(SEMIHOSTING)
|
||||
add_definitions(-DSEMIHOSTING)
|
||||
@@ -494,9 +497,16 @@ if(NOT MSVC)
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
# add_custom_command(
|
||||
# TARGET firmware POST_BUILD
|
||||
# COMMAND arm-none-eabi-size firmware.elf
|
||||
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
# )
|
||||
|
||||
add_custom_command(
|
||||
TARGET firmware POST_BUILD
|
||||
COMMAND arm-none-eabi-size firmware.elf
|
||||
COMMAND ${PROJECT_SOURCE_DIR}/tools/get-fw-size.sh firmware.elf 0x20000 0x4000
|
||||
DEPENDS firmware
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
|
||||
@@ -181,10 +181,6 @@ const char * const audioFilenames[] = {
|
||||
"servoko",
|
||||
"rxko",
|
||||
"modelpwr",
|
||||
#if defined(PCBSKY9X)
|
||||
"highmah",
|
||||
"hightemp",
|
||||
#endif
|
||||
"error",
|
||||
"warning1",
|
||||
"warning2",
|
||||
@@ -1077,10 +1073,6 @@ void audioEvent(unsigned int index)
|
||||
audioQueue.playTone(2250, 80, 20, PLAY_REPEAT(2));
|
||||
break;
|
||||
case AU_TX_BATTERY_LOW:
|
||||
#if defined(PCBSKY9X)
|
||||
case AU_TX_MAH_HIGH:
|
||||
case AU_TX_TEMP_HIGH:
|
||||
#endif
|
||||
audioQueue.playTone(1950, 160, 20, PLAY_REPEAT(2), 1);
|
||||
audioQueue.playTone(2550, 160, 20, PLAY_REPEAT(2), -1);
|
||||
break;
|
||||
|
||||
@@ -564,10 +564,6 @@ void audioTimerCountdown(uint8_t timer, int value);
|
||||
#define AUDIO_WARNING1() AUDIO_BUZZER(audioEvent(AU_WARNING1), beep(3))
|
||||
#define AUDIO_WARNING2() AUDIO_BUZZER(audioEvent(AU_WARNING2), beep(2))
|
||||
#define AUDIO_TX_BATTERY_LOW() AUDIO_BUZZER(audioEvent(AU_TX_BATTERY_LOW), beep(4))
|
||||
#if defined(PCBSKY9X)
|
||||
#define AUDIO_TX_MAH_HIGH() audioEvent(AU_TX_MAH_HIGH)
|
||||
#define AUDIO_TX_TEMP_HIGH() audioEvent(AU_TX_TEMP_HIGH)
|
||||
#endif
|
||||
#define AUDIO_ERROR() AUDIO_BUZZER(audioEvent(AU_ERROR), beep(4))
|
||||
#define AUDIO_TIMER_COUNTDOWN(idx, val) audioTimerCountdown(idx, val)
|
||||
#define AUDIO_TIMER_ELAPSED(idx) AUDIO_BUZZER(audioEvent(AU_TIMER1_ELAPSED+idx), beep(3))
|
||||
@@ -588,8 +584,6 @@ void audioTimerCountdown(uint8_t timer, int value);
|
||||
#define AUDIO_TRAINER_LOST() audioEvent(AU_TRAINER_LOST)
|
||||
#define AUDIO_TRAINER_BACK() audioEvent(AU_TRAINER_BACK)
|
||||
|
||||
#define AUDIO_HEARTBEAT()
|
||||
|
||||
enum AutomaticPromptsCategories {
|
||||
SYSTEM_AUDIO_CATEGORY,
|
||||
MODEL_AUDIO_CATEGORY,
|
||||
|
||||
@@ -97,7 +97,7 @@ void *bin_l_alloc (void *ud, void *ptr, size_t osize, size_t nsize)
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
#if defined(DEBUG)
|
||||
|
||||
|
Before Width: | Height: | Size: 495 B |
|
After Width: | Height: | Size: 261 B |
@@ -72,7 +72,7 @@ char * bluetoothReadline(bool error_reset)
|
||||
#if defined(PCBX9E) && !defined(USEHORUSBT) // X9E BT module can get unresponsive
|
||||
TRACE("NO RESPONSE FROM BT MODULE");
|
||||
#endif
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
TRACE_NOCRLF("%02X ", byte);
|
||||
if (byte == '\n') {
|
||||
@@ -116,11 +116,11 @@ void bluetoothProcessTrainerFrame(const uint8_t * bluetoothBuffer)
|
||||
|
||||
for (uint8_t channel=0, i=1; channel<8; channel+=2, i+=3) {
|
||||
// +-500 != 512, but close enough.
|
||||
ppmInput[channel] = bluetoothBuffer[i] + ((bluetoothBuffer[i+1] & 0xf0) << 4) - 1500;
|
||||
ppmInput[channel+1] = ((bluetoothBuffer[i+1] & 0x0f) << 4) + ((bluetoothBuffer[i+2] & 0xf0) >> 4) + ((bluetoothBuffer[i+2] & 0x0f) << 8) - 1500;
|
||||
trainerInput[channel] = bluetoothBuffer[i] + ((bluetoothBuffer[i+1] & 0xf0) << 4) - 1500;
|
||||
trainerInput[channel+1] = ((bluetoothBuffer[i+1] & 0x0f) << 4) + ((bluetoothBuffer[i+2] & 0xf0) >> 4) + ((bluetoothBuffer[i+2] & 0x0f) << 8) - 1500;
|
||||
}
|
||||
|
||||
ppmInputValidityTimer = PPM_IN_VALID_TIMEOUT;
|
||||
trainerInputValidityTimer = TRAINER_IN_VALID_TIMEOUT;
|
||||
}
|
||||
|
||||
void bluetoothAppendTrainerByte(uint8_t data)
|
||||
@@ -280,7 +280,7 @@ void bluetoothWakeup(void)
|
||||
uint8_t len = ZLEN(g_eeGeneral.bluetoothName);
|
||||
if (len > 0) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
*cur++ = idx2char(g_eeGeneral.bluetoothName[i]);
|
||||
*cur++ = zchar2char(g_eeGeneral.bluetoothName[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -380,7 +380,7 @@ void bluetoothWakeup()
|
||||
uint8_t len = ZLEN(g_eeGeneral.bluetoothName);
|
||||
if (len > 0) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
*cur++ = idx2char(g_eeGeneral.bluetoothName[i]);
|
||||
*cur++ = zchar2char(g_eeGeneral.bluetoothName[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -20,30 +20,12 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
void pushPrompt(uint16_t value)
|
||||
{
|
||||
TRACE("pushPrompt %u", value);
|
||||
}
|
||||
#if !defined(DFPLAYER)
|
||||
#define pushPrompt(value)
|
||||
#define pushCustomPrompt(value)
|
||||
#define pushNumberPrompt(value)
|
||||
|
||||
void pushCustomPrompt(uint8_t value)
|
||||
{
|
||||
pushPrompt(PROMPT_CUSTOM_BASE + value);
|
||||
}
|
||||
|
||||
void pushNumberPrompt(uint8_t value)
|
||||
{
|
||||
pushPrompt(PROMPT_I18N_BASE + value);
|
||||
}
|
||||
|
||||
void pushUnit(uint8_t unit, uint8_t idx, uint8_t id){
|
||||
TRACE("pushUnit %u", unit);
|
||||
}
|
||||
|
||||
void audioEvent(unsigned int index){
|
||||
TRACE("audioEvent %u", index);
|
||||
}
|
||||
|
||||
bool isPlaying(){
|
||||
TRACE("isPlaying");
|
||||
bool isPlaying(uint8_t id){
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -21,26 +21,119 @@
|
||||
#ifndef _BUZZER_H_
|
||||
#define _BUZZER_H_
|
||||
|
||||
enum FragmentTypes {
|
||||
FRAGMENT_EMPTY,
|
||||
FRAGMENT_TONE,
|
||||
FRAGMENT_FILE,
|
||||
};
|
||||
|
||||
extern void pushPrompt(uint16_t prompt);
|
||||
extern void pushUnit(uint8_t unit, uint8_t idx, uint8_t id);
|
||||
extern bool isPlaying();
|
||||
extern void audioEvent(unsigned int index);
|
||||
|
||||
extern uint8_t g_beepCnt;
|
||||
extern uint8_t beepAgain;
|
||||
extern uint8_t beepAgainOrig;
|
||||
extern uint8_t beepOn;
|
||||
extern bool warble;
|
||||
extern bool warbleC;
|
||||
extern bool isPlaying(uint8_t id = 0);
|
||||
|
||||
#if defined(HAPTIC)
|
||||
extern uint8_t hapticTick;
|
||||
#endif /* HAPTIC */
|
||||
|
||||
void buzzerEvent(unsigned int index);
|
||||
void audioEvent(unsigned int index);
|
||||
|
||||
#define AUDIO_ERROR_MESSAGE(e) buzzerEvent(e)
|
||||
#if defined(DFPLAYER)
|
||||
extern Fifo<uint16_t, 16> dfplayerFifo;
|
||||
extern uint32_t getAudioFileIndex(uint32_t i);
|
||||
extern bool isAudioFileReferenced(uint32_t i);
|
||||
void audioPlay(unsigned int index);
|
||||
|
||||
#define AUDIO_ERROR_MESSAGE(e) audioEvent(e)
|
||||
#define AUDIO_TIMER_MINUTE(t) playDuration(t, 0, 0)
|
||||
|
||||
#define AUDIO_KEY_PRESS() audioKeyPress()
|
||||
#define AUDIO_KEY_ERROR() audioKeyError()
|
||||
|
||||
#define AUDIO_HELLO() audioPlay(AUDIO_HELLO)
|
||||
#define AUDIO_BYE() //
|
||||
#define AUDIO_WARNING1() audioEvent(AU_WARNING1)
|
||||
#define AUDIO_WARNING2() audioEvent(AU_WARNING2)
|
||||
#define AUDIO_TX_BATTERY_LOW() audioEvent(AU_TX_BATTERY_LOW)
|
||||
#define AUDIO_ERROR() audioEvent(AU_ERROR)
|
||||
#define AUDIO_TIMER_COUNTDOWN(idx, val) audioTimerCountdown(idx, val)
|
||||
#define AUDIO_TIMER_ELAPSED(idx) audioEvent(AU_TIMER1_ELAPSED+idx)
|
||||
#define AUDIO_INACTIVITY() audioEvent(AU_INACTIVITY)
|
||||
#define AUDIO_MIX_WARNING(x) audioEvent(AU_MIX_WARNING_1+x-1)
|
||||
#define AUDIO_POT_MIDDLE(x) audioEvent(AU_STICK1_MIDDLE+x)
|
||||
#define AUDIO_TRIM_MIDDLE() audioEvent(AU_TRIM_MIDDLE)
|
||||
#define AUDIO_TRIM_MIN() audioEvent(AU_TRIM_MIN)
|
||||
#define AUDIO_TRIM_MAX() audioEvent(AU_TRIM_MAX)
|
||||
#define AUDIO_TRIM_PRESS(val) audioTrimPress(val)
|
||||
#define AUDIO_PLAY(p) audioEvent(p)
|
||||
#define AUDIO_VARIO(fq, t, p, f) playTone(fq, t, p, f)
|
||||
#define AUDIO_RSSI_ORANGE() audioEvent(AU_RSSI_ORANGE)
|
||||
#define AUDIO_RSSI_RED() audioEvent(AU_RSSI_RED)
|
||||
#define AUDIO_RAS_RED() audioEvent(AU_RAS_RED)
|
||||
#define AUDIO_TELEMETRY_LOST() audioEvent(AU_TELEMETRY_LOST)
|
||||
#define AUDIO_TELEMETRY_BACK() audioEvent(AU_TELEMETRY_BACK)
|
||||
#define AUDIO_TRAINER_LOST() audioEvent(AU_TRAINER_LOST)
|
||||
#define AUDIO_TRAINER_BACK() audioEvent(AU_TRAINER_BACK)
|
||||
|
||||
// enum AutomaticPromptsCategories {
|
||||
// SYSTEM_AUDIO_CATEGORY,
|
||||
// MODEL_AUDIO_CATEGORY,
|
||||
// PHASE_AUDIO_CATEGORY,
|
||||
// SWITCH_AUDIO_CATEGORY,
|
||||
// LOGICAL_SWITCH_AUDIO_CATEGORY,
|
||||
// };
|
||||
|
||||
// enum AutomaticPromptsEvents {
|
||||
// AUDIO_EVENT_OFF,
|
||||
// AUDIO_EVENT_ON,
|
||||
// AUDIO_EVENT_MID,
|
||||
// };
|
||||
|
||||
enum {
|
||||
// IDs for special functions [0:64]
|
||||
// IDs for global functions [64:128]
|
||||
ID_PLAY_PROMPT_BASE = 179,
|
||||
ID_PLAY_FROM_SD_MANAGER = 255,
|
||||
};
|
||||
|
||||
extern void pushPrompt(uint16_t prompt, uint8_t id=0);
|
||||
extern void pushUnit(uint8_t unit, uint8_t idx, uint8_t id);
|
||||
extern void playModelName();
|
||||
extern void playModelEvent(uint8_t category, uint8_t index, event_t event=0);
|
||||
|
||||
#define PLAY_PHASE_OFF(phase) //playModelEvent(PHASE_AUDIO_CATEGORY, phase, AUDIO_EVENT_OFF)
|
||||
#define PLAY_PHASE_ON(phase) //playModelEvent(PHASE_AUDIO_CATEGORY, phase, AUDIO_EVENT_ON)
|
||||
#define PLAY_SWITCH_MOVED(sw) //playModelEvent(SWITCH_AUDIO_CATEGORY, sw)
|
||||
#define PLAY_LOGICAL_SWITCH_OFF(sw) //playModelEvent(LOGICAL_SWITCH_AUDIO_CATEGORY, sw, AUDIO_EVENT_OFF)
|
||||
#define PLAY_LOGICAL_SWITCH_ON(sw) //playModelEvent(LOGICAL_SWITCH_AUDIO_CATEGORY, sw, AUDIO_EVENT_ON)
|
||||
#define PLAY_MODEL_NAME()
|
||||
#define START_SILENCE_PERIOD()
|
||||
#define IS_SILENCE_PERIOD_ELAPSED() (true)
|
||||
|
||||
#define PROMPT_CUSTOM_BASE 0
|
||||
#define PROMPT_I18N_BASE 0
|
||||
#define PROMPT_SYSTEM_BASE 0
|
||||
|
||||
#define I18N_PLAY_FUNCTION(lng, x, ...) void lng ## _ ## x(__VA_ARGS__, uint8_t id)
|
||||
#define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__, uint8_t id)
|
||||
|
||||
#define PUSH_CUSTOM_PROMPT(p, id) pushPrompt(PROMPT_CUSTOM_BASE+(p))
|
||||
#define PUSH_NUMBER_PROMPT(p) pushPrompt((EN_PROMPT_NUMBERS_BASE + p), id)
|
||||
#define PUSH_UNIT_PROMPT(p, i) pushUnit((EN_PROMPT_UNITS_BASE + ((p - 1/*RAW index*/) * 2)), (i), id)
|
||||
#define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a), id)
|
||||
#define PLAY_DURATION(d, att) playDuration((d), (att), id)
|
||||
#define PLAY_TIME 1
|
||||
#define IS_PLAY_TIME() (flags&PLAY_TIME)
|
||||
#define IS_PLAYING(id) isPlaying((id))
|
||||
#define PLAY_VALUE(v, id) playValue((v), (id))
|
||||
#define PLAY_FILE(f, id) dfPlayerQueuePlayFile((f))
|
||||
#define AUDIO_FLUSH() //audioQueue.flush()
|
||||
|
||||
#define setScaledVolume(v)
|
||||
|
||||
#else // buzzer
|
||||
|
||||
extern void pushPrompt(uint16_t prompt);
|
||||
extern void pushUnit(uint8_t unit, uint8_t idx, uint8_t id);
|
||||
|
||||
#define AUDIO_ERROR_MESSAGE(e) audioEvent(e)
|
||||
#define AUDIO_TIMER_MINUTE(t)
|
||||
|
||||
#define AUDIO_KEY_PRESS() audioKeyPress()
|
||||
@@ -48,34 +141,28 @@ void buzzerEvent(unsigned int index);
|
||||
|
||||
#define AUDIO_HELLO() PUSH_SYSTEM_PROMPT(AUDIO_HELLO)
|
||||
#define AUDIO_BYE()
|
||||
#define AUDIO_WARNING1() buzzerEvent(AU_WARNING1)
|
||||
#define AUDIO_WARNING2() buzzerEvent(AU_WARNING2)
|
||||
#define AUDIO_TX_BATTERY_LOW() buzzerEvent(AU_TX_BATTERY_LOW)
|
||||
#if defined(PCBSKY9X)
|
||||
#define AUDIO_TX_MAH_HIGH() buzzerEvent(AU_TX_MAH_HIGH)
|
||||
#define AUDIO_TX_TEMP_HIGH() buzzerEvent(AU_TX_TEMP_HIGH)
|
||||
#endif
|
||||
#define AUDIO_ERROR() buzzerEvent(AU_ERROR)
|
||||
#define AUDIO_WARNING1() audioEvent(AU_WARNING1)
|
||||
#define AUDIO_WARNING2() audioEvent(AU_WARNING2)
|
||||
#define AUDIO_TX_BATTERY_LOW() audioEvent(AU_TX_BATTERY_LOW)
|
||||
#define AUDIO_ERROR() audioEvent(AU_ERROR)
|
||||
#define AUDIO_TIMER_COUNTDOWN(idx, val) audioTimerCountdown(idx, val)
|
||||
#define AUDIO_TIMER_ELAPSED(idx) buzzerEvent(AU_TIMER1_ELAPSED+idx)
|
||||
#define AUDIO_INACTIVITY() buzzerEvent(AU_INACTIVITY)
|
||||
#define AUDIO_MIX_WARNING(x) buzzerEvent(AU_MIX_WARNING_1+x-1)
|
||||
#define AUDIO_POT_MIDDLE(x) buzzerEvent(AU_STICK1_MIDDLE+x)
|
||||
#define AUDIO_TRIM_MIDDLE() buzzerEvent(AU_TRIM_MIDDLE)
|
||||
#define AUDIO_TRIM_MIN() buzzerEvent(AU_TRIM_MIN)
|
||||
#define AUDIO_TRIM_MAX() buzzerEvent(AU_TRIM_MAX)
|
||||
#define AUDIO_TIMER_ELAPSED(idx) audioEvent(AU_TIMER1_ELAPSED+idx)
|
||||
#define AUDIO_INACTIVITY() audioEvent(AU_INACTIVITY)
|
||||
#define AUDIO_MIX_WARNING(x) audioEvent(AU_MIX_WARNING_1+x-1)
|
||||
#define AUDIO_POT_MIDDLE(x) audioEvent(AU_STICK1_MIDDLE+x)
|
||||
#define AUDIO_TRIM_MIDDLE() audioEvent(AU_TRIM_MIDDLE)
|
||||
#define AUDIO_TRIM_MIN() audioEvent(AU_TRIM_MIN)
|
||||
#define AUDIO_TRIM_MAX() audioEvent(AU_TRIM_MAX)
|
||||
#define AUDIO_TRIM_PRESS(val) audioTrimPress(val)
|
||||
#define AUDIO_PLAY(p) buzzerEvent(p)
|
||||
#define AUDIO_PLAY(p) audioEvent(p)
|
||||
#define AUDIO_VARIO(fq, t, p, f) playTone(fq, t, p, f)
|
||||
#define AUDIO_RSSI_ORANGE() buzzerEvent(AU_RSSI_ORANGE)
|
||||
#define AUDIO_RSSI_RED() buzzerEvent(AU_RSSI_RED)
|
||||
#define AUDIO_RAS_RED() buzzerEvent(AU_RAS_RED)
|
||||
#define AUDIO_TELEMETRY_LOST() buzzerEvent(AU_TELEMETRY_LOST)
|
||||
#define AUDIO_TELEMETRY_BACK() buzzerEvent(AU_TELEMETRY_BACK)
|
||||
#define AUDIO_TRAINER_LOST() buzzerEvent(AU_TRAINER_LOST)
|
||||
#define AUDIO_TRAINER_BACK() buzzerEvent(AU_TRAINER_BACK)
|
||||
|
||||
#define IS_AUDIO_BUSY() (g_beepCnt || beepAgain || beepOn)
|
||||
#define AUDIO_RSSI_ORANGE() audioEvent(AU_RSSI_ORANGE)
|
||||
#define AUDIO_RSSI_RED() audioEvent(AU_RSSI_RED)
|
||||
#define AUDIO_RAS_RED() audioEvent(AU_RAS_RED)
|
||||
#define AUDIO_TELEMETRY_LOST() audioEvent(AU_TELEMETRY_LOST)
|
||||
#define AUDIO_TELEMETRY_BACK() audioEvent(AU_TELEMETRY_BACK)
|
||||
#define AUDIO_TRAINER_LOST() audioEvent(AU_TRAINER_LOST)
|
||||
#define AUDIO_TRAINER_BACK() audioEvent(AU_TRAINER_BACK)
|
||||
|
||||
#define AUDIO_RESET()
|
||||
#define AUDIO_FLUSH()
|
||||
@@ -87,6 +174,7 @@ void buzzerEvent(unsigned int index);
|
||||
#define PLAY_LOGICAL_SWITCH_ON(sw)
|
||||
#define PLAY_MODEL_NAME()
|
||||
#define START_SILENCE_PERIOD()
|
||||
#define IS_SILENCE_PERIOD_ELAPSED() (true)
|
||||
|
||||
#define PROMPT_CUSTOM_BASE 0
|
||||
#define PROMPT_I18N_BASE 256
|
||||
@@ -99,14 +187,15 @@ void buzzerEvent(unsigned int index);
|
||||
#define PUSH_NUMBER_PROMPT(p) pushPrompt(PROMPT_I18N_BASE+(p))
|
||||
#define PUSH_SYSTEM_PROMPT(p) pushPrompt(PROMPT_SYSTEM_BASE+(p))
|
||||
#define PLAY_NUMBER(n, u, a)
|
||||
#define PUSH_UNIT_PROMPT(p, i) pushUnit((p), (i), id)
|
||||
#define PUSH_UNIT_PROMPT(p, i)
|
||||
#define PLAY_DURATION(d, att) {}
|
||||
#define PLAY_TIME
|
||||
#define IS_PLAY_TIME() (0)
|
||||
#define IS_PLAYING(id) isPlaying()
|
||||
#define IS_PLAYING(id) isPlaying((id))
|
||||
#define PLAY_VALUE(v, id) playValue((v), (id))
|
||||
|
||||
#define setScaledVolume(v)
|
||||
|
||||
#endif // DFPLAYER
|
||||
|
||||
#endif // _BUZZER_H_
|
||||
|
||||
@@ -72,7 +72,7 @@ int toLongLongInt(const char ** argv, int index, long long int * val)
|
||||
base = 16;
|
||||
s = &argv[index][2];
|
||||
}
|
||||
char * endptr = NULL;
|
||||
char * endptr = nullptr;
|
||||
*val = strtoll(s, &endptr, base);
|
||||
if (*endptr == '\0')
|
||||
return 1;
|
||||
@@ -709,9 +709,7 @@ int cliTrace(const char ** argv)
|
||||
|
||||
int cliStackInfo(const char ** argv)
|
||||
{
|
||||
#if !defined(PCBI6)
|
||||
serialPrint("[MAIN] %d available / %d", stackAvailable(), stackSize() * 4); // stackSize() returns size in 32bit chunks
|
||||
#endif
|
||||
serialPrint("[MENUS] %d available / %d", menusStack.available(), menusStack.size());
|
||||
serialPrint("[MIXER] %d available / %d", mixerStack.available(), mixerStack.size());
|
||||
#if defined(AUDIO)
|
||||
@@ -792,13 +790,13 @@ const MemArea memAreas[] = {
|
||||
{ "GPIOD", GPIOD, sizeof(GPIO_TypeDef) },
|
||||
{ "GPIOE", GPIOE, sizeof(GPIO_TypeDef) },
|
||||
{ "GPIOF", GPIOF, sizeof(GPIO_TypeDef) },
|
||||
#if !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
{ "GPIOG", GPIOG, sizeof(GPIO_TypeDef) },
|
||||
#endif
|
||||
{ "USART1", USART1, sizeof(USART_TypeDef) },
|
||||
{ "USART2", USART2, sizeof(USART_TypeDef) },
|
||||
{ "USART3", USART3, sizeof(USART_TypeDef) },
|
||||
{ NULL, NULL, 0 },
|
||||
{ nullptr, nullptr, 0 },
|
||||
};
|
||||
|
||||
int cliSet(const char ** argv)
|
||||
@@ -966,7 +964,7 @@ int cliDisplay(const char ** argv)
|
||||
{
|
||||
long long int address = 0;
|
||||
|
||||
for (const MemArea * area = memAreas; area->name != NULL; area++) {
|
||||
for (const MemArea * area = memAreas; area->name != nullptr; area++) {
|
||||
if (!strcmp(area->name, argv[1])) {
|
||||
dump((uint8_t *)area->start, area->size);
|
||||
return 0;
|
||||
@@ -1035,7 +1033,7 @@ int cliDisplay(const char ** argv)
|
||||
case 2:
|
||||
tim = TIM2;
|
||||
break;
|
||||
#if !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
case 13:
|
||||
tim = TIM13;
|
||||
break;
|
||||
@@ -1063,7 +1061,7 @@ int cliDisplay(const char ** argv)
|
||||
serialPrint(" CCR4 0x%x", tim->CCR4);
|
||||
}
|
||||
}
|
||||
#if !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
else if (!strcmp(argv[1], "dma")) {
|
||||
serialPrint("DMA1_Stream7");
|
||||
serialPrint(" CR 0x%x", DMA1_Stream7->CR);
|
||||
@@ -1246,12 +1244,12 @@ const CliCommand cliCommands[] = {
|
||||
#if defined(BLUETOOTH)
|
||||
{ "bt", cliBlueTooth, "<baudrate>|<command>" },
|
||||
#endif
|
||||
{ NULL, NULL, NULL } /* sentinel */
|
||||
{ nullptr, nullptr, nullptr } /* sentinel */
|
||||
};
|
||||
|
||||
int cliHelp(const char ** argv)
|
||||
{
|
||||
for (const CliCommand * command = cliCommands; command->name != NULL; command++) {
|
||||
for (const CliCommand * command = cliCommands; command->name != nullptr; command++) {
|
||||
if (argv[1][0] == '\0' || !strcmp(command->name, argv[0])) {
|
||||
serialPrint("%s %s", command->name, command->args);
|
||||
if (argv[1][0] != '\0') {
|
||||
@@ -1270,7 +1268,7 @@ int cliExecCommand(const char ** argv)
|
||||
if (argv[0][0] == '\0')
|
||||
return 0;
|
||||
|
||||
for (const CliCommand * command = cliCommands; command->name != NULL; command++) {
|
||||
for (const CliCommand * command = cliCommands; command->name != nullptr; command++) {
|
||||
if (!strcmp(command->name, argv[0])) {
|
||||
return command->func(argv);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
uint8_t s_curveChan;
|
||||
|
||||
int8_t * curveEnd[MAX_CURVES];
|
||||
void loadCurves()
|
||||
{
|
||||
@@ -317,8 +315,8 @@ int applyCustomCurve(int x, uint8_t idx)
|
||||
point_t getPoint(uint8_t i)
|
||||
{
|
||||
point_t result = {0, 0};
|
||||
CurveInfo & crv = g_model.curves[s_curveChan];
|
||||
int8_t * points = curveAddress(s_curveChan);
|
||||
CurveInfo & crv = g_model.curves[s_currIdxSubMenu];
|
||||
int8_t * points = curveAddress(s_currIdxSubMenu);
|
||||
bool custom = (crv.type == CURVE_TYPE_CUSTOM);
|
||||
uint8_t count = 5+crv.points;
|
||||
if (i < count) {
|
||||
@@ -333,5 +331,5 @@ point_t getPoint(uint8_t i)
|
||||
|
||||
int applyCurrentCurve(int x)
|
||||
{
|
||||
return applyCustomCurve(x, s_curveChan);
|
||||
return applyCustomCurve(x, s_currIdxSubMenu);
|
||||
}
|
||||
|
||||
@@ -58,32 +58,17 @@
|
||||
#define MAX_INPUTS 32
|
||||
#define MAX_TRAINER_CHANNELS 16
|
||||
#define MAX_TELEMETRY_SENSORS 32
|
||||
#elif defined(PCBSKY9X)
|
||||
#define MAX_MODELS 60
|
||||
#define MAX_OUTPUT_CHANNELS 32 // number of real output channels CH1-CH32
|
||||
#define MAX_FLIGHT_MODES 9
|
||||
#define MAX_MIXERS 64
|
||||
#define MAX_EXPOS 32
|
||||
#define MAX_LOGICAL_SWITCHES 64
|
||||
#define MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches
|
||||
#define MAX_INPUTS 32
|
||||
#define MAX_TRAINER_CHANNELS 16
|
||||
#define MAX_TELEMETRY_SENSORS 32
|
||||
#elif defined(PCBI6)
|
||||
#elif defined(PCBI6X)
|
||||
#define MAX_MODELS 16
|
||||
#define MAX_OUTPUT_CHANNELS 14 // number of real output channels CH1-CH14
|
||||
#define MAX_OUTPUT_CHANNELS 16 // number of real output channels CH1-CH16
|
||||
#define MAX_FLIGHT_MODES 5
|
||||
#define MAX_MIXERS 32
|
||||
#define MAX_EXPOS 14
|
||||
#define MAX_LOGICAL_SWITCHES 12
|
||||
#define MAX_SPECIAL_FUNCTIONS 11 // number of functions assigned to switches
|
||||
#define MAX_TRAINER_CHANNELS 8
|
||||
#define MAX_SPECIAL_FUNCTIONS 18 // number of functions assigned to switches, 20B each
|
||||
#define MAX_TRAINER_CHANNELS 16
|
||||
#define MAX_INPUTS 16
|
||||
#if defined(PCBI6_ELRSV2)
|
||||
#define MAX_TELEMETRY_SENSORS 22
|
||||
#else
|
||||
#define MAX_TELEMETRY_SENSORS 28
|
||||
#endif
|
||||
#define MAX_TELEMETRY_SENSORS 30 // 48B each
|
||||
#define MAX_SCRIPTS 0
|
||||
#else
|
||||
#define MAX_MODELS 16
|
||||
@@ -149,7 +134,7 @@ enum CurveType {
|
||||
#define MAX_CURVE_POINTS 512
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBSKY9X) || defined(PCBHORUS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6X)
|
||||
#define NUM_MODULES 2
|
||||
#else
|
||||
#define NUM_MODULES 1
|
||||
@@ -157,16 +142,8 @@ enum CurveType {
|
||||
|
||||
#define XPOTS_MULTIPOS_COUNT 6
|
||||
|
||||
#if defined(PCBSKY9X) && defined(REVX)
|
||||
#define MAX_ROTARY_ENCODERS 1
|
||||
#define NUM_ROTARY_ENCODERS 0
|
||||
#elif defined(PCBSKY9X)
|
||||
#define MAX_ROTARY_ENCODERS 1
|
||||
#define NUM_ROTARY_ENCODERS 1
|
||||
#else
|
||||
#define MAX_ROTARY_ENCODERS 0
|
||||
#define NUM_ROTARY_ENCODERS 0
|
||||
#endif
|
||||
#define MAX_ROTARY_ENCODERS 0
|
||||
#define NUM_ROTARY_ENCODERS 0
|
||||
|
||||
#if defined(COLORLCD)
|
||||
enum MainViews {
|
||||
@@ -192,6 +169,7 @@ enum MainViews {
|
||||
VIEW_OUTPUTS_BARS,
|
||||
VIEW_INPUTS,
|
||||
VIEW_TIMER2,
|
||||
VIEW_CHAN_MONITOR,
|
||||
VIEW_COUNT
|
||||
};
|
||||
#endif
|
||||
@@ -203,16 +181,26 @@ enum BeeperMode {
|
||||
e_mode_all
|
||||
};
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6X)
|
||||
enum ModuleIndex {
|
||||
INTERNAL_MODULE,
|
||||
EXTERNAL_MODULE,
|
||||
TRAINER_MODULE,
|
||||
FLASHING_MODULE,
|
||||
};
|
||||
|
||||
enum ArmingMode {
|
||||
ARMING_MODE_FIRST = 0,
|
||||
ARMING_MODE_CH5 = ARMING_MODE_FIRST,
|
||||
ARMING_MODE_SWITCH = 1,
|
||||
ARMING_MODE_LAST = ARMING_MODE_SWITCH,
|
||||
};
|
||||
|
||||
enum TrainerMode {
|
||||
TRAINER_MODE_MASTER_TRAINER_JACK,
|
||||
#if !defined(PCBI6X)
|
||||
TRAINER_MODE_SLAVE,
|
||||
#endif
|
||||
#if defined(PCBTARANIS)
|
||||
TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE,
|
||||
TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE,
|
||||
@@ -223,26 +211,24 @@ enum BeeperMode {
|
||||
TRAINER_MODE_SLAVE_BLUETOOTH,
|
||||
#endif
|
||||
};
|
||||
#elif defined(PCBSKY9X)
|
||||
enum ModuleIndex {
|
||||
EXTERNAL_MODULE,
|
||||
EXTRA_MODULE,
|
||||
TRAINER_MODULE
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH
|
||||
#elif defined(PCBX7) || defined(PCBXLITE)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
|
||||
#elif defined(PCBI6X)
|
||||
#if defined(SBUS_TRAINER)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_BATTERY_COMPARTMENT
|
||||
#else
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_MASTER_TRAINER_JACK
|
||||
#endif
|
||||
#else
|
||||
#define TRAINER_MODE_MAX() HAS_WIRELESS_TRAINER_HARDWARE() ? TRAINER_MODE_MASTER_BATTERY_COMPARTMENT : TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6X)
|
||||
#define IS_INTERNAL_MODULE_ENABLED() (g_model.moduleData[INTERNAL_MODULE].type != MODULE_TYPE_NONE)
|
||||
#elif defined(PCBSKY9X)
|
||||
#define IS_INTERNAL_MODULE_ENABLED() (false)
|
||||
#endif
|
||||
#define IS_EXTERNAL_MODULE_ENABLED() (g_model.moduleData[EXTERNAL_MODULE].type != MODULE_TYPE_NONE)
|
||||
|
||||
@@ -254,9 +240,15 @@ enum UartModes {
|
||||
UART_MODE_NONE,
|
||||
#endif
|
||||
UART_MODE_TELEMETRY_MIRROR,
|
||||
#if !defined(PCBI6X)
|
||||
UART_MODE_TELEMETRY,
|
||||
#endif
|
||||
#if defined(SBUS_TRAINER)
|
||||
UART_MODE_SBUS_TRAINER,
|
||||
#endif
|
||||
#if defined(LUA)
|
||||
UART_MODE_LUA,
|
||||
#endif
|
||||
UART_MODE_COUNT,
|
||||
UART_MODE_MAX = UART_MODE_COUNT-1
|
||||
};
|
||||
@@ -336,17 +328,19 @@ enum TelemetryUnit {
|
||||
enum TelemetryScreenType {
|
||||
TELEMETRY_SCREEN_TYPE_NONE,
|
||||
TELEMETRY_SCREEN_TYPE_VALUES,
|
||||
TELEMETRY_SCREEN_TYPE_GAUGES,
|
||||
#if defined(LUA)
|
||||
TELEMETRY_SCREEN_TYPE_BARS,
|
||||
TELEMETRY_SCREEN_TYPE_SCRIPT,
|
||||
#if defined(LUA)
|
||||
TELEMETRY_SCREEN_TYPE_MAX = TELEMETRY_SCREEN_TYPE_SCRIPT
|
||||
#elif defined(PCBI6X)
|
||||
TELEMETRY_SCREEN_TYPE_MAX = TELEMETRY_SCREEN_TYPE_SCRIPT
|
||||
#else
|
||||
TELEMETRY_SCREEN_TYPE_MAX = TELEMETRY_SCREEN_TYPE_GAUGES
|
||||
TELEMETRY_SCREEN_TYPE_MAX = TELEMETRY_SCREEN_TYPE_BARS
|
||||
#endif
|
||||
};
|
||||
#define MAX_TELEMETRY_SCREENS 4
|
||||
#define TELEMETRY_SCREEN_TYPE(screenIndex) TelemetryScreenType((g_model.frsky.screensType >> (2*(screenIndex))) & 0x03)
|
||||
#define IS_BARS_SCREEN(screenIndex) (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_GAUGES)
|
||||
#define IS_BARS_SCREEN(screenIndex) (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_BARS)
|
||||
|
||||
#define FAILSAFE_CHANNEL_HOLD 2000
|
||||
#define FAILSAFE_CHANNEL_NOPULSE 2001
|
||||
@@ -376,7 +370,7 @@ enum SwitchSources {
|
||||
|
||||
SWSRC_FIRST_SWITCH,
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS) || defined(PCBI6X)
|
||||
SWSRC_SA0 = SWSRC_FIRST_SWITCH,
|
||||
SWSRC_SA1,
|
||||
SWSRC_SA2,
|
||||
@@ -389,22 +383,22 @@ enum SwitchSources {
|
||||
SWSRC_SD0,
|
||||
SWSRC_SD1,
|
||||
SWSRC_SD2,
|
||||
#if !defined(PCBX7) && !defined(PCBXLITE) && !defined(PCBI6)
|
||||
#if !defined(PCBX7) && !defined(PCBXLITE) && !defined(PCBI6X)
|
||||
SWSRC_SE0,
|
||||
SWSRC_SE1,
|
||||
SWSRC_SE2,
|
||||
#endif
|
||||
#if !defined(PCBXLITE) && !defined(PCBI6)
|
||||
#if !defined(PCBXLITE) && !defined(PCBI6X)
|
||||
SWSRC_SF0,
|
||||
SWSRC_SF1,
|
||||
SWSRC_SF2,
|
||||
#endif
|
||||
#if !defined(PCBX7) && !defined(PCBXLITE) && !defined(PCBI6)
|
||||
#if !defined(PCBX7) && !defined(PCBXLITE) && !defined(PCBI6X)
|
||||
SWSRC_SG0,
|
||||
SWSRC_SG1,
|
||||
SWSRC_SG2,
|
||||
#endif
|
||||
#if !defined(PCBXLITE) && !defined(PCBI6)
|
||||
#if !defined(PCBXLITE) && !defined(PCBI6X)
|
||||
SWSRC_SH0,
|
||||
SWSRC_SH1,
|
||||
SWSRC_SH2,
|
||||
@@ -444,7 +438,7 @@ enum SwitchSources {
|
||||
#if defined(PCBX9E)
|
||||
SWSRC_TRAINER = SWSRC_SH2,
|
||||
SWSRC_LAST_SWITCH = SWSRC_SR2,
|
||||
#elif defined(PCBXLITE) || defined(PCBI6)
|
||||
#elif defined(PCBXLITE) || defined(PCBI6X)
|
||||
SWSRC_TRAINER = SWSRC_SD2,
|
||||
SWSRC_LAST_SWITCH = SWSRC_SD2,
|
||||
#else
|
||||
@@ -488,10 +482,6 @@ enum SwitchSources {
|
||||
SWSRC_TrimT6Up,
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
SWSRC_REa,
|
||||
#endif
|
||||
|
||||
SWSRC_FIRST_LOGICAL_SWITCH,
|
||||
SWSRC_SW1 = SWSRC_FIRST_LOGICAL_SWITCH,
|
||||
SWSRC_SW2,
|
||||
@@ -574,7 +564,7 @@ enum MixSources {
|
||||
MIXSRC_SLIDER3, LUA_EXPORT("lcs", "Left center slider (X9E only)")
|
||||
MIXSRC_SLIDER4, LUA_EXPORT("rcs", "Right center slider (X9E only)")
|
||||
MIXSRC_LAST_POT = MIXSRC_SLIDER4,
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBI6)
|
||||
#elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBI6X)
|
||||
MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1")
|
||||
MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2")
|
||||
MIXSRC_LAST_POT = MIXSRC_POT2,
|
||||
@@ -598,11 +588,6 @@ enum MixSources {
|
||||
MIXSRC_MOUSE2, LUA_EXPORT("jsy", "Joystick Y")
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
MIXSRC_REa,
|
||||
MIXSRC_LAST_ROTARY_ENCODER = MIXSRC_REa,
|
||||
#endif
|
||||
|
||||
MIXSRC_MAX,
|
||||
|
||||
MIXSRC_FIRST_HELI,
|
||||
@@ -625,7 +610,7 @@ enum MixSources {
|
||||
|
||||
MIXSRC_FIRST_SWITCH,
|
||||
|
||||
#if defined(PCBXLITE) || defined(PCBI6)
|
||||
#if defined(PCBXLITE) || defined(PCBI6X)
|
||||
MIXSRC_SA = MIXSRC_FIRST_SWITCH, LUA_EXPORT("sa", "Switch A")
|
||||
MIXSRC_SB, LUA_EXPORT("sb", "Switch B")
|
||||
MIXSRC_SC, LUA_EXPORT("sc", "Switch C")
|
||||
@@ -749,16 +734,16 @@ enum Functions {
|
||||
// then the other functions
|
||||
FUNC_FIRST_WITHOUT_ENABLE,
|
||||
FUNC_PLAY_SOUND = FUNC_FIRST_WITHOUT_ENABLE,
|
||||
// FUNC_PLAY_TRACK,
|
||||
// FUNC_PLAY_VALUE,
|
||||
FUNC_PLAY_TRACK,
|
||||
FUNC_PLAY_VALUE,
|
||||
FUNC_RESERVE4,
|
||||
FUNC_PLAY_SCRIPT,
|
||||
FUNC_RESERVE5,
|
||||
// FUNC_BACKGND_MUSIC,
|
||||
// FUNC_BACKGND_MUSIC_PAUSE,
|
||||
// FUNC_BACKGND_MUSIC,
|
||||
// FUNC_BACKGND_MUSIC_PAUSE,
|
||||
FUNC_VARIO,
|
||||
FUNC_HAPTIC,
|
||||
// FUNC_LOGS,
|
||||
// FUNC_LOGS,
|
||||
FUNC_BACKLIGHT,
|
||||
#if defined(PCBTARANIS)
|
||||
FUNC_SCREENSHOT,
|
||||
@@ -781,7 +766,7 @@ enum TimerModes {
|
||||
enum CountDownModes {
|
||||
COUNTDOWN_SILENT,
|
||||
COUNTDOWN_BEEPS,
|
||||
#if defined(VOICE)
|
||||
#if defined(VOICE) || defined(DFPLAYER)
|
||||
COUNTDOWN_VOICE,
|
||||
#endif
|
||||
#if defined(HAPTIC)
|
||||
@@ -823,4 +808,11 @@ enum BluetoothModes {
|
||||
BLUETOOTH_TRAINER,
|
||||
};
|
||||
|
||||
// PPM Units
|
||||
enum PPMUnit {
|
||||
PPM_PERCENT_PREC0,
|
||||
PPM_PERCENT_PREC1,
|
||||
PPM_US
|
||||
};
|
||||
|
||||
#endif // _DATACONSTANTS_H_
|
||||
|
||||
@@ -154,21 +154,26 @@ PACK(struct CustomFunctionData {
|
||||
int16_t swtch : 9;
|
||||
uint16_t func : 7;
|
||||
PACK(union {
|
||||
#if !defined(PCBI6X) // SDCARD + VOICE
|
||||
NOBACKUP(PACK(struct {
|
||||
char name[LEN_FUNCTION_NAME];
|
||||
}) play);
|
||||
|
||||
#endif
|
||||
PACK(struct {
|
||||
int16_t val;
|
||||
uint8_t mode;
|
||||
uint8_t param;
|
||||
#if !defined(PCBI6X) // SDCARD + VOICE
|
||||
NOBACKUP(CFN_SPARE_TYPE spare);
|
||||
#endif
|
||||
})
|
||||
all;
|
||||
|
||||
NOBACKUP(PACK(struct {
|
||||
int32_t val1;
|
||||
#if !defined(PCBI6X) // SDCARD + VOICE
|
||||
NOBACKUP(CFN_SPARE_TYPE val2);
|
||||
#endif
|
||||
}) clear);
|
||||
});
|
||||
uint8_t active;
|
||||
@@ -406,18 +411,15 @@ PACK(struct TelemetrySensor {
|
||||
#define MM_RF_CUSTOM_SELECTED 0xff
|
||||
|
||||
PACK(struct ModuleData {
|
||||
uint8_t type : 4;
|
||||
int8_t rfProtocol : 4;
|
||||
uint8_t type; // : 4; // use full byte to reduce code size on PCBI6X
|
||||
int8_t rfProtocol; // : 4
|
||||
uint8_t channelsStart;
|
||||
int8_t channelsCount; // 0=8 channels
|
||||
uint8_t failsafeMode : 4; // only 3 bits used
|
||||
uint8_t subType : 3;
|
||||
uint8_t invertedSerial : 1; // telemetry serial inverted from standard
|
||||
#if defined(PCBI6)
|
||||
uint8_t rxID[4];
|
||||
uint16_t servoFreq;
|
||||
#endif
|
||||
int16_t failsafeChannels[MAX_OUTPUT_CHANNELS];
|
||||
|
||||
union {
|
||||
struct {
|
||||
int8_t delay : 6;
|
||||
@@ -433,21 +435,20 @@ PACK(struct ModuleData {
|
||||
uint8_t lowPowerMode : 1;
|
||||
int8_t optionValue;
|
||||
} multi);
|
||||
NOBACKUP(struct {
|
||||
uint8_t power : 2; // 0=10 mW, 1=100 mW, 2=500 mW, 3=1W
|
||||
uint8_t spare1 : 2;
|
||||
uint8_t receiver_telem_off : 1; // false = receiver telem enabled
|
||||
uint8_t receiver_channel_9_16 : 1; // false = pwm out 1-8, true 9-16
|
||||
uint8_t external_antenna : 1; // false = internal antenna, true = external antenna
|
||||
uint8_t fast : 1; // TODO: to be used later by external module (fast means serial @ high speed)
|
||||
uint8_t spare2;
|
||||
} pxx);
|
||||
NOBACKUP(struct {
|
||||
uint8_t spare1 : 6;
|
||||
uint8_t noninverted : 1;
|
||||
uint8_t spare2 : 1;
|
||||
int8_t refreshRate; // definition as framelength for ppm (* 5 + 225 = time in 1/10 ms)
|
||||
} sbus);
|
||||
NOBACKUP(struct {
|
||||
uint16_t servoFreq; // 50 - 400
|
||||
} afhds2a);
|
||||
NOBACKUP(struct {
|
||||
uint8_t crsfArmingMode:1;
|
||||
int16_t crsfArmingTrigger:10;
|
||||
int16_t spare1:5;
|
||||
} crsf);
|
||||
};
|
||||
|
||||
// Helper functions to set both of the rfProto protocol at the same time
|
||||
@@ -492,7 +493,7 @@ typedef uint32_t swarnenable_t;
|
||||
typedef uint16_t swconfig_t;
|
||||
typedef uint16_t swarnstate_t;
|
||||
typedef uint8_t swarnenable_t;
|
||||
#elif defined(PCBI6)
|
||||
#elif defined(PCBI6X)
|
||||
typedef uint8_t swconfig_t;
|
||||
typedef uint8_t swarnstate_t;
|
||||
typedef uint8_t swarnenable_t;
|
||||
@@ -566,7 +567,7 @@ PACK(struct CustomScreenData {
|
||||
char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; \
|
||||
uint8_t potsWarnEnabled; \
|
||||
int8_t potsWarnPosition[NUM_POTS + NUM_SLIDERS];
|
||||
#elif defined(PCBI6)
|
||||
#elif defined(PCBI6X)
|
||||
#define MODELDATA_EXTRA \
|
||||
NOBACKUP(uint8_t spare : 3); \
|
||||
NOBACKUP(uint8_t trainerMode : 3); \
|
||||
@@ -576,15 +577,6 @@ PACK(struct CustomScreenData {
|
||||
uint8_t potsWarnEnabled; \
|
||||
int8_t potsWarnPosition[NUM_POTS + NUM_SLIDERS]; \
|
||||
uint8_t rxBattAlarms[2];
|
||||
#elif defined(PCBSKY9X)
|
||||
#define MODELDATA_EXTRA \
|
||||
uint8_t spare : 6; \
|
||||
uint8_t potsWarnMode : 2; \
|
||||
ModuleData moduleData[NUM_MODULES + 1]; \
|
||||
char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; \
|
||||
uint8_t potsWarnEnabled; \
|
||||
int8_t potsWarnPosition[NUM_POTS + NUM_SLIDERS]; \
|
||||
uint8_t rxBattAlarms[2];
|
||||
#else
|
||||
#define MODELDATA_EXTRA
|
||||
#endif
|
||||
@@ -661,12 +653,6 @@ PACK(struct TrainerData {
|
||||
NOBACKUP(TrainerMix mix[4]);
|
||||
});
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define SPLASH_MODE uint8_t splashSpares : 3
|
||||
#else
|
||||
#define SPLASH_MODE int8_t splashMode : 3
|
||||
#endif
|
||||
|
||||
#define EXTRA_GENERAL_FIELDS_ARM \
|
||||
NOBACKUP(uint8_t backlightBright); \
|
||||
NOBACKUP(uint32_t globalTimer); \
|
||||
@@ -677,7 +663,8 @@ PACK(struct TrainerData {
|
||||
NOBACKUP(uint8_t jitterFilter : 1); /* 0 - active */ \
|
||||
NOBACKUP(uint8_t disableRssiPoweroffAlarm : 1); \
|
||||
NOBACKUP(uint8_t USBMode : 2); \
|
||||
NOBACKUP(uint8_t spareExtraArm : 3); \
|
||||
NOBACKUP(uint8_t spare : 1); \
|
||||
NOBACKUP(uint8_t ppmunit : 2); \
|
||||
NOBACKUP(char ttsLanguage[2]); \
|
||||
NOBACKUP(int8_t beepVolume : 4); \
|
||||
NOBACKUP(int8_t wavVolume : 4); \
|
||||
@@ -691,7 +678,7 @@ PACK(struct TrainerData {
|
||||
#if defined(PCBHORUS)
|
||||
#define EXTRA_GENERAL_FIELDS \
|
||||
EXTRA_GENERAL_FIELDS_ARM \
|
||||
NOBACKUP(uint8_t serial2Mode : 4); \
|
||||
NOBACKUP(uint8_t auxSerialMode : 4); \
|
||||
uint8_t slidersConfig : 4; \
|
||||
uint32_t switchConfig; \
|
||||
uint8_t potsConfig; /* two bits per pot */ \
|
||||
@@ -701,7 +688,7 @@ PACK(struct TrainerData {
|
||||
NOBACKUP(uint8_t spare : 1); \
|
||||
NOBACKUP(uint8_t blOffBright : 7); \
|
||||
NOBACKUP(char bluetoothName[LEN_BLUETOOTH_NAME]);
|
||||
#elif defined(PCBTARANIS) || defined(PCBI6)
|
||||
#elif defined(PCBTARANIS) || defined(PCBI6X)
|
||||
#if defined(BLUETOOTH)
|
||||
#define BLUETOOTH_FIELDS \
|
||||
uint8_t spare; \
|
||||
@@ -711,30 +698,15 @@ PACK(struct TrainerData {
|
||||
#endif
|
||||
#define EXTRA_GENERAL_FIELDS \
|
||||
EXTRA_GENERAL_FIELDS_ARM \
|
||||
uint8_t serial2Mode : 4; \
|
||||
uint8_t auxSerialMode : 4; \
|
||||
uint8_t slidersConfig : 4; \
|
||||
uint8_t potsConfig; /* two bits per pot */ \
|
||||
uint8_t backlightColor; \
|
||||
swarnstate_t switchUnlockStates; \
|
||||
swconfig_t switchConfig; \
|
||||
char switchNames[NUM_SWITCHES][LEN_SWITCH_NAME]; \
|
||||
char anaNames[NUM_STICKS + NUM_POTS + NUM_SLIDERS][LEN_ANA_NAME]; \
|
||||
uint8_t receiverId[16][4]; /* AFHDS2A RxNum */ \
|
||||
BLUETOOTH_FIELDS
|
||||
#elif defined(PCBSKY9X)
|
||||
#define EXTRA_GENERAL_FIELDS \
|
||||
EXTRA_GENERAL_FIELDS_ARM \
|
||||
int8_t txCurrentCalibration; \
|
||||
int8_t temperatureWarn; \
|
||||
uint8_t mAhWarn; \
|
||||
uint16_t mAhUsed; \
|
||||
int8_t temperatureCalib; \
|
||||
uint8_t optrexDisplay; \
|
||||
uint8_t sticksGain; \
|
||||
uint8_t rotarySteps; \
|
||||
char switchNames[NUM_SWITCHES][LEN_SWITCH_NAME]; \
|
||||
char anaNames[NUM_STICKS + NUM_POTS + NUM_SLIDERS][LEN_ANA_NAME]; \
|
||||
\
|
||||
#define EXTRA_GENERAL_FIELDS EXTRA_GENERAL_FIELDS_ARM
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
@@ -755,7 +727,7 @@ PACK(struct TrainerData {
|
||||
|
||||
PACK(struct RadioData {
|
||||
NOBACKUP(uint8_t version);
|
||||
NOBACKUP(uint16_t variant);
|
||||
NOBACKUP(uint16_t variant); // not used on PCBI6X, reuse for swconfig_t?
|
||||
CalibData calib[NUM_CALIBRATED_ANALOGS];
|
||||
NOBACKUP(uint16_t chkSum);
|
||||
N_HORUS_FIELD(int8_t currModel);
|
||||
@@ -776,7 +748,7 @@ PACK(struct RadioData {
|
||||
NOBACKUP(uint8_t adjustRTC : 1);
|
||||
NOBACKUP(uint8_t inactivityTimer);
|
||||
uint8_t telemetryBaudrate : 3;
|
||||
SPLASH_MODE; /* 3bits */
|
||||
int8_t splashMode : 3;
|
||||
NOBACKUP(int8_t hapticMode : 2); // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||
int8_t switchesDelay;
|
||||
NOBACKUP(uint8_t lightAutoOff);
|
||||
@@ -804,7 +776,6 @@ PACK(struct RadioData {
|
||||
#undef TELEMETRY_DATA
|
||||
#undef MODELDATA_EXTRA
|
||||
#undef CUSTOM_SCREENS_DATA
|
||||
#undef SPLASH_MODE
|
||||
#undef EXTRA_GENERAL_FIELDS
|
||||
#undef THEME_DATA
|
||||
#undef NOBACKUP
|
||||
@@ -874,24 +845,11 @@ static inline void check_struct() {
|
||||
CHKSIZE(CurveData, 4);
|
||||
CHKSIZE(CustomScreenData, 610);
|
||||
CHKSIZE(Topbar::PersistentData, 216);
|
||||
#elif defined(PCBSKY9X)
|
||||
CHKSIZE(MixData, 20);
|
||||
CHKSIZE(ExpoData, 17);
|
||||
CHKSIZE(LimitData, 11);
|
||||
CHKSIZE(CustomFunctionData, 9);
|
||||
CHKSIZE(FlightModeData, 38);
|
||||
CHKSIZE(TimerData, 11);
|
||||
CHKSIZE(SwashRingData, 8);
|
||||
CHKSIZE(FrSkyBarData, 5);
|
||||
CHKSIZE(FrSkyLineData, 2);
|
||||
CHKSIZE(FrSkyTelemetryData, 88);
|
||||
CHKSIZE(ModelHeader, 12);
|
||||
CHKTYPE(CurveData, 4);
|
||||
#elif defined(PCBI6)
|
||||
#elif defined(PCBI6X)
|
||||
CHKSIZE(LimitData, 11);
|
||||
CHKSIZE(MixData, 20);
|
||||
CHKSIZE(ExpoData, 17);
|
||||
CHKSIZE(CustomFunctionData, 9);
|
||||
CHKSIZE(CustomFunctionData, 7);
|
||||
CHKSIZE(FlightModeData, 36);
|
||||
CHKSIZE(TimerData, 11);
|
||||
CHKSIZE(SwashRingData, 8);
|
||||
@@ -924,18 +882,17 @@ static inline void check_struct() {
|
||||
CHKSIZE(LogicalSwitchData, 9);
|
||||
CHKSIZE(TelemetrySensor, 14);
|
||||
|
||||
#if defined(PCBI6)
|
||||
CHKSIZE(ModuleData, 40);
|
||||
#else
|
||||
CHKSIZE(ModuleData, 70);
|
||||
#endif
|
||||
CHKSIZE(ModuleData, 7 + (2 * MAX_OUTPUT_CHANNELS));
|
||||
|
||||
CHKSIZE(GVarData, 7);
|
||||
|
||||
CHKSIZE(RssiAlarmData, 2);
|
||||
CHKSIZE(TrainerData, 16);
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
#if defined(PCBI6X)
|
||||
CHKSIZE(RadioData, 318);
|
||||
CHKSIZE(ModelData, 2848);
|
||||
#elif defined(PCBXLITE)
|
||||
CHKSIZE(RadioData, 844);
|
||||
CHKSIZE(ModelData, 6025);
|
||||
#elif defined(PCBX7)
|
||||
@@ -947,9 +904,6 @@ static inline void check_struct() {
|
||||
#elif defined(PCBX9D)
|
||||
CHKSIZE(RadioData, 872);
|
||||
CHKSIZE(ModelData, 6507);
|
||||
#elif defined(PCBSKY9X)
|
||||
CHKSIZE(RadioData, 727);
|
||||
CHKSIZE(ModelData, 5188);
|
||||
#elif defined(PCBHORUS)
|
||||
CHKSIZE(RadioData, 847);
|
||||
CHKSIZE(ModelData, 9380);
|
||||
|
||||
@@ -47,7 +47,7 @@ void debugPrintf(const char * format, ...)
|
||||
#if defined(DEBUG_TRACE_BUFFER)
|
||||
static struct TraceElement traceBuffer[TRACE_BUFFER_LEN];
|
||||
static uint8_t traceBufferPos;
|
||||
extern Fifo<uint8_t, 512> serial2TxFifo;
|
||||
extern Fifo<uint8_t, 512> auxSerialTxFifo;
|
||||
gtime_t filltm(const gtime_t *t, struct gtm *tp);
|
||||
|
||||
void trace_event(enum TraceEvent event, uint32_t data)
|
||||
@@ -93,7 +93,7 @@ void dumpTraceBuffer()
|
||||
if (traceBuffer[n].time == 0 && traceBuffer[n].time_ms == 0) break;
|
||||
#if !defined(SIMU)
|
||||
if ((n % 5) == 0) {
|
||||
while (!serial2TxFifo.isEmpty()) {
|
||||
while (!auxSerialTxFifo.isEmpty()) {
|
||||
RTOS_WAIT_TICKS(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint8_t serial2TracesEnabled();
|
||||
uint8_t auxSerialTracesEnabled();
|
||||
|
||||
#if defined(SIMU)
|
||||
typedef void (*traceCallbackFunc)(const char * text);
|
||||
@@ -45,7 +45,7 @@ uint8_t serial2TracesEnabled();
|
||||
#define debugPrintf(...) printf(__VA_ARGS__)
|
||||
#elif defined(DEBUG) && defined(CLI)
|
||||
#define debugPrintf(...) do { if (cliTracesEnabled) serialPrintf(__VA_ARGS__); } while(0)
|
||||
#elif defined(DEBUG) && defined(SERIAL2)
|
||||
#elif defined(DEBUG) && defined(AUX_SERIAL)
|
||||
#define debugPrintf(...) do { serialPrintf(__VA_ARGS__); } while(0)
|
||||
#else
|
||||
#define debugPrintf(...)
|
||||
@@ -157,27 +157,27 @@ void dumpTraceBuffer();
|
||||
|
||||
#else // #if defined(DEBUG_TRACE_BUFFER)
|
||||
|
||||
#define TRACE_EVENT(condition, event, data)
|
||||
#define TRACEI_EVENT(condition, event, data)
|
||||
#define TRACE_EVENT(condition, event, data)
|
||||
#define TRACEI_EVENT(condition, event, data)
|
||||
|
||||
#endif // #if defined(DEBUG_TRACE_BUFFER)
|
||||
|
||||
#if defined(TRACE_SD_CARD)
|
||||
#define TRACE_SD_CARD_EVENT(condition, event, data) TRACE_EVENT(condition, event, data)
|
||||
#else
|
||||
#define TRACE_SD_CARD_EVENT(condition, event, data)
|
||||
#define TRACE_SD_CARD_EVENT(condition, event, data)
|
||||
#endif
|
||||
#if defined(TRACE_FATFS)
|
||||
#define TRACE_FATFS_EVENT(condition, event, data) TRACE_EVENT(condition, event, data)
|
||||
#else
|
||||
#define TRACE_FATFS_EVENT(condition, event, data)
|
||||
#define TRACE_FATFS_EVENT(condition, event, data)
|
||||
#endif
|
||||
#if defined(TRACE_AUDIO)
|
||||
#define TRACE_AUDIO_EVENT(condition, event, data) TRACE_EVENT(condition, event, data)
|
||||
#define TRACEI_AUDIO_EVENT(condition, event, data) TRACEI_EVENT(condition, event, data)
|
||||
#else
|
||||
#define TRACE_AUDIO_EVENT(condition, event, data)
|
||||
#define TRACEI_AUDIO_EVENT(condition, event, data)
|
||||
#define TRACE_AUDIO_EVENT(condition, event, data)
|
||||
#define TRACEI_AUDIO_EVENT(condition, event, data)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ enum InterruptNames {
|
||||
#endif // #if defined(DEBUG_USB_INTERRUPTS)
|
||||
INT_LAST
|
||||
};
|
||||
#elif defined(PCBTARANIS) || defined(PCBI6)
|
||||
#elif defined(PCBTARANIS) || defined(PCBI6X)
|
||||
enum InterruptNames {
|
||||
INT_TICK,
|
||||
INT_5MS,
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#define _DEFINITIONS_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#if !defined(UNUSED)
|
||||
#define UNUSED(x) ((void)(x)) /* to avoid warnings */
|
||||
@@ -65,4 +67,8 @@
|
||||
#define CONVERT_UINT_PTR(x) ((uint32_t *)(x))
|
||||
#endif
|
||||
|
||||
#if !defined(DIM)
|
||||
#define DIM(__arr) (sizeof((__arr)) / sizeof((__arr)[0]))
|
||||
#endif
|
||||
|
||||
#endif // _DEFINITIONS_H_
|
||||
|
||||
@@ -27,8 +27,8 @@ template <int N>
|
||||
class DMAFifo
|
||||
{
|
||||
public:
|
||||
DMAFifo(DMA_Stream_TypeDef * stream):
|
||||
stream(stream),
|
||||
explicit DMAFifo(DMA_Channel_TypeDef * channel):
|
||||
channel(channel),
|
||||
ridx(0)
|
||||
{
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class DMAFifo
|
||||
|
||||
uint8_t last(int index)
|
||||
{
|
||||
return fifo[(2*N - stream->NDTR - index) & (N-1)];
|
||||
return fifo[(2*N - channel->CNDTR - index) & (N-1)];
|
||||
}
|
||||
|
||||
bool isEmpty()
|
||||
@@ -53,7 +53,7 @@ class DMAFifo
|
||||
#if defined(SIMU)
|
||||
return true;
|
||||
#endif
|
||||
return (ridx == N - stream->NDTR);
|
||||
return (ridx == N - channel->CNDTR);
|
||||
}
|
||||
|
||||
bool pop(uint8_t & element)
|
||||
@@ -73,9 +73,9 @@ class DMAFifo
|
||||
return fifo;
|
||||
}
|
||||
|
||||
DMA_Channel_TypeDef * channel;
|
||||
protected:
|
||||
uint8_t fifo[N];
|
||||
DMA_Stream_TypeDef * stream;
|
||||
volatile uint32_t ridx;
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ uint8_t dumpPosition;
|
||||
|
||||
void dumpStart(unsigned int size)
|
||||
{
|
||||
dumpPrintf("DUMP %d bytes ...\n\r", size);
|
||||
dumpPrintf("DUMP %d b\n\r", size);
|
||||
dumpPosition = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#ifndef _FIFO_H_
|
||||
#define _FIFO_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
template <class T, int N>
|
||||
class Fifo
|
||||
{
|
||||
@@ -40,7 +42,7 @@ class Fifo
|
||||
|
||||
void push(T element)
|
||||
{
|
||||
uint32_t next = (widx+1) & (N-1);
|
||||
uint32_t next = nextIndex(widx);
|
||||
if (next != ridx) {
|
||||
fifo[widx] = element;
|
||||
widx = next;
|
||||
@@ -54,7 +56,7 @@ class Fifo
|
||||
}
|
||||
else {
|
||||
element = fifo[ridx];
|
||||
ridx = (ridx+1) & (N-1);
|
||||
ridx = nextIndex(ridx);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -64,23 +66,23 @@ class Fifo
|
||||
return (ridx == widx);
|
||||
}
|
||||
|
||||
bool isFull()
|
||||
bool isFull() const
|
||||
{
|
||||
uint32_t next = (widx+1) & (N-1);
|
||||
uint32_t next = nextIndex(widx);
|
||||
return (next == ridx);
|
||||
}
|
||||
|
||||
void flush()
|
||||
{
|
||||
while (!isEmpty()) {};
|
||||
while (!isEmpty());
|
||||
}
|
||||
|
||||
uint32_t size() const
|
||||
{
|
||||
return (N + widx - ridx) & (N-1);
|
||||
return (N + widx - ridx) & (N - 1);
|
||||
}
|
||||
|
||||
uint32_t hasSpace(uint32_t n) const
|
||||
bool hasSpace(uint32_t n) const
|
||||
{
|
||||
return (N > (size() + n));
|
||||
}
|
||||
@@ -100,6 +102,11 @@ class Fifo
|
||||
T fifo[N];
|
||||
volatile uint32_t widx;
|
||||
volatile uint32_t ridx;
|
||||
|
||||
static inline uint32_t nextIndex(uint32_t idx)
|
||||
{
|
||||
return (idx + 1) & (N - 1);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _FIFO_H_
|
||||
|
||||
@@ -36,6 +36,7 @@ void testFunc()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(PCBI6X) || defined(DFPLAYER)
|
||||
PLAY_FUNCTION(playValue, source_t idx)
|
||||
{
|
||||
if (IS_FAI_FORBIDDEN(idx))
|
||||
@@ -86,6 +87,7 @@ PLAY_FUNCTION(playValue, source_t idx)
|
||||
PLAY_NUMBER(val, 0, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VOICE)
|
||||
void playCustomFunctionFile(const CustomFunctionData * sd, uint8_t id)
|
||||
@@ -99,9 +101,17 @@ void playCustomFunctionFile(const CustomFunctionData * sd, uint8_t id)
|
||||
PLAY_FILE(filename, sd->func == FUNC_BACKGND_MUSIC ? PLAY_BACKGROUND : 0, id);
|
||||
}
|
||||
}
|
||||
#elif defined(DFPLAYER)
|
||||
void playCustomFunctionFile(const CustomFunctionData * sd, uint8_t id)
|
||||
{
|
||||
uint16_t val = sd->all.val;
|
||||
if (val != 0) { // Custom files start at DFPLAYER_CUSTOM_FILE_INDEX
|
||||
PLAY_FILE(val, id);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(VOICE) || defined(PCBI6X)
|
||||
bool isRepeatDelayElapsed(const CustomFunctionData * functions, CustomFunctionsContext & functionsContext, uint8_t index)
|
||||
{
|
||||
const CustomFunctionData * cfn = &functions[index];
|
||||
@@ -130,26 +140,30 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
MASK_FUNC_TYPE newActiveFunctions = 0;
|
||||
MASK_CFN_TYPE newActiveSwitches = 0;
|
||||
|
||||
#if defined(DFPLAYER)
|
||||
uint8_t playFirstIndex = (functions == g_model.customFn ? 1 : 1+MAX_SPECIAL_FUNCTIONS);
|
||||
#define PLAY_INDEX (i+playFirstIndex)
|
||||
#else
|
||||
#define PLAY_INDEX 0
|
||||
#endif
|
||||
|
||||
#if defined(ROTARY_ENCODERS) && defined(GVARS)
|
||||
static rotenc_t rePreviousValues[ROTARY_ENCODERS];
|
||||
#endif
|
||||
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
for (uint8_t i=0; i<MAX_OUTPUT_CHANNELS; i++) {
|
||||
for (uint32_t i=0; i<MAX_OUTPUT_CHANNELS; i++) {
|
||||
safetyCh[i] = OVERRIDE_CHANNEL_UNDEFINED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(GVARS)
|
||||
for (uint8_t i=0; i<NUM_TRIMS; i++) {
|
||||
for (uint32_t i=0; i<NUM_TRIMS; i++) {
|
||||
trimGvar[i] = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
|
||||
for (uint32_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
|
||||
const CustomFunctionData * cfn = &functions[i];
|
||||
swsrc_t swtch = CFN_SWITCH(cfn);
|
||||
if (swtch) {
|
||||
@@ -161,7 +175,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
active &= (bool)CFN_ACTIVE(cfn);
|
||||
}
|
||||
|
||||
if (active || IS_PLAY_BOTH_FUNC(CFN_FUNC(cfn))) {
|
||||
if (active) {
|
||||
|
||||
switch (CFN_FUNC(cfn)) {
|
||||
|
||||
@@ -239,7 +253,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
{
|
||||
unsigned int moduleIndex = CFN_PARAM(cfn);
|
||||
if (moduleIndex < NUM_MODULES) {
|
||||
moduleFlag[moduleIndex] = 1 + CFN_FUNC(cfn) - FUNC_RANGECHECK;
|
||||
moduleState[moduleIndex].mode = 1 + CFN_FUNC(cfn) - FUNC_RANGECHECK;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -274,7 +288,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if !defined(PCBI6X)
|
||||
case FUNC_VOLUME:
|
||||
{
|
||||
getvalue_t raw = getValue(CFN_PARAM(cfn));
|
||||
@@ -285,11 +299,13 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
requiredSpeakerVolume = ((1024 + requiredSpeakerVolumeRawLast) * VOLUME_LEVEL_MAX) / 2048;
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
#endif
|
||||
#if defined(SDCARD) || defined(PCBI6X)
|
||||
case FUNC_PLAY_SOUND:
|
||||
// case FUNC_PLAY_TRACK:
|
||||
// case FUNC_PLAY_VALUE:
|
||||
#if defined(DFPLAYER)
|
||||
case FUNC_PLAY_TRACK:
|
||||
case FUNC_PLAY_VALUE:
|
||||
#endif
|
||||
#if defined(HAPTIC)
|
||||
case FUNC_HAPTIC:
|
||||
#endif
|
||||
@@ -297,43 +313,51 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
if (isRepeatDelayElapsed(functions, functionsContext, i)) {
|
||||
if (!IS_PLAYING(PLAY_INDEX)) {
|
||||
if (CFN_FUNC(cfn) == FUNC_PLAY_SOUND) {
|
||||
#if defined(PCBI6X)
|
||||
if (true) {
|
||||
#else
|
||||
if (audioQueue.isEmpty()) {
|
||||
#endif
|
||||
AUDIO_PLAY(AU_SPECIAL_SOUND_FIRST + CFN_PARAM(cfn));
|
||||
}
|
||||
}
|
||||
// else if (CFN_FUNC(cfn) == FUNC_PLAY_VALUE) {
|
||||
// PLAY_VALUE(CFN_PARAM(cfn), PLAY_INDEX);
|
||||
// }
|
||||
// #if defined(HAPTIC)
|
||||
// else if (CFN_FUNC(cfn) == FUNC_HAPTIC) {
|
||||
// haptic.event(AU_SPECIAL_SOUND_LAST+CFN_PARAM(cfn));
|
||||
// }
|
||||
// #endif
|
||||
// else {
|
||||
// playCustomFunctionFile(cfn, PLAY_INDEX);
|
||||
// }
|
||||
#if defined(DFPLAYER)
|
||||
else if (CFN_FUNC(cfn) == FUNC_PLAY_VALUE) {
|
||||
PLAY_VALUE(CFN_PARAM(cfn), PLAY_INDEX);
|
||||
}
|
||||
#endif
|
||||
#if defined(HAPTIC)
|
||||
else if (CFN_FUNC(cfn) == FUNC_HAPTIC) {
|
||||
haptic.event(AU_SPECIAL_SOUND_LAST+CFN_PARAM(cfn));
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
#if defined(DFPLAYER)
|
||||
playCustomFunctionFile(cfn, PLAY_INDEX);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if !defined(PCBI6X)
|
||||
case FUNC_BACKGND_MUSIC:
|
||||
if (!(newActiveFunctions & (1 << FUNCTION_BACKGND_MUSIC))) {
|
||||
newActiveFunctions |= (1 << FUNCTION_BACKGND_MUSIC);
|
||||
if (!IS_PLAYING(PLAY_INDEX)) {
|
||||
playCustomFunctionFile(cfn, PLAY_INDEX);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// case FUNC_BACKGND_MUSIC:
|
||||
// if (!(newActiveFunctions & (1 << FUNCTION_BACKGND_MUSIC))) {
|
||||
// // newActiveFunctions |= (1 << FUNCTION_BACKGND_MUSIC);
|
||||
// // if (!IS_PLAYING(PLAY_INDEX)) {
|
||||
// // playCustomFunctionFile(cfn, PLAY_INDEX);
|
||||
// // }
|
||||
// }
|
||||
// break;
|
||||
|
||||
// case FUNC_BACKGND_MUSIC_PAUSE:
|
||||
// // newActiveFunctions |= (1 << FUNCTION_BACKGND_MUSIC_PAUSE);
|
||||
// break;
|
||||
|
||||
case FUNC_BACKGND_MUSIC_PAUSE:
|
||||
newActiveFunctions |= (1 << FUNCTION_BACKGND_MUSIC_PAUSE);
|
||||
break;
|
||||
#endif
|
||||
#else
|
||||
case FUNC_PLAY_SOUND:
|
||||
// case FUNC_PLAY_TRACK:
|
||||
// case FUNC_PLAY_VALUE:
|
||||
case FUNC_PLAY_TRACK:
|
||||
case FUNC_PLAY_VALUE:
|
||||
{
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
uint8_t repeatParam = CFN_PLAY_REPEAT(cfn);
|
||||
@@ -343,15 +367,16 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
if (CFN_FUNC(cfn) == FUNC_PLAY_SOUND) {
|
||||
AUDIO_PLAY(AU_SPECIAL_SOUND_FIRST+param);
|
||||
}
|
||||
// else if (CFN_FUNC(cfn) == FUNC_PLAY_VALUE) {
|
||||
// PLAY_VALUE(param, PLAY_INDEX);
|
||||
// }
|
||||
// else {
|
||||
// #if defined(GVARS)
|
||||
// if (CFN_FUNC(cfn) == FUNC_PLAY_TRACK && param > 250)
|
||||
// param = GVAR_VALUE(param-251, getGVarFlightMode(mixerCurrentFlightMode, param-251));
|
||||
// #endif
|
||||
// }
|
||||
else if (CFN_FUNC(cfn) == FUNC_PLAY_VALUE) {
|
||||
PLAY_VALUE(param, PLAY_INDEX);
|
||||
}
|
||||
else {
|
||||
#if defined(GVARS)
|
||||
if (CFN_FUNC(cfn) == FUNC_PLAY_TRACK && param > 250)
|
||||
param = GVAR_VALUE(param-251, getGVarFlightMode(mixerCurrentFlightMode, param-251));
|
||||
#endif
|
||||
PUSH_CUSTOM_PROMPT(active ? param : param+1, PLAY_INDEX);
|
||||
}
|
||||
}
|
||||
if (!active) {
|
||||
// PLAY_BOTH would change activeFnSwitches otherwise
|
||||
@@ -359,27 +384,40 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif // PCBI6X || SDCARD
|
||||
|
||||
#if defined(TELEMETRY_FRSKY) && defined(VARIO)
|
||||
case FUNC_VARIO:
|
||||
newActiveFunctions |= (1 << FUNCTION_VARIO);
|
||||
newActiveFunctions |= (1u << FUNCTION_VARIO);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
//#if defined(SDCARD)
|
||||
// case FUNC_LOGS:
|
||||
// if (CFN_PARAM(cfn)) {
|
||||
// newActiveFunctions |= (1 << FUNCTION_LOGS);
|
||||
// logDelay = CFN_PARAM(cfn);
|
||||
// }
|
||||
// break;
|
||||
//#endif
|
||||
#if defined(SDCARD)
|
||||
case FUNC_LOGS:
|
||||
if (CFN_PARAM(cfn)) {
|
||||
newActiveFunctions |= (1u << FUNCTION_LOGS);
|
||||
logDelay = CFN_PARAM(cfn);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case FUNC_BACKLIGHT:
|
||||
newActiveFunctions |= (1 << FUNCTION_BACKLIGHT);
|
||||
{
|
||||
newActiveFunctions |= (1u << FUNCTION_BACKLIGHT);
|
||||
if (!CFN_PARAM(cfn)) { // When no source is set, backlight works like original backlight and turn on regardless of backlight settings
|
||||
requiredBacklightBright = BACKLIGHT_FORCED_ON;
|
||||
break;
|
||||
}
|
||||
|
||||
getvalue_t raw = getValue(CFN_PARAM(cfn));
|
||||
#if defined(COLORLCD)
|
||||
requiredBacklightBright = (1024 - raw) * (BACKLIGHT_LEVEL_MAX - BACKLIGHT_LEVEL_MIN) / 2048;
|
||||
#else
|
||||
requiredBacklightBright = (1024 - raw) * 100 / 2048;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
case FUNC_SCREENSHOT:
|
||||
@@ -388,7 +426,6 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
case FUNC_TEST:
|
||||
testFunc();
|
||||
@@ -408,7 +445,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
{
|
||||
unsigned int moduleIndex = CFN_PARAM(cfn);
|
||||
if (moduleIndex < NUM_MODULES) {
|
||||
moduleFlag[moduleIndex] = 0;
|
||||
moduleState[moduleIndex].mode = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -423,7 +460,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||
functionsContext.activeFunctions = newActiveFunctions;
|
||||
|
||||
#if defined(ROTARY_ENCODERS) && defined(GVARS)
|
||||
for (uint8_t i=0; i<ROTARY_ENCODERS; i++) {
|
||||
for (uint32_t i=0; i<ROTARY_ENCODERS; i++) {
|
||||
rePreviousValues[i] = (rotencValue[i] / ROTARY_ENCODER_GRANULARITY);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -124,9 +124,10 @@ const unsigned char font_8x10[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
const unsigned char font_22x38_num[] = {
|
||||
#include "font_22x38_num.lbm"
|
||||
};
|
||||
// only lua uses those
|
||||
// const unsigned char font_22x38_num[] = {
|
||||
// #include "font_22x38_num.lbm"
|
||||
// };
|
||||
|
||||
const unsigned char font_4x6_extra[] = {
|
||||
#include "font_04x06_extra.lbm"
|
||||
|
||||
@@ -35,9 +35,6 @@
|
||||
#define HEADER_LINE_COLUMNS 0,
|
||||
#endif
|
||||
|
||||
#define COLUMN_X 0
|
||||
#define drawFieldLabel(x, y, str) lcdDrawTextAlignedLeft(y, str)
|
||||
|
||||
#define NUM_BODY_LINES (LCD_LINES-1)
|
||||
#define MENU_HEADER_HEIGHT FH
|
||||
#define MENU_INIT_VPOS 0
|
||||
@@ -53,7 +50,7 @@ extern uint8_t noHighlightCounter;
|
||||
#define NO_HIGHLIGHT() (noHighlightCounter > 0)
|
||||
#define START_NO_HIGHLIGHT() do { noHighlightCounter = 25; } while(0)
|
||||
|
||||
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t width, uint8_t value, uint8_t max, uint8_t attr);
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||
|
||||
#if defined(NAVIGATION_POT1)
|
||||
@@ -225,8 +222,22 @@ void title(const char * s);
|
||||
|
||||
typedef int choice_t;
|
||||
|
||||
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event);
|
||||
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label, LcdFlags attr, event_t event);
|
||||
choice_t editChoice(coord_t x, coord_t y, const char *label,
|
||||
const char *values, choice_t value, choice_t min,
|
||||
choice_t max, LcdFlags attr, event_t event);
|
||||
choice_t editChoice(coord_t x, coord_t y, const char *label,
|
||||
const char *values, choice_t value, choice_t min,
|
||||
choice_t max, LcdFlags attr, event_t event, coord_t lblX);
|
||||
choice_t editChoice(coord_t x, coord_t y, const char *label,
|
||||
const char *values, choice_t value, choice_t min,
|
||||
choice_t max, LcdFlags attr, event_t event, coord_t lblX,
|
||||
IsValueAvailable isValueAvailable);
|
||||
|
||||
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char * label,
|
||||
LcdFlags attr, event_t event);
|
||||
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label,
|
||||
LcdFlags attr, event_t event, coord_t lblX);
|
||||
|
||||
int8_t editSwitch(coord_t x, coord_t y, int8_t value, LcdFlags attr, event_t event);
|
||||
|
||||
#define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event)
|
||||
@@ -263,10 +274,6 @@ void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8
|
||||
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay);
|
||||
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(y, event, attr, str, delay)
|
||||
|
||||
#define WARNING_TYPE_ASTERISK 0
|
||||
#define WARNING_TYPE_CONFIRM 1
|
||||
#define WARNING_TYPE_INPUT 2
|
||||
|
||||
extern const char * warningText;
|
||||
extern const char * warningInfoText;
|
||||
extern uint8_t warningInfoLength;
|
||||
@@ -279,7 +286,7 @@ extern uint8_t s_copyMode;
|
||||
extern int8_t s_copySrcRow;
|
||||
extern int8_t s_copyTgtOfs;
|
||||
extern uint8_t s_currIdx;
|
||||
extern uint8_t s_curveChan;
|
||||
extern uint8_t s_currIdxSubMenu;
|
||||
extern uint8_t s_copySrcIdx;
|
||||
extern uint8_t s_copySrcCh;
|
||||
extern int8_t s_currCh;
|
||||
@@ -299,6 +306,9 @@ void drawStatusLine();
|
||||
void pushModelNotes();
|
||||
void readModelNotes();
|
||||
|
||||
void menuChannelsView(event_t event);
|
||||
void menuChannelsViewCommon(event_t event);
|
||||
|
||||
#define LABEL(...) (uint8_t)-1
|
||||
|
||||
#define CURSOR_MOVED_LEFT(event) (IS_ROTARY_LEFT(event) || EVT_KEY_MASK(event) == KEY_LEFT)
|
||||
@@ -320,7 +330,6 @@ void drawStatusLine();
|
||||
#define IS_ROTARY_EVENT(evt) (EVT_KEY_MASK(evt) >= 0x0e)
|
||||
void repeatLastCursorMove(event_t event);
|
||||
#define REPEAT_LAST_CURSOR_MOVE() { if (EVT_KEY_MASK(event) >= 0x0e) putEvent(event); else repeatLastCursorMove(event); }
|
||||
#define MOVE_CURSOR_FROM_HERE() if (menuHorizontalPosition > 0) REPEAT_LAST_CURSOR_MOVE()
|
||||
#else
|
||||
#define IS_ROTARY_LEFT(evt) (0)
|
||||
#define IS_ROTARY_RIGHT(evt) (0)
|
||||
@@ -329,7 +338,6 @@ void drawStatusLine();
|
||||
#define IS_ROTARY_EVENT(evt) (0)
|
||||
void repeatLastCursorMove(event_t event);
|
||||
#define REPEAT_LAST_CURSOR_MOVE() repeatLastCursorMove(event)
|
||||
#define MOVE_CURSOR_FROM_HERE() if (menuHorizontalPosition > 0) REPEAT_LAST_CURSOR_MOVE()
|
||||
#endif
|
||||
|
||||
// TODO enum
|
||||
@@ -371,6 +379,8 @@ void doMainScreenGraphics();
|
||||
void drawProgressBar(const char * label, int num, int den);
|
||||
void drawSleepBitmap();
|
||||
|
||||
void drawChannelValue(coord_t x, coord_t y, uint8_t ch, int16_t value, LcdFlags flags);
|
||||
|
||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max);
|
||||
|
||||
@@ -378,6 +388,7 @@ void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t
|
||||
void drawAlertBox(const char * title, const char * text, const char * action);
|
||||
#endif
|
||||
|
||||
void drawAlertBox(const char * title, const char * text, const char * action);
|
||||
void showAlertBox(const char * title, const char * text, const char * action , uint8_t sound);
|
||||
|
||||
#define SET_SCROLLBAR_X(x)
|
||||
@@ -385,11 +396,11 @@ void showAlertBox(const char * title, const char * text, const char * action , u
|
||||
|
||||
#define IS_MAIN_VIEW_DISPLAYED() menuHandlers[0] == menuMainView
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuViewTelemetryFrsky
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuViewTelemetry
|
||||
#else
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() false
|
||||
#endif
|
||||
#define IS_OTHER_VIEW_DISPLAYED() false
|
||||
#define IS_OTHER_VIEW_DISPLAYED() menuHandlers[0] == menuChannelsView
|
||||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags flags);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
|
||||
}
|
||||
else if (i<=width) {
|
||||
uint8_t skip = true;
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
for (uint32_t j=0; j<lines; j++) {
|
||||
b[j] = *(pattern++); /*top byte*/
|
||||
if (b[j] != 0xff) {
|
||||
skip = false;
|
||||
@@ -74,7 +74,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
|
||||
}
|
||||
if (skip) {
|
||||
if (flags & FIXEDWIDTH) {
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
for (uint32_t j=0; j<lines; j++) {
|
||||
b[j] = 0;
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ uint8_t getPatternWidth(const PatternData * pattern)
|
||||
uint8_t lines = (pattern->height+7)/8;
|
||||
const uint8_t * data = pattern->data;
|
||||
for (int8_t i=0; i<pattern->width; i++) {
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
for (uint32_t j=0; j<lines; j++) {
|
||||
if (data[j] != 0xff) {
|
||||
result += 1;
|
||||
break;
|
||||
@@ -172,11 +172,11 @@ void getCharPattern(PatternData * pattern, unsigned char c, LcdFlags flags)
|
||||
pattern->data = &font_10x14[((uint16_t)c_remapped)*20];
|
||||
}
|
||||
}
|
||||
else if (fontsize == XXLSIZE) {
|
||||
pattern->width = 22;
|
||||
pattern->height = 38;
|
||||
pattern->data = &font_22x38_num[((uint16_t)c-'0'+5)*110];
|
||||
}
|
||||
// else if (fontsize == XXLSIZE) { // only lua uses those
|
||||
// pattern->width = 22;
|
||||
// pattern->height = 38;
|
||||
// pattern->data = &font_22x38_num[((uint16_t)c-'0'+5)*110];
|
||||
// }
|
||||
else if (fontsize == MIDSIZE) {
|
||||
pattern->width = 8;
|
||||
pattern->height = 12;
|
||||
@@ -248,10 +248,10 @@ void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags flags)
|
||||
}
|
||||
lcdPutPattern(x, y, q, 10, 16, flags);
|
||||
}
|
||||
else if (fontsize == XXLSIZE) {
|
||||
q = &font_22x38_num[((uint16_t)c-'0'+5)*110];
|
||||
lcdPutPattern(x, y, q, 22, 38, flags);
|
||||
}
|
||||
// else if (fontsize == XXLSIZE) { // only lua uses those
|
||||
// q = &font_22x38_num[((uint16_t)c-'0'+5)*110];
|
||||
// lcdPutPattern(x, y, q, 22, 38, flags);
|
||||
// }
|
||||
else if (fontsize == MIDSIZE) {
|
||||
q = &font_8x10[((uint16_t)c-0x20)*16];
|
||||
lcdPutPattern(x, y, q, 8, 12, flags);
|
||||
@@ -292,7 +292,7 @@ uint8_t getTextWidth(const char * s, uint8_t len, LcdFlags flags)
|
||||
{
|
||||
uint8_t width = 0;
|
||||
for (int i=0; len==0 || i<len; ++i) {
|
||||
unsigned char c = (flags & ZCHAR) ? idx2char(*s) : *s;
|
||||
unsigned char c = (flags & ZCHAR) ? zchar2char(*s) : *s;
|
||||
if (!c) {
|
||||
break;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlag
|
||||
switch (flags & ZCHAR) {
|
||||
#if !defined(BOOT)
|
||||
case ZCHAR:
|
||||
c = idx2char(*s);
|
||||
c = zchar2char(*s);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@@ -409,6 +409,11 @@ void lcdDrawTextAlignedLeft(coord_t y, const char * s)
|
||||
lcdDrawText(0, y, s);
|
||||
}
|
||||
|
||||
void lcdDrawTextIndented(coord_t y, const char * s)
|
||||
{
|
||||
lcdDrawText(INDENT_WIDTH, y, s);
|
||||
}
|
||||
|
||||
#if !defined(BOOT)
|
||||
void lcdDrawTextAtIndex(coord_t x, coord_t y, const char * s,uint8_t idx, LcdFlags flags)
|
||||
{
|
||||
@@ -434,12 +439,12 @@ void lcdDraw8bitsNumber(coord_t x, coord_t y, int8_t val)
|
||||
lcdDrawNumber(x, y, val);
|
||||
}
|
||||
|
||||
void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags flags)
|
||||
void lcdDrawNumber(coord_t x, coord_t y, int val, LcdFlags flags)
|
||||
{
|
||||
lcdDrawNumber(x, y, val, flags, 0);
|
||||
}
|
||||
|
||||
void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t len)
|
||||
void lcdDrawNumber(coord_t x, coord_t y, int val, LcdFlags flags, uint8_t len)
|
||||
{
|
||||
char str[16+1];
|
||||
char *s = str+16;
|
||||
@@ -522,7 +527,7 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc
|
||||
#endif
|
||||
|
||||
|
||||
void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att)
|
||||
void lcdDrawVerticalLine(coord_t x, coord_t y, coord_t h, uint8_t pat, LcdFlags att)
|
||||
{
|
||||
if (x >= LCD_W) return;
|
||||
// should never happen on 9X
|
||||
@@ -558,7 +563,7 @@ void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlag
|
||||
}
|
||||
}
|
||||
|
||||
void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h, LcdFlags att)
|
||||
void lcdDrawSolidVerticalLine(coord_t x, coord_t y, coord_t h, LcdFlags att)
|
||||
{
|
||||
lcdDrawVerticalLine(x, y, h, SOLID, att);
|
||||
}
|
||||
@@ -573,9 +578,9 @@ void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFla
|
||||
}
|
||||
|
||||
#if !defined(BOOT)
|
||||
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||
void lcdDrawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||
{
|
||||
for (scoord_t i=y; i<(scoord_t)(y+h); i++) { // cast to scoord_t needed otherwise (y+h) is promoted to int (see #5055)
|
||||
for (coord_t i=y; i<y+h; i++) { // cast to coord_t needed otherwise (y+h) is promoted to int (see #5055)
|
||||
if ((att&ROUND) && (i==y || i==y+h-1))
|
||||
lcdDrawHorizontalLine(x+1, i, w-2, pat, att);
|
||||
else
|
||||
@@ -588,10 +593,10 @@ void drawTelemetryTopBar()
|
||||
{
|
||||
putsModelName(0, 0, g_model.header.name, g_eeGeneral.currModel, 0);
|
||||
uint8_t att = (IS_TXBATT_WARNING() ? BLINK : 0);
|
||||
putsVBat(14*FW,0,att);
|
||||
putsVBat(10*FW-1,0,att);
|
||||
if (g_model.timers[0].mode) {
|
||||
att = (timersStates[0].val<0 ? BLINK : 0);
|
||||
drawTimer(17*FW+5*FWNUM+1, 0, timersStates[0].val, att, att);
|
||||
drawTimer(13*FW+5, 0, timersStates[0].val, att, att);
|
||||
}
|
||||
lcdInvertLine(0);
|
||||
}
|
||||
@@ -603,7 +608,7 @@ void drawRtcTime(coord_t x, coord_t y, LcdFlags att)
|
||||
}
|
||||
#endif
|
||||
|
||||
void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2)
|
||||
void drawTimer(coord_t x, coord_t y, int32_t tme, LcdFlags att, LcdFlags att2)
|
||||
{
|
||||
div_t qr;
|
||||
if (IS_RIGHT_ALIGNED(att)) {
|
||||
@@ -694,11 +699,11 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
||||
idx = idx - MIXSRC_Rud;
|
||||
if (ZEXIST(g_eeGeneral.anaNames[idx])) {
|
||||
if (idx < MIXSRC_FIRST_POT-MIXSRC_Rud )
|
||||
lcdDrawChar(x, y, '\307', att); // stick symbol
|
||||
lcdDrawText(x, y, "\307", att); // stick symbol
|
||||
else if (idx <= MIXSRC_LAST_POT-MIXSRC_Rud )
|
||||
lcdDrawChar(x, y, '\310', att); // pot symbol
|
||||
lcdDrawText(x, y, "\310", att); // pot symbol
|
||||
else
|
||||
lcdDrawChar(x, y, '\311', att); // slider symbol
|
||||
lcdDrawText(x, y, "\311", att); // slider symbol
|
||||
lcdDrawSizedText(lcdNextPos, y, g_eeGeneral.anaNames[idx], LEN_ANA_NAME, ZCHAR|att);
|
||||
}
|
||||
else {
|
||||
@@ -708,7 +713,7 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
||||
else if (idx >= MIXSRC_FIRST_SWITCH && idx <= MIXSRC_LAST_SWITCH) {
|
||||
idx = idx-MIXSRC_FIRST_SWITCH;
|
||||
if (ZEXIST(g_eeGeneral.switchNames[idx])) {
|
||||
lcdDrawChar(x, y, '\312', att); //switch symbol
|
||||
lcdDrawText(x, y, "\312", att); //switch symbol
|
||||
lcdDrawSizedText(lcdNextPos, y, g_eeGeneral.switchNames[idx], LEN_SWITCH_NAME, ZCHAR|att);
|
||||
}
|
||||
else {
|
||||
@@ -767,10 +772,12 @@ void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
||||
}
|
||||
}
|
||||
|
||||
void drawSwitch(coord_t x, coord_t y, swsrc_t idx, LcdFlags flags)
|
||||
void drawSwitch(coord_t x, coord_t y, swsrc_t idx, LcdFlags flags, bool autoBold)
|
||||
{
|
||||
char s[8];
|
||||
getSwitchString(s, idx);
|
||||
getSwitchPositionName(s, idx);
|
||||
if (autoBold && idx != SWSRC_NONE && getSwitch(idx))
|
||||
flags |= BOLD;
|
||||
lcdDrawText(x, y, s, flags);
|
||||
}
|
||||
|
||||
@@ -781,7 +788,7 @@ void drawCurveName(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
lcdDrawText(x, y, s, att);
|
||||
}
|
||||
|
||||
void drawTimerMode(coord_t x, coord_t y, int8_t mode, LcdFlags att)
|
||||
void drawTimerMode(coord_t x, coord_t y, swsrc_t mode, LcdFlags att)
|
||||
{
|
||||
if (mode >= 0) {
|
||||
if (mode < TMRMODE_COUNT)
|
||||
@@ -836,7 +843,7 @@ void putsRotaryEncoderMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, Lcd
|
||||
}
|
||||
#endif
|
||||
|
||||
void drawValueWithUnit(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlags att)
|
||||
void drawValueWithUnit(coord_t x, coord_t y, int32_t val, uint8_t unit, LcdFlags att)
|
||||
{
|
||||
// convertUnit(val, unit);
|
||||
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
|
||||
@@ -867,21 +874,28 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L
|
||||
lcdLastRightPos += 3;
|
||||
}
|
||||
}
|
||||
#if !defined(PCBI6X) // GPS format setting disabled
|
||||
else {
|
||||
absvalue /= 10000;
|
||||
lcdDrawNumber(lcdLastRightPos+FW, y, absvalue, att|LEFT|PREC2); // mm.mmm
|
||||
}
|
||||
#endif
|
||||
lcdDrawSizedText(lcdLastRightPos+1, y, direction + (value>=0 ? 0 : 1), 1);
|
||||
}
|
||||
|
||||
void drawTime(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
|
||||
{
|
||||
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos, y, ":", att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos, y, ":", att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0, 2);
|
||||
}
|
||||
|
||||
void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
|
||||
{
|
||||
if (BLINK_ON_PHASE) {
|
||||
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos, y, ":", att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos, y, ":", att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0, 2);
|
||||
drawTime(x, y, telemetryItem, att);
|
||||
}
|
||||
else {
|
||||
lcdDrawNumber(x, y, telemetryItem.datetime.year, att|LEADING0|LEFT, 4);
|
||||
@@ -892,17 +906,51 @@ void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
|
||||
}
|
||||
}
|
||||
|
||||
void drawTimerWithMode(coord_t x, coord_t y, uint8_t index, LcdFlags att)
|
||||
{
|
||||
const TimerData &timer = g_model.timers[index];
|
||||
|
||||
if (timer.mode) {
|
||||
const TimerState &timerState = timersStates[index];
|
||||
const uint8_t negative = (timerState.val < 0 ? BLINK | INVERS : 0);
|
||||
if (timerState.val < 60 * 60) { // display MM:SS
|
||||
div_t qr = div((int) abs(timerState.val), 60);
|
||||
lcdDrawNumber(x - 5, y, qr.rem, att | LEADING0 | negative, 2);
|
||||
lcdDrawText(lcdLastLeftPos, y, ":", att | BLINK | negative);
|
||||
lcdDrawNumber(lcdLastLeftPos, y, qr.quot, att | negative);
|
||||
if (negative)
|
||||
lcdDrawText(lcdLastLeftPos, y, "-", att | negative);
|
||||
}
|
||||
else if (timerState.val < (99 * 60 * 60) + (59 * 60)) { // display HHhMM
|
||||
div_t qr = div((int) (abs(timerState.val) / 60), 60);
|
||||
lcdDrawNumber(x - 5, y, qr.rem, att | LEADING0, 2);
|
||||
lcdDrawText(lcdLastLeftPos, y, "h", att);
|
||||
lcdDrawNumber(lcdLastLeftPos, y, qr.quot, att);
|
||||
if (negative)
|
||||
lcdDrawText(lcdLastLeftPos, y, "-", att);
|
||||
}
|
||||
else { //display HHHH for crazy large persistent timers
|
||||
lcdDrawText(x - 5, y, "h", att);
|
||||
lcdDrawNumber(lcdLastLeftPos, y, timerState.val / 3600, att);
|
||||
}
|
||||
uint8_t xLabel = (negative ? x - 56 : x - 49);
|
||||
uint8_t len = zlen(timer.name, LEN_TIMER_NAME);
|
||||
if (len > 0) {
|
||||
lcdDrawSizedText(xLabel, y + FH, timer.name, len, RIGHT | ZCHAR);
|
||||
}
|
||||
else {
|
||||
drawTimerMode(xLabel, y + FH, timer.mode, RIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void drawTelemScreenDate(coord_t x, coord_t y, source_t sensor, LcdFlags att)
|
||||
{
|
||||
y+=3;
|
||||
sensor = (sensor-MIXSRC_FIRST_TELEM) / 3;
|
||||
TelemetryItem & telemetryItem = telemetryItems[sensor];
|
||||
|
||||
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos, y, ":", att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0, 2);
|
||||
lcdDrawText(lcdNextPos, y, ":", att);
|
||||
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0, 2);
|
||||
drawTime(x, y, telemetryItem, att);
|
||||
|
||||
lcdDrawNumber(x-29, y, telemetryItem.datetime.month, att|LEADING0|LEFT, 2);
|
||||
lcdDrawChar(lcdNextPos, y, '-', att);
|
||||
@@ -912,7 +960,7 @@ void drawTelemScreenDate(coord_t x, coord_t y, source_t sensor, LcdFlags att)
|
||||
void drawGPSPosition(coord_t x, coord_t y, int32_t longitude, int32_t latitude, LcdFlags flags)
|
||||
{
|
||||
if (flags & DBLSIZE) {
|
||||
x -= (g_eeGeneral.gpsFormat == 0 ? 62 : 61);
|
||||
x -= 62; // (g_eeGeneral.gpsFormat == 0 ? 62 : 61);
|
||||
flags &= ~0x0F00; // TODO constant
|
||||
drawGPSCoord(x, y, latitude, "NS", flags);
|
||||
drawGPSCoord(x, y+FH, longitude, "EW", flags);
|
||||
@@ -943,7 +991,7 @@ void lcdDraw1bitBitmap(coord_t x, coord_t y, const uint8_t * img, uint8_t idx, L
|
||||
uint8_t hb = ((*q++) + 7) / 8;
|
||||
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false);
|
||||
q += idx*w*hb;
|
||||
for (uint8_t yb = 0; yb < hb; yb++) {
|
||||
for (uint32_t yb = 0; yb < hb; yb++) {
|
||||
uint8_t *p = &displayBuf[(y / 8 + yb) * LCD_W + x];
|
||||
for (coord_t i=0; i<w; i++){
|
||||
uint8_t b = *q++;
|
||||
|
||||
@@ -23,15 +23,14 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
typedef int coord_t;
|
||||
typedef uint32_t LcdFlags;
|
||||
typedef uint8_t display_t;
|
||||
|
||||
#define BOX_WIDTH 23
|
||||
#define coord_t uint8_t
|
||||
#define scoord_t int8_t
|
||||
#define CENTER
|
||||
#define CENTER_OFS 0
|
||||
|
||||
typedef int32_t lcdint_t;
|
||||
typedef uint32_t lcduint_t;
|
||||
|
||||
#define FW 6
|
||||
#define FWNUM 5
|
||||
#define FH 8
|
||||
@@ -45,7 +44,7 @@
|
||||
#define BLINK 0x01
|
||||
#define INVERS 0x02
|
||||
#if defined(BOLD_FONT)
|
||||
#define BOLD 0x40
|
||||
#define BOLD 0x40u
|
||||
#else
|
||||
#define BOLD 0x00
|
||||
#endif
|
||||
@@ -54,13 +53,11 @@
|
||||
#define CENTERED 0x20
|
||||
#define CONDENSED 0x08
|
||||
#define FIXEDWIDTH 0x10
|
||||
/* lcd puts flags */
|
||||
/* no 0x80 here because of "GV"1 which is aligned LEFT */
|
||||
/* no 0x10 here because of "MODEL"01 which uses LEADING0 */
|
||||
#define ZCHAR 0x80
|
||||
#define ZCHAR 0x80u
|
||||
|
||||
/* lcdDrawNumber additional flags */
|
||||
#define UNSIGN 0x08
|
||||
#define LEADING0 0x10
|
||||
#define PREC1 0x20
|
||||
#define PREC2 0x30
|
||||
@@ -90,9 +87,6 @@
|
||||
#define TIMEHOUR 0x2000
|
||||
#define STREXPANDED 0x4000
|
||||
|
||||
typedef uint32_t LcdFlags;
|
||||
|
||||
#define display_t uint8_t
|
||||
#define DISPLAY_BUFFER_SIZE (LCD_W*((LCD_H+7)/8))
|
||||
|
||||
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
|
||||
@@ -103,11 +97,6 @@ extern coord_t lcdNextPos;
|
||||
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
|
||||
#define ASSERT_IN_DISPLAY(p) assert((p) >= displayBuf && (p) < DISPLAY_END)
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
extern volatile uint8_t lcdLock ;
|
||||
extern volatile uint32_t lcdInputs ;
|
||||
#endif
|
||||
|
||||
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c);
|
||||
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags flags);
|
||||
void lcdDrawText(coord_t x, coord_t y, const char * s, LcdFlags flags);
|
||||
@@ -116,23 +105,23 @@ void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len, L
|
||||
void lcdDrawText(coord_t x, coord_t y, const char * s);
|
||||
void lcdDrawSizedText(coord_t x, coord_t y, const char * s, unsigned char len);
|
||||
void lcdDrawTextAlignedLeft(coord_t y, const char * s);
|
||||
|
||||
#define lcdDrawTextAlignedCenter(y, s) lcdDrawText((LCD_W-sizeof(TR_##s)*FW+FW+1)/2, y, STR_##s)
|
||||
void lcdDrawTextIndented(coord_t y, const char * s);
|
||||
void drawTimerWithMode(coord_t x, coord_t y, uint8_t index, LcdFlags att);
|
||||
|
||||
void lcdDrawHexNumber(coord_t x, coord_t y, uint32_t val, LcdFlags mode=0);
|
||||
|
||||
void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags mode, uint8_t len);
|
||||
void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags mode=0);
|
||||
void lcdDrawNumber(coord_t x, coord_t y, int val, LcdFlags mode, uint8_t len);
|
||||
void lcdDrawNumber(coord_t x, coord_t y, int val, LcdFlags mode=0);
|
||||
void lcdDraw8bitsNumber(coord_t x, coord_t y, int8_t val);
|
||||
|
||||
void drawStringWithIndex(coord_t x, coord_t y, const char * str, uint8_t idx, LcdFlags att=0);
|
||||
void putsModelName(coord_t x, coord_t y, char * name, uint8_t id, LcdFlags att);
|
||||
#if !defined(BOOT) // TODO not here ...
|
||||
void drawSwitch(coord_t x, coord_t y, swsrc_t swtch, LcdFlags att=0);
|
||||
void drawSwitch(coord_t x, coord_t y, swsrc_t swtch, LcdFlags att=0, bool autoBold = true);
|
||||
void drawSource(coord_t x, coord_t y, mixsrc_t idx, LcdFlags att=0);
|
||||
#endif
|
||||
void drawCurveName(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
|
||||
void drawTimerMode(coord_t x, coord_t y, int8_t mode, LcdFlags att=0);
|
||||
void drawTimerMode(coord_t x, coord_t y, swsrc_t mode, LcdFlags att=0);
|
||||
|
||||
void drawTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att);
|
||||
void drawShortTrimMode(coord_t x, coord_t y, uint8_t mode, uint8_t idx, LcdFlags att);
|
||||
@@ -147,13 +136,11 @@ void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags attr);
|
||||
void putsVolts(coord_t x, coord_t y, uint16_t volts, LcdFlags att);
|
||||
void putsVBat(coord_t x, coord_t y, LcdFlags att);
|
||||
|
||||
|
||||
#define putstime_t int32_t
|
||||
#define FlightModesType uint16_t
|
||||
#define FlightModesType uint16_t
|
||||
|
||||
void drawRtcTime(coord_t x, coord_t y, LcdFlags att);
|
||||
void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2);
|
||||
inline void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att)
|
||||
void drawTimer(coord_t x, coord_t y, int32_t tme, LcdFlags att, LcdFlags att2);
|
||||
inline void drawTimer(coord_t x, coord_t y, int32_t tme, LcdFlags att)
|
||||
{
|
||||
drawTimer(x, y, tme, att, att);
|
||||
}
|
||||
@@ -165,13 +152,11 @@ void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att=0);
|
||||
void lcdMaskPoint(uint8_t *p, uint8_t mask, LcdFlags att=0);
|
||||
void lcdDrawSolidHorizontalLine(coord_t x, coord_t y, coord_t w, LcdFlags att=0);
|
||||
void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h, LcdFlags att=0);
|
||||
void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att=0);
|
||||
|
||||
void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
|
||||
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
inline void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags att=0)
|
||||
void lcdDrawSolidVerticalLine(coord_t x, coord_t y, coord_t h, LcdFlags att=0);
|
||||
void lcdDrawVerticalLine(coord_t x, coord_t y, coord_t h, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
void lcdDrawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
inline void lcdDrawSolidFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, LcdFlags att=0)
|
||||
{
|
||||
lcdDrawFilledRect(x, y, w, h, SOLID, att);
|
||||
}
|
||||
@@ -179,7 +164,10 @@ void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat=SOLID,
|
||||
|
||||
void lcdInvertLine(int8_t line);
|
||||
#define lcdInvertLastLine() lcdInvertLine(LCD_LINES-1)
|
||||
inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcdDrawRect(x, y, w, w, SOLID, att); }
|
||||
inline void lcdDrawSquare(coord_t x, coord_t y, coord_t w, LcdFlags att=0)
|
||||
{
|
||||
lcdDrawRect(x, y, w, w, SOLID, att);
|
||||
}
|
||||
|
||||
void drawTelemetryTopBar();
|
||||
|
||||
@@ -189,7 +177,7 @@ void drawTelemetryTopBar();
|
||||
lcdDrawSolidVerticalLine(xx+1,yy-ll,ll)
|
||||
|
||||
|
||||
void lcdClear(void);
|
||||
void lcdClear();
|
||||
void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t idx, LcdFlags att=0);
|
||||
inline void lcdDrawBitmap(coord_t x, coord_t y, const uint8_t * bitmap)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay)
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, str);
|
||||
lcdDrawNumber(MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
||||
lcdDrawNumber(MIXES_2ND_COLUMN, y, delay, attr|PREC1|LEFT);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, delay, DELAY_MAX);
|
||||
return delay;
|
||||
}
|
||||
@@ -46,3 +46,4 @@ void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8
|
||||
}
|
||||
|
||||
uint8_t s_currIdx;
|
||||
uint8_t s_currIdxSubMenu;
|
||||
|
||||
@@ -67,8 +67,8 @@ void menuModelNotes(event_t event)
|
||||
{
|
||||
if (event == EVT_ENTRY) {
|
||||
#if defined(SDCARD)
|
||||
strcpy(s_text_file, MODELS_PATH "/");
|
||||
char *buf = strcat_modelname(&s_text_file[sizeof(MODELS_PATH)], g_eeGeneral.currModel);
|
||||
strcpy(reusableBuffer.viewText.filename, MODELS_PATH "/");
|
||||
char *buf = strcat_modelname(&reusableBuffer.viewText.filename[sizeof(MODELS_PATH)], g_eeGeneral.currModel);
|
||||
strcpy(buf, TEXT_EXT);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -65,33 +65,23 @@ inline MenuHandlerFunc lastPopMenu()
|
||||
void onMainViewMenu(const char * result);
|
||||
void menuFirstCalib(event_t event);
|
||||
void menuMainView(event_t event);
|
||||
void menuViewTelemetryFrsky(event_t event);
|
||||
void menuViewTelemetry(event_t event);
|
||||
void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext);
|
||||
|
||||
enum MenuRadioIndexes
|
||||
{
|
||||
#if defined(PCBI6_ELRSV2)
|
||||
#if defined(RADIO_TOOLS)
|
||||
MENU_RADIO_TOOLS,
|
||||
#endif
|
||||
MENU_RADIO_SETUP,
|
||||
CASE_SDCARD(MENU_RADIO_SD_MANAGER)
|
||||
MENU_RADIO_SETUP,
|
||||
MENU_RADIO_SPECIAL_FUNCTIONS,
|
||||
MENU_RADIO_TRAINER,
|
||||
MENU_RADIO_VERSION,
|
||||
#if defined(MENU_DIAGKEYS)
|
||||
MENU_RADIO_SWITCHES_TEST,
|
||||
#endif
|
||||
#if defined(MENU_ANALOGS)
|
||||
MENU_RADIO_ANALOGS_TEST,
|
||||
#endif
|
||||
MENU_RADIO_HARDWARE,
|
||||
MENU_RADIO_CALIBRATION,
|
||||
MENU_RADIO_VERSION,
|
||||
MENU_RADIO_PAGES_COUNT
|
||||
};
|
||||
|
||||
#if defined(PCBI6_ELRSV2)
|
||||
void menuRadioTools(event_t event);
|
||||
#endif
|
||||
void menuRadioSetup(event_t event);
|
||||
void menuRadioSdManager(event_t event);
|
||||
void menuRadioSpecialFunctions(event_t event);
|
||||
@@ -100,25 +90,19 @@ void menuRadioVersion(event_t event);
|
||||
void menuRadioDiagKeys(event_t event);
|
||||
void menuRadioDiagAnalogs(event_t event);
|
||||
void menuRadioHardware(event_t event);
|
||||
void menuRadioTools(event_t event);
|
||||
void menuRadioCalibration(event_t event);
|
||||
|
||||
static const MenuHandlerFunc menuTabGeneral[] = {
|
||||
#if defined(PCBI6_ELRSV2)
|
||||
#if defined(RADIO_TOOLS)
|
||||
menuRadioTools,
|
||||
#endif
|
||||
menuRadioSetup,
|
||||
CASE_SDCARD(menuRadioSdManager)
|
||||
menuRadioSpecialFunctions,
|
||||
menuRadioTrainer,
|
||||
menuRadioVersion,
|
||||
#if defined(MENU_DIAGKEYS)
|
||||
menuRadioDiagKeys,
|
||||
#endif
|
||||
#if defined(MENU_DIAGANAS)
|
||||
menuRadioDiagAnalogs,
|
||||
#endif
|
||||
menuRadioHardware,
|
||||
menuRadioCalibration
|
||||
menuRadioVersion
|
||||
};
|
||||
|
||||
enum MenuModelIndexes {
|
||||
@@ -181,7 +165,7 @@ static const MenuHandlerFunc menuTabModel[] = {
|
||||
void menuStatisticsView(event_t event);
|
||||
void menuStatisticsDebug(event_t event);
|
||||
void menuStatisticsDebug2(event_t event);
|
||||
#if !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
void menuAboutView(event_t event);
|
||||
#endif
|
||||
#endif // _MENUS_H_
|
||||
|
||||
@@ -20,17 +20,39 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
void displayPresetChoice(event_t event)
|
||||
void runPopupCurvePreset(event_t event)
|
||||
{
|
||||
runPopupWarning(event);
|
||||
lcdDrawNumber(WARNING_LINE_X+FW*7, WARNING_LINE_Y, 45*warningInputValue/4, LEFT|INVERS);
|
||||
warningResult = false;
|
||||
|
||||
drawMessageBox();
|
||||
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+2*FH, STR_POPUPS_ENTER_EXIT);
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
warningResult = true;
|
||||
// no break
|
||||
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
warningText = NULL;
|
||||
warningType = WARNING_TYPE_ASTERISK;
|
||||
break;
|
||||
|
||||
default:
|
||||
s_editMode = EDIT_MODIFY_FIELD;
|
||||
reusableBuffer.curveEdit.preset = checkIncDec(event, reusableBuffer.curveEdit.preset, -4, 4);
|
||||
s_editMode = EDIT_SELECT_FIELD;
|
||||
break;
|
||||
}
|
||||
|
||||
lcdDrawNumber(WARNING_LINE_X+FW*7, WARNING_LINE_Y, 45 * reusableBuffer.curveEdit.preset / 4, LEFT|INVERS);
|
||||
lcdDrawChar(lcdLastRightPos, WARNING_LINE_Y, '@', INVERS);
|
||||
|
||||
if (warningResult) {
|
||||
warningResult = 0;
|
||||
CurveInfo & crv = g_model.curves[s_curveChan];
|
||||
int8_t * points = curveAddress(s_curveChan);
|
||||
int k = 25 * warningInputValue;
|
||||
CurveInfo & crv = g_model.curves[s_currIdxSubMenu];
|
||||
int8_t * points = curveAddress(s_currIdxSubMenu);
|
||||
int k = 25 * reusableBuffer.curveEdit.preset;
|
||||
int dx = 2000 / (5+crv.points-1);
|
||||
for (uint8_t i=0; i<5+crv.points; i++) {
|
||||
int x = -1000 + i * dx;
|
||||
@@ -45,17 +67,18 @@ void displayPresetChoice(event_t event)
|
||||
void onCurveOneMenu(const char * result)
|
||||
{
|
||||
if (result == STR_CURVE_PRESET) {
|
||||
POPUP_INPUT(STR_PRESET, displayPresetChoice, 0, -4, 4);
|
||||
reusableBuffer.curveEdit.preset = 4; // 45°
|
||||
POPUP_INPUT(STR_PRESET, runPopupCurvePreset);
|
||||
}
|
||||
else if (result == STR_MIRROR) {
|
||||
CurveInfo & crv = g_model.curves[s_curveChan];
|
||||
int8_t * points = curveAddress(s_curveChan);
|
||||
CurveInfo & crv = g_model.curves[s_currIdxSubMenu];
|
||||
int8_t * points = curveAddress(s_currIdxSubMenu);
|
||||
for (int i=0; i<5+crv.points; i++)
|
||||
points[i] = -points[i];
|
||||
}
|
||||
else if (result == STR_CLEAR) {
|
||||
CurveInfo & crv = g_model.curves[s_curveChan];
|
||||
int8_t * points = curveAddress(s_curveChan);
|
||||
CurveInfo & crv = g_model.curves[s_currIdxSubMenu];
|
||||
int8_t * points = curveAddress(s_currIdxSubMenu);
|
||||
for (int i=0; i<5+crv.points; i++)
|
||||
points[i] = 0;
|
||||
if (crv.type == CURVE_TYPE_CUSTOM) {
|
||||
@@ -66,10 +89,10 @@ void onCurveOneMenu(const char * result)
|
||||
|
||||
void menuModelCurveOne(event_t event)
|
||||
{
|
||||
CurveData & crv = g_model.curves[s_curveChan];
|
||||
int8_t * points = curveAddress(s_curveChan);
|
||||
CurveData & crv = g_model.curves[s_currIdxSubMenu];
|
||||
int8_t * points = curveAddress(s_currIdxSubMenu);
|
||||
|
||||
drawStringWithIndex(PSIZE(TR_MENUCURVES)*FW+FW, 0, STR_CV, s_curveChan+1);
|
||||
drawStringWithIndex(PSIZE(TR_MENUCURVES)*FW+FW, 0, STR_CV, s_currIdxSubMenu+1);
|
||||
|
||||
SIMPLE_SUBMENU(STR_MENUCURVES, 4 + 5+crv.points + (crv.type==CURVE_TYPE_CUSTOM ? 5+crv.points-2 : 0));
|
||||
|
||||
@@ -85,9 +108,9 @@ void menuModelCurveOne(event_t event)
|
||||
uint8_t newType = checkIncDecModelZero(event, crv.type, CURVE_TYPE_LAST);
|
||||
if (newType != crv.type) {
|
||||
for (int i = 1; i < 4 + crv.points; i++) {
|
||||
points[i] = calcRESXto100(applyCustomCurve(calc100toRESX(getCurveX(5 + crv.points, i)), s_curveChan));
|
||||
points[i] = calcRESXto100(applyCustomCurve(calc100toRESX(getCurveX(5 + crv.points, i)), s_currIdxSubMenu));
|
||||
}
|
||||
if (moveCurve(s_curveChan, checkIncDec_Ret > 0 ? 3 + crv.points : -3 - crv.points)) {
|
||||
if (moveCurve(s_currIdxSubMenu, checkIncDec_Ret > 0 ? 3 + crv.points : -3 - crv.points)) {
|
||||
if (newType == CURVE_TYPE_CUSTOM) {
|
||||
resetCustomCurveX(points, 5 + crv.points);
|
||||
}
|
||||
@@ -108,8 +131,8 @@ void menuModelCurveOne(event_t event)
|
||||
newPoints[0] = points[0];
|
||||
newPoints[4 + count] = points[4 + crv.points];
|
||||
for (int i = 1; i < 4 + count; i++)
|
||||
newPoints[i] = calcRESXto100(applyCustomCurve(calc100toRESX(getCurveX(5 + count, i)), s_curveChan));
|
||||
if (moveCurve(s_curveChan, checkIncDec_Ret * (crv.type == CURVE_TYPE_CUSTOM ? 2 : 1))) {
|
||||
newPoints[i] = calcRESXto100(applyCustomCurve(calc100toRESX(getCurveX(5 + count, i)), s_currIdxSubMenu));
|
||||
if (moveCurve(s_currIdxSubMenu, checkIncDec_Ret * (crv.type == CURVE_TYPE_CUSTOM ? 2 : 1))) {
|
||||
for (int i = 0; i < 5 + count; i++) {
|
||||
points[i] = newPoints[i];
|
||||
if (crv.type == CURVE_TYPE_CUSTOM && i != 0 && i != 4 + count)
|
||||
@@ -138,6 +161,18 @@ void menuModelCurveOne(event_t event)
|
||||
POPUP_MENU_START(onCurveOneMenu);
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(NAVIGATION_X7)
|
||||
case EVT_KEY_LONG(KEY_MENU):
|
||||
pushMenu(menuChannelsView);
|
||||
killEvents(event);
|
||||
break;
|
||||
#elif defined(NAVIGATION_XLITE)
|
||||
case EVT_KEY_LONG(KEY_SHIFT):
|
||||
pushMenu(menuChannelsView);
|
||||
killEvents(event);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
drawCurve(0);
|
||||
|
||||
@@ -33,12 +33,12 @@ void onModelCustomScriptMenu(const char *result)
|
||||
ScriptData &sd = g_model.scriptsData[s_currIdx];
|
||||
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
if (!sdListFiles(SCRIPTS_MIXES_PATH, SCRIPTS_EXT, sizeof(sd.file), NULL)) {
|
||||
if (!sdListFiles(SCRIPTS_MIXES_PATH, SCRIPTS_EXT, sizeof(sd.file), nullptr)) {
|
||||
POPUP_WARNING(STR_NO_SCRIPTS_ON_SD);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a lua file in the list
|
||||
else if (result) {
|
||||
// The user chosen a lua file in the list
|
||||
copySelection(sd.file, result, sizeof(sd.file));
|
||||
memset(sd.inputs, 0, sizeof(sd.inputs));
|
||||
storageDirty(EE_MODEL);
|
||||
|
||||
@@ -50,31 +50,56 @@ enum MenuModelDisplayItems {
|
||||
#else
|
||||
#define DISPLAY_COL2 (8*FW)
|
||||
#endif
|
||||
#define DISPLAY_COL3 (17*FW+2)
|
||||
#define DISPLAY_COL3 (15*FW+2)
|
||||
|
||||
#if defined(LUA)
|
||||
#define SCREEN_TYPE_ROWS 1
|
||||
#define DISPLAY_LINE_ROWS(x) ((TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_NONE || TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_SCRIPT) ? HIDDEN_ROW : (TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_GAUGES ? (uint8_t)2 : (uint8_t)1))
|
||||
#else
|
||||
#define SCREEN_TYPE_ROWS 0
|
||||
#define DISPLAY_LINE_ROWS(x) (TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_NONE ? HIDDEN_ROW : (TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_GAUGES ? (uint8_t)2 : (uint8_t)1))
|
||||
#endif
|
||||
|
||||
#define TELEMETRY_SCREEN_ROWS(x) SCREEN_TYPE_ROWS, DISPLAY_LINE_ROWS(x), DISPLAY_LINE_ROWS(x), DISPLAY_LINE_ROWS(x), DISPLAY_LINE_ROWS(x)
|
||||
#define TELEMETRY_CURRENT_SCREEN(k) (k < ITEM_DISPLAY_SCREEN_LABEL2 ? 0 : (k < ITEM_DISPLAY_SCREEN_LABEL3 ? 1 : (k < ITEM_DISPLAY_SCREEN_LABEL4 ? 2 : 3)))
|
||||
|
||||
#if defined(LUA)
|
||||
void onTelemetryScriptFileSelectionMenu(const char *result)
|
||||
inline uint8_t SCREEN_TYPE_COLUMNS(uint8_t screenIndex)
|
||||
{
|
||||
int screenIndex = TELEMETRY_CURRENT_SCREEN(menuVerticalPosition - HEADER_LINE);
|
||||
#if defined(LUA)
|
||||
if (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_SCRIPT)
|
||||
return 1;
|
||||
else
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline uint8_t SCREEN_LINE_COLUMNS(uint8_t screenIndex, uint8_t lineIndex)
|
||||
{
|
||||
switch (TELEMETRY_SCREEN_TYPE(screenIndex)) {
|
||||
case TELEMETRY_SCREEN_TYPE_VALUES:
|
||||
return 1;
|
||||
case TELEMETRY_SCREEN_TYPE_BARS:
|
||||
return g_model.frsky.screens[screenIndex].bars[lineIndex].source ? 2 : 0;
|
||||
default:
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
}
|
||||
|
||||
#define TELEMETRY_SCREEN_ROWS(x) SCREEN_TYPE_COLUMNS(x), SCREEN_LINE_COLUMNS(x, 0), SCREEN_LINE_COLUMNS(x, 1), SCREEN_LINE_COLUMNS(x, 2), SCREEN_LINE_COLUMNS(x, 3)
|
||||
|
||||
inline uint8_t DISPLAY_CURRENT_SCREEN(uint8_t line)
|
||||
{
|
||||
if (line < ITEM_DISPLAY_SCREEN_LABEL2)
|
||||
return 0;
|
||||
else if (line < ITEM_DISPLAY_SCREEN_LABEL3)
|
||||
return 1;
|
||||
else if (line < ITEM_DISPLAY_SCREEN_LABEL4)
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
}
|
||||
|
||||
#if defined(LUA)
|
||||
void onTelemetryScriptFileSelectionMenu(const char * result)
|
||||
{
|
||||
int screenIndex = DISPLAY_CURRENT_SCREEN(menuVerticalPosition - HEADER_LINE);
|
||||
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
if (!sdListFiles(SCRIPTS_TELEM_PATH, SCRIPTS_EXT, sizeof(g_model.frsky.screens[screenIndex].script.file), NULL)) {
|
||||
POPUP_WARNING(STR_NO_SCRIPTS_ON_SD);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a file in the list
|
||||
else if (result != STR_EXIT) {
|
||||
// The user chosen a file in the list
|
||||
memcpy(g_model.frsky.screens[screenIndex].script.file, result, sizeof(g_model.frsky.screens[screenIndex].script.file));
|
||||
storageDirty(EE_MODEL);
|
||||
LUA_LOAD_MODEL_SCRIPTS();
|
||||
@@ -82,7 +107,6 @@ void onTelemetryScriptFileSelectionMenu(const char *result)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int skipHiddenLines(int noRows, const uint8_t * mstate_tab, int row)
|
||||
{
|
||||
for(int i=0; i<noRows; ++i) {
|
||||
@@ -106,7 +130,7 @@ void menuModelDisplay(event_t event)
|
||||
|
||||
int8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
|
||||
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
int k = i + menuVerticalOffset;
|
||||
SKIP_HIDDEN_MENU_ROWS(k);
|
||||
@@ -120,7 +144,7 @@ void menuModelDisplay(event_t event)
|
||||
case ITEM_DISPLAY_SCREEN_LABEL3:
|
||||
case ITEM_DISPLAY_SCREEN_LABEL4:
|
||||
{
|
||||
uint8_t screenIndex = TELEMETRY_CURRENT_SCREEN(k);
|
||||
uint8_t screenIndex = DISPLAY_CURRENT_SCREEN(k);
|
||||
drawStringWithIndex(0*FW, y, STR_SCREEN, screenIndex+1);
|
||||
TelemetryScreenType oldScreenType = TELEMETRY_SCREEN_TYPE(screenIndex);
|
||||
TelemetryScreenType newScreenType = (TelemetryScreenType)editChoice(DISPLAY_COL2, y, "", STR_VTELEMSCREENTYPE, oldScreenType, 0, TELEMETRY_SCREEN_TYPE_MAX, (menuHorizontalPosition==0 ? attr : 0), event);
|
||||
@@ -149,9 +173,6 @@ void menuModelDisplay(event_t event)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (attr) {
|
||||
MOVE_CURSOR_FROM_HERE();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -207,9 +228,6 @@ void menuModelDisplay(event_t event)
|
||||
drawSourceCustomValue(DISPLAY_COL3, y, bar.source, bar.barMax, (menuHorizontalPosition==2 ? attr : 0) | lf);
|
||||
}
|
||||
}
|
||||
else if (attr) {
|
||||
MOVE_CURSOR_FROM_HERE();
|
||||
}
|
||||
if (attr && s_editMode>0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
@@ -226,10 +244,10 @@ void menuModelDisplay(event_t event)
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
bar.barMin = checkIncDec(event, bar.barMin, barMin, bar.barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||
bar.barMin = checkIncDec(event, bar.barMin, barMin, barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||
break;
|
||||
case 2:
|
||||
bar.barMax = checkIncDec(event, bar.barMax, bar.barMin, barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||
bar.barMax = checkIncDec(event, bar.barMax, barMin, barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -237,11 +255,11 @@ void menuModelDisplay(event_t event)
|
||||
else {
|
||||
for (int c=0; c<NUM_LINE_ITEMS; c++) {
|
||||
LcdFlags cellAttr = (menuHorizontalPosition==c ? attr : 0);
|
||||
source_t & value = g_model.frsky.screens[screenIndex].lines[lineIndex].sources[c];
|
||||
source_t * value = &g_model.frsky.screens[screenIndex].lines[lineIndex].sources[c];
|
||||
const coord_t pos[] = {DISPLAY_COL1, DISPLAY_COL2, DISPLAY_COL3};
|
||||
drawSource(pos[c], y, value, cellAttr);
|
||||
drawSource(pos[c], y, *value, cellAttr);
|
||||
if (cellAttr && s_editMode>0) {
|
||||
value = checkIncDec(event, value, 0, MIXSRC_LAST_TELEM, EE_MODEL|INCDEC_SOURCE|NO_INCDEC_MARKS, isSourceAvailable);
|
||||
*value = checkIncDec(event, *value, 0, MIXSRC_LAST_TELEM, EE_MODEL|INCDEC_SOURCE|NO_INCDEC_MARKS, isSourceAvailable);
|
||||
}
|
||||
}
|
||||
if (attr && menuHorizontalPosition == NUM_LINE_ITEMS) {
|
||||
|
||||
@@ -83,16 +83,17 @@ void menuModelFlightModeOne(event_t event)
|
||||
int8_t editMode = s_editMode;
|
||||
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
if (s_currIdx == 0 && sub>=ITEM_MODEL_FLIGHT_MODE_SWITCH) sub += VERTICAL_SHIFT;
|
||||
if (s_currIdx == 0 && sub>=ITEM_MODEL_FLIGHT_MODE_SWITCH)
|
||||
sub += VERTICAL_SHIFT;
|
||||
|
||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||
for (uint32_t k=0; k<LCD_LINES-1; k++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
|
||||
int8_t i = k + menuVerticalOffset;
|
||||
|
||||
if (s_currIdx == 0 && i>=ITEM_MODEL_FLIGHT_MODE_SWITCH) i += VERTICAL_SHIFT;
|
||||
uint8_t attr = (sub==i ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||
#else
|
||||
for (uint8_t i=0, k=0, y=PHASE_ONE_FIRST_LINE; i<ITEM_MODEL_FLIGHT_MODE_MAX; i++, k++, y+=FH) {
|
||||
for (uint32_t i=0, k=0, y=PHASE_ONE_FIRST_LINE; i<ITEM_MODEL_FLIGHT_MODE_MAX; i++, k++, y+=FH) {
|
||||
if (s_currIdx == 0 && i==ITEM_MODEL_FLIGHT_MODE_SWITCH) i = ITEM_MODEL_FLIGHT_MODE_FADE_IN;
|
||||
uint8_t attr = (sub==k ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||
#endif
|
||||
@@ -107,9 +108,13 @@ void menuModelFlightModeOne(event_t event)
|
||||
|
||||
case ITEM_MODEL_FLIGHT_MODE_TRIMS:
|
||||
lcdDrawTextAlignedLeft(y, STR_TRIMS);
|
||||
for (uint8_t t = 0; t < NUM_STICKS; t++) {
|
||||
for (uint32_t t = 0; t < NUM_STICKS; t++) {
|
||||
drawTrimMode(MIXES_2ND_COLUMN + (t*2*FW), y, s_currIdx, t, menuHorizontalPosition == t ? attr : 0);
|
||||
#if defined(NAVIGATION_9X)
|
||||
if (s_editMode > 0 && attr && menuHorizontalPosition == t) {
|
||||
#else
|
||||
if (s_editMode >= 0 && attr && menuHorizontalPosition == t) {
|
||||
#endif
|
||||
trim_t & v = fm->trim[t];
|
||||
v.mode = checkIncDec(event, v.mode==TRIM_MODE_NONE ? -1 : v.mode, -1, k==0 ? 0 : 2*MAX_FLIGHT_MODES-1, EE_MODEL, isTrimModeAvailable);
|
||||
}
|
||||
@@ -157,7 +162,7 @@ void menuModelFlightModeOne(event_t event)
|
||||
drawStringWithIndex(INDENT_WIDTH, y, STR_GV, idx+1, posHorz==0 ? attr : 0);
|
||||
lcdDrawSizedText(4*FW, y,g_model.gvars[idx].name, LEN_GVAR_NAME, ZCHAR);
|
||||
if (attr && editMode>0 && posHorz==0) {
|
||||
s_currIdx = sub - ITEM_MODEL_FLIGHT_MODE_GV1;
|
||||
s_currIdxSubMenu = sub - ITEM_MODEL_FLIGHT_MODE_GV1;
|
||||
editMode = 0;
|
||||
pushMenu(menuModelGVarOne);
|
||||
}
|
||||
@@ -198,7 +203,7 @@ void menuModelFlightModeOne(event_t event)
|
||||
#define TRIMS_OFS (-FW/2-4)
|
||||
#define ROTARY_ENC_OFS (2)
|
||||
#endif
|
||||
#elif defined(PCBTARANIS)
|
||||
#elif defined(PCBTARANIS) || defined(PCBI6X)
|
||||
#define NAME_POS 20
|
||||
#define SWITCH_POS 59
|
||||
#define TRIMS_POS 79
|
||||
@@ -239,14 +244,14 @@ void menuModelFlightModesAll(event_t event)
|
||||
att = (i==sub ? INVERS : 0);
|
||||
FlightModeData * p = flightModeAddress(i);
|
||||
drawFlightMode(0, y, i+1, att|(getFlightMode()==i ? BOLD : 0));
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
lcdDrawSizedText(NAME_POS, y, p->name, sizeof(p->name), ZCHAR);
|
||||
#else
|
||||
lcdDrawSizedText(4*FW+NAME_OFS, y, p->name, sizeof(p->name), ZCHAR);
|
||||
#endif
|
||||
if (i == 0) {
|
||||
for (uint8_t t=0; t<NUM_STICKS; t++) {
|
||||
#if defined(PCBTARANIS)
|
||||
for (uint32_t t=0; t<NUM_STICKS; t++) {
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
drawTrimMode(TRIMS_POS+t*FW*2, y, i, t, 0);
|
||||
#else
|
||||
drawShortTrimMode((9+LEN_FLIGHT_MODE_NAME+t)*FW+TRIMS_OFS, y, i, t, 0);
|
||||
@@ -254,14 +259,14 @@ void menuModelFlightModesAll(event_t event)
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
drawSwitch(SWITCH_POS, y, p->swtch, 0);
|
||||
for (uint8_t t=0; t<NUM_STICKS; t++) {
|
||||
for (uint32_t t=0; t<NUM_STICKS; t++) {
|
||||
drawTrimMode(TRIMS_POS+t*FW*2, y, i, t, 0);
|
||||
}
|
||||
#else
|
||||
drawSwitch((4+LEN_FLIGHT_MODE_NAME)*FW+SWITCH_OFS, y, p->swtch, 0);
|
||||
for (uint8_t t=0; t<NUM_STICKS; t++) {
|
||||
for (uint32_t t=0; t<NUM_STICKS; t++) {
|
||||
drawShortTrimMode((9+LEN_FLIGHT_MODE_NAME+t)*FW+TRIMS_OFS, y, i, t, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,28 +23,28 @@
|
||||
void editGVarValue(coord_t x, coord_t y, event_t event, uint8_t gvar, uint8_t flightMode, LcdFlags flags)
|
||||
{
|
||||
FlightModeData * fm = &g_model.flightModeData[flightMode];
|
||||
gvar_t & v = fm->gvars[gvar];
|
||||
gvar_t * v = &fm->gvars[gvar];
|
||||
int16_t vmin, vmax;
|
||||
if (v > GVAR_MAX) {
|
||||
uint8_t fm = v - GVAR_MAX - 1;
|
||||
if (*v > GVAR_MAX) {
|
||||
uint8_t fm = *v - GVAR_MAX - 1;
|
||||
if (fm >= flightMode) fm++;
|
||||
drawFlightMode(x, y, fm + 1, flags&(~LEFT));
|
||||
vmin = GVAR_MAX + 1;
|
||||
vmax = GVAR_MAX + MAX_FLIGHT_MODES - 1;
|
||||
}
|
||||
else {
|
||||
drawGVarValue(x, y, gvar, v, flags);
|
||||
drawGVarValue(x, y, gvar, *v, flags);
|
||||
vmin = GVAR_MIN + g_model.gvars[gvar].min;
|
||||
vmax = GVAR_MAX - g_model.gvars[gvar].max;
|
||||
}
|
||||
|
||||
if (flags & INVERS) {
|
||||
if (event == EVT_KEY_LONG(KEY_ENTER) && flightMode > 0) {
|
||||
v = (v > GVAR_MAX ? 0 : GVAR_MAX+1);
|
||||
*v = (*v > GVAR_MAX ? 0 : GVAR_MAX+1);
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
else if (s_editMode > 0) {
|
||||
v = checkIncDec(event, v, vmin, vmax, EE_MODEL);
|
||||
*v = checkIncDec(event, *v, vmin, vmax, EE_MODEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,10 +64,10 @@ enum GVarFields {
|
||||
|
||||
void menuModelGVarOne(event_t event)
|
||||
{
|
||||
GVarData * gvar = &g_model.gvars[s_currIdx];
|
||||
GVarData * gvar = &g_model.gvars[s_currIdxSubMenu];
|
||||
|
||||
drawStringWithIndex(PSIZE(TR_GVARS)*FW+FW, 0, STR_GV, s_currIdx+1, 0);
|
||||
drawGVarValue(32*FW, 0, s_currIdx, getGVarValue(s_currIdx, getFlightMode()));
|
||||
drawStringWithIndex(PSIZE(TR_GVARS)*FW+FW, 0, STR_GV, s_currIdxSubMenu+1, 0);
|
||||
drawGVarValue(32*FW, 0, s_currIdxSubMenu, getGVarValue(s_currIdxSubMenu, getFlightMode()));
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID);
|
||||
|
||||
SIMPLE_SUBMENU(STR_GVARS, GVAR_FIELD_LAST);
|
||||
@@ -91,14 +91,14 @@ void menuModelGVarOne(event_t event)
|
||||
break;
|
||||
|
||||
case GVAR_FIELD_MIN:
|
||||
lcdDrawText(0, y, STR_MIN);
|
||||
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdx, GVAR_MIN+gvar->min, LEFT|attr);
|
||||
lcdDrawTextAlignedLeft(y, STR_MIN);
|
||||
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdxSubMenu, GVAR_MIN+gvar->min, LEFT|attr);
|
||||
if (attr) gvar->min = checkIncDec(event, GVAR_MIN+gvar->min, GVAR_MIN, GVAR_MAX-gvar->max, EE_MODEL) - GVAR_MIN;
|
||||
break;
|
||||
|
||||
case GVAR_FIELD_MAX:
|
||||
lcdDrawText(0, y, STR_MAX);
|
||||
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdx, GVAR_MAX-gvar->max, LEFT|attr);
|
||||
lcdDrawTextAlignedLeft(y, STR_MAX);
|
||||
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdxSubMenu, GVAR_MAX-gvar->max, LEFT|attr);
|
||||
if (attr) gvar->max = GVAR_MAX - checkIncDec(event, GVAR_MAX-gvar->max, GVAR_MIN+gvar->min, GVAR_MAX, EE_MODEL);
|
||||
break;
|
||||
|
||||
@@ -108,7 +108,7 @@ void menuModelGVarOne(event_t event)
|
||||
|
||||
default:
|
||||
drawStringWithIndex(0, y, STR_FM, k-GVAR_FIELD_FM0);
|
||||
editGVarValue(GVAR_2ND_COLUMN, y, event, s_currIdx, k-GVAR_FIELD_FM0, LEFT|attr);
|
||||
editGVarValue(GVAR_2ND_COLUMN, y, event, s_currIdxSubMenu, k-GVAR_FIELD_FM0, LEFT|attr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "opentx.h"
|
||||
|
||||
#define EXPO_ONE_2ND_COLUMN (7*FW+3*FW+2)
|
||||
#define EXPO_ONE_FM_WIDTH (5*FW)
|
||||
|
||||
int expoFn(int x)
|
||||
{
|
||||
@@ -40,6 +39,7 @@ void drawFunction(FnFuncP fn, uint8_t offset)
|
||||
|
||||
for (int xv=-CURVE_SIDE_WIDTH; xv<=CURVE_SIDE_WIDTH; xv++) {
|
||||
coord_t yv = (LCD_H-1) - (((uint16_t)RESX + fn(xv * (RESX/CURVE_SIDE_WIDTH))) / 2 * (LCD_H-1) / RESX);
|
||||
yv = limit (0, yv, LCD_H-1);
|
||||
if (prev_yv != (coord_t)-1) {
|
||||
if (abs((int8_t)yv-prev_yv) <= 1) {
|
||||
lcdDrawPoint(CURVE_CENTER_X+xv-offset-1, prev_yv, FORCE);
|
||||
@@ -72,6 +72,17 @@ enum ExposFields {
|
||||
|
||||
void menuModelExpoOne(event_t event)
|
||||
{
|
||||
#if defined(NAVIGATION_X7)
|
||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
||||
pushMenu(menuChannelsView);
|
||||
killEvents(event);
|
||||
}
|
||||
#elif defined(NAVIGATION_XLITE)
|
||||
if (event == EVT_KEY_LONG(KEY_SHIFT)) {
|
||||
pushMenu(menuChannelsView);
|
||||
killEvents(event);
|
||||
}
|
||||
#endif
|
||||
ExpoData * ed = expoAddress(s_currIdx);
|
||||
drawSource(PSIZE(TR_MENUINPUTS)*FW+FW, 0, MIXSRC_FIRST_INPUT+ed->chn, 0);
|
||||
|
||||
@@ -100,14 +111,14 @@ void menuModelExpoOne(event_t event)
|
||||
break;
|
||||
|
||||
case EXPO_FIELD_SOURCE:
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_SOURCE));
|
||||
lcdDrawTextAlignedLeft(y, STR_SOURCE);
|
||||
drawSource(EXPO_ONE_2ND_COLUMN, y, ed->srcRaw, RIGHT|STREXPANDED|attr);
|
||||
if (attr) ed->srcRaw = checkIncDec(event, ed->srcRaw, INPUTSRC_FIRST, INPUTSRC_LAST, EE_MODEL|INCDEC_SOURCE|NO_INCDEC_MARKS, isInputSourceAvailable);
|
||||
if (attr) ed->srcRaw = checkIncDec(event, ed->srcRaw, INPUTSRC_FIRST, INPUTSRC_LAST, EE_MODEL|INCDEC_SOURCE|NO_INCDEC_MARKS, isSourceAvailableInInputs);
|
||||
break;
|
||||
|
||||
case EXPO_FIELD_SCALE:
|
||||
lcdDrawTextAlignedLeft(y, STR_SCALE);
|
||||
drawSensorCustomValue(EXPO_ONE_2ND_COLUMN, y, (ed->srcRaw - MIXSRC_FIRST_TELEM)/3, convertTelemValue(ed->srcRaw - MIXSRC_FIRST_TELEM + 1, ed->scale), attr);
|
||||
drawSensorCustomValue(EXPO_ONE_2ND_COLUMN, y, (ed->srcRaw - MIXSRC_FIRST_TELEM)/3, convertTelemValue(ed->srcRaw - MIXSRC_FIRST_TELEM + 1, ed->scale), RIGHT | attr);
|
||||
if (attr) ed->scale = checkIncDec(event, ed->scale, 0, maxTelemValue(ed->srcRaw - MIXSRC_FIRST_TELEM + 1), EE_MODEL);
|
||||
break;
|
||||
|
||||
@@ -117,7 +128,7 @@ void menuModelExpoOne(event_t event)
|
||||
break;
|
||||
|
||||
case EXPO_FIELD_OFFSET:
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_OFFSET));
|
||||
lcdDrawTextAlignedLeft(y, STR_OFFSET);
|
||||
ed->offset = GVAR_MENU_ITEM(EXPO_ONE_2ND_COLUMN, y, ed->offset, -100, 100, RIGHT | attr, 0, event);
|
||||
break;
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ void insertExpoMix(uint8_t expo, uint8_t idx)
|
||||
memmove(mix+1, mix, (MAX_MIXERS-(idx+1))*sizeof(MixData));
|
||||
memclear(mix, sizeof(MixData));
|
||||
mix->destCh = s_currCh-1;
|
||||
mix->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channel_order(s_currCh));
|
||||
mix->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channelOrder(s_currCh));
|
||||
mix->weight = 100;
|
||||
}
|
||||
resumeMixerCalculations();
|
||||
@@ -240,7 +240,7 @@ void menuModelExpoOne(event_t event)
|
||||
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1;
|
||||
|
||||
for (uint8_t i=0; i<EXPO_FIELD_MAX+1; i++) {
|
||||
for (uint32_t i=0; i<EXPO_FIELD_MAX+1; i++) {
|
||||
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||
switch (i) {
|
||||
case EXPO_FIELD_NAME:
|
||||
@@ -271,7 +271,7 @@ void menuModelExpoOne(event_t event)
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, ed->curveParam, CURVE_BASE+MAX_CURVES-1);
|
||||
if (ed->curveParam) ed->curveMode = MODE_CURVE;
|
||||
if (ed->curveParam>=CURVE_BASE && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
s_curveChan = ed->curveParam - CURVE_BASE;
|
||||
s_currIdxSubMenu = ed->curveParam - CURVE_BASE;
|
||||
pushMenu(menuModelCurveOne);
|
||||
}
|
||||
}
|
||||
@@ -361,13 +361,13 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
|
||||
}
|
||||
lcdDrawSolidVerticalLine(x+GAUGE_WIDTH/2-1, y, GAUGE_HEIGHT+1);
|
||||
if (barMin == -101) {
|
||||
for (uint8_t i=0; i<3; ++i) {
|
||||
for (uint32_t i=0; i<3; ++i) {
|
||||
lcdDrawPoint(x+i, y+4-i);
|
||||
lcdDrawPoint(x+3+i, y+4-i);
|
||||
}
|
||||
}
|
||||
if (barMax == 101) {
|
||||
for (uint8_t i=0; i<3; ++i) {
|
||||
for (uint32_t i=0; i<3; ++i) {
|
||||
lcdDrawPoint(x+GAUGE_WIDTH-8+i, y+4-i);
|
||||
lcdDrawPoint(x+GAUGE_WIDTH-5+i, y+4-i);
|
||||
}
|
||||
@@ -404,17 +404,17 @@ void menuModelMixOne(event_t event)
|
||||
editSingleName(COLUMN_X+MIXES_2ND_COLUMN, y, STR_MIXNAME, md2->name, sizeof(md2->name), event, attr);
|
||||
break;
|
||||
case MIX_FIELD_SOURCE:
|
||||
drawFieldLabel(COLUMN_X, y, NO_INDENT(STR_SOURCE));
|
||||
lcdDrawTextAlignedLeft(y, STR_SOURCE);
|
||||
drawSource(COLUMN_X+MIXES_2ND_COLUMN, y, md2->srcRaw, STREXPANDED|attr);
|
||||
if (attr) CHECK_INCDEC_MODELSOURCE(event, md2->srcRaw, 1, MIXSRC_LAST);
|
||||
break;
|
||||
case MIX_FIELD_WEIGHT:
|
||||
drawFieldLabel(COLUMN_X, y, STR_WEIGHT);
|
||||
lcdDrawTextAlignedLeft(y, STR_WEIGHT);
|
||||
gvarWeightItem(COLUMN_X+MIXES_2ND_COLUMN, y, md2, attr|LEFT, event);
|
||||
break;
|
||||
case MIX_FIELD_OFFSET:
|
||||
{
|
||||
drawFieldLabel(COLUMN_X, y, NO_INDENT(STR_OFFSET));
|
||||
lcdDrawTextAlignedLeft(y, STR_OFFSET);
|
||||
u_int8int16_t offset;
|
||||
MD_OFFSET_TO_UNION(md2, offset);
|
||||
offset.word = GVAR_MENU_ITEM(COLUMN_X+MIXES_2ND_COLUMN, y, offset.word, GV_RANGELARGE_OFFSET_NEG, GV_RANGELARGE_OFFSET, attr|LEFT, 0, event);
|
||||
@@ -427,7 +427,7 @@ void menuModelMixOne(event_t event)
|
||||
{
|
||||
uint8_t not_stick = (md2->srcRaw > NUM_STICKS);
|
||||
int8_t carryTrim = -md2->carryTrim;
|
||||
drawFieldLabel(COLUMN_X, y, STR_TRIM);
|
||||
lcdDrawTextAlignedLeft(y, STR_TRIM);
|
||||
lcdDrawTextAtIndex((not_stick ? COLUMN_X+MIXES_2ND_COLUMN : COLUMN_X+6*FW-3), y, STR_VMIXTRIMS, (not_stick && carryTrim == 0) ? 0 : carryTrim+1, menuHorizontalPosition==0 ? attr : 0);
|
||||
if (attr && menuHorizontalPosition==0 && (not_stick || editMode>0)) md2->carryTrim = -checkIncDecModel(event, carryTrim, not_stick ? TRIM_ON : -TRIM_OFF, -TRIM_AIL);
|
||||
if (!not_stick) {
|
||||
@@ -443,13 +443,13 @@ void menuModelMixOne(event_t event)
|
||||
|
||||
case MIX_FIELD_CURVE:
|
||||
{
|
||||
drawFieldLabel(COLUMN_X, y, STR_CURVE);
|
||||
lcdDrawTextAlignedLeft(y, STR_CURVE);
|
||||
int8_t curveParam = md2->curveParam;
|
||||
if (md2->curveMode == MODE_CURVE) {
|
||||
drawCurveName(COLUMN_X+MIXES_2ND_COLUMN, y, curveParam, attr);
|
||||
if (attr) {
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER) && (curveParam<0 || curveParam>=CURVE_BASE)){
|
||||
s_curveChan = (curveParam<0 ? -curveParam-1 : curveParam-CURVE_BASE);
|
||||
s_currIdxSubMenu = (curveParam<0 ? -curveParam-1 : curveParam-CURVE_BASE);
|
||||
pushMenu(menuModelCurveOne);
|
||||
}
|
||||
else {
|
||||
@@ -482,7 +482,7 @@ void menuModelMixOne(event_t event)
|
||||
md2->swtch = editSwitch(COLUMN_X+MIXES_2ND_COLUMN, y, md2->swtch, attr, event);
|
||||
break;
|
||||
case MIX_FIELD_WARNING:
|
||||
drawFieldLabel(COLUMN_X+MIXES_2ND_COLUMN, y, STR_MIXWARNING);
|
||||
lcdDrawTextAlignedLeft(y, STR_MIXWARNING);
|
||||
if (md2->mixWarn)
|
||||
lcdDrawNumber(COLUMN_X+MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
|
||||
else
|
||||
@@ -524,7 +524,6 @@ void menuModelMixOne(event_t event)
|
||||
#define MIX_LINE_SWITCH_POS 16*FW
|
||||
#define MIX_LINE_DELAY_POS 19*FW+7
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
void onExpoMixMenu(const char *result)
|
||||
{
|
||||
bool expo = (menuHandlers[menuLevel] == menuModelExposAll);
|
||||
@@ -551,7 +550,6 @@ void onExpoMixMenu(const char *result)
|
||||
deleteExpoMix(expo, s_currIdx);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void displayMixInfos(coord_t y, MixData *md)
|
||||
{
|
||||
@@ -672,7 +670,6 @@ void menuModelExpoMix(uint8_t expo, event_t event)
|
||||
}
|
||||
else {
|
||||
if (s_copyMode) s_currCh = 0;
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
if (s_currCh) {
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
insertExpoMix(expo, s_currIdx);
|
||||
@@ -691,15 +688,6 @@ void menuModelExpoMix(uint8_t expo, event_t event)
|
||||
POPUP_MENU_ADD_ITEM(STR_DELETE);
|
||||
POPUP_MENU_START(onExpoMixMenu);
|
||||
}
|
||||
#else
|
||||
if (s_currCh) {
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
insertExpoMix(expo, s_currIdx);
|
||||
}
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
s_copyMode = 0;
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -235,7 +235,7 @@ void onLogicalSwitchesMenu(const char *result)
|
||||
pushMenu(menuModelLogicalSwitchOne);
|
||||
}
|
||||
#if defined(SDCARD)
|
||||
if (result == STR_COPY) {
|
||||
else if (result == STR_COPY) {
|
||||
|
||||
clipboard.type = CLIPBOARD_TYPE_CUSTOM_SWITCH;
|
||||
clipboard.data.csw = *cs;
|
||||
@@ -247,11 +247,13 @@ void onLogicalSwitchesMenu(const char *result)
|
||||
storageDirty(EE_MODEL);
|
||||
|
||||
}
|
||||
else if (result == STR_CLEAR) {
|
||||
else
|
||||
#endif
|
||||
if (result == STR_CLEAR) {
|
||||
memset(cs, 0, sizeof(LogicalSwitchData));
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void menuModelLogicalSwitches(event_t event)
|
||||
@@ -267,10 +269,11 @@ void menuModelLogicalSwitches(event_t event)
|
||||
LogicalSwitchData * cs = lswAddress(sub);
|
||||
if (cs->func)
|
||||
s_currIdx = sub;
|
||||
if (sub >= 0)
|
||||
POPUP_MENU_ADD_ITEM(STR_EDIT);
|
||||
#if defined(SDCARD)
|
||||
if (cs->func || cs->v1 || cs->v2 || cs->delay || cs->duration || cs->andsw)
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY);
|
||||
#if defined(SDCARD)
|
||||
if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_SWITCH)
|
||||
POPUP_MENU_ADD_ITEM(STR_PASTE);
|
||||
#endif
|
||||
@@ -279,7 +282,7 @@ void menuModelLogicalSwitches(event_t event)
|
||||
POPUP_MENU_START(onLogicalSwitchesMenu);
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
for (uint32_t i=0; i<LCD_LINES-1; i++) {
|
||||
y = 1 + (i+1)*FH;
|
||||
k = i + menuVerticalOffset;
|
||||
LogicalSwitchData * cs = lswAddress(k);
|
||||
|
||||
@@ -70,13 +70,13 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
|
||||
}
|
||||
lcdDrawSolidVerticalLine(x+gaugeWidth/2-1, y, gaugeHeight+1);
|
||||
if (barMin == -101) {
|
||||
for (uint8_t i=0; i<3; ++i) {
|
||||
for (uint32_t i=0; i<3; ++i) {
|
||||
lcdDrawPoint(x+i, y+4-i);
|
||||
lcdDrawPoint(x+3+i, y+4-i);
|
||||
}
|
||||
}
|
||||
if (barMax == 101) {
|
||||
for (uint8_t i=0; i<3; ++i) {
|
||||
for (uint32_t i=0; i<3; ++i) {
|
||||
lcdDrawPoint(x+gaugeWidth-8+i, y+4-i);
|
||||
lcdDrawPoint(x+gaugeWidth-5+i, y+4-i);
|
||||
}
|
||||
@@ -85,6 +85,17 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
|
||||
|
||||
void menuModelMixOne(event_t event)
|
||||
{
|
||||
#if defined(NAVIGATION_X7)
|
||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
||||
pushMenu(menuChannelsView);
|
||||
killEvents(event);
|
||||
}
|
||||
#elif defined(NAVIGATION_XLITE)
|
||||
if (event == EVT_KEY_LONG(KEY_SHIFT)) {
|
||||
pushMenu(menuChannelsView);
|
||||
killEvents(event);
|
||||
}
|
||||
#endif
|
||||
MixData * md2 = mixAddress(s_currIdx) ;
|
||||
putsChn(PSIZE(TR_MIXER)*FW+FW, 0, md2->destCh+1,0);
|
||||
|
||||
@@ -110,7 +121,7 @@ void menuModelMixOne(event_t event)
|
||||
break;
|
||||
|
||||
case MIX_FIELD_SOURCE:
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_SOURCE));
|
||||
lcdDrawTextAlignedLeft(y, STR_SOURCE);
|
||||
drawSource(MIXES_2ND_COLUMN, y, md2->srcRaw, STREXPANDED|attr);
|
||||
if (attr) CHECK_INCDEC_MODELSOURCE(event, md2->srcRaw, 1, MIXSRC_LAST);
|
||||
break;
|
||||
@@ -122,7 +133,7 @@ void menuModelMixOne(event_t event)
|
||||
|
||||
case MIX_FIELD_OFFSET:
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_OFFSET));
|
||||
lcdDrawTextAlignedLeft(y, STR_OFFSET);
|
||||
u_int8int16_t offset;
|
||||
MD_OFFSET_TO_UNION(md2, offset);
|
||||
offset.word = GVAR_MENU_ITEM(MIXES_2ND_COLUMN, y, offset.word, GV_RANGELARGE_OFFSET_NEG, GV_RANGELARGE_OFFSET, attr|LEFT, 0, event);
|
||||
@@ -154,7 +165,7 @@ void menuModelMixOne(event_t event)
|
||||
break;
|
||||
|
||||
case MIX_FIELD_WARNING:
|
||||
drawFieldLabel(MIXES_2ND_COLUMN, y, STR_MIXWARNING);
|
||||
lcdDrawTextAlignedLeft(y, STR_MIXWARNING);
|
||||
if (md2->mixWarn)
|
||||
lcdDrawNumber(MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
|
||||
else
|
||||
|
||||
@@ -33,14 +33,6 @@ enum MenuModelOutputsItems {
|
||||
ITEM_OUTPUTS_MAXROW = ITEM_OUTPUTS_COUNT-1
|
||||
};
|
||||
|
||||
#if defined(PPM_UNIT_US)
|
||||
#define LIMITS_MIN_POS 12*FW+1
|
||||
#define PREC_THRESHOLD 804
|
||||
#else
|
||||
#define LIMITS_MIN_POS 12*FW-2
|
||||
#define PREC_THRESHOLD 0
|
||||
#endif
|
||||
|
||||
#define LIMITS_OFFSET_POS 8*FW-1
|
||||
|
||||
#if defined(PPM_LIMITS_SYMETRICAL)
|
||||
@@ -70,14 +62,6 @@ enum MenuModelOutputsItems {
|
||||
#define CONVERT_US_MIN_MAX(x) ((int16_t(x)*128)/25)
|
||||
#define MIN_MAX_ATTR attr
|
||||
|
||||
#if defined(PPM_UNIT_US)
|
||||
#define SET_MIN_MAX(x, val) x = ((val)*250)/128
|
||||
#define MIN_MAX_DISPLAY(x) CONVERT_US_MIN_MAX(x)
|
||||
#else
|
||||
#define MIN_MAX_DISPLAY(x) (x)
|
||||
#define SET_MIN_MAX(x, val) x = (val)
|
||||
#endif
|
||||
|
||||
enum MenuModelOutputsOneItems {
|
||||
ITEM_OUTPUTONE_CH_NAME,
|
||||
ITEM_OUTPUTONE_OFFSET,
|
||||
@@ -96,6 +80,13 @@ enum MenuModelOutputsOneItems {
|
||||
|
||||
#define LIMITS_ONE_2ND_COLUMN (13*FW)
|
||||
|
||||
int32_t minMaxDisplay(int32_t val)
|
||||
{
|
||||
if (g_eeGeneral.ppmunit == PPM_US)
|
||||
val = CONVERT_US_MIN_MAX(val);
|
||||
return val;
|
||||
}
|
||||
|
||||
void menuModelLimitsOne(event_t event)
|
||||
{
|
||||
TITLE(STR_MENULIMITS);
|
||||
@@ -132,7 +123,7 @@ void menuModelLimitsOne(event_t event)
|
||||
ld->min = GVAR_MENU_ITEM(LIMITS_ONE_2ND_COLUMN, y, ld->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, attr|PREC1, 0, event);
|
||||
break;
|
||||
}
|
||||
lcdDrawNumber(LIMITS_ONE_2ND_COLUMN, y, MIN_MAX_DISPLAY(ld->min-LIMITS_MIN_MAX_OFFSET), attr|PREC1);
|
||||
lcdDrawNumber(LIMITS_ONE_2ND_COLUMN, y, minMaxDisplay(ld->min-LIMITS_MIN_MAX_OFFSET), attr|PREC1);
|
||||
if (active) {
|
||||
ld->min = LIMITS_MIN_MAX_OFFSET + checkIncDec(event, ld->min-LIMITS_MIN_MAX_OFFSET, -limit, 0, EE_MODEL, NULL, stops1000);
|
||||
}
|
||||
@@ -144,7 +135,7 @@ void menuModelLimitsOne(event_t event)
|
||||
ld->max = GVAR_MENU_ITEM(LIMITS_ONE_2ND_COLUMN, y, ld->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, attr|PREC1, 0, event);
|
||||
break;
|
||||
}
|
||||
lcdDrawNumber(LIMITS_ONE_2ND_COLUMN, y, MIN_MAX_DISPLAY(ld->max+LIMITS_MIN_MAX_OFFSET), attr|PREC1);
|
||||
lcdDrawNumber(LIMITS_ONE_2ND_COLUMN, y, minMaxDisplay(ld->max+LIMITS_MIN_MAX_OFFSET), attr|PREC1);
|
||||
if (active) {
|
||||
ld->max = -LIMITS_MIN_MAX_OFFSET + checkIncDec(event, ld->max+LIMITS_MIN_MAX_OFFSET, 0, +limit, EE_MODEL, NULL, stops1000);
|
||||
}
|
||||
@@ -228,13 +219,14 @@ void menuModelLimits(event_t event)
|
||||
|
||||
SIMPLE_MENU(STR_MENULIMITS, menuTabModel, MENU_MODEL_OUTPUTS, HEADER_LINE+MAX_OUTPUT_CHANNELS+1);
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
for (uint32_t i=0; i<LCD_LINES-1; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i+menuVerticalOffset;
|
||||
LcdFlags attr = (sub==MAX_OUTPUT_CHANNELS) ? INVERS : 0;
|
||||
|
||||
if (sub==k && event==EVT_KEY_FIRST(KEY_ENTER) && !READ_ONLY() && (k != MAX_OUTPUT_CHANNELS) ) {
|
||||
killEvents(event);
|
||||
s_editMode = 0;
|
||||
POPUP_MENU_ADD_ITEM(STR_EDIT);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_TRIMS_TO_OFS);
|
||||
@@ -265,39 +257,42 @@ void menuModelLimits(event_t event)
|
||||
lcdDrawSizedText(0, y, ld->name, sizeof(ld->name), ((sub==k) ? INVERS : 0) | ZCHAR | LEFT);
|
||||
}
|
||||
|
||||
coord_t limitsMinPos = (g_eeGeneral.ppmunit == PPM_US) ? 12*FW+1 : 12*FW-2;
|
||||
int precThreshold = (g_eeGeneral.ppmunit == PPM_US) ? 804 : 0;
|
||||
|
||||
for (uint8_t j=0; j<ITEM_OUTPUTS_COUNT; j++) {
|
||||
switch (j) {
|
||||
case ITEM_OUTPUTS_OFFSET:
|
||||
#if defined(PPM_UNIT_US)
|
||||
lcdDrawNumber(LIMITS_OFFSET_POS, y, ((int32_t)ld->offset*128) / 25, PREC1|RIGHT);
|
||||
#else
|
||||
if (g_eeGeneral.ppmunit == PPM_US) {
|
||||
lcdDrawNumber(LIMITS_OFFSET_POS, y, ((int32_t)ld->offset*128) / 25, PREC1|RIGHT);
|
||||
} else {
|
||||
#if defined(GVARS)
|
||||
if (GV_IS_GV_VALUE(ld->offset, -GV_RANGELARGE, GV_RANGELARGE)) {
|
||||
drawGVarName(LIMITS_OFFSET_POS, y, ld->offset, attr|PREC1|RIGHT);
|
||||
break;
|
||||
}
|
||||
if (GV_IS_GV_VALUE(ld->offset, -GV_RANGELARGE, GV_RANGELARGE)) {
|
||||
drawGVarName(LIMITS_OFFSET_POS, y, ld->offset, attr|PREC1|RIGHT);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (abs(ld->offset) >= 1000) {
|
||||
lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset/10, RIGHT);
|
||||
if (abs(ld->offset) >= 1000) {
|
||||
lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset/10, RIGHT);
|
||||
}
|
||||
else {
|
||||
lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset, PREC1|RIGHT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset, PREC1|RIGHT);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ITEM_OUTPUTS_MIN:
|
||||
#if defined(GVARS)
|
||||
if (GV_IS_GV_VALUE(ld->min, -GV_RANGELARGE, GV_RANGELARGE)) {
|
||||
drawGVarName(LIMITS_MIN_POS, y, ld->min, attr|PREC1|RIGHT);
|
||||
drawGVarName(limitsMinPos, y, ld->min, attr|PREC1|RIGHT);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (ld->min <= PREC_THRESHOLD) {
|
||||
lcdDrawNumber(LIMITS_MIN_POS, y, MIN_MAX_DISPLAY(ld->min-LIMITS_MIN_MAX_OFFSET)/10, RIGHT);
|
||||
if (ld->min <= precThreshold) {
|
||||
lcdDrawNumber(limitsMinPos, y, minMaxDisplay(ld->min-LIMITS_MIN_MAX_OFFSET)/10, RIGHT);
|
||||
}
|
||||
else {
|
||||
lcdDrawNumber(LIMITS_MIN_POS, y, MIN_MAX_DISPLAY(ld->min-LIMITS_MIN_MAX_OFFSET), attr|PREC1|RIGHT);
|
||||
lcdDrawNumber(limitsMinPos, y, minMaxDisplay(ld->min-LIMITS_MIN_MAX_OFFSET), attr|PREC1|RIGHT);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -308,11 +303,11 @@ void menuModelLimits(event_t event)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (ld->max >= -PREC_THRESHOLD) {
|
||||
lcdDrawNumber(LIMITS_MAX_POS, y, MIN_MAX_DISPLAY(ld->max+LIMITS_MIN_MAX_OFFSET)/10, RIGHT);
|
||||
if (ld->max >= -precThreshold) {
|
||||
lcdDrawNumber(LIMITS_MAX_POS, y, minMaxDisplay(ld->max+LIMITS_MIN_MAX_OFFSET)/10, RIGHT);
|
||||
}
|
||||
else {
|
||||
lcdDrawNumber(LIMITS_MAX_POS, y, MIN_MAX_DISPLAY(ld->max+LIMITS_MIN_MAX_OFFSET), attr|PREC1|RIGHT);
|
||||
lcdDrawNumber(LIMITS_MAX_POS, y, minMaxDisplay(ld->max+LIMITS_MIN_MAX_OFFSET), attr|PREC1|RIGHT);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#define MODELSEL_W LCD_W
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
void onModelSelectMenu(const char * result)
|
||||
{
|
||||
int8_t sub = menuVerticalPosition;
|
||||
@@ -56,7 +55,7 @@ void onModelSelectMenu(const char * result)
|
||||
SET_WARNING_INFO(modelHeaders[sub].name, sizeof(g_model.header.name), ZCHAR);
|
||||
}
|
||||
#if defined(SDCARD)
|
||||
else {
|
||||
else if (result != STR_EXIT) {
|
||||
// The user choosed a file on SD to restore
|
||||
storageCheck(true);
|
||||
POPUP_WARNING(eeRestoreModel(sub, (char *)result));
|
||||
@@ -66,7 +65,6 @@ void onModelSelectMenu(const char * result)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuModelSelect(event_t event)
|
||||
{
|
||||
@@ -199,7 +197,6 @@ void menuModelSelect(event_t event)
|
||||
else if (event == EVT_KEY_LONG(KEY_ENTER) || IS_ROTARY_BREAK(event)) {
|
||||
s_copyMode = 0;
|
||||
killEvents(event);
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
if (eeModelExists(sub)) {
|
||||
POPUP_MENU_ADD_ITEM(STR_SELECT_MODEL);
|
||||
@@ -223,11 +220,6 @@ void menuModelSelect(event_t event)
|
||||
POPUP_MENU_ADD_ITEM(STR_MOVE_MODEL);
|
||||
}
|
||||
POPUP_MENU_START(onModelSelectMenu);
|
||||
#else
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
selectModel(sub);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (eeModelExists(sub)) {
|
||||
s_copyMode = (s_copyMode == COPY_MODE ? MOVE_MODE : COPY_MODE);
|
||||
@@ -250,13 +242,21 @@ void menuModelSelect(event_t event)
|
||||
case EVT_ROTARY_LEFT:
|
||||
case EVT_ROTARY_RIGHT:
|
||||
#endif
|
||||
#if defined(PCBI6X)
|
||||
case EVT_KEY_BREAK(KEY_RIGHT):
|
||||
case EVT_KEY_LONG(KEY_RIGHT):
|
||||
#else
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
#endif
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
if ((!IS_ROTARY_RIGHT(event) && !IS_ROTARY_LEFT(event)) || s_editMode < 0) {
|
||||
#endif
|
||||
if (sub == g_eeGeneral.currModel) {
|
||||
chainMenu((IS_ROTARY_RIGHT(event) || event == EVT_KEY_FIRST(KEY_RIGHT)) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
|
||||
chainMenu((IS_ROTARY_RIGHT(event) || event == EVT_KEY_BREAK(KEY_RIGHT)) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
|
||||
if (event == EVT_KEY_LONG(KEY_RIGHT)) {
|
||||
killEvents(event);
|
||||
}
|
||||
}
|
||||
else {
|
||||
AUDIO_WARNING2();
|
||||
@@ -319,7 +319,7 @@ void menuModelSelect(event_t event)
|
||||
|
||||
TITLE(STR_MENUMODELSEL);
|
||||
|
||||
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i+menuVerticalOffset;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
uint8_t g_moduleIdx;
|
||||
void menuModelFailsafe(event_t event);
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
uint8_t getSwitchWarningsCount()
|
||||
{
|
||||
int count = 0;
|
||||
@@ -61,7 +61,9 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_THROTTLE_TRACE,
|
||||
ITEM_MODEL_THROTTLE_TRIM,
|
||||
ITEM_MODEL_PREFLIGHT_LABEL,
|
||||
#if !defined(PCBI6X)
|
||||
ITEM_MODEL_CHECKLIST_DISPLAY,
|
||||
#endif
|
||||
ITEM_MODEL_THROTTLE_WARNING,
|
||||
ITEM_MODEL_SWITCHES_WARNING,
|
||||
#if defined(PCBTARANIS)
|
||||
@@ -70,10 +72,10 @@ enum MenuModelSetupItems {
|
||||
#endif
|
||||
ITEM_MODEL_BEEP_CENTER,
|
||||
ITEM_MODEL_USE_GLOBAL_FUNCTIONS,
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
ITEM_MODEL_INTERNAL_MODULE_LABEL,
|
||||
ITEM_MODEL_INTERNAL_MODULE_MODE,
|
||||
#if defined(PCBI6)
|
||||
#if defined(PCBI6X)
|
||||
ITEM_MODEL_INTERNAL_MODULE_SUBTYPE,
|
||||
ITEM_MODEL_INTERNAL_MODULE_SERVOFREQ,
|
||||
#else
|
||||
@@ -87,6 +89,10 @@ enum MenuModelSetupItems {
|
||||
#endif
|
||||
ITEM_MODEL_EXTERNAL_MODULE_LABEL,
|
||||
ITEM_MODEL_EXTERNAL_MODULE_MODE,
|
||||
#if defined(CROSSFIRE)
|
||||
ITEM_MODEL_SETUP_EXTERNAL_MODULE_ARMING_MODE,
|
||||
ITEM_MODEL_SETUP_EXTERNAL_MODULE_ARMING_TRIGGER,
|
||||
#endif
|
||||
#if defined(MULTIMODULE)
|
||||
ITEM_MODEL_EXTERNAL_MODULE_SUBTYPE,
|
||||
ITEM_MODEL_EXTERNAL_MODULE_STATUS,
|
||||
@@ -94,56 +100,46 @@ enum MenuModelSetupItems {
|
||||
#endif
|
||||
ITEM_MODEL_EXTERNAL_MODULE_CHANNELS,
|
||||
ITEM_MODEL_EXTERNAL_MODULE_BIND,
|
||||
#if defined(PCBSKY9X) && defined(REVX)
|
||||
ITEM_MODEL_EXTERNAL_MODULE_OUTPUT_TYPE,
|
||||
#endif
|
||||
ITEM_MODEL_EXTERNAL_MODULE_OPTIONS,
|
||||
#if defined(MULTIMODULE)
|
||||
ITEM_MODEL_EXTERNAL_MODULE_AUTOBIND,
|
||||
#endif
|
||||
ITEM_MODEL_EXTERNAL_MODULE_POWER,
|
||||
#if defined(PCBSKY9X) && !defined(REVA)
|
||||
ITEM_MODEL_EXTRA_MODULE_LABEL,
|
||||
ITEM_MODEL_EXTRA_MODULE_CHANNELS,
|
||||
ITEM_MODEL_EXTRA_MODULE_BIND,
|
||||
#endif
|
||||
ITEM_MODEL_EXTERNAL_MODULE_FAILSAFE,
|
||||
#if defined(PCBX7)
|
||||
#if defined(SBUS_TRAINER)
|
||||
ITEM_MODEL_TRAINER_LABEL,
|
||||
ITEM_MODEL_TRAINER_MODE,
|
||||
#endif
|
||||
#if defined(PCBX7) || defined(PCBX3)
|
||||
#if defined(BLUETOOTH)
|
||||
ITEM_MODEL_TRAINER_BLUETOOTH,
|
||||
#endif
|
||||
ITEM_MODEL_TRAINER_CHANNELS,
|
||||
ITEM_MODEL_TRAINER_PARAMS,
|
||||
#elif defined(PCBXLITE)
|
||||
ITEM_MODEL_TRAINER_LABEL,
|
||||
ITEM_MODEL_TRAINER_MODE,
|
||||
ITEM_MODEL_TRAINER_BLUETOOTH,
|
||||
ITEM_MODEL_TRAINER_CHANNELS,
|
||||
#endif
|
||||
ITEM_MODEL_SETUP_MAX
|
||||
};
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
#define FIELD_PROTOCOL_MAX 2
|
||||
#else
|
||||
#define FIELD_PROTOCOL_MAX 1
|
||||
#endif
|
||||
|
||||
#define MODEL_SETUP_2ND_COLUMN (LCD_W-11*FW)
|
||||
#define MODEL_SETUP_BIND_OFS 2*FW+1
|
||||
#define MODEL_SETUP_RANGE_OFS 4*FW+3
|
||||
#define MODEL_SETUP_SET_FAILSAFE_OFS 7*FW-2
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(SBUS_TRAINER)
|
||||
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_TRAINER_LABEL ? TRAINER_MODULE : (k>=ITEM_MODEL_EXTERNAL_MODULE_LABEL ? EXTERNAL_MODULE : INTERNAL_MODULE))
|
||||
#elif defined(PCBSKY9X) && !defined(REVA)
|
||||
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_EXTRA_MODULE_LABEL ? EXTRA_MODULE : EXTERNAL_MODULE)
|
||||
#elif defined(PCBI6)
|
||||
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_EXTERNAL_MODULE_LABEL ? EXTERNAL_MODULE : INTERNAL_MODULE)
|
||||
#else
|
||||
#define CURRENT_MODULE_EDITED(k) (EXTERNAL_MODULE)
|
||||
#define CURRENT_MODULE_EDITED(k) (k>=ITEM_MODEL_EXTERNAL_MODULE_LABEL ? EXTERNAL_MODULE : INTERNAL_MODULE)
|
||||
#endif
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
#define IF_MODULE_ARMED(module, xxx) (CRSF_ELRS_MIN_VER(4, 0) ? (uint8_t)(xxx) : HIDDEN_ROW)
|
||||
#define IF_MODULE_ARMED_TRIGGER(module, xxx) ((CRSF_ELRS_MIN_VER(4, 0) && g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingMode) ? (uint8_t)(xxx) : HIDDEN_ROW)
|
||||
#else
|
||||
#define IF_MODULE_ARMED(module, xxx)
|
||||
#define IF_MODULE_ARMED_TRIGGER(module, xxx)
|
||||
#endif
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
@@ -151,7 +147,7 @@ enum MenuModelSetupItems {
|
||||
#else
|
||||
#define SW_WARN_ROWS uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1)), uint8_t(getSwitchWarningsCount() > 5 ? TITLE_ROW : HIDDEN_ROW)
|
||||
#endif
|
||||
#if !defined(TARANIS_INTERNAL_PPM) && !defined(PCBI6)
|
||||
#if !defined(TARANIS_INTERNAL_PPM) && !defined(PCBI6X)
|
||||
#define INTERNAL_MODULE_MODE_ROWS 0 // (OFF / RF protocols)
|
||||
#else
|
||||
#define INTERNAL_MODULE_MODE_ROWS (isModuleXJT(INTERNAL_MODULE)||isModuleA7105(INTERNAL_MODULE) ? (uint8_t)1 : (uint8_t)0) // Module type + RF protocols
|
||||
@@ -159,13 +155,10 @@ enum MenuModelSetupItems {
|
||||
#define IF_INTERNAL_MODULE_ON(x) (IS_INTERNAL_MODULE_ENABLED()? (uint8_t)(x) : HIDDEN_ROW)
|
||||
#define IF_EXTERNAL_MODULE_ON(x) (IS_EXTERNAL_MODULE_ENABLED()? (uint8_t)(x) : HIDDEN_ROW)
|
||||
#define INTERNAL_MODULE_CHANNELS_ROWS IF_INTERNAL_MODULE_ON(1)
|
||||
#define EXTERNAL_MODULE_BIND_ROWS() ((isModuleXJT(EXTERNAL_MODULE) && IS_D8_RX(EXTERNAL_MODULE)) || isModuleSBUS(EXTERNAL_MODULE)) ? (uint8_t)1 : (isModulePPM(EXTERNAL_MODULE) || isModulePXX(EXTERNAL_MODULE) || isModuleDSM2(EXTERNAL_MODULE) || isModuleMultimodule(EXTERNAL_MODULE)) ? (uint8_t)2 : HIDDEN_ROW
|
||||
#define EXTERNAL_MODULE_BIND_ROWS() ((isModuleXJT(EXTERNAL_MODULE) && IS_D8_RX(EXTERNAL_MODULE)) || isModuleSBUS(EXTERNAL_MODULE)) ? (uint8_t)1 : (isModulePPM(EXTERNAL_MODULE) || isModulePXX(EXTERNAL_MODULE) || isModuleDSM2(EXTERNAL_MODULE) || isModuleMultimodule(EXTERNAL_MODULE)) ? (uint8_t)2 : (isModuleCrossfire(EXTERNAL_MODULE)) ? (uint8_t)0 : HIDDEN_ROW
|
||||
|
||||
#if defined(PCBSKY9X) && defined(REVX)
|
||||
#define OUTPUT_TYPE_ROWS() (isModulePPM(EXTERNAL_MODULE) ? (uint8_t)0 : HIDDEN_ROW) ,
|
||||
#else
|
||||
#define OUTPUT_TYPE_ROWS()
|
||||
#endif
|
||||
|
||||
#define PORT_CHANNELS_ROWS(x) (x==EXTERNAL_MODULE ? EXTERNAL_MODULE_CHANNELS_ROWS : 0)
|
||||
|
||||
#define EXTERNAL_MODULE_MODE_ROWS (isModulePXX(EXTERNAL_MODULE) || isModuleDSM2(EXTERNAL_MODULE) || isModuleMultimodule(EXTERNAL_MODULE) || isModuleCrossfire(EXTERNAL_MODULE)) ? (uint8_t)1 : (uint8_t)0
|
||||
@@ -175,11 +168,7 @@ enum MenuModelSetupItems {
|
||||
#define POT_WARN_ITEMS() ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0)
|
||||
#define TIMER_ROWS(x) 2, 0, 0, 0, g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 : (uint8_t)0
|
||||
#define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2)
|
||||
#if defined(PCBSKY9X) && !defined(REVA)
|
||||
#define EXTRA_MODULE_ROWS LABEL(ExtraModule), 1, 2,
|
||||
#else
|
||||
#define EXTRA_MODULE_ROWS
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7)
|
||||
#define ANTENNA_ROW
|
||||
@@ -191,8 +180,10 @@ enum MenuModelSetupItems {
|
||||
#define TRAINER_BLUETOOTH_ROW
|
||||
#endif
|
||||
#define TRAINER_CHANNELS_ROW (IS_SLAVE_TRAINER() ? (uint8_t)1 : HIDDEN_ROW)
|
||||
#define TRAINER_PARAMS_ROW (IS_SLAVE_TRAINER() ? (uint8_t)2 : HIDDEN_ROW)
|
||||
#define TRAINER_PARAMS_ROW (g_model.trainerData.mode == TRAINER_MODE_SLAVE ? (uint8_t)2 : HIDDEN_ROW)
|
||||
#define TRAINER_ROWS LABEL(Trainer), 0, TRAINER_BLUETOOTH_ROW TRAINER_CHANNELS_ROW, TRAINER_PARAMS_ROW
|
||||
#elif defined(PCBI6X)
|
||||
#define TRAINER_ROWS LABEL(Trainer), 0, HIDDEN_ROW, HIDDEN_ROW
|
||||
#elif defined(PCBXLITE)
|
||||
#define ANTENNA_ROW IF_INTERNAL_MODULE_ON(0),
|
||||
#define IF_BT_TRAINER_ON(x) (g_eeGeneral.bluetoothMode == BLUETOOTH_TRAINER ? (uint8_t)(x) : HIDDEN_ROW)
|
||||
@@ -226,6 +217,7 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
void onBindMenu(const char * result)
|
||||
{
|
||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(menuVerticalPosition);
|
||||
@@ -250,8 +242,9 @@ void onBindMenu(const char * result)
|
||||
return;
|
||||
}
|
||||
|
||||
moduleFlag[moduleIdx] = MODULE_BIND;
|
||||
moduleState[moduleIdx].mode = MODULE_MODE_BIND;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void menuModelSetup(event_t event)
|
||||
@@ -265,6 +258,7 @@ void menuModelSetup(event_t event)
|
||||
#endif
|
||||
|
||||
int8_t old_editMode = s_editMode;
|
||||
int8_t old_posHorz = menuHorizontalPosition;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
MENU_TAB({
|
||||
@@ -322,17 +316,17 @@ void menuModelSetup(event_t event)
|
||||
0, // Throttle trim
|
||||
// 0, // Throttle trim switch
|
||||
LABEL(PreflightCheck),
|
||||
0,
|
||||
// 0, // Checklist
|
||||
0,
|
||||
NUM_SWITCHES-1,
|
||||
NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_ROTARY_ENCODERS-1,
|
||||
0,
|
||||
LABEL(InternalModule),
|
||||
INTERNAL_MODULE_MODE_ROWS,
|
||||
#if !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
INTERNAL_MODULE_CHANNELS_ROWS,
|
||||
#endif
|
||||
#if defined(PCBI6)
|
||||
#if defined(PCBI6X)
|
||||
IF_INTERNAL_MODULE_ON(1), // Subtype
|
||||
IF_INTERNAL_MODULE_ON(1), // Servo Freq
|
||||
#endif
|
||||
@@ -340,6 +334,8 @@ void menuModelSetup(event_t event)
|
||||
IF_INTERNAL_MODULE_ON(FAILSAFE_ROWS(INTERNAL_MODULE)),
|
||||
LABEL(ExternalModule),
|
||||
EXTERNAL_MODULE_MODE_ROWS,
|
||||
IF_MODULE_ARMED(EXTERNAL_MODULE, 0), /* Arming Mode */
|
||||
IF_MODULE_ARMED_TRIGGER(EXTERNAL_MODULE, 0), /* Arming TRIGGER */
|
||||
MULTIMODULE_SUBTYPE_ROWS(EXTERNAL_MODULE)
|
||||
MULTIMODULE_STATUS_ROWS
|
||||
EXTERNAL_MODULE_CHANNELS_ROWS,
|
||||
@@ -357,23 +353,25 @@ void menuModelSetup(event_t event)
|
||||
|
||||
#if (defined(DSM2) || defined(PXX))
|
||||
if (menuEvent) {
|
||||
moduleFlag[0] = 0;
|
||||
moduleState[0].mode = 0;
|
||||
#if NUM_MODULES > 1
|
||||
moduleFlag[1] = 0;
|
||||
moduleState[1].mode = 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
TITLE(STR_MENUSETUP);
|
||||
|
||||
#if defined(PXX)
|
||||
if (event == EVT_ENTRY) {
|
||||
reusableBuffer.modelsetup.r9mPower = g_model.moduleData[EXTERNAL_MODULE].pxx.power;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
int8_t editMode = s_editMode;
|
||||
|
||||
for (uint8_t i=0; i<NUM_BODY_LINES; ++i) {
|
||||
for (uint32_t i=0; i<NUM_BODY_LINES; ++i) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i + menuVerticalOffset;
|
||||
for (int j=0; j<=k; j++) {
|
||||
@@ -429,7 +427,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
case 2:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
|
||||
timer->start -= qr.rem ;
|
||||
timer->start -= qr.rem;
|
||||
if ((int16_t)timer->start < 0) timer->start=0;
|
||||
if ((int16_t)timer->start > 5999) timer->start=32399; // 8:59:59
|
||||
break;
|
||||
@@ -484,7 +482,7 @@ void menuModelSetup(event_t event)
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
START_NO_HIGHLIGHT();
|
||||
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
|
||||
for (uint32_t i=0; i<MAX_FLIGHT_MODES; i++) {
|
||||
memclear(&g_model.flightModeData[i], TRIMS_ARRAY_SIZE);
|
||||
}
|
||||
storageDirty(EE_MODEL);
|
||||
@@ -525,11 +523,11 @@ void menuModelSetup(event_t event)
|
||||
case ITEM_MODEL_PREFLIGHT_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_PREFLIGHT);
|
||||
break;
|
||||
|
||||
#if !defined(PCBI6X)
|
||||
case ITEM_MODEL_CHECKLIST_DISPLAY:
|
||||
ON_OFF_MENU_ITEM(g_model.displayChecklist, MODEL_SETUP_2ND_COLUMN, y, STR_CHECKLIST, attr, event);
|
||||
break;
|
||||
|
||||
#endif
|
||||
case ITEM_MODEL_THROTTLE_WARNING:
|
||||
g_model.disableThrottleWarning = !editCheckBox(!g_model.disableThrottleWarning, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEWARNING, attr, event);
|
||||
break;
|
||||
@@ -546,7 +544,7 @@ void menuModelSetup(event_t event)
|
||||
#endif
|
||||
|
||||
case ITEM_MODEL_SWITCHES_WARNING:
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
{
|
||||
#define FIRSTSW_STR STR_VSRCRAW+(MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1)*length
|
||||
uint8_t length = STR_VSRCRAW[0];
|
||||
@@ -581,7 +579,10 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
if (menuHorizontalPosition < 0 || menuHorizontalPosition >= NUM_SWITCHES) {
|
||||
#if !defined(PCBI6X)
|
||||
if (menuHorizontalPosition < 0 || menuHorizontalPosition >= NUM_SWITCHES)
|
||||
#endif
|
||||
{
|
||||
START_NO_HIGHLIGHT();
|
||||
getMovedSwitch();
|
||||
g_model.switchWarningState = switches_states;
|
||||
@@ -594,13 +595,11 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
}
|
||||
|
||||
LcdFlags line = attr;
|
||||
|
||||
int current = 0;
|
||||
for (int i=0; i<NUM_SWITCHES; i++) {
|
||||
for (int i = 0; i < NUM_SWITCHES; i++) {
|
||||
if (SWITCH_WARNING_ALLOWED(i)) {
|
||||
div_t qr = div(current, 5);
|
||||
if (!READ_ONLY() && event==EVT_KEY_BREAK(KEY_ENTER) && line && l_posHorz==current) {
|
||||
if (!READ_ONLY() && event==EVT_KEY_BREAK(KEY_ENTER) && attr && l_posHorz == current && old_posHorz >= 0) {
|
||||
g_model.switchWarningEnable ^= (1 << i);
|
||||
storageDirty(EE_MODEL);
|
||||
#if defined(PCBXLITE)
|
||||
@@ -609,14 +608,14 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
uint8_t swactive = !(g_model.switchWarningEnable & (1<<i));
|
||||
c = "\300-\301"[states & 0x03];
|
||||
//lcdDrawChar(MODEL_SETUP_2ND_COLUMN+qr.rem*(2*FW+1), y+FH*qr.quot, 'A'+i, line && (menuHorizontalPosition==current) ? INVERS : 0);
|
||||
lcdDrawSizedText(MODEL_SETUP_2ND_COLUMN + qr.rem*((2*FW)+1), y+FH*qr.quot, FIRSTSW_STR+(i*length)+3, 1, line && (menuHorizontalPosition==current) ? INVERS : 0);
|
||||
// lcdDrawChar(MODEL_SETUP_2ND_COLUMN+qr.rem*(2*FW+1), y+FH*qr.quot, 'A'+i, attr && (menuHorizontalPosition==current) ? INVERS : 0);
|
||||
lcdDrawSizedText(MODEL_SETUP_2ND_COLUMN + qr.rem*((2*FW)+1), y+FH*qr.quot, FIRSTSW_STR+(i*length)+3, 1, attr && (menuHorizontalPosition==current) ? INVERS : 0);
|
||||
if (swactive) lcdDrawChar(lcdNextPos, y+FH*qr.quot, c);
|
||||
++current;
|
||||
}
|
||||
states >>= 2;
|
||||
}
|
||||
if (attr && ((menuHorizontalPosition < 0) || menuHorizontalPosition >= NUM_SWITCHES)) {
|
||||
if (attr && (/*(menuHorizontalPosition < 0) ||*/ menuHorizontalPosition >= NUM_SWITCHES)) {
|
||||
lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 8*(2*FW+1), 1+FH*((current+4)/5));
|
||||
}
|
||||
#else //PCBTARANIS
|
||||
@@ -649,9 +648,8 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
}
|
||||
}
|
||||
LcdFlags line = attr;
|
||||
|
||||
for (uint8_t i=0; i<NUM_SWITCHES-1/*not on TRN switch*/; i++) {
|
||||
for (uint32_t i=0; i<NUM_SWITCHES-1/*not on TRN switch*/; i++) {
|
||||
uint8_t swactive = !(g_model.switchWarningEnable & 1 << i);
|
||||
attr = 0;
|
||||
|
||||
@@ -665,11 +663,11 @@ void menuModelSetup(event_t event)
|
||||
c = *(STR_VSWITCHES - 2 + 9 + (3*(i+1)));
|
||||
states >>= 1;
|
||||
}
|
||||
if (line && (menuHorizontalPosition == i)) {
|
||||
if (attr && (menuHorizontalPosition == i)) {
|
||||
attr = BLINK | INVERS;
|
||||
}
|
||||
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+i*FW, y, (swactive) ? c : '-', attr);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+(NUM_SWITCHES*FW), y, "<]", (menuHorizontalPosition == NUM_SWITCHES-1 && !NO_HIGHLIGHT()) ? line : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+(NUM_SWITCHES*FW), y, "<]", (menuHorizontalPosition == NUM_SWITCHES-1 && !NO_HIGHLIGHT()) ? attr : 0);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
@@ -725,7 +723,7 @@ void menuModelSetup(event_t event)
|
||||
|
||||
case ITEM_MODEL_BEEP_CENTER:
|
||||
lcdDrawTextAlignedLeft(y, STR_BEEPCTR);
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_ROTARY_ENCODERS; i++) {
|
||||
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS+NUM_ROTARY_ENCODERS; i++) {
|
||||
// TODO flash saving, \001 not needed in STR_RETA123
|
||||
coord_t x = MODEL_SETUP_2ND_COLUMN+i*FW;
|
||||
lcdDrawTextAtIndex(x, y, STR_RETA123, i, ((menuHorizontalPosition==i) && attr) ? BLINK|INVERS : (((g_model.beepANACenter & ((BeepANACenter)1<<i)) || (attr && CURSOR_ON_LINE())) ? INVERS : 0 ) );
|
||||
@@ -747,14 +745,14 @@ void menuModelSetup(event_t event)
|
||||
if (attr) g_model.noGlobalFunctions = !checkIncDecModel(event, !g_model.noGlobalFunctions, 0, 1);
|
||||
break;
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, TR_INTERNALRF);
|
||||
break;
|
||||
#endif
|
||||
#if defined(PCBTARANIS)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[0].rfProtocol, attr);
|
||||
if (attr) {
|
||||
g_model.moduleData[INTERNAL_MODULE].rfProtocol = checkIncDec(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, RF_PROTO_OFF, RF_PROTO_LAST, EE_MODEL, isRfProtocolAvailable);
|
||||
@@ -768,32 +766,25 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if defined(PCBI6)
|
||||
#if defined(PCBI6X)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
lcdDrawTextAtIndex(
|
||||
MODEL_SETUP_2ND_COLUMN,
|
||||
y,
|
||||
STR_I6X_PROTOCOLS,
|
||||
1+g_model.moduleData[INTERNAL_MODULE].rfProtocol,
|
||||
attr);
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_I6X_PROTOCOLS, 1+g_model.moduleData[INTERNAL_MODULE].rfProtocol, attr);
|
||||
if (attr) {
|
||||
g_model.moduleData[INTERNAL_MODULE].rfProtocol =
|
||||
checkIncDec(event,
|
||||
g_model.moduleData[INTERNAL_MODULE].rfProtocol,
|
||||
RF_I6X_PROTO_OFF,
|
||||
RF_I6X_PROTO_LAST,
|
||||
EE_MODEL,
|
||||
isRfProtocolAvailable);
|
||||
checkIncDec(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, RF_I6X_PROTO_OFF, RF_I6X_PROTO_LAST, EE_MODEL, isRfProtocolAvailable);
|
||||
if (checkIncDec_Ret) { // modified?
|
||||
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_AFHDS2A_SPI;
|
||||
g_model.moduleData[INTERNAL_MODULE].channelsStart = 0;
|
||||
g_model.moduleData[INTERNAL_MODULE].channelsCount = MAX_OUTPUT_CHANNELS - 8; // 16
|
||||
g_model.moduleData[INTERNAL_MODULE].afhds2a.servoFreq = 50;
|
||||
if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF){
|
||||
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ITEM_MODEL_INTERNAL_MODULE_SUBTYPE:
|
||||
case ITEM_MODEL_INTERNAL_MODULE_SUBTYPE:
|
||||
lcdDrawTextAlignedLeft(y, INDENT "Subtype");
|
||||
lcdDrawTextAtIndex(
|
||||
MODEL_SETUP_2ND_COLUMN,
|
||||
@@ -812,28 +803,24 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
break;
|
||||
case ITEM_MODEL_INTERNAL_MODULE_SERVOFREQ:
|
||||
lcdDrawTextAlignedLeft(y, INDENT "Servo freq");
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, g_model.moduleData[INTERNAL_MODULE].servoFreq, attr|LEADING0|LEFT, 3);
|
||||
lcdDrawTextAlignedLeft(y, INDENT "Servo rate");
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, g_model.moduleData[INTERNAL_MODULE].afhds2a.servoFreq, attr|LEFT);
|
||||
// lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[INTERNAL_MODULE].servoFreq, 50, 400);
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[INTERNAL_MODULE].afhds2a.servoFreq, 50, 400);
|
||||
}
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
case ITEM_MODEL_EXTRA_MODULE_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, "RF Port 2 (PPM)");
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, TR_EXTERNALRF);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].type, menuHorizontalPosition==0 ? attr : 0);
|
||||
#if !defined(PCBI6X)
|
||||
if (isModuleXJT(EXTERNAL_MODULE))
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, menuHorizontalPosition==1 ? attr : 0);
|
||||
else if (isModuleDSM2(EXTERNAL_MODULE))
|
||||
@@ -841,6 +828,7 @@ void menuModelSetup(event_t event)
|
||||
else if (isModuleR9M(EXTERNAL_MODULE)){
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_R9M_REGION, g_model.moduleData[EXTERNAL_MODULE].subType, (menuHorizontalPosition==1 ? attr : 0));
|
||||
}
|
||||
#endif
|
||||
#if defined(MULTIMODULE)
|
||||
else if (isModuleMultimodule(EXTERNAL_MODULE)) {
|
||||
int multi_rfProto = g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false);
|
||||
@@ -857,7 +845,7 @@ void menuModelSetup(event_t event)
|
||||
event,
|
||||
g_model.moduleData[EXTERNAL_MODULE].type,
|
||||
MODULE_TYPE_NONE,
|
||||
#if defined(PCBI6)
|
||||
#if defined(PCBI6X)
|
||||
IS_TRAINER_EXTERNAL_MODULE() ? MODULE_TYPE_NONE : MODULE_TYPE_COUNT-2, // exclude AFHDS2A
|
||||
#else
|
||||
IS_TRAINER_EXTERNAL_MODULE() ? MODULE_TYPE_NONE : MODULE_TYPE_COUNT-1,
|
||||
@@ -874,6 +862,7 @@ void menuModelSetup(event_t event)
|
||||
SET_DEFAULT_PPM_FRAME_LENGTH(EXTERNAL_MODULE);
|
||||
}
|
||||
break;
|
||||
#if !defined(PCBI6X) // no second column on i6X external module line
|
||||
case 1:
|
||||
if (isModuleDSM2(EXTERNAL_MODULE))
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, DSM2_PROTO_LP45, DSM2_PROTO_DSMX);
|
||||
@@ -914,6 +903,7 @@ void menuModelSetup(event_t event)
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsCount = defaultModuleChannels_M8(EXTERNAL_MODULE);
|
||||
}
|
||||
#endif // PCBI6X
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -950,13 +940,28 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(CROSSFIRE)
|
||||
case ITEM_MODEL_SETUP_EXTERNAL_MODULE_ARMING_MODE:
|
||||
g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingMode =
|
||||
editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_CRSF_ARMING_MODE, STR_CRSF_ARMING_MODES,
|
||||
g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingMode, ARMING_MODE_FIRST, ARMING_MODE_LAST, attr, event, INDENT_WIDTH);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_EXTERNAL_MODULE_ARMING_TRIGGER:
|
||||
lcdDrawTextIndented(y, STR_SWITCH);
|
||||
drawSwitch(MODEL_SETUP_2ND_COLUMN, y, g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingTrigger, attr);
|
||||
if (attr)
|
||||
CHECK_INCDEC_SWITCH(event, g_model.moduleData[EXTERNAL_MODULE].crsf.crsfArmingTrigger, SWSRC_FIRST, SWSRC_LAST, EE_MODEL, isSwitchAvailableForArming);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(SBUS_TRAINER)
|
||||
case ITEM_MODEL_TRAINER_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_TRAINER);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_TRAINER_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VTRAINERMODES, g_model.trainerMode, attr);
|
||||
if (attr) {
|
||||
g_model.trainerMode = checkIncDec(event, g_model.trainerMode, 0, TRAINER_MODE_MAX(), EE_MODEL, isTrainerModeAvailable);
|
||||
@@ -977,7 +982,7 @@ void menuModelSetup(event_t event)
|
||||
s_editMode = 0;
|
||||
}
|
||||
if (bluetoothDistantAddr[0]) {
|
||||
lcdDrawText(INDENT_WIDTH, y+1, bluetoothDistantAddr, TINSIZE);
|
||||
lcdDrawTextIndented(y+1, bluetoothDistantAddr, TINSIZE);
|
||||
if (bluetoothState != BLUETOOTH_STATE_CONNECTED) {
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Bind"), menuHorizontalPosition == 0 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+5*FW, y, BUTTON("Clear"), menuHorizontalPosition == 1 ? attr : 0);
|
||||
@@ -996,7 +1001,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
}
|
||||
else {
|
||||
lcdDrawText(INDENT_WIDTH, y, "---");
|
||||
lcdDrawTextIndented(y, "---");
|
||||
if (bluetoothState < BLUETOOTH_STATE_IDLE)
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Init"), attr);
|
||||
else
|
||||
@@ -1011,9 +1016,9 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
else {
|
||||
if (bluetoothDistantAddr[0])
|
||||
lcdDrawText(INDENT_WIDTH, y+1, bluetoothDistantAddr, TINSIZE);
|
||||
lcdDrawTextIndented(y+1, bluetoothDistantAddr, TINSIZE);
|
||||
else
|
||||
lcdDrawText(INDENT_WIDTH, y, "---");
|
||||
lcdDrawTextIndented(y, "---");
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, bluetoothState == BLUETOOTH_STATE_CONNECTED ? "Connected" : "!Connected");
|
||||
}
|
||||
break;
|
||||
@@ -1022,9 +1027,6 @@ void menuModelSetup(event_t event)
|
||||
#if defined(PCBTARANIS)
|
||||
case ITEM_MODEL_TRAINER_CHANNELS:
|
||||
case ITEM_MODEL_INTERNAL_MODULE_CHANNELS:
|
||||
#endif
|
||||
#if defined(PCBSKY9X)
|
||||
case ITEM_MODEL_EXTRA_MODULE_CHANNELS:
|
||||
#endif
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_CHANNELS:
|
||||
{
|
||||
@@ -1056,11 +1058,8 @@ void menuModelSetup(event_t event)
|
||||
#if defined(PCBX7)
|
||||
case ITEM_MODEL_TRAINER_PARAMS:
|
||||
#endif
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_BIND:
|
||||
#endif
|
||||
#if defined(PCBSKY9X)
|
||||
case ITEM_MODEL_EXTRA_MODULE_BIND:
|
||||
#endif
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_BIND:
|
||||
{
|
||||
@@ -1069,7 +1068,7 @@ void menuModelSetup(event_t event)
|
||||
if (isModulePPM(moduleIdx)) {
|
||||
lcdDrawTextAlignedLeft(y, STR_PPMFRAME);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MS);
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, (int16_t)moduleData.ppm.frameLength*5 + 225, (menuHorizontalPosition<=0 ? attr : 0) | PREC1|LEFT);
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, (int16_t)moduleData.ppm.frameLength * PPM_STEP_SIZE + PPM_DEF_PERIOD, (menuHorizontalPosition<=0 ? attr : 0) | PREC1|LEFT);
|
||||
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, 'u');
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, (moduleData.ppm.delay*50)+300, RIGHT | ((CURSOR_ON_LINE() || menuHorizontalPosition==1) ? attr : 0));
|
||||
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+10*FW, y, moduleData.ppm.pulsePol ? '+' : '-', (CURSOR_ON_LINE() || menuHorizontalPosition==2) ? attr : 0);
|
||||
@@ -1089,14 +1088,14 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
else if (isModuleSBUS(moduleIdx)) {
|
||||
lcdDrawTextAlignedLeft(y, STR_REFRESHRATE);
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, (int16_t)moduleData.ppm.frameLength*5 + 225, (menuHorizontalPosition<=0 ? attr : 0) | PREC1|LEFT);
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, (int16_t)moduleData.sbus.refreshRate * SBUS_STEPSIZE + SBUS_DEF_PERIOD, (menuHorizontalPosition<=0 ? attr : 0) | PREC1|LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, STR_MS);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+5*FW+2, y, moduleData.sbus.noninverted ? "no inv" : "normal", (CURSOR_ON_LINE() || menuHorizontalPosition==1) ? attr : 0);
|
||||
|
||||
if (attr && s_editMode>0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
CHECK_INCDEC_MODELVAR(event, moduleData.ppm.frameLength, -33, 35);
|
||||
CHECK_INCDEC_MODELVAR(event, moduleData.sbus.refreshRate, (SBUS_MIN_PERIOD - SBUS_DEF_PERIOD) / SBUS_STEPSIZE, (SBUS_MAX_PERIOD - SBUS_DEF_PERIOD) / SBUS_STEPSIZE);
|
||||
break;
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, moduleData.sbus.noninverted, 1);
|
||||
@@ -1110,18 +1109,23 @@ void menuModelSetup(event_t event)
|
||||
xOffsetBind = 0;
|
||||
lcdDrawTextAlignedLeft(y, STR_RECEIVER);
|
||||
if (attr) l_posHorz += 1;
|
||||
// } else if (isModuleCrossfire(moduleIdx)) {
|
||||
// lcdDrawTextAlignedLeft(y, STR_RECEIVER);
|
||||
} else {
|
||||
lcdDrawTextAlignedLeft(y, STR_RECEIVER_NUM);
|
||||
lcdDrawTextAlignedLeft(y, STR_RECEIVER);
|
||||
}
|
||||
if (isModulePXX(moduleIdx) || isModuleDSM2(moduleIdx) || isModuleMultimodule(moduleIdx) || isModuleA7105(moduleIdx)) {
|
||||
if (isModulePXX(moduleIdx) || isModuleDSM2(moduleIdx) || isModuleMultimodule(moduleIdx) || isModuleCrossfire(moduleIdx) || isModuleA7105(moduleIdx)) {
|
||||
if (xOffsetBind)
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, g_model.header.modelId[moduleIdx], (l_posHorz==0 ? attr : 0) | LEADING0|LEFT, 2);
|
||||
if (attr && l_posHorz == 0) {
|
||||
if (editMode>0 || p1valdiff) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.header.modelId[moduleIdx], MAX_RX_NUM(moduleIdx));
|
||||
if (checkIncDec_Ret) {
|
||||
if (isModuleCrossfire(moduleIdx))
|
||||
moduleState[EXTERNAL_MODULE].counter = CRSF_FRAME_MODELID;
|
||||
modelHeaders[g_eeGeneral.currModel].modelId[moduleIdx] = g_model.header.modelId[moduleIdx];
|
||||
}
|
||||
#if !defined(PCBI6X)
|
||||
else if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
uint8_t newVal = findNextUnusedModelId(g_eeGeneral.currModel, moduleIdx);
|
||||
@@ -1130,10 +1134,13 @@ void menuModelSetup(event_t event)
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isModuleA7105(moduleIdx)) { // isModuleBindRangeAvailable
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+xOffsetBind, y, STR_MODULE_BIND, l_posHorz==1 ? attr : 0);
|
||||
#if defined(PCBTARANIS) || defined(DSM2) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(DSM2) || defined(PCBI6X)
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+MODEL_SETUP_RANGE_OFS+xOffsetBind, y, STR_MODULE_RANGE, l_posHorz==2 ? attr : 0);
|
||||
#endif
|
||||
uint8_t newFlag = 0;
|
||||
@@ -1150,8 +1157,6 @@ void menuModelSetup(event_t event)
|
||||
if (isModuleR9M(moduleIdx) || (isModuleXJT(moduleIdx) && g_model.moduleData[moduleIdx].rfProtocol==RF_PROTO_X16)) {
|
||||
#if defined(PCBXLITE)
|
||||
if (EVT_KEY_MASK(event) == KEY_ENTER) {
|
||||
#elif defined(PCBSKY9X) || defined(AR9X)
|
||||
if (event == EVT_KEY_FIRST(KEY_ENTER)) {
|
||||
#else
|
||||
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
#endif
|
||||
@@ -1179,36 +1184,36 @@ void menuModelSetup(event_t event)
|
||||
POPUP_MENU_START(onBindMenu);
|
||||
continue;
|
||||
}
|
||||
if (moduleFlag[moduleIdx] == MODULE_BIND) {
|
||||
newFlag = MODULE_BIND;
|
||||
if (moduleState[moduleIdx].mode == MODULE_MODE_BIND) {
|
||||
newFlag = MODULE_MODE_BIND;
|
||||
}
|
||||
else {
|
||||
if (!popupMenuNoItems) {
|
||||
if (!popupMenuItemsCount) {
|
||||
s_editMode = 0; // this is when popup is exited before a choice is made
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
newFlag = MODULE_BIND;
|
||||
newFlag = MODULE_MODE_BIND;
|
||||
}
|
||||
}
|
||||
else if (l_posHorz == 2) {
|
||||
newFlag = MODULE_RANGECHECK;
|
||||
newFlag = MODULE_MODE_RANGECHECK;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (attr && l_posHorz>0 && s_editMode>0) {
|
||||
if (l_posHorz == 1)
|
||||
newFlag = MODULE_BIND;
|
||||
newFlag = MODULE_MODE_BIND;
|
||||
else if (l_posHorz == 2)
|
||||
newFlag = MODULE_RANGECHECK;
|
||||
newFlag = MODULE_MODE_RANGECHECK;
|
||||
}
|
||||
#endif
|
||||
moduleFlag[moduleIdx] = newFlag;
|
||||
moduleState[moduleIdx].mode = newFlag;
|
||||
|
||||
#if defined(MULTIMODULE)
|
||||
if (newFlag == MODULE_BIND) {
|
||||
if (newFlag == MODULE_MODE_BIND) {
|
||||
multiBindStatus = MULTI_BIND_INITIATED;
|
||||
}
|
||||
#endif
|
||||
@@ -1217,17 +1222,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(PCBSKY9X) && defined(REVX)
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_OUTPUT_TYPE:
|
||||
{
|
||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
|
||||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||
moduleData.ppm.outputType = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_OUTPUT_TYPE, STR_VOUTPUT_TYPE, moduleData.ppm.outputType, 0, 1, attr, event);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_FAILSAFE:
|
||||
#endif
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_FAILSAFE: {
|
||||
@@ -1326,7 +1321,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#if !defined(PCBI6X)
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_POWER:
|
||||
{
|
||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
|
||||
@@ -1365,7 +1360,7 @@ void menuModelSetup(event_t event)
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
#endif // PCBI6X
|
||||
#if defined(MULTIMODULE)
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_AUTOBIND:
|
||||
if (g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(true) == MM_RF_PROTO_DSM2)
|
||||
@@ -1392,82 +1387,31 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
case ITEM_MODEL_PPM2_PROTOCOL:
|
||||
lcdDrawTextAlignedLeft(y, "Port2");
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, 0, 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW+3, y, STR_CH, menuHorizontalPosition<=0 ? attr : 0);
|
||||
lcdDrawNumber(lcdLastRightPos, y, g_model.moduleData[1].channelsStart+1, LEFT | (menuHorizontalPosition<=0 ? attr : 0));
|
||||
lcdDrawChar(lcdLastRightPos, y, '-');
|
||||
lcdDrawNumber(lcdLastRightPos + FW+1, y, g_model.moduleData[1].channelsStart+8+g_model.moduleData[1].channelsCount, LEFT | (menuHorizontalPosition!=0 ? attr : 0));
|
||||
if (attr && (editMode>0 || p1valdiff)) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.moduleData[1].channelsStart, 32-8-g_model.moduleData[1].channelsCount);
|
||||
SET_DEFAULT_PPM_FRAME_LENGTH(1);
|
||||
break;
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].channelsCount, -4, min<int8_t>(8, 32-8-g_model.moduleData[1].channelsStart));
|
||||
SET_DEFAULT_PPM_FRAME_LENGTH(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_PPM2_PARAMS:
|
||||
lcdDrawTextAlignedLeft(y, STR_PPMFRAME);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MS);
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, (int16_t)g_model.moduleData[1].ppmFrameLength*5 + 225, (menuHorizontalPosition<=0 ? attr : 0) | PREC1 | LEFT);
|
||||
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, 'u');
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, (g_model.moduleData[1].ppmDelay*50)+300, RIGHT | ((menuHorizontalPosition < 0 || menuHorizontalPosition==1) ? attr : 0));
|
||||
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+10*FW, y, g_model.moduleData[1].ppmPulsePol ? '+' : '-', (menuHorizontalPosition < 0 || menuHorizontalPosition==2) ? attr : 0);
|
||||
if (attr && (editMode>0 || p1valdiff)) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].ppmFrameLength, -20, 35);
|
||||
break;
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].ppmDelay, -4, 10);
|
||||
break;
|
||||
case 2:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.moduleData[1].ppmPulsePol, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(PXX) || defined(PCBI6)
|
||||
if (IS_RANGECHECK_ENABLE()) {
|
||||
showMessageBox("RSSI: ");
|
||||
lcdDrawNumber(16+4*FW, 5*FH, TELEMETRY_RSSI(), BOLD);
|
||||
#if defined(AFHDS2A)
|
||||
if (isModuleInRangeCheckMode()) {
|
||||
showMessageBox("RQly");
|
||||
lcdDrawNumber(WARNING_LINE_X, 5*FH, TELEMETRY_RSSI(), BOLD);
|
||||
}
|
||||
#endif
|
||||
|
||||
// some field just finished being edited
|
||||
if (old_editMode > 0 && s_editMode == 0) {
|
||||
switch(menuVerticalPosition) {
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_BIND:
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_BIND + 1: // for some reason index is off by one
|
||||
if (menuHorizontalPosition == 0)
|
||||
checkModelIdUnique(g_eeGeneral.currModel, INTERNAL_MODULE);
|
||||
break;
|
||||
#endif
|
||||
#if defined(PCBSKY9X)
|
||||
case ITEM_MODEL_EXTRA_MODULE_BIND:
|
||||
if (menuHorizontalPosition == 0)
|
||||
checkModelIdUnique(g_eeGeneral.currModel, EXTRA_MODULE);
|
||||
break;
|
||||
#endif
|
||||
#if !defined(PCBI6X)
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_BIND:
|
||||
if (menuHorizontalPosition == 0)
|
||||
checkModelIdUnique(g_eeGeneral.currModel, EXTERNAL_MODULE);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1477,9 +1421,8 @@ void menuModelFailsafe(event_t event)
|
||||
const uint8_t channelStart = g_model.moduleData[g_moduleIdx].channelsStart;
|
||||
const int lim = (g_model.extendedLimits ? (512 * LIMIT_EXT_PERCENT / 100) : 512) * 2;
|
||||
uint8_t wbar = LCD_W - FW * 4 - FWNUM * 4;
|
||||
#if defined(PPM_UNIT_PERCENT_PREC1)
|
||||
if (g_eeGeneral.ppmunit == PPM_PERCENT_PREC1)
|
||||
wbar -= 6;
|
||||
#endif
|
||||
|
||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
@@ -1491,13 +1434,13 @@ void menuModelFailsafe(event_t event)
|
||||
s_editMode = 0;
|
||||
}
|
||||
else {
|
||||
int16_t & failsafe = g_model.moduleData[g_moduleIdx].failsafeChannels[menuVerticalPosition];
|
||||
if (failsafe < FAILSAFE_CHANNEL_HOLD)
|
||||
failsafe = FAILSAFE_CHANNEL_HOLD;
|
||||
else if (failsafe == FAILSAFE_CHANNEL_HOLD)
|
||||
failsafe = FAILSAFE_CHANNEL_NOPULSE;
|
||||
int16_t * failsafe = &g_model.moduleData[g_moduleIdx].failsafeChannels[menuVerticalPosition];
|
||||
if (*failsafe < FAILSAFE_CHANNEL_HOLD)
|
||||
*failsafe = FAILSAFE_CHANNEL_HOLD;
|
||||
else if (*failsafe == FAILSAFE_CHANNEL_HOLD)
|
||||
*failsafe = FAILSAFE_CHANNEL_NOPULSE;
|
||||
else
|
||||
failsafe = 0;
|
||||
*failsafe = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1512,7 +1455,7 @@ void menuModelFailsafe(event_t event)
|
||||
|
||||
SIMPLE_SUBMENU_NOTITLE(sentModuleChannels(g_moduleIdx) + 1);
|
||||
|
||||
lcdDrawTextAlignedCenter(0, FAILSAFESET);
|
||||
lcdDrawText(LCD_W / 2, 0, STR_FAILSAFESET, CENTERED);
|
||||
lcdInvertLine(0);
|
||||
|
||||
const coord_t x = 1;
|
||||
@@ -1553,17 +1496,11 @@ void menuModelFailsafe(event_t event)
|
||||
failsafeValue = 0;
|
||||
}
|
||||
else {
|
||||
#if defined(PPM_UNIT_US)
|
||||
lcdDrawNumber(xValue, y, PPM_CH_CENTER(ch)+failsafeValue/2, RIGHT|flags);
|
||||
#elif defined(PPM_UNIT_PERCENT_PREC1)
|
||||
lcdDrawNumber(xValue, y, calcRESXto1000(failsafeValue), RIGHT|PREC1|flags);
|
||||
#else
|
||||
lcdDrawNumber(xValue, y, calcRESXto1000(failsafeValue)/10, RIGHT|flags);
|
||||
#endif
|
||||
drawChannelValue(xValue, y, ch, failsafeValue, RIGHT|flags);
|
||||
}
|
||||
|
||||
// Gauge
|
||||
#if !defined(PCBX7) // X7 LCD doesn't like too many horizontal lines
|
||||
#if !defined(PCBX7) && !defined(PCBI6X) // X7 & i6X LCD doesn't like too many horizontal lines
|
||||
lcdDrawRect(x+LCD_W-3-wbar, y, wbar+1, 6);
|
||||
#endif
|
||||
const uint8_t lenChannel = limit<uint8_t>(1, (abs(channelValue) * wbar/2 + lim/2) / lim, wbar/2);
|
||||
|
||||
@@ -24,11 +24,7 @@
|
||||
#define MODEL_SPECIAL_FUNC_2ND_COLUMN (4*FW-1)
|
||||
#define MODEL_SPECIAL_FUNC_3RD_COLUMN (15*FW-3)
|
||||
#define MODEL_SPECIAL_FUNC_4TH_COLUMN (20*FW)
|
||||
#if defined(GRAPHICS)
|
||||
#define MODEL_SPECIAL_FUNC_4TH_COLUMN_ONOFF (20*FW)
|
||||
#else
|
||||
#define MODEL_SPECIAL_FUNC_4TH_COLUMN_ONOFF (18*FW+2)
|
||||
#endif
|
||||
#define MODEL_SPECIAL_FUNC_4TH_COLUMN_ONOFF (20*FW)
|
||||
|
||||
#if defined(SDCARD)
|
||||
void onCustomFunctionsFileSelectionMenu(const char * result)
|
||||
@@ -61,15 +57,15 @@ void onCustomFunctionsFileSelectionMenu(const char * result)
|
||||
POPUP_WARNING(func==FUNC_PLAY_SCRIPT ? STR_NO_SCRIPTS_ON_SD : STR_NO_SOUNDS_ON_SD);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a file in the list
|
||||
else if (result != STR_EXIT) {
|
||||
// The user chosen a file in the list
|
||||
memcpy(cfn->play.name, result, sizeof(cfn->play.name));
|
||||
storageDirty(eeFlags);
|
||||
}
|
||||
}
|
||||
#endif // SDCARD
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
|
||||
void onAdjustGvarSourceLongEnterPress(const char * result)
|
||||
{
|
||||
@@ -95,7 +91,7 @@ void onAdjustGvarSourceLongEnterPress(const char * result)
|
||||
CFN_PARAM(cfn) = 0;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
else {
|
||||
else if (result != STR_EXIT) {
|
||||
onSourceLongEnterPress(result);
|
||||
}
|
||||
}
|
||||
@@ -142,7 +138,7 @@ void onCustomFunctionsMenu(const char * result)
|
||||
storageDirty(eeFlags);
|
||||
}
|
||||
}
|
||||
#endif // PCBTARANIS
|
||||
#endif // PCBTARANIS, PCBI6X
|
||||
|
||||
void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext)
|
||||
{
|
||||
@@ -150,19 +146,23 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
|
||||
uint8_t eeFlags = (functions == g_model.customFn) ? EE_MODEL : EE_GENERAL;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBXLITE)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
#if defined(PCBXLITE) || defined(PCBI6X)
|
||||
if (menuHorizontalPosition==0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
#if !defined(PCBI6X)
|
||||
killEvents(KEY_ENTER);
|
||||
if (IS_SHIFT_PRESSED()) { // ENT LONG on xlite brings up switch type menu, so this menu is activated with SHIT + ENT LONG
|
||||
if (IS_SHIFT_PRESSED()) { // ENT LONG on xlite brings up switch type menu, so this menu is activated with SHIT + ENT LONG
|
||||
#else
|
||||
s_editMode = 0;
|
||||
#endif // PCBI6X
|
||||
#else
|
||||
if (menuHorizontalPosition<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
#endif
|
||||
killEvents(event);
|
||||
CustomFunctionData *cfn = &functions[sub];
|
||||
if (!CFN_EMPTY(cfn))
|
||||
#if !defined(PCBI6X)
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY);
|
||||
#if defined(SDCARD)
|
||||
if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_FUNCTION && isAssignableFunctionAvailable(clipboard.data.cfn.func))
|
||||
POPUP_MENU_ADD_ITEM(STR_PASTE);
|
||||
#endif
|
||||
@@ -181,15 +181,15 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
#if defined(PCBXLITE)
|
||||
}
|
||||
#endif
|
||||
#endif // PCBTARANIS
|
||||
#endif // PCBTARANIS, PCBI6X
|
||||
|
||||
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i+menuVerticalOffset;
|
||||
|
||||
CustomFunctionData * cfn = &functions[k];
|
||||
uint8_t func = CFN_FUNC(cfn);
|
||||
for (uint8_t j=0; j<5; j++) {
|
||||
for (uint32_t j=0; j<5; j++) {
|
||||
uint8_t attr = ((sub==k && menuHorizontalPosition==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||
uint8_t active = (attr && (s_editMode>0 || p1valdiff));
|
||||
switch (j) {
|
||||
@@ -281,10 +281,12 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
|
||||
}
|
||||
#endif // OVERRIDE_CHANNEL_FUNCTION
|
||||
else if (func >= FUNC_SET_FAILSAFE && func <= FUNC_BIND) {
|
||||
#if defined(DANGEROUS_MODULE_FUNCTIONS)
|
||||
else if (func >= FUNC_RANGECHECK && func <= FUNC_BIND) {
|
||||
val_max = NUM_MODULES-1;
|
||||
lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
}
|
||||
#endif
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
getMixSrcRange(MIXSRC_FIRST_TIMER, val_min, val_max);
|
||||
drawTimer(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr);
|
||||
@@ -326,6 +328,15 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // SDCARD
|
||||
#if defined(DFPLAYER)
|
||||
else if (func == FUNC_PLAY_TRACK) {
|
||||
val_min = DFPLAYER_CUSTOM_FILE_INDEX;
|
||||
val_max = DFPLAYER_LAST_FILE_INDEX;
|
||||
if (val_displayed < val_min) val_displayed = val_min;
|
||||
// lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
|
||||
editChoice(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, "", audioNames, val_displayed, DFPLAYER_CUSTOM_FILE_INDEX, DFPLAYER_LAST_FILE_INDEX, attr, event);
|
||||
}
|
||||
else if (func == FUNC_PLAY_VALUE) {
|
||||
val_max = MIXSRC_LAST_TELEM;
|
||||
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
@@ -334,7 +345,8 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
INCDEC_ENABLE_CHECK(functionsContext == &globalFunctionsContext ? isSourceAvailableInGlobalFunctions : isSourceAvailable);
|
||||
}
|
||||
}
|
||||
#endif // SDCARD
|
||||
#endif // SDCARD || DFPLAYER
|
||||
#if !defined(PCBI6X)
|
||||
else if (func == FUNC_VOLUME) {
|
||||
val_max = MIXSRC_LAST_CH;
|
||||
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
@@ -343,6 +355,15 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
}
|
||||
}
|
||||
#endif // PCBI6X
|
||||
else if (func == FUNC_BACKLIGHT) {
|
||||
val_max = MIXSRC_LAST_CH;
|
||||
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
if (active) {
|
||||
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
}
|
||||
}
|
||||
#if defined(SDCARD)
|
||||
else if (func == FUNC_LOGS) {
|
||||
if (val_displayed) {
|
||||
@@ -376,6 +397,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
break;
|
||||
default: // FUNC_ADJUST_GVAR_INC
|
||||
getMixSrcRange(CFN_GVAR_INDEX(cfn) + MIXSRC_FIRST_GVAR, val_min, val_max);
|
||||
getGVarIncDecRange(val_min, val_max);
|
||||
lcdDrawText(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, (val_displayed < 0 ? "-= " : "+= "), attr);
|
||||
drawGVarValue(lcdNextPos, y, CFN_GVAR_INDEX(cfn), abs(val_displayed), attr|LEFT);
|
||||
break;
|
||||
|
||||
@@ -105,6 +105,8 @@ enum MenuModelTelemetryFrskyItems {
|
||||
|
||||
#if defined (PCBTARANIS)
|
||||
#define TELEMETRY_TYPE_SHOW_TELEMETRY (! IS_INTERNAL_MODULE_ENABLED() && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM) ? (uint8_t)0 : HIDDEN_ROW
|
||||
#elif defined(PCBI6X) // no telemetry input implemented
|
||||
#define TELEMETRY_TYPE_SHOW_TELEMETRY HIDDEN_ROW
|
||||
#else
|
||||
#define TELEMETRY_TYPE_SHOW_TELEMETRY (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM) ? (uint8_t)0 : HIDDEN_ROW
|
||||
#endif
|
||||
@@ -133,7 +135,9 @@ enum SensorFields {
|
||||
SENSOR_FIELD_ONLYPOSITIVE,
|
||||
SENSOR_FIELD_FILTER,
|
||||
SENSOR_FIELD_PERSISTENT,
|
||||
#if defined(SDCARD)
|
||||
SENSOR_FIELD_LOGS,
|
||||
#endif
|
||||
SENSOR_FIELD_MAX
|
||||
};
|
||||
|
||||
@@ -162,7 +166,7 @@ void menuModelSensor(event_t event)
|
||||
|
||||
int8_t sub = menuVerticalPosition;
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
for (uint32_t i=0; i<LCD_LINES-1; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i + menuVerticalOffset;
|
||||
|
||||
@@ -296,7 +300,7 @@ void menuModelSensor(event_t event)
|
||||
case SENSOR_FIELD_PARAM2:
|
||||
if (sensor->type == TELEM_TYPE_CALCULATED) {
|
||||
if (sensor->formula == TELEM_FORMULA_CELL) {
|
||||
sensor->cell.index = editChoice(SENSOR_2ND_COLUMN, y, STR_CELLINDEX, STR_VCELLINDEX, sensor->cell.index, 0, 8, attr, event);
|
||||
sensor->cell.index = editChoice(SENSOR_2ND_COLUMN, y, STR_CELLINDEX, STR_VCELLINDEX, sensor->cell.index, TELEM_CELL_INDEX_LOWEST, TELEM_CELL_INDEX_LAST, attr, event);
|
||||
break;
|
||||
}
|
||||
else if (sensor->formula == TELEM_FORMULA_DIST) {
|
||||
@@ -315,7 +319,7 @@ void menuModelSensor(event_t event)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_OFFSET));
|
||||
lcdDrawTextAlignedLeft(y, STR_OFFSET);
|
||||
if (attr) CHECK_INCDEC_MODELVAR(event, sensor->custom.offset, -30000, +30000);
|
||||
if (sensor->prec > 0) attr |= (sensor->prec == 2 ? PREC2 : PREC1);
|
||||
lcdDrawNumber(SENSOR_2ND_COLUMN, y, sensor->custom.offset, LEFT|attr);
|
||||
@@ -328,17 +332,17 @@ void menuModelSensor(event_t event)
|
||||
|
||||
case SENSOR_FIELD_PARAM4:
|
||||
{
|
||||
drawStringWithIndex(0, y, NO_INDENT(STR_SOURCE), k-SENSOR_FIELD_PARAM1+1);
|
||||
int8_t & source = sensor->calc.sources[k-SENSOR_FIELD_PARAM1];
|
||||
drawStringWithIndex(0, y, STR_SOURCE, k-SENSOR_FIELD_PARAM1+1);
|
||||
int8_t * source = &sensor->calc.sources[k-SENSOR_FIELD_PARAM1];
|
||||
if (attr) {
|
||||
source = checkIncDec(event, source, -MAX_TELEMETRY_SENSORS, MAX_TELEMETRY_SENSORS, EE_MODEL|NO_INCDEC_MARKS, isSensorAvailable);
|
||||
*source = checkIncDec(event, *source, -MAX_TELEMETRY_SENSORS, MAX_TELEMETRY_SENSORS, EE_MODEL|NO_INCDEC_MARKS, isSensorAvailable);
|
||||
}
|
||||
if (source < 0) {
|
||||
if (*source < 0) {
|
||||
lcdDrawChar(SENSOR_2ND_COLUMN, y, '-', attr);
|
||||
drawSource(lcdNextPos, y, MIXSRC_FIRST_TELEM+3*(-1-source), attr);
|
||||
drawSource(lcdNextPos, y, MIXSRC_FIRST_TELEM+3*(-1-*source), attr);
|
||||
}
|
||||
else {
|
||||
drawSource(SENSOR_2ND_COLUMN, y, source ? MIXSRC_FIRST_TELEM+3*(source-1) : 0, attr);
|
||||
drawSource(SENSOR_2ND_COLUMN, y, *source ? MIXSRC_FIRST_TELEM+3*(*source-1) : 0, attr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -362,14 +366,14 @@ void menuModelSensor(event_t event)
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(SDCARD)
|
||||
case SENSOR_FIELD_LOGS:
|
||||
ON_OFF_MENU_ITEM(sensor->logs, SENSOR_2ND_COLUMN, y, STR_LOGS, attr, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
#if defined(SDCARD)
|
||||
logsClose();
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -434,7 +438,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
for (uint32_t i=0; i<LCD_LINES-1; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i + menuVerticalOffset;
|
||||
for (int j=0; j<=k; j++) {
|
||||
@@ -456,6 +460,9 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
if (telemetryItems[index].isFresh()) {
|
||||
lcdDrawChar(17*FW, y, '*');
|
||||
}
|
||||
#if 0 // draw telemetry sensor ID
|
||||
lcdDrawNumber(LCD_W, y, g_model.telemetrySensors[index].instance, RIGHT);
|
||||
#endif
|
||||
TelemetryItem & telemetryItem = telemetryItems[index];
|
||||
if (telemetryItem.isAvailable()) {
|
||||
bool isOld = telemetryItem.isOld();
|
||||
@@ -485,6 +492,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
else
|
||||
|
||||
switch (k) {
|
||||
#if !defined(PCBI6X) // no telemetry input implemented
|
||||
case ITEM_TELEMETRY_PROTOCOL_TYPE:
|
||||
lcdDrawTextAlignedLeft(y, STR_TELEMETRY_TYPE);
|
||||
lcdDrawTextAtIndex(TELEM_COL2, y, STR_TELEMETRY_PROTOCOLS, g_model.telemetryProtocol, attr);
|
||||
@@ -492,7 +500,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
g_model.telemetryProtocol = checkIncDec(event, g_model.telemetryProtocol, PROTOCOL_TELEMETRY_FIRST, PROTOCOL_TELEMETRY_LAST, EE_MODEL, isTelemetryProtocolAvailable);
|
||||
}
|
||||
break;
|
||||
|
||||
#endif
|
||||
#if defined(REVX)
|
||||
case ITEM_TELEMETRY_INVERTED_SERIAL:
|
||||
ON_OFF_MENU_ITEM(g_model.moduleData[EXTERNAL_MODULE].invertedSerial, TELEM_COL2, y, STR_INVERTED_SERIAL, attr, event);
|
||||
@@ -512,7 +520,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_NEW_SENSOR:
|
||||
lcdDrawText(0, y, STR_TELEMETRY_NEWSENSOR, attr);
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_TELEMETRY_NEWSENSOR, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
int res = availableTelemetryIndex();
|
||||
@@ -543,19 +551,13 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
|
||||
|
||||
case ITEM_TELEMETRY_RSSI_LABEL:
|
||||
#if defined(MULTIMODULE)
|
||||
if (telemetryProtocol == PROTOCOL_MULTIMODULE &&
|
||||
g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(false) == MM_RF_PROTO_FS_AFHDS2A)
|
||||
lcdDrawTextAlignedLeft(y, "RSNR");
|
||||
else
|
||||
#endif
|
||||
lcdDrawTextAlignedLeft(y, "RSSI");
|
||||
lcdDrawTextAlignedLeft(y, "RQly");
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_RSSI_ALARM1:
|
||||
case ITEM_TELEMETRY_RSSI_ALARM2: {
|
||||
bool warning = (k==ITEM_TELEMETRY_RSSI_ALARM1);
|
||||
lcdDrawTextAlignedLeft(y, (warning ? STR_LOWALARM : STR_CRITICALALARM));
|
||||
lcdDrawTextIndented(y, (warning ? STR_LOWALARM : STR_CRITICALALARM));
|
||||
lcdDrawNumber(LCD_W, y, warning? g_model.rssiAlarms.getWarningRssi() : g_model.rssiAlarms.getCriticalRssi(), RIGHT | attr, 3);
|
||||
if (attr && s_editMode>0) {
|
||||
if (warning)
|
||||
@@ -575,7 +577,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_VARIO_SOURCE:
|
||||
lcdDrawTextAlignedLeft(y, STR_SOURCE);
|
||||
lcdDrawTextIndented(y, STR_SOURCE);
|
||||
drawSource(TELEM_COL2, y, g_model.frsky.varioSource ? MIXSRC_FIRST_TELEM+3*(g_model.frsky.varioSource-1) : 0, attr);
|
||||
if (attr) {
|
||||
g_model.frsky.varioSource = checkIncDec(event, g_model.frsky.varioSource, 0, MAX_TELEMETRY_SENSORS, EE_MODEL|NO_INCDEC_MARKS, isSensorAvailable);
|
||||
@@ -583,7 +585,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_VARIO_RANGE:
|
||||
lcdDrawTextAlignedLeft(y, STR_RANGE);
|
||||
lcdDrawTextIndented(y, STR_RANGE);
|
||||
if (attr && CURSOR_ON_LINE()) {
|
||||
lcdDrawSolidFilledRect(TELEM_COL2-1, y-1, LCD_W-TELEM_COL2+1, FH+1);
|
||||
}
|
||||
@@ -602,7 +604,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_VARIO_CENTER:
|
||||
lcdDrawTextAlignedLeft(y, STR_CENTER);
|
||||
lcdDrawTextIndented(y, STR_CENTER);
|
||||
lcdDrawNumber(TELEM_COL2, y, -5+g_model.frsky.varioCenterMin, ((CURSOR_ON_LINE() || menuHorizontalPosition==0) ? attr : 0)|PREC1|LEFT);
|
||||
lcdDrawNumber(TELEM_COL2+4*FW, y, 5+g_model.frsky.varioCenterMax, ((CURSOR_ON_LINE() || menuHorizontalPosition==1) ? attr : 0)|PREC1|LEFT);
|
||||
lcdDrawTextAtIndex(TELEM_COL2+8*FW, y, STR_VVARIOCENTER, g_model.frsky.varioCenterSilent, (menuHorizontalPosition==2 ? attr : 0));
|
||||
|
||||
@@ -40,7 +40,7 @@ void menuModelTemplates(event_t event)
|
||||
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1;
|
||||
uint8_t k = 0;
|
||||
for (uint8_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
|
||||
for (uint32_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
|
||||
k = i+menuVerticalOffset;
|
||||
lcdDrawNumber(3*FW, y, k, (sub==k ? INVERS : 0)|LEADING0, 2);
|
||||
lcdDrawTextAtIndex(4*FW, y, STR_VTEMPLATES, k, (sub==k ? INVERS : 0));
|
||||
|
||||
@@ -27,14 +27,11 @@ uint8_t warningType;
|
||||
uint8_t warningResult = 0;
|
||||
|
||||
uint8_t warningInfoFlags = ZCHAR;
|
||||
int16_t warningInputValue;
|
||||
int16_t warningInputValueMin;
|
||||
int16_t warningInputValueMax;
|
||||
|
||||
void drawMessageBox()
|
||||
{
|
||||
lcdDrawFilledRect(10, 16, LCD_W-20, 40, SOLID, ERASE);
|
||||
lcdDrawRect(10, 16, LCD_W-20, 40);
|
||||
lcdDrawFilledRect(MESSAGEBOX_X - 1, MESSAGEBOX_Y - 1, MESSAGEBOX_W + 2, 48 + 2, SOLID, ERASE);
|
||||
lcdDrawRect(MESSAGEBOX_X, MESSAGEBOX_Y, MESSAGEBOX_W, 48);
|
||||
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y, warningText, WARNING_LINE_LEN);
|
||||
// could be a place for a warningInfoText
|
||||
}
|
||||
@@ -54,11 +51,12 @@ const unsigned char ASTERISK_BITMAP[] = {
|
||||
void drawAlertBox(const char * title, const char * text, const char * action)
|
||||
{
|
||||
lcdClear();
|
||||
#if !defined(PCBI6)// || !defined(DEBUG)
|
||||
lcdDraw1bitBitmap(2, 0, ASTERISK_BITMAP, 0, 0);
|
||||
#else
|
||||
|
||||
#if defined(DEBUG) || (defined(PCBI6X_ELRS) && defined(TRANSLATIONS_PT)) // saves ~140B
|
||||
lcdDrawRect(2, 2, 32 - 4, 32 - 4);
|
||||
lcdDrawText(11, 6, "x", DBLSIZE);
|
||||
lcdDrawChar(11, 6, 'x', DBLSIZE);
|
||||
#else
|
||||
lcdDraw1bitBitmap(2, 0, ASTERISK_BITMAP, 0, 0);
|
||||
#endif
|
||||
|
||||
#define MESSAGE_LCD_OFFSET 6*FW
|
||||
@@ -90,8 +88,8 @@ void showAlertBox(const char * title, const char * text, const char * action , u
|
||||
|
||||
lcdRefresh();
|
||||
lcdSetContrast();
|
||||
clearKeyEvents();
|
||||
backlightOn();
|
||||
waitKeysReleased();
|
||||
resetBacklightTimeout();
|
||||
checkBacklight();
|
||||
}
|
||||
|
||||
@@ -100,9 +98,10 @@ void runPopupWarning(event_t event)
|
||||
warningResult = false;
|
||||
drawMessageBox();
|
||||
if (warningInfoText) {
|
||||
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, WARNING_INFO_FLAGS);
|
||||
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, warningInfoFlags);
|
||||
}
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+2*FH, warningType == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS);
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+4*FH+2, warningType == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS_ENTER_EXIT);
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
if (warningType == WARNING_TYPE_ASTERISK)
|
||||
@@ -113,11 +112,5 @@ void runPopupWarning(event_t event)
|
||||
warningText = NULL;
|
||||
warningType = WARNING_TYPE_ASTERISK;
|
||||
break;
|
||||
default:
|
||||
if (warningType != WARNING_TYPE_INPUT) break;
|
||||
s_editMode = EDIT_MODIFY_FIELD;
|
||||
warningInputValue = checkIncDec(event, warningInputValue, warningInputValueMin, warningInputValueMax);
|
||||
s_editMode = EDIT_SELECT_FIELD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,68 +21,160 @@
|
||||
#ifndef _POPUPS_H_
|
||||
#define _POPUPS_H_
|
||||
|
||||
#define MENU_X 10
|
||||
#define MENU_Y 16
|
||||
#define MENU_W LCD_W-(2*MENU_X)
|
||||
#define WARNING_LINE_LEN 20
|
||||
#define WARNING_LINE_X 16
|
||||
#define WARNING_LINE_Y 3*FH
|
||||
#include <inttypes.h>
|
||||
#include "buzzer.h"
|
||||
|
||||
extern const char * warningText;
|
||||
extern const char * warningInfoText;
|
||||
extern uint8_t warningInfoLength;
|
||||
extern uint8_t warningResult;
|
||||
extern uint8_t warningType;
|
||||
extern uint8_t warningInfoFlags;
|
||||
|
||||
#define MESSAGEBOX_X 8
|
||||
#define MESSAGEBOX_Y 8
|
||||
#define MESSAGEBOX_W (LCD_W - 15)
|
||||
|
||||
#define MENU_X MESSAGEBOX_X
|
||||
#define MENU_Y MESSAGEBOX_Y
|
||||
#define MENU_W MESSAGEBOX_W
|
||||
|
||||
#define WARNING_LINE_LEN 24
|
||||
#define WARNING_LINE_X 12
|
||||
#define WARNING_LINE_Y MESSAGEBOX_Y + 2
|
||||
|
||||
#define POPUP_MENU_MAX_LINES 12
|
||||
#define MENU_MAX_DISPLAY_LINES 6
|
||||
#define MENU_LINE_LENGTH (LEN_MODEL_NAME+12)
|
||||
|
||||
enum {
|
||||
MENU_OFFSET_INTERNAL,
|
||||
MENU_OFFSET_EXTERNAL
|
||||
};
|
||||
|
||||
typedef void (* PopupFunc)(event_t event);
|
||||
extern PopupFunc popupFunc;
|
||||
extern uint8_t popupMenuOffsetType;
|
||||
|
||||
extern uint16_t popupMenuOffset;
|
||||
extern const char * popupMenuItems[POPUP_MENU_MAX_LINES];
|
||||
extern uint16_t popupMenuItemsCount;
|
||||
typedef void (* PopupMenuHandler)(const char * result);
|
||||
extern PopupMenuHandler popupMenuHandler;
|
||||
extern const char * popupMenuTitle;
|
||||
extern uint8_t popupMenuSelectedItem;
|
||||
|
||||
// Message box
|
||||
void drawMessageBoxBackground(coord_t top, coord_t height);
|
||||
void drawMessageBox();
|
||||
void showMessageBox(const char * title);
|
||||
|
||||
// Popup menu
|
||||
const char * runPopupMenu(event_t event);
|
||||
void runPopupWarning(event_t event);
|
||||
|
||||
#define DRAW_MESSAGE_BOX(title) (warningText = title, drawMessageBox(), warningText = NULL)
|
||||
|
||||
extern void (*popupFunc)(event_t event);
|
||||
extern int16_t warningInputValue;
|
||||
extern int16_t warningInputValueMin;
|
||||
extern int16_t warningInputValueMax;
|
||||
extern uint8_t warningInfoFlags;
|
||||
enum
|
||||
{
|
||||
WARNING_TYPE_WAIT,
|
||||
WARNING_TYPE_INFO,
|
||||
WARNING_TYPE_ASTERISK,
|
||||
WARNING_TYPE_CONFIRM,
|
||||
WARNING_TYPE_INPUT
|
||||
};
|
||||
|
||||
#if !defined(GUI)
|
||||
#define DISPLAY_WARNING(...)
|
||||
#define POPUP_WARNING(...)
|
||||
#define POPUP_CONFIRMATION(...)
|
||||
#define POPUP_INPUT(...)
|
||||
#define WARNING_INFO_FLAGS 0
|
||||
#define SET_WARNING_INFO(...)
|
||||
#else
|
||||
#define DISPLAY_WARNING (*popupFunc)
|
||||
#define POPUP_WARNING(s) (warningText = s, warningInfoText = 0, popupFunc = runPopupWarning)
|
||||
#define POPUP_CONFIRMATION(s) (warningText = s, warningType = WARNING_TYPE_CONFIRM, warningInfoText = 0, popupFunc = runPopupWarning)
|
||||
#define POPUP_INPUT(s, func, start, min, max) (warningText = s, warningType = WARNING_TYPE_INPUT, popupFunc = func, warningInputValue = start, warningInputValueMin = min, warningInputValueMax = max)
|
||||
#define WARNING_INFO_FLAGS warningInfoFlags
|
||||
#define SET_WARNING_INFO(info, len, flags) (warningInfoText = info, warningInfoLength = len, warningInfoFlags = flags)
|
||||
#define DISPLAY_WARNING(evt) (*popupFunc)(evt)
|
||||
// #define POPUP_CONFIRMATION(s) (warningText = s, warningType = WARNING_TYPE_CONFIRM, warningInfoText = 0, popupFunc = runPopupWarning)
|
||||
// #define POPUP_INPUT(s, func) (warningText = s, popupFunc = func)
|
||||
#endif
|
||||
|
||||
|
||||
inline void POPUP_WARNING(const char * s)
|
||||
{
|
||||
// killAllEvents();
|
||||
warningText = s;
|
||||
warningInfoText = nullptr;
|
||||
warningType = WARNING_TYPE_ASTERISK;
|
||||
popupFunc = runPopupWarning;
|
||||
}
|
||||
|
||||
inline void POPUP_CONFIRMATION(const char * s/*, PopupMenuHandler handler*/)
|
||||
{
|
||||
if (s != warningText) {
|
||||
// killAllEvents();
|
||||
warningText = s;
|
||||
warningInfoText = nullptr;
|
||||
warningType = WARNING_TYPE_CONFIRM;
|
||||
popupFunc = runPopupWarning;
|
||||
// popupMenuHandler = handler;
|
||||
}
|
||||
}
|
||||
|
||||
inline void POPUP_INPUT(const char * s, PopupFunc func)
|
||||
{
|
||||
// killAllEvents();
|
||||
warningText = s;
|
||||
warningInfoText = nullptr;
|
||||
warningType = WARNING_TYPE_INPUT;
|
||||
popupFunc = func;
|
||||
}
|
||||
|
||||
inline void SET_WARNING_INFO(const char * info, uint8_t length, uint8_t flags)
|
||||
{
|
||||
warningInfoText = info;
|
||||
warningInfoLength = length;
|
||||
warningInfoFlags = flags;
|
||||
}
|
||||
|
||||
inline bool isEventCaughtByPopup()
|
||||
{
|
||||
if (warningText /*&& warningType != WARNING_TYPE_WAIT*/)
|
||||
return true;
|
||||
|
||||
if (popupMenuItemsCount > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
inline void POPUP_MENU_ADD_ITEM(const char * s)
|
||||
{
|
||||
popupMenuOffsetType = MENU_OFFSET_INTERNAL;
|
||||
if (popupMenuItemsCount < POPUP_MENU_MAX_LINES) {
|
||||
popupMenuItems[popupMenuItemsCount++] = s;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
#define POPUP_MENU_ADD_SD_ITEM(s) POPUP_MENU_ADD_ITEM(s)
|
||||
#else
|
||||
#define POPUP_MENU_ADD_SD_ITEM(s)
|
||||
#endif
|
||||
|
||||
#define NAVIGATION_MENUS
|
||||
#define POPUP_MENU_ADD_ITEM(s) do { popupMenuOffsetType = MENU_OFFSET_INTERNAL; if (popupMenuNoItems < POPUP_MENU_MAX_LINES) popupMenuItems[popupMenuNoItems++] = s; } while (0)
|
||||
#define POPUP_MENU_SELECT_ITEM(s) s_menu_item = (s > 0 ? (s < popupMenuNoItems ? s : popupMenuNoItems) : 0)
|
||||
#define POPUP_MENU_START(func) do { popupMenuHandler = (func); AUDIO_KEY_PRESS(); } while (0)
|
||||
#define POPUP_MENU_MAX_LINES 12
|
||||
#define MENU_MAX_DISPLAY_LINES 6
|
||||
#define MENU_LINE_LENGTH (LEN_MODEL_NAME+12)
|
||||
inline void POPUP_MENU_SELECT_ITEM(uint8_t index)
|
||||
{
|
||||
popupMenuSelectedItem = (index > 0 ? (index < popupMenuItemsCount ? index : popupMenuItemsCount) : 0);
|
||||
}
|
||||
|
||||
enum {
|
||||
MENU_OFFSET_INTERNAL,
|
||||
MENU_OFFSET_EXTERNAL
|
||||
};
|
||||
extern uint8_t popupMenuOffsetType;
|
||||
extern uint8_t s_menu_item;
|
||||
inline void POPUP_MENU_TITLE(const char * s)
|
||||
{
|
||||
popupMenuTitle = s;
|
||||
}
|
||||
|
||||
inline void POPUP_MENU_START(PopupMenuHandler handler)
|
||||
{
|
||||
if (handler != popupMenuHandler) {
|
||||
// killAllEvents();
|
||||
AUDIO_KEY_PRESS();
|
||||
popupMenuHandler = handler;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
extern uint16_t popupMenuOffset;
|
||||
extern const char * popupMenuItems[POPUP_MENU_MAX_LINES];
|
||||
extern uint16_t popupMenuNoItems;
|
||||
const char * runPopupMenu(event_t event);
|
||||
extern void (*popupMenuHandler)(const char * result);
|
||||
#endif
|
||||
|
||||
#endif // _POPUPS_H_
|
||||
|
||||
@@ -33,7 +33,7 @@ enum CalibrationState {
|
||||
|
||||
void menuCommonCalib(event_t event)
|
||||
{
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) { // get low and high vals for sticks and trims
|
||||
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) { // get low and high vals for sticks and trims
|
||||
int16_t vt = anaIn(i);
|
||||
reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[i]);
|
||||
reusableBuffer.calib.hiVals[i] = max(vt, reusableBuffer.calib.hiVals[i]);
|
||||
@@ -101,7 +101,7 @@ void menuCommonCalib(event_t event)
|
||||
// SET MIDPOINT
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
||||
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
|
||||
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
|
||||
reusableBuffer.calib.loVals[i] = 15000;
|
||||
reusableBuffer.calib.hiVals[i] = -15000;
|
||||
#if defined(PCBTARANIS)
|
||||
@@ -120,7 +120,7 @@ void menuCommonCalib(event_t event)
|
||||
// MOVE STICKS/POTS
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
||||
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
|
||||
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
|
||||
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
|
||||
g_eeGeneral.calib[i].mid = reusableBuffer.calib.midVals[i];
|
||||
int16_t v = reusableBuffer.calib.midVals[i] - reusableBuffer.calib.loVals[i];
|
||||
@@ -133,7 +133,7 @@ void menuCommonCalib(event_t event)
|
||||
|
||||
case CALIB_STORE:
|
||||
#if defined(PCBTARANIS)
|
||||
for (uint8_t i=POT1; i<=POT_LAST; i++) {
|
||||
for (uint32_t i=POT1; i<=POT_LAST; i++) {
|
||||
int idx = i - POT1;
|
||||
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
|
||||
if (IS_POT_MULTIPOS(i)) {
|
||||
@@ -172,7 +172,7 @@ void menuCommonCalib(event_t event)
|
||||
|
||||
void menuRadioCalibration(event_t event)
|
||||
{
|
||||
check_simple(event, MENU_RADIO_CALIBRATION, menuTabGeneral, DIM(menuTabGeneral), 0);
|
||||
check_submenu_simple(event, 0);
|
||||
TITLE(STR_MENUCALIBRATION);
|
||||
menuCommonCalib(READ_ONLY() ? 0 : event);
|
||||
if (menuEvent) {
|
||||
@@ -187,7 +187,7 @@ void menuFirstCalib(event_t event)
|
||||
chainMenu(menuMainView);
|
||||
}
|
||||
else {
|
||||
lcdDrawTextAlignedCenter(0*FH, MENUCALIBRATION);
|
||||
lcdDrawText(LCD_W / 2, 0, STR_MENUCALIBRATION, CENTERED);
|
||||
lcdInvertLine(0);
|
||||
menuCommonCalib(event);
|
||||
}
|
||||
|
||||
@@ -20,21 +20,19 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(MENU_DIAGANAS)
|
||||
#if defined(MENU_DIAG_ANAS_KEYS)
|
||||
void menuRadioDiagAnalogs(event_t event)
|
||||
{
|
||||
// TODO enum
|
||||
#if defined(TX_CAPACITY_MEASUREMENT)
|
||||
#define ANAS_ITEMS_COUNT 3
|
||||
#elif defined(PCBSKY9X)
|
||||
#define ANAS_ITEMS_COUNT 2
|
||||
#else
|
||||
#define ANAS_ITEMS_COUNT 1
|
||||
#endif
|
||||
|
||||
SIMPLE_MENU(STR_MENU_RADIO_ANALOGS, menuTabGeneral, MENU_RADIO_ANALOGS_TEST, HEADER_LINE+ANAS_ITEMS_COUNT);
|
||||
SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS, HEADER_LINE+ANAS_ITEMS_COUNT);
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
|
||||
for (uint32_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
|
||||
#if (NUM_STICKS+NUM_POTS+NUM_SLIDERS) > 9
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/3)*FH;
|
||||
const uint8_t x_coord[] = {0, 70, 154};
|
||||
@@ -47,7 +45,7 @@ void menuRadioDiagAnalogs(event_t event)
|
||||
drawStringWithIndex(x, y, "A", i+1);
|
||||
lcdDrawChar(lcdNextPos, y, ':');
|
||||
#endif
|
||||
lcdDrawHexNumber(x+3*FW-1, y, anaIn(i));
|
||||
lcdDrawNumber(x+3*FW-1, y, anaIn(i), LEADING0|LEFT, 4);
|
||||
lcdDrawNumber(x+10*FW-1, y, (int16_t)calibratedAnalogs[CONVERT_MODE(i)]*25/256, RIGHT);
|
||||
}
|
||||
|
||||
@@ -68,50 +66,8 @@ void menuRadioDiagAnalogs(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT + 1 + (NUM_STICKS+NUM_POTS+NUM_SLIDERS+1)/2 * FH + 2, STR_BATT_CALIB);
|
||||
putsVolts(LEN_CALIB_FIELDS*FW+FW, MENU_HEADER_HEIGHT + 1 + (NUM_STICKS+NUM_POTS+NUM_SLIDERS+1)/2 * FH + 2, getBatteryVoltage(), (menuVerticalPosition==HEADER_LINE ? INVERS | (s_editMode > 0 ? BLINK : 0) : 0) | PREC2 | LEFT);
|
||||
#elif defined(PCBSKY9X)
|
||||
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+1+4*FH, STR_BATT_CALIB);
|
||||
static int32_t adcBatt;
|
||||
// TODO board.cpp
|
||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
||||
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.txVoltageCalibration)/128) * 4191;
|
||||
batCalV /= 55296;
|
||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+4*FH, batCalV, (menuVerticalPosition==HEADER_LINE ? INVERS : 0));
|
||||
#else
|
||||
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT + 1 + (NUM_STICKS+NUM_POTS+NUM_SLIDERS+1)/2 * FH, STR_BATT_CALIB);
|
||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT + 1 + (NUM_STICKS+NUM_POTS+NUM_SLIDERS+1)/2 * FH, g_vbat100mV, (menuVerticalPosition==HEADER_LINE ? INVERS : 0));
|
||||
#endif
|
||||
|
||||
if (menuVerticalPosition == HEADER_LINE) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
|
||||
}
|
||||
|
||||
#if defined(TX_CAPACITY_MEASUREMENT)
|
||||
lcdDrawTextAlignedLeft(6*FH+1, STR_CURRENT_CALIB);
|
||||
drawValueWithUnit(LEN_CALIB_FIELDS*FW+4*FW, 6*FH+1, getCurrent(), UNIT_MILLIAMPS, (menuVerticalPosition==2 ? INVERS : 0)) ;
|
||||
if (menuVerticalPosition==2) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txCurrentCalibration, -49, 49);
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
#if defined(TX_CAPACITY_MEASUREMENT)
|
||||
#define TEMP_CALIB_POS 7*FH+1
|
||||
#define TEMP_CALIB_MENU_POS 3
|
||||
#else
|
||||
#define TEMP_CALIB_POS 6*FH+1
|
||||
#define TEMP_CALIB_MENU_POS 2
|
||||
#endif
|
||||
|
||||
lcdDrawTextAlignedLeft(TEMP_CALIB_POS, STR_TEMP_CALIB);
|
||||
drawValueWithUnit(LEN_CALIB_FIELDS*FW+4*FW, TEMP_CALIB_POS, getTemperature(), UNIT_TEMPERATURE, (menuVerticalPosition==TEMP_CALIB_MENU_POS ? INVERS : 0)) ;
|
||||
if (menuVerticalPosition==TEMP_CALIB_MENU_POS)
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.temperatureCalib, -100, 100);
|
||||
#endif
|
||||
|
||||
#if (NUM_PWMSTICKS > 0) && !defined(SIMU)
|
||||
lcdDrawTextAlignedLeft(7*FH, STICKS_PWM_ENABLED() ? "Sticks: PWM" : "Sticks: ANA");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif // MENU_DIAG_ANAS_KEYS
|
||||
|
||||
@@ -34,14 +34,14 @@ void displaySwitchState(uint8_t x, uint8_t y, uint8_t sw)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MENU_DIAGKEYS)
|
||||
#if defined(MENU_DIAG_ANAS_KEYS)
|
||||
void menuRadioDiagKeys(event_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENU_RADIO_SWITCHES, menuTabGeneral, MENU_RADIO_SWITCHES_TEST, 1);
|
||||
SIMPLE_SUBMENU(STR_MENU_RADIO_SWITCHES, 1);
|
||||
|
||||
lcdDrawText(14*FW, MENU_HEADER_HEIGHT+2*FH, STR_VTRIM);
|
||||
|
||||
for (uint8_t i=0; i<9; i++) {
|
||||
for (uint32_t i=0; i<9; i++) {
|
||||
coord_t y;
|
||||
|
||||
if (i < NUM_TRIMS_KEYS) {
|
||||
@@ -69,7 +69,7 @@ void menuRadioDiagKeys(event_t event)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
if (i < NUM_SWITCHES) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH+i);
|
||||
@@ -87,7 +87,7 @@ void menuRadioDiagKeys(event_t event)
|
||||
}
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
for (uint8_t i=0; i<DIM(rotencValue); i++) {
|
||||
for (uint32_t i=0; i<DIM(rotencValue); i++) {
|
||||
|
||||
#if defined(PCBX7)
|
||||
coord_t y = MENU_HEADER_HEIGHT + FH;
|
||||
|
||||
@@ -20,83 +20,19 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
#define HW_SETTINGS_COLUMN (2+(15*FW))
|
||||
enum MenuRadioHardwareItems {
|
||||
ITEM_RADIO_HARDWARE_OPTREX_DISPLAY,
|
||||
ITEM_RADIO_HARDWARE_STICKS_GAINS_LABELS,
|
||||
ITEM_RADIO_HARDWARE_STICK_LV_GAIN,
|
||||
ITEM_RADIO_HARDWARE_STICK_LH_GAIN,
|
||||
ITEM_RADIO_HARDWARE_STICK_RV_GAIN,
|
||||
ITEM_RADIO_HARDWARE_STICK_RH_GAIN,
|
||||
IF_ROTARY_ENCODERS(ITEM_RADIO_HARDWARE_ROTARY_ENCODER)
|
||||
CASE_BLUETOOTH(ITEM_RADIO_HARDWARE_BT_BAUDRATE)
|
||||
ITEM_RADIO_HARDWARE_MAX
|
||||
};
|
||||
#define HW_SETTINGS_COLUMN1 30
|
||||
#define HW_SETTINGS_COLUMN2 (HW_SETTINGS_COLUMN1 + 5*FW)
|
||||
#define HW_SETTINGS_COLUMN3 HW_SETTINGS_COLUMN2 + FW
|
||||
|
||||
void menuRadioHardware(event_t event)
|
||||
{
|
||||
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, ITEM_RADIO_HARDWARE_MAX+1, {0, 0, (uint8_t)-1, 0, 0, 0, IF_ROTARY_ENCODERS(0) CASE_BLUETOOTH(0)});
|
||||
|
||||
uint8_t sub = menuVerticalPosition - 1;
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i+menuVerticalOffset;
|
||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||
uint8_t attr = (sub == k ? blink : 0);
|
||||
|
||||
switch(k) {
|
||||
case ITEM_RADIO_HARDWARE_OPTREX_DISPLAY:
|
||||
g_eeGeneral.optrexDisplay = editChoice(HW_SETTINGS_COLUMN, y, STR_LCD, STR_VLCD, g_eeGeneral.optrexDisplay, 0, 1, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_HARDWARE_STICKS_GAINS_LABELS:
|
||||
lcdDrawTextAlignedLeft(y, "Sticks");
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_HARDWARE_STICK_LV_GAIN:
|
||||
case ITEM_RADIO_HARDWARE_STICK_LH_GAIN:
|
||||
case ITEM_RADIO_HARDWARE_STICK_RV_GAIN:
|
||||
case ITEM_RADIO_HARDWARE_STICK_RH_GAIN:
|
||||
{
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, "\002LVLHRVRH", k-ITEM_RADIO_HARDWARE_STICK_LV_GAIN, 0);
|
||||
lcdDrawText(INDENT_WIDTH+3*FW, y, "Gain");
|
||||
uint8_t mask = (1<<(k-ITEM_RADIO_HARDWARE_STICK_LV_GAIN));
|
||||
uint8_t val = (g_eeGeneral.sticksGain & mask ? 1 : 0);
|
||||
lcdDrawChar(HW_SETTINGS_COLUMN, y, val ? '2' : '1', attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, val, 0, 1);
|
||||
if (checkIncDec_Ret) {
|
||||
g_eeGeneral.sticksGain ^= mask;
|
||||
setSticksGain(g_eeGeneral.sticksGain);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(ROTARY_ENCODERS)
|
||||
case ITEM_RADIO_HARDWARE_ROTARY_ENCODER:
|
||||
g_eeGeneral.rotarySteps = editChoice(HW_SETTINGS_COLUMN, y, "Rotary Encoder", "\0062steps4steps", g_eeGeneral.rotarySteps, 0, 1, attr, event);
|
||||
break;
|
||||
#if defined(BATTGRAPH)
|
||||
#define CASE_BATTGRAPH(x) x,
|
||||
#else
|
||||
#define CASE_BATTGRAPH(x)
|
||||
#endif
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
case ITEM_RADIO_HARDWARE_BT_BAUDRATE:
|
||||
g_eeGeneral.bluetoothBaudrate = editChoice(HW_SETTINGS_COLUMN, y, STR_BAUDRATE, "\005115k 9600 19200", g_eeGeneral.bluetoothBaudrate, 0, 2, attr, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
btInit();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // PCBSKY9X
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
enum MenuRadioHardwareItems {
|
||||
ITEM_RADIO_HARDWARE_LABEL_STICKS,
|
||||
#if defined(PCBTARANIS) || defined(PCBI6X)
|
||||
enum {
|
||||
ITEM_RADIO_HARDWARE_LABEL_STICKS = 0,
|
||||
ITEM_RADIO_HARDWARE_STICK1,
|
||||
ITEM_RADIO_HARDWARE_STICK2,
|
||||
ITEM_RADIO_HARDWARE_STICK3,
|
||||
@@ -109,10 +45,14 @@ enum MenuRadioHardwareItems {
|
||||
ITEM_RADIO_HARDWARE_SB,
|
||||
ITEM_RADIO_HARDWARE_SC,
|
||||
ITEM_RADIO_HARDWARE_SD,
|
||||
#if NUM_SWITCHES > 4
|
||||
#if NUM_SWITCHES >= 5
|
||||
ITEM_RADIO_HARDWARE_SF,
|
||||
#endif
|
||||
#if NUM_SWITCHES >= 6
|
||||
ITEM_RADIO_HARDWARE_SH,
|
||||
#endif
|
||||
CASE_BATTGRAPH(ITEM_RADIO_HARDWARE_BATT_RANGE)
|
||||
ITEM_RADIO_HARDWARE_BATTERY_CALIB,
|
||||
ITEM_RADIO_HARDWARE_SERIAL_BAUDRATE,
|
||||
#if defined(BLUETOOTH)
|
||||
ITEM_RADIO_HARDWARE_BLUETOOTH_MODE,
|
||||
@@ -120,49 +60,100 @@ enum MenuRadioHardwareItems {
|
||||
ITEM_RADIO_HARDWARE_BLUETOOTH_LOCAL_ADDR,
|
||||
ITEM_RADIO_HARDWARE_BLUETOOTH_DISTANT_ADDR,
|
||||
ITEM_RADIO_HARDWARE_BLUETOOTH_NAME,
|
||||
#endif
|
||||
#if defined(AUX_SERIAL)
|
||||
ITEM_RADIO_HARDWARE_AUX_SERIAL_MODE,
|
||||
#endif
|
||||
ITEM_RADIO_HARDWARE_JITTER_FILTER,
|
||||
#if defined(MENU_DIAG_ANAS_KEYS)
|
||||
ITEM_RADIO_HARDWARE_DEBUG,
|
||||
#endif
|
||||
#if defined(EEPROM_RLC)
|
||||
#if !defined(PCBI6X)
|
||||
ITEM_RADIO_BACKUP_EEPROM,
|
||||
#endif
|
||||
ITEM_RADIO_FACTORY_RESET,
|
||||
#endif
|
||||
ITEM_RADIO_HARDWARE_MAX
|
||||
};
|
||||
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
|
||||
#if NUM_SWITCHES > 4
|
||||
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#if defined(PCBX3)
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1
|
||||
#else
|
||||
#define POTS_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#endif
|
||||
|
||||
#if NUM_SWITCHES == 6
|
||||
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#elif NUM_SWITCHES == 5
|
||||
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#elif NUM_SWITCHES == 4
|
||||
#define SWITCHES_ROWS NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1, NAVIGATION_LINE_BY_LINE|1
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBX3)
|
||||
#define BLUETOOTH_ROWS
|
||||
#elif defined(PCBTARANIS)
|
||||
#define BLUETOOTH_ROWS uint8_t(IS_BLUETOOTH_CHIP_PRESENT() ? 0 : HIDDEN_ROW), uint8_t(g_eeGeneral.bluetoothMode == BLUETOOTH_TELEMETRY ? -1 : HIDDEN_ROW), uint8_t(g_eeGeneral.bluetoothMode == BLUETOOTH_OFF ? HIDDEN_ROW : -1), uint8_t(g_eeGeneral.bluetoothMode == BLUETOOTH_OFF ? HIDDEN_ROW : -1), uint8_t(g_eeGeneral.bluetoothMode == BLUETOOTH_OFF ? HIDDEN_ROW : 0),
|
||||
#elif defined(BLUETOOTH)
|
||||
#define BLUETOOTH_ROWS 0, uint8_t(g_eeGeneral.bluetoothMode == BLUETOOTH_OFF ? HIDDEN_ROW : -1), uint8_t(g_eeGeneral.bluetoothMode == BLUETOOTH_OFF ? HIDDEN_ROW : -1), uint8_t(g_eeGeneral.bluetoothMode == BLUETOOTH_OFF ? HIDDEN_ROW : 0),
|
||||
#else
|
||||
#define BLUETOOTH_ROWS
|
||||
#endif
|
||||
#if defined(PCBXLITE)
|
||||
#if defined(PCBXLITE) || defined(PCBI6X)
|
||||
#define SWITCH_TYPE_MAX(sw) (SWITCH_3POS)
|
||||
#elif defined(PCBI6)
|
||||
#define SWITCH_TYPE_MAX(sw) ((MIXSRC_SC-MIXSRC_FIRST_SWITCH == sw) ? SWITCH_3POS : SWITCH_2POS)
|
||||
#else
|
||||
#define SWITCH_TYPE_MAX(sw) ((MIXSRC_SF-MIXSRC_FIRST_SWITCH == sw || MIXSRC_SH-MIXSRC_FIRST_SWITCH == sw) ? SWITCH_2POS : SWITCH_3POS)
|
||||
#endif
|
||||
|
||||
#define HW_SETTINGS_COLUMN1 30
|
||||
#define HW_SETTINGS_COLUMN2 (30 + 5*FW)
|
||||
#if defined(EEPROM_RLC)
|
||||
void onFactoryResetConfirm(const char result)
|
||||
{
|
||||
if (result) {
|
||||
warningResult = 0;
|
||||
showMessageBox(STR_STORAGE_FORMAT);
|
||||
storageEraseAll(false);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuRadioHardware(event_t event)
|
||||
{
|
||||
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, HEADER_LINE+ITEM_RADIO_HARDWARE_MAX, { HEADER_LINE_COLUMNS LABEL(Sticks), 0, 0, 0, 0, LABEL(Pots), POTS_ROWS, LABEL(Switches), SWITCHES_ROWS, 0/*max bauds*/, BLUETOOTH_ROWS 0/*jitter filter*/ });
|
||||
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, HEADER_LINE + ITEM_RADIO_HARDWARE_MAX, {
|
||||
HEADER_LINE_COLUMNS
|
||||
0 /* calibration button */,
|
||||
0 /* stick 1 */,
|
||||
0 /* stick 2 */,
|
||||
0 /* stick 3 */,
|
||||
0 /* stick 4 */,
|
||||
LABEL(Pots),
|
||||
POTS_ROWS,
|
||||
LABEL(Switches),
|
||||
SWITCHES_ROWS,
|
||||
CASE_BATTGRAPH(1)
|
||||
0 /* battery calib */,
|
||||
#if defined(CROSSFIRE)
|
||||
0 /* max bauds */,
|
||||
#endif
|
||||
0 /* Aux serial mode */,
|
||||
BLUETOOTH_ROWS
|
||||
0 /*jitter filter*/,
|
||||
#if defined(MENU_DIAG_ANAS_KEYS)
|
||||
1 /* debugs */,
|
||||
#endif
|
||||
0 /* factory reset */
|
||||
});
|
||||
|
||||
uint8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i+menuVerticalOffset;
|
||||
for (int j=0; j<=k; j++) {
|
||||
if (mstate_tab[j+HEADER_LINE] == HIDDEN_ROW)
|
||||
if (mstate_tab[j+HEADER_LINE] == HIDDEN_ROW) {
|
||||
k++;
|
||||
}
|
||||
}
|
||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||
uint8_t attr = (sub == k ? blink : 0);
|
||||
@@ -170,6 +161,10 @@ void menuRadioHardware(event_t event)
|
||||
switch(k) {
|
||||
case ITEM_RADIO_HARDWARE_LABEL_STICKS:
|
||||
lcdDrawTextAlignedLeft(y, STR_STICKS);
|
||||
lcdDrawText(HW_SETTINGS_COLUMN2, y, STR_CALIB_BTN, attr);
|
||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
||||
pushMenu(menuRadioCalibration);
|
||||
}
|
||||
break;
|
||||
case ITEM_RADIO_HARDWARE_STICK1:
|
||||
case ITEM_RADIO_HARDWARE_STICK2:
|
||||
@@ -188,7 +183,7 @@ void menuRadioHardware(event_t event)
|
||||
int idx = k - ITEM_RADIO_HARDWARE_POT1;
|
||||
uint8_t shift = (2*idx);
|
||||
uint8_t mask = (0x03 << shift);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, NUM_STICKS+idx+1, menuHorizontalPosition < 0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, NUM_STICKS+idx+1, /*menuHorizontalPosition < 0 ? attr :*/ 0);
|
||||
if (ZEXIST(g_eeGeneral.anaNames[NUM_STICKS+idx]) || (attr && s_editMode > 0 && menuHorizontalPosition == 0))
|
||||
editName(HW_SETTINGS_COLUMN1, y, g_eeGeneral.anaNames[NUM_STICKS+idx], LEN_ANA_NAME, event, attr && menuHorizontalPosition == 0);
|
||||
else
|
||||
@@ -208,14 +203,16 @@ void menuRadioHardware(event_t event)
|
||||
case ITEM_RADIO_HARDWARE_SB:
|
||||
case ITEM_RADIO_HARDWARE_SC:
|
||||
case ITEM_RADIO_HARDWARE_SD:
|
||||
#if NUM_SWITCHES > 4
|
||||
#if NUM_SWITCHES >= 5
|
||||
case ITEM_RADIO_HARDWARE_SF:
|
||||
#endif
|
||||
#if NUM_SWITCHES >= 6
|
||||
case ITEM_RADIO_HARDWARE_SH:
|
||||
#endif
|
||||
{
|
||||
int index = k-ITEM_RADIO_HARDWARE_SA;
|
||||
int config = SWITCH_CONFIG(index);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, MIXSRC_FIRST_SWITCH-MIXSRC_Rud+index+1, menuHorizontalPosition < 0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, MIXSRC_FIRST_SWITCH-MIXSRC_Rud+index+1, /*menuHorizontalPosition < 0 ? attr :*/ 0);
|
||||
if (ZEXIST(g_eeGeneral.switchNames[index]) || (attr && s_editMode > 0 && menuHorizontalPosition == 0))
|
||||
editName(HW_SETTINGS_COLUMN1, y, g_eeGeneral.switchNames[index], LEN_SWITCH_NAME, event, menuHorizontalPosition == 0 ? attr : 0);
|
||||
else
|
||||
@@ -228,14 +225,38 @@ void menuRadioHardware(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM_RADIO_HARDWARE_SERIAL_BAUDRATE:
|
||||
g_eeGeneral.telemetryBaudrate = editChoice(HW_SETTINGS_COLUMN2, y, STR_MAXBAUDRATE, "\0043.7M1.8M921k400k115k", g_eeGeneral.telemetryBaudrate, 0, DIM(CROSSFIRE_BAUDRATES) - 1, attr, event);
|
||||
#if defined(BATTGRAPH)
|
||||
case ITEM_RADIO_HARDWARE_BATT_RANGE:
|
||||
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
|
||||
putsVolts(HW_SETTINGS_COLUMN3, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|NO_UNIT);
|
||||
lcdDrawChar(lcdNextPos, y, '-');
|
||||
putsVolts(lcdNextPos, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|NO_UNIT);
|
||||
if (attr && s_editMode>0) {
|
||||
if (menuHorizontalPosition==0)
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -60, g_eeGeneral.vBatMax+29); // min=3.0V
|
||||
else
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMax, g_eeGeneral.vBatMin-29, +40); // max=16.0V
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_RADIO_HARDWARE_BATTERY_CALIB:
|
||||
lcdDrawTextAlignedLeft(y, STR_BATT_CALIB);
|
||||
putsVolts(HW_SETTINGS_COLUMN3, y, getBatteryVoltage(), attr|PREC2|LEFT);
|
||||
if (attr) {
|
||||
if (checkIncDec_Ret) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
case ITEM_RADIO_HARDWARE_SERIAL_BAUDRATE:
|
||||
g_eeGeneral.telemetryBaudrate = editChoice(HW_SETTINGS_COLUMN2, y, STR_MAXBAUDRATE, "\005400k 115k 921k 1.87M3.75M5.25M", g_eeGeneral.telemetryBaudrate, 0, DIM(CROSSFIRE_BAUDRATES) - 1, attr, event);
|
||||
if (attr) {
|
||||
storageDirty(EE_GENERAL);
|
||||
if (checkIncDec_Ret && IS_EXTERNAL_MODULE_ON()) {
|
||||
pauseMixerCalculations();
|
||||
pausePulses();
|
||||
EXTERNAL_MODULE_OFF();
|
||||
storageDirty(EE_GENERAL);
|
||||
RTOS_WAIT_MS(20); // 20ms so that the pulses interrupt will reinit the frame rate
|
||||
telemetryProtocol = 255; // force telemetry port + module reinitialization
|
||||
EXTERNAL_MODULE_ON();
|
||||
@@ -244,42 +265,58 @@ void menuRadioHardware(event_t event)
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
case ITEM_RADIO_HARDWARE_BLUETOOTH_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_BLUETOOTH);
|
||||
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN2, y, STR_BLUETOOTH_MODES, g_eeGeneral.bluetoothMode, attr);
|
||||
if (g_eeGeneral.bluetoothMode != BLUETOOTH_OFF && !IS_BLUETOOTH_CHIP_PRESENT()) {
|
||||
g_eeGeneral.bluetoothMode = BLUETOOTH_OFF;
|
||||
#if defined(AUX_SERIAL)
|
||||
case ITEM_RADIO_HARDWARE_AUX_SERIAL_MODE:
|
||||
g_eeGeneral.auxSerialMode = editChoice(HW_SETTINGS_COLUMN2, y, STR_AUX_SERIAL_MODE, STR_AUX_SERIAL_MODES, g_eeGeneral.auxSerialMode, 0, UART_MODE_MAX, attr, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
auxSerialInit(g_eeGeneral.auxSerialMode, modelTelemetryProtocol());
|
||||
storageDirty(EE_GENERAL);
|
||||
}
|
||||
if (attr) {
|
||||
g_eeGeneral.bluetoothMode = checkIncDecGen(event, g_eeGeneral.bluetoothMode, BLUETOOTH_OFF, BLUETOOTH_TRAINER);
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_HARDWARE_BLUETOOTH_PAIRING_CODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_BLUETOOTH_PIN_CODE);
|
||||
lcdDrawText(HW_SETTINGS_COLUMN2, y, "0000");
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_HARDWARE_BLUETOOTH_LOCAL_ADDR:
|
||||
lcdDrawTextAlignedLeft(y, STR_BLUETOOTH_LOCAL_ADDR);
|
||||
lcdDrawText(HW_SETTINGS_COLUMN2, y, bluetoothLocalAddr[0] == '\0' ? "---" : bluetoothLocalAddr);
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_HARDWARE_BLUETOOTH_DISTANT_ADDR:
|
||||
lcdDrawTextAlignedLeft(y, STR_BLUETOOTH_DIST_ADDR);
|
||||
lcdDrawText(HW_SETTINGS_COLUMN2, y, bluetoothDistantAddr[0] == '\0' ? "---" : bluetoothDistantAddr);
|
||||
break;
|
||||
|
||||
case ITEM_RADIO_HARDWARE_BLUETOOTH_NAME:
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_NAME);
|
||||
editName(HW_SETTINGS_COLUMN2, y, g_eeGeneral.bluetoothName, LEN_BLUETOOTH_NAME, event, attr);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_RADIO_HARDWARE_JITTER_FILTER:
|
||||
g_eeGeneral.jitterFilter = 1 - editCheckBox(1 - g_eeGeneral.jitterFilter, HW_SETTINGS_COLUMN2, y, STR_JITTER_FILTER, attr, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
storageDirty(EE_GENERAL);
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(MENU_DIAG_ANAS_KEYS)
|
||||
case ITEM_RADIO_HARDWARE_DEBUG:
|
||||
lcdDrawTextAlignedLeft(y, STR_DEBUG);
|
||||
lcdDrawText(HW_SETTINGS_COLUMN2, y, STR_ANALOGS_BTN, menuHorizontalPosition == 0 ? attr : 0);
|
||||
lcdDrawText(lcdLastRightPos + 2, y, STR_KEYS_BTN, menuHorizontalPosition == 1 ? attr : 0);
|
||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
||||
if (menuHorizontalPosition == 0)
|
||||
pushMenu(menuRadioDiagAnalogs);
|
||||
else
|
||||
pushMenu(menuRadioDiagKeys);
|
||||
}
|
||||
break;
|
||||
#endif // MENU_DIAG_ANAS_KEYS
|
||||
#if defined(SDCARD)
|
||||
case ITEM_RADIO_BACKUP_EEPROM:
|
||||
lcdDrawTextAlignedLeft(y, BUTTON(STR_EEBACKUP), attr);
|
||||
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
|
||||
s_editMode = EDIT_SELECT_FIELD;
|
||||
eepromBackup();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case ITEM_RADIO_FACTORY_RESET:
|
||||
onFactoryResetConfirm(warningResult);
|
||||
if (LCD_W < 212)
|
||||
lcdDrawText(LCD_W / 2, y, BUTTON(TR_FACTORYRESET), attr | CENTERED);
|
||||
else
|
||||
lcdDrawText(HW_SETTINGS_COLUMN2, y, BUTTON(TR_FACTORYRESET), attr);
|
||||
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = EDIT_SELECT_FIELD;
|
||||
// POPUP_CONFIRMATION(STR_CONFIRMRESET, onFactoryResetConfirm);
|
||||
POPUP_CONFIRMATION(STR_CONFIRMRESET);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,15 +26,13 @@ const unsigned char sticks[] = {
|
||||
#include "sticks.lbm"
|
||||
};
|
||||
|
||||
#define RADIO_SETUP_2ND_COLUMN (LCD_W-6*FW-3)
|
||||
#define RADIO_SETUP_DATE_COLUMN (FW*15+7)
|
||||
#define RADIO_SETUP_TIME_COLUMN (FW*15+9)
|
||||
#define RADIO_SETUP_2ND_COLUMN 79
|
||||
|
||||
#define SLIDER_5POS(y, value, label, event, attr) { \
|
||||
int8_t tmp = value; \
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
||||
value = editChoice(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \
|
||||
}
|
||||
int8_t slider_5pos(coord_t y, int8_t value, event_t event, uint8_t attr, const char* title)
|
||||
{
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, LCD_W - 2 - RADIO_SETUP_2ND_COLUMN, 2+value, 4, attr);
|
||||
return editChoice(RADIO_SETUP_2ND_COLUMN, y, title, nullptr, value, -2, +2, attr, event, INDENT_WIDTH);
|
||||
}
|
||||
|
||||
#if defined(SPLASH)
|
||||
#define CASE_SPLASH_PARAM(x) x,
|
||||
@@ -42,16 +40,9 @@ const unsigned char sticks[] = {
|
||||
#define CASE_SPLASH_PARAM(x)
|
||||
#endif
|
||||
|
||||
#if defined(BATTGRAPH)
|
||||
#define CASE_BATTGRAPH(x) x,
|
||||
#else
|
||||
#define CASE_BATTGRAPH(x)
|
||||
#endif
|
||||
|
||||
enum MenuRadioSetupItems {
|
||||
CASE_RTCLOCK(ITEM_SETUP_DATE)
|
||||
CASE_RTCLOCK(ITEM_SETUP_TIME)
|
||||
CASE_BATTGRAPH(ITEM_SETUP_BATT_RANGE)
|
||||
ITEM_SETUP_SOUND_LABEL,
|
||||
CASE_AUDIO(ITEM_SETUP_BEEP_MODE)
|
||||
CASE_BUZZER(ITEM_SETUP_BUZZER_MODE)
|
||||
@@ -59,7 +50,7 @@ enum MenuRadioSetupItems {
|
||||
ITEM_SETUP_BEEP_VOLUME,
|
||||
ITEM_SETUP_BEEP_LENGTH,
|
||||
ITEM_SETUP_SPEAKER_PITCH,
|
||||
// ITEM_SETUP_WAV_VOLUME,
|
||||
CASE_DFPLAYER(ITEM_SETUP_WAV_VOLUME)
|
||||
// ITEM_SETUP_BACKGROUND_VOLUME,
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_LABEL)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_VOLUME)
|
||||
@@ -70,35 +61,37 @@ enum MenuRadioSetupItems {
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_MODE)
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_LENGTH)
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_STRENGTH)
|
||||
ITEM_SETUP_CONTRAST,
|
||||
ITEM_SETUP_ALARMS_LABEL,
|
||||
ITEM_SETUP_BATTERY_WARNING,
|
||||
CASE_CAPACITY(ITEM_SETUP_CAPACITY_WARNING)
|
||||
CASE_PCBSKY9X(ITEM_SETUP_TEMPERATURE_WARNING)
|
||||
ITEM_SETUP_INACTIVITY_ALARM,
|
||||
ITEM_SETUP_MEMORY_WARNING,
|
||||
ITEM_SETUP_ALARM_WARNING,
|
||||
#if defined(PWR_BUTTON_SOFT)
|
||||
ITEM_SETUP_RSSI_POWEROFF_ALARM,
|
||||
#endif
|
||||
IF_ROTARY_ENCODERS(ITEM_SETUP_RE_NAVIGATION)
|
||||
ITEM_SETUP_BACKLIGHT_LABEL,
|
||||
ITEM_SETUP_BACKLIGHT_MODE,
|
||||
ITEM_SETUP_BACKLIGHT_DELAY,
|
||||
// ITEM_SETUP_BRIGHTNESS,
|
||||
ITEM_SETUP_BRIGHTNESS,
|
||||
CASE_PWM_BACKLIGHT(ITEM_SETUP_BACKLIGHT_BRIGHTNESS_OFF)
|
||||
CASE_PWM_BACKLIGHT(ITEM_SETUP_BACKLIGHT_BRIGHTNESS_ON)
|
||||
ITEM_SETUP_FLASH_BEEP,
|
||||
ITEM_SETUP_CONTRAST,
|
||||
CASE_SPLASH_PARAM(ITEM_SETUP_DISABLE_SPLASH)
|
||||
CASE_GPS(ITEM_SETUP_TIMEZONE)
|
||||
#if defined(PXX2)
|
||||
ITEM_RADIO_OWNER_ID,
|
||||
#endif
|
||||
// CASE_GPS(ITEM_SETUP_TIMEZONE)
|
||||
// ITEM_SETUP_ADJUST_RTC,
|
||||
CASE_GPS(ITEM_SETUP_GPSFORMAT)
|
||||
CASE_PXX(ITEM_SETUP_COUNTRYCODE)
|
||||
// ITEM_SETUP_LANGUAGE,
|
||||
// ITEM_SETUP_IMPERIAL,
|
||||
ITEM_SETUP_PPM,
|
||||
IF_FAI_CHOICE(ITEM_SETUP_FAI)
|
||||
ITEM_SETUP_SWITCHES_DELAY,
|
||||
#if defined(PCBI6)
|
||||
ITEM_SETUP_USB_ENABLE,
|
||||
#endif
|
||||
CASE_STM32(ITEM_SETUP_USB_MODE)
|
||||
ITEM_SETUP_RX_CHANNEL_ORD,
|
||||
ITEM_SETUP_STICK_MODE_LABELS,
|
||||
@@ -135,12 +128,46 @@ void menuRadioSetup(event_t event)
|
||||
#endif
|
||||
|
||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, MENU_RADIO_SETUP, HEADER_LINE+ITEM_SETUP_MAX, {
|
||||
HEADER_LINE_COLUMNS CASE_RTCLOCK(2) CASE_RTCLOCK(2) CASE_BATTGRAPH(1)
|
||||
LABEL(SOUND), CASE_AUDIO(0) CASE_BUZZER(0) /*0,*/ 0, 0, 0, /*0,*/ CASE_AUDIO(0)
|
||||
CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0)
|
||||
CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0,
|
||||
LABEL(ALARMS), 0, CASE_CAPACITY(0) CASE_PCBSKY9X(0) 0, 0, 0, 0, IF_ROTARY_ENCODERS(0)
|
||||
LABEL(BACKLIGHT), 0, 0, /*0,*/ CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(0) 0, CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) 0, CASE_STM32(0) 0, COL_TX_MODE, 0, 1/*to force edit mode*/});
|
||||
HEADER_LINE_COLUMNS CASE_RTCLOCK(2) CASE_RTCLOCK(2)
|
||||
LABEL(SOUND), CASE_AUDIO(0)
|
||||
CASE_BUZZER(0)
|
||||
/*0,*/ 0, 0, 0, CASE_DFPLAYER(0) CASE_AUDIO(0)
|
||||
CASE_VARIO(LABEL(VARIO))
|
||||
CASE_VARIO(0)
|
||||
CASE_VARIO(0)
|
||||
CASE_VARIO(0)
|
||||
CASE_VARIO(0)
|
||||
CASE_HAPTIC(LABEL(HAPTIC))
|
||||
CASE_HAPTIC(0)
|
||||
CASE_HAPTIC(0)
|
||||
CASE_HAPTIC(0)
|
||||
LABEL(ALARMS), 0, CASE_CAPACITY(0)
|
||||
0, 0, 0,
|
||||
#if defined(PWR_BUTTON_SOFT)
|
||||
0, /* rssi poweroff alarm */
|
||||
#endif
|
||||
IF_ROTARY_ENCODERS(0)
|
||||
LABEL(BACKLIGHT), 0, 0,
|
||||
0, /* backlight */
|
||||
CASE_PWM_BACKLIGHT(0)
|
||||
CASE_PWM_BACKLIGHT(0)
|
||||
0, /* alarm */
|
||||
0, // Contrast
|
||||
CASE_SPLASH_PARAM(0)
|
||||
#if defined(PXX2)
|
||||
0 /* owner registration ID */,
|
||||
#endif
|
||||
/*CASE_GPS(0)*/
|
||||
/*0, rtc */
|
||||
CASE_GPS(0)
|
||||
CASE_PXX(0)
|
||||
/*0, 0,*/ /* voice language, imperial */
|
||||
0, /* PPM Unit */
|
||||
IF_FAI_CHOICE(0)
|
||||
0,
|
||||
CASE_STM32(0) // USB mode
|
||||
0,
|
||||
COL_TX_MODE, 0, 1/*to force edit mode*/});
|
||||
|
||||
if (event == EVT_ENTRY) {
|
||||
reusableBuffer.generalSettings.stickMode = g_eeGeneral.stickMode;
|
||||
@@ -148,7 +175,7 @@ void menuRadioSetup(event_t event)
|
||||
|
||||
uint8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
for (uint32_t i=0; i<LCD_LINES-1; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i + menuVerticalOffset;
|
||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||
@@ -158,17 +185,17 @@ void menuRadioSetup(event_t event)
|
||||
#if defined(RTCLOCK)
|
||||
case ITEM_SETUP_DATE:
|
||||
lcdDrawTextAlignedLeft(y, STR_DATE);
|
||||
lcdDrawChar(RADIO_SETUP_DATE_COLUMN, y, '-');
|
||||
lcdDrawChar(RADIO_SETUP_DATE_COLUMN+3*FW-2, y, '-');
|
||||
for (uint8_t j=0; j<3; j++) {
|
||||
for (uint32_t j=0; j<3; j++) {
|
||||
uint8_t rowattr = (menuHorizontalPosition==j ? attr : 0);
|
||||
switch (j) {
|
||||
case 0:
|
||||
lcdDrawNumber(RADIO_SETUP_DATE_COLUMN, y, t.tm_year+TM_YEAR_BASE, rowattr|RIGHT);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, t.tm_year+TM_YEAR_BASE, rowattr|RIGHT);
|
||||
lcdDrawChar(lcdNextPos, y, '-');
|
||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_year = checkIncDec(event, t.tm_year, 112, 200, 0);
|
||||
break;
|
||||
case 1:
|
||||
lcdDrawNumber(RADIO_SETUP_DATE_COLUMN+3*FW-2, y, t.tm_mon+1, rowattr|LEADING0|RIGHT, 2);
|
||||
lcdDrawNumber(lcdNextPos+3*FW-2, y, t.tm_mon+1, rowattr|LEADING0|RIGHT, 2);
|
||||
lcdDrawChar(lcdNextPos, y, '-');
|
||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mon = checkIncDec(event, t.tm_mon, 0, 11, 0);
|
||||
break;
|
||||
case 2:
|
||||
@@ -177,7 +204,7 @@ void menuRadioSetup(event_t event)
|
||||
int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0);
|
||||
static const uint8_t dmon[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
dlim += dmon[t.tm_mon];
|
||||
lcdDrawNumber(RADIO_SETUP_DATE_COLUMN+6*FW-4, y, t.tm_mday, rowattr|LEADING0|RIGHT, 2);
|
||||
lcdDrawNumber(lcdNextPos+6*FW-4, y, t.tm_mday, rowattr|LEADING0|RIGHT, 2);
|
||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
|
||||
break;
|
||||
}
|
||||
@@ -190,20 +217,21 @@ void menuRadioSetup(event_t event)
|
||||
|
||||
case ITEM_SETUP_TIME:
|
||||
lcdDrawTextAlignedLeft(y, STR_TIME);
|
||||
lcdDrawChar(RADIO_SETUP_TIME_COLUMN+1, y, ':'); lcdDrawChar(RADIO_SETUP_TIME_COLUMN+3*FW-2, y, ':');
|
||||
for (uint8_t j=0; j<3; j++) {
|
||||
for (uint32_t j=0; j<3; j++) {
|
||||
uint8_t rowattr = (menuHorizontalPosition==j ? attr : 0);
|
||||
switch (j) {
|
||||
case 0:
|
||||
lcdDrawNumber(RADIO_SETUP_TIME_COLUMN, y, t.tm_hour, rowattr|LEADING0|RIGHT, 2);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, t.tm_hour, rowattr|LEADING0|RIGHT, 2);
|
||||
lcdDrawChar(lcdNextPos + 1, y, ':');
|
||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_hour = checkIncDec(event, t.tm_hour, 0, 23, 0);
|
||||
break;
|
||||
case 1:
|
||||
lcdDrawNumber(RADIO_SETUP_TIME_COLUMN+3*FWNUM, y, t.tm_min, rowattr|LEADING0|RIGHT, 2);
|
||||
lcdDrawNumber(lcdNextPos + 1, y, t.tm_min, rowattr|LEADING0|RIGHT, 2);
|
||||
lcdDrawChar(lcdNextPos + 1, y, ':');
|
||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_min = checkIncDec(event, t.tm_min, 0, 59, 0);
|
||||
break;
|
||||
case 2:
|
||||
lcdDrawNumber(RADIO_SETUP_TIME_COLUMN+6*FWNUM, y, t.tm_sec, rowattr|LEADING0|RIGHT, 2);
|
||||
lcdDrawNumber(lcdNextPos + 1, y, t.tm_sec, rowattr|LEADING0|RIGHT, 2);
|
||||
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_sec = checkIncDec(event, t.tm_sec, 0, 59, 0);
|
||||
break;
|
||||
}
|
||||
@@ -214,56 +242,32 @@ void menuRadioSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(BATTGRAPH)
|
||||
case ITEM_SETUP_BATT_RANGE:
|
||||
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
|
||||
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|LEFT|NO_UNIT);
|
||||
lcdDrawChar(lcdLastRightPos, y, '-');
|
||||
putsVolts(lcdLastRightPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
|
||||
if (attr && s_editMode>0) {
|
||||
if (menuHorizontalPosition==0)
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -50, g_eeGeneral.vBatMax+29); // min=4.0V
|
||||
else
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMax, g_eeGeneral.vBatMin-29, +40); // max=16.0V
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_SOUND_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_SOUND_LABEL);
|
||||
break;
|
||||
|
||||
#if defined(AUDIO)
|
||||
case ITEM_SETUP_BEEP_MODE:
|
||||
g_eeGeneral.beepMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr, event);
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
if (attr && checkIncDec_Ret) frskySendAlarms();
|
||||
#endif
|
||||
g_eeGeneral.beepMode = editChoice(LCD_W-2, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr|RIGHT, event, INDENT_WIDTH);
|
||||
break;
|
||||
|
||||
#if defined(BUZZER) // AUDIO + BUZZER
|
||||
case ITEM_SETUP_BUZZER_MODE:
|
||||
g_eeGeneral.buzzerMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_BUZZER, STR_VBEEPMODE, g_eeGeneral.buzzerMode, -2, 1, attr, event);
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
if (attr && checkIncDec_Ret) frskySendAlarms();
|
||||
#endif
|
||||
g_eeGeneral.buzzerMode = editChoice(LCD_W-2, y, STR_BUZZER, STR_VBEEPMODE, g_eeGeneral.buzzerMode, -2, 1, attr|RIGHT, event, INDENT_WIDTH);
|
||||
break;
|
||||
#endif
|
||||
#elif defined(BUZZER) // BUZZER only
|
||||
case ITEM_SETUP_BUZZER_MODE:
|
||||
g_eeGeneral.beepMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr, event);
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
if (attr && checkIncDec_Ret) frskySendAlarms();
|
||||
#endif
|
||||
g_eeGeneral.beepMode = editChoice(LCD_W-2, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr|RIGHT, event, INDENT_WIDTH);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(VOICE)
|
||||
case ITEM_SETUP_SPEAKER_VOLUME:
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, STR_SPEAKER_VOLUME);
|
||||
lcdDrawTextIndented(y, STR_SPEAKER_VOLUME);
|
||||
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, LCD_W - 2 - RADIO_SETUP_2ND_COLUMN, b, VOLUME_LEVEL_MAX, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, b, 0, VOLUME_LEVEL_MAX);
|
||||
if (checkIncDec_Ret) {
|
||||
@@ -275,26 +279,38 @@ void menuRadioSetup(event_t event)
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_BEEP_VOLUME:
|
||||
SLIDER_5POS(y, g_eeGeneral.beepVolume, STR_BEEP_VOLUME, event, attr);
|
||||
g_eeGeneral.beepVolume = slider_5pos(y, g_eeGeneral.beepVolume, event, attr, STR_BEEP_VOLUME);
|
||||
break;
|
||||
// case ITEM_SETUP_WAV_VOLUME:
|
||||
// SLIDER_5POS(y, g_eeGeneral.wavVolume, STR_WAV_VOLUME, event, attr);
|
||||
// break;
|
||||
|
||||
#if defined(DFPLAYER)
|
||||
case ITEM_SETUP_WAV_VOLUME:
|
||||
{
|
||||
int8_t vol = g_eeGeneral.wavVolume;
|
||||
g_eeGeneral.wavVolume = slider_5pos(y, g_eeGeneral.wavVolume, event, attr, STR_WAV_VOLUME);
|
||||
if (vol != g_eeGeneral.wavVolume) {
|
||||
dfplayerSetVolume(g_eeGeneral.wavVolume);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
// case ITEM_SETUP_BACKGROUND_VOLUME:
|
||||
// SLIDER_5POS(y, g_eeGeneral.backgroundVolume, STR_BG_VOLUME, event, attr);
|
||||
// g_eeGeneral.backgroundVolume = slider_5pos(y, g_eeGeneral.backgroundVolume, event, attr, STR_BG_VOLUME);
|
||||
// break;
|
||||
|
||||
case ITEM_SETUP_BEEP_LENGTH:
|
||||
SLIDER_5POS(y, g_eeGeneral.beepLength, STR_BEEP_LENGTH, event, attr);
|
||||
g_eeGeneral.beepLength = slider_5pos(y, g_eeGeneral.beepLength, event, attr, STR_BEEP_LENGTH);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_SPEAKER_PITCH:
|
||||
lcdDrawTextAlignedLeft( y, STR_SPKRPITCH);
|
||||
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 20);
|
||||
{
|
||||
lcdDrawTextIndented(y, STR_SPKRPITCH);
|
||||
lcdDrawNumber(LCD_W-14, y, g_eeGeneral.speakerPitch*15, attr|RIGHT);
|
||||
coord_t lp = lcdLastLeftPos - FW;
|
||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||
lcdDrawChar(lp, y, '+', attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 20);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -303,23 +319,23 @@ void menuRadioSetup(event_t event)
|
||||
lcdDrawTextAlignedLeft(y, STR_VARIO);
|
||||
break;
|
||||
case ITEM_SETUP_VARIO_VOLUME:
|
||||
SLIDER_5POS(y, g_eeGeneral.varioVolume, TR_SPEAKER_VOLUME, event, attr);
|
||||
g_eeGeneral.varioVolume = slider_5pos(y, g_eeGeneral.varioVolume, event, attr, TR_SPEAKER_VOLUME);
|
||||
break;
|
||||
case ITEM_SETUP_VARIO_PITCH:
|
||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
||||
lcdDrawTextIndented(y, STR_PITCH_AT_ZERO);
|
||||
lcdDrawNumber(LCD_W-14, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|RIGHT);
|
||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
||||
break;
|
||||
case ITEM_SETUP_VARIO_RANGE:
|
||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_MAX);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
|
||||
lcdDrawTextIndented(y, STR_PITCH_AT_MAX);
|
||||
lcdDrawNumber(LCD_W-14, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|RIGHT);
|
||||
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
||||
break;
|
||||
case ITEM_SETUP_VARIO_REPEAT:
|
||||
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
||||
lcdDrawTextIndented(y, STR_REPEAT_AT_ZERO);
|
||||
lcdDrawNumber(LCD_W-14, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|RIGHT);
|
||||
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
||||
break;
|
||||
@@ -331,21 +347,21 @@ void menuRadioSetup(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_HAPTIC_MODE:
|
||||
g_eeGeneral.hapticMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_MODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event);
|
||||
g_eeGeneral.hapticMode = editChoice(LCD_W-2s, y, TR_MODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr|RIGHT, event);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_HAPTIC_LENGTH:
|
||||
SLIDER_5POS(y, g_eeGeneral.hapticLength, STR_LENGTH, event, attr);
|
||||
g_eeGeneral.hapticLength = slider_5pos(y, g_eeGeneral.hapticLength, event, attr, STR_LENGTH);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_HAPTIC_STRENGTH:
|
||||
SLIDER_5POS(y, g_eeGeneral.hapticStrength, STR_HAPTICSTRENGTH, event, attr);
|
||||
g_eeGeneral.hapticStrength = slider_5pos(y, g_eeGeneral.hapticStrength, event, attr, STR_HAPTICSTRENGTH);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_CONTRAST:
|
||||
lcdDrawTextAlignedLeft(y, STR_CONTRAST);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.contrast, attr|LEFT);
|
||||
lcdDrawTextIndented(y, STR_CONTRAST);
|
||||
lcdDrawNumber(LCD_W-2, y, g_eeGeneral.contrast, attr|RIGHT);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX);
|
||||
lcdSetContrast();
|
||||
@@ -357,31 +373,32 @@ void menuRadioSetup(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_BATTERY_WARNING:
|
||||
lcdDrawTextAlignedLeft(y, STR_BATTERYWARNING);
|
||||
putsVolts(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.vBatWarn, attr|LEFT);
|
||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
|
||||
lcdDrawTextIndented(y, STR_BATTERYWARNING);
|
||||
putsVolts(LCD_W-7, y, g_eeGeneral.vBatWarn, attr|RIGHT);
|
||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 30, 120); //3.5-12V
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_MEMORY_WARNING:
|
||||
{
|
||||
uint8_t b = 1-g_eeGeneral.disableMemoryWarning;
|
||||
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_MEMORYWARNING, attr, event);
|
||||
g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, LCD_W-9, y, STR_MEMORYWARNING, attr, event, INDENT_WIDTH);
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM_SETUP_ALARM_WARNING:
|
||||
{
|
||||
uint8_t b = 1 - g_eeGeneral.disableAlarmWarning;
|
||||
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event);
|
||||
g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, LCD_W-9, y, STR_ALARMWARNING, attr, event, INDENT_WIDTH);
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(PWR_BUTTON_SOFT)
|
||||
case ITEM_SETUP_RSSI_POWEROFF_ALARM:
|
||||
{
|
||||
uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm;
|
||||
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event);
|
||||
g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, LCD_W-9, y, STR_RSSISHUTDOWNALARM, attr, event, INDENT_WIDTH);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(TX_CAPACITY_MEASUREMENT)
|
||||
case ITEM_SETUP_CAPACITY_WARNING:
|
||||
@@ -391,17 +408,9 @@ void menuRadioSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
case ITEM_SETUP_TEMPERATURE_WARNING:
|
||||
lcdDrawTextAlignedLeft(y, STR_TEMPWARNING);
|
||||
drawValueWithUnit(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.temperatureWarn, UNIT_TEMPERATURE, attr|LEFT) ;
|
||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.temperatureWarn, 0, 120); // 0 means no alarm
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_INACTIVITY_ALARM:
|
||||
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
||||
lcdDrawTextIndented(y, STR_INACTIVITYALARM);
|
||||
lcdDrawNumber(LCD_W-7, y, g_eeGeneral.inactivityTimer, attr|RIGHT);
|
||||
lcdDrawChar(lcdLastRightPos, y, 'm');
|
||||
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
||||
break;
|
||||
@@ -420,30 +429,28 @@ void menuRadioSetup(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_BACKLIGHT_MODE:
|
||||
g_eeGeneral.backlightMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_MODE, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
|
||||
g_eeGeneral.backlightMode = editChoice(LCD_W-2, y, TR_MODE, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr|RIGHT, event, INDENT_WIDTH);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_FLASH_BEEP:
|
||||
g_eeGeneral.alarmsFlash = editCheckBox(g_eeGeneral.alarmsFlash, RADIO_SETUP_2ND_COLUMN, y, STR_ALARM, attr, event ) ;
|
||||
g_eeGeneral.alarmsFlash = editCheckBox(g_eeGeneral.alarmsFlash, LCD_W-9, y, STR_ALARM, attr, event, INDENT_WIDTH);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_BACKLIGHT_DELAY:
|
||||
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
|
||||
lcdDrawTextIndented(y, STR_BLDELAY);
|
||||
lcdDrawNumber(LCD_W-7, y, g_eeGeneral.lightAutoOff*5, attr|RIGHT);
|
||||
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
|
||||
break;
|
||||
|
||||
// case ITEM_SETUP_BRIGHTNESS:
|
||||
// lcdDrawTextAlignedLeft(y, STR_BRIGHTNESS);
|
||||
// lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 100-g_eeGeneral.backlightBright, attr|LEFT) ;
|
||||
// if (attr) {
|
||||
// uint8_t b = 100 - g_eeGeneral.backlightBright;
|
||||
// CHECK_INCDEC_GENVAR(event, b, 0, 100);
|
||||
// g_eeGeneral.backlightBright = 100 - b;
|
||||
// }
|
||||
// break;
|
||||
|
||||
case ITEM_SETUP_BRIGHTNESS:
|
||||
lcdDrawTextIndented(y, STR_BRIGHTNESS);
|
||||
lcdDrawNumber(LCD_W-2, y, 100-g_eeGeneral.backlightBright, attr|RIGHT) ;
|
||||
if (attr) {
|
||||
uint8_t b = 100 - g_eeGeneral.backlightBright;
|
||||
CHECK_INCDEC_GENVAR(event, b, 0, 100);
|
||||
g_eeGeneral.backlightBright = 100 - b;
|
||||
}
|
||||
break;
|
||||
#if defined(PWM_BACKLIGHT)
|
||||
case ITEM_SETUP_BACKLIGHT_BRIGHTNESS_OFF:
|
||||
lcdDrawTextAlignedLeft(y, STR_BLOFFBRIGHTNESS);
|
||||
@@ -474,7 +481,14 @@ void menuRadioSetup(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
case ITEM_RADIO_OWNER_ID:
|
||||
editSingleName(RADIO_SETUP_2ND_COLUMN, y, STR_OWNER_ID, g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID, event, attr);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(TELEMETRY_FRSKY) && defined(GPS)
|
||||
#if defined(RTCLOCK)
|
||||
case ITEM_SETUP_TIMEZONE:
|
||||
lcdDrawTextAlignedLeft(y, STR_TIMEZONE);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
||||
@@ -484,7 +498,7 @@ void menuRadioSetup(event_t event)
|
||||
case ITEM_SETUP_ADJUST_RTC:
|
||||
g_eeGeneral.adjustRTC = editCheckBox(g_eeGeneral.adjustRTC, RADIO_SETUP_2ND_COLUMN, y, STR_ADJUST_RTC, attr, event);
|
||||
break;
|
||||
|
||||
#endif
|
||||
case ITEM_SETUP_GPSFORMAT:
|
||||
g_eeGeneral.gpsFormat = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
|
||||
break;
|
||||
@@ -514,6 +528,10 @@ void menuRadioSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_PPM:
|
||||
g_eeGeneral.ppmunit = editChoice(LCD_W-2, y, STR_UNITS_PPM, "\004""0.--""0.0\0""us\0 ", g_eeGeneral.ppmunit, PPM_PERCENT_PREC0, PPM_US, attr|RIGHT, event);
|
||||
break;
|
||||
|
||||
#if defined(FAI_CHOICE)
|
||||
case ITEM_SETUP_FAI:
|
||||
editCheckBox(g_eeGeneral.fai, RADIO_SETUP_2ND_COLUMN, y, "FAI Mode", attr, event);
|
||||
@@ -529,50 +547,33 @@ void menuRadioSetup(event_t event)
|
||||
|
||||
case ITEM_SETUP_SWITCHES_DELAY:
|
||||
lcdDrawTextAlignedLeft(y, STR_SWITCHES_DELAY);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 10*SWITCHES_DELAY(), attr|LEFT);
|
||||
lcdDrawNumber(LCD_W-14, y, 10*SWITCHES_DELAY(), attr|RIGHT);
|
||||
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchesDelay, -15, 100-15);
|
||||
break;
|
||||
#if defined(PCBI6)
|
||||
case ITEM_SETUP_USB_ENABLE:
|
||||
globalData.usbDetect = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_USBDETECT, STR_USBDETECTMODES, globalData.usbDetect, USB_DETECT_AUTO, USB_MAX_DETECT, attr, event);
|
||||
break;
|
||||
#endif
|
||||
#if defined(STM32)
|
||||
|
||||
case ITEM_SETUP_USB_MODE:
|
||||
g_eeGeneral.USBMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_USBMODE, STR_USBMODES, g_eeGeneral.USBMode, USB_UNSELECTED_MODE, USB_MAX_MODE, attr, event);
|
||||
g_eeGeneral.USBMode = editChoice(LCD_W-2, y, STR_USBMODE, STR_USBMODES, g_eeGeneral.USBMode, USB_UNSELECTED_MODE, USB_MAX_MODE, attr|RIGHT, event);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_RX_CHANNEL_ORD:
|
||||
lcdDrawTextAlignedLeft(y, STR_RXCHANNELORD); // RAET->AETR
|
||||
for (uint8_t i=1; i<=4; i++) {
|
||||
putsChnLetter(RADIO_SETUP_2ND_COLUMN - FW + i*FW, y, channel_order(i), attr);
|
||||
for (uint32_t i=1; i<=4; i++) {
|
||||
putsChnLetter(LCD_W - 2 - 5*FW + i*FW, y, channelOrder(i), attr);
|
||||
}
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_STICK_MODE_LABELS:
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_MODE));
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
for (uint32_t i=0; i<4; i++) {
|
||||
lcdDraw1bitBitmap(5*FW+i*(4*FW+2), y, sticks, i, 0);
|
||||
#if defined(FRSKY_STICKS) && !defined(PCBTARANIS)
|
||||
if (g_eeGeneral.stickReverse & (1<<i)) {
|
||||
lcdDrawFilledRect(5*FW+i*(4*FW+2), y, 3*FW, FH-1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if defined(FRSKY_STICKS) && !defined(PCBTARANIS)
|
||||
if (attr) {
|
||||
s_editMode = 0;
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.stickReverse, 0, 15);
|
||||
lcdDrawRect(5*FW-1, y-1, 16*FW+2, 9);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_STICK_MODE:
|
||||
lcdDrawChar(2*FW, y, '1'+reusableBuffer.generalSettings.stickMode, attr);
|
||||
for (uint8_t i=0; i<NUM_STICKS; i++) {
|
||||
for (uint32_t i=0; i<NUM_STICKS; i++) {
|
||||
drawSource((5*FW-3)+i*(4*FW+2), y, MIXSRC_Rud + *(modn12x3 + 4*reusableBuffer.generalSettings.stickMode + i), 0);
|
||||
}
|
||||
if (attr && s_editMode>0) {
|
||||
@@ -581,11 +582,10 @@ void menuRadioSetup(event_t event)
|
||||
else if (reusableBuffer.generalSettings.stickMode != g_eeGeneral.stickMode) {
|
||||
pausePulses();
|
||||
g_eeGeneral.stickMode = reusableBuffer.generalSettings.stickMode;
|
||||
checkTHR();
|
||||
checkThrottleStick();
|
||||
resumePulses();
|
||||
clearKeyEvents();
|
||||
waitKeysReleased();
|
||||
}
|
||||
MOVE_CURSOR_FROM_HERE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
void menuRadioTrainer(event_t event)
|
||||
{
|
||||
uint8_t y;
|
||||
bool slave = SLAVE_MODE();
|
||||
|
||||
MENU(STR_MENUTRAINER, menuTabGeneral, MENU_RADIO_TRAINER, (slave ? HEADER_LINE : HEADER_LINE+6), { HEADER_LINE_COLUMNS 2, 2, 2, 2, 0/*, 0*/ });
|
||||
|
||||
if (slave) {
|
||||
lcdDrawText(7*FW, 4*FH, STR_SLAVE);
|
||||
}
|
||||
else {
|
||||
uint8_t attr;
|
||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||
|
||||
lcdDrawText(3*FW, MENU_HEADER_HEIGHT+1, STR_MODESRC);
|
||||
|
||||
y = MENU_HEADER_HEIGHT + 1 + FH;
|
||||
|
||||
for (uint8_t i=HEADER_LINE; i<HEADER_LINE+NUM_STICKS; i++) {
|
||||
uint8_t chan = channel_order(i+1-HEADER_LINE);
|
||||
volatile TrainerMix * td = &g_eeGeneral.trainer.mix[chan-1];
|
||||
|
||||
drawSource(0, y, MIXSRC_Rud-1+chan, (menuVerticalPosition==i && CURSOR_ON_LINE()) ? INVERS : 0);
|
||||
|
||||
for (uint8_t j=0; j<3; j++) {
|
||||
|
||||
attr = ((menuVerticalPosition==i && menuHorizontalPosition==j) ? blink : 0);
|
||||
|
||||
switch (j) {
|
||||
case 0:
|
||||
lcdDrawTextAtIndex(4*FW, y, STR_TRNMODE, td->mode, attr);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->mode, 0, 2);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lcdDrawNumber(11*FW, y, td->studWeight, attr|RIGHT);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->studWeight, -125, 125);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lcdDrawTextAtIndex(12*FW, y, STR_TRNCHN, td->srcChn, attr);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->srcChn, 0, 3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
y += FH;
|
||||
}
|
||||
|
||||
attr = (menuVerticalPosition==HEADER_LINE+4) ? blink : 0;
|
||||
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_MULTIPLIER);
|
||||
lcdDrawNumber(LEN_MULTIPLIER*FW+3*FW, MENU_HEADER_HEIGHT+1+5*FH, g_eeGeneral.PPM_Multiplier+10, attr|PREC1|RIGHT);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
||||
|
||||
attr = (menuVerticalPosition==HEADER_LINE+5) ? INVERS : 0;
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+1+6*FH, STR_CAL, attr);
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
uint8_t x = (i*8+16)*FW/2;
|
||||
lcdDrawNumber(x, MENU_HEADER_HEIGHT+1+6*FH, (ppmInput[i]-g_eeGeneral.trainer.calib[i])/5, RIGHT);
|
||||
}
|
||||
|
||||
if (attr) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)){
|
||||
memcpy(g_eeGeneral.trainer.calib, ppmInput, sizeof(g_eeGeneral.trainer.calib));
|
||||
storageDirty(EE_GENERAL);
|
||||
AUDIO_WARNING1();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,68 +38,16 @@ enum MenuRadioVersionItems
|
||||
ITEM_RADIO_VERSION_FIRST = HEADER_LINE - 1,
|
||||
#if defined(PXX2)
|
||||
ITEM_RADIO_MODULES_VERSION,
|
||||
#endif
|
||||
#if defined(EEPROM_RLC)
|
||||
#if defined(SDCARD)
|
||||
ITEM_RADIO_BACKUP_EEPROM,
|
||||
#endif
|
||||
ITEM_RADIO_FACTORY_RESET,
|
||||
#endif
|
||||
ITEM_RADIO_VERSION_COUNT
|
||||
};
|
||||
|
||||
void menuRadioVersion(event_t event)
|
||||
{
|
||||
#if defined(EEPROM_RLC)
|
||||
if (warningResult) {
|
||||
warningResult = 0;
|
||||
showMessageBox(STR_STORAGE_FORMAT);
|
||||
storageEraseAll(false);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
#endif
|
||||
|
||||
SIMPLE_MENU(STR_MENUVERSION, menuTabGeneral, MENU_RADIO_VERSION, ITEM_RADIO_VERSION_COUNT);
|
||||
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1;
|
||||
lcdDrawTextAlignedLeft(MENU_HEADER_HEIGHT+FH, vers_stamp);
|
||||
y += 5*FH;
|
||||
// TODO this was good on AVR radios, but horrible now ...
|
||||
coord_t y = MENU_HEADER_HEIGHT + 2;
|
||||
lcdDrawText(FW, y, vers_stamp, SMLSIZE);
|
||||
y += 5 * (FH - 1);
|
||||
|
||||
#if defined(COPROCESSOR)
|
||||
if (Coproc_valid == 1) {
|
||||
lcdDrawTextAlignedLeft(y, "CoPr:");
|
||||
lcdDraw8bitsNumber(10*FW, y, Coproc_read);
|
||||
}
|
||||
else {
|
||||
lcdDrawTextAlignedLeft(y, "CoPr: ---");
|
||||
}
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
#if defined(PXX2)
|
||||
lcdDrawText(0, y, BUTTON("Modules / RX version"), menuVerticalPosition == ITEM_RADIO_MODULES_VERSION ? INVERS : 0);
|
||||
y += FH;
|
||||
if (menuVerticalPosition == ITEM_RADIO_MODULES_VERSION && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = EDIT_SELECT_FIELD;
|
||||
pushMenu(menuRadioModulesVersion);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(EEPROM_RLC)
|
||||
#if defined(SDCARD)
|
||||
lcdDrawText(0, y, BUTTON(TR_EEBACKUP), menuVerticalPosition == ITEM_RADIO_BACKUP_EEPROM ? INVERS : 0);
|
||||
y += FH;
|
||||
if (menuVerticalPosition == ITEM_RADIO_BACKUP_EEPROM && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = EDIT_SELECT_FIELD;
|
||||
eepromBackup();
|
||||
}
|
||||
#endif
|
||||
lcdDrawText(0, y, BUTTON(TR_FACTORYRESET), menuVerticalPosition == ITEM_RADIO_FACTORY_RESET ? INVERS : 0);
|
||||
// y += FH;
|
||||
if (menuVerticalPosition == ITEM_RADIO_FACTORY_RESET && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = EDIT_SELECT_FIELD;
|
||||
POPUP_CONFIRMATION(STR_CONFIRMRESET);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -23,8 +23,8 @@
|
||||
#if defined(SPLASH)
|
||||
const unsigned char splashdata[] = {
|
||||
'S','P','S',0,
|
||||
#if defined(PCBI6)
|
||||
#include "bitmaps/128x64/splash_i6x_trim.lbm"
|
||||
#if defined(PCBI6X)
|
||||
#include "bitmaps/128x64/splash_i6x_neg_trim.lbm"
|
||||
#else
|
||||
#include "bitmaps/128x64/splash.lbm"
|
||||
#endif
|
||||
@@ -35,9 +35,8 @@ const unsigned char * const splash_lbm = splashdata+4;
|
||||
void drawSplash()
|
||||
{
|
||||
lcdClear();
|
||||
#if defined(PCBI6)
|
||||
lcdDrawSolidFilledRect(0, 0, LCD_W, LCD_H);
|
||||
lcdDraw1bitBitmap(8, 16, splash_lbm, 0, 0);
|
||||
#if defined(PCBI6X)
|
||||
lcdDraw1bitBitmap(10, 16, splash_lbm, 0, 0);
|
||||
#else
|
||||
lcdDraw1bitBitmap(0, 0, splash_lbm, 0, 0);
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
#if !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
const unsigned char about_bmp[] = {
|
||||
#include "about.lbm"
|
||||
};
|
||||
@@ -52,7 +52,7 @@ enum AboutScreens {
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_FIRST(KEY_DOWN)
|
||||
#endif
|
||||
|
||||
#if !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
void menuAboutView(event_t event)
|
||||
{
|
||||
static uint8_t screenIndex;
|
||||
|
||||
@@ -20,97 +20,101 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
void menuChannelsView(event_t event)
|
||||
{
|
||||
bool newLongNames = false;
|
||||
constexpr coord_t CHANNEL_NAME_OFFSET = 0;
|
||||
constexpr coord_t CHANNEL_VALUE_OFFSET = CHANNEL_NAME_OFFSET + 43;
|
||||
constexpr coord_t CHANNEL_GAUGE_OFFSET = CHANNEL_VALUE_OFFSET - 1;
|
||||
constexpr coord_t CHANNEL_BAR_WIDTH = 70;
|
||||
constexpr coord_t CHANNEL_PROPERTIES_OFFSET = CHANNEL_GAUGE_OFFSET + CHANNEL_BAR_WIDTH + 2;
|
||||
|
||||
#if defined(NAVIGATION_X7)
|
||||
#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_LONG(KEY_PAGE)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_PAGE)
|
||||
#define EVT_KEY_NEXT_PAGE EVT_ROTARY_RIGHT
|
||||
#define EVT_KEY_PREVIOUS_PAGE EVT_ROTARY_LEFT
|
||||
#elif defined(NAVIGATION_XLITE)
|
||||
#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_BREAK(KEY_UP)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_DOWN)
|
||||
#define EVT_KEY_NEXT_PAGE EVT_KEY_BREAK(KEY_RIGHT)
|
||||
#define EVT_KEY_PREVIOUS_PAGE EVT_KEY_BREAK(KEY_LEFT)
|
||||
#else
|
||||
#define EVT_KEY_PREVIOUS_VIEW EVT_KEY_BREAK(KEY_UP)
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_DOWN)
|
||||
#define EVT_KEY_NEXT_PAGE EVT_KEY_BREAK(KEY_RIGHT)
|
||||
#define EVT_KEY_PREVIOUS_PAGE EVT_KEY_BREAK(KEY_LEFT)
|
||||
#endif
|
||||
|
||||
static bool mixersView = false;
|
||||
|
||||
void menuChannelsViewCommon(event_t event)
|
||||
{
|
||||
uint8_t ch;
|
||||
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
memclear(&reusableBuffer.viewChannels, sizeof(reusableBuffer.viewChannels));
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
mixersView = !mixersView;
|
||||
break;
|
||||
}
|
||||
|
||||
ch = 8 * (g_eeGeneral.view / ALTERNATE_VIEW);
|
||||
|
||||
// Screen title
|
||||
lcdDrawText(LCD_W / 2, 0, mixersView ? STR_MIXERS_MONITOR : STR_CHANNELS_MONITOR, CENTERED);
|
||||
lcdInvertLine(0);
|
||||
|
||||
int16_t limits = 512 * 2;
|
||||
|
||||
// Channels
|
||||
for (uint32_t line = 0; line < 8; line++) {
|
||||
LimitData * ld = limitAddress(ch);
|
||||
const uint8_t y = 9 + line * 7;
|
||||
const int32_t val = mixersView ? ex_chans[ch] : channelOutputs[ch];
|
||||
const uint8_t lenLabel = ZLEN(g_model.limitData[ch].name);
|
||||
|
||||
// Channel name if present, number if not
|
||||
if (lenLabel > 0) {
|
||||
lcdDrawSizedText(CHANNEL_NAME_OFFSET, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
}
|
||||
else {
|
||||
putsChn(CHANNEL_NAME_OFFSET, y, ch + 1, SMLSIZE);
|
||||
}
|
||||
|
||||
// Value
|
||||
drawChannelValue(CHANNEL_VALUE_OFFSET, y + 1, ch, val, TINSIZE | RIGHT);
|
||||
|
||||
// Gauge
|
||||
drawGauge(CHANNEL_GAUGE_OFFSET, y, CHANNEL_BAR_WIDTH, 6, val, limits);
|
||||
|
||||
if (!mixersView) {
|
||||
// Properties
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
if (safetyCh[ch] != OVERRIDE_CHANNEL_UNDEFINED)
|
||||
lcdDrawText(CHANNEL_PROPERTIES_OFFSET, y, "OVR", TINSIZE);
|
||||
else
|
||||
#endif
|
||||
if (ld && ld->revert) {
|
||||
lcdDrawText(CHANNEL_PROPERTIES_OFFSET, y, "INV", TINSIZE);
|
||||
}
|
||||
}
|
||||
|
||||
++ch;
|
||||
}
|
||||
}
|
||||
|
||||
void menuChannelsView(event_t event)
|
||||
{
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
popMenu();
|
||||
break;
|
||||
|
||||
#if defined(PCBI6)
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
#else
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
#endif
|
||||
reusableBuffer.viewChannels.secondPage = !reusableBuffer.viewChannels.secondPage;
|
||||
case EVT_KEY_NEXT_PAGE:
|
||||
g_eeGeneral.view = (g_eeGeneral.view + (4 * ALTERNATE_VIEW) + ALTERNATE_VIEW) % (4 * ALTERNATE_VIEW);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
reusableBuffer.viewChannels.mixersView = !reusableBuffer.viewChannels.mixersView;
|
||||
case EVT_KEY_PREVIOUS_PAGE:
|
||||
g_eeGeneral.view = (g_eeGeneral.view + (4 * ALTERNATE_VIEW) - ALTERNATE_VIEW) % (4 * ALTERNATE_VIEW);
|
||||
break;
|
||||
}
|
||||
|
||||
if (reusableBuffer.viewChannels.secondPage)
|
||||
ch = 16;
|
||||
else
|
||||
ch = 0;
|
||||
|
||||
if (reusableBuffer.viewChannels.mixersView) {
|
||||
lcdDrawTextAlignedCenter(0, MIXERS_MONITOR);
|
||||
}
|
||||
else {
|
||||
lcdDrawTextAlignedCenter(0, CHANNELS_MONITOR);
|
||||
}
|
||||
|
||||
lcdInvertLine(0);
|
||||
|
||||
// Column separator
|
||||
lcdDrawSolidVerticalLine(LCD_W/2, FH, LCD_H-FH);
|
||||
|
||||
for (uint8_t col=0; col<2; col++) {
|
||||
|
||||
uint8_t x = col*LCD_W/2+1;
|
||||
|
||||
// Channels
|
||||
for (uint8_t line=0; line<8; line++) {
|
||||
uint8_t y = 9+line*7;
|
||||
int32_t val = (reusableBuffer.viewChannels.mixersView) ? ex_chans[ch] : channelOutputs[ch];
|
||||
uint8_t ofs = (col ? 0 : 1);
|
||||
|
||||
// Channel name if present, number if not
|
||||
uint8_t lenLabel = ZLEN(g_model.limitData[ch].name);
|
||||
if (lenLabel > 4) {
|
||||
newLongNames = reusableBuffer.viewChannels.longNames = true;
|
||||
}
|
||||
|
||||
if (lenLabel > 0)
|
||||
lcdDrawSizedText(x+1-ofs, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
else
|
||||
putsChn(x+1-ofs, y, ch+1, SMLSIZE);
|
||||
|
||||
// Value
|
||||
#if defined(PPM_UNIT_US)
|
||||
uint8_t wbar = (reusableBuffer.viewChannels.longNames ? 54 : 64);
|
||||
lcdDrawNumber(x+LCD_W/2-3-wbar-ofs, y+1, PPM_CH_CENTER(ch)+val/2, TINSIZE|RIGHT);
|
||||
#elif defined(PPM_UNIT_PERCENT_PREC1)
|
||||
uint8_t wbar = (reusableBuffer.viewChannels.longNames ? 48 : 58);
|
||||
lcdDrawNumber(x+LCD_W/2-3-wbar-ofs, y+1, calcRESXto1000(val), PREC1|TINSIZE|RIGHT);
|
||||
#else
|
||||
uint8_t wbar = (longNames ? 54 : 64);
|
||||
lcdDrawNumber(x+LCD_W/2-3-wbar-ofs, y+1, calcRESXto1000(val)/10, TINSIZE|RIGHT);
|
||||
#endif
|
||||
|
||||
// Gauge
|
||||
// uint16_t lim = (g_model.extendedLimits ? (512 * (long)LIMIT_EXT_PERCENT / 100) : 512) * 2;
|
||||
//#ifdef MIXERS_MONITOR
|
||||
// if (mixersView)
|
||||
// lim = 512 * 2 * 2;
|
||||
//#endif
|
||||
// TODO ? drawGauge(x+LCD_W/2-3-wbar-ofs, y, wbar, 6, val, lim);
|
||||
|
||||
ch++;
|
||||
}
|
||||
}
|
||||
|
||||
reusableBuffer.viewChannels.longNames = newLongNames;
|
||||
}
|
||||
menuChannelsViewCommon(event);
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "opentx.h"
|
||||
|
||||
#define BIGSIZE DBLSIZE
|
||||
#if defined (PCBTARANIS)
|
||||
#if defined (PCBTARANIS) || defined(PCBI6X)
|
||||
#define LBOX_CENTERX (LCD_W/4 + 14)
|
||||
#define RBOX_CENTERX (3*LCD_W/4 - 13)
|
||||
#else
|
||||
@@ -50,7 +50,7 @@
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
#define RSSSI_X (30)
|
||||
#define RSSSI_Y (31)
|
||||
#if defined(PCBI6)
|
||||
#if defined(PCBI6X)
|
||||
#define RSSI_MAX 100
|
||||
#else
|
||||
#define RSSI_MAX 105
|
||||
@@ -59,18 +59,25 @@
|
||||
|
||||
#define TRIM_LEN 23
|
||||
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
void drawRSSIGauge()
|
||||
void drawExternalAntennaAndRSSI()
|
||||
{
|
||||
uint8_t bar = (RSSI_MAX - g_model.rssiAlarms.getWarningRssi()) / 4;
|
||||
#if defined(INTERNAL_MODULE_PXX1) && defined(EXTERNAL_ANTENNA)
|
||||
if (isModuleXJT(INTERNAL_MODULE) && isExternalAntennaEnabled()) {
|
||||
lcdDrawText(VBATT_X-1, VBATT_Y+8, "E", TINSIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
for(uint8_t i=1; i<5; i++) {
|
||||
if((TELEMETRY_RSSI() - g_model.rssiAlarms.getWarningRssi()) > bar*(i-1)) {
|
||||
lcdDrawFilledRect(RSSSI_X + i*4, RSSSI_Y - 2*i, 3, 2*i, SOLID, 0);
|
||||
if (TELEMETRY_RSSI() > 0) {
|
||||
auto warningRSSI = g_model.rssiAlarms.getWarningRssi();
|
||||
int8_t value = TELEMETRY_RSSI() - warningRSSI;
|
||||
uint8_t step = (RSSI_MAX - warningRSSI) / 4;
|
||||
for (uint8_t i = 1; i < 5; i++) {
|
||||
if (value > step * (i - 1)) {
|
||||
lcdDrawFilledRect(RSSSI_X + i * 4, RSSSI_Y - 2 * i + 1, 3, 2 * i - 1, SOLID, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void drawPotsBars()
|
||||
{
|
||||
@@ -100,7 +107,7 @@ void doMainScreenGraphics()
|
||||
|
||||
void displayTrims(uint8_t phase)
|
||||
{
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
for (uint32_t i=0; i<4; i++) {
|
||||
static coord_t x[4] = {TRIM_LH_X, TRIM_LV_X, TRIM_RV_X, TRIM_RH_X};
|
||||
static uint8_t vert[4] = {0,1,1,0};
|
||||
coord_t xm, ym;
|
||||
@@ -177,25 +184,6 @@ void displayTrims(uint8_t phase)
|
||||
}
|
||||
}
|
||||
|
||||
void drawTimerWithMode(coord_t x, coord_t y, uint8_t index)
|
||||
{
|
||||
const TimerData & timer = g_model.timers[index];
|
||||
if (timer.mode) {
|
||||
const TimerState & timerState = timersStates[index];
|
||||
const uint8_t negative = (timerState.val<0 ? BLINK | INVERS : 0);
|
||||
LcdFlags att = RIGHT | DBLSIZE | negative;
|
||||
drawTimer(x, y, timerState.val, att, att);
|
||||
uint8_t xLabel = (negative ? x-56 : x-49);
|
||||
uint8_t len = zlen(timer.name, LEN_TIMER_NAME);
|
||||
if (len > 0) {
|
||||
lcdDrawSizedText(xLabel, y+FH, timer.name, len, RIGHT | ZCHAR);
|
||||
}
|
||||
else {
|
||||
drawTimerMode(xLabel, y+FH, timer.mode, RIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void displayBattVoltage()
|
||||
{
|
||||
#if defined(BATTGRAPH)
|
||||
@@ -203,7 +191,7 @@ void displayBattVoltage()
|
||||
lcdDrawSolidFilledRect(VBATT_X-25, VBATT_Y+9, 21, 5);
|
||||
lcdDrawSolidVerticalLine(VBATT_X-4, VBATT_Y+10, 3);
|
||||
uint8_t count = GET_TXBATT_BARS();
|
||||
for (uint8_t i=0; i<count; i+=2)
|
||||
for (uint32_t i=0; i<count; i+=2)
|
||||
lcdDrawSolidVerticalLine(VBATT_X-24+i, VBATT_Y+10, 3);
|
||||
if (!IS_TXBATT_WARNING() || BLINK_ON_PHASE)
|
||||
lcdDrawSolidFilledRect(VBATT_X-26, VBATT_Y, 24, 15);
|
||||
@@ -214,22 +202,7 @@ void displayBattVoltage()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
void displayVoltageOrAlarm()
|
||||
{
|
||||
if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) {
|
||||
drawValueWithUnit(6*FW-1, 2*FH, getTemperature(), UNIT_TEMPERATURE, BLINK|INVERS|DBLSIZE|RIGHT);
|
||||
}
|
||||
else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.txCurrentCalibration)/8192/36) / 500 >= g_eeGeneral.mAhWarn) {
|
||||
drawValueWithUnit(7*FW-1, 2*FH, (g_eeGeneral.mAhUsed + Current_used*(488 + g_eeGeneral.txCurrentCalibration)/8192/36)/10, UNIT_MAH, BLINK|INVERS|DBLSIZE|RIGHT);
|
||||
}
|
||||
else {
|
||||
displayBattVoltage();
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define displayVoltageOrAlarm() displayBattVoltage()
|
||||
#endif
|
||||
#define displayVoltageOrAlarm() displayBattVoltage()
|
||||
|
||||
#if defined(PCBX7)
|
||||
#define EVT_KEY_CONTEXT_MENU EVT_KEY_LONG(KEY_ENTER)
|
||||
@@ -255,7 +228,7 @@ void displayVoltageOrAlarm()
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_BREAK(KEY_DOWN)
|
||||
#define EVT_KEY_NEXT_PAGE EVT_KEY_BREAK(KEY_RIGHT)
|
||||
#define EVT_KEY_PREVIOUS_PAGE EVT_KEY_BREAK(KEY_LEFT)
|
||||
#if defined(PCBI6)
|
||||
#if defined(PCBI6X)
|
||||
#define EVT_KEY_GENERAL_MENU EVT_KEY_LONG(KEY_RIGHT)
|
||||
#define EVT_KEY_MODEL_MENU EVT_KEY_LONG(KEY_MENU)
|
||||
#else
|
||||
@@ -267,7 +240,6 @@ void displayVoltageOrAlarm()
|
||||
#define EVT_KEY_STATISTICS EVT_KEY_LONG(KEY_UP)
|
||||
#endif
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
void onMainViewMenu(const char *result)
|
||||
{
|
||||
if (result == STR_RESET_TIMER1) {
|
||||
@@ -281,7 +253,7 @@ void onMainViewMenu(const char *result)
|
||||
timerReset(2);
|
||||
}
|
||||
#endif
|
||||
#if !defined(PCBI6)
|
||||
#if defined(SDCARD)
|
||||
else if (result == STR_VIEW_NOTES) {
|
||||
pushModelNotes();
|
||||
}
|
||||
@@ -306,19 +278,24 @@ void onMainViewMenu(const char *result)
|
||||
else if (result == STR_STATISTICS) {
|
||||
chainMenu(menuStatisticsView);
|
||||
}
|
||||
#if !defined(PCBI6)
|
||||
else if (result == STR_SAVEALLDATA) {
|
||||
watchdogSuspend(200); // 2s
|
||||
saveAllData();
|
||||
}
|
||||
#if !defined(PCBI6X)
|
||||
else if (result == STR_ABOUT_US) {
|
||||
chainMenu(menuAboutView);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuMainView(event_t event)
|
||||
{
|
||||
uint8_t view = g_eeGeneral.view;
|
||||
uint8_t view_base = view & 0x0f;
|
||||
uint8_t num_pages = MAX_OUTPUT_CHANNELS / 8;
|
||||
|
||||
#define CHANNELS_PAGES ((MAX_OUTPUT_CHANNELS + 8 - 1) / 8)
|
||||
#define CHANNELS_SEGMENT_WIDTH (54 / CHANNELS_PAGES)
|
||||
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
@@ -338,35 +315,34 @@ void menuMainView(event_t event)
|
||||
|
||||
case EVT_KEY_NEXT_PAGE:
|
||||
case EVT_KEY_PREVIOUS_PAGE:
|
||||
if (view_base <= VIEW_INPUTS) {
|
||||
if (view_base == VIEW_INPUTS)
|
||||
g_eeGeneral.view ^= ALTERNATE_VIEW;
|
||||
else
|
||||
g_eeGeneral.view = (g_eeGeneral.view + (num_pages*ALTERNATE_VIEW) +
|
||||
((event==EVT_KEY_PREVIOUS_PAGE) ? -ALTERNATE_VIEW : ALTERNATE_VIEW))
|
||||
% (num_pages*ALTERNATE_VIEW);
|
||||
storageDirty(EE_GENERAL);
|
||||
AUDIO_KEY_PRESS();
|
||||
}
|
||||
if (view_base == VIEW_INPUTS)
|
||||
g_eeGeneral.view ^= ALTERNATE_VIEW;
|
||||
else
|
||||
g_eeGeneral.view = (g_eeGeneral.view + (CHANNELS_PAGES*ALTERNATE_VIEW) + ((event==EVT_KEY_PREVIOUS_PAGE) ? -ALTERNATE_VIEW : ALTERNATE_VIEW)) % (CHANNELS_PAGES*ALTERNATE_VIEW);
|
||||
break;
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
case EVT_KEY_CONTEXT_MENU:
|
||||
killEvents(event);
|
||||
|
||||
#if defined(PCBI6X)
|
||||
if (view_base == VIEW_CHAN_MONITOR) break;
|
||||
#else
|
||||
if (modelHasNotes()) {
|
||||
POPUP_MENU_ADD_ITEM(STR_VIEW_NOTES);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBI6X)
|
||||
POPUP_MENU_ADD_ITEM(STR_SAVEALLDATA);
|
||||
#endif
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_SUBMENU);
|
||||
|
||||
POPUP_MENU_ADD_ITEM(STR_STATISTICS);
|
||||
#if !defined(PCBI6)
|
||||
|
||||
#if !defined(PCBI6X)
|
||||
POPUP_MENU_ADD_ITEM(STR_ABOUT_US);
|
||||
#endif
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if MENUS_LOCK != 2 /*no menus*/
|
||||
#if defined(EVT_KEY_LAST_MENU)
|
||||
@@ -384,7 +360,7 @@ void menuMainView(event_t event)
|
||||
|
||||
CASE_EVT_ROTARY_LONG
|
||||
case EVT_KEY_GENERAL_MENU:
|
||||
pushMenu(menuRadioSetup);
|
||||
pushMenu(menuTabGeneral[0]);
|
||||
killEvents(event);
|
||||
break;
|
||||
#endif
|
||||
@@ -394,12 +370,12 @@ void menuMainView(event_t event)
|
||||
case EVT_KEY_PREVIOUS_VIEW:
|
||||
case EVT_KEY_NEXT_VIEW:
|
||||
// TODO try to split those 2 cases on 9X
|
||||
g_eeGeneral.view = (event == EVT_KEY_PREVIOUS_VIEW ? (view_base == VIEW_COUNT-1 ? 0 : view_base+1) : (view_base == 0 ? VIEW_COUNT-1 : view_base-1));
|
||||
g_eeGeneral.view = (event == EVT_KEY_PREVIOUS_VIEW ? (view_base == VIEW_COUNT - 1 ? 0 : view_base + 1) : (view_base == 0 ? VIEW_COUNT - 1 : view_base - 1));
|
||||
storageDirty(EE_GENERAL);
|
||||
break;
|
||||
#else
|
||||
case EVT_KEY_NEXT_VIEW:
|
||||
g_eeGeneral.view = (view_base == 0 ? VIEW_COUNT-1 : view_base-1);
|
||||
g_eeGeneral.view = (view_base == 0 ? VIEW_COUNT - 1 : view_base - 1);
|
||||
storageDirty(EE_GENERAL);
|
||||
break;
|
||||
#endif
|
||||
@@ -413,7 +389,7 @@ void menuMainView(event_t event)
|
||||
|
||||
case EVT_KEY_TELEMETRY:
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
chainMenu(menuViewTelemetryFrsky);
|
||||
chainMenu(menuViewTelemetry);
|
||||
#else
|
||||
chainMenu(menuStatisticsDebug);
|
||||
#endif
|
||||
@@ -425,73 +401,31 @@ void menuMainView(event_t event)
|
||||
if (gvarDisplayTimer > 0) {
|
||||
gvarDisplayTimer = 0;
|
||||
}
|
||||
#endif
|
||||
#if !defined(NAVIGATION_MENUS)
|
||||
if (view == VIEW_TIMER2) {
|
||||
timerReset(1);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
#if !defined(NAVIGATION_MENUS)
|
||||
case EVT_KEY_LONG(KEY_EXIT):
|
||||
flightReset();
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
// Flight Mode Name
|
||||
uint8_t mode = mixerCurrentFlightMode;
|
||||
lcdDrawSizedText(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
||||
switch (view_base) {
|
||||
case VIEW_CHAN_MONITOR:
|
||||
menuChannelsViewCommon(event);
|
||||
break;
|
||||
case VIEW_OUTPUTS_VALUES:
|
||||
case VIEW_OUTPUTS_BARS:
|
||||
// scroll bar
|
||||
lcdDrawHorizontalLine(38, 34, 54, DOTTED);
|
||||
lcdDrawSolidHorizontalLine(38 + (g_eeGeneral.view / ALTERNATE_VIEW) * CHANNELS_SEGMENT_WIDTH, 34, CHANNELS_SEGMENT_WIDTH, SOLID);
|
||||
for (uint32_t i=0; i<8; i++) {
|
||||
uint8_t x0, y0;
|
||||
uint8_t chan = 8 * (g_eeGeneral.view / ALTERNATE_VIEW) + i;
|
||||
int16_t val = channelOutputs[chan];
|
||||
|
||||
// Model Name
|
||||
putsModelName(MODELNAME_X, MODELNAME_Y, g_model.header.name, g_eeGeneral.currModel, BIGSIZE);
|
||||
|
||||
// Main Voltage (or alarm if any)
|
||||
displayVoltageOrAlarm();
|
||||
|
||||
// Timer 1
|
||||
drawTimerWithMode(125, 2*FH, 0);
|
||||
|
||||
// Trims sliders
|
||||
displayTrims(mode);
|
||||
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
// RSSI gauge
|
||||
if (TELEMETRY_RSSI() > 0) {
|
||||
drawRSSIGauge();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (view_base < VIEW_INPUTS) {
|
||||
// scroll bar
|
||||
lcdDrawHorizontalLine(38, 34, 54, DOTTED);
|
||||
uint8_t segment_width = 54 / num_pages;
|
||||
lcdDrawSolidHorizontalLine(38 + (g_eeGeneral.view / ALTERNATE_VIEW) * segment_width, 34, segment_width, SOLID);
|
||||
|
||||
for (uint8_t i=0; i<8; i++) {
|
||||
uint8_t x0,y0;
|
||||
uint8_t chan = 8*(g_eeGeneral.view / ALTERNATE_VIEW) + i;
|
||||
|
||||
int16_t val = channelOutputs[chan];
|
||||
|
||||
switch (view_base) {
|
||||
case VIEW_OUTPUTS_VALUES:
|
||||
x0 = (i%4*9+3)*FW/2;
|
||||
y0 = i/4*FH+40;
|
||||
#if defined(PPM_UNIT_US)
|
||||
lcdDrawNumber(x0+4*FW , y0, PPM_CH_CENTER(chan)+val/2, RIGHT);
|
||||
#elif defined(PPM_UNIT_PERCENT_PREC1)
|
||||
lcdDrawNumber(x0+4*FW , y0, calcRESXto1000(val), RIGHT|PREC1);
|
||||
#else
|
||||
lcdDrawNumber(x0+4*FW , y0, calcRESXto1000(val)/10, RIGHT); // G: Don't like the decimal part*
|
||||
#endif
|
||||
break;
|
||||
|
||||
case VIEW_OUTPUTS_BARS:
|
||||
#define WBAR2 (50/2)
|
||||
if (view_base == VIEW_OUTPUTS_VALUES) {
|
||||
x0 = (i % 4 * 9 + 3) * FW / 2;
|
||||
y0 = i / 4 * FH + 40;
|
||||
drawChannelValue(x0 + 4 * FW, y0, chan, val, RIGHT);
|
||||
}
|
||||
else {
|
||||
constexpr coord_t WBAR2 = (50/2);
|
||||
x0 = i<4 ? LCD_W/4+2 : LCD_W*3/4-2;
|
||||
y0 = 38+(i%4)*5;
|
||||
|
||||
@@ -508,93 +442,151 @@ void menuMainView(event_t event)
|
||||
x0 -= len;
|
||||
lcdDrawSolidHorizontalLine(x0, y0+1, len);
|
||||
lcdDrawSolidHorizontalLine(x0, y0-1, len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (view_base == VIEW_INPUTS) {
|
||||
if (view == VIEW_INPUTS) {
|
||||
// Sticks + Pots
|
||||
doMainScreenGraphics();
|
||||
break;
|
||||
|
||||
// Switches
|
||||
#if defined(PCBTARANIS) || defined(PCBI6)
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
uint8_t x = 2*FW-2, y = 4*FH+i*FH+1;
|
||||
if (i >= NUM_SWITCHES/2) {
|
||||
x = 16*FW+5;
|
||||
y -= (NUM_SWITCHES/2)*FH;
|
||||
case VIEW_TIMER2:
|
||||
drawTimerWithMode(87, 5 * FH, 1, RIGHT | DBLSIZE);
|
||||
break;
|
||||
|
||||
case VIEW_INPUTS:
|
||||
if (view == VIEW_INPUTS) {
|
||||
// Sticks + Pots
|
||||
doMainScreenGraphics();
|
||||
|
||||
// Switches
|
||||
#if defined(PCBX9LITES)
|
||||
static const uint8_t x[NUM_SWITCHES-2] = {2*FW-2, 2*FW-2, 17*FW+1, 2*FW-2, 17*FW+1};
|
||||
static const uint8_t y[NUM_SWITCHES-2] = {4*FH+1, 5*FH+1, 5*FH+1, 6*FH+1, 6*FH+1};
|
||||
for (int i=0; i<NUM_SWITCHES - 2; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH + i);
|
||||
getvalue_t sw = ((val < 0) ? 3 * i + 1 : ((val == 0) ? 3 * i + 2 : 3 * i + 3));
|
||||
drawSwitch(x[i], y[i], sw, 0, false);
|
||||
}
|
||||
}
|
||||
drawSmallSwitch(29, 5*FH+1, 4, SW_SF);
|
||||
drawSmallSwitch(16*FW+1, 5*FH+1, 4, SW_SG);
|
||||
#elif defined(PCBX9LITE)
|
||||
static const uint8_t x[NUM_SWITCHES] = {2 * FW - 2, 2 * FW - 2, 16 * FW + 1, 2 * FW - 2, 16 * FW + 1};
|
||||
static const uint8_t y[NUM_SWITCHES] = {4 * FH + 1, 5 * FH + 1, 5 * FH + 1, 6 * FH + 1, 6 * FH + 1};
|
||||
for (int i = 0; i < NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH + i);
|
||||
getvalue_t sw = ((val < 0) ? 3 * i + 1 : ((val == 0) ? 3 * i + 2 : 3 * i + 3));
|
||||
drawSwitch(x[i], y[i], sw, 0, false);
|
||||
}
|
||||
}
|
||||
#elif defined(PCBXLITES)
|
||||
static const uint8_t x[NUM_SWITCHES] = {2*FW-2, 16*FW+1, 2*FW-2, 16*FW+1, 2*FW-2, 16*FW+1};
|
||||
static const uint8_t y[NUM_SWITCHES] = {4*FH+1, 4*FH+1, 6*FH+1, 6*FH+1, 5*FH+1, 5*FH+1};
|
||||
for (int i=0; i<NUM_SWITCHES; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH + i);
|
||||
getvalue_t sw = ((val < 0) ? 3 * i + 1 : ((val == 0) ? 3 * i + 2 : 3 * i + 3));
|
||||
drawSwitch(x[i], y[i], sw, 0, false);
|
||||
}
|
||||
}
|
||||
#elif defined(PCBTARANIS) || defined(PCBI6X)
|
||||
uint8_t switches = min((int)NUM_SWITCHES, 6);
|
||||
for (int i = 0; i < switches; ++i) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
uint8_t x = 2 * FW - 2, y = 4 * FH + i * FH + 1;
|
||||
if (i >= switches / 2) {
|
||||
x = 16 * FW + 1;
|
||||
y -= (switches / 2) * FH;
|
||||
}
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH + i);
|
||||
getvalue_t sw = ((val < 0) ? 3 * i + 1 : ((val == 0) ? 3 * i + 2 : 3 * i + 3));
|
||||
drawSwitch(x, y, sw, 0, false);
|
||||
}
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH+i);
|
||||
getvalue_t sw = ((val < 0) ? 3*i+1 : ((val == 0) ? 3*i+2 : 3*i+3));
|
||||
drawSwitch(x, y, sw, 0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
// The ID0 3-POS switch is merged with the TRN switch
|
||||
for (uint8_t i=SWSRC_THR; i<=SWSRC_TRN; i++) {
|
||||
int8_t sw = (i == SWSRC_TRN ? (switchState(SW_ID0) ? SWSRC_ID0 : (switchState(SW_ID1) ? SWSRC_ID1 : SWSRC_ID2)) : i);
|
||||
uint8_t x = 2*FW-2, y = i*FH+1;
|
||||
if (i >= SWSRC_AIL) {
|
||||
x = 17*FW-1;
|
||||
y -= 3*FH;
|
||||
// The ID0 3-POS switch is merged with the TRN switch
|
||||
for (uint32_t i=SWSRC_THR; i<=SWSRC_TRN; i++) {
|
||||
int8_t sw = (i == SWSRC_TRN ? (switchState(SW_ID0) ? SWSRC_ID0 : (switchState(SW_ID1) ? SWSRC_ID1 : SWSRC_ID2)) : i);
|
||||
uint8_t x = 2*FW-2, y = i*FH+1;
|
||||
if (i >= SWSRC_AIL) {
|
||||
x = 17*FW-1;
|
||||
y -= 3*FH;
|
||||
}
|
||||
drawSwitch(x, y, sw, getSwitch(i) ? INVERS : 0, false);
|
||||
}
|
||||
drawSwitch(x, y, sw, getSwitch(i) ? INVERS : 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
|
||||
// Logical Switches
|
||||
uint8_t index = 0;
|
||||
uint8_t y = LCD_H-20;
|
||||
for (uint8_t line=0; line<2; line++) {
|
||||
for (uint8_t column=0; column<MAX_LOGICAL_SWITCHES/2; column++) {
|
||||
int8_t len = getSwitch(SWSRC_SW1+index) ? 10 : 1;
|
||||
uint8_t x = (16 + 3*column);
|
||||
lcdDrawSolidVerticalLine(x-1, y-len, len);
|
||||
lcdDrawSolidVerticalLine(x, y-len, len);
|
||||
index++;
|
||||
}
|
||||
else {
|
||||
// Logical Switches
|
||||
uint8_t index = 0;
|
||||
uint8_t y = LCD_H - 20;
|
||||
for (uint8_t line = 0; line < 2; line++) {
|
||||
for (uint8_t column = 0; column < MAX_LOGICAL_SWITCHES / 2; column++) {
|
||||
int8_t len = getSwitch(SWSRC_SW1 + index) ? 10 : 1;
|
||||
uint8_t x = (16 + 3 * column);
|
||||
lcdDrawSolidVerticalLine(x - 1, y - len, len);
|
||||
lcdDrawSolidVerticalLine(x, y - len, len);
|
||||
index++;
|
||||
}
|
||||
y += 12;
|
||||
}
|
||||
y += 12;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (view_base != VIEW_CHAN_MONITOR) {
|
||||
// Flight Mode Name
|
||||
uint8_t mode = mixerCurrentFlightMode;
|
||||
lcdDrawSizedText(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR | PHASE_FLAGS);
|
||||
|
||||
// Model Name
|
||||
putsModelName(MODELNAME_X, MODELNAME_Y, g_model.header.name, g_eeGeneral.currModel, BIGSIZE);
|
||||
|
||||
// Main Voltage (or alarm if any)
|
||||
displayVoltageOrAlarm();
|
||||
|
||||
// Timer 1
|
||||
drawTimerWithMode(125, 2 * FH, 0, RIGHT | DBLSIZE);
|
||||
|
||||
// Trims sliders
|
||||
displayTrims(mode);
|
||||
|
||||
// RSSI gauge / external antenna
|
||||
drawExternalAntennaAndRSSI();
|
||||
|
||||
// And ! in case of unexpected shutdown
|
||||
if (isAsteriskDisplayed()) {
|
||||
lcdDrawChar(REBOOT_X, 0 * FH, '!', INVERS | BLINK);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Timer2
|
||||
drawTimerWithMode(87, 5*FH, 1);
|
||||
|
||||
#if defined(PCBI6X)
|
||||
// Add square in case of pending or ongoing eeprom write
|
||||
if (storageDirtyMsk || eepromIsWriting()) {
|
||||
lcdDrawRect(REBOOT_X + 3, 0 * FH, 4, 4);
|
||||
}
|
||||
#endif // PCBI6X
|
||||
}
|
||||
|
||||
// And ! in case of unexpected shutdown
|
||||
#if defined(LOG_TELEMETRY) || defined(WATCHDOG_DISABLED)
|
||||
lcdDrawChar(REBOOT_X, 0*FH, '!', INVERS);
|
||||
#else
|
||||
if (globalData.unexpectedShutdown) {
|
||||
lcdDrawChar(REBOOT_X, 0*FH, '!', INVERS);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(GVARS) && !defined(PCBSTD)
|
||||
#if defined(GVARS)
|
||||
if (gvarDisplayTimer > 0) {
|
||||
gvarDisplayTimer--;
|
||||
warningText = STR_GLOBAL_VAR;
|
||||
drawMessageBox();
|
||||
lcdDrawSizedText(16, 5*FH, g_model.gvars[gvarLastChanged].name, LEN_GVAR_NAME, ZCHAR);
|
||||
lcdDrawText(16+6*FW, 5*FH, "[", BOLD);
|
||||
drawGVarValue(lcdLastRightPos, 5*FH, gvarLastChanged, GVAR_VALUE(gvarLastChanged, getGVarFlightMode(mixerCurrentFlightMode, gvarLastChanged)), LEFT|BOLD);
|
||||
showMessageBox(warningText); // drawMessageBox(warningText);
|
||||
lcdDrawSizedText(16, 5 * FH, g_model.gvars[gvarLastChanged].name, LEN_GVAR_NAME, ZCHAR);
|
||||
lcdDrawText(16 + 6 * FW, 5 * FH, "[", BOLD);
|
||||
drawGVarValue(lcdLastRightPos, 5 * FH, gvarLastChanged, GVAR_VALUE(gvarLastChanged, getGVarFlightMode(mixerCurrentFlightMode, gvarLastChanged)),
|
||||
LEFT | BOLD);
|
||||
if (g_model.gvars[gvarLastChanged].unit) {
|
||||
lcdDrawText(lcdLastRightPos, 5*FH, "%", BOLD);
|
||||
lcdDrawText(lcdLastRightPos, 5 * FH, "%", BOLD);
|
||||
}
|
||||
lcdDrawText(lcdLastRightPos, 5*FH, "]", BOLD);
|
||||
warningText = NULL;
|
||||
lcdDrawText(lcdLastRightPos, 5 * FH, "]", BOLD);
|
||||
warningText = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DSM2)
|
||||
if (moduleFlag[0] == MODULE_BIND) {
|
||||
if (moduleState[0].mode == MODULE_MODE_BIND) {
|
||||
// Issue 98
|
||||
lcdDrawText(15*FW, 0, "BIND", 0);
|
||||
lcdDrawText(15 * FW, 0, "BIND", 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void menuStatisticsView(event_t event)
|
||||
#if !defined(PCBTARANIS)
|
||||
case EVT_KEY_LONG(KEY_MENU): // historical
|
||||
#endif
|
||||
#if !defined(PCBSKY9X) && !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
#endif
|
||||
g_eeGeneral.globalTimer = 0;
|
||||
@@ -120,10 +120,6 @@ void menuStatisticsDebug(event_t event)
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
#if defined(PCBSKY9X)
|
||||
g_eeGeneral.mAhUsed = 0;
|
||||
Current_used = 0;
|
||||
#endif
|
||||
g_eeGeneral.globalTimer = 0;
|
||||
sessionTimer = 0;
|
||||
storageDirty(EE_GENERAL);
|
||||
@@ -131,7 +127,8 @@ void menuStatisticsDebug(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
maxMixerDuration = 0;
|
||||
// telemetryErrors = 0;
|
||||
maxMixerDuration = 0;
|
||||
break;
|
||||
|
||||
|
||||
@@ -139,9 +136,10 @@ void menuStatisticsDebug(event_t event)
|
||||
#if defined(PCBX7)
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
#endif
|
||||
#if !defined(PCBI6X) // single debug screen
|
||||
chainMenu(menuStatisticsDebug2);
|
||||
return;
|
||||
|
||||
#endif
|
||||
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
#if defined(PCBX7)
|
||||
@@ -156,13 +154,9 @@ void menuStatisticsDebug(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
if ((ResetReason&RSTC_SR_RSTTYP) == (2<<8)) {
|
||||
lcdDrawText(LCD_W-8*FW, 0*FH, "WATCHDOG");
|
||||
}
|
||||
else if (globalData.unexpectedShutdown) {
|
||||
lcdDrawText(LCD_W-13*FW, 0*FH, "UNEXP.SHTDOWN");
|
||||
}
|
||||
#if defined(PCBI6X) // single debug screen
|
||||
// lcdDrawTextAlignedLeft(MENU_DEBUG_ROW1, "Tlm RX Err");
|
||||
// lcdDrawNumber(MENU_DEBUG_COL1_OFS + FW, MENU_DEBUG_ROW1, telemetryErrors, RIGHT);
|
||||
#endif
|
||||
|
||||
#if defined(TX_CAPACITY_MEASUREMENT)
|
||||
@@ -177,13 +171,6 @@ void menuStatisticsDebug(event_t event)
|
||||
drawValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MAH, g_eeGeneral.mAhUsed + Current_used*current_scale/8192/36, UNIT_MAH, LEFT|PREC1);
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_CPU_TEMP, STR_CPU_TEMP);
|
||||
drawValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_CPU_TEMP, getTemperature(), UNIT_TEMPERATURE, LEFT);
|
||||
lcdDrawChar(MENU_DEBUG_COL2_OFS, MENU_DEBUG_Y_CPU_TEMP, '>');
|
||||
drawValueWithUnit(MENU_DEBUG_COL2_OFS+FW+1, MENU_DEBUG_Y_CPU_TEMP, maxTemperature+g_eeGeneral.temperatureCalib, UNIT_TEMPERATURE, LEFT);
|
||||
#endif
|
||||
|
||||
#if defined(COPROCESSOR)
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_COPROC, STR_COPROC_TEMP);
|
||||
|
||||
@@ -202,7 +189,7 @@ void menuStatisticsDebug(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBTARANIS) //|| defined(PCBI6X)
|
||||
#if !defined(SIMU) && defined(DEBUG)
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_USB, "Usb");
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_USB, charsWritten, LEFT);
|
||||
@@ -225,17 +212,25 @@ void menuStatisticsDebug(event_t event)
|
||||
#endif // LUA
|
||||
#endif // PCBTARANIS
|
||||
|
||||
// lcdDrawTextAlignedLeft(MENU_DEBUG_Y_COPROC, "Stack");
|
||||
// lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, stackAvailable(), LEFT);
|
||||
// lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_COPROC, "/");
|
||||
// lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_COPROC, stackSize() * 4, LEFT);
|
||||
|
||||
// lcdDrawTextAlignedLeft(MENU_DEBUG_Y_COPROC, "USB Conn");
|
||||
// lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, ((GPIOA->IDR & GPIO_IDR_11) ? 1 : 0), LEFT);
|
||||
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_MIXMAX, "ms");
|
||||
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS, menusStack.available(), UNSIGN|LEFT);
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
|
||||
lcdDrawNumber(lcdLastRightPos+1, MENU_DEBUG_Y_RTOS, mixerStack.available(), UNSIGN|LEFT);
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
|
||||
#if defined(AUDIO)
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
|
||||
lcdDrawNumber(lcdLastRightPos+1, MENU_DEBUG_Y_RTOS, audioStack.available(), UNSIGN|LEFT);
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
|
||||
#endif
|
||||
|
||||
lcdDrawText(4*FW, 7*FH+1, STR_MENUTORESET);
|
||||
@@ -249,7 +244,7 @@ void menuStatisticsDebug2(event_t event)
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
telemetryErrors = 0;
|
||||
// telemetryErrors = 0;
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
@@ -272,8 +267,8 @@ void menuStatisticsDebug2(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_ROW1, "Tlm RX Err");
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS + FW, MENU_DEBUG_ROW1, telemetryErrors, RIGHT);
|
||||
// lcdDrawTextAlignedLeft(MENU_DEBUG_ROW1, "Tlm RX Err");
|
||||
// lcdDrawNumber(MENU_DEBUG_COL1_OFS + FW, MENU_DEBUG_ROW1, telemetryErrors, RIGHT);
|
||||
#if defined(BLUETOOTH)
|
||||
#if defined(PCBX7)
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_ROW2, "BT status");
|
||||
|
||||
@@ -21,12 +21,10 @@
|
||||
#include "opentx.h"
|
||||
|
||||
#define STATUS_BAR_Y (7*FH+1)
|
||||
#define TELEM_2ND_COLUMN (10*FW)
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
uint8_t s_frsky_view = 0;
|
||||
uint8_t selectedTelemView = 0;
|
||||
#endif
|
||||
|
||||
|
||||
#define BAR_LEFT 25
|
||||
#define BAR_WIDTH 100
|
||||
|
||||
@@ -43,13 +41,11 @@ void displayRssiLine()
|
||||
lcdDrawFilledRect(66+36-v, 58, v, 5, (rssi < g_model.rssiAlarms.getWarningRssi()) ? DOTTED : SOLID);
|
||||
}
|
||||
else {
|
||||
lcdDrawText(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
|
||||
lcdDrawText(LCD_W/2, STATUS_BAR_Y, STR_NODATA, BLINK|CENTERED);
|
||||
lcdInvertLastLine();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t barCoord(int16_t value, int16_t min, int16_t max)
|
||||
{
|
||||
if (value <= min)
|
||||
@@ -60,7 +56,6 @@ uint8_t barCoord(int16_t value, int16_t min, int16_t max)
|
||||
return ((int32_t)(BAR_WIDTH-1) * (value - min)) / (max - min);
|
||||
}
|
||||
|
||||
|
||||
bool displayGaugesTelemetryScreen(FrSkyScreenData & screen)
|
||||
{
|
||||
// Custom Screen with gauges
|
||||
@@ -74,27 +69,20 @@ bool displayGaugesTelemetryScreen(FrSkyScreenData & screen)
|
||||
barMin = calc100toRESX(barMin);
|
||||
barMax = calc100toRESX(barMax);
|
||||
}
|
||||
if (source && barMax > barMin) {
|
||||
if (source) {
|
||||
uint8_t y = barHeight+6+i*(barHeight+6);
|
||||
drawSource(0, y+barHeight/2-3, source, SMLSIZE);
|
||||
lcdDrawRect(BAR_LEFT, y, BAR_WIDTH+1, barHeight+2);
|
||||
getvalue_t value = getValue(source);
|
||||
|
||||
uint8_t thresholdX = 0;
|
||||
|
||||
|
||||
uint8_t width = barCoord(value, barMin, barMax);
|
||||
|
||||
uint8_t width = (barMin < barMax) ? barCoord(value, barMin, barMax) : 99 - barCoord(value, barMax, barMin);
|
||||
uint8_t barShade = SOLID;
|
||||
|
||||
lcdDrawFilledRect(BAR_LEFT+1, y+1, width, barHeight, barShade);
|
||||
|
||||
for (uint8_t j=24; j<99; j+=25) {
|
||||
if (j>thresholdX || j>width) {
|
||||
lcdDrawSolidVerticalLine(j*BAR_WIDTH/100+BAR_LEFT+1, y+1, barHeight);
|
||||
}
|
||||
}
|
||||
|
||||
if (thresholdX) {
|
||||
lcdDrawVerticalLine(BAR_LEFT+1+thresholdX, y-2, barHeight+3, DOTTED);
|
||||
lcdDrawSolidHorizontalLine(BAR_LEFT+thresholdX, y-2, 3);
|
||||
@@ -113,7 +101,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||
// Custom Screen with numbers
|
||||
uint8_t fields_count = 0;
|
||||
lcdDrawSolidVerticalLine(63, 8, 48);
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
for (uint32_t i=0; i<4; i++) {
|
||||
for (uint8_t j=0; j<NUM_LINE_ITEMS; j++) {
|
||||
source_t field = screen.lines[i].sources[j];
|
||||
if (field > 0) {
|
||||
@@ -131,6 +119,8 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||
if (field >= MIXSRC_FIRST_TIMER && field <= MIXSRC_LAST_TIMER && i!=3) {
|
||||
// there is not enough space on LCD for displaying "Tmr1" or "Tmr2" and still see the - sign, we write "T1" or "T2" instead
|
||||
drawStringWithIndex(pos[j], 1+FH+2*FH*i, "T", field-MIXSRC_FIRST_TIMER+1, 0);
|
||||
drawTimerWithMode(pos[j+1] + 2, 1+FH+2*FH*i, field - MIXSRC_FIRST_TIMER, RIGHT | DBLSIZE);
|
||||
continue;
|
||||
}
|
||||
else if (field >= MIXSRC_FIRST_TELEM && isGPSSensor(1+(field-MIXSRC_FIRST_TELEM)/3) && telemetryItems[(field-MIXSRC_FIRST_TELEM)/3].isAvailable()) {
|
||||
// we don't display GPS name, no space for it
|
||||
@@ -149,7 +139,8 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||
att |= INVERS|BLINK;
|
||||
}
|
||||
}
|
||||
if(isSensorUnit(1+(field-MIXSRC_FIRST_TELEM)/3, UNIT_DATETIME) && field >= MIXSRC_FIRST_TELEM) {
|
||||
|
||||
if (isSensorUnit(1+(field-MIXSRC_FIRST_TELEM)/3, UNIT_DATETIME) && field >= MIXSRC_FIRST_TELEM) {
|
||||
drawTelemScreenDate(pos[j+1]-36, 6+FH+2*FH*i, field, SMLSIZE|NO_UNIT);
|
||||
}
|
||||
else {
|
||||
@@ -167,7 +158,7 @@ bool displayCustomTelemetryScreen(uint8_t index)
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
FrSkyScreenData & screen = g_model.frsky.screens[index];
|
||||
|
||||
if (IS_BARS_SCREEN(s_frsky_view)) {
|
||||
if (IS_BARS_SCREEN(selectedTelemView)) {
|
||||
return displayGaugesTelemetryScreen(screen);
|
||||
}
|
||||
|
||||
@@ -176,12 +167,14 @@ bool displayCustomTelemetryScreen(uint8_t index)
|
||||
return true;
|
||||
}
|
||||
|
||||
void inavRun(event_t event);
|
||||
|
||||
bool displayTelemetryScreen()
|
||||
{
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
#if defined(LUA)
|
||||
if (TELEMETRY_SCREEN_TYPE(s_frsky_view) == TELEMETRY_SCREEN_TYPE_SCRIPT) {
|
||||
uint8_t state = isTelemetryScriptAvailable(s_frsky_view);
|
||||
if (TELEMETRY_SCREEN_TYPE(selectedTelemView) == TELEMETRY_SCREEN_TYPE_SCRIPT) {
|
||||
uint8_t state = isTelemetryScriptAvailable(selectedTelemView);
|
||||
switch (state) {
|
||||
case SCRIPT_OK:
|
||||
return true; // contents will be drawed by Lua Task
|
||||
@@ -195,16 +188,21 @@ bool displayTelemetryScreen()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#elif defined(PCBI6X_INAV)
|
||||
if (TELEMETRY_SCREEN_TYPE(selectedTelemView) == TELEMETRY_SCREEN_TYPE_SCRIPT) {
|
||||
inavRun(0xff);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (TELEMETRY_SCREEN_TYPE(s_frsky_view) == TELEMETRY_SCREEN_TYPE_NONE) {
|
||||
if (TELEMETRY_SCREEN_TYPE(selectedTelemView) == TELEMETRY_SCREEN_TYPE_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
drawTelemetryTopBar();
|
||||
|
||||
if (s_frsky_view < MAX_TELEMETRY_SCREENS) {
|
||||
return displayCustomTelemetryScreen(s_frsky_view);
|
||||
if (selectedTelemView < MAX_TELEMETRY_SCREENS) {
|
||||
return displayCustomTelemetryScreen(selectedTelemView);
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +229,7 @@ enum NavigationDirection {
|
||||
#define EVT_KEY_NEXT_VIEW EVT_KEY_FIRST(KEY_DOWN)
|
||||
#endif
|
||||
|
||||
void menuViewTelemetryFrsky(event_t event)
|
||||
void menuViewTelemetry(event_t event)
|
||||
{
|
||||
#if defined(TELEMETRY_FRSKY)
|
||||
enum NavigationDirection direction = none;
|
||||
@@ -246,26 +244,14 @@ void menuViewTelemetryFrsky(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_PREVIOUS_VIEW:
|
||||
#if defined(PCBXLITE)
|
||||
if (IS_SHIFT_PRESSED()) {
|
||||
decrTelemetryScreen();
|
||||
}
|
||||
#else
|
||||
if (IS_KEY_LONG(EVT_KEY_PREVIOUS_VIEW)) {
|
||||
killEvents(event);
|
||||
}
|
||||
decrTelemetryScreen();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EVT_KEY_NEXT_VIEW:
|
||||
#if defined(PCBXLITE)
|
||||
if (IS_SHIFT_PRESSED()) {
|
||||
incrTelemetryScreen();
|
||||
}
|
||||
#else
|
||||
incrTelemetryScreen();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
@@ -278,12 +264,12 @@ void menuViewTelemetryFrsky(event_t event)
|
||||
|
||||
for (int i=0; i<=TELEMETRY_SCREEN_TYPE_MAX; i++) {
|
||||
if (direction == up) {
|
||||
if (s_frsky_view-- == 0)
|
||||
s_frsky_view = TELEMETRY_VIEW_MAX;
|
||||
if (selectedTelemView-- == 0)
|
||||
selectedTelemView = TELEMETRY_VIEW_MAX;
|
||||
}
|
||||
else if (direction == down) {
|
||||
if (s_frsky_view++ == TELEMETRY_VIEW_MAX)
|
||||
s_frsky_view = 0;
|
||||
if (selectedTelemView++ == TELEMETRY_VIEW_MAX)
|
||||
selectedTelemView = 0;
|
||||
}
|
||||
else {
|
||||
direction = down;
|
||||
|
||||
@@ -34,17 +34,12 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval)
|
||||
|
||||
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||
{
|
||||
#if defined(GRAPHICS)
|
||||
if (value)
|
||||
lcdDrawChar(x+1, y, '#');
|
||||
if (attr)
|
||||
lcdDrawSolidFilledRect(x, y, 7, 7);
|
||||
else
|
||||
lcdDrawSquare(x, y, 7);
|
||||
#else
|
||||
/* ON / OFF version */
|
||||
lcdDrawTextAtIndex(x, y, STR_OFFON, value, attr ? INVERS:0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
||||
@@ -67,16 +62,17 @@ void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uin
|
||||
|
||||
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max)
|
||||
{
|
||||
// lcdDrawRect(x, y, w+1, h);
|
||||
// lcdDrawFilledRect(x+1, y+1, w-1, 4, SOLID, ERASE);
|
||||
// coord_t len = limit((uint8_t)1, uint8_t((abs(val) * w/2 + max/2) / max), uint8_t(w/2));
|
||||
// coord_t x0 = (val>0) ? x+w/2 : x+1+w/2-len;
|
||||
// for (coord_t i=h-2; i>0; i--) {
|
||||
// lcdDrawSolidHorizontalLine(x0, y+i, len);
|
||||
// }
|
||||
lcdDrawRect(x, y, w+1, h, 0xff);
|
||||
uint8_t len = limit((uint8_t)1, uint8_t(w*val/max), uint8_t(w));
|
||||
lcdDrawSolidFilledRect(x+1, y+1, len, h-2);
|
||||
#if defined(PCBX7) || defined(PCBX9LITES) || defined(PCBI6X) // X7 LCD doesn't like too many horizontal lines
|
||||
h++;
|
||||
#else
|
||||
lcdDrawRect(x, y, w+1, h);
|
||||
#endif
|
||||
lcdDrawFilledRect(x+1, y+1, w-1, 4, SOLID, ERASE);
|
||||
coord_t len = limit((uint8_t)1, uint8_t((abs(val) * w/2 + max/2) / max), uint8_t(w/2));
|
||||
coord_t x0 = (val>0) ? x+w/2 : x+1+w/2-len;
|
||||
for (coord_t i=h-2; i>0; i--) {
|
||||
lcdDrawSolidHorizontalLine(x0, y+i, len);
|
||||
}
|
||||
}
|
||||
|
||||
void title(const char * s)
|
||||
@@ -84,39 +80,58 @@ void title(const char * s)
|
||||
lcdDrawText(0, 0, s, INVERS);
|
||||
}
|
||||
|
||||
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event)
|
||||
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, coord_t lblX, IsValueAvailable isValueAvailable)
|
||||
{
|
||||
drawFieldLabel(x, y, label);
|
||||
if (label) {
|
||||
lcdDrawText(lblX, y, label);
|
||||
}
|
||||
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
|
||||
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (menuVerticalPositions[0] == 0) ? EE_MODEL : EE_GENERAL);
|
||||
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (menuVerticalPositions[0] == 0) ? EE_MODEL : EE_GENERAL, isValueAvailable);
|
||||
return value;
|
||||
}
|
||||
|
||||
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event )
|
||||
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, coord_t lblX)
|
||||
{
|
||||
return editChoice(x, y, label, values, value, min, max, attr, event, lblX, nullptr);
|
||||
}
|
||||
|
||||
choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event)
|
||||
{
|
||||
return editChoice(x, y, label, values, value, min, max, attr, event, 0, nullptr);
|
||||
}
|
||||
|
||||
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event, coord_t lblX)
|
||||
{
|
||||
#if defined(GRAPHICS)
|
||||
drawCheckBox(x, y, value, attr);
|
||||
return editChoice(x, y, label, NULL, value, 0, 1, attr, event);
|
||||
#else
|
||||
return editChoice(x, y, label, STR_OFFON, value, 0, 1, attr, event);
|
||||
#endif
|
||||
return editChoice(x, y, label, nullptr, value, 0, 1, attr, event, lblX);
|
||||
}
|
||||
|
||||
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event)
|
||||
{
|
||||
return editCheckBox(value, x, y, label, attr, event, 0);
|
||||
}
|
||||
|
||||
int8_t editSwitch(coord_t x, coord_t y, int8_t value, LcdFlags attr, event_t event)
|
||||
{
|
||||
drawFieldLabel(x, y, STR_SWITCH);
|
||||
lcdDrawTextAlignedLeft(y, STR_SWITCH);
|
||||
drawSwitch(x, y, value, attr);
|
||||
if (attr & (~RIGHT)) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
|
||||
return value;
|
||||
}
|
||||
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t width, uint8_t value, uint8_t max, uint8_t attr)
|
||||
{
|
||||
lcdDrawChar(x+(value*4*FW)/max, y, '$');
|
||||
lcdDrawSolidHorizontalLine(x, y+3, 5*FW-1, FORCE);
|
||||
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) lcdDrawSolidFilledRect(x, y, 5*FW-1, FH-1);
|
||||
lcdDrawChar(x + (value * (width - FWNUM)) / max, y, '$');
|
||||
lcdDrawSolidHorizontalLine(x, y + 3, width, FORCE);
|
||||
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) {
|
||||
lcdDrawSolidFilledRect(x, y, width, FH - 1);
|
||||
}
|
||||
}
|
||||
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
{
|
||||
drawSlider(x, y, 5*FW - 1, value, max, attr);
|
||||
}
|
||||
|
||||
#if defined(GVARS)
|
||||
void drawGVarValue(coord_t x, coord_t y, uint8_t gvar, gvar_t value, LcdFlags flags)
|
||||
@@ -260,6 +275,20 @@ void drawProgressBar(const char * label, int num, int den)
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
void drawChannelValue(coord_t x, coord_t y, uint8_t ch, int16_t value, LcdFlags flags)
|
||||
{
|
||||
int16_t valueToDisplay;
|
||||
if (g_eeGeneral.ppmunit == PPM_US) {
|
||||
valueToDisplay = PPM_CH_CENTER(ch) + value / 2;
|
||||
} else if (g_eeGeneral.ppmunit == PPM_PERCENT_PREC1) {
|
||||
flags |= PREC1;
|
||||
valueToDisplay = calcRESXto1000(value);
|
||||
} else {
|
||||
valueToDisplay = calcRESXto1000(value) / 10;
|
||||
}
|
||||
lcdDrawNumber(x, y, valueToDisplay, flags);
|
||||
}
|
||||
|
||||
const unsigned char SLEEP_BITMAP[] = {
|
||||
#include "sleep.lbm"
|
||||
};
|
||||
@@ -270,7 +299,7 @@ const unsigned char SLEEP_BITMAP[] = {
|
||||
void drawSleepBitmap()
|
||||
{
|
||||
lcdClear();
|
||||
#if !defined(PCBI6)
|
||||
#if !defined(PCBI6X)
|
||||
lcdDraw1bitBitmap((LCD_W-SLEEP_BITMAP_WIDTH)/2, (LCD_H-SLEEP_BITMAP_HEIGHT)/2, SLEEP_BITMAP, 0);
|
||||
#else
|
||||
lcdDrawText(LCD_W/2, LCD_H/2 - 4, "z z z", CENTERED);
|
||||
|
||||
@@ -122,7 +122,7 @@ uint8_t * lcdLoadBitmap(uint8_t * bmp, const char * filename, uint16_t width, ui
|
||||
f_close(&bmpFile);
|
||||
return NULL;
|
||||
}
|
||||
for (uint8_t i=0; i<16; i++) {
|
||||
for (uint32_t i=0; i<16; i++) {
|
||||
palette[i] = buf[4*i] >> 4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,11 +47,6 @@
|
||||
|
||||
#define MENUS_SCROLLBAR_WIDTH 2
|
||||
|
||||
inline void drawFieldLabel(coord_t x, coord_t y, const char * str)
|
||||
{
|
||||
lcdDrawText(0, y, str);
|
||||
}
|
||||
|
||||
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
||||
bool loadModelBitmap(char * name, uint8_t * bitmap);
|
||||
|
||||
@@ -254,10 +249,6 @@ void editSingleName(coord_t x, coord_t y, const char * label, char * name, uint8
|
||||
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay);
|
||||
#define EDIT_DELAY(y, event, attr, str, delay) editDelay(y, event, attr, str, delay)
|
||||
|
||||
#define WARNING_TYPE_ASTERISK 0
|
||||
#define WARNING_TYPE_CONFIRM 1
|
||||
#define WARNING_TYPE_INPUT 2
|
||||
|
||||
void copySelection(char * dst, const char * src, uint8_t size);
|
||||
|
||||
extern const char * warningText;
|
||||
@@ -306,7 +297,6 @@ void menuChannelsView(event_t event);
|
||||
#endif
|
||||
|
||||
#define REPEAT_LAST_CURSOR_MOVE() { if (CURSOR_MOVED_LEFT(event) || CURSOR_MOVED_RIGHT(event)) putEvent(event); else menuHorizontalPosition = 0; }
|
||||
#define MOVE_CURSOR_FROM_HERE() if (menuHorizontalPosition > 0) REPEAT_LAST_CURSOR_MOVE()
|
||||
|
||||
#define MENU_FIRST_LINE_EDIT (menuTab ? (MAXCOL((uint16_t)0) >= HIDDEN_ROW ? (MAXCOL((uint16_t)1) >= HIDDEN_ROW ? 2 : 1) : 0) : 0)
|
||||
#define POS_HORZ_INIT(posVert) ((COLATTR(posVert) & NAVIGATION_LINE_BY_LINE) ? -1 : 0)
|
||||
|
||||
@@ -467,7 +467,7 @@ void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat, Lc
|
||||
}
|
||||
#endif
|
||||
|
||||
void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h, LcdFlags att)
|
||||
void lcdDrawSolidVerticalLine(coord_t x, coord_t y, coord_t h, LcdFlags att)
|
||||
{
|
||||
lcdDrawVerticalLine(x, y, h, SOLID, att);
|
||||
}
|
||||
@@ -482,9 +482,9 @@ void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFla
|
||||
}
|
||||
|
||||
#if !defined(BOOT)
|
||||
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||
void lcdDrawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||
{
|
||||
for (scoord_t i=y; i<(scoord_t)(y+h); i++) {
|
||||
for (coord_t i=y; i<y+h; i++) {
|
||||
if ((att&ROUND) && (i==y || i==y+h-1))
|
||||
lcdDrawHorizontalLine(x+1, i, w-2, pat, att);
|
||||
else
|
||||
@@ -516,7 +516,7 @@ void drawRtcTime(coord_t x, coord_t y, LcdFlags att)
|
||||
drawTimer(x, y, getValue(MIXSRC_TX_TIME), att, att);
|
||||
}
|
||||
|
||||
void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2)
|
||||
void drawTimer(coord_t x, coord_t y, int32_t tme, LcdFlags att, LcdFlags att2)
|
||||
{
|
||||
div_t qr;
|
||||
|
||||
@@ -685,7 +685,7 @@ void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
||||
void drawSwitch(coord_t x, coord_t y, int32_t idx, LcdFlags flags)
|
||||
{
|
||||
char s[8];
|
||||
getSwitchString(s, idx);
|
||||
getSwitchPositionName(s, idx);
|
||||
lcdDrawText(x, y, s, flags);
|
||||
}
|
||||
|
||||
@@ -877,7 +877,7 @@ void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlag
|
||||
}
|
||||
}
|
||||
|
||||
void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att)
|
||||
void lcdDrawVerticalLine(coord_t x, coord_t y, coord_t h, uint8_t pat, LcdFlags att)
|
||||
{
|
||||
if (x >= LCD_W) return;
|
||||
if (y >= LCD_H) return;
|
||||
@@ -922,7 +922,7 @@ void lcdDraw1bitBitmap(coord_t x, coord_t y, const unsigned char * img, uint8_t
|
||||
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false);
|
||||
q += idx*w*hb;
|
||||
for (uint8_t yb = 0; yb < hb; yb++) {
|
||||
for (uint8_t i=0; i<w; i++) {
|
||||
for (uint32_t i=0; i<w; i++) {
|
||||
uint8_t b = *(q++);
|
||||
uint8_t val = inv ? ~b : b;
|
||||
for (int k=0; k<8; k++) {
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
#define _LCD_H_
|
||||
|
||||
|
||||
typedef int coord_t;
|
||||
typedef uint32_t LcdFlags;
|
||||
typedef uint8_t display_t;
|
||||
|
||||
#define BOX_WIDTH 31
|
||||
#define coord_t int
|
||||
#define scoord_t int
|
||||
#define CENTER "\015"
|
||||
#define CENTER_OFS (7*FW-FW/2)
|
||||
|
||||
#define lcdint_t int32_t
|
||||
|
||||
#define FW 6
|
||||
#define FWNUM 5
|
||||
#define FH 8
|
||||
@@ -84,9 +84,6 @@
|
||||
#define GREY_DEFAULT GREY(11)
|
||||
#define COLOUR_MASK(x) ((x) & 0x0F0000)
|
||||
|
||||
#define LcdFlags uint32_t
|
||||
|
||||
#define display_t uint8_t
|
||||
#define DISPLAY_BUFFER_SIZE (LCD_W*LCD_H*4/8)
|
||||
|
||||
#if (defined(PCBX9E) || defined(PCBX9DP)) && defined(LCD_DUAL_BUFFER)
|
||||
@@ -134,11 +131,9 @@ void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags attr);
|
||||
void putsVolts(coord_t x, coord_t y, uint16_t volts, LcdFlags att);
|
||||
void putsVBat(coord_t x, coord_t y, LcdFlags att);
|
||||
|
||||
#define putstime_t int32_t
|
||||
|
||||
void drawRtcTime(coord_t x, coord_t y, LcdFlags att);
|
||||
void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2);
|
||||
inline void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att)
|
||||
void drawTimer(coord_t x, coord_t y, int32_t tme, LcdFlags att, LcdFlags att2);
|
||||
inline void drawTimer(coord_t x, coord_t y, int32_t tme, LcdFlags att)
|
||||
{
|
||||
drawTimer(x, y, tme, att, att);
|
||||
}
|
||||
@@ -150,11 +145,11 @@ void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att=0);
|
||||
void lcdMaskPoint(uint8_t *p, uint8_t mask, LcdFlags att=0);
|
||||
void lcdDrawSolidHorizontalLine(coord_t x, coord_t y, coord_t w, LcdFlags att=0);
|
||||
void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, scoord_t h, LcdFlags att=0);
|
||||
void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawSolidVerticalLine(coord_t x, coord_t y, coord_t h, LcdFlags att=0);
|
||||
void lcdDrawVerticalLine(coord_t x, coord_t y, coord_t h, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
inline void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags att=0)
|
||||
void lcdDrawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
inline void lcdDrawSolidFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, LcdFlags att=0)
|
||||
{
|
||||
lcdDrawFilledRect(x, y, w, h, SOLID, att);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ const MenuHandlerFunc menuTabModel[] = {
|
||||
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay)
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, str);
|
||||
lcdDrawNumber(MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
||||
lcdDrawNumber(MIXES_2ND_COLUMN, y, delay, attr|PREC1|LEFT);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, delay, DELAY_MAX);
|
||||
return delay;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
@@ -26,10 +26,7 @@ const MenuHandlerFunc menuTabGeneral[] = {
|
||||
menuRadioSpecialFunctions,
|
||||
menuRadioTrainer,
|
||||
menuRadioVersion,
|
||||
menuRadioDiagKeys,
|
||||
menuRadioDiagAnalogs,
|
||||
menuRadioHardware,
|
||||
menuRadioCalibration
|
||||
menuRadioHardware
|
||||
};
|
||||
|
||||
void menuRadioSpecialFunctions(event_t event)
|
||||
|
||||
@@ -66,10 +66,7 @@ enum MenuRadioIndexes {
|
||||
MENU_RADIO_SPECIAL_FUNCTIONS,
|
||||
MENU_RADIO_TRAINER,
|
||||
MENU_RADIO_VERSION,
|
||||
MENU_RADIO_SWITCHES_TEST,
|
||||
MENU_RADIO_ANALOGS_TEST,
|
||||
MENU_RADIO_HARDWARE,
|
||||
MENU_RADIO_CALIBRATION,
|
||||
MENU_RADIO_PAGES_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -20,19 +20,43 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
void displayPresetChoice(event_t event)
|
||||
void runPopupCurvePreset(event_t event)
|
||||
{
|
||||
runPopupWarning(event);
|
||||
lcdDrawNumber(WARNING_LINE_X+FW*7, WARNING_LINE_Y, 45*warningInputValue/4, LEFT|INVERS);
|
||||
warningResult = false;
|
||||
|
||||
drawMessageBox(warningText);
|
||||
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+2*FH, STR_POPUPS_ENTER_EXIT);
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
if (warningType == WARNING_TYPE_ASTERISK)
|
||||
break;
|
||||
warningResult = true;
|
||||
// no break
|
||||
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
warningText = NULL;
|
||||
warningType = WARNING_TYPE_ASTERISK;
|
||||
break;
|
||||
|
||||
default:
|
||||
s_editMode = EDIT_MODIFY_FIELD;
|
||||
reusableBuffer.curveEdit.preset = checkIncDec(event, reusableBuffer.curveEdit.preset, -4, +4);
|
||||
s_editMode = EDIT_SELECT_FIELD;
|
||||
break;
|
||||
}
|
||||
|
||||
lcdDrawNumber(WARNING_LINE_X+FW*7, WARNING_LINE_Y, 45 * reusableBuffer.curveEdit.preset / 4, LEFT|INVERS);
|
||||
lcdDrawChar(lcdLastRightPos, WARNING_LINE_Y, '@', INVERS);
|
||||
|
||||
if (warningResult) {
|
||||
warningResult = 0;
|
||||
CurveInfo & crv = g_model.curves[s_curveChan];
|
||||
int8_t * points = curveAddress(s_curveChan);
|
||||
int k = 25 * warningInputValue;
|
||||
int k = 25 * reusableBuffer.curveEdit.preset;
|
||||
int dx = 2000 / (5+crv.points-1);
|
||||
for (uint8_t i=0; i<5+crv.points; i++) {
|
||||
for (uint32_t i=0; i<5+crv.points; i++) {
|
||||
int x = -1000 + i * dx;
|
||||
points[i] = div_and_round(div_and_round(k * x, 100), 10);
|
||||
}
|
||||
@@ -45,7 +69,8 @@ void displayPresetChoice(event_t event)
|
||||
void onCurveOneMenu(const char * result)
|
||||
{
|
||||
if (result == STR_CURVE_PRESET) {
|
||||
POPUP_INPUT(STR_PRESET, displayPresetChoice, 0, -4, 4);
|
||||
reusableBuffer.curveEdit.preset = 4; // 45°
|
||||
POPUP_INPUT(STR_PRESET, runPopupCurvePreset);
|
||||
}
|
||||
else if (result == STR_MIRROR) {
|
||||
CurveInfo & crv = g_model.curves[s_curveChan];
|
||||
@@ -155,7 +180,7 @@ void menuModelCurveOne(event_t event)
|
||||
|
||||
uint8_t posY = FH+1;
|
||||
attr = (s_editMode > 0 ? INVERS|BLINK : INVERS);
|
||||
for (uint8_t i=0; i<5+crv.points; i++) {
|
||||
for (uint32_t i=0; i<5+crv.points; i++) {
|
||||
point_t point = getPoint(i);
|
||||
uint8_t selectionMode = 0;
|
||||
if (crv.type==CURVE_TYPE_CUSTOM) {
|
||||
|
||||
@@ -51,21 +51,44 @@ enum MenuModelDisplayItems {
|
||||
#define DISPLAY_COL2 (16*FW)
|
||||
#define DISPLAY_COL3 (28*FW+2)
|
||||
|
||||
#if defined(LUA)
|
||||
#define SCREEN_TYPE_ROWS 1
|
||||
#define DISPLAY_LINE_ROWS(x) ((TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_NONE || TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_SCRIPT) ? HIDDEN_ROW : (uint8_t)2)
|
||||
#else
|
||||
#define SCREEN_TYPE_ROWS 0
|
||||
#define DISPLAY_LINE_ROWS(x) (TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_NONE ? HIDDEN_ROW : (uint8_t)2)
|
||||
#endif
|
||||
#define TELEMETRY_SCREEN_ROWS(x) SCREEN_TYPE_ROWS, DISPLAY_LINE_ROWS(x), DISPLAY_LINE_ROWS(x), DISPLAY_LINE_ROWS(x), DISPLAY_LINE_ROWS(x)
|
||||
inline uint8_t SCREEN_TYPE_COLUMNS(uint8_t screenIndex)
|
||||
{
|
||||
if (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_SCRIPT)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define TELEMETRY_CURRENT_SCREEN(k) (k < ITEM_DISPLAY_SCREEN_LABEL2 ? 0 : (k < ITEM_DISPLAY_SCREEN_LABEL3 ? 1 : (k < ITEM_DISPLAY_SCREEN_LABEL4 ? 2 : 3)))
|
||||
inline uint8_t SCREEN_LINE_COLUMNS(uint8_t screenIndex, uint8_t lineIndex)
|
||||
{
|
||||
switch (TELEMETRY_SCREEN_TYPE(screenIndex)) {
|
||||
case TELEMETRY_SCREEN_TYPE_VALUES:
|
||||
return 2;
|
||||
case TELEMETRY_SCREEN_TYPE_BARS:
|
||||
return g_model.screens[screenIndex].bars[lineIndex].source ? 2 : 0;
|
||||
default:
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
}
|
||||
|
||||
#define TELEMETRY_SCREEN_ROWS(x) SCREEN_TYPE_COLUMNS(x), SCREEN_LINE_COLUMNS(x, 0), SCREEN_LINE_COLUMNS(x, 1), SCREEN_LINE_COLUMNS(x, 2), SCREEN_LINE_COLUMNS(x, 3)
|
||||
|
||||
inline uint8_t DISPLAY_CURRENT_SCREEN(uint8_t line)
|
||||
{
|
||||
if (line < ITEM_DISPLAY_SCREEN_LABEL2)
|
||||
return 0;
|
||||
else if (line < ITEM_DISPLAY_SCREEN_LABEL3)
|
||||
return 1;
|
||||
else if (line < ITEM_DISPLAY_SCREEN_LABEL4)
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
}
|
||||
|
||||
#if defined(LUA)
|
||||
void onTelemetryScriptFileSelectionMenu(const char *result)
|
||||
{
|
||||
int screenIndex = TELEMETRY_CURRENT_SCREEN(menuVerticalPosition);
|
||||
int screenIndex = DISPLAY_CURRENT_SCREEN(menuVerticalPosition);
|
||||
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
if (!sdListFiles(SCRIPTS_TELEM_PATH, SCRIPTS_EXT, sizeof(g_model.frsky.screens[screenIndex].script.file), NULL)) {
|
||||
@@ -122,7 +145,7 @@ void menuModelDisplay(event_t event)
|
||||
case ITEM_DISPLAY_SCREEN_LABEL3:
|
||||
case ITEM_DISPLAY_SCREEN_LABEL4:
|
||||
{
|
||||
uint8_t screenIndex = TELEMETRY_CURRENT_SCREEN(k);
|
||||
uint8_t screenIndex = DISPLAY_CURRENT_SCREEN(k);
|
||||
drawStringWithIndex(0*FW, y, STR_SCREEN, screenIndex+1);
|
||||
TelemetryScreenType oldScreenType = TELEMETRY_SCREEN_TYPE(screenIndex);
|
||||
TelemetryScreenType newScreenType = (TelemetryScreenType)editChoice(DISPLAY_COL2, y, "", STR_VTELEMSCREENTYPE, oldScreenType, 0, TELEMETRY_SCREEN_TYPE_MAX, (menuHorizontalPosition==0 ? attr : 0), event);
|
||||
@@ -151,9 +174,6 @@ void menuModelDisplay(event_t event)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (attr) {
|
||||
MOVE_CURSOR_FROM_HERE();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -195,7 +215,7 @@ void menuModelDisplay(event_t event)
|
||||
|
||||
if (IS_BARS_SCREEN(screenIndex)) {
|
||||
FrSkyBarData & bar = g_model.frsky.screens[screenIndex].bars[lineIndex];
|
||||
drawSource(DISPLAY_COL1, y, bar.source, menuHorizontalPosition==0 ? attr : 0);
|
||||
drawSource(DISPLAY_COL1, y, bar.source, menuHorizontalPosition == 0 ? attr : 0);
|
||||
int16_t barMax, barMin;
|
||||
LcdFlags lf = LEFT;
|
||||
getMixSrcRange(bar.source, barMin, barMax, &lf);
|
||||
@@ -209,9 +229,6 @@ void menuModelDisplay(event_t event)
|
||||
drawSourceCustomValue(DISPLAY_COL3, y, bar.source, bar.barMax, (menuHorizontalPosition==2 ? attr : 0) | lf);
|
||||
}
|
||||
}
|
||||
else if (attr) {
|
||||
MOVE_CURSOR_FROM_HERE();
|
||||
}
|
||||
if (attr && s_editMode>0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
@@ -228,10 +245,10 @@ void menuModelDisplay(event_t event)
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
bar.barMin = checkIncDec(event, bar.barMin, barMin, bar.barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||
bar.barMin = checkIncDec(event, bar.barMin, barMin, barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||
break;
|
||||
case 2:
|
||||
bar.barMax = checkIncDec(event, bar.barMax, bar.barMin, barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||
bar.barMax = checkIncDec(event, bar.barMax, barMin, barMax, EE_MODEL|NO_INCDEC_MARKS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ void menuModelFlightModesAll(event_t event)
|
||||
drawColumnHeader(STR_PHASES_HEADERS, posHorz);
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
for (uint32_t i=0; i<LCD_LINES-1; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i+menuVerticalOffset;
|
||||
|
||||
@@ -126,12 +126,12 @@ void menuModelFlightModesAll(event_t event)
|
||||
}
|
||||
|
||||
case ITEM_FLIGHT_MODES_FADE_IN:
|
||||
lcdDrawNumber(32*FW-2, y, (10/DELAY_STEP)*p->fadeIn, attr|PREC1|RIGHT);
|
||||
lcdDrawNumber(32*FW-2, y, p->fadeIn, attr|PREC1|RIGHT);
|
||||
if (active) p->fadeIn = checkIncDec(event, p->fadeIn, 0, DELAY_MAX, EE_MODEL|NO_INCDEC_MARKS);
|
||||
break;
|
||||
|
||||
case ITEM_FLIGHT_MODES_FADE_OUT:
|
||||
lcdDrawNumber(35*FW, y, (10/DELAY_STEP)*p->fadeOut, attr|PREC1|RIGHT);
|
||||
lcdDrawNumber(35*FW, y, p->fadeOut, attr|PREC1|RIGHT);
|
||||
if (active) p->fadeOut = checkIncDec(event, p->fadeOut, 0, DELAY_MAX, EE_MODEL|NO_INCDEC_MARKS);
|
||||
break;
|
||||
|
||||
|
||||
@@ -91,13 +91,13 @@ void menuModelGVarOne(event_t event)
|
||||
break;
|
||||
|
||||
case GVAR_FIELD_MIN:
|
||||
lcdDrawText(0, y, STR_MIN);
|
||||
lcdDrawTextAlignedLeft(y, STR_MIN);
|
||||
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdx, GVAR_MIN+gvar->min, LEFT|attr);
|
||||
if (attr) gvar->min = checkIncDec(event, GVAR_MIN+gvar->min, GVAR_MIN, GVAR_MAX-gvar->max, EE_MODEL) - GVAR_MIN;
|
||||
break;
|
||||
|
||||
case GVAR_FIELD_MAX:
|
||||
lcdDrawText(0, y, STR_MAX);
|
||||
lcdDrawTextAlignedLeft(y, STR_MAX);
|
||||
drawGVarValue(GVAR_2ND_COLUMN, y, s_currIdx, GVAR_MAX-gvar->max, LEFT|attr);
|
||||
if (attr) gvar->max = GVAR_MAX - checkIncDec(event, GVAR_MAX-gvar->max, GVAR_MIN+gvar->min, GVAR_MAX, EE_MODEL);
|
||||
break;
|
||||
|
||||
@@ -107,7 +107,7 @@ void menuModelExpoOne(event_t event)
|
||||
break;
|
||||
|
||||
case EXPO_FIELD_SOURCE:
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_SOURCE));
|
||||
lcdDrawTextAlignedLeft(y, STR_SOURCE);
|
||||
drawSource(EXPO_ONE_2ND_COLUMN, y, ed->srcRaw, STREXPANDED|attr);
|
||||
if (attr) ed->srcRaw = checkIncDec(event, ed->srcRaw, INPUTSRC_FIRST, INPUTSRC_LAST, EE_MODEL|INCDEC_SOURCE|NO_INCDEC_MARKS, isInputSourceAvailable);
|
||||
break;
|
||||
@@ -124,7 +124,7 @@ void menuModelExpoOne(event_t event)
|
||||
break;
|
||||
|
||||
case EXPO_FIELD_OFFSET:
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_OFFSET));
|
||||
lcdDrawTextAlignedLeft(y, STR_OFFSET);
|
||||
ed->offset = GVAR_MENU_ITEM(EXPO_ONE_2ND_COLUMN, y, ed->offset, -100, 100, LEFT|attr, 0, event);
|
||||
break;
|
||||
|
||||
@@ -135,7 +135,7 @@ void menuModelExpoOne(event_t event)
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
case EXPO_FIELD_FLIGHT_MODES:
|
||||
drawFieldLabel(EXPO_ONE_2ND_COLUMN, y, STR_FLMODE);
|
||||
lcdDrawTextAlignedLeft(y, STR_FLMODE);
|
||||
ed->flightModes = editFlightModes(EXPO_ONE_2ND_COLUMN, y, event, ed->flightModes, attr);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -98,7 +98,7 @@ void menuModelLogicalSwitches(event_t event)
|
||||
POPUP_MENU_START(onLogicalSwitchesMenu);
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<NUM_BODY_LINES; ++i) {
|
||||
for (uint32_t i=0; i<NUM_BODY_LINES; ++i) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
k = i+menuVerticalOffset;
|
||||
LcdFlags attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||
|
||||
@@ -70,13 +70,13 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
|
||||
}
|
||||
lcdDrawSolidVerticalLine(x+gaugeWidth/2-1, y, gaugeHeight+1);
|
||||
if (barMin == -101) {
|
||||
for (uint8_t i=0; i<3; ++i) {
|
||||
for (uint32_t i=0; i<3; ++i) {
|
||||
lcdDrawPoint(x+i, y+4-i);
|
||||
lcdDrawPoint(x+3+i, y+4-i);
|
||||
}
|
||||
}
|
||||
if (barMax == 101) {
|
||||
for (uint8_t i=0; i<3; ++i) {
|
||||
for (uint32_t i=0; i<3; ++i) {
|
||||
lcdDrawPoint(x+gaugeWidth-8+i, y+4-i);
|
||||
lcdDrawPoint(x+gaugeWidth-5+i, y+4-i);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ void menuModelMixOne(event_t event)
|
||||
break;
|
||||
|
||||
case MIX_FIELD_SOURCE:
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_SOURCE));
|
||||
lcdDrawTextAlignedLeft(y, STR_SOURCE);
|
||||
drawSource(MIXES_2ND_COLUMN, y, md2->srcRaw, STREXPANDED|attr);
|
||||
if (attr) CHECK_INCDEC_MODELSOURCE(event, md2->srcRaw, 1, MIXSRC_LAST);
|
||||
break;
|
||||
@@ -121,7 +121,7 @@ void menuModelMixOne(event_t event)
|
||||
|
||||
case MIX_FIELD_OFFSET:
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, NO_INDENT(STR_OFFSET));
|
||||
lcdDrawTextAlignedLeft(y, STR_OFFSET);
|
||||
u_int8int16_t offset;
|
||||
MD_OFFSET_TO_UNION(md2, offset);
|
||||
offset.word = GVAR_MENU_ITEM(MIXES_2ND_COLUMN, y, offset.word, GV_RANGELARGE_OFFSET_NEG, GV_RANGELARGE_OFFSET, attr|LEFT, 0, event);
|
||||
@@ -145,7 +145,7 @@ void menuModelMixOne(event_t event)
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
case MIX_FIELD_FLIGHT_MODE:
|
||||
drawFieldLabel(MIXES_2ND_COLUMN, y, STR_FLMODE);
|
||||
lcdDrawTextAlignedLeft(y, STR_FLMODE);
|
||||
md2->flightModes = editFlightModes(MIXES_2ND_COLUMN, y, event, md2->flightModes, attr);
|
||||
break;
|
||||
#endif
|
||||
@@ -155,7 +155,7 @@ void menuModelMixOne(event_t event)
|
||||
break;
|
||||
|
||||
case MIX_FIELD_WARNING:
|
||||
drawFieldLabel(MIXES_2ND_COLUMN, y, STR_MIXWARNING);
|
||||
lcdDrawTextAlignedLeft(y, STR_MIXWARNING);
|
||||
if (md2->mixWarn)
|
||||
lcdDrawNumber(MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
|
||||
else
|
||||
|
||||
@@ -238,7 +238,7 @@ void menuModelSelect(event_t event)
|
||||
|
||||
TITLE(STR_MENUMODELSEL);
|
||||
|
||||
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
for (uint32_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i+menuVerticalOffset;
|
||||
|
||||
|
||||
@@ -95,8 +95,6 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_MAX
|
||||
};
|
||||
|
||||
#define FIELD_PROTOCOL_MAX 1
|
||||
|
||||
#define MODEL_SETUP_2ND_COLUMN (LCD_W-17*FW-MENUS_SCROLLBAR_WIDTH-1)
|
||||
#define MODEL_SETUP_3RD_COLUMN (MODEL_SETUP_2ND_COLUMN+6*FW)
|
||||
#define MODEL_SETUP_BIND_OFS 3*FW-2
|
||||
@@ -143,7 +141,7 @@ void copySelection(char * dst, const char * src, uint8_t size)
|
||||
void onModelSetupBitmapMenu(const char * result)
|
||||
{
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
if (!sdListFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.header.bitmap), NULL)) {
|
||||
if (!sdListFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.header.bitmap), nullptr)) {
|
||||
POPUP_WARNING(STR_NO_BITMAPS_ON_SD);
|
||||
}
|
||||
}
|
||||
@@ -432,7 +430,7 @@ void menuModelSetup(event_t event)
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
START_NO_HIGHLIGHT();
|
||||
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
|
||||
for (uint32_t i=0; i<MAX_FLIGHT_MODES; i++) {
|
||||
memclear(&g_model.flightModeData[i], TRIMS_ARRAY_SIZE);
|
||||
}
|
||||
storageDirty(EE_MODEL);
|
||||
@@ -668,7 +666,7 @@ void menuModelSetup(event_t event)
|
||||
|
||||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[INTERNAL_MODULE].type, menuHorizontalPosition==0 ? attr : 0);
|
||||
if (isModuleXJT(INTERNAL_MODULE))
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_3RD_COLUMN, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[INTERNAL_MODULE].rfProtocol, menuHorizontalPosition==1 ? attr : 0);
|
||||
@@ -693,7 +691,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#else
|
||||
case ITEM_MODEL_INTERNAL_MODULE_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[0].rfProtocol, attr);
|
||||
if (attr) {
|
||||
g_model.moduleData[INTERNAL_MODULE].rfProtocol = checkIncDec(event, g_model.moduleData[INTERNAL_MODULE].rfProtocol, -1, RF_PROTO_LAST, EE_MODEL, isRfProtocolAvailable);
|
||||
@@ -709,7 +707,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
case ITEM_MODEL_TRAINER_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VTRAINERMODES, g_model.trainerMode, attr);
|
||||
if (attr) {
|
||||
g_model.trainerMode = checkIncDec(event, g_model.trainerMode, 0, TRAINER_MODE_MAX(), EE_MODEL, isTrainerModeAvailable);
|
||||
@@ -727,7 +725,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_MODE:
|
||||
lcdDrawTextAlignedLeft(y, STR_MODE);
|
||||
lcdDrawTextAlignedLeft(y, INDENT TR_MODE);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].type, menuHorizontalPosition==0 ? attr : 0);
|
||||
if (isModuleXJT(EXTERNAL_MODULE))
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_3RD_COLUMN, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, menuHorizontalPosition==1 ? attr : 0);
|
||||
@@ -840,7 +838,7 @@ void menuModelSetup(event_t event)
|
||||
s_editMode = 0;
|
||||
}
|
||||
if (bluetoothDistantAddr[0]) {
|
||||
lcdDrawText(INDENT_WIDTH, y+1, bluetoothDistantAddr, TINSIZE);
|
||||
lcdDrawTextIndented(y+1, bluetoothDistantAddr, TINSIZE);
|
||||
if (bluetoothState != BLUETOOTH_STATE_CONNECTED) {
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Bind"), menuHorizontalPosition == 0 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+5*FW, y, BUTTON("Clear"), menuHorizontalPosition == 1 ? attr : 0);
|
||||
@@ -859,7 +857,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
}
|
||||
else {
|
||||
lcdDrawText(INDENT_WIDTH, y, "---");
|
||||
lcdDrawTextIndented(y, "---");
|
||||
if (bluetoothState < BLUETOOTH_STATE_IDLE)
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON("Init"), attr);
|
||||
else
|
||||
@@ -1033,7 +1031,7 @@ void menuModelSetup(event_t event)
|
||||
newFlag = MODULE_BIND;
|
||||
}
|
||||
else {
|
||||
if (!popupMenuNoItems) {
|
||||
if (!popupMenuItemsCount) {
|
||||
s_editMode = 0; // this is when popup is exited before a choice is made
|
||||
}
|
||||
}
|
||||
@@ -1110,7 +1108,7 @@ void menuModelSetup(event_t event)
|
||||
const uint8_t multi_proto = g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(true);
|
||||
const mm_protocol_definition *pdef = getMultiProtocolDefinition(multi_proto);
|
||||
if (pdef->optionsstr)
|
||||
lcdDrawText(INDENT_WIDTH, y, pdef->optionsstr);
|
||||
lcdDrawTextIndented(y, pdef->optionsstr);
|
||||
|
||||
if (multi_proto == MM_RF_PROTO_FS_AFHDS2A)
|
||||
optionValue = 50 + 5 * optionValue;
|
||||
@@ -1203,7 +1201,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
|
||||
#if defined(PXX)
|
||||
if (IS_RANGECHECK_ENABLE()) {
|
||||
if (isModuleInRangeCheckMode()) {
|
||||
showMessageBox("RSSI: ");
|
||||
lcdDrawNumber(16+4*FW, 5*FH, TELEMETRY_RSSI(), BOLD);
|
||||
}
|
||||
|
||||