Compare commits
3593 Commits
release-2279
...
2.0.13
| Author | SHA1 | Date | |
|---|---|---|---|
| b359aa12ba | |||
| 5f81444ccb | |||
| e8aba51edb | |||
| 6393f10ae4 | |||
| 8a16b63b31 | |||
| a5d334b11d | |||
| b51060f8f8 | |||
| 0db8fc5ab2 | |||
| 1c696c28fd | |||
| f29d2074c1 | |||
| c12bc7326c | |||
| 6365292bfe | |||
| d74bdef2ea | |||
| 884698c7f7 | |||
| 1454764987 | |||
| fb35ff098d | |||
| 681064b11c | |||
| 87ebf0b90a | |||
| 1f63108753 | |||
| 649fffa439 | |||
| e3d08e9bab | |||
| b4cc92b3f0 | |||
| 9691d9f648 | |||
| f02b9699d5 | |||
| b78556275b | |||
| 1effa17204 | |||
| ff69164400 | |||
| 86e8687d32 | |||
| 85755312e4 | |||
| f826d77f18 | |||
| 9dc4756789 | |||
| afd04e0c44 | |||
| d718ca03db | |||
| ca4028cc7e | |||
| 9c0b13eb6b | |||
| 5a10d85ee0 | |||
| 2d80327ffd | |||
| 2a5ff5244f | |||
| 2ce1ec16fb | |||
| 607a93b604 | |||
| 75b7a0517b | |||
| cf54d28f35 | |||
| ffe8ee5a29 | |||
| 552e3d468a | |||
| 949369d6a8 | |||
| 3b2cf5d738 | |||
| 5468bacad7 | |||
| b8fea4d652 | |||
| 734480cc56 | |||
| 30e0d441e4 | |||
| 784238252a | |||
| 403a62478a | |||
| c73ab26bc4 | |||
| c0783948e6 | |||
| dc3ca96a2f | |||
| 5664b4a141 | |||
| 7e18f53cbe | |||
| 611e26d0bf | |||
| ae7a36deeb | |||
| 7c37277364 | |||
| 2230fbaa94 | |||
| 97bb1a4b4d | |||
| 82d385bcef | |||
| 34f9367e25 | |||
| 205e510468 | |||
| 414a482ce4 | |||
| b24d071493 | |||
| a50e2472e9 | |||
| 29c95fd2a3 | |||
| c9875525a4 | |||
| 6df7575ad8 | |||
| 86c8d4a878 | |||
| 6abc26c36a | |||
| 966398426a | |||
| d43a48f088 | |||
| 56b4698655 | |||
| 57f0c1b6f6 | |||
| b89e16e627 | |||
| 9e4e990d33 | |||
| a7c893607a | |||
| e477183026 | |||
| a4698287f8 | |||
| b035a8df64 | |||
| 223be49c5d | |||
| ac8312de36 | |||
| 46a9151bcf | |||
| 0e9536fea9 | |||
| 64d86c4c74 | |||
| 151a09149d | |||
| fd53eba65f | |||
| 393f599ecf | |||
| 1fbb4effed | |||
| fe95488a83 | |||
| c9b9de2c99 | |||
| 3adc4c20a6 | |||
| 227a886122 | |||
| de625fde01 | |||
| daad477250 | |||
| 334a718a8a | |||
| 5baaec1868 | |||
| c2ad82eb35 | |||
| c61c417f13 | |||
| 98f156301a | |||
| ef6fe0006e | |||
| 23358c254c | |||
| 6114245229 | |||
| e76880cf26 | |||
| f30dfa3365 | |||
| f4aa92ec20 | |||
| 2640ca9fea | |||
| f6a1420ce3 | |||
| 6c0f65411a | |||
| a7f1ace55b | |||
| b8dedd7940 | |||
| 2703118c56 | |||
| 8bfc7a497a | |||
| 87870c24a5 | |||
| 7610fb43d5 | |||
| 0263784e65 | |||
| 6f74624371 | |||
| 1c721b3817 | |||
| 67d97046bb | |||
| 19d9e6ab19 | |||
| 5d9883d47f | |||
| bb5f1d7d79 | |||
| 30087b4a3a | |||
| 61aa01b9b3 | |||
| 16e06cff70 | |||
| 2073a1f033 | |||
| 563b817b46 | |||
| 8b540a66f6 | |||
| b0b7657756 | |||
| 74d22b623f | |||
| bee01d9999 | |||
| d2055edf62 | |||
| c926ac557b | |||
| 3e2092e32f | |||
| 21054ffc54 | |||
| 350ece0b60 | |||
| 01a103f2e6 | |||
| 2e8e439d27 | |||
| 98e6a3dc21 | |||
| 3b324d076a | |||
| 91c922d5fb | |||
| eac918c2da | |||
| b5f9c0ec84 | |||
| d1f54b099b | |||
| 7b98ad55c0 | |||
| d2cb7cb3dd | |||
| be190b8bb1 | |||
| 4b2c02b2c5 | |||
| 142d3fee1a | |||
| 6a5e938ead | |||
| 2d9ae108ff | |||
| bae84e4e8c | |||
| f4944eefdb | |||
| 5d598cc6a1 | |||
| 945808d69b | |||
| dbe512e45a | |||
| 11efb5121e | |||
| f6274f38aa | |||
| cd1f20b8a0 | |||
| e61b931ddb | |||
| a7a9b61234 | |||
| 5ee95673d1 | |||
| 98c5b5e7bd | |||
| 6d434c0bf9 | |||
| ade7151796 | |||
| a7cd1f9aa0 | |||
| cb2c922542 | |||
| 8159a559da | |||
| ed826d8c62 | |||
| b57f5ab2ce | |||
| 8fbafa6f05 | |||
| 9243a59426 | |||
| ccf66831c7 | |||
| 06792b5696 | |||
| 6d4d871849 | |||
| 5a634a7991 | |||
| 69e504212e | |||
| 03e049c360 | |||
| 4ca893da1f | |||
| 66670cf713 | |||
| 271bb4a82e | |||
| e0eab648ef | |||
| 3235f43db9 | |||
| c12b0cfebe | |||
| 3e590d44f0 | |||
| 1f6d1799af | |||
| 8c813a87c9 | |||
| 5bdeedbd0e | |||
| e33f4cf415 | |||
| 61d745011a | |||
| 3e269a04ae | |||
| 341feaf78f | |||
| 19ddf6fc23 | |||
| 9b4b0d3c83 | |||
| dc1eebf40d | |||
| 752e13b9ab | |||
| b988bec5bd | |||
| 3c72afed20 | |||
| e7586f47c3 | |||
| f126b149f0 | |||
| 6b15c0c985 | |||
| db85f39ebc | |||
| dee1e4ce8d | |||
| df96504a85 | |||
| 0112a1e3e9 | |||
| 36481471a3 | |||
| dd08886f2c | |||
| 76ef4b5948 | |||
| eaa247f46d | |||
| 3ada9f7cf5 | |||
| 10a5e4dc89 | |||
| 50e4850745 | |||
| a92de216ac | |||
| 3f3708f0f1 | |||
| 72c433ce9d | |||
| f123b69521 | |||
| 80369f0e8f | |||
| 8cd67bf31e | |||
| 34ef060e16 | |||
| 1f07f88dce | |||
| 4db5bdd486 | |||
| 05ac0682f0 | |||
| f12c3072b5 | |||
| 35aea83c89 | |||
| cf9b5d05a8 | |||
| d5393be5cb | |||
| 10c9936fa0 | |||
| 7a74d3ac85 | |||
| 39edaff669 | |||
| c5aed5f79b | |||
| 9b07a77e14 | |||
| 380fe5e44d | |||
| 8bd2c120d6 | |||
| 741ef45f3e | |||
| 4103adf75d | |||
| c0e612531d | |||
| 55cb5dce87 | |||
| 12ba27247e | |||
| 1e33e99655 | |||
| 50acd1fd92 | |||
| c3626225aa | |||
| b71a96ed55 | |||
| d2fcd544d8 | |||
| 50997721e2 | |||
| 828372ab29 | |||
| 21ae270c0e | |||
| 1b2efd1121 | |||
| 8d6a7c9495 | |||
| 189becfbb2 | |||
| 5a19e147fd | |||
| 062f93ae38 | |||
| 9861a08150 | |||
| de15d0a5a4 | |||
| 1e77bb3c02 | |||
| adadbe06ad | |||
| 92f2c48de9 | |||
| 1d4fa2a8b0 | |||
| 5493776b9c | |||
| b166b77c3e | |||
| 0ecb978364 | |||
| c8d792d3d8 | |||
| e9663e40e2 | |||
| a7e906dea9 | |||
| 685ab3d101 | |||
| 77564d74a4 | |||
| a0142d65be | |||
| 662bf15562 | |||
| 79b928af56 | |||
| 8c28f4bc48 | |||
| 7a4d6c89a1 | |||
| 38347becca | |||
| 49036dbb40 | |||
| abf36de157 | |||
| 32afbf5a5a | |||
| cba4a02cc1 | |||
| 4062555605 | |||
| 9cb38ce839 | |||
| 905090ef09 | |||
| 62e5820082 | |||
| 2d21e16201 | |||
| 07303f4301 | |||
| 91228f803c | |||
| e5d7e1f7c2 | |||
| 81573537eb | |||
| 7a85328b86 | |||
| fd84c62ff4 | |||
| 13e0b21656 | |||
| 5949be30fa | |||
| 0117c2da68 | |||
| 943f70c599 | |||
| 52a48fc4b1 | |||
| 2712ffabb0 | |||
| fa8c8a7094 | |||
| 5907193571 | |||
| 45abfb872f | |||
| 4d5962b15b | |||
| eea1c3a84c | |||
| deed7fc20f | |||
| 62fca3f8b6 | |||
| 9377e58407 | |||
| 9b53f69038 | |||
| 3680149b52 | |||
| 93faeeafbe | |||
| 2d5d1cb357 | |||
| 2a5364dc8c | |||
| 7f47a4fe10 | |||
| a0cc428228 | |||
| 61985f7d6a | |||
| 3baf64f123 | |||
| 4fd40c154e | |||
| 3c360618b9 | |||
| 1d96731ad5 | |||
| 9d1d31d26a | |||
| 0b52ccfaf1 | |||
| 484566083e | |||
| 0f33dc6113 | |||
| 7f3778fc3c | |||
| 0a9dcc5ce6 | |||
| 2f01f139cc | |||
| fb3e615008 | |||
| ce6d0807fa | |||
| cab8f3db71 | |||
| 399a8b2e35 | |||
| 3d4a791940 | |||
| 7373ce2cae | |||
| 5da1e35efe | |||
| fe5b7bee8c | |||
| 2da1134796 | |||
| 83e47d9e35 | |||
| f0c76efaf7 | |||
| 2fe7d856c3 | |||
| a7c1f22b36 | |||
| d92620919b | |||
| 94bb21886b | |||
| 5db98a3fef | |||
| 763c7fbb7d | |||
| b2d1a4ed22 | |||
| e7211065ab | |||
| 68b8b0e38f | |||
| 644c833311 | |||
| 30b1f62e99 | |||
| 03aa787c8e | |||
| 79592d3b00 | |||
| 7ed527a328 | |||
| 3e0766f2bf | |||
| 71e7926045 | |||
| 8c3d47deac | |||
| 197f31d5a1 | |||
| 1a198c35ad | |||
| 2934fc4d23 | |||
| 4ae9585080 | |||
| 161016a02a | |||
| 559bb83864 | |||
| 9a37c3027e | |||
| 6548afcad3 | |||
| ee31c51275 | |||
| 63aadad10c | |||
| 30958a9a65 | |||
| 995183bf22 | |||
| 99fedb081e | |||
| cc934c3ac0 | |||
| c1d789d004 | |||
| 4d945b5d95 | |||
| 28c900e3f7 | |||
| b41ba50b53 | |||
| 2d22c18758 | |||
| 8ce05b3284 | |||
| 6d18820b53 | |||
| 58ed329ac2 | |||
| 2e0858bc0c | |||
| 7c9636c58c | |||
| 9dbd1326da | |||
| 4c82d12c1a | |||
| 972685bc15 | |||
| 00f8b97ee4 | |||
| 0b7bbbbdbd | |||
| 47bc3e896c | |||
| 904249b2dc | |||
| 3700047d2c | |||
| d44e851648 | |||
| 1be75735be | |||
| 7da72240a3 | |||
| 9357c951f1 | |||
| 1afeb9f977 | |||
| 000e55725c | |||
| 38e342b27b | |||
| 3e9064e2e2 | |||
| 2d764e73fd | |||
| f8efcf420a | |||
| cf546a2341 | |||
| 87a4f3526b | |||
| 6b49119af7 | |||
| 4c6314331d | |||
| 55ab067a0c | |||
| 3fc18b1cf7 | |||
| f2f8419da1 | |||
| 365c2f9e34 | |||
| 01fde3db27 | |||
| d743ed9645 | |||
| dd67811638 | |||
| ebe4f6a365 | |||
| b4e816b784 | |||
| 2798fa7ba9 | |||
| ee077a06e6 | |||
| 8f73e9bde0 | |||
| 45d8fca125 | |||
| 2bc6c1e754 | |||
| 39a0feae3b | |||
| ad7da779c7 | |||
| 23cafa84f2 | |||
| a20e5aee3b | |||
| fa3c50df8e | |||
| 81eb9326eb | |||
| 7c71d56383 | |||
| 5109a2d7c1 | |||
| 82cc799afe | |||
| 88bb28e3f1 | |||
| f4fdc233c0 | |||
| 7130e48089 | |||
| ed094f89e8 | |||
| 58f81b193b | |||
| 50122d4ee1 | |||
| f66388c1d3 | |||
| 838190ce80 | |||
| 1bc04db9cd | |||
| 30a68cf170 | |||
| ec8c207631 | |||
| 9337080307 | |||
| 8200164797 | |||
| 7d85d40f68 | |||
| 5d23135b0d | |||
| be6f1587ed | |||
| c184ddd996 | |||
| c903bbcb13 | |||
| 9b008ded21 | |||
| 6f79de6cae | |||
| 711b54c98e | |||
| 6876718d72 | |||
| 4ffb9f69c6 | |||
| b8a6548686 | |||
| 8c010277c9 | |||
| f30e3db1ef | |||
| d675ab1578 | |||
| b6cbde48be | |||
| 1fef79ce80 | |||
| 4f03ae75c5 | |||
| 34850fb73d | |||
| ee05f7f80e | |||
| 83614359aa | |||
| 17a2865070 | |||
| e3866fda45 | |||
| 81ed325830 | |||
| 36e78b9315 | |||
| 6716482ae4 | |||
| 7e758ce7ad | |||
| 63fe996ebc | |||
| 038365e639 | |||
| c3aebfa239 | |||
| e6370ebb2a | |||
| 1e25e368d2 | |||
| 645350a1a2 | |||
| dd927e6761 | |||
| 713b2e2cf5 | |||
| 7a02e57dcf | |||
| 724949b8fc | |||
| 1f5295db9c | |||
| 72ef865c10 | |||
| be0ebe833c | |||
| 57b08fb064 | |||
| 7162ab5399 | |||
| 4eb44837f3 | |||
| 194a635800 | |||
| e4314004a8 | |||
| 74534b74c2 | |||
| 59eb020eb1 | |||
| 1d1a815ef7 | |||
| 4088abaafb | |||
| 9333f3778f | |||
| 070a133cd5 | |||
| 74f4f99280 | |||
| 66848156a8 | |||
| 74dfd64e29 | |||
| ef0b81cd2d | |||
| 09842fe531 | |||
| 3c93699f8f | |||
| a9dd0d0dfb | |||
| 013e6925dc | |||
| 591ccfd25f | |||
| b0bdaf6b65 | |||
| f77e6370cf | |||
| ce70efa31d | |||
| 3a7fe01950 | |||
| 3f39352d95 | |||
| d38c02f847 | |||
| 2dddd76320 | |||
| 391e6a867f | |||
| 1df8b5f5c1 | |||
| 6913c8e7e5 | |||
| aab03a2b9f | |||
| a83c6c8a0c | |||
| b5cdd60367 | |||
| 5453ff5678 | |||
| 7b69fb2f79 | |||
| 19ac5d3038 | |||
| 4b64862cf2 | |||
| f643f0be85 | |||
| 0e0b1792e4 | |||
| f81c31510b | |||
| 5c3bd1faf9 | |||
| 90cf98465b | |||
| 1dd47484d4 | |||
| bd4a85c6a7 | |||
| b6520e2db6 | |||
| 0ea114b219 | |||
| e36f54eda5 | |||
| d983404656 | |||
| 677b50d39c | |||
| e5ae504bae | |||
| ce302aae60 | |||
| b0869fccfc | |||
| 17ab12f7bf | |||
| 816f9ce8a0 | |||
| 5fb41eb32f | |||
| c687e20fff | |||
| c5aa691467 | |||
| a3d7c694ef | |||
| 2c8b51c9d6 | |||
| a518a34055 | |||
| 4d3ca7e82e | |||
| 98c756a6d2 | |||
| 84d5c6c4b0 | |||
| 935458caa4 | |||
| dcec97411e | |||
| 91032483c8 | |||
| 9e40708f7c | |||
| 54902a5a00 | |||
| 927a9b9f38 | |||
| bfdb3a9da7 | |||
| 63269ac35a | |||
| 113deb6b75 | |||
| c48f4a51a6 | |||
| 3cd2f709fc | |||
| d2df4af67d | |||
| 67177aed42 | |||
| 5879ca2fb6 | |||
| 77a7f13507 | |||
| 2a794e2ae3 | |||
| 090f659dca | |||
| ca79fabdc7 | |||
| 693f232f01 | |||
| 8c33914cbb | |||
| a8e594e54c | |||
| 17f7d90dbf | |||
| 7ad3d5d317 | |||
| 3d37b0d397 | |||
| e8fc7c4c89 | |||
| 405fd802d5 | |||
| 5d1e9a1701 | |||
| d09b85ddc4 | |||
| a4aa0eb7c8 | |||
| d105325dd7 | |||
| 1fb9e57c62 | |||
| 576d9d6d9d | |||
| b7f3d1674d | |||
| f7b009a9be | |||
| 2e472700cc | |||
| edbe6fc72e | |||
| 1b728948f4 | |||
| 7434c28820 | |||
| 751027b4ad | |||
| 317890c9f9 | |||
| 65f433438a | |||
| 7167f6a9b7 | |||
| cb47c0fc92 | |||
| 37222c32a4 | |||
| dafb700be2 | |||
| 9d4fbfc3ea | |||
| e96578c857 | |||
| d2ce28f897 | |||
| 7b3e661110 | |||
| 2c6f28e422 | |||
| 1febac7bf9 | |||
| 59b0bca88b | |||
| 9f522beac4 | |||
| 4712383523 | |||
| b8487c90de | |||
| f3bc8cb9a4 | |||
| c0c6a90f65 | |||
| ffd4151029 | |||
| e3b8e91a0a | |||
| 629e09c464 | |||
| 8f36f0e405 | |||
| 7467213bad | |||
| 5b2530ba79 | |||
| d0a7d748c9 | |||
| 790073d4db | |||
| bb9cd3e8f5 | |||
| 83532f84cd | |||
| cfd6d47dfb | |||
| 831cbc0122 | |||
| d0edbacf37 | |||
| 5fcba6e193 | |||
| e5e378b1b0 | |||
| 319b3006f3 | |||
| e14c2e0916 | |||
| 026213fcd5 | |||
| 1116bbb167 | |||
| 99704109eb | |||
| f707035af5 | |||
| 8d6ab5c123 | |||
| 40a391d778 | |||
| 9fe49846c5 | |||
| 88c4c11b56 | |||
| e4b5f98d58 | |||
| 405391033d | |||
| 13fd1f04c0 | |||
| 8d42380abb | |||
| 9e1afe8cb0 | |||
| 90381e369d | |||
| 8fa2c21a47 | |||
| c08b57ad9b | |||
| e31f71f874 | |||
| 206563f433 | |||
| a191543ee3 | |||
| d74af019f8 | |||
| 7ea0c7cb5c | |||
| 38918e157e | |||
| 99d33cbc74 | |||
| a02b0f5d00 | |||
| bd42cbed33 | |||
| 546a680bec | |||
| 7cc411d384 | |||
| 6908509d79 | |||
| b1f44d7101 | |||
| e8e2ff4a94 | |||
| 9d7af18f7b | |||
| 937662eac4 | |||
| 2a277e930c | |||
| c9cc39c139 | |||
| 3623f66927 | |||
| dc58dd4d6f | |||
| 0d5196e8c9 | |||
| 11b18ca760 | |||
| b1fa194a1d | |||
| 3dfe0afd6f | |||
| e82ca116f7 | |||
| 9db563c7c1 | |||
| a9ad37cab9 | |||
| 2d5a5eccd6 | |||
| a5647ed7bc | |||
| 7b1edb58a4 | |||
| ed90015503 | |||
| 6ef4134b2d | |||
| 282a3d00b1 | |||
| 36395862d1 | |||
| 1560fa8bd9 | |||
| 79abc49a6c | |||
| 6c86cada2c | |||
| 3e0135071e | |||
| cdc0147dcb | |||
| 73cd69c63b | |||
| 7e147c71c1 | |||
| c4140f305c | |||
| 07b4be8f45 | |||
| fd9f3ad8be | |||
| b83f95ed1a | |||
| b77d470684 | |||
| ec81b078fe | |||
| 2416dde7bb | |||
| 0af5794cfa | |||
| 1e917da05e | |||
| c82068115f | |||
| 41f14b93df | |||
| df7455e24b | |||
| a5316ef6e3 | |||
| e6391f04c4 | |||
| 571b498a82 | |||
| efc11be7ee | |||
| 19ef43cd7f | |||
| 1861c5e264 | |||
| e040ab9897 | |||
| f2b59df0f6 | |||
| 824059d033 | |||
| 500ca6554d | |||
| b3b35eca5b | |||
| 39118453da | |||
| 9e64801384 | |||
| 6497407788 | |||
| 5a3d2244d8 | |||
| 8115a78df7 | |||
| f597e6412b | |||
| 3df0b12ccb | |||
| f99fc83993 | |||
| bf511767ce | |||
| 9682bf116d | |||
| 6086112cf9 | |||
| 6dacd5a914 | |||
| 2094e87da5 | |||
| 20125474c1 | |||
| 18f327612f | |||
| 6689919a39 | |||
| c7133bb5a0 | |||
| a40dc4c4d2 | |||
| 9840cc7dfc | |||
| 8cd55856e9 | |||
| f4bbaf682c | |||
| db7dd83168 | |||
| 4d71fb31db | |||
| 101293124a | |||
| effcb1610b | |||
| 97b37a5024 | |||
| c79d78664b | |||
| 9c972b0c42 | |||
| 35765394dc | |||
| 219c4e913c | |||
| d3ca801e53 | |||
| 1c2257190a | |||
| f509a7d22b | |||
| 44829cd579 | |||
| 94e749d08e | |||
| 726a03d433 | |||
| d6ef1c011b | |||
| f295f3b888 | |||
| f55e5f862b | |||
| 3c5d9c617a | |||
| 10413bbede | |||
| 91dfb0309e | |||
| 6707f68923 | |||
| 21b80be29a | |||
| c4b19de8eb | |||
| 5351514180 | |||
| 37ec428efc | |||
| 1941d3eb7e | |||
| e3df420f8e | |||
| 87c8b4b153 | |||
| 4149361de8 | |||
| 2fbd68ecb3 | |||
| cedac96cf4 | |||
| 89433127c4 | |||
| c23f1e974a | |||
| 9a83325119 | |||
| a596001338 | |||
| 1127ea412e | |||
| e85242e08d | |||
| 7ea2eb6259 | |||
| 2cd66cbc65 | |||
| 06064b6da2 | |||
| 809cb69b4f | |||
| 6f8e439154 | |||
| 4c81e57134 | |||
| ddd2d19c0c | |||
| eeb9ee8aa2 | |||
| 30b660da17 | |||
| 4cd881d746 | |||
| ea731eae37 | |||
| 5d77b8bf21 | |||
| 621639ad0b | |||
| fdc95bbf23 | |||
| b182d98da0 | |||
| e49a15bf07 | |||
| 3cdb2b549b | |||
| 69276bffcc | |||
| b0afbb692f | |||
| 0ab85725e0 | |||
| e8e025fdb0 | |||
| 7d29fed9a5 | |||
| 78ef42755b | |||
| 2a9429d183 | |||
| 4773ba469f | |||
| 6d1b379f53 | |||
| 54cbc46929 | |||
| 1fd4dbb1a9 | |||
| ecd871fe34 | |||
| 5c4b2ebd90 | |||
| 3fe75fac59 | |||
| 43a7434ae5 | |||
| 134a9c2472 | |||
| 0f495a6fd9 | |||
| 5d037327d4 | |||
| ebbe2635b7 | |||
| cab9615fa8 | |||
| 9b6d45bba3 | |||
| 7ddb29ca74 | |||
| 87e1c4f96d | |||
| 22e625baad | |||
| b37f573226 | |||
| 296264d8b4 | |||
| 2ba86d8cb3 | |||
| 8e5a52879a | |||
| e4d03b8c70 | |||
| 831cd81320 | |||
| b2d8c76fc1 | |||
| 3392879940 | |||
| d767b62d01 | |||
| 2ea687099a | |||
| 81c4b61322 | |||
| 0610c2c79a | |||
| e50d9c0edf | |||
| 72dc022dc9 | |||
| 123d5c1be8 | |||
| 9be2755d91 | |||
| 4305935fd4 | |||
| 3dff1fdac7 | |||
| 0281a5bb22 | |||
| cc0552d1a2 | |||
| f4ee34dcc9 | |||
| 9791509ec1 | |||
| bb71cd35f8 | |||
| d93b63d85c | |||
| 2706a3d81c | |||
| 73b0090840 | |||
| 2b3242f863 | |||
| 9f9a561c82 | |||
| ba10ec68b6 | |||
| 0b5820bdd6 | |||
| bfbe0046ab | |||
| 71ba0328bd | |||
| df80aa00c2 | |||
| 3c181fc474 | |||
| e62a8e8ba7 | |||
| eb69444cbf | |||
| f083b6f45a | |||
| 13de131fe4 | |||
| 4c6c9fdb20 | |||
| 9cb4d5da1f | |||
| ce22ea22b4 | |||
| aa661ced46 | |||
| 1e56c9ba14 | |||
| e65b9d825b | |||
| 2561e53696 | |||
| 2665c2318f | |||
| 5a0f154876 | |||
| 15d89d638c | |||
| 087c9f0202 | |||
| 0ae00dddf8 | |||
| f865bdf785 | |||
| 04897885dd | |||
| 2248c84b8f | |||
| 5f0f5de111 | |||
| b93036c81d | |||
| 6bfc4f7986 | |||
| 34de0aa01a | |||
| b8ca14c921 | |||
| 5ec77c6dae | |||
| f482b895fb | |||
| 73f2e99d7d | |||
| 49b821b04d | |||
| 17bfe1544f | |||
| 7a7b4c047e | |||
| 7912b79d7e | |||
| 83d8834fe4 | |||
| bf9fc6dd98 | |||
| 6edc28b4ba | |||
| e0deb3b665 | |||
| 8f3060f99c | |||
| 9e7a52b952 | |||
| 3b8e64fe64 | |||
| 479c070896 | |||
| 9f75be0dc4 | |||
| d090175b2a | |||
| 93d6788605 | |||
| 5de9f6c4a4 | |||
| 9785720bf6 | |||
| 626f4c5784 | |||
| c1e15d0212 | |||
| a19fff0998 | |||
| 9a502461df | |||
| bc484879a5 | |||
| b070f56838 | |||
| dd874427b8 | |||
| 902a69323a | |||
| a6c39e83b1 | |||
| 6511ae173d | |||
| 3d4d6ba313 | |||
| ce1ff9ea14 | |||
| 38cf9536e1 | |||
| 2683194f64 | |||
| 010d6691b9 | |||
| 3c6e21d945 | |||
| dcde1073b0 | |||
| fd55a40d26 | |||
| a2350c6d92 | |||
| 35e5faa8ad | |||
| 77e9130c37 | |||
| 9cc0b8b608 | |||
| 96953c7987 | |||
| 5b277378c6 | |||
| 2714017fe8 | |||
| b747b03ac0 | |||
| 3ed37c1e79 | |||
| b9b2cb46eb | |||
| 832c891e3e | |||
| 86a8e6a128 | |||
| 30c28645da | |||
| 01c0607aa8 | |||
| 7a14c3592a | |||
| e9b28898d0 | |||
| 001585a194 | |||
| b22dca6be7 | |||
| e46523b08e | |||
| a3f8e92c39 | |||
| 4cdd359405 | |||
| 82aa8cc383 | |||
| 85cb8b3dbd | |||
| 0a5c3f42c5 | |||
| 8267ac2fc2 | |||
| 6bbb416f83 | |||
| 1478b8c9da | |||
| 3dddf353e4 | |||
| ecb1955750 | |||
| c00c9e7e79 | |||
| e9084e4d59 | |||
| 016eafefab | |||
| 7cdc42387b | |||
| f09e1338f6 | |||
| 458e41744b | |||
| f276b8a9eb | |||
| 57d50f05cd | |||
| dd5889c6fc | |||
| a4c400b62a | |||
| e7e6c9b75e | |||
| b54c5c2d2e | |||
| b3d61289e8 | |||
| e0295d08da | |||
| cf7984a3c5 | |||
| 41390af8a4 | |||
| 5385a01b2e | |||
| 54447a45a0 | |||
| b593d871a6 | |||
| d18c6c9985 | |||
| 64e84f1af9 | |||
| 61923a9bec | |||
| c8e0b85e7e | |||
| 2170d2a129 | |||
| 7f4f7cee8b | |||
| f2c9aa9494 | |||
| 79b461eda8 | |||
| becbb8cbb9 | |||
| ac98f6adaf | |||
| fe68ef4cd1 | |||
| 0342ca9172 | |||
| d030561bf3 | |||
| d21fcbf260 | |||
| 19818b6c07 | |||
| 6b7cc60751 | |||
| 00d3d3e20b | |||
| 4a099a7161 | |||
| df30dd9bb9 | |||
| e44e87221f | |||
| d4959dfeb0 | |||
| ffe70d1eaa | |||
| f40182d7f9 | |||
| 5d83772e13 | |||
| c721a16d65 | |||
| a257f6f784 | |||
| 0b6bcb656a | |||
| abfbc75fed | |||
| 8f7f308ead | |||
| fbb90ff5d5 | |||
| 9b31bfd3ec | |||
| b98a9e0228 | |||
| 08f72ae0f7 | |||
| 40b9b7f48c | |||
| 7b6557852b | |||
| 115f7884d3 | |||
| 9f9186b7a2 | |||
| 0949049ad6 | |||
| 7ff2e78155 | |||
| 7ce3eb4460 | |||
| bc6de2c70d | |||
| 1fe835e099 | |||
| 8418bfa4af | |||
| 3b441a7765 | |||
| 0ea3daa4c4 | |||
| 207fc721fa | |||
| 960527887d | |||
| addf396145 | |||
| 7b26f6d7c6 | |||
| dad8f29cac | |||
| 2ed9570b9d | |||
| 0b13b15a98 | |||
| 14de1bb3f8 | |||
| b2058761f0 | |||
| 756df02043 | |||
| 44f4ed09fb | |||
| 83378dd84b | |||
| fdb756735c | |||
| d45daae44f | |||
| 634c327ac6 | |||
| a5dea34415 | |||
| 6d384759ae | |||
| d641147ef0 | |||
| 266c3ced04 | |||
| f54936d5d2 | |||
| 03851b8014 | |||
| a4577a9c5a | |||
| a5a9678fc5 | |||
| f8798ee298 | |||
| 0a0d6a18b6 | |||
| 148483819d | |||
| 0191b37d12 | |||
| b54bb5a169 | |||
| 72dc69086c | |||
| a02cdca62c | |||
| ba5fe50a66 | |||
| 2774c781f1 | |||
| ee021008a5 | |||
| 2b82b2ef78 | |||
| 82dbba2b69 | |||
| 326a694d1d | |||
| 4acef445a3 | |||
| 2c3866b6ef | |||
| b10709f68b | |||
| f0ae596dc4 | |||
| fc54178c8e | |||
| f94b4c743d | |||
| 950f651af9 | |||
| 687ddd8f4d | |||
| 259eafca69 | |||
| a752135b10 | |||
| 7414164b05 | |||
| b05241adf6 | |||
| 5db234e346 | |||
| 2680562170 | |||
| 114179f648 | |||
| 4c1346c820 | |||
| 4bbb715fbe | |||
| c601b1db37 | |||
| ae04c4f5cc | |||
| 3849d3c00f | |||
| 3c92608e7f | |||
| f2515b6b9f | |||
| 7a4af9de15 | |||
| 85f5584793 | |||
| 0963458d29 | |||
| e169bc7ed2 | |||
| ec7fc8ebf3 | |||
| 8c43ec47af | |||
| 483e36e646 | |||
| 9919ad026b | |||
| 2505eb958d | |||
| 576b5d5cdf | |||
| 9947c9090d | |||
| dee4a10436 | |||
| 023b3ac17c | |||
| 4497e5e68d | |||
| c32f162162 | |||
| 340aaba419 | |||
| ce0f6c33be | |||
| cdfeebf494 | |||
| 25effb4652 | |||
| e8ce7c9350 | |||
| 9047238878 | |||
| 8b641c1309 | |||
| 93c18d1b66 | |||
| e1f2661838 | |||
| 4070ec52e7 | |||
| ad3ca12a66 | |||
| 4679eefc3c | |||
| 441d56346e | |||
| 1c99c3d5af | |||
| 5ca79216f1 | |||
| b0c22d6160 | |||
| 305676bb52 | |||
| bb9e05faed | |||
| 28f88a180e | |||
| b67005b0a2 | |||
| 3cb695ed35 | |||
| 4797df176c | |||
| 7cd7d0917e | |||
| 31230aec00 | |||
| 14dec6f432 | |||
| 415f1d3dca | |||
| b6cc01153c | |||
| 7f7d92b9af | |||
| b736517986 | |||
| fdde364307 | |||
| 5620a76679 | |||
| d5465dd264 | |||
| 148e3e3180 | |||
| ffbae2592b | |||
| 97d8886dfa | |||
| 84305a5a05 | |||
| 2be373900c | |||
| 614ba85ad9 | |||
| 76fb45fc9c | |||
| 8bfc902647 | |||
| b547dbb2f8 | |||
| cf2f3f17f5 | |||
| db311eb78c | |||
| 170cbddb13 | |||
| 331fb9d588 | |||
| 5ac583c598 | |||
| fa0dd2ba08 | |||
| fc876f0506 | |||
| 0c3b28546a | |||
| 3f2fb96caa | |||
| e370b32203 | |||
| d82dc54d05 | |||
| 08ad87b7ed | |||
| eb2fd118b7 | |||
| 02396dc03d | |||
| ea4f41100d | |||
| ecb9129f94 | |||
| db75471f21 | |||
| a6c01f990b | |||
| 59d121e5d4 | |||
| 2fd1f575ba | |||
| 09d49126a4 | |||
| c7c58b1a1d | |||
| 8f9391a8df | |||
| 5463a93f48 | |||
| 3e7773eea2 | |||
| 85427915c4 | |||
| 3ba532cb19 | |||
| f4681eff0c | |||
| 4c201da3b6 | |||
| 91aa1d0690 | |||
| 98bb7acdc8 | |||
| 74e6ee6d1f | |||
| a46b78bd97 | |||
| 3126586615 | |||
| cd6bad23fd | |||
| ede7b02706 | |||
| 136cd666f7 | |||
| 375147e4eb | |||
| 48a62406f8 | |||
| d7fe3c77ff | |||
| b0e0403904 | |||
| 8334641a8e | |||
| 781133fc86 | |||
| daf80cad83 | |||
| 4164481d0a | |||
| 2b367b6814 | |||
| 2a6e69f902 | |||
| b01a936b4d | |||
| 1c54a30f01 | |||
| 90d63738e8 | |||
| e4f550085a | |||
| 6261fbf317 | |||
| c6aff45638 | |||
| 857aca7e39 | |||
| fbe6021fbd | |||
| 5f65fc57a3 | |||
| e91390690c | |||
| dc2ac966a3 | |||
| 847baa09ef | |||
| 2a777003b9 | |||
| 73faca60d7 | |||
| a178d6b326 | |||
| b3a6556e0b | |||
| 84eb29cd96 | |||
| 43a3b3ee46 | |||
| 7505701e64 | |||
| 273098f9e1 | |||
| a1c90fccf9 | |||
| f349330f7d | |||
| 90fbd9cf62 | |||
| a85ad617fc | |||
| 89f42eab8b | |||
| 788193f89c | |||
| 49a4d5ecb1 | |||
| 1a7ff9239d | |||
| ca9d1e47ff | |||
| dffb5a7a79 | |||
| b9ee91b08d | |||
| aaa313be76 | |||
| b2dc625205 | |||
| 23ebe7e2e4 | |||
| d4ea6e0d8f | |||
| c2db918e91 | |||
| df971b0e77 | |||
| dc2fcb2618 | |||
| 0180e3b90d | |||
| 9dcaccc87f | |||
| e14734c8af | |||
| fbb1b65fd6 | |||
| d6a150738c | |||
| 1491d3b236 | |||
| 8ec706ad08 | |||
| c0c824c0f4 | |||
| 8cba5f9c02 | |||
| d32b869582 | |||
| 07a5333a08 | |||
| 6e5f064c31 | |||
| c2031934e0 | |||
| 34e1a0ce86 | |||
| 8c21462f74 | |||
| 4c44000bce | |||
| c987f04388 | |||
| f235ce038f | |||
| 128956dbab | |||
| 7aec5762a9 | |||
| 6c17fee19b | |||
| 0a53e2e6b3 | |||
| ef15ccf321 | |||
| 96ddda7bef | |||
| 5bfe5d9cf6 | |||
| 4f0e4feadd | |||
| 92e7182740 | |||
| 4048d65724 | |||
| 5c880e47cd | |||
| 836cc95570 | |||
| e4346e70cd | |||
| 487cd04030 | |||
| 3b85414f2e | |||
| 9805a8cf60 | |||
| 9bbe3236ab | |||
| bfbee05b25 | |||
| 74a8e612bc | |||
| 07e6df9ea5 | |||
| 40783acc36 | |||
| fec39c4222 | |||
| d6977a130b | |||
| b4d99acea9 | |||
| 96f3c909bc | |||
| c72d84e27f | |||
| 6b3c4c8cfe | |||
| c9500063aa | |||
| b376192b61 | |||
| 7b1f11398d | |||
| 2fbd4ff13a | |||
| 55ed62e6ac | |||
| 6bcf5aa651 | |||
| 970cebb9bd | |||
| 4f5c145ac7 | |||
| 5503a9cd3c | |||
| d047133e64 | |||
| a86ff47e24 | |||
| 38815c5662 | |||
| d92322bd0c | |||
| 8f10bed8c1 | |||
| cd42a7749e | |||
| 7bd45379b9 | |||
| 6406c7352b | |||
| 276e86eac1 | |||
| d7307ae79f | |||
| 46c0df8447 | |||
| 30c4833c23 | |||
| c13d71c620 | |||
| 216ecc636a | |||
| 0e84a27521 | |||
| 4932ed8099 | |||
| 5a7a52c76d | |||
| f0f37d5c5d | |||
| a98dfabc4b | |||
| 55b0a0a5e0 | |||
| b1dbf06861 | |||
| 0d7fa422b0 | |||
| 2c2278a9ed | |||
| 6225609f0e | |||
| 623dbf176c | |||
| 32d57fbc3d | |||
| 10545a1e6a | |||
| 324fe4e341 | |||
| efeb02b6c6 | |||
| ae5468330a | |||
| f0c2f1f3df | |||
| 5bd09f9cf2 | |||
| cc38920432 | |||
| df73c969c6 | |||
| a877fefade | |||
| 9860bb1a46 | |||
| 1f87ce75bf | |||
| 9716fb04d2 | |||
| 22697f9491 | |||
| 1a4114dbfe | |||
| e5a46e2fa8 | |||
| e78beed266 | |||
| 61224e7207 | |||
| a7d58e9a86 | |||
| 0145bcfd6c | |||
| 750cde82d1 | |||
| fb20b21151 | |||
| cd04dfaa5e | |||
| 8033451e0a | |||
| 98920569ab | |||
| 72a36b065e | |||
| 8bd0657b7e | |||
| 0e2647fa13 | |||
| 533000ddcd | |||
| 220e9f3e97 | |||
| cfd4aa73a0 | |||
| ba1116b000 | |||
| 3a2e9e7c2e | |||
| 071890d900 | |||
| 7de60763e5 | |||
| 8b2769a734 | |||
| c3859dc308 | |||
| 9a086312c7 | |||
| 41571d4a74 | |||
| 6b4dba947a | |||
| 3c07e0a227 | |||
| 57193fddfe | |||
| 4e285ed502 | |||
| 0714138fcd | |||
| 7e6b2acc57 | |||
| fdb9871a25 | |||
| 48b183e6c2 | |||
| a1fab7de0f | |||
| 216184e6f9 | |||
| c5a526f3b3 | |||
| 77bafb5364 | |||
| 5316931fa1 | |||
| 61addd3d4e | |||
| b9ee1d5dee | |||
| 97bbdd3be1 | |||
| b9b4e441e7 | |||
| 809a3cfd60 | |||
| 50774a9018 | |||
| f3f9f46742 | |||
| f178748090 | |||
| 7119d069da | |||
| 15dd4ba2f2 | |||
| 6ae7da4b1a | |||
| c53fbd9e94 | |||
| 934961e999 | |||
| 2810323cc7 | |||
| be3c674fe5 | |||
| 1466f96e51 | |||
| 6868b69aad | |||
| 740e5fd703 | |||
| 5ec1860921 | |||
| bba3d8f08c | |||
| 1f3e67f912 | |||
| fe719686d9 | |||
| 7027d809c1 | |||
| 0fc8a5e2f2 | |||
| 8787dd05cd | |||
| 667453d48c | |||
| 1485713f84 | |||
| cb0b6f1c18 | |||
| 573858552c | |||
| c1d57f0b0c | |||
| 644f975322 | |||
| 8799e370f2 | |||
| ee9aa5bed5 | |||
| 1fb115d3b1 | |||
| 9f487a86da | |||
| bee347b291 | |||
| 0440bc6f34 | |||
| 219e0ef5d5 | |||
| 1a43b6d353 | |||
| 3b4053d850 | |||
| 48328a7f8a | |||
| 72d0f2e6f6 | |||
| 363bc745ce | |||
| 16c05c21b6 | |||
| e30cd90140 | |||
| ad0e497d17 | |||
| 950786c01d | |||
| 044ceb37ac | |||
| 44cd11c606 | |||
| ab23afa5fd | |||
| 0e4ff42d79 | |||
| 1e0c549444 | |||
| aba29cb355 | |||
| 1c4eac406d | |||
| a3b47625f5 | |||
| c70da8878a | |||
| aa733fa060 | |||
| 624bdf4a93 | |||
| 7b835b37b3 | |||
| 38627890fa | |||
| b092607553 | |||
| d2c42c780f | |||
| 88e7ad4b8c | |||
| 1a6906bbb3 | |||
| 168ec19ef4 | |||
| 6b1afde47e | |||
| 3cd070ee38 | |||
| e2cfaf6742 | |||
| a2dbee7d98 | |||
| f783d12cb2 | |||
| 926ad88b73 | |||
| 8baa2b3887 | |||
| 3a7f122323 | |||
| 7ca42a8472 | |||
| 314a9d468d | |||
| c03708a4dc | |||
| bdf4e6d0d1 | |||
| 802c7fdb4c | |||
| 7fc1372f8f | |||
| 09295d377d | |||
| 91c84dbb65 | |||
| 09d9bcf59a | |||
| 0ffd0c8e0b | |||
| 667dd5fe9e | |||
| 1378ce75d3 | |||
| 08284a69e6 | |||
| 866e321b1a | |||
| cbc0d9a30a | |||
| 9bb4ddf975 | |||
| 24cbbad82b | |||
| 43bc81de4d | |||
| 93969c2ee1 | |||
| d4d19269ee | |||
| 30bc786e08 | |||
| 565aa29c48 | |||
| cee6523774 | |||
| 1a39317c2d | |||
| cc49e71f76 | |||
| 937481d761 | |||
| 2d62054e9a | |||
| a6548a05d8 | |||
| bff912aef6 | |||
| 833585002b | |||
| d4362e5e62 | |||
| b56bcff576 | |||
| db1336522e | |||
| 16c6a94d35 | |||
| bb75538070 | |||
| d612f5609f | |||
| 8781b522d8 | |||
| 3980f42b3d | |||
| 01391aa6aa | |||
| 55d8a0ac8c | |||
| fbbe7e9cc6 | |||
| eac17bda08 | |||
| 06beced480 | |||
| bd31c541f6 | |||
| fc4cf73c89 | |||
| 9285a3a9a1 | |||
| 812242f010 | |||
| 5bd376d3e1 | |||
| 9a1ba771c0 | |||
| 7949ba2a1d | |||
| 6bd816d5a4 | |||
| 07149f516f | |||
| ed4a46242b | |||
| 225ea5d63d | |||
| 5c4f704696 | |||
| c22ee587cd | |||
| 5c0b8fcb2d | |||
| 5d2aacb7d1 | |||
| 95fa0991e6 | |||
| dfead504f7 | |||
| 7600924d94 | |||
| 3d7ce1f5e7 | |||
| 496f3c3793 | |||
| f1ce1ed6b8 | |||
| 57d541efc1 | |||
| 147b6af9cf | |||
| e3955159a2 | |||
| 5ad4543d91 | |||
| f29952616f | |||
| 528f1a4267 | |||
| 31196c626b | |||
| c1cd268c00 | |||
| 699707fba4 | |||
| faa6cd7a3c | |||
| 867be03f96 | |||
| 00a5819f3a | |||
| 2ff45dd73c | |||
| 7bb54201cb | |||
| 542ec36579 | |||
| 03a4221fe6 | |||
| 198bcebabf | |||
| 85a79b6819 | |||
| 2e25d2ad23 | |||
| b7351d2406 | |||
| d9c1bf767f | |||
| cfa25ab030 | |||
| 3815ab8c45 | |||
| 36409c37f4 | |||
| be5ed503be | |||
| a6ad130df7 | |||
| 5a06c42bca | |||
| 3d35273f4f | |||
| 27600ba37e | |||
| fc92ad3a86 | |||
| 65521d96d4 | |||
| b70586bd9f | |||
| a8c828f105 | |||
| 0e7b420b71 | |||
| 7f4d72c072 | |||
| 95e7f7915b | |||
| 3df9fcb67a | |||
| 352066c7d1 | |||
| c4eb1182df | |||
| 2eed4ea8e2 | |||
| c41c7469b8 | |||
| 17c0032451 | |||
| 1f6e5544b8 | |||
| 22dde8014c | |||
| d7205c0601 | |||
| 72aff8c738 | |||
| 58b6d19030 | |||
| f3678b2002 | |||
| 9341aff386 | |||
| 97796628af | |||
| f2ec3f215b | |||
| 22ddb96526 | |||
| c911098d84 | |||
| 146c421c84 | |||
| 5de6f4dc94 | |||
| a5085cf7e2 | |||
| 50a73a3af5 | |||
| c5ac19a054 | |||
| 7dd9e2d1e2 | |||
| 9ae7cb771c | |||
| 1dd761b390 | |||
| ae3327f5a1 | |||
| 0785930011 | |||
| 3a783658f9 | |||
| d42ac095aa | |||
| bfadb3664b | |||
| 4c3dd8a9b2 | |||
| c8712db5ba | |||
| 7645c644bc | |||
| 94404b42ce | |||
| 3d2a030868 | |||
| 37960e6a9d | |||
| 741b92721e | |||
| aaa94ca2f8 | |||
| c02dbae87a | |||
| c2119f0b22 | |||
| 061db5e904 | |||
| b805b147f3 | |||
| 3829604480 | |||
| 97dee28ae1 | |||
| c9b4b78abd | |||
| 9bb39a71ca | |||
| 1107e778b5 | |||
| 2a7a0f0a47 | |||
| e502f6df6b | |||
| b9bdb5c8fc | |||
| 1e4877eaf8 | |||
| 02e45c5eea | |||
| e312454aca | |||
| 05aaec3dc3 | |||
| 4e28a0211b | |||
| 4ccbc13f6a | |||
| f6d1b0c46f | |||
| f47cd81108 | |||
| 6823fbdc5a | |||
| 44a2e5231e | |||
| 02be92c561 | |||
| a8da67d0c3 | |||
| 55034273f6 | |||
| 6354b83a0d | |||
| e1372cf695 | |||
| cd9facb147 | |||
| 7f7c722429 | |||
| e11821b342 | |||
| 4850541002 | |||
| 5402dd7ad9 | |||
| 506bc9b6ae | |||
| 560cd8f619 | |||
| 9ba8dfae44 | |||
| b873036c42 | |||
| ec59baaf4a | |||
| 2daf4323ca | |||
| 38f8025221 | |||
| 5c8504add6 | |||
| 6011b971ad | |||
| 6ee5e4885f | |||
| 8c5fc3a01f | |||
| 52954b1be4 | |||
| 138b2deedc | |||
| 5a522fac4b | |||
| df954ae483 | |||
| b7cc3a5ef2 | |||
| e11c14e66b | |||
| 785c17ed2f | |||
| 01ee8c31fc | |||
| f2dba0a9ba | |||
| 9b7cca6bcb | |||
| b605dd94eb | |||
| 255ce4de98 | |||
| a068323df1 | |||
| 48d87cd3da | |||
| a3804b25e7 | |||
| 48161129e3 | |||
| 7ad04b8f32 | |||
| daa34d6d5b | |||
| e8565b49e0 | |||
| db419fd459 | |||
| 36e573d024 | |||
| cbabb15556 | |||
| 52c58b917c | |||
| 2cfd95a026 | |||
| ac1dbf81f4 | |||
| d442fa77e0 | |||
| 10f16583e0 | |||
| da23a6cf6c | |||
| 4eb279e157 | |||
| 5db4aa57b1 | |||
| cb2e3325cd | |||
| f6c8053d00 | |||
| aec13e3e97 | |||
| 1b34d178b0 | |||
| ed3bc66ea1 | |||
| c19dea8472 | |||
| cb7484cffa | |||
| 9135409e67 | |||
| 5aaa560cb4 | |||
| f08a3f6613 | |||
| af4f8e7f36 | |||
| 80c7dc53fc | |||
| 6c25307b48 | |||
| 5e875786cd | |||
| 471794a1dc | |||
| d1f45951fc | |||
| 7540768c1f | |||
| 3e6df4b67c | |||
| 19730d4527 | |||
| f3f7fc31b4 | |||
| bef65d304b | |||
| ff2eb36887 | |||
| de9e2a50bc | |||
| 5c4e921899 | |||
| 498272bfd2 | |||
| ea1e7bdc87 | |||
| 6a3a245ed8 | |||
| 5dab6ef38f | |||
| 358992c48f | |||
| 4f7a98be01 | |||
| ab7218e5cf | |||
| aaec5f8fb0 | |||
| 7ba16bccb4 | |||
| 53719f1807 | |||
| 33d0222e10 | |||
| 33a44322dc | |||
| 58b00334ff | |||
| 2a337543d6 | |||
| f3088920af | |||
| a84427e260 | |||
| 31183cb840 | |||
| ff7a4599e9 | |||
| fd92c3877b | |||
| 96aa54ac77 | |||
| 896ff1e386 | |||
| 77477c1687 | |||
| 563aa62fcd | |||
| 845e6e06ea | |||
| a4d6a6f5e3 | |||
| 721ffc75dd | |||
| 99fbb69cf5 | |||
| 5ee181dc09 | |||
| 578a94f744 | |||
| ad465aaf21 | |||
| 63c3ae5a7a | |||
| 692b13bba5 | |||
| 2443b27b72 | |||
| c7d14939a9 | |||
| 0ea06cba2a | |||
| 1b76c9a754 | |||
| a514b8e027 | |||
| 53269df1ba | |||
| 30111d9299 | |||
| 5f736554bb | |||
| a72df4ca16 | |||
| 4c2dabb287 | |||
| 5c3bb2ab06 | |||
| d22529f181 | |||
| 6af9abd9b7 | |||
| a4f378d726 | |||
| 68a45467c5 | |||
| 97cf0544a7 | |||
| 7fdc23b5bb | |||
| 9172eaff6d | |||
| e1df9df40f | |||
| 711112846c | |||
| b36393e155 | |||
| 4a8b8834a2 | |||
| 4864af2bfa | |||
| 03ab5adfc1 | |||
| d1d499a299 | |||
| 451463505d | |||
| b7ace8526b | |||
| b894d0f267 | |||
| 4dd72782c2 | |||
| fa1218417a | |||
| 6ebefe9e69 | |||
| 9f5ce8f0a6 | |||
| 514d3fdad2 | |||
| d33d2b7ae6 | |||
| b4ae7e232f | |||
| e1e15787c5 | |||
| ae3f207140 | |||
| 6ee3921bce | |||
| 8f47a2ebb5 | |||
| 5d40e1e5c9 | |||
| 1751a1a06c | |||
| f2af6bf854 | |||
| 6e2d3c3a63 | |||
| 319ec11fab | |||
| cbd4186f8c | |||
| 29e47006ae | |||
| e4416e6134 | |||
| 1b2db2e2b5 | |||
| e00f008460 | |||
| eec02abf23 | |||
| ad9b32beba | |||
| e2e537060c | |||
| 796b322edf | |||
| 79dbd89214 | |||
| 63bacf04f8 | |||
| 4c6cdd4ed5 | |||
| 38e6b2f4b6 | |||
| 4f7b19ac99 | |||
| 3f9bbbc393 | |||
| d2a99aadd5 | |||
| 09e1ac33b1 | |||
| ec260cbfa8 | |||
| 573e8600e3 | |||
| 144952f46d | |||
| a1277a7af0 | |||
| c65b26ec69 | |||
| 0075f20ae4 | |||
| 821a4b9289 | |||
| 8ae44231f0 | |||
| 42db8824ab | |||
| b7a4b75479 | |||
| 95acb16c96 | |||
| 0789bb83b1 | |||
| f86cf7f48a | |||
| 2335c13a90 | |||
| e2f0fc039f | |||
| 47bd738662 | |||
| d9c60a9586 | |||
| 30099dc5cd | |||
| 3fefcfda53 | |||
| 51b160a15c | |||
| 1d5a33b981 | |||
| fae5686258 | |||
| 38bbde82bf | |||
| 8f5169c9ec | |||
| 3c3a5851f5 | |||
| b8f97212cf | |||
| 3d5a05538a | |||
| a3344f399b | |||
| 7ec8392c81 | |||
| 5a67212b20 | |||
| 6b2ca5d8dd | |||
| 4e65718126 | |||
| 1bf95c9438 | |||
| a522dc149f | |||
| d988b7da64 | |||
| 8bffd10084 | |||
| c93ae32139 | |||
| 376ab58437 | |||
| 213a7d2526 | |||
| c4e685170d | |||
| 6bf5409707 | |||
| c3ba95a980 | |||
| c57213459f | |||
| 6c5150de8c | |||
| 9356a3bd41 | |||
| cad1850116 | |||
| 7a29fcf266 | |||
| 342aa93213 | |||
| a527a869c1 | |||
| ed1457f9f1 | |||
| efcdaa31d6 | |||
| 684b7529b6 | |||
| 31a5fc2e63 | |||
| 7379341559 | |||
| da81bda26d | |||
| 59aabb4ee5 | |||
| 1503b83dec | |||
| 026f756475 | |||
| 8059daccaf | |||
| 7d5b876e27 | |||
| 1875785cf8 | |||
| 91fa910f84 | |||
| 21b5b80491 | |||
| c8444b91bb | |||
| 3a26790b7f | |||
| e9cc42751f | |||
| 42727e6e19 | |||
| 71fb790248 | |||
| bb57755f5e | |||
| 6b4c5bb754 | |||
| 967770376f | |||
| 2839591917 | |||
| 02bb061b1d | |||
| 59aa647c3d | |||
| d48ffac93d | |||
| 28f5d1eec4 | |||
| f0cb7e2596 | |||
| e19ff2ce6b | |||
| 00b0ddef8b | |||
| b54f41c47f | |||
| ffff419bb1 | |||
| cbb8486c75 | |||
| 11566674fb | |||
| 2984a476a4 | |||
| f2f20520e3 | |||
| e61b411d7a | |||
| 34b2fdcd7e | |||
| 4abfa688f8 | |||
| 82ea14e014 | |||
| 0b881fea00 | |||
| a72396620d | |||
| 838bf165ba | |||
| 6d1ad5d121 | |||
| e24301cf13 | |||
| 54eb567770 | |||
| b5840ee906 | |||
| a1a82ad137 | |||
| e10305a4e6 | |||
| 719b519650 | |||
| abbb9aac08 | |||
| b3864e590b | |||
| 8d85ca9bcb | |||
| 6a6489a060 | |||
| 7584888869 | |||
| 9a5d757ba3 | |||
| 51d93b8bde | |||
| ffa06b0143 | |||
| 2fb2638321 | |||
| 9d731bafa6 | |||
| ef95b8e01d | |||
| db8071fc36 | |||
| 5e32b1f9ba | |||
| 4dc9024e0a | |||
| e0b0bbb517 | |||
| 22942b3615 | |||
| f9b9df3a83 | |||
| 09fc2af254 | |||
| 3286318bda | |||
| ffe1c3f737 | |||
| 1328893f5d | |||
| 95c8f460a3 | |||
| e66c44b3e9 | |||
| 0ab77f7e90 | |||
| d1b1044cac | |||
| 8ae3276747 | |||
| 78bdff492d | |||
| c5b0e79e99 | |||
| da292d3d4c | |||
| 2df098c7a6 | |||
| 1fd305b5b7 | |||
| b05c3e3476 | |||
| 95a39777f8 | |||
| 8c59a196c7 | |||
| 47b79b16ba | |||
| 76368f3e71 | |||
| dffc9a3cfe | |||
| 37314c42b9 | |||
| cdb81d7740 | |||
| 60b3d8f237 | |||
| 5dc592a145 | |||
| 9eaf00b557 | |||
| eedf8b6643 | |||
| 6a7e903185 | |||
| 95f7dbf102 | |||
| 30a457234e | |||
| a2aeaa3d69 | |||
| 0b20297306 | |||
| a37a9f7237 | |||
| e5cbba4ee2 | |||
| 32090b8bbe | |||
| be5e6f678a | |||
| 8dd27fc051 | |||
| d4b7ef433a | |||
| 31823c0c95 | |||
| e9035d3649 | |||
| 01912356bf | |||
| 42f28a7089 | |||
| 90dc5f5dd1 | |||
| 6a874b9c23 | |||
| 545b5bc3ce | |||
| ba6ebc82bc | |||
| c3d4989afa | |||
| f7822cd356 | |||
| 6ddafb76f1 | |||
| a341f29900 | |||
| 16155484f9 | |||
| 91223db338 | |||
| 6aecf8c7db | |||
| 2d7c275d82 | |||
| 8a31de751f | |||
| 4fc12f2f3e | |||
| e58e07502a | |||
| b18073fd23 | |||
| 7de67e7d09 | |||
| 8be144adc0 | |||
| fbe298bece | |||
| cf22b2328b | |||
| d69e8d9993 | |||
| 86f136c733 | |||
| bc9650fc0c | |||
| 49e587eb44 | |||
| 57e2428c29 | |||
| f7de9e510a | |||
| 054ff2dccf | |||
| ababec79f9 | |||
| 9ba6564c9a | |||
| e8084650b1 | |||
| 3bf7053a86 | |||
| bbc568690c | |||
| dcce1d067c | |||
| 031dad4687 | |||
| c0f1de4685 | |||
| 29b272ea47 | |||
| b2991ec73c | |||
| eaef0d4886 | |||
| eceedefa94 | |||
| 5a5da9da32 | |||
| cd23b9bc00 | |||
| 78cf31c937 | |||
| b3e0f46cc2 | |||
| b7ba3021a8 | |||
| 0d329b7118 | |||
| 3fe337e2ba | |||
| 14eb727a21 | |||
| 3c5ae3ea91 | |||
| 79565142b8 | |||
| 1b5aa2bbfa | |||
| 719c940be3 | |||
| b3c7cfd860 | |||
| 6aed5948d6 | |||
| 553ac3b9f5 | |||
| 77c822b772 | |||
| b973c5db1d | |||
| dd7298a35b | |||
| 26200e6080 | |||
| dccfbb61d7 | |||
| cdde00286a | |||
| 871899e451 | |||
| e3fb62b33e | |||
| 05e2c8bdf3 | |||
| d8c8e21e1f | |||
| 5036c64a7b | |||
| d2185d1e17 | |||
| 1019912432 | |||
| 787ca4200b | |||
| 349240e6eb | |||
| c26117971c | |||
| 50d8aeeddd | |||
| a5706d600a | |||
| a8c1b72850 | |||
| 54ddf73d44 | |||
| 180a8d4a46 | |||
| 161e0b1ec3 | |||
| bbc7302b89 | |||
| 533f540c04 | |||
| 78df41fd86 | |||
| a213a0613a | |||
| f85b671c2a | |||
| 308136aec0 | |||
| 5677c5175c | |||
| 7b8869f065 | |||
| 7f5d6ad7ad | |||
| 1476ef9126 | |||
| 25a94e637d | |||
| 1d1f4ed4fe | |||
| afa8a7991e | |||
| 4df95fb61e | |||
| a111b8a6f0 | |||
| 1d3d2dd4e3 | |||
| bc93768359 | |||
| b3cb503a0d | |||
| c55ee5f404 | |||
| 5051d3324b | |||
| 69f5119dbc | |||
| c94fcb88ed | |||
| 25ee57caf0 | |||
| 469ae3d90d | |||
| d5cfa845c2 | |||
| 071f71f84e | |||
| de073a25ea | |||
| f907abb730 | |||
| bb4bca8125 | |||
| bd419d14e3 | |||
| 28b763b44f | |||
| ded73341e8 | |||
| 0a70142067 | |||
| 0c9b45e738 | |||
| c3e0d1967b | |||
| 9af0639b76 | |||
| 4202492b1a | |||
| a082a9a53e | |||
| 9bd8e1a53d | |||
| e2c26ac295 | |||
| f1aeecaf9a | |||
| edd54cafea | |||
| 78ed248fda | |||
| 1b32ff2850 | |||
| 9c8c01af8d | |||
| f21ffb2796 | |||
| d4acb9a8d0 | |||
| c59b0afa39 | |||
| 3bc5d8f6ff | |||
| 7429fc6215 | |||
| 8105adb174 | |||
| c20b5d3413 | |||
| 73b59267fa | |||
| 34b7826638 | |||
| 93333b1735 | |||
| 50a38a97be | |||
| dedfac4041 | |||
| 19d9c585f8 | |||
| f30f1cef7f | |||
| 69ba969bd1 | |||
| a38d92f64b | |||
| abda129041 | |||
| c6ec0838c0 | |||
| 75c42afbbc | |||
| db7034b150 | |||
| 0071a04efa | |||
| 78f36a02b4 | |||
| 8bc28248e0 | |||
| 1c3ced7222 | |||
| d7afdfc77c | |||
| 347988c135 | |||
| 538db5e4af | |||
| 7289fbdd2a | |||
| d9f14997b8 | |||
| 39b7060393 | |||
| 2915f294aa | |||
| 0ae5d05519 | |||
| c10dd3640a | |||
| eb0cb8312a | |||
| 8a38c6a13b | |||
| 383475a6ed | |||
| e0582cd398 | |||
| 13e998ec2d | |||
| c913aa3374 | |||
| ef05cdd782 | |||
| 7738aa27bd | |||
| 278218e7a0 | |||
| 68c270760c | |||
| ae6d9f146b | |||
| ce8880e162 | |||
| cd97abca08 | |||
| fcdc6f68bd | |||
| 4f6b60bdd5 | |||
| e000eb586a | |||
| b389495e7b | |||
| cec0a9cd3b | |||
| e2dd42658d | |||
| d5da0ad828 | |||
| 9943bf9845 | |||
| 02268c54ff | |||
| 9f085e2c87 | |||
| cea4c89fe2 | |||
| 5603287204 | |||
| eeb5532ffa | |||
| 47b6c2b771 | |||
| b6982a310f | |||
| 4e6def3ba3 | |||
| 5e6cd0ee76 | |||
| 197708c967 | |||
| 0dbf9d8b81 | |||
| 7f6a137ce8 | |||
| 3b1ac9f5d8 | |||
| a2235f1bda | |||
| 43733d4e66 | |||
| 404c58d447 | |||
| 072f305cfe | |||
| 1d181ae300 | |||
| 55349d46da | |||
| 5b0835cecb | |||
| 708411c272 | |||
| 3f231585a9 | |||
| 4cc6b6f8aa | |||
| 21f2130d13 | |||
| b919773b56 | |||
| b506259d76 | |||
| 3788f5f562 | |||
| e45410c257 | |||
| 9cdd175250 | |||
| dc3ea6b555 | |||
| 51fe47ed8a | |||
| bb767ca863 | |||
| 0b83d9e0d7 | |||
| 74872b1322 | |||
| b7e079a0d9 | |||
| b133a990f1 | |||
| 11565e05e9 | |||
| ae54f4908a | |||
| 7853aebf3d | |||
| cd6acebaaa | |||
| 1c0278130c | |||
| e7c08e56b2 | |||
| 8c06e0d8ac | |||
| c482eef8d2 | |||
| d5b83e1b4e | |||
| eb52b7288c | |||
| 92436f47f7 | |||
| e0b8e55e73 | |||
| df462447e0 | |||
| e648cb7542 | |||
| 13a2fdfc00 | |||
| 898496a85d | |||
| 9bb64c07ae | |||
| 7435416422 | |||
| b90cff13b4 | |||
| 0a867bcc22 | |||
| b6b2569190 | |||
| 5b5aac9d16 | |||
| 8662a4ec68 | |||
| a18953f6a2 | |||
| 9dfffbf641 | |||
| 145c741307 | |||
| 8a0dc22578 | |||
| 55cea50824 | |||
| 88b7374c6c | |||
| cdce9b0da7 | |||
| c8f1758bc1 | |||
| b347b6f9c5 | |||
| adf08a59fb | |||
| bf7919bd8d | |||
| 858c9193cb | |||
| 5fb301b9e2 | |||
| e59ebed474 | |||
| aed219cbd1 | |||
| 672e5f8088 | |||
| 61bb02ceea | |||
| e5cfef711f | |||
| cac6314ce1 | |||
| 06e945be67 | |||
| 3215346a1b | |||
| f9e6819b37 | |||
| 35b2346ba8 | |||
| 83651486f4 | |||
| 55ff2e6b5e | |||
| 4506328144 | |||
| dcb52913a5 | |||
| 09e427d73e | |||
| 64fa9ed334 | |||
| 058a65cac6 | |||
| b734077605 | |||
| 6eb57c2f63 | |||
| 4d66fd8061 | |||
| 3ab86c90a6 | |||
| c2912eb5e1 | |||
| 56cb40dd38 | |||
| 89970776a6 | |||
| da41f43ff4 | |||
| f250d381e5 | |||
| c4bff418e3 | |||
| 3692ad0eb0 | |||
| 38fd271246 | |||
| 2d678b781e | |||
| c6b64a9305 | |||
| 88cba206ff | |||
| d6fefe71c0 | |||
| 8d9039532a | |||
| 1c482e7f6e | |||
| 0a30595bb1 | |||
| 8ce52f9d5e | |||
| 756c6b37cc | |||
| 8277e8bef1 | |||
| a12e615a30 | |||
| bec9f650ee | |||
| 423d1a4437 | |||
| 3c8fd3a51d | |||
| 572a9ed3ba | |||
| 93b895a4f5 | |||
| 961fbf291b | |||
| 4f225ae707 | |||
| c0b3c1c6e9 | |||
| baffeeb5b0 | |||
| 832ac1927b | |||
| fdd2e3f4d4 | |||
| 86c0678273 | |||
| 33091c295f | |||
| e0548cdfe8 | |||
| d57697460b | |||
| d465ee80a2 | |||
| 933f866e93 | |||
| 356980fac3 | |||
| 3f03abc0d1 | |||
| 32aa5e9bc4 | |||
| f2e252c986 | |||
| d14fc31f88 | |||
| 32bcb8b5d6 | |||
| 66610f8562 | |||
| f5b9ebfcc3 | |||
| cf9eaf11fb | |||
| a5330a7bfc | |||
| f7e741b4e2 | |||
| 5ece7d9934 | |||
| 31526f7fe2 | |||
| c5edba2188 | |||
| 7c3c7a1572 | |||
| c1f44e1748 | |||
| b5c46626f9 | |||
| 4d2f8d2918 | |||
| d7483c9dc3 | |||
| bfb5f5b993 | |||
| 94afb88f8b | |||
| 95d7951b17 | |||
| 82146f7b7d | |||
| 2e58969aa1 | |||
| 590a58a6e9 | |||
| d8c6e69b09 | |||
| 2e14e5d9c8 | |||
| 06115fdaed | |||
| 9992c1f79c | |||
| 0029f57413 | |||
| c823ca69ce | |||
| 0f3e6581bd | |||
| ca4c7b4dc1 | |||
| ca3127fdc1 | |||
| 91f8157f03 | |||
| 575ea504aa | |||
| dc37677cc6 | |||
| 56d167e45f | |||
| 2a8abd08da | |||
| 3ac1a03d96 | |||
| c98e718e16 | |||
| c289689105 | |||
| d4db0f1f95 | |||
| 5d46f46a87 | |||
| 0bbb3c6b4f | |||
| 525fee5acd | |||
| ed6fc15a13 | |||
| 08812f2546 | |||
| 6607dbd1b4 | |||
| d8f7bde324 | |||
| f3680fdc6a | |||
| 6f4cda74bc | |||
| eafc5b8359 | |||
| 7195ad3806 | |||
| 62f921404e | |||
| 6ea9b2c26a | |||
| eaefefa4f0 | |||
| 5b3449c55a | |||
| d7a67fc7a1 | |||
| c7eccdec0f | |||
| c63a29ef97 | |||
| 10a1250496 | |||
| 8b90b62333 | |||
| 7e43a88d3f | |||
| 059234a6e0 | |||
| bebb067ee3 | |||
| a4a6d3b0ce | |||
| da277536b7 | |||
| a47ac42996 | |||
| 7cf94ec204 | |||
| f3b9135a09 | |||
| 5337158911 | |||
| 82e74a72e6 | |||
| aab70cde9d | |||
| fdb0e00685 | |||
| 2f1056b05a | |||
| 3333d68fd8 | |||
| 7ebd371ab6 | |||
| 0f373353c7 | |||
| 903cb8bd83 | |||
| ccfa25d58e | |||
| 47259fb40a | |||
| 92a5429ce0 | |||
| 1a61ff64bd | |||
| 3f14d6a066 | |||
| 0602a550d7 | |||
| e9ce69c6a4 | |||
| 9c38236a30 | |||
| ea57e3e40a | |||
| 9b5b22658a | |||
| a7bba2a578 | |||
| d02912577b | |||
| af4e1ce85a | |||
| 0345173039 | |||
| 5f560e8d1b | |||
| a2ebf07cad | |||
| 095bb38c03 | |||
| 5dbf2063f8 | |||
| 9ade773618 | |||
| 9639d60acf | |||
| bb774648ff | |||
| 23b3ea1856 | |||
| 6955a492d7 | |||
| 40579a0d75 | |||
| 6312222eec | |||
| f857d5454e | |||
| 0e09e1e270 | |||
| 1ca2e091a7 | |||
| cb88a28557 | |||
| 576682f6a8 | |||
| 08245aade9 | |||
| b30cf3ee0e | |||
| 04f5afbb9b | |||
| 9fa5ffc69c | |||
| 2aa8c68cf6 | |||
| 903dc152a5 | |||
| 99e42ceeb2 | |||
| 67afb99c77 | |||
| 901c5339ff | |||
| 5842bc8473 | |||
| 58d8a99511 | |||
| de3e0e802f | |||
| a05a88cc89 | |||
| 681a4f436c | |||
| 4805e3eb4b | |||
| f2f9579b77 | |||
| e5f336fba1 | |||
| 65e6814b28 | |||
| 91bec1e4d9 | |||
| a91bfbba9e | |||
| 7f12f50036 | |||
| fe99e0d917 | |||
| 204b4b2369 | |||
| f8d7007ef8 | |||
| 444fc85710 | |||
| 1f318844f0 | |||
| d5348de16e | |||
| be20388278 | |||
| 7e0a30c08f | |||
| e87bec64e3 | |||
| 2ac79a7791 | |||
| 067c4ee0db | |||
| a14848fc7f | |||
| 9fa0919a36 | |||
| 5659dcb78f | |||
| 44ea1ae8eb | |||
| e0a03f6728 | |||
| 0db90e34c3 | |||
| 4a9e8d6a4b | |||
| 4385be717f | |||
| 0cfbc7669d | |||
| fd855d8a8c | |||
| 342d2cdb83 | |||
| a93ea1faa1 | |||
| 82348f7e05 | |||
| 4d1df6a166 | |||
| 73621e1f75 | |||
| 481e312ae3 | |||
| 7eee552f2c | |||
| b3e2e8e321 | |||
| 7c4214d5b9 | |||
| 5a7fda2f81 | |||
| 3340a18461 | |||
| 59af2e2719 | |||
| 271fe6804d | |||
| 80ef2b8d38 | |||
| ad134173be | |||
| e38a4d320f | |||
| 82910acffe | |||
| bd8c1b6f32 | |||
| da0c47f536 | |||
| da68c593cf | |||
| 141b999b92 | |||
| fbd0744431 | |||
| 197c008937 | |||
| f9590d4141 | |||
| 8023606223 | |||
| 0157eebf7c | |||
| ec6d1c1212 | |||
| 8c5798443a | |||
| d389d31694 | |||
| ef51b2e6e8 | |||
| 45330e6468 | |||
| 9f658cd760 | |||
| 1767de646d | |||
| 259f8efdf9 | |||
| 298fb332f9 | |||
| f617ae1362 | |||
| 2616961b95 | |||
| c23a096a73 | |||
| 967af60cbe | |||
| b82ffe308d | |||
| 76bda4f89a | |||
| a9f4d2185c | |||
| a2ecdaa484 | |||
| ade4c07083 | |||
| 2633b61433 | |||
| 7164375b75 | |||
| 502ea0e921 | |||
| 408d0ef26d | |||
| 8ec13c59e9 | |||
| fdc9873ab8 | |||
| d2189f5d10 | |||
| cc5061970e | |||
| acbe17e4bc | |||
| ea3f47c7f2 | |||
| 7ef2f866af | |||
| d02d78101c | |||
| 79e86c249a | |||
| 52dff725c1 | |||
| d2674a5ba1 | |||
| c4c67658b4 | |||
| 745161ee6e | |||
| 81fd67585e | |||
| 26c1bc0725 | |||
| 24f30bf5e1 | |||
| e607dea888 | |||
| 3bdce075a1 | |||
| e19df39c0e | |||
| 78fb60de27 | |||
| a12367c0fa | |||
| 249152394b | |||
| 0d76f2461a | |||
| 6bbf56bdd8 | |||
| a87e5af764 | |||
| 3d542a0ded | |||
| 646485599a | |||
| ba5a9c723e | |||
| 0b9602a8da | |||
| 3d5a9904d0 | |||
| b5af24e8c9 | |||
| 3084ad12c5 | |||
| aa19969759 | |||
| a918f293cf | |||
| 7d3642e16f | |||
| d2dd9fa6f8 | |||
| e505efc9f5 | |||
| 2c605e8280 | |||
| 6f807b007b | |||
| c909590091 | |||
| 26d9455b8a | |||
| 491f4e12c2 | |||
| a0dbfddad0 | |||
| 4ca9aba433 | |||
| fab041ce16 | |||
| 53b8825d03 | |||
| 675a425eed | |||
| 9a47c9d067 | |||
| 64573dd571 | |||
| 94720b0c4e | |||
| c034abdb4e | |||
| 60b4fb1126 | |||
| a76484a7eb | |||
| 973475d01e | |||
| 48af7aefd0 | |||
| a4f4999546 | |||
| 9caa0f1e3b | |||
| 45ba06c7b9 | |||
| 83727726aa | |||
| 18a2af7291 | |||
| 448a3c1b6b | |||
| 7a9105dccb | |||
| 2c60b84258 | |||
| f5797b2b3a | |||
| eedc5ea68f | |||
| 58e213f578 | |||
| 2794bb8070 | |||
| 72898b0d3a | |||
| dcaed635f0 | |||
| da23a624dc | |||
| 70ddd2911a | |||
| bb4fc32b00 | |||
| 1a6832c83a | |||
| b74d7f0f32 | |||
| 7eddd64e3a | |||
| 9337fa861f | |||
| d5e22111e1 | |||
| 51a6c3c0ab | |||
| c205336fa6 | |||
| cde4fea817 | |||
| 9ac30369e0 | |||
| f635a1e762 | |||
| a43caca219 | |||
| 041bf5aa04 | |||
| ce6e9fa4a9 | |||
| 2a83cffc53 | |||
| b39dd034c6 | |||
| 160cf07110 | |||
| d374453c8f | |||
| da5359af87 | |||
| 2f6c8cb200 | |||
| e15eb9ff79 | |||
| 7e65fe82c3 | |||
| 330234df01 | |||
| 8f08a61d12 | |||
| 12997bd169 | |||
| c48e1781fd | |||
| dc660d4ade | |||
| 30d13baeab | |||
| af755fa549 | |||
| ac57faa85e | |||
| ee2e46f3cb | |||
| c64ef77f08 | |||
| 07a6fd8ee7 | |||
| 0188d076e3 | |||
| 0f340e1aaf | |||
| 2e270950fe | |||
| 24ae9854c0 | |||
| 4b280fb3fa | |||
| d932bfc79a | |||
| 7ef7436118 | |||
| b99cb4c431 | |||
| 0b13c57b96 | |||
| 6560c99445 | |||
| e27a8bece4 | |||
| 1ef2e89972 | |||
| d146966a18 | |||
| 417ab94993 | |||
| 9052f8824e | |||
| 2aca8a1338 | |||
| 5c70c2f415 | |||
| a9ed6485fd | |||
| f79ae6c39b | |||
| 63d48e810d | |||
| 08a37b77e7 | |||
| afc3b61232 | |||
| 2f437ccad5 | |||
| 5f75e5851e | |||
| 1ce67a62c2 | |||
| ca9d53dbdd | |||
| 17823786e4 | |||
| 4c5ac47507 | |||
| f686934430 | |||
| 2e35e095c6 | |||
| 8f0a318cc3 | |||
| 55f600a63c | |||
| 9894fda194 | |||
| db1a459a47 | |||
| 23a61cc60e | |||
| 98779da0cf | |||
| b12f76bc39 | |||
| 2364752a98 | |||
| f7f1de4e94 | |||
| 86bd251f74 | |||
| e4ee5a0cd9 | |||
| 5c0c57a2c5 | |||
| 1006496795 | |||
| eb80d75ee1 | |||
| c7b7cd2ba9 | |||
| 9badcb3513 | |||
| 7b8a7ffd58 | |||
| 01242e2b78 | |||
| 38129abd43 | |||
| cae4d1ecf6 | |||
| 4a20329b2b | |||
| dac51367f4 | |||
| 2d241ea9d9 | |||
| 46fe25fd24 | |||
| c473b8e105 | |||
| 71b28cff87 | |||
| 1f7be79a92 | |||
| 06bb5ab175 | |||
| d9f97016e2 | |||
| 873d2c4377 | |||
| 8ff61ef915 | |||
| cefd125117 | |||
| bb3335b555 | |||
| 191c11056a | |||
| cf6a56b64a | |||
| 0ecadadeb4 | |||
| cfa5382969 | |||
| 77ff73a89b | |||
| 9744eb966c | |||
| 0a45a71ea0 | |||
| 40edf9f88a | |||
| 49bcb3b0fc | |||
| 08cc65b517 | |||
| b18a642de6 | |||
| 9c82e62cc7 | |||
| 98eb42a77c | |||
| 21398347f1 | |||
| a48d76504a | |||
| 71ef6d5457 | |||
| 10dc3503c2 | |||
| c4251c4ee2 | |||
| 62ad79538f | |||
| 28e9d0ee94 | |||
| 59ad4f79fc | |||
| efacc05868 | |||
| c2b18553ab | |||
| 075a21b53a | |||
| c8ae023a15 | |||
| e48c27d30a | |||
| b404673f58 | |||
| b8f3e1771d | |||
| e0fe763832 | |||
| 5960f25878 | |||
| 719aa2ee49 | |||
| 1b071cbf47 | |||
| 210c03e0a1 | |||
| 2b878af183 | |||
| 9730f8d190 | |||
| 7c81920431 | |||
| d44f3d9f3e | |||
| 6509a5a66e | |||
| 6a9b21b6e6 | |||
| 9a81cc37b3 | |||
| 352a2e023a | |||
| 5916959038 | |||
| 413c146fe0 | |||
| 64a8349120 | |||
| f4784e61b1 | |||
| cb7cb4aaf8 | |||
| e6c92d1ed9 | |||
| 698885f645 | |||
| e1aba1bc1c | |||
| 3adac4c795 | |||
| 54076ebb8f | |||
| 0f1c14549e | |||
| 72022a0e32 | |||
| c91759166a | |||
| 2a9d5d4778 | |||
| c045a6214b | |||
| 3e2e665955 | |||
| 281dee18eb | |||
| 53c670deee | |||
| c3417a0d88 | |||
| 0b77d9921d | |||
| b9448c6baf | |||
| c9367ba10f | |||
| 2c9f601404 | |||
| d9373b997b | |||
| 6f8ab60e11 | |||
| 3db2b2912f | |||
| 670bb0a0c5 | |||
| cae8cb9c1f | |||
| 3f2166330d | |||
| 3a5b41ae54 | |||
| fcce76cfa4 | |||
| 856ffd4ed7 | |||
| e28e048e12 | |||
| dbc29b4444 | |||
| cdfc8b5b2b | |||
| 7d5e37d5fa | |||
| a3b7852467 | |||
| 298803ca04 | |||
| f8b0100655 | |||
| b9ee9ee0d6 | |||
| c57e0fc6d3 | |||
| 582b14e919 | |||
| 2d884d413a | |||
| e44c49f189 | |||
| 8ef1456fe9 | |||
| 1cef62df48 | |||
| 0446658f4b | |||
| 38145a02f4 | |||
| 2646307efd | |||
| ce2b033ccb | |||
| 59d8653b61 | |||
| 586b74b7f7 | |||
| e8744eb73c | |||
| bffa086f72 | |||
| 7430620a8b | |||
| c86123632c | |||
| f77e43c1f1 | |||
| f74fc932cc | |||
| 171245d892 | |||
| 27fbd4b952 | |||
| 63529d77e3 | |||
| 722a9686e4 | |||
| 35659a09a4 | |||
| 7d88ff506e | |||
| f41f1a3f7b | |||
| 30b8a7e14b | |||
| b44fa1432e | |||
| 80a6c4727d | |||
| 63193951e9 | |||
| cde59a2b22 | |||
| 5c601a0bb7 | |||
| cb47c03f4f | |||
| 16c1bd01c6 | |||
| 046a4d253d | |||
| 6fd9c47649 | |||
| 746f9f93b7 | |||
| 220ddb8bcf | |||
| 0c015f321a | |||
| 7c1ff4949e | |||
| 69da337b70 | |||
| 8936b3feec | |||
| 5d9293e8f5 | |||
| d695b53548 | |||
| 94bee30517 | |||
| e58946dabd | |||
| 1d625bdac8 | |||
| 1451d7d37e | |||
| e9860ed649 | |||
| f676589989 | |||
| c5660353d2 | |||
| 3323875a63 | |||
| 33d214234c | |||
| ad956ac0cf | |||
| ab67433c45 | |||
| 4ad86b5ac5 | |||
| 0505836e33 | |||
| 2890259808 | |||
| fccfe6eaf1 | |||
| f184aa719f | |||
| 1d0ebe5642 | |||
| 9c5dd4072d | |||
| f89fc9a9ae | |||
| b66fafbec3 | |||
| bf8e74b266 | |||
| c04387b7c0 | |||
| 1a6880400d | |||
| 5690186fcc | |||
| cd245818fe | |||
| a14948b66a | |||
| 802e7e64ff | |||
| 764622f9d3 | |||
| 3473b685b8 | |||
| 947b691e2a | |||
| 8b33ba4576 | |||
| 30c7e990fb | |||
| b32dcda598 | |||
| 7d2d7cac08 | |||
| 7a60bd8203 | |||
| fcd1e69eb9 | |||
| 7c2cfd4db3 | |||
| ecc2be0b3e | |||
| d0d9556498 | |||
| 87bf0a163c | |||
| 5741739360 | |||
| 834c415028 | |||
| eea4f1c225 | |||
| 0dcf67cd8e | |||
| a9e8450578 | |||
| e695b92a50 | |||
| 08da268aff | |||
| 8438a5b044 | |||
| 4764cc889c | |||
| c7707b2d4b | |||
| 2b3b0f5feb | |||
| 96318e0c02 | |||
| 63ab2ef141 | |||
| 8a8e143eb2 | |||
| 916114eacd | |||
| 8e222b2800 | |||
| 932553e403 | |||
| 71f669bbef | |||
| d3b66c849b | |||
| c0f9a993a4 | |||
| f6ba7e26b7 | |||
| c1453cc6cb | |||
| 8a32e769dc | |||
| 1c59184583 | |||
| 93646983b5 | |||
| 2cdbcc53b9 | |||
| bff28a6c28 | |||
| dc6c2bd665 | |||
| a7fdad2a69 | |||
| f3060e72e4 | |||
| b66fd75b50 | |||
| dddad5389a | |||
| bb0ab55830 | |||
| fc716b3a2a | |||
| 6c4e89a35a | |||
| da2561b672 | |||
| 3332cbf051 | |||
| f83446cea1 | |||
| ee42fec3dd | |||
| e3f2f08d24 | |||
| 4c909224f3 | |||
| 7f311aa748 | |||
| fe95960059 | |||
| 9e1139c4e3 | |||
| 3d91abbd5b | |||
| ccd8d9d1fd | |||
| d1b95610e2 | |||
| 0009c8b287 | |||
| e7a8de750c | |||
| b323c2e7a4 | |||
| 6c798882aa | |||
| 9829059e66 | |||
| 2925ab29a9 | |||
| 8a53e7345a | |||
| 004cac122a | |||
| 84e02706e7 | |||
| 9d1d36cd3b | |||
| dfad662f18 | |||
| 522e0cd1f6 | |||
| b44879a7e1 | |||
| c7d84f741d | |||
| d790fa3d4b | |||
| 7e164f4b8d | |||
| bbb9a4ceda | |||
| 770b95507e | |||
| 2107f25765 | |||
| 392169591c | |||
| 30dd3cd41d | |||
| ff876880d5 | |||
| 1b46c80613 | |||
| 4dc9194a36 | |||
| 28fad3a306 | |||
| 60c1282c15 | |||
| a545bae3a6 | |||
| 448618cc7e | |||
| 34009091fd | |||
| 676491412d | |||
| 6fc35b523f | |||
| 6bba2b14ca | |||
| 125650d230 | |||
| b38d278c75 | |||
| efa484a710 | |||
| 42c39a9d5f | |||
| 439cabe83c | |||
| ba71d4ebda | |||
| ffeb7cd6b2 | |||
| 3acb7e5eff | |||
| 0d394ca7c6 | |||
| 8f1ae2e529 | |||
| af1ab8ec59 | |||
| 1a00145b1d | |||
| a3e4591144 | |||
| 97de97c84e | |||
| fad6211789 | |||
| 034130555e | |||
| 0f2cc257cd | |||
| a3a698181e | |||
| 43059f3539 | |||
| 987b5eeecb | |||
| 261cdd4cca | |||
| 9ec25ed189 | |||
| 95163bde66 | |||
| 540ca146b8 | |||
| 628f2eb1c8 | |||
| f9f930afa3 | |||
| 15203266ac | |||
| a4e3cf6f3c | |||
| 0bf7410145 | |||
| 0326a3d27f | |||
| 57d3fe53bc | |||
| f0e7accae8 | |||
| 0c0662711e | |||
| eb3cc1447b | |||
| 229dfc1938 | |||
| 5160fd8503 | |||
| 296b12ffdb | |||
| 9ce093dfd0 | |||
| b30fdf841d | |||
| 988103d785 | |||
| 8662736e22 | |||
| d134c063e5 | |||
| 11e83de0d3 | |||
| 3326d6ac6b | |||
| 88602a88c7 | |||
| f2bc9e2fe1 | |||
| 753c5e3119 | |||
| 8b739815e3 | |||
| 3b570db6ba | |||
| acd974403b | |||
| 9244350737 | |||
| 508a3edf8d | |||
| 1589f33443 | |||
| 6158f80c06 | |||
| f48ed4b0d5 | |||
| 2398f5d59c | |||
| 9f4fe67508 | |||
| 4d3747e5b6 | |||
| 933e2c4001 | |||
| ea4abdf9bf | |||
| 93ba07eaf6 | |||
| 600dc5e9f4 | |||
| f49d281330 | |||
| ce6e9aefc9 | |||
| 57ea7937d8 | |||
| 8cdfe1040d | |||
| dda6069fef | |||
| 5219d9d53b | |||
| ccc4096106 | |||
| 2ea96f15d2 | |||
| 01c2413a0c | |||
| 1edd98f501 | |||
| c19c592035 | |||
| ddd8d137fc | |||
| eca1273b59 | |||
| e0e16a4256 | |||
| bf54445c94 | |||
| d2e510792d | |||
| 1574df9e12 | |||
| c27c4f2c78 | |||
| 34776b24c0 | |||
| 006eee1411 | |||
| 4f087a216f | |||
| 0b2b9ea1c3 | |||
| 18a5883f66 | |||
| cfec9ed00e | |||
| 9fd20a87fe | |||
| 20ddf27fff | |||
| b4c6d123c8 | |||
| 2f67344b81 | |||
| 78b28444e6 | |||
| bea9c74243 | |||
| fb705d66df | |||
| ba9f55cb67 | |||
| f246c992c0 | |||
| e7dc6644c7 | |||
| 06a2e757f1 | |||
| 02f75dedd9 | |||
| 9b6c0e4fd1 | |||
| 691b52572f | |||
| 888895b60b | |||
| f11c961be4 | |||
| 0f0db5e1d3 | |||
| d945052c82 | |||
| bea06a1772 | |||
| cedddfe8d2 | |||
| b6be6222f3 | |||
| 9cc9e115a4 | |||
| 0b387a2467 | |||
| 7755ae6063 | |||
| bbf5e9608d | |||
| 01cb2411c8 | |||
| 1bdca8ae9c | |||
| 9419f565aa | |||
| a292fabb02 | |||
| f2c5e428d9 | |||
| bcf072708d | |||
| a025d325dd | |||
| 278f5013ab | |||
| 00779bc33a | |||
| f7e1c6cb8b | |||
| 8ad6f3d5e6 | |||
| 7255f47a85 | |||
| 817dea8f1e | |||
| 4312e708fe | |||
| 32213baf9e | |||
| 33cb784ff1 | |||
| 7426aa7738 | |||
| cb4286d99d | |||
| 96e1dcbcd8 | |||
| 7880d144f6 | |||
| 7f6bdd87cb | |||
| cb6d13bf6a | |||
| e8d54d35f1 | |||
| 9a2b668956 | |||
| ef3f8a7405 | |||
| 691d568b1a | |||
| 84661b20d4 | |||
| b94da82e17 | |||
| b6aca8c0f5 | |||
| b5435ce940 | |||
| df4c7afdbb | |||
| f647971d71 | |||
| 6480741e42 | |||
| 1dff05dc02 | |||
| 3ade8707a7 | |||
| 57f9489d81 | |||
| 27f8be304a | |||
| 3b59d07724 | |||
| 3dfdd1b61d | |||
| 5d3c827488 | |||
| d0281da58d | |||
| d72d8f609f | |||
| 4a6acab3c9 | |||
| 893eb3c061 | |||
| a646e240fb | |||
| 57718d0100 | |||
| e4b3b3af85 | |||
| c90e167594 | |||
| a86ab46bb1 | |||
| 0494118089 | |||
| c2d220e94b | |||
| bddfa3938a | |||
| 8d1d456721 | |||
| d19f50772e | |||
| 8dcd1da919 | |||
| 0090b9ae78 | |||
| 1615fd7593 | |||
| 55fc49edba | |||
| 04c4912449 | |||
| b33fbdd274 | |||
| 300d6af086 | |||
| 4ffe49ef01 | |||
| c177824601 | |||
| b185cc7fd8 | |||
| 132aa15ab6 | |||
| 0f242f5565 | |||
| 499092b479 | |||
| b3f1716f82 | |||
| 5d3c3f4a21 | |||
| 9b1f36c155 | |||
| 7a5154305b | |||
| 63dd5927fb | |||
| 624bab7826 | |||
| d65b74269b | |||
| 0d189b87da | |||
| 32c16f9f28 | |||
| 7645fec55d | |||
| 3783648a7c | |||
| 7c9470a745 | |||
| 370cec86a9 | |||
| e5ad887be9 | |||
| 353eab083f | |||
| 24f4535655 | |||
| b90a621db8 | |||
| ca61fe4298 | |||
| fce51a6945 | |||
| dbf39608eb | |||
| 0618f98a13 | |||
| 3d5806cb3c | |||
| ab5d5dd835 | |||
| 26dc8723bb | |||
| 58a3ff84a7 | |||
| 5741bcfc7c | |||
| 655169aa7a | |||
| 33eeb4cc64 | |||
| 3aee625cd7 | |||
| ef28d7e233 | |||
| 91da126cba | |||
| 1c8b865d89 | |||
| 445899b58b | |||
| 0d49c5eee6 | |||
| ed61ce0a19 | |||
| 86ee17eba0 | |||
| 7a1f11862e | |||
| 7313d13532 | |||
| d779aa732c | |||
| 337757f8c6 | |||
| 5fbaefa004 | |||
| 304eaae751 | |||
| 64419ffd3f | |||
| c33e7c313c | |||
| e250806eb7 | |||
| aadce547a5 | |||
| 53f48dc487 | |||
| 447ee71698 | |||
| f31e14153a | |||
| 97907215c7 | |||
| 1be0977330 | |||
| bbae0f7533 | |||
| 1f4086f381 | |||
| 7e5d0a8bba | |||
| f879c54f8e | |||
| 4fece76edb | |||
| 682517b0ed | |||
| 200ad04660 | |||
| ee08415077 | |||
| 77bd6e5b25 | |||
| 69ae9805e9 | |||
| 76a7674272 | |||
| 57c6738ab7 | |||
| e436e9dc79 | |||
| e18499925e | |||
| 271075ec16 | |||
| e9839b6b0c | |||
| 3cfbd189f8 | |||
| eb41750e9e | |||
| a2e9c6cdca | |||
| 20ef6984ee | |||
| b3c7bb1e8c | |||
| 9a334e44f4 | |||
| e16500de9e | |||
| a14ba678b4 | |||
| 97ff1828d1 | |||
| 76eec92bdd | |||
| 4eedf94f03 | |||
| ee1b51b214 | |||
| 8c6bfb208b | |||
| 5b7654e475 | |||
| 70102b2fa5 | |||
| 350e910a57 | |||
| fe30a393b5 | |||
| 1244b7642c | |||
| 7e567fdb15 | |||
| d840c8acd4 | |||
| 833dd62611 | |||
| 38caa56387 | |||
| b802bc5db2 | |||
| c38f7f9941 | |||
| a0eb087d11 | |||
| 3569272812 | |||
| bacb65338c | |||
| 14ae917da7 | |||
| ac3981373c | |||
| 0395dbef0a | |||
| 2cb5586fd6 | |||
| b6f8fb689f | |||
| 207c0cac8c | |||
| 6f98c73ac2 | |||
| e551118b38 | |||
| 1f6bd16d8e | |||
| 6d0398ec64 | |||
| 595258e3e8 | |||
| 45c563086c | |||
| f648c53443 | |||
| b2540a9fc1 | |||
| 1998a75eff | |||
| 51ed610ba5 | |||
| dda4a157b1 | |||
| adec1f4cf1 | |||
| d263552c27 | |||
| a6863e3d1c | |||
| 39a4b8e39d | |||
| 44c6ed07f5 | |||
| ec0f7b3b37 | |||
| 0b61e17454 | |||
| f2c89f31d8 | |||
| 7317a6f8a9 | |||
| b6246e7ae9 | |||
| 825cc28bd8 | |||
| 7c9b0960ea | |||
| d396e85fe0 | |||
| e4428849f3 | |||
| 9c5e8881fc | |||
| 05fca48115 | |||
| d125e408f2 | |||
| ab1c367dba | |||
| 6749d26333 | |||
| 413119efc5 | |||
| 7f6591edad | |||
| 32b0aaa19a | |||
| b2db04f4bb | |||
| 2f8f2df3c7 | |||
| 43b0c00e11 | |||
| 452e987fca | |||
| 74918e4d12 | |||
| 4e58605333 | |||
| 772d1ca4c8 | |||
| 9a57ec0acc | |||
| eab9fdc24c | |||
| 942e658c8e | |||
| 2ce10db3fe | |||
| 5c582390f6 | |||
| 0fefe2f2dd | |||
| 8c81cb5ec0 | |||
| eb20e5e7b6 | |||
| 97dda47e5b | |||
| 589e02755b | |||
| f4df52a033 | |||
| ad7c110179 | |||
| f9adb56d10 | |||
| 4bfb7caaa8 | |||
| f088c481f8 | |||
| 037bfb373a | |||
| 9f25f558fd | |||
| 9aa5e6d5b5 | |||
| 0b267c4a4c | |||
| c7dac9c9a9 | |||
| 05be5429a2 | |||
| 5b78409920 | |||
| e6bd812f85 | |||
| 11521c128c | |||
| d563f64fe3 | |||
| ea98552365 | |||
| b13fbade78 | |||
| 6e310b922d | |||
| c31f184813 | |||
| 0c0f559f75 | |||
| aee3a1c25e | |||
| 1c510326cb | |||
| 84680a674b | |||
| 503e652906 | |||
| 023051bf47 | |||
| 38a2643001 | |||
| 3c1a2bddbc | |||
| 1dd8737b0d | |||
| 4b9270182e | |||
| 89c6bb2513 | |||
| 4318f6f00d | |||
| 35250f30c2 | |||
| 82f111d249 | |||
| 0592960262 | |||
| ee486897df | |||
| b41762bcf4 | |||
| 3a1c4b1379 | |||
| 4f690f33e3 | |||
| 41b8409975 | |||
| d038a0a353 | |||
| 30c87f5cf5 | |||
| eca752d80d | |||
| d30176763f | |||
| d08e1e8e7a | |||
| e7a7916d8a | |||
| dd3a41e4ce | |||
| 62183fc8dd | |||
| 30ce4a328d | |||
| 4f55c6d3aa | |||
| defb936d33 | |||
| bc8d6ef9c0 | |||
| eb14396223 | |||
| b3d5b7c107 | |||
| a02dc351f3 | |||
| 831866bf26 | |||
| ec7dbcfa59 | |||
| 246076dcd7 | |||
| 9d4887d864 | |||
| 3d603143dd | |||
| 121dad121c | |||
| 95a1fd273b | |||
| 05e46242b0 | |||
| c163e2513b | |||
| bbb2b25ac8 | |||
| dc29a32f02 | |||
| cefd7ee08c | |||
| 8af733fb3d | |||
| 1cb4834c38 | |||
| cb28cccf50 | |||
| 498323a8e2 | |||
| a518696cad | |||
| 8429ab57b3 | |||
| 740fc27d5c | |||
| 1c77990d0f | |||
| 53473e75ea | |||
| e2b645bf5b | |||
| fa386a9477 | |||
| 96c49676d4 | |||
| 851c4c0225 | |||
| 8453e13fe1 | |||
| 347283cb32 | |||
| 1c940aebb4 | |||
| 0b48b71c56 | |||
| 2db13ce1a4 | |||
| 3f036e38b5 | |||
| 013a7d3fb5 | |||
| 080240d16f | |||
| 102d069400 | |||
| 9c0b09855c | |||
| 17b347e785 | |||
| 3e61939b0b | |||
| a43e1a8025 | |||
| 20af6b2c0e | |||
| d2322c738d | |||
| 8c4610ede7 | |||
| cb3a0cb823 | |||
| c6ff076bd8 | |||
| f4e0724018 | |||
| 9de6c04844 | |||
| dfacf867c1 | |||
| 035e0df210 | |||
| 34445b6f15 | |||
| d5e7bf2433 | |||
| 5441c10412 | |||
| cc6e00e806 | |||
| bab514ff75 | |||
| 900b3249d4 | |||
| 1c7e7226de | |||
| 0394b70d40 | |||
| 514022284c | |||
| 94ffd75c88 | |||
| 2e1ac80a25 | |||
| b130a8dbbd | |||
| 306e3886d7 | |||
| 3f47a2daf5 | |||
| 666b3ad94c | |||
| 52142e5ea5 | |||
| ad25ad00b1 | |||
| 79e152e1bf | |||
| 07c786d19c | |||
| ab7a99b9af | |||
| 9de9bc8147 | |||
| 381b786025 | |||
| 4e100c542d | |||
| 56bcdec148 | |||
| 2d90443257 | |||
| dfbd269c4d | |||
| 53baa62e48 | |||
| 6b49ae7c23 | |||
| c50ff6c1ff | |||
| 980b2cb0dd | |||
| 0ef7021cff | |||
| 308537ed17 | |||
| 5419429ad0 | |||
| 42dc9ddf35 | |||
| da654f45c6 | |||
| b8d5c343a8 | |||
| 091d5122af | |||
| 87c86e344a | |||
| 9b8320a8e4 | |||
| 9d600f6119 | |||
| 3c88b34ba3 | |||
| 7ee9b0a064 | |||
| b069829a5d | |||
| e78f8de757 | |||
| 33aa4f00b1 | |||
| 8c76a379b5 | |||
| 52dd8fc3c3 | |||
| abe6eddc58 | |||
| 3bf24aff2f | |||
| b3c11ef02c | |||
| 2945ee250a | |||
| 6fc96cb786 | |||
| afe979d51f | |||
| 460046cb4b | |||
| 65fdb1a64b | |||
| 05fb10b7e3 | |||
| 3a359b2075 | |||
| 01fe85f969 | |||
| 7b00d70cac | |||
| d56492403d | |||
| a26ee86101 | |||
| 509399ad04 | |||
| b444e857d7 | |||
| 35f3ce021f | |||
| 05c55592f5 | |||
| 6968b552ea | |||
| 566fc2344b | |||
| 89c1962c5f | |||
| 511b63d604 | |||
| 1839ff7dcc | |||
| e8822c805f | |||
| 19d1238ab6 | |||
| 7db61e7385 | |||
| badff8ff1c | |||
| 981e402e68 | |||
| 50c7a8b5db | |||
| b941aa0277 | |||
| 4a8f1281d4 | |||
| 3f9c37bb15 | |||
| bd1f7b332d | |||
| f3d38ab8e2 | |||
| bd166cae99 | |||
| e8a2942895 | |||
| d144b2dc05 | |||
| 3cbad08e50 | |||
| ed61d18878 | |||
| 34b6c5bc3b | |||
| 35837548de | |||
| 4c92ad1da8 | |||
| a548818523 | |||
| 47723faaeb | |||
| a366053b72 | |||
| 9c1761972a | |||
| 0d64e6b3c7 | |||
| 2b3fe0f752 | |||
| 7ef4fc4594 | |||
| 6e04ee65ee | |||
| 8312989282 | |||
| 32a2943a83 | |||
| 7501f9c403 | |||
| 0f2d097a43 | |||
| 0cb22c6cf2 | |||
| 57c3a19e8e | |||
| 9a79ea4919 | |||
| e97af2fb23 | |||
| a7c26a4514 | |||
| a19970c0ca | |||
| b362bc7f9d | |||
| a03c3a849d | |||
| 6442950fc2 | |||
| 750922b698 | |||
| 0abbfa5f8e | |||
| 3b491cdf82 | |||
| 0f00dc3e16 | |||
| 75ce4c2afa | |||
| b15030afc3 | |||
| b1389ee87a | |||
| 4035b82831 | |||
| 8bac09c126 | |||
| 381af741fb | |||
| 2d3215466f | |||
| c924a369d7 | |||
| a9208deb91 | |||
| d0156700f5 | |||
| 475b8bc3e6 | |||
| d796623e3a | |||
| e5595cfdce | |||
| 442264199f | |||
| ea4ffb99b0 | |||
| 9cb49d7f83 | |||
| 4c34d8aaff | |||
| 1f31c60c82 | |||
| 7ecc01672f | |||
| 67b6a82671 | |||
| 5ee5fa7e98 | |||
| e86aa51a22 | |||
| e25200b45e | |||
| d91b8ecd0b | |||
| 288a697264 | |||
| 432ee0f337 | |||
| 7534e58bbd | |||
| 5e6c32b929 | |||
| 0e441c1baf | |||
| 0f3b5d8fd7 | |||
| 9b0b2d078c | |||
| 7fef965b08 | |||
| fc4a41a689 | |||
| 836cadcb13 | |||
| f65e99504c | |||
| b7be29b9ca | |||
| 761eb7add1 | |||
| f4a3d199b9 | |||
| 318abd2667 | |||
| 171c77ff64 | |||
| 82ffb34ec2 | |||
| 5a157471fd | |||
| e416fa4871 | |||
| 72aaae0b4a | |||
| 0f3928743c | |||
| f6d1986b5c | |||
| d597c5d653 | |||
| ec970f7dfa | |||
| 43e18379ee | |||
| 2f5fcfcc01 | |||
| 5d484a3eff | |||
| 5973057d7b | |||
| 76ee88eb4c | |||
| bfe67b39f5 | |||
| 3639ec807d | |||
| ba51df10f2 | |||
| 2a2840eb14 | |||
| d38c32544c | |||
| 8b37174008 | |||
| 66b810b7ad | |||
| ed55931f77 | |||
| a92f0b3c72 | |||
| fea4145271 | |||
| 5e5b093a2f | |||
| 190100b8e2 | |||
| bd7e6d8637 | |||
| 77409ec7d8 | |||
| 10049de852 | |||
| 24ee0f03e9 | |||
| bc8cfe5a04 | |||
| b66577deb5 | |||
| aff9a411b9 | |||
| fd042add99 | |||
| 7d452e798b | |||
| f79e2aba4f | |||
| 46ae2e434a | |||
| 4c01fa5ccd | |||
| 8270bdabdb | |||
| 7ec7428da8 | |||
| 9016e8dc79 | |||
| 2ec67683ec | |||
| a6c9883383 | |||
| 1c695a05d7 | |||
| f4d3759e8a | |||
| cbe3a02fb9 | |||
| ab37f82825 | |||
| 5701c029db | |||
| 01033837da | |||
| 29b941539b | |||
| 63407597c5 | |||
| c246dc27ce | |||
| 62326a67ce | |||
| b58dcc9824 | |||
| 4b014c163b | |||
| f4bdc3888e | |||
| 86a7429f51 | |||
| fc1349fb75 | |||
| d0c4ddd064 | |||
| 6e14b9ee63 | |||
| a861ab1dfd | |||
| dc36a83cf5 | |||
| 855c3b6a6c | |||
| 4215d5b55d | |||
| cec998133f | |||
| 718d055cbc | |||
| e589f91d45 | |||
| bb3751bb9a | |||
| d5f19c0da7 | |||
| c84501fbd1 | |||
| 784bab30b1 | |||
| b2247dc943 | |||
| d3704b1c1f | |||
| 46d157f0a4 | |||
| 46b46b7c52 | |||
| b2824994aa | |||
| 0ac385eed0 | |||
| cf578bbaa0 | |||
| 6427b8a8bb | |||
| ffe29e6f1a | |||
| dd7e9ae2b4 | |||
| 6dc8eb75a2 | |||
| a8f99b1b61 | |||
| c9171c6d79 | |||
| 7e7b1914ff | |||
| cf3da300b5 | |||
| f7c207547f | |||
| 61b8f4b4e4 | |||
| 3a8220a4bb | |||
| ad653ecd0f | |||
| b593317360 | |||
| 40b42a4171 | |||
| 1ee7247576 | |||
| 98456f9489 | |||
| 3492b5d0a6 | |||
| 1aff10dc35 | |||
| 33fff62c0c | |||
| 1042f3ea2e | |||
| 6a3b539a22 | |||
| edb07e2c56 | |||
| 14bb497195 | |||
| 3e14bedf20 | |||
| 3846677431 | |||
| d9480578fb | |||
| 782ab91599 | |||
| 212b02dfc6 | |||
| c36d366ef1 | |||
| 6efaf223ba | |||
| a1601aa6a2 | |||
| d043701944 | |||
| 2c5c3de04a | |||
| 7251f7bafa | |||
| 6b886cf5d7 | |||
| 2ff6e1f644 | |||
| 6b412ed264 | |||
| b0e49b8aaf | |||
| 53e061ab6a | |||
| 53f111ccbf | |||
| 937183e629 | |||
| bc2a9e1fd5 | |||
| 59fdea8ee5 | |||
| a2aa7c62c2 | |||
| 8d4c57bf8d | |||
| f31edc88ea | |||
| e25e903896 | |||
| 68a4d94e59 | |||
| 2815ddd4b7 | |||
| 149079e8ae | |||
| ec5b3039b8 | |||
| e41ae1fadc | |||
| c107643d69 | |||
| 20af91b9e1 | |||
| 0e9b213845 | |||
| 64a2a74a52 | |||
| 10cb8b72db | |||
| ce4804d94c | |||
| 05569ef15a | |||
| c762e1bf65 | |||
| 0a719d9ec7 | |||
| bea62a03ff | |||
| d386b65343 | |||
| a7ebbe8c94 | |||
| 6f1291ca21 | |||
| 7b46be2118 | |||
| ded8f237e0 | |||
| 182d97ed18 | |||
| 6753e0f92b | |||
| ae82c5f7a0 | |||
| 878c7b081c | |||
| 367ca4dfa7 | |||
| c4d6bfbff8 | |||
| a41dc24a2e | |||
| 80b0f0ee52 | |||
| 79aa9f6648 | |||
| 6df7a23d0a | |||
| e933f62096 | |||
| f664c2a763 | |||
| db805b35df | |||
| 1e500d56bf | |||
| 931294081c | |||
| 984e179c0e | |||
| db93fb0f14 | |||
| 90be0bae10 | |||
| a4cfa395a8 | |||
| 14828737ee | |||
| 406d17ff35 | |||
| ed268ff085 | |||
| 59b26ad36c | |||
| 698e977833 | |||
| 2d58fa3f55 | |||
| 67120bb5e7 | |||
| 97402aa919 | |||
| e57be1ac6e | |||
| 6ee4c7c269 | |||
| 70b11d037d | |||
| 9184adb2ab | |||
| 37aa54f1a1 | |||
| ab8e72e89c | |||
| 96371bd27d | |||
| cf2c83ff10 | |||
| e4e211a7a9 | |||
| 156a05bee3 | |||
| 57703965ae | |||
| 60f7d97194 | |||
| 8079b7c053 | |||
| 3be0515cf2 | |||
| 4dfa4d7249 | |||
| 47881b80da | |||
| 6217e1331a | |||
| 4b7c16fc9f | |||
| 21a85244b0 | |||
| 53cbfd5d8f | |||
| ea1a07dbfa | |||
| 8f3122ab74 | |||
| dfb99c80e5 | |||
| 1f97f644e9 | |||
| 20a9369f2f | |||
| 86baf80ac2 | |||
| 481c18d6ff | |||
| 233342e0e5 | |||
| 81f8bd4570 | |||
| c7c907e7ce | |||
| 37880ee9ec | |||
| f82680b53c | |||
| a5ed5599ce | |||
| 914ca9d865 | |||
| eb7488f670 | |||
| ec2445e0c8 | |||
| b9b36220da | |||
| 68c28187a8 | |||
| 240c6223fe | |||
| 0e824f8e8a | |||
| f565f3c893 | |||
| f0259d499d | |||
| 22a6669b1e | |||
| 71518e8e8c | |||
| 6f4a8ccb74 | |||
| 1ce2e2c3d4 | |||
| 5c06fdba92 | |||
| 67a683e6c4 | |||
| 38afc96e2c | |||
| f915a7c82e | |||
| 19d4bfe50a | |||
| 1ecea6b4af | |||
| a23a7204cf | |||
| 2f3f2157fb | |||
| 11c1dba91e | |||
| e7a0c793bb | |||
| 295f42007d | |||
| 71711b1008 | |||
| b05f6476f6 | |||
| 335f1dffc3 |
@@ -0,0 +1,8 @@
|
||||
/.*project
|
||||
/.settings
|
||||
/.autotools
|
||||
radio/src/bootloader/.dep/
|
||||
radio/src/bootloader/bootloader_ramBoot*
|
||||
*.lbm
|
||||
*.o
|
||||
/doc
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
Bertrand Songis
|
||||
Romolo Manfredini
|
||||
André Bernet
|
||||
Michael Blandford
|
||||
Rob Thomson
|
||||
Bryan J. Rentoul (aka Gruvin)
|
||||
Cameron Weeks
|
||||
Martin Hotař
|
||||
Andreas Weitl
|
||||
Kjell Kernen
|
||||
Gabriel Birkus
|
||||
Jean-Pierre Parisy
|
||||
Karl Szmutny
|
||||
Michal Hlavinka
|
||||
Pat Mackenzie
|
||||
Michael Byrne (logos and official splashes)
|
||||
Severino Anedda (splash screens)
|
||||
Grootwitbaas - 9xforums.com (mac)
|
||||
Adrian Amberg (splash screens)
|
||||
Wallaguest1 - 9xforums.com (splash screens)
|
||||
HC1969 - 9xforums.com (splash screens)
|
||||
|
||||
+642
@@ -0,0 +1,642 @@
|
||||
Mario Sette
|
||||
Felice Baratto
|
||||
Alessandro Mari
|
||||
Gianpiero Spontina
|
||||
Ingo Kuzniak
|
||||
Hans-Åke Rahm
|
||||
Tamas Varga
|
||||
Thomas Gregg
|
||||
Didier Christien
|
||||
Alain Pinard
|
||||
Sergio Melas
|
||||
Paul Montenot
|
||||
Chris Guy
|
||||
Adrien Gravouille
|
||||
Thomas Black
|
||||
Marc Lucht
|
||||
Michel Baily
|
||||
Zdenek Trojanek
|
||||
Martin Hotar
|
||||
[Devo] Stefan Grundevik
|
||||
[Devo] Fabio Eboli
|
||||
Federico Zotti
|
||||
Albin Esbjörnsson
|
||||
Kilian Hüttenhofer
|
||||
Stephen Stough
|
||||
Adilson Oliveira
|
||||
Robert Saint Marie
|
||||
Tad Leake
|
||||
Andreas Weitl
|
||||
Chan Lofland
|
||||
Dirk Kasten
|
||||
Denisov Alexander
|
||||
Timo Varppee
|
||||
Ondrej Hatapka
|
||||
Valérie Billon
|
||||
R. Scott Page
|
||||
Johan Cronje
|
||||
Renato Aranghelovici
|
||||
Jeffrey Irvin
|
||||
Aloft Hobbies
|
||||
John Rodgers
|
||||
Kenneth Crump
|
||||
Damjan Adamic
|
||||
Martin Wilson
|
||||
Joe Street
|
||||
John Holdsworth
|
||||
Daniel Schwartz
|
||||
Dean Church (monthly)
|
||||
Michael Halse
|
||||
David Mark
|
||||
Ted Moss
|
||||
Jim Wagner
|
||||
Nicola Porzi
|
||||
Michael Halse
|
||||
Chewytm
|
||||
Espen Solbu
|
||||
Mike Frizell
|
||||
Bruce Jones
|
||||
Stefano Airaghi
|
||||
Dan Eeckhout
|
||||
Alex Calderhead
|
||||
Leonard MacKey
|
||||
Heung Jin Choi
|
||||
Mike Retterer
|
||||
Keith Wood
|
||||
Viljo Liukku
|
||||
Eric Beier
|
||||
Burt Pickard-Richardson
|
||||
Helmut Renz
|
||||
Rick Harms
|
||||
Vincenzo Vavala
|
||||
Patricia Martin
|
||||
Harald Klein
|
||||
Carl Petersen
|
||||
Douglas Burkett
|
||||
Clifford Evans
|
||||
Teodor Yantchev
|
||||
Jarad Berkman
|
||||
Christian Schulz
|
||||
Gregory J Shepherd
|
||||
Michael Shellim
|
||||
Ming Wang
|
||||
R. Scott Page
|
||||
Bernard Lukaschek
|
||||
Nigel Chippindale
|
||||
Mike Perkins
|
||||
Ted Hammond
|
||||
David Beanland
|
||||
Bernd Koehler
|
||||
Frédéric Duflos
|
||||
Dave Fasken
|
||||
Heinrich Illig
|
||||
Michael Collins
|
||||
Michael Manning
|
||||
Craig Lorentz
|
||||
Jonathan Modellismo - jonathan.it
|
||||
André Lasseret
|
||||
Felipe Alexandre de Oliveira
|
||||
Brian Harris
|
||||
Philippe Herbots
|
||||
Rainer Nelte
|
||||
Franck Bernhard
|
||||
Erhard Werner
|
||||
Stig Jøran Moen
|
||||
Keith Hertzog
|
||||
Christophe Dauvergne
|
||||
Michel Baily
|
||||
Tauno Rautakorpi
|
||||
Sven Assmus
|
||||
Paul Dittman
|
||||
Mike Matheny
|
||||
Cheryl Wynne
|
||||
Emay Toha
|
||||
Don Nolder
|
||||
André Lasseret
|
||||
Filip Lowette
|
||||
Arnaldo Gabella
|
||||
Fiorenzo Agnelli
|
||||
Michele Villa
|
||||
Christophe Rodriguez
|
||||
Larisa Filocamo
|
||||
Hartmut Sahm
|
||||
Åke Brodin
|
||||
Aloft Hobbies - www.alofthobbies.com
|
||||
Ted Moss
|
||||
Filippos Tigarakis
|
||||
Chewytm
|
||||
Eric Burdis
|
||||
Nigel Chippindale
|
||||
Michael Deasy
|
||||
Stephen Stough
|
||||
Kenneth Lilja (monthly)
|
||||
Robert Jero
|
||||
Gary Bancroft
|
||||
Robert Cotsford
|
||||
NorthSide
|
||||
George Constandinides
|
||||
Robert Schonk Jr
|
||||
Kevin Berkefeld
|
||||
Peter Webster
|
||||
Mike Matheny
|
||||
Martin Sniedze
|
||||
Fernando Rimoldi
|
||||
Sidney Fisher
|
||||
Bruce Anderson
|
||||
John Rodgers
|
||||
Ed Pare
|
||||
Thomas Kilduff
|
||||
Robert Ferguson
|
||||
Bryan Green
|
||||
Kevin Berkefeld
|
||||
Julien Michel
|
||||
Krittikun Chiraphanda
|
||||
Douglas Law
|
||||
Alberto Scotti
|
||||
Oliver Kunkel
|
||||
D. Joseph Frazier
|
||||
Heiko Polig
|
||||
Andrew Fernie
|
||||
Marco Lange
|
||||
Nick McMillan
|
||||
Michel Baily (monthly)
|
||||
Patrick Mullen
|
||||
Scott Campbell
|
||||
Erich Roeder
|
||||
Wayne Davy
|
||||
Michael Fontenot
|
||||
Willie Swanepoel
|
||||
Satoru Sasaki
|
||||
Tyler Darby
|
||||
Nicholas Crego
|
||||
Keith Hertzog
|
||||
Johan Moelich
|
||||
Timo Esser
|
||||
Dean Church (monthly)
|
||||
Brian Paddock (monthly)
|
||||
Jean Pierre Parisy
|
||||
Norbert Martsch
|
||||
Jean-Marie Guitard
|
||||
Mike Perkins
|
||||
Tilman Baumann (monthly)
|
||||
Fred Larssen
|
||||
Ari Aalto
|
||||
Robert Sams
|
||||
Kirk Robertson
|
||||
John Koontz
|
||||
Jeffery Golias
|
||||
Paul Robinson
|
||||
Dave Matison
|
||||
Mike Matheny
|
||||
Pino Agostino
|
||||
Graham Boucher (monthly)
|
||||
Nelson Noura
|
||||
Joel Allamy
|
||||
Philip David Martin
|
||||
Sean Stephen
|
||||
Bruce Mackay
|
||||
Blake Spilman
|
||||
Timothy Pelletier
|
||||
Glen Roe (ShowMaster)
|
||||
Jan Van Ooteghem
|
||||
David Ankers - Special thanks here to the OpenPilot project!
|
||||
Lawrence Christensen (monthly)
|
||||
Leo Duflou
|
||||
Bruce Wood
|
||||
Arnd Feige
|
||||
Tauno Rautakorpi
|
||||
Steve Coley
|
||||
Stefan Kiendl
|
||||
Gregory Nuspel
|
||||
Mitchell Brenner
|
||||
Ronnnie DePrez
|
||||
Ferenc Koller
|
||||
Robert Sessler
|
||||
Didier Lanot
|
||||
Rodney Hunt
|
||||
Steve Bernard
|
||||
Paul Nazaroff
|
||||
Gordon Ernenputsch
|
||||
Ksamak
|
||||
Marc Gittelman
|
||||
David Poole
|
||||
Ralph Sauer
|
||||
Karl-Heinz Gansel
|
||||
Michels Bernhard
|
||||
Thomas Demmelbauer
|
||||
Felice Baratto
|
||||
Michael Halse
|
||||
Horst Kampen
|
||||
Ian Gough
|
||||
Matthew Brett
|
||||
Lexington S Morley
|
||||
Clemens Drews
|
||||
Axel Stöckle
|
||||
Roberto Orsello
|
||||
Richard Ruck
|
||||
Hugh Caldwell
|
||||
Christian Marauli
|
||||
Albin Esbjörnsson
|
||||
Per Esbjörnsson
|
||||
Bernd Hohmann
|
||||
Sławomir Juszczak
|
||||
Stephen Henderson
|
||||
David Morgan
|
||||
Aloft Hobbies
|
||||
Netanel Hobara
|
||||
Cameron Galipo
|
||||
Doug Schafer
|
||||
Pietro Rossin
|
||||
Earl Killingsworth
|
||||
Victor B Wright
|
||||
Terry McKinley
|
||||
Марков Алексей
|
||||
Offer Shmuely
|
||||
Ian Lobley
|
||||
Keith Hertzog
|
||||
Stéphane Fortas
|
||||
Peter Mitrik
|
||||
Thomas Majewski
|
||||
ANF King
|
||||
Henrik Hammarström
|
||||
Kenneth Lilja (monthly)
|
||||
R Wells
|
||||
Uwe Jordt
|
||||
Harald Wilczak
|
||||
Bernhard Lohmann
|
||||
Ferenc Koller
|
||||
Robert Ferguson
|
||||
Daniel Byers
|
||||
Tyler Darby
|
||||
Miguel Villalpando
|
||||
Kim Dong Hoon
|
||||
Terry McKinley
|
||||
Walter Bell
|
||||
wsTech - http://wstech.de
|
||||
Clinton Linck
|
||||
Josep Clodas Sola
|
||||
Thierry Martin
|
||||
Peter Mauro
|
||||
Mitchell Brenner
|
||||
Yak
|
||||
Lluis Bullich Rañe
|
||||
Steffen Rohr
|
||||
Eric Jacquin
|
||||
Harvest Lane
|
||||
Ville Kuvaja
|
||||
DK-System
|
||||
Heinz Vogel
|
||||
Heung Jin Choi
|
||||
MMJS van der Helm
|
||||
Dan Neelands
|
||||
Yashiro Masayuki
|
||||
Isaac Sloan
|
||||
Harold Baird
|
||||
Roy Bender
|
||||
Bradley Murchie
|
||||
Maximilian Süß
|
||||
Dean Jansa
|
||||
Ronald Donker
|
||||
Paul Oldenkamp
|
||||
Dietmar Drees
|
||||
Bradley Murchie
|
||||
Richard Fahie
|
||||
James Kaufman
|
||||
Henry Deucker
|
||||
Christian Fuchs
|
||||
Arold Reinders
|
||||
Robert Miller
|
||||
Aviomotive - www.aviomotive.com
|
||||
Mark Gaskievicz
|
||||
Roland Müller
|
||||
Frank Gewalt
|
||||
Remi Viard
|
||||
Reginald H Millsom
|
||||
Pierluigi Sommaruga
|
||||
A Harris
|
||||
Stefan Grunenberg
|
||||
Francisco Gutierrez Muñoz
|
||||
Steve Coley
|
||||
Sean Cull
|
||||
Roberto Orsello
|
||||
David Finger
|
||||
FrSky - www.frsky-rc.com (monthly)
|
||||
Jean-Marie Oddo
|
||||
Mike Matheny
|
||||
Glen Roe (Showmaster)
|
||||
Arron Bates
|
||||
Tim Spurr
|
||||
Daniel Morgan
|
||||
Trent Ready
|
||||
Mark Maskiell
|
||||
Robert Crockford
|
||||
Mark Illum
|
||||
David McGuire
|
||||
Martyn Coles
|
||||
Jose Sobral
|
||||
Heung Jin Choi
|
||||
Tomasz Janiak
|
||||
Fabien Gagné
|
||||
Joe Street
|
||||
Micha Ronen
|
||||
Albert Blondin
|
||||
Klaus Schuebel
|
||||
Evening Shade Pottery
|
||||
Thomas Kilduff
|
||||
Sven Assmus
|
||||
Markus Eberl
|
||||
Nicholas Field
|
||||
Harald Wilczak
|
||||
Michel Baily
|
||||
John Grepps
|
||||
Anthony Burbidge
|
||||
Sherba Baine
|
||||
Gordon Evans
|
||||
Fred Figge
|
||||
Uwe Kuehn
|
||||
David Beatty
|
||||
Aaron Stringer
|
||||
Alan J Wasserman
|
||||
Wolfgang Rauser
|
||||
Samuel Cook
|
||||
BoltRC - www.boltrc.com
|
||||
Friedrich Ipolt
|
||||
Barrington Cole
|
||||
Charles Lakins
|
||||
Thos. O'Meara Photography
|
||||
Adam Chevalier
|
||||
Mike Mulligan
|
||||
Serge Michaux
|
||||
Robert Young
|
||||
Wilco Hijink
|
||||
Roy Nixon
|
||||
Lexington S Morley
|
||||
Daryl Dacko
|
||||
Beat Zurflueh
|
||||
Piotr Kundu
|
||||
Kevin Berkefeld
|
||||
Tomasz Klys
|
||||
Mirco Didone'
|
||||
Christoph Schroeter
|
||||
Zdenek Trojanek
|
||||
Bryan Anderson
|
||||
Kamco Enterprises
|
||||
Robert Bates
|
||||
Robert Brown
|
||||
Dennis Marinus
|
||||
Ronald Van Putte
|
||||
Thomas Kvitle Jenssen
|
||||
Patrick Tuxbury
|
||||
Istvan Magi
|
||||
Sasaki Satoru
|
||||
David Laburthe
|
||||
Vit Jelinek
|
||||
Pablo Gomez Martinez
|
||||
Alan Thoren
|
||||
Jack Clodfelter
|
||||
William Simon
|
||||
James Houck
|
||||
Peter Fithern
|
||||
Thomas Svedman
|
||||
TechFixPros
|
||||
Rafael Eric Suarez Nordlow
|
||||
Colin Rycroft
|
||||
Emanuel Stassar
|
||||
Michael Gregory
|
||||
Robert Russell
|
||||
Gordon Stahl
|
||||
Felix Kaiser
|
||||
Joshua Bardwell
|
||||
Davd Goodall
|
||||
Leonard MacKey
|
||||
Miles Kelly
|
||||
Sergio Robledo
|
||||
Mikael Wallbäck
|
||||
Daniel Malcman
|
||||
Paul Dittman
|
||||
Attilio Rausse
|
||||
Sidney Gates
|
||||
Andrea Montefusco
|
||||
Paul Luby
|
||||
Donald L Webster
|
||||
Kenneth Frehafer
|
||||
Peter McHenry
|
||||
Matthias Hase
|
||||
Markus Wolf
|
||||
Andrew Fazio
|
||||
Stefan Künst
|
||||
Stephen Adams
|
||||
Arold Reinders
|
||||
Tauno Rautakorpi
|
||||
Frank Houvenaghel
|
||||
Aerial Tech Hobbies - www.aerialtechhobbies.com
|
||||
George Neusse
|
||||
Andreja Rusjakovski
|
||||
Axel Stöckle
|
||||
Mike Perkins
|
||||
Erwin Störrle
|
||||
Rodger Hopper
|
||||
Fernando Cesar
|
||||
Jonathan Gillis
|
||||
DK-System
|
||||
Lexington S Morley
|
||||
Bernd Koehler
|
||||
Davis RC
|
||||
Pete Johnson
|
||||
Patricia Martin
|
||||
Florian Tschacher
|
||||
Brian Spearing
|
||||
Craig Hall
|
||||
Joseph Case
|
||||
Harald Klein
|
||||
Robert Crockford
|
||||
Chris Boultinghouse
|
||||
Kitsew
|
||||
Georgios Papadopoulos
|
||||
Fourmost Products
|
||||
Dennis Miller
|
||||
Dave Matison
|
||||
Maximilian Radig
|
||||
Juan Rodriguez
|
||||
Robert Sessler
|
||||
John Murray
|
||||
Martin Sniedze
|
||||
David Poole
|
||||
Manfred Delakowitz
|
||||
Martijn Kruissen
|
||||
Jörgen Norman
|
||||
Nathan Kinney
|
||||
John Godden
|
||||
Larry Roper
|
||||
Mike Frizell
|
||||
Daniel Pospolita
|
||||
Peter Herz
|
||||
Don Mondrik
|
||||
Paul Fram
|
||||
Charles Knight
|
||||
Matthew Adams
|
||||
Kenneth Reed
|
||||
Gary Wild
|
||||
Christof Ramm
|
||||
Bruno Bedard
|
||||
Salih Samim Aydin
|
||||
Alexander Pils
|
||||
Andrew Scerbina
|
||||
Donovan Bodishbaugh
|
||||
Ray Dunn
|
||||
Burt Pickard-Richardson
|
||||
Robert Ferguson
|
||||
CY Enterprise
|
||||
Michel Stathakis Neto
|
||||
Beat Zurflueh
|
||||
Heinrich Illig
|
||||
Portstate Pty Ltd
|
||||
Jens Hoffmann
|
||||
Ricardo Santos
|
||||
Jean-Francois Le Breton
|
||||
Michael Deasy
|
||||
Anindya Mukerjee
|
||||
Emay Toha
|
||||
Kamco Enterprises
|
||||
Peter Mueller
|
||||
Giovanni Trentini
|
||||
Cecil Porter
|
||||
Robert Canavan
|
||||
Greg Higginbottom
|
||||
Tim Walker
|
||||
Thos. O'Meara Photography
|
||||
Spis Ltd/TurboNote
|
||||
Patricia Cox
|
||||
Matthew Lukes
|
||||
Sabine Witte
|
||||
Phillip Perry
|
||||
Beat Zurflueh
|
||||
Russell Stutzman
|
||||
Dietmar Drees
|
||||
Kenneth Ward
|
||||
Jens Lochmüller
|
||||
Anthony Witham
|
||||
Peter Hauke
|
||||
Arizona Action Photos
|
||||
Francis F Dale
|
||||
Willie Swanepoel
|
||||
Edward Hauser
|
||||
Adilson Oliveira
|
||||
Joseph Ordille
|
||||
Michael Shellim
|
||||
Teddie Holmes
|
||||
Alexandre Rault
|
||||
Eric Albin
|
||||
Lukas Kliment
|
||||
Bernard Philippe
|
||||
Bernard Delpy
|
||||
Didier Klein
|
||||
Arnaldo Guedes
|
||||
Cyberauto Systems
|
||||
John Alsbrooks
|
||||
John Kearney
|
||||
Christopher Borden
|
||||
Marc Virgilio Ricci
|
||||
Frederick Davie
|
||||
Jürgen Enders
|
||||
Terrence Pitts
|
||||
Thomas Sandner
|
||||
Marco Coltorti
|
||||
Harald Wilczak
|
||||
Rodney Lorimor
|
||||
Richard Davis
|
||||
Stephen Palmer
|
||||
Michael Napolitan
|
||||
Joshua Bardwell
|
||||
Fred Dawson
|
||||
Jim Wagner
|
||||
Peter Johnson
|
||||
Fredrik Lewerth
|
||||
Arvin Stenersen
|
||||
Daniel Morgan
|
||||
Roy Nixon
|
||||
Joachim Blunck
|
||||
Karl-Heinz Gansel
|
||||
Monrovia Mountain Enterprises
|
||||
Alessandro Villa
|
||||
Jan-Åke Nilsson
|
||||
Matthias Rei
|
||||
DVR Solutions BV
|
||||
Bertrand Condevaux Lanloy
|
||||
Henri Mirra
|
||||
Aurélien Planiol
|
||||
Kevin Caldwell
|
||||
Andrew Garello
|
||||
Tomasz Maziarz
|
||||
Russell Flack
|
||||
Fernando Rimoldi
|
||||
Greg Reid
|
||||
Dietmar Drees
|
||||
Holger Landwehr
|
||||
Arno Loehdorf
|
||||
Boon Sripattha
|
||||
Patrik Åkerfeldt
|
||||
Alonzo Fretwell
|
||||
Renjith Chandrasekharan
|
||||
Ruben Gomez Hernandez
|
||||
Michael Gardner
|
||||
Judith Green
|
||||
Timo Ruppell
|
||||
John Lipscomb
|
||||
Norbert Wenke
|
||||
Erik Frieberg
|
||||
Raimo Ruotsalainen
|
||||
Brian Harris
|
||||
Sebastian Blüml
|
||||
Efisio Maxia
|
||||
Jeff Theobald
|
||||
Anthony Rizzo
|
||||
Rodney Huddleston
|
||||
Dietmar Drees
|
||||
Jürgen Monden
|
||||
David Morgan
|
||||
Andrew Fernie
|
||||
Michel Baily
|
||||
Donald Burke
|
||||
Ronald Donker
|
||||
Fredie Singh
|
||||
Patrizio Simoncini (monthly)
|
||||
Harald Gabler
|
||||
Michael Brown
|
||||
Julien Gérard
|
||||
Alexandre d'Alton
|
||||
Peter Mergaerts
|
||||
Jan Houwers
|
||||
Gordon Stahl
|
||||
Christian Grandjean
|
||||
Roger Bergevin
|
||||
NorthSide
|
||||
Sigmund Martinsen
|
||||
Lionel Lafraise
|
||||
Gisli Ofeigsson
|
||||
The Gruvin9x Project
|
||||
Manuel McLure
|
||||
Fernando Rimoldi
|
||||
Hiltenkamp Stephan
|
||||
Sandeep Kishore Jain
|
||||
Sebastien Charpentier
|
||||
Greg Parker
|
||||
Norman Maaß
|
||||
Adriano Del Ben
|
||||
Justin Poole
|
||||
Kenneth Harrison
|
||||
Eugene LaFaille
|
||||
John O'Shaughnessy
|
||||
Uwe Jordt
|
||||
Stuart Olson
|
||||
Frédéric Devillard
|
||||
Cheung Leo
|
||||
Peter Webster
|
||||
Jean-Claude Bachetta
|
||||
Delfin Perena
|
||||
Sae-wook Yoon
|
||||
Focus on Excellence
|
||||
Jeffery Golias
|
||||
Nick Milton
|
||||
Paul Zasso
|
||||
Reidar Johannes Lillebotn
|
||||
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,7 @@
|
||||
##OpenTX Master Branch
|
||||
|
||||
You have found your way to the GitHub repository site for the OpenTX Master Branch. This code branch holds the source code for the latest stable release.
|
||||
|
||||
The ongoing development is not done in this branch. It is performed in the branch called next.
|
||||
|
||||
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
|
||||
@@ -1,5 +0,0 @@
|
||||
TODO list (no particular order)
|
||||
|
||||
- DSM2 channel order (Cam)
|
||||
- Variometer (rate as cm/sec)
|
||||
- Trace telemetry data
|
||||
@@ -1,206 +0,0 @@
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
#define TWI_CMD_PAGEUPDATE 0x01 // TWI Command to program a flash page
|
||||
#define TWI_CMD_EXECUTEAPP 0x02 // TWI Command to jump to the application program
|
||||
#define TWI_CMD_SETREAD_ADDRESS 0x03 // TWI Command to set address to read from
|
||||
#define TWI_CMD_WRITE_DATA 0x04 // TWI Command send data to the application
|
||||
|
||||
#define TWI_CMD_REBOOT 0x55 // TWI Command to restart back in the bootloader
|
||||
|
||||
#define TWI_SUBCMD_SETDATETIME 0x74 // TWI Command to set the date and time
|
||||
//#define TWI_CMD_BVERSION 0x04 // TWI Command to get the bootloader revision identifier
|
||||
//#define TWI_CMD_ERASEFLASH 0x05 // TWI Command to erase the entire application section of flash memory
|
||||
//#define TWI_CMD_GETERRCONDN 0x07 // TWI Command to get Error condition
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
//#define BOOT_SETTLE_DELAY 100 // Debounce delay for the boot pin in MCU cycles
|
||||
//#define SLAVE_ADDRESS 0xb0 // The address identifier of this slave device on the TWI (I2C) bus
|
||||
#define INTVECT_PAGE_ADDRESS 0x000 // The location of the start of the interrupt vector table address
|
||||
|
||||
|
||||
|
||||
// Select the communcation interfacing type: TWI or USI
|
||||
/*#if defined(__ATTINY25__) | defined(__ATTINY25V__) | \
|
||||
defined(__ATTINY45__) | defined(__ATTINY45V__) | \
|
||||
defined(__ATTINY85__) | defined(__ATTINY85V__) | \
|
||||
defined(__ATTINY24__) | defined(__ATTINY24A__) | \
|
||||
defined(__ATTINY44__) | defined(__ATTINY44A__) | \
|
||||
defined(__ATTINY84__) | defined(__ATTINY84A__) | \
|
||||
defined(__ATTINY2313__) | defined(__ATTINY2313A__) | \
|
||||
defined(__ATTINY4313__) | defined(__ATTINY4313A__) | \
|
||||
defined(__ATTINY261__) | defined(__ATTINY261A__) | \
|
||||
defined(__ATTINY461__) | defined(__ATTINY461A__) | \
|
||||
defined(__ATTINY861__) | defined(__ATTINY861A__) | \
|
||||
defined(__ATTINY43U__) | \
|
||||
defined(__ATTINY87__) | \
|
||||
defined(__ATTINY167__)
|
||||
#define __USI__ // set the communication type as USI
|
||||
#endif */
|
||||
|
||||
#define __USI__ // set the communication type as USI
|
||||
|
||||
|
||||
/*#if defined(__ATTINY48__) | defined(__ATTINY88__) | \
|
||||
defined(__ATMEGA48A__) | defined(__ATMEGA48PA__) | \
|
||||
defined(__ATMEGA48__)
|
||||
#define __TWI__
|
||||
#endif */
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
// Page size selection for the controller with 2K flash
|
||||
/*#if defined(__ATTINY25__) | defined(__ATTINY25V__) | \
|
||||
defined(__ATTINY24__) | defined(__ATTINY24A__) | \
|
||||
defined(__ATTINY2313__) | defined(__ATTINY2313A__) | \
|
||||
defined(__ATTINY261__) | defined(__ATTINY261A__)
|
||||
|
||||
// The flash memory page size for these devices
|
||||
#define PAGE_SIZE 32
|
||||
|
||||
// Page 32, the start of bootloader section
|
||||
#define BOOT_PAGE_ADDRESS 0X0400
|
||||
|
||||
// 2KB of flash divided by pages of size 32 bytes
|
||||
#define TOTAL_NO_OF_PAGES 64
|
||||
|
||||
// The number of pages being used for bootloader code
|
||||
#define BOOTLOADER_PAGES (TOTAL_NO_OF_PAGES - BOOT_PAGE_ADDRESS/PAGE_SIZE)
|
||||
|
||||
// For bounds check during page write/erase operation to protect the bootloader code from being corrupted
|
||||
#define LAST_PAGE_NO_TO_BE_ERASED (TOTAL_NO_OF_PAGES - BOOTLOADER_PAGES)
|
||||
#endif */
|
||||
|
||||
// Page size selection for the controller with 4K flash
|
||||
|
||||
/*#if defined(__ATTINY45__) | defined(__ATTINY45V__) | \
|
||||
defined(__ATTINY44__) | defined(__ATTINY44A__) | \
|
||||
defined(__ATTINY4313__) | defined(__ATTINY4313A__) | \
|
||||
defined(__ATTINY461__) | defined(__ATTINY461A__) | \
|
||||
defined(__ATTINY43U__) | \
|
||||
defined(__ATTINY48__) | \
|
||||
defined(__ATMEGA48__) | \
|
||||
defined(__ATMEGA48A__) | defined(__ATMEGA48PA__)
|
||||
|
||||
// The flash memory page size for these devices
|
||||
#define PAGE_SIZE 64
|
||||
|
||||
// Page 48, the start of bootloader section
|
||||
#define BOOT_PAGE_ADDRESS 0X0C00
|
||||
|
||||
// 4KB of flash divided by pages of size 64 bytes
|
||||
#define TOTAL_NO_OF_PAGES 64
|
||||
|
||||
// The number of pages being used for bootloader code
|
||||
#define BOOTLOADER_PAGES (TOTAL_NO_OF_PAGES - BOOT_PAGE_ADDRESS/PAGE_SIZE)
|
||||
|
||||
// For bounds check during page write/erase operation to protect the bootloader code from being corrupted
|
||||
#define LAST_PAGE_NO_TO_BE_ERASED (TOTAL_NO_OF_PAGES - BOOTLOADER_PAGES)
|
||||
#endif */
|
||||
|
||||
|
||||
// Page size selection for the controller with 8K flash
|
||||
/*#if defined(__ATTINY85__) | defined(__ATTINY85V__) | \
|
||||
defined(__ATTINY84__) | defined(__ATTINY84A__) | \
|
||||
defined(__ATTINY861__) | defined(__ATTINY861A__) | \
|
||||
defined(__ATTINY87__) | \
|
||||
defined(__ATTINY88__)
|
||||
|
||||
// The flash memory page size for these devices
|
||||
#define PAGE_SIZE 64
|
||||
|
||||
// Page 112, the start of bootloader section
|
||||
#define BOOT_PAGE_ADDRESS 0X1C00
|
||||
|
||||
// 8KB of flash divided by pages of size 64 bytes
|
||||
#define TOTAL_NO_OF_PAGES 128
|
||||
|
||||
// The number of pages being used for bootloader code
|
||||
#define BOOTLOADER_PAGES (TOTAL_NO_OF_PAGES - BOOT_PAGE_ADDRESS/PAGE_SIZE)
|
||||
|
||||
// // For bounds check during page write/erase operation to protect the bootloader code from being corrupted
|
||||
// #define LAST_PAGE_NO_TO_BE_ERASED (TOTAL_NO_OF_PAGES - BOOTLOADER_PAGES)
|
||||
//#endif*/
|
||||
|
||||
// Page size selection for the controller with 16K flash
|
||||
//#if defined(__ATTINY167__)
|
||||
|
||||
// The flash memory page size for Atiny167
|
||||
#define PAGE_SIZE 128
|
||||
|
||||
// Page 120, the start of bootloader section
|
||||
#define BOOT_PAGE_ADDRESS 0X3800
|
||||
|
||||
// 16KB of flash divided by pages of size 128 bytes
|
||||
#define TOTAL_NO_OF_PAGES 128
|
||||
|
||||
// The number of pages being used for bootloader code
|
||||
#define BOOTLOADER_PAGES (TOTAL_NO_OF_PAGES - BOOT_PAGE_ADDRESS/PAGE_SIZE)
|
||||
|
||||
// For bounds check during page write/erase operation to protect the bootloader code from being corrupted
|
||||
#define LAST_PAGE_NO_TO_BE_ERASED (TOTAL_NO_OF_PAGES - BOOTLOADER_PAGES)
|
||||
|
||||
//#endif
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
// Select the correct Bit name of to SELFPROGRAMming
|
||||
/*#if defined(__ATTINY48__) | defined(__ATTINY48A__) | \
|
||||
defined(__ATTINY88__) | defined(__ATTINY88A__) | \
|
||||
defined(__ATMEGA48__) | \
|
||||
defined(__ATMEGA48A__) | defined(__ATMEGA48PA__)
|
||||
|
||||
#define SELFPROGEN SELFPRGEN
|
||||
|
||||
#endif */
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*#if defined(__ATTINY25__) | defined(__ATTINY25V__) | \
|
||||
defined(__ATTINY45__) | defined(__ATTINY45V__) | \
|
||||
defined(__ATTINY85__) | defined(__ATTINY85V__) | \
|
||||
defined(__ATTINY87__) | defined(__ATTINY167__) */
|
||||
|
||||
#define SELFPROGEN SPMEN
|
||||
|
||||
//#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
#define WDT_TIMEOUT_8s ( _BV( WDP3 ) | _BV( WDP0 ) ) // Watchdog timeout for inactivity in the boot section
|
||||
#define WDT_TIMEOUT_16ms 0 // Watchdog timeout for system reset (cleanup) before jump to application
|
||||
#define WDT_TIMEOUT_min WDT_TIMEOUT_16ms // The minimum watchdog reset time interval for jump to application
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define STATUSMASK_SPMBUSY 0x01 // The mask bit for SPM busy status code
|
||||
#define STATUSMASK_BLSCERR 0x02 // The mask bit for attempt to override bootloader section
|
||||
#define STATUSMASK_TWIABORT 0x04 // The mask bit for indicating TWI abort fn called
|
||||
#define STATUSMASK_SLTR_BUSY 0x08 // The mask bit for slave transmit
|
||||
#define STATUSMASK_SLRBAA_BUSY 0x10 // The mask bit for slave receive and ack
|
||||
#define STATUSMASK_SLRBAN_BUSY 0x20 // The mask bit for slave receive and Nack
|
||||
#define STATUSMASK_EEPROM_BUSY 0x40 // The mask bit for EEPROM busy
|
||||
#define STATUSMASK_BOOTLOADER 0x80 // The mask bit for bootloader operations
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define EEMEM_ADDR_AVERSION 0x05 // The address in EEPROM where application revision identifier will be stored
|
||||
#define BVERSION 0x96 // This bootloader revision identifier
|
||||
|
||||
|
||||
//static void UpdatePage (uint16_t);
|
||||
|
||||
#ifndef _BV
|
||||
#define _BV( __BIT_POSITION__ ) ( 1 << __BIT_POSITION__ )
|
||||
#endif
|
||||
|
||||
//#ifdef _BV
|
||||
//#warning _BV now stands defined
|
||||
//#endif
|
||||
@@ -1,624 +0,0 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#----------------------------------------------------------------------------
|
||||
# WinAVR Makefile
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF.
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude.
|
||||
# Please customize the avrdude settings below first!
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
#
|
||||
# make filename.i = Create a preprocessed source file for use in submitting
|
||||
# bug reports to the GCC project.
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = attiny167
|
||||
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
# Typical values are:
|
||||
# F_CPU = 1000000
|
||||
# F_CPU = 1843200
|
||||
# F_CPU = 2000000
|
||||
# F_CPU = 3686400
|
||||
# F_CPU = 4000000
|
||||
# F_CPU = 7372800
|
||||
# F_CPU = 8000000
|
||||
# F_CPU = 11059200
|
||||
# F_CPU = 14745600
|
||||
# F_CPU = 16000000
|
||||
# F_CPU = 18432000
|
||||
# F_CPU = 20000000
|
||||
F_CPU = 8000000
|
||||
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = TinyApp
|
||||
|
||||
|
||||
# Object files directory
|
||||
# To put object files in current directory, use a dot (.), do NOT make
|
||||
# this an empty or blank macro!
|
||||
OBJDIR = .
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
SRC = $(TARGET).c
|
||||
|
||||
|
||||
# List C++ source files here. (C dependencies are automatically generated.)
|
||||
CPPSRC =
|
||||
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
|
||||
# Debugging format.
|
||||
# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
|
||||
# AVR Studio 4.10 requires dwarf-2.
|
||||
# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
|
||||
#DEBUG = stabs
|
||||
DEBUG = dwarf-2
|
||||
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
# Use forward slashes for directory separators.
|
||||
# For a directory that has spaces, enclose it in quotes.
|
||||
EXTRAINCDIRS = c:\progs\iccv7avr\include
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 = "ANSI" C
|
||||
# gnu89 = c89 plus GCC extensions
|
||||
# c99 = ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 = c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
|
||||
# Place -D or -U options here for C sources
|
||||
CDEFS = -DF_CPU=$(F_CPU)UL
|
||||
|
||||
|
||||
# Place -D or -U options here for ASM sources
|
||||
ADEFS = -DF_CPU=$(F_CPU)
|
||||
|
||||
|
||||
# Place -D or -U options here for C++ sources
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
|
||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
|
||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
|
||||
|
||||
|
||||
|
||||
#---------------- Compiler Options C ----------------
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g$(DEBUG)
|
||||
CFLAGS += $(CDEFS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char
|
||||
CFLAGS += -funsigned-bitfields
|
||||
CFLAGS += -fpack-struct
|
||||
CFLAGS += -fshort-enums
|
||||
CFLAGS += -Wall
|
||||
CFLAGS += -Wno-main
|
||||
CFLAGS += -Wstrict-prototypes
|
||||
#CFLAGS += -mshort-calls
|
||||
#CFLAGS += -fno-unit-at-a-time
|
||||
#CFLAGS += -Wundef
|
||||
#CFLAGS += -Wunreachable-code
|
||||
#CFLAGS += -Wsign-compare
|
||||
CFLAGS += -Wa,-adlns=$(<:%.c=$(OBJDIR)/%.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
# Next line dumps rtl file
|
||||
#CFLAGS += -dr
|
||||
#CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
|
||||
|
||||
|
||||
#---------------- Compiler Options C++ ----------------
|
||||
# -g*: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CPPFLAGS = -g$(DEBUG)
|
||||
CPPFLAGS += $(CPPDEFS)
|
||||
CPPFLAGS += -O$(OPT)
|
||||
CPPFLAGS += -funsigned-char
|
||||
CPPFLAGS += -funsigned-bitfields
|
||||
CPPFLAGS += -fpack-struct
|
||||
CPPFLAGS += -fshort-enums
|
||||
CPPFLAGS += -fno-exceptions
|
||||
CPPFLAGS += -Wall
|
||||
CFLAGS += -Wundef
|
||||
#CPPFLAGS += -mshort-calls
|
||||
#CPPFLAGS += -fno-unit-at-a-time
|
||||
#CPPFLAGS += -Wstrict-prototypes
|
||||
#CPPFLAGS += -Wunreachable-code
|
||||
#CPPFLAGS += -Wsign-compare
|
||||
CPPFLAGS += -Wa,-adlns=$(<:%.cpp=$(OBJDIR)/%.lst)
|
||||
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
#CPPFLAGS += $(CSTANDARD)
|
||||
#CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
|
||||
|
||||
|
||||
#---------------- Assembler Options ----------------
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
# -listing-cont-lines: Sets the maximum number of continuation lines of hex
|
||||
# dump that will be displayed for a given single line of source input.
|
||||
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
|
||||
|
||||
|
||||
#---------------- Library Options ----------------
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
# If this is left blank, then it will use the Standard printf version.
|
||||
PRINTF_LIB =
|
||||
#PRINTF_LIB = $(PRINTF_LIB_MIN)
|
||||
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
|
||||
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
# If this is left blank, then it will use the Standard scanf version.
|
||||
SCANF_LIB =
|
||||
#SCANF_LIB = $(SCANF_LIB_MIN)
|
||||
#SCANF_LIB = $(SCANF_LIB_FLOAT)
|
||||
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
|
||||
# List any extra directories to look for libraries here.
|
||||
# Each directory must be seperated by a space.
|
||||
# Use forward slashes for directory separators.
|
||||
# For a directory that has spaces, enclose it in quotes.
|
||||
EXTRALIBDIRS =
|
||||
|
||||
|
||||
|
||||
#---------------- External Memory Options ----------------
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
|
||||
|
||||
#---------------- Linker Options ----------------
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
LDFLAGS += -Wl,--section-start=.text=0x00D0
|
||||
LDFLAGS += -Wl,--section-start=.vectors=0x0080
|
||||
LDFLAGS += -T avr3-167.ld
|
||||
LDFLAGS += -N
|
||||
|
||||
|
||||
|
||||
#---------------- Programming Options (avrdude) ----------------
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
AVRDUDE_PROGRAMMER = stk500
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = com3
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
#---------------- Debugging Options ----------------
|
||||
|
||||
# For simulavr only - target MCU frequency.
|
||||
DEBUG_MFREQ = $(F_CPU)
|
||||
|
||||
# Set the DEBUG_UI to either gdb or insight.
|
||||
# DEBUG_UI = gdb
|
||||
DEBUG_UI = insight
|
||||
|
||||
# Set the debugging back-end to either avarice, simulavr.
|
||||
DEBUG_BACKEND = avarice
|
||||
#DEBUG_BACKEND = simulavr
|
||||
|
||||
# GDB Init Filename.
|
||||
GDBINIT_FILE = __avr_gdbinit
|
||||
|
||||
# When using avarice settings for the JTAG
|
||||
JTAG_DEV = /dev/com1
|
||||
|
||||
# Debugging port used to communicate between GDB / avarice / simulavr.
|
||||
DEBUG_PORT = 4242
|
||||
|
||||
# Debugging host used to communicate between GDB / avarice / simulavr, normally
|
||||
# just set to localhost unless doing some sort of crazy debugging when
|
||||
# avarice is running on a different computer.
|
||||
DEBUG_HOST = localhost
|
||||
|
||||
|
||||
|
||||
#============================================================================
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = avr-gcc
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJDUMP = avr-objdump
|
||||
SIZE = avr-size
|
||||
AR = avr-ar rcs
|
||||
NM = avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
REMOVEDIR = rm -rf
|
||||
COPY = cp
|
||||
WINSHELL = cmd
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling C:
|
||||
MSG_COMPILING_CPP = Compiling C++:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
MSG_CREATING_LIBRARY = Creating library:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
|
||||
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
all: begin gccversion sizebefore build sizeafter end
|
||||
|
||||
# Change the build target to build a HEX file or a library.
|
||||
build: elf hex eep lss sym bin
|
||||
#build: lib
|
||||
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
bin: $(TARGET).bin
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
LIBNAME=lib$(TARGET).a
|
||||
lib: $(LIBNAME)
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
|
||||
|
||||
sizebefore:
|
||||
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
|
||||
2>/dev/null; echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
|
||||
2>/dev/null; echo; fi
|
||||
|
||||
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
# Generate avr-gdb config/init file which does the following:
|
||||
# define the reset signal, load the target file, connect to target, and set
|
||||
# a breakpoint at main().
|
||||
gdb-config:
|
||||
@$(REMOVE) $(GDBINIT_FILE)
|
||||
@echo define reset >> $(GDBINIT_FILE)
|
||||
@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
|
||||
@echo end >> $(GDBINIT_FILE)
|
||||
@echo file $(TARGET).elf >> $(GDBINIT_FILE)
|
||||
@echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
|
||||
ifeq ($(DEBUG_BACKEND),simulavr)
|
||||
@echo load >> $(GDBINIT_FILE)
|
||||
endif
|
||||
@echo break main >> $(GDBINIT_FILE)
|
||||
|
||||
debug: gdb-config $(TARGET).elf
|
||||
ifeq ($(DEBUG_BACKEND), avarice)
|
||||
@echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
|
||||
@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
|
||||
$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
|
||||
@$(WINSHELL) /c pause
|
||||
|
||||
else
|
||||
@$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
|
||||
$(DEBUG_MFREQ) --port $(DEBUG_PORT)
|
||||
endif
|
||||
@$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT = $(OBJCOPY) --debugging
|
||||
COFFCONVERT += --change-section-address .data-0x800000
|
||||
COFFCONVERT += --change-section-address .bss-0x800000
|
||||
COFFCONVERT += --change-section-address .noinit-0x800000
|
||||
COFFCONVERT += --change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.bin: %.elf
|
||||
$(OBJCOPY) -O binary $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Create library from object files.
|
||||
.SECONDARY : $(TARGET).a
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.a: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_CREATING_LIBRARY) $@
|
||||
$(AR) $@ $(OBJ)
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
$(OBJDIR)/%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create object files from C++ source files.
|
||||
$(OBJDIR)/%.o : %.cpp
|
||||
@echo
|
||||
@echo $(MSG_COMPILING_CPP) $<
|
||||
$(CC) -c $(ALL_CPPFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C++ source files.
|
||||
%.s : %.cpp
|
||||
$(CC) -S $(ALL_CPPFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
$(OBJDIR)/%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Create preprocessed source for use in sending a bug report.
|
||||
%.i : %.c
|
||||
$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).bin
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
|
||||
$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) $(SRC:.c=.i)
|
||||
$(REMOVEDIR) .dep
|
||||
|
||||
|
||||
# Create object files directory
|
||||
$(shell mkdir $(OBJDIR) 2>/dev/null)
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program debug gdb-config
|
||||
|
||||
|
||||
|
||||
|
||||
-1070
File diff suppressed because it is too large
Load Diff
@@ -1,174 +0,0 @@
|
||||
#ifdef __USI__
|
||||
|
||||
/****************************************************************************/
|
||||
static void USI_TWI_SLAVE_Init( void );
|
||||
static void USI_TWI_SLAVE_Abort(void);
|
||||
static void USI_TWI_SLAVE_ReadAndProcessPacket(void);
|
||||
static void USI_TWI_SLAVE_Process_Start_Condition(void);
|
||||
void USI_TWI_SLAVE_Process_Overflow_Condition(void);
|
||||
|
||||
// void prog_buffer_set_byte(uint8_t );
|
||||
|
||||
// uint8_t bootloader_exit;
|
||||
uint8_t Run_boot ;
|
||||
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
// TWI write states.
|
||||
#define USI_TWI_SLAVE_WRITE_ADDR_HI_BYTE (0x00)
|
||||
#define USI_TWI_SLAVE_WRITE_ADDR_LO_BYTE (0x01)
|
||||
#define USI_TWI_SLAVE_WRITE_DATA_BYTE (0x02)
|
||||
|
||||
// TWI overflow states.
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_NONE (0x00)
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_ACK_PR_RX (0x01)
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_RX (0x02)
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_ACK_PR_TX (0x03)
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_PR_ACK_TX (0x04)
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_TX (0x05)
|
||||
|
||||
// newly added ..
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_CMD_RX (0x06)
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_TX_AVERSION (0x07)
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_TX_BVERSION (0x08)
|
||||
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_TX_GETERRCONDN (0x09)
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// typedef unsigned char uint8_t;
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
///////////////// Driver Buffer Definitions //////////////////////
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// 1,2,4,8,16,32,64,128 or 256 bytes are allowed buffer sizes
|
||||
|
||||
#define TWI_RX_BUFFER_SIZE (16)
|
||||
#define TWI_RX_BUFFER_MASK ( TWI_RX_BUFFER_SIZE - 1 )
|
||||
|
||||
#if ( TWI_RX_BUFFER_SIZE & TWI_RX_BUFFER_MASK )
|
||||
#error TWI RX buffer size is not a power of 2
|
||||
#endif
|
||||
|
||||
// 1,2,4,8,16,32,64,128 or 256 bytes are allowed buffer sizes
|
||||
|
||||
#define TWI_TX_BUFFER_SIZE (16)
|
||||
#define TWI_TX_BUFFER_MASK ( TWI_TX_BUFFER_SIZE - 1 )
|
||||
|
||||
#if ( TWI_TX_BUFFER_SIZE & TWI_TX_BUFFER_MASK )
|
||||
#error TWI TX buffer size is not a power of 2
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define USI_SLAVE_CHECK_ADDRESS (0x00)
|
||||
#define USI_SLAVE_SEND_DATA (0x01)
|
||||
#define USI_SLAVE_REQUEST_REPLY_FROM_SEND_DATA (0x02)
|
||||
#define USI_SLAVE_CHECK_REPLY_FROM_SEND_DATA (0x03)
|
||||
#define USI_SLAVE_REQUEST_DATA (0x04)
|
||||
#define USI_SLAVE_GET_DATA_AND_SEND_ACK (0x05)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/*#if defined(__ATTINY2313__) | defined(__ATTINY2313A__) | \
|
||||
defined(__ATTINY4313__) | defined(__ATTINY4313A__) */
|
||||
|
||||
// #define DDR_USI DDRB
|
||||
// #define PORT_USI PORTB
|
||||
// #define PIN_USI PINB
|
||||
// #define PORT_USI_SDA PORTB5
|
||||
// #define PORT_USI_SCL PORTB7
|
||||
// #define PIN_USI_SDA PINB5
|
||||
// #define PIN_USI_SCL PINB7
|
||||
// #define USI_START_COND_INT USISIF
|
||||
// #define USI_START_VECTOR USI_STRT_vect
|
||||
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
|
||||
//#endif
|
||||
|
||||
/*#if defined(__ATTINY25__) | defined(__ATTINY25V__) | \
|
||||
// defined(__ATTINY45__) | defined(__ATTINY45V__) | \
|
||||
// defined(__ATTINY85__) | defined(__ATTINY85V__) */
|
||||
// #define DDR_USI DDRB
|
||||
// #define PORT_USI PORTB
|
||||
// #define PIN_USI PINB
|
||||
// #define PORT_USI_SDA PORTB0
|
||||
// #define PORT_USI_SCL PORTB2
|
||||
// #define PIN_USI_SDA PINB0
|
||||
// #define PIN_USI_SCL PINB2
|
||||
// #define USI_START_COND_INT USICIF
|
||||
// #define USI_START_VECTOR USI_START_vect
|
||||
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
|
||||
//#endif
|
||||
|
||||
/*#if defined(__ATTINY24__) | defined(__ATTINY24A__) | \
|
||||
defined(__ATTINY44__) | defined(__ATTINY44A__) | \
|
||||
defined(__ATTINY84__) | defined(__ATTINY84V__) */
|
||||
|
||||
// #define DDR_USI DDRA
|
||||
// #define PORT_USI PORTA
|
||||
// #define PIN_USI PINA
|
||||
// #define PORT_USI_SDA PORTA6
|
||||
// #define PORT_USI_SCL PORTA4
|
||||
// #define PIN_USI_SDA PINA6
|
||||
// #define PIN_USI_SCL PINA4
|
||||
// #define USI_START_COND_INT USISIF
|
||||
// #define USI_START_VECTOR USI_START_vect
|
||||
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
|
||||
//#endif
|
||||
|
||||
|
||||
/*#if defined(__ATTINY261__) | defined(__ATTINY261A__) | \
|
||||
defined(__ATTINY461__) | defined(__ATTINY461A__) | \
|
||||
defined(__ATTINY861A__) | defined(__ATTINY861A__) */
|
||||
|
||||
// #define DDR_USI DDRB
|
||||
// #define PORT_USI PORTB
|
||||
// #define PIN_USI PINB
|
||||
// #define PORT_USI_SDA PORTB0
|
||||
// #define PORT_USI_SCL PORTB2
|
||||
// #define PIN_USI_SDA PINB0
|
||||
// #define PIN_USI_SCL PINB2
|
||||
// #define USI_START_COND_INT USISIF
|
||||
// #define USI_START_VECTOR USI_START_vect
|
||||
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
|
||||
//#endif
|
||||
|
||||
|
||||
//#if defined(__ATTINY43U__)
|
||||
// #define DDR_USI DDRB
|
||||
// #define PORT_USI PORTB
|
||||
// #define PIN_USI PINB
|
||||
// #define PORT_USI_SDA PORTB4
|
||||
// #define PORT_USI_SCL PORTB6
|
||||
// #define PIN_USI_SDA PINB4
|
||||
// #define PIN_USI_SCL PINB6
|
||||
// #define USI_START_COND_INT USISIF
|
||||
// #define USI_START_VECTOR USI_START_vect
|
||||
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
|
||||
//#endif
|
||||
|
||||
|
||||
//#if defined(__ATTINY87__) | defined(__ATTINY167__)
|
||||
|
||||
#define DDR_USI DDRB
|
||||
#define PORT_USI PORTB
|
||||
#define PIN_USI PINB
|
||||
#define PORT_USI_SDA PORTB0
|
||||
#define PORT_USI_SCL PORTB2
|
||||
#define PIN_USI_SDA PINB0
|
||||
#define PIN_USI_SCL PINB2
|
||||
#define USI_START_COND_INT USISIF
|
||||
#define USI_START_VECTOR USI_START_vect
|
||||
#define USI_OVERFLOW_VECTOR USI_OVF_vect
|
||||
//#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,231 +0,0 @@
|
||||
/* Default linker script, for normal executables */
|
||||
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
|
||||
OUTPUT_ARCH(avr:3)
|
||||
MEMORY
|
||||
{
|
||||
text (rx) : ORIGIN = 0, LENGTH = 16K
|
||||
data (rw!x) : ORIGIN = 0x800060, LENGTH = 0xffa0
|
||||
eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
|
||||
fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
|
||||
lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
|
||||
signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.gnu.version : { *(.gnu.version) }
|
||||
.gnu.version_d : { *(.gnu.version_d) }
|
||||
.gnu.version_r : { *(.gnu.version_r) }
|
||||
.rel.init : { *(.rel.init) }
|
||||
.rela.init : { *(.rela.init) }
|
||||
.rel.text :
|
||||
{
|
||||
*(.rel.text)
|
||||
*(.rel.text.*)
|
||||
*(.rel.gnu.linkonce.t*)
|
||||
}
|
||||
.rela.text :
|
||||
{
|
||||
*(.rela.text)
|
||||
*(.rela.text.*)
|
||||
*(.rela.gnu.linkonce.t*)
|
||||
}
|
||||
.rel.fini : { *(.rel.fini) }
|
||||
.rela.fini : { *(.rela.fini) }
|
||||
.rel.rodata :
|
||||
{
|
||||
*(.rel.rodata)
|
||||
*(.rel.rodata.*)
|
||||
*(.rel.gnu.linkonce.r*)
|
||||
}
|
||||
.rela.rodata :
|
||||
{
|
||||
*(.rela.rodata)
|
||||
*(.rela.rodata.*)
|
||||
*(.rela.gnu.linkonce.r*)
|
||||
}
|
||||
.rel.data :
|
||||
{
|
||||
*(.rel.data)
|
||||
*(.rel.data.*)
|
||||
*(.rel.gnu.linkonce.d*)
|
||||
}
|
||||
.rela.data :
|
||||
{
|
||||
*(.rela.data)
|
||||
*(.rela.data.*)
|
||||
*(.rela.gnu.linkonce.d*)
|
||||
}
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
/* Internal text space or external memory. */
|
||||
.vectors :
|
||||
{
|
||||
*(.vectors)
|
||||
KEEP(*(.vectors))
|
||||
}
|
||||
.text :
|
||||
{
|
||||
/* For data that needs to reside in the lower 64k of progmem. */
|
||||
*(.progmem.gcc*)
|
||||
*(.progmem*)
|
||||
. = ALIGN(2);
|
||||
__trampolines_start = . ;
|
||||
/* The jump trampolines for the 16-bit limited relocs will reside here. */
|
||||
*(.trampolines)
|
||||
*(.trampolines*)
|
||||
__trampolines_end = . ;
|
||||
/* For future tablejump instruction arrays for 3 byte pc devices.
|
||||
We don't relax jump/call instructions within these sections. */
|
||||
*(.jumptables)
|
||||
*(.jumptables*)
|
||||
/* For code that needs to reside in the lower 128k progmem. */
|
||||
*(.lowtext)
|
||||
*(.lowtext*)
|
||||
__ctors_start = . ;
|
||||
*(.ctors)
|
||||
__ctors_end = . ;
|
||||
__dtors_start = . ;
|
||||
*(.dtors)
|
||||
__dtors_end = . ;
|
||||
KEEP(SORT(*)(.ctors))
|
||||
KEEP(SORT(*)(.dtors))
|
||||
/* From this point on, we don't bother about wether the insns are
|
||||
below or above the 16 bits boundary. */
|
||||
*(.init0) /* Start here after reset. */
|
||||
KEEP (*(.init0))
|
||||
*(.init1)
|
||||
KEEP (*(.init1))
|
||||
*(.init2) /* Clear __zero_reg__, set up stack pointer. */
|
||||
KEEP (*(.init2))
|
||||
*(.init3)
|
||||
KEEP (*(.init3))
|
||||
*(.init4) /* Initialize data and BSS. */
|
||||
KEEP (*(.init4))
|
||||
*(.init5)
|
||||
KEEP (*(.init5))
|
||||
*(.init6) /* C++ constructors. */
|
||||
KEEP (*(.init6))
|
||||
*(.init7)
|
||||
KEEP (*(.init7))
|
||||
*(.init8)
|
||||
KEEP (*(.init8))
|
||||
*(.init9) /* Call main(). */
|
||||
KEEP (*(.init9))
|
||||
*(.text)
|
||||
. = ALIGN(2);
|
||||
*(.text.*)
|
||||
. = ALIGN(2);
|
||||
*(.fini9) /* _exit() starts here. */
|
||||
KEEP (*(.fini9))
|
||||
*(.fini8)
|
||||
KEEP (*(.fini8))
|
||||
*(.fini7)
|
||||
KEEP (*(.fini7))
|
||||
*(.fini6) /* C++ destructors. */
|
||||
KEEP (*(.fini6))
|
||||
*(.fini5)
|
||||
KEEP (*(.fini5))
|
||||
*(.fini4)
|
||||
KEEP (*(.fini4))
|
||||
*(.fini3)
|
||||
KEEP (*(.fini3))
|
||||
*(.fini2)
|
||||
KEEP (*(.fini2))
|
||||
*(.fini1)
|
||||
KEEP (*(.fini1))
|
||||
*(.fini0) /* Infinite loop after program termination. */
|
||||
KEEP (*(.fini0))
|
||||
_etext = . ;
|
||||
} > text
|
||||
.data : AT (ADDR (.text) + SIZEOF (.text))
|
||||
{
|
||||
PROVIDE (__data_start = .) ;
|
||||
*(.data)
|
||||
*(.data*)
|
||||
*(.rodata) /* We need to include .rodata here if gcc is used */
|
||||
*(.rodata*) /* with -fdata-sections. */
|
||||
*(.gnu.linkonce.d*)
|
||||
. = ALIGN(2);
|
||||
_edata = . ;
|
||||
PROVIDE (__data_end = .) ;
|
||||
} > data
|
||||
.bss : AT (ADDR (.bss))
|
||||
{
|
||||
PROVIDE (__bss_start = .) ;
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
PROVIDE (__bss_end = .) ;
|
||||
} > data
|
||||
__data_load_start = LOADADDR(.data);
|
||||
__data_load_end = __data_load_start + SIZEOF(.data);
|
||||
/* Global data not cleared after reset. */
|
||||
.noinit :
|
||||
{
|
||||
PROVIDE (__noinit_start = .) ;
|
||||
*(.noinit*)
|
||||
PROVIDE (__noinit_end = .) ;
|
||||
_end = . ;
|
||||
PROVIDE (__heap_start = .) ;
|
||||
} > data
|
||||
.eeprom :
|
||||
{
|
||||
*(.eeprom*)
|
||||
__eeprom_end = . ;
|
||||
} > eeprom
|
||||
.fuse :
|
||||
{
|
||||
KEEP(*(.fuse))
|
||||
KEEP(*(.lfuse))
|
||||
KEEP(*(.hfuse))
|
||||
KEEP(*(.efuse))
|
||||
} > fuse
|
||||
.lock :
|
||||
{
|
||||
KEEP(*(.lock*))
|
||||
} > lock
|
||||
.signature :
|
||||
{
|
||||
KEEP(*(.signature*))
|
||||
} > signature
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
of the section so we begin them at 0. */
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
}
|
||||
@@ -1,234 +0,0 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# ATMEL Microcontroller Software Support
|
||||
# ----------------------------------------------------------------------------
|
||||
# Copyright (c) 2011, Atmel Corporation
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# - Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the disclaimer below.
|
||||
#
|
||||
# Atmel's name may not be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Makefile for compiling the applet-serial flash project
|
||||
|
||||
# Chip & board used for compilation
|
||||
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
|
||||
CHIP = atsam3s4
|
||||
BOARD = atsam3s4_ek
|
||||
DYN = OFF
|
||||
|
||||
# Makefile for compiling applet-serialflash applet.
|
||||
|
||||
ifeq (atsam3s4,$(CHIP))
|
||||
BOARD_DIR = at91sam3s4-ek
|
||||
endif
|
||||
|
||||
ifeq (atsam3s2,$(CHIP))
|
||||
BOARD_DIR = at91sam3s2-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9g15,$(CHIP))
|
||||
BOARD =sam9g15_ek
|
||||
BOARD_DIR = at91sam9g15-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9g25,$(CHIP))
|
||||
BOARD =sam9g25_ek
|
||||
BOARD_DIR = at91sam9g25-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9g35,$(CHIP))
|
||||
BOARD =sam9g35_ek
|
||||
BOARD_DIR = at91sam9g35-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9x25,$(CHIP))
|
||||
BOARD =sam9x25_ek
|
||||
BOARD_DIR = at91sam9x25-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9x35,$(CHIP))
|
||||
BOARD =sam9x35_ek
|
||||
BOARD_DIR = at91sam9x35-ek
|
||||
endif
|
||||
|
||||
# Defines which are the available memory targets for the AT91SAM3S-EK board.
|
||||
MEMORIES = sram
|
||||
|
||||
# Trace level used for compilation
|
||||
# (can be overriden by adding TRACE_LEVEL=#number to the command-line)
|
||||
# TRACE_LEVEL_DEBUG 5
|
||||
# TRACE_LEVEL_INFO 4
|
||||
# TRACE_LEVEL_WARNING 3
|
||||
# TRACE_LEVEL_ERROR 2
|
||||
# TRACE_LEVEL_FATAL 1
|
||||
# TRACE_LEVEL_NO_TRACE 0
|
||||
|
||||
# Info traces allowed by default
|
||||
TR_LEV = 0
|
||||
|
||||
# Optimization level, put in comment for debugging
|
||||
OPTIMIZATION = -Os
|
||||
|
||||
# Output file basename
|
||||
OUTPUT = applet-coprocessor-$(CHIP)
|
||||
|
||||
# Output directories
|
||||
BIN = bin
|
||||
OBJ = obj
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Tools
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Tool suffix when cross-compiling
|
||||
CROSS_COMPILE = arm-none-eabi-
|
||||
|
||||
# Libraries
|
||||
LIBRARIES = ../../libraries
|
||||
# Chip library directory
|
||||
CHIP_LIB = $(LIBRARIES)/libchip_atsam3s
|
||||
# Board library directory
|
||||
BOARD_LIB = $(LIBRARIES)/libboard_atsam3s-ek
|
||||
# Spiflash library directory
|
||||
#SPIFLASH_LIB = $(LIBRARIES)/libspiflash
|
||||
|
||||
# ISP directory
|
||||
ISP = ..
|
||||
# tcl_lib directory
|
||||
|
||||
#INSTALLDIR = "../../../../tcl_lib/$(BOARD_DIR)/"
|
||||
|
||||
LIBS = -Wl,--start-group -lgcc -lc -Wl,--end-group
|
||||
|
||||
#-lchip_$(CHIP)_gcc_rel -lboard_$(BOARD)_gcc_rel -lspiflash_gcc_rel -Wl,--end-group
|
||||
|
||||
LIB_PATH = -L$(CHIP_LIB)/lib
|
||||
LIB_PATH += -L$(BOARD_LIB)/lib
|
||||
#LIB_PATH += -L$(SPIFLASH_LIB)/lib
|
||||
#LIB_PATH+=-L=/lib
|
||||
#LIB_PATH+=-L=/../lib/gcc/arm-none-eabi/4.4.1
|
||||
|
||||
# Compilation tools
|
||||
AR = $(CROSS_COMPILE)ar
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
LD = $(CROSS_COMPILE)ld
|
||||
SIZE = $(CROSS_COMPILE)size
|
||||
STRIP = $(CROSS_COMPILE)strip
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
GDB = $(CROSS_COMPILE)gdb
|
||||
NM = $(CROSS_COMPILE)nm
|
||||
CLSS = $(CROSS_COMPILE)objdump
|
||||
|
||||
# Flags
|
||||
INCLUDES = -I$(CHIP_LIB)
|
||||
INCLUDES += -I$(BOARD_LIB)
|
||||
INCLUDES += -I$(SPIFLASH_LIB)
|
||||
INCLUDES += -I$(LIBRARIES)
|
||||
|
||||
CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int
|
||||
CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
|
||||
CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
|
||||
CFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
|
||||
CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings
|
||||
CFLAGS += -Wsign-compare -Waggregate-return -Wstrict-prototypes
|
||||
CFLAGS += -Wmissing-prototypes -Wmissing-declarations
|
||||
CFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
|
||||
CFLAGS += -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long
|
||||
CFLAGS += -Wunreachable-code
|
||||
CFLAGS += -Wcast-align
|
||||
#CFLAGS += -Wmissing-noreturn
|
||||
#CFLAGS += -Wconversion
|
||||
|
||||
# To reduce application size use only integer printf function.
|
||||
CFLAGS += -Dprintf=iprintf
|
||||
TRACE_LEVEL = 4
|
||||
#CFLAGS += -DTRACE_LEVEL=$(TR_LEV)
|
||||
#-DDYN_TRACES
|
||||
# -mlong-calls -Wall
|
||||
CFLAGS += -ffunction-sections -D$(MEMORIES)
|
||||
#CFLAGS += -DNDEBUG
|
||||
CFLAGS += -mthumb -g -gdwarf-2 $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_LEVEL=$(TRACE_LEVEL) -DDYN_TRACES
|
||||
ASFLAGS = -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
|
||||
LDFLAGS= -nostartfiles -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=entry -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols
|
||||
LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Files
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Directories where source files can be found
|
||||
|
||||
VPATH += ../..
|
||||
VPATH += $(ISP)/common
|
||||
|
||||
|
||||
# Objects built from Asm source files
|
||||
//ASM_OBJECTS = applet_cstartup.o
|
||||
|
||||
# Objects built from C source files
|
||||
C_OBJECTS += main.o
|
||||
C_OBJECTS += applet_cstartup.o
|
||||
|
||||
# Append OBJ and BIN directories to output filename
|
||||
OUTPUT := $(BIN)/$(OUTPUT)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Rules
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
all: $(BIN) $(OBJ) $(MEMORIES)
|
||||
|
||||
$(BIN) $(OBJ):
|
||||
mkdir $@
|
||||
|
||||
define RULES
|
||||
C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS))
|
||||
ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))
|
||||
|
||||
$(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
|
||||
$(CC) $(LIB_PATH) $(LDFLAGS) $(LD_OPTIONAL) -T"$(BOARD_LIB)/resources/gcc/$(CHIP)/$$@_samba.lds" -Wl,-Map,$(OUTPUT).map -o $(OUTPUT).elf $$^ $(LIBS)
|
||||
$(NM) $(OUTPUT).elf >$(OUTPUT).elf.txt
|
||||
$(OBJCOPY) -O binary $(OUTPUT).elf $(OUTPUT).bin
|
||||
$(SIZE) $$^ $(OUTPUT).elf
|
||||
$(CLSS) -h -S $(OUTPUT).elf >$(OUTPUT).lss
|
||||
# @[ -e $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
|
||||
# @cp -f $(OUTPUT).bin $(INSTALLDIR)
|
||||
|
||||
$$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
|
||||
$(CC) $(CFLAGS) -D$(1) -c -o $$@ $$<
|
||||
|
||||
$$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
|
||||
$(CC) $(ASFLAGS) -D$(1) -c -o $$@ $$<
|
||||
|
||||
debug_$(1): $(1)
|
||||
$(GDB) -x "$(BOARD_LIB)/resources/gcc/$(BOARD)_$(1).gdb" -ex "reset" -readnow -se $(OUTPUT)-$(1).elf
|
||||
endef
|
||||
|
||||
$(foreach MEMORY, $(MEMORIES), $(eval $(call RULES,$(MEMORY))))
|
||||
|
||||
clean:
|
||||
-del $(OBJ)\*.o $(BIN)\*.bin $(BIN)\*.elf $(BIN)\*.map
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,101 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2008, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef APPLET_H
|
||||
#define APPLET_H
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Global definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** Refers to the Version of SAM-BA */
|
||||
#define SAM_BA_APPLETS_VERSION "2.11"
|
||||
|
||||
/** Applet initialization command code.*/
|
||||
#define APPLET_CMD_INIT 0x00
|
||||
/** Applet full erase command code.*/
|
||||
#define APPLET_CMD_FULL_ERASE 0x01
|
||||
/** Applet write command code.*/
|
||||
#define APPLET_CMD_WRITE 0x02
|
||||
/** Applet read command code.*/
|
||||
#define APPLET_CMD_READ 0x03
|
||||
/** Applet read command code.*/
|
||||
#define APPLET_CMD_LOCK 0x04
|
||||
/** Applet read command code.*/
|
||||
#define APPLET_CMD_UNLOCK 0x05
|
||||
/** Applet set/clear GPNVM command code.*/
|
||||
#define APPLET_CMD_GPNVM 0x06
|
||||
/** Applet set security bit command code.*/
|
||||
#define APPLET_CMD_SECURITY 0x07
|
||||
/** Applet buffer erase command code.*/
|
||||
#define APPLET_CMD_BUFFER_ERASE 0x08
|
||||
/** Applet binary page command code for Dataflash.*/
|
||||
#define APPLET_CMD_BINARY_PAGE 0x09
|
||||
/** List Bad Blocks of a Nandflash*/
|
||||
#define APPLET_CMD_LIST_BAD_BLOCKS 0x10
|
||||
/** Tag a Nandflash Block*/
|
||||
#define APPLET_CMD_TAG_BLOCK 0x11
|
||||
/** Read the Unique ID bits (on SAM3)*/
|
||||
#define APPLET_CMD_READ_UNIQUE_ID 0x12
|
||||
/** Applet blocks erase command code. */
|
||||
#define APPLET_CMD_ERASE_BLOCKS 0x13
|
||||
/** Applet batch full erase command code. */
|
||||
#define APPLET_CMD_BATCH_ERASE 0x14
|
||||
|
||||
/** Operation was successful.*/
|
||||
#define APPLET_SUCCESS 0x00
|
||||
/** Device unknown.*/
|
||||
#define APPLET_DEV_UNKNOWN 0x01
|
||||
/** Write operation failed.*/
|
||||
#define APPLET_WRITE_FAIL 0x02
|
||||
/** Read operation failed.*/
|
||||
#define APPLET_READ_FAIL 0x03
|
||||
/** Protect operation failed.*/
|
||||
#define APPLET_PROTECT_FAIL 0x04
|
||||
/** Unprotect operation failed.*/
|
||||
#define APPLET_UNPROTECT_FAIL 0x05
|
||||
/** Erase operation failed.*/
|
||||
#define APPLET_ERASE_FAIL 0x06
|
||||
/** No device defined in board.h*/
|
||||
#define APPLET_NO_DEV 0x07
|
||||
/** Read / write address is not aligned*/
|
||||
#define APPLET_ALIGN_ERROR 0x08
|
||||
/** Read / write found bad block*/
|
||||
#define APPLET_BAD_BLOCK 0x09
|
||||
/** Applet failure.*/
|
||||
#define APPLET_FAIL 0x0f
|
||||
|
||||
|
||||
/** Communication link identification*/
|
||||
#define USB_COM_TYPE 0x00
|
||||
#define DBGU_COM_TYPE 0x01
|
||||
#define JTAG_COM_TYPE 0x02
|
||||
|
||||
#endif //#ifndef APPLET_H
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2011, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
#include "board.h"
|
||||
#include "board_lowlevel.h"
|
||||
typedef void( *IntFunc )( void );
|
||||
/*----------------------------------------------------------------------------
|
||||
* Prototypes
|
||||
*----------------------------------------------------------------------------*/
|
||||
/** Stack top */
|
||||
extern unsigned long _sstack;
|
||||
|
||||
/** Initialize segments*/
|
||||
extern unsigned int _sidata;
|
||||
extern unsigned int _sdata, _edata;
|
||||
extern unsigned int _szero, _ezero;
|
||||
|
||||
/** Default link entry */
|
||||
extern int main(int argc, char **argv);
|
||||
|
||||
/** Reset entry */
|
||||
void ResetException(void) ;//__attribute__((__interrupt__));
|
||||
|
||||
/** Exception Table */
|
||||
__attribute__((section(".isr_vector")))
|
||||
//IntFunc exception_table[] = {
|
||||
//__attribute__ ((section(".vectors"), used))
|
||||
void (* const gVectors[])(void) =
|
||||
{
|
||||
/* Configure Initial Stack Pointer, using linker-generated symbols */
|
||||
(void (*)(void))((unsigned long)&_sstack),
|
||||
// /*(IntFunc)&*/_sstack,
|
||||
ResetException, /* Initial PC, set to entry point */
|
||||
(unsigned int) 0 /*NMIException*/,
|
||||
(unsigned int) 0 /*HardFaultException*/,
|
||||
(unsigned int) 0 /*MemManageException*/,
|
||||
(unsigned int) 0 /*BusFaultException*/,
|
||||
(unsigned int) 0 /*UsageFaultException*/,
|
||||
0, 0, 0, 0, /* Reserved */
|
||||
(unsigned int) 0 /*SVCHandler*/,
|
||||
(unsigned int) 0 /*DebugMonitor*/,
|
||||
0, /* Reserved */
|
||||
(unsigned int) 0 /*PendSVC*/,
|
||||
(unsigned int) 0 /*SysTickHandler*/,
|
||||
/*
|
||||
:
|
||||
*/
|
||||
};
|
||||
|
||||
/** Applet Mailbox and initialization flag */
|
||||
#define MAILBOX_SIZE 32
|
||||
__attribute__((section(".mailbox")))
|
||||
unsigned int mailbox[MAILBOX_SIZE];
|
||||
volatile unsigned int isInitialized = 0;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Reset Handler
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* \brief This is the code that gets called on processor reset. To initialize the
|
||||
* device. And call the main() routine.
|
||||
*
|
||||
*/
|
||||
__attribute__ ((section(".text"), used))
|
||||
void ResetException(void)
|
||||
{
|
||||
unsigned int *pSrc, *pDest;
|
||||
// { asm volatile ("cpsid i"); }
|
||||
|
||||
// Initialize data
|
||||
// Zero fill bss
|
||||
if (isInitialized == 0) {
|
||||
pSrc = &_sidata;
|
||||
for(pDest = &_sdata; pDest < &_edata;) {
|
||||
|
||||
*(pDest ++) = *(pSrc ++);
|
||||
}
|
||||
|
||||
for (pDest = &_szero; pDest < &_ezero;) {
|
||||
|
||||
*(pDest ++) = 0;
|
||||
}
|
||||
isInitialized = 1;
|
||||
}
|
||||
|
||||
/* LowLevelInit(); */
|
||||
|
||||
/* Save original SP. */
|
||||
__asm("mov r4, sp");
|
||||
/* Change SP to current stack point. */
|
||||
__asm("ldr r5, =_sstack");
|
||||
__asm(" mov sp, r5");
|
||||
main(1, (char**)mailbox);
|
||||
/* Restore previous SP point. */
|
||||
__asm("mov sp, r4");
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* Interface for the low-level initialization function.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BOARD_LOWLEVEL_H
|
||||
#define BOARD_LOWLEVEL_H
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Exported functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern void LowLevelInit( void ) ;
|
||||
|
||||
#endif /* BOARD_LOWLEVEL_H */
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# ATMEL Microcontroller Software Support
|
||||
# ----------------------------------------------------------------------------
|
||||
# Copyright (c) 2011, Atmel Corporation
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# - Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the disclaimer below.
|
||||
#
|
||||
# Atmel's name may not be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Makefile for compiling the applet-serial flash project
|
||||
|
||||
# Chip & board used for compilation
|
||||
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
|
||||
CHIP = atsam3s4
|
||||
BOARD = atsam3s4_ek
|
||||
DYN = OFF
|
||||
|
||||
# Makefile for compiling applet-serialflash applet.
|
||||
|
||||
ifeq (atsam3s4,$(CHIP))
|
||||
BOARD_DIR = at91sam3s4-ek
|
||||
endif
|
||||
|
||||
ifeq (atsam3s2,$(CHIP))
|
||||
BOARD_DIR = at91sam3s2-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9g15,$(CHIP))
|
||||
BOARD =sam9g15_ek
|
||||
BOARD_DIR = at91sam9g15-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9g25,$(CHIP))
|
||||
BOARD =sam9g25_ek
|
||||
BOARD_DIR = at91sam9g25-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9g35,$(CHIP))
|
||||
BOARD =sam9g35_ek
|
||||
BOARD_DIR = at91sam9g35-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9x25,$(CHIP))
|
||||
BOARD =sam9x25_ek
|
||||
BOARD_DIR = at91sam9x25-ek
|
||||
endif
|
||||
|
||||
ifeq (sam9x35,$(CHIP))
|
||||
BOARD =sam9x35_ek
|
||||
BOARD_DIR = at91sam9x35-ek
|
||||
endif
|
||||
|
||||
# Defines which are the available memory targets for the AT91SAM3S-EK board.
|
||||
MEMORIES = sram
|
||||
|
||||
# Trace level used for compilation
|
||||
# (can be overriden by adding TRACE_LEVEL=#number to the command-line)
|
||||
# TRACE_LEVEL_DEBUG 5
|
||||
# TRACE_LEVEL_INFO 4
|
||||
# TRACE_LEVEL_WARNING 3
|
||||
# TRACE_LEVEL_ERROR 2
|
||||
# TRACE_LEVEL_FATAL 1
|
||||
# TRACE_LEVEL_NO_TRACE 0
|
||||
|
||||
# Info traces allowed by default
|
||||
TR_LEV = 0
|
||||
|
||||
# Optimization level, put in comment for debugging
|
||||
OPTIMIZATION = -Os
|
||||
|
||||
# Output file basename
|
||||
OUTPUT = applet-serialflash-$(CHIP)
|
||||
|
||||
# Output directories
|
||||
BIN = bin
|
||||
OBJ = obj
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Tools
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Tool suffix when cross-compiling
|
||||
CROSS_COMPILE = arm-none-eabi-
|
||||
|
||||
# Libraries
|
||||
LIBRARIES = ../../libraries
|
||||
# Chip library directory
|
||||
CHIP_LIB = $(LIBRARIES)/libchip_atsam3s
|
||||
# Board library directory
|
||||
BOARD_LIB = $(LIBRARIES)/libboard_atsam3s-ek
|
||||
# Spiflash library directory
|
||||
#SPIFLASH_LIB = $(LIBRARIES)/libspiflash
|
||||
|
||||
# ISP directory
|
||||
ISP = ..
|
||||
# tcl_lib directory
|
||||
|
||||
#INSTALLDIR = "../../../../tcl_lib/$(BOARD_DIR)/"
|
||||
|
||||
LIBS = -Wl,--start-group -lgcc -lc -Wl,--end-group
|
||||
|
||||
#-lchip_$(CHIP)_gcc_rel -lboard_$(BOARD)_gcc_rel -lspiflash_gcc_rel -Wl,--end-group
|
||||
|
||||
LIB_PATH = -L$(CHIP_LIB)/lib
|
||||
LIB_PATH += -L$(BOARD_LIB)/lib
|
||||
#LIB_PATH += -L$(SPIFLASH_LIB)/lib
|
||||
#LIB_PATH+=-L=/lib
|
||||
#LIB_PATH+=-L=/../lib/gcc/arm-none-eabi/4.4.1
|
||||
|
||||
# Compilation tools
|
||||
AR = $(CROSS_COMPILE)ar
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
LD = $(CROSS_COMPILE)ld
|
||||
SIZE = $(CROSS_COMPILE)size
|
||||
STRIP = $(CROSS_COMPILE)strip
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
GDB = $(CROSS_COMPILE)gdb
|
||||
NM = $(CROSS_COMPILE)nm
|
||||
CLSS = $(CROSS_COMPILE)objdump
|
||||
|
||||
# Flags
|
||||
INCLUDES = -I$(CHIP_LIB)
|
||||
INCLUDES += -I$(BOARD_LIB)
|
||||
INCLUDES += -I$(SPIFLASH_LIB)
|
||||
INCLUDES += -I$(LIBRARIES)
|
||||
|
||||
CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int
|
||||
CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
|
||||
CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
|
||||
CFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
|
||||
CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings
|
||||
CFLAGS += -Wsign-compare -Waggregate-return -Wstrict-prototypes
|
||||
CFLAGS += -Wmissing-prototypes -Wmissing-declarations
|
||||
CFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
|
||||
CFLAGS += -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long
|
||||
CFLAGS += -Wunreachable-code
|
||||
CFLAGS += -Wcast-align
|
||||
#CFLAGS += -Wmissing-noreturn
|
||||
#CFLAGS += -Wconversion
|
||||
|
||||
# To reduce application size use only integer printf function.
|
||||
CFLAGS += -Dprintf=iprintf
|
||||
TRACE_LEVEL = 4
|
||||
#CFLAGS += -DTRACE_LEVEL=$(TR_LEV)
|
||||
#-DDYN_TRACES
|
||||
# -mlong-calls -Wall
|
||||
CFLAGS += -ffunction-sections -D$(MEMORIES)
|
||||
#CFLAGS += -DNDEBUG
|
||||
CFLAGS += -mthumb -g -gdwarf-2 $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_LEVEL=$(TRACE_LEVEL) -DDYN_TRACES
|
||||
ASFLAGS = -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
|
||||
LDFLAGS= -nostartfiles -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=entry -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols
|
||||
LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Files
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Directories where source files can be found
|
||||
|
||||
VPATH += ../..
|
||||
VPATH += $(ISP)/common
|
||||
|
||||
|
||||
# Objects built from Asm source files
|
||||
//ASM_OBJECTS = applet_cstartup.o
|
||||
|
||||
# Objects built from C source files
|
||||
C_OBJECTS += main.o
|
||||
C_OBJECTS += applet_cstartup.o
|
||||
|
||||
# Append OBJ and BIN directories to output filename
|
||||
OUTPUT := $(BIN)/$(OUTPUT)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Rules
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
all: $(BIN) $(OBJ) $(MEMORIES)
|
||||
|
||||
$(BIN) $(OBJ):
|
||||
mkdir $@
|
||||
|
||||
define RULES
|
||||
C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS))
|
||||
ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))
|
||||
|
||||
$(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
|
||||
$(CC) $(LIB_PATH) $(LDFLAGS) $(LD_OPTIONAL) -T"$(BOARD_LIB)/resources/gcc/$(CHIP)/$$@_samba.lds" -Wl,-Map,$(OUTPUT).map -o $(OUTPUT).elf $$^ $(LIBS)
|
||||
$(NM) $(OUTPUT).elf >$(OUTPUT).elf.txt
|
||||
$(OBJCOPY) -O binary $(OUTPUT).elf $(OUTPUT).bin
|
||||
$(SIZE) $$^ $(OUTPUT).elf
|
||||
$(CLSS) -h -S $(OUTPUT).elf >$(OUTPUT).lss
|
||||
# @[ -e $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
|
||||
# @cp -f $(OUTPUT).bin $(INSTALLDIR)
|
||||
|
||||
$$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
|
||||
$(CC) $(CFLAGS) -D$(1) -c -o $$@ $$<
|
||||
|
||||
$$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
|
||||
$(CC) $(ASFLAGS) -D$(1) -c -o $$@ $$<
|
||||
|
||||
debug_$(1): $(1)
|
||||
$(GDB) -x "$(BOARD_LIB)/resources/gcc/$(BOARD)_$(1).gdb" -ex "reset" -readnow -se $(OUTPUT)-$(1).elf
|
||||
endef
|
||||
|
||||
$(foreach MEMORY, $(MEMORIES), $(eval $(call RULES,$(MEMORY))))
|
||||
|
||||
clean:
|
||||
-del $(OBJ)\*.o $(BIN)\*.bin $(BIN)\*.elf $(BIN)\*.map
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
@@ -1,971 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2011, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "../common/applet.h"
|
||||
#include <board.h>
|
||||
//#include "libspiflash.h"
|
||||
#include <string.h>
|
||||
|
||||
#undef DYN_TRACES
|
||||
#define DYN_TRACES 0
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Internal definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** SPI clock frequency in Hz. */
|
||||
#define SPCK 8000000
|
||||
|
||||
|
||||
/** Stack size in SRAM */
|
||||
#define STACK_SIZE 0x100
|
||||
|
||||
/** Last erased sector id, this will avoid to erase if the block is already erased. */
|
||||
//static unsigned short lastErasedBlock = 0xFFFF;
|
||||
|
||||
/** Indicate the farthest memory offset ever erase, if current write address is less
|
||||
than the address, the related block should be erase again before write. */
|
||||
//static uint32_t writtenAddress = 0;
|
||||
|
||||
|
||||
/** Max size of data we can tranfsert in one shot */
|
||||
#define MAX_COUNT 0x6000
|
||||
|
||||
/** Chip select value used to select the AT25 chip. */
|
||||
#define SPI_CS 0
|
||||
/** SPI peripheral pins to configure to access the serial flash. */
|
||||
#define SPI_PINS PINS_SPI0, PIN_SPI0_NPCS0
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Types
|
||||
*----------------------------------------------------------------------------*/
|
||||
/** Structure for storing parameters for each command that can be performed by
|
||||
the applet. */
|
||||
struct _Mailbox {
|
||||
|
||||
/** Command send to the monitor to be executed. */
|
||||
uint32_t command;
|
||||
/** Returned status, updated at the end of the monitor execution.*/
|
||||
uint32_t status;
|
||||
|
||||
/** Input Arguments in the argument area*/
|
||||
union {
|
||||
|
||||
/** Input arguments for the Init command.*/
|
||||
struct {
|
||||
|
||||
/** Communication link used.*/
|
||||
uint32_t comType;
|
||||
/**Trace level.*/
|
||||
uint32_t traceLevel;
|
||||
/** Serial flash index.*/
|
||||
uint32_t at25Idx;
|
||||
|
||||
} inputInit;
|
||||
|
||||
/** Output arguments for the Init command.*/
|
||||
struct {
|
||||
|
||||
/** Memory size.*/
|
||||
uint32_t memorySize;
|
||||
/** Buffer address.*/
|
||||
uint32_t bufferAddress;
|
||||
/** Buffer size.*/
|
||||
uint32_t bufferSize;
|
||||
|
||||
} outputInit;
|
||||
|
||||
/** Input arguments for the Write command.*/
|
||||
struct {
|
||||
|
||||
/** Buffer address.*/
|
||||
uint32_t bufferAddr;
|
||||
/** Buffer size.*/
|
||||
uint32_t bufferSize;
|
||||
/** Memory offset.*/
|
||||
uint32_t memoryOffset;
|
||||
|
||||
} inputWrite;
|
||||
|
||||
/** Output arguments for the Write command.*/
|
||||
struct {
|
||||
|
||||
/** Bytes written.*/
|
||||
uint32_t bytesWritten;
|
||||
|
||||
uint32_t bufferSize; // temp
|
||||
/** Memory offset.*/
|
||||
uint32_t memoryOffset; // temp
|
||||
uint32_t debug1 ;
|
||||
uint32_t debug2 ;
|
||||
|
||||
} outputWrite;
|
||||
|
||||
/** Input arguments for the Read command.*/
|
||||
struct {
|
||||
|
||||
/** Buffer address. */
|
||||
uint32_t bufferAddr;
|
||||
/** Buffer size.*/
|
||||
uint32_t bufferSize;
|
||||
/** Memory offset.*/
|
||||
uint32_t memoryOffset;
|
||||
|
||||
} inputRead;
|
||||
|
||||
/** Output arguments for the Read command.*/
|
||||
struct {
|
||||
|
||||
/** Bytes read.*/
|
||||
uint32_t bytesRead;
|
||||
|
||||
} outputRead;
|
||||
|
||||
/** Input arguments for the Full Erase command.*/
|
||||
// NONE
|
||||
|
||||
/** Output arguments for the Full Erase command.*/
|
||||
// NONE
|
||||
/** Input arguments for the Buffer Erase command.*/
|
||||
struct {
|
||||
|
||||
/** Memory offset to be erase.*/
|
||||
uint32_t memoryOffset;
|
||||
|
||||
} inputBufferErase;
|
||||
|
||||
/** Output arguments for the Buffer Erase command.*/
|
||||
struct {
|
||||
|
||||
/** Memory offset to be erase.*/
|
||||
uint32_t bytesErased;
|
||||
|
||||
} outputBufferErase;
|
||||
} argument;
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Global variables
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** End of program space (code + data). */
|
||||
extern int end;
|
||||
extern int _sstack;
|
||||
/*----------------------------------------------------------------------------
|
||||
* Local variables
|
||||
*----------------------------------------------------------------------------*/
|
||||
/** Global DMA driver instance for all DMA transfers in application. */
|
||||
//static sDmad dmad;
|
||||
|
||||
/** SPI driver instance. */
|
||||
//static Spid spid;
|
||||
|
||||
/** Serial flash driver instance. */
|
||||
//static At25 at25;
|
||||
|
||||
/** Pins to configure for the application. */
|
||||
//static Pin pins[] = {SPI_PINS};
|
||||
|
||||
/** Size of one page in the serial flash, in bytes. */
|
||||
static uint32_t pageSize;
|
||||
|
||||
/** Size of one block in the serial flash, in bytes. */
|
||||
static uint32_t blockSize;
|
||||
|
||||
/**Size of the buffer used for read/write operations in bytes. */
|
||||
static uint32_t bufferSize;
|
||||
|
||||
/** Depending on DYN_TRACES, dwTraceLevel is a modifable runtime variable or a define */
|
||||
uint32_t dwTraceLevel;
|
||||
|
||||
uint32_t Spi_init_done = 0 ;
|
||||
struct _Mailbox *Pmailbox = 0 ;
|
||||
|
||||
uint8_t Spi_tx_buf[24] ;
|
||||
uint8_t Spi_rx_buf[24] ;
|
||||
|
||||
uint8_t Block_buffer[4096] ;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Global functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
uint32_t eeprom_write_one( uint8_t byte, uint8_t count ) ;
|
||||
uint32_t eeprom_read_status( void ) ;
|
||||
void eeprom_write_enable( void ) ;
|
||||
void eeprom_wait_busy( void ) ;
|
||||
uint32_t spi_operation( register uint8_t *tx, register uint8_t *rx, register uint32_t count ) ;
|
||||
void init_spi( void ) ;
|
||||
uint32_t unprotect_eeprom( void ) ;
|
||||
uint32_t spi_PDC_action( register uint8_t *command, register uint8_t *tx, register uint8_t *rx, register uint32_t comlen, register uint32_t count ) ;
|
||||
uint32_t eeprom_block_erased( register uint8_t *p) ;
|
||||
uint32_t eeprom_page_erased( register uint8_t *p) ;
|
||||
void AT25D_Read( uint8_t *BufferAddr, uint32_t size, uint32_t memoryOffset) ;
|
||||
void AT25D_Write( uint8_t *BufferAddr, uint32_t size, uint32_t memoryOffset ) ;
|
||||
uint32_t AT25D_EraseBlock( uint32_t memoryOffset ) ;
|
||||
//uint32_t min( uint32_t a, uint32_t b ) ;
|
||||
|
||||
|
||||
uint32_t eeprom_write_one( uint8_t byte, uint8_t count )
|
||||
{
|
||||
register Spi *spiptr ;
|
||||
register uint32_t result ;
|
||||
|
||||
spiptr = SPI ;
|
||||
spiptr->SPI_CR = 1 ; // Enable
|
||||
(void) spiptr->SPI_RDR ; // Dump any rx data
|
||||
|
||||
spiptr->SPI_TDR = byte ;
|
||||
|
||||
result = 0 ;
|
||||
while( ( spiptr->SPI_SR & SPI_SR_RDRF ) == 0 )
|
||||
{
|
||||
// wait for received
|
||||
if ( ++result > 10000 )
|
||||
{
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if ( count == 0 )
|
||||
{
|
||||
spiptr->SPI_CR = 2 ; // Disable
|
||||
return spiptr->SPI_RDR ;
|
||||
}
|
||||
(void) spiptr->SPI_RDR ; // Dump the rx data
|
||||
spiptr->SPI_TDR = 0 ;
|
||||
result = 0 ;
|
||||
while( ( spiptr->SPI_SR & SPI_SR_RDRF ) == 0 )
|
||||
{
|
||||
// wait for received
|
||||
if ( ++result > 10000 )
|
||||
{
|
||||
break ;
|
||||
}
|
||||
}
|
||||
spiptr->SPI_CR = 2 ; // Disable
|
||||
return spiptr->SPI_RDR ;
|
||||
}
|
||||
|
||||
|
||||
uint32_t eeprom_read_status()
|
||||
{
|
||||
return eeprom_write_one( 5, 1 ) ;
|
||||
}
|
||||
|
||||
|
||||
void eeprom_write_enable()
|
||||
{
|
||||
eeprom_write_one( 6, 0 ) ;
|
||||
}
|
||||
|
||||
void eeprom_wait_busy()
|
||||
{
|
||||
register uint32_t x ;
|
||||
register uint32_t y ;
|
||||
|
||||
y = 0 ;
|
||||
do
|
||||
{
|
||||
y += 1 ;
|
||||
if ( y > 1000000 )
|
||||
{
|
||||
break ;
|
||||
}
|
||||
x = eeprom_read_status() ;
|
||||
} while ( x & 1 ) ;
|
||||
|
||||
Pmailbox->argument.outputWrite.debug2 = y ;
|
||||
}
|
||||
|
||||
uint32_t spi_operation( register uint8_t *tx, register uint8_t *rx, register uint32_t count )
|
||||
{
|
||||
register Spi *spiptr ;
|
||||
register uint32_t result ;
|
||||
|
||||
// PMC->PMC_PCER0 |= 0x00200000L ; // Enable peripheral clock to SPI
|
||||
|
||||
result = 0 ;
|
||||
spiptr = SPI ;
|
||||
spiptr->SPI_CR = 1 ; // Enable
|
||||
(void) spiptr->SPI_RDR ; // Dump any rx data
|
||||
while( count )
|
||||
{
|
||||
result = 0 ;
|
||||
while( ( spiptr->SPI_SR & SPI_SR_TXEMPTY ) == 0 )
|
||||
{
|
||||
// wait
|
||||
if ( ++result > 10000 )
|
||||
{
|
||||
result = 0xFFFF ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if ( result > 10000 )
|
||||
{
|
||||
break ;
|
||||
}
|
||||
// if ( count == 1 )
|
||||
// {
|
||||
// spiptr->SPI_CR = SPI_CR_LASTXFER ; // LastXfer bit
|
||||
// }
|
||||
spiptr->SPI_TDR = *tx++ ;
|
||||
result = 0 ;
|
||||
while( ( spiptr->SPI_SR & SPI_SR_RDRF ) == 0 )
|
||||
{
|
||||
// wait for received
|
||||
if ( ++result > 10000 )
|
||||
{
|
||||
result = 0x2FFFF ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
if ( result > 10000 )
|
||||
{
|
||||
break ;
|
||||
}
|
||||
*rx++ = spiptr->SPI_RDR ;
|
||||
count -= 1 ;
|
||||
}
|
||||
if ( result <= 10000 )
|
||||
{
|
||||
result = 0 ;
|
||||
}
|
||||
spiptr->SPI_CR = 2 ; // Disable
|
||||
|
||||
// Power save
|
||||
// PMC->PMC_PCER0 &= ~0x00200000L ; // Disable peripheral clock to SPI
|
||||
|
||||
return result ;
|
||||
}
|
||||
|
||||
uint32_t spi_PDC_action( register uint8_t *command, register uint8_t *tx, register uint8_t *rx, register uint32_t comlen, register uint32_t count )
|
||||
{
|
||||
register Spi *spiptr ;
|
||||
// register uint32_t result ;
|
||||
register uint32_t condition ;
|
||||
static uint8_t discard_rx_command[4] ;
|
||||
|
||||
// PMC->PMC_PCER0 |= 0x00200000L ; // Enable peripheral clock to SPI
|
||||
|
||||
// Spi_complete = 0 ;
|
||||
if ( comlen > 4 )
|
||||
{
|
||||
// Spi_complete = 1 ;
|
||||
return 0x4FFFF ;
|
||||
}
|
||||
condition = SPI_SR_TXEMPTY ;
|
||||
spiptr = SPI ;
|
||||
spiptr->SPI_CR = 1 ; // Enable
|
||||
(void) spiptr->SPI_RDR ; // Dump any rx data
|
||||
(void) spiptr->SPI_SR ; // Clear error flags
|
||||
spiptr->SPI_RPR = (uint32_t)discard_rx_command ;
|
||||
spiptr->SPI_RCR = comlen ;
|
||||
if ( rx )
|
||||
{
|
||||
spiptr->SPI_RNPR = (uint32_t)rx ;
|
||||
spiptr->SPI_RNCR = count ;
|
||||
condition = SPI_SR_RXBUFF ;
|
||||
}
|
||||
spiptr->SPI_TPR = (uint32_t)command ;
|
||||
spiptr->SPI_TCR = comlen ;
|
||||
if ( tx )
|
||||
{
|
||||
spiptr->SPI_TNPR = (uint32_t)tx ;
|
||||
}
|
||||
else
|
||||
{
|
||||
spiptr->SPI_TNPR = (uint32_t)rx ;
|
||||
}
|
||||
spiptr->SPI_TNCR = count ;
|
||||
|
||||
spiptr->SPI_PTCR = SPI_PTCR_RXTEN | SPI_PTCR_TXTEN ; // Start transfers
|
||||
|
||||
// Wait for things to get started, avoids early interrupt
|
||||
for ( count = 0 ; count < 1000 ; count += 1 )
|
||||
{
|
||||
if ( ( spiptr->SPI_SR & SPI_SR_TXEMPTY ) == 0 )
|
||||
{
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
count = 0 ;
|
||||
while( ( spiptr->SPI_SR & condition ) == 0 )
|
||||
{
|
||||
if ( ++count > 1000000 )
|
||||
{
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
spiptr->SPI_CR = 2 ; // Disable
|
||||
(void) spiptr->SPI_RDR ; // Dump any rx data
|
||||
(void) spiptr->SPI_SR ; // Clear error flags
|
||||
spiptr->SPI_PTCR = SPI_PTCR_RXTDIS | SPI_PTCR_TXTDIS ; // Stop tramsfers
|
||||
|
||||
if ( count > 1000000 )
|
||||
{
|
||||
return 1 ;
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
||||
uint32_t unprotect_eeprom()
|
||||
{
|
||||
register uint8_t *p ;
|
||||
|
||||
eeprom_write_enable() ;
|
||||
|
||||
p = Spi_tx_buf ;
|
||||
*p = 0x39 ; // Unprotect sector command
|
||||
*(p+1) = 0 ;
|
||||
*(p+2) = 0 ;
|
||||
*(p+3) = 0 ; // 3 bytes address
|
||||
|
||||
return spi_operation( p, Spi_rx_buf, 4 ) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void init_spi()
|
||||
{
|
||||
register Pio *pioptr ;
|
||||
register Spi *spiptr ;
|
||||
register uint32_t timer ;
|
||||
register uint8_t *p ;
|
||||
uint8_t spi_buf[4] ;
|
||||
|
||||
if ( !Spi_init_done)
|
||||
{
|
||||
PMC->PMC_PCER0 |= 0x00200000L ; // Enable peripheral clock to SPI
|
||||
/* Configure PIO */
|
||||
pioptr = PIOA ;
|
||||
pioptr->PIO_ABCDSR[0] &= ~0x00007800 ; // Peripheral A bits 14,13,12,11
|
||||
pioptr->PIO_ABCDSR[1] &= ~0x00007800 ; // Peripheral A
|
||||
pioptr->PIO_PDR = 0x00007800 ; // Assign to peripheral
|
||||
|
||||
spiptr = SPI ;
|
||||
timer = ( 64000000 / 3000000 ) << 8 ;
|
||||
spiptr->SPI_MR = 0x14000011 ; // 0001 0100 0000 0000 0000 0000 0001 0001 Master
|
||||
spiptr->SPI_CSR[0] = 0x01180009 | timer ; // 0000 0001 0001 1000 xxxx xxxx 0000 1001
|
||||
// NVIC_EnableIRQ(SPI_IRQn) ;
|
||||
|
||||
p = spi_buf ;
|
||||
|
||||
// *p = 0x39 ; // Unprotect sector command
|
||||
// *(p+1) = 0 ;
|
||||
// *(p+2) = 0 ;
|
||||
// *(p+3) = 0 ; // 3 bytes address
|
||||
|
||||
// spi_operation( p, spi_buf, 4 ) ;
|
||||
|
||||
eeprom_write_enable() ;
|
||||
|
||||
*p = 1 ; // Write status register command
|
||||
*(p+1) = 0 ;
|
||||
spi_operation( p, spi_buf, 2 ) ;
|
||||
Spi_init_done = 1 ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uint32_t eeprom_block_erased( register uint8_t *p)
|
||||
{
|
||||
register uint32_t x ;
|
||||
register uint32_t result ;
|
||||
|
||||
result = 1 ;
|
||||
|
||||
for ( x = 0 ; x < 4096 ; x += 1 )
|
||||
{
|
||||
if ( *p++ != 0xFF )
|
||||
{
|
||||
result = 0 ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
return result ;
|
||||
}
|
||||
|
||||
uint32_t eeprom_page_erased( register uint8_t *p)
|
||||
{
|
||||
register uint32_t x ;
|
||||
register uint32_t result ;
|
||||
|
||||
result = 1 ;
|
||||
|
||||
for ( x = 0 ; x < 256 ; x += 1 )
|
||||
{
|
||||
if ( *p++ != 0xFF )
|
||||
{
|
||||
result = 0 ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
return result ;
|
||||
}
|
||||
|
||||
|
||||
void AT25D_Read( uint8_t *BufferAddr, uint32_t size, uint32_t memoryOffset)
|
||||
{
|
||||
register uint8_t *p ;
|
||||
|
||||
p = Spi_tx_buf ;
|
||||
*p = 3 ; // Read command
|
||||
*(p+1) = memoryOffset >> 16 ;
|
||||
*(p+2) = memoryOffset >> 8 ;
|
||||
*(p+3) = memoryOffset ; // 3 bytes address
|
||||
|
||||
spi_PDC_action( p, 0, BufferAddr, 4, size ) ;
|
||||
}
|
||||
|
||||
void AT25D_Write( uint8_t *BufferAddr, uint32_t size, uint32_t memoryOffset )
|
||||
{
|
||||
register uint8_t *p ;
|
||||
|
||||
eeprom_write_enable() ;
|
||||
|
||||
p = Spi_tx_buf ;
|
||||
*p = 2 ; // Write command
|
||||
*(p+1) = memoryOffset >> 16 ;
|
||||
*(p+2) = memoryOffset >> 8 ;
|
||||
*(p+3) = memoryOffset ; // 3 bytes address
|
||||
|
||||
spi_PDC_action( p, BufferAddr, 0, 4, size ) ;
|
||||
|
||||
eeprom_wait_busy() ;
|
||||
|
||||
}
|
||||
|
||||
uint32_t AT25D_EraseBlock( uint32_t memoryOffset )
|
||||
{
|
||||
register uint8_t *p ;
|
||||
register uint32_t x ;
|
||||
|
||||
eeprom_write_enable() ;
|
||||
p = Spi_tx_buf ;
|
||||
*p = 0x20 ; // Block Erase command
|
||||
*(p+1) = memoryOffset >> 16 ;
|
||||
*(p+2) = memoryOffset >> 8 ;
|
||||
*(p+3) = memoryOffset ; // 3 bytes address
|
||||
x = spi_operation( p, Spi_rx_buf, 4 ) ;
|
||||
|
||||
eeprom_wait_busy() ;
|
||||
return x ;
|
||||
}
|
||||
|
||||
//uint32_t min( uint32_t a, uint32_t b )
|
||||
//{
|
||||
// if ( a < b )
|
||||
// {
|
||||
// return a ;
|
||||
// }
|
||||
// return b ;
|
||||
//}
|
||||
|
||||
/**
|
||||
* \brief Applet main entry. This function decodes received command and executes it.
|
||||
* \param argc always 1
|
||||
* \param argv Address of the argument area.
|
||||
*/
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct _Mailbox *pMailbox = (struct _Mailbox *) argv;
|
||||
Pmailbox = pMailbox ;
|
||||
/* Communication type with SAM-BA GUI. */
|
||||
// uint8_t comType;
|
||||
|
||||
// uint32_t jedecId;
|
||||
uint32_t bytesToWrite, bytesToRead, bufferAddr, startMemoryOffset, memoryOffset, packetSize;
|
||||
/* index on read/write buffer */
|
||||
uint8_t *pBuffer;
|
||||
/* Temporary buffer used for non block aligned read/write */
|
||||
// uint32_t tempBufferAddr;
|
||||
/* Offset in destination buffer during buffer copy */
|
||||
// uint32_t bufferOffset;
|
||||
|
||||
uint32_t block_address ;
|
||||
uint32_t x ;
|
||||
/* INIT */
|
||||
/* Save communication link type */
|
||||
// comType = pMailbox->argument.inputInit.comType;
|
||||
|
||||
init_spi() ;
|
||||
|
||||
if (pMailbox->command == APPLET_CMD_INIT)
|
||||
{
|
||||
#if (DYN_TRACES == 1)
|
||||
dwTraceLevel = pMailbox->argument.inputInit.traceLevel;
|
||||
#endif
|
||||
|
||||
// TRACE_INFO("-- SerialFlash AT25/AT26 applet %s --\n\r", SAM_BA_APPLETS_VERSION);
|
||||
// TRACE_INFO("-- %s\n\r", BOARD_NAME);
|
||||
// TRACE_INFO("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);
|
||||
/* Configure pins */
|
||||
// PIO_Configure(pins, PIO_LISTSIZE(pins));
|
||||
/* Initialize DMA driver instance with polling mode */
|
||||
// DMAD_Initialize( &dmad, 1 );
|
||||
|
||||
/* Initialize the SPI and serial flash */
|
||||
init_spi() ;
|
||||
|
||||
|
||||
|
||||
// SPID_Configure(&spid, SPI0, ID_SPI0, &dmad);
|
||||
// AT25_Configure(&at25, &spid, SPI_CS, 1);
|
||||
// TRACE_INFO("SPI and AT25/AT25 drivers initialized\n\r");
|
||||
pMailbox->argument.outputInit.bufferAddress = (uint32_t) &end ;
|
||||
/* Read the JEDEC ID of the device to identify it */
|
||||
// jedecId = AT25D_ReadJedecId(&at25);
|
||||
// if (AT25_FindDevice(&at25, jedecId) == 0) {
|
||||
// pMailbox->status = APPLET_DEV_UNKNOWN;
|
||||
// pMailbox->argument.outputInit.bufferSize = 0;
|
||||
// pMailbox->argument.outputInit.memorySize = 0;
|
||||
// TRACE_INFO("Device Unknown\n\r");
|
||||
// goto exit;
|
||||
// }
|
||||
// else {
|
||||
/* Get device parameters */
|
||||
pMailbox->status = APPLET_SUCCESS;
|
||||
pageSize = 256 ;
|
||||
// pageSize = AT25_PageSize(&at25);
|
||||
blockSize = 4096 ;
|
||||
// blockSize = AT25_BlockSize(&at25);
|
||||
|
||||
/* Program page */
|
||||
// if (AT25_ManId(&at25) == SST_SPI_FLASH) {
|
||||
/* SST Flash write is slower, we reduce buffer size to avoid USB timeout */
|
||||
// bufferSize = 10 * pageSize;
|
||||
// }
|
||||
// else {
|
||||
bufferSize = 2 * blockSize;
|
||||
// }
|
||||
/* integer number of pages can be contained in each buffer */
|
||||
bufferSize -= bufferSize % pageSize;
|
||||
if ( bufferSize < pageSize) {
|
||||
// TRACE_INFO("No enought memory to load buffer.\n\r");
|
||||
goto exit;
|
||||
}
|
||||
pMailbox->argument.outputInit.bufferSize = bufferSize;
|
||||
pMailbox->argument.outputInit.memorySize = 128*4096;
|
||||
// TRACE_INFO("%s blockSize : 0x%lx bufferAddr : 0x%lx\n\r",
|
||||
// "sky9x", blockSize, pMailbox->argument.outputInit.bufferAddress);
|
||||
// }
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// WRITE:
|
||||
// ----------------------------------------------------------
|
||||
else if (pMailbox->command == APPLET_CMD_WRITE)
|
||||
{
|
||||
startMemoryOffset = pMailbox->argument.inputWrite.memoryOffset;
|
||||
memoryOffset = startMemoryOffset;
|
||||
bufferAddr = pMailbox->argument.inputWrite.bufferAddr;
|
||||
// tempBufferAddr = bufferAddr + bufferSize;
|
||||
bytesToWrite = pMailbox->argument.inputWrite.bufferSize;
|
||||
// TRACE_INFO("WRITE at offset: 0x%lx buffer at : 0x%lx of: 0x%lx Bytes\n\r",
|
||||
// memoryOffset, bufferAddr, bytesToWrite);
|
||||
/* Check word alignment */
|
||||
if (memoryOffset % 4) {
|
||||
|
||||
pMailbox->status = APPLET_ALIGN_ERROR;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
unprotect_eeprom() ;
|
||||
// if (AT25D_Unprotect(&at25)) {
|
||||
|
||||
// TRACE_INFO("Can not unprotect the flash\n\r");
|
||||
// pMailbox->status = APPLET_UNPROTECT_FAIL;
|
||||
// goto exit;
|
||||
// }
|
||||
|
||||
pBuffer = (uint8_t *) bufferAddr;
|
||||
|
||||
block_address = memoryOffset &0xFFFFF000 ; // 4k boundary
|
||||
AT25D_Read( Block_buffer, 4096, block_address ) ; // read block to write to
|
||||
// Check to see if it is blank
|
||||
x = eeprom_block_erased( Block_buffer ) ;
|
||||
if ( x == 0 )
|
||||
{
|
||||
AT25D_EraseBlock( block_address ) ;
|
||||
}
|
||||
|
||||
if (bytesToWrite)
|
||||
{
|
||||
uint32_t bytes_to_copy ;
|
||||
uint32_t i ;
|
||||
uint32_t j ;
|
||||
uint8_t *s ;
|
||||
uint8_t *dest ;
|
||||
|
||||
dest = Block_buffer + (memoryOffset & 0x0FFF ) ;
|
||||
s = pBuffer ;
|
||||
bytes_to_copy = 4096 - ( memoryOffset - block_address ) ;
|
||||
if ( bytes_to_copy > bytesToWrite )
|
||||
{
|
||||
bytes_to_copy = bytesToWrite ;
|
||||
}
|
||||
for ( i = 0 ; i < bytes_to_copy ; i += 1 )
|
||||
{
|
||||
*dest++ = *s++ ;
|
||||
}
|
||||
memoryOffset += bytes_to_copy ;
|
||||
bytesToWrite -= bytes_to_copy ;
|
||||
s = Block_buffer ;
|
||||
j = 0 ;
|
||||
for ( i = 0 ; i < 16 ; i += 1 ) // pages in block
|
||||
{
|
||||
j <<= 1 ;
|
||||
x = eeprom_page_erased( s ) ;
|
||||
if ( x == 0 ) // Not blank
|
||||
{
|
||||
AT25D_Write( s, 256, block_address ) ;
|
||||
j |= 1 ;
|
||||
}
|
||||
s += 256 ;
|
||||
block_address += 256 ;
|
||||
}
|
||||
pMailbox->argument.outputWrite.debug1 = j ;
|
||||
}
|
||||
|
||||
|
||||
// if ((memoryOffset % pageSize) != 0) {
|
||||
|
||||
// /* We are not page aligned, retrieve first page content to update it*/
|
||||
// if (memoryOffset < writtenAddress) {
|
||||
// lastErasedBlock = 0xFFFF;
|
||||
// }
|
||||
// /* Flush temp buffer */
|
||||
// memset((uint32_t *)tempBufferAddr, 0xFF, pageSize);
|
||||
|
||||
// bufferOffset = (memoryOffset % pageSize);
|
||||
// packetSize = pageSize - bufferOffset;
|
||||
// memoryOffset -= bufferOffset;
|
||||
// /* Read page to be updated*/
|
||||
// AT25D_Read( (uint8_t *) tempBufferAddr, pageSize, memoryOffset);
|
||||
// /* Fill retrieved page with data to be programmed */
|
||||
// memcpy((uint8_t *)(tempBufferAddr + bufferOffset), pBuffer, packetSize);
|
||||
|
||||
// if (((memoryOffset / blockSize) > lastErasedBlock) || (lastErasedBlock == 0xFFFF)) {
|
||||
// /* Erase the block to be updated */
|
||||
//// AT25D_EraseBlock( memoryOffset);
|
||||
// lastErasedBlock = (memoryOffset / blockSize);
|
||||
// }
|
||||
|
||||
// /* Write the page contents */
|
||||
//// AT25D_Write( (uint8_t *) tempBufferAddr, pageSize, memoryOffset);
|
||||
// bytesToWrite = (bytesToWrite > packetSize) ? (bytesToWrite - packetSize) : 0;
|
||||
// pBuffer += packetSize;
|
||||
// memoryOffset += pageSize;
|
||||
// writtenAddress = memoryOffset;
|
||||
// }
|
||||
|
||||
// /* If it remains more than one page to write */
|
||||
// while (bytesToWrite >= pageSize)
|
||||
// {
|
||||
// if (memoryOffset < writtenAddress)
|
||||
// {
|
||||
// lastErasedBlock = 0xFFFF;
|
||||
// }
|
||||
// if (((memoryOffset / blockSize) > lastErasedBlock) || (lastErasedBlock == 0xFFFF)) {
|
||||
// /* Erase the block to be updated */
|
||||
//// AT25D_EraseBlock( memoryOffset);
|
||||
// lastErasedBlock = (memoryOffset / blockSize);
|
||||
// }
|
||||
// /* Write the page contents */
|
||||
// AT25D_Write( (uint8_t *) pBuffer, pageSize, memoryOffset);
|
||||
// pBuffer += pageSize;
|
||||
// memoryOffset += pageSize;
|
||||
// bytesToWrite -= pageSize;
|
||||
// writtenAddress = memoryOffset;
|
||||
// }
|
||||
|
||||
// /* Write remaining data */
|
||||
// if (bytesToWrite > 0) {
|
||||
|
||||
// /* Read previous content of page */
|
||||
// AT25D_Read( (uint8_t *) tempBufferAddr, pageSize, memoryOffset);
|
||||
// /* Fill retrieved block with data to be programmed */
|
||||
// memcpy((uint8_t *)tempBufferAddr, pBuffer, bytesToWrite);
|
||||
// if (((memoryOffset / blockSize) > lastErasedBlock) || (lastErasedBlock == 0xFFFF)) {
|
||||
// /* Erase the block to be updated */
|
||||
//// AT25D_EraseBlock( memoryOffset);
|
||||
// lastErasedBlock = (memoryOffset / blockSize);
|
||||
// }
|
||||
// /* Write the page contents */;
|
||||
//// AT25D_Write( (uint8_t *) tempBufferAddr, pageSize, memoryOffset);
|
||||
// writtenAddress = memoryOffset + bytesToWrite;
|
||||
// /* No more bytes to write */
|
||||
// bytesToWrite = 0;
|
||||
// }
|
||||
|
||||
//// TRACE_INFO("WRITE return byte written : 0x%lx Bytes\n\r",
|
||||
//// pMailbox->argument.inputWrite.bufferSize - bytesToWrite);
|
||||
|
||||
pMailbox->argument.outputWrite.bytesWritten = pMailbox->argument.inputWrite.bufferSize - bytesToWrite;
|
||||
// pMailbox->argument.outputWrite.bytesWritten = bytesToWrite;
|
||||
pMailbox->status = APPLET_SUCCESS;
|
||||
}
|
||||
|
||||
// // ----------------------------------------------------------
|
||||
// // READ:
|
||||
// // ----------------------------------------------------------
|
||||
else if (pMailbox->command == APPLET_CMD_READ)
|
||||
{
|
||||
memoryOffset = pMailbox->argument.inputRead.memoryOffset;
|
||||
bufferAddr = pMailbox->argument.inputRead.bufferAddr;
|
||||
bytesToRead = pMailbox->argument.inputRead.bufferSize;
|
||||
|
||||
// TRACE_INFO("READ at offset: 0x%lx buffer at : 0x%lx of: 0x%lx Bytes\n\r",
|
||||
// memoryOffset, bufferAddr, bytesToRead);
|
||||
/* Check word alignment */
|
||||
if (memoryOffset % 4) {
|
||||
|
||||
pMailbox->status = APPLET_ALIGN_ERROR;
|
||||
goto exit;
|
||||
}
|
||||
pBuffer = (uint8_t *) bufferAddr;
|
||||
|
||||
/* Read packet after packets */
|
||||
while (((uint32_t)pBuffer < (bufferAddr + bufferSize)) && (bytesToRead > 0))
|
||||
{
|
||||
packetSize = bytesToRead ;
|
||||
if ( packetSize > MAX_COUNT )
|
||||
{
|
||||
packetSize = MAX_COUNT ;
|
||||
}
|
||||
AT25D_Read( pBuffer, packetSize, memoryOffset);
|
||||
pBuffer += packetSize;
|
||||
bytesToRead -= packetSize;
|
||||
memoryOffset += packetSize;
|
||||
}
|
||||
|
||||
// TRACE_INFO("READ return byte read : 0x%lx Bytes\n\r",
|
||||
// pMailbox->argument.inputRead.bufferSize - bytesToRead);
|
||||
|
||||
pMailbox->argument.outputRead.bytesRead = pMailbox->argument.inputRead.bufferSize - bytesToRead;
|
||||
pMailbox->status = APPLET_SUCCESS;
|
||||
}
|
||||
|
||||
// // ----------------------------------------------------------
|
||||
// // FULL ERASE:
|
||||
// // ----------------------------------------------------------
|
||||
else if (pMailbox->command == APPLET_CMD_FULL_ERASE)
|
||||
{
|
||||
pMailbox->status = APPLET_ERASE_FAIL;
|
||||
// TRACE_INFO("FULL ERASE\n\r");
|
||||
|
||||
// unprotect_eeprom() ;
|
||||
|
||||
// /* Unprotected the flash */
|
||||
//// if (AT25D_Unprotect(&at25)) {
|
||||
|
||||
//// TRACE_INFO("Can not unprotect the flash\n\r");
|
||||
//// pMailbox->status = APPLET_UNPROTECT_FAIL;
|
||||
//// goto exit;
|
||||
//// }
|
||||
|
||||
// TRACE_INFO("Flash unprotected\n\r");
|
||||
|
||||
// /* Erase the chip */
|
||||
// TRACE_INFO("Chip is being erased...\n\r");
|
||||
|
||||
//// if (AT25D_EraseChip()) {
|
||||
|
||||
// // NOT IMPLEMENTED (YET?)
|
||||
|
||||
// TRACE_INFO("Erasing error\n\r");
|
||||
// pMailbox->status = APPLET_ERASE_FAIL;
|
||||
// goto exit;
|
||||
//// }
|
||||
|
||||
// TRACE_INFO("Full Erase achieved\n\r");
|
||||
// pMailbox->status = APPLET_SUCCESS;
|
||||
}
|
||||
// // ----------------------------------------------------------
|
||||
// // BUFFER ERASE:
|
||||
// // ----------------------------------------------------------
|
||||
else if (pMailbox->command == APPLET_CMD_BUFFER_ERASE)
|
||||
{
|
||||
|
||||
// TRACE_INFO("BUFFER ERASE \n\r");
|
||||
/* Unprotected the flash */
|
||||
unprotect_eeprom() ;
|
||||
|
||||
// if (AT25D_Unprotect(&at25)) {
|
||||
|
||||
// TRACE_INFO("Can not unprotect the flash\n\r");
|
||||
// pMailbox->status = APPLET_UNPROTECT_FAIL;
|
||||
// goto exit;
|
||||
// }
|
||||
|
||||
memoryOffset = pMailbox->argument.inputBufferErase.memoryOffset;
|
||||
|
||||
if (AT25D_EraseBlock( memoryOffset))
|
||||
{
|
||||
pMailbox->status = APPLET_ERASE_FAIL;
|
||||
// TRACE_INFO("Block erasing error\n\r");
|
||||
goto exit;
|
||||
}
|
||||
pMailbox->argument.outputBufferErase.bytesErased = 4096;
|
||||
|
||||
// TRACE_INFO("Buffer Erase achieved\n\r");
|
||||
pMailbox->status = APPLET_SUCCESS;
|
||||
}
|
||||
exit:
|
||||
/* Acknowledge the end of command */
|
||||
// TRACE_INFO("\tEnd of applet (command : %lx --- status : %lx)\n\r", pMailbox->command, pMailbox->status);
|
||||
|
||||
/* Notify the host application of the end of the command processing */
|
||||
pMailbox->command = ~(pMailbox->command);
|
||||
/* Send ACK character */
|
||||
// if (comType == DBGU_COM_TYPE)
|
||||
// {
|
||||
/* Wait for the transmitter to be ready */
|
||||
// while ( (DBGU->DBGU_SR & DBGU_SR_TXEMPTY) == 0 ) ;
|
||||
/* Send character */
|
||||
// DBGU->DBGU_THR= 0x06 ;
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,734 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2011, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \page sam3s_ek_board_desc SAM3S-EK - Board Description
|
||||
*
|
||||
* \section Purpose
|
||||
*
|
||||
* A file is dedicated to descibe the AT91SAM3S-EK board.
|
||||
*
|
||||
* \section Contents
|
||||
*
|
||||
* - For AT91SAM3S-EK information, see \subpage sam3s_ek_board_info.
|
||||
* - For operating frequency information, see \subpage sam3s_ek_opfreq.
|
||||
* - For using portable PIO definitions, see \subpage sam3s_ek_piodef.
|
||||
* - For on-board memories, see \subpage sam3s_ek_mem.
|
||||
* - Several USB definitions are included here, see \subpage sam3s_ek_usb.
|
||||
* - For External components, see \subpage sam3s_ek_extcomp.
|
||||
* - For Individual chip definition, see \subpage sam3s_ek_chipdef.
|
||||
*
|
||||
* To get more software details and the full list of parameters related to the
|
||||
* SAM3S-EK board configuration, please have a look at the source file:
|
||||
* \ref board.h\n
|
||||
*
|
||||
* \section Usage
|
||||
*
|
||||
* - The code for booting the board is provided by board_cstartup_xxx.c and
|
||||
* board_lowlevel.c.
|
||||
* - For using board PIOs, board characteristics (clock, etc.) and external
|
||||
* components, see board.h.
|
||||
* - For manipulating memories, see board_memories.h.
|
||||
*
|
||||
* This file can be used as a template and modified to fit a custom board, with
|
||||
* specific PIOs usage or memory connections.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file board.h
|
||||
*
|
||||
* Definition of AT91SAM3S-EK characteristics, AT91SAM3S-dependant PIOs and
|
||||
* external components interfacing.
|
||||
*/
|
||||
|
||||
#ifndef _BOARD_
|
||||
#define _BOARD_
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include <chip.h>
|
||||
|
||||
|
||||
//#include <include/at45d.h>
|
||||
//#include <include/at45_spi.h>
|
||||
#include <include/board_lowlevel.h>
|
||||
//#include <include/board_memories.h>
|
||||
//#include <include/hamming.h>
|
||||
//#include <include/math.h>
|
||||
//#include <include/uart_console.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \page sam3s_ek_board_info "SAM3S-EK - Board informations"
|
||||
* This page lists several definition related to the board description.
|
||||
*
|
||||
* \section Definitions
|
||||
* - \ref BOARD_NAME
|
||||
*/
|
||||
|
||||
/** Name of the board */
|
||||
#define BOARD_NAME "ATSAM3S-EK"
|
||||
/** Board definition */
|
||||
#define atsam3sek
|
||||
/** Family definition (already defined) */
|
||||
#define atsam3s
|
||||
/** Core definition */
|
||||
#define cortexm3
|
||||
|
||||
/*
|
||||
#define BOARD_REV_A
|
||||
*/
|
||||
#define BOARD_REV_B
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \page sam3s_ek_opfreq "SAM3S-EK - Operating frequencies"
|
||||
* This page lists several definition related to the board operating frequency
|
||||
* (when using the initialization done by board_lowlevel.c).
|
||||
*
|
||||
* \section Definitions
|
||||
* - \ref BOARD_MAINOSC
|
||||
* - \ref BOARD_MCK
|
||||
*/
|
||||
|
||||
/** Frequency of the board main oscillator */
|
||||
#define BOARD_MAINOSC 12000000
|
||||
|
||||
/** Master clock frequency (when using board_lowlevel.c) */
|
||||
// #define BOARD_MCK 64000000
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \page sam3s_ek_piodef "SAM3S-EK - PIO definitions"
|
||||
* This pages lists all the pio definitions contained in board.h. The constants
|
||||
* are named using the following convention: PIN_* for a constant which defines
|
||||
* a single Pin instance (but may include several PIOs sharing the same
|
||||
* controller), and PINS_* for a list of Pin instances.
|
||||
*
|
||||
* ADC
|
||||
* - \ref PIN_ADC0_AD0
|
||||
* - \ref PIN_ADC0_AD1
|
||||
* - \ref PIN_ADC0_AD2
|
||||
* - \ref PIN_ADC0_AD3
|
||||
* - \ref PIN_ADC0_AD4
|
||||
* - \ref PIN_ADC0_AD5
|
||||
* - \ref PIN_ADC0_AD6
|
||||
* - \ref PIN_ADC0_AD7
|
||||
* - \ref PINS_ADC
|
||||
*
|
||||
* UART
|
||||
* - \ref PINS_UART
|
||||
*
|
||||
* EBI
|
||||
* - \ref PIN_EBI_DATA_BUS
|
||||
* - \ref PIN_EBI_NRD
|
||||
* - \ref PIN_EBI_NWE
|
||||
* - \ref PIN_EBI_NCS0
|
||||
* - \ref PIN_EBI_PSRAM_ADDR_BUS
|
||||
* - \ref PIN_EBI_PSRAM_NBS
|
||||
* - \ref PIN_EBI_A1
|
||||
* - \ref PIN_EBI_NCS1
|
||||
* - \ref PIN_EBI_LCD_RS
|
||||
*
|
||||
* LEDs
|
||||
* - \ref PIN_LED_0
|
||||
* - \ref PIN_LED_1
|
||||
* - \ref PIN_LED_2
|
||||
* - \ref PINS_LEDS
|
||||
*
|
||||
* MCI
|
||||
* - \ref PINS_MCI
|
||||
*
|
||||
* Push buttons
|
||||
* - \ref PIN_PUSHBUTTON_1
|
||||
* - \ref PIN_PUSHBUTTON_2
|
||||
* - \ref PINS_PUSHBUTTONS
|
||||
* - \ref PUSHBUTTON_BP1
|
||||
* - \ref PUSHBUTTON_BP2
|
||||
*
|
||||
* PWMC
|
||||
* - \ref PIN_PWMC_PWMH0
|
||||
* - \ref PIN_PWMC_PWML0
|
||||
* - \ref PIN_PWMC_PWMH1
|
||||
* - \ref PIN_PWMC_PWML1
|
||||
* - \ref PIN_PWMC_PWMH2
|
||||
* - \ref PIN_PWMC_PWML2
|
||||
* - \ref PIN_PWMC_PWMH3
|
||||
* - \ref PIN_PWMC_PWML3
|
||||
* - \ref PIN_PWM_LED0
|
||||
* - \ref PIN_PWM_LED1
|
||||
* - \ref PIN_PWM_LED2
|
||||
* - \ref CHANNEL_PWM_LED0
|
||||
* - \ref CHANNEL_PWM_LED1
|
||||
* - \ref CHANNEL_PWM_LED2
|
||||
*
|
||||
* SPI
|
||||
* - \ref PIN_SPI_MISO
|
||||
* - \ref PIN_SPI_MOSI
|
||||
* - \ref PIN_SPI_SPCK
|
||||
* - \ref PINS_SPI
|
||||
* - \ref PIN_SPI_NPCS0_PA11
|
||||
*
|
||||
* SSC
|
||||
* - \ref PIN_SSC_TD
|
||||
* - \ref PIN_SSC_TK
|
||||
* - \ref PIN_SSC_TF
|
||||
* - \ref PINS_SSC_CODEC
|
||||
*
|
||||
* PCK0
|
||||
* - \ref PIN_PCK0
|
||||
*
|
||||
* PIO PARALLEL CAPTURE
|
||||
* - \ref PIN_PIODCEN1
|
||||
* - \ref PIN_PIODCEN2
|
||||
*
|
||||
* TWI
|
||||
* - \ref TWI_V3XX
|
||||
* - \ref PIN_TWI_TWD0
|
||||
* - \ref PIN_TWI_TWCK0
|
||||
* - \ref PINS_TWI0
|
||||
* - \ref PIN_TWI_TWD1
|
||||
* - \ref PIN_TWI_TWCK1
|
||||
* - \ref PINS_TWI1
|
||||
*
|
||||
* USART0
|
||||
* - \ref PIN_USART0_RXD
|
||||
* - \ref PIN_USART0_TXD
|
||||
* - \ref PIN_USART0_CTS
|
||||
* - \ref PIN_USART0_RTS
|
||||
* - \ref PIN_USART0_SCK
|
||||
*
|
||||
* USB
|
||||
* - \ref PIN_USB_VBUS
|
||||
*
|
||||
* NandFlash
|
||||
* - \ref PIN_EBI_NANDOE
|
||||
* - \ref PIN_EBI_NANDWE
|
||||
* - \ref PIN_EBI_NANDCLE
|
||||
* - \ref PIN_EBI_NANDALE
|
||||
* - \ref PIN_EBI_NANDIO
|
||||
* - \ref BOARD_NF_CE_PIN
|
||||
* - \ref BOARD_NF_RB_PIN
|
||||
* - \ref PINS_NANDFLASH
|
||||
*
|
||||
* QTouch
|
||||
* PIO definitions for Slider
|
||||
* \ref SLIDER_IOMASK_SNS
|
||||
* \ref SLIDER_IOMASK_SNSK
|
||||
* \ref PINS_SLIDER_SNS
|
||||
* \ref PINS_SLIDER_SNSK
|
||||
*
|
||||
* PIO definitions for keys
|
||||
* \ref KEY_IOMASK_SNS
|
||||
* \ref KEY_IOMASK_SNSK
|
||||
* \ref PINS_KEY_SNS
|
||||
* \ref PINS_KEY_SNSK
|
||||
*
|
||||
* PIOS for QTouch
|
||||
* \ref PINS_QTOUCH
|
||||
*/
|
||||
|
||||
/** ADC_AD0 pin definition. */
|
||||
#define PIN_ADC0_AD0 {1 << 21, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
|
||||
/** ADC_AD1 pin definition. */
|
||||
#define PIN_ADC0_AD1 {1 << 30, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
|
||||
/** ADC_AD2 pin definition. */
|
||||
#define PIN_ADC0_AD2 {1 << 3, PIOB, ID_PIOB, PIO_INPUT, PIO_DEFAULT}
|
||||
/** ADC_AD3 pin definition. */
|
||||
#define PIN_ADC0_AD3 {1 << 4, PIOB, ID_PIOB, PIO_INPUT, PIO_DEFAULT}
|
||||
/** ADC_AD4 pin definition. */
|
||||
#define PIN_ADC0_AD4 {1 << 15, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
|
||||
/** ADC_AD5 pin definition. */
|
||||
#define PIN_ADC0_AD5 {1 << 16, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
|
||||
/** ADC_AD6 pin definition. */
|
||||
#define PIN_ADC0_AD6 {1 << 17, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
|
||||
/** ADC_AD7 pin definition. */
|
||||
#define PIN_ADC0_AD7 {1 << 18, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
|
||||
|
||||
/** Pins ADC */
|
||||
#define PINS_ADC PIN_ADC0_AD0, PIN_ADC0_AD1, PIN_ADC0_AD2, PIN_ADC0_AD3, PIN_ADC0_AD4, PIN_ADC0_AD5, PIN_ADC0_AD6, PIN_ADC0_AD7
|
||||
|
||||
/** Startup time max, return from Idle mode (in µs) */
|
||||
#define ADC_STARTUP_TIME_MAX 15
|
||||
/** Track and hold Acquisition Time min (in ns) */
|
||||
#define ADC_TRACK_HOLD_TIME_MIN 1200
|
||||
/** ADC clock frequence */
|
||||
#define BOARD_ADC_FREQ (6000000)
|
||||
|
||||
/** UART pins (UTXD0 and URXD0) definitions, PA9,10. */
|
||||
#define PINS_UART {0x00000600, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
|
||||
/** EBI Data Bus pins */
|
||||
#define PIN_EBI_DATA_BUS {0xFF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** EBI NRD pin */
|
||||
#define PIN_EBI_NRD {1 << 11, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** EBI NWE pin */
|
||||
#define PIN_EBI_NWE {1 << 8, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** EBI NCS0 pin */
|
||||
#define PIN_EBI_NCS0 {1 << 20, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** EBI pins for PSRAM address bus */
|
||||
#define PIN_EBI_PSRAM_ADDR_BUS {0x3f00fff, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** EBI pins for PSRAM NBS pins */
|
||||
#define PIN_EBI_PSRAM_NBS {1 << 7, PIOB, ID_PIOB, PIO_PERIPH_B, PIO_PULLUP}, \
|
||||
{1 << 15, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** EBI A1 pin */
|
||||
#define PIN_EBI_A1 {1 << 19, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** EBI NCS1 pin */
|
||||
#define PIN_EBI_NCS1 {1 << 15, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP} /* LCD CS pin */
|
||||
/** EBI pin for LCD RS */
|
||||
#define PIN_EBI_LCD_RS {1 << 19, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP} /* LCD RS pin */
|
||||
|
||||
#define LED_BLUE 0
|
||||
#define LED_GREEN 1
|
||||
#define LED_RED 2
|
||||
|
||||
#ifdef BOARD_REV_A
|
||||
/** LED #0 pin definition (BLUE). */
|
||||
#define PIN_LED_0 {PIO_PC20, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
|
||||
/** LED #1 pin definition (GREEN). */
|
||||
#define PIN_LED_1 {PIO_PC21, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
|
||||
/** LED #2 pin definition (RED). */
|
||||
#define PIN_LED_2 {PIO_PC22, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_REV_B
|
||||
/** LED #0 pin definition (BLUE). */
|
||||
#define PIN_LED_0 {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
|
||||
/** LED #1 pin definition (GREEN). */
|
||||
#define PIN_LED_1 {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
|
||||
/** LED #2 pin definition (RED). */
|
||||
#define PIN_LED_2 {PIO_PC20, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
|
||||
|
||||
#endif
|
||||
|
||||
/** List of all LEDs definitions. */
|
||||
#define PINS_LEDS PIN_LED_0, PIN_LED_1, PIN_LED_2
|
||||
|
||||
/** MCI pins definition. */
|
||||
#define PINS_MCI {0x3fUL << 26, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP}
|
||||
/** MCI pin Card Detect. */
|
||||
#ifdef BOARD_REV_A
|
||||
#define PIN_MCI_CD {PIO_PA15, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_REV_B
|
||||
#define PIN_MCI_CD {PIO_PA6, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
|
||||
#endif
|
||||
|
||||
/** Push button #0 definition. Attributes = pull-up + debounce + interrupt on rising edge. */
|
||||
#define PIN_PUSHBUTTON_1 {PIO_PB3, PIOB, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_RISE_EDGE}
|
||||
/** Push button #1 definition. Attributes = pull-up + debounce + interrupt on falling edge. */
|
||||
#define PIN_PUSHBUTTON_2 {PIO_PC12, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE}
|
||||
/** List of all push button definitions. */
|
||||
#define PINS_PUSHBUTTONS PIN_PUSHBUTTON_1, PIN_PUSHBUTTON_2
|
||||
|
||||
/** Push button #1 index. */
|
||||
#define PUSHBUTTON_BP1 0
|
||||
/** Push button #2 index. */
|
||||
#define PUSHBUTTON_BP2 1
|
||||
|
||||
/** Simulated joystick LEFT index. */
|
||||
#define JOYSTICK_LEFT 0
|
||||
/** Simulated joystick RIGHT index. */
|
||||
#define JOYSTICK_RIGHT 1
|
||||
|
||||
/** PWMC PWM0 pin definition: Output High. */
|
||||
#define PIN_PWMC_PWMH0 {PIO_PC18B_PWMH0, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
|
||||
/** PWMC PWM0 pin definition: Output Low. */
|
||||
#define PIN_PWMC_PWML0 {PIO_PA19B_PWML0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
|
||||
/** PWMC PWM1 pin definition: Output High. */
|
||||
#define PIN_PWMC_PWMH1 {PIO_PC19B_PWMH1, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
|
||||
/** PWMC PWM1 pin definition: Output Low. */
|
||||
#define PIN_PWMC_PWML1 {PIO_PA20B_PWML1, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
|
||||
/** PWMC PWM2 pin definition: Output High. */
|
||||
#define PIN_PWMC_PWMH2 {PIO_PC20B_PWMH2, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
|
||||
/** PWMC PWM2 pin definition: Output Low. */
|
||||
#define PIN_PWMC_PWML2 {PIO_PA16C_PWML2, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}
|
||||
/** PWMC PWM3 pin definition: Output High. */
|
||||
#define PIN_PWMC_PWMH3 {PIO_PC21B_PWMH3, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
|
||||
/** PWMC PWM3 pin definition: Output Low. */
|
||||
#define PIN_PWMC_PWML3 {PIO_PA15C_PWML3, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}
|
||||
/** PWM pins definition for LED0 */
|
||||
#define PIN_PWM_LED0 PIN_PWMC_PWMH0, PIN_PWMC_PWML0
|
||||
/** PWM pins definition for LED1 */
|
||||
#define PIN_PWM_LED1 PIN_PWMC_PWMH1, PIN_PWMC_PWML1
|
||||
/** PWM pins definition for LED2 */
|
||||
#define PIN_PWM_LED2 PIN_PWMC_PWMH2, PIN_PWMC_PWML2
|
||||
/** PWM channel for LED0 */
|
||||
#define CHANNEL_PWM_LED0 0
|
||||
/** PWM channel for LED1 */
|
||||
#define CHANNEL_PWM_LED1 1
|
||||
/** PWM channel for LED2 */
|
||||
#define CHANNEL_PWM_LED2 2
|
||||
|
||||
/** SPI MISO pin definition. */
|
||||
#define PIN_SPI_MISO {PIO_PA12A_MISO, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** SPI MOSI pin definition. */
|
||||
#define PIN_SPI_MOSI {PIO_PA13A_MOSI, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** SPI SPCK pin definition. */
|
||||
#define PIN_SPI_SPCK {PIO_PA14A_SPCK, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** SPI chip select pin definition. */
|
||||
#define PIN_SPI_NPCS0_PA11 {PIO_PA11A_NPCS0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** List of SPI pin definitions (MISO, MOSI & SPCK). */
|
||||
#define PINS_SPI PIN_SPI_MISO, PIN_SPI_MOSI, PIN_SPI_SPCK
|
||||
|
||||
/** SSC pin Transmitter Data (TD) */
|
||||
#define PIN_SSC_TD {PIO_PA17A_TD, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** SSC pin Transmitter Clock (TK) */
|
||||
#define PIN_SSC_TK {PIO_PA16A_TK, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** SSC pin Transmitter FrameSync (TF) */
|
||||
#define PIN_SSC_TF {PIO_PA15A_TF, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** SSC pins definition for codec. */
|
||||
#define PINS_SSC_CODEC PIN_SSC_TD, PIN_SSC_TK, PIN_SSC_TF
|
||||
|
||||
/** PCK0 */
|
||||
#define PIN_PCK0 {PIO_PA6B_PCK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
|
||||
#define PIN_PCK1 {PIO_PA17B_PCK1,PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
|
||||
|
||||
/** PIO PARALLEL CAPTURE */
|
||||
/** Parallel Capture Mode Data Enable1 */
|
||||
#define PIN_PIODCEN1 PIO_PA15
|
||||
/** Parallel Capture Mode Data Enable2 */
|
||||
#define PIN_PIODCEN2 PIO_PA16
|
||||
|
||||
/** TWI ver 3.xx */
|
||||
#define TWI_V3XX
|
||||
/** TWI0 data pin */
|
||||
#define PIN_TWI_TWD0 {PIO_PA3A_TWD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** TWI0 clock pin */
|
||||
#define PIN_TWI_TWCK0 {PIO_PA4A_TWCK0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** TWI0 pins */
|
||||
#define PINS_TWI0 PIN_TWI_TWD0, PIN_TWI_TWCK0
|
||||
/** TWI1 data pin */
|
||||
#define PIN_TWI_TWD1 {PIO_PB4A_TWD1, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** TWI1 clock pin */
|
||||
#define PIN_TWI_TWCK1 {PIO_PB5A_TWCK1, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** TWI1 pins */
|
||||
#define PINS_TWI1 PIN_TWI_TWD1, PIN_TWI_TWCK1
|
||||
|
||||
/** USART0 pin RX */
|
||||
#define PIN_USART0_RXD {PIO_PA5A_RXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** USART0 pin TX */
|
||||
#define PIN_USART0_TXD {PIO_PA6A_TXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** USART0 pin CTS */
|
||||
#define PIN_USART0_CTS {PIO_PA8A_CTS0, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** USART0 pin RTS */
|
||||
#define PIN_USART0_RTS {PIO_PA7A_RTS0, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** USART0 pin SCK */
|
||||
#define PIN_USART0_SCK {PIO_PA2B_SCK0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
|
||||
/** USART1 pin RX */
|
||||
#define PIN_USART1_RXD {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** USART1 pin TX */
|
||||
#define PIN_USART1_TXD {PIO_PA22A_TXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** USART1 pin CTS */
|
||||
#define PIN_USART1_CTS {PIO_PA25A_CTS1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** USART1 pin RTS */
|
||||
#define PIN_USART1_RTS {PIO_PA24A_RTS1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
/** USART1 pin ENABLE */
|
||||
#define PIN_USART1_EN {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
|
||||
/** USART1 pin SCK */
|
||||
#define PIN_USART1_SCK {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
|
||||
|
||||
/** USB VBus monitoring pin definition. */
|
||||
#ifdef BOARD_REV_A
|
||||
#define PIN_USB_VBUS {PIO_PC23, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP}
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_REV_B
|
||||
#define PIN_USB_VBUS {PIO_PC21, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP}
|
||||
#endif
|
||||
|
||||
/** NandFlash pins definition: OE. */
|
||||
#define PIN_EBI_NANDOE {PIO_PC9, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** NandFlash pins definition: WE. */
|
||||
#define PIN_EBI_NANDWE {PIO_PC10, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** NandFlash pins definition: CLE. */
|
||||
#define PIN_EBI_NANDCLE {PIO_PC17, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** NandFlash pins definition: ALE. */
|
||||
#define PIN_EBI_NANDALE {PIO_PC16, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
/** NandFlash pins definition: DATA. */
|
||||
#define PIN_EBI_NANDIO {0x000000FF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
|
||||
|
||||
/** Nandflash chip enable pin definition. */
|
||||
#define BOARD_NF_CE_PIN {PIO_PC14, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
|
||||
|
||||
/** Nandflash controller peripheral pins definition. */
|
||||
#define PINS_NANDFLASH PIN_EBI_NANDIO, BOARD_NF_CE_PIN, PIN_EBI_NANDOE, \
|
||||
PIN_EBI_NANDWE, PIN_EBI_NANDCLE, PIN_EBI_NANDALE
|
||||
|
||||
/* PIO definitions for Slider */
|
||||
#define SLIDER_IOMASK_SNS (uint32_t)(PIO_PA0 | PIO_PA2 | PIO_PA4)
|
||||
#define SLIDER_IOMASK_SNSK (uint32_t)(PIO_PA1 | PIO_PA3 | PIO_PA5)
|
||||
#define PINS_SLIDER_SNS {SLIDER_IOMASK_SNS, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
|
||||
#define PINS_SLIDER_SNSK {SLIDER_IOMASK_SNSK, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
|
||||
|
||||
/* PIO definitions for keys */
|
||||
#define KEY_IOMASK_SNS (uint32_t)(PIO_PC22 | PIO_PC24 | PIO_PC26 | PIO_PC28 | PIO_PC30)
|
||||
#define KEY_IOMASK_SNSK (uint32_t)(PIO_PC23 | PIO_PC25 | PIO_PC27 | PIO_PC29 | PIO_PC31)
|
||||
#define PINS_KEY_SNS {KEY_IOMASK_SNS, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
|
||||
#define PINS_KEY_SNSK {KEY_IOMASK_SNSK, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
|
||||
|
||||
/* PIOS for QTouch */
|
||||
#define PINS_QTOUCH PINS_SLIDER_SNS, PINS_SLIDER_SNSK, PINS_KEY_SNS, PINS_KEY_SNSK
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \page sam3s_ek_usb "SAM3S-EK - USB device"
|
||||
*
|
||||
* \section Definitions
|
||||
* - \ref BOARD_USB_BMATTRIBUTES
|
||||
* - \ref CHIP_USB_UDP
|
||||
* - \ref CHIP_USB_PULLUP_INTERNAL
|
||||
* - \ref CHIP_USB_NUMENDPOINTS
|
||||
* - \ref CHIP_USB_ENDPOINTS_MAXPACKETSIZE
|
||||
* - \ref CHIP_USB_ENDPOINTS_BANKS
|
||||
*/
|
||||
|
||||
/** USB attributes configuration descriptor (bus or self powered, remote wakeup) */
|
||||
#define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_SELFPOWERED_RWAKEUP
|
||||
|
||||
/** Indicates chip has an UDP Full Speed. */
|
||||
#define CHIP_USB_UDP
|
||||
|
||||
/** Indicates chip has an internal pull-up. */
|
||||
#define CHIP_USB_PULLUP_INTERNAL
|
||||
|
||||
/** Number of USB endpoints */
|
||||
#define CHIP_USB_NUMENDPOINTS 8
|
||||
|
||||
/** Endpoints max paxcket size */
|
||||
#define CHIP_USB_ENDPOINTS_MAXPACKETSIZE(i) \
|
||||
((i == 0) ? 64 : \
|
||||
((i == 1) ? 64 : \
|
||||
((i == 2) ? 64 : \
|
||||
((i == 3) ? 64 : \
|
||||
((i == 4) ? 512 : \
|
||||
((i == 5) ? 512 : \
|
||||
((i == 6) ? 64 : \
|
||||
((i == 7) ? 64 : 0 ))))))))
|
||||
|
||||
/** Endpoints Number of Bank */
|
||||
#define CHIP_USB_ENDPOINTS_BANKS(i) \
|
||||
((i == 0) ? 1 : \
|
||||
((i == 1) ? 2 : \
|
||||
((i == 2) ? 2 : \
|
||||
((i == 3) ? 1 : \
|
||||
((i == 4) ? 2 : \
|
||||
((i == 5) ? 2 : \
|
||||
((i == 6) ? 2 : \
|
||||
((i == 7) ? 2 : 0 ))))))))
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \page sam3s_ek_extcomp "SAM3S-EK - External components"
|
||||
* This page lists the definitions related to external on-board components
|
||||
* located in the board.h file for the AT91SAM3S-EK.
|
||||
*
|
||||
* SD Card
|
||||
* - \ref BOARD_SD_PINS
|
||||
* - \ref BOARD_SD_PIN_CD
|
||||
*
|
||||
* LCD
|
||||
* - \ref BOARD_LCD_ILI9325
|
||||
* - \ref BOARD_LCD_PINS
|
||||
* - \ref BOARD_BACKLIGHT_PIN
|
||||
* - \ref BOARD_LCD_BASE
|
||||
* - \ref BOARD_LCD_RS
|
||||
* - \ref BOARD_LCD_WIDTH
|
||||
* - \ref BOARD_LCD_HEIGHT
|
||||
*
|
||||
* TouchScreen
|
||||
* - \ref BOARD_TSC_ADS7843
|
||||
* - \ref PIN_TCS_IRQ
|
||||
* - \ref PIN_TCS_BUSY
|
||||
* - \ref BOARD_TSC_SPI_BASE
|
||||
* - \ref BOARD_TSC_SPI_ID
|
||||
* - \ref BOARD_TSC_SPI_PINS
|
||||
* - \ref BOARD_TSC_NPCS
|
||||
* - \ref BOARD_TSC_NPCS_PIN
|
||||
*
|
||||
* SmartCard
|
||||
* - \ref SMARTCARD_CONNECT_PIN
|
||||
* - \ref PIN_ISO7816_RSTMC
|
||||
* - \ref PINS_ISO7816
|
||||
*/
|
||||
|
||||
/** MCI pins that shall be configured to access the SD card. */
|
||||
#define BOARD_SD_PINS PINS_MCI
|
||||
/** MCI Card Detect pin. */
|
||||
#define BOARD_SD_PIN_CD PIN_MCI_CD
|
||||
|
||||
/** Indicates board has an ILI9325 external component to manage LCD. */
|
||||
#define BOARD_LCD_ILI9325
|
||||
|
||||
/** LCD pins definition. */
|
||||
#define BOARD_LCD_PINS PIN_EBI_DATA_BUS, PIN_EBI_NRD, PIN_EBI_NWE, PIN_EBI_NCS1, PIN_EBI_LCD_RS
|
||||
/** Backlight pin definition. */
|
||||
#define BOARD_BACKLIGHT_PIN {PIO_PC13, PIOC, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT}
|
||||
/** Define ILI9325 base address. */
|
||||
#define BOARD_LCD_BASE 0x61000000
|
||||
/** Define ILI9325 register select signal. */
|
||||
#define BOARD_LCD_RS (1 << 1)
|
||||
/** Display width in pixels. */
|
||||
#define BOARD_LCD_WIDTH 240
|
||||
/** Display height in pixels. */
|
||||
#define BOARD_LCD_HEIGHT 320
|
||||
|
||||
/** Indicates board has an ADS7843 external component to manage Touch Screen */
|
||||
#define BOARD_TSC_ADS7843
|
||||
|
||||
/** Touchscreen controller IRQ pin definition. */
|
||||
#ifdef BOARD_REV_A
|
||||
#define PIN_TSC_IRQ {PIO_PA4, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
|
||||
#define PIN_TSC_IRQ_WUP_ID (1 << 3)
|
||||
/** Touchscreen controller Busy pin definition. */
|
||||
#define PIN_TSC_BUSY {PIO_PA5, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
|
||||
#endif
|
||||
|
||||
#ifdef BOARD_REV_B
|
||||
#define PIN_TSC_IRQ {PIO_PA16, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
|
||||
#define PIN_TSC_IRQ_WUP_ID (1 << 15)
|
||||
/** Touchscreen controller Busy pin definition. */
|
||||
#define PIN_TSC_BUSY {PIO_PA17, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
|
||||
#endif
|
||||
|
||||
/** Base address of SPI peripheral connected to the touchscreen controller. */
|
||||
#define BOARD_TSC_SPI_BASE SPI
|
||||
/** Identifier of SPI peripheral connected to the touchscreen controller. */
|
||||
#define BOARD_TSC_SPI_ID ID_SPI
|
||||
/** Pins of the SPI peripheral connected to the touchscreen controller. */
|
||||
#define BOARD_TSC_SPI_PINS PINS_SPI
|
||||
/** Chip select connected to the touchscreen controller. */
|
||||
#define BOARD_TSC_NPCS 0
|
||||
/** Chip select pin connected to the touchscreen controller. */
|
||||
#define BOARD_TSC_NPCS_PIN PIN_SPI_NPCS0_PA11
|
||||
|
||||
/// Smartcard detection pin
|
||||
//#define SMARTCARD_CONNECT_PIN {1 << 13, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
|
||||
|
||||
/// PIN used for reset the smartcard
|
||||
#define PIN_ISO7816_RSTMC {1 << 11, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
|
||||
/// Pins used for connect the smartcard
|
||||
#define PINS_ISO7816 PIN_USART1_TXD, PIN_USART1_SCK, PIN_ISO7816_RSTMC
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \page sam3s_ek_mem "SAM3S-EK - Memories"
|
||||
* This page lists definitions related to internal & external on-board memories.
|
||||
*
|
||||
* \section SRAM
|
||||
* - \ref AT91C_ISRAM
|
||||
* - \ref AT91C_ISRAM_SIZE
|
||||
*
|
||||
* \section Flash
|
||||
* - \ref AT91C_IFLASH_SIZE
|
||||
* - \ref AT91C_IFLASH_PAGE_SIZE
|
||||
* - \ref AT91C_IFLASH_NB_OF_PAGES
|
||||
* - \ref AT91C_IFLASH_LOCK_REGION_SIZE
|
||||
* - \ref AT91C_IFLASH_NB_OF_LOCK_BITS
|
||||
*
|
||||
* \section NandFlash
|
||||
* - \ref BOARD_NF_COMMAND_ADDR
|
||||
* - \ref BOARD_NF_ADDRESS_ADDR
|
||||
* - \ref BOARD_NF_DATA_ADDR
|
||||
*
|
||||
* \section NorFlash
|
||||
* - \ref BOARD_NORFLASH_ADDR
|
||||
* - \ref BOARD_NORFLASH_DFT_BUS_SIZE
|
||||
*/
|
||||
|
||||
/** Address for transferring command bytes to the nandflash. */
|
||||
#define BOARD_NF_COMMAND_ADDR 0x60400000
|
||||
/** Address for transferring address bytes to the nandflash. */
|
||||
#define BOARD_NF_ADDRESS_ADDR 0x60200000
|
||||
/** Address for transferring data bytes to the nandflash. */
|
||||
#define BOARD_NF_DATA_ADDR 0x60000000
|
||||
|
||||
/** Address for transferring command bytes to the norflash. */
|
||||
#define BOARD_NORFLASH_ADDR 0x63000000
|
||||
/** Default NOR bus size after power up reset */
|
||||
#define BOARD_NORFLASH_DFT_BUS_SIZE 8
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \page sam3s_ek_chipdef "SAM3S-EK - Individual chip definition"
|
||||
* This page lists the definitions related to different chip's definition
|
||||
* located in the board.h file for the SAM3S-EK.
|
||||
*
|
||||
* \section USART
|
||||
* - \ref BOARD_PIN_USART_RXD
|
||||
* - \ref BOARD_PIN_USART_TXD
|
||||
* - \ref BOARD_PIN_USART_CTS
|
||||
* - \ref BOARD_PIN_USART_RTS
|
||||
* - \ref BOARD_PIN_USART_EN
|
||||
* - \ref BOARD_USART_BASE
|
||||
* - \ref BOARD_ID_USART
|
||||
*/
|
||||
|
||||
/** Rtc */
|
||||
#define BOARD_RTC_ID ID_RTC
|
||||
|
||||
/** TWI ID for EEPROM application to use */
|
||||
#define BOARD_ID_TWI_EEPROM ID_TWI1
|
||||
/** TWI ID for SLAVE application to use */
|
||||
#define BOARD_ID_TWI_SLAVE ID_TWI1
|
||||
/** TWI Base for TWI EEPROM application to use */
|
||||
#define BOARD_BASE_TWI_EEPROM TWI1
|
||||
/** TWI Base for TWI SLAVE application to use */
|
||||
#define BOARD_BASE_TWI_SLAVE TWI1
|
||||
/** TWI pins for EEPROM application to use */
|
||||
#define BOARD_PINS_TWI_EEPROM PINS_TWI1
|
||||
/** TWI pins for TWI SLAVE application to use */
|
||||
#define BOARD_PINS_TWI_SLAVE PINS_TWI1
|
||||
|
||||
/** USART RX pin for application */
|
||||
#define BOARD_PIN_USART_RXD PIN_USART1_RXD
|
||||
/** USART TX pin for application */
|
||||
#define BOARD_PIN_USART_TXD PIN_USART1_TXD
|
||||
/** USART CTS pin for application */
|
||||
#define BOARD_PIN_USART_CTS PIN_USART1_CTS
|
||||
/** USART RTS pin for application */
|
||||
#define BOARD_PIN_USART_RTS PIN_USART1_RTS
|
||||
/** USART ENABLE pin for application */
|
||||
#define BOARD_PIN_USART_EN PIN_USART1_EN
|
||||
/** USART Base for application */
|
||||
#define BOARD_USART_BASE USART1
|
||||
/** USART ID for application */
|
||||
#define BOARD_ID_USART ID_USART1
|
||||
|
||||
#endif /* #ifndef _BOARD_ */
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* Interface for the low-level initialization function.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BOARD_LOWLEVEL_H
|
||||
#define BOARD_LOWLEVEL_H
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Exported functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern void LowLevelInit( void ) ;
|
||||
|
||||
#endif /* BOARD_LOWLEVEL_H */
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Linker script for running in internal SRAM on the AT91SAM3S1
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(ResetException)
|
||||
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x00004000 /* sram, 16K */
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.fixed :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sfixed = .;
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
*(.ramfunc)
|
||||
*(.rodata*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
. = ALIGN(4);
|
||||
_efixed = .; /* End of text section */
|
||||
} > sram
|
||||
|
||||
.relocate : AT (_efixed)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_srelocate = .;
|
||||
*(.data)
|
||||
. = ALIGN(4);
|
||||
_erelocate = .;
|
||||
} >sram
|
||||
|
||||
.bss (NOLOAD) : {
|
||||
. = ALIGN(4);
|
||||
_szero = .;
|
||||
*(.bss)
|
||||
. = ALIGN(4);
|
||||
_ezero = .;
|
||||
} >sram
|
||||
|
||||
/* Stack in the end of SRAM */
|
||||
_estack = 0x20003FFC;
|
||||
|
||||
}
|
||||
end = .;
|
||||
@@ -1,91 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Linker script for running in internal SRAM on the AT91SAM3S1
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(entry)
|
||||
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x0800
|
||||
sram (W!RX) : ORIGIN = 0x20000800, LENGTH = 0x00003800 /* sram, 16K - sizeof(romcodesram) */
|
||||
}
|
||||
|
||||
/* Entry point */
|
||||
/*ENTRY (ResetException)*/
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* startup code in the .isr_vector */
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_stext = .;
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.mailbox)
|
||||
*(.text .text.*)
|
||||
*(.rodata .rodata.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.gcc_except_table)
|
||||
*(.rodata .rodata*)
|
||||
*(.gnu.linkonce.r.*)
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
} > sram
|
||||
|
||||
/* data */
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sidata = .;
|
||||
_sdata = .;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
. = ALIGN(4);
|
||||
_edata = .;
|
||||
} > sram
|
||||
|
||||
.bss (NOLOAD) : {
|
||||
_szero = .;
|
||||
*(.bss)
|
||||
. = ALIGN(4);
|
||||
_ezero = .;
|
||||
} >sram
|
||||
|
||||
/* Stack in SRAM */
|
||||
_sstack = 0x20003FFC;
|
||||
}
|
||||
end = .;
|
||||
@@ -1,81 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Linker script for running in internal SRAM on the AT91SAM3S2
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(ResetException)
|
||||
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* sram, 32K */
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.fixed :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sfixed = .;
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
*(.ramfunc)
|
||||
*(.rodata*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
. = ALIGN(4);
|
||||
_efixed = .; /* End of text section */
|
||||
} > sram
|
||||
|
||||
.relocate : AT (_efixed)
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_srelocate = .;
|
||||
*(.data)
|
||||
. = ALIGN(4);
|
||||
_erelocate = .;
|
||||
} >sram
|
||||
|
||||
.bss (NOLOAD) : {
|
||||
. = ALIGN(4);
|
||||
_szero = .;
|
||||
*(.bss)
|
||||
. = ALIGN(4);
|
||||
_ezero = .;
|
||||
} >sram
|
||||
|
||||
/* Stack in the end of SRAM */
|
||||
_estack = 0x20007FFC;
|
||||
|
||||
}
|
||||
end = .;
|
||||
@@ -1,91 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Linker script for running in internal SRAM on the AT91SAM3S2
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(entry)
|
||||
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x0800
|
||||
sram (W!RX) : ORIGIN = 0x20000800, LENGTH = 0x00007800 /* sram, 32K - sizeof(romcodesram) */
|
||||
}
|
||||
|
||||
/* Entry point */
|
||||
/*ENTRY (ResetException)*/
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* startup code in the .isr_vector */
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_stext = .;
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.mailbox)
|
||||
*(.text .text.*)
|
||||
*(.rodata .rodata.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.gcc_except_table)
|
||||
*(.rodata .rodata*)
|
||||
*(.gnu.linkonce.r.*)
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
} > sram
|
||||
|
||||
/* data */
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sidata = .;
|
||||
_sdata = .;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
. = ALIGN(4);
|
||||
_edata = .;
|
||||
} > sram
|
||||
|
||||
.bss (NOLOAD) : {
|
||||
_szero = .;
|
||||
*(.bss)
|
||||
. = ALIGN(4);
|
||||
_ezero = .;
|
||||
} >sram
|
||||
|
||||
/* Stack in SRAM */
|
||||
_sstack = 0x20007FFC;
|
||||
}
|
||||
end = .;
|
||||
@@ -1,215 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Linker script for running in internal SRAM on the AT91SAM3S4
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
OUTPUT_FORMAT ("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
ENTRY(_start)
|
||||
SEARCH_DIR(.)
|
||||
GROUP(-lgcc -lc -lcs3 -lcs3unhosted -lcs3micro)
|
||||
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x0000C000 /* sram, 48K */
|
||||
}
|
||||
|
||||
/* These force the linker to search for particular symbols from
|
||||
* the start of the link process and thus ensure the user's
|
||||
* overrides are picked up
|
||||
*/
|
||||
EXTERN(__cs3_reset_generic_m)
|
||||
INCLUDE atsam3s.inc
|
||||
EXTERN(__cs3_interrupt_vector_micro)
|
||||
EXTERN(__cs3_start_c main __cs3_stack __cs3_heap_end)
|
||||
|
||||
PROVIDE(__cs3_heap_start = _end);
|
||||
PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
|
||||
PROVIDE(__cs3_region_num = (__cs3_regions_end - __cs3_regions) / 20);
|
||||
PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
.text :
|
||||
{
|
||||
CREATE_OBJECT_SYMBOLS
|
||||
__cs3_region_start_ram = .;
|
||||
*(.cs3.region-head.ram)
|
||||
ASSERT (. == __cs3_region_start_ram, ".cs3.region-head.ram not permitted");
|
||||
__cs3_interrupt_vector = __cs3_interrupt_vector_micro;
|
||||
*(.cs3.interrupt_vector)
|
||||
/* Make sure we pulled in an interrupt vector. */
|
||||
ASSERT (. != __cs3_interrupt_vector_micro, "No interrupt vector");
|
||||
|
||||
_start = __cs3_reset_generic_m;
|
||||
__cs3_reset = __cs3_reset_generic_m;
|
||||
*(.cs3.reset)
|
||||
/* Make sure we pulled in some reset code. */
|
||||
ASSERT (. != __cs3_reset, "No reset code");
|
||||
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.plt)
|
||||
*(.gnu.warning)
|
||||
*(.glue_7t) *(.glue_7) *(.vfp11_veneer)
|
||||
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
*(.gcc_except_table)
|
||||
} >ram
|
||||
.eh_frame_hdr : ALIGN (4)
|
||||
{
|
||||
KEEP (*(.eh_frame_hdr))
|
||||
} >ram
|
||||
.eh_frame : ALIGN (4)
|
||||
{
|
||||
KEEP (*(.eh_frame))
|
||||
} >ram
|
||||
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} >ram
|
||||
__exidx_end = .;
|
||||
.rodata : ALIGN (4)
|
||||
{
|
||||
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.init))
|
||||
|
||||
. = ALIGN(4);
|
||||
__preinit_array_start = .;
|
||||
KEEP (*(.preinit_array))
|
||||
__preinit_array_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__init_array_start = .;
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
__init_array_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.fini))
|
||||
|
||||
. = ALIGN(4);
|
||||
__fini_array_start = .;
|
||||
KEEP (*(.fini_array))
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
__fini_array_end = .;
|
||||
|
||||
. = ALIGN(0x4);
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*crtend.o(.ctors))
|
||||
|
||||
. = ALIGN(0x4);
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*crtend.o(.dtors))
|
||||
|
||||
. = ALIGN(4);
|
||||
__cs3_regions = .;
|
||||
LONG (0)
|
||||
LONG (__cs3_region_init_ram)
|
||||
LONG (__cs3_region_start_ram)
|
||||
LONG (__cs3_region_init_size_ram)
|
||||
LONG (__cs3_region_zero_size_ram)
|
||||
__cs3_regions_end = .;
|
||||
|
||||
. = ALIGN (8);
|
||||
_etext = .;
|
||||
} >ram
|
||||
|
||||
.data : ALIGN (8)
|
||||
{
|
||||
|
||||
KEEP(*(.jcr))
|
||||
*(.got.plt) *(.got)
|
||||
*(.shdata)
|
||||
*(.data .data.* .gnu.linkonce.d.*)
|
||||
. = ALIGN (8);
|
||||
*(.ram)
|
||||
_edata = .;
|
||||
} >ram
|
||||
.bss :
|
||||
{
|
||||
*(.shbss)
|
||||
*(.bss .bss.* .gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
. = ALIGN (8);
|
||||
*(.ram.b)
|
||||
_end = .;
|
||||
__end = .;
|
||||
} >ram
|
||||
__cs3_region_init_ram = __cs3_region_start_ram;
|
||||
__cs3_region_init_size_ram = _edata - __cs3_region_start_ram;
|
||||
__cs3_region_zero_size_ram = _end - _edata;
|
||||
/* Default to 1M of heap */
|
||||
__cs3_region_size_ram = ALIGN (1024) - __cs3_region_start_ram + 1M;
|
||||
|
||||
.stab 0 (NOLOAD) : { *(.stab) }
|
||||
.stabstr 0 (NOLOAD) : { *(.stabstr) }
|
||||
/* DWARF debug sections.
|
||||
* Symbols in the DWARF debugging sections are relative to the beginning
|
||||
* of the section so we begin them at 0. */
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
/* DWARF 2.1 */
|
||||
.debug_ranges 0 : { *(.debug_ranges) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
|
||||
.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
|
||||
.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
|
||||
/DISCARD/ : { *(.note.GNU-stack) }
|
||||
}
|
||||
/* checksum: 576d003e2604ff7a1b02791267 */
|
||||
@@ -1,91 +0,0 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Linker script for running in internal SRAM on the AT91SAM3S4
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(entry)
|
||||
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x01000
|
||||
sram (W!RX) : ORIGIN = 0x20001000, LENGTH = 0x0000B000 /* sram, 48K - sizeof(romcodesram) */
|
||||
}
|
||||
|
||||
/* Entry point */
|
||||
/*ENTRY (ResetException)*/
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* startup code in the .isr_vector */
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_stext = .;
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.mailbox)
|
||||
*(.text .text.*)
|
||||
*(.rodata .rodata.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.gcc_except_table)
|
||||
*(.rodata .rodata*)
|
||||
*(.gnu.linkonce.r.*)
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
} > sram
|
||||
|
||||
/* data */
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sidata = .;
|
||||
_sdata = .;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
. = ALIGN(4);
|
||||
_edata = .;
|
||||
} > sram
|
||||
|
||||
.bss (NOLOAD) : {
|
||||
_szero = .;
|
||||
*(.bss)
|
||||
. = ALIGN(4);
|
||||
_ezero = .;
|
||||
} >sram
|
||||
|
||||
/* Stack in SRAM */
|
||||
_sstack = 0x2000BFFC;
|
||||
}
|
||||
end = .;
|
||||
@@ -1,63 +0,0 @@
|
||||
#ifndef _LIB_ATSAM3S_
|
||||
#define _LIB_ATSAM3S_
|
||||
|
||||
/*
|
||||
* Peripherals registers definitions
|
||||
*/
|
||||
#if defined atsam3s4
|
||||
#include <include/ATSAM3S4.h>
|
||||
#elif defined atsam3s2
|
||||
#include <include/ATSAM3S2.h>
|
||||
#elif defined atsam3s1
|
||||
#include <include/ATSAM3S1.h>
|
||||
#else
|
||||
#warning Library does not support the specified chip, specifying atsam3s4.
|
||||
#define atsam3s4
|
||||
#include <include/ATSAM3S4.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Define attribute */
|
||||
#if defined ( __CC_ARM ) /* Keil µVision 4 */
|
||||
#define WEAK __attribute__ ((weak))
|
||||
#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
|
||||
#define WEAK __weak
|
||||
#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */
|
||||
#define WEAK __attribute__ ((weak))
|
||||
#endif
|
||||
|
||||
/* Define NO_INIT attribute */
|
||||
#if defined ( __CC_ARM )
|
||||
#define NO_INIT
|
||||
#elif defined ( __ICCARM__ )
|
||||
#define NO_INIT __no_init
|
||||
#elif defined ( __GNUC__ )
|
||||
#define NO_INIT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Core
|
||||
*/
|
||||
|
||||
/*
|
||||
* Peripherals
|
||||
*/
|
||||
//#include <include/async.h>
|
||||
//#include <include/efc.h>
|
||||
//#include <include/flashd.h>
|
||||
//#include <include/pio.h>
|
||||
//#include <include/pmc.h>
|
||||
//#include <include/spi.h>
|
||||
//#include <include/spi_pdc.h>
|
||||
//#include <include/twi.h>
|
||||
//#include <include/twid.h>
|
||||
//#include <include/usart.h>
|
||||
|
||||
/*
|
||||
#include <USBD_Config.h>
|
||||
*/
|
||||
|
||||
//#include <include/trace.h>
|
||||
//#include <include/wdt.h>
|
||||
|
||||
#endif /* _LIB_ATSAM3S_ */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
-235
@@ -1,235 +0,0 @@
|
||||
******************************************
|
||||
CHANGELOG: 07-05-2012 BSS
|
||||
AutoSwitch feature added
|
||||
Mix Warning was not so regular (sometime 2 ticks instead of 3)
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 06-05-2012 BSS
|
||||
FW options now stored in a byte of the EEPROM
|
||||
[Arm] getSwitch() problem with Custom Switches
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 05-05-2012 BSS
|
||||
[FrSky] Speed in Gauges configuration was buggy
|
||||
[FrSky] We stored Min Speed instead of Max Speed
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 04-05-2012 BSS
|
||||
Momentary Switches in Function Switches
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 03-05-2012 BSS
|
||||
[Arm] Audio / Haptic refactoring
|
||||
[Arm] Timer blocked at 10:55
|
||||
[V4] SDcard menu reworked
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 02-05-2012 BSS
|
||||
[V4/Arm] Problem in Models Move
|
||||
[stock] Flash saving (840bytes)
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 01-05-2012 BSS
|
||||
[FrSky] GPS distance bug fix
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 29-04-2012 BSS
|
||||
[V4/Arm] EEPROM marked as dirty on reboot
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 27-04-2012 BSS
|
||||
Vario feature added
|
||||
New EEPROM format 205
|
||||
[FrSky] Telemetry offset for A1/A2 on 12bits
|
||||
[V4] Models with empty name bug when SDcard backup
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 26-04-2012 BSS
|
||||
[Arm] 32Channels 9Phases 64Mixes 32Expos 32VSwitches 32FSwitches
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 23-04-2012 BSS
|
||||
[V4] SDcard Models storage implemented
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 20-04-2012 BSS
|
||||
[Stock] 400bytes flash saving
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 15-03-2012 BSS
|
||||
FAAST option in protocol to enable startPulses before the splash screen
|
||||
Telemetry configurable screen
|
||||
Confirmation before applying templates
|
||||
Used channels cleaned before applying a template
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 14-03-2012 BSS
|
||||
Potscroll option added
|
||||
|
||||
******************************************
|
||||
|
||||
Version 364:
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 04-03-2012 BSS
|
||||
New EEPROM format 205
|
||||
Introduction of differential in Mixers
|
||||
Introduction of Switches as Mixer Source (FULL now removed)
|
||||
Negative curves in Mixers
|
||||
Optimizations in Mixer
|
||||
Extended chars for localization
|
||||
Swedish translations
|
||||
Beep length updated
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 01-03-2012 BSS
|
||||
Feature "Use THR trim as a slider" now finished
|
||||
[FrSky] Jitter (2us) introduced by last optimization removed
|
||||
Trim parameter in Mixer is OFF if the source is not a stick
|
||||
GPS distance fixed
|
||||
|
||||
******************************************
|
||||
|
||||
Version 304:
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 28-02-2012 BSS
|
||||
Flash saving (600bytes)
|
||||
[FrSky] NO DATA displayed on the status line when nothing received
|
||||
Sticks/Pots center beep now more accurate
|
||||
Beeps length for center beep and inactivity reduced
|
||||
Vibration when MIN/MID/MAX trim position reached
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 27-02-2012 BSS
|
||||
Flash saving (idea from er9x)
|
||||
Trims2Offsets function removed
|
||||
A "Safety CHxx" function is not applied when it is currently edited
|
||||
The Stick Mode needs confirmation before being applied
|
||||
|
||||
******************************************
|
||||
|
||||
Version 288:
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 24-02-2012 BSS
|
||||
Throttle Trace bug solved when using P1-P3
|
||||
New way of dealing with recursive mixers in Flight Phases (with FadeIn / FadeOut)
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 23-02-2012 BSS
|
||||
PXX updates + optimizations pulled from er9x
|
||||
FrSky TELEMETRY menu is now moved to [DOWN long]
|
||||
Optimizations
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 22-02-2012 BSS
|
||||
Blades count may now be 4
|
||||
V4: New mixers/expos fields inflight modifiable through RE1
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 21-02-2012 BSS
|
||||
V4: Logs format ported from gruvin9x
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 20-02-2012 BSS
|
||||
Last GPS coords displayed even when streaming stops (model lost)
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 19-02-2012 BSS
|
||||
V4: Inflight fields modification through RE1 feature added
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 17-02-2012 BSS
|
||||
RSSI thresholds on a per model basis
|
||||
Flash Saving
|
||||
FrSky Hub variometer + cells voltage fix
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 16-02-2012 BSS
|
||||
Beeper mode splitted from Beeper length
|
||||
Haptic redesigned
|
||||
No FrSky alarms when Tx asked to be quiet
|
||||
Flash Saving
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 14-02-2012 BSS
|
||||
Blades count configuration for RPMs
|
||||
Instant trim bug fixed for stick modes != RETA
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 1O-02-2012 BSS
|
||||
Copyright updated
|
||||
GPS distance and speed bug fixes
|
||||
|
||||
******************************************
|
||||
|
||||
Version 232:
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 09-02-2012 BSS
|
||||
Multiplier added for telemetry A1/A2 => 204.0v!
|
||||
GPS distance added
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 08-02-2012 BSS
|
||||
Telemetry bars screen
|
||||
Add individual cell voltages from FrSky Hub 2.0
|
||||
New units for A1/A2
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 06-02-2012 BSS
|
||||
Flash saving
|
||||
Telemetry screens redesigned
|
||||
|
||||
******************************************
|
||||
|
||||
Version 213:
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 05-02-2012 BSS
|
||||
Add GPS speed display, with max speed
|
||||
GPS screen redesigned
|
||||
|
||||
******************************************
|
||||
|
||||
Version 205:
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 04-02-2012 BSS
|
||||
New way of configuring A1 and A2 using Range and Offset
|
||||
Named sounds in Func Switches
|
||||
Haptic only sounds skipped when HAPTIC option disable
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 03-02-2012 BSS
|
||||
Safety switches screen removed (moved to Func Switches)
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 02-02-2012 BSS
|
||||
French translations updated
|
||||
AUDIO optimizations
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 01-02-2012 BSS
|
||||
AUDIO and HAPTIC may be enabled separately
|
||||
AUDIO bug fixes
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 31-01-2012 BSS
|
||||
HAPTIC now working
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 29-01-2012 BSS
|
||||
Inactivity timer reset on Keys and Trims press
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 28-01-2012 BSS
|
||||
New splash
|
||||
|
||||
******************************************
|
||||
CHANGELOG: 27-01-2012 BSS
|
||||
NMEA and ARDUPILOT ported from er9x
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
<h2>Version 2.0.13 / 2014-11-20</h2>
|
||||
<ul>
|
||||
<li>Too many curves shown on non ARM boards</li>
|
||||
<li>Fixed vario limits</li>
|
||||
<li>Fixes in compare dialog</li>
|
||||
<li>Fixed receiver number range</li>
|
||||
<li>Virtual inputs not selectable in SF Volume and heli Collective Source</li>
|
||||
<li>Joystick calibration crash after channel assignment</li>
|
||||
<li>Gvar import error for limits</li>
|
||||
<li>Companion shows too many curve types in input/mixer for 9x</li>
|
||||
<li>NOT curves removed from inputs (for non ARM platforms)</li>
|
||||
<li>Companion again builds on OS X (Mac)</li>
|
||||
<li>Companion simulator Lua crash on OS X 64bit (Mac)</li>
|
||||
<li>Companion didn't take care of PlayScript functions</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.12 / 2014-09-15</h2>
|
||||
<ul>
|
||||
<li>Typos & Translations updated</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.11 / 2014-09-10</h2>
|
||||
<ul>
|
||||
<li>Limits EEPROM export was broken (all boards except Taranis)</li>
|
||||
<li>Fix issue when a GVAR was used as Offset</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.10 / 2014-09-08</h2>
|
||||
<ul>
|
||||
<li>Taranis is now the default board in General Settings</li>
|
||||
<li>GVARS allowed in Limits min/max/offset</li>
|
||||
<li>Limits displayed in us when ppmus option selected
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.8 / 2014-07-23</h2>
|
||||
<ul>
|
||||
<li>Compare dialog bugfixes</li>
|
||||
<li>Curve index correctly resetted when type changed</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.7</h2>
|
||||
<ul>
|
||||
<li>SafetyCH function was missing in simulator</li>
|
||||
<li>EEPROM export warning when exporting logical switches > L12 on 9X128</li>
|
||||
<li>FAS offset was not exported on 9X/9XR boards</li>
|
||||
<li>Trims modes bugfix on non Taranis boards</li>
|
||||
<li>It was impossible to open a backuped model from the Tx</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.6</h2>
|
||||
<ul>
|
||||
<li>Fix Mix curves bug on Sky9x boards</li>
|
||||
<li>Channels 17-32 are displayed in the simulator</li>
|
||||
<li>Backlight simulation bugfix</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.5</h2>
|
||||
<ul>
|
||||
<li>Fix crash on startup</li>
|
||||
<li>Fix version number in simu</li>
|
||||
<li>9XR-Pro now supported on Mac</li>
|
||||
<li>Fix loss of settings in telemetry custom screens</li>
|
||||
<li>Fix 10000% bug when using GVs in mixer weithg or offset</li>
|
||||
<li>Fix Cnsp range in logical switches (up to 30000mAh)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.4</h2>
|
||||
<ul>
|
||||
<li>Sound should be ok on all platforms</li>
|
||||
<li>Min/Max reviewed in Logical switches (for the whole telemetry)</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.3</h2>
|
||||
<ul>
|
||||
<li>EEPROM import bug on AdjustGVAR function</li>
|
||||
<li>Timers correctly displayed in logical switches tab</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.2</h2>
|
||||
<ul>
|
||||
<li>Mouse scroll wheel behaves differently</li>
|
||||
<li>Play Sounds should now work on all platforms</li>
|
||||
<li>A lot of small bug fixes</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.1</h2>
|
||||
<ul>
|
||||
<li>Fix on recursive GVars</li>
|
||||
<li>Sky9x EEPROM read/write fix</li>
|
||||
<li>Translations updated
|
||||
<li>Wizard fixes
|
||||
<li>Fix on invalid splashes bitmaps
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.0</h2>
|
||||
<ul>
|
||||
<li>Companion now merged into OpenTX</li>
|
||||
<li>Too many changes to list them all!</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.52</h2>
|
||||
<ul>
|
||||
<li>Fix crash when writing certain EEPROMS</li>
|
||||
<li>Google Earth export of logs containing GPS positions</li>
|
||||
<li>DSM2 added for Taranis</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.51</h2>
|
||||
<ul>
|
||||
<li>Wrong DFU-Util default path (MAC)</li>
|
||||
<li>new voices download server (ip address changed to new fiber connection)</li>
|
||||
<li>Fixed contributor list</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.50</h2>
|
||||
<ul>
|
||||
<li>solved issue with taranis radio with some linux distributions</li>
|
||||
<li>blank eeprom created using a radio profile that holds calibration data, will contain calibration data from the profile</li>
|
||||
<li>new opentx compilation server (ip address changed to new fiber connection)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.49</h2>
|
||||
<ul>
|
||||
<li>Stack usage optimizations</li>
|
||||
<li>Playsound order is misaligned between companion9x and the TX</li>
|
||||
<li>Model image could not be reset.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.48</h2>
|
||||
<ul>
|
||||
<li>Interface fixes</li>
|
||||
<li>Hide include dr/expo when not applicable</li>
|
||||
<li>Fix extraction of grayscale images from taranis firmwares</li>
|
||||
<li>No TX and RX in Taranis telemetry fields</li>
|
||||
<li>Issue 255 fixed - "No GVAR selection possible for PLAY VALUE"</li>
|
||||
<li>Issue 254 fixed - "SE Language for building opentx"</li>
|
||||
<li>Issue 253 fixed - "OpenTX doesn't accept this protocol (DSM2 on Sky9x)"</li>
|
||||
<li>Prevent segfault while parsing wrong log files or files with broken lines</li>
|
||||
<li>Small bug in model printout</li>
|
||||
<li>Fixed wrong display of values in custom functions</li>
|
||||
<li>Image in preferences was saved only black & white</li>
|
||||
<li>Issue 247 fixed - "Labelled items on radio should not be translated."</li>
|
||||
<li>Added support of tstick (taranis like stick) compile option for sky9x opentx firmware</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.47</h2>
|
||||
<ul>
|
||||
<li>Interface fixes (issues 232,233,238,241)</li>
|
||||
<li>Fix for print/compare models</li>
|
||||
<li>Function switch parameter on screen different than printout.</li>
|
||||
<li>Translations fixes</li>
|
||||
<li>Command line print mode</li>
|
||||
<li>Better mavlink support</li>
|
||||
<li>SE tts language added for taranis</li>
|
||||
<li>Alternate font option for opentx added</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.46</h2>
|
||||
<ul>
|
||||
<li>Interface fixes (issues 224,225)</li>
|
||||
<li>Show persistent timers value in modeledit</li>
|
||||
<li>Consistent naming of Custom Switches in c9x</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.45</h2>
|
||||
<ul>
|
||||
<li>Various fixes</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.44</h2>
|
||||
<ul>
|
||||
<li>Fix regression on AND parameter in custom functions</li>
|
||||
<li>Add mavlink support for stock and m128 boards</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.43</h2>
|
||||
<ul>
|
||||
<li>Copy Malfunctions in Custom Functions (Issue 205)</li>
|
||||
<li>Enable repeat parameter in functions for all boards</li>
|
||||
<li>Remove sink tones from vario for stock/m128 board</li>
|
||||
<li>Fix for wrongly named channels in mixerlist (Issue 210)</li>
|
||||
<li>Fix badly exported gvars in mixers</li>
|
||||
<li>Fix while editing custom switches</li>
|
||||
<li>Add access to the release notes of currently selected firmware</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.42</h2>
|
||||
<ul>
|
||||
<li>Add Companion9X changelog</li>
|
||||
<li>Add Fw release notes browser</li>
|
||||
<li>Simplify burn menu for sky9x and Taranis.</li>
|
||||
<li>Fix in telemetry conversion (rssi alarm) for stock board</li>
|
||||
<li>Drop support of sky9x boards on MacOS due to missing SAM-BA tool.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.41</h2>
|
||||
<ul>
|
||||
<li>Fix unneeded rescaling of splash images</li>
|
||||
<li>Fix for telemetry screens for Taranis</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.40</h2>
|
||||
<ul>
|
||||
<li>Log dialog - Split of logging sessions.</li>
|
||||
<li>Telemetry screen 1 as default (issue 206)</li>
|
||||
<li>Rename all channels in mixer tab accordingly to limits names</li>
|
||||
<li>Fix a segfault in phases tabs (Issue 203 regression introduced in release 2140)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.39</h2>
|
||||
<ul>
|
||||
<li>Custom functions cut&paste </li>
|
||||
<li>Custom switches cut&paste </li>
|
||||
<li>Color button text in curve editor for MACOSX</li>
|
||||
<li>Adjust name lengths for Taranis</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.38</h2>
|
||||
<ul>
|
||||
<li>Core when model names were > 10 chars</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.37</h2>
|
||||
<ul>
|
||||
<li>Fix OpenTX segfault in Taranis simulator</li>
|
||||
<li>Implement brightness control for Taranis</li>
|
||||
<li>Reduce modeledit windows size</li>
|
||||
<li>Taranis splash screen in grayscale</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.36</h2>
|
||||
<ul>
|
||||
<li>Burning windows (with progress bar) now in foreground (Issue 197)</li>
|
||||
<li>Allow a selection of tracks for Background Music (Issue 199)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.35</h2>
|
||||
<ul>
|
||||
<li>Country names mismatch between Taranis and Companion 9X (Issue 198)</li>
|
||||
<li>TIM function in custom switches</li>
|
||||
<li>Fix timer switches.</li>
|
||||
<li>Taranis LCD adjustment in general settings.</li>
|
||||
<li>New tool in curve editor</li>
|
||||
<li>Minor fixes</li>
|
||||
<li>Expo move bug + invalid chars in channels, expo and mixer names</li>
|
||||
<li>Try to reduce modeledit window form MAC</li>
|
||||
<li>Wrong init of RF-Module data</li>
|
||||
<li>Read flash from TX didn't worked for Taranis</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,469 @@
|
||||
PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "13" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
MESSAGE( STATUS "Looking for XercesC " )
|
||||
FIND_PACKAGE(XercesC)
|
||||
IF ( XERCESC_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${XERCESC_INCLUDE_DIR} )
|
||||
SET(LidarFormat_LIBRAIRIES ${LidarFormat_LIBRAIRIES} ${XERCESC_LIBRARIES})
|
||||
ELSE()
|
||||
MESSAGE( FATAL_ERROR "XercesC not found! Please set XercesC path ..." )
|
||||
ENDIF()
|
||||
|
||||
MESSAGE( STATUS "Looking for Xsd " )
|
||||
FIND_PACKAGE(Xsd)
|
||||
IF ( XSD_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${XSD_INCLUDE_DIR} )
|
||||
MESSAGE("XSD Include Path: " ${XSD_INCLUDE_DIR} )
|
||||
ELSE()
|
||||
MESSAGE( FATAL_ERROR "XSD not found! Please set XSD path ..." )
|
||||
ENDIF()
|
||||
|
||||
MESSAGE( STATUS "Looking for SDL " )
|
||||
FIND_PACKAGE(Sdl)
|
||||
IF ( SDL_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
|
||||
MESSAGE("SDL Include Path: " ${SDL_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DJOYSTICKS )
|
||||
ELSE()
|
||||
MESSAGE( "SDL not found! Joysticks support will be disabled" )
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
|
||||
SET( QT_USE_QTNETWORK True )
|
||||
SET( QT_USE_QTXML True )
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
|
||||
MESSAGE( STATUS "Looking for PHONON " )
|
||||
FIND_PACKAGE(Phonon)
|
||||
IF ( PHONON_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} )
|
||||
MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DPHONON )
|
||||
ELSE()
|
||||
MESSAGE( "PHONON not found!" )
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
COMMAND ${XSDCXX_EXECUTABLE} cxx-tree --root-element-all --generate-serialization --output-dir ${PROJECT_BINARY_DIR}/ ${PROJECT_SOURCE_DIR}/radio.xsd
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/radio.hxx ${PROJECT_BINARY_DIR}/radio.cxx
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/radio.xsd
|
||||
)
|
||||
|
||||
IF( MSVC )
|
||||
SET(CMAKE_CXX_FLAGS "/EHsc /LD")
|
||||
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes)
|
||||
LINK_DIRECTORIES( C:/Programs/pthreads/Pre-built.2/lib/ )
|
||||
SET( PTHREAD_LIBRARY pthreadVC2.lib )
|
||||
ELSE( )
|
||||
SET( PTHREAD_LIBRARY pthread )
|
||||
ADD_DEFINITIONS( -Wall )
|
||||
LINK_DIRECTORIES( /usr/local/lib )
|
||||
ENDIF( )
|
||||
|
||||
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
|
||||
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
|
||||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
COMMAND make lbm
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/bitmaps/sticks_4x1.xbm
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
COMMAND make tra
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/translations/en.h.txt
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
||||
COMMAND make PCB=TARANIS lua_exports.cpp
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}/../..
|
||||
${SIMU_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
${RADIO_SRC_DIRECTORY}/lua/src
|
||||
${XSD_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
add_subdirectory(modeledit)
|
||||
add_subdirectory(simulation)
|
||||
|
||||
set(common_SRCS
|
||||
eeprominterface.cpp
|
||||
firmwares/th9x/th9xeeprom.cpp # TODO not needed
|
||||
firmwares/th9x/th9xinterface.cpp
|
||||
firmwares/er9x/er9xeeprom.cpp
|
||||
firmwares/er9x/er9xinterface.cpp
|
||||
firmwares/gruvin9x/gruvin9xeeprom.cpp
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/ersky9x/ersky9xeeprom.cpp
|
||||
firmwares/ersky9x/ersky9xinterface.cpp
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
||||
firmwares/opentx/opentxeeprom.cpp
|
||||
firmwares/opentx/open9xStockeeprom.cpp
|
||||
firmwares/opentx/open9xGruvin9xeeprom.cpp
|
||||
firmwares/opentx/open9xSky9xeeprom.cpp
|
||||
firmwares/opentx/opentxinterface.cpp
|
||||
firmwares/opentx/opentxTaranisSimulator.cpp
|
||||
firmwares/opentx/opentxSky9xsimulator.cpp
|
||||
firmwares/opentx/opentxGruvin9xsimulator.cpp
|
||||
firmwares/opentx/opentxM128simulator.cpp
|
||||
firmwares/opentx/opentxM64simulator.cpp
|
||||
file.cpp
|
||||
appdata.cpp
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(common_SRCS)
|
||||
|
||||
add_library(common ${common_SRCS})
|
||||
|
||||
set(companion_SRCS
|
||||
hexinterface.cpp
|
||||
flashinterface.cpp
|
||||
# xmlinterface.cpp
|
||||
# ${PROJECT_BINARY_DIR}/radio.cxx
|
||||
helpers.cpp
|
||||
mdichild.cpp
|
||||
generaledit.cpp
|
||||
modelslist.cpp
|
||||
mountlist.cpp
|
||||
avroutputdialog.cpp
|
||||
apppreferencesdialog.cpp
|
||||
fwpreferencesdialog.cpp
|
||||
burnconfigdialog.cpp
|
||||
comparedialog.cpp
|
||||
contributorsdialog.cpp
|
||||
customizesplashdialog.cpp
|
||||
burndialog.cpp
|
||||
printdialog.cpp
|
||||
fusesdialog.cpp
|
||||
logsdialog.cpp
|
||||
downloaddialog.cpp
|
||||
splashlibrary.cpp
|
||||
mainwindow.cpp
|
||||
companion.cpp
|
||||
radionotfound.cpp
|
||||
qcustomplot.cpp
|
||||
wizarddata.cpp
|
||||
wizarddialog.cpp
|
||||
)
|
||||
|
||||
set(companion_MOC_HDRS
|
||||
avroutputdialog.h
|
||||
apppreferencesdialog.h
|
||||
fwpreferencesdialog.h
|
||||
burnconfigdialog.h
|
||||
comparedialog.h
|
||||
printdialog.h
|
||||
fusesdialog.h
|
||||
logsdialog.h
|
||||
contributorsdialog.h
|
||||
customizesplashdialog.h
|
||||
splashlibrary.h
|
||||
splashlabel.h
|
||||
burndialog.h
|
||||
downloaddialog.h
|
||||
generaledit.h
|
||||
modelslist.h
|
||||
mdichild.h
|
||||
mainwindow.h
|
||||
radionotfound.h
|
||||
qcustomplot.h
|
||||
qautocombobox.h
|
||||
helpers.h
|
||||
wizarddialog.h
|
||||
)
|
||||
|
||||
set(companion_UIS
|
||||
mdichild.ui
|
||||
avroutputdialog.ui
|
||||
comparedialog.ui
|
||||
fusesdialog.ui
|
||||
logsdialog.ui
|
||||
apppreferencesdialog.ui
|
||||
fwpreferencesdialog.ui
|
||||
burnconfigdialog.ui
|
||||
downloaddialog.ui
|
||||
generaledit.ui
|
||||
printdialog.ui
|
||||
contributorsdialog.ui
|
||||
customizesplashdialog.ui
|
||||
splashlibrary.ui
|
||||
burndialog.ui
|
||||
radionotfound.ui
|
||||
)
|
||||
|
||||
set(companion_RCS
|
||||
companion.qrc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
|
||||
)
|
||||
|
||||
MACRO (TODAY RESULT)
|
||||
IF (WIN32)
|
||||
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
|
||||
ELSEIF(UNIX)
|
||||
EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
|
||||
ELSE (WIN32)
|
||||
MESSAGE(SEND_ERROR "date not implemented")
|
||||
SET(${RESULT} 00.00.0000)
|
||||
ENDIF (WIN32)
|
||||
ENDMACRO (TODAY)
|
||||
|
||||
MACRO (NOW RESULT)
|
||||
IF (WIN32)
|
||||
EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
|
||||
ELSEIF(UNIX)
|
||||
EXECUTE_PROCESS(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
|
||||
ELSE (WIN32)
|
||||
MESSAGE(SEND_ERROR "time not implemented")
|
||||
SET(${RESULT} 00:00:00)
|
||||
ENDIF (WIN32)
|
||||
ENDMACRO (NOW)
|
||||
|
||||
TODAY(DATE)
|
||||
NOW(TIME)
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( companion_SRCS ${companion_SRCS} icon.rc )
|
||||
IF ( NOT MSVC )
|
||||
SET(CMAKE_EXE_LINKER_FLAGS -mwindows)
|
||||
ENDIF( )
|
||||
ENDIF( )
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
|
||||
|
||||
SET( LANGUAGES he pl pt ru de fr it sv cs fi nl)
|
||||
FOREACH( language ${LANGUAGES} )
|
||||
SET( companion_TS ${companion_TS} translations/companion_${language}.ts )
|
||||
ENDFOREACH( language )
|
||||
|
||||
set( companion_SRCS ${companion_SRCS} )
|
||||
QT4_WRAP_UI( companion_SRCS ${companion_UIS} )
|
||||
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} )
|
||||
QT4_ADD_TRANSLATION( companion_QM ${companion_TS} )
|
||||
QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
|
||||
|
||||
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
|
||||
|
||||
IF( APPLE )
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
|
||||
ELSE( )
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
|
||||
ENDIF( )
|
||||
|
||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} modeledit simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
|
||||
)
|
||||
|
||||
set(simu_SRCS
|
||||
${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
||||
modeledit/node.cpp
|
||||
modeledit/edge.cpp # TODO not needed
|
||||
simulator.cpp
|
||||
)
|
||||
|
||||
set(simu_MOC_HDRS
|
||||
modeledit/node.h
|
||||
)
|
||||
|
||||
set( simu_SRCS ${simu_SRCS} )
|
||||
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
|
||||
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
|
||||
|
||||
if(WIN32)
|
||||
set(simu_SRCS ${simu_SRCS} icon.rc)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
add_executable(simulator MACOSX_BUNDLE ${simu_SRCS})
|
||||
else()
|
||||
add_executable(simulator WIN32 ${simu_SRCS})
|
||||
endif()
|
||||
|
||||
if(SDL_FOUND)
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
else()
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
endif()
|
||||
|
||||
############# Packaging ####################
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( FILES companion.desktop DESTINATION share/applications )
|
||||
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps )
|
||||
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps )
|
||||
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps )
|
||||
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps )
|
||||
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps )
|
||||
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps )
|
||||
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
|
||||
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
|
||||
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
|
||||
INSTALL( FILES ../targets/linux/45-taranis.rules DESTINATION /etc/udev/rules.d/ )
|
||||
# Linux specific code
|
||||
SET(OperatingSystem "Linux")
|
||||
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${QT_BINARY_DIR} )
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
IF( WIN32 )
|
||||
IF( MSVC )
|
||||
SET( NSI_IN_FILE companion-vs.nsi.in )
|
||||
ELSE( )
|
||||
SET( NSI_IN_FILE companion-msys.nsi.in )
|
||||
ENDIF( )
|
||||
|
||||
SET( SYSDIR "$ENV{windir}/system32" )
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
|
||||
|
||||
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
|
||||
"C:/Program Files/NSIS"
|
||||
"C:/Program Files (x86)/NSIS"
|
||||
"C:/Programs/NSIS"
|
||||
)
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS companion.nsi
|
||||
DEPENDS ${PROJECT_NAME} simulator ${PROJECT_BINARY_DIR}/companion.nsi
|
||||
COMMENT "Windows NSIS Installer")
|
||||
|
||||
ADD_CUSTOM_TARGET( installer
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/companionInstall.exe
|
||||
SOURCES ${PROJECT_BINARY_DIR}/companion.nsi
|
||||
)
|
||||
ENDIF( )
|
||||
|
||||
IF( APPLE )
|
||||
SET(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
|
||||
IF( CMAKE_GENERATOR STREQUAL Xcode )
|
||||
SET( WORK_DIR ${CMAKE_BINARY_DIR}/Debug )
|
||||
ELSE( )
|
||||
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_TARGET( addframeworks ALL
|
||||
COMMAND mkdir -p companion.app/Contents/Frameworks
|
||||
COMMAND mkdir -p companion.app/Contents/Resources
|
||||
COMMAND mkdir -p companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
|
||||
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
|
||||
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
|
||||
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS ${PROJECT_NAME} )
|
||||
|
||||
|
||||
ADD_CUSTOM_TARGET( makedmg
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS addframeworks )
|
||||
|
||||
ENDIF( )
|
||||
|
||||
ADD_CUSTOM_TARGET( stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
|
||||
|
||||
IF(WIN32)
|
||||
ADD_CUSTOM_TARGET( translations
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMAND lupdate ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
|
||||
ELSE( )
|
||||
ADD_CUSTOM_TARGET( translations
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
|
||||
ENDIF( )
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "COMPANION")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
|
||||
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
|
||||
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
||||
if(DPKG_PROGRAM)
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
execute_process(
|
||||
COMMAND ${DPKG_PROGRAM} --print-architecture
|
||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Romolo Manfredini <romolo.manfredini-nosp@m-gmail.com>")
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION ${C9X_VERSION})
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${C9X_VERSION_MAJOR})
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${C9X_VERSION_MINOR})
|
||||
SET(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
|
||||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
else(DPKG_PROGRAM)
|
||||
SET(CPACK_GENERATOR "RPM")
|
||||
SET(CPACK_RPM_PACKAGE_VERSION ${C9X_VERSION})
|
||||
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${C9X_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif(DPKG_PROGRAM)
|
||||
|
||||
INCLUDE(CPack)
|
||||
@@ -0,0 +1,698 @@
|
||||
/*
|
||||
* Author - Kjell Kernen
|
||||
*
|
||||
* 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 "appdata.h"
|
||||
|
||||
// Global data and storage object
|
||||
AppData g;
|
||||
|
||||
// ** CompStoreObj class********************
|
||||
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (tag2.isEmpty())
|
||||
{
|
||||
settings.remove(tag1);
|
||||
}
|
||||
else if (tag3.isEmpty())
|
||||
{
|
||||
settings.beginGroup(tag1);
|
||||
settings.remove(tag2);
|
||||
settings.endGroup();
|
||||
}
|
||||
else
|
||||
{
|
||||
settings.beginGroup(tag1);
|
||||
settings.beginGroup(tag2);
|
||||
settings.remove(tag3);
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
}
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newArray);
|
||||
array = newArray;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newSList);
|
||||
stringList = newSList;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const QString newString, QString &string, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newString);
|
||||
string = newString;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newTruth);
|
||||
truth = newTruth;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::store(const int newNumber, int &number, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
settings.setValue(tag, newNumber);
|
||||
number = newNumber;
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
// Retrieval functions
|
||||
void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
array = settings.value(tag, def).toByteArray();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
stringList = settings.value(tag, def).toStringList();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::retrieve( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
string = settings.value(tag, def).toString();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
truth = settings.value(tag, def).toBool();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
void CompStoreObj::retrieve( int &number, const QString tag, const int def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
number = settings.value(tag, def).toInt();
|
||||
|
||||
if (!group1.isEmpty()) settings.endGroup();
|
||||
if (!group2.isEmpty()) settings.endGroup();
|
||||
}
|
||||
|
||||
// Retrieve and Store functions
|
||||
void CompStoreObj::getset( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( array, tag, def, group1, group2);
|
||||
store(array, array, tag, group1, group2);
|
||||
}
|
||||
|
||||
void CompStoreObj::getset( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( stringList, tag, def, group1, group2);
|
||||
store(stringList, stringList, tag, group1, group2);
|
||||
}
|
||||
|
||||
void CompStoreObj::getset( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( string, tag, def, group1, group2);
|
||||
store(string, string, tag, group1, group2);
|
||||
}
|
||||
|
||||
void CompStoreObj::getset( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( truth, tag, def, group1, group2);
|
||||
store(truth, truth, tag, group1, group2);
|
||||
}
|
||||
|
||||
void CompStoreObj::getset( int &number, const QString tag, const int def, const QString group1, const QString group2 )
|
||||
{
|
||||
retrieve( number, tag, def, group1, group2);
|
||||
store(number, number, tag, group1, group2);
|
||||
}
|
||||
|
||||
// ** FwRevision class********************
|
||||
int FwRevision::get( const QString fwType )
|
||||
{
|
||||
QString result;
|
||||
retrieve( result, fwType, "", "FwRevisions" );
|
||||
return result.toInt();
|
||||
}
|
||||
|
||||
void FwRevision::set( const QString fwType, const int fwRevision )
|
||||
{
|
||||
QString tempString = QString("%1").arg(fwRevision);
|
||||
store( tempString, tempString, fwType, "FwRevisions" );
|
||||
}
|
||||
|
||||
void FwRevision::remove( const QString tag )
|
||||
{
|
||||
clear( "FwRevisions", tag );
|
||||
}
|
||||
|
||||
// ** JStickData class********************
|
||||
// Get declarations
|
||||
int JStickData::stick_axe() { return _stickAxe; }
|
||||
int JStickData::stick_min() { return _stickMin; }
|
||||
int JStickData::stick_med() { return _stickMed; }
|
||||
int JStickData::stick_max() { return _stickMax; }
|
||||
int JStickData::stick_inv() { return _stickInv; }
|
||||
|
||||
// Set declarations
|
||||
void JStickData::stick_axe(const int it) { store( it, _stickAxe, QString("stick%1_axe").arg(index), "JsCalibration" );}
|
||||
void JStickData::stick_min(const int it) { store( it, _stickMin, QString("stick%1_min").arg(index), "JsCalibration" );}
|
||||
void JStickData::stick_med(const int it) { store( it, _stickMed, QString("stick%1_med").arg(index), "JsCalibration" );}
|
||||
void JStickData::stick_max(const int it) { store( it, _stickMax, QString("stick%1_max").arg(index), "JsCalibration" );}
|
||||
void JStickData::stick_inv(const int it) { store( it, _stickInv, QString("stick%1_inv").arg(index), "JsCalibration" );}
|
||||
|
||||
// Constructor
|
||||
JStickData::JStickData()
|
||||
{
|
||||
index = -1;
|
||||
}
|
||||
|
||||
void JStickData::remove()
|
||||
{
|
||||
// Remove all JStickData values from settings file
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
settings.beginGroup( "JsCalibration" );
|
||||
settings.remove( QString( "stick%1_axe").arg(index) );
|
||||
settings.remove( QString( "stick%1_min").arg(index) );
|
||||
settings.remove( QString( "stick%1_med").arg(index) );
|
||||
settings.remove( QString( "stick%1_max").arg(index) );
|
||||
settings.remove( QString( "stick%1_inv").arg(index) );
|
||||
settings.endGroup();
|
||||
|
||||
// Reset all JStickData variables to initial values
|
||||
init(index);
|
||||
}
|
||||
|
||||
bool JStickData::existsOnDisk()
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
settings.beginGroup("JsCalibration");
|
||||
int axe = settings.value( QString("stick%1_axe").arg(index), -1 ).toInt();
|
||||
settings.endGroup();
|
||||
|
||||
return (axe > -1);
|
||||
}
|
||||
|
||||
void JStickData::init(int newIndex)
|
||||
{
|
||||
index = newIndex;
|
||||
_stickAxe = -1;
|
||||
_stickMin = -32767;
|
||||
_stickMed = 0;
|
||||
_stickMax = 0;
|
||||
_stickInv = 0;
|
||||
|
||||
// Do not write empty joystick calibrations to disk.
|
||||
if ( !existsOnDisk() )
|
||||
return;
|
||||
|
||||
flush();
|
||||
}
|
||||
|
||||
void JStickData::flush()
|
||||
{
|
||||
getset( _stickAxe, QString("stick%1_axe").arg(index), -1, "JsCalibration" );
|
||||
getset( _stickMin, QString("stick%1_min").arg(index), -32767, "JsCalibration" );
|
||||
getset( _stickMed, QString("stick%1_med").arg(index), 0, "JsCalibration" );
|
||||
getset( _stickMax, QString("stick%1_max").arg(index), 0, "JsCalibration" );
|
||||
getset( _stickInv, QString("stick%1_inv").arg(index), 0, "JsCalibration" );
|
||||
}
|
||||
|
||||
// ** Profile class********************
|
||||
// Get declarations
|
||||
QString Profile::fwName() const { return _fwName; }
|
||||
QString Profile::fwType() const { return _fwType; }
|
||||
QString Profile::name() const { return _name; }
|
||||
QString Profile::sdPath() const { return _sdPath; }
|
||||
QString Profile::splashFile() const { return _splashFile; }
|
||||
bool Profile::burnFirmware() const { return _burnFirmware; }
|
||||
bool Profile::renameFwFiles() const { return _renameFwFiles; }
|
||||
int Profile::channelOrder() const { return _channelOrder; }
|
||||
int Profile::defaultMode() const { return _defaultMode; }
|
||||
|
||||
QString Profile::beeper() const { return _beeper; }
|
||||
QString Profile::countryCode() const { return _countryCode; }
|
||||
QString Profile::display() const { return _display; }
|
||||
QString Profile::haptic() const { return _haptic; }
|
||||
QString Profile::speaker() const { return _speaker; }
|
||||
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
||||
QString Profile::timeStamp() const { return _timeStamp; }
|
||||
QString Profile::trainerCalib() const { return _trainerCalib; }
|
||||
int Profile::currentCalib() const { return _currentCalib; }
|
||||
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||
int Profile::vBatCalib() const { return _vBatCalib; }
|
||||
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||
|
||||
// Set declarations
|
||||
void Profile::name (const QString x) { store(x, _name, "Name" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::fwName (const QString x) { store(x, _fwName, "fwName" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::fwType (const QString x) { store(x, _fwType, "fwType" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
void Profile::beeper (const QString x) { store(x, _beeper, "Beeper" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::countryCode (const QString x) { store(x, _countryCode, "countryCode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::display (const QString x) { store(x, _display, "Display" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::haptic (const QString x) { store(x, _haptic, "Haptic" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::speaker (const QString x) { store(x, _speaker, "Speaker" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
// Constructor
|
||||
Profile::Profile()
|
||||
{
|
||||
index = -1;
|
||||
}
|
||||
|
||||
// The default copy operator can not be used since the index variable would be destroyed
|
||||
Profile& Profile::operator=(const Profile& rhs)
|
||||
{
|
||||
name ( rhs.name() );
|
||||
fwName ( rhs.fwName() );
|
||||
fwType ( rhs.fwType() );
|
||||
sdPath ( rhs.sdPath() );
|
||||
splashFile ( rhs.splashFile() );
|
||||
burnFirmware ( rhs.burnFirmware() );
|
||||
renameFwFiles( rhs.renameFwFiles() );
|
||||
channelOrder ( rhs.channelOrder() );
|
||||
defaultMode ( rhs.defaultMode() );
|
||||
beeper ( rhs.beeper() );
|
||||
countryCode ( rhs.countryCode() );
|
||||
display ( rhs.display() );
|
||||
haptic ( rhs.haptic() );
|
||||
speaker ( rhs.speaker() );
|
||||
stickPotCalib( rhs.stickPotCalib() );
|
||||
trainerCalib ( rhs.trainerCalib() );
|
||||
currentCalib ( rhs.currentCalib() );
|
||||
gsStickMode ( rhs.gsStickMode() );
|
||||
ppmMultiplier( rhs.ppmMultiplier() );
|
||||
vBatCalib ( rhs.vBatCalib() );
|
||||
vBatWarn ( rhs.vBatWarn() );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Profile::remove()
|
||||
{
|
||||
// Remove all profile values from settings file
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
settings.beginGroup("Profiles");
|
||||
settings.remove(QString("profile%1").arg(index));
|
||||
settings.endGroup();
|
||||
|
||||
// Reset all profile variables to initial values
|
||||
init(index);
|
||||
}
|
||||
|
||||
bool Profile::existsOnDisk()
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
settings.beginGroup("Profiles");
|
||||
settings.beginGroup(QString("profile%1").arg(index));
|
||||
QStringList keyList = settings.allKeys();
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
|
||||
return (keyList.length() > 0);
|
||||
}
|
||||
|
||||
void Profile::initFwVariables()
|
||||
{
|
||||
_beeper = "";
|
||||
_countryCode = "";
|
||||
_display = "";
|
||||
_haptic = "";
|
||||
_speaker = "";
|
||||
_stickPotCalib = "";
|
||||
_timeStamp = "";
|
||||
_trainerCalib = "";
|
||||
|
||||
_currentCalib = 0;
|
||||
_gsStickMode = 0;
|
||||
_ppmMultiplier = 0;
|
||||
_vBatCalib = 0;
|
||||
_vBatWarn = 0;
|
||||
}
|
||||
|
||||
void Profile::init(int newIndex)
|
||||
{
|
||||
index = newIndex;
|
||||
|
||||
_fwName = "";
|
||||
_fwType = "";
|
||||
_name = "";
|
||||
_sdPath = "";
|
||||
_splashFile = "";
|
||||
_burnFirmware = false;
|
||||
_renameFwFiles = false;
|
||||
_channelOrder = 0;
|
||||
_defaultMode = 1;
|
||||
|
||||
initFwVariables();
|
||||
|
||||
// Do not write empty profiles to disk except the default (0) profile.
|
||||
if ( index > 0 && !existsOnDisk())
|
||||
return;
|
||||
|
||||
flush();
|
||||
}
|
||||
|
||||
void Profile::flush()
|
||||
{
|
||||
// Load and store all variables. Use default values if setting values are missing
|
||||
getset( _fwName, "fwName" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _fwType, "fwType" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _name, "Name" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
|
||||
|
||||
getset( _beeper, "Beeper" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _countryCode, "countryCode" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _display, "Display" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _haptic, "Haptic" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _speaker, "Speaker" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _currentCalib, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
}
|
||||
|
||||
|
||||
// ** AppData class********************
|
||||
|
||||
// Get declarations
|
||||
QStringList AppData::recentFiles() { return _recentFiles; }
|
||||
QByteArray AppData::mainWinGeo() { return _mainWinGeo; }
|
||||
QByteArray AppData::mainWinState() { return _mainWinState; }
|
||||
QByteArray AppData::modelEditGeo() { return _modelEditGeo; }
|
||||
|
||||
QString AppData::armMcu() { return _armMcu; }
|
||||
QString AppData::avrArguments() { return _avrArguments; }
|
||||
QString AppData::avrPort() { return _avrPort; }
|
||||
QString AppData::avrdudeLocation() { return _avrdudeLocation; }
|
||||
QString AppData::dfuArguments() { return _dfuArguments; }
|
||||
QString AppData::dfuLocation() { return _dfuLocation; }
|
||||
QString AppData::locale() { return _locale; }
|
||||
QString AppData::mcu() { return _mcu; }
|
||||
QString AppData::programmer() { return _programmer; }
|
||||
QString AppData::sambaLocation() { return _sambaLocation; }
|
||||
QString AppData::sambaPort() { return _sambaPort; }
|
||||
|
||||
QString AppData::backupDir() { return _backupDir; }
|
||||
QString AppData::gePath() { return _gePath; }
|
||||
QString AppData::eepromDir() { return _eepromDir; }
|
||||
QString AppData::flashDir() { return _flashDir; }
|
||||
QString AppData::imagesDir() { return _imagesDir; }
|
||||
QString AppData::logDir() { return _logDir; }
|
||||
QString AppData::libDir() { return _libDir; }
|
||||
QString AppData::snapshotDir() { return _snapshotDir; }
|
||||
QString AppData::updatesDir() { return _updatesDir; }
|
||||
|
||||
bool AppData::enableBackup() { return _enableBackup; }
|
||||
bool AppData::backupOnFlash() { return _backupOnFlash; }
|
||||
bool AppData::jsSupport() { return _jsSupport; }
|
||||
bool AppData::maximized() { return _maximized; }
|
||||
bool AppData::showSplash() { return _showSplash; }
|
||||
bool AppData::snapToClpbrd() { return _snapToClpbrd; }
|
||||
bool AppData::autoCheckApp() { return _autoCheckApp; }
|
||||
bool AppData::autoCheckFw() { return _autoCheckFw; }
|
||||
bool AppData::simuSW() { return _simuSW; }
|
||||
bool AppData::useWizard() { return _useWizard; }
|
||||
|
||||
int AppData::backLight() { return _backLight; }
|
||||
int AppData::embedSplashes() { return _embedSplashes; }
|
||||
int AppData::fwServerFails() { return _fwServerFails; }
|
||||
int AppData::generalEditTab() { return _generalEditTab; }
|
||||
int AppData::iconSize() { return _iconSize; }
|
||||
int AppData::historySize() { return _historySize; }
|
||||
int AppData::jsCtrl() { return _jsCtrl; }
|
||||
int AppData::id() { return _id; }
|
||||
int AppData::theme() { return _theme; }
|
||||
int AppData::warningId() { return _warningId; }
|
||||
|
||||
// Set declarations
|
||||
void AppData::recentFiles (const QStringList x) { store(x, _recentFiles, "recentFileList" );}
|
||||
void AppData::mainWinGeo (const QByteArray x) { store(x, _mainWinGeo, "mainWindowGeometry" );}
|
||||
void AppData::mainWinState (const QByteArray x) { store(x, _mainWinState, "mainWindowState" );}
|
||||
void AppData::modelEditGeo (const QByteArray x) { store(x, _modelEditGeo, "modelEditGeometry" );}
|
||||
|
||||
void AppData::armMcu (const QString x) { store(x, _armMcu, "arm_mcu" );}
|
||||
void AppData::avrArguments (const QString x) { store(x, _avrArguments, "avr_arguments" );}
|
||||
void AppData::avrPort (const QString x) { store(x, _avrPort, "avr_port" );}
|
||||
void AppData::avrdudeLocation (const QString x) { store(x, _avrdudeLocation, "avrdudeLocation" );}
|
||||
void AppData::dfuArguments (const QString x) { store(x, _dfuArguments, "dfu_arguments" );}
|
||||
void AppData::dfuLocation (const QString x) { store(x, _dfuLocation, "dfu_location" );}
|
||||
void AppData::locale (const QString x) { store(x, _locale, "locale" );}
|
||||
void AppData::mcu (const QString x) { store(x, _mcu, "mcu" );}
|
||||
void AppData::programmer (const QString x) { store(x, _programmer, "programmer" );}
|
||||
void AppData::sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );}
|
||||
void AppData::sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );}
|
||||
|
||||
void AppData::backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
|
||||
void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );}
|
||||
void AppData::eepromDir (const QString x) { store(x, _eepromDir, "lastDir" );}
|
||||
void AppData::flashDir (const QString x) { store(x, _flashDir, "lastFlashDir" );}
|
||||
void AppData::imagesDir (const QString x) { store(x, _imagesDir, "lastImagesDir" );}
|
||||
void AppData::logDir (const QString x) { store(x, _logDir, "lastLogDir" );}
|
||||
void AppData::libDir (const QString x) { store(x, _libDir, "libraryPath" );}
|
||||
void AppData::snapshotDir (const QString x) { store(x, _snapshotDir, "snapshotpath" );}
|
||||
void AppData::updatesDir (const QString x) { store(x, _updatesDir, "lastUpdatesDir" );}
|
||||
|
||||
void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
|
||||
void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
|
||||
void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );}
|
||||
void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
|
||||
void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
|
||||
void AppData::snapToClpbrd (const bool x) { store(x, _snapToClpbrd, "snapshot_to_clipboard" );}
|
||||
void AppData::autoCheckApp (const bool x) { store(x, _autoCheckApp, "startup_check_companion" );}
|
||||
void AppData::autoCheckFw (const bool x) { store(x, _autoCheckFw, "startup_check_fw" );}
|
||||
void AppData::simuSW (const bool x) { store(x, _simuSW, "simuSW" );}
|
||||
void AppData::useWizard (const bool x) { store(x, _useWizard, "useWizard" );}
|
||||
|
||||
void AppData::backLight (const int x) { store(x, _backLight, "backLight" );}
|
||||
void AppData::embedSplashes (const int x) { store(x, _embedSplashes, "embedded_splashes" );}
|
||||
void AppData::fwServerFails (const int x) { store(x, _fwServerFails, "fwserver" );}
|
||||
void AppData::generalEditTab (const int x) { store(x, _generalEditTab, "generalEditTab" );}
|
||||
void AppData::iconSize (const int x) { store(x, _iconSize, "icon_size" );}
|
||||
void AppData::historySize (const int x) { store(x, _historySize, "history_size" );}
|
||||
void AppData::jsCtrl (const int x) { store(x, _jsCtrl, "js_ctrl" );}
|
||||
void AppData::id (const int x) { store(x, _id, "profileId" );}
|
||||
void AppData::theme (const int x) { store(x, _theme, "theme" );}
|
||||
void AppData::warningId (const int x) { store(x, _warningId, "warningId" );}
|
||||
|
||||
// Constructor
|
||||
AppData::AppData()
|
||||
{
|
||||
//Initialize the profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
profile[i].init( i );
|
||||
|
||||
//Initialize the joysticks
|
||||
for (int i=0; i<MAX_JOYSTICKS; i++)
|
||||
joystick[i].init( i );
|
||||
|
||||
// Import settings from companion9x, but only do it one time.
|
||||
QSettings c9x_settings("companion9x", "companion9x");
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (profile[0].name().isEmpty() )
|
||||
{
|
||||
// Copy all settings from companion9x to companion
|
||||
QStringList keys = c9x_settings.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
{
|
||||
settings.setValue(*i, c9x_settings.value(*i));
|
||||
}
|
||||
|
||||
// Store old values in new locations
|
||||
autoCheckApp(settings.value("startup_check_companion9x", true).toBool());
|
||||
useWizard(settings.value("wizardEnable", true).toBool());
|
||||
|
||||
// Convert and store the firmware type
|
||||
QString fwType = settings.value("firmware", "").toString();
|
||||
fwType.replace("open9x","opentx");
|
||||
fwType.replace("x9da","taranis");
|
||||
profile[0].fwType( fwType );
|
||||
|
||||
// Move the Companion9x profile settings to profile0, the new default profile
|
||||
profile[0].name( settings.value( "Name", "" ).toString());
|
||||
profile[0].sdPath( settings.value( "sdPath", "" ).toString());
|
||||
profile[0].splashFile( settings.value( "SplashFileName", "" ).toString());
|
||||
profile[0].burnFirmware( settings.value( "burnFirmware", false ).toBool());
|
||||
profile[0].renameFwFiles( settings.value( "rename_firmware_files", false ).toBool());
|
||||
profile[0].channelOrder( settings.value( "default_channel_order", "0" ).toInt());
|
||||
profile[0].defaultMode( settings.value( "default_mode", "1" ).toInt());
|
||||
|
||||
// Ensure that the default profile has a name
|
||||
if ( profile[0].name().isEmpty() )
|
||||
profile[0].name("My Radio");
|
||||
|
||||
// Delete obsolete settings fields from companion9x
|
||||
settings.remove("ActiveProfile");
|
||||
settings.remove("burnFirmware");
|
||||
settings.remove("custom_id");
|
||||
settings.remove("default_channel_order");
|
||||
settings.remove("default_mode");
|
||||
settings.remove("firmware");
|
||||
settings.remove("lastFw");
|
||||
settings.remove("modelEditTab");
|
||||
settings.remove("Name");
|
||||
settings.remove("patchImage");
|
||||
settings.remove("rename_firmware_files");
|
||||
settings.remove("sdPath");
|
||||
settings.remove("SplashFileName");
|
||||
settings.remove("startup_check_companion9x");
|
||||
settings.remove("wizardEnable");
|
||||
|
||||
// Delete settings that we do not want to carry over from 1.52
|
||||
settings.remove("dfu_location");
|
||||
|
||||
// Select the new default profile as current profile
|
||||
id( 0 );
|
||||
}
|
||||
|
||||
// Remove settings that have been made obsolete during companion2.0 development
|
||||
settings.remove("compilation-server");
|
||||
|
||||
// Load and store all variables. Use default values if setting values are missing
|
||||
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
|
||||
getset( _tempString, "settings_version" ,"20" ); // This is a version marker. Will be used to upgrade the settings later on.
|
||||
|
||||
getset( _recentFiles, "recentFileList" ,"" );
|
||||
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
|
||||
getset( _mainWinState, "mainWindowState" ,"" );
|
||||
getset( _modelEditGeo, "modelEditGeometry" ,"" );
|
||||
|
||||
getset( _armMcu, "arm_mcu" ,"at91sam3s4-9x" );
|
||||
getset( _avrArguments, "avr_arguments" ,"" );
|
||||
getset( _avrPort, "avr_port" ,"" );
|
||||
getset( _avrdudeLocation, "avrdudeLocation" ,"" );
|
||||
getset( _dfuArguments, "dfu_arguments" ,"-a 0" );
|
||||
getset( _dfuLocation, "dfu_location" ,"" );
|
||||
getset( _locale, "locale" ,"" );
|
||||
getset( _mcu, "mcu" ,"m64" );
|
||||
getset( _programmer, "programmer" ,"usbasp" );
|
||||
getset( _sambaLocation, "samba_location" ,"" );
|
||||
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
|
||||
|
||||
getset( _backupDir, "backupPath" ,"" );
|
||||
getset( _gePath, "gePath" ,"" );
|
||||
getset( _eepromDir, "lastDir" ,"" );
|
||||
getset( _flashDir, "lastFlashDir" ,"" );
|
||||
getset( _imagesDir, "lastImagesDir" ,"" );
|
||||
getset( _logDir, "lastLogDir" ,"" );
|
||||
getset( _libDir, "libraryPath" ,"" );
|
||||
getset( _snapshotDir, "snapshotpath" ,"" );
|
||||
getset( _updatesDir, "lastUpdatesDir" ,"" );
|
||||
|
||||
getset( _enableBackup, "backupEnable" ,false );
|
||||
getset( _backupOnFlash, "backupOnFlash" ,true );
|
||||
getset( _jsSupport, "js_support" ,false );
|
||||
getset( _maximized, "maximized" ,false );
|
||||
getset( _showSplash, "show_splash" ,true );
|
||||
getset( _snapToClpbrd, "snapshot_to_clipboard" ,false );
|
||||
getset( _autoCheckApp, "startup_check_companion" ,true );
|
||||
getset( _autoCheckFw, "startup_check_fw" ,true );
|
||||
getset( _simuSW, "simuSW" ,false );
|
||||
getset( _useWizard, "useWizard" ,true );
|
||||
|
||||
getset( _backLight, "backLight" ,0 );
|
||||
getset( _embedSplashes, "embedded_splashes" ,0 );
|
||||
getset( _fwServerFails, "fwserver" ,0 );
|
||||
getset( _generalEditTab, "generalEditTab" ,0 );
|
||||
getset( _iconSize, "icon_size" ,2 );
|
||||
getset( _jsCtrl, "js_ctrl" ,0 );
|
||||
getset( _historySize, "history_size" ,10 );
|
||||
getset( _id, "profileId" ,0 );
|
||||
getset( _theme, "theme" ,1 );
|
||||
getset( _warningId, "warningId" ,0 );
|
||||
}
|
||||
@@ -0,0 +1,359 @@
|
||||
/*
|
||||
* Author - Kjell Kernen
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
// All temporary and permanent global variables are defined here to make
|
||||
// initialization and storage safe and visible.
|
||||
// Do not access variables in QSettings directly, it is not type safe!
|
||||
|
||||
|
||||
#ifndef COMPANION_APPDATA_H
|
||||
#define COMPANION_APPDATA_H
|
||||
#include <QByteArray>
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
#include <QSettings>
|
||||
|
||||
#define COMPANY "OpenTX Companion"
|
||||
#define PRODUCT "OpenTX"
|
||||
|
||||
#define MAX_PROFILES 15
|
||||
#define MAX_JOYSTICKS 8
|
||||
|
||||
class CompStoreObj
|
||||
{
|
||||
public:
|
||||
void clear (const QString tag1="", const QString tag2="", const QString tag3="");
|
||||
void store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1="", const QString group2="" );
|
||||
void store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1="", const QString group2="" );
|
||||
void store(const QString newString, QString &string, const QString tag, const QString group1="", const QString group2="" );
|
||||
void store(const bool newTruth, bool &truth, const QString tag, const QString group1="", const QString group2="" );
|
||||
void store(const int newNumber, int &number, const QString tag, const QString group1="", const QString group2="" );
|
||||
|
||||
// Retrieval functions
|
||||
void retrieve( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void retrieve( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void retrieve( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
|
||||
void retrieve( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
||||
|
||||
// Retrieve and Store functions
|
||||
void getset( QByteArray &array, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void getset( QStringList &stringList, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
|
||||
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
||||
};
|
||||
|
||||
class FwRevision: protected CompStoreObj
|
||||
{
|
||||
public:
|
||||
int get( const QString);
|
||||
void set( const QString, const int );
|
||||
void remove( const QString );
|
||||
};
|
||||
|
||||
class JStickData: protected CompStoreObj
|
||||
{
|
||||
private:
|
||||
int index;
|
||||
|
||||
int _stickAxe;
|
||||
int _stickMin;
|
||||
int _stickMed;
|
||||
int _stickMax;
|
||||
int _stickInv;
|
||||
|
||||
public:
|
||||
// All the get definitions
|
||||
int stick_axe();
|
||||
int stick_min();
|
||||
int stick_med();
|
||||
int stick_max();
|
||||
int stick_inv();
|
||||
|
||||
// All the set definitions
|
||||
void stick_axe(const int);
|
||||
void stick_min(const int);
|
||||
void stick_med(const int);
|
||||
void stick_max(const int);
|
||||
void stick_inv(const int);
|
||||
|
||||
JStickData();
|
||||
void remove();
|
||||
bool existsOnDisk();
|
||||
void init(int index);
|
||||
void flush();
|
||||
};
|
||||
|
||||
class Profile: protected CompStoreObj
|
||||
{
|
||||
private:
|
||||
// Class Internal Variable
|
||||
int index;
|
||||
|
||||
// Application Variables
|
||||
QString _fwName;
|
||||
QString _fwType;
|
||||
QString _name;
|
||||
QString _sdPath;
|
||||
QString _splashFile;
|
||||
bool _burnFirmware;
|
||||
bool _renameFwFiles;
|
||||
int _channelOrder;
|
||||
int _defaultMode;
|
||||
|
||||
// Firmware Variables
|
||||
QString _beeper;
|
||||
QString _countryCode;
|
||||
QString _display;
|
||||
QString _haptic;
|
||||
QString _speaker;
|
||||
QString _stickPotCalib;
|
||||
QString _timeStamp;
|
||||
QString _trainerCalib;
|
||||
int _currentCalib;
|
||||
int _gsStickMode;
|
||||
int _ppmMultiplier;
|
||||
int _vBatCalib;
|
||||
int _vBatWarn;
|
||||
|
||||
public:
|
||||
// All the get definitions
|
||||
QString fwName() const;
|
||||
QString fwType() const;
|
||||
QString name() const;
|
||||
QString sdPath() const;
|
||||
QString splashFile() const;
|
||||
bool burnFirmware() const;
|
||||
bool renameFwFiles() const;
|
||||
int channelOrder() const;
|
||||
int defaultMode() const;
|
||||
|
||||
QString beeper() const;
|
||||
QString countryCode() const;
|
||||
QString display() const;
|
||||
QString haptic() const;
|
||||
QString speaker() const;
|
||||
QString stickPotCalib() const;
|
||||
QString timeStamp() const;
|
||||
QString trainerCalib() const;
|
||||
int currentCalib() const;
|
||||
int gsStickMode() const;
|
||||
int ppmMultiplier() const;
|
||||
int vBatCalib() const;
|
||||
int vBatWarn() const;
|
||||
|
||||
// All the set definitions
|
||||
void name (const QString);
|
||||
void fwName (const QString);
|
||||
void fwType (const QString);
|
||||
void sdPath (const QString);
|
||||
void splashFile (const QString);
|
||||
void burnFirmware (const bool);
|
||||
void renameFwFiles (const bool);
|
||||
void channelOrder (const int);
|
||||
void defaultMode (const int);
|
||||
|
||||
void beeper (const QString);
|
||||
void countryCode (const QString);
|
||||
void display (const QString);
|
||||
void haptic (const QString);
|
||||
void speaker (const QString);
|
||||
void stickPotCalib (const QString);
|
||||
void timeStamp (const QString);
|
||||
void trainerCalib (const QString);
|
||||
void currentCalib (const int);
|
||||
void gsStickMode (const int);
|
||||
void ppmMultiplier (const int);
|
||||
void vBatCalib (const int);
|
||||
void vBatWarn (const int);
|
||||
|
||||
Profile();
|
||||
Profile& operator=(const Profile&);
|
||||
void remove();
|
||||
bool existsOnDisk();
|
||||
void init(int newIndex);
|
||||
void initFwVariables();
|
||||
void flush();
|
||||
};
|
||||
|
||||
class AppData: protected CompStoreObj
|
||||
{
|
||||
// All the global variables
|
||||
public:
|
||||
Profile profile[MAX_PROFILES];
|
||||
JStickData joystick[MAX_JOYSTICKS];
|
||||
FwRevision fwRev;
|
||||
|
||||
private:
|
||||
QStringList _recentFiles;
|
||||
QByteArray _mainWinGeo;
|
||||
QByteArray _mainWinState;
|
||||
QByteArray _modelEditGeo;
|
||||
|
||||
QString _armMcu;
|
||||
QString _avrArguments;
|
||||
QString _avrPort;
|
||||
QString _avrdudeLocation;
|
||||
QString _dfuArguments;
|
||||
QString _dfuLocation;
|
||||
QString _locale;
|
||||
QString _mcu;
|
||||
QString _programmer;
|
||||
QString _sambaLocation;
|
||||
QString _sambaPort;
|
||||
|
||||
QString _backupDir;
|
||||
QString _gePath;
|
||||
QString _eepromDir;
|
||||
QString _flashDir;
|
||||
QString _imagesDir;
|
||||
QString _logDir;
|
||||
QString _libDir;
|
||||
QString _snapshotDir;
|
||||
QString _updatesDir;
|
||||
|
||||
bool _enableBackup;
|
||||
bool _backupOnFlash;
|
||||
bool _maximized;
|
||||
bool _jsSupport;
|
||||
bool _showSplash;
|
||||
bool _snapToClpbrd;
|
||||
bool _autoCheckApp;
|
||||
bool _autoCheckFw;
|
||||
bool _simuSW;
|
||||
bool _useWizard;
|
||||
|
||||
int _backLight;
|
||||
int _embedSplashes;
|
||||
int _fwServerFails;
|
||||
int _generalEditTab;
|
||||
int _iconSize;
|
||||
int _jsCtrl;
|
||||
int _historySize;
|
||||
int _id;
|
||||
int _theme;
|
||||
int _warningId;
|
||||
|
||||
public:
|
||||
// All the get definitions
|
||||
QStringList recentFiles();
|
||||
QByteArray mainWinGeo();
|
||||
QByteArray mainWinState();
|
||||
QByteArray modelEditGeo();
|
||||
|
||||
QString armMcu();
|
||||
QString avrArguments();
|
||||
QString avrPort();
|
||||
QString avrdudeLocation();
|
||||
QString dfuArguments();
|
||||
QString dfuLocation();
|
||||
QString lastFw();
|
||||
QString locale();
|
||||
QString mcu();
|
||||
QString programmer();
|
||||
QString sambaLocation();
|
||||
QString sambaPort();
|
||||
|
||||
QString backupDir();
|
||||
QString gePath();
|
||||
QString eepromDir();
|
||||
QString flashDir();
|
||||
QString imagesDir();
|
||||
QString logDir();
|
||||
QString libDir();
|
||||
QString snapshotDir();
|
||||
QString updatesDir();
|
||||
|
||||
bool enableBackup();
|
||||
bool backupOnFlash();
|
||||
bool jsSupport();
|
||||
bool maximized();
|
||||
bool showSplash();
|
||||
bool snapToClpbrd();
|
||||
bool autoCheckApp();
|
||||
bool autoCheckFw();
|
||||
bool simuSW();
|
||||
bool useWizard();
|
||||
|
||||
int backLight();
|
||||
int embedSplashes();
|
||||
int fwServerFails();
|
||||
int generalEditTab();
|
||||
int iconSize();
|
||||
int historySize();
|
||||
int jsCtrl();
|
||||
int id();
|
||||
int theme();
|
||||
int warningId();
|
||||
|
||||
// All the set definitions
|
||||
void recentFiles (const QStringList x);
|
||||
void mainWinGeo (const QByteArray);
|
||||
void mainWinState (const QByteArray);
|
||||
void modelEditGeo (const QByteArray);
|
||||
|
||||
void armMcu (const QString);
|
||||
void avrArguments (const QString);
|
||||
void avrPort (const QString);
|
||||
void avrdudeLocation (const QString);
|
||||
void dfuArguments (const QString);
|
||||
void dfuLocation (const QString);
|
||||
void lastFw (const QString);
|
||||
void locale (const QString);
|
||||
void mcu (const QString);
|
||||
void programmer (const QString);
|
||||
void sambaLocation (const QString);
|
||||
void sambaPort (const QString);
|
||||
|
||||
void backupDir (const QString);
|
||||
void gePath (const QString);
|
||||
void eepromDir (const QString);
|
||||
void flashDir (const QString);
|
||||
void imagesDir (const QString);
|
||||
void logDir (const QString);
|
||||
void libDir (const QString);
|
||||
void snapshotDir (const QString);
|
||||
void updatesDir (const QString);
|
||||
|
||||
void enableBackup (const bool);
|
||||
void backupOnFlash (const bool);
|
||||
void maximized (const bool);
|
||||
void jsSupport (const bool);
|
||||
void showSplash (const bool);
|
||||
void snapToClpbrd (const bool);
|
||||
void autoCheckApp (const bool);
|
||||
void autoCheckFw (const bool);
|
||||
void simuSW (const bool);
|
||||
void useWizard (const bool);
|
||||
|
||||
void backLight (const int);
|
||||
void embedSplashes (const int);
|
||||
void fwServerFails (const int);
|
||||
void generalEditTab (const int);
|
||||
void iconSize (const int);
|
||||
void historySize (const int);
|
||||
void jsCtrl (const int);
|
||||
void modelEditTab (const int);
|
||||
void id (const int);
|
||||
void theme (const int);
|
||||
void warningId (const int);
|
||||
|
||||
// Constructor
|
||||
AppData();
|
||||
};
|
||||
|
||||
extern AppData g;
|
||||
|
||||
#endif // COMPANION_APPDATA_H
|
||||
@@ -0,0 +1,483 @@
|
||||
#include "apppreferencesdialog.h"
|
||||
#include "ui_apppreferencesdialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "appdata.h"
|
||||
#include "helpers.h"
|
||||
#include "flashinterface.h"
|
||||
#ifdef JOYSTICKS
|
||||
#include "joystick.h"
|
||||
#include "joystickdialog.h"
|
||||
#endif
|
||||
#include <QDesktopServices>
|
||||
#include <QtGui>
|
||||
|
||||
AppPreferencesDialog::AppPreferencesDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AppPreferencesDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
updateLock=false;
|
||||
setWindowIcon(CompanionIcon("apppreferences.png"));
|
||||
|
||||
initSettings();
|
||||
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
||||
|
||||
#ifndef JOYSTICKS
|
||||
ui->joystickCB->hide();
|
||||
ui->joystickCB->setDisabled(true);
|
||||
ui->joystickcalButton->hide();
|
||||
ui->joystickChkB->hide();
|
||||
ui->label_11->hide();
|
||||
#endif
|
||||
|
||||
shrink();
|
||||
}
|
||||
|
||||
AppPreferencesDialog::~AppPreferencesDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::writeValues()
|
||||
{
|
||||
g.autoCheckApp(ui->startupCheck_companion9x->isChecked());
|
||||
g.autoCheckFw(ui->startupCheck_fw->isChecked());
|
||||
g.showSplash(ui->showSplash->isChecked());
|
||||
g.simuSW(ui->simuSW->isChecked());
|
||||
g.useWizard(ui->modelWizard_CB->isChecked());
|
||||
g.historySize(ui->historySize->value());
|
||||
g.backLight(ui->backLightColor->currentIndex());
|
||||
g.libDir(ui->libraryPath->text());
|
||||
g.gePath(ui->ge_lineedit->text());
|
||||
g.embedSplashes(ui->splashincludeCB->currentIndex());
|
||||
g.enableBackup(ui->backupEnable->isChecked());
|
||||
|
||||
if (ui->joystickChkB ->isChecked() && ui->joystickCB->isEnabled()) {
|
||||
g.jsSupport(ui->joystickChkB ->isChecked());
|
||||
g.jsCtrl(ui->joystickCB ->currentIndex());
|
||||
}
|
||||
else {
|
||||
g.jsSupport(false);
|
||||
g.jsCtrl(0);
|
||||
}
|
||||
g.profile[g.id()].channelOrder(ui->channelorderCB->currentIndex());
|
||||
g.profile[g.id()].defaultMode(ui->stickmodeCB->currentIndex());
|
||||
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
|
||||
g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked());
|
||||
g.profile[g.id()].sdPath(ui->sdPath->text());
|
||||
g.profile[g.id()].splashFile(ui->SplashFileName->text());
|
||||
|
||||
// The profile name may NEVER be empty
|
||||
if (ui->profileNameLE->text().isEmpty())
|
||||
g.profile[g.id()].name(tr("My Radio"));
|
||||
else
|
||||
g.profile[g.id()].name(ui->profileNameLE->text());
|
||||
|
||||
// If a new fw type has been choosen, several things need to reset
|
||||
current_firmware_variant = getFirmwareVariant();
|
||||
QString id = current_firmware_variant->getId();
|
||||
if (g.profile[g.id()].fwType() != id) {
|
||||
g.profile[g.id()].fwName("");
|
||||
g.profile[g.id()].initFwVariables();
|
||||
g.profile[g.id()].fwType(id);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_snapshotPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your snapshot folder"), g.snapshotDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
g.snapshotDir(fileName);
|
||||
g.snapToClpbrd(false);
|
||||
ui->snapshotPath->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::initSettings()
|
||||
{
|
||||
ui->snapshotClipboardCKB->setChecked(g.snapToClpbrd());
|
||||
ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware());
|
||||
ui->snapshotPath->setText(g.snapshotDir());
|
||||
ui->snapshotPath->setReadOnly(true);
|
||||
if (ui->snapshotClipboardCKB->isChecked()) {
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
ui->startupCheck_companion9x->setChecked(g.autoCheckApp());
|
||||
ui->startupCheck_fw->setChecked(g.autoCheckFw());
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
ui->backLightColor->setCurrentIndex(g.backLight());
|
||||
|
||||
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||
ui->backLightColor->setEnabled(false);
|
||||
}
|
||||
|
||||
ui->simuSW->setChecked(g.simuSW());
|
||||
ui->modelWizard_CB->setChecked(g.useWizard());
|
||||
ui->libraryPath->setText(g.libDir());
|
||||
ui->ge_lineedit->setText(g.gePath());
|
||||
|
||||
if (!g.backupDir().isEmpty()) {
|
||||
if (QDir(g.backupDir()).exists()) {
|
||||
ui->backupPath->setText(g.backupDir());
|
||||
ui->backupEnable->setEnabled(true);
|
||||
ui->backupEnable->setChecked(g.enableBackup());
|
||||
} else {
|
||||
ui->backupEnable->setDisabled(true);
|
||||
}
|
||||
} else {
|
||||
ui->backupEnable->setDisabled(true);
|
||||
}
|
||||
ui->splashincludeCB->setCurrentIndex(g.embedSplashes());
|
||||
|
||||
#ifdef JOYSTICKS
|
||||
ui->joystickChkB->setChecked(g.jsSupport());
|
||||
if (ui->joystickChkB->isChecked()) {
|
||||
QStringList joystickNames;
|
||||
joystickNames << tr("No joysticks found");
|
||||
joystick = new Joystick(0,false,0,0);
|
||||
ui->joystickcalButton->setDisabled(true);
|
||||
ui->joystickCB->setDisabled(true);
|
||||
|
||||
if ( joystick ) {
|
||||
if ( joystick->joystickNames.count() > 0 ) {
|
||||
joystickNames = joystick->joystickNames;
|
||||
ui->joystickCB->setEnabled(true);
|
||||
ui->joystickcalButton->setEnabled(true);
|
||||
}
|
||||
joystick->close();
|
||||
}
|
||||
ui->joystickCB->clear();
|
||||
ui->joystickCB->insertItems(0, joystickNames);
|
||||
ui->joystickCB->setCurrentIndex(g.jsCtrl());
|
||||
}
|
||||
else {
|
||||
ui->joystickCB->clear();
|
||||
ui->joystickCB->setDisabled(true);
|
||||
ui->joystickcalButton->setDisabled(true);
|
||||
}
|
||||
#endif
|
||||
// Profile Tab Inits
|
||||
ui->channelorderCB->setCurrentIndex(g.profile[g.id()].channelOrder());
|
||||
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
|
||||
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
|
||||
ui->sdPath->setText(g.profile[g.id()].sdPath());
|
||||
ui->profileNameLE->setText(g.profile[g.id()].name());
|
||||
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
|
||||
|
||||
displayImage( g.profile[g.id()].splashFile() );
|
||||
|
||||
QString hwSettings;
|
||||
if (g.profile[g.id()].stickPotCalib() == "" ) {
|
||||
hwSettings = tr("EMPTY: No radio settings stored in profile");
|
||||
}
|
||||
else {
|
||||
QString str = g.profile[g.id()].timeStamp();
|
||||
if (str.isEmpty())
|
||||
hwSettings = tr("AVAILABLE: Radio settings of unknown age");
|
||||
else
|
||||
hwSettings = tr("AVAILABLE: Radio settings stored %1").arg(str);
|
||||
}
|
||||
ui->lblGeneralSettings->setText(hwSettings);
|
||||
|
||||
FirmwareInterface * current_firmware = GetCurrentFirmware();
|
||||
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
ui->downloadVerCB->addItem(firmware->getName(), firmware->getId());
|
||||
if (current_firmware->getFirmwareBase() == firmware) {
|
||||
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
baseFirmwareChanged();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_libraryPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your library folder"), g.libDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
g.libDir(fileName);
|
||||
ui->libraryPath->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_snapshotClipboardCKB_clicked()
|
||||
{
|
||||
if (ui->snapshotClipboardCKB->isChecked()) {
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
g.snapToClpbrd(true);
|
||||
}
|
||||
else {
|
||||
ui->snapshotPath->setEnabled(true);
|
||||
ui->snapshotPath->setReadOnly(true);
|
||||
ui->snapshotPathButton->setEnabled(true);
|
||||
g.snapToClpbrd(false);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_backupPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
g.backupDir(fileName);
|
||||
ui->backupPath->setText(fileName);
|
||||
}
|
||||
ui->backupEnable->setEnabled(true);
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_ge_pathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Google Earth executable"),ui->ge_lineedit->text());
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->ge_lineedit->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef JOYSTICKS
|
||||
void AppPreferencesDialog::on_joystickChkB_clicked() {
|
||||
if (ui->joystickChkB->isChecked()) {
|
||||
QStringList joystickNames;
|
||||
joystickNames << tr("No joysticks found");
|
||||
joystick = new Joystick(0,false,0,0);
|
||||
ui->joystickcalButton->setDisabled(true);
|
||||
ui->joystickCB->setDisabled(true);
|
||||
|
||||
if ( joystick ) {
|
||||
if ( joystick->joystickNames.count() > 0 ) {
|
||||
joystickNames = joystick->joystickNames;
|
||||
ui->joystickCB->setEnabled(true);
|
||||
ui->joystickcalButton->setEnabled(true);
|
||||
}
|
||||
joystick->close();
|
||||
}
|
||||
ui->joystickCB->clear();
|
||||
ui->joystickCB->insertItems(0, joystickNames);
|
||||
}
|
||||
else {
|
||||
ui->joystickCB->clear();
|
||||
ui->joystickCB->setDisabled(true);
|
||||
ui->joystickcalButton->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_joystickcalButton_clicked() {
|
||||
joystickDialog * jd=new joystickDialog(this, ui->joystickCB->currentIndex());
|
||||
jd->exec();
|
||||
}
|
||||
#endif
|
||||
|
||||
// ******** Profile tab functions
|
||||
|
||||
void AppPreferencesDialog::on_sdPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select the folder replicating your SD structure"), g.profile[g.id()].sdPath());
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->sdPath->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_removeProfileButton_clicked()
|
||||
{
|
||||
if ( g.id() == 0 ) {
|
||||
QMessageBox::information(this, tr("Not possible to remove profile"), tr("The default profile can not be removed."));
|
||||
}
|
||||
else {
|
||||
g.profile[g.id()].remove();
|
||||
g.id( 0 );
|
||||
initSettings();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool AppPreferencesDialog::displayImage( QString fileName )
|
||||
{
|
||||
// Start by clearing the pixmap
|
||||
ui->imageLabel->setPixmap(QPixmap());
|
||||
|
||||
QImage image(fileName);
|
||||
if (image.isNull())
|
||||
return false;
|
||||
|
||||
// Use the firmware name to determine splash width
|
||||
int width = SPLASH_WIDTH;
|
||||
if (g.profile[g.id()].fwType().contains("taranis"))
|
||||
width = SPLASHX9D_WIDTH;
|
||||
|
||||
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
|
||||
ui->imageLabel->setFixedSize(width, SPLASH_HEIGHT);
|
||||
return true;
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_SplashSelect_clicked()
|
||||
{
|
||||
QString supportedImageFormats;
|
||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||
}
|
||||
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
|
||||
if (!fileName.isEmpty()){
|
||||
g.imagesDir(QFileInfo(fileName).dir().absolutePath());
|
||||
|
||||
displayImage(fileName);
|
||||
ui->SplashFileName->setText(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_clearImageButton_clicked()
|
||||
{
|
||||
ui->imageLabel->clear();
|
||||
ui->SplashFileName->clear();
|
||||
}
|
||||
|
||||
|
||||
void AppPreferencesDialog::showVoice(bool show)
|
||||
{
|
||||
ui->voiceLabel->setVisible(show);
|
||||
ui->voiceCombo->setVisible(show);
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::baseFirmwareChanged()
|
||||
{
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
if (firmware->getId() == selected_firmware) {
|
||||
populateFirmwareOptions(firmware);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FirmwareInterface * AppPreferencesDialog::getFirmwareVariant()
|
||||
{
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
QString id = firmware->getId();
|
||||
if (id == selected_firmware) {
|
||||
foreach(QCheckBox *cb, optionsCheckBoxes) {
|
||||
if (cb->isChecked()) {
|
||||
id += QString("-") + cb->text();
|
||||
}
|
||||
}
|
||||
|
||||
if (voice && voice->isChecked()) {
|
||||
id += QString("-tts") + ui->voiceCombo->currentText();
|
||||
}
|
||||
|
||||
if (ui->langCombo->count()) {
|
||||
id += QString("-") + ui->langCombo->currentText();
|
||||
}
|
||||
|
||||
return GetFirmware(id);
|
||||
}
|
||||
}
|
||||
|
||||
// Should never occur...
|
||||
return default_firmware_variant;
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::firmwareOptionChanged(bool state)
|
||||
{
|
||||
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
|
||||
if (cb == voice) {
|
||||
showVoice(voice->isChecked());
|
||||
}
|
||||
FirmwareInterface * firmware=NULL;
|
||||
if (cb && state) {
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
foreach(firmware, firmwares) {
|
||||
if (firmware->getId() == selected_firmware) {
|
||||
foreach(QList<Option> opts, firmware->opts) {
|
||||
foreach(Option opt, opts) {
|
||||
if (cb->text() == opt.name) {
|
||||
foreach(Option other, opts) {
|
||||
if (other.name != opt.name) {
|
||||
foreach(QCheckBox *ocb, optionsCheckBoxes) {
|
||||
if (ocb->text() == other.name) {
|
||||
ocb->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * firmware)
|
||||
{
|
||||
const FirmwareInterface * parent = firmware->getFirmwareBase();
|
||||
|
||||
updateLock = true;
|
||||
|
||||
QString id = current_firmware_variant->getId();
|
||||
ui->langCombo->clear();
|
||||
foreach(const char *lang, parent->languages) {
|
||||
ui->langCombo->addItem(lang);
|
||||
if (id.endsWith(lang)) {
|
||||
ui->langCombo->setCurrentIndex(ui->langCombo->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
voice = NULL; // we will search for a voice checkbox
|
||||
|
||||
int index = 0;
|
||||
foreach(QList<Option> opts, parent->opts) {
|
||||
foreach(Option opt, opts) {
|
||||
if (index >= optionsCheckBoxes.size()) {
|
||||
QCheckBox * checkbox = new QCheckBox(ui->profileTab);
|
||||
ui->optionsLayout->addWidget(checkbox, optionsCheckBoxes.count()/5, optionsCheckBoxes.count()%5, 1, 1);
|
||||
optionsCheckBoxes.push_back(checkbox);
|
||||
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
|
||||
}
|
||||
|
||||
QCheckBox *cb = optionsCheckBoxes.at(index++);
|
||||
if (cb) {
|
||||
cb->show();
|
||||
cb->setText(opt.name);
|
||||
cb->setToolTip(opt.tooltip);
|
||||
cb->setCheckState(id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
|
||||
if (opt.name == QString("voice")) {
|
||||
voice = cb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (; index<optionsCheckBoxes.size(); index++) {
|
||||
QCheckBox *cb = optionsCheckBoxes.at(index);
|
||||
cb->hide();
|
||||
cb->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
|
||||
ui->voiceCombo->clear();
|
||||
foreach(const char *lang, parent->ttslanguages) {
|
||||
ui->voiceCombo->addItem(lang);
|
||||
if (id.contains(QString("-tts%1").arg(lang))) {
|
||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
showVoice(voice && voice->isChecked());
|
||||
|
||||
updateLock = false;
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::shrink()
|
||||
{
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#ifndef APPPREFERENCESDIALOG_H
|
||||
#define APPPREFERENCESDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QCheckBox>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
namespace Ui {
|
||||
class AppPreferencesDialog;
|
||||
}
|
||||
|
||||
class Joystick;
|
||||
|
||||
class AppPreferencesDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AppPreferencesDialog(QWidget *parent = 0);
|
||||
~AppPreferencesDialog();
|
||||
Joystick *joystick;
|
||||
|
||||
private:
|
||||
QList<QCheckBox *> optionsCheckBoxes;
|
||||
bool updateLock;
|
||||
void showVoice(bool);
|
||||
void showVoice();
|
||||
void hideVoice();
|
||||
void populateLocale();
|
||||
void populateFirmwareOptions(const FirmwareInterface *);
|
||||
FirmwareInterface * getFirmwareVariant();
|
||||
QCheckBox * voice;
|
||||
|
||||
Ui::AppPreferencesDialog *ui;
|
||||
void initSettings();
|
||||
bool displayImage( QString fileName );
|
||||
void loadProfileString(QString profile, QString label);
|
||||
void loadFromProfile();
|
||||
|
||||
protected slots:
|
||||
void shrink();
|
||||
void baseFirmwareChanged();
|
||||
void firmwareOptionChanged(bool state);
|
||||
|
||||
void writeValues();
|
||||
void on_libraryPathButton_clicked();
|
||||
void on_snapshotPathButton_clicked();
|
||||
void on_snapshotClipboardCKB_clicked();
|
||||
void on_backupPathButton_clicked();
|
||||
void on_ge_pathButton_clicked();
|
||||
|
||||
void on_sdPathButton_clicked();
|
||||
void on_removeProfileButton_clicked();
|
||||
void on_SplashSelect_clicked();
|
||||
void on_clearImageButton_clicked();
|
||||
|
||||
#ifdef JOYSTICKS
|
||||
void on_joystickChkB_clicked();
|
||||
void on_joystickcalButton_clicked();
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // APPPREFERENCESDIALOG_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,504 @@
|
||||
#include "avroutputdialog.h"
|
||||
#include "ui_avroutputdialog.h"
|
||||
#include <QtGui>
|
||||
#include "eeprominterface.h"
|
||||
#include "flashinterface.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <Windows.h>
|
||||
#include <WinBase.h>
|
||||
#include <tlhelp32.h>
|
||||
#define sleep(x) Sleep(x*1000)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include "mountlist.h"
|
||||
#endif
|
||||
|
||||
avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg, QString wTitle, int closeBehaviour, bool displayDetails) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui(new Ui::avrOutputDialog),
|
||||
kill_timer(NULL),
|
||||
hasErrors(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
#ifdef __APPLE__
|
||||
QFont newFont("Courier", 13);
|
||||
ui->plainTextEdit->setFont(newFont);
|
||||
ui->plainTextEdit->setAttribute(Qt::WA_MacNormalSize);
|
||||
#endif
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
QFont newFont("Courier", 9);
|
||||
ui->plainTextEdit->setFont(newFont);
|
||||
#endif
|
||||
|
||||
cmdLine = prog;
|
||||
closeOpt = closeBehaviour;
|
||||
if (cmdLine.isEmpty()) {
|
||||
if (arg.count()<2) {
|
||||
closeOpt = AVR_DIALOG_FORCE_CLOSE;
|
||||
QTimer::singleShot(0, this, SLOT(forceClose()));
|
||||
}
|
||||
else {
|
||||
sourceFile=arg.at(0);
|
||||
destFile=arg.at(1);
|
||||
if (!displayDetails) {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
} else {
|
||||
ui->checkBox->setChecked(true);
|
||||
}
|
||||
ui->progressBar->setMaximum(127);
|
||||
QTimer::singleShot(500, this, SLOT(doCopy()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (wTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " " + tr("result"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + wTitle);
|
||||
QFile exec;
|
||||
winTitle=wTitle;
|
||||
if (!(exec.exists(prog))) {
|
||||
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("executable not found"));
|
||||
closeOpt = AVR_DIALOG_FORCE_CLOSE;
|
||||
QTimer::singleShot(0, this, SLOT(forceClose()));
|
||||
}
|
||||
else {
|
||||
foreach(QString str, arg) cmdLine.append(" " + str);
|
||||
lfuse = 0;
|
||||
hfuse = 0;
|
||||
efuse = 0;
|
||||
phase=0;
|
||||
currLine.clear();
|
||||
if (!displayDetails) {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
else {
|
||||
ui->checkBox->setChecked(true);
|
||||
}
|
||||
process = new QProcess(this);
|
||||
connect(process,SIGNAL(readyReadStandardError()), this, SLOT(doAddTextStdErr()));
|
||||
connect(process,SIGNAL(started()),this,SLOT(doProcessStarted()));
|
||||
connect(process,SIGNAL(readyReadStandardOutput()),this,SLOT(doAddTextStdOut()));
|
||||
connect(process,SIGNAL(finished(int)),this,SLOT(doFinished(int)));
|
||||
|
||||
#if !__GNUC__
|
||||
kill_timer = new QTimer(this);
|
||||
connect(kill_timer, SIGNAL(timeout()), this, SLOT(killTimerElapsed()));
|
||||
kill_timer->start(2000);
|
||||
#endif
|
||||
|
||||
process->start(prog,arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# if !__GNUC__
|
||||
BOOL KillProcessByName(char *szProcessToKill){
|
||||
HANDLE hProcessSnap;
|
||||
HANDLE hProcess;
|
||||
PROCESSENTRY32 pe32;
|
||||
DWORD dwPriorityClass;
|
||||
|
||||
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); // Takes a snapshot of all the processes
|
||||
|
||||
if(hProcessSnap == INVALID_HANDLE_VALUE){
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
pe32.dwSize = sizeof(PROCESSENTRY32);
|
||||
|
||||
if(!Process32First(hProcessSnap, &pe32)){
|
||||
CloseHandle(hProcessSnap);
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
do{
|
||||
if(!strcmp(pe32.szExeFile,szProcessToKill)){ // checks if process at current position has the name of to be killed app
|
||||
hProcess = OpenProcess(PROCESS_TERMINATE,0, pe32.th32ProcessID); // gets handle to process
|
||||
TerminateProcess(hProcess,0); // Terminate process by handle
|
||||
CloseHandle(hProcess); // close the handle
|
||||
}
|
||||
}while(Process32Next(hProcessSnap,&pe32)); // gets next member of snapshot
|
||||
|
||||
CloseHandle(hProcessSnap); // closes the snapshot handle
|
||||
return( TRUE );
|
||||
}
|
||||
#endif
|
||||
|
||||
void avrOutputDialog::doCopy()
|
||||
{
|
||||
char buf[BLKSIZE];
|
||||
|
||||
QFile source(sourceFile);
|
||||
int blocks = (source.size() + BLKSIZE - 1) / BLKSIZE;
|
||||
ui->progressBar->setMaximum(blocks-1);
|
||||
|
||||
if (source.open(QIODevice::ReadOnly)) {
|
||||
QFile dest(destFile);
|
||||
if (dest.open(QIODevice::WriteOnly)) {
|
||||
addText(tr("Writing file: "));
|
||||
for (int i=0; i<blocks; i++) {
|
||||
int read = source.read(buf, BLKSIZE);
|
||||
if (dest.write(buf, read) == read) {
|
||||
dest.flush();
|
||||
ui->progressBar->setValue(i);
|
||||
if ((i%2) != 0)
|
||||
addText("#");
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Write error"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
dest.close();
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.fileName() + ", " + tr("reason") + ": " + dest.errorString());
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.fileName() + ", " + tr("reason") + ": " + source.errorString());
|
||||
}
|
||||
|
||||
source.close();
|
||||
doFinished(0);
|
||||
}
|
||||
|
||||
void avrOutputDialog::killTimerElapsed()
|
||||
{
|
||||
delete kill_timer;
|
||||
kill_timer = NULL;
|
||||
# if !__GNUC__
|
||||
KillProcessByName("tasklist.exe");
|
||||
#endif
|
||||
}
|
||||
|
||||
avrOutputDialog::~avrOutputDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete kill_timer;
|
||||
}
|
||||
|
||||
void avrOutputDialog::runAgain(QString prog, QStringList arg, int closeBehaviour)
|
||||
{
|
||||
cmdLine = prog;
|
||||
foreach(QString str, arg) cmdLine.append(" " + str);
|
||||
closeOpt = closeBehaviour;
|
||||
currLine.clear();
|
||||
process->start(prog,arg);
|
||||
}
|
||||
|
||||
void avrOutputDialog::waitForFinish()
|
||||
{
|
||||
process->waitForFinished();
|
||||
}
|
||||
|
||||
void avrOutputDialog::addText(const QString &text)
|
||||
{
|
||||
QTextCursor cursor(ui->plainTextEdit->textCursor());
|
||||
|
||||
// is the scrollbar at the end?
|
||||
bool atEnd = (ui->plainTextEdit->verticalScrollBar()->value() == ui->plainTextEdit->verticalScrollBar()->maximum());
|
||||
|
||||
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
|
||||
cursor.insertText(text);
|
||||
|
||||
if (atEnd) {
|
||||
ui->plainTextEdit->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::doAddTextStdOut()
|
||||
{
|
||||
QByteArray data = process->readAllStandardOutput();
|
||||
QString text = QString(data);
|
||||
QString temp;
|
||||
int nlPos, pos, size;
|
||||
|
||||
addText(text);
|
||||
|
||||
currStdLine.append(text);
|
||||
if (currStdLine.contains("size = ")) {
|
||||
pos = currStdLine.lastIndexOf("size = ");
|
||||
temp = currStdLine.mid(pos+7);
|
||||
pos = temp.lastIndexOf("\n");
|
||||
size = temp.left(pos).toInt();
|
||||
ui->progressBar->setMaximum(size/2048);
|
||||
}
|
||||
if (currStdLine.contains("\n")) {
|
||||
nlPos = currStdLine.lastIndexOf("\n");
|
||||
currStdLine = currStdLine.mid(nlPos+1);
|
||||
}
|
||||
if (!currStdLine.isEmpty()) {
|
||||
if (currStdLine.at(0) == QChar('.')) {
|
||||
pos = currStdLine.lastIndexOf(".");
|
||||
ui->progressBar->setValue(pos);
|
||||
}
|
||||
else if (currStdLine.startsWith("Starting upload: [")) {
|
||||
pos = (currStdLine.lastIndexOf("#")-19)/(MAX_FSIZE/204800.0);
|
||||
ui->progressBar->setValue(pos);
|
||||
}
|
||||
}
|
||||
|
||||
if (text.contains("Complete ")) {
|
||||
#if !__GNUC__
|
||||
delete kill_timer;
|
||||
kill_timer = NULL;
|
||||
#endif
|
||||
int start = text.indexOf("Complete ");
|
||||
int end = text.indexOf("%");
|
||||
if (start > 0) {
|
||||
start += 9;
|
||||
int value = text.mid(start, end-start).toInt();
|
||||
ui->progressBar->setValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (text.contains(":010000")) {
|
||||
//contains fuse info
|
||||
QStringList stl = text.split(":01000000");
|
||||
foreach (QString t, stl) {
|
||||
bool ok = false;
|
||||
if (!lfuse) lfuse = t.left(2).toInt(&ok,16);
|
||||
if (!hfuse && !ok) hfuse = t.left(2).toInt(&ok,16);
|
||||
if (!efuse && !ok) efuse = t.left(2).toInt(&ok,16);
|
||||
}
|
||||
}
|
||||
|
||||
if (text.contains("-E-")) {
|
||||
hasErrors = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QString avrOutputDialog::getProgrammer()
|
||||
{
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
return "DFU Util";
|
||||
}
|
||||
else if IS_SKY9X(eepromInterface->getBoard()) {
|
||||
return "SAM-BA";
|
||||
}
|
||||
else {
|
||||
return "AVRDUDE";
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::errorWizard()
|
||||
{
|
||||
QString output=ui->plainTextEdit->toPlainText();
|
||||
if (output.contains("avrdude: Expected signature for")) { // wrong signature
|
||||
int pos=output.indexOf("avrdude: Device signature = ");
|
||||
bool fwexist=false;
|
||||
QString DeviceStr="Unknown";
|
||||
QString FwStr="";
|
||||
|
||||
if (pos>0) {
|
||||
QString DeviceId=output.mid(pos+28,8);
|
||||
if (DeviceId=="0x1e9602") {
|
||||
DeviceStr="Atmega 64";
|
||||
FwStr="\n"+tr("ie: OpenTX for 9X board or OpenTX for 9XR board");
|
||||
fwexist=true;
|
||||
}
|
||||
else if (DeviceId=="0x1e9702") {
|
||||
DeviceStr="Atmega 128";
|
||||
FwStr="\n"+tr("ie: OpenTX for M128 / 9X board or OpenTX for 9XR board with M128 chip");
|
||||
fwexist=true;
|
||||
}
|
||||
else if (DeviceId=="0x1e9703") {
|
||||
DeviceStr="Atmega 1280";
|
||||
}
|
||||
else if (DeviceId=="0x1e9704") {
|
||||
DeviceStr="Atmega 1281";
|
||||
}
|
||||
else if (DeviceId=="0x1e9801") {
|
||||
DeviceStr="Atmega 2560";
|
||||
FwStr="\n"+tr("ie: OpenTX for Gruvin9X board");
|
||||
fwexist=true;
|
||||
}
|
||||
else if (DeviceId=="0x1e9802") {
|
||||
DeviceStr="Atmega 2561";
|
||||
}
|
||||
}
|
||||
if (fwexist==false) {
|
||||
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease check advanced burn options to set the correct cpu type.").arg(DeviceStr));
|
||||
}
|
||||
else {
|
||||
FirmwareInterface *firmware = GetCurrentFirmware();
|
||||
QMessageBox::warning(this, "Companion - Tip of the day", tr("Your radio uses a %1 CPU!!!\n\nPlease select an appropriate firmware type to program it.").arg(DeviceStr)+FwStr+tr("\nYou are currently using:\n %1").arg(firmware->getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::doAddTextStdErr()
|
||||
{
|
||||
int nlPos;
|
||||
int pbvalue;
|
||||
QString avrphase;
|
||||
QByteArray data = process->readAllStandardError();
|
||||
QString text = QString(data);
|
||||
|
||||
currLine.append(text);
|
||||
if (currLine.contains("#")) {
|
||||
avrphase = currLine.left(1).toLower();
|
||||
if (avrphase=="w") {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #ff0000; text-align:center;}:");
|
||||
phase=1;
|
||||
if(winTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " - " + tr("Writing"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Writing"));
|
||||
pbvalue=currLine.count("#")*2;
|
||||
ui->progressBar->setValue(pbvalue);
|
||||
}
|
||||
else if (avrphase=="r") {
|
||||
if (phase==0) {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #00ff00; text-align:center;}:");
|
||||
if(winTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " - " + tr("Reading"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Reading"));
|
||||
}
|
||||
else {
|
||||
ui->progressBar->setStyleSheet("QProgressBar {text-align: center;} QProgressBar::chunk { background-color: #0000ff; text-align:center;}:");
|
||||
phase=2;
|
||||
if(winTitle.isEmpty())
|
||||
setWindowTitle(getProgrammer() + " - " + tr("Verifying"));
|
||||
else
|
||||
setWindowTitle(getProgrammer() + " - " + winTitle + " - " + tr("Verifying"));
|
||||
}
|
||||
pbvalue=currLine.count("#")*2;
|
||||
ui->progressBar->setValue(pbvalue);
|
||||
}
|
||||
}
|
||||
|
||||
if (currLine.contains("\n")) {
|
||||
nlPos = currLine.lastIndexOf("\n");
|
||||
currLine = currLine.mid(nlPos+1);
|
||||
}
|
||||
|
||||
if (text.contains("-E-") && !text.contains("-E- No receive file name")) {
|
||||
hasErrors = true;
|
||||
}
|
||||
|
||||
addText(text);
|
||||
}
|
||||
|
||||
#define HLINE_SEPARATOR "================================================================================="
|
||||
|
||||
void avrOutputDialog::doFinished(int code=0)
|
||||
{
|
||||
addText("\n" HLINE_SEPARATOR);
|
||||
if (code==1 && getProgrammer()=="SAM-BA")
|
||||
code=0;
|
||||
|
||||
if (code) {
|
||||
ui->checkBox->setChecked(true);
|
||||
addText("\n" + getProgrammer() + " " + tr("done - exit code %1").arg(code));
|
||||
}
|
||||
else if (hasErrors) {
|
||||
ui->checkBox->setChecked(true);
|
||||
addText("\n" + getProgrammer() + " " + tr("done with errors"));
|
||||
}
|
||||
else if (!cmdLine.isEmpty()) {
|
||||
addText("\n" + getProgrammer() + " " + tr("done - SUCCESSFUL"));
|
||||
}
|
||||
else {
|
||||
addText(tr("done - SUCCESSFUL"));
|
||||
}
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
|
||||
if(lfuse || hfuse || efuse) {
|
||||
addReadFuses();
|
||||
}
|
||||
|
||||
switch(closeOpt)
|
||||
{
|
||||
case AVR_DIALOG_CLOSE_IF_SUCCESSFUL:
|
||||
if (!hasErrors && !code) accept();
|
||||
if (code) {
|
||||
errorWizard();
|
||||
}
|
||||
break;
|
||||
case AVR_DIALOG_FORCE_CLOSE:
|
||||
if (hasErrors || code)
|
||||
reject();
|
||||
else
|
||||
accept();
|
||||
break;
|
||||
|
||||
case AVR_DIALOG_SHOW_DONE:
|
||||
if (hasErrors || code) {
|
||||
if (!cmdLine.isEmpty()) {
|
||||
if (getProgrammer()!="AVRDUDE") {
|
||||
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("did not finish correctly"));
|
||||
}
|
||||
else {
|
||||
int res = QMessageBox::question(this, "Companion",getProgrammer() + " " + tr("did not finish correctly!\nDo you want some help ?"),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res != QMessageBox::No) {
|
||||
errorWizard();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, "Companion", tr("Copy did not finish correctly"));
|
||||
}
|
||||
// reject();
|
||||
}
|
||||
else {
|
||||
if (!cmdLine.isEmpty()) {
|
||||
ui->progressBar->setValue(ui->progressBar->maximum());
|
||||
QMessageBox::information(this, "Companion", getProgrammer() + " " + tr("finished correctly"));
|
||||
accept();
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, "Companion", tr("Copy finished correctly"));
|
||||
accept();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default: //AVR_DIALOG_KEEP_OPEN
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::doProcessStarted()
|
||||
{
|
||||
addText(HLINE_SEPARATOR "\n");
|
||||
addText(tr("Started") + " " + getProgrammer() + "\n");
|
||||
addText(cmdLine);
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
}
|
||||
|
||||
void avrOutputDialog::addReadFuses()
|
||||
{
|
||||
addText(HLINE_SEPARATOR "\n");
|
||||
addText(tr("FUSES: Low=%1 High=%2 Ext=%3").arg(lfuse,2,16,QChar('0')).arg(hfuse,2,16,QChar('0')).arg(efuse,2,16,QChar('0')));
|
||||
addText("\n" HLINE_SEPARATOR "\n");
|
||||
}
|
||||
|
||||
void avrOutputDialog::on_checkBox_toggled(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui->plainTextEdit->show();
|
||||
}
|
||||
else {
|
||||
ui->plainTextEdit->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
}
|
||||
|
||||
void avrOutputDialog::shrink()
|
||||
{
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
void avrOutputDialog::forceClose()
|
||||
{
|
||||
accept();
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
#ifndef AVROUTPUTDIALOG_H
|
||||
#define AVROUTPUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
|
||||
#define AVR_DIALOG_CLOSE_IF_SUCCESSFUL 0x00
|
||||
#define AVR_DIALOG_KEEP_OPEN 0x01
|
||||
#define AVR_DIALOG_FORCE_CLOSE 0x02
|
||||
#define AVR_DIALOG_SHOW_DONE 0x04
|
||||
#define READBUF 65536
|
||||
#define BLKSIZE 512
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class avrOutputDialog;
|
||||
}
|
||||
|
||||
class avrOutputDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit avrOutputDialog(QWidget *parent, QString prog, QStringList arg, QString wTitle, int closeBehaviour=AVR_DIALOG_CLOSE_IF_SUCCESSFUL, bool displayDetails=false);
|
||||
~avrOutputDialog();
|
||||
|
||||
void addText(const QString &text);
|
||||
void runAgain(QString prog, QStringList arg, int closeBehaviour=AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
|
||||
void waitForFinish();
|
||||
void addReadFuses();
|
||||
|
||||
protected slots:
|
||||
void doAddTextStdOut();
|
||||
void doAddTextStdErr();
|
||||
void doProcessStarted();
|
||||
void doCopy();
|
||||
void doFinished(int code);
|
||||
void on_checkBox_toggled(bool checked);
|
||||
void shrink();
|
||||
void forceClose();
|
||||
void killTimerElapsed();
|
||||
void errorWizard();
|
||||
|
||||
private:
|
||||
QString getProgrammer();
|
||||
Ui::avrOutputDialog *ui;
|
||||
|
||||
QProcess *process;
|
||||
QTimer *kill_timer;
|
||||
QString cmdLine;
|
||||
int closeOpt;
|
||||
quint8 lfuse;
|
||||
quint8 hfuse;
|
||||
quint8 efuse;
|
||||
QString currLine;
|
||||
QString currStdLine;
|
||||
int phase;
|
||||
QString winTitle;
|
||||
bool hasErrors;
|
||||
QString sourceFile;
|
||||
QString destFile;
|
||||
|
||||
};
|
||||
|
||||
#endif // AVROUTPUTDIALOG_H
|
||||
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>avrOutputDialog</class>
|
||||
<widget class="QDialog" name="avrOutputDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>700</width>
|
||||
<height>348</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>700</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Show Details</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>312</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::WidgetWidth</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,446 @@
|
||||
#include "burnconfigdialog.h"
|
||||
#include "ui_burnconfigdialog.h"
|
||||
#include "avroutputdialog.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include <QtGui>
|
||||
|
||||
#if !defined WIN32 && defined __GNUC__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
burnConfigDialog::burnConfigDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::burnConfigDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("configure.png"));
|
||||
ui->avrdude_programmer->model()->sort(0);
|
||||
|
||||
getSettings();
|
||||
populateProgrammers();
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
setWindowTitle(tr("DFU-UTIL Configuration"));
|
||||
ui->avrArgs->hide();
|
||||
ui->avrdude_location->hide();
|
||||
ui->avrdude_port->hide();
|
||||
ui->avrdude_programmer->hide();
|
||||
ui->label_av1->hide();
|
||||
ui->label_av2->hide();
|
||||
ui->label_av4->hide();
|
||||
ui->label_av5->hide();
|
||||
ui->pushButton->hide();
|
||||
ui->pushButton_3->hide();
|
||||
ui->pushButton_4->hide();
|
||||
ui->label_sb1->hide();
|
||||
ui->label_sb3->hide();
|
||||
ui->samba_location->hide();
|
||||
ui->samba_port->hide();
|
||||
ui->sb_browse->hide();
|
||||
}
|
||||
else if (IS_SKY9X(eepromInterface->getBoard())) {
|
||||
setWindowTitle(tr("SAM-BA Configuration"));
|
||||
ui->avrArgs->hide();
|
||||
ui->avrdude_location->hide();
|
||||
ui->avrdude_port->hide();
|
||||
ui->avrdude_programmer->hide();
|
||||
ui->label_av1->hide();
|
||||
ui->label_av2->hide();
|
||||
ui->label_av4->hide();
|
||||
ui->label_av5->hide();
|
||||
ui->pushButton->hide();
|
||||
ui->pushButton_3->hide();
|
||||
ui->pushButton_4->hide();
|
||||
ui->label_dfu1->hide();
|
||||
ui->dfu_location->hide();
|
||||
ui->dfu_browse->hide();
|
||||
}
|
||||
else {
|
||||
setWindowTitle(tr("AVRDUDE Configuration"));
|
||||
ui->label_sb1->hide();
|
||||
ui->label_sb3->hide();
|
||||
ui->samba_location->hide();
|
||||
ui->samba_port->hide();
|
||||
ui->sb_browse->hide();
|
||||
ui->label_dfu1->hide();
|
||||
ui->label_dfu2->hide();
|
||||
ui->dfu_location->hide();
|
||||
ui->dfu_browse->hide();
|
||||
}
|
||||
ui->label_av3->hide();
|
||||
ui->avrdude_mcu->hide();
|
||||
ui->label_sb2->hide();
|
||||
ui->arm_mcu->hide();
|
||||
ui->label_dfu2->hide();
|
||||
ui->dfuArgs->hide();
|
||||
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
connect(this,SIGNAL(accepted()),this,SLOT(putSettings()));
|
||||
}
|
||||
|
||||
burnConfigDialog::~burnConfigDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void burnConfigDialog::getSettings()
|
||||
{
|
||||
avrLoc = g.avrdudeLocation();
|
||||
sambaLoc = g.sambaLocation();
|
||||
dfuLoc = g.dfuLocation();
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = QFileInfo("avrdude.exe").absoluteFilePath();
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = QFileInfo("sam-ba.exe").absoluteFilePath();
|
||||
if ( dfuLoc.isEmpty())
|
||||
dfuLoc = QFileInfo("dfu-util.exe").absoluteFilePath();
|
||||
#elif defined __APPLE__
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = "/usr/local/bin/avrdude";
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = "/usr/local/bin/sam-ba";
|
||||
if ( dfuLoc.isEmpty())
|
||||
dfuLoc = QFileInfo("/opt/local/bin/dfu-util").absoluteFilePath();
|
||||
#else
|
||||
if ( avrLoc.isEmpty())
|
||||
avrLoc = "/usr/bin/avrdude";
|
||||
if ( sambaLoc.isEmpty())
|
||||
sambaLoc = "/usr/bin/sam-ba";
|
||||
if ( dfuLoc.isEmpty())
|
||||
dfuLoc = QFileInfo("/usr/bin/dfu-util").absoluteFilePath();
|
||||
#endif
|
||||
|
||||
dfuArgs = g.dfuArguments().split(" ", QString::SkipEmptyParts);
|
||||
avrArgs = g.avrArguments().split(" ", QString::SkipEmptyParts);
|
||||
avrProgrammer = g.programmer();
|
||||
avrPort = g.avrPort();
|
||||
avrMCU = g.mcu();
|
||||
armMCU = g.armMcu();
|
||||
sambaPort = g.sambaPort();
|
||||
|
||||
ui->avrdude_location->setText(getAVRDUDE());
|
||||
ui->avrArgs->setText(getAVRArgs().join(" "));
|
||||
|
||||
ui->samba_location->setText(getSAMBA());
|
||||
ui->samba_port->setText(getSambaPort());
|
||||
|
||||
ui->dfu_location->setText(getDFU());
|
||||
ui->dfuArgs->setText(getDFUArgs().join(" "));
|
||||
|
||||
int idx1 = ui->avrdude_programmer->findText(getProgrammer());
|
||||
int idx2 = ui->avrdude_port->findText(getPort());
|
||||
int idx3 = ui->avrdude_mcu->findText(getMCU());
|
||||
int idx4 = ui->arm_mcu->findText(getArmMCU());
|
||||
if(idx1>=0) ui->avrdude_programmer->setCurrentIndex(idx1);
|
||||
if(idx2>=0) ui->avrdude_port->setCurrentIndex(idx2);
|
||||
if(idx3>=0) ui->avrdude_mcu->setCurrentIndex(idx3);
|
||||
if(idx4>=0) ui->arm_mcu->setCurrentIndex(idx4);
|
||||
QFile file;
|
||||
if (file.exists(avrLoc)) {
|
||||
ui->pushButton_3->setEnabled(true);
|
||||
} else {
|
||||
ui->pushButton_3->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void burnConfigDialog::putSettings()
|
||||
{
|
||||
g.avrdudeLocation( avrLoc );
|
||||
g.programmer( avrProgrammer);
|
||||
g.mcu( avrMCU );
|
||||
g.avrPort( avrPort );
|
||||
g.avrArguments( avrArgs.join(" ") );
|
||||
g.sambaLocation( sambaLoc );
|
||||
g.sambaPort( sambaPort );
|
||||
g.armMcu( armMCU );
|
||||
g.dfuLocation( dfuLoc );
|
||||
g.dfuArguments( dfuArgs.join(" ") );
|
||||
}
|
||||
|
||||
void burnConfigDialog::populateProgrammers()
|
||||
{
|
||||
QString fileName = QFileInfo(avrLoc).canonicalPath() + "/avrdude.conf"; //for windows
|
||||
if(!QFileInfo(fileName).exists()) fileName = "/etc/avrdude.conf"; //for linux
|
||||
if(!QFileInfo(fileName).exists()) fileName = "/etc/avrdude/avrdude.conf"; //for linux
|
||||
if(!QFileInfo(fileName).exists()) return; // not found avrdude.conf - returning
|
||||
|
||||
QFile file(fileName);
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return;
|
||||
|
||||
QStringList items;
|
||||
QString line = "";
|
||||
QString prevline = "";
|
||||
QTextStream in(&file);
|
||||
while (!in.atEnd())
|
||||
{
|
||||
prevline = line;
|
||||
line = in.readLine();
|
||||
|
||||
if(prevline.left(10).toLower()=="programmer")
|
||||
items << line.section('"',1,1);
|
||||
}
|
||||
file.close();
|
||||
|
||||
items.sort();
|
||||
|
||||
QString avrProgrammer_temp = avrProgrammer;
|
||||
ui->avrdude_programmer->clear();
|
||||
ui->avrdude_programmer->addItems(items);
|
||||
int idx1 = ui->avrdude_programmer->findText(avrProgrammer_temp);
|
||||
if(idx1>=0) ui->avrdude_programmer->setCurrentIndex(idx1);
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrdude_programmer_currentIndexChanged(QString )
|
||||
{
|
||||
avrProgrammer = ui->avrdude_programmer->currentText();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrdude_mcu_currentIndexChanged(QString )
|
||||
{
|
||||
avrMCU = ui->avrdude_mcu->currentText();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrdude_location_editingFinished()
|
||||
{
|
||||
avrLoc = ui->avrdude_location->text();
|
||||
if (avrLoc.isEmpty()) {
|
||||
ui->pushButton_3->setDisabled(true);
|
||||
} else {
|
||||
QFile file;
|
||||
if (file.exists(avrLoc)) {
|
||||
ui->pushButton_3->setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrArgs_editingFinished()
|
||||
{
|
||||
avrArgs = ui->avrArgs->text().split(" ", QString::SkipEmptyParts);
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_avrdude_port_currentIndexChanged(QString )
|
||||
{
|
||||
avrPort = ui->avrdude_port->currentText();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_samba_location_editingFinished()
|
||||
{
|
||||
sambaLoc = ui->samba_location->text();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_samba_port_editingFinished()
|
||||
{
|
||||
sambaPort = ui->samba_port->text();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_arm_mcu_currentIndexChanged(QString )
|
||||
{
|
||||
armMCU = ui->arm_mcu->currentText();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_pushButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Location"),ui->avrdude_location->text());
|
||||
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
ui->avrdude_location->setText(fileName);
|
||||
avrLoc = fileName;
|
||||
}
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_sb_browse_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Location"),ui->samba_location->text());
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
ui->samba_location->setText(fileName);
|
||||
sambaLoc = fileName;
|
||||
}
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_dfu_browse_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Location"),ui->dfu_location->text());
|
||||
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
ui->dfu_location->setText(fileName);
|
||||
dfuLoc = fileName;
|
||||
}
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_dfu_location_editingFinished()
|
||||
{
|
||||
dfuLoc = ui->dfu_location->text();
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_dfuArgs_editingFinished()
|
||||
{
|
||||
dfuArgs = ui->dfuArgs->text().split(" ", QString::SkipEmptyParts);
|
||||
}
|
||||
|
||||
void burnConfigDialog::listProgrammers()
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << "-c?";
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "List available programmers", AVR_DIALOG_KEEP_OPEN, TRUE);
|
||||
ad->setWindowIcon(CompanionIcon("list.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_pushButton_3_clicked()
|
||||
{
|
||||
listProgrammers();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void burnConfigDialog::on_pushButton_4_clicked()
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << "-?";
|
||||
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, ui->avrdude_location->text(), arguments, "Show help", AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(CompanionIcon("configure.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
|
||||
void burnConfigDialog::readFuses()
|
||||
{
|
||||
QStringList args = avrArgs;
|
||||
if(!avrPort.isEmpty()) args << "-P" << avrPort;
|
||||
|
||||
QStringList str;
|
||||
str << "-U" << "lfuse:r:-:i" << "-U" << "hfuse:r:-:i" << "-U" << "efuse:r:-:i";
|
||||
|
||||
QStringList arguments;
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << str;
|
||||
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Read Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
void burnConfigDialog::restFuses(bool eeProtect)
|
||||
{
|
||||
//fuses
|
||||
//avrdude -c usbasp -p m64 -U lfuse:w:<0x0E>:m
|
||||
//avrdude -c usbasp -p m64 -U hfuse:w:<0x89>:m 0x81 for eeprom protection
|
||||
//avrdude -c usbasp -p m64 -U efuse:w:<0xFF>:m
|
||||
|
||||
QMessageBox::StandardButton ret = QMessageBox::No;
|
||||
ret = QMessageBox::warning(this, tr("Companion"),
|
||||
tr("<b><u>WARNING!</u></b><br>This will reset the fuses of %1 to the factory settings.<br>Writing fuses can mess up your radio.<br>Do this only if you are sure they are wrong!<br>Are you sure you want to continue?").arg(avrMCU),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret == QMessageBox::Yes)
|
||||
{
|
||||
QStringList args = avrArgs;
|
||||
if(!avrPort.isEmpty()) args << "-P" << avrPort;
|
||||
QStringList str;
|
||||
if (avrMCU=="m2560") {
|
||||
args << "-B8";
|
||||
QString erStr = eeProtect ? "hfuse:w:0x11:m" : "hfuse:w:0x19:m";
|
||||
str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
}
|
||||
else {
|
||||
QString lfuses;
|
||||
QString tempFile = generateProcessUniqueTempFileName("ftemp.bin");
|
||||
QStringList argread;
|
||||
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
QFile file(tempFile);
|
||||
if (file.exists() && file.size()==1) {
|
||||
file.open(QIODevice::ReadOnly);
|
||||
char bin_flash[1];
|
||||
file.read(bin_flash, 1);
|
||||
if (bin_flash[0]==0x0E) {
|
||||
lfuses="lfuse:w:0x0E:m";
|
||||
}
|
||||
else {
|
||||
lfuses="lfuse:w:0x3F:m";
|
||||
}
|
||||
file.close();
|
||||
qunlink(tempFile);
|
||||
}
|
||||
else {
|
||||
lfuses="lfuse:w:0x3F:m";
|
||||
}
|
||||
|
||||
QString erStr = eeProtect ? "hfuse:w:0x81:m" : "hfuse:w:0x89:m";
|
||||
str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
}
|
||||
QStringList arguments;
|
||||
if (avrMCU=="m2560") {
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-u" << str;
|
||||
}
|
||||
else {
|
||||
arguments << "-c" << avrProgrammer << "-p" << avrMCU << args << "-B" << "100" << "-u" << str;
|
||||
}
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, arguments, "Reset Fuses",AVR_DIALOG_KEEP_OPEN,TRUE);
|
||||
ad->setWindowIcon(CompanionIcon("fuses.png"));
|
||||
ad->show();
|
||||
delete ad;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void burnConfigDialog::on_advCtrChkB_toggled(bool checked)
|
||||
{
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (checked) {
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
ui->label_dfu2->show();
|
||||
ui->dfuArgs->show();
|
||||
}
|
||||
else if (IS_SKY9X(eepromInterface->getBoard())) {
|
||||
ui->label_sb2->show();
|
||||
ui->arm_mcu->show();
|
||||
}
|
||||
else {
|
||||
ui->label_av3->show();
|
||||
ui->avrdude_mcu->show();
|
||||
QMessageBox::warning(this, tr("Companion"),
|
||||
tr("<b><u>WARNING!</u></b><br>Normally CPU type is automatically selected according to the chosen firmware.<br>If you change the CPU type the resulting eeprom could be inconsistent."),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
ui->label_dfu2->hide();
|
||||
ui->dfuArgs->hide();
|
||||
}
|
||||
else if (IS_SKY9X(eepromInterface->getBoard())) {
|
||||
ui->label_sb2->hide();
|
||||
ui->arm_mcu->hide();
|
||||
}
|
||||
else {
|
||||
ui->label_av3->hide();
|
||||
ui->avrdude_mcu->hide();
|
||||
}
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
|
||||
void burnConfigDialog::shrink()
|
||||
{
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
#ifndef BURNCONFIGDIALOG_H
|
||||
#define BURNCONFIGDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
|
||||
#define MEM_TYPE_EEPROM 1
|
||||
#define MEM_TYPE_FLASH 2
|
||||
|
||||
#define OPR_TYPE_READ 1
|
||||
#define OPR_TYPE_WRITE 2
|
||||
|
||||
namespace Ui {
|
||||
class burnConfigDialog;
|
||||
}
|
||||
|
||||
class burnConfigDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
burnConfigDialog(QWidget *parent = 0);
|
||||
~burnConfigDialog();
|
||||
|
||||
QString getAVRDUDE() {return avrLoc;}
|
||||
QString getSAMBA() {return sambaLoc;}
|
||||
QString getDFU() {return dfuLoc;}
|
||||
QStringList getAVRArgs() {return avrArgs;}
|
||||
QStringList getDFUArgs() {return dfuArgs;}
|
||||
QString getProgrammer() {return avrProgrammer;}
|
||||
QString getMCU() {return avrMCU;}
|
||||
QString getArmMCU() {return armMCU;}
|
||||
QString getPort() {return avrPort;}
|
||||
QString getSambaPort() {return sambaPort;}
|
||||
|
||||
void listProgrammers();
|
||||
void restFuses(bool eeProtect);
|
||||
void readFuses();
|
||||
|
||||
private:
|
||||
Ui::burnConfigDialog *ui;
|
||||
|
||||
void populateProgrammers();
|
||||
|
||||
QString avrLoc;
|
||||
QString sambaLoc;
|
||||
QString dfuLoc;
|
||||
QStringList avrArgs;
|
||||
QString avrProgrammer;
|
||||
QString avrMCU;
|
||||
QString armMCU;
|
||||
QString avrPort;
|
||||
QString sambaPort;
|
||||
QStringList dfuArgs;
|
||||
|
||||
private slots:
|
||||
void shrink();
|
||||
void on_avrArgs_editingFinished();
|
||||
void on_pushButton_4_clicked();
|
||||
void on_pushButton_3_clicked();
|
||||
void on_pushButton_clicked();
|
||||
void on_avrdude_location_editingFinished();
|
||||
void on_avrdude_programmer_currentIndexChanged(QString );
|
||||
void on_avrdude_mcu_currentIndexChanged(QString );
|
||||
void on_avrdude_port_currentIndexChanged(QString );
|
||||
void on_samba_location_editingFinished();
|
||||
void on_samba_port_editingFinished();
|
||||
void on_arm_mcu_currentIndexChanged(QString );
|
||||
void on_sb_browse_clicked();
|
||||
void on_dfu_browse_clicked();
|
||||
void on_dfu_location_editingFinished();
|
||||
void on_dfuArgs_editingFinished();
|
||||
void on_advCtrChkB_toggled(bool checked);
|
||||
void getSettings();
|
||||
void putSettings();
|
||||
};
|
||||
|
||||
#endif // BURNCONFIGDIALOG_H
|
||||
@@ -0,0 +1,859 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>burnConfigDialog</class>
|
||||
<widget class="QDialog" name="burnConfigDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>531</width>
|
||||
<height>335</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>531</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Programmer Configuration</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="9" column="2">
|
||||
<widget class="QLineEdit" name="dfu_location">
|
||||
<property name="toolTip">
|
||||
<string>Location of sam-ba executable</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The location of the AVRDUDE executable.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">dfu-util</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_dfu1">
|
||||
<property name="text">
|
||||
<string>DFU-Util Location</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="avrdude_location">
|
||||
<property name="toolTip">
|
||||
<string>Location of AVRDUDE executable</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The location of the AVRDUDE executable.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4" rowspan="2">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="whatsThis">
|
||||
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_av2">
|
||||
<property name="text">
|
||||
<string>Programmer</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QComboBox" name="avrdude_programmer">
|
||||
<property name="whatsThis">
|
||||
<string>Programmer used for communicating with the controller.
|
||||
Please consult the programmer's documentation and the AVRDUDE documentation to select the appropriate programmer.</string>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAlphabetically</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">c2n232i</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dasa3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dasa</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">siprog</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">ponyser</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">89isp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">frank-stk200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">blaster</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">ere-isp-avr</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">atisp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dapa</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">xil</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">futurlec</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">abcmini</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">picoweb</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">sp12</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">alf</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">bascom</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dt006</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">pony-stk200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">bsd</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">pavr</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_pdi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_dw</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_hvsp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_pp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_isp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">dragon_jtag</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2pdi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2avr32</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtagmkII_avr32</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2dw</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2isp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2fast</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag2slow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtagmkII</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag1slow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtag1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">jtagmkI</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avr911</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avr109</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">butterfly</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">usbtiny</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">usbasp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avr910</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk600hvsp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk600pp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk600</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500hvsp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500pp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500v2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">mib510</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500v1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">stk500</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">buspirate</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrisp2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrispmkII</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrispv2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrisp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">arduino</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="whatsThis">
|
||||
<string>List all available programmers.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>List Available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QLineEdit" name="avrArgs">
|
||||
<property name="toolTip">
|
||||
<string>Extra arguments that will be passed to AVRDUDE on every call</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Extra arguments used in AVRDUDE.
|
||||
This can be used for providing extra information to AVRDUDE.
|
||||
|
||||
Please only use this if you know what you are doing. There are no error checks and you could cripple your controller.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_av5">
|
||||
<property name="text">
|
||||
<string>Extra Arguments</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="whatsThis">
|
||||
<string>Show AVRDUDE help</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QComboBox" name="avrdude_port">
|
||||
<property name="whatsThis">
|
||||
<string>Communication port to the programmer.
|
||||
</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">usb</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com5</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com6</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com7</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com8</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com9</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com10</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com11</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com12</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com13</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com14</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">com15</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">lpt4</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">avrdoper</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">/dev/ttyUSB0</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">/dev/ttyUSB1</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_av4">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_av1">
|
||||
<property name="text">
|
||||
<string>AVRDUDE Location</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_av3">
|
||||
<property name="text">
|
||||
<string>MCU</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QComboBox" name="avrdude_mcu">
|
||||
<property name="toolTip">
|
||||
<string>CPU of your TX</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>CPU present on your 9x radio
|
||||
Should be m64 for stock radios
|
||||
m2560 for v4.1 boards</string>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAlphabetically</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">m64</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">m128</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">m2560</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QComboBox" name="arm_mcu">
|
||||
<property name="toolTip">
|
||||
<string>CPU of your TX</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>CPU present on your 9x radio
|
||||
Should be m64 for stock radios
|
||||
m2560 for v4.1 boards</string>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::InsertAlphabetically</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">at91sam3s4-9x</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>at91sam3s8-9xr</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_sb1">
|
||||
<property name="text">
|
||||
<string>SAM-BA Location</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLineEdit" name="samba_location">
|
||||
<property name="toolTip">
|
||||
<string>Location of sam-ba executable</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The location of the AVRDUDE executable.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">sam-ba.exe</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_sb2">
|
||||
<property name="text">
|
||||
<string>ARM MCU</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_sb3">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QLineEdit" name="samba_port">
|
||||
<property name="toolTip">
|
||||
<string>sam-ba serial port</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>The location of the AVRDUDE executable.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">\USBserial\COM23</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_dfu2">
|
||||
<property name="text">
|
||||
<string>Alternate device</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="2">
|
||||
<widget class="QLineEdit" name="dfuArgs">
|
||||
<property name="toolTip">
|
||||
<string>Extra arguments that will be passed to AVRDUDE on every call</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Extra arguments used in AVRDUDE.
|
||||
This can be used for providing extra information to AVRDUDE.
|
||||
|
||||
Please only use this if you know what you are doing. There are no error checks and you could cripple your controller.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QPushButton" name="sb_browse">
|
||||
<property name="whatsThis">
|
||||
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="4">
|
||||
<widget class="QPushButton" name="dfu_browse">
|
||||
<property name="whatsThis">
|
||||
<string>Use this button to browse and look for the AVRDUDE executable file.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="2">
|
||||
<widget class="QCheckBox" name="advCtrChkB">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Use advanced controls</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>avrdude_location</tabstop>
|
||||
<tabstop>pushButton</tabstop>
|
||||
<tabstop>avrdude_programmer</tabstop>
|
||||
<tabstop>pushButton_3</tabstop>
|
||||
<tabstop>avrdude_mcu</tabstop>
|
||||
<tabstop>avrdude_port</tabstop>
|
||||
<tabstop>avrArgs</tabstop>
|
||||
<tabstop>pushButton_4</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>burnConfigDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>burnConfigDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,615 @@
|
||||
#include "burndialog.h"
|
||||
#include "ui_burndialog.h"
|
||||
|
||||
#include <QtGui>
|
||||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "flashinterface.h"
|
||||
#include "hexinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
// Type 1 = Burn EEPROM, Type 2= Burn Flash
|
||||
burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * backupEE, QString DocName):
|
||||
QDialog(parent),
|
||||
ui(new Ui::burnDialog),
|
||||
hexfileName(fileName),
|
||||
backup(backupEE),
|
||||
hexType(Type)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("write_flash.png"));
|
||||
|
||||
if (!g.profile[g.id()].splashFile().isEmpty()){
|
||||
imageSource=PROFILE;
|
||||
imageFile=g.profile[g.id()].splashFile();
|
||||
}
|
||||
else {
|
||||
ui->useProfileImageCB->setDisabled(true);
|
||||
imageSource=FIRMWARE;
|
||||
imageFile="";
|
||||
}
|
||||
ui->SplashFrame->hide();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->EEbackupCB->hide();
|
||||
ui->EEbackupCB->setCheckState(*backup ? Qt::Checked : Qt::Unchecked);
|
||||
if (Type == FLASH_FILE_TYPE ) {
|
||||
ui->EEpromCB->hide();
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
ui->patchhw_CB->hide();
|
||||
setWindowTitle(tr("Write firmware to Radio"));
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEbackupCB->hide();
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->FlashLoadButton->setText(tr("Browse for file"));
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
ui->patchhw_CB->hide();
|
||||
ui->EEpromCB->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->FWFileName->clear();
|
||||
ui->DateField->clear();
|
||||
ui->versionField->clear();
|
||||
ui->ModField->clear();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->SplashFrame->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->EEbackupCB->hide();
|
||||
if (DocName.isEmpty()) {
|
||||
setWindowTitle(tr("Write Backup to Radio"));
|
||||
}
|
||||
else {
|
||||
setWindowTitle(tr("Write Backup from %1 to Radio").arg(DocName));
|
||||
}
|
||||
ui->profile_label->setText(tr("Current profile")+QString(": ")+g.profile[g.id()].name());
|
||||
}
|
||||
if (!hexfileName->isEmpty()) {
|
||||
ui->FWFileName->setText(*hexfileName);
|
||||
if (Type==FLASH_FILE_TYPE) {
|
||||
checkFw(*hexfileName);
|
||||
}
|
||||
else {
|
||||
burnraw=false;
|
||||
if (checkeEprom(*hexfileName)) {
|
||||
QString Name = g.profile[g.id()].name();
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
QString DisplaySet = g.profile[g.id()].display();
|
||||
QString BeeperSet = g.profile[g.id()].beeper();
|
||||
QString HapticSet = g.profile[g.id()].haptic();
|
||||
QString SpeakerSet = g.profile[g.id()].speaker();
|
||||
if (!Name.isEmpty()) {
|
||||
ui->profile_label->show();
|
||||
ui->patchcalib_CB->show();
|
||||
ui->patchhw_CB->show();
|
||||
// TODO I hardcode the number of pots here, should be dependant on the board?
|
||||
if (!((calib.length()==(NUM_STICKS+3)*12) && (trainercalib.length()==16))) {
|
||||
ui->patchcalib_CB->setDisabled(true);
|
||||
}
|
||||
if (!((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6))) {
|
||||
ui->patchhw_CB->setDisabled(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->profile_label->hide();
|
||||
}
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEpromCB->show();
|
||||
}
|
||||
else {
|
||||
ui->EEpromCB->setChecked(false);
|
||||
}
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
}
|
||||
}
|
||||
ui->FWFileName->hide();
|
||||
ui->FlashLoadButton->hide();
|
||||
hexfileName->clear();
|
||||
}
|
||||
else if (Type==FLASH_FILE_TYPE) {
|
||||
QString FileName = g.profile[g.id()].fwName();
|
||||
QFile file(FileName);
|
||||
if (file.exists()) {
|
||||
checkFw(FileName);
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
resize(0, 0);
|
||||
}
|
||||
|
||||
burnDialog::~burnDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void burnDialog::on_FlashLoadButton_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->FWFileName->clear();
|
||||
ui->DateField->clear();
|
||||
ui->versionField->clear();
|
||||
ui->ModField->clear();
|
||||
ui->FramFWInfo->hide();
|
||||
ui->SplashFrame->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->EEbackupCB->hide();
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
if (hexType==FLASH_FILE_TYPE) {
|
||||
fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
|
||||
if(fileName.isEmpty())
|
||||
return;
|
||||
checkFw(fileName);
|
||||
}
|
||||
else {
|
||||
QString fileName = QFileDialog::getOpenFileName(this,tr("Choose Radio Backup file"), g.eepromDir(), tr(EXTERNAL_EEPROM_FILES_FILTER));
|
||||
if (checkeEprom(fileName)) {
|
||||
if (burnraw==false) {
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
ui->profile_label->show();
|
||||
ui->patchcalib_CB->show();
|
||||
ui->patchhw_CB->show();
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEpromCB->show();
|
||||
}
|
||||
else {
|
||||
ui->EEpromCB->setChecked(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
ui->profile_label->hide();
|
||||
ui->patchcalib_CB->setChecked(false);
|
||||
ui->patchhw_CB->setChecked(false);
|
||||
ui->patchhw_CB->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::checkFw(QString fileName)
|
||||
{
|
||||
if (fileName.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEbackupCB->show();
|
||||
}
|
||||
else {
|
||||
ui->EEbackupCB->setChecked(false);
|
||||
*backup=false;
|
||||
}
|
||||
ui->FWFileName->setText(fileName);
|
||||
FlashInterface flash(fileName);
|
||||
if (flash.isValid()) {
|
||||
ui->FramFWInfo->show();
|
||||
ui->DateField->setText(flash.getDate() + " " + flash.getTime());
|
||||
ui->versionField->setText(flash.getVersion());
|
||||
ui->ModField->setText(flash.getEEpromId());
|
||||
|
||||
ui->SplashFrame->hide();
|
||||
if (flash.hasSplash()) {
|
||||
ui->SplashFrame->show();
|
||||
ui->imageLabel->setFixedSize(flash.getSplashWidth(), flash.getSplashHeight());
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fileName));
|
||||
}
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
}
|
||||
|
||||
bool burnDialog::checkeEprom(QString fileName)
|
||||
{
|
||||
if (fileName.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
QFile file(fileName);
|
||||
if (!file.exists()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Unable to find file %1!").arg(fileName));
|
||||
return false;
|
||||
}
|
||||
burnraw=false;
|
||||
int fileType = getFileType(fileName);
|
||||
#if 0
|
||||
if (fileType==FILE_TYPE_XML) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
QTextStream inputStream(&file);
|
||||
XmlInterface(inputStream).load(radioData);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
|
||||
bool xmlOK = doc.setContent(&file);
|
||||
if(xmlOK) {
|
||||
if (!LoadEepromXml(radioData, doc)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
file.reset();
|
||||
|
||||
QTextStream inputStream(&file);
|
||||
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
|
||||
QString hline = inputStream.readLine();
|
||||
if (hline!=EEPE_EEPROM_FILE_HEADER) {
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
uint8_t eeprom[EESIZE_RLC_MAX];
|
||||
int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX);
|
||||
if (!eeprom_size) {
|
||||
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
burnraw=true;
|
||||
ui->FWFileName->setText(fileName);
|
||||
return true;
|
||||
}
|
||||
file.close();
|
||||
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
|
||||
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
burnraw=true;
|
||||
ui->FWFileName->setText(fileName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (fileType==FILE_TYPE_BIN) { //read binary
|
||||
int eeprom_size = file.size();
|
||||
if (!file.open(QFile::ReadOnly)) { //reading binary file - TODO HEX support
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
uint8_t *eeprom = (uint8_t *)malloc(eeprom_size);
|
||||
memset(eeprom, 0, eeprom_size);
|
||||
long result = file.read((char*)eeprom, eeprom_size);
|
||||
file.close();
|
||||
if (result != eeprom_size) {
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error reading file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
|
||||
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
burnraw=true;
|
||||
}
|
||||
}
|
||||
ui->FWFileName->setText(fileName);
|
||||
return true;
|
||||
}
|
||||
|
||||
void burnDialog::displaySplash()
|
||||
{
|
||||
QImage image;
|
||||
if (imageSource == FIRMWARE){
|
||||
FlashInterface flash(ui->FWFileName->text());
|
||||
image = flash.getSplash();
|
||||
}
|
||||
else {
|
||||
image.load(imageFile);
|
||||
}
|
||||
if (image.isNull()) {
|
||||
return;
|
||||
}
|
||||
ui->imageLabel->setPixmap( makePixMap( image, g.profile[g.id()].fwType()));
|
||||
}
|
||||
|
||||
void burnDialog::updateUI()
|
||||
{
|
||||
if (hexType==EEPROM_FILE_TYPE)
|
||||
return;
|
||||
|
||||
ui->useProfileImageCB->setChecked( imageSource == PROFILE );
|
||||
ui->useFwImageCB->setChecked( imageSource == FIRMWARE );
|
||||
ui->useLibraryImageCB->setChecked( imageSource == LIBRARY );
|
||||
ui->useAnotherImageCB->setChecked( imageSource == ANOTHER );
|
||||
|
||||
displaySplash();
|
||||
}
|
||||
|
||||
void burnDialog::on_useFwImageCB_clicked()
|
||||
{
|
||||
QString fileName = ui->FWFileName->text();
|
||||
FlashInterface flash(fileName);
|
||||
if (!flash.isValid()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr( "The firmware file is not valid." ));
|
||||
}
|
||||
else {
|
||||
if (!flash.hasSplash()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr( "There is no start screen image in the firmware file." ));
|
||||
}
|
||||
else{
|
||||
imageSource = FIRMWARE;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_useProfileImageCB_clicked()
|
||||
{
|
||||
QString fileName = g.profile[g.id()].splashFile();
|
||||
if (!fileName.isEmpty()){
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Profile image %1 is invalid.").arg(fileName));
|
||||
}
|
||||
else {
|
||||
imageSource = PROFILE;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_useAnotherImageCB_clicked()
|
||||
{
|
||||
QString supportedImageFormats;
|
||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||
}
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open image file to use as radio start screen"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
if (!fileName.isEmpty()){
|
||||
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Image could not be loaded from %1").arg(fileName));
|
||||
}
|
||||
else{
|
||||
imageSource = ANOTHER;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_useLibraryImageCB_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
splashLibrary *ld = new splashLibrary(this,&fileName);
|
||||
ld->exec();
|
||||
if (!fileName.isEmpty()) {
|
||||
QImage image(fileName);
|
||||
if (image.isNull()) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("The library image could not be loaded"));
|
||||
}
|
||||
else{
|
||||
imageSource = LIBRARY;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
void burnDialog::on_BurnFlashButton_clicked()
|
||||
{
|
||||
if (hexType==FLASH_FILE_TYPE) {
|
||||
QString fileName=ui->FWFileName->text();
|
||||
if (!fileName.isEmpty()) {
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
if (!ui->useFwImageCB->isChecked()) {
|
||||
const QPixmap * pixmap = ui->imageLabel->pixmap();
|
||||
QImage image;
|
||||
if (pixmap) {
|
||||
image = pixmap->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
|
||||
}
|
||||
if (!image.isNull()) {
|
||||
QString tempFile;
|
||||
if (getFileType(fileName) == FILE_TYPE_HEX)
|
||||
tempFile = generateProcessUniqueTempFileName("flash.hex");
|
||||
else
|
||||
tempFile = generateProcessUniqueTempFileName("flash.bin");
|
||||
FlashInterface flash(fileName);
|
||||
flash.setSplash(image);
|
||||
if (flash.saveFlash(tempFile) > 0) {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(tempFile);
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Custom image not found"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(fileName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
|
||||
hexfileName->clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (hexType==EEPROM_FILE_TYPE) {
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
||||
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
|
||||
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
|
||||
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
||||
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
|
||||
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
|
||||
|
||||
QString DisplaySet= g.profile[g.id()].display();
|
||||
QString BeeperSet= g.profile[g.id()].beeper();
|
||||
QString HapticSet= g.profile[g.id()].haptic();
|
||||
QString SpeakerSet= g.profile[g.id()].speaker();
|
||||
bool patch=false;
|
||||
if (ui->patchcalib_CB->isChecked()) {
|
||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||
QString Byte;
|
||||
int16_t byte16;
|
||||
bool ok;
|
||||
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
|
||||
Byte=calib.mid(i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.calibMid[i]=byte16;
|
||||
Byte=calib.mid(4+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.calibSpanNeg[i]=byte16;
|
||||
Byte=calib.mid(8+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.calibSpanPos[i]=byte16;
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
Byte=trainercalib.mid(i*4,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.trainer.calib[i]=byte16;
|
||||
}
|
||||
radioData.generalSettings.currentCalib=currentCalib;
|
||||
radioData.generalSettings.vBatCalib=vBatCalib;
|
||||
radioData.generalSettings.PPM_Multiplier=PPM_Multiplier;
|
||||
patch=true;
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, Settings not patched"));
|
||||
}
|
||||
}
|
||||
if (ui->patchhw_CB->isChecked()) {
|
||||
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
|
||||
radioData.generalSettings.vBatWarn=vBatWarn;
|
||||
radioData.generalSettings.stickMode=GSStickMode;
|
||||
uint8_t byte8u;
|
||||
int8_t byte8;
|
||||
bool ok;
|
||||
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.optrexDisplay=(byte8==1 ? true : false);
|
||||
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.contrast=byte8u;
|
||||
|
||||
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.backlightBright=byte8u;
|
||||
|
||||
byte8u=(uint8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.beeperMode=(BeeperMode)byte8u;
|
||||
|
||||
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.beeperLength=byte8;
|
||||
|
||||
byte8u=(uint8_t)HapticSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.hapticMode=(BeeperMode)byte8u;
|
||||
|
||||
byte8u=(uint8_t)HapticSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.hapticStrength=byte8u;
|
||||
|
||||
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.hapticLength=byte8;
|
||||
|
||||
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.speakerMode=byte8u;
|
||||
|
||||
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.speakerPitch=byte8u;
|
||||
|
||||
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
radioData.generalSettings.speakerVolume=byte8u;
|
||||
patch=true;
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
|
||||
}
|
||||
|
||||
if (patch) {
|
||||
QString fileName = generateProcessUniqueTempFileName("temp.bin");
|
||||
QFile file(fileName);
|
||||
|
||||
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
|
||||
int eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmware()->getVariantNumber());
|
||||
if (!eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
hexfileName->clear();
|
||||
}
|
||||
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
hexfileName->clear();
|
||||
}
|
||||
|
||||
QTextStream outputStream(&file);
|
||||
|
||||
long result = file.write((char*)eeprom, eeprom_size);
|
||||
if (result != eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
}
|
||||
|
||||
hexfileName->clear();
|
||||
hexfileName->append(fileName);
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
}
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
}
|
||||
}
|
||||
this->close();
|
||||
}
|
||||
|
||||
void burnDialog::on_cancelButton_clicked()
|
||||
{
|
||||
hexfileName->clear();
|
||||
this->close();
|
||||
}
|
||||
|
||||
void burnDialog::on_EEpromCB_toggled(bool checked)
|
||||
{
|
||||
*backup = ui->EEpromCB->isChecked();
|
||||
}
|
||||
|
||||
void burnDialog::shrink()
|
||||
{
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
void burnDialog::on_EEbackupCB_clicked()
|
||||
{
|
||||
*backup = ui->EEbackupCB->isChecked();
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
#ifndef BURNDIALOG_H
|
||||
#define BURNDIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
#include "flashinterface.h"
|
||||
#include "xmlinterface.h"
|
||||
|
||||
#define HEX_FILES_FILTER "HEX files (*.hex);;"
|
||||
#define BIN_FILES_FILTER "BIN files (*.bin);;"
|
||||
#define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;"
|
||||
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
|
||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
||||
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
|
||||
#define EEPE_MODEL_FILE_HEADER "EEPE MODEL FILE"
|
||||
#define EEPROM_FILE_TYPE 1
|
||||
#define FLASH_FILE_TYPE 2
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class burnDialog;
|
||||
}
|
||||
|
||||
class burnDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit burnDialog(QWidget *parent = 0, int Type = 2, QString * fileName = NULL, bool * backupEE=NULL, QString docname="");
|
||||
~burnDialog();
|
||||
|
||||
private slots:
|
||||
void on_FlashLoadButton_clicked();
|
||||
void on_BurnFlashButton_clicked();
|
||||
void on_cancelButton_clicked();
|
||||
void on_EEbackupCB_clicked();
|
||||
void on_EEpromCB_toggled(bool checked);
|
||||
bool checkeEprom(QString fileName);
|
||||
void on_useProfileImageCB_clicked();
|
||||
void on_useFwImageCB_clicked();
|
||||
void on_useLibraryImageCB_clicked();
|
||||
void on_useAnotherImageCB_clicked();
|
||||
|
||||
void checkFw(QString fileName);
|
||||
void displaySplash();
|
||||
void updateUI();
|
||||
void shrink();
|
||||
|
||||
|
||||
private:
|
||||
Ui::burnDialog *ui;
|
||||
QString * hexfileName;
|
||||
bool * backup;
|
||||
int hexType;
|
||||
RadioData radioData;
|
||||
bool burnraw;
|
||||
enum ImageSource {FIRMWARE, PROFILE, LIBRARY, ANOTHER};
|
||||
ImageSource imageSource;
|
||||
QString imageFile;
|
||||
};
|
||||
|
||||
#endif // BURNDIALOG_H
|
||||
@@ -0,0 +1,379 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>burnDialog</class>
|
||||
<widget class="QDialog" name="burnDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>399</width>
|
||||
<height>564</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Customize Splash</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<spacer name="hs2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="BurnFlashButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Write to TX</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="patchcalib_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Modify calibration parameters using settings from current profile</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Patch calibration setting from profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="patchhw_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Modify HW parameters using settings from current profile</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Patch HW setting from profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QFrame" name="FramFWInfo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="dateLabel">
|
||||
<property name="text">
|
||||
<string>Date & Time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="versionField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="buildLabel">
|
||||
<property name="text">
|
||||
<string>Variant</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="ModField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="versionLabel">
|
||||
<property name="text">
|
||||
<string>Version</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="DateField">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="FWFileName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="FlashLoadButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse for file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QCheckBox" name="EEpromCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Allows Companion to write to older version of the firmware</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check Firmware compatibility</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="EEbackupCB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Backup and restore Models and Settings</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="profile_label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current Profile</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QFrame" name="SplashFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="SplashLayout" rowstretch="0,0,0,0,0,0,0">
|
||||
<item row="0" column="1" rowspan="7">
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>214</width>
|
||||
<height>66</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="useFwImageCB">
|
||||
<property name="text">
|
||||
<string>Use firmware start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="useAnotherImageCB">
|
||||
<property name="text">
|
||||
<string>Use another start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="useProfileImageCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use profile start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="useLibraryImageCB">
|
||||
<property name="text">
|
||||
<string>Use library start screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>BurnFlashButton</tabstop>
|
||||
<tabstop>FWFileName</tabstop>
|
||||
<tabstop>FlashLoadButton</tabstop>
|
||||
<tabstop>versionField</tabstop>
|
||||
<tabstop>ModField</tabstop>
|
||||
<tabstop>useProfileImageCB</tabstop>
|
||||
<tabstop>useFwImageCB</tabstop>
|
||||
<tabstop>useLibraryImageCB</tabstop>
|
||||
<tabstop>useAnotherImageCB</tabstop>
|
||||
<tabstop>EEbackupCB</tabstop>
|
||||
<tabstop>patchcalib_CB</tabstop>
|
||||
<tabstop>patchhw_CB</tabstop>
|
||||
<tabstop>EEpromCB</tabstop>
|
||||
<tabstop>cancelButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,71 @@
|
||||
# Find libphonon
|
||||
# Once done this will define
|
||||
#
|
||||
# PHONON_FOUND - system has Phonon Library
|
||||
# PHONON_INCLUDES - the Phonon include directory
|
||||
# PHONON_LIBS - link these to use Phonon
|
||||
# PHONON_VERSION - the version of the Phonon Library
|
||||
|
||||
# Copyright (c) 2008, Matthias Kretz <kretz@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
macro(_phonon_find_version)
|
||||
set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h")
|
||||
if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000)
|
||||
string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}")
|
||||
set(PHONON_VERSION "${CMAKE_MATCH_1}")
|
||||
message(STATUS "Phonon Version: ${PHONON_VERSION}")
|
||||
endmacro(_phonon_find_version)
|
||||
|
||||
if(PHONON_FOUND)
|
||||
# Already found, nothing more to do except figuring out the version
|
||||
_phonon_find_version()
|
||||
else(PHONON_FOUND)
|
||||
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
||||
set(PHONON_FIND_QUIETLY TRUE)
|
||||
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
||||
|
||||
# As discussed on kde-buildsystem: first look at CMAKE_PREFIX_PATH, then at the suggested PATHS (kde4 install dir)
|
||||
find_library(PHONON_LIBRARY NAMES phonon phonon4 PATHS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
|
||||
# then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.)
|
||||
find_library(PHONON_LIBRARY NAMES phonon)
|
||||
|
||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
|
||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h)
|
||||
|
||||
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
||||
set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
|
||||
set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
|
||||
set(PHONON_FOUND TRUE)
|
||||
_phonon_find_version()
|
||||
else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
||||
set(PHONON_FOUND FALSE)
|
||||
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
||||
|
||||
if(PHONON_FOUND)
|
||||
if(NOT PHONON_FIND_QUIETLY)
|
||||
message(STATUS "Found Phonon: ${PHONON_LIBRARY}")
|
||||
message(STATUS "Found Phonon Includes: ${PHONON_INCLUDES}")
|
||||
endif(NOT PHONON_FIND_QUIETLY)
|
||||
else(PHONON_FOUND)
|
||||
if(Phonon_FIND_REQUIRED)
|
||||
if(NOT PHONON_INCLUDE_DIR)
|
||||
message(STATUS "Phonon includes NOT found!")
|
||||
endif(NOT PHONON_INCLUDE_DIR)
|
||||
if(NOT PHONON_LIBRARY)
|
||||
message(STATUS "Phonon library NOT found!")
|
||||
endif(NOT PHONON_LIBRARY)
|
||||
message(FATAL_ERROR "Phonon library or includes NOT found!")
|
||||
else(Phonon_FIND_REQUIRED)
|
||||
message(STATUS "Unable to find Phonon")
|
||||
endif(Phonon_FIND_REQUIRED)
|
||||
endif(PHONON_FOUND)
|
||||
|
||||
|
||||
mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY PHONON_INCLUDES)
|
||||
endif(PHONON_FOUND)
|
||||
@@ -0,0 +1,165 @@
|
||||
# - Locate the SDL library
|
||||
# This module defines
|
||||
# SDL_LIBRARY, the library to link against
|
||||
# SDL_FOUND, if false, do not try to link to SDL
|
||||
# SDL_INCLUDE_DIR, where to find SDL.h
|
||||
#
|
||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
||||
# OS X framework based version. (Other versions link to -lSDLmain which
|
||||
# this module will try to find on your behalf.) Also for OS X, this
|
||||
# module will automatically add the -framework Cocoa on your behalf.
|
||||
# $SDLDIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$SDLDIR
|
||||
# used in building SDL.
|
||||
# l.e.galup 9-20-02
|
||||
#
|
||||
# Modified by Eric Wing.
|
||||
# Added new modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
# Also corrected the header search path to follow "proper" SDL guidelines.
|
||||
# Added a search for SDLmain which is needed by some platforms.
|
||||
# Added a search for threads which is needed by some platforms.
|
||||
# Added needed compile switches for MinGW.
|
||||
#
|
||||
# On OSX, this will prefer the Framework version (if found) over others.
|
||||
# People will have to manually change the cache values of
|
||||
# SDL_LIBRARY to override this selection.
|
||||
#
|
||||
# Note that the header path has changed from SDL/SDL.h to just SDL.h
|
||||
# This needed to change because "proper" SDL convention
|
||||
# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability
|
||||
# reasons because not all systems place things in SDL/ (see FreeBSD).
|
||||
FIND_PATH(SDL_INCLUDE_DIR SDL.h
|
||||
$ENV{SDLDIR}/include
|
||||
~/Library/Frameworks/SDL.framework/Headers
|
||||
/Library/Frameworks/SDL.framework/Headers
|
||||
/usr/local/include/SDL
|
||||
/usr/include/SDL
|
||||
/usr/local/include/SDL12
|
||||
/usr/local/include/SDL11 # FreeBSD ports
|
||||
/usr/include/SDL12
|
||||
/usr/include/SDL11
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include/SDL # Fink
|
||||
/sw/include
|
||||
/opt/local/include/SDL # DarwinPorts
|
||||
/opt/local/include
|
||||
/opt/csw/include/SDL # Blastwave
|
||||
/opt/csw/include
|
||||
/opt/include/SDL
|
||||
/opt/include
|
||||
C:/Programs/SDL/include
|
||||
)
|
||||
# I'm not sure if I should do a special casing for Apple. It is
|
||||
# unlikely that other Unix systems will find the framework path.
|
||||
# But if they do ([Next|Open|GNU]Step?),
|
||||
# do they want the -framework option also?
|
||||
IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
# The Cocoa framework must be linked into SDL because SDL is Cocoa based.
|
||||
# Remember that the OS X framework version expects you to drop in
|
||||
# SDLmain.h and SDLmain.m directly into your project.
|
||||
# (Cocoa link moved to bottom of this script.)
|
||||
# SET (SDL_LIBRARY "-framework SDL -framework Cocoa" CACHE STRING "SDL framework for OSX")
|
||||
# SET(SDL_LIBRARY "-framework SDL" CACHE STRING "SDL framework for OSX")
|
||||
# Extract the path the framework resides in so we can use it for the -F flag
|
||||
STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" SDL_FRAMEWORK_PATH_TEMP ${SDL_INCLUDE_DIR})
|
||||
IF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
|
||||
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
|
||||
)
|
||||
# String is in default search path, don't need to use -F
|
||||
SET(SDL_LIBRARY_TEMP "-framework SDL")
|
||||
ELSE("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
|
||||
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
|
||||
)
|
||||
# String is not /Library/Frameworks, need to use -F
|
||||
SET(SDL_LIBRARY_TEMP "-F${SDL_FRAMEWORK_PATH_TEMP} -framework SDL")
|
||||
ENDIF("${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/Library/Frameworks"
|
||||
OR "${SDL_FRAMEWORK_PATH_TEMP}" STREQUAL "/System/Library/Frameworks"
|
||||
)
|
||||
# Clear the temp variable so nobody can see it
|
||||
SET(SDL_FRAMEWORK_PATH_TEMP "" CACHE INTERNAL "")
|
||||
|
||||
ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
# SDL-1.1 is the name used by FreeBSD ports...
|
||||
# don't confuse it for the version number.
|
||||
FIND_LIBRARY(SDL_LIBRARY_TEMP
|
||||
NAMES SDL SDL-1.1
|
||||
PATHS
|
||||
$ENV{SDLDIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
C:/Programs/SDL/lib
|
||||
)
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDLmain. This is mainly for Windows and OS X. Other platforms
|
||||
# seem to provide SDLmain for compatibility even though they don't
|
||||
# necessarily need it.
|
||||
FIND_LIBRARY(SDLMAIN_LIBRARY
|
||||
NAMES SDLmain SDLmain-1.1
|
||||
PATHS
|
||||
$ENV{SDLDIR}/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
C:/Programs/SDL/lib
|
||||
)
|
||||
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
|
||||
# SDL may require threads on your system.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# But for non-OSX systems, I will use the CMake Threads package.
|
||||
IF(NOT APPLE)
|
||||
FIND_PACKAGE(Threads)
|
||||
ENDIF(NOT APPLE)
|
||||
|
||||
# MinGW needs an additional library, mwindows
|
||||
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
|
||||
# (Actually on second look, I think it only needs one of the m* libraries.)
|
||||
IF(MINGW)
|
||||
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
|
||||
ENDIF(MINGW)
|
||||
|
||||
SET(SDL_FOUND "NO")
|
||||
IF(SDL_LIBRARY_TEMP)
|
||||
# For SDLmain
|
||||
IF(SDLMAIN_LIBRARY)
|
||||
SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP})
|
||||
ENDIF(SDLMAIN_LIBRARY)
|
||||
|
||||
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there. I think it has something to do
|
||||
# with the CACHE STRING. Maybe somebody else knows how to fix this.
|
||||
# The problem is mainly cosmetic, and not a functional issue.
|
||||
IF(APPLE)
|
||||
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
|
||||
ENDIF(APPLE)
|
||||
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if Find the threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
IF(NOT APPLE)
|
||||
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF(NOT APPLE)
|
||||
|
||||
# For MinGW library
|
||||
IF(MINGW)
|
||||
SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
|
||||
ENDIF(MINGW)
|
||||
|
||||
# Set the final string here so the GUI reflects the final state.
|
||||
SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
|
||||
|
||||
SET(SDL_FOUND "YES")
|
||||
ENDIF(SDL_LIBRARY_TEMP)
|
||||
|
||||
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
|
||||
@@ -0,0 +1,68 @@
|
||||
# Find Xerces-C
|
||||
# The following setings are defined
|
||||
# XERCESC_ROOT_DIR, the root of the include and lib directory
|
||||
# XERCESC_INCLUDE_DIR, the full path of the include dir (ADVANCED)
|
||||
# XERCESC_LIBRARIES, the name of the xerces-c library (ADVANCED)
|
||||
|
||||
# Look for a root installation
|
||||
IF( MSVC )
|
||||
SET( XERCES_WINDIR C:/Programs/xerces-vc )
|
||||
ELSE( )
|
||||
SET( XERCES_WINDIR C:/Programs/xerces )
|
||||
ENDIF( )
|
||||
|
||||
FIND_PATH(XERCESC_ROOT_DIR include/xercesc/parsers/SAXParser.hpp
|
||||
${XERCES_WINDIR}
|
||||
"C:/mingw/msys/1.0/local"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2"
|
||||
/usr
|
||||
/usr/local
|
||||
"C:/MinGW"
|
||||
$ENV{CODESYNTH}
|
||||
DOC "The root of an installed xerces-c installation"
|
||||
)
|
||||
|
||||
# try to find the header
|
||||
FIND_PATH(XERCESC_INCLUDE_DIR xercesc/parsers/SAXParser.hpp
|
||||
${XERCESC_ROOT_DIR}/include
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
# Find the library
|
||||
FIND_LIBRARY(XERCESC_LIBRARY
|
||||
NAMES xerces-c xerces-c_3
|
||||
PATHS
|
||||
${XERCESC_ROOT_DIR}/lib
|
||||
${XERCESC_ROOT_DIR}/lib/vc-9.0
|
||||
${XERCESC_ROOT_DIR}/lib64/vc-9.0
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
DOC "The name of the xerces-c library"
|
||||
)
|
||||
|
||||
IF (XERCESC_ROOT_DIR)
|
||||
IF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
|
||||
SET (XERCESC_FOUND TRUE)
|
||||
SET (XERCESC_LIBRARIES "${XERCESC_LIBRARY}")
|
||||
# FIXME: There should be a better way of handling this?
|
||||
# FIXME: How can we test to see if the lib dir isn't
|
||||
# FIXME: one of the default dirs?
|
||||
LINK_DIRECTORIES(${XERCESC_ROOT_DIR}/lib)
|
||||
ENDIF (XERCESC_INCLUDE_DIR AND XERCESC_LIBRARY)
|
||||
ENDIF (XERCESC_ROOT_DIR)
|
||||
|
||||
IF (XERCESC_FOUND)
|
||||
IF (NOT XERCESC_FIND_QUIETLY)
|
||||
MESSAGE (STATUS " found xerces-c: ${XERCESC_LIBRARY}")
|
||||
ENDIF (NOT XERCESC_FIND_QUIETLY)
|
||||
ELSE (XERCESC_FOUND)
|
||||
IF (XERCESC_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find Xerces-C")
|
||||
ENDIF (XERCESC_FIND_REQUIRED)
|
||||
ENDIF (XERCESC_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
XERCESC_INCLUDE_DIR
|
||||
XERCESC_LIBRARY
|
||||
)
|
||||
@@ -0,0 +1,52 @@
|
||||
# Locate Xsd from code synthesis include paths and binary
|
||||
# Xsd can be found at http://codesynthesis.com/products/xsd/
|
||||
# Written by Frederic Heem, frederic.heem _at_ telsey.it
|
||||
|
||||
# This module defines
|
||||
# XSD_INCLUDE_DIR, where to find elements.hxx, etc.
|
||||
# XSD_EXECUTABLE, where is the xsd compiler
|
||||
# XSD_FOUND, If false, don't try to use xsd
|
||||
|
||||
FIND_PATH( XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx
|
||||
"/opt/local/xsd-3.3.0-i686-macosx/libxsd"
|
||||
"C:/Programs/xsd-3.3.0/libxsd"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2/include"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/libxsd"
|
||||
$ENV{XSDDIR}/include
|
||||
$ENV{CODESYNTH}/include
|
||||
/usr/local/include /usr/include
|
||||
)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( XSDCXX_FILENAME1 xsd-cxx.exe )
|
||||
ELSE( )
|
||||
SET( XSDCXX_FILENAME1 xsdcxx )
|
||||
SET( XSDCXX_FILENAME2 xsd )
|
||||
ENDIF( )
|
||||
|
||||
FIND_PROGRAM( XSDCXX_EXECUTABLE
|
||||
NAMES
|
||||
${XSDCXX_FILENAME1} ${XSDCXX_FILENAME2}
|
||||
PATHS
|
||||
"/opt/local/xsd-3.3.0-i686-macosx/bin"
|
||||
"C:/Programs/xsd-3.3.0/bin"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/bin"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
|
||||
$ENV{XSDDIR}/bin
|
||||
/usr/local/bin
|
||||
/usr/bin
|
||||
)
|
||||
|
||||
MESSAGE(STATUS ${XSDCXX_EXECUTABLE})
|
||||
|
||||
# if the include and the program are found then we have it
|
||||
IF( XSD_INCLUDE_DIR )
|
||||
IF( XSDCXX_EXECUTABLE )
|
||||
SET( XSD_FOUND "YES" )
|
||||
ENDIF( XSDCXX_EXECUTABLE )
|
||||
ENDIF( XSD_INCLUDE_DIR )
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
XSD_INCLUDE_DIR
|
||||
XSDCXX_EXECUTABLE
|
||||
)
|
||||
@@ -0,0 +1,137 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QTranslator>
|
||||
#include <QLocale>
|
||||
#include <QString>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QSplashScreen>
|
||||
#include <QThread>
|
||||
#include <iostream>
|
||||
#include "mainwindow.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
#define sleep(x) Sleep(x*1000)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <QProxyStyle>
|
||||
|
||||
class MyProxyStyle : public QProxyStyle
|
||||
{
|
||||
public:
|
||||
void polish ( QWidget * w ) {
|
||||
QMenu* mn = dynamic_cast<QMenu*>(w);
|
||||
QPushButton* pb = dynamic_cast<QPushButton*>(w);
|
||||
if(!(mn || pb) && !w->testAttribute(Qt::WA_MacNormalSize))
|
||||
w->setAttribute(Qt::WA_MacSmallSize);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(companion);
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("OpenTX Companion");
|
||||
app.setOrganizationName("OpenTX");
|
||||
app.setOrganizationDomain("open-tx.org");
|
||||
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
|
||||
|
||||
#ifdef __APPLE__
|
||||
app.setStyle(new MyProxyStyle);
|
||||
#endif
|
||||
|
||||
QTranslator companionTranslator;
|
||||
companionTranslator.load(":/companion_" + g.locale());
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load((QString)"qt_" + g.locale().left(2), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
app.installTranslator(&companionTranslator);
|
||||
app.installTranslator(&qtTranslator);
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
RegisterEepromInterfaces();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
if (g.profile[g.id()].fwType().isEmpty()){
|
||||
g.profile[g.id()].fwType(default_firmware_variant->getId());
|
||||
g.profile[g.id()].fwName("");
|
||||
}
|
||||
|
||||
QString splashScreen;
|
||||
if ( g.profile[g.id()].fwType().contains("taranis")) splashScreen = ":/images/splasht.png";
|
||||
else if ( g.profile[g.id()].fwType().contains("9xrpro")) splashScreen = ":/images/splashp.png";
|
||||
else if ( g.profile[g.id()].fwType().contains("9xr")) splashScreen = ":/images/splashr.png";
|
||||
else splashScreen = ":/images/splash.png";
|
||||
|
||||
QPixmap pixmap = QPixmap(splashScreen);
|
||||
QSplashScreen *splash = new QSplashScreen(pixmap);
|
||||
|
||||
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
|
||||
|
||||
MainWindow *mainWin = new MainWindow();
|
||||
if (g.showSplash()) {
|
||||
splash->show();
|
||||
QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close()));
|
||||
QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show()));
|
||||
}
|
||||
else {
|
||||
mainWin->show();
|
||||
}
|
||||
|
||||
int result = app.exec();
|
||||
|
||||
delete splash;
|
||||
delete mainWin;
|
||||
|
||||
UnregisterFirmwares();
|
||||
UnregisterEepromInterfaces();
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Name=Companion
|
||||
GenericName=Transmitter Companion App
|
||||
Comment=The Ultimate Transmitter Companion
|
||||
Icon=companion
|
||||
Exec='companion'
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Categories=Application
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,94 @@
|
||||
#ifndef COMPAREDIALOG_H
|
||||
#define COMPAREDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
#include <QDir>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
namespace Ui {
|
||||
class CompareDialog;
|
||||
}
|
||||
|
||||
class CompareDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CompareDialog(QWidget *parent);
|
||||
~CompareDialog();
|
||||
|
||||
protected:
|
||||
GeneralSettings * settings;
|
||||
ModelData * g_model1;
|
||||
ModelData * g_model2;
|
||||
ModelData * modeltemp;
|
||||
int model1;
|
||||
int model2;
|
||||
|
||||
private:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
Ui::CompareDialog *ui;
|
||||
QString doTC(const QString s, const QString color, bool bold);
|
||||
QString doTR(const QString s, const QString color, bool bold);
|
||||
QString doTL(const QString s, const QString color, bool bold);
|
||||
QString fv(const QString name, const QString value,const QString color);
|
||||
template<class T> QString getColor1(T val1, T val2) {
|
||||
if (val1!=val2)
|
||||
return "green";
|
||||
else
|
||||
return "grey";
|
||||
}
|
||||
template<class T> QString getColor2(T val1, T val2) {
|
||||
if (val1!=val2)
|
||||
return "red";
|
||||
else
|
||||
return "grey";
|
||||
}
|
||||
QString getColor1(char * val1, char * val2) {
|
||||
if (strcmp(val1,val2)!=0)
|
||||
return "green";
|
||||
else
|
||||
return "grey";
|
||||
}
|
||||
QString getColor2(char * val1, char * val2) {
|
||||
if (strcmp(val1,val2)!=0)
|
||||
return "red";
|
||||
else
|
||||
return "grey";
|
||||
}
|
||||
|
||||
int ModelHasExpo(ExpoData * ExpoArray, ExpoData expo, bool * expoused);
|
||||
bool ChannelHasExpo(ExpoData * expoArray, uint8_t destCh);
|
||||
int ModelHasMix(MixData * mixArray, MixData mix, bool * mixused);
|
||||
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
|
||||
|
||||
QTextEdit * te;
|
||||
QString curvefile5;
|
||||
QString curvefile9;
|
||||
QDir *qd;
|
||||
|
||||
private slots:
|
||||
void on_printButton_clicked();
|
||||
void on_printFileButton_clicked();
|
||||
|
||||
protected:
|
||||
void dropEvent(QDropEvent *event);
|
||||
void dragMoveEvent(QDragMoveEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dragLeaveEvent(QDragLeaveEvent *event);
|
||||
void printDiff();
|
||||
void printSetup();
|
||||
void printPhases();
|
||||
void printLimits();
|
||||
void printExpos();
|
||||
void printMixers();
|
||||
void printCurves();
|
||||
void printGvars();
|
||||
void printSwitches();
|
||||
void printSafetySwitches();
|
||||
void printFSwitches();
|
||||
void printFrSky();
|
||||
};
|
||||
|
||||
#endif // COMPAREDIALOG_H
|
||||
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CompareDialog</class>
|
||||
<widget class="QDialog" name="CompareDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>580</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>780</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Compare Models</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_1">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:green;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Drag first model here</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:red;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Drag second model here</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="closeButton">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="printButton">
|
||||
<property name="text">
|
||||
<string>Print</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="printFileButton">
|
||||
<property name="text">
|
||||
<string>Print to file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>closeButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>CompareDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>739</x>
|
||||
<y>636</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>565</x>
|
||||
<y>623</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,132 @@
|
||||
#include "contributorsdialog.h"
|
||||
#include "ui_contributorsdialog.h"
|
||||
#include <QtGui>
|
||||
#include "helpers.h"
|
||||
|
||||
contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnurl) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui(new Ui::contributorsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
switch (contest) {
|
||||
case 0:
|
||||
{
|
||||
this->setWindowIcon(CompanionIcon("contributors.png"));
|
||||
QFile file(":/DONATIONS.txt");
|
||||
QString str;
|
||||
str.append("<html><head>");
|
||||
str.append("<style type=\"text/css\">\n");
|
||||
str.append(".mycss\n{\nfont-weight:normal;\ncolor:#000000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append(".mycssb\n{\nfont-weight:bold;\ncolor:#C00000;vertical-align: top;font-size:10px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append(".myhead\n{\nfont-weight:bold;\ncolor:#000000;font-size:14px;text-align:left;font-family:arial, helvetica, sans-serif;\n}\n");
|
||||
str.append("</style>\n</head><body class=\"mycss\"><table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
str.append("<tr><td class=\"myhead\">"+tr("People who have contributed to this project")+"</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
int columns=6;
|
||||
float cwidth=100.0/columns;
|
||||
while (!file.atEnd()) {
|
||||
str.append("<tr>");
|
||||
for (int i=0; i<columns; i++) {
|
||||
str.append(QString("<td width=\"%1%\" ").arg(cwidth));
|
||||
if (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
if (line.contains("monthly") || line.contains("mensual")) {
|
||||
str.append("class=\"mycssb\">");
|
||||
} else {
|
||||
str.append("class=\"mycss\">");
|
||||
}
|
||||
str.append(line.trimmed()+"</td>");
|
||||
} else {
|
||||
str.append("class=\"mycss\"> </td>");
|
||||
}
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
str.append("</table>");
|
||||
QFile file2(":/CREDITS.txt");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
str.append("<tr><td class=\"mycss\"> </td></tr>");
|
||||
str.append("<tr><td class=\"myhead\">"+tr("Coders")+"</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=2>");
|
||||
if(file2.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
while (!file2.atEnd()) {
|
||||
str.append("<tr>");
|
||||
for (int i=0; i<3; i++) {
|
||||
str.append("<td width=\"33.33%\" class=\"mycss\">");
|
||||
if (!file2.atEnd()) {
|
||||
QByteArray line = file2.readLine();
|
||||
str.append(line.trimmed());
|
||||
} else {
|
||||
str.append(" ");
|
||||
}
|
||||
str.append("</td>");
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
str.append("<tr><td class=\"mycss\"> </td></tr>");
|
||||
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>");
|
||||
str.append("<tr><td colspan=3 class=\"mycss\">" + tr("Thank you all !!!") + "</td></tr>");
|
||||
str.append("</table>");
|
||||
str.append("</body></html>");
|
||||
ui->textEditor->setHtml(str);
|
||||
ui->textEditor->scroll(0, 0);
|
||||
setWindowTitle(tr("Contributors"));
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
this->setWindowIcon(CompanionIcon("changelog.png"));
|
||||
QFile file(":/releasenotes.txt");
|
||||
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
ui->textEditor->setHtml(file.readAll());
|
||||
}
|
||||
ui->textEditor->scroll(0,0);
|
||||
setWindowTitle(tr("Companion Release Notes"));
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
if (!rnurl.isEmpty()) {
|
||||
this->setWindowIcon(CompanionIcon("changelog.png"));
|
||||
this->setWindowTitle(tr("OpenTX Release Notes"));
|
||||
manager = new QNetworkAccessManager(this);
|
||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
|
||||
QUrl url(rnurl);
|
||||
QNetworkRequest request(url);
|
||||
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
|
||||
manager->get(request);
|
||||
}
|
||||
else {
|
||||
QTimer::singleShot(0, this, SLOT(forceClose()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void contributorsDialog::showEvent ( QShowEvent * )
|
||||
{
|
||||
ui->textEditor->scroll(0, 0);
|
||||
}
|
||||
|
||||
contributorsDialog::~contributorsDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void contributorsDialog::replyFinished(QNetworkReply * reply)
|
||||
{
|
||||
ui->textEditor->setHtml(reply->readAll());
|
||||
}
|
||||
|
||||
void contributorsDialog::forceClose()
|
||||
{
|
||||
accept();;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef CONTRIBUTORSDIALOG_H
|
||||
#define CONTRIBUTORSDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
#include "downloaddialog.h"
|
||||
|
||||
namespace Ui {
|
||||
class contributorsDialog;
|
||||
}
|
||||
|
||||
class contributorsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit contributorsDialog(QWidget *parent = 0, int contest = 0, QString rnurl = QString() );
|
||||
~contributorsDialog();
|
||||
|
||||
private:
|
||||
Ui::contributorsDialog *ui;
|
||||
QNetworkAccessManager *manager;
|
||||
|
||||
void showEvent ( QShowEvent * );
|
||||
|
||||
private slots:
|
||||
void forceClose();
|
||||
void replyFinished(QNetworkReply * reply);
|
||||
|
||||
};
|
||||
|
||||
#endif // CONTRIBUTORSDIALOG_H
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>contributorsDialog</class>
|
||||
<widget class="QDialog" name="contributorsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>788</width>
|
||||
<height>528</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextEdit" name="textEditor">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,269 @@
|
||||
#include "customizesplashdialog.h"
|
||||
#include "ui_customizesplashdialog.h"
|
||||
|
||||
#include <QtGui>
|
||||
#include "appdata.h"
|
||||
#include "helpers.h"
|
||||
#include "burndialog.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "flashinterface.h"
|
||||
|
||||
//*** Side Class ***
|
||||
|
||||
Side::Side(){
|
||||
imageLabel = 0;
|
||||
fileNameEdit = 0;
|
||||
saveButton = 0;
|
||||
loadFwButton=0;
|
||||
loadPictButton = 0;
|
||||
loadProfileButton = 0;
|
||||
saveToFileName = new QString("");
|
||||
source = new Source(UNDEFINED);
|
||||
format = new LCDFormat(LCDTARANIS);
|
||||
}
|
||||
|
||||
void Side::markSourceButton()
|
||||
{
|
||||
loadFwButton->setChecked(*source == FW ? true : false );
|
||||
loadPictButton->setChecked(*source == PICT ? true : false );
|
||||
loadProfileButton->setChecked(*source == PROFILE ? true : false );
|
||||
}
|
||||
|
||||
void Side::copyImage( Side side )
|
||||
{
|
||||
if ((*source!=UNDEFINED) && (*side.source!=UNDEFINED))
|
||||
imageLabel->setPixmap(*side.imageLabel->pixmap());
|
||||
}
|
||||
|
||||
bool Side::displayImage( QString fileName, Source pictSource )
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if (fileName.isEmpty())
|
||||
return false;
|
||||
|
||||
// Determine which picture format to use
|
||||
if (pictSource == FW ){
|
||||
FlashInterface flash(fileName);
|
||||
if (!flash.hasSplash())
|
||||
return false;
|
||||
else
|
||||
image = flash.getSplash();
|
||||
*format = (flash.getSplashWidth()==WIDTH_TARANIS ? LCDTARANIS : LCD9X);
|
||||
}
|
||||
else {
|
||||
image.load(fileName);
|
||||
if (pictSource== PICT)
|
||||
*format = image.width()>WIDTH_9X ? LCDTARANIS : LCD9X;
|
||||
else if (pictSource == PROFILE)
|
||||
*format = (g.profile[g.id()].fwType().contains("taranis")) ? LCDTARANIS : LCD9X;
|
||||
}
|
||||
if (image.isNull()) {
|
||||
return false;
|
||||
}
|
||||
// Load image
|
||||
if (*format==LCDTARANIS) {
|
||||
imageLabel->setPixmap( makePixMap( image, "taranis" ));
|
||||
imageLabel->setFixedSize(WIDTH_TARANIS*2, HEIGHT_TARANIS*2);
|
||||
}
|
||||
else {
|
||||
imageLabel->setPixmap( makePixMap( image, "9x" ));
|
||||
imageLabel->setFixedSize(WIDTH_9X*2, HEIGHT_9X*2);
|
||||
}
|
||||
|
||||
switch (pictSource){
|
||||
case FW:
|
||||
fileNameEdit->setText(QObject::tr("FW: %1").arg(fileName));
|
||||
*saveToFileName = fileName;
|
||||
*source=FW;
|
||||
break;
|
||||
case PICT:
|
||||
fileNameEdit->setText(QObject::tr("Pict: %1").arg(fileName));
|
||||
*saveToFileName = fileName;
|
||||
*source=PICT;
|
||||
break;
|
||||
case PROFILE:
|
||||
fileNameEdit->setText(QObject::tr("Profile image"));
|
||||
*saveToFileName = fileName;
|
||||
*source=PROFILE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
saveButton->setEnabled(true);
|
||||
libraryButton->setEnabled(true);
|
||||
invertButton->setEnabled(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Side::refreshImage()
|
||||
{
|
||||
return displayImage( *saveToFileName, *source );
|
||||
}
|
||||
|
||||
bool Side::saveImage()
|
||||
{
|
||||
if (*source == FW )
|
||||
{
|
||||
FlashInterface flash(*saveToFileName);
|
||||
if (!flash.hasSplash()) {
|
||||
return false;
|
||||
}
|
||||
QImage image = imageLabel->pixmap()->toImage().scaled(flash.getSplashWidth(), flash.getSplashHeight());
|
||||
if (flash.setSplash(image) && (flash.saveFlash(*saveToFileName) > 0)) {
|
||||
g.flashDir( QFileInfo(*saveToFileName).dir().absolutePath() );
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (*source == PICT) {
|
||||
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
|
||||
if (image.save(*saveToFileName)) {
|
||||
g.imagesDir( QFileInfo(*saveToFileName).dir().absolutePath() );
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (*source == PROFILE) {
|
||||
QImage image = imageLabel->pixmap()->toImage().scaled(imageLabel->width()/2, imageLabel->height()/2).convertToFormat(QImage::Format_Indexed8);
|
||||
if (!image.save(*saveToFileName)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//*** customizeSplashDialog Class ***
|
||||
|
||||
customizeSplashDialog::customizeSplashDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::customizeSplashDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("paintbrush.png"));
|
||||
ui->leftLibraryButton->setIcon(CompanionIcon("library.png"));
|
||||
ui->rightLibraryButton->setIcon(CompanionIcon("library.png"));
|
||||
|
||||
left.imageLabel = ui->leftImageLabel;
|
||||
right.imageLabel = ui->rightImageLabel;
|
||||
left.fileNameEdit = ui->leftFileNameEdit;
|
||||
right.fileNameEdit = ui->rightFileNameEdit;
|
||||
left.saveButton = ui->leftSaveButton;
|
||||
right.saveButton = ui->rightSaveButton;
|
||||
left.libraryButton = ui->leftLibraryButton;
|
||||
right.libraryButton = ui->rightLibraryButton;
|
||||
left.invertButton = ui->leftInvertButton;
|
||||
right.invertButton = ui->rightInvertButton;
|
||||
|
||||
left.loadFwButton = ui->leftLoadFwButton;
|
||||
right.loadFwButton = ui->rightLoadFwButton;
|
||||
left.loadPictButton = ui->leftLoadPictButton;
|
||||
right.loadPictButton = ui->rightLoadPictButton;
|
||||
left.loadProfileButton = ui->leftLoadProfileButton;
|
||||
right.loadProfileButton = ui->rightLoadProfileButton;
|
||||
|
||||
loadProfile(left);
|
||||
left.markSourceButton();
|
||||
|
||||
resize(0,0);
|
||||
}
|
||||
|
||||
customizeSplashDialog::~customizeSplashDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_copyRightToLeftButton_clicked() {
|
||||
left.copyImage(right);
|
||||
}
|
||||
void customizeSplashDialog::on_copyLeftToRightButton_clicked() {
|
||||
right.copyImage(left);
|
||||
}
|
||||
|
||||
|
||||
void customizeSplashDialog::on_leftLoadFwButton_clicked() {loadFirmware(left);}
|
||||
void customizeSplashDialog::on_rightLoadFwButton_clicked() {loadFirmware(right);}
|
||||
void customizeSplashDialog::loadFirmware(Side side)
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
|
||||
if (!fileName.isEmpty()) {
|
||||
if (!side.displayImage( fileName, FW ))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Can not load embedded image from firmware file %1.").arg(fileName));
|
||||
else
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
}
|
||||
side.markSourceButton();
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_leftLoadPictButton_clicked() {loadPicture(left);}
|
||||
void customizeSplashDialog::on_rightLoadPictButton_clicked() {loadPicture(right);}
|
||||
void customizeSplashDialog::loadPicture(Side side)
|
||||
{
|
||||
QString supportedImageFormats;
|
||||
for (int formatIndex = 0; formatIndex < QImageReader::supportedImageFormats().count(); formatIndex++) {
|
||||
supportedImageFormats += QLatin1String(" *.") + QImageReader::supportedImageFormats()[formatIndex];
|
||||
}
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
tr("Open Image to load"), g.imagesDir(), tr("Images (%1)").arg(supportedImageFormats));
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
if (!side.displayImage( fileName, PICT ))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load the image file %1.").arg(fileName));
|
||||
else
|
||||
g.imagesDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
}
|
||||
side.markSourceButton();
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_leftLoadProfileButton_clicked() {loadProfile(left);}
|
||||
void customizeSplashDialog::on_rightLoadProfileButton_clicked() {loadProfile(right);}
|
||||
void customizeSplashDialog::loadProfile(Side side)
|
||||
{
|
||||
QString fileName=g.profile[g.id()].splashFile();
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
if (!side.displayImage( fileName, PROFILE ))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load profile image %1.").arg(fileName));
|
||||
}
|
||||
side.markSourceButton();
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_leftLibraryButton_clicked(){libraryButton_clicked(left);}
|
||||
void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicked(right);}
|
||||
void customizeSplashDialog::libraryButton_clicked( Side side )
|
||||
{
|
||||
QString fileName;
|
||||
splashLibrary *ld = new splashLibrary(this,&fileName);
|
||||
ld->exec();
|
||||
if (!fileName.isEmpty()) {
|
||||
if (!side.displayImage( fileName, UNDEFINED ))
|
||||
QMessageBox::critical(this, tr("Error"), tr("Cannot load the library image %1.").arg(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_leftSaveButton_clicked(){saveButton_clicked(left);}
|
||||
void customizeSplashDialog::on_rightSaveButton_clicked(){saveButton_clicked(right);}
|
||||
void customizeSplashDialog::saveButton_clicked( Side side )
|
||||
{
|
||||
if (side.saveImage()){
|
||||
QMessageBox::information(this, tr("File Saved"), tr("The image was saved to the file %1").arg(*side.saveToFileName));
|
||||
if ( !side.refreshImage()){
|
||||
QMessageBox::critical(this, tr("Image Refresh Error"), tr("Failed to refresh image from file %1").arg(*side.saveToFileName));
|
||||
}
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(this, tr("File Save Error"), tr("Failed to write image to %1").arg(*side.saveToFileName));
|
||||
}
|
||||
|
||||
void customizeSplashDialog::on_leftInvertButton_clicked(){invertButton_clicked(left);}
|
||||
void customizeSplashDialog::on_rightInvertButton_clicked(){invertButton_clicked(right);}
|
||||
void customizeSplashDialog::invertButton_clicked(Side side)
|
||||
{
|
||||
QImage image = side.imageLabel->pixmap()->toImage();
|
||||
image.invertPixels();
|
||||
side.imageLabel->setPixmap(QPixmap::fromImage(image));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#ifndef CUSTOMIZESPLASHDIALOG_H
|
||||
#define CUSTOMIZESPLASHDIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include "flashinterface.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class customizeSplashDialog;
|
||||
}
|
||||
|
||||
const int WIDTH_TARANIS = 212;
|
||||
const int HEIGHT_TARANIS = 64;
|
||||
const int WIDTH_9X = 128;
|
||||
const int HEIGHT_9X = 64;
|
||||
|
||||
enum Source {FW, PICT, PROFILE, UNDEFINED};
|
||||
enum LCDFormat {LCD9X, LCDTARANIS};
|
||||
|
||||
class Side
|
||||
{
|
||||
public:
|
||||
Side();
|
||||
void markSourceButton();
|
||||
void copyImage( Side );
|
||||
bool displayImage( QString fileName, Source source );
|
||||
bool saveImage();
|
||||
bool refreshImage();
|
||||
|
||||
QLabel *imageLabel;
|
||||
QLineEdit *fileNameEdit;
|
||||
QPushButton *saveButton;
|
||||
QPushButton *invertButton;
|
||||
QToolButton *libraryButton;
|
||||
QPushButton *loadFwButton;
|
||||
QPushButton *loadPictButton;
|
||||
QPushButton *loadProfileButton;
|
||||
|
||||
QString *saveToFileName;
|
||||
|
||||
private:
|
||||
Source *source;
|
||||
LCDFormat *format;
|
||||
};
|
||||
|
||||
class customizeSplashDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Side left;
|
||||
Side right;
|
||||
|
||||
public:
|
||||
explicit customizeSplashDialog(QWidget *parent = 0);
|
||||
~customizeSplashDialog();
|
||||
|
||||
private slots:
|
||||
void on_leftLoadFwButton_clicked();
|
||||
void on_leftLoadPictButton_clicked();
|
||||
void on_leftLoadProfileButton_clicked();
|
||||
void on_leftLibraryButton_clicked();
|
||||
void on_leftSaveButton_clicked();
|
||||
void on_leftInvertButton_clicked();
|
||||
|
||||
void on_rightLoadFwButton_clicked();
|
||||
void on_rightLoadPictButton_clicked();
|
||||
void on_rightLoadProfileButton_clicked();
|
||||
void on_rightLibraryButton_clicked();
|
||||
void on_rightSaveButton_clicked();
|
||||
void on_rightInvertButton_clicked();
|
||||
|
||||
void on_copyRightToLeftButton_clicked();
|
||||
void on_copyLeftToRightButton_clicked();
|
||||
|
||||
private:
|
||||
void loadFirmware( Side );
|
||||
void loadPicture( Side );
|
||||
void loadProfile( Side );
|
||||
void libraryButton_clicked( Side );
|
||||
void saveButton_clicked( Side );
|
||||
void invertButton_clicked( Side );
|
||||
|
||||
Ui::customizeSplashDialog *ui;
|
||||
enum sideEnum { LEFT, RIGHT };
|
||||
};
|
||||
|
||||
#endif // CUSTOMIZESPLASHDIALOG_H
|
||||
@@ -0,0 +1,667 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>customizeSplashDialog</class>
|
||||
<widget class="QDialog" name="customizeSplashDialog">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1087</width>
|
||||
<height>298</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Transmitter Splash Screen Editor</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="Line" name="line_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leftFileNameEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>426</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="leftImageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftInvertButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Invert</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="leftLibraryButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open Splash Library</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftLoadProfileButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftLoadFwButton">
|
||||
<property name="text">
|
||||
<string>Load FW</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftLoadPictButton">
|
||||
<property name="text">
|
||||
<string>Load Pict</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="leftSaveButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="QToolButton" name="copyRightToLeftButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::LeftArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="copyLeftToRightButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::RightArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="Line" name="line_14">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="rightFileNameEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>426</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="rightImageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>424</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightInvertButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Invert</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="rightLibraryButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open Splash Library</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightLoadProfileButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightLoadFwButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load FW</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightLoadPictButton">
|
||||
<property name="text">
|
||||
<string>Load Pict</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="rightSaveButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>leftFileNameEdit</tabstop>
|
||||
<tabstop>leftInvertButton</tabstop>
|
||||
<tabstop>leftLibraryButton</tabstop>
|
||||
<tabstop>leftLoadProfileButton</tabstop>
|
||||
<tabstop>leftLoadFwButton</tabstop>
|
||||
<tabstop>leftLoadPictButton</tabstop>
|
||||
<tabstop>leftSaveButton</tabstop>
|
||||
<tabstop>copyLeftToRightButton</tabstop>
|
||||
<tabstop>copyRightToLeftButton</tabstop>
|
||||
<tabstop>rightFileNameEdit</tabstop>
|
||||
<tabstop>rightInvertButton</tabstop>
|
||||
<tabstop>rightLibraryButton</tabstop>
|
||||
<tabstop>rightLoadProfileButton</tabstop>
|
||||
<tabstop>rightLoadFwButton</tabstop>
|
||||
<tabstop>rightLoadPictButton</tabstop>
|
||||
<tabstop>rightSaveButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,100 @@
|
||||
#include "downloaddialog.h"
|
||||
#include "ui_downloaddialog.h"
|
||||
#include <QMessageBox>
|
||||
#include <QtGui>
|
||||
#include <QTime>
|
||||
#include "helpers.h"
|
||||
|
||||
downloadDialog::downloadDialog(QWidget *parent, QString src, QString tgt):
|
||||
QDialog(parent),
|
||||
ui(new Ui::downloadDialog),
|
||||
file(NULL)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("fwpreferences.png"));
|
||||
ui->progressBar->setValue(1);
|
||||
ui->progressBar->setMinimum(0);
|
||||
ui->progressBar->setMaximum(0);
|
||||
|
||||
if (tgt.isEmpty()) {
|
||||
setWindowTitle(src);
|
||||
return; // just show wait dialog.
|
||||
}
|
||||
|
||||
file = new QFile(tgt);
|
||||
if (!file->open(QIODevice::WriteOnly)) {
|
||||
QMessageBox::critical(this, "Companion",
|
||||
tr("Unable to save the file %1: %2.")
|
||||
.arg(tgt).arg(file->errorString()));
|
||||
QTimer::singleShot(0, this, SLOT(fileError()));
|
||||
}
|
||||
else {
|
||||
reply = qnam.get(QNetworkRequest(QUrl(src)));
|
||||
connect(reply, SIGNAL(finished()), this, SLOT(httpFinished()));
|
||||
connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead()));
|
||||
connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(updateDataReadProgress(qint64,qint64)));
|
||||
}
|
||||
}
|
||||
|
||||
downloadDialog::~downloadDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete file;
|
||||
}
|
||||
|
||||
void downloadDialog::httpFinished()
|
||||
{
|
||||
file->flush();
|
||||
file->close();
|
||||
|
||||
bool ok = true;
|
||||
if (reply->error()) {
|
||||
file->remove();
|
||||
QMessageBox::information(this, tr("Companion"),
|
||||
tr("Download failed: %1.")
|
||||
.arg(reply->errorString()));
|
||||
ok = false;
|
||||
}
|
||||
|
||||
reply->deleteLater();
|
||||
reply = 0;
|
||||
delete file;
|
||||
file = NULL;
|
||||
|
||||
if (ok)
|
||||
accept();
|
||||
else
|
||||
reject();
|
||||
}
|
||||
|
||||
void downloadDialog::httpReadyRead()
|
||||
{
|
||||
if (file) {
|
||||
file->write(reply->readAll());
|
||||
}
|
||||
}
|
||||
|
||||
void downloadDialog::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes)
|
||||
{
|
||||
ui->progressBar->setMaximum(totalBytes);
|
||||
ui->progressBar->setValue(bytesRead);
|
||||
}
|
||||
|
||||
void downloadDialog::fileError()
|
||||
{
|
||||
delete file;
|
||||
file = NULL;
|
||||
reject();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void downloadDialog::closeEvent( QCloseEvent * event)
|
||||
{
|
||||
// Delay closing 2 seconds to avoid unpleasant flashing download dialogs
|
||||
QTime closeTime= QTime::currentTime().addSecs(2);
|
||||
while( QTime::currentTime() < closeTime )
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||
|
||||
event->accept();
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef DOWNLOADDIALOG_H
|
||||
#define DOWNLOADDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QFile>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class downloadDialog;
|
||||
}
|
||||
|
||||
class downloadDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit downloadDialog(QWidget *parent = 0, QString src = "", QString tgt = "");
|
||||
~downloadDialog();
|
||||
|
||||
private slots:
|
||||
void fileError();
|
||||
void httpFinished();
|
||||
void httpReadyRead();
|
||||
void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
|
||||
|
||||
private:
|
||||
#if 0
|
||||
void closeEvent( QCloseEvent * event);
|
||||
#endif
|
||||
Ui::downloadDialog *ui;
|
||||
|
||||
QNetworkAccessManager qnam;
|
||||
QNetworkReply *reply;
|
||||
QFile *file;
|
||||
|
||||
};
|
||||
|
||||
#endif // DOWNLOADDIALOG_H
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>downloadDialog</class>
|
||||
<widget class="QDialog" name="downloadDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>562</width>
|
||||
<height>82</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Downloading: </string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>downloadDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>downloadDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,714 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef eeprom_importexport_h
|
||||
#define eeprom_importexport_h
|
||||
|
||||
#define DIM(arr) (sizeof((arr))/sizeof((arr)[0]))
|
||||
|
||||
class DataField {
|
||||
public:
|
||||
DataField(const char *name=""):
|
||||
name(name)
|
||||
{
|
||||
}
|
||||
virtual const char *getName() { return name; }
|
||||
virtual ~DataField() { }
|
||||
virtual void ExportBits(QBitArray & output) = 0;
|
||||
virtual void ImportBits(QBitArray & input) = 0;
|
||||
virtual unsigned int size() = 0;
|
||||
|
||||
QBitArray bytesToBits(QByteArray bytes)
|
||||
{
|
||||
QBitArray bits(bytes.count()*8);
|
||||
// Convert from QByteArray to QBitArray
|
||||
for (int i=0; i<bytes.count(); ++i)
|
||||
for (int b=0; b<8; ++b)
|
||||
bits.setBit(i*8+b, bytes.at(i)&(1<<b));
|
||||
return bits;
|
||||
}
|
||||
|
||||
QByteArray bitsToBytes(QBitArray bits, int offset=0)
|
||||
{
|
||||
QByteArray bytes;
|
||||
bytes.resize((offset+bits.count()+7)/8);
|
||||
bytes.fill(0);
|
||||
// Convert from QBitArray to QByteArray
|
||||
for (int b=0; b<bits.count(); ++b)
|
||||
bytes[(b+offset)/8] = ( bytes.at((b+offset)/8) | ((bits[b]?1:0)<<((b+offset)%8)));
|
||||
return bytes;
|
||||
}
|
||||
|
||||
int Export(QByteArray & output)
|
||||
{
|
||||
QBitArray result;
|
||||
ExportBits(result);
|
||||
output = bitsToBytes(result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Import(QByteArray & input)
|
||||
{
|
||||
QBitArray bits = bytesToBits(input);
|
||||
ImportBits(bits);
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int Dump(int level=0, int offset=0)
|
||||
{
|
||||
QBitArray bits;
|
||||
ExportBits(bits);
|
||||
QByteArray bytes = bitsToBytes(bits);
|
||||
int result = (offset+bits.count()) % 8;
|
||||
for (int i=0; i<level; i++) printf(" ");
|
||||
if (bits.count() % 8 == 0)
|
||||
printf("%s (%dbytes) ", getName(), bytes.count());
|
||||
else
|
||||
printf("%s (%dbits) ", getName(), bits.count());
|
||||
for (int i=0; i<bytes.count(); i++) {
|
||||
unsigned char c = bytes[i];
|
||||
if ((i==0 && offset) || (i==bytes.count()-1 && result!=0))
|
||||
printf("(%02x) ", c);
|
||||
else
|
||||
printf("%02x ", c);
|
||||
}
|
||||
printf("\n"); fflush(stdout);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected:
|
||||
const char *name;
|
||||
};
|
||||
|
||||
class ProxyField: public DataField {
|
||||
public:
|
||||
ProxyField():
|
||||
DataField("Proxy")
|
||||
{
|
||||
}
|
||||
|
||||
virtual DataField * getField() = 0;
|
||||
|
||||
};
|
||||
|
||||
template<int N>
|
||||
class UnsignedField: public DataField {
|
||||
public:
|
||||
explicit UnsignedField(unsigned int & field):
|
||||
DataField("Unsigned"),
|
||||
field(field),
|
||||
min(0),
|
||||
max(UINT_MAX)
|
||||
{
|
||||
}
|
||||
|
||||
UnsignedField(unsigned int & field, const char *name):
|
||||
DataField(name),
|
||||
field(field),
|
||||
min(0),
|
||||
max(UINT_MAX)
|
||||
{
|
||||
}
|
||||
|
||||
UnsignedField(unsigned int & field, unsigned int min, unsigned int max, const char *name="Unsigned"):
|
||||
DataField(name),
|
||||
field(field),
|
||||
min(min),
|
||||
max(max)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ExportBits(QBitArray & output)
|
||||
{
|
||||
unsigned int value = field;
|
||||
if (value > max) value = max;
|
||||
if (value < min) value = min;
|
||||
|
||||
output.resize(N);
|
||||
for (int i=0; i<N; i++) {
|
||||
if (value & (1<<i))
|
||||
output.setBit(i);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
field = 0;
|
||||
for (int i=0; i<N; i++) {
|
||||
if (input[i])
|
||||
field |= (1<<i);
|
||||
}
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
{
|
||||
return N;
|
||||
}
|
||||
|
||||
protected:
|
||||
unsigned int & field;
|
||||
unsigned int min;
|
||||
unsigned int max;
|
||||
|
||||
private:
|
||||
UnsignedField();
|
||||
};
|
||||
|
||||
template<int N>
|
||||
class BoolField: public DataField {
|
||||
public:
|
||||
explicit BoolField(bool & field):
|
||||
DataField("Bool"),
|
||||
field(field)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ExportBits(QBitArray & output)
|
||||
{
|
||||
output.resize(N);
|
||||
if (field) {
|
||||
output.setBit(0);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
field = input[0] ? true : false;
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
{
|
||||
return N;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool & field;
|
||||
|
||||
private:
|
||||
BoolField();
|
||||
};
|
||||
|
||||
template<int N>
|
||||
class SignedField: public DataField {
|
||||
public:
|
||||
SignedField(int & field):
|
||||
DataField("Signed"),
|
||||
field(field),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX)
|
||||
{
|
||||
}
|
||||
|
||||
SignedField(int & field, const char *name):
|
||||
DataField(name),
|
||||
field(field),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX)
|
||||
{
|
||||
}
|
||||
|
||||
SignedField(int & field, int min, int max, const char *name="Signed"):
|
||||
DataField(name),
|
||||
field(field),
|
||||
min(min),
|
||||
max(max)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ExportBits(QBitArray & output)
|
||||
{
|
||||
int value = field;
|
||||
if (value > max) value = max;
|
||||
if (value < min) value = min;
|
||||
|
||||
output.resize(N);
|
||||
for (int i=0; i<N; i++) {
|
||||
if (((unsigned int)value) & (1<<i))
|
||||
output.setBit(i);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
unsigned int value = 0;
|
||||
for (int i=0; i<N; i++) {
|
||||
if (input[i])
|
||||
value |= (1<<i);
|
||||
}
|
||||
|
||||
if (input[N-1]) {
|
||||
for (unsigned int i=N; i<8*sizeof(int); i++) {
|
||||
value |= (1<<i);
|
||||
}
|
||||
}
|
||||
|
||||
field = (int)value;
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
{
|
||||
return N;
|
||||
}
|
||||
|
||||
protected:
|
||||
int & field;
|
||||
int min;
|
||||
int max;
|
||||
};
|
||||
|
||||
template<int N>
|
||||
class SpareBitsField: public UnsignedField<N> {
|
||||
public:
|
||||
SpareBitsField():
|
||||
UnsignedField<N>(spare, 0, 0, "Spare"),
|
||||
spare(0)
|
||||
{
|
||||
}
|
||||
protected:
|
||||
unsigned int spare;
|
||||
};
|
||||
|
||||
template<int N>
|
||||
class CharField: public DataField {
|
||||
public:
|
||||
CharField(char *field, bool truncate=true):
|
||||
DataField("Char"),
|
||||
field(field),
|
||||
truncate(truncate)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ExportBits(QBitArray & output)
|
||||
{
|
||||
output.resize(N*8);
|
||||
int b = 0;
|
||||
int len = truncate ? strlen(field) : N;
|
||||
for (int i=0; i<N; i++) {
|
||||
int idx = (i>=len ? 0 : field[i]);
|
||||
for (int j=0; j<8; j++, b++) {
|
||||
if (idx & (1<<j))
|
||||
output.setBit(b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
unsigned int b = 0;
|
||||
for (int i=0; i<N; i++) {
|
||||
int8_t idx = 0;
|
||||
for (int j=0; j<8; j++) {
|
||||
if (input[b++])
|
||||
idx |= (1<<j);
|
||||
}
|
||||
field[i] = idx;
|
||||
}
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
{
|
||||
return 8*N;
|
||||
}
|
||||
|
||||
protected:
|
||||
char * field;
|
||||
bool truncate;
|
||||
};
|
||||
|
||||
int8_t char2idx(char c);
|
||||
char idx2char(int8_t idx);
|
||||
|
||||
template<int N>
|
||||
class ZCharField: public DataField {
|
||||
public:
|
||||
ZCharField(char *field):
|
||||
DataField("ZChar"),
|
||||
field(field)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ExportBits(QBitArray & output)
|
||||
{
|
||||
output.resize(N*8);
|
||||
int b = 0;
|
||||
int len = strlen(field);
|
||||
for (int i=0; i<N; i++) {
|
||||
int idx = i>=len ? 0 : char2idx(field[i]);
|
||||
for (int j=0; j<8; j++, b++) {
|
||||
if (idx & (1<<j))
|
||||
output.setBit(b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
unsigned int b = 0;
|
||||
for (int i=0; i<N; i++) {
|
||||
int8_t idx = 0;
|
||||
for (int j=0; j<8; j++) {
|
||||
if (input[b++])
|
||||
idx |= (1<<j);
|
||||
}
|
||||
field[i] = idx2char(idx);
|
||||
}
|
||||
|
||||
field[N] = '\0';
|
||||
for (int i=N-1; i>=0; i--) {
|
||||
if (field[i] == ' ')
|
||||
field[i] = '\0';
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
{
|
||||
return 8*N;
|
||||
}
|
||||
|
||||
protected:
|
||||
char * field;
|
||||
};
|
||||
|
||||
class StructField: public DataField {
|
||||
public:
|
||||
StructField(const char *name="Struct"):
|
||||
DataField(name)
|
||||
{
|
||||
}
|
||||
|
||||
~StructField() {
|
||||
foreach(DataField *field, fields) {
|
||||
delete field;
|
||||
}
|
||||
}
|
||||
|
||||
inline void Append(DataField *field) {
|
||||
fields.append(field);
|
||||
}
|
||||
|
||||
virtual void ExportBits(QBitArray & output)
|
||||
{
|
||||
int offset = 0;
|
||||
output.resize(size());
|
||||
foreach(DataField *field, fields) {
|
||||
QBitArray bits;
|
||||
field->ExportBits(bits);
|
||||
for (int i=0; i<bits.size(); i++)
|
||||
output[offset++] = bits[i];
|
||||
}
|
||||
}
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
int offset = 0;
|
||||
foreach(DataField *field, fields) {
|
||||
unsigned int size = field->size();
|
||||
QBitArray bits(size);
|
||||
for (unsigned int i=0; i<size; i++) {
|
||||
bits[i] = input[offset++];
|
||||
}
|
||||
field->ImportBits(bits);
|
||||
}
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
{
|
||||
unsigned int result = 0;
|
||||
foreach(DataField *field, fields) {
|
||||
result += field->size();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual int Dump(int level=0, int offset=0)
|
||||
{
|
||||
for (int i=0; i<level; i++) printf(" ");
|
||||
printf("%s (%d bytes)\n", getName(), size()/8);
|
||||
foreach(DataField *field, fields) {
|
||||
offset = field->Dump(level+1, offset);
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
protected:
|
||||
QList<DataField *> fields;
|
||||
};
|
||||
|
||||
class TransformedField: public DataField {
|
||||
public:
|
||||
TransformedField(DataField & field):
|
||||
DataField(),
|
||||
field(field)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~TransformedField()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ExportBits(QBitArray & output)
|
||||
{
|
||||
beforeExport();
|
||||
field.ExportBits(output);
|
||||
}
|
||||
|
||||
virtual void ImportBits(QBitArray & input)
|
||||
{
|
||||
field.ImportBits(input);
|
||||
afterImport();
|
||||
}
|
||||
|
||||
|
||||
virtual const char *getName()
|
||||
{
|
||||
return field.getName();
|
||||
}
|
||||
|
||||
virtual unsigned int size()
|
||||
{
|
||||
return field.size();
|
||||
}
|
||||
|
||||
virtual void beforeExport() = 0;
|
||||
|
||||
virtual void afterImport() = 0;
|
||||
|
||||
virtual int Dump(int level=0, int offset=0)
|
||||
{
|
||||
beforeExport();
|
||||
return field.Dump(level, offset);
|
||||
}
|
||||
|
||||
protected:
|
||||
DataField & field;
|
||||
};
|
||||
|
||||
class ConversionTable {
|
||||
|
||||
public:
|
||||
bool exportValue(const int before, int &after)
|
||||
{
|
||||
after = 0;
|
||||
|
||||
for (std::list<ConversionTuple>::iterator it=exportTable.begin(); it!=exportTable.end(); it++) {
|
||||
ConversionTuple tuple = *it;
|
||||
if (before == tuple.a) {
|
||||
after = tuple.b;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool importValue(const int before, int &after)
|
||||
{
|
||||
after = 0;
|
||||
|
||||
for (std::list<ConversionTuple>::iterator it=importTable.begin(); it!=importTable.end(); it++) {
|
||||
ConversionTuple tuple = *it;
|
||||
if (before == tuple.b) {
|
||||
after = tuple.a;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
class ConversionTuple {
|
||||
public:
|
||||
ConversionTuple(const int a, const int b):
|
||||
a(a),
|
||||
b(b)
|
||||
{
|
||||
}
|
||||
|
||||
int a;
|
||||
int b;
|
||||
};
|
||||
|
||||
void addConversion(const int a, const int b)
|
||||
{
|
||||
ConversionTuple conversion(a, b);
|
||||
importTable.push_back(conversion);
|
||||
exportTable.push_back(conversion);
|
||||
}
|
||||
|
||||
void addImportConversion(const int a, const int b)
|
||||
{
|
||||
importTable.push_back(ConversionTuple(a, b));
|
||||
}
|
||||
|
||||
void addExportConversion(const int a, const int b)
|
||||
{
|
||||
exportTable.push_back(ConversionTuple(a, b));
|
||||
}
|
||||
|
||||
std::list<ConversionTuple> importTable;
|
||||
std::list<ConversionTuple> exportTable;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class ConversionField: public TransformedField {
|
||||
public:
|
||||
ConversionField(int & field, ConversionTable *table, const char *name, const QString & error = ""):
|
||||
TransformedField(internalField),
|
||||
internalField(_field, name),
|
||||
field(field),
|
||||
_field(0),
|
||||
table(table),
|
||||
shift(0),
|
||||
scale(1),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX),
|
||||
exportFunc(NULL),
|
||||
importFunc(NULL),
|
||||
error(error)
|
||||
{
|
||||
}
|
||||
|
||||
ConversionField(unsigned int & field, ConversionTable *table, const char *name, const QString & error = ""):
|
||||
TransformedField(internalField),
|
||||
internalField((unsigned int &)_field, name),
|
||||
field((int &)field),
|
||||
_field(0),
|
||||
table(table),
|
||||
shift(0),
|
||||
scale(0),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX),
|
||||
exportFunc(NULL),
|
||||
importFunc(NULL),
|
||||
error(error)
|
||||
{
|
||||
}
|
||||
|
||||
ConversionField(int & field, int (*exportFunc)(int), int (*importFunc)(int)):
|
||||
TransformedField(internalField),
|
||||
internalField(_field),
|
||||
field(field),
|
||||
_field(0),
|
||||
table(NULL),
|
||||
shift(0),
|
||||
scale(0),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX),
|
||||
exportFunc(exportFunc),
|
||||
importFunc(importFunc),
|
||||
error("")
|
||||
{
|
||||
}
|
||||
|
||||
ConversionField(int & field, int shift, int scale=0, int min=INT_MIN, int max=INT_MAX, const char *name = "Signed shifted"):
|
||||
TransformedField(internalField),
|
||||
internalField(_field, name),
|
||||
field(field),
|
||||
_field(0),
|
||||
table(NULL),
|
||||
shift(shift),
|
||||
scale(scale),
|
||||
min(min),
|
||||
max(max),
|
||||
exportFunc(NULL),
|
||||
importFunc(NULL),
|
||||
error("")
|
||||
{
|
||||
}
|
||||
|
||||
ConversionField(unsigned int & field, int shift, int scale=0):
|
||||
TransformedField(internalField),
|
||||
internalField((unsigned int &)_field),
|
||||
field((int &)field),
|
||||
_field(0),
|
||||
table(NULL),
|
||||
shift(shift),
|
||||
scale(scale),
|
||||
min(INT_MIN),
|
||||
max(INT_MAX),
|
||||
exportFunc(NULL),
|
||||
importFunc(NULL),
|
||||
error("")
|
||||
{
|
||||
}
|
||||
|
||||
virtual void beforeExport()
|
||||
{
|
||||
_field = field;
|
||||
|
||||
if (scale) {
|
||||
_field /= scale;
|
||||
}
|
||||
|
||||
if (table) {
|
||||
if (table->exportValue(_field, _field))
|
||||
return;
|
||||
if (!error.isEmpty())
|
||||
EEPROMWarnings.push_back(error);
|
||||
}
|
||||
|
||||
if (shift) {
|
||||
if (_field < min) _field = min + shift;
|
||||
else if (_field > max) _field = max + shift;
|
||||
else _field += shift;
|
||||
}
|
||||
|
||||
if (exportFunc) {
|
||||
_field = exportFunc(_field);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
field = _field;
|
||||
|
||||
if (table) {
|
||||
if (table->importValue(field, field))
|
||||
return;
|
||||
}
|
||||
|
||||
if (shift) {
|
||||
field -= shift;
|
||||
}
|
||||
|
||||
if (importFunc) {
|
||||
field = importFunc(field);
|
||||
}
|
||||
|
||||
if (scale) {
|
||||
field *= scale;
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
T internalField;
|
||||
int & field;
|
||||
int _field;
|
||||
ConversionTable * table;
|
||||
int shift;
|
||||
int scale;
|
||||
int min;
|
||||
int max;
|
||||
int (*exportFunc)(int);
|
||||
int (*importFunc)(int);
|
||||
const QString error;
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,659 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 "stdio.h"
|
||||
#include "inttypes.h"
|
||||
#include "string.h"
|
||||
#include "file.h"
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
RleFile::RleFile():
|
||||
eeprom(NULL),
|
||||
eeprom_size(0),
|
||||
eeFs(NULL),
|
||||
eeFsArm(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
|
||||
{
|
||||
this->eeprom = eeprom;
|
||||
this->eeprom_size = size;
|
||||
this->board = board;
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
memset(eeprom, 0xFF, size);
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
eeFsArm = (EeFsArm *)eeprom;
|
||||
eeFsVersion = 5;
|
||||
eeFsSize = 8+4*62;
|
||||
eeFsBlockSize = 64;
|
||||
eeFsFirstBlock = 1;
|
||||
eeFsBlocksOffset = eeFsSize - eeFsBlockSize;
|
||||
eeFsBlocksMax = 1 + (EESIZE_TARANIS-eeFsSize)/eeFsBlockSize;
|
||||
eeFsLinkSize = sizeof(int16_t);
|
||||
memset(eeprom, 0, size);
|
||||
eeFsArm->version = eeFsVersion;
|
||||
eeFsArm->mySize = eeFsSize;
|
||||
eeFsArm->freeList = 0;
|
||||
eeFsArm->bs = 64;
|
||||
for (unsigned int i=eeFsFirstBlock; i<eeFsBlocksMax-1; i++)
|
||||
EeFsSetLink(i, i+1);
|
||||
EeFsSetLink(eeFsBlocksMax-1, 0);
|
||||
eeFsArm->freeList = eeFsFirstBlock;
|
||||
// EeFsFlush();
|
||||
}
|
||||
else {
|
||||
eeFs = (EeFs *)eeprom;
|
||||
eeFsVersion = (board==BOARD_GRUVIN9X || board==BOARD_M128) ? 5 : 4;
|
||||
eeFsBlockSize = 16;
|
||||
eeFsLinkSize = 1;
|
||||
|
||||
if (eeFsVersion == 5) {
|
||||
eeFsSize = 4+3*36;
|
||||
eeFsFirstBlock = 1;
|
||||
eeFsBlocksOffset = 112 - 16;
|
||||
eeFsBlocksMax = 1 + (4096-112)/16;
|
||||
}
|
||||
else {
|
||||
eeFsSize = 4+3*20;
|
||||
eeFsFirstBlock = 4;
|
||||
eeFsBlocksOffset = 0;
|
||||
eeFsBlocksMax = 2048/16;
|
||||
}
|
||||
|
||||
memset(eeprom, 0, size);
|
||||
eeFs->version = eeFsVersion;
|
||||
eeFs->mySize = eeFsSize;
|
||||
eeFs->freeList = 0;
|
||||
eeFs->bs = eeFsBlockSize;
|
||||
for (unsigned int i=eeFsFirstBlock; i<eeFsBlocksMax-1; i++)
|
||||
EeFsSetLink(i, i+1);
|
||||
EeFsSetLink(eeFsBlocksMax-1, 0);
|
||||
eeFs->freeList = eeFsFirstBlock;
|
||||
// EeFsFlush();
|
||||
}
|
||||
}
|
||||
|
||||
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
|
||||
{
|
||||
this->eeprom = eeprom;
|
||||
this->eeprom_size = size;
|
||||
this->board = board;
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
return 1;
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
eeFsArm = (EeFsArm *)eeprom;
|
||||
eeFsVersion = eeFsArm->version;
|
||||
eeFsSize = 8+4*62;
|
||||
eeFsBlockSize = 64;
|
||||
eeFsLinkSize = sizeof(int16_t);
|
||||
eeFsFirstBlock = 1;
|
||||
eeFsBlocksOffset = eeFsSize - eeFsBlockSize;
|
||||
eeFsBlocksMax = 1 + (EESIZE_TARANIS-eeFsSize)/eeFsBlockSize;
|
||||
return eeFsArm->mySize == eeFsSize;
|
||||
}
|
||||
else {
|
||||
eeFs = (EeFs *)eeprom;
|
||||
eeFsVersion = eeFs->version;
|
||||
eeFsBlockSize = 16;
|
||||
eeFsLinkSize = 1;
|
||||
if (eeFsVersion == 5) {
|
||||
eeFsSize = 4+3*36;
|
||||
eeFsFirstBlock = 1;
|
||||
eeFsBlocksOffset = 112 - 16;
|
||||
eeFsBlocksMax = 1 + (4096-112)/16;
|
||||
}
|
||||
else if (eeFsVersion == 4) {
|
||||
eeFsSize = 4+3*20;
|
||||
eeFsFirstBlock = 4;
|
||||
eeFsBlocksOffset = 0;
|
||||
eeFsBlocksMax = 2048/16;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return eeFs->mySize == eeFsSize;
|
||||
}
|
||||
}
|
||||
|
||||
void RleFile::eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size)
|
||||
{
|
||||
memcpy(pointer_ram, &eeprom[pointer_eeprom], size);
|
||||
}
|
||||
|
||||
void RleFile::eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size)
|
||||
{
|
||||
memcpy(&eeprom[pointer_eeprom], pointer_ram, size);
|
||||
}
|
||||
|
||||
uint8_t RleFile::EeFsRead(unsigned int blk, unsigned int ofs)
|
||||
{
|
||||
uint8_t ret;
|
||||
eeprom_read_block(&ret, blk*eeFsBlockSize+ofs+eeFsBlocksOffset, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RleFile::EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val)
|
||||
{
|
||||
eeprom_write_block(&val, blk*eeFsBlockSize+ofs+eeFsBlocksOffset, 1);
|
||||
}
|
||||
|
||||
unsigned int RleFile::EeFsGetLink(unsigned int blk)
|
||||
{
|
||||
if (IS_ARM(board)) {
|
||||
int16_t ret;
|
||||
eeprom_read_block((uint8_t *)&ret, blk*eeFsBlockSize+eeFsBlocksOffset, eeFsLinkSize);
|
||||
return ret;
|
||||
}
|
||||
else {
|
||||
return EeFsRead(blk, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void RleFile::EeFsSetLink(unsigned int blk, unsigned int val)
|
||||
{
|
||||
if (IS_ARM(board)) {
|
||||
int16_t s_link = val;
|
||||
eeprom_write_block((uint8_t *)&s_link, (blk*eeFsBlockSize)+eeFsBlocksOffset, eeFsLinkSize);
|
||||
}
|
||||
else {
|
||||
EeFsWrite(blk, 0, val);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t RleFile::EeFsGetDat(unsigned int blk, unsigned int ofs)
|
||||
{
|
||||
return EeFsRead(blk, ofs+eeFsLinkSize);
|
||||
}
|
||||
|
||||
void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf, unsigned int len)
|
||||
{
|
||||
eeprom_write_block(buf, blk*eeFsBlockSize+ofs+eeFsLinkSize+eeFsBlocksOffset, len);
|
||||
}
|
||||
|
||||
unsigned int RleFile::EeFsGetFree()
|
||||
{
|
||||
unsigned int ret = 0;
|
||||
unsigned int i;
|
||||
if (IS_ARM(board))
|
||||
i = eeFsArm->freeList;
|
||||
else
|
||||
i = eeFs->freeList;
|
||||
|
||||
while (i) {
|
||||
ret += eeFsBlockSize-eeFsLinkSize;
|
||||
i = EeFsGetLink(i);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* free one or more blocks
|
||||
*/
|
||||
void RleFile::EeFsFree(unsigned int blk)
|
||||
{
|
||||
unsigned int i = blk;
|
||||
while (EeFsGetLink(i)) i = EeFsGetLink(i);
|
||||
if (IS_ARM(board)) {
|
||||
EeFsSetLink(i, eeFsArm->freeList);
|
||||
eeFsArm->freeList = blk; //chain in front
|
||||
}
|
||||
else {
|
||||
EeFsSetLink(i, eeFs->freeList);
|
||||
eeFs->freeList = blk; //chain in front
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* alloc one block from freelist
|
||||
*/
|
||||
unsigned int RleFile::EeFsAlloc()
|
||||
{
|
||||
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
|
||||
if (ret) {
|
||||
if (IS_ARM(board))
|
||||
eeFsArm->freeList = EeFsGetLink(ret);
|
||||
else
|
||||
eeFs->freeList = EeFsGetLink(ret);
|
||||
EeFsSetLink(ret, 0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int RleFile::size(unsigned int id)
|
||||
{
|
||||
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
|
||||
}
|
||||
|
||||
unsigned int RleFile::openRd(unsigned int i_fileId)
|
||||
{
|
||||
if (IS_SKY9X(board)) {
|
||||
m_fileId = get_current_block_number(i_fileId * 2, &m_size);
|
||||
m_pos = sizeof(t_eeprom_header);
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
m_fileId = i_fileId;
|
||||
m_pos = 0;
|
||||
m_currBlk = (IS_ARM(board) ? eeFsArm->files[m_fileId].startBlk : eeFs->files[m_fileId].startBlk);
|
||||
m_ofs = 0;
|
||||
m_zeroes = 0;
|
||||
m_bRlc = 0;
|
||||
m_err = ERR_NONE; //error reasons
|
||||
if (IS_ARM(board))
|
||||
return eeFsArm->files[m_fileId].typ;
|
||||
else
|
||||
return eeFs->files[m_fileId].typ;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
|
||||
len -= m_pos;
|
||||
if (i_len > len) i_len = len;
|
||||
len = i_len;
|
||||
while(len) {
|
||||
if (!m_currBlk) break;
|
||||
*buf++ = EeFsGetDat(m_currBlk, m_ofs++);
|
||||
if (m_ofs >= (eeFsBlockSize-(IS_ARM(board)? 2 : 1))) {
|
||||
m_ofs = 0;
|
||||
m_currBlk = EeFsGetLink(m_currBlk);
|
||||
}
|
||||
len--;
|
||||
}
|
||||
m_pos += i_len - len;
|
||||
return i_len - len;
|
||||
}
|
||||
|
||||
// G: Read runlength (RLE) compressed bytes into buf.
|
||||
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
{
|
||||
memset(buf, 0, i_len);
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
int len = std::min((int)i_len, (int)m_size + (int)sizeof(t_eeprom_header) - (int)m_pos);
|
||||
if (len > 0) {
|
||||
eeprom_read_block(buf, (m_fileId << 12) + m_pos, len);
|
||||
m_pos += len;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
else {
|
||||
unsigned int i=0;
|
||||
for( ; 1; ) {
|
||||
uint8_t ln = std::min<uint16_t>(m_zeroes, i_len-i);
|
||||
memset(&buf[i], 0, ln);
|
||||
i += ln;
|
||||
m_zeroes -= ln;
|
||||
if(m_zeroes) break;
|
||||
|
||||
ln = std::min<uint16_t>(m_bRlc, i_len-i);
|
||||
uint8_t lr = read(&buf[i], ln);
|
||||
i += lr ;
|
||||
m_bRlc -= lr;
|
||||
if(m_bRlc) break;
|
||||
|
||||
if (read(&m_bRlc, 1) !=1) break; //read how many bytes to read
|
||||
|
||||
if (!(m_bRlc & 0x7f)) {
|
||||
qDebug() << "RLC decoding error!";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rlc2) {
|
||||
if(m_bRlc&0x80){ // if contains high byte
|
||||
m_zeroes =(m_bRlc>>4) & 0x7;
|
||||
m_bRlc = m_bRlc & 0x0f;
|
||||
}
|
||||
else if(m_bRlc&0x40){
|
||||
m_zeroes = m_bRlc & 0x3f;
|
||||
m_bRlc = 0;
|
||||
}
|
||||
//else m_bRlc
|
||||
}
|
||||
else {
|
||||
if(m_bRlc&0x80){ // if contains high byte
|
||||
m_zeroes = m_bRlc & 0x7f;
|
||||
m_bRlc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion)
|
||||
{
|
||||
uint8_t *buf = (uint8_t *)src.data();
|
||||
unsigned int len = src.size();
|
||||
uint8_t zeroes = 0;
|
||||
uint8_t bRlc = 0;
|
||||
|
||||
dst.resize(0);
|
||||
|
||||
for( ; 1; ) {
|
||||
for (int i=0; i<zeroes; i++)
|
||||
dst.append((char)0);
|
||||
zeroes = 0;
|
||||
|
||||
if (len == 0)
|
||||
return dst.size();
|
||||
|
||||
for (int i=0; i<bRlc; i++) {
|
||||
dst.append(*buf++);
|
||||
if (--len == 0)
|
||||
return dst.size();
|
||||
}
|
||||
|
||||
bRlc = *buf++;
|
||||
--len;
|
||||
|
||||
if (!(bRlc & 0x7f)) {
|
||||
qDebug() << "RLC decoding error!";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rlcVersion == 2) {
|
||||
if (bRlc&0x80){ // if contains high byte
|
||||
zeroes = (bRlc>>4) & 0x07;
|
||||
bRlc = bRlc & 0x0f;
|
||||
}
|
||||
else if (bRlc&0x40){
|
||||
zeroes = bRlc & 0x3f;
|
||||
bRlc = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (bRlc&0x80){ // if contains high byte
|
||||
zeroes = bRlc & 0x7f;
|
||||
bRlc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dst.size();
|
||||
}
|
||||
|
||||
unsigned int RleFile::write1(uint8_t b)
|
||||
{
|
||||
return write(&b, 1);
|
||||
}
|
||||
|
||||
unsigned int RleFile::write(const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
unsigned int len = i_len;
|
||||
if (!m_currBlk && m_pos==0)
|
||||
{
|
||||
if (IS_ARM(board))
|
||||
eeFsArm->files[m_fileId].startBlk = m_currBlk = EeFsAlloc();
|
||||
else
|
||||
eeFs->files[m_fileId].startBlk = m_currBlk = EeFsAlloc();
|
||||
}
|
||||
while (len)
|
||||
{
|
||||
if (!m_currBlk) {
|
||||
m_err = ERR_FULL;
|
||||
return 0;
|
||||
}
|
||||
if (m_ofs >= eeFsBlockSize-eeFsLinkSize) {
|
||||
m_ofs = 0;
|
||||
if (!EeFsGetLink(m_currBlk) ){
|
||||
EeFsSetLink(m_currBlk, EeFsAlloc());
|
||||
}
|
||||
m_currBlk = EeFsGetLink(m_currBlk);
|
||||
}
|
||||
if (!m_currBlk) {
|
||||
m_err = ERR_FULL;
|
||||
return 0;
|
||||
}
|
||||
uint8_t l = eeFsBlockSize-eeFsLinkSize-m_ofs; if(l>len) l=len;
|
||||
EeFsSetDat(m_currBlk, m_ofs, buf, l);
|
||||
buf +=l;
|
||||
m_ofs +=l;
|
||||
len -=l;
|
||||
}
|
||||
m_pos += i_len - len;
|
||||
return i_len - len;
|
||||
}
|
||||
|
||||
void RleFile::create(unsigned int i_fileId, unsigned int typ)
|
||||
{
|
||||
openRd(i_fileId); //internal use
|
||||
if (IS_ARM(board)) {
|
||||
eeFsArm->files[i_fileId].typ = typ;
|
||||
eeFsArm->files[i_fileId].size = 0;
|
||||
}
|
||||
else {
|
||||
eeFs->files[i_fileId].typ = typ;
|
||||
eeFs->files[i_fileId].size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void RleFile::closeTrunc()
|
||||
{
|
||||
unsigned int fri=0;
|
||||
if (IS_ARM(board))
|
||||
eeFsArm->files[m_fileId].size = m_pos;
|
||||
else
|
||||
eeFs->files[m_fileId].size = m_pos;
|
||||
if (m_currBlk && ( fri = EeFsGetLink(m_currBlk))) EeFsSetLink(m_currBlk, 0);
|
||||
if(fri) EeFsFree( fri ); //chain in
|
||||
}
|
||||
|
||||
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
create(i_fileId, typ);
|
||||
bool state0 = true;
|
||||
uint8_t cnt = 0;
|
||||
uint16_t i;
|
||||
|
||||
//RLE compression:
|
||||
//rb = read byte
|
||||
//if (rb | 0x80) write rb & 0x7F zeros
|
||||
//else write rb bytes
|
||||
for (i=0; i<=i_len; i++)
|
||||
{
|
||||
bool nst0 = (buf[i] == 0);
|
||||
if (nst0 && !state0 && buf[i+1]!=0) nst0 = false ;
|
||||
if (nst0 != state0 || cnt>=0x7f || i==i_len) {
|
||||
if (state0) {
|
||||
if(cnt>0) {
|
||||
cnt |= 0x80;
|
||||
if (write(&cnt,1)!=1) goto error;
|
||||
cnt=0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cnt>0) {
|
||||
if (write(&cnt,1) !=1) goto error;
|
||||
uint8_t ret=write(&buf[i-cnt],cnt);
|
||||
if (ret!=cnt) { cnt-=ret; goto error;}
|
||||
cnt=0;
|
||||
}
|
||||
}
|
||||
state0 = nst0;
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
if(0){
|
||||
error:
|
||||
i_len = i - (cnt & 0x7f);
|
||||
}
|
||||
closeTrunc();
|
||||
return i_len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write runlength (RLE) compressed bytes
|
||||
*/
|
||||
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
if (IS_SKY9X(board)) {
|
||||
openRd(i_fileId);
|
||||
eeprom_write_block(buf, (m_fileId << 12) + m_pos, i_len);
|
||||
t_eeprom_header header;
|
||||
header.sequence_no = 1;
|
||||
header.data_size = i_len;
|
||||
header.flags = 0;
|
||||
header.hcsum = byte_checksum((uint8_t *) &header, 7);
|
||||
eeprom_write_block(&header, (m_fileId << 12), sizeof(header));
|
||||
return i_len;
|
||||
}
|
||||
else {
|
||||
create(i_fileId, typ);
|
||||
bool run0 = buf[0] == 0;
|
||||
uint8_t cnt = 1;
|
||||
uint8_t cnt0 = 0;
|
||||
uint16_t i = 0;
|
||||
if (i_len==0) goto close;
|
||||
|
||||
//RLE compression:
|
||||
//rb = read byte
|
||||
//if (rb | 0x80) write rb & 0x7F zeros
|
||||
//else write rb bytes
|
||||
for (i=1; 1; i++) { // !! laeuft ein byte zu weit !!
|
||||
bool cur0 = buf[i] == 0;
|
||||
if (i==i_len || cur0 != run0 || cnt==0x3f || (cnt0 && cnt==0xf)) {
|
||||
if (run0){
|
||||
assert(cnt0==0);
|
||||
if (cnt<8 && i!=i_len)
|
||||
cnt0 = cnt; //aufbew fuer spaeter
|
||||
else {
|
||||
if (write1(cnt|0x40)!=1) goto error;//-cnt&0x3f
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cnt0) {
|
||||
if (write1(0x80 | (cnt0<<4) | cnt)!=1) goto error;//-cnt0xx-cnt
|
||||
cnt0 = 0;
|
||||
}
|
||||
else {
|
||||
if (write1(cnt)!=1) goto error;//-cnt
|
||||
}
|
||||
uint8_t ret = write(&buf[i-cnt], cnt);
|
||||
if (ret != cnt) { cnt-=ret; goto error;}//-cnt
|
||||
}
|
||||
cnt=0;
|
||||
if (i==i_len) break;
|
||||
run0 = cur0;
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
if (0) {
|
||||
error:
|
||||
i-=cnt+cnt0;
|
||||
}
|
||||
|
||||
close:
|
||||
closeTrunc();
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t RleFile::byte_checksum( uint8_t *p, unsigned int size )
|
||||
{
|
||||
uint32_t csum ;
|
||||
|
||||
csum = 0 ;
|
||||
while( size )
|
||||
{
|
||||
csum += *p++ ;
|
||||
size -= 1 ;
|
||||
}
|
||||
return csum ;
|
||||
}
|
||||
|
||||
uint32_t RleFile::ee32_check_header( struct t_eeprom_header *hptr )
|
||||
{
|
||||
uint8_t csum ;
|
||||
|
||||
csum = byte_checksum( ( uint8_t *) hptr, 7 ) ;
|
||||
if ( csum == hptr->hcsum )
|
||||
{
|
||||
return 1 ;
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
// Pass in an even block number, this and the next block will be checked
|
||||
// to see which is the most recent, the block_no of the most recent
|
||||
// is returned, with the corresponding data size if required
|
||||
// and the sequence number if required
|
||||
uint32_t RleFile::get_current_block_number( uint32_t block_no, uint16_t *p_size)
|
||||
{
|
||||
struct t_eeprom_header b0 ;
|
||||
struct t_eeprom_header b1 ;
|
||||
// uint32_t sequence_no ;
|
||||
uint16_t size ;
|
||||
|
||||
eeprom_read_block( ( uint8_t *)&b0, block_no << 12, sizeof(b0) ) ; // Sequence # 0
|
||||
eeprom_read_block( ( uint8_t *)&b1, (block_no+1) << 12, sizeof(b1) ) ; // Sequence # 1
|
||||
|
||||
if ( ee32_check_header( &b0 ) == 0 )
|
||||
{
|
||||
b0.sequence_no = 0 ;
|
||||
b0.data_size = 0 ;
|
||||
b0.flags = 0 ;
|
||||
}
|
||||
|
||||
size = b0.data_size ;
|
||||
// sequence_no = b0.sequence_no ;
|
||||
if ( ee32_check_header( &b0 ) == 0 )
|
||||
{
|
||||
if ( ee32_check_header( &b1 ) != 0 )
|
||||
{
|
||||
size = b1.data_size ;
|
||||
// sequence_no = b1.sequence_no ;
|
||||
block_no += 1 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = 0 ;
|
||||
// sequence_no = 1 ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ee32_check_header( &b1 ) != 0 )
|
||||
{
|
||||
if ( b1.sequence_no > b0.sequence_no )
|
||||
{
|
||||
size = b1.data_size ;
|
||||
// sequence_no = b1.sequence_no ;
|
||||
block_no += 1 ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( size == 0xFFFF )
|
||||
{
|
||||
size = 0 ;
|
||||
}
|
||||
if ( p_size )
|
||||
{
|
||||
*p_size = size ;
|
||||
}
|
||||
|
||||
return block_no ;
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
// TODO should be rle
|
||||
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef file_h
|
||||
#define file_h
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
#define ERR_NONE 0
|
||||
#define ERR_FULL 1
|
||||
#define ERR_TMO 2
|
||||
|
||||
PACK(struct DirEnt {
|
||||
uint8_t startBlk;
|
||||
uint16_t size:12;
|
||||
uint16_t typ:4;
|
||||
});
|
||||
|
||||
PACK(struct DirEntArm {
|
||||
uint16_t startBlk;
|
||||
uint16_t size:12;
|
||||
uint16_t typ:4;
|
||||
});
|
||||
|
||||
PACK(struct EeFs{
|
||||
uint8_t version;
|
||||
uint8_t mySize;
|
||||
uint8_t freeList;
|
||||
uint8_t bs;
|
||||
DirEnt files[36];
|
||||
});
|
||||
|
||||
PACK(struct EeFsArm {
|
||||
uint8_t version;
|
||||
uint16_t mySize;
|
||||
uint16_t freeList;
|
||||
uint8_t bs;
|
||||
uint8_t spare[2];
|
||||
DirEntArm files[62];
|
||||
});
|
||||
|
||||
struct t_eeprom_header
|
||||
{
|
||||
uint32_t sequence_no ; // sequence # to decide which block is most recent
|
||||
uint16_t data_size ; // # bytes in data area
|
||||
uint8_t flags ;
|
||||
uint8_t hcsum ;
|
||||
};
|
||||
|
||||
class RleFile
|
||||
{
|
||||
uint8_t m_fileId; //index of file in directory = filename
|
||||
unsigned int m_pos; //over all filepos
|
||||
unsigned int m_currBlk; //current block.id
|
||||
unsigned int m_ofs; //offset inside of the current block
|
||||
uint8_t m_zeroes; //control byte for run length decoder
|
||||
uint8_t m_bRlc; //control byte for run length decoder
|
||||
unsigned int m_err; //error reasons
|
||||
uint16_t m_size;
|
||||
|
||||
BoardEnum board;
|
||||
uint8_t *eeprom;
|
||||
unsigned int eeprom_size;
|
||||
EeFs *eeFs;
|
||||
EeFsArm *eeFsArm;
|
||||
unsigned int eeFsVersion;
|
||||
unsigned int eeFsBlockSize;
|
||||
unsigned int eeFsSize;
|
||||
unsigned int eeFsFirstBlock;
|
||||
unsigned int eeFsBlocksOffset;
|
||||
unsigned int eeFsBlocksMax;
|
||||
unsigned int eeFsLinkSize;
|
||||
|
||||
void eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size);
|
||||
void eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size);
|
||||
|
||||
uint8_t EeFsRead(unsigned int blk, unsigned int ofs);
|
||||
void EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val);
|
||||
|
||||
unsigned int EeFsGetLink(unsigned int blk);
|
||||
void EeFsSetLink(unsigned int blk, unsigned int val);
|
||||
uint8_t EeFsGetDat(unsigned int blk, unsigned int ofs);
|
||||
void EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf, unsigned int len);
|
||||
unsigned int EeFsGetFree();
|
||||
void EeFsFree(unsigned int blk); // free one or more blocks
|
||||
unsigned int EeFsAlloc(); // alloc one block from freelist
|
||||
|
||||
public:
|
||||
|
||||
RleFile();
|
||||
|
||||
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board);
|
||||
|
||||
bool EeFsOpen(uint8_t *eeprom, int size, BoardEnum board);
|
||||
|
||||
///open file for reading, no close necessary
|
||||
///for writing use writeRlc() or create()
|
||||
unsigned int openRd(unsigned int i_fileId);
|
||||
/// create a new file with given fileId,
|
||||
/// !!! if this file already exists, then all blocks are reused
|
||||
/// and all contents will be overwritten.
|
||||
/// after writing closeTrunc has to be called
|
||||
void create(unsigned int i_fileId, unsigned int typ);
|
||||
/// close file and truncate the blockchain if to long.
|
||||
void closeTrunc();
|
||||
|
||||
///open file, write to file and close it.
|
||||
///If file existed before, then contents is overwritten.
|
||||
///If file was larger before, then unused blocks are freed
|
||||
unsigned int writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len);
|
||||
unsigned int writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len);
|
||||
|
||||
unsigned int read(uint8_t *buf, unsigned int i_len);
|
||||
unsigned int write1(uint8_t b);
|
||||
unsigned int write(const uint8_t *buf, unsigned int i_len);
|
||||
|
||||
///return size of compressed file without block overhead
|
||||
unsigned int size(unsigned int id);
|
||||
///read from opened file and decode rlc-coded data
|
||||
unsigned int readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2);
|
||||
inline unsigned int readRlc1(uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
return readRlc12(buf, i_len, false);
|
||||
}
|
||||
inline unsigned int readRlc2(uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
return readRlc12(buf, i_len, true);
|
||||
}
|
||||
|
||||
uint8_t byte_checksum(uint8_t *p, unsigned int size);
|
||||
unsigned int ee32_check_header(struct t_eeprom_header *hptr);
|
||||
unsigned int get_current_block_number(unsigned int block_no, uint16_t *p_size);
|
||||
};
|
||||
|
||||
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion=2);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,472 @@
|
||||
#include <algorithm>
|
||||
#include "er9xeeprom.h"
|
||||
#include "helpers.h"
|
||||
#include <QObject>
|
||||
|
||||
RawSwitch er9xToSwitch(int8_t sw)
|
||||
{
|
||||
uint8_t swa = abs(sw);
|
||||
if (swa == 0)
|
||||
return RawSwitch(SWITCH_TYPE_NONE);
|
||||
else if (swa <= 9)
|
||||
return RawSwitch(SWITCH_TYPE_SWITCH, sw);
|
||||
else if (swa <= 21)
|
||||
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
|
||||
else if (sw == 22)
|
||||
return RawSwitch(SWITCH_TYPE_ON);
|
||||
else if (sw == -22)
|
||||
return RawSwitch(SWITCH_TYPE_OFF);
|
||||
else if (swa <= 22+9)
|
||||
return RawSwitch(SWITCH_TYPE_SWITCH, sw > 0 ? sw-22 : sw+22);
|
||||
else
|
||||
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-22-9 : sw+22+9);
|
||||
}
|
||||
|
||||
t_Er9xTrainerMix::t_Er9xTrainerMix()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xTrainerMix));
|
||||
}
|
||||
|
||||
t_Er9xTrainerMix::operator TrainerMix()
|
||||
{
|
||||
TrainerMix c9x;
|
||||
c9x.src = srcChn;
|
||||
c9x.swtch = er9xToSwitch(swtch);
|
||||
c9x.weight = (25 * studWeight) / 8;
|
||||
c9x.mode = mode;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Er9xTrainerData::t_Er9xTrainerData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xTrainerData));
|
||||
}
|
||||
|
||||
t_Er9xTrainerData::operator TrainerData ()
|
||||
{
|
||||
TrainerData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
c9x.calib[i] = calib[i];
|
||||
c9x.mix[i] = mix[i];
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Er9xGeneral::t_Er9xGeneral()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xGeneral));
|
||||
}
|
||||
|
||||
Er9xGeneral::operator GeneralSettings ()
|
||||
{
|
||||
GeneralSettings result;
|
||||
result.version = myVers;
|
||||
for (int i=0; i<NUM_STICKSnPOTS; i++) {
|
||||
result.calibMid[i] = calibMid[i];
|
||||
result.calibSpanNeg[i] = calibSpanNeg[i];
|
||||
result.calibSpanPos[i] = calibSpanPos[i];
|
||||
}
|
||||
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.trainer = trainer;
|
||||
result.blightinv=blightinv;
|
||||
result.stickScroll=stickScroll;
|
||||
result.crosstrim=crosstrim;
|
||||
result.hideNameOnSplash=hideNameOnSplash;
|
||||
result.enablePpmsim=enablePpmsim;
|
||||
|
||||
result.view = std::min((uint8_t)4, view);
|
||||
result.disableThrottleWarning = disableThrottleWarning;
|
||||
result.switchWarning = disableSwitchWarning ? 0 : -1;
|
||||
result.disableMemoryWarning = disableMemoryWarning;
|
||||
|
||||
switch (beeperVal) {
|
||||
case 0:
|
||||
result.beeperMode = e_quiet;
|
||||
break;
|
||||
case 1:
|
||||
result.beeperMode = e_no_keys;
|
||||
break;
|
||||
default:
|
||||
result.beeperMode = e_all;
|
||||
result.beeperLength = beeperVal - 4;
|
||||
break;
|
||||
}
|
||||
|
||||
result.disableAlarmWarning = disableAlarmWarning;
|
||||
result.stickMode = std::max((uint8_t)0, std::min(stickMode, (uint8_t)3));
|
||||
result.inactivityTimer = inactivityTimer + 10;
|
||||
result.minuteBeep = minuteBeep;
|
||||
result.preBeep = preBeep;
|
||||
result.flashBeep = flashBeep;
|
||||
result.splashMode = disableSplashScreen;
|
||||
result.disablePotScroll=(disablePotScroll==1);
|
||||
result.disableBG=(disableBG==1);
|
||||
result.frskyinternalalarm = frskyinternalalarm;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
result.backlightMode = 4;
|
||||
}
|
||||
else if (lightAutoOff) {
|
||||
result.backlightMode |= 1;
|
||||
result.backlightDelay = lightAutoOff;
|
||||
}
|
||||
else if (lightOnStickMove) {
|
||||
result.backlightMode |= 2;
|
||||
result.backlightDelay = lightOnStickMove;
|
||||
}
|
||||
|
||||
result.templateSetup = templateSetup;
|
||||
result.PPM_Multiplier = PPM_Multiplier;
|
||||
getEEPROMString(result.ownerName, ownerName, sizeof(ownerName));
|
||||
result.speakerPitch = speakerPitch;
|
||||
result.hapticStrength = hapticStrength - 3;
|
||||
result.speakerMode = speakerMode;
|
||||
result.switchWarningStates =switchWarningStates;
|
||||
return result;
|
||||
}
|
||||
|
||||
t_Er9xLimitData::t_Er9xLimitData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xLimitData));
|
||||
}
|
||||
|
||||
t_Er9xLimitData::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Er9xMixData::t_Er9xMixData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xMixData));
|
||||
}
|
||||
|
||||
t_Er9xMixData::operator MixData ()
|
||||
{
|
||||
MixData c9x;
|
||||
c9x.destCh = destCh;
|
||||
if (abs(weight)>125) {
|
||||
int gvar;
|
||||
if (weight>0) {
|
||||
gvar=weight-125;
|
||||
} else {
|
||||
gvar=weight+131;
|
||||
}
|
||||
gvar+=10000;
|
||||
c9x.weight=gvar;
|
||||
} else {
|
||||
c9x.weight = weight;
|
||||
}
|
||||
if (abs(sOffset)>125) {
|
||||
int gvar;
|
||||
if (sOffset>0) {
|
||||
gvar=sOffset-125;
|
||||
} else {
|
||||
gvar=sOffset+131;
|
||||
}
|
||||
gvar+=10000;
|
||||
c9x.sOffset=gvar;
|
||||
} else {
|
||||
c9x.sOffset=sOffset;
|
||||
}
|
||||
c9x.swtch = er9xToSwitch(swtch);
|
||||
|
||||
if (srcRaw == 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 7) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
|
||||
}
|
||||
else if (srcRaw == 8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (srcRaw == 9) {
|
||||
if (swtch < 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch < -3 ? -swtch-3 : -swtch);
|
||||
c9x.weight = -weight;
|
||||
}
|
||||
else if (swtch > 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch > 3 ? swtch-3 : swtch);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
if (mltpx != MLTPX_REP)
|
||||
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 12) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
|
||||
}
|
||||
else if (srcRaw <= 20) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
|
||||
}
|
||||
else if (srcRaw <=37) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_GVAR, srcRaw-38);
|
||||
}
|
||||
|
||||
if (differential==1) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_DIFF;
|
||||
c9x.curve.value = differential;
|
||||
}
|
||||
else if (curve > 6) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
|
||||
c9x.curve.value = curve - 6;
|
||||
}
|
||||
else if (curve > 0) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
|
||||
c9x.curve.value = curve;
|
||||
}
|
||||
|
||||
// c9x.lateOffset=lateOffset;
|
||||
c9x.delayUp = delayUp;
|
||||
c9x.delayDown = delayDown;
|
||||
c9x.speedUp = speedUp;
|
||||
c9x.speedDown = speedDown;
|
||||
c9x.carryTrim = carryTrim;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
// c9x.enableFmTrim=enableFmTrim;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
RawSource er9xToSource(int8_t value)
|
||||
{
|
||||
if (value == 0) {
|
||||
return RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (value <= 7) {
|
||||
return RawSource(SOURCE_TYPE_STICK, value - 1);
|
||||
}
|
||||
else if (value == 8) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (value == 9) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (value <= 12) {
|
||||
return RawSource(SOURCE_TYPE_CYC, value-10);
|
||||
}
|
||||
else if (value <= 20) {
|
||||
return RawSource(SOURCE_TYPE_PPM, value-13);
|
||||
}
|
||||
else if (value <= 36) {
|
||||
return RawSource(SOURCE_TYPE_CH, value-21);
|
||||
}
|
||||
else {
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
|
||||
}
|
||||
}
|
||||
|
||||
Er9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
{
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = er9xToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = er9xToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = er9xToSwitch(v1).toValue();
|
||||
c9x.val2 = er9xToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
|
||||
t_Er9xSafetySwData::t_Er9xSafetySwData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xSafetySwData));
|
||||
}
|
||||
|
||||
t_Er9xFrSkyChannelData::t_Er9xFrSkyChannelData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xFrSkyChannelData));
|
||||
}
|
||||
|
||||
t_Er9xFrSkyChannelData::operator FrSkyChannelData ()
|
||||
{
|
||||
FrSkyChannelData c9x;
|
||||
c9x.ratio = ratio;
|
||||
c9x.alarms[0].value = alarms_value[0];
|
||||
c9x.alarms[0].level = alarms_level & 3;
|
||||
c9x.alarms[0].greater = alarms_greater & 1;
|
||||
c9x.alarms[1].value = alarms_value[1];
|
||||
c9x.alarms[1].level = (alarms_level >> 2) & 3;
|
||||
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
|
||||
if (type==2) {
|
||||
c9x.type = 0;
|
||||
c9x.multiplier=1;
|
||||
} else {
|
||||
c9x.type = type;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Er9xFrSkyData::t_Er9xFrSkyData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xFrSkyData));
|
||||
}
|
||||
|
||||
t_Er9xFrSkyData::operator FrSkyData ()
|
||||
{
|
||||
FrSkyData c9x;
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
return c9x;
|
||||
}
|
||||
|
||||
RawSwitch getEr9xTimerMode(int mode)
|
||||
{
|
||||
/*
|
||||
if (mode <= -33)
|
||||
return TimerMode(TMRMODE_FIRST_NEG_SWITCH+(mode+33));
|
||||
else if (mode <= -1)
|
||||
return TimerMode(TMRMODE_FIRST_NEG_SWITCH+(mode+1));
|
||||
else if (mode < 16)
|
||||
return TimerMode(mode);
|
||||
else if (mode < 16+21)
|
||||
return TimerMode(TMRMODE_FIRST_SWITCH+(mode-16));
|
||||
else
|
||||
return TimerMode(TMRMODE_FIRST_SWITCH+(mode-16-21));
|
||||
*/
|
||||
return RawSwitch();
|
||||
}
|
||||
|
||||
t_Er9xModelData::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
|
||||
c9x.timers[0].val = tmrVal;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.funcSw[0].func = FuncInstantTrim;
|
||||
if (trimSw) {
|
||||
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
|
||||
}
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.swashRingData.invertELE = swashInvertELE;
|
||||
c9x.swashRingData.invertAIL = swashInvertAIL;
|
||||
c9x.swashRingData.invertCOL = swashInvertCOL;
|
||||
c9x.swashRingData.type = swashType;
|
||||
c9x.swashRingData.collectiveSource = er9xToSource(swashCollectiveSource);
|
||||
c9x.swashRingData.value = swashRingValue;
|
||||
|
||||
for (int i=0; i<ER9X_MAX_MIXERS; i++) {
|
||||
Er9xMixData mix = mixData[i];
|
||||
c9x.mixData[i] = mix;
|
||||
}
|
||||
|
||||
for (int i=0; i<ER9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
|
||||
// expoData
|
||||
int e = 0;
|
||||
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
|
||||
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
|
||||
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
|
||||
dr = 2;
|
||||
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
|
||||
break;
|
||||
if (expoData[ch].drSw1 && !expoData[ch].drSw2) {
|
||||
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? expoData[ch].drSw1 : 0);
|
||||
pos = dr == 0 ? 1 : 0;
|
||||
}
|
||||
else {
|
||||
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? -expoData[ch].drSw1 : (dr == 1 ? -expoData[ch].drSw2 : 0));
|
||||
}
|
||||
c9x.expoData[e].chn = ch;
|
||||
if (expoData[ch].expo[pos][0][0]) {
|
||||
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
|
||||
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][0];
|
||||
}
|
||||
c9x.expoData[e].weight = 100 + expoData[ch].expo[pos][1][0];
|
||||
if (expoData[ch].expo[pos][0][0] == expoData[ch].expo[pos][0][1] && expoData[ch].expo[pos][1][0] == expoData[ch].expo[pos][1][1]) {
|
||||
c9x.expoData[e++].mode = 3;
|
||||
}
|
||||
else {
|
||||
c9x.expoData[e].mode = 2;
|
||||
if (e < C9X_MAX_EXPOS - 1) {
|
||||
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
|
||||
c9x.expoData[++e].chn = ch;
|
||||
c9x.expoData[e].mode = 1;
|
||||
if (expoData[ch].expo[pos][0][1]) {
|
||||
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
|
||||
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][1];
|
||||
}
|
||||
c9x.expoData[e++].weight = 100 + expoData[ch].expo[pos][1][1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ER9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<ER9X_MAX_CURVE9; i++) {
|
||||
c9x.curves[ER9X_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[ER9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[ER9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<ER9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
|
||||
// for (int i=0; i<ER9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef er9xeeprom_h
|
||||
#define er9xeeprom_h
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
//eeprom data
|
||||
#define ER9X_MAX_MIXERS 32
|
||||
#define ER9X_MAX_CURVE5 8
|
||||
#define ER9X_MAX_CURVE9 8
|
||||
#define ER9X_MAX_CSFUNC 13
|
||||
|
||||
#define MDVERS 10
|
||||
|
||||
#define ER9X_NUM_CHNOUT 16 //number of real outputchannels CH1-CH8
|
||||
#define ER9X_NUM_CSW 12 //number of custom switches
|
||||
#define NUM_STICKSnPOTS 7 //number of sticks and pots
|
||||
#define ER9X_MAX_GVARS 7
|
||||
|
||||
#define ER9X_MAX_MODES 4
|
||||
|
||||
PACK(typedef struct t_Er9xTrainerMix {
|
||||
uint8_t srcChn:3; //0-7 = ch1-8
|
||||
int8_t swtch:5;
|
||||
int8_t studWeight:6;
|
||||
uint8_t mode:2; // off, add-mode, subst-mode
|
||||
|
||||
operator TrainerMix();
|
||||
t_Er9xTrainerMix();
|
||||
}) Er9xTrainerMix; //
|
||||
|
||||
PACK(typedef struct t_Er9xTrainerData {
|
||||
int16_t calib[4];
|
||||
Er9xTrainerMix mix[4];
|
||||
|
||||
operator TrainerData();
|
||||
t_Er9xTrainerData();
|
||||
}) Er9xTrainerData;
|
||||
|
||||
PACK(typedef struct t_Er9xGeneral {
|
||||
uint8_t myVers;
|
||||
int16_t calibMid[NUM_STICKSnPOTS];
|
||||
int16_t calibSpanNeg[NUM_STICKSnPOTS];
|
||||
int16_t calibSpanPos[NUM_STICKSnPOTS];
|
||||
uint16_t chkSum;
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t lightSw;
|
||||
Er9xTrainerData trainer;
|
||||
uint8_t view;
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t disableSwitchWarning:1;
|
||||
uint8_t disableMemoryWarning:1;
|
||||
uint8_t beeperVal:3;
|
||||
uint8_t reserveWarning:1;
|
||||
uint8_t disableAlarmWarning:1;
|
||||
uint8_t stickMode;
|
||||
int8_t inactivityTimer;
|
||||
uint8_t throttleReversed:1;
|
||||
uint8_t minuteBeep:1;
|
||||
uint8_t preBeep:1;
|
||||
uint8_t flashBeep:1;
|
||||
uint8_t disableSplashScreen:1;
|
||||
uint8_t disablePotScroll:1;
|
||||
uint8_t disableBG:1;
|
||||
uint8_t frskyinternalalarm:1;
|
||||
uint8_t spare_filter ; // No longer needed, left for eepe compatibility for now
|
||||
uint8_t lightAutoOff;
|
||||
uint8_t templateSetup; //RETA order according to chout_ar array
|
||||
int8_t PPM_Multiplier;
|
||||
uint8_t unused1;
|
||||
uint8_t unused2:4;
|
||||
uint8_t hideNameOnSplash:1;
|
||||
uint8_t enablePpmsim:1;
|
||||
uint8_t blightinv:1;
|
||||
uint8_t stickScroll:1;
|
||||
uint8_t speakerPitch;
|
||||
uint8_t hapticStrength;
|
||||
uint8_t speakerMode;
|
||||
uint8_t lightOnStickMove;
|
||||
|
||||
char ownerName[10];
|
||||
uint8_t switchWarningStates;
|
||||
uint8_t volume ;
|
||||
uint8_t res[3];
|
||||
uint8_t crosstrim:1;
|
||||
uint8_t spare1:7;
|
||||
|
||||
operator GeneralSettings();
|
||||
t_Er9xGeneral();
|
||||
}) Er9xGeneral;
|
||||
|
||||
PACK(typedef struct t_Er9xExpoData {
|
||||
int8_t expo[3][2][2];
|
||||
int8_t drSw1;
|
||||
int8_t drSw2;
|
||||
|
||||
t_Er9xExpoData() { memset(this, 0, sizeof(t_Er9xExpoData)); }
|
||||
}) Er9xExpoData;
|
||||
|
||||
|
||||
PACK(typedef struct t_Er9xLimitData {
|
||||
int8_t min;
|
||||
int8_t max;
|
||||
bool revert;
|
||||
int16_t offset;
|
||||
|
||||
operator LimitData();
|
||||
t_Er9xLimitData();
|
||||
}) Er9xLimitData;
|
||||
|
||||
#define MLTPX_ADD 0
|
||||
#define MLTPX_MUL 1
|
||||
#define MLTPX_REP 2
|
||||
|
||||
PACK(typedef struct t_Er9xMixData {
|
||||
uint8_t destCh; // 1..C9X_NUM_CHNOUT
|
||||
uint8_t srcRaw; //
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t curve; //0=symmetrisch 1=no neg 2=no pos
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint8_t carryTrim:1;
|
||||
uint8_t mltpx:2; // multiplex method 0=+ 1=* 2=replace
|
||||
uint8_t lateOffset:1; // Add offset later
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t enableFmTrim:1;
|
||||
uint8_t differential:1;
|
||||
int8_t sOffset;
|
||||
int8_t res;
|
||||
|
||||
operator MixData();
|
||||
t_Er9xMixData();
|
||||
}) Er9xMixData;
|
||||
|
||||
|
||||
PACK(typedef struct t_Er9xLogicalSwitchData { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func:4;
|
||||
uint8_t andsw:4;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Er9xLogicalSwitchData() { memset(this, 0, sizeof(t_Er9xLogicalSwitchData)); }
|
||||
}) Er9xLogicalSwitchData;
|
||||
|
||||
PACK(typedef struct t_Er9xSafetySwData { // Custom Switches data
|
||||
int8_t swtch;
|
||||
int8_t val;
|
||||
|
||||
t_Er9xSafetySwData();
|
||||
}) Er9xSafetySwData;
|
||||
|
||||
PACK(typedef struct t_Er9xFrSkyChannelData {
|
||||
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_level:4;
|
||||
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
|
||||
uint8_t type:2; // future use: 0=volts, ...
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Er9xFrSkyChannelData();
|
||||
}) Er9xFrSkyChannelData;
|
||||
|
||||
PACK(typedef struct t_Er9xFrSkyData {
|
||||
Er9xFrSkyChannelData channels[2];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Er9xFrSkyData();
|
||||
}) Er9xFrSkyData;
|
||||
|
||||
PACK(typedef struct t_gvar {
|
||||
int8_t gvar ;
|
||||
uint8_t gvsource ;
|
||||
// int8_t gvswitch ;
|
||||
}) Er9xGvarData ;
|
||||
|
||||
PACK(typedef struct t_FlightModeData {
|
||||
// Trim store as -1001 to -1, trim value-501, 0-5 use trim of phase 0-5
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of modes 1|2|3|4 instead
|
||||
int8_t swtch; // Try 0-5 use trim of phase 0-5, 1000-2000, trim + 1500 ???
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
}) Er9xFlightModeData;
|
||||
|
||||
PACK(typedef struct t_Er9xModelData {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
uint8_t modelVoice ; // Index to model name voice (260+value)
|
||||
int8_t tmrMode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint8_t tmrDir:1; //0=>Count Down, 1=>Count Up
|
||||
uint8_t traineron:1; // 0 disable trainer, 1 allow trainer
|
||||
uint8_t t2throttle:1 ; // Start timer2 using throttle
|
||||
uint8_t FrSkyUsrProto:1 ; // Protocol in FrSky User Data, 0=FrSky Hub, 1=WS HowHigh
|
||||
uint8_t FrSkyGpsAlt:1 ; // Use Gps Altitude as main altitude reading
|
||||
uint8_t FrSkyImperial:1 ; // Convert FrSky values to imperial units
|
||||
uint8_t FrSkyAltAlarm:2;
|
||||
uint16_t tmrVal;
|
||||
uint8_t protocol;
|
||||
int8_t ppmNCH;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
uint8_t xnumBlades:2; // RPM scaling
|
||||
uint8_t spare10:1;
|
||||
uint8_t thrExpo:1; // Enable Throttle Expo
|
||||
uint8_t ppmStart:3 ; // Start channel for PPM
|
||||
int8_t trimInc; // Trim Increments
|
||||
int8_t ppmDelay;
|
||||
int8_t trimSw;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t swashInvertELE:1;
|
||||
uint8_t swashInvertAIL:1;
|
||||
uint8_t swashInvertCOL:1;
|
||||
uint8_t swashType:3;
|
||||
uint8_t swashCollectiveSource;
|
||||
uint8_t swashRingValue;
|
||||
int8_t ppmFrameLength;
|
||||
Er9xMixData mixData[ER9X_MAX_MIXERS];
|
||||
Er9xLimitData limitData[ER9X_NUM_CHNOUT];
|
||||
Er9xExpoData expoData[4];
|
||||
int8_t trim[4];
|
||||
int8_t curves5[ER9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ER9X_MAX_CURVE9][9];
|
||||
Er9xLogicalSwitchData customSw[ER9X_NUM_CSW];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
int8_t tmrModeB;
|
||||
uint8_t numVoice;
|
||||
Er9xSafetySwData safetySw[ER9X_NUM_CHNOUT];
|
||||
Er9xFrSkyData frsky;
|
||||
uint8_t numBlades ;
|
||||
uint8_t unused1[8] ;
|
||||
uint8_t CustomDisplayIndex[6] ;
|
||||
Er9xGvarData gvars[ER9X_MAX_GVARS] ;
|
||||
Er9xFlightModeData flightModeData[ER9X_MAX_MODES] ;
|
||||
|
||||
operator ModelData();
|
||||
t_Er9xModelData() { memset(this, 0, sizeof(t_Er9xModelData)); }
|
||||
}) Er9xModelData;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,323 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 <iostream>
|
||||
#include "er9xinterface.h"
|
||||
#include "er9xeeprom.h"
|
||||
#include "er9xsimulator.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
|
||||
#define FILE_GENERAL 0
|
||||
#define FILE_MODEL(n) (1+n)
|
||||
|
||||
Er9xInterface::Er9xInterface():
|
||||
EEPROMInterface(BOARD_STOCK),
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
||||
Er9xInterface::~Er9xInterface()
|
||||
{
|
||||
delete efile;
|
||||
}
|
||||
|
||||
const char * Er9xInterface::getName()
|
||||
{
|
||||
return "Er9x";
|
||||
}
|
||||
|
||||
const int Er9xInterface::getEEpromSize()
|
||||
{
|
||||
QString avrMCU = g.mcu();
|
||||
if (avrMCU==QString("m128")) {
|
||||
return 2*EESIZE_STOCK;
|
||||
}
|
||||
return EESIZE_STOCK;
|
||||
}
|
||||
|
||||
const int Er9xInterface::getMaxModels()
|
||||
{
|
||||
return 16;
|
||||
}
|
||||
|
||||
inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
|
||||
{
|
||||
for (int i=0; i<2; i++) {
|
||||
int stick = applyStickMode(i+1, mode) - 1;
|
||||
{
|
||||
int tmp = model.trim[i];
|
||||
model.trim[i] = model.trim[stick];
|
||||
model.trim[stick] = tmp;
|
||||
}
|
||||
{
|
||||
Er9xExpoData tmp = model.expoData[i];
|
||||
model.expoData[i] = model.expoData[stick];
|
||||
model.expoData[stick] = tmp;
|
||||
}
|
||||
}
|
||||
for (int i=0; i<ER9X_MAX_MIXERS; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ER9X_NUM_CSW; i++) {
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
|
||||
}
|
||||
|
||||
bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
std::cout << "trying er9x xml import... ";
|
||||
|
||||
Er9xGeneral er9xGeneral;
|
||||
memset(&er9xGeneral,0,sizeof(er9xGeneral));
|
||||
if(!loadGeneralDataXML(&doc, &er9xGeneral)) {
|
||||
return false;
|
||||
} else {
|
||||
radioData.generalSettings=er9xGeneral;
|
||||
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
|
||||
}
|
||||
for(int i=0; i<getMaxModels(); i++)
|
||||
{
|
||||
Er9xModelData er9xModel;
|
||||
memset(&er9xModel,0,sizeof(er9xModel));
|
||||
if(loadModelDataXML(&doc, &er9xModel, i)) {
|
||||
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
|
||||
radioData.models[i] = er9xModel;
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying er9x import... ";
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
Er9xGeneral er9xGeneral;
|
||||
|
||||
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
|
||||
|
||||
switch(er9xGeneral.myVers) {
|
||||
case 3:
|
||||
std::cout << "(old gruvin9x) ";
|
||||
case 4:
|
||||
// case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
break;
|
||||
default:
|
||||
std::cout << "not er9x\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
}
|
||||
radioData.generalSettings = er9xGeneral;
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
Er9xModelData er9xModel;
|
||||
efile->openRd(FILE_MODEL(i));
|
||||
if (!efile->readRlc1((uint8_t*)&er9xModel, sizeof(Er9xModelData))) {
|
||||
radioData.models[i].clear();
|
||||
}
|
||||
else {
|
||||
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
|
||||
radioData.models[i] = er9xModel;
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
{
|
||||
std::cout << "NO!\n";
|
||||
// TODO an error
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Er9xInterface::getSize(ModelData &model)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Er9xInterface::getSize(GeneralSettings &settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Er9xInterface::isAvailable(Protocol prot, int port)
|
||||
{
|
||||
switch (prot) {
|
||||
case PPM:
|
||||
case DSM2:
|
||||
case PXX_DJT:
|
||||
case PPM16:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Er9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value)
|
||||
{
|
||||
QDomElement e = qdoc->createElement(name);
|
||||
QDomText t = qdoc->createTextNode(name);
|
||||
t.setNodeValue(value);
|
||||
e.appendChild(t);
|
||||
pe->appendChild(e);
|
||||
}
|
||||
|
||||
void Er9xInterface::appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite)
|
||||
{
|
||||
if(value || forceZeroWrite) {
|
||||
QDomElement e = qdoc->createElement(name);
|
||||
QDomText t = qdoc->createTextNode(name);
|
||||
t.setNodeValue(QString("%1").arg(value));
|
||||
e.appendChild(t);
|
||||
pe->appendChild(e);
|
||||
}
|
||||
}
|
||||
|
||||
void Er9xInterface::appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size)
|
||||
{
|
||||
QDomElement e = qdoc->createElement(name);
|
||||
QDomCDATASection t = qdoc->createCDATASection(name);
|
||||
t.setData(QByteArray(data, size).toBase64());
|
||||
e.appendChild(t);
|
||||
pe->appendChild(e);
|
||||
}
|
||||
|
||||
QDomElement Er9xInterface::getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
|
||||
{
|
||||
QDomElement gd = qdoc->createElement("GENERAL_DATA");
|
||||
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Er9xGeneral));
|
||||
return gd;
|
||||
}
|
||||
|
||||
QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum, int mdver)
|
||||
{
|
||||
QDomElement md = qdoc->createElement("MODEL_DATA");
|
||||
md.setAttribute("number", modelNum);
|
||||
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Er9xModelData));
|
||||
return md;
|
||||
}
|
||||
|
||||
bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
|
||||
{
|
||||
//look for "GENERAL_DATA" tag
|
||||
QDomElement gde = qdoc->elementsByTagName("GENERAL_DATA").at(0).toElement();
|
||||
|
||||
if(gde.isNull()) // couldn't find
|
||||
return false;
|
||||
|
||||
//load cdata into tgen
|
||||
QDomNode n = gde.elementsByTagName("Data").at(0).firstChild();// get all children in Data
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
const char * data = ba.data();
|
||||
memcpy(tgen, data, sizeof(Er9xGeneral));
|
||||
break;
|
||||
}
|
||||
n = n.nextSibling();
|
||||
}
|
||||
//check version?
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum)
|
||||
{
|
||||
//look for MODEL_DATA with modelNum attribute.
|
||||
//if modelNum = -1 then just pick the first one
|
||||
QDomNodeList ndl = qdoc->elementsByTagName("MODEL_DATA");
|
||||
|
||||
//cycle through nodes to find correct model number
|
||||
QDomNode k = ndl.at(0);
|
||||
if(modelNum>=0) {
|
||||
while(!k.isNull()) {
|
||||
int a = k.toElement().attribute("number").toInt();
|
||||
if(a==modelNum)
|
||||
break;
|
||||
k = k.nextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
if(k.isNull()) // couldn't find
|
||||
return false;
|
||||
|
||||
|
||||
//load cdata into tgen
|
||||
QDomNode n = k.toElement().elementsByTagName("Data").at(0).firstChild();// get all children in Data
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
const char * data = ba.data();
|
||||
memcpy(tmod, data, sizeof(Er9xModelData));
|
||||
break;
|
||||
}
|
||||
n = n.nextSibling();
|
||||
}
|
||||
//check version?
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef er9x_interface_h
|
||||
#define er9x_interface_h
|
||||
#include <QtXml>
|
||||
#include "eeprominterface.h"
|
||||
#include "er9xeeprom.h"
|
||||
class RleFile;
|
||||
|
||||
class Er9xInterface : public EEPROMInterface
|
||||
{
|
||||
public:
|
||||
|
||||
Er9xInterface();
|
||||
|
||||
virtual ~Er9xInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
virtual const int getEEpromSize();
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
RleFile *efile;
|
||||
|
||||
private:
|
||||
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
|
||||
|
||||
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
|
||||
|
||||
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
|
||||
|
||||
QDomElement getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); //parse out data to XML format
|
||||
|
||||
QDomElement getModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum, int mdver); //parse out data to XML format
|
||||
|
||||
bool loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); // get data from XML
|
||||
|
||||
bool loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum = -1); // get data from XML
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,224 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 "firmwares/er9x/er9xsimulator.h"
|
||||
#include "firmwares/er9x/er9xinterface.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define FRSKY
|
||||
#define PHASES
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define SWSRC_SW1 DSW_SW1
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Er9x {
|
||||
|
||||
#include "simpgmspace.h"
|
||||
#include "er9x.cpp"
|
||||
#include "stamp.cpp"
|
||||
#include "menus.cpp"
|
||||
#include "pers.cpp"
|
||||
#include "file.cpp"
|
||||
#include "lcd.cpp"
|
||||
#include "drivers.cpp"
|
||||
#include "simpgmspace.cpp"
|
||||
#include "templates.cpp"
|
||||
#include "frsky.cpp"
|
||||
#include "audio.cpp"
|
||||
|
||||
uint8_t pxxFlag = 0;
|
||||
int16_t g_anas[7];
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 1500;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void setTrim(uint8_t idx, int8_t value)
|
||||
{
|
||||
g_model.trim[idx] = value;
|
||||
}
|
||||
|
||||
void getTrims(int16_t values[4])
|
||||
{
|
||||
for (int i=0; i<4; i++)
|
||||
values[i] = g_model.trim[i];
|
||||
}
|
||||
|
||||
#define GPIO_TRIM_LH_L pind
|
||||
#define GPIO_TRIM_LV_DN pind
|
||||
#define GPIO_TRIM_RV_UP pind
|
||||
#define GPIO_TRIM_RH_L pind
|
||||
#define GPIO_TRIM_LH_R pind
|
||||
#define GPIO_TRIM_LV_UP pind
|
||||
#define GPIO_TRIM_RV_DN pind
|
||||
#define GPIO_TRIM_RH_R pind
|
||||
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
|
||||
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
|
||||
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
|
||||
#define PIN_TRIM_RH_L (1<<INP_D_TRM_RH_DWN)
|
||||
#define PIN_TRIM_LH_R (1<<INP_D_TRM_LH_UP)
|
||||
#define PIN_TRIM_LV_UP (1<<INP_D_TRM_LV_UP)
|
||||
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
|
||||
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
|
||||
|
||||
#define TRIM_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
if (state) pin |= mask; else pin &= ~mask;\
|
||||
break;
|
||||
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
switch (trim) {
|
||||
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
|
||||
}
|
||||
}
|
||||
|
||||
#define SWITCH_CASE(swtch, pin, mask) \
|
||||
case swtch: \
|
||||
if (state) pin &= ~(mask); else pin |= (mask); \
|
||||
break;
|
||||
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
|
||||
case swtch: \
|
||||
if (state >= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
|
||||
if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
|
||||
break;
|
||||
|
||||
void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
{
|
||||
switch (swtch) {
|
||||
SWITCH_CASE(0, pinc, 1<<INP_C_ThrCt)
|
||||
SWITCH_CASE(4, pinc, 1<<INP_C_AileDR)
|
||||
SWITCH_3_CASE(3, ping, pine, (1<<INP_G_ID1), (1<<INP_E_ID2))
|
||||
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
|
||||
SWITCH_CASE(2, pine, 1<<INP_E_ElevDR)
|
||||
SWITCH_CASE(5, pine, 1<<INP_E_Gear)
|
||||
SWITCH_CASE(6, pine, 1<<INP_E_Trainer)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define KEY_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
if (state) pin |= mask; else pin &= ~mask;\
|
||||
break;
|
||||
|
||||
void simuSetKey(uint8_t key, bool state)
|
||||
{
|
||||
switch (key) {
|
||||
KEY_CASE(KEY_MENU, pinb, (1<<INP_B_KEY_MEN))
|
||||
KEY_CASE(KEY_EXIT, pinb, (1<<INP_B_KEY_EXT))
|
||||
KEY_CASE(KEY_RIGHT, pinb, (1<<INP_B_KEY_RGT))
|
||||
KEY_CASE(KEY_LEFT, pinb, (1<<INP_B_KEY_LFT))
|
||||
KEY_CASE(KEY_UP, pinb, (1<<INP_B_KEY_UP))
|
||||
KEY_CASE(KEY_DOWN, pinb, (1<<INP_B_KEY_DWN))
|
||||
}
|
||||
}
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
}
|
||||
|
||||
using namespace Er9x;
|
||||
|
||||
Er9xSimulator::Er9xSimulator(Er9xInterface * er9xInterface):
|
||||
er9xInterface(er9xInterface)
|
||||
{
|
||||
}
|
||||
|
||||
bool Er9xSimulator::timer10ms()
|
||||
{
|
||||
AUDIO_DRIVER(); // the tone generator
|
||||
AUDIO_HEARTBEAT(); // the queue processing
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Er9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Er9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Er9xSimulator::start(RadioData &radioData, bool tests)
|
||||
{
|
||||
er9xInterface->save(&eeprom[0], radioData);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Er9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
}
|
||||
|
||||
void Er9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
outputs.beep = audio.busy();
|
||||
}
|
||||
|
||||
void Er9xSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Er9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
Er9x::setTrim(idx, value);
|
||||
}
|
||||
|
||||
void Er9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
trims.extended = false;
|
||||
Er9x::getTrims(trims.values);
|
||||
}
|
||||
|
||||
const char * Er9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef er9x_simulator_h
|
||||
#define er9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Er9xInterface;
|
||||
|
||||
class Er9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Er9xSimulator(Er9xInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase() { return 0; }
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
||||
|
||||
virtual void wheelEvent(uint8_t steps) { }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
protected:
|
||||
|
||||
Er9xInterface * er9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,728 @@
|
||||
#include <algorithm>
|
||||
#include "helpers.h"
|
||||
#include "ersky9xeeprom.h"
|
||||
#include <QObject>
|
||||
|
||||
extern RawSwitch er9xToSwitch(int8_t sw);
|
||||
|
||||
RawSwitch getErSky9xTimerMode(int mode)
|
||||
{
|
||||
if (mode<4)
|
||||
return RawSwitch(SWITCH_TYPE_TIMER_MODE, mode);
|
||||
else
|
||||
return RawSwitch();
|
||||
}
|
||||
|
||||
RawSwitch ersky9xToSwitch(int8_t sw)
|
||||
{
|
||||
uint8_t swa = abs(sw);
|
||||
if (swa == 0)
|
||||
return RawSwitch(SWITCH_TYPE_NONE);
|
||||
else if (swa <= 9)
|
||||
return RawSwitch(SWITCH_TYPE_SWITCH, sw);
|
||||
else if (swa <= 33)
|
||||
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
|
||||
else if (sw == 34)
|
||||
return RawSwitch(SWITCH_TYPE_ON);
|
||||
else if (sw == -34)
|
||||
return RawSwitch(SWITCH_TYPE_OFF);
|
||||
else if (swa <= 34+9)
|
||||
return RawSwitch(SWITCH_TYPE_SWITCH, sw > 0 ? sw-34 : sw+34);
|
||||
else
|
||||
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-34-9 : sw+34+9);
|
||||
}
|
||||
|
||||
t_Ersky9xTrainerMix::t_Ersky9xTrainerMix()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xTrainerMix));
|
||||
}
|
||||
|
||||
t_Ersky9xTrainerMix::operator TrainerMix()
|
||||
{
|
||||
TrainerMix c9x;
|
||||
c9x.src = srcChn;
|
||||
c9x.swtch = er9xToSwitch(swtch);
|
||||
c9x.weight = (25 * studWeight) / 8;
|
||||
c9x.mode = mode;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xTrainerData::t_Ersky9xTrainerData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xTrainerData));
|
||||
}
|
||||
|
||||
t_Ersky9xTrainerData::operator TrainerData ()
|
||||
{
|
||||
TrainerData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
c9x.calib[i] = calib[i];
|
||||
c9x.mix[i] = mix[i];
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xGeneral::t_Ersky9xGeneral()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xGeneral));
|
||||
}
|
||||
|
||||
Ersky9xGeneral::operator GeneralSettings ()
|
||||
{
|
||||
GeneralSettings result;
|
||||
|
||||
result.version = myVers;
|
||||
|
||||
for (int i=0; i<NUM_STICKSnPOTS; i++) {
|
||||
result.calibMid[i] = calibMid[i];
|
||||
result.calibSpanNeg[i] = calibSpanNeg[i];
|
||||
result.calibSpanPos[i] = calibSpanPos[i];
|
||||
}
|
||||
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
result.backlightMode = 4;
|
||||
}
|
||||
else if (lightAutoOff) {
|
||||
result.backlightMode |= 1;
|
||||
result.backlightDelay = lightAutoOff;
|
||||
}
|
||||
else if (lightOnStickMove) {
|
||||
result.backlightMode |= 2;
|
||||
result.backlightDelay = lightOnStickMove;
|
||||
}
|
||||
|
||||
result.trainer = trainer;
|
||||
result.view = std::min((uint8_t)4, view);
|
||||
result.disableThrottleWarning = disableThrottleWarning;
|
||||
result.switchWarning = disableSwitchWarning ? 0 : -1;
|
||||
result.disableMemoryWarning = disableMemoryWarning;
|
||||
|
||||
switch (beeperVal) {
|
||||
case 0:
|
||||
result.beeperMode = e_quiet;
|
||||
break;
|
||||
case 1:
|
||||
result.beeperMode = e_no_keys;
|
||||
break;
|
||||
default:
|
||||
result.beeperMode = e_all;
|
||||
result.beeperLength = beeperVal - 4;
|
||||
break;
|
||||
}
|
||||
|
||||
result.disableAlarmWarning = disableAlarmWarning;
|
||||
result.stickMode = std::max((uint8_t)0, std::min(stickMode, (uint8_t)3));
|
||||
result.inactivityTimer = inactivityTimer + 10;
|
||||
result.minuteBeep = minuteBeep;
|
||||
result.preBeep = preBeep;
|
||||
result.flashBeep = flashBeep;
|
||||
result.splashMode = disableSplashScreen;
|
||||
result.disablePotScroll=(disablePotScroll==1);
|
||||
result.disableBG=(disableBG==1);
|
||||
result.templateSetup = templateSetup;
|
||||
result.PPM_Multiplier = PPM_Multiplier;
|
||||
getEEPROMString(result.ownerName, ownerName, sizeof(ownerName));
|
||||
result.optrexDisplay = optrexDisplay;
|
||||
result.speakerPitch = speakerPitch;
|
||||
result.hapticStrength = hapticStrength - 3;
|
||||
result.speakerMode = speakerMode;
|
||||
result.switchWarningStates = switchWarningStates;
|
||||
result.speakerVolume = volume;
|
||||
result.backlightBright = bright ;
|
||||
result.currentCalib = current_calib;
|
||||
return result;
|
||||
}
|
||||
|
||||
t_Ersky9xLimitData::t_Ersky9xLimitData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xLimitData));
|
||||
}
|
||||
|
||||
t_Ersky9xLimitData::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xMixData_v10::t_Ersky9xMixData_v10()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xMixData_v10));
|
||||
}
|
||||
|
||||
t_Ersky9xMixData_v10::operator MixData ()
|
||||
{
|
||||
MixData c9x;
|
||||
c9x.destCh = destCh;
|
||||
c9x.weight = weight;
|
||||
c9x.swtch = er9xToSwitch(swtch);
|
||||
|
||||
if (srcRaw == 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 7) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
|
||||
}
|
||||
else if (srcRaw == 8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (srcRaw == 9) {
|
||||
if (swtch < 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch < -3 ? -swtch-3 : -swtch);
|
||||
c9x.weight = -weight;
|
||||
}
|
||||
else if (swtch > 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch > 3 ? swtch-3 : swtch);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
if (mltpx != MLTPX_REP)
|
||||
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw == 37) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 12) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
|
||||
}
|
||||
else if (srcRaw <= 20) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
|
||||
}
|
||||
|
||||
if (curve > 6) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
|
||||
c9x.curve.value = curve - 6;
|
||||
}
|
||||
else if (curve > 0) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
|
||||
c9x.curve.value = curve;
|
||||
}
|
||||
|
||||
c9x.delayUp = delayUp;
|
||||
c9x.delayDown = delayDown;
|
||||
c9x.speedUp = speedUp;
|
||||
c9x.speedDown = speedDown;
|
||||
c9x.carryTrim = carryTrim;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
// c9x.enableFmTrim=enableFmTrim;
|
||||
c9x.sOffset = sOffset;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
|
||||
t_Ersky9xMixData_v11::t_Ersky9xMixData_v11()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xMixData_v11));
|
||||
}
|
||||
|
||||
t_Ersky9xMixData_v11::operator MixData ()
|
||||
{
|
||||
MixData c9x;
|
||||
c9x.destCh = destCh;
|
||||
c9x.weight = weight;
|
||||
c9x.swtch = ersky9xToSwitch(swtch);
|
||||
|
||||
if (srcRaw == 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 7) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
|
||||
}
|
||||
else if (srcRaw == 8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (srcRaw == 9) {
|
||||
if (swtch < 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch < -3 ? -swtch-3 : -swtch);
|
||||
c9x.weight = -weight;
|
||||
}
|
||||
else if (swtch > 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch > 3 ? swtch-3 : swtch);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
if (mltpx != MLTPX_REP)
|
||||
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw == 45) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw > 45) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_GVAR, srcRaw-46);
|
||||
}
|
||||
else if (srcRaw <= 12) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
|
||||
}
|
||||
else if (srcRaw <= 20) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
|
||||
}
|
||||
|
||||
if (curve > 6) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
|
||||
c9x.curve.value = curve - 6;
|
||||
}
|
||||
else if (curve > 0) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
|
||||
c9x.curve.value = curve;
|
||||
}
|
||||
|
||||
c9x.delayUp = delayUp;
|
||||
c9x.delayDown = delayDown;
|
||||
c9x.speedUp = speedUp;
|
||||
c9x.speedDown = speedDown;
|
||||
c9x.carryTrim = carryTrim;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
// c9x.enableFmTrim=enableFmTrim;
|
||||
c9x.sOffset = sOffset;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
RawSource ersky9xToSource_v10(int8_t value)
|
||||
{
|
||||
if (value == 0) {
|
||||
return RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (value <= 7) {
|
||||
return RawSource(SOURCE_TYPE_STICK, value - 1);
|
||||
}
|
||||
else if (value == 8) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (value == 9) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (value <= 12) {
|
||||
return RawSource(SOURCE_TYPE_CYC, value-10);
|
||||
}
|
||||
else if (value <= 20) {
|
||||
return RawSource(SOURCE_TYPE_PPM, value-13);
|
||||
}
|
||||
else if (value <= 36) {
|
||||
return RawSource(SOURCE_TYPE_CH, value-21);
|
||||
}
|
||||
else {
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
|
||||
}
|
||||
}
|
||||
|
||||
RawSource ersky9xToSource_v11(int8_t value)
|
||||
{
|
||||
if (value == 0) {
|
||||
return RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (value <= 7) {
|
||||
return RawSource(SOURCE_TYPE_STICK, value - 1);
|
||||
}
|
||||
else if (value == 8) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (value == 9) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (value <= 12) {
|
||||
return RawSource(SOURCE_TYPE_CYC, value-10);
|
||||
}
|
||||
else if (value <= 20) {
|
||||
return RawSource(SOURCE_TYPE_PPM, value-13);
|
||||
}
|
||||
else if (value <= 36) {
|
||||
return RawSource(SOURCE_TYPE_CH, value-21);
|
||||
}
|
||||
else {
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
|
||||
}
|
||||
}
|
||||
|
||||
Ersky9xLogicalSwitchData_v10::operator LogicalSwitchData ()
|
||||
{
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = ersky9xToSource_v10(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = ersky9xToSource_v10(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = er9xToSwitch(v1).toValue();
|
||||
c9x.val2 = er9xToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
Ersky9xLogicalSwitchData_v11::operator LogicalSwitchData ()
|
||||
{
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = ersky9xToSource_v11(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = ersky9xToSource_v11(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = er9xToSwitch(v1).toValue();
|
||||
c9x.val2 = er9xToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xSafetySwData_v10::t_Ersky9xSafetySwData_v10()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xSafetySwData_v10));
|
||||
}
|
||||
|
||||
t_Ersky9xSafetySwData_v11::t_Ersky9xSafetySwData_v11()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xSafetySwData_v11));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyChannelData_v10::t_Ersky9xFrSkyChannelData_v10()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xFrSkyChannelData_v10));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyChannelData_v10::operator FrSkyChannelData ()
|
||||
{
|
||||
FrSkyChannelData c9x;
|
||||
c9x.ratio = ratio;
|
||||
c9x.alarms[0].value = alarms_value[0];
|
||||
c9x.alarms[0].level = alarms_level & 3;
|
||||
c9x.alarms[0].greater = alarms_greater & 1;
|
||||
c9x.alarms[1].value = alarms_value[1];
|
||||
c9x.alarms[1].level = (alarms_level >> 2) & 3;
|
||||
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
|
||||
if (type==2) {
|
||||
c9x.type = 0;
|
||||
c9x.multiplier=1;
|
||||
} else {
|
||||
c9x.type = type;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyChannelData_v11::t_Ersky9xFrSkyChannelData_v11()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xFrSkyChannelData_v11));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyChannelData_v11::operator FrSkyChannelData ()
|
||||
{
|
||||
FrSkyChannelData c9x;
|
||||
c9x.ratio = ratio;
|
||||
c9x.alarms[0].value = alarms_value[0];
|
||||
c9x.alarms[0].level = alarms_level & 3;
|
||||
c9x.alarms[0].greater = alarms_greater & 1;
|
||||
c9x.alarms[1].value = alarms_value[1];
|
||||
c9x.alarms[1].level = (alarms_level >> 2) & 3;
|
||||
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
|
||||
if (type==2) {
|
||||
c9x.type = 0;
|
||||
c9x.multiplier=1;
|
||||
} else {
|
||||
c9x.type = type;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyData_v10::t_Ersky9xFrSkyData_v10()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xFrSkyData_v10));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyData_v10::operator FrSkyData ()
|
||||
{
|
||||
FrSkyData c9x;
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyData_v11::t_Ersky9xFrSkyData_v11()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xFrSkyData_v11));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyData_v11::operator FrSkyData ()
|
||||
{
|
||||
FrSkyData c9x;
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xModelData_v10::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<2; i++) {
|
||||
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
|
||||
c9x.timers[i].val = timer[i].tmrVal;
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.funcSw[0].func = FuncInstantTrim;
|
||||
if (trimSw) {
|
||||
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
|
||||
}
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.swashRingData.invertELE = swashInvertELE;
|
||||
c9x.swashRingData.invertAIL = swashInvertAIL;
|
||||
c9x.swashRingData.invertCOL = swashInvertCOL;
|
||||
c9x.swashRingData.type = swashType;
|
||||
c9x.swashRingData.collectiveSource = ersky9xToSource_v10(swashCollectiveSource);
|
||||
c9x.swashRingData.value = swashRingValue;
|
||||
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<ERSKY9X_NUM_CHNOUT_V10; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
|
||||
// expoData
|
||||
int e = 0;
|
||||
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
|
||||
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
|
||||
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
|
||||
dr = 2;
|
||||
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
|
||||
break;
|
||||
if (expoData[ch].drSw1 && !expoData[ch].drSw2) {
|
||||
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? expoData[ch].drSw1 : 0);
|
||||
pos = dr == 0 ? 1 : 0;
|
||||
}
|
||||
else {
|
||||
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? -expoData[ch].drSw1 : (dr == 1 ? -expoData[ch].drSw2 : 0));
|
||||
}
|
||||
c9x.expoData[e].chn = ch;
|
||||
if (expoData[ch].expo[pos][0][0]) {
|
||||
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
|
||||
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][0];
|
||||
}
|
||||
c9x.expoData[e].weight = 100 + expoData[ch].expo[pos][1][0];
|
||||
if (expoData[ch].expo[pos][0][0] == expoData[ch].expo[pos][0][1] && expoData[ch].expo[pos][1][0] == expoData[ch].expo[pos][1][1]) {
|
||||
c9x.expoData[e++].mode = 3;
|
||||
}
|
||||
else {
|
||||
c9x.expoData[e].mode = 2;
|
||||
if (e < C9X_MAX_EXPOS - 1) {
|
||||
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
|
||||
c9x.expoData[++e].chn = ch;
|
||||
c9x.expoData[e].mode = 1;
|
||||
if (expoData[ch].expo[pos][0][1]) {
|
||||
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
|
||||
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][1];
|
||||
}
|
||||
c9x.expoData[e++].weight = 100 + expoData[ch].expo[pos][1][1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ERSKY9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<ERSKY9X_MAX_CURVE9; i++) {
|
||||
c9x.curves[ERSKY9X_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[ERSKY9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[ERSKY9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
|
||||
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V10; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Ersky9xModelData_v11::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<2; i++) {
|
||||
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
|
||||
c9x.timers[i].val = timer[i].tmrVal;
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.funcSw[0].func = FuncInstantTrim;
|
||||
if (trimSw) {
|
||||
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
|
||||
}
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.swashRingData.invertELE = swashInvertELE;
|
||||
c9x.swashRingData.invertAIL = swashInvertAIL;
|
||||
c9x.swashRingData.invertCOL = swashInvertCOL;
|
||||
c9x.swashRingData.type = swashType;
|
||||
c9x.swashRingData.collectiveSource = ersky9xToSource_v11(swashCollectiveSource);
|
||||
c9x.swashRingData.value = swashRingValue;
|
||||
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<ERSKY9X_NUM_CHNOUT_V11; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
|
||||
// expoData
|
||||
int e = 0;
|
||||
for (int ch = 0; ch < 4 && e < C9X_MAX_EXPOS; ch++) {
|
||||
for (int dr = 0, pos = 0; dr < 3 && e < C9X_MAX_EXPOS; dr++, pos++) {
|
||||
if ((dr == 0 && !expoData[ch].drSw1) || (dr == 1 && !expoData[ch].drSw2))
|
||||
dr = 2;
|
||||
if (dr == 2 && !expoData[ch].expo[0][0][0] && !expoData[ch].expo[0][0][1] && !expoData[ch].expo[0][1][0] && !expoData[ch].expo[0][1][1])
|
||||
break;
|
||||
if (expoData[ch].drSw1 && !expoData[ch].drSw2) {
|
||||
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? expoData[ch].drSw1 : 0);
|
||||
pos = dr == 0 ? 1 : 0;
|
||||
}
|
||||
else {
|
||||
c9x.expoData[e].swtch = er9xToSwitch(dr == 0 ? -expoData[ch].drSw1 : (dr == 1 ? -expoData[ch].drSw2 : 0));
|
||||
}
|
||||
c9x.expoData[e].chn = ch;
|
||||
if (expoData[ch].expo[pos][0][0]) {
|
||||
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
|
||||
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][0];
|
||||
}
|
||||
c9x.expoData[e].weight = 100 + expoData[ch].expo[pos][1][0];
|
||||
if (expoData[ch].expo[pos][0][0] == expoData[ch].expo[pos][0][1] && expoData[ch].expo[pos][1][0] == expoData[ch].expo[pos][1][1]) {
|
||||
c9x.expoData[e++].mode = 3;
|
||||
}
|
||||
else {
|
||||
c9x.expoData[e].mode = 2;
|
||||
if (e < C9X_MAX_EXPOS - 1) {
|
||||
c9x.expoData[e + 1].swtch = c9x.expoData[e].swtch;
|
||||
c9x.expoData[++e].chn = ch;
|
||||
c9x.expoData[e].mode = 1;
|
||||
if (expoData[ch].expo[pos][0][1]) {
|
||||
c9x.expoData[e].curve.type = CurveReference::CURVE_REF_EXPO;
|
||||
c9x.expoData[e].curve.value = expoData[ch].expo[pos][0][1];
|
||||
}
|
||||
c9x.expoData[e++].weight = 100 + expoData[ch].expo[pos][1][1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ERSKY9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<ERSKY9X_MAX_CURVE9; i++) {
|
||||
c9x.curves[ERSKY9X_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[ERSKY9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[ERSKY9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
|
||||
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V11; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
// for (int i=0; i<8; i++) {
|
||||
// c9x.frskyalarms[i].frskyAlarmLimit=frskyAlarms.alarmData[i].frskyAlarmLimit;
|
||||
// c9x.frskyalarms[i].frskyAlarmSound=frskyAlarms.alarmData[i].frskyAlarmSound;
|
||||
// c9x.frskyalarms[i].frskyAlarmType=frskyAlarms.alarmData[i].frskyAlarmType;
|
||||
// }
|
||||
// for (int i=0; i<8; i++) {
|
||||
// c9x.customdisplay[i]=customDisplayIndex[i];
|
||||
// }
|
||||
for (int i=0; i<5;i++) {
|
||||
c9x.flightModeData[0].gvars[i]=gvars[i].gvar;
|
||||
// c9x.gvsource[i]=gvars[i].gvsource;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,431 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef ersky9xeeprom_h
|
||||
#define ersky9xeeprom_h
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
extern RawSwitch getEr9xTimerMode(int mode);
|
||||
|
||||
//eeprom data
|
||||
#define ERSKY9X_MAX_MIXERS_V10 32
|
||||
#define ERSKY9X_MAX_MIXERS_V11 48
|
||||
#define ERSKY9X_MAX_CURVE5 8
|
||||
#define ERSKY9X_MAX_CURVE9 8
|
||||
#define ERSKY9X_MAX_CSFUNC 13
|
||||
|
||||
#define ERSKY9X_MDVERS10 10
|
||||
#define ERSKY9X_MDVERS11 11
|
||||
|
||||
#define ERSKY9X_GENERAL_OWNER_NAME_LEN 10
|
||||
#define ERSKY9X_NUM_CHNOUT_V10 16 //number of real outputchannels CH1-CH8
|
||||
#define ERSKY9X_NUM_CHNOUT_V11 24 //number of real outputchannels CH1-CH8
|
||||
#define ERSKY9X_NUM_CSW_V10 12 //number of custom switches
|
||||
#define ERSKY9X_NUM_CSW_V11 24
|
||||
#define ERSKY9X_NUM_FSW 16
|
||||
#define ERSKY9X_NUM_VOICE 8
|
||||
#define ERSKY9X_MAX_GVARS 7
|
||||
|
||||
#define NUM_STICKSnPOTS 7 //number of sticks and pots
|
||||
|
||||
PACK(typedef struct t_Ersky9xTrainerMix {
|
||||
uint8_t srcChn:3; //0-7 = ch1-8
|
||||
int8_t swtch:5;
|
||||
int8_t studWeight:6;
|
||||
uint8_t mode:2; // off, add-mode, subst-mode
|
||||
|
||||
operator TrainerMix();
|
||||
t_Ersky9xTrainerMix();
|
||||
}) Ersky9xTrainerMix; //
|
||||
|
||||
PACK(typedef struct t_Ersky9xTrainerData {
|
||||
int16_t calib[4];
|
||||
Ersky9xTrainerMix mix[4];
|
||||
|
||||
operator TrainerData();
|
||||
t_Ersky9xTrainerData();
|
||||
}) Ersky9xTrainerData;
|
||||
|
||||
PACK(typedef struct t_Ersky9xGeneral {
|
||||
uint8_t myVers;
|
||||
int16_t calibMid[NUM_STICKSnPOTS];
|
||||
int16_t calibSpanNeg[NUM_STICKSnPOTS];
|
||||
int16_t calibSpanPos[NUM_STICKSnPOTS];
|
||||
uint16_t chkSum;
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t lightSw;
|
||||
Ersky9xTrainerData trainer;
|
||||
uint8_t view;
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t disableSwitchWarning:1;
|
||||
uint8_t disableMemoryWarning:1;
|
||||
uint8_t beeperVal:3;
|
||||
uint8_t reserveWarning:1;
|
||||
uint8_t disableAlarmWarning:1;
|
||||
uint8_t stickMode;
|
||||
int8_t inactivityTimer;
|
||||
uint8_t throttleReversed:1;
|
||||
uint8_t minuteBeep:1;
|
||||
uint8_t preBeep:1;
|
||||
uint8_t flashBeep:1;
|
||||
uint8_t disableSplashScreen:1;
|
||||
uint8_t disablePotScroll:1;
|
||||
uint8_t disableBG:1;
|
||||
uint8_t res1:1;
|
||||
uint8_t filterInput;
|
||||
uint8_t lightAutoOff;
|
||||
uint8_t templateSetup; //RETA order according to chout_ar array
|
||||
int8_t PPM_Multiplier;
|
||||
uint8_t FRSkyYellow:4;
|
||||
uint8_t FRSkyOrange:4;
|
||||
uint8_t FRSkyRed:4; //mike please check these are correct
|
||||
uint8_t hideNameOnSplash:1;
|
||||
uint8_t optrexDisplay:1;
|
||||
uint8_t spare:2;
|
||||
uint8_t speakerPitch;
|
||||
uint8_t hapticStrength;
|
||||
uint8_t speakerMode;
|
||||
uint8_t lightOnStickMove;
|
||||
|
||||
char ownerName[10];
|
||||
uint8_t switchWarningStates;
|
||||
uint8_t volume ;
|
||||
uint8_t bright ; // backlight
|
||||
uint8_t stickGain;
|
||||
uint8_t mAh_alarm ;
|
||||
uint16_t mAh_used ;
|
||||
uint16_t run_time ;
|
||||
int8_t current_calib ;
|
||||
uint8_t bt_baudrate ;
|
||||
uint8_t rotaryDivisor ;
|
||||
operator GeneralSettings();
|
||||
t_Ersky9xGeneral();
|
||||
}) Ersky9xGeneral;
|
||||
|
||||
PACK(typedef struct t_Ersky9xExpoData {
|
||||
int8_t expo[3][2][2];
|
||||
int8_t drSw1;
|
||||
int8_t drSw2;
|
||||
|
||||
t_Ersky9xExpoData() { memset(this, 0, sizeof(t_Ersky9xExpoData)); }
|
||||
}) Ersky9xExpoData;
|
||||
|
||||
|
||||
PACK(typedef struct t_Ersky9xLimitData {
|
||||
int8_t min;
|
||||
int8_t max;
|
||||
bool revert;
|
||||
int16_t offset;
|
||||
|
||||
operator LimitData();
|
||||
t_Ersky9xLimitData() ;
|
||||
}) Ersky9xLimitData;
|
||||
|
||||
#define MLTPX_ADD 0
|
||||
#define MLTPX_MUL 1
|
||||
#define MLTPX_REP 2
|
||||
|
||||
PACK(typedef struct t_Ersky9xMixData_v10 {
|
||||
uint8_t destCh; // 1..C9X_NUM_CHNOUT
|
||||
uint8_t srcRaw; //
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t curve; //0=symmetrisch 1=no neg 2=no pos
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint8_t carryTrim:1;
|
||||
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t enableFmTrim:1;
|
||||
uint8_t mixres:1;
|
||||
int8_t sOffset;
|
||||
int8_t res;
|
||||
|
||||
operator MixData();
|
||||
t_Ersky9xMixData_v10();
|
||||
}) Ersky9xMixData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xMixData_v11 {
|
||||
uint8_t destCh; // 1..C9X_NUM_CHNOUT
|
||||
uint8_t srcRaw; //
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t curve; //0=symmetrisch 1=no neg 2=no pos
|
||||
uint8_t delayUp;
|
||||
uint8_t delayDown;
|
||||
uint8_t speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown; // 0 nichts
|
||||
uint8_t carryTrim:1;
|
||||
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t enableFmTrim:1;
|
||||
uint8_t mixres:1;
|
||||
int8_t sOffset;
|
||||
uint8_t res[4];
|
||||
operator MixData();
|
||||
t_Ersky9xMixData_v11();
|
||||
}) Ersky9xMixData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xLogicalSwitchData_v10 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Ersky9xLogicalSwitchData_v10() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v10)); }
|
||||
}) Ersky9xLogicalSwitchData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xLogicalSwitchData_v11 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
uint8_t andsw;
|
||||
uint8_t res ;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Ersky9xLogicalSwitchData_v11() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v11)); }
|
||||
}) Ersky9xLogicalSwitchData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xSafetySwData_v10 { // Custom Switches data
|
||||
int8_t swtch;
|
||||
int8_t val;
|
||||
|
||||
t_Ersky9xSafetySwData_v10();
|
||||
}) Ersky9xSafetySwData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xSafetySwData_v11 { // Custom Switches data
|
||||
union opt {
|
||||
struct ss {
|
||||
int8_t swtch ;
|
||||
uint8_t mode ;
|
||||
int8_t val ;
|
||||
uint8_t res ;
|
||||
} ss ;
|
||||
struct vs {
|
||||
uint8_t vswtch ;
|
||||
uint8_t vmode ; // ON, OFF, BOTH, 15Secs, 30Secs, 60Secs, Varibl
|
||||
uint8_t vval;
|
||||
uint8_t vres ;
|
||||
} vs ;
|
||||
} opt ;
|
||||
|
||||
t_Ersky9xSafetySwData_v11();
|
||||
}) Ersky9xSafetySwData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xgvar {
|
||||
int8_t gvar ;
|
||||
uint8_t gvsource ;
|
||||
// int8_t gvswitch ;
|
||||
}) Ersky9xGvarData ;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFlightModeData {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
uint16_t spare ; // Future expansion
|
||||
}) Ersky9xFlightModeData;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFuncSwData { // Function Switches data
|
||||
int8_t swtch; //input
|
||||
uint8_t func;
|
||||
char param[6];
|
||||
uint8_t delay;
|
||||
uint8_t spare;
|
||||
}) Ersky9xFuncSwData;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFrSkyChannelData_v10 {
|
||||
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_level:4;
|
||||
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
|
||||
uint8_t type:2; // future use: 0=volts, ...
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Ersky9xFrSkyChannelData_v10();
|
||||
}) Ersky9xFrSkyChannelData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFrSkyData_v10 {
|
||||
Ersky9xFrSkyChannelData_v10 channels[2];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Ersky9xFrSkyData_v10();
|
||||
}) Ersky9xFrSkyData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFrSkyChannelData_v11 {
|
||||
uint8_t ratio ; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t offset ; //
|
||||
uint8_t gain ; //
|
||||
uint8_t alarms_value[2] ; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_level ;
|
||||
uint8_t alarms_greater ; // 0=LT(<), 1=GT(>)
|
||||
uint8_t type ; // 0=volts, 1=raw, 2=volts*2, 3=Amps
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Ersky9xFrSkyChannelData_v11();
|
||||
}) Ersky9xFrSkyChannelData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFrSkyData_v11 {
|
||||
Ersky9xFrSkyChannelData_v11 channels[2];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Ersky9xFrSkyData_v11();
|
||||
}) Ersky9xFrSkyData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFrSkyalarms_v11 {
|
||||
uint8_t frskyAlarmType ;
|
||||
uint8_t frskyAlarmLimit ;
|
||||
uint8_t frskyAlarmSound ;
|
||||
}) Ersky9xFrSkyAlData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFrSkyAlarmData_v11 {
|
||||
Ersky9xFrSkyAlData_v11 alarmData[8] ;
|
||||
}) Ersky9xFrSkyAlarmData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xTimerMode_v10 {
|
||||
uint8_t tmrModeA:7 ; // timer trigger source -> off, abs, stk, stk%, cx%
|
||||
uint8_t tmrDir:1 ; // Timer direction
|
||||
int8_t tmrModeB ; // timer trigger source -> !sw, none, sw, m_sw
|
||||
uint16_t tmrVal ;
|
||||
}) Ersky9xTimerMode_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xTimerMode_v11 {
|
||||
uint8_t tmrModeA:7 ; // timer trigger source -> off, abs, stk, stk%, cx%
|
||||
uint8_t tmrDir:1 ; // Timer direction
|
||||
int8_t tmrModeB ; // timer trigger source -> !sw, none, sw, m_sw
|
||||
uint16_t tmrVal ;
|
||||
}) Ersky9xTimerMode_v11;
|
||||
|
||||
PACK(typedef struct te_Ersky9xswVoice {
|
||||
uint8_t swtch ;
|
||||
uint8_t mode ; // ON, OFF, BOTH, 15Secs, 30Secs, 60Secs
|
||||
uint8_t val ;
|
||||
uint8_t vres ;
|
||||
}) Ersky9xvoiceSwData ;
|
||||
|
||||
PACK(typedef struct t_Ersky9xModelData_v10 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
uint8_t reserved_spare; //used to be MDVERS - now depreciated
|
||||
int8_t spare21; // was timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
// uint8_t sparex:1; // was tmrDir, now use tmrVal>0 => count down
|
||||
uint8_t sparex:1; // was tmrDir, now use tmrVal>0 => count down
|
||||
// uint8_t tmrDir:1; // was tmrDir, now use tmrVal>0 => count down
|
||||
uint8_t traineron:1; // 0 disable trainer, 1 allow trainer
|
||||
uint8_t spare22:1 ; // Start timer2 using throttle
|
||||
uint8_t FrSkyUsrProto:1 ; // Protocol in FrSky User Data, 0=FrSky Hub, 1=WS HowHigh
|
||||
uint8_t FrSkyGpsAlt:1 ; // Use Gps Altitude as main altitude reading
|
||||
uint8_t FrSkyImperial:1 ; // Convert FrSky values to imperial units
|
||||
uint8_t FrSkyAltAlarm:2;
|
||||
uint16_t spare_u16 ; // Was timerval
|
||||
uint8_t protocol;
|
||||
int8_t ppmNCH;
|
||||
int8_t thrTrim:4; // Enable Throttle Trim
|
||||
int8_t thrExpo:4; // Enable Throttle Expo
|
||||
int8_t trimInc; // Trim Increments
|
||||
int8_t ppmDelay;
|
||||
int8_t trimSw;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t swashInvertELE:1;
|
||||
uint8_t swashInvertAIL:1;
|
||||
uint8_t swashInvertCOL:1;
|
||||
uint8_t swashType:3;
|
||||
uint8_t swashCollectiveSource;
|
||||
uint8_t swashRingValue;
|
||||
int8_t ppmFrameLength; //0=22.5 (10msec-30msec) 0.5msec increments
|
||||
Ersky9xMixData_v10 mixData[ERSKY9X_MAX_MIXERS_V10];
|
||||
Ersky9xLimitData limitData[ERSKY9X_NUM_CHNOUT_V10];
|
||||
Ersky9xExpoData expoData[4];
|
||||
int8_t trim[4];
|
||||
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
|
||||
Ersky9xLogicalSwitchData_v10 customSw[ERSKY9X_NUM_CSW_V10];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
uint8_t res3[2];
|
||||
Ersky9xSafetySwData_v10 safetySw[ERSKY9X_NUM_CHNOUT_V10];
|
||||
Ersky9xFrSkyData_v10 frsky;
|
||||
Ersky9xTimerMode_v10 timer[2] ;
|
||||
operator ModelData();
|
||||
t_Ersky9xModelData_v10() { memset(this, 0, sizeof(t_Ersky9xModelData_v10)); }
|
||||
}) Ersky9xModelData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xModelData_v11 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
uint8_t modelVoice ; // Index to model name voice (261+value)
|
||||
uint8_t RxNum ; // was timer trigger source, now RxNum for model match
|
||||
uint8_t sparex:1; // was tmrDir, now use tmrVal>0 => count down
|
||||
uint8_t traineron:1; // 0 disable trainer, 1 allow trainer
|
||||
uint8_t spare22:1 ; // Start timer2 using throttle
|
||||
uint8_t FrSkyUsrProto:1 ; // Protocol in FrSky User Data, 0=FrSky Hub, 1=WS HowHigh
|
||||
uint8_t FrSkyGpsAlt:1 ; // Use Gps Altitude as main altitude reading
|
||||
uint8_t FrSkyImperial:1 ; // Convert FrSky values to imperial units
|
||||
uint8_t FrSkyAltAlarm:2;
|
||||
uint8_t version ;
|
||||
uint8_t protocol;
|
||||
int8_t ppmNCH;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
uint8_t numBlades:2; // RPM scaling
|
||||
uint8_t spare10:1;
|
||||
uint8_t thrExpo:1; // Enable Throttle Expo
|
||||
uint8_t spare11:3;
|
||||
int8_t trimInc; // Trim Increments
|
||||
int8_t ppmDelay;
|
||||
int8_t trimSw;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t swashInvertELE:1;
|
||||
uint8_t swashInvertAIL:1;
|
||||
uint8_t swashInvertCOL:1;
|
||||
uint8_t swashType:3;
|
||||
uint8_t swashCollectiveSource;
|
||||
uint8_t swashRingValue;
|
||||
int8_t ppmFrameLength; //0=22.5 (10msec-30msec) 0.5msec increments
|
||||
Ersky9xMixData_v11 mixData[ERSKY9X_MAX_MIXERS_V11];
|
||||
Ersky9xLimitData limitData[ERSKY9X_NUM_CHNOUT_V11];
|
||||
Ersky9xExpoData expoData[4];
|
||||
int8_t trim[4];
|
||||
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
|
||||
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
|
||||
int8_t curvexy[18];
|
||||
Ersky9xLogicalSwitchData_v11 customSw[ERSKY9X_NUM_CSW_V11];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
uint8_t bt_telemetry;
|
||||
uint8_t numVoice; // 0-16, rest are Safety switches
|
||||
Ersky9xSafetySwData_v11 safetySw[ERSKY9X_NUM_CHNOUT_V11];
|
||||
Ersky9xvoiceSwData voiceSwitches[ERSKY9X_NUM_VOICE] ;
|
||||
Ersky9xFrSkyData_v11 frsky;
|
||||
Ersky9xTimerMode_v11 timer[2] ;
|
||||
Ersky9xFrSkyAlarmData_v11 frskyAlarms ;
|
||||
// Add 6 bytes for custom telemetry screen
|
||||
uint8_t customDisplayIndex[6] ;
|
||||
Ersky9xFuncSwData funcSw[ERSKY9X_NUM_FSW];
|
||||
Ersky9xFlightModeData flightModeData[6] ;
|
||||
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
|
||||
|
||||
operator ModelData();
|
||||
t_Ersky9xModelData_v11() { memset(this, 0, sizeof(t_Ersky9xModelData_v11)); }
|
||||
}) Ersky9xModelData_v11;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,372 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 <iostream>
|
||||
#include <QMessageBox>
|
||||
#include "ersky9xinterface.h"
|
||||
#include "ersky9xeeprom.h"
|
||||
#include "ersky9xsimulator.h"
|
||||
#include "file.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
|
||||
/// fileId of general file
|
||||
#define FILE_GENERAL 0
|
||||
/// convert model number 0..MAX_MODELS-1 int fileId
|
||||
#define FILE_MODEL(n) (1+n)
|
||||
#define FILE_TMP (1+16)
|
||||
|
||||
Ersky9xInterface::Ersky9xInterface():
|
||||
EEPROMInterface(BOARD_SKY9X),
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
||||
Ersky9xInterface::~Ersky9xInterface()
|
||||
{
|
||||
delete efile;
|
||||
}
|
||||
|
||||
const char * Ersky9xInterface::getName()
|
||||
{
|
||||
return "Ersky9x";
|
||||
}
|
||||
|
||||
const int Ersky9xInterface::getEEpromSize()
|
||||
{
|
||||
return EESIZE_SKY9X;
|
||||
}
|
||||
|
||||
const int Ersky9xInterface::getMaxModels()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
inline void applyStickModeToModel(Ersky9xModelData_v10 & model, unsigned int mode)
|
||||
{
|
||||
for (int i=0; i<2; i++) {
|
||||
int stick = applyStickMode(i+1, mode) - 1;
|
||||
{
|
||||
int tmp = model.trim[i];
|
||||
model.trim[i] = model.trim[stick];
|
||||
model.trim[stick] = tmp;
|
||||
}
|
||||
{
|
||||
Ersky9xExpoData tmp = model.expoData[i];
|
||||
model.expoData[i] = model.expoData[stick];
|
||||
model.expoData[stick] = tmp;
|
||||
}
|
||||
}
|
||||
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++) {
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
|
||||
}
|
||||
|
||||
inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mode)
|
||||
{
|
||||
for (int i=0; i<2; i++) {
|
||||
int stick = applyStickMode(i+1, mode) - 1;
|
||||
{
|
||||
int tmp = model.trim[i];
|
||||
model.trim[i] = model.trim[stick];
|
||||
model.trim[stick] = tmp;
|
||||
}
|
||||
{
|
||||
Ersky9xExpoData tmp = model.expoData[i];
|
||||
model.expoData[i] = model.expoData[stick];
|
||||
model.expoData[stick] = tmp;
|
||||
}
|
||||
}
|
||||
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
|
||||
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
|
||||
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++) {
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
std::cout << "trying ersky9x xml import... ";
|
||||
|
||||
Ersky9xGeneral ersky9xGeneral;
|
||||
memset(&ersky9xGeneral,0,sizeof(ersky9xGeneral));
|
||||
if(!loadGeneralDataXML(&doc, &ersky9xGeneral)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
radioData.generalSettings=ersky9xGeneral;
|
||||
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
|
||||
}
|
||||
for(int i=0; i<getMaxModels(); i++) {
|
||||
if (ersky9xGeneral.myVers == 10) {
|
||||
if (!loadModelDataXML<Ersky9xModelData_v10>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying ersky9x import... ";
|
||||
|
||||
if (size != EESIZE_SKY9X) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
Ersky9xGeneral ersky9xGeneral;
|
||||
|
||||
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
|
||||
|
||||
switch(ersky9xGeneral.myVers) {
|
||||
case 10:
|
||||
break;
|
||||
case 11:
|
||||
break;
|
||||
default:
|
||||
std::cout << "not ersky9x\n";
|
||||
return false;
|
||||
}
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
}
|
||||
radioData.generalSettings = ersky9xGeneral;
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
uint8_t buffer[4096];
|
||||
uint size;
|
||||
memset(buffer,0,sizeof(buffer));
|
||||
efile->openRd(FILE_MODEL(i));
|
||||
|
||||
// if (!efile->readRlc2((uint8_t*)&ersky9xModel, sizeof(Ersky9xModelData))) {
|
||||
size=efile->readRlc2(buffer, 4096);
|
||||
if (!size) {
|
||||
radioData.models[i].clear();
|
||||
}
|
||||
else {
|
||||
if (size<720) {
|
||||
Ersky9xModelData_v10 ersky9xModel;
|
||||
memcpy(&ersky9xModel, buffer, sizeof(ersky9xModel));
|
||||
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
|
||||
radioData.models[i] = ersky9xModel;
|
||||
} else {
|
||||
Ersky9xModelData_v11 ersky9xModel;
|
||||
memcpy(&ersky9xModel, buffer, sizeof(ersky9xModel));
|
||||
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
|
||||
radioData.models[i] = ersky9xModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
{
|
||||
std::cout << "NO!\n";
|
||||
// TODO an error
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Ersky9xInterface::getSize(ModelData &model)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Ersky9xInterface::getSize(GeneralSettings &settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Ersky9xInterface::isAvailable(Protocol prot, int port)
|
||||
{
|
||||
switch (prot) {
|
||||
case PPM:
|
||||
case DSM2:
|
||||
case PXX_DJT:
|
||||
case PPM16:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Ersky9xInterface::appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value)
|
||||
{
|
||||
QDomElement e = qdoc->createElement(name);
|
||||
QDomText t = qdoc->createTextNode(name);
|
||||
t.setNodeValue(value);
|
||||
e.appendChild(t);
|
||||
pe->appendChild(e);
|
||||
}
|
||||
|
||||
void Ersky9xInterface::appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite)
|
||||
{
|
||||
if(value || forceZeroWrite) {
|
||||
QDomElement e = qdoc->createElement(name);
|
||||
QDomText t = qdoc->createTextNode(name);
|
||||
t.setNodeValue(QString("%1").arg(value));
|
||||
e.appendChild(t);
|
||||
pe->appendChild(e);
|
||||
}
|
||||
}
|
||||
|
||||
void Ersky9xInterface::appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size)
|
||||
{
|
||||
QDomElement e = qdoc->createElement(name);
|
||||
QDomCDATASection t = qdoc->createCDATASection(name);
|
||||
t.setData(QByteArray(data, size).toBase64());
|
||||
e.appendChild(t);
|
||||
pe->appendChild(e);
|
||||
}
|
||||
|
||||
QDomElement Ersky9xInterface::getGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen)
|
||||
{
|
||||
QDomElement gd = qdoc->createElement("GENERAL_DATA");
|
||||
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Ersky9xGeneral));
|
||||
return gd;
|
||||
}
|
||||
|
||||
QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelData_v11 * tmod, int modelNum, int mdver)
|
||||
{
|
||||
QDomElement md = qdoc->createElement("MODEL_DATA");
|
||||
md.setAttribute("number", modelNum);
|
||||
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Ersky9xModelData_v11));
|
||||
return md;
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen)
|
||||
{
|
||||
//look for "GENERAL_DATA" tag
|
||||
QDomElement gde = qdoc->elementsByTagName("GENERAL_DATA").at(0).toElement();
|
||||
|
||||
if(gde.isNull()) // couldn't find
|
||||
return false;
|
||||
|
||||
//load cdata into tgen
|
||||
QDomNode n = gde.elementsByTagName("Data").at(0).firstChild();// get all children in Data
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
const char * data = ba.data();
|
||||
memcpy(tgen, data, std::min((unsigned int)ba.size(), (unsigned int)sizeof(Ersky9xGeneral)));
|
||||
break;
|
||||
}
|
||||
n = n.nextSibling();
|
||||
}
|
||||
//check version?
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, int modelNum, int stickMode)
|
||||
{
|
||||
T ersky9xModel;
|
||||
memset(&ersky9xModel, 0, sizeof(ersky9xModel));
|
||||
|
||||
//look for MODEL_DATA with modelNum attribute.
|
||||
//if modelNum = -1 then just pick the first one
|
||||
QDomNodeList ndl = qdoc->elementsByTagName("MODEL_DATA");
|
||||
|
||||
//cycle through nodes to find correct model number
|
||||
QDomNode k = ndl.at(0);
|
||||
if (modelNum>=0) {
|
||||
while(!k.isNull()) {
|
||||
int a = k.toElement().attribute("number").toInt();
|
||||
if(a==modelNum)
|
||||
break;
|
||||
k = k.nextSibling();
|
||||
}
|
||||
}
|
||||
|
||||
if (k.isNull()) // couldn't find
|
||||
return false;
|
||||
|
||||
//load cdata into tgen
|
||||
QDomNode n = k.toElement().elementsByTagName("Data").at(0).firstChild();// get all children in Data
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
const char * data = ba.data();
|
||||
memcpy(&ersky9xModel, data, std::min(ba.size(), (int)sizeof(ersky9xModel)));
|
||||
break;
|
||||
}
|
||||
n = n.nextSibling();
|
||||
}
|
||||
|
||||
applyStickModeToModel(ersky9xModel, stickMode);
|
||||
*model = ersky9xModel;
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef ersky9x_interface_h
|
||||
#define ersky9x_interface_h
|
||||
#include <QtXml>
|
||||
#include "eeprominterface.h"
|
||||
#include "ersky9xeeprom.h"
|
||||
class RleFile;
|
||||
|
||||
class Ersky9xInterface : public EEPROMInterface
|
||||
{
|
||||
public:
|
||||
|
||||
Ersky9xInterface();
|
||||
|
||||
virtual ~Ersky9xInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
virtual const int getEEpromSize();
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
RleFile *efile;
|
||||
|
||||
private:
|
||||
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
|
||||
|
||||
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
|
||||
|
||||
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
|
||||
|
||||
QDomElement getGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); //parse out data to XML format
|
||||
|
||||
QDomElement getModelDataXML(QDomDocument * qdoc, Ersky9xModelData_v11 * tmod, int modelNum, int mdver); //parse out data to XML format
|
||||
|
||||
bool loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); // get data from XML
|
||||
|
||||
template <class T>
|
||||
bool loadModelDataXML(QDomDocument * qdoc, ModelData * model, int modelNum, int stickMode); // get data from XML
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 "firmwares/ersky9x/ersky9xsimulator.h"
|
||||
#include "firmwares/ersky9x/ersky9xinterface.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBSKY9X
|
||||
#define PCBSKY
|
||||
#define STAMP
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define TEMPLATES
|
||||
#define HELI
|
||||
#define HAPTIC
|
||||
#define AUDIO
|
||||
#define REVB
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define SWSRC_SW1 DSW_SW1
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Ersky9x {
|
||||
|
||||
#include "../ersky9x/timers.h"
|
||||
#include "../ersky9x/ersky9x.cpp"
|
||||
#include "../ersky9x/stamp.cpp"
|
||||
#include "../ersky9x/menus.cpp"
|
||||
#include "../ersky9x/pers.cpp"
|
||||
#include "../ersky9x/file.cpp"
|
||||
#include "../ersky9x/lcd.cpp"
|
||||
#include "../ersky9x/drivers.cpp"
|
||||
#include "../ersky9x/logicio.cpp"
|
||||
#include "../ersky9x/timers.cpp"
|
||||
#include "../ersky9x/simpgmspace.cpp"
|
||||
#include "../ersky9x/templates.cpp"
|
||||
#include "../ersky9x/frsky.cpp"
|
||||
#include "../ersky9x/audio.cpp"
|
||||
#include "../ersky9x/sound.cpp"
|
||||
#include "../ersky9x/diskio.cpp"
|
||||
|
||||
#define IS_BACKLIGHT_ON() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||
|
||||
//uint8_t pxxFlag = 0;
|
||||
int16_t g_anas[7];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 1500;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void setTrim(uint8_t idx, int8_t value)
|
||||
{
|
||||
g_model.trim[idx] = value;
|
||||
}
|
||||
|
||||
void getTrims(int16_t values[4])
|
||||
{
|
||||
for (int i=0; i<4; i++)
|
||||
values[i] = g_model.trim[i];
|
||||
}
|
||||
|
||||
#define SWITCH_CASE(swtch, pin, mask) \
|
||||
case swtch: \
|
||||
if (state) pin |= (mask); else pin &= ~(mask); \
|
||||
break;
|
||||
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
|
||||
case swtch: \
|
||||
if (state < 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
|
||||
if (state > 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
|
||||
break;
|
||||
|
||||
void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
{
|
||||
// printf("swtch=%d state=%d\n", swtch, state); fflush(stdout);
|
||||
switch (swtch) {
|
||||
SWITCH_CASE(0, PIOC->PIO_PDSR, 1<<20)
|
||||
SWITCH_CASE(1, PIOA->PIO_PDSR, 1<<15)
|
||||
SWITCH_CASE(2, PIOC->PIO_PDSR, 1<<31)
|
||||
SWITCH_3_CASE(3, PIOC->PIO_PDSR, PIOC->PIO_PDSR, 0x00004000, 0x00000800)
|
||||
SWITCH_CASE(4, PIOA->PIO_PDSR, 1<<2)
|
||||
SWITCH_CASE(5, PIOC->PIO_PDSR, 1<<16)
|
||||
SWITCH_CASE(6, PIOC->PIO_PDSR, 1<<8)
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define GPIO_BUTTON_MENU PIOB->PIO_PDSR
|
||||
#define GPIO_BUTTON_EXIT PIOC->PIO_PDSR
|
||||
#define GPIO_BUTTON_UP PIOC->PIO_PDSR
|
||||
#define GPIO_BUTTON_DOWN PIOC->PIO_PDSR
|
||||
#define GPIO_BUTTON_RIGHT PIOC->PIO_PDSR
|
||||
#define GPIO_BUTTON_LEFT PIOC->PIO_PDSR
|
||||
#define PIN_BUTTON_MENU 0x00000020
|
||||
#define PIN_BUTTON_EXIT 0x01000000
|
||||
#define PIN_BUTTON_UP 0x00000002
|
||||
#define PIN_BUTTON_DOWN 0x00000020
|
||||
#define PIN_BUTTON_RIGHT 0x00000010
|
||||
#define PIN_BUTTON_LEFT 0x00000008
|
||||
|
||||
#define KEY_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
if (state) pin &= ~mask; else pin |= mask;\
|
||||
break;
|
||||
|
||||
void simuSetKey(uint8_t key, bool state)
|
||||
{
|
||||
switch (key) {
|
||||
KEY_CASE(KEY_MENU, GPIO_BUTTON_MENU, PIN_BUTTON_MENU)
|
||||
KEY_CASE(KEY_EXIT, GPIO_BUTTON_EXIT, PIN_BUTTON_EXIT)
|
||||
KEY_CASE(KEY_RIGHT, GPIO_BUTTON_RIGHT, PIN_BUTTON_RIGHT)
|
||||
KEY_CASE(KEY_LEFT, GPIO_BUTTON_LEFT, PIN_BUTTON_LEFT)
|
||||
KEY_CASE(KEY_UP, GPIO_BUTTON_UP, PIN_BUTTON_UP)
|
||||
KEY_CASE(KEY_DOWN, GPIO_BUTTON_DOWN, PIN_BUTTON_DOWN)
|
||||
}
|
||||
}
|
||||
|
||||
#define GPIO_TRIM_LH_L PIOA->PIO_PDSR
|
||||
#define GPIO_TRIM_LV_DN PIOA->PIO_PDSR
|
||||
#define GPIO_TRIM_RV_UP PIOA->PIO_PDSR
|
||||
#define GPIO_TRIM_RH_L PIOA->PIO_PDSR
|
||||
#define GPIO_TRIM_LH_R PIOB->PIO_PDSR
|
||||
#define GPIO_TRIM_LV_UP PIOC->PIO_PDSR
|
||||
#define GPIO_TRIM_RV_DN PIOC->PIO_PDSR
|
||||
#define GPIO_TRIM_RH_R PIOC->PIO_PDSR
|
||||
#define PIN_TRIM_LH_L 0x00800000
|
||||
#define PIN_TRIM_LV_DN 0x01000000
|
||||
#define PIN_TRIM_RV_UP 0x00000002
|
||||
#define PIN_TRIM_RH_L 0x00000001
|
||||
#define PIN_TRIM_LH_R 0x00000010
|
||||
#define PIN_TRIM_LV_UP 0x10000000
|
||||
#define PIN_TRIM_RV_DN 0x00000400
|
||||
#define PIN_TRIM_RH_R 0x00000200
|
||||
|
||||
#define TRIM_CASE KEY_CASE
|
||||
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
switch (trim) {
|
||||
TRIM_CASE(0, GPIO_TRIM_LH_L, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, GPIO_TRIM_LH_R, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, GPIO_TRIM_LV_DN, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, GPIO_TRIM_LV_UP, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, GPIO_TRIM_RV_DN, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, GPIO_TRIM_RV_UP, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, GPIO_TRIM_RH_L, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, GPIO_TRIM_RH_R, PIN_TRIM_RH_R)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Ersky9x;
|
||||
|
||||
Ersky9xSimulator::Ersky9xSimulator(Ersky9xInterface * ersky9xInterface):
|
||||
ersky9xInterface(ersky9xInterface)
|
||||
{
|
||||
}
|
||||
|
||||
bool Ersky9xSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Ersky9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::start(RadioData &radioData, bool tests)
|
||||
{
|
||||
ersky9xInterface->save(Ersky9x::eeprom, radioData);
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
Ersky9x::setTrim(idx, value);
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
trims.extended = false;
|
||||
Ersky9x::getTrims(trims.values);
|
||||
}
|
||||
|
||||
const char * Ersky9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ersky9x_simulator_h
|
||||
#define ersky9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Ersky9xInterface;
|
||||
|
||||
class Ersky9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Ersky9xSimulator(Ersky9xInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase() { return 0; }
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
||||
|
||||
virtual void wheelEvent(uint8_t steps) { }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
protected:
|
||||
|
||||
Ersky9xInterface * ersky9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,729 @@
|
||||
#include <stdlib.h>
|
||||
#include <algorithm>
|
||||
#include "helpers.h"
|
||||
#include "gruvin9xeeprom.h"
|
||||
#include <QObject>
|
||||
|
||||
#define EEPROM_VER 106
|
||||
|
||||
extern void getEEPROMZString(char *dst, const char *src, int size);
|
||||
|
||||
RawSwitch gruvin9xToSwitch(int8_t sw)
|
||||
{
|
||||
if (sw == 0)
|
||||
return RawSwitch(SWITCH_TYPE_NONE);
|
||||
else if (sw <= 9)
|
||||
return RawSwitch(SWITCH_TYPE_SWITCH, sw);
|
||||
else
|
||||
return RawSwitch(SWITCH_TYPE_VIRTUAL, sw > 0 ? sw-9 : sw+9);
|
||||
}
|
||||
|
||||
t_Gruvin9xTrainerMix_v103::operator TrainerMix()
|
||||
{
|
||||
TrainerMix c9x;
|
||||
c9x.src = srcChn;
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
c9x.weight = (25 * studWeight) / 8;
|
||||
c9x.mode = mode;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xTrainerMix_v104::operator TrainerMix()
|
||||
{
|
||||
TrainerMix c9x;
|
||||
c9x.src = srcChn;
|
||||
c9x.weight = studWeight;
|
||||
c9x.mode = mode;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xTrainerData_v103::operator TrainerData ()
|
||||
{
|
||||
TrainerData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
c9x.calib[i] = calib[i];
|
||||
c9x.mix[i] = mix[i];
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xTrainerData_v104::operator TrainerData ()
|
||||
{
|
||||
TrainerData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
c9x.calib[i] = calib[i];
|
||||
c9x.mix[i] = mix[i];
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
Gruvin9xGeneral_v103::operator GeneralSettings ()
|
||||
{
|
||||
GeneralSettings result;
|
||||
|
||||
for (int i=0; i<NUM_STICKS+BOARD_9X_NUM_POTS; i++) {
|
||||
result.calibMid[i] = calibMid[i];
|
||||
result.calibSpanNeg[i] = calibSpanNeg[i];
|
||||
result.calibSpanPos[i] = calibSpanPos[i];
|
||||
}
|
||||
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
result.backlightMode = 4;
|
||||
}
|
||||
else if (lightAutoOff) {
|
||||
result.backlightMode |= 1;
|
||||
result.backlightDelay = lightAutoOff;
|
||||
}
|
||||
|
||||
result.trainer = trainer;
|
||||
result.view = view;
|
||||
result.disableThrottleWarning = disableThrottleWarning;
|
||||
result.switchWarning = switchWarning;
|
||||
|
||||
switch (beeperVal) {
|
||||
case 0:
|
||||
result.beeperMode = e_quiet;
|
||||
break;
|
||||
case 1:
|
||||
result.beeperMode = e_no_keys;
|
||||
break;
|
||||
default:
|
||||
result.beeperMode = e_all;
|
||||
result.beeperLength = beeperVal - 4;
|
||||
break;
|
||||
}
|
||||
|
||||
result.disableMemoryWarning = disableMemoryWarning;
|
||||
result.disableAlarmWarning = disableAlarmWarning;
|
||||
result.stickMode = stickMode;
|
||||
result.inactivityTimer = inactivityTimer;
|
||||
result.minuteBeep = minuteBeep;
|
||||
result.preBeep = preBeep;
|
||||
result.flashBeep = flashBeep;
|
||||
result.splashMode = disableSplashScreen;
|
||||
result.enableTelemetryAlarm = enableTelemetryAlarm;
|
||||
result.templateSetup = templateSetup;
|
||||
result.PPM_Multiplier = PPM_Multiplier;
|
||||
// TODO frskyRssiAlarms[2];
|
||||
return result;
|
||||
}
|
||||
|
||||
Gruvin9xGeneral_v104::operator GeneralSettings ()
|
||||
{
|
||||
GeneralSettings result;
|
||||
|
||||
for (int i=0; i<NUM_STICKS+BOARD_9X_NUM_POTS; i++) {
|
||||
result.calibMid[i] = calibMid[i];
|
||||
result.calibSpanNeg[i] = calibSpanNeg[i];
|
||||
result.calibSpanPos[i] = calibSpanPos[i];
|
||||
}
|
||||
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
result.backlightMode = 4;
|
||||
}
|
||||
else if (lightAutoOff) {
|
||||
result.backlightMode |= 1;
|
||||
result.backlightDelay = lightAutoOff;
|
||||
}
|
||||
|
||||
result.trainer = trainer;
|
||||
result.view = view;
|
||||
result.disableThrottleWarning = disableThrottleWarning;
|
||||
result.switchWarning = switchWarning;
|
||||
result.beeperMode = (BeeperMode)beeperVal;
|
||||
result.disableMemoryWarning = disableMemoryWarning;
|
||||
result.disableAlarmWarning = disableAlarmWarning;
|
||||
result.stickMode = stickMode;
|
||||
result.inactivityTimer = inactivityTimer;
|
||||
result.minuteBeep = minuteBeep;
|
||||
result.preBeep = preBeep;
|
||||
result.flashBeep = flashBeep;
|
||||
result.splashMode = disableSplashScreen;
|
||||
result.enableTelemetryAlarm = enableTelemetryAlarm;
|
||||
result.templateSetup = templateSetup;
|
||||
result.PPM_Multiplier = PPM_Multiplier;
|
||||
// TODO frskyRssiAlarms[2];
|
||||
return result;
|
||||
}
|
||||
|
||||
t_Gruvin9xExpoData::t_Gruvin9xExpoData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Gruvin9xExpoData));
|
||||
}
|
||||
|
||||
t_Gruvin9xExpoData::operator ExpoData ()
|
||||
{
|
||||
ExpoData c9x;
|
||||
c9x.mode = mode;
|
||||
c9x.chn = chn;
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
if (negPhase) {
|
||||
c9x.phases= 1 << (phase -1);
|
||||
} else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
} else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.weight = weight;
|
||||
if (expo) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_EXPO;
|
||||
c9x.curve.value = expo;
|
||||
}
|
||||
else if (curve > 6) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
|
||||
c9x.curve.value = curve - 6;
|
||||
}
|
||||
else if (curve > 0) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
|
||||
c9x.curve.value = curve;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xLimitData::t_Gruvin9xLimitData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Gruvin9xLimitData));
|
||||
}
|
||||
|
||||
t_Gruvin9xLimitData::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xMixData::t_Gruvin9xMixData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Gruvin9xMixData));
|
||||
}
|
||||
|
||||
t_Gruvin9xMixData::operator MixData ()
|
||||
{
|
||||
MixData c9x;
|
||||
c9x.destCh = destCh;
|
||||
c9x.weight = weight;
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
|
||||
if (srcRaw == 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 7) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
|
||||
}
|
||||
else if (srcRaw == 8) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (srcRaw == 9) {
|
||||
if (swtch < 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, -swtch - 1);
|
||||
c9x.weight = -weight;
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, swtch - 1);
|
||||
}
|
||||
if (mltpx != MLTPX_REP)
|
||||
c9x.swtch = RawSwitch(SWITCH_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 12) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-10);
|
||||
}
|
||||
else if (srcRaw <= 20) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-13);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-21);
|
||||
}
|
||||
|
||||
c9x.delayUp = delayUp;
|
||||
c9x.delayDown = delayDown;
|
||||
c9x.speedUp = speedUp;
|
||||
c9x.speedDown = speedDown;
|
||||
c9x.carryTrim = carryTrim;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
c9x.sOffset = sOffset;
|
||||
|
||||
if (curve > 6) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_CUSTOM;
|
||||
c9x.curve.value = curve - 6;
|
||||
}
|
||||
else if (curve > 0) {
|
||||
c9x.curve.type = CurveReference::CURVE_REF_FUNC;
|
||||
c9x.curve.value = curve;
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
RawSource gruvin9xToSource(int8_t value)
|
||||
{
|
||||
if (value == 0) {
|
||||
return RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (value <= 7) {
|
||||
return RawSource(SOURCE_TYPE_STICK, value - 1);
|
||||
}
|
||||
else if (value == 8) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (value == 9) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (value <= 12) {
|
||||
return RawSource(SOURCE_TYPE_CYC, value-10);
|
||||
}
|
||||
else if (value <= 20) {
|
||||
return RawSource(SOURCE_TYPE_PPM, value-13);
|
||||
}
|
||||
else if (value <= 36) {
|
||||
return RawSource(SOURCE_TYPE_CH, value-21);
|
||||
}
|
||||
else {
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, value-36);
|
||||
}
|
||||
}
|
||||
|
||||
Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
{
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = gruvin9xToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = gruvin9xToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = gruvin9xToSwitch(v1).toValue();
|
||||
c9x.val2 = gruvin9xToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
Gruvin9xFuncSwData::operator FuncSwData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func + G9X_NUM_CHNOUT);
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xSwashRingData::t_Gruvin9xSwashRingData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Gruvin9xSwashRingData));
|
||||
}
|
||||
|
||||
t_Gruvin9xSwashRingData::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = gruvin9xToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xFlightModeData_v102::operator FlightModeData ()
|
||||
{
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
c9x.fadeIn = fadeIn;
|
||||
c9x.fadeOut = fadeOut;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xFlightModeData_v106::operator FlightModeData ()
|
||||
{
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
c9x.fadeIn = fadeIn;
|
||||
c9x.fadeOut = fadeOut;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
extern RawSwitch getEr9xTimerMode(int mode);
|
||||
|
||||
t_Gruvin9xTimerData::operator TimerData ()
|
||||
{
|
||||
TimerData c9x;
|
||||
c9x.mode = getEr9xTimerMode(mode);
|
||||
c9x.val = val;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xFrSkyChannelData::t_Gruvin9xFrSkyChannelData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Gruvin9xFrSkyChannelData));
|
||||
}
|
||||
|
||||
t_Gruvin9xFrSkyChannelData::operator FrSkyChannelData ()
|
||||
{
|
||||
FrSkyChannelData c9x;
|
||||
c9x.ratio = ratio;
|
||||
c9x.alarms[0].value = alarms_value[0];
|
||||
c9x.alarms[0].level = alarms_level & 3;
|
||||
c9x.alarms[0].greater = alarms_greater & 1;
|
||||
c9x.alarms[1].value = alarms_value[1];
|
||||
c9x.alarms[1].level = (alarms_level >> 2) & 3;
|
||||
c9x.alarms[1].greater = (alarms_greater >> 1) & 1;
|
||||
c9x.type = type;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xFrSkyData::t_Gruvin9xFrSkyData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Gruvin9xFrSkyData));
|
||||
}
|
||||
|
||||
t_Gruvin9xFrSkyData::operator FrSkyData ()
|
||||
{
|
||||
FrSkyData c9x;
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
c9x.timers[0] = timer1;
|
||||
c9x.timers[1] = timer2;
|
||||
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int i=0; i<G9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<G9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<G9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<G9X_MAX_CURVE9; i++) {
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xModelData_v103::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
c9x.timers[0] = timer1;
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int i=0; i<G9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<G9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<G9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<G9X_MAX_CURVE9; i++) {
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
c9x.timers[0] = timer1;
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (flightModeData[i].trim[j] > 125) {
|
||||
c9x.flightModeData[i].trimRef[j] = 0;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
else if (flightModeData[i].trim[j] < -125) {
|
||||
c9x.flightModeData[i].trimRef[j] = 129 + flightModeData[i].trim[j];
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
else {
|
||||
c9x.flightModeData[i].trim[j] += subtrim[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<G9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<G9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<G9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<G9X_MAX_CURVE9; i++) {
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<G9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
c9x.timers[0] = timer1;
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc-2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<G9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<G9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<G9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<G9X_MAX_CURVE9; i++) {
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[G9X_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<G9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<G9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
// c9x.safetySw[i] = safetySw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,421 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef gruvin9xeeprom_h
|
||||
#define gruvin9xeeprom_h
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "eeprominterface.h"
|
||||
#define GR9X_MAX_CSFUNC 13
|
||||
|
||||
PACK(typedef struct t_Gruvin9xTrainerMix_v103 {
|
||||
uint8_t srcChn:3; //0-7 = ch1-8
|
||||
int8_t swtch:5;
|
||||
int8_t studWeight:6;
|
||||
uint8_t mode:2; //off,add-mode,subst-mode
|
||||
|
||||
operator TrainerMix();
|
||||
t_Gruvin9xTrainerMix_v103() { memset(this, 0, sizeof(t_Gruvin9xTrainerMix_v103)); }
|
||||
|
||||
}) Gruvin9xTrainerMix_v103; //
|
||||
|
||||
PACK(typedef struct t_Gruvin9xTrainerMix_v104 {
|
||||
uint8_t srcChn:6; // 0-7 = ch1-8
|
||||
uint8_t mode:2; // off,add-mode,subst-mode
|
||||
int8_t studWeight;
|
||||
|
||||
operator TrainerMix();
|
||||
t_Gruvin9xTrainerMix_v104() { memset(this, 0, sizeof(t_Gruvin9xTrainerMix_v104)); }
|
||||
}) Gruvin9xTrainerMix_v104; //
|
||||
|
||||
PACK(typedef struct t_Gruvin9xTrainerData_v103 {
|
||||
int16_t calib[4];
|
||||
Gruvin9xTrainerMix_v103 mix[4];
|
||||
|
||||
operator TrainerData();
|
||||
}) Gruvin9xTrainerData_v103;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xTrainerData_v104 {
|
||||
int16_t calib[4];
|
||||
Gruvin9xTrainerMix_v104 mix[4];
|
||||
|
||||
operator TrainerData();
|
||||
t_Gruvin9xTrainerData_v104() { memset(this, 0, sizeof(t_Gruvin9xTrainerData_v104)); }
|
||||
}) Gruvin9xTrainerData_v104;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFrSkyRSSIAlarm {
|
||||
uint8_t level:2;
|
||||
int8_t value:6;
|
||||
}) Gruvin9xFrSkyRSSIAlarm;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xGeneral_v103 {
|
||||
uint8_t myVers;
|
||||
int16_t calibMid[7];
|
||||
int16_t calibSpanNeg[7];
|
||||
int16_t calibSpanPos[7];
|
||||
uint16_t chkSum;
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t lightSw;
|
||||
Gruvin9xTrainerData_v103 trainer;
|
||||
uint8_t view; //index of subview in main scrren
|
||||
uint8_t disableThrottleWarning:1;
|
||||
int8_t switchWarning:2; // -1=down, 0=off, 1=up
|
||||
uint8_t beeperVal:3;
|
||||
uint8_t disableMemoryWarning:1;
|
||||
uint8_t disableAlarmWarning:1;
|
||||
uint8_t stickMode;
|
||||
uint8_t inactivityTimer;
|
||||
uint8_t throttleReversed:1;
|
||||
uint8_t minuteBeep:1;
|
||||
uint8_t preBeep:1;
|
||||
uint8_t flashBeep:1;
|
||||
uint8_t disableSplashScreen:1;
|
||||
uint8_t enableTelemetryAlarm:1; // 0=no, 1=yes (Sound alarm when there's no telem. data coming in)
|
||||
uint8_t spare:2;
|
||||
uint8_t filterInput;
|
||||
uint8_t lightAutoOff;
|
||||
uint8_t templateSetup; //RETA order according to chout_ar array
|
||||
int8_t PPM_Multiplier;
|
||||
Gruvin9xFrSkyRSSIAlarm frskyRssiAlarms[2];
|
||||
|
||||
operator GeneralSettings();
|
||||
t_Gruvin9xGeneral_v103() { memset(this, 0, sizeof(t_Gruvin9xGeneral_v103)); }
|
||||
}) Gruvin9xGeneral_v103;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xGeneral_v104 {
|
||||
uint8_t myVers;
|
||||
int16_t calibMid[7];
|
||||
int16_t calibSpanNeg[7];
|
||||
int16_t calibSpanPos[7];
|
||||
uint16_t chkSum;
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t lightSw;
|
||||
Gruvin9xTrainerData_v104 trainer;
|
||||
uint8_t view; //index of subview in main scrren
|
||||
uint8_t disableThrottleWarning:1;
|
||||
int8_t switchWarning:2; // -1=down, 0=off, 1=up
|
||||
uint8_t beeperVal:3;
|
||||
uint8_t disableMemoryWarning:1;
|
||||
uint8_t disableAlarmWarning:1;
|
||||
uint8_t stickMode;
|
||||
uint8_t inactivityTimer;
|
||||
uint8_t throttleReversed:1;
|
||||
uint8_t minuteBeep:1;
|
||||
uint8_t preBeep:1;
|
||||
uint8_t flashBeep:1;
|
||||
uint8_t disableSplashScreen:1;
|
||||
uint8_t enableTelemetryAlarm:1; // 0=no, 1=yes (Sound alarm when there's no telem. data coming in)
|
||||
uint8_t spare:2;
|
||||
uint8_t filterInput;
|
||||
uint8_t lightAutoOff;
|
||||
uint8_t templateSetup; //RETA order according to chout_ar array
|
||||
int8_t PPM_Multiplier;
|
||||
Gruvin9xFrSkyRSSIAlarm frskyRssiAlarms[2];
|
||||
|
||||
operator GeneralSettings();
|
||||
t_Gruvin9xGeneral_v104() { memset(this, 0, sizeof(t_Gruvin9xGeneral_v104)); }
|
||||
}) Gruvin9xGeneral_v104;
|
||||
|
||||
typedef Gruvin9xGeneral_v104 Gruvin9xGeneral;
|
||||
|
||||
// eeprom modelspec
|
||||
|
||||
PACK(typedef struct t_Gruvin9xExpoData {
|
||||
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
|
||||
uint8_t chn:2;
|
||||
uint8_t curve:4; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
|
||||
int8_t swtch:5;
|
||||
uint8_t phase:3; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
|
||||
uint8_t negPhase:1;
|
||||
uint8_t weight:7;
|
||||
int8_t expo;
|
||||
|
||||
operator ExpoData();
|
||||
t_Gruvin9xExpoData();
|
||||
}) Gruvin9xExpoData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xLimitData {
|
||||
int8_t min;
|
||||
int8_t max;
|
||||
bool revert;
|
||||
int16_t offset;
|
||||
|
||||
operator LimitData();
|
||||
t_Gruvin9xLimitData();
|
||||
}) Gruvin9xLimitData;
|
||||
|
||||
#define MLTPX_ADD 0
|
||||
#define MLTPX_MUL 1
|
||||
#define MLTPX_REP 2
|
||||
|
||||
PACK(typedef struct t_Gruvin9xMixData {
|
||||
uint8_t destCh:5; // 0, 1..C9X_NUM_CHNOUT
|
||||
uint8_t mixWarn:3; // mixer warning
|
||||
uint8_t srcRaw; //
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t curve; // 0=symmetrisch, 1=no neg, 2=no pos
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint8_t carryTrim:1;
|
||||
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
|
||||
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Gruvin9xMixData();
|
||||
}) Gruvin9xMixData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xLogicalSwitchData { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Gruvin9xLogicalSwitchData() { memset(this, 0, sizeof(t_Gruvin9xLogicalSwitchData)); }
|
||||
}) Gruvin9xLogicalSwitchData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
|
||||
int8_t swtch;
|
||||
int8_t val;
|
||||
|
||||
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
|
||||
}) Gruvin9xSafetySwData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Gruvin9xFuncSwData() { memset(this, 0, sizeof(t_Gruvin9xFuncSwData)); }
|
||||
}) Gruvin9xFuncSwData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFrSkyChannelData {
|
||||
uint16_t ratio:12; // (Maximum resistor divider input volts +/- calibration. 0 means channel not used.
|
||||
// 0.01v steps from 0 to 40.95V. Ex. 6.60 Volts = 660. 40.95V = 4095
|
||||
uint16_t type:4; // channel display unit (0=volts, 1=raw, 2-15=reserverd.)
|
||||
uint8_t alarms_value[2]; // raw sample values 0..255
|
||||
uint8_t alarms_level:4; // two pairs of 2bits. none=0, yel=1, org=2, red=3
|
||||
uint8_t alarms_greater:2; // two alarms, 1 bit each. 0=LT(<), 1=GT(>)
|
||||
uint8_t spare:2;
|
||||
uint8_t barMin; // minimum for bar display (raw ADC value)
|
||||
uint8_t barMax; // ditto for max display (would G:NOT usually = ratio)
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Gruvin9xFrSkyChannelData();
|
||||
}) Gruvin9xFrSkyChannelData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFrSkyData {
|
||||
Gruvin9xFrSkyChannelData channels[2];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Gruvin9xFrSkyData();
|
||||
}) Gruvin9xFrSkyData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xSwashRingData { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
uint8_t invertAIL:1;
|
||||
uint8_t invertCOL:1;
|
||||
uint8_t type:5;
|
||||
uint8_t collectiveSource;
|
||||
uint8_t value;
|
||||
|
||||
operator SwashRingData();
|
||||
t_Gruvin9xSwashRingData();
|
||||
}) Gruvin9xSwashRingData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFlightModeData_v102 {
|
||||
int8_t trim[4]; // -125..125 => trim value, 127 => use trim of phase 0, -128, -127, -126 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator FlightModeData();
|
||||
t_Gruvin9xFlightModeData_v102() { memset(this, 0, sizeof(t_Gruvin9xFlightModeData_v102)); }
|
||||
}) Gruvin9xFlightModeData_v102;
|
||||
|
||||
|
||||
PACK(typedef struct t_Gruvin9xFlightModeData_v106 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator FlightModeData();
|
||||
t_Gruvin9xFlightModeData_v106() { memset(this, 0, sizeof(t_Gruvin9xFlightModeData_v106)); }
|
||||
}) Gruvin9xFlightModeData_v106;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xTimerData {
|
||||
int8_t mode:7; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint8_t dir:1; // 0=>Count Down, 1=>Count Up
|
||||
uint16_t val;
|
||||
|
||||
operator TimerData();
|
||||
t_Gruvin9xTimerData() { memset(this, 0, sizeof(t_Gruvin9xTimerData)); }
|
||||
}) Gruvin9xTimerData;
|
||||
|
||||
#define G9X_MAX_FLIGHT_MODES 5
|
||||
#define G9X_MAX_MIXERS 32
|
||||
#define G9X_MAX_EXPOS 14
|
||||
#define G9X_MAX_CURVE5 8
|
||||
#define G9X_MAX_CURVE9 8
|
||||
|
||||
#define G9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define G9X_NUM_CSW 12 // number of custom switches
|
||||
#define G9X_NUM_FSW 12 // number of functions assigned to switches
|
||||
|
||||
// TODO
|
||||
PACK(typedef struct t_Gruvin9xModelData_v102 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Gruvin9xTimerData timer1;
|
||||
uint8_t protocol:3;
|
||||
int8_t ppmNCH:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
uint8_t thrExpo:1; // Enable Throttle Expo
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Gruvin9xTimerData timer2;
|
||||
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
|
||||
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Gruvin9xModelData_v102() { memset(this, 0, sizeof(t_Gruvin9xModelData_v102)); }
|
||||
|
||||
}) Gruvin9xModelData_v102;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xModelData_v103 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Gruvin9xTimerData timer1;
|
||||
uint8_t protocol:3;
|
||||
int8_t ppmNCH:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
uint8_t thrExpo:1; // Enable Throttle Expo
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Gruvin9xTimerData timer2;
|
||||
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
|
||||
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Gruvin9xModelData_v103() { memset(this, 0, sizeof(t_Gruvin9xModelData_v103)); }
|
||||
|
||||
}) Gruvin9xModelData_v103;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xModelData_v105 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Gruvin9xTimerData timer1;
|
||||
uint8_t protocol:3;
|
||||
int8_t ppmNCH:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
uint8_t thrExpo:1; // Enable Throttle Expo
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Gruvin9xTimerData timer2;
|
||||
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
|
||||
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
int16_t subtrim[NUM_STICKS];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Gruvin9xModelData_v105() { memset(this, 0, sizeof(t_Gruvin9xModelData_v105)); }
|
||||
}) Gruvin9xModelData_v105;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xModelData_v106 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Gruvin9xTimerData timer1;
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t thrExpo:1; // Enable Throttle Expo
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Gruvin9xTimerData timer2;
|
||||
Gruvin9xMixData mixData[G9X_MAX_MIXERS];
|
||||
Gruvin9xLimitData limitData[G9X_NUM_CHNOUT];
|
||||
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
|
||||
int8_t curves5[G9X_MAX_CURVE5][5];
|
||||
int8_t curves9[G9X_MAX_CURVE9][9];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xFlightModeData_v106 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Gruvin9xModelData_v106() { memset(this, 0, sizeof(t_Gruvin9xModelData_v106)); }
|
||||
}) Gruvin9xModelData_v106;
|
||||
|
||||
typedef Gruvin9xModelData_v106 Gruvin9xModelData;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,232 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 <iostream>
|
||||
#include "gruvin9xinterface.h"
|
||||
#include "gruvin9xeeprom.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
|
||||
#define FILE_GENERAL 0
|
||||
#define FILE_MODEL(n) (1+n)
|
||||
|
||||
Gruvin9xInterface::Gruvin9xInterface(BoardEnum board):
|
||||
EEPROMInterface(board),
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
||||
Gruvin9xInterface::~Gruvin9xInterface()
|
||||
{
|
||||
delete efile;
|
||||
}
|
||||
|
||||
const char * Gruvin9xInterface::getName()
|
||||
{
|
||||
if (board == BOARD_STOCK)
|
||||
return "Gruvin9x";
|
||||
else
|
||||
return "Gruvin9x v4";
|
||||
}
|
||||
|
||||
const int Gruvin9xInterface::getEEpromSize()
|
||||
{
|
||||
if (board == BOARD_STOCK) {
|
||||
QString avrMCU = g.mcu();
|
||||
if (avrMCU==QString("m128")) {
|
||||
return EESIZE_STOCK*2;
|
||||
}
|
||||
return EESIZE_STOCK;
|
||||
} else {
|
||||
return EESIZE_GRUVIN9X;
|
||||
}
|
||||
}
|
||||
|
||||
const int Gruvin9xInterface::getMaxModels()
|
||||
{
|
||||
return 16;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Gruvin9xInterface::loadModel(ModelData &model, unsigned int stickMode, int version)
|
||||
{
|
||||
T _model;
|
||||
if ((version == 2 && efile->readRlc2((uint8_t*)&_model, sizeof(T))) ||
|
||||
(version == 1 && efile->readRlc1((uint8_t*)&_model, sizeof(T)))) {
|
||||
model = _model;
|
||||
if (stickMode) {
|
||||
applyStickModeToModel(model, stickMode);
|
||||
}
|
||||
}
|
||||
else {
|
||||
model.clear();
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Gruvin9xInterface::loadGeneral(GeneralSettings &settings, int version)
|
||||
{
|
||||
T _settings;
|
||||
if ((version == 2 && efile->readRlc2((uint8_t*)&_settings, sizeof(T))) ||
|
||||
(version == 1 && efile->readRlc1((uint8_t*)&_settings, sizeof(T)))) {
|
||||
settings = _settings;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::cerr << "error when loading general settings";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import... ";
|
||||
|
||||
if (size != this->getEEpromSize()) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
|
||||
uint8_t version;
|
||||
if (efile->readRlc2(&version, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (version == 0) {
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (efile->readRlc1(&version, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)version << " ";
|
||||
|
||||
switch(version) {
|
||||
case 5:
|
||||
case 100:
|
||||
case 101:
|
||||
case 102:
|
||||
case 103:
|
||||
case 104:
|
||||
case 105:
|
||||
// subtrims(16bits) + function switches added
|
||||
case 106:
|
||||
// trims(10bits), no subtrims
|
||||
break;
|
||||
default:
|
||||
std::cout << "not gruvin9x\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (version == 5) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1))
|
||||
return false;
|
||||
}
|
||||
else if (version < 104) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings))
|
||||
return false;
|
||||
}
|
||||
else if (version <= 106) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
efile->openRd(FILE_MODEL(i));
|
||||
if (version == 5) {
|
||||
loadModel<Gruvin9xModelData_v102>(radioData.models[i], radioData.generalSettings.stickMode+1, 1);
|
||||
}
|
||||
else if (version < 103) {
|
||||
loadModel<Gruvin9xModelData_v102>(radioData.models[i], radioData.generalSettings.stickMode+1);
|
||||
}
|
||||
else if (version == 103) {
|
||||
loadModel<Gruvin9xModelData_v103>(radioData.models[i], radioData.generalSettings.stickMode+1);
|
||||
}
|
||||
else if (version == 105) {
|
||||
loadModel<Gruvin9xModelData_v105>(radioData.models[i], radioData.generalSettings.stickMode+1);
|
||||
}
|
||||
else if (version == 106) {
|
||||
loadModel<Gruvin9xModelData_v106>(radioData.models[i], radioData.generalSettings.stickMode+1);
|
||||
}
|
||||
else {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
{
|
||||
std::cout << "NO!\n";
|
||||
// TODO an error
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::getSize(ModelData &model)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::getSize(GeneralSettings &settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::isAvailable(Protocol proto, int port)
|
||||
{
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case SILV_A:
|
||||
case SILV_B:
|
||||
case SILV_C:
|
||||
case CTP1009:
|
||||
case DSM2:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef gruvin9x_interface_h
|
||||
#define gruvin9x_interface_h
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class RleFile;
|
||||
|
||||
class Gruvin9xInterface : public EEPROMInterface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
Gruvin9xInterface(BoardEnum board);
|
||||
|
||||
virtual ~Gruvin9xInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
virtual const int getEEpromSize();
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
template <class T>
|
||||
void loadModel(ModelData &model, unsigned int stickMode=0, int version=2);
|
||||
|
||||
template <class T>
|
||||
bool loadGeneral(GeneralSettings &settings, int version=2);
|
||||
|
||||
RleFile *efile;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,859 @@
|
||||
#include <stdlib.h>
|
||||
#include <algorithm>
|
||||
#include "helpers.h"
|
||||
#include "open9xGruvin9xeeprom.h"
|
||||
#include <QObject>
|
||||
#include <QMessageBox>
|
||||
|
||||
extern void getEEPROMZString(char *dst, const char *src, int size);
|
||||
extern RawSwitch open9xStockToSwitch(int8_t sw);
|
||||
|
||||
t_Open9xGruvin9xFlightModeData_v207::operator FlightModeData ()
|
||||
{
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
c9x.fadeIn = fadeIn;
|
||||
c9x.fadeOut = fadeOut;
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.rotaryEncoders[i] = rotaryEncoders[i];
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xFlightModeData_v208::operator FlightModeData ()
|
||||
{
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
c9x.fadeIn = fadeIn;
|
||||
c9x.fadeOut = fadeOut;
|
||||
for (int i=0; i<2; i++)
|
||||
c9x.rotaryEncoders[i] = rotaryEncoders[i];
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xMixData_v207::operator MixData ()
|
||||
{
|
||||
MixData c9x;
|
||||
if (srcRaw) {
|
||||
c9x.destCh = destCh+1;
|
||||
if (srcRaw == 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 7) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
|
||||
}
|
||||
else if (srcRaw <= 9) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_ROTARY_ENCODER, srcRaw-8);
|
||||
}
|
||||
else if (srcRaw == 10) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
/* else if (srcRaw == 11) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_3POS);
|
||||
} */
|
||||
else if (srcRaw <= 32) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-11);
|
||||
}
|
||||
else if (srcRaw <= 35) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-33);
|
||||
}
|
||||
else if (srcRaw <= 43) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-36);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-44);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
|
||||
if (differential) {
|
||||
c9x.curve = CurveReference(CurveReference::CURVE_REF_DIFF, differential*2);
|
||||
}
|
||||
else {
|
||||
// TODO c9x.curve = curve;
|
||||
}
|
||||
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
c9x.delayUp = delayUp;
|
||||
c9x.delayDown = delayDown;
|
||||
c9x.speedUp = speedUp;
|
||||
c9x.speedDown = speedDown;
|
||||
c9x.carryTrim = carryTrim;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xMixData_v209::operator MixData ()
|
||||
{
|
||||
MixData c9x;
|
||||
if (srcRaw) {
|
||||
c9x.destCh = destCh+1;
|
||||
if (srcRaw == 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 7) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
|
||||
}
|
||||
else if (srcRaw <= 9) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_ROTARY_ENCODER, srcRaw-8);
|
||||
}
|
||||
else if (srcRaw <= 13) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_TRIM, srcRaw-10);
|
||||
}
|
||||
else if (srcRaw == 14) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (srcRaw == 15) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 36) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-15);
|
||||
}
|
||||
else if (srcRaw <= 39) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-37);
|
||||
}
|
||||
else if (srcRaw <= 47) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-40);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-48);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
|
||||
if (differential) {
|
||||
c9x.curve = CurveReference(CurveReference::CURVE_REF_DIFF, differential*2);
|
||||
}
|
||||
else {
|
||||
// TODO c9x.curve = curve;
|
||||
}
|
||||
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
c9x.delayUp = delayUp;
|
||||
c9x.delayDown = delayDown;
|
||||
c9x.speedUp = speedUp;
|
||||
c9x.speedDown = speedDown;
|
||||
c9x.carryTrim = carryTrim;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xMixData_v211::operator MixData ()
|
||||
{
|
||||
MixData c9x;
|
||||
if (srcRaw) {
|
||||
c9x.destCh = destCh+1;
|
||||
if (srcRaw == 0) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (srcRaw <= 7) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_STICK, srcRaw-1);
|
||||
}
|
||||
else if (srcRaw <= 9) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_ROTARY_ENCODER, srcRaw-8);
|
||||
}
|
||||
else if (srcRaw <= 13) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_TRIM, srcRaw-10);
|
||||
}
|
||||
else if (srcRaw == 14) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
else if (srcRaw == 15) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, 0);
|
||||
}
|
||||
else if (srcRaw <= 36) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_SWITCH, srcRaw-15);
|
||||
}
|
||||
else if (srcRaw <= 39) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CYC, srcRaw-37);
|
||||
}
|
||||
else if (srcRaw <= 47) {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_PPM, srcRaw-40);
|
||||
}
|
||||
else {
|
||||
c9x.srcRaw = RawSource(SOURCE_TYPE_CH, srcRaw-48);
|
||||
}
|
||||
c9x.weight = weight;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
|
||||
if (curveMode==0) {
|
||||
c9x.curve = CurveReference(CurveReference::CURVE_REF_DIFF, curveParam);
|
||||
}
|
||||
else {
|
||||
// TODO c9x.curve = curve;
|
||||
}
|
||||
|
||||
c9x.delayUp = delayUp;
|
||||
c9x.delayDown = delayDown;
|
||||
c9x.speedUp = speedUp;
|
||||
c9x.speedDown = speedDown;
|
||||
c9x.carryTrim = carryTrim;
|
||||
c9x.noExpo = noExpo;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
c9x.phases = phases;
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
RawSource open9xV4207ToSource(int8_t value)
|
||||
{
|
||||
if (value == 0) {
|
||||
return RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (value <= 7) {
|
||||
return RawSource(SOURCE_TYPE_STICK, value - 1);
|
||||
}
|
||||
else if (value <= 9) {
|
||||
return RawSource(SOURCE_TYPE_ROTARY_ENCODER, value - 8);
|
||||
}
|
||||
else if (value == 10) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
/* else if (value == 11) {
|
||||
return RawSource(SOURCE_TYPE_3POS);
|
||||
} */
|
||||
else if (value <= 14) {
|
||||
return RawSource(SOURCE_TYPE_CYC, value-12);
|
||||
}
|
||||
else if (value <= 22) {
|
||||
return RawSource(SOURCE_TYPE_PPM, value-15);
|
||||
}
|
||||
else if (value <= 38) {
|
||||
return RawSource(SOURCE_TYPE_CH, value-23);
|
||||
}
|
||||
else {
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, value-38);
|
||||
}
|
||||
}
|
||||
|
||||
RawSource open9xV4209ToSource(int8_t value)
|
||||
{
|
||||
if (value == 0) {
|
||||
return RawSource(SOURCE_TYPE_NONE);
|
||||
}
|
||||
else if (value <= 7) {
|
||||
return RawSource(SOURCE_TYPE_STICK, value - 1);
|
||||
}
|
||||
else if (value <= 9) {
|
||||
return RawSource(SOURCE_TYPE_ROTARY_ENCODER, value - 8);
|
||||
}
|
||||
else if (value <= 13) {
|
||||
return RawSource(SOURCE_TYPE_STICK, value - 10);
|
||||
}
|
||||
else if (value == 14) {
|
||||
return RawSource(SOURCE_TYPE_MAX);
|
||||
}
|
||||
/* else if (value == 15) {
|
||||
return RawSource(SOURCE_TYPE_3POS);
|
||||
} */
|
||||
else if (value <= 18) {
|
||||
return RawSource(SOURCE_TYPE_CYC, value-16);
|
||||
}
|
||||
else if (value <= 26) {
|
||||
return RawSource(SOURCE_TYPE_PPM, value-19);
|
||||
}
|
||||
else if (value <= 42) {
|
||||
return RawSource(SOURCE_TYPE_CH, value-27);
|
||||
}
|
||||
else {
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, value-42);
|
||||
}
|
||||
}
|
||||
|
||||
Open9xGruvin9xLogicalSwitchData_v207::operator LogicalSwitchData ()
|
||||
{
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9xV4207ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = open9xV4207ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xStockToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xStockToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
Open9xGruvin9xLogicalSwitchData_v209::operator LogicalSwitchData ()
|
||||
{
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9xV4209ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_EQUAL && c9x.func <= LS_FN_ELESS) {
|
||||
c9x.val2 = open9xV4209ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xStockToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xStockToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
if (func < 16) {
|
||||
c9x.func = (AssignFunc)(func);
|
||||
c9x.enabled=param & 0x01;
|
||||
c9x.param = (param>>1)<<1;
|
||||
}
|
||||
else {
|
||||
c9x.param = param;
|
||||
if (func <= 20)
|
||||
c9x.func = (AssignFunc)(func);
|
||||
else if (func == 21)
|
||||
c9x.func = FuncInstantTrim;
|
||||
else if (func == 22)
|
||||
c9x.func = FuncPlaySound;
|
||||
else if (func == 23)
|
||||
c9x.func = FuncPlayHaptic;
|
||||
else if (func == 24)
|
||||
c9x.func = FuncReset;
|
||||
else if (func == 25)
|
||||
c9x.func = FuncVario;
|
||||
else if (func == 26)
|
||||
c9x.func = FuncPlayPrompt;
|
||||
else if (func == 27)
|
||||
c9x.func = FuncPlayValue;
|
||||
else if (func == 28)
|
||||
c9x.func = FuncLogs;
|
||||
else if (func == 29)
|
||||
c9x.func = FuncBacklight;
|
||||
else if (func >= 30 && func <= 34)
|
||||
c9x.func = AssignFunc(FuncAdjustGV1 + func - 30);
|
||||
else
|
||||
c9x.clear();
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xFuncSwData_v210::operator FuncSwData ()
|
||||
{
|
||||
FuncSwData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
c9x.param = param;
|
||||
if (func < 22) {
|
||||
c9x.func = (AssignFunc)(func);
|
||||
c9x.enabled = delay;
|
||||
} else {
|
||||
if (func == 22)
|
||||
c9x.func = FuncPlaySound;
|
||||
else if (func == 23)
|
||||
c9x.func = FuncPlayHaptic;
|
||||
else if (func == 24)
|
||||
c9x.func = FuncReset;
|
||||
else if (func == 25)
|
||||
c9x.func = FuncVario;
|
||||
else if (func == 26)
|
||||
c9x.func = FuncPlayPrompt;
|
||||
else if (func == 27)
|
||||
c9x.func = FuncPlayValue;
|
||||
else if (func == 28)
|
||||
c9x.func = FuncLogs;
|
||||
else
|
||||
c9x.clear();
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xSwashRingData_v208::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9xV4207ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xSwashRingData_v209::operator SwashRingData ()
|
||||
{
|
||||
SwashRingData c9x;
|
||||
c9x.invertELE = invertELE;
|
||||
c9x.invertAIL = invertAIL;
|
||||
c9x.invertCOL = invertCOL;
|
||||
c9x.type = type;
|
||||
c9x.collectiveSource = open9xV4209ToSource(collectiveSource);
|
||||
c9x.value = value;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc - 2;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc - 2;
|
||||
c9x.disableThrottleWarning=disableThrottleWarning;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
c9x.frsky.varioCenterMax = varioSpeedUpMin;
|
||||
c9x.frsky.varioCenterMin = varioSpeedDownMin;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc - 2;
|
||||
c9x.disableThrottleWarning=disableThrottleWarning;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_209_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
for (int j = 0; j < 5; j++) {
|
||||
c9x.curves[i].points[j].x = -100 + 50 * i;
|
||||
c9x.curves[i].points[j].y = curves5[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_209_MAX_CURVE9; i++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].count = 9;
|
||||
for (int j = 0; j < 9; j++) {
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].x = -100 + 25 * i;
|
||||
c9x.curves[O9X_209_MAX_CURVE5 + i].points[j].y = curves9[i][j];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.varioSource = varioSource;
|
||||
c9x.frsky.varioCenterMax = varioSpeedUpMin;
|
||||
c9x.frsky.varioCenterMin = varioSpeedDownMin;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int line=0; line<4; line++) {
|
||||
for (int col=0; col<2; col++) {
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
|
||||
c9x.frsky.screens[1].body.lines[line].source[col] += (((frskyLinesXtra >> (4*line+2*col)) & 0x03) * 16);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++)
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc - 2;
|
||||
c9x.disableThrottleWarning=disableThrottleWarning;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
for (int j=0; j<crvinfo.points; j++)
|
||||
c9x.curves[i].points[j].y = crvinfo.crv[j];
|
||||
if (crvinfo.custom) {
|
||||
c9x.curves[i].points[0].x = -100;
|
||||
for (int j=1; j<crvinfo.points-1; j++)
|
||||
c9x.curves[i].points[j].x = crvinfo.crv[crvinfo.points+j-1];
|
||||
c9x.curves[i].points[crvinfo.points-1].x = +100;
|
||||
}
|
||||
else {
|
||||
for (int j=0; j<crvinfo.points; j++)
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++) {
|
||||
c9x.limitData[i].ppmCenter = servoCenter[i];
|
||||
}
|
||||
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
for (int i=0; i<O9X_MAX_TIMERS; i++) {
|
||||
c9x.timers[i] = timers[i];
|
||||
c9x.timers[i].persistent = timersXtra[i].remanent;
|
||||
c9x.timers[i].val = timersXtra[i].value;
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
c9x.thrTrim = thrTrim;
|
||||
c9x.trimInc = trimInc - 2;
|
||||
c9x.disableThrottleWarning=disableThrottleWarning;
|
||||
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
|
||||
c9x.beepANACenter = beepANACenter;
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<O9X_NUM_CHNOUT; i++)
|
||||
c9x.limitData[i] = limitData[i];
|
||||
for (int i=0; i<O9X_MAX_EXPOS; i++)
|
||||
c9x.expoData[i] = expoData[i];
|
||||
for (int i=0; i<O9X_MAX_CURVES; i++) {
|
||||
CurveInfo crvinfo = curveinfo(this, i);
|
||||
c9x.curves[i].type = (crvinfo.custom ? CurveData::CURVE_TYPE_CUSTOM : CurveData::CURVE_TYPE_STANDARD);
|
||||
c9x.curves[i].count = crvinfo.points;
|
||||
for (int j=0; j<crvinfo.points; j++)
|
||||
c9x.curves[i].points[j].y = crvinfo.crv[j];
|
||||
if (crvinfo.custom) {
|
||||
c9x.curves[i].points[0].x = -100;
|
||||
for (int j=1; j<crvinfo.points-1; j++)
|
||||
c9x.curves[i].points[j].x = crvinfo.crv[crvinfo.points+j-1];
|
||||
c9x.curves[i].points[crvinfo.points-1].x = +100;
|
||||
}
|
||||
else {
|
||||
for (int j=0; j<crvinfo.points; j++)
|
||||
c9x.curves[i].points[j].x = -100 + (200*i) / (crvinfo.points-1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<O9X_NUM_CSW; i++)
|
||||
c9x.customSw[i] = customSw[i];
|
||||
for (int i=0; i<O9X_NUM_FSW; i++)
|
||||
c9x.funcSw[i] = funcSw[i];
|
||||
c9x.swashRingData = swashR;
|
||||
c9x.frsky = frsky;
|
||||
c9x.switchWarningStates = switchWarningStates;
|
||||
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
|
||||
c9x.thrTraceSrc = thrTraceSrc;
|
||||
c9x.modelId = modelId;
|
||||
return c9x;
|
||||
}
|
||||
@@ -0,0 +1,365 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef open9xGruvin9xeeprom_h
|
||||
#define open9xGruvin9xeeprom_h
|
||||
|
||||
#define O9X_V4_MAX_CSFUNCOLD 13
|
||||
#define O9X_V4_MAX_CSFUNC 15
|
||||
|
||||
#include "open9xStockeeprom.h"
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xFlightModeData_v207 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[2];
|
||||
operator FlightModeData();
|
||||
t_Open9xGruvin9xFlightModeData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xFlightModeData_v207)); }
|
||||
}) Open9xGruvin9xFlightModeData_v207;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xFlightModeData_v208 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[2];
|
||||
operator FlightModeData();
|
||||
t_Open9xGruvin9xFlightModeData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xFlightModeData_v208)); }
|
||||
}) Open9xGruvin9xFlightModeData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xMixData_v207 {
|
||||
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
|
||||
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t weight;
|
||||
int8_t swtch:6;
|
||||
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
int8_t curve:6;
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint16_t srcRaw:7; //
|
||||
uint16_t differential:7;
|
||||
uint16_t carryTrim:2;
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xGruvin9xMixData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v207)); }
|
||||
}) Open9xGruvin9xMixData_v207;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xMixData_v209 {
|
||||
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
|
||||
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t weight;
|
||||
int8_t swtch:6;
|
||||
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
int8_t curve:6;
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint16_t srcRaw:6; //
|
||||
int16_t differential:7;
|
||||
int16_t carryTrim:3;
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xGruvin9xMixData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v209)); }
|
||||
}) Open9xGruvin9xMixData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xMixData_v211 {
|
||||
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
|
||||
uint8_t curveMode:1; // O=curve, 1=differential
|
||||
uint8_t noExpo:1;
|
||||
uint8_t spare:2;
|
||||
int8_t weight;
|
||||
int8_t swtch:6;
|
||||
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
uint8_t phases:5;
|
||||
int8_t carryTrim:3;
|
||||
uint8_t srcRaw:6;
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4;
|
||||
uint8_t speedDown:4;
|
||||
int8_t curveParam;
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xGruvin9xMixData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v211)); }
|
||||
}) Open9xGruvin9xMixData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v207 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xGruvin9xLogicalSwitchData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xLogicalSwitchData_v207)); }
|
||||
int8_t fromSource(RawSource source);
|
||||
RawSource toSource(int8_t value);
|
||||
}) Open9xGruvin9xLogicalSwitchData_v207;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xGruvin9xLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xLogicalSwitchData_v209)); }
|
||||
int8_t fromSource(RawSource source);
|
||||
RawSource toSource(int8_t value);
|
||||
}) Open9xGruvin9xLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xGruvin9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v203)); }
|
||||
}) Open9xGruvin9xFuncSwData_v203;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v210 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func:5;
|
||||
uint8_t delay:3;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xGruvin9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v210)); }
|
||||
}) Open9xGruvin9xFuncSwData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v208 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
uint8_t invertAIL:1;
|
||||
uint8_t invertCOL:1;
|
||||
uint8_t type:5;
|
||||
uint8_t collectiveSource;
|
||||
uint8_t value;
|
||||
|
||||
operator SwashRingData();
|
||||
t_Open9xGruvin9xSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xSwashRingData_v208)); }
|
||||
}) Open9xGruvin9xSwashRingData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v209 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
uint8_t invertAIL:1;
|
||||
uint8_t invertCOL:1;
|
||||
uint8_t type:5;
|
||||
uint8_t collectiveSource;
|
||||
uint8_t value;
|
||||
|
||||
operator SwashRingData();
|
||||
t_Open9xGruvin9xSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xSwashRingData_v209)); }
|
||||
}) Open9xGruvin9xSwashRingData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xFlightModeData_v207 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v205 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xGruvin9xModelData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v207)); }
|
||||
}) Open9xGruvin9xModelData_v207;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v207 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xGruvin9xModelData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v208)); }
|
||||
}) Open9xGruvin9xModelData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xGruvin9xModelData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v209)); }
|
||||
}) Open9xGruvin9xModelData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xFrSkyData_v210 frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xGruvin9xModelData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v210)); }
|
||||
}) Open9xGruvin9xModelData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xGruvin9xMixData_v211 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xFrSkyData_v210 frsky;
|
||||
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xGruvin9xModelData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xModelData_v211)); }
|
||||
}) Open9xGruvin9xModelData_v211;
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,519 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef open9xSky9xeeprom_h
|
||||
#define open9xSky9xeeprom_h
|
||||
|
||||
#include "open9xStockeeprom.h"
|
||||
|
||||
#define O9X_ARM_MAX_FLIGHT_MODES 9
|
||||
#define O9X_ARM_MAX_MIXERS 64
|
||||
#define O9X_ARM_MAX_EXPOS 32
|
||||
#define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16
|
||||
#define O9X_ARM_NUM_CSW 32 // number of custom switches
|
||||
#define O9X_ARM_NUM_FSW 32 // number of functions assigned to switches
|
||||
#define O9X_ARM_MAX_CURVES 16
|
||||
#define O9X_ARM_NUM_POINTS 512
|
||||
#define O9X_ARM_MAX_CSFUNCOLD 13
|
||||
#define O9X_ARM_MAX_CSFUNC 15
|
||||
|
||||
PACK(typedef struct t_Open9xArmTimerData_v202 {
|
||||
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint16_t val;
|
||||
|
||||
operator TimerData();
|
||||
t_Open9xArmTimerData_v202() { memset(this, 0, sizeof(t_Open9xArmTimerData_v202)); }
|
||||
}) Open9xArmTimerData_v202;
|
||||
|
||||
PACK(typedef struct t_Open9xArmExpoData_v208 {
|
||||
uint8_t mode; // 0=end, 1=pos, 2=neg, 3=both
|
||||
uint8_t chn;
|
||||
int8_t curve; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
|
||||
int8_t swtch;
|
||||
int8_t phase; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
|
||||
uint8_t weight;
|
||||
int8_t expo;
|
||||
|
||||
operator ExpoData();
|
||||
t_Open9xArmExpoData_v208() { memset(this, 0, sizeof(t_Open9xArmExpoData_v208)); }
|
||||
}) Open9xArmExpoData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmExpoData_v210 {
|
||||
uint8_t mode; // 0=end, 1=pos, 2=neg, 3=both
|
||||
uint8_t chn;
|
||||
int8_t curve; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
|
||||
int8_t swtch;
|
||||
int8_t phase; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
|
||||
uint8_t weight;
|
||||
int8_t expo;
|
||||
char name[6];
|
||||
uint8_t spare[4];
|
||||
|
||||
operator ExpoData();
|
||||
t_Open9xArmExpoData_v210() { memset(this, 0, sizeof(t_Open9xArmExpoData_v210)); }
|
||||
}) Open9xArmExpoData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmExpoData_v212 {
|
||||
uint8_t mode; // 0=end, 1=pos, 2=neg, 3=both
|
||||
uint8_t chn;
|
||||
int8_t swtch;
|
||||
uint16_t phases;
|
||||
int8_t weight;
|
||||
uint8_t curveMode;
|
||||
char name[6];
|
||||
int8_t curveParam;
|
||||
|
||||
operator ExpoData();
|
||||
t_Open9xArmExpoData_v212() { memset(this, 0, sizeof(t_Open9xArmExpoData_v212)); }
|
||||
}) Open9xArmExpoData_v212;
|
||||
|
||||
PACK(typedef struct t_Open9xArmMixData_v208 {
|
||||
uint8_t destCh; // 0, 1..C9X_NUM_CHNOUT
|
||||
int8_t phase; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t mltpx; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
int8_t curve;
|
||||
uint8_t mixWarn; // mixer warning
|
||||
uint8_t delayUp;
|
||||
uint8_t delayDown;
|
||||
uint8_t speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown; // 0 nichts
|
||||
uint8_t srcRaw; //
|
||||
int8_t differential;
|
||||
uint8_t carryTrim;
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xArmMixData_v208() { memset(this, 0, sizeof(t_Open9xArmMixData_v208)); }
|
||||
}) Open9xArmMixData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmMixData_v209 {
|
||||
uint8_t destCh; // 0, 1..C9X_NUM_CHNOUT
|
||||
int8_t phase; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t mltpx; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
int8_t curve;
|
||||
uint8_t mixWarn; // mixer warning
|
||||
uint8_t delayUp;
|
||||
uint8_t delayDown;
|
||||
uint8_t speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown; // 0 nichts
|
||||
uint8_t srcRaw; //
|
||||
int8_t differential;
|
||||
int8_t carryTrim;
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xArmMixData_v209() { memset(this, 0, sizeof(t_Open9xArmMixData_v209)); }
|
||||
}) Open9xArmMixData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xArmMixData_v210 {
|
||||
uint8_t destCh; // 0, 1..C9X_NUM_CHNOUT
|
||||
int8_t phase; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t mltpx; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
int8_t curve;
|
||||
uint8_t mixWarn; // mixer warning
|
||||
uint8_t delayUp;
|
||||
uint8_t delayDown;
|
||||
uint8_t speedUp; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown; // 0 nichts
|
||||
uint8_t srcRaw; //
|
||||
int8_t differential;
|
||||
int8_t carryTrim;
|
||||
int8_t sOffset;
|
||||
char name[6];
|
||||
uint8_t spare[4];
|
||||
|
||||
operator MixData();
|
||||
t_Open9xArmMixData_v210() { memset(this, 0, sizeof(t_Open9xArmMixData_v210)); }
|
||||
}) Open9xArmMixData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmMixData_v212 {
|
||||
uint8_t destCh;
|
||||
uint16_t phases;
|
||||
uint8_t curveMode:1; // O=curve, 1=differential
|
||||
uint8_t noExpo:1;
|
||||
int8_t carryTrim:3;
|
||||
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
uint8_t spare:1;
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
int8_t curveParam;
|
||||
uint8_t mixWarn; // mixer warning
|
||||
uint8_t delayUp;
|
||||
uint8_t delayDown;
|
||||
uint8_t speedUp;
|
||||
uint8_t speedDown;
|
||||
uint8_t srcRaw;
|
||||
int8_t sOffset;
|
||||
char name[6];
|
||||
|
||||
operator MixData();
|
||||
t_Open9xArmMixData_v212() { memset(this, 0, sizeof(t_Open9xArmMixData_v212)); }
|
||||
}) Open9xArmMixData_v212;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFlightModeData_v208 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
operator FlightModeData();
|
||||
t_Open9xArmFlightModeData_v208() { memset(this, 0, sizeof(t_Open9xArmFlightModeData_v208)); }
|
||||
}) Open9xArmFlightModeData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFlightModeData_v212 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[1];
|
||||
operator FlightModeData();
|
||||
t_Open9xArmFlightModeData_v212() { memset(this, 0, sizeof(t_Open9xArmFlightModeData_v212)); }
|
||||
}) Open9xArmFlightModeData_v212;
|
||||
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v208 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v208() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v208)); }
|
||||
}) Open9xArmLogicalSwitchData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v209)); }
|
||||
}) Open9xArmLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v210 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
uint8_t delay;
|
||||
uint8_t duration;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v210() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v210)); }
|
||||
}) Open9xArmLogicalSwitchData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xArmFuncSwData_v208() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v208)); }
|
||||
}) Open9xArmFuncSwData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFuncSwData_v210 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
char param[6];
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xArmFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v210)); }
|
||||
}) Open9xArmFuncSwData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFuncSwData_v211 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
char param[6];
|
||||
uint8_t delay;
|
||||
uint8_t spare;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xArmFuncSwData_v211() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v211)); }
|
||||
}) Open9xArmFuncSwData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xArmSwashRingData_v208 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
uint8_t invertAIL:1;
|
||||
uint8_t invertCOL:1;
|
||||
uint8_t type:5;
|
||||
uint8_t collectiveSource;
|
||||
uint8_t value;
|
||||
|
||||
operator SwashRingData();
|
||||
t_Open9xArmSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v208)); }
|
||||
}) Open9xArmSwashRingData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmSwashRingData_v209 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
uint8_t invertAIL:1;
|
||||
uint8_t invertCOL:1;
|
||||
uint8_t type:5;
|
||||
uint8_t collectiveSource;
|
||||
uint8_t value;
|
||||
|
||||
operator SwashRingData();
|
||||
t_Open9xArmSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v209)); }
|
||||
}) Open9xArmSwashRingData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xArmSwashRingData_v210 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
uint8_t invertAIL:1;
|
||||
uint8_t invertCOL:1;
|
||||
uint8_t type:5;
|
||||
uint8_t collectiveSource;
|
||||
uint8_t value;
|
||||
|
||||
operator SwashRingData();
|
||||
t_Open9xArmSwashRingData_v210() { memset(this, 0, sizeof(t_Open9xArmSwashRingData_v210)); }
|
||||
}) Open9xArmSwashRingData_v210;
|
||||
|
||||
|
||||
PACK(typedef struct t_Open9xArmFrSkyBarData_v210 {
|
||||
uint8_t source;
|
||||
uint8_t barMin; // minimum for bar display
|
||||
uint8_t barMax; // ditto for max display (would usually = ratio)
|
||||
}) Open9xArmFrSkyBarData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFrSkyData_v210 {
|
||||
Open9xFrSkyChannelData_v208 channels[2];
|
||||
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
|
||||
uint8_t voltsSource:2;
|
||||
uint8_t blades:2;
|
||||
uint8_t currentSource:2;
|
||||
Open9xArmFrSkyBarData_v210 bars[4];
|
||||
Open9xFrSkyRSSIAlarm rssiAlarms[2];
|
||||
uint8_t lines[4*2*2];
|
||||
uint8_t spare[4];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xArmFrSkyData_v210() { memset(this, 0, sizeof(t_Open9xArmFrSkyData_v210)); }
|
||||
}) Open9xArmFrSkyData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFrSkyData_v211 {
|
||||
Open9xFrSkyChannelData_v208 channels[2];
|
||||
Open9xFrSkyRSSIAlarm rssiAlarms[2];
|
||||
uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
|
||||
uint8_t voltsSource;
|
||||
uint8_t blades; // How many blades for RPMs, 0=2 blades, 1=3 blades
|
||||
uint8_t currentSource;
|
||||
Open9xArmFrSkyBarData_v210 bars[4];
|
||||
uint8_t lines[4*2*2];
|
||||
uint8_t varioSource;
|
||||
uint8_t varioSpeedUpMin; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
uint8_t spare[4];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xArmFrSkyData_v211() { memset(this, 0, sizeof(t_Open9xArmFrSkyData_v211)); }
|
||||
}) Open9xArmFrSkyData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v208 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v208 swashR;
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xArmModelData_v208() { memset(this, 0, sizeof(t_Open9xArmModelData_v208)); }
|
||||
}) Open9xArmModelData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v209 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xArmModelData_v209() { memset(this, 0, sizeof(t_Open9xArmModelData_v209)); }
|
||||
}) Open9xArmModelData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFrSkyData_v210 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xArmModelData_v210() { memset(this, 0, sizeof(t_Open9xArmModelData_v210)); }
|
||||
|
||||
}) Open9xArmModelData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v210 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_ARM_NUM_CHNOUT];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xArmFrSkyData_v211 frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xArmModelData_v211() { memset(this, 0, sizeof(t_Open9xArmModelData_v211)); }
|
||||
}) Open9xArmModelData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xArmTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint16_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xArmMixData_v212 mixData[O9X_ARM_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_ARM_NUM_CHNOUT];
|
||||
Open9xArmExpoData_v212 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v210 swashR;
|
||||
Open9xArmFlightModeData_v212 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xArmFrSkyData_v211 frsky;
|
||||
Open9xTimerDataExtra timersXtra[O9X_MAX_TIMERS];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xArmModelData_v212() { memset(this, 0, sizeof(t_Open9xArmModelData_v212)); }
|
||||
}) Open9xArmModelData_v212;
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,819 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#ifndef open9xstockeeprom_h
|
||||
#define open9xstockeeprom_h
|
||||
|
||||
#define O9X_MAX_CSFUNCOLD 13
|
||||
#define O9X_MAX_CSFUNC 15
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "eeprominterface.h"
|
||||
#include <qbytearray.h>
|
||||
|
||||
int8_t open9xV4209FromSource(RawSource source);
|
||||
int8_t open9xStock209FromSource(RawSource source);
|
||||
RawSource open9xV4209ToSource(int8_t value);
|
||||
RawSource open9xStock209ToSource(int8_t value);
|
||||
int8_t open9xStockFromSwitch(const RawSwitch & sw);
|
||||
RawSwitch open9xStockToSwitch(int8_t sw);
|
||||
|
||||
struct CurveInfo {
|
||||
int8_t *crv;
|
||||
uint8_t points;
|
||||
bool custom;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
int8_t *curveaddress(T * model, uint8_t idx)
|
||||
{
|
||||
return &model->points[idx==0 ? 0 : 5*idx+model->curves[idx-1]];
|
||||
}
|
||||
|
||||
template <class T>
|
||||
extern CurveInfo curveinfo(T * model, uint8_t idx)
|
||||
{
|
||||
CurveInfo result;
|
||||
result.crv = curveaddress(model, idx);
|
||||
int8_t *next = curveaddress(model, idx+1);
|
||||
uint8_t size = next - result.crv;
|
||||
if (size % 2 == 0) {
|
||||
result.points = (size / 2) + 1;
|
||||
result.custom = true;
|
||||
}
|
||||
else {
|
||||
result.points = size;
|
||||
result.custom = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyRSSIAlarm {
|
||||
uint8_t level:2;
|
||||
int8_t value:6;
|
||||
FrSkyRSSIAlarm get(int index);
|
||||
t_Open9xFrSkyRSSIAlarm() { memset(this, 0, sizeof(t_Open9xFrSkyRSSIAlarm)); }
|
||||
}) Open9xFrSkyRSSIAlarm;
|
||||
|
||||
PACK(typedef struct t_Open9xExpoData_v201 {
|
||||
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
|
||||
uint8_t chn:2;
|
||||
uint8_t curve:4; // 0=no curve, 1-6=std curves, 7-10=CV1-CV4, 11-15=CV9-CV13
|
||||
int8_t swtch:5;
|
||||
uint8_t phase:3; // if negPhase is 0: 0=normal, 5=FP4 if negPhase is 1: 5=!FP4
|
||||
uint8_t negPhase:1;
|
||||
uint8_t weight:7;
|
||||
int8_t expo;
|
||||
|
||||
operator ExpoData();
|
||||
t_Open9xExpoData_v201() { memset(this, 0, sizeof(t_Open9xExpoData_v201)); }
|
||||
}) Open9xExpoData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xExpoData_v211 {
|
||||
uint8_t mode:2; // 0=end, 1=pos, 2=neg, 3=both
|
||||
int8_t swtch:6;
|
||||
uint8_t chn:2;
|
||||
uint8_t phases:5;
|
||||
uint8_t curveMode:1;
|
||||
uint8_t weight; // we have one bit spare here :)
|
||||
int8_t curveParam;
|
||||
|
||||
operator ExpoData();
|
||||
t_Open9xExpoData_v211() { memset(this, 0, sizeof(t_Open9xExpoData_v211)); }
|
||||
}) Open9xExpoData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xLimitData_v201 {
|
||||
int8_t min;
|
||||
int8_t max;
|
||||
bool revert;
|
||||
int16_t offset;
|
||||
|
||||
operator LimitData();
|
||||
t_Open9xLimitData_v201() { memset(this, 0, sizeof(t_Open9xLimitData_v201)); }
|
||||
}) Open9xLimitData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xLimitData_v211 {
|
||||
int8_t min;
|
||||
int8_t max;
|
||||
int8_t ppmCenter;
|
||||
int16_t offset:14;
|
||||
uint16_t symetrical:1;
|
||||
uint16_t revert:1;
|
||||
|
||||
operator LimitData();
|
||||
t_Open9xLimitData_v211() { memset(this, 0, sizeof(t_Open9xLimitData_v211)); }
|
||||
}) Open9xLimitData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xMixData_v201 {
|
||||
uint8_t destCh:5; // 0, 1..C9X_NUM_CHNOUT
|
||||
uint8_t mixWarn:3; // mixer warning
|
||||
uint8_t srcRaw; //
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t curve; // 0=symmetrisch, 1=no neg, 2=no pos
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint8_t carryTrim:1;
|
||||
uint8_t mltpx:3; // multiplex method 0=+ 1=* 2=replace
|
||||
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xMixData_v201() { memset(this, 0, sizeof(t_Open9xMixData_v201)); }
|
||||
}) Open9xMixData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xMixData_v203 {
|
||||
uint8_t destCh:5; // 0, 1..C9X_NUM_CHNOUT
|
||||
uint8_t mixWarn:3; // mixer warning
|
||||
uint8_t srcRaw; //
|
||||
int8_t weight;
|
||||
int8_t swtch;
|
||||
uint8_t curve;
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint8_t carryTrim:2;
|
||||
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xMixData_v203() { memset(this, 0, sizeof(t_Open9xMixData_v203)); }
|
||||
}) Open9xMixData_v203;
|
||||
|
||||
PACK(typedef struct t_Open9xMixData_v205 {
|
||||
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
|
||||
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t weight;
|
||||
int8_t swtch:6;
|
||||
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
int8_t curve:6;
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint16_t srcRaw:7; //
|
||||
int16_t differential:7;
|
||||
uint16_t carryTrim:2;
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xMixData_v205() { memset(this, 0, sizeof(t_Open9xMixData_v205)); }
|
||||
}) Open9xMixData_v205;
|
||||
|
||||
PACK(typedef struct t_Open9xMixData_v209 {
|
||||
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
|
||||
int8_t phase:4; // -5=!FP4, 0=normal, 5=FP4
|
||||
int8_t weight;
|
||||
int8_t swtch:6;
|
||||
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
int8_t curve:6;
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4; // Servogeschwindigkeit aus Tabelle (10ms Cycle)
|
||||
uint8_t speedDown:4; // 0 nichts
|
||||
uint16_t srcRaw:6;
|
||||
int16_t differential:7;
|
||||
int16_t carryTrim:3;
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xMixData_v209() { memset(this, 0, sizeof(t_Open9xMixData_v209)); }
|
||||
}) Open9xMixData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xMixData_v211 {
|
||||
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
|
||||
uint8_t curveMode:1; // O=curve, 1=differential
|
||||
uint8_t noExpo:1;
|
||||
uint8_t spare:2;
|
||||
int8_t weight;
|
||||
int8_t swtch:6;
|
||||
uint8_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
uint8_t phases:5;
|
||||
int8_t carryTrim:3;
|
||||
uint8_t srcRaw:6;
|
||||
uint8_t mixWarn:2; // mixer warning
|
||||
uint8_t delayUp:4;
|
||||
uint8_t delayDown:4;
|
||||
uint8_t speedUp:4;
|
||||
uint8_t speedDown:4;
|
||||
int8_t curveParam;
|
||||
int8_t sOffset;
|
||||
|
||||
operator MixData();
|
||||
t_Open9xMixData_v211() { memset(this, 0, sizeof(t_Open9xMixData_v211)); }
|
||||
}) Open9xMixData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xLogicalSwitchData_v208 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xLogicalSwitchData_v208() { memset(this, 0, sizeof(t_Open9xLogicalSwitchData_v208)); }
|
||||
t_Open9xLogicalSwitchData_v208(LogicalSwitchData&);
|
||||
}) Open9xLogicalSwitchData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xLogicalSwitchData_v209)); }
|
||||
}) Open9xLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
|
||||
int8_t swtch;
|
||||
int8_t val;
|
||||
|
||||
t_Open9xSafetySwData() { memset(this, 0, sizeof(t_Open9xSafetySwData)); }
|
||||
}) Open9xSafetySwData;
|
||||
|
||||
PACK(typedef struct t_Open9xFuncSwData_v201 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xFuncSwData_v201() { memset(this, 0, sizeof(t_Open9xFuncSwData_v201)); }
|
||||
}) Open9xFuncSwData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xFuncSwData_v203 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xFuncSwData_v203)); }
|
||||
}) Open9xFuncSwData_v203;
|
||||
|
||||
PACK(typedef struct t_Open9xFuncSwData_v210 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
uint8_t func:5;
|
||||
uint8_t delay:3;
|
||||
uint8_t param;
|
||||
|
||||
operator FuncSwData();
|
||||
t_Open9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xFuncSwData_v210)); }
|
||||
}) Open9xFuncSwData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyChannelData_v201 {
|
||||
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t type:4; // channel unit (0=volts, ...)
|
||||
int8_t offset:4; // calibration offset. Signed 0.1V steps. EG. -4 to substract 0.4V
|
||||
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_level:4;
|
||||
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
|
||||
uint8_t spare:2;
|
||||
uint8_t barMin; // minimum for bar display
|
||||
uint8_t barMax; // ditto for max display (would usually = ratio)
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Open9xFrSkyChannelData_v201() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v201)); }
|
||||
}) Open9xFrSkyChannelData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyChannelData_v203 {
|
||||
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t type; // channel unit (0=volts, ...)
|
||||
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_level:4;
|
||||
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
|
||||
uint8_t spare:2;
|
||||
uint8_t barMin:4; // minimum for bar display
|
||||
uint8_t barMax:4; // ditto for max display (would usually = ratio)
|
||||
int8_t offset; // calibration offset. Signed 0.1V steps. EG. -4 to substract 0.4V
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Open9xFrSkyChannelData_v203() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v203)); }
|
||||
}) Open9xFrSkyChannelData_v203;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyChannelData_v204 {
|
||||
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t type; // channel unit (0=volts, ...)
|
||||
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_level:4;
|
||||
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
|
||||
uint8_t multiplier:2;
|
||||
int8_t offset; // calibration offset. Signed 0.1V steps. EG. -4 to substract 0.4V
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Open9xFrSkyChannelData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v204)); }
|
||||
}) Open9xFrSkyChannelData_v204;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyChannelData_v208 {
|
||||
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
int16_t offset:12;
|
||||
uint16_t type:4; // channel unit (0=volts, ...)
|
||||
uint8_t alarms_value[2]; // 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
|
||||
uint8_t alarms_level:4;
|
||||
uint8_t alarms_greater:2; // 0=LT(<), 1=GT(>)
|
||||
uint8_t multiplier:2;
|
||||
|
||||
operator FrSkyChannelData();
|
||||
t_Open9xFrSkyChannelData_v208() { memset(this, 0, sizeof(t_Open9xFrSkyChannelData_v208)); }
|
||||
}) Open9xFrSkyChannelData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyData_v201 {
|
||||
Open9xFrSkyChannelData_v201 channels[2];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xFrSkyData_v201() { memset(this, 0, sizeof(t_Open9xFrSkyData_v201)); }
|
||||
}) Open9xFrSkyData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyData_v202 {
|
||||
Open9xFrSkyChannelData_v201 channels[2];
|
||||
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
|
||||
uint8_t spare:6;
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xFrSkyData_v202() { memset(this, 0, sizeof(t_Open9xFrSkyData_v202)); }
|
||||
}) Open9xFrSkyData_v202;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyData_v203 {
|
||||
Open9xFrSkyChannelData_v203 channels[2];
|
||||
uint8_t usrProto; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xFrSkyData_v203() { memset(this, 0, sizeof(t_Open9xFrSkyData_v203)); }
|
||||
}) Open9xFrSkyData_v203;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyBarData_v204 {
|
||||
uint16_t source:4;
|
||||
uint16_t barMin:6; // minimum for bar display
|
||||
uint16_t barMax:6; // ditto for max display (would usually = ratio)
|
||||
|
||||
operator FrSkyBarData();
|
||||
t_Open9xFrSkyBarData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyBarData_v204)); }
|
||||
}) Open9xFrSkyBarData_v204;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyData_v204 {
|
||||
Open9xFrSkyChannelData_v204 channels[2];
|
||||
uint8_t usrProto:3; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
|
||||
uint8_t imperial:1;
|
||||
uint8_t blades:2;
|
||||
uint8_t spare:2;
|
||||
Open9xFrSkyBarData_v204 bars[4];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xFrSkyData_v204() { memset(this, 0, sizeof(t_Open9xFrSkyData_v204)); }
|
||||
}) Open9xFrSkyData_v204;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyData_v205 {
|
||||
Open9xFrSkyChannelData_v204 channels[2];
|
||||
uint8_t usrProto:3; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
|
||||
uint8_t imperial:1;
|
||||
uint8_t blades:2;
|
||||
uint8_t spare:2;
|
||||
Open9xFrSkyBarData_v204 bars[4];
|
||||
Open9xFrSkyRSSIAlarm rssiAlarms[2];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xFrSkyData_v205() { memset(this, 0, sizeof(t_Open9xFrSkyData_v205)); }
|
||||
}) Open9xFrSkyData_v205;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyData_v208 {
|
||||
Open9xFrSkyChannelData_v208 channels[2];
|
||||
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
|
||||
uint8_t voltsSource:2;
|
||||
uint8_t blades:2;
|
||||
uint8_t currentSource:2;
|
||||
Open9xFrSkyBarData_v204 bars[4];
|
||||
Open9xFrSkyRSSIAlarm rssiAlarms[2];
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xFrSkyData_v208() { memset(this, 0, sizeof(t_Open9xFrSkyData_v208)); }
|
||||
}) Open9xFrSkyData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xFrSkyData_v210 {
|
||||
Open9xFrSkyChannelData_v208 channels[2];
|
||||
uint8_t usrProto:2; // Protocol in FrSky user data, 0=None, 1=FrSky hub, 2=WS HowHigh
|
||||
uint8_t blades:2; // How many blades for RPMs, 0=2 blades, 1=3 blades
|
||||
uint8_t spare1:4;
|
||||
uint8_t voltsSource:3;
|
||||
uint8_t currentSource:3;
|
||||
uint8_t spare2:2;
|
||||
Open9xFrSkyBarData_v204 bars[4];
|
||||
Open9xFrSkyRSSIAlarm rssiAlarms[2];
|
||||
uint8_t lines[4];
|
||||
uint16_t linesXtra;
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
|
||||
operator FrSkyData();
|
||||
t_Open9xFrSkyData_v210() { memset(this, 0, sizeof(t_Open9xFrSkyData_v210)); }
|
||||
}) Open9xFrSkyData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xSwashRingData_v208 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
uint8_t invertAIL:1;
|
||||
uint8_t invertCOL:1;
|
||||
uint8_t type:5;
|
||||
uint8_t collectiveSource;
|
||||
uint8_t value;
|
||||
|
||||
operator SwashRingData();
|
||||
t_Open9xSwashRingData_v208() { memset(this, 0, sizeof(t_Open9xSwashRingData_v208)); }
|
||||
}) Open9xSwashRingData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xSwashRingData_v209 { // Swash Ring data
|
||||
uint8_t invertELE:1;
|
||||
uint8_t invertAIL:1;
|
||||
uint8_t invertCOL:1;
|
||||
uint8_t type:5;
|
||||
uint8_t collectiveSource;
|
||||
uint8_t value;
|
||||
|
||||
operator SwashRingData();
|
||||
t_Open9xSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xSwashRingData_v209)); }
|
||||
}) Open9xSwashRingData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xFlightModeData_v201 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator FlightModeData();
|
||||
t_Open9xFlightModeData_v201() { memset(this, 0, sizeof(t_Open9xFlightModeData_v201)); }
|
||||
}) Open9xFlightModeData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xTimerData_v201 {
|
||||
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint16_t val:14;
|
||||
uint16_t persistent:1;
|
||||
uint16_t dir:1; // 0=>Count Down, 1=>Count Up
|
||||
|
||||
operator TimerData();
|
||||
t_Open9xTimerData_v201() { memset(this, 0, sizeof(t_Open9xTimerData_v201)); }
|
||||
}) Open9xTimerData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xTimerData_v202 {
|
||||
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint16_t val;
|
||||
|
||||
operator TimerData();
|
||||
t_Open9xTimerData_v202() { memset(this, 0, sizeof(t_Open9xTimerData_v202)); }
|
||||
}) Open9xTimerData_v202;
|
||||
|
||||
PACK(typedef struct t_Open9xTimerDataExtra {
|
||||
uint16_t remanent:1;
|
||||
uint16_t value:15;
|
||||
t_Open9xTimerDataExtra() { memset(this, 0, sizeof(t_Open9xTimerDataExtra)); }
|
||||
}) Open9xTimerDataExtra;
|
||||
|
||||
#define O9X_MAX_TIMERS 2
|
||||
#define O9X_MAX_FLIGHT_MODES 5
|
||||
#define O9X_MAX_MIXERS 32
|
||||
#define O9X_MAX_EXPOS 14
|
||||
#define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16
|
||||
#define O9X_NUM_CSW 12 // number of custom switches
|
||||
#define O9X_NUM_FSW 16 // number of functions assigned to switches
|
||||
#define O9X_MAX_CURVES 8
|
||||
#define O9X_NUM_POINTS (112-O9X_MAX_CURVES)
|
||||
#define O9X_MAX_GVARS 5
|
||||
|
||||
#define O9X_209_MAX_CURVE5 8
|
||||
#define O9X_209_MAX_CURVE9 8
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v201 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v201 timer1;
|
||||
uint8_t protocol:3;
|
||||
int8_t ppmNCH:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
uint8_t thrExpo:1; // Enable Throttle Expo
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v201 timer2;
|
||||
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v201 frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v201() { memset(this, 0, sizeof(t_Open9xModelData_v201)); }
|
||||
}) Open9xModelData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v202 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timer1;
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v201 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v202 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v202() { memset(this, 0, sizeof(t_Open9xModelData_v202)); }
|
||||
}) Open9xModelData_v202;
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v203 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timer1;
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v202 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v203() { memset(this, 0, sizeof(t_Open9xModelData_v203)); }
|
||||
}) Open9xModelData_v203;
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v204 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timer1;
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xTimerData_v202 timer2;
|
||||
Open9xMixData_v203 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v204 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
Open9xFrSkyRSSIAlarm frskyRssiAlarms[2];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v204() { memset(this, 0, sizeof(t_Open9xModelData_v204)); }
|
||||
}) Open9xModelData_v204;
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v205 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t spare1:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v205 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v205() { memset(this, 0, sizeof(t_Open9xModelData_v205)); }
|
||||
}) Open9xModelData_v205;
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v208 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v205 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v208() { memset(this, 0, sizeof(t_Open9xModelData_v208)); }
|
||||
}) Open9xModelData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v209 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
uint8_t frskyLines[4];
|
||||
uint16_t frskyLinesXtra;
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
|
||||
uint8_t varioSource:3;
|
||||
uint8_t varioSpeedUpMin:5; // if increment in 0.2m/s = 3.0m/s max
|
||||
uint8_t varioSpeedDownMin;
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v209() { memset(this, 0, sizeof(t_Open9xModelData_v209)); }
|
||||
}) Open9xModelData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v210 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v209 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v201 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
int8_t servoCenter[O9X_NUM_CHNOUT];
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xFrSkyData_v210 frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v210() { memset(this, 0, sizeof(t_Open9xModelData_v210)); }
|
||||
}) Open9xModelData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xModelData_v211 {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
Open9xTimerData_v202 timers[O9X_MAX_TIMERS];
|
||||
uint8_t protocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
int8_t ppmNCH:4;
|
||||
uint8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t spare1:1;
|
||||
int8_t ppmDelay;
|
||||
uint8_t beepANACenter; // 1<<0->A1.. 1<<6->A7
|
||||
Open9xMixData_v211 mixData[O9X_MAX_MIXERS];
|
||||
Open9xLimitData_v211 limitData[O9X_NUM_CHNOUT];
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
uint8_t modelId;
|
||||
|
||||
uint8_t switchWarningStates;
|
||||
|
||||
Open9xFrSkyData_v210 frsky;
|
||||
|
||||
operator ModelData();
|
||||
t_Open9xModelData_v211() { memset(this, 0, sizeof(t_Open9xModelData_v211)); }
|
||||
}) Open9xModelData_v211;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 "opentxGruvin9xsimulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "opentxeeprom.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBGRUVIN9X
|
||||
#define CPUM2560
|
||||
#define ROTARY_ENCODERS 2
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define VARIO
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define BUZZER
|
||||
#define AUDIO
|
||||
#define HAPTIC
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define VOICE
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define GAUGES
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Open9xGruvin9x {
|
||||
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_default.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#include "radio/src/targets/gruvin9x/somo14d.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 150;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xGruvin9x;
|
||||
|
||||
Open9xGruvin9xSimulator::Open9xGruvin9xSimulator()
|
||||
{
|
||||
}
|
||||
|
||||
bool Open9xGruvin9xSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Open9xGruvin9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Open9xGruvin9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
memcpy(Open9xGruvin9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xGruvin9x::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = Open9xGruvin9x::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
g_rotenc[0] += steps;
|
||||
}
|
||||
|
||||
unsigned int Open9xGruvin9xSimulator::getPhase()
|
||||
{
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * Open9xGruvin9xSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * Open9xGruvin9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef open9xGruvin9x_simulator_h
|
||||
#define open9xGruvin9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class Open9xGruvin9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xGruvin9xSimulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(uint8_t steps);
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 "opentxM128simulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "opentxeeprom.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBSTD
|
||||
#define CPUM128
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define VARIO
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define AUDIO
|
||||
#define HAPTIC
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define VOICE
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define GAUGES
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define EEPROM_VARIANT SIMU_M128_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace OpenTxM128 {
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_default.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/targets/stock/voice.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 150;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace OpenTxM128;
|
||||
|
||||
OpenTxM128Simulator::OpenTxM128Simulator()
|
||||
{
|
||||
}
|
||||
|
||||
bool OpenTxM128Simulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * OpenTxM128Simulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpenTxM128Simulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(OpenTxM128::eeprom, eeprom.data(), std::min<int>(sizeof(OpenTxM128::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = OpenTxM128::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = OpenTxM128::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenTxM128Simulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int OpenTxM128Simulator::getPhase()
|
||||
{
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * OpenTxM128Simulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * OpenTxM128Simulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OpenTxM128_simulator_h
|
||||
#define OpenTxM128_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class OpenTxM128Simulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
OpenTxM128Simulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(uint8_t steps);
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 "opentxM64simulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "opentxeeprom.h"
|
||||
|
||||
#define HELI
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBSTD
|
||||
#define CPUM64
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define VARIO
|
||||
#define HAPTIC
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define VOICE
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define BUZZER
|
||||
#define GAUGES
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
#define FAS_OFFSET
|
||||
|
||||
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
#define NUM_POTS 3
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace OpenTxM64 {
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_default.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/targets/stock/voice.cpp"
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 1500;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace OpenTxM64;
|
||||
|
||||
OpenTxM64Simulator::OpenTxM64Simulator()
|
||||
{
|
||||
#define INIT_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpenTxM64Simulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * OpenTxM64Simulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpenTxM64Simulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(&OpenTxM64::eeprom[0], eeprom.data(), 2048);
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = OpenTxM64::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpenTxM64Simulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = OpenTxM64::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int OpenTxM64Simulator::getPhase()
|
||||
{
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * OpenTxM64Simulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * OpenTxM64Simulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef open9x_simulator_h
|
||||
#define open9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class OpenTxM64Simulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
OpenTxM64Simulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
virtual void start(const char * filename, bool tests=true);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase();
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase);
|
||||
|
||||
virtual void wheelEvent(uint8_t steps) { }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 "opentxSky9xsimulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBSKY9X
|
||||
#define CPUARM
|
||||
#define REVB
|
||||
#define ROTARY_ENCODERS 1
|
||||
#define HELI
|
||||
#define TEMPLATES
|
||||
#define SPLASH
|
||||
#define FLIGHT_MODES
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define VARIO
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define BUZZER
|
||||
#define AUDIO
|
||||
#define VOICE
|
||||
#define HAPTIC
|
||||
// #define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define DBLKEYS
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define SDCARD
|
||||
#define CURVES
|
||||
#define XCURVES
|
||||
#define GVARS
|
||||
#define BOLD_FONT
|
||||
#define PPM_CENTER_ADJUSTABLE
|
||||
#define PPM_LIMITS_SYMETRICAL
|
||||
#define GAUGES
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Open9xSky9x {
|
||||
#include "radio/src/targets/sky9x/board_sky9x.cpp"
|
||||
#include "radio/src/pulses/ppm_arm.cpp"
|
||||
#include "radio/src/pulses/pxx_arm.cpp"
|
||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
||||
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pwr_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#include "radio/src/eeprom_raw.cpp"
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
#include "radio/src/gui/view_main.cpp"
|
||||
#include "radio/src/gui/view_statistics.cpp"
|
||||
#include "radio/src/gui/view_telemetry.cpp"
|
||||
#include "radio/src/gui/view_about.cpp"
|
||||
#include "radio/src/gui/view_text.cpp"
|
||||
#include "radio/src/lcd_common.cpp"
|
||||
#include "radio/src/lcd_default.cpp"
|
||||
#include "radio/src/logs.cpp"
|
||||
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#include "radio/src/targets/sky9x/audio_driver.cpp"
|
||||
#include "radio/src/audio_arm.cpp"
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
#include "radio/src/translations/tts_cz.cpp"
|
||||
#include "radio/src/translations/tts_de.cpp"
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
#include "radio/src/translations/tts_es.cpp"
|
||||
#include "radio/src/translations/tts_se.cpp"
|
||||
#include "radio/src/translations/tts_it.cpp"
|
||||
#include "radio/src/translations/tts_fr.cpp"
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
#include "radio/src/translations/tts_hu.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 1500;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xSky9x;
|
||||
|
||||
Open9xSky9xSimulator::Open9xSky9xSimulator()
|
||||
{
|
||||
QString path=g.profile[g.id()].sdPath()+"/";
|
||||
int i=0;
|
||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
||||
simuSdDirectory[i]=path.at(i).toAscii();
|
||||
}
|
||||
simuSdDirectory[i]=0;
|
||||
}
|
||||
|
||||
bool Open9xSky9xSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Open9xSky9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Open9xSky9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
g_rotenc[0] += steps*4;
|
||||
}
|
||||
|
||||
unsigned int Open9xSky9xSimulator::getPhase()
|
||||
{
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * Open9xSky9xSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * Open9xSky9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user