Compare commits

...

283 Commits

Author SHA1 Message Date
Bertrand Songis 259a15f8db OpenTX 2.1.9 2016-09-14 08:00:32 +02:00
Bertrand Songis 2ae0f7efaf Update DONATIONS.txt 2016-09-13 06:37:23 +02:00
Damjan Adamic c9923fa6a4 Release notes updated 2016-09-12 21:53:28 +02:00
Andre Bernet 56ac50f18e [Taranis] Fix bootloader freeze on USB disconnect 2016-09-12 19:00:03 +02:00
Bertrand Songis ca8b60d0f6 Update DONATIONS.txt 2016-09-11 23:31:37 +02:00
Bertrand Songis b5f0270bf8 Update DONATIONS.txt 2016-09-11 18:45:16 +02:00
Bertrand Songis efa0cab367 Update DONATIONS.txt 2016-09-09 19:28:23 +02:00
Bertrand Songis 98188eb40b Update DONATIONS.txt 2016-09-09 07:20:59 +02:00
Bertrand Songis cd5c42b6f5 Update DONATIONS.txt 2016-09-08 17:46:21 +02:00
Bertrand Songis 68da99b5ac Update DONATIONS.txt 2016-09-07 06:38:52 +02:00
Bertrand Songis ac5e1625ee Update DONATIONS.txt 2016-09-06 19:37:26 +02:00
Bertrand Songis 3466799df3 Update DONATIONS.txt 2016-09-04 15:36:10 +02:00
Bertrand Songis 4a526ccb1e Update DONATIONS.txt 2016-09-03 09:04:16 +02:00
Bertrand Songis c5cf3355fc Update DONATIONS.txt 2016-09-02 21:22:34 +02:00
Bertrand Songis 33cfa5acd6 Update DONATIONS.txt 2016-09-02 07:19:40 +02:00
Bertrand Songis 0bb590b37b Update DONATIONS.txt 2016-09-02 06:34:27 +02:00
Bertrand Songis 64c06d0ae0 Update DONATIONS.txt 2016-09-01 23:25:43 +02:00
Bertrand Songis ff16505793 Update DONATIONS.txt 2016-09-01 22:21:55 +02:00
Bertrand Songis c5941230ef Update DONATIONS.txt 2016-09-01 21:43:54 +02:00
Bertrand Songis 01b1fb07ce Update DONATIONS.txt 2016-08-30 18:25:27 +02:00
Andre Bernet 61efbc87ba Release notes updated 2016-08-27 18:38:10 +02:00
Jim Taylor bf165fdbf7 Skip first record when calculating replay speed and set minimum repla… (#3715)
* Skip first record when calculating replay speed and set minimum replay speed to 100 ms.
Fixes issue 3708

* Cosmetics
2016-08-27 18:35:51 +02:00
Bertrand Songis 4db01b3a90 Update DONATIONS.txt 2016-08-26 18:32:42 +02:00
Bertrand Songis c507b670c4 Update DONATIONS.txt 2016-08-26 08:37:35 +02:00
Bertrand Songis b938c0a2ea Update DONATIONS.txt 2016-08-25 00:09:24 +02:00
Bertrand Songis 5ce55e2a2d Update DONATIONS.txt 2016-08-21 22:59:33 +02:00
mhotar ebfef82310 Bug in CZ input names corrected 2016-08-21 21:05:43 +02:00
Bertrand Songis 851239049a Update DONATIONS.txt 2016-08-20 11:56:00 +02:00
Bertrand Songis e8e1f3a2af Update DONATIONS.txt 2016-08-20 08:49:57 +02:00
Bertrand Songis 7164c5c9b9 Update DONATIONS.txt 2016-08-19 10:49:32 +02:00
Bertrand Songis 552d32a221 Update DONATIONS.txt 2016-08-19 09:04:39 +02:00
Bertrand Songis 143a2b1ff7 Update DONATIONS.txt 2016-08-18 11:11:25 +02:00
Bertrand Songis dbb859645b Update DONATIONS.txt 2016-08-18 11:10:18 +02:00
Bertrand Songis a882b3fe0b Update DONATIONS.txt 2016-08-18 11:07:36 +02:00
Bertrand Songis 094361d743 Update DONATIONS.txt 2016-08-18 11:06:59 +02:00
Bertrand Songis efdc3f1dc0 Update DONATIONS.txt 2016-08-18 11:05:13 +02:00
Arne Schwabe 6883ae72cc Fix channel count on dsm2 module, purely cosmetic (closes issue #3673) (#3689)
Taranis menu always use 8 channels as default opposed to 9x and Horus, which use the maximum number as default channel count (which is 6 on dsm2). This commit does not change that logic.
2016-08-04 18:25:19 +02:00
Arne Schwabe 272fa718bc Fix gcc 5.4 compiler warnings (#3681)
The order preference in flash_driver would evaluate ! before & but I think checking the bit first is what was intended
2016-08-03 16:55:35 +02:00
Bertrand Songis 03590cf9d2 Update DONATIONS.txt 2016-07-31 09:02:52 +02:00
Bertrand Songis 074f2930e9 Update DONATIONS.txt 2016-07-30 10:46:41 +02:00
Bertrand Songis 84e08d51a3 Merge branch 'master' of https://github.com/opentx/opentx 2016-07-27 19:08:53 +02:00
Bertrand Songis 58f4b3ad7a Fixes #3608 2016-07-27 19:08:38 +02:00
3djc 08412c544f One docker to rule them all ! (#3664)
- Add companion compile capability to the docker image
2016-07-26 00:39:50 +02:00
Andre Bernet db693a6f6b Fix SE translations 2016-07-22 20:20:59 +02:00
Andre Bernet df3d3542e5 Fix SE translations 2016-07-22 19:56:49 +02:00
Bertrand Songis 5a45e2d92d Update DONATIONS.txt 2016-07-15 09:20:03 +02:00
Bertrand Songis 0a487aac0b Update DONATIONS.txt 2016-07-10 10:52:11 +02:00
Bertrand Songis 1fc697949d Update DONATIONS.txt 2016-07-10 07:37:21 +02:00
Bertrand Songis 24e27d866a Update DONATIONS.txt 2016-07-06 23:33:08 +02:00
Bertrand Songis 6ef4ba264c Update DONATIONS.txt 2016-07-01 06:39:43 +02:00
Damjan Adamic 5b517ce264 Projectkk2glider/gcc6 compilation fixes (#3638)
* Re #3635: added missing compound statements

* Fixes #3635: compilation problems with gcc-6 fixed
2016-06-30 18:50:01 +02:00
Bertrand Songis 3ab7a45c3d Update DONATIONS.txt 2016-06-30 18:45:21 +02:00
Andre Bernet f959ecea3e LSs weren't selectable as input source (Fix #3632) 2016-06-27 13:17:14 +02:00
Bertrand Songis 1a37e183c0 Update DONATIONS.txt 2016-06-24 06:56:14 +02:00
Andre Bernet 425000a2cb New chat link 2016-06-19 13:10:13 +02:00
Andre Bernet 802219106c New chat link 2016-06-19 13:07:00 +02:00
Damjan Adamic 7fd412f719 Fixes #3549: disable trim processing in while shutdown is in progress, do no turn of the back-light before the shutdown (#3612) 2016-06-18 22:18:22 +02:00
Andre Bernet 0863e8c880 Update releasenotes.txt 2016-06-14 07:58:31 +02:00
Damjan Adamic a49927b7f7 Release notes updated 2016-06-13 21:12:30 +02:00
Damjan Adamic 3eda58c9a5 Fixes #3595: show value of persistent sensor after power on, before the telemetry is received (ported from next) 2016-06-13 20:33:51 +02:00
Neil Horne bd9b91a011 Fixes circular linked global variables and rotary encoders. (#3590) 2016-06-12 15:17:15 +02:00
Bertrand Songis b7654bf791 Update DONATIONS.txt 2016-06-12 08:39:07 +02:00
Neil Horne ce68f36425 Fixed #3473: New model global variables and rotary encoders initialisation and trim controls behaviour (#3578)
* Fixes #3473: Inconsistent new model global variables

* Correct linked drop down index where not linked

* Modify flightModeData::clear to accept parameter
Modify radio defaults to set rotary encoders to linked to flight mode zero
2016-06-08 20:39:58 +02:00
3djc d23855ecc2 3djc/#3569 master (#3577)
* Tentative, untested fix for #3569

* Fix tentative fix to  make it , well, fix :)
2016-06-08 12:49:00 +02:00
Neil Horne 8ff7bce444 Fixes #3547: Flight modes linked trims display value (#3568) 2016-06-07 23:34:02 +02:00
Arne Schwabe 3c0e628782 [Companion] Implement print functions for the hell setup screen (fixes 3430) (#3554)
Fixes #3430: added print functions for the hell setup screen (ported from next)
2016-06-06 21:10:10 +02:00
Bertrand Songis 7b19a004a2 Update DONATIONS.txt 2016-06-03 10:55:37 +02:00
Bertrand Songis ff3a11433c Update DONATIONS.txt 2016-06-03 09:16:58 +02:00
Bertrand Songis 9669f857a5 Error on compilation server 2016-05-31 22:57:21 +02:00
Arne Schwabe 6a77573f62 Fixes #3510: Fix heli inversion not correctly shown/saved from Companion on Radios without virtual inputs (#3517) (ported from next) 2016-05-31 19:06:46 +02:00
Damjan Adamic 476fe43cd2 Cosmetics 2016-05-25 22:12:43 +02:00
BenZoFly f27162e1df Fixes #3518: GVar combobox not being refreshed when GV checkbox (re-)selected 2016-05-25 22:11:13 +02:00
Bertrand Songis e21b4c46c1 Travis fix 2016-05-25 16:27:06 +02:00
Arne Schwabe d3449170b9 Implement absolut minimal support for the DYI Multimodule in 2.1 Companion. (#3526)
This allows to show the protocol in Companion if a user is running my backported multimode code on 2.1 (https://github.com/schwabe/opentx/tree/multi_module_opentx21) and write back the eeprom to the radio without loosing the external radio configuration for those modules. Companion will still complain about an unsupported protocol but still preserve the eeprom.
2016-05-25 09:43:58 +02:00
Damjan Adamic 4dbc15544b Release notes updated 2016-05-23 19:27:34 +02:00
Raphael Coeffic 0f1259d47c Closes #3505: add fuel quantity sensor in telemetry simulator (#3506)
* Closes #3507: raise max RPM in telemetry simulator to 2147483647 (0x7FFFFFFF)
2016-05-23 18:47:05 +02:00
Bertrand Songis 80b545985c Update DONATIONS.txt 2016-05-17 21:37:57 +02:00
Damjan Adamic 81b5ffc56a Re #2826: Lua API: return proper values for Cels- and Cels+ 2016-05-16 22:00:04 +02:00
Arne Schwabe d57a770b5f Remove "*.exe" from german translation for Unix/Mac (closes #3500) 2016-05-16 18:24:53 +02:00
Damjan Adamic 0da367554a Projectkk2glider/issue 3317 curves (#3451)
* Fixes #3317: curve Preset and Clear fixes

* Re #3317: cosmetics
2016-05-15 07:55:56 +02:00
Neil Horne 5eca36b92b Fixes #3459 Rotary encoders linked flight mode can freeze Companion (#3470) 2016-05-14 20:16:42 +02:00
Bertrand Songis c2b8920f65 Update README.md 2016-05-14 11:39:50 +02:00
Andre Bernet 32f68047be Merge pull request #3477 from opentx/projectkk2glider/issue_3476_mixer_offset_bar
Fixes #3476: better representation of negative mixer weight in offset…
2016-05-12 11:09:15 +02:00
Damjan Adamic 494a83db44 Fixes #3476: better representation of negative mixer weight in offset bar widget 2016-05-09 20:18:10 +02:00
Damjan Adamic 95845c8fd8 Re #3462: Lua doc update 2016-05-09 19:29:00 +02:00
Bertrand Songis 1fee1b6c1e Update DONATIONS.txt 2016-05-08 23:18:39 +02:00
Michal Ulianko 91614f3147 Enable DSM protocols on all targets that define DSM2 macro, not just on Taranis. (#3471) 2016-05-08 21:23:59 +02:00
Damjan Adamic 91105a86b6 Merge pull request #3460 from elecpower/elecpower/Issue3214_flight_mode_clear
Fixes #3214 : Flight mode clear
2016-05-08 20:32:28 +02:00
Damjan Adamic 2b6fdc7386 Release notes updated 2016-05-06 23:01:14 +02:00
Damjan Adamic 2e631f99c7 Fixes #3462: PlayTone check for min/max frequency added. Fixes Lua playTone() crash when called with abnormal parameter values. (#3468) 2016-05-06 22:31:56 +02:00
Damjan Adamic 6630406d39 Projectkk2glider/issue 3463 negative filtered sensor values (#3469)
* Fixes #3463: negative sensor values were invalid if filter was active for the sensor

* Re #3463: enable simultaneous use of `offset` and `filter` (was: when `offset` was enabled, the `filter` was always inactive even if enabled)
2016-05-06 22:27:25 +02:00
Bertrand Songis 14769d4d65 Update DONATIONS.txt 2016-05-05 11:25:19 +02:00
Bertrand Songis 6a522c4bb1 Update DONATIONS.txt 2016-05-05 09:29:17 +02:00
elecpower b8b78a5fe2 Fixes #3214: Flight mode clear 2016-05-05 14:45:30 +10:00
Bertrand Songis 70a93ddb1e Update DONATIONS.txt 2016-05-03 19:38:55 +02:00
Bertrand Songis 82222d538b Update DONATIONS.txt 2016-05-03 06:54:51 +02:00
Bertrand Songis 92d43929d3 Update DONATIONS.txt 2016-05-02 21:23:10 +02:00
Damjan Adamic 3ecea58153 Re #3454: sensor persistent fix for 9X (which was missing from 81b474aea) 2016-05-02 19:44:28 +02:00
Damjan Adamic 81b474aea4 Projectkk2glider/sensor persistent (#3454)
* Only clear sensor.persistentValue when the sensor.persistent is disabled and not on every shutdown.

* Only show persistent option for calculated type sensors (only these actually get saved in EEPROM)
2016-05-02 19:21:49 +02:00
Damjan Adamic cfbf59198b Proper simulator shutdown 2016-05-01 10:47:06 +02:00
Bertrand Songis 4c4acd930e Update DONATIONS.txt 2016-04-30 08:26:51 +02:00
Damjan Adamic 717a5b94ff Release notes updated 2016-04-29 21:27:03 +02:00
Bertrand Songis 2479aebde5 [Sky9x] Shift in External Module settings 2016-04-29 20:49:19 +02:00
Damjan Adamic 4a05c2f640 Merge pull request #3410 from opentx/projectkk2glider/issue_3178_for_master
Fixes #3178: USB driver changed interrupt grouping which affected int…
2016-04-29 20:25:53 +02:00
Bertrand Songis 2c08bb1ba3 Fixes #3203 - Tested 2016-04-28 22:03:11 +02:00
Damjan Adamic a450925842 gtests compilation fix 2016-04-28 12:44:27 +02:00
Damjan Adamic 13d5fe5606 Fixes #3372: Telemetry mode "FrSky D (cable)" choice was missing for Taranis 2016-04-28 12:17:28 +02:00
Damjan Adamic d96122b3de Compilation fix 3 2016-04-28 07:46:36 +02:00
Damjan Adamic 088d8b3106 Compilation fix 2 2016-04-28 07:21:18 +02:00
Damjan Adamic 8e0d7e4fdc Compilation fix 2016-04-28 06:39:45 +02:00
Bertrand Songis ac4449f344 Merge pull request #3448 from opentx/projectkk2glider/new_jitter_filter_with_option
Projectkk2glider/new jitter filter with option
2016-04-27 21:48:41 +02:00
Damjan Adamic e4892573e7 Fixes #3432: radio option added to turn on/off ADC jitter filter 2016-04-27 21:27:53 +02:00
Damjan Adamic d8fc0f594d Re #3233: multipos calibration fix (ported from next) 2016-04-27 19:51:38 +02:00
Damjan Adamic acc087d532 Re #3233: compilation fix 2016-04-27 19:51:38 +02:00
Damjan Adamic 6231a451a0 Re #3233: using inverted formula and scaled input value for jitter filter, gives better result for small changes 2016-04-27 19:51:38 +02:00
Damjan Adamic bc9ae7a1a1 Calibration state packed in enum 2016-04-27 19:51:37 +02:00
Bertrand Songis eba1e9b4fc Update DONATIONS.txt 2016-04-25 06:55:02 +02:00
Bertrand Songis 27d4420ac9 Update DONATIONS.txt 2016-04-23 17:08:57 +02:00
Bertrand Songis ae3990624a Update DONATIONS.txt 2016-04-22 20:38:30 +02:00
Bertrand Songis 4abf464407 Update DONATIONS.txt 2016-04-18 18:09:07 +02:00
Bertrand Songis a2dfa3b8a9 Update DONATIONS.txt 2016-04-17 23:06:19 +02:00
Bertrand Songis 9073f03ee7 Update DONATIONS.txt 2016-04-17 20:54:16 +02:00
Bertrand Songis 517a0acedb Update DONATIONS.txt 2016-04-17 19:19:36 +02:00
Bertrand Songis dc512b7608 Update DONATIONS.txt 2016-04-16 16:42:37 +02:00
Damjan Adamic e415be95e2 Fixes #3351: QByteArray used instead of QString for file contents comparison 2016-04-15 17:27:29 +02:00
Damjan Adamic 819e41c761 Fixes #3351: same file was used as source and destination in file contents comparison 2016-04-15 15:27:27 +02:00
Bertrand Songis 8253d5ca1c Other OSX warnings fixed 2016-04-14 19:00:03 +02:00
Bertrand Songis bf497f3c27 Other OSX warnings fixed 2016-04-14 18:54:17 +02:00
Bertrand Songis 345b2df4b0 Other OSX warnings fixed 2016-04-14 18:43:15 +02:00
Bertrand Songis d08666dba2 er9x/gruvin9x/th9x simulators were outdated 2016-04-14 18:24:48 +02:00
Bertrand Songis 3da92275b6 er9x/gruvin9x/th9x simulators were outdated 2016-04-14 18:18:25 +02:00
Bertrand Songis 4894f98c2e Some OSX warnings removed 2016-04-14 17:49:03 +02:00
Damjan Adamic 63a10187c4 Release notes updated 2016-04-14 07:53:23 +02:00
Bertrand Songis 2e18e36844 Update DONATIONS.txt 2016-04-12 22:51:21 +02:00
Damjan Adamic af38748d3a Release notes updated 2016-04-10 22:25:00 +02:00
Bertrand Songis 65d7fd0a29 Fixes #2616 2016-04-10 21:24:31 +02:00
Bertrand Songis cc5b48516f Fixes #2616 2016-04-10 21:11:03 +02:00
Damjan Adamic 2d8d865ee1 Release notes updated 2016-04-10 18:35:15 +02:00
Damjan Adamic 2fa78ada47 Fixes #3342: Lua io.open() problem for non-existing files (backported from next eb9e6d3c) 2016-04-10 18:33:04 +02:00
Damjan Adamic 5b2694eb5f Fixes #3178: USB driver changed interrupt grouping which affected interrupt priorities (fix suggested by Michael Blandford) 2016-04-10 18:28:00 +02:00
Damjan Adamic c294f49cce Version moved to 2.1.8 2016-04-10 18:24:53 +02:00
Andre Bernet 61f24a134e French translations 2016-04-10 18:09:54 +04:00
Damjan Adamic ef53705cc2 Release notes updated 2016-04-10 12:23:15 +02:00
Damjan Adamic 34457188ba Release notes updated 2016-04-10 12:11:20 +02:00
Bertrand Songis b1a619d404 Update DONATIONS.txt 2016-04-10 10:52:10 +02:00
Bertrand Songis 73024a716d Qt warnings removed 2016-04-09 15:04:45 +04:00
Bertrand Songis c95b227732 Fixes #3353 2016-04-09 15:02:52 +04:00
Bertrand Songis a705e19165 Update DONATIONS.txt 2016-04-09 11:26:26 +02:00
Bertrand Songis a9bfa26264 Update DONATIONS.txt 2016-04-08 08:19:52 +02:00
Damjan Adamic c51a7cdf7b Update README.md 2016-04-03 17:42:56 +02:00
Andre Bernet a4540862df Merge pull request #3396 from opentx/kilrah/taranis_gpio_20
Taranis GPIO speed adjustments
2016-04-01 11:16:58 +04:00
Bertrand Songis a341aebde6 Docker fixes for 2.1 2016-03-30 23:03:17 +02:00
Bertrand Songis ccb6c11d3d Docker fixes for 2.1 2016-03-30 21:59:48 +02:00
Bertrand Songis 3a314c5616 Executable permissions for Python scripts 2016-03-30 21:50:17 +02:00
Bertrand Songis 8a2add9849 Avoid install avr-gcc 4.8 before installing 4.7.2 from Wheezy 2016-03-30 21:43:43 +02:00
Bertrand Songis 22c8989a1c Dockerfile and build script ported to 2.1 2016-03-30 21:02:41 +02:00
Andre Bernet ee6a180ae7 Channel range fix 2016-03-30 20:27:28 +04:00
Andre Bernet a84c31aec6 Reorganize / clarify board types by relevance 2016-03-30 20:13:15 +04:00
Andre Bernet 079984a183 Taranis GPIO speed adjustments - to be tested! 2016-03-25 14:48:08 +04:00
Andre Bernet 7d8be44189 9x timer start edit fix 2016-03-25 11:46:58 +04:00
Bertrand Songis 373d0ef4a4 Update DONATIONS.txt 2016-03-24 07:44:34 +01:00
Bertrand Songis b9bf10c6dd Update DONATIONS.txt 2016-03-23 18:23:43 +01:00
Andre Bernet 3c65c32d45 Wasted flash 2016-03-23 16:56:12 +04:00
Bertrand Songis a604d9cba2 Update DONATIONS.txt 2016-03-23 07:03:24 +01:00
Bertrand Songis 41cf4af536 Merge pull request #3378 from opentx/kilrah/3301_timers
Removed a few legacy timer limitations, fix non-working limit (fix #3301)
2016-03-22 22:47:42 +01:00
Bertrand Songis 56dfb156fd Update DONATIONS.txt 2016-03-22 20:43:04 +01:00
Andre Bernet 349c2aa3b6 Refactoring 2016-03-22 22:03:53 +04:00
Andre Bernet bb1106ff82 Default AVR fuse settings changed to disable JTAG interface (#3379 part 2) 2016-03-22 16:15:42 +04:00
Andre Bernet 662a20555d Removed a few legacy timer limitations, fix non-working limit (fix #3301) 2016-03-22 14:08:59 +04:00
Andre Bernet e1bcbfa013 [9X/2650] Fix occasional interaction between JTAG port and POT3 (fix from Mike following openrcforums discussion) 2016-03-22 12:20:57 +04:00
Bertrand Songis 3f969acaa8 Update DONATIONS.txt 2016-03-21 22:11:47 +01:00
Bertrand Songis dbd8abbfe8 Update DONATIONS.txt 2016-03-19 22:45:10 +01:00
Bertrand Songis b468304819 Update DONATIONS.txt 2016-03-19 16:36:56 +01:00
Bertrand Songis 0400e8896e Merge pull request #3364 from craftandtheory/master
SMLSIZE fixes + Gtests on SmlsizeDecimalPoint
2016-03-16 23:06:56 +01:00
floaledm 2f2b6122b4 SMLSIZE fixes + Gtests on SmlsizeDecimalPoint 2016-03-16 21:25:58 +00:00
Damjan Adamic cbf2b71bd7 Re #3350: translations regenerated 2016-03-13 19:22:26 +01:00
Damjan Adamic 5e6b0025b2 Fixes #3350: sync dialog new line was not translated 2016-03-13 19:21:24 +01:00
Damjan Adamic 84020586d4 Fixes #3347 (backported from next 946c1777) 2016-03-13 18:40:16 +01:00
Bertrand Songis bc4e2aba4e Update DONATIONS.txt 2016-03-13 16:02:20 +01:00
Bertrand Songis 2c2a93dd17 Update DONATIONS.txt 2016-03-13 09:40:26 +01:00
Bertrand Songis 8734a2e19c Update DONATIONS.txt 2016-03-12 20:39:49 +01:00
Bertrand Songis 7ff8a1c13f Update DONATIONS.txt 2016-03-12 15:57:33 +01:00
Bertrand Songis d7ae0d91cd Update DONATIONS.txt 2016-03-12 10:22:25 +01:00
Bertrand Songis 06ec90a643 Merge pull request #3348 from craftandtheory/master
[Taranis] fixed placement of decimal point in SMLSIZE font
2016-03-11 07:09:15 +01:00
floaledm 17d4536e9c [Taranis] fixed placement of decimal point in SMLSIZE font 2016-03-10 17:20:43 -06:00
Bertrand Songis 9058737f86 Update DONATIONS.txt 2016-03-10 18:06:03 +01:00
Bertrand Songis ec9ac82a70 Update DONATIONS.txt 2016-03-09 21:25:19 +01:00
Bertrand Songis 189b7c0bfe Update DONATIONS.txt 2016-03-08 07:11:34 +01:00
Bertrand Songis 825e0286f1 [Taranis] Infinite loop when drawing horizontal lines with a negative width 2016-03-05 00:25:56 +01:00
Bertrand Songis 98996620a4 Update DONATIONS.txt 2016-03-04 17:26:50 +01:00
Andre Bernet d2a937c3f1 Sync Companion voice language list with radio (fix #3338) 2016-03-03 10:53:34 +04:00
Andre Bernet 4f0d5f556e Hungarian TTS fixes by hori64 2016-03-03 10:37:47 +04:00
Bertrand Songis 3728ebcdc9 Update DONATIONS.txt 2016-03-01 22:53:18 +01:00
Bertrand Songis bf44994c34 Update DONATIONS.txt 2016-02-29 23:24:34 +01:00
Damjan Adamic b736ec5f48 Fixes #3329: playDuration() second parameter is now really optional 2016-02-29 19:09:41 +01:00
Damjan Adamic bb8eff3488 Fixes #3328: docs updated 2016-02-29 19:07:17 +01:00
Bertrand Songis 456df25c0e Update DONATIONS.txt 2016-02-27 09:54:47 +01:00
Bertrand Songis 055dc646dc Update DONATIONS.txt 2016-02-24 22:00:43 +01:00
Bertrand Songis 0d13182733 Fixes #3307 2016-02-21 10:26:24 +01:00
Bertrand Songis 0899bf49b6 [RedundancyBus] Fields renamed (not PowerBox anymore) 2016-02-21 10:08:41 +01:00
Andre Bernet ce5daa0991 Merge pull request #3304 from hrenz/patch-12
Update de.h.txt (fix #3292)
2016-02-18 22:12:16 +04:00
Andre Bernet 977ba3da46 Merge pull request #3283 from opentx/MicheleVilla/FW_Fix_Translation
Fix it.h.txt
2016-02-18 22:10:44 +04:00
hrenz d1c1113a61 Update de.h.txt
EU-Format select deleted  --> Kilrah told to it #3292
X16 --> D16  now Frsky conform
Now same as all other Languages
2016-02-17 20:21:40 +01:00
Bertrand Songis 877b130e47 Update DONATIONS.txt 2016-02-16 22:31:46 +01:00
Bertrand Songis 1deb60a734 Update DONATIONS.txt 2016-02-16 18:28:47 +01:00
Damjan Adamic b25a5b8c5a Fixes #3256: Spanish TTS correction for hundreds 2016-02-15 22:17:21 +01:00
Damjan Adamic d402e2f340 Fixes #3285: only first 32 input lines (out of 64) were accessible in Lua 2016-02-15 21:48:15 +01:00
Bertrand Songis b7867af720 Update DONATIONS.txt 2016-02-15 21:26:33 +01:00
Bertrand Songis 3f3ccc2668 MEGA2560 compilation failed 2016-02-14 19:29:45 +01:00
Bertrand Songis 45b5c0990d Update DONATIONS.txt 2016-02-14 13:50:58 +01:00
Bertrand Songis 8a70229406 Update DONATIONS.txt 2016-02-11 21:15:43 +01:00
Bertrand Songis 3df558d280 Update DONATIONS.txt 2016-02-10 21:41:37 +01:00
JivaroFAD d1f42b79de Mega2560 audio compilation allowed 2016-02-09 20:06:00 +01:00
JivaroFAD ae8935aa40 Mega2560 audio correction 2016-02-09 19:36:10 +01:00
Michele 282c05e272 Update it.h.txt
Fix IT translation
2016-02-09 12:35:15 +01:00
Bertrand Songis bb0c2e6443 Update DONATIONS.txt 2016-02-09 10:52:57 +01:00
Bertrand Songis 43b97d3211 Update DONATIONS.txt 2016-02-08 19:08:56 +01:00
Andre Bernet a9a22628c3 Taranis main view adjustments for 3-char switch names (fix #3278) 2016-02-07 15:44:20 +04:00
Bertrand Songis 68f873db2c Update DONATIONS.txt 2016-02-06 08:31:42 +01:00
Bertrand Songis cbf14235a1 Merge pull request #3276 from opentx/kilrah/3268_16buttons
Joystick now supports 24 buttons (ch9-32) (fix #3268)
2016-02-05 22:30:16 +01:00
Andre Bernet 0ebbe08f3d Joystick now supports 24 buttons (ch9-32) (fix #3268) 2016-02-06 00:32:44 +04:00
Andre Bernet 77c9ec6dff Missing replace in commit ee6cd81069 had broken Windows build 2016-02-05 23:53:11 +04:00
Bertrand Songis 75a819d9f6 Update DONATIONS.txt 2016-02-05 17:40:36 +01:00
Bertrand Songis 58fe7c155e Update DONATIONS.txt 2016-02-04 20:25:55 +01:00
Bertrand Songis 0ef3678374 Update DONATIONS.txt 2016-02-03 19:12:47 +01:00
Bertrand Songis 5232d56701 Update DONATIONS.txt 2016-02-02 22:44:51 +01:00
Bertrand Songis 13f5140457 Update DONATIONS.txt 2016-02-01 23:31:49 +01:00
Bertrand Songis c2cb22b542 Update DONATIONS.txt 2016-01-31 22:05:32 +01:00
Bertrand Songis 4d30ee4dd1 Merge pull request #3269 from opentx/kilrah/issue3260
Store control types and names in profile (fix #3260)
2016-01-31 12:12:15 +01:00
Andre Bernet 2a4dfdd8a4 Store control types and names in profile (fix #3260) 2016-01-31 11:58:21 +01:00
Andre Bernet 3804f39eb0 Import/export handling was broken for Average formula telemetry sensors (Fix #3262) 2016-01-30 23:06:32 +01:00
Bertrand Songis 2232306003 Cosmetics 2016-01-30 09:22:09 +01:00
Bertrand Songis f4081d4c21 Merge pull request #2981 from sloped-soarer/sloped_soarer/issue_2938_MEGA2560-the-first-PPM-pulse-in-the-frame-longer
Update pulses_avr.cpp
2016-01-30 09:09:03 +01:00
Bertrand Songis 292dfdd458 Merge pull request #3243 from opentx/driver33/pl_tr
New things and fixes
2016-01-30 09:01:51 +01:00
Bertrand Songis 5e04eb91c7 Update DONATIONS.txt 2016-01-30 08:56:28 +01:00
Bertrand Songis 0f19f75af6 Update DONATIONS.txt 2016-01-29 09:09:30 +01:00
Bertrand Songis 2a557129e0 Update DONATIONS.txt 2016-01-28 06:43:57 +01:00
Bertrand Songis 9f7ecf7595 Update DONATIONS.txt 2016-01-27 00:08:12 +01:00
Damjan Adamic 37043f77c7 Fixes #3248: offset was missing in inputs display 2016-01-25 20:20:56 +01:00
Damjan Adamic 6c8e3b165e Fixes #3253: PL translation had typo 2016-01-25 18:54:58 +01:00
Bertrand Songis 6382a50d4f Update DONATIONS.txt 2016-01-25 18:41:28 +01:00
Bertrand Songis d35a42c442 Update DONATIONS.txt 2016-01-24 20:55:16 +01:00
Bertrand Songis 82b4b5b546 Mike's bootloader moved to GitHub 2016-01-24 09:24:23 +01:00
Bertrand Songis 20e0b674d8 Update DONATIONS.txt 2016-01-22 07:12:09 +01:00
Bertrand Songis d0bb02cecf Update DONATIONS.txt 2016-01-21 22:22:13 +01:00
Bertrand Songis e0fb81bf4a Update DONATIONS.txt 2016-01-20 21:58:50 +01:00
driver33 50ce9b3a0f New things and fixes 2016-01-20 10:53:42 +01:00
sloped-soarer 948306657f Update pulses_avr.cpp 2016-01-19 10:55:56 +00:00
Bertrand Songis 3e90ab72cb Merge pull request #3240 from opentx/projectkk2glider/issue_3233_adc_jitter_filter_and_measure
Fixes #3233: Added ADC jitter measurement (use MEASURE_JITTER=YES to …
2016-01-18 21:59:32 +01:00
Damjan Adamic 30a7de6fa0 Fixes #3233: Added ADC jitter measurement (use MEASURE_JITTER=YES to enable), Added ADC jitter filter (use JITTER_FILTER=No to disable) 2016-01-18 20:50:06 +01:00
Damjan Adamic 46bdd0eba4 Fixes #2639: ADC crosstalk on X9E fixed, sample time was not set for the right channels, sample time also needed to be increased 2016-01-18 20:45:05 +01:00
Bertrand Songis a77860c451 Update DONATIONS.txt 2016-01-18 19:19:41 +01:00
Andre Bernet 0404538854 Companion looking for custom scripts at the wrong place (fix #3237) 2016-01-18 14:41:31 +01:00
Andre Bernet 0b04fb5407 Merge pull request #3236 from HakanBastedt/HakanBastedt/SE_updated_3113
Updated se translation and now in sync with en translation 3113
2016-01-17 14:33:07 +01:00
Håkan Båstedt fff6ba4f27 Updated se translation and now in sync with en translation 2016-01-17 13:46:43 +01:00
Damjan Adamic d124ce8317 Lua docs updated 2016-01-16 16:05:27 +01:00
Bertrand Songis db7af1d676 Update DONATIONS.txt 2016-01-15 11:17:18 +01:00
Bertrand Songis 0b91fa5b05 Update DONATIONS.txt 2016-01-15 07:57:10 +01:00
Bertrand Songis d31f14816b Update DONATIONS.txt 2016-01-13 18:25:12 +01:00
David S. Beach f8de9f9d99 Merge pull request #3213 from opentx/projectkk2glider/issue_3207_telem_simu_instance
Fixes #3207: proper sensor instance generation in Telemetry Simulator
2016-01-11 12:54:48 -05:00
Andre Bernet 759bdd586d RTC tooltip corrected (fix #3225) 2016-01-11 20:35:33 +04:00
Damjan Adamic 0004b89532 Fixes #3222 : Throttle Source combobox was populated multiple times 2016-01-10 21:47:04 +01:00
Damjan Adamic 5cb3ef82e2 Fixes #3223: some lua fields were not exported (CPUARM) 2016-01-10 21:07:56 +01:00
Damjan Adamic 69039ae560 Re #2939: additional test for EDGE logical switch (ported from next) 2016-01-10 18:56:52 +01:00
Bertrand Songis 0e1dda33cf Update DONATIONS.txt 2016-01-10 10:04:08 +01:00
Bertrand Songis b358cc8965 Update DONATIONS.txt 2016-01-10 09:24:42 +01:00
Bertrand Songis f023b61513 Update DONATIONS.txt 2016-01-10 00:54:13 +01:00
Damjan Adamic 485fcb4fc4 Re #3207: cosmetics 2016-01-07 21:54:11 +01:00
Damjan Adamic f4378038c7 Fixes #2939: Logical switch internal state was being reset by the AND switch, that affected its function (it looked like AND was applied before the EDGE processing, not after like it is done for other logical switch types). (ported from 2.0 branch) 2016-01-07 21:44:28 +01:00
Bertrand Songis ed9a8c9975 Fixes #3206 - I forgot to add the file after the mods 2016-01-07 21:25:47 +01:00
Bertrand Songis d9d0d9f1cd Update DONATIONS.txt 2016-01-07 21:18:42 +01:00
Bertrand Songis 9fb7f12091 Fixes #3206 2016-01-07 19:22:15 +01:00
Damjan Adamic 62ae0e010c Re #3207: better default instance values 2016-01-07 19:03:10 +01:00
Damjan Adamic fcd07780c9 Re #3207: typo 2016-01-07 18:20:20 +01:00
Damjan Adamic b493754443 Fixes #3207: proper sensor instance generation in Telemetry Simulator 2016-01-07 12:44:06 +01:00
sloped-soarer ec2da1f6be Update pulses_avr.cpp 2016-01-06 18:57:26 +00:00
sloped-soarer 53d3e35d77 Update pulses_avr.cpp 2016-01-06 18:55:49 +00:00
sloped-soarer 56b04262a9 Update pulses_avr.cpp 2016-01-06 18:50:48 +00:00
sloped-soarer b2386d7055 Update pulses_avr.cpp
Added space after if function.
2016-01-06 12:52:01 +00:00
sloped-soarer 7fe82d4099 Update pulses_avr.cpp 2015-10-19 15:21:02 +01:00
sloped-soarer deb64c0c91 Update pulses_avr.cpp
Changed formatting again ... something weird about this editor re: tabs and spaces.
2015-10-19 15:18:55 +01:00
sloped-soarer 2dafac5d94 Update pulses_avr.cpp
Update code style to K&R was Allman (ish) ... Indentation corrected.
2015-10-19 15:06:54 +01:00
sloped-soarer efc3364b32 Update pulses_avr.cpp
issue 2938
2015-10-18 20:32:55 +01:00
170 changed files with 22054 additions and 15937 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ before_install:
- sudo apt-get update
install:
- sudo apt-get install -y lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
- sudo apt-get install --yes --force-yes lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
script:
- radio/util/commit-tests.sh
+127 -1
View File
@@ -9,6 +9,7 @@
<a href="http://openpilot.com">David Ankers (OpenPilot)</a>
<a href="http://3drobotics.com">3D Robotics</a>
<a href="http://rcstudio.cz">RC Studio (monthly)</a>
<a href="http://www.craftandtheoryllc.com">Craft & Theory (monthly)</a>
Mario Sette
Felice Baratto
@@ -332,7 +333,6 @@ Jose Sobral
Heung Jin Choi
Tomasz Janiak
Fabien Gagné
Joe Street
Micha Ronen
Albert Blondin
Klaus Schuebel
@@ -885,3 +885,129 @@ Gilles Dando
Denis Roussille
Olivier Anken
Michel Motte
David McDonald
Tauno Rautakorpi
Carsten Schlassa
Angel de la Dehesa Calles
Michel Garbarin
Algirdas Tamosiunas
Petr Kysela
Pascal Roux
Robert Whitfield
InTheTubeDeep
Jaromir Malek
Joe Street
Regin Poulsen
Hervé Laveyssiere
Walter Fowler
Richard Wagner
Kevin Hyman
Herald Reichel
Frederic Rouyre
David Libby
Hans Timmermans
Adrian De Zee
John Hanagan
Didier van Steensel
Julius Vicze
Cristiano Merighi
James Holley
Chris Merry
Jiri Fojtasek
Thierry Laligand
Hassouna Cherif
Fred Thijssen
Andrew Gardiner
Christian Niß
Douglas Penney
Starck Associates
Johannes Wollenweber
Fred Page
Jean Trouche
Patrick Blanc
Jean-Louis Tonnellier
Masoud
Mustafa Güven
William Waters
Joël Allamy
William Mckinstry
Jean-Jacques Pointel
Frédéric Rouyre
Jonathan Pruett
Jörg Zieren
Christopher Rhodes
Marco Strack
Stefano Boggia
Dwayne Myers
Stavros Papathanasiou
Roland Nittby
Courtney Puskas
NorthSide
Martin Polák
Ulf Reinhardt
Wolfgang Renisch
Trevor Hinze
Mohammad Zargari
Dr. Willutzki
Jean Pierre Bernard
Patrick Castellan
Udo Tödter
Marc J Merlin
Paul Chitonu
Wolfgang Rauser
Emmanuel Dallery
James Lyons
Tauno Rautakorpi
Gerald Peklar
Fabien Gagné
David Cox
Philip Cork
Kevin Wright
John Scott
Yves Berger
Otto Fröhlich
Kenneth Lilja
Benjamin Johnson
Brad Kelley
Michel Biancki
Lynn Laycock
Claude Godefroy
Gérald Joubert
Wayne J Podaima
Philippe Peyron
Julien Kieffer
Gregor Walter
Carlos Viegas
Roberto Orsello
Steve Murray (monthly)
Marcel Schäfer
Sean Cull
Holger Bothmer
Michael Manning
Martin Risik
ZEN Computer Services
Egbert Stohlmann
Martin Peryea
Nathan James
Luis Suarez
Artur Uzieblo
InTheTubeDeep
Jaap Greve
Peter Glassey
David Reynolds
David Frazier
Donald L Singer
George Carnie
Susan Holbert
Richard Garrett
Paco Galván
Matthew Sylvester
Robert Bates
Hans-Peter Endres
Axel Stöckle
Leonard MacKey
Andrew Fernie
Mark McCoy
Damir Pooshs
Jeff Dillingham
Brent Hampton
+9 -2
View File
@@ -1,9 +1,16 @@
##OpenTX 2.1 Branch
[![Build Status](https://travis-ci.org/opentx/opentx.svg?branch=master)](https://travis-ci.org/opentx/opentx)
[![Join the chat at https://gitter.im/opentx/opentx](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/opentx/opentx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the chat at https://opentx.rocket.chat](https://camo.githubusercontent.com/3d659054abd6ce21c0e47cf3b83a51bda69ca282/68747470733a2f2f64656d6f2e726f636b65742e636861742f696d616765732f6a6f696e2d636861742e737667)](https://opentx.rocket.chat)
[![Donate using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJ9MASSKVW8WN)
The ongoing development on 2.1.x is done in this branch.
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.
Refer to the [OpenTX wiki](https://github.com/opentx/opentx/wiki) for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
Useful links:
* OpenTX Blog http://blog.open-tx.org/
* OpenTX Main Site http://www.open-tx.org/
* OpenTx University http://open-txu.org/
* OpenTX User Manual https://www.gitbook.com/book/opentx/opentx-taranis-manual/details
* OpenTX Lua Reference Guide https://www.gitbook.com/book/opentx/opentx-lua-reference-guide/details
+42
View File
@@ -1,3 +1,45 @@
<h2>Version 2.1.9 / 2016-09-14</h2>
<ul>
<li>SD sync fixes (<a href=https://github.com/opentx/opentx/issues/3351>#3351</a>)</li>
<li>Fixed: Telemetry mode "FrSky D (cable)" choice was missing for Taranis (<a href=https://github.com/opentx/opentx/issues/3372>#3372</a>)</li>
<li>Show persistent option only for calculated sensors (<a href=https://github.com/opentx/opentx/issues/3454>#3454</a>)</li>
<li>Fixed Flight mode clear command (<a href=https://github.com/opentx/opentx/issues/3214>#3214</a>)</li>
<li>Fixed a problem with Rotary encoders linked to flight mode (could freeze Companion) (<a href=https://github.com/opentx/opentx/issues/3459>#3459</a>, <a href=https://github.com/opentx/opentx/issues/3470>#3470</a>)</li>
<li>Telemetry simulator improvements: added fuel quantity sensor, increased RPM range (<a href=https://github.com/opentx/opentx/issues/3505>#3505</a>, <a href=https://github.com/opentx/opentx/issues/3506>#3506</a>)</li>
<li>Implemented minimal support for the DYI Multimodule (<a href=https://github.com/opentx/opentx/issues/3526>#3526</a>)</li>
<li>Fixed: GVar combo-box not being refreshed when GV check-box (re-)selected (<a href=https://github.com/opentx/opentx/issues/3518>#3518</a>)</li>
<li>Fixed: Heli inversion not correctly shown/saved from Companion on Radios without virtual inputs (<a href=https://github.com/opentx/opentx/issues/3510>#3510</a>)</li>
<li>Implemented print functions for the Heli setup screen (<a href=https://github.com/opentx/opentx/issues/3554>#3554</a>)</li>
<li>Fixed: Flight modes linked trims display value (<a href=https://github.com/opentx/opentx/issues/3547>#3547</a>, <a href=https://github.com/opentx/opentx/issues/3568>#3568</a>)</li>
<li>Fixed: New model global variables and rotary encoders initialisation (<a href=https://github.com/opentx/opentx/issues/3473>#3473</a>)</li>
<li>Fixed: Prevent circular linked global variables and rotary encoders (<a href=https://github.com/opentx/opentx/issues/3472>#3472</a>)</li>
<li>Fixed wrong log replay speed issue in Telemetry simulator (<a href=https://github.com/opentx/opentx/issues/3708>#3708</a>)</li>
<li>Various texts and translations corrections</li>
</ul>
<h2>Version 2.1.8 / 2016-04-14</h2>
<ul>
<li>Telemetry Simulator sensor instance number fixed (<a href=https://github.com/opentx/opentx/issues/3207>#3207</a>)</li>
<li>Fixed: Throttle Source combo-box was populated multiple times (<a href=https://github.com/opentx/opentx/issues/3222>#3222</a>)</li>
<li>RTC option tool-tip corrected (<a href=https://github.com/opentx/opentx/issues/3225>#3225</a>)</li>
<li>Fixed: Companion was looking for custom scripts at the wrong place (<a href=https://github.com/opentx/opentx/issues/3237>#3237</a>)</li>
<li>Offset displayed in inputs screen (<a href=https://github.com/opentx/opentx/issues/3248>#3248</a>)</li>
<li>Import/export handling was broken for Average formula telemetry sensors (<a href=https://github.com/opentx/opentx/issues/3262>#3262</a>)</li>
<li>Fixed: Hardware Setup control types and names were not stored in profile (<a href=https://github.com/opentx/opentx/issues/3260>#3260</a>)</li>
<li>Fixed voice language list (<a href=https://github.com/opentx/opentx/issues/3338>#3338</a>)</li>
<li>Fixed data overflow in Special Functions Override Channel (<a href=https://github.com/opentx/opentx/issues/3347>#3347</a>)</li>
<li>Fixed: Sync dialog new line problem (only present for some UI languages) (<a href=https://github.com/opentx/opentx/issues/3350>#3350</a>)</li>
<li>Removed a few legacy timer limitations, fix non-working limit (<a href=https://github.com/opentx/opentx/issues/3301>#3301</a>)</li>
<li>Default AVR fuse settings changed to disable JTAG interface (<a href=https://github.com/opentx/opentx/issues/3379>#3379</a>)</li>
<li>Channel range fix (Start, Channels) in Model Settings, Setup page, int/ext module settings</li>
<li>Use friendly GVAR names in dialogs (if available) (<a href=https://github.com/opentx/opentx/issues/3353>#3353</a>)</li>
<li>Various texts and translations corrections</li>
</ul>
<h2>Version 2.1.7 / 2016-01-04</h2>
<ul>
+1 -1
View File
@@ -2,7 +2,7 @@ PROJECT( companion )
SET(C9X_VERSION_MAJOR "2")
SET(C9X_VERSION_MINOR "1")
SET(C9X_VERSION_REVISION "7")
SET(C9X_VERSION_REVISION "9")
SET(C9X_VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
SET(C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION}${C9X_VERSION_SUFFIX})
+10
View File
@@ -312,6 +312,8 @@ QString Profile::speaker() const { return _speaker; }
QString Profile::stickPotCalib() const { return _stickPotCalib; }
QString Profile::timeStamp() const { return _timeStamp; }
QString Profile::trainerCalib() const { return _trainerCalib; }
QString Profile::controlTypes() const { return _controlTypes; }
QString Profile::controlNames() const { return _controlNames; }
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
int Profile::gsStickMode() const { return _gsStickMode; }
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
@@ -342,6 +344,8 @@ void Profile::speaker (const QString x) { store(x, _speaker, "Speake
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::controlTypes (const QString x) { store(x, _controlTypes, "ControlTypes" ,"Profiles", QString("profile%1").arg(index));}
void Profile::controlNames (const QString x) { store(x, _controlNames, "ControlNames" ,"Profiles", QString("profile%1").arg(index));}
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "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));}
@@ -378,6 +382,8 @@ Profile& Profile::operator=(const Profile& rhs)
speaker ( rhs.speaker() );
stickPotCalib( rhs.stickPotCalib() );
trainerCalib ( rhs.trainerCalib() );
controlTypes ( rhs.controlTypes() );
controlNames ( rhs.controlNames() );
txCurrentCalibration ( rhs.txCurrentCalibration() );
gsStickMode ( rhs.gsStickMode() );
ppmMultiplier( rhs.ppmMultiplier() );
@@ -423,6 +429,8 @@ void Profile::initFwVariables()
_stickPotCalib = "";
_timeStamp = "";
_trainerCalib = "";
_controlTypes = "";
_controlNames = "";
_txCurrentCalibration = 0;
_gsStickMode = 0;
@@ -483,6 +491,8 @@ void Profile::flush()
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( _controlTypes, "ControlTypes" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _controlNames, "ControlNames" ,"" ,"Profiles", QString("profile%1").arg(index));
getset( _txCurrentCalibration, "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));
+6
View File
@@ -125,6 +125,8 @@ class Profile: protected CompStoreObj
QString _stickPotCalib;
QString _timeStamp;
QString _trainerCalib;
QString _controlTypes;
QString _controlNames;
int _txCurrentCalibration;
int _gsStickMode;
int _ppmMultiplier;
@@ -156,6 +158,8 @@ class Profile: protected CompStoreObj
QString stickPotCalib() const;
QString timeStamp() const;
QString trainerCalib() const;
QString controlTypes() const;
QString controlNames() const;
int txCurrentCalibration() const;
int gsStickMode() const;
int ppmMultiplier() const;
@@ -186,6 +190,8 @@ class Profile: protected CompStoreObj
void stickPotCalib (const QString);
void timeStamp (const QString);
void trainerCalib (const QString);
void controlTypes (const QString);
void controlNames (const QString);
void txCurrentCalibration (const int);
void gsStickMode (const int);
void ppmMultiplier (const int);
+63 -10
View File
@@ -1410,7 +1410,7 @@ void ModelData::clear()
moduleData[1].protocol = PULSES_OFF;
}
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
flightModeData[i].clear();
flightModeData[i].clear(i);
}
clearInputs();
clearMixes();
@@ -1523,9 +1523,7 @@ int ModelData::getTrimValue(int phaseIdx, int trimIdx)
}
else {
phaseIdx = phase.trimRef[trimIdx];
if (phase.trimMode[trimIdx] == 0)
result = 0;
else
if (phase.trimMode[trimIdx] != 0)
result += phase.trim[trimIdx];
}
}
@@ -1538,16 +1536,57 @@ bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
return flightModeData[phaseIdx].gvars[gvarIdx] > 1024;
}
int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
bool ModelData::isGVarLinkedCircular(int phaseIdx, int gvarIdx)
{
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
for (int i=0; idx>1024 && i<C9X_MAX_FLIGHT_MODES; i++) {
int nextPhase = idx - 1025;
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
int val = flightModeData[phaseIdx].gvars[gvarIdx];
if ((phaseIdx==0) || (val<=1024)) return false;
int nextPhase = val - 1025;
if (nextPhase >= phaseIdx) nextPhase += 1;
phaseIdx = nextPhase;
idx = flightModeData[phaseIdx].gvars[gvarIdx];
}
return idx;
return true;
}
int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
{
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
int val = flightModeData[phaseIdx].gvars[gvarIdx];
if ((phaseIdx==0) || (val<=1024)) return val;
int nextPhase = val - 1025;
if (nextPhase >= phaseIdx) nextPhase += 1;
phaseIdx = nextPhase;
}
return flightModeData[0].gvars[gvarIdx]; // circular linked
}
bool ModelData::isRELinked(int phaseIdx, int reIdx)
{
return flightModeData[phaseIdx].rotaryEncoders[reIdx] > 1024;
}
bool ModelData::isRELinkedCircular(int phaseIdx, int reIdx)
{
for (int i=0; i<C9X_MAX_ENCODERS; i++) {
int val = flightModeData[phaseIdx].rotaryEncoders[reIdx];
if ((phaseIdx==0) || (val<=1024)) return false;
int nextPhase = val - 1025;
if (nextPhase >= phaseIdx) nextPhase += 1;
phaseIdx = nextPhase;
}
return true;
}
int ModelData::getREValue(int phaseIdx, int reIdx)
{
for (int i=0; i<C9X_MAX_ENCODERS; i++) {
int val = flightModeData[phaseIdx].rotaryEncoders[reIdx];
if ((phaseIdx==0) || (val<=1024)) return val;
int nextPhase = val - 1025;
if (nextPhase >= phaseIdx) nextPhase += 1;
phaseIdx = nextPhase;
}
return flightModeData[0].rotaryEncoders[reIdx]; // circular linked
}
void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
@@ -1843,3 +1882,17 @@ SimulatorInterface *GetCurrentFirmwareSimulator()
else
return NULL;
}
void FlightModeData::clear(const int phase)
{
memset(this, 0, sizeof(FlightModeData));
if (phase != 0) {
for (int idx=0; idx<C9X_MAX_GVARS; idx++) {
gvars[idx] = 1025;
}
for (int idx=0; idx<C9X_MAX_ENCODERS; idx++) {
rotaryEncoders[idx] = 1025;
}
}
}
+12 -4
View File
@@ -632,7 +632,7 @@ class CustomFunctionData { // Function Switches data
class FlightModeData {
public:
FlightModeData() { clear(); }
FlightModeData() { clear(0); }
int trimMode[NUM_STICKS];
int trimRef[NUM_STICKS];
int trim[NUM_STICKS];
@@ -640,9 +640,9 @@ class FlightModeData {
char name[10+1];
unsigned int fadeIn;
unsigned int fadeOut;
int rotaryEncoders[2];
int rotaryEncoders[C9X_MAX_ENCODERS];
int gvars[C9X_MAX_GVARS];
void clear() { memset(this, 0, sizeof(FlightModeData)); }
void clear(const int phase);
};
class SwashRingData { // Swash Ring data
@@ -842,6 +842,7 @@ enum PulsesProtocol {
PULSES_PXX_XJT_LR12,
PULSES_PXX_DJT,
PULSES_CROSSFIRE,
PULSES_MULTIMODULE,
PULSES_PROTOCOL_LAST
};
@@ -1077,8 +1078,13 @@ class ModelData {
void setTrimValue(int phaseIdx, int trimIdx, int value);
bool isGVarLinked(int phaseIdx, int gvarIdx);
bool isGVarLinkedCircular(int phaseIdx, int gvarIdx);
int getGVarValue(int phaseIdx, int gvarIdx);
bool isRELinked(int phaseIdx, int reIdx);
bool isRELinkedCircular(int phaseIdx, int reIdx);
int getREValue(int phaseIdx, int reIdx);
ModelData removeGlobalVars();
void clearMixes();
@@ -1624,7 +1630,9 @@ class Firmware {
}
virtual int getCapability(const Capability) = 0;
virtual QTime getMaxTimerStart() = 0;
virtual bool isTelemetrySourceAvailable(int source) = 0;
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
@@ -17,7 +17,6 @@
#include <iostream>
#include "er9xinterface.h"
#include "er9xeeprom.h"
#include "simulator/er9xsimulator.h"
#include "file.h"
#include "appdata.h"
@@ -1,15 +0,0 @@
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
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
)
add_library(er9x-simulator er9xsimulator.cpp)
@@ -1,224 +0,0 @@
/*
* 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 isBacklightEnable() (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 TRIMS_GPIO_REG_LHL pind
#define TRIMS_GPIO_REG_LVD pind
#define TRIMS_GPIO_REG_RVU pind
#define TRIMS_GPIO_REG_RHL pind
#define TRIMS_GPIO_REG_LHR pind
#define TRIMS_GPIO_REG_LVU pind
#define TRIMS_GPIO_REG_RVD pind
#define TRIMS_GPIO_REG_RHR 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, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, 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 isBacklightEnable() (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"
}
@@ -1,70 +0,0 @@
/*
* 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 const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Er9xInterface * er9xInterface;
};
#endif
@@ -17,7 +17,6 @@
#include <iostream>
#include "ersky9xinterface.h"
#include "ersky9xeeprom.h"
#include "simulator/ersky9xsimulator.h"
#include "file.h"
#define FILE_TYP_GENERAL 1
@@ -1,15 +0,0 @@
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
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
)
add_library(ersky9x-simulator ersky9xsimulator.cpp)
@@ -1,247 +0,0 @@
/*
* 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 isBacklightEnable() (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 KEYS_GPIO_REG_MENU PIOB->PIO_PDSR
#define KEYS_GPIO_REG_EXIT PIOC->PIO_PDSR
#define KEYS_GPIO_REG_UP PIOC->PIO_PDSR
#define KEYS_GPIO_REG_DOWN PIOC->PIO_PDSR
#define KEYS_GPIO_REG_RIGHT PIOC->PIO_PDSR
#define KEYS_GPIO_REG_LEFT PIOC->PIO_PDSR
#define KEYS_GPIO_PIN_MENU 0x00000020
#define KEYS_GPIO_PIN_EXIT 0x01000000
#define KEYS_GPIO_PIN_UP 0x00000002
#define KEYS_GPIO_PIN_DOWN 0x00000020
#define KEYS_GPIO_PIN_RIGHT 0x00000010
#define KEYS_GPIO_PIN_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, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU)
KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT)
KEY_CASE(KEY_RIGHT, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT)
KEY_CASE(KEY_LEFT, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT)
KEY_CASE(KEY_UP, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP)
KEY_CASE(KEY_DOWN, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN)
}
}
#define TRIMS_GPIO_REG_LHL PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_LVD PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_RVU PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_RHL PIOA->PIO_PDSR
#define TRIMS_GPIO_REG_LHR PIOB->PIO_PDSR
#define TRIMS_GPIO_REG_LVU PIOC->PIO_PDSR
#define TRIMS_GPIO_REG_RVD PIOC->PIO_PDSR
#define TRIMS_GPIO_REG_RHR 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, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, 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"
}
@@ -1,70 +0,0 @@
/*
* 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 const char * getError();
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
virtual void setLuaStateReloadPermanentScripts() {};
protected:
Ersky9xInterface * ersky9xInterface;
};
#endif
+14 -13
View File
@@ -741,6 +741,14 @@ class CurveReferenceField: public TransformedField {
int _curve_value;
};
static int exportHeliInversionWeight(int source) {
return (source < 0) ? 1 : 0;
}
static int importHeliInversionWeight(int source) {
return source ? -100: 100;
}
class HeliField: public StructField {
public:
HeliField(SwashRingData & heli, BoardEnum board, unsigned int version, unsigned int variant)
@@ -756,22 +764,15 @@ class HeliField: public StructField {
Append(new SignedField<8>(heli.elevatorWeight));
}
else {
Append(new BoolField<1>(invertELE));
Append(new BoolField<1>(invertAIL));
Append(new BoolField<1>(invertCOL));
Append(new ConversionField< SignedField<1> >(heli.elevatorWeight, exportHeliInversionWeight, importHeliInversionWeight));
Append(new ConversionField< SignedField<1> >(heli.aileronWeight, exportHeliInversionWeight, importHeliInversionWeight));
Append(new ConversionField< SignedField<1> >(heli.collectiveWeight, exportHeliInversionWeight, importHeliInversionWeight));
Append(new UnsignedField<5>(heli.type));
Append(new SourceField<8>(heli.collectiveSource, board, version, variant));
//, FLAG_NOSWITCHES)); Fix shift in collective
Append(new UnsignedField<8>(heli.value));
}
}
// TODO before + after
protected:
bool invertELE;
bool invertAIL;
bool invertCOL;
};
class FlightModeField: public TransformedField {
@@ -2170,7 +2171,7 @@ class ArmCustomFunctionField: public TransformedField {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
fn.func = AssignFunc(fn.func + index);
fn.param = (int8_t)value;
fn.param = (int16_t)(uint16_t)value;
}
else if (fn.func >= FuncSetTimer1 && fn.func <= FuncSetTimer3) {
fn.func = AssignFunc(fn.func + index);
@@ -2823,7 +2824,7 @@ class SensorField: public TransformedField {
_instance = sensor.formula;
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
_param = (sensor.source) + (sensor.index << 8);
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
_param = ((uint8_t)sensor.sources[0]) + ((uint8_t)sensor.sources[1] << 8) + ((uint8_t)sensor.sources[2] << 16) + ((uint8_t)sensor.sources[3] << 24);
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
_param = (sensor.gps) + (sensor.alt << 8);
@@ -2845,7 +2846,7 @@ class SensorField: public TransformedField {
sensor.formula = _instance;
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
(sensor.source = _sources[0], sensor.index = _sources[1]);
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
for (int i=0; i<4; ++i)
sensor.sources[i] = _sources[i];
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
@@ -82,7 +82,8 @@ class ProtocolsConversionTable: public ConversionTable
addConversion(PULSES_DSMX, val++);
}
if (IS_TARANIS(board)) {
addConversion(PULSES_CROSSFIRE, val++);
addConversion(PULSES_CROSSFIRE, val++);
addConversion(PULSES_MULTIMODULE, val++);
}
}
};
+131 -121
View File
@@ -805,6 +805,16 @@ int OpenTxFirmware::getCapability(const Capability capability)
}
}
QTime OpenTxFirmware::getMaxTimerStart()
{
if (IS_TARANIS(board))
return QTime(23, 59, 59);
else if (IS_ARM(board))
return QTime(8, 59, 59);
else
return QTime(0, 59, 59);
}
bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
{
if (IS_TARANIS(board) && (source == TELEMETRY_SOURCE_RSSI_TX))
@@ -1143,7 +1153,7 @@ void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
Option usb_options[] = { { "massstorage", QObject::tr("Instead of Joystick emulation, USB connection is Mass Storage (as in the Bootloader)") }, { "cli", QObject::tr("Instead of Joystick emulation, USB connection is Command Line Interface") }, { NULL } };
firmware->addOptions(usb_options);
firmware->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
firmware->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use in the EU on radios sold after Jan 1st, 2015"));
firmware->addOption("eu", QObject::tr("Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015"));
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack"));
}
@@ -1168,8 +1178,109 @@ void registerOpenTxFirmwares()
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
/* Taranis Plus board */
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis board */
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis X9E board */
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR board with M128 chip */
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("Turnigy 9XR with m128 chip"), BOARD_M128);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR board */
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("Turnigy 9XR"), BOARD_STOCK);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
firmware->addOption("novario", QObject::tr("No vario support"));
firmware->addOption("nogps", QObject::tr("No GPS support"));
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9x board */
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X board"), BOARD_STOCK);
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X with stock board"), BOARD_STOCK);
firmware->addOptions(ext_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@@ -1205,7 +1316,7 @@ void registerOpenTxFirmwares()
firmwares.push_back(firmware);
/* 9x board with M128 chip */
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("M128 / 9X board"), BOARD_M128);
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("9X with stock board and m128 chip"), BOARD_M128);
firmware->addOptions(ext_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@@ -1234,69 +1345,52 @@ void registerOpenTxFirmwares()
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR board */
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("9XR"), BOARD_STOCK);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
/* ar9x board */
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("9X with AR9X board"), BOARD_AR9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
firmware->addOption("novario", QObject::tr("No vario support"));
firmware->addOption("nogps", QObject::tr("No GPS support"));
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR board with M128 chip */
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("9XR with M128 chip"), BOARD_M128);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
/* Sky9x board */
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("9X with Sky9x board"), BOARD_SKY9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Gruvin9x board */
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("Gruvin9x board / 9X"), BOARD_GRUVIN9X);
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("9X with Gruvin9x board"), BOARD_GRUVIN9X);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
@@ -1321,7 +1415,7 @@ void registerOpenTxFirmwares()
firmwares.push_back(firmware);
/* MEGA2560 board */
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("MEGA2560 board"), BOARD_MEGA2560);
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("DIY MEGA2560 radio"), BOARD_MEGA2560);
addOpenTxLcdOptions(firmware);
firmware->addOption("PWR", QObject::tr("Power management by soft-off circuitry"));
firmware->addOptions(ext_options);
@@ -1332,7 +1426,7 @@ void registerOpenTxFirmwares()
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("sdcard", QObject::tr("Support for SD memory card"));
//firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
//firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
@@ -1350,90 +1444,6 @@ void registerOpenTxFirmwares()
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Sky9x board */
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("Sky9x board / 9X"), BOARD_SKY9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* ar9x board */
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("ar9x board / 9X"), BOARD_AR9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("9XR-PRO"), BOARD_9XRPRO);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis board */
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis Plus board */
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis X9E board */
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
default_firmware_variant = GetFirmware("opentx-taranisplus-en");
current_firmware_variant = default_firmware_variant;
}
@@ -118,6 +118,8 @@ class OpenTxFirmware: public Firmware {
virtual QString getFirmwareUrl();
virtual int getCapability(const Capability);
virtual QTime getMaxTimerStart();
virtual bool isTelemetrySourceAvailable(int source);
@@ -30,8 +30,8 @@ macro(add_lua_export_target target)
add_custom_target(lua_export_${target} DEPENDS ${RADIO_SRC_DIRECTORY}/lua/lua_exports_${target}.inc)
endmacro(add_lua_export_target)
add_lua_export_target(taranis -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
add_lua_export_target(taranis_x9e -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
add_lua_export_target(taranis -DCPUARM -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
add_lua_export_target(taranis_x9e -DCPUARM -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
set(OPENTX_SRC_FILES
opentxsimulator.cpp
@@ -77,6 +77,9 @@
#undef min
#undef max
// some C++ headers must be included outside the custom namespace (fails to compile in gcc-6)
#include <math.h>
namespace NAMESPACE {
#if defined(CPUARM)
@@ -326,6 +329,11 @@ uint16_t anaIn(uint8_t chan)
return g_anas[chan];
}
uint16_t getAnalogValue(uint32_t index)
{
return anaIn(index);
}
bool hasExtendedTrims()
{
return g_model.extendedTrims;
@@ -497,7 +505,7 @@ void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
#endif
}
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id)
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id, uint8_t defaultValue)
{
#if defined(FRSKY_SPORT)
for (int i = 0; i<MAX_SENSORS; i++) {
@@ -509,7 +517,7 @@ uint8_t OpenTxSimulator::getSensorInstance(uint16_t id)
}
}
#endif
return 0;
return defaultValue;
}
uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
@@ -122,7 +122,7 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
virtual void sendTelemetry(uint8_t * data, unsigned int len);
virtual uint8_t getSensorInstance(uint16_t id);
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0);
virtual uint16_t getSensorRatio(uint16_t id);
@@ -1,15 +0,0 @@
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
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}
)
add_library(th9x-simulator th9xsimulator.cpp)
@@ -1,233 +0,0 @@
/*
* 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/th9x/th9xsimulator.h"
#include "firmwares/th9x/th9xinterface.h"
#define SIM
#define SIMU
#define SIMU_EXCEPTIONS
#undef min
#undef max
#define NUM_POTS 3
#define NUM_CSW 12
#define SWSRC_SW1 10
#include <exception>
#include <algorithm>
namespace Th9x {
#include "simpgmspace.h"
#include "th9x.cpp"
#include "stamp.cpp"
#include "menus.cpp"
#include "pers.cpp"
#include "file.cpp"
#include "lcd.cpp"
#include "drivers.cpp"
#include "foldedlist.cpp"
#include "simpgmspace.cpp"
#include "pulses.cpp"
int16_t g_anas[7];
char g_title[80] = "";
uint16_t anaIn(uint8_t chan)
{
if (chan == 7)
return 750;
else
return 512 + g_anas[chan];
}
bool hasExtendedTrims()
{
return false;
}
void setTrim(uint8_t idx, int8_t value)
{
g_model.trimData[idx].itrim = trimRevertM(value, g_model.trimData[idx].tmode);
}
void getTrims(int16_t values[4])
{
for (int i=0; i<4; i++) {
values[i] = trimVal(i);
}
}
void eeprom_RESV_mismatch(void)
{
assert(!"Should never been called. Only needed by VC++ (debug mode)");
}
#define TRIMS_GPIO_REG_LHL pind
#define TRIMS_GPIO_REG_LVD pind
#define TRIMS_GPIO_REG_RVU pind
#define TRIMS_GPIO_REG_RHL pind
#define TRIMS_GPIO_REG_LHR pind
#define TRIMS_GPIO_REG_LVU pind
#define TRIMS_GPIO_REG_RVD pind
#define TRIMS_GPIO_REG_RHR 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, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, 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, pine, 1<<INP_E_ThrCt)
SWITCH_CASE(4, pine, 1<<INP_E_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 isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
}
using namespace Th9x;
Th9xSimulator::Th9xSimulator(Th9xInterface * th9xInterface):
th9xInterface(th9xInterface)
{
}
bool Th9xSimulator::timer10ms()
{
#define TIMER10MS_IMPORT
#include "simulatorimport.h"
}
uint8_t * Th9xSimulator::getLcd()
{
#define GETLCD_IMPORT
#include "simulatorimport.h"
}
bool Th9xSimulator::lcdChanged(bool & lightEnable)
{
#define LCDCHANGED_IMPORT
#include "simulatorimport.h"
}
void Th9xSimulator::start(RadioData &radioData, bool tests)
{
th9xInterface->save(&eeprom[0], radioData);
StartMainThread(tests);
}
void Th9xSimulator::stop()
{
StopMainThread();
}
void Th9xSimulator::getValues(TxOutputs &outputs)
{
#define GETVALUES_IMPORT
#include "simulatorimport.h"
for (int i=0; i<8; i++)
outputs.chans[i] *= 2;
}
void Th9xSimulator::setValues(TxInputs &_inputs)
{
TxInputs inputs = _inputs;
for (int i=0; i<4; i++)
inputs.sticks[i] /= 2;
for (int i=0; i<3; i++)
inputs.pots[i] /= 2;
#define SETVALUES_IMPORT
#include "simulatorimport.h"
}
void Th9xSimulator::setTrim(unsigned int idx, int value)
{
Th9x::setTrim(idx, value);
}
void Th9xSimulator::getTrims(Trims & trims)
{
trims.extended = false;
Th9x::getTrims(trims.values);
}
const char * Th9xSimulator::getError()
{
#define GETERROR_IMPORT
#include "simulatorimport.h"
}
@@ -1,58 +0,0 @@
/*
* 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 th9x_simulator_h
#define th9x_simulator_h
#include "simulatorinterface.h"
class RadioData;
class Th9xInterface;
class Th9xSimulator : public SimulatorInterface {
public:
Th9xSimulator(Th9xInterface *);
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 * getError();
protected:
Th9xInterface * th9xInterface;
};
#endif
@@ -17,7 +17,6 @@
#include <iostream>
#include "th9xinterface.h"
#include "th9xeeprom.h"
#include "simulator/th9xsimulator.h"
#include "file.h"
#include "appdata.h"
+85 -36
View File
@@ -84,12 +84,15 @@ void GeneralEdit::on_calretrieve_PB_clicked()
{
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString calib=g.profile[profile_id].stickPotCalib();
int potsnum=GetCurrentFirmware()->getCapability(Pots);
int potsnum=GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
int numSwPots=GetCurrentFirmware()->getCapability(Switches)+GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
if (calib.isEmpty()) {
return;
}
else {
QString trainercalib = g.profile[profile_id].trainerCalib();
QString hwtypes = g.profile[profile_id].controlTypes();
QString controlNames=g.profile[profile_id].controlNames();
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
@@ -108,22 +111,18 @@ void GeneralEdit::on_calretrieve_PB_clicked()
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
Byte=calib.mid(i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
generalSettings.calibMid[i]=byte16;
if (ok) generalSettings.calibMid[i]=byte16;
Byte=calib.mid(4+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
generalSettings.calibSpanNeg[i]=byte16;
if (ok) generalSettings.calibSpanNeg[i]=byte16;
Byte=calib.mid(8+i*12,4);
byte16=(int16_t)Byte.toInt(&ok,16);
if (ok)
generalSettings.calibSpanPos[i]=byte16;
if (ok) 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)
generalSettings.trainer.calib[i]=byte16;
if (ok) generalSettings.trainer.calib[i]=byte16;
}
generalSettings.txCurrentCalibration=txCurrentCalibration;
generalSettings.txVoltageCalibration=txVoltageCalibration;
@@ -136,6 +135,48 @@ void GeneralEdit::on_calretrieve_PB_clicked()
} else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, radio calibration was not retrieved"));
}
if (hwtypes.length()==numSwPots) {
QString Byte;
int16_t byte16;
QByteArray qba;
int16_t offset;
bool ok;
for (int i=0; i<NUM_STICKS; i++) {
qba = controlNames.mid(3*i,3).toAscii();
strcpy(generalSettings.stickName[i], qba.data());
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
Byte=hwtypes.mid(i,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS),3).toAscii();
if (ok) {
generalSettings.switchConfig[i]=byte16;
strcpy(generalSettings.switchName[i], qba.data());
}
}
offset = GetCurrentFirmware()->getCapability(Switches);
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
Byte=hwtypes.mid(i+offset,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toAscii();
if (ok) {
generalSettings.potConfig[i]=byte16;
strcpy(generalSettings.potName[i], qba.data());
}
}
offset += GetCurrentFirmware()->getCapability(Pots);
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
Byte=hwtypes.mid(i+offset,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toAscii();
if (ok) {
generalSettings.sliderConfig[i]=byte16;
strcpy(generalSettings.sliderName[i], qba.data());
}
}
} else {
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, Switch/pot config not retrieved"));
}
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
generalSettings.stickMode=GSStickMode;
uint8_t byte8u;
@@ -143,45 +184,32 @@ void GeneralEdit::on_calretrieve_PB_clicked()
QString chars;
bool ok;
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
if (ok)
generalSettings.optrexDisplay=(byte8==1 ? true : false);
if (ok) generalSettings.optrexDisplay=(byte8==1 ? true : false);
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
if (ok)
generalSettings.contrast=byte8u;
if (ok) generalSettings.contrast=byte8u;
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
if (ok)
generalSettings.backlightBright=byte8u;
if (ok) generalSettings.backlightBright=byte8u;
byte8=(int8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
if (ok)
generalSettings.beeperMode = (GeneralSettings::BeeperMode)byte8;
if (ok) generalSettings.beeperMode = (GeneralSettings::BeeperMode)byte8;
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
if (ok)
generalSettings.beeperLength=byte8;
if (ok) generalSettings.beeperLength=byte8;
byte8=(int8_t)HapticSet.mid(0,2).toUInt(&ok,16);
if (ok)
generalSettings.hapticMode=(GeneralSettings::BeeperMode)byte8;
if (ok) generalSettings.hapticMode=(GeneralSettings::BeeperMode)byte8;
byte8=(int8_t)HapticSet.mid(2,2).toInt(&ok,16);
if (ok)
generalSettings.hapticStrength=byte8;
if (ok) generalSettings.hapticStrength=byte8;
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
if (ok)
generalSettings.hapticLength=byte8;
if (ok) generalSettings.hapticLength=byte8;
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
if (ok)
generalSettings.speakerMode=byte8u;
if (ok) generalSettings.speakerMode=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
if (ok)
generalSettings.speakerPitch=byte8u;
if (ok) generalSettings.speakerPitch=byte8u;
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
if (ok)
generalSettings.speakerVolume=byte8u;
if (ok) generalSettings.speakerVolume=byte8u;
if (CountrySet.length()==6) {
byte8u=(uint8_t)CountrySet.mid(0,2).toUInt(&ok,16);
if (ok)
generalSettings.countryCode=byte8u;
if (ok) generalSettings.countryCode=byte8u;
byte8u=(uint8_t)CountrySet.mid(2,2).toUInt(&ok,16);
if (ok)
generalSettings.imperial=byte8u;
if (ok) generalSettings.imperial=byte8u;
chars=CountrySet.mid(4,2);
generalSettings.ttsLanguage[0]=chars[0].toAscii();
generalSettings.ttsLanguage[1]=chars[1].toAscii();
@@ -200,13 +228,15 @@ void GeneralEdit::on_calstore_PB_clicked()
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
QString name=g.profile[profile_id].name();
int potsnum=GetCurrentFirmware()->getCapability(Pots);
int potsnum=GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
if (name.isEmpty()) {
ui->calstore_PB->setDisabled(true);
return;
}
else {
QString calib=g.profile[profile_id].stickPotCalib();
QString hwtypes=g.profile[profile_id].controlTypes();
QString controlNames=g.profile[profile_id].controlNames();
if (!(calib.isEmpty())) {
int ret = QMessageBox::question(this, "Companion",
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
@@ -227,6 +257,25 @@ void GeneralEdit::on_calstore_PB_clicked()
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
}
g.profile[profile_id].trainerCalib( calib );
hwtypes.clear();
controlNames.clear();
for (int i=0; i<NUM_STICKS; i++) {
controlNames.append(QString("%1").arg(generalSettings.stickName[i], -3));
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.switchConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.switchName[i], -3));
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.potConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.potName[i], -3));
}
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.sliderConfig[i], 1));
controlNames.append(QString("%1").arg(generalSettings.sliderName[i], -3));
}
g.profile[profile_id].controlTypes( hwtypes );
g.profile[profile_id].controlNames( controlNames );
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
+2 -2
View File
@@ -275,8 +275,8 @@ void GeneralSetupPanel::populateBacklightCB()
void GeneralSetupPanel::populateVoiceLangCB()
{
QComboBox * b = ui->voiceLang_CB;
QString strings[] = { QObject::tr("English"), QObject::tr("Finnish"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), NULL};
QString langcode[] = { "en", "fi","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", NULL};
QString strings[] = { QObject::tr("English"), QObject::tr("Dutch"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), QObject::tr("Hungarian"), NULL};
QString langcode[] = { "en", "nl","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", "hu", NULL};
b->clear();
for (int i=0; strings[i]!=NULL; i++) {
+1 -1
View File
@@ -658,7 +658,7 @@
<item>
<widget class="QCheckBox" name="adjustRTC">
<property name="toolTip">
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
<string>Automatically adjust the radio's clock if a GPS is connected to telemetry.</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
+22 -14
View File
@@ -103,7 +103,7 @@ void populatePhasesCB(QComboBox *b, int value)
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
}
GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
GVarGroup::GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
QObject(),
weightGV(weightGV),
weightSB(weightSB),
@@ -115,7 +115,7 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox
lock(true)
{
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
populateGVCB(weightCB, weight);
populateGVCB(*weightCB, weight, model);
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
}
@@ -179,13 +179,14 @@ void GVarGroup::valuesChanged()
}
}
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
CurveGroup::CurveGroup(QComboBox * curveTypeCB, QCheckBox * curveGVarCB, QComboBox * curveValueCB, QSpinBox * curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags):
QObject(),
curveTypeCB(curveTypeCB),
curveGVarCB(curveGVarCB),
curveValueCB(curveValueCB),
curveValueSB(curveValueSB),
curve(curve),
model(model),
flags(flags),
lock(false),
lastType(-1)
@@ -219,7 +220,7 @@ void CurveGroup::update()
curveGVarCB->setChecked(true);
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
lastType = curve.type;
populateGVCB(curveValueCB, curve.value);
populateGVCB(*curveValueCB, curve.value, model);
}
curveValueCB->show();
curveValueSB->hide();
@@ -276,6 +277,7 @@ void CurveGroup::gvarCBChanged(int state)
if (!lock) {
if (state) {
curve.value = 10000+1; // TODO constant in EEpromInterface ...
lastType = -1; // quickfix for issue #3518: force refresh of curveValueCB at next update() to set current index to GV1
}
else {
curve.value = 0; // TODO could be better
@@ -478,33 +480,39 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
b->setMaxVisibleItems(10);
}
void populateGVCB(QComboBox *b, int value)
void populateGVCB(QComboBox & b, int value, const ModelData & model)
{
bool selected = false;
b->clear();
b.clear();
int pgvars = GetCurrentFirmware()->getCapability(Gvars);
for (int i=-pgvars; i<=-1; i++) {
int count = GetCurrentFirmware()->getCapability(Gvars);
for (int i=-count; i<=-1; i++) {
int16_t gval = (int16_t)(-10000+i);
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
if (strlen(model.gvars_names[-i-1]) > 0)
b.addItem(QObject::tr("-GV%1 (%2)").arg(-i).arg(model.gvars_names[-i-1]), gval);
else
b.addItem(QObject::tr("-GV%1").arg(-i), gval);
if (value == gval) {
b->setCurrentIndex(b->count()-1);
b.setCurrentIndex(b.count()-1);
selected = true;
}
}
for (int i=1; i<=pgvars; i++) {
for (int i=1; i<=count; i++) {
int16_t gval = (int16_t)(10000+i);
b->addItem(QObject::tr("GV%1").arg(i), gval);
if (strlen(model.gvars_names[i-1]) > 0)
b.addItem(QObject::tr("GV%1 (%2)").arg(i).arg(model.gvars_names[i-1]), gval);
else
b.addItem(QObject::tr("GV%1").arg(i), gval);
if (value == gval) {
b->setCurrentIndex(b->count()-1);
b.setCurrentIndex(b.count()-1);
selected = true;
}
}
if (!selected) {
b->setCurrentIndex(pgvars);
b.setCurrentIndex(count);
}
}
+4 -4
View File
@@ -45,7 +45,7 @@ class GVarGroup: public QObject {
Q_OBJECT
public:
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
protected slots:
void gvarCBChanged(int);
@@ -71,7 +71,7 @@ class CurveGroup : public QObject {
Q_OBJECT
public:
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags=0);
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags=0);
void update();
protected slots:
@@ -85,6 +85,7 @@ class CurveGroup : public QObject {
QComboBox *curveValueCB;
QSpinBox *curveValueSB;
CurveReference & curve;
const ModelData & model;
unsigned int flags;
bool lock;
int lastType;
@@ -117,8 +118,7 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase);
#define GVARS_VARIANT 0x0001
#define FRSKY_VARIANT 0x0002
// void populateGVarCB(QComboBox *b, int value, int min, int max,int pgvars=5); //TODO: Clean Up
void populateGVCB(QComboBox *b, int value);
void populateGVCB(QComboBox & b, int value, const ModelData & model);
void populateSourceCB(QComboBox *b, const RawSource &source, const GeneralSettings generalSettings, const ModelData * model, unsigned int flags);
QString image2qstring(QImage image);
int findmult(float value, float base);
+5 -5
View File
@@ -7,7 +7,7 @@
#include <QCheckBox>
#include <QDoubleSpinBox>
LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, int min, int max, int deflt):
LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout * tableLayout, int row, int col, int & value, const ModelData & model, int min, int max, int deflt):
firmware(firmware),
spinbox(new QDoubleSpinBox()),
value(value),
@@ -50,7 +50,7 @@ LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row,
horizontalLayout->addWidget(cb);
horizontalLayout->addWidget(spinbox);
tableLayout->addLayout(row, col, horizontalLayout);
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
gvarGroup = new GVarGroup(gv, spinbox, cb, value, model, deflt, min, max, displayStep, allowGVars);
}
LimitsGroup::~LimitsGroup()
@@ -119,13 +119,13 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
}
// Channel offset
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].offset, -1000, 1000, 0);
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].offset, model, -1000, 1000, 0);
// Channel min
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].min, model, -model.getChannelsMax()*10, 0, -1000);
// Channel max
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].max, model, 0, model.getChannelsMax()*10, 1000);
// Channel inversion
QComboBox * invCB = new QComboBox(this);
+1 -1
View File
@@ -10,7 +10,7 @@ class GVarGroup;
class LimitsGroup
{
public:
LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, int min, int max, int deflt);
LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, const ModelData & model, int min, int max, int deflt);
~LimitsGroup();
void updateMinMax(int max);
+1 -2
View File
@@ -503,9 +503,8 @@ void Curves::resizeEvent(QResizeEvent *event)
ModelPanel::resizeEvent(event);
}
void Curves::on_curveType_currentIndexChanged()
void Curves::on_curveType_currentIndexChanged(int index)
{
int index = ui->curveType->currentIndex();
unsigned int flags = templates[index].flags;
ui->curveCoeffLabel->setVisible(flags & CURVE_COEFF_ENABLE);
ui->curveCoeff->setVisible(flags & CURVE_COEFF_ENABLE);
+1 -1
View File
@@ -46,7 +46,7 @@ class Curves : public ModelPanel
void onNodeMoved(int x, int y);
void onNodeFocus();
void onNodeUnfocus();
void on_curveType_currentIndexChanged();
void on_curveType_currentIndexChanged(int index);
void on_curveApply_clicked();
protected:
+2 -2
View File
@@ -70,7 +70,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
s1.report("get tracks");
if (IS_TARANIS(firmware->getBoard())) {
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/FUNCTIONS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
for (int i=0; i<num_fsw; i++) {
if (functions[i].func==FuncPlayScript) {
QString temp = functions[i].paramarm;
@@ -403,7 +403,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
else if (func>=FuncSetTimer1 && func<=FuncSetTimer3) {
if (modified) cfn.param = QTimeS(fswtchParamTime[i]->time()).seconds();
fswtchParamTime[i]->setMinimumTime(QTime(0, 0, 0));
fswtchParamTime[i]->setMaximumTime(QTime(0, 59, 59));
fswtchParamTime[i]->setMaximumTime(firmware->getMaxTimerStart());
fswtchParamTime[i]->setTime(QTimeS(cfn.param));
widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM + CUSTOM_FUNCTION_ENABLE;
}
-2
View File
@@ -46,8 +46,6 @@
#include <math.h>
static const double Pi = 3.14159265358979323846264338327950288419717;
Edge::Edge(Node *sourceNode, Node *destNode)
: arrowSize(10)
{
+4 -4
View File
@@ -21,11 +21,11 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
QRegExp rx(CHAR_FOR_NAMES_REGEX);
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, -100, 100);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, 0, -100, 100);
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, model, 100, -100, 100);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, model, 0, -100, 100);
}
else {
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, 0, 100);
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, model, 100, 0, 100);
gvOffsetGroup = NULL;
ui->offsetLabel->hide();
ui->offsetGV->hide();
@@ -33,7 +33,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->offsetCB->hide();
}
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve,
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, model,
firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings, MixesContext);
+55 -28
View File
@@ -110,14 +110,14 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
reLayout->addWidget(label, i, 0, 1, 1);
if (phaseIdx > 0) {
// RE link to another RE
QComboBox *link = new QComboBox(ui->gvGB);
link->setProperty("index", i);
populateGvarUseCB(link, phaseIdx);
connect(link, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseREUse_currentIndexChanged(int)));
reUse[i] = new QComboBox(ui->reGB);
reUse[i]->setProperty("index", i);
populateGvarUseCB(reUse[i], phaseIdx);
if (phase.rotaryEncoders[i] > 1024) {
link->setCurrentIndex(phase.rotaryEncoders[i] - 1024);
reUse[i]->setCurrentIndex(phase.rotaryEncoders[i] - 1024);
}
reLayout->addWidget(link, i, 1, 1, 1);
connect(reUse[i], SIGNAL(currentIndexChanged(int)), this, SLOT(phaseREUse_currentIndexChanged(int)));
reLayout->addWidget(reUse[i], i, 1, 1, 1);
}
// RE value
reValues[i] = new QSpinBox(ui->reGB);
@@ -152,14 +152,14 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
}
if (phaseIdx > 0) {
// GVar link to another GVar
QComboBox *link = new QComboBox(ui->gvGB);
link->setProperty("index", i);
populateGvarUseCB(link, phaseIdx);
gvUse[i] = new QComboBox(ui->gvGB);
gvUse[i]->setProperty("index", i);
populateGvarUseCB(gvUse[i], phaseIdx);
if (phase.gvars[i] > 1024) {
link->setCurrentIndex(phase.gvars[i] - 1024);
gvUse[i]->setCurrentIndex(phase.gvars[i] - 1024);
}
connect(link, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseGVUse_currentIndexChanged(int)));
gvLayout->addWidget(link, i, col++, 1, 1);
connect(gvUse[i], SIGNAL(currentIndexChanged(int)), this, SLOT(phaseGVUse_currentIndexChanged(int)));
gvLayout->addWidget(gvUse[i], i, col++, 1, 1);
}
// GVar value
gvValues[i] = new QSpinBox(ui->gvGB);
@@ -227,17 +227,11 @@ void FlightModePanel::update()
}
}
for (int i=0; i<reCount; i++) {
reValues[i]->setDisabled(false);
int idx = phase.rotaryEncoders[i];
FlightModeData *phasere = &phase;
while (idx > 1024) {
idx -= 1025;
phasere = &model->flightModeData[idx];
idx = phasere->rotaryEncoders[i];
reValues[i]->setDisabled(true);
if (ui->reGB->isVisible()) {
for (int i=0; i<reCount; i++) {
reValues[i]->setDisabled(model->isRELinked(phaseIdx, i));
reValues[i]->setValue(model->getREValue(phaseIdx, i));
}
reValues[i]->setValue(phasere->rotaryEncoders[i]);
}
}
@@ -251,9 +245,11 @@ void FlightModePanel::phaseName_editingFinished()
void FlightModePanel::phaseSwitch_currentIndexChanged(int index)
{
if (!lock) {
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
phase.swtch = RawSwitch(comboBox->itemData(index).toInt());
emit modified();
}
}
void FlightModePanel::phaseFadeIn_editingFinished()
@@ -290,8 +286,14 @@ void FlightModePanel::trimUpdate(unsigned int trim)
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
else
trimsUse[trim]->setCurrentIndex(phase.trimRef[chn]);
trimsValue[trim]->setEnabled(true);
trimsSlider[trim]->setEnabled(true);
if (phaseIdx == 0 || phase.trimRef[chn] == phaseIdx || (IS_TARANIS(board) && phase.trimMode[chn] != 0)) {
trimsValue[trim]->setEnabled(true);
trimsSlider[trim]->setEnabled(true);
}
else {
trimsValue[trim]->setEnabled(false);
trimsSlider[trim]->setEnabled(false);
}
}
lock = false;
}
@@ -330,6 +332,8 @@ void FlightModePanel::phaseGVUse_currentIndexChanged(int index)
phase.gvars[gvar] = 1024 + index;
}
update();
if (model->isGVarLinkedCircular(phaseIdx,gvar))
QMessageBox::warning(this, "Companion", tr("Warning: Global variable links back to itself. Flight Mode 0 value used."));
emit modified();
lock = false;
}
@@ -340,6 +344,7 @@ void FlightModePanel::phaseGVPopupToggled(bool checked)
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
int gvar = cb->property("index").toInt();
model->gvars_popups[gvar] = checked;
emit modified();
}
void FlightModePanel::phaseREValue_editingFinished()
@@ -365,8 +370,10 @@ void FlightModePanel::phaseREUse_currentIndexChanged(int index)
phase.rotaryEncoders[re] = 1024 + index; ;
}
update();
lock = false;
if (model->isRELinkedCircular(phaseIdx,re))
QMessageBox::warning(this, "Companion", tr("Warning: Rotary encoder links back to itself. Flight Mode 0 value used."));
emit modified();
lock = false;
}
}
@@ -442,9 +449,29 @@ void FlightModePanel::fmClear()
{
int res = QMessageBox::question(this, "Companion", tr("Clear all current Flight Mode properties?"), QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::Yes) {
phase.clear();
for(int i=0; i < 4; ++i) {
model->setTrimValue(phaseIdx, i, 0);
phase.clear(phaseIdx);
if (phaseIdx == 0) {
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
for (int i=0; i < gvCount; ++i) {
memset(&model->gvars_names[i], 0, sizeof(model->gvars_names[i]));
model->gvars_popups[i] = 0;
}
}
}
else {
lock = true;
QComboBox * pswtch = ui->swtch;
RawSwitch item = RawSwitch(SWITCH_TYPE_NONE);
pswtch->setCurrentIndex(pswtch->findText(item.toString()));
if (gvCount > 0 && (firmware->getCapability(GvarsFlightModes))) {
for (int i=0; i<gvCount; i++) {
gvUse[i]->setCurrentIndex((phase.gvars[i] > 1024 ? (phase.gvars[i] - 1024) : 0));
}
}
for (int i=0; i<reCount; i++) {
reUse[i]->setCurrentIndex((phase.rotaryEncoders[i] > 1024 ? (phase.rotaryEncoders[i] - 1024) : 0));
}
lock = false;
}
update();
emit modified();
+2
View File
@@ -54,7 +54,9 @@ class FlightModePanel : public ModelPanel
QLineEdit * gvNames[C9X_MAX_GVARS];
QSpinBox * gvValues[C9X_MAX_GVARS];
QCheckBox * gvPopups[C9X_MAX_GVARS];
QComboBox * gvUse[C9X_MAX_GVARS];
QSpinBox * reValues[C9X_MAX_ENCODERS];
QComboBox * reUse[C9X_MAX_ENCODERS];
QVector<QComboBox *> trimsUse;
QVector<QSpinBox *> trimsValue;
QVector<QSlider *> trimsSlider;
+3 -3
View File
@@ -25,10 +25,10 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
int limit = firmware->getCapability(OffsetWeight);
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, model, 100, -limit, limit);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, model, 0, -limit, limit);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB,
md->curve, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
md->curve, model, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
ui->MixDR_CB->setChecked(md->noExpo == 0);
+11 -6
View File
@@ -42,6 +42,8 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
ui->countdownBeep->addItem(tr("Voice"), TimerData::COUNTDOWN_VOICE);
ui->countdownBeep->addItem(tr("Haptic"), TimerData::COUNTDOWN_HAPTIC);
}
ui->value->setMaximumTime(firmware->getMaxTimerStart());
ui->persistent->setField(timer.persistent, this);
ui->persistent->addItem(tr("Not persistent"), 0);
@@ -66,9 +68,11 @@ TimerPanel::~TimerPanel()
void TimerPanel::update()
{
int min = timer.val / 60;
int sec = timer.val % 60;
ui->value->setTime(QTime(0, min, sec));
int hour = timer.val / 3600;
int min = (timer.val - (hour * 3600)) / 60;
int sec = (timer.val - (hour * 3600)) % 60;
ui->value->setTime(QTime(hour, min, sec));
if (firmware->getCapability(PermTimers)) {
int sign = 1;
@@ -94,7 +98,7 @@ QWidget * TimerPanel::getLastFocus()
void TimerPanel::on_value_editingFinished()
{
timer.val = ui->value->time().minute()*60 + ui->value->time().second();
timer.val = ui->value->time().hour()*3600 + ui->value->time().minute()*60 + ui->value->time().second();
emit modified();
}
@@ -327,8 +331,8 @@ void ModulePanel::update()
ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES);
if (mask & MASK_CHANNELS_RANGE) {
ui->channelsStart->setMaximum(32 - ui->channelsCount->value());
ui->channelsCount->setMaximum(qMin(16, 32-ui->channelsStart->value()));
ui->channelsStart->setMaximum(33 - ui->channelsCount->value());
ui->channelsCount->setMaximum(qMin(16, 33-ui->channelsStart->value()));
}
}
@@ -774,6 +778,7 @@ void SetupPanel::populateThrottleSourceCB()
lock = true;
ui->throttleSource->clear();
ui->throttleSource->addItem(QObject::tr("THR"));
if (IS_TARANIS_X9E(GetEepromInterface()->getBoard())) {
+3 -3
View File
@@ -18,7 +18,7 @@
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>-1</number>
<number>6</number>
</property>
<property name="margin">
<number>0</number>
@@ -39,10 +39,10 @@
<bool>true</bool>
</property>
<property name="currentSection">
<enum>QDateTimeEdit::MinuteSection</enum>
<enum>QDateTimeEdit::HourSection</enum>
</property>
<property name="displayFormat">
<string notr="true">mm:ss</string>
<string notr="true">hh:mm:ss</string>
</property>
</widget>
</item>
+5 -4
View File
@@ -619,7 +619,7 @@ void TelemetrySensorPanel::update()
ui->source4->setVisible(sources34FieldsDisplayed);
ui->autoOffset->setVisible(sensor.unit != SensorData::UNIT_RPMS && isConfigurable);
ui->filter->setVisible(isConfigurable);
ui->persistent->setVisible((sensor.type == SensorData::TELEM_TYPE_CALCULATED && sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION) || isConfigurable);
ui->persistent->setVisible(sensor.type == SensorData::TELEM_TYPE_CALCULATED);
lock = false;
}
@@ -696,10 +696,10 @@ void TelemetrySensorPanel::on_unit_currentIndexChanged(int index)
}
}
void TelemetrySensorPanel::on_prec_valueChanged()
void TelemetrySensorPanel::on_prec_valueChanged(double value)
{
if (!lock) {
sensor.prec = ui->prec->value();
sensor.prec = value;
emit dataModified();
emit modified();
}
@@ -800,7 +800,8 @@ void TelemetryPanel::setup()
if (IS_ARM(firmware->getBoard())) {
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
if (IS_9XRPRO(firmware->getBoard())) {
if (IS_9XRPRO(firmware->getBoard()) ||
(IS_TARANIS(firmware->getBoard()) && generalSettings.hw_uartMode == 2)) {
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
}
ui->telemetryProtocol->setCurrentIndex(model->telemetryProtocol);
+1 -1
View File
@@ -96,7 +96,7 @@ class TelemetrySensorPanel: public ModelPanel
void on_type_currentIndexChanged(int index);
void on_formula_currentIndexChanged(int index);
void on_unit_currentIndexChanged(int index);
void on_prec_valueChanged();
void on_prec_valueChanged(double value);
protected:
void updateSourcesComboBox(AutoComboBox * cb, bool negative);
+24 -1
View File
@@ -98,7 +98,8 @@ QString ModelPrinter::printModuleProtocol(unsigned int protocol)
"LP45", "DSM2", "DSMX",
"PPM16", "PPMsim",
"FrSky XJT (D16)", "FrSky XJT (D8)", "FrSky XJT (LR12)", "FrSky DJT",
"Crossfire"
"Crossfire",
"DIY Multiprotocol Module"
};
return CHECK_IN_ARRAY(strings, protocol);
@@ -142,6 +143,25 @@ QString ModelPrinter::printTrainerMode()
return result;
}
QString ModelPrinter::printHeliSwashType ()
{
switch (model.swashRingData.type) {
case HELI_SWASH_TYPE_90:
return tr("90");
case HELI_SWASH_TYPE_120:
return tr("120");
case HELI_SWASH_TYPE_120X:
return tr("120X");
case HELI_SWASH_TYPE_140:
return tr("140");
case HELI_SWASH_TYPE_NONE:
return tr("Off");
default:
return "???";
}
}
QString ModelPrinter::printCenterBeep()
{
QStringList strl;
@@ -306,6 +326,9 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
else if (input.carryTrim<0) str += " " + Qt::escape(RawSource(SOURCE_TYPE_TRIM, (-(input.carryTrim)-1)).toString(&model));
}
if (input.offset)
str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(input.offset)));
if (firmware->getCapability(HasExpoNames) && input.name[0])
str += Qt::escape(QString(" [%1]").arg(input.name));
+1
View File
@@ -44,6 +44,7 @@ class ModelPrinter: public QObject
QString printModule(int idx);
QString printTrainerMode();
QString printCenterBeep();
QString printHeliSwashType();
QString printTrim(int flightModeIndex, int stickIndex);
QString printGlobalVar(int flightModeIndex, int gvarIndex);
QString printRotaryEncoder(int flightModeIndex, int reIndex);
+5 -13
View File
@@ -209,8 +209,8 @@
#ifdef MOUNTED_GETMNTINFO
# if ! HAVE_STRUCT_STATFS_F_FSTYPENAME
static char *
# if defined(MOUNTED_VMOUNT) && ! HAVE_STRUCT_STATFS_F_FSTYPENAME
static const char *
fstype_to_string (short int t)
{
switch (t)
@@ -305,20 +305,11 @@ fstype_to_string (short int t)
}
# endif
static char *
fsp_to_string (const struct statfs *fsp)
{
# if HAVE_STRUCT_STATFS_F_FSTYPENAME
return (char *) (fsp->f_fstypename);
# else
return fstype_to_string (fsp->f_type);
# endif
}
#endif /* MOUNTED_GETMNTINFO */
#ifdef MOUNTED_VMOUNT /* AIX. */
static char *
static const char *
fstype_to_string (int t)
{
struct vfs_ent *e;
@@ -900,7 +891,7 @@ read_file_system_list (bool need_fs_type)
*mtail = NULL;
return mount_list;
#if defined(MOUNTED_GETMNTENT1) || defined(MOUNTED_GETMNTENT2) || defined(MOUNTED_GETMNT) || defined(MOUNTED_FREAD) || defined(MOUNTED_FREAD_FSTYP)
free_then_fail:
{
int saved_errno = errno;
@@ -920,6 +911,7 @@ read_file_system_list (bool need_fs_type)
errno = saved_errno;
return NULL;
}
#endif
}
void free_file_system_list(struct mount_entry * mount_list)
+53
View File
@@ -128,6 +128,8 @@ QString MultiModelPrinter::print(QTextDocument * document)
QString str = "<table border='1' cellspacing='0' cellpadding='3' width='100%' style='font-family: monospace;'>";
str += printSetup();
if (firmware->getCapability(Heli))
str += printHeliSetup();
if (firmware->getCapability(FlightModes))
str += printFlightModes();
str += printInputs();
@@ -181,6 +183,57 @@ QString MultiModelPrinter::printSetup()
return str;
}
QString MultiModelPrinter::printHeliSetup()
{
bool heliEnabled = false;
for (int k=0; k<models.size(); k++) {
heliEnabled = heliEnabled || models[k]->swashRingData.type != HELI_SWASH_TYPE_NONE;
}
if (!heliEnabled)
return "";
QString str = printTitle(tr("Helicopter Setup"));
MultiColumns columns(models.size());
columns.appendTitle (tr("Swash Type:"));
COMPARE(modelPrinter->printHeliSwashType());
columns.append ("<br/>");
columns.appendTitle (tr("Swash Ring:"));
COMPARE(model->swashRingData.value);
columns.append ("<table cellspacing='0' cellpadding='1' width='100%' border='0' style='border-collapse:collapse'>");
columns.append("<tr>");
columns.append("<td></td><td><b>" + tr("Input") + "</b></td><td><b>" + tr("Weight") + "</b></td>");
columns.append("</tr>");
columns.append("<tr><td><b>" + tr("Long. cyc") + "</b></td><td>");
COMPARE(model->swashRingData.elevatorSource.toString(model));
columns.append("</td><td>");
COMPARE(model->swashRingData.elevatorWeight)
columns.append("</td></tr>");
columns.append("<tr><td><b>" + tr("Lateral cyc") + "</b></td><td>");
COMPARE(model->swashRingData.aileronSource.toString(model));
columns.append("</td><td>");
COMPARE(model->swashRingData.aileronWeight)
columns.append("</td></tr>");
columns.append("<tr><td><b>" + tr("Collective") + "</b></td><td>");
COMPARE(model->swashRingData.collectiveSource.toString(model));
columns.append("</td><td>");
COMPARE(model->swashRingData.collectiveWeight)
columns.append("</td></tr>");
columns.append("</table>");
str.append(columns.print());
return str;
}
QString MultiModelPrinter::printFlightModes()
{
QString str = printTitle(tr("Flight modes"));
+1
View File
@@ -43,6 +43,7 @@ class MultiModelPrinter: public QObject
QString printTitle(const QString & label);
QString printSetup();
QString printHeliSetup();
QString printFlightModes();
QString printLimits();
QString printInputs();
+29 -18
View File
@@ -94,7 +94,7 @@ QString SyncProcess::updateEntry(const QString & path, const QDir & source, cons
else {
if (!destinationInfo.exists()) {
// qDebug() << "Copy" << path << "to" << destinationPath;
progress->addText(tr("Copy %1 to %2\n").arg(path).arg(destinationPath));
progress->addText(tr("Copy %1 to %2").arg(path).arg(destinationPath) + "\n");
if (!QFile::copy(path, destinationPath)) {
return QObject::tr("Copy '%1' to '%2' failed").arg(path).arg(destinationPath);
}
@@ -105,27 +105,38 @@ QString SyncProcess::updateEntry(const QString & path, const QDir & source, cons
if (!sourceFile.open(QFile::ReadOnly)) {
return QObject::tr("Open '%1' failed").arg(path);
}
QString sourceContents = sourceFile.readAll();
QByteArray sourceContents = sourceFile.readAll();
sourceFile.close();
// try to retrieve destination contents
QFile destinationFile(path);
if (destinationFile.open(QFile::ReadOnly)) {
QString destinationContents = destinationFile.readAll();
destinationFile.close();
if (sourceContents == destinationContents) {
// qDebug() << "Skip" << path;
return QString();
}
// retrieve destination contents
QFile destinationFile(destinationPath);
if (!destinationFile.open(QFile::ReadOnly)) {
return QObject::tr("Open '%1' failed").arg(destinationPath);
}
if (!destinationFile.open(QFile::WriteOnly)) {
return QObject::tr("Write '%1' failed").arg(destinationPath);
}
progress->addText(tr("Write %1\n").arg(destinationPath));
// qDebug() << "Write" << destinationPath;
QTextStream destinationStream(&destinationFile);
destinationStream << sourceContents;
QByteArray destinationContents = destinationFile.readAll();
destinationFile.close();
if (contentsDifferent(sourceContents, destinationContents)) {
// copy contents
if (!destinationFile.open(QFile::WriteOnly | QIODevice::Truncate)) {
return QObject::tr("Write '%1' failed").arg(destinationPath);
}
progress->addText(tr("Write %1").arg(destinationPath) + "\n");
// qDebug() << "Write" << destinationPath;
destinationFile.write(sourceContents);
destinationFile.close();
}
}
}
return QString();
}
bool SyncProcess::contentsDifferent(const QByteArray & source, const QByteArray & dest) {
if (source.size() != dest.size()) return true;
for(int n=0; n<source.size(); ++n) {
if (source[n] != dest[n]) {
return true;
}
}
return false;
}
+2
View File
@@ -3,6 +3,7 @@
#include <QString>
#include <QStringList>
#include <QByteArray>
class QDir;
class ProgressWidget;
@@ -22,6 +23,7 @@ class SyncProcess : public QObject
int getFilesCount(const QString & directory);
QStringList updateDir(const QString & source, const QString & destination);
QString updateEntry(const QString & path, const QDir & source, const QDir & destination);
bool contentsDifferent(const QByteArray & source, const QByteArray & dest);
QString folder1;
QString folder2;
ProgressWidget * progress;
+2 -2
View File
@@ -191,7 +191,7 @@ void resetAvrdudeFuses(bool eepromProtect, ProgressWidget *progress)
QStringList str;
if (bcd.getMCU() == "m2560") {
args << "-B8";
QString erStr = eepromProtect ? "hfuse:w:0x11:m" : "hfuse:w:0x19:m";
QString erStr = eepromProtect ? "hfuse:w:0x51:m" : "hfuse:w:0x59: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
}
@@ -220,7 +220,7 @@ void resetAvrdudeFuses(bool eepromProtect, ProgressWidget *progress)
lfuses = "lfuse:w:0x3F:m";
}
QString erStr = eepromProtect ? "hfuse:w:0x81:m" : "hfuse:w:0x89:m";
QString erStr = eepromProtect ? "hfuse:w:0xC1:m" : "hfuse:w:0xC9:m";
str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m";
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
}
-1
View File
@@ -14,7 +14,6 @@ set(shared_HDRS
autolineedit.h
genericpanel.h
hexspinbox.h
verticalscrollarea.h
)
qt4_wrap_cpp(shared_SRCS ${shared_HDRS})
+1 -2
View File
@@ -5,8 +5,7 @@
VerticalScrollArea::VerticalScrollArea(QWidget * parent, GenericPanel * panel):
QScrollArea(parent),
panel(panel),
parent(parent)
panel(panel)
{
setWidgetResizable(true);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -15,7 +15,6 @@ class VerticalScrollArea : public QScrollArea
private:
GenericPanel * panel;
QWidget * parent;
};
#endif
+1 -1
View File
@@ -862,7 +862,7 @@ void SimulatorDialogTaranis::getValues()
{
-pots[0]->value(),
pots[1]->value(),
((flags && SIMULATOR_FLAGS_S3) ? pots[2]->value() : 0),
((flags & SIMULATOR_FLAGS_S3) ? pots[2]->value() : 0),
-sliders[0]->value(),
sliders[1]->value()
},
@@ -99,7 +99,7 @@ class SimulatorInterface
virtual void sendTelemetry(uint8_t * data, unsigned int len) = 0;
virtual uint8_t getSensorInstance(uint16_t id) = 0;
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) = 0;
virtual uint16_t getSensorRatio(uint16_t id) = 0;
+58 -31
View File
@@ -143,37 +143,40 @@ void TelemetrySimulator::closeEvent(QCloseEvent *event)
event->accept();
}
#define SET_INSTANCE(control, id, def) ui->control->setText(QString::number(simulator->getSensorInstance(id, ((def) & 0x1F) + 1)))
void TelemetrySimulator::showEvent(QShowEvent *event)
{
SET_INSTANCE(rxbt_inst, BATT_ID, 0);
SET_INSTANCE(rssi_inst, RSSI_ID, 24);
SET_INSTANCE(swr_inst, SWR_ID, 24);
SET_INSTANCE(a1_inst, ADC1_ID, 0);
SET_INSTANCE(a2_inst, ADC2_ID, 0);
SET_INSTANCE(a3_inst, A3_FIRST_ID, 0);
SET_INSTANCE(a4_inst, A4_FIRST_ID, 0);
SET_INSTANCE(t1_inst, T1_FIRST_ID, 0);
SET_INSTANCE(t2_inst, T2_FIRST_ID, 0);
SET_INSTANCE(rpm_inst, RPM_FIRST_ID, DATA_ID_RPM);
SET_INSTANCE(fuel_inst, FUEL_FIRST_ID, 0);
SET_INSTANCE(fuel_qty_inst, FUEL_QTY_FIRST_ID, 0);
SET_INSTANCE(aspd_inst, AIR_SPEED_FIRST_ID, 0);
SET_INSTANCE(vvspd_inst, VARIO_FIRST_ID, DATA_ID_VARIO);
SET_INSTANCE(valt_inst, ALT_FIRST_ID, DATA_ID_VARIO);
SET_INSTANCE(fasv_inst, VFAS_FIRST_ID, DATA_ID_FAS);
SET_INSTANCE(fasc_inst, CURR_FIRST_ID, DATA_ID_FAS);
SET_INSTANCE(cells_inst, CELLS_FIRST_ID, DATA_ID_FLVSS);
SET_INSTANCE(gpsa_inst, GPS_ALT_FIRST_ID, DATA_ID_GPS);
SET_INSTANCE(gpss_inst, GPS_SPEED_FIRST_ID, DATA_ID_GPS);
SET_INSTANCE(gpsc_inst, GPS_COURS_FIRST_ID, DATA_ID_GPS);
SET_INSTANCE(gpst_inst, GPS_TIME_DATE_FIRST_ID, DATA_ID_GPS);
SET_INSTANCE(gpsll_inst, GPS_LONG_LATI_FIRST_ID, DATA_ID_GPS);
SET_INSTANCE(accx_inst, ACCX_FIRST_ID, 0);
SET_INSTANCE(accy_inst, ACCY_FIRST_ID, 0);
SET_INSTANCE(accz_inst, ACCZ_FIRST_ID, 0);
ui->rxbt_inst->setText(QString::number(simulator->getSensorInstance(BATT_ID)));
ui->rxbt_ratio->setValue(simulator->getSensorRatio(BATT_ID) / 10.0);
ui->rssi_inst->setText(QString::number(simulator->getSensorInstance(RSSI_ID)));
ui->swr_inst->setText(QString::number(simulator->getSensorInstance(SWR_ID)));
ui->a1_inst->setText(QString::number(simulator->getSensorInstance(ADC1_ID)));
ui->A1_ratio->setValue(simulator->getSensorRatio(ADC1_ID) / 10.0);
ui->a2_inst->setText(QString::number(simulator->getSensorInstance(ADC2_ID)));
ui->A2_ratio->setValue(simulator->getSensorRatio(ADC2_ID) / 10.0);
ui->a3_inst->setText(QString::number(simulator->getSensorInstance(A3_FIRST_ID)));
ui->a4_inst->setText(QString::number(simulator->getSensorInstance(A4_FIRST_ID)));
ui->t1_inst->setText(QString::number(simulator->getSensorInstance(T1_FIRST_ID)));
ui->t2_inst->setText(QString::number(simulator->getSensorInstance(T2_FIRST_ID)));
ui->rpm_inst->setText(QString::number(simulator->getSensorInstance(RPM_FIRST_ID)));
ui->fuel_inst->setText(QString::number(simulator->getSensorInstance(FUEL_FIRST_ID)));
ui->aspd_inst->setText(QString::number(simulator->getSensorInstance(AIR_SPEED_FIRST_ID)));
ui->vvspd_inst->setText(QString::number(simulator->getSensorInstance(VARIO_FIRST_ID)));
ui->valt_inst->setText(QString::number(simulator->getSensorInstance(ALT_FIRST_ID)));
ui->fasv_inst->setText(QString::number(simulator->getSensorInstance(VFAS_FIRST_ID)));
ui->fasc_inst->setText(QString::number(simulator->getSensorInstance(CURR_FIRST_ID)));
ui->cells_inst->setText(QString::number(simulator->getSensorInstance(CELLS_FIRST_ID)));
ui->gpsa_inst->setText(QString::number(simulator->getSensorInstance(GPS_ALT_FIRST_ID)));
ui->gpss_inst->setText(QString::number(simulator->getSensorInstance(GPS_SPEED_FIRST_ID)));
ui->gpsc_inst->setText(QString::number(simulator->getSensorInstance(GPS_COURS_FIRST_ID)));
ui->gpst_inst->setText(QString::number(simulator->getSensorInstance(GPS_TIME_DATE_FIRST_ID)));
ui->gpsll_inst->setText(QString::number(simulator->getSensorInstance(GPS_LONG_LATI_FIRST_ID)));
ui->accx_inst->setText(QString::number(simulator->getSensorInstance(ACCX_FIRST_ID)));
ui->accy_inst->setText(QString::number(simulator->getSensorInstance(ACCY_FIRST_ID)));
ui->accz_inst->setText(QString::number(simulator->getSensorInstance(ACCZ_FIRST_ID)));
ui->Simulate->setChecked(true);
onSimulateToggled(true); // not sure why this doesn't fire automatically
@@ -193,13 +196,27 @@ void setSportPacketCrc(uint8_t * packet)
//TRACE("crc set: %x", packet[FRSKY_SPORT_PACKET_SIZE-1]);
}
void generateSportPacket(uint8_t * packet, uint8_t dataId, uint8_t prim, uint16_t appId, uint32_t data)
uint8_t getBit(uint8_t position, uint8_t value)
{
packet[0] = dataId;
return (value & (uint8_t)(1 << position)) ? 1 : 0;
}
bool generateSportPacket(uint8_t * packet, uint8_t dataId, uint8_t prim, uint16_t appId, uint32_t data)
{
if (dataId > 0x1B ) return false;
// generate Data ID field
uint8_t bit5 = getBit(0, dataId) ^ getBit(1, dataId) ^ getBit(2, dataId);
uint8_t bit6 = getBit(2, dataId) ^ getBit(3, dataId) ^ getBit(4, dataId);
uint8_t bit7 = getBit(0, dataId) ^ getBit(2, dataId) ^ getBit(4, dataId);
packet[0] = (bit7 << 7) + (bit6 << 6) + (bit5 << 5) + dataId;
// qDebug("dataID: 0x%02x (%d)", packet[0], dataId);
packet[1] = prim;
*((uint16_t *)(packet+2)) = appId;
*((int32_t *)(packet+4)) = data;
setSportPacketCrc(packet);
return true;
}
void TelemetrySimulator::generateTelemetryFrame()
@@ -267,7 +284,7 @@ void TelemetrySimulator::generateTelemetryFrame()
case 10:
if (ui->rpm->value() > 0)
generateSportPacket(buffer, ui->rpm_inst->text().toInt(&ok, 0) - 1, DATA_FRAME, RPM_FIRST_ID, LIMIT<uint32_t>(0, ui->rpm->value(), 0xFFFF));
generateSportPacket(buffer, ui->rpm_inst->text().toInt(&ok, 0) - 1, DATA_FRAME, RPM_FIRST_ID, LIMIT<uint32_t>(0, ui->rpm->value(), 0x7FFFFFFF));
break;
case 11:
@@ -367,12 +384,17 @@ void TelemetrySimulator::generateTelemetryFrame()
generateSportPacket(buffer, ui->accz_inst->text().toInt(&ok, 0) - 1, DATA_FRAME, ACCZ_FIRST_ID, LIMIT<int32_t>(-0x7FFFFFFF, ui->accz->value() * 100.0, 0x7FFFFFFF));
break;
case 26:
if (ui->fuel_qty->value() > 0)
generateSportPacket(buffer, ui->fuel_qty_inst->text().toInt(&ok, 0) - 1, DATA_FRAME, FUEL_QTY_FIRST_ID, LIMIT<uint32_t>(0, ui->fuel_qty->value() * 100.0, 0xFFFFFF));
break;
default:
item = 0;
return;
}
if (ok && buffer[0])
if (ok && (buffer[2] || buffer[3]))
simulator->sendTelemetry(buffer, FRSKY_SPORT_PACKET_SIZE);
else
onTimerEvent();
@@ -580,6 +602,7 @@ TelemetrySimulator::LogPlaybackController::LogPlaybackController(Ui::TelemetrySi
colToFuncMap.insert("Tmp2(@F)", T2_DEGF);
colToFuncMap.insert("RPM(rpm)", RPM);
colToFuncMap.insert("Fuel(%)", FUEL);
colToFuncMap.insert("Fuel(ml)", FUEL_QTY);
colToFuncMap.insert("VSpd(m/s)", VSPD_MS);
colToFuncMap.insert("VSpd(f/s)", VSPD_FS);
colToFuncMap.insert("Alt(ft)", ALT_FEET);
@@ -628,14 +651,15 @@ QDateTime TelemetrySimulator::LogPlaybackController::parseTransmittterTimestamp(
void TelemetrySimulator::LogPlaybackController::calcLogFrequency()
{
// examine up to 20 rows to determine log frequency in seconds
// Skip the first entry which contains the file open time
logFrequency = 25.5; // default value
QDateTime lastTime;
for (int i = 1; (i < 20) && (i < csvRecords.count()); i++)
for (int i = 2; (i < 21) && (i < csvRecords.count()); i++)
{
QDateTime logTime = parseTransmittterTimestamp(csvRecords[i]);
// ugh - no timespan in this Qt version
double timeDiff = (logTime.toMSecsSinceEpoch() - lastTime.toMSecsSinceEpoch()) / 1000.0;
if ((timeDiff > 0) && (timeDiff < logFrequency)) {
if ((timeDiff > 0.1) && (timeDiff < logFrequency)) {
logFrequency = timeDiff;
}
lastTime = logTime;
@@ -874,6 +898,9 @@ void TelemetrySimulator::LogPlaybackController::setUiDataValues()
case FUEL:
ui->fuel->setValue(columnData[info.dataIndex].toDouble());
break;
case FUEL_QTY:
ui->fuel_qty->setValue(columnData[info.dataIndex].toDouble());
break;
case VSPD_MS:
ui->vspeed->setValue(columnData[info.dataIndex].toDouble());
break;
+1 -4
View File
@@ -80,6 +80,7 @@ class TelemetrySimulator : public QDialog
ACCX,
ACCY,
ACCZ,
FUEL_QTY,
};
QMap<QString, CONVERT_TYPE> colToFuncMap; // contains all 'known' column headings and how they are to be processed
Ui::TelemetrySimulator * ui;
@@ -100,7 +101,6 @@ class TelemetrySimulator : public QDialog
bool stepping;
QDateTime parseTransmittterTimestamp(QString row);
void calcLogFrequency();
int32_t replayRate;
};
private:
@@ -141,8 +141,6 @@ private:
uint32_t cellData1;
uint32_t cellData2;
uint32_t cellData3;
uint32_t cellDataTime;
double cell[MAXCELLS];
};
class GPSEmulator
@@ -164,7 +162,6 @@ private:
double course;
double speedKNTS;
double altitude; // in meters
uint32_t nextDataIndex;
uint32_t encodeLatLon(double latLon, bool isLat);
uint32_t encodeDateTime(uint8_t yearOrHour, uint8_t monthOrMinute, uint8_t dayOrSecond, bool isDate);
};
+75 -28
View File
@@ -1360,7 +1360,7 @@ Timestamp</string>
</font>
</property>
<property name="maximum">
<number>65535</number>
<number>2147483647</number>
</property>
</widget>
</item>
@@ -1520,23 +1520,20 @@ Timestamp</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_11">
<item row="11" column="0">
<widget class="QLabel" name="label_51">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>VSpd</string>
<string>Fuel Qty</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QLineEdit" name="vvspd_inst">
<widget class="QLineEdit" name="fuel_qty_inst">
<property name="font">
<font>
<pointsize>8</pointsize>
@@ -1545,35 +1542,26 @@ Timestamp</string>
</widget>
</item>
<item row="11" column="2">
<widget class="QDoubleSpinBox" name="vspeed">
<widget class="QSpinBox" name="fuel_qty">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-16777215.000000000000000</double>
</property>
<property name="maximum">
<double>16777215.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
<double>100000.000000000000000</double>
</property>
</widget>
</item>
<item row="11" column="3">
<widget class="QLabel" name="label_48">
<widget class="QLabel" name="label_52">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>m/s</string>
<string>ml</string>
</property>
</widget>
</item>
@@ -1632,7 +1620,7 @@ Timestamp</string>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_12">
<widget class="QLabel" name="label_11">
<property name="font">
<font>
<pointsize>8</pointsize>
@@ -1642,12 +1630,12 @@ Timestamp</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Alt</string>
<string>VSpd</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QLineEdit" name="valt_inst">
<widget class="QLineEdit" name="vvspd_inst">
<property name="font">
<font>
<pointsize>8</pointsize>
@@ -1656,7 +1644,7 @@ Timestamp</string>
</widget>
</item>
<item row="12" column="2">
<widget class="QDoubleSpinBox" name="valt">
<widget class="QDoubleSpinBox" name="vspeed">
<property name="font">
<font>
<pointsize>8</pointsize>
@@ -1677,14 +1665,14 @@ Timestamp</string>
</widget>
</item>
<item row="12" column="3">
<widget class="QLabel" name="label_49">
<widget class="QLabel" name="label_48">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>Meters</string>
<string>m/s</string>
</property>
</widget>
</item>
@@ -1742,7 +1730,64 @@ Timestamp</string>
</property>
</widget>
</item>
</layout>
<item row="13" column="0">
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Alt</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QLineEdit" name="valt_inst">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
</widget>
</item>
<item row="13" column="2">
<widget class="QDoubleSpinBox" name="valt">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>-16777215.000000000000000</double>
</property>
<property name="maximum">
<double>16777215.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="13" column="3">
<widget class="QLabel" name="label_49">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>Meters</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<tabstops>
@@ -1812,6 +1857,8 @@ Timestamp</string>
<tabstop>accy</tabstop>
<tabstop>accz_inst</tabstop>
<tabstop>accz</tabstop>
<tabstop>fuel_qty_inst</tabstop>
<tabstop>fuel_qty</tabstop>
</tabstops>
<resources/>
<connections/>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
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
+79
View File
@@ -1,3 +1,82 @@
<h2>Version 2.1.9 / 2016-09-14</h2>
[All]
<ul>
<li>Fixed: calculated sensors had persistent value set to zero at every shutdown when persistent option was not active (<a href=https://github.com/opentx/opentx/issues/3454>#3454</a>)</li>
<li>Show persistent option only for calculated sensors (<a href=https://github.com/opentx/opentx/issues/3454>#3454</a>)</li>
<li>Fixed: sensors with active filter had invalid negative values (<a href=https://github.com/opentx/opentx/issues/3463>#3463</a>)</li>
<li>Enabled DSM protocols on several raios (<a href=https://github.com/opentx/opentx/issues/3471>#3471</a>)</li>
<li>Better representation of negative mixer weight in offset bar widget (<a href=https://github.com/opentx/opentx/issues/3476>#3476</a>)</li>
<li>Fixed several bugs in curve preset function (<a href=https://github.com/opentx/opentx/issues/3451>#3451</a>)</li>
<li>Fixed flight modes rotary encoders initialization when creating new model (only for radios with rotary encoders) (<a href=https://github.com/opentx/opentx/issues/3473>#3473</a>)</li>
<li>Fixed: show value of persistent sensor after power on, before the telemetry is received (<a href=https://github.com/opentx/opentx/issues/3595>#3595</a>)</li>
<li>Fixed: LSs weren't selectable as input source (<a href=https://github.com/opentx/opentx/issues/3632>#3632>/a>)</li>
</ul>
[Taranis]
<ul>
<li>Fixed USB driver changed interrupt grouping which affected interrupt priorities (fix suggested by Michael Blandford), this should fix the SBUS Trainer issue <a href=https://github.com/opentx/opentx/issues/2999>#2999</a> (<a href=https://github.com/opentx/opentx/issues/3178>#3178</a>)</li>
<li>ADC Jitter Filter improvements, option added in Hardware settings to turn it on/off (<a href=https://github.com/opentx/opentx/issues/3432>#3432</a>)</li>
</ul>
[9XR-PRO]
<ul>
<li>Fixed: Trainer inputs >TR4 not working (<a href=https://github.com/opentx/opentx/issues/3203>#3203</a>)</li>
<li>External module output type setting was not visible</li>
</ul>
[Lua]
<ul>
<li>Fixed playTone() crash when called with abnormal parameter values (<a href=https://github.com/opentx/opentx/issues/3462>#3462</a>)</li>
<li>Return proper values for `Cels-` and `Cels+` (<a href=https://github.com/opentx/opentx/issues/2826>#2826</a>)</li>
<li>Fixed lcd.drawNumber() display when INVERS flag was used (<a href=https://github.com/opentx/opentx/issues/3569>#3569</a>)</li>
</ul>
<h2>Version 2.1.8 / 2016-04-14</h2>
Notice: EDGE Logical Switch operation has changed. Users should check their setups, if they use EDGE with AND switch.
This bug was introduced in version 2.1.2 and has been fixed in 2.1.8. (<a href=https://github.com/opentx/opentx/issues/2939>#2939</a>)
[Taranis]
<ul>
<li>Improvements of Statistics screen (<a href=https://github.com/opentx/opentx/issues/3206>#3206</a>)</li>
<li>Flight Modes screen layout fix (<a href=https://github.com/opentx/opentx/issues/3307>#3307</a>)</li>
<li>Fixed: left slider was affecting the value of the right slider on X9E (<a href=https://github.com/opentx/opentx/issues/2639>#2639</a>)</li>
<li>USB Joystick now supports 24 buttons (CH9-32) (<a href=https://github.com/opentx/opentx/issues/3268>#3268</a>)</li>
<li>Main view adjustments for 3-char switch names (<a href=https://github.com/opentx/opentx/issues/3278>#3278</a>)</li>
</ul>
[ARM (Taranis, Sky9x, 9XR-PRO, AR9X)]
<ul>
<li>Channel jitter reduced (<a href=https://github.com/opentx/opentx/issues/3233>#3233</a>)</li>
<li>Fixed: EDGE Logical switch internal state was being reset by the AND switch, that affected its function (it looked like AND was applied before the EDGE processing, not after like it is done for other logical switch types) (<a href=https://github.com/opentx/opentx/issues/2939>#2939</a>)</li>
</ul>
[Lua]
<ul>
<li>Some Lua fields were not available to scripts (<a href=https://github.com/opentx/opentx/issues/3223>#3223</a>)</li>
<li>Fixed: only first 32 input lines (out of 64) were accessible in Lua (<a href=https://github.com/opentx/opentx/issues/3285>#3285</a>)</li>
<li>playDuration() second parameter is now really optional (<a href=https://github.com/opentx/opentx/issues/3329>#3329</a>)</li>
<li>Fixed Lua io.open() problem for non-existing files (<a href=https://github.com/opentx/opentx/issues/3342>#3342</a>)</li>
</ul>
[Mega2560]
<ul>
<li>Fixed: First PPM pulse in the frame was longer (<a href=https://github.com/opentx/opentx/issues/2981>#2981</a>)</li>
</ul>
[All]
<ul>
<li>Various texts and translations corrections (se, it, pl, de)</li>
<li>Text to speech fixes (hu, sp)</li>
<li>Various small bug-fixes</li>
<li>PowerBox telemetry sensor names changed</li>
<li>Removed a few legacy timer limitations, fix non-working limit (<a href=https://github.com/opentx/opentx/issues/3301>#3301</a>)</li>
<li>Removed the "RF signal low" alert before "Telemetry lost" when powering off the receiver (<a href=https://github.com/opentx/opentx/issues/2616>#2616</a>)</li>
</ul>
<h2>Version 2.1.7 / 2016-01-04</h2>
Notice: Lua model wizard was fixed (<a href=https://github.com/opentx/opentx/issues/3061>#3061</a>)
+17 -9
View File
@@ -383,6 +383,10 @@ WARNINGS_AS_ERRORS = NO
# Values = NO, YES
LUA_COMPILER = NO
# Enable ADC jitter measurement
# Values = NO, YES
JITTER_MEASURE = NO
#------- END BUILD OPTIONS ---------------------------
# Define programs and commands.
@@ -395,7 +399,7 @@ TRANSLATE = -python ../util/translate.py
VERSION_MAJOR = 2
VERSION_MINOR = 1
VERSION_REVISION = 7
VERSION_REVISION = 9
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)$(OPENTX_VERSION_SUFFIX)
@@ -712,7 +716,7 @@ ifeq ($(PCB), MEGA2560)
TRGT = avr-
MCU = atmega2560
OPT = s
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBMEGA2560 -DCPUM2560 -DEEPROM_RLC -DEEPROM_VARIANT=0 -DAUDIO
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBMEGA2560 -DCPUM2560 -DEEPROM_RLC -DEEPROM_VARIANT=0
SDCARD = NO
BUZZER = YES
THR_TRACE = YES
@@ -721,7 +725,7 @@ ifeq ($(PCB), MEGA2560)
BOARDSRC = main_avr.cpp targets/mega2560/board_mega2560.cpp
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
PULSESSRC = pulses/pulses_avr.cpp
CPPSRC += audio_avr.cpp debug.cpp
CPPSRC += debug.cpp
BITMAPS += bitmaps/9X/splash.lbm bitmaps/9X/asterisk.lbm bitmaps/9X/about.lbm
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
@@ -958,7 +962,8 @@ ifeq ($(PCB), TARANIS)
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp eeprom_conversions.cpp
PULSESSRC = pulses/pulses_arm.cpp pulses/ppm_arm.cpp pulses/pxx_arm.cpp pulses/crossfire.cpp
CPPSRC += tasks_arm.cpp audio_arm.cpp sbus.cpp telemetry/telemetry.cpp
CPPSRC += targets/taranis/pulses_driver.cpp targets/taranis/keys_driver.cpp targets/taranis/adc_driver.cpp targets/taranis/trainer_driver.cpp targets/taranis/audio_driver.cpp targets/taranis/serial2_driver.cpp targets/taranis/telemetry_driver.cpp
CPPSRC += targets/taranis/pulses_driver.cpp targets/taranis/keys_driver.cpp targets/taranis/trainer_driver.cpp targets/taranis/audio_driver.cpp targets/taranis/serial2_driver.cpp targets/taranis/telemetry_driver.cpp
EXTRABOARDSRC += targets/taranis/adc_driver.cpp
CPPSRC += bmp.cpp gui/$(GUIDIRECTORY)/view_channels.cpp gui/$(GUIDIRECTORY)/view_about.cpp gui/$(GUIDIRECTORY)/view_text.cpp debug.cpp
CPPSRC += loadboot.cpp
ifeq ($(PCBREV), REV9E)
@@ -1067,6 +1072,9 @@ ifeq ($(PCB), TARANIS)
ifeq ($(WATCHDOG_TEST), YES)
CPPDEFS += -DWATCHDOG_TEST
endif
ifeq ($(JITTER_MEASURE), YES)
CPPDEFS += -DJITTER_MEASURE
endif
endif
CC = $(TRGT)gcc
@@ -1518,12 +1526,12 @@ bootloader.lbm: targets/taranis/bootloader/bootloader_ramBoot.bin
else ifeq ($(PCB), $(filter $(PCB), 9XRPRO AR9X))
bootloader.lbm:
@echo "Fetching Mike's bootloader..."
wget http://ersky9x.googlecode.com/svn/trunk/src/bootloader/bootflash8.lbm
wget https://github.com/MikeBland/OpenRcBootloader/releases/download/V1.9/bootflash8.lbm
mv bootflash8.lbm $@
else ifeq ($(PCB), SKY9X)
bootloader.lbm:
@echo "Fetching Mike's bootloader..."
wget http://ersky9x.googlecode.com/svn/trunk/src/bootloader/bootflash4.lbm
wget https://github.com/MikeBland/OpenRcBootloader/releases/download/V1.9/bootflash4.lbm
mv bootflash4.lbm $@
endif
@@ -1658,14 +1666,14 @@ endif
lua_exports_taranis.inc: myeeprom.h ../util/luaexport.py
@echo "Generating a list of Lua exported constants in lua_exports_taranis.txt"
@$(PARSER) -DEXPORT -DPCBTARANIS -DLUA -DVIRTUALINPUTS myeeprom.h | grep LEXP > lua_exports_taranis.txt
@$(PARSER) -DEXPORT -DCPUARM -DPCBTARANIS -DLUA -DVIRTUALINPUTS myeeprom.h | grep LEXP > lua_exports_taranis.txt
@echo "Parsing and generating C Lua exports in lua/lua_exports_taranis.inc"
@$(PYTHON) ../util/luaexport.py $(VERSION) lua_exports_taranis.txt lua/lua_exports_taranis.inc lua_fields_taranis.txt
@python ../util/luaexport.py $(VERSION) lua_exports_taranis.txt lua/lua_exports_taranis.inc lua_fields_taranis.txt
@rm lua_exports_taranis.txt
lua_exports_taranis_x9e.inc: myeeprom.h ../util/luaexport.py
@echo "Generating a list of Lua exported constants in lua_exports_taranis_x9e.txt"
@$(PARSER) -DEXPORT -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS myeeprom.h | grep LEXP > lua_exports_taranis_x9e.txt
@$(PARSER) -DEXPORT -DCPUARM -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS myeeprom.h | grep LEXP > lua_exports_taranis_x9e.txt
@echo "Parsing and generating C Lua exports in lua/lua_exports_taranis_x9e.inc"
@python ../util/luaexport.py $(VERSION) lua_exports_taranis_x9e.txt lua/lua_exports_taranis_x9e.inc lua_fields_taranis_x9e.txt
@rm lua_exports_taranis_x9e.txt
+16 -2
View File
@@ -672,12 +672,26 @@ int ToneContext::mixBuffer(AudioBuffer *buffer, int volume, unsigned int fade)
if (fragment.tone.freq != state.freq) {
state.freq = fragment.tone.freq;
state.step = double(DIM(sineValues)*fragment.tone.freq) / AUDIO_SAMPLE_RATE;
state.step = limit<double>(1, double(DIM(sineValues)*fragment.tone.freq) / AUDIO_SAMPLE_RATE, 512);
state.volume = evalVolumeRatio(fragment.tone.freq, volume);
}
if (fragment.tone.freqIncr) {
fragment.tone.freq += AUDIO_BUFFER_DURATION * fragment.tone.freqIncr;
int freqChange = AUDIO_BUFFER_DURATION * fragment.tone.freqIncr;
if (freqChange > 0) {
fragment.tone.freq += freqChange;
if (fragment.tone.freq > BEEP_MAX_FREQ) {
fragment.tone.freq = BEEP_MAX_FREQ;
}
}
else {
if (fragment.tone.freq > BEEP_MIN_FREQ - freqChange) {
fragment.tone.freq += freqChange;
}
else {
fragment.tone.freq = BEEP_MIN_FREQ;
}
}
}
if (remainingDuration > AUDIO_BUFFER_DURATION) {
+1
View File
@@ -53,6 +53,7 @@
#endif
#define BEEP_MIN_FREQ (150)
#define BEEP_MAX_FREQ (15000)
#define BEEP_DEFAULT_FREQ (2250)
#define BEEP_KEY_UP_FREQ (BEEP_DEFAULT_FREQ+150)
#define BEEP_KEY_DOWN_FREQ (BEEP_DEFAULT_FREQ-150)
+1
View File
@@ -226,6 +226,7 @@ int cliDisplay(const char ** argv)
}
if (!strcmp(argv[1], "adc")) {
extern uint16_t Analog_values[NUMBER_ANALOG];
for (int i=0; i<NUMBER_ANALOG; i++) {
serialPrint("adc[%d] = %04X", i, Analog_values[i]);
}
+30
View File
@@ -160,5 +160,35 @@ void dumpTraceBuffer();
#endif
#if defined(JITTER_MEASURE) && defined(__cplusplus)
template<class T> class JitterMeter {
public:
T min;
T max;
T measured;
JitterMeter() : min(~(T)0), max(0), measured(0) {};
void reset() {
// store mesaurement
measured = max - min;
//reset - begin new measurement
min = ~(T)0;
max = 0;
};
void measure(T value) {
if (value > max) max = value;
if (value < min) min = value;
};
T get() const {
return measured;
};
};
#endif // defined(JITTER_MEASURE)
#endif // #ifndef debug_h
+1
View File
@@ -375,6 +375,7 @@ void eeLoadModel(uint8_t id)
TelemetrySensor & sensor = g_model.telemetrySensors[i];
if (sensor.type == TELEM_TYPE_CALCULATED && sensor.persistent) {
telemetryItems[i].value = sensor.persistentValue;
telemetryItems[i].lastReceived = TELEMETRY_VALUE_OLD; // #3595: make value visible even before the first new value is received)
}
}
#endif
+1
View File
@@ -994,6 +994,7 @@ void eeLoadModel(uint8_t id)
TelemetrySensor & sensor = g_model.telemetrySensors[i];
if (sensor.type == TELEM_TYPE_CALCULATED && sensor.persistent) {
telemetryItems[i].value = sensor.persistentValue;
telemetryItems[i].lastReceived = TELEMETRY_VALUE_OLD; // #3595: make value visible even before the first new value is received)
}
}
#endif
-1
View File
@@ -168,7 +168,6 @@ class RlcFile: public EFile
uint8_t m_bRlc; // control byte for run length decoder
uint8_t m_zeroes;
uint8_t m_flags;
#define WRITE_FIRST_LINK 0x01
#define WRITE_NEXT_LINK_1 0x02
#define WRITE_NEXT_LINK_2 0x03
+7 -3
View File
@@ -457,9 +457,9 @@ void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t
}
else if (smlsize) {
x -= 2;
lcd_plot(x+1, y+5);
lcd_plot(x, y+5);
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcd_vline(x+1, y, 7);
lcd_vline(x, y-1, 8);
}
}
else if (tinsize) {
@@ -625,7 +625,7 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
#if defined(CPUARM)
char separator = ':';
if (tme >= 3600 && (~att & DBLSIZE)) {
if (tme >= 3600) {
qr = div(qr.quot, 60);
separator = CHR_HOUR;
}
@@ -633,6 +633,10 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
#define separator ':'
#endif
lcd_outdezNAtt(x, y, qr.quot, att|LEADING0|LEFT, 2);
#if defined(CPUARM)
if (separator == CHR_HOUR)
att &= ~DBLSIZE;
#endif
#if defined(CPUARM) && defined(RTCLOCK)
if (att&TIMEBLINK)
lcd_putcAtt(lcdLastPos, y, separator, BLINK);
+18 -10
View File
@@ -39,6 +39,14 @@
#define XPOT_DELTA 10
#define XPOT_DELAY 10 /* cycles */
enum CalibrationState {
CALIB_START = 0,
CALIB_SET_MIDPOINT,
CALIB_MOVE_STICKS,
CALIB_STORE,
CALIB_FINISHED
};
void menuCommonCalib(uint8_t event)
{
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) { // get low and high vals for sticks and trims
@@ -57,7 +65,7 @@ void menuCommonCalib(uint8_t event)
switch (event)
{
case EVT_ENTRY:
reusableBuffer.calib.state = 0;
reusableBuffer.calib.state = CALIB_START;
break;
case EVT_KEY_BREAK(KEY_ENTER):
@@ -66,14 +74,14 @@ void menuCommonCalib(uint8_t event)
}
switch (reusableBuffer.calib.state) {
case 0:
case CALIB_START:
// START CALIBRATION
if (!READ_ONLY()) {
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUTOSTART);
}
break;
case 1:
case CALIB_SET_MIDPOINT:
// SET MIDPOINT
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
@@ -85,7 +93,7 @@ void menuCommonCalib(uint8_t event)
}
break;
case 2:
case CALIB_MOVE_STICKS:
// MOVE STICKS/POTS
STICK_SCROLL_DISABLE();
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
@@ -102,14 +110,14 @@ void menuCommonCalib(uint8_t event)
}
break;
case 3:
case CALIB_STORE:
g_eeGeneral.chkSum = evalChkSum();
eeDirty(EE_GENERAL);
reusableBuffer.calib.state = 4;
reusableBuffer.calib.state = CALIB_FINISHED;
break;
default:
reusableBuffer.calib.state = 0;
reusableBuffer.calib.state = CALIB_START;
break;
}
@@ -121,7 +129,7 @@ void menuGeneralCalib(uint8_t event)
check_simple(event, e_Calib, menuTabGeneral, DIM(menuTabGeneral), 0);
if (menuEvent) {
calibrationState = 0;
calibrationState = CALIB_START;
}
TITLE(STR_MENUCALIBRATION);
@@ -130,8 +138,8 @@ void menuGeneralCalib(uint8_t event)
void menuFirstCalib(uint8_t event)
{
if (event == EVT_KEY_BREAK(KEY_EXIT) || reusableBuffer.calib.state == 4) {
calibrationState = 0;
if (event == EVT_KEY_BREAK(KEY_EXIT) || reusableBuffer.calib.state == CALIB_FINISHED) {
calibrationState = CALIB_START;
chainMenu(menuMainView);
}
else {
@@ -211,7 +211,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
#endif
#if defined(CPUARM)
else if (func == FUNC_SET_TIMER) {
val_max = 59*60+59;
val_max = 539*60+59;
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr);
}
#endif
+5 -1
View File
@@ -419,7 +419,7 @@ void gvarWeightItem(coord_t x, coord_t y, MixData *md, uint8_t attr, uint8_t eve
void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
{
int offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, mixerCurrentFlightMode);
int weight = abs(GET_GVAR(MD_WEIGHT(md), GV_RANGELARGE_NEG, GV_RANGELARGE, mixerCurrentFlightMode));
int weight = GET_GVAR(MD_WEIGHT(md), GV_RANGELARGE_NEG, GV_RANGELARGE, mixerCurrentFlightMode);
int barMin = offset - weight;
int barMax = offset + weight;
if (y > 15) {
@@ -431,6 +431,10 @@ void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
lcd_outdezAtt(x+GAUGE_WIDTH+1, y-8, barMax);
#endif
}
if (weight < 0) {
barMin = -barMin;
barMax = -barMax;
}
if (barMin < -101)
barMin = -101;
if (barMax > 101)
+7 -3
View File
@@ -116,7 +116,7 @@ void menuModelSetup(uint8_t event)
#define IS_D8_RX(x) (g_model.moduleData[x].rfProtocol == RF_PROTO_D8)
#define EXTERNAL_MODULE_CHANNELS_ROWS() IF_EXTERNAL_MODULE_ON(IS_MODULE_DSM2(EXTERNAL_MODULE) ? (uint8_t)0 : (uint8_t)1)
#define EXTERNAL_MODULE_SETTINGS_ROWS() (IS_MODULE_XJT(EXTERNAL_MODULE) && IS_D8_RX(EXTERNAL_MODULE)) ? (uint8_t)1 : (IS_MODULE_PPM(EXTERNAL_MODULE) || IS_MODULE_XJT(EXTERNAL_MODULE) || IS_MODULE_DSM2(EXTERNAL_MODULE)) ? (uint8_t)2 : HIDDEN_ROW
#if defined(PCBSKY9X) && !defined(REVX)
#if defined(PCBSKY9X) && defined(REVX)
#define OUTPUT_TYPE_ROWS() (IS_MODULE_PPM(EXTERNAL_MODULE) ? (uint8_t)0 : HIDDEN_ROW) ,
#else
#define OUTPUT_TYPE_ROWS()
@@ -220,13 +220,14 @@ void menuModelSetup(uint8_t event)
break;
}
case 1:
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59);
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 539); // 8:59
timer->start = qr.rem + qr.quot*60;
break;
case 2:
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
timer->start -= qr.rem ;
if ((int16_t)timer->start < 0) timer->start=0;
if ((int16_t)timer->start > 5999) timer->start=32399; // 8:59:59
break;
}
}
@@ -299,7 +300,10 @@ void menuModelSetup(uint8_t event)
break;
case 2:
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
timer->start -= qr.rem ;
if (timer->start >= qr.rem) {
timer->start -= qr.rem ;
}
if ((int32_t)timer->start > 3599) timer->start=3599; // 59:59
break;
}
}
+1 -1
View File
@@ -278,7 +278,7 @@ bool isSensorAvailable(int sensor)
#define SENSOR_PARAM4_ROWS (sensor->type == TELEM_TYPE_CALCULATED && sensor->formula < TELEM_FORMULA_MULTIPLY) ? (uint8_t)0 : HIDDEN_ROW
#define SENSOR_AUTOOFFSET_ROWS (sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
#define SENSOR_FILTER_ROWS (sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
#define SENSOR_PERSISTENT_ROWS (sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
#define SENSOR_PERSISTENT_ROWS (sensor->type == TELEM_TYPE_CALCULATED ? (uint8_t)0 : HIDDEN_ROW)
void menuModelSensor(uint8_t event)
{
+5
View File
@@ -170,6 +170,11 @@ bool isInputSourceAvailable(int source)
if (source>=MIXSRC_FIRST_CH && source<=MIXSRC_LAST_CH)
return true;
if (source>=MIXSRC_FIRST_LOGICAL_SWITCH && source<=MIXSRC_LAST_LOGICAL_SWITCH) {
LogicalSwitchData * cs = lswAddress(source-MIXSRC_SW1);
return (cs->func != LS_FUNC_NONE);
}
if (source>=MIXSRC_FIRST_TRAINER && source<=MIXSRC_LAST_TRAINER)
return true;
+7 -4
View File
@@ -421,17 +421,17 @@ void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t
}
else if (smlsize) {
x -= 2;
lcd_plot(x+1, y+5);
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcd_vline(x+1, y, 7);
lcd_vlineStip(x, y-1, 8, SOLID, INVERS);
}
lcd_plot(x, y+5);
}
else if (tinsize) {
x--;
lcd_plot(x-1, y+4);
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcd_vline(x-1, y-1, 7);
lcd_vlineStip(x-1, y-1, 7, SOLID, INVERS);
}
lcd_plot(x-1, y+4);
x--;
}
else {
@@ -593,6 +593,8 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
qr.quot = qr2.rem;
if (att & MIDSIZE)
x += 17;
else if (att & BOLD)
x += 15;
else
x += 13;
}
@@ -1036,6 +1038,7 @@ void lcd_plot(coord_t x, coord_t y, LcdFlags att)
void lcd_hlineStip(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att)
{
if (w < 0) { x += w; w = -w; }
if (y < 0 || y >= LCD_H) return;
if (x+w > LCD_W) {
if (x >= LCD_W ) return;
+21 -11
View File
@@ -41,6 +41,14 @@
#define BAR_SPACING 12
#define BAR_HEIGHT 22
enum CalibrationState {
CALIB_START = 0,
CALIB_SET_MIDPOINT,
CALIB_MOVE_STICKS,
CALIB_STORE,
CALIB_FINISHED
};
void drawPotsBars()
{
// Optimization by Mike Blandford
@@ -67,6 +75,8 @@ void menuCommonCalib(uint8_t event)
uint8_t idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
if (IS_POT_MULTIPOS(i) && count <= XPOTS_MULTIPOS_COUNT) {
// use raw analog value for multipos calibraton, anaIn() already has multipos decoded value
vt = getAnalogValue(i) >> 1;
if (reusableBuffer.calib.xpotsCalib[idx].lastCount == 0 || vt < reusableBuffer.calib.xpotsCalib[idx].lastPosition - XPOT_DELTA || vt > reusableBuffer.calib.xpotsCalib[idx].lastPosition + XPOT_DELTA) {
reusableBuffer.calib.xpotsCalib[idx].lastPosition = vt;
reusableBuffer.calib.xpotsCalib[idx].lastCount = 1;
@@ -101,7 +111,7 @@ void menuCommonCalib(uint8_t event)
{
case EVT_ENTRY:
case EVT_KEY_BREAK(KEY_EXIT):
reusableBuffer.calib.state = 0;
reusableBuffer.calib.state = CALIB_START;
break;
case EVT_KEY_BREAK(KEY_ENTER):
@@ -110,14 +120,14 @@ void menuCommonCalib(uint8_t event)
}
switch (reusableBuffer.calib.state) {
case 0:
case CALIB_START:
// START CALIBRATION
if (!READ_ONLY()) {
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUTOSTART);
}
break;
case 1:
case CALIB_SET_MIDPOINT:
// SET MIDPOINT
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
@@ -133,7 +143,7 @@ void menuCommonCalib(uint8_t event)
}
break;
case 2:
case CALIB_MOVE_STICKS:
// MOVE STICKS/POTS
STICK_SCROLL_DISABLE();
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
@@ -150,7 +160,7 @@ void menuCommonCalib(uint8_t event)
}
break;
case 3:
case CALIB_STORE:
for (uint8_t i=POT1; i<=POT_LAST; i++) {
int idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
@@ -176,11 +186,11 @@ void menuCommonCalib(uint8_t event)
}
g_eeGeneral.chkSum = evalChkSum();
eeDirty(EE_GENERAL);
reusableBuffer.calib.state = 4;
reusableBuffer.calib.state = CALIB_FINISHED;
break;
default:
reusableBuffer.calib.state = 0;
reusableBuffer.calib.state = CALIB_START;
break;
}
@@ -190,7 +200,7 @@ void menuCommonCalib(uint8_t event)
#if 0
for (int i=POT1; i<=POT_LAST; i++) {
uint8_t steps = 0;
if (reusableBuffer.calib.state == 2) {
if (reusableBuffer.calib.state == CALIB_MOVE_STICKS) {
steps = reusableBuffer.calib.xpotsCalib[i-POT1].stepsCount;
}
else if (IS_POT_MULTIPOS(i)) {
@@ -209,14 +219,14 @@ void menuGeneralCalib(uint8_t event)
check_simple(STR_MENUCALIBRATION, event, e_Calib, menuTabGeneral, DIM(menuTabGeneral), 0);
menuCommonCalib(READ_ONLY() ? 0 : event);
if (menuEvent) {
calibrationState = 0;
calibrationState = CALIB_START;
}
}
void menuFirstCalib(uint8_t event)
{
if (event == EVT_KEY_BREAK(KEY_EXIT) || reusableBuffer.calib.state == 4) {
calibrationState = 0;
if (event == EVT_KEY_BREAK(KEY_EXIT) || reusableBuffer.calib.state == CALIB_FINISHED) {
calibrationState = CALIB_START;
chainMenu(menuMainView);
}
else {
+10 -12
View File
@@ -43,28 +43,26 @@ void menuGeneralDiagAna(uint8_t event)
STICK_SCROLL_DISABLE();
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
#if (NUM_STICKS+NUM_POTS) > 9
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/3)*FH;
const uint8_t x_coord[] = {0, 70, 154};
uint8_t x = x_coord[i%3];
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
uint8_t x = i&1 ? LCD_W/2 + FW : 0;
lcd_outdezNAtt(x, y, i+1, LEADING0|LEFT, 2);
lcd_putc(x+2*FW-2, y, ':');
#else
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
uint8_t x = i&1 ? 64+5 : 0;
putsStrIdx(x, y, PSTR("A"), i+1);
lcd_putc(lcdNextPos, y, ':');
#endif
lcd_outhex4(x+3*FW-1, y, anaIn(i));
#if defined(JITTER_MEASURE)
lcd_outdezAtt(x+10*FW-1, y, rawJitter[i].get());
lcd_outdezAtt(x+13*FW-1, y, avgJitter[i].get());
lcd_outdez8(x+17*FW-1, y, (int16_t)calibratedStick[CONVERT_MODE(i)]*25/256);
#else
lcd_outdez8(x+10*FW-1, y, (int16_t)calibratedStick[CONVERT_MODE(i)]*25/256);
#endif
}
lcd_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_BATT_CALIB);
lcd_putsLeft(MENU_HEADER_HEIGHT+1+6*FH, STR_BATT_CALIB);
static int32_t adcBatt;
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.txVoltageCalibration)/128) * BATT_SCALE;
batCalV >>= 11;
batCalV += 2; // because of the diode
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+5*FH, batCalV, s_editMode > 0 ? BLINK|INVERS : INVERS);
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+6*FH, batCalV, s_editMode > 0 ? BLINK|INVERS : INVERS);
if (s_editMode > 0) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
}
@@ -72,6 +72,7 @@ enum menuGeneralHwItems {
CASE_REV9E(ITEM_SETUP_HW_SR)
CASE_REV9E(ITEM_SETUP_HW_BLUETOOTH)
ITEM_SETUP_HW_UART3_MODE,
ITEM_SETUP_HW_JITTER_FILTER,
ITEM_SETUP_HW_MAX
};
@@ -227,6 +228,12 @@ void menuGeneralHardware(uint8_t event)
serial2Init(g_eeGeneral.serial2Mode, MODEL_TELEMETRY_PROTOCOL());
}
break;
case ITEM_SETUP_HW_JITTER_FILTER:
{
uint8_t b = 1-g_eeGeneral.jitterFilter;
g_eeGeneral.jitterFilter = 1 - onoffMenuItem(b, RADIO_SETUP_2ND_COLUMN, y, STR_JITTER_FILTER, attr, event);
break;
}
}
}
}
+28 -13
View File
@@ -95,6 +95,18 @@ bool moveCurve(uint8_t index, int8_t shift)
return true;
}
int8_t getCurveX(int noPoints, int point)
{
return -100 + div10_and_round( (point*2000) / (noPoints-1) );
}
void resetCustomCurveX(int8_t * points, int noPoints)
{
for (int i=0; i<noPoints-2; i++) {
points[noPoints+i] = getCurveX(noPoints, i+1);
}
}
void displayPresetChoice(uint8_t event)
{
displayWarning(event);
@@ -105,11 +117,14 @@ void displayPresetChoice(uint8_t event)
warningResult = 0;
CurveInfo & crv = g_model.curves[s_curveChan];
int8_t * points = curveAddress(s_curveChan);
for (uint8_t i=0; i<5+crv.points; i++)
points[i] = (i-((5+crv.points)/2)) * warningInputValue * 50 / (4+crv.points);
int k = 25 * warningInputValue;
int dx = 2000 / (5+crv.points-1);
for (uint8_t i=0; i<5+crv.points; i++) {
int x = -1000 + i * dx;
points[i] = div10_and_round(div100_and_round(k * x));
}
if (crv.type == CURVE_TYPE_CUSTOM) {
for (int i=0; i<3+crv.points; i++)
points[crv.points+i] = -100 + ((i+1)*200) / (4+crv.points);
resetCustomCurveX(points, 5+crv.points);
}
}
}
@@ -131,12 +146,12 @@ void onCurveOneMenu(const char *result)
for (int i=0; i<5+crv.points; i++)
points[i] = 0;
if (crv.type == CURVE_TYPE_CUSTOM) {
for (int i=0; i<3+crv.points; i++)
points[crv.points+i] = -100 + ((i+1)*200) / (4+crv.points);
resetCustomCurveX(points, 5+crv.points);
}
}
}
void menuModelCurveOne(uint8_t event)
{
static uint8_t pointsOfs = 0;
@@ -158,12 +173,12 @@ void menuModelCurveOne(uint8_t event)
if (attr) {
uint8_t newType = checkIncDecModelZero(event, crv.type, CURVE_TYPE_LAST);
if (newType != crv.type) {
for (int i=1; i<4+crv.points; i++)
points[i] = calcRESXto100(applyCustomCurve(calc100toRESX(-100 + i*200/(4+crv.points)), s_curveChan));
for (int i=1; i<4+crv.points; i++) {
points[i] = calcRESXto100(applyCustomCurve(calc100toRESX(getCurveX(5+crv.points, i)), s_curveChan));
}
moveCurve(s_curveChan, checkIncDec_Ret > 0 ? 3+crv.points : -3-crv.points);
if (newType == CURVE_TYPE_CUSTOM) {
for (int i=0; i<3+crv.points; i++)
points[5+crv.points+i] = -100 + ((i+1)*200) / (4+crv.points);
resetCustomCurveX(points, 5+crv.points);
}
crv.type = newType;
}
@@ -180,12 +195,12 @@ void menuModelCurveOne(uint8_t event)
newPoints[0] = points[0];
newPoints[4+count] = points[4+crv.points];
for (int i=1; i<4+count; i++)
newPoints[i] = calcRESXto100(applyCustomCurve(calc100toRESX(-100 + (i*200) / (4+count)), s_curveChan));
newPoints[i] = calcRESXto100(applyCustomCurve(calc100toRESX(getCurveX(5+count, i)), s_curveChan));
moveCurve(s_curveChan, checkIncDec_Ret*(crv.type==CURVE_TYPE_CUSTOM?2:1));
for (int i=0; i<5+count; i++) {
points[i] = newPoints[i];
if (crv.type == CURVE_TYPE_CUSTOM && i!=0 && i!=4+count)
points[5+count+i-1] = -100 + (i*200) / (4+count);
points[5+count+i-1] = getCurveX(5+count, i);
}
crv.points = count;
}
@@ -232,7 +247,7 @@ void menuModelCurveOne(uint8_t event)
}
if (i>=pointsOfs && i<pointsOfs+7) {
int8_t x = -100 + 200*i/(5+crv.points-1);
int8_t x = getCurveX(5+crv.points, i);
if (crv.type==CURVE_TYPE_CUSTOM && i>0 && i<5+crv.points-1) x = points[5+crv.points+i-1];
lcd_outdezAtt(6+8*FW, posY, i+1, LEFT);
lcd_outdezAtt(3+12*FW, posY, x, LEFT|(selectionMode==1?attr:0));
@@ -272,8 +272,8 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
}
else if (func == FUNC_SET_TIMER) {
val_max = 59*60+59;
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr);
val_max = 539*60+59; //8:59:59
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT|TIMEHOUR, attr);
}
else if (func == FUNC_PLAY_SOUND) {
val_max = AU_FRSKY_LAST-AU_FRSKY_FIRST-1;
@@ -121,7 +121,7 @@ void menuModelFlightModesAll(uint8_t event)
case ITEM_FLIGHT_MODES_SWITCH:
if (k>0) {
putsSwitches((5+LEN_FLIGHT_MODE_NAME)*FW+FW/2, y, p->swtch, attr);
putsSwitches((4+LEN_FLIGHT_MODE_NAME)*FW+FW/2, y, p->swtch, attr);
if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
}
break;
@@ -449,13 +449,17 @@ void gvarWeightItem(coord_t x, coord_t y, MixData *md, uint8_t attr, uint8_t eve
void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
{
int offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, mixerCurrentFlightMode);
int weight = abs(GET_GVAR(MD_WEIGHT(md), GV_RANGELARGE_NEG, GV_RANGELARGE, mixerCurrentFlightMode));
int weight = GET_GVAR(MD_WEIGHT(md), GV_RANGELARGE_NEG, GV_RANGELARGE, mixerCurrentFlightMode);
int barMin = offset - weight;
int barMax = offset + weight;
if (y > 15) {
lcd_outdezAtt(x-((barMin >= 0) ? 2 : 3), y-6, barMin, TINSIZE|LEFT);
lcd_outdezAtt(x+GAUGE_WIDTH+1, y-6, barMax, TINSIZE);
}
if (weight < 0) {
barMin = -barMin;
barMax = -barMax;
}
if (barMin < -101)
barMin = -101;
if (barMax > 101)
+5 -4
View File
@@ -137,8 +137,8 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
TimerData * timer = &g_model.timers[timerIdx];
putsStrIdx(0*FW, y, STR_TIMER, timerIdx+1);
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0);
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, menuHorizontalPosition==1 ? attr : 0, menuHorizontalPosition==2 ? attr : 0);
if (attr && menuHorizontalPosition < 0) drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, menuHorizontalPosition==1 ? attr|TIMEHOUR : TIMEHOUR, menuHorizontalPosition==2 ? attr|TIMEHOUR : TIMEHOUR);
if (attr && menuHorizontalPosition < 0) drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 11*FW, FH+1);
if (attr && s_editMode>0) {
div_t qr = div(timer->start, 60);
switch (menuHorizontalPosition) {
@@ -162,13 +162,14 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
break;
}
case 1:
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59);
qr.quot = checkIncDec(event, qr.quot, 0, 1439, EE_MODEL | NO_INCDEC_MARKS); // 23h59
timer->start = qr.rem + qr.quot*60;
break;
case 2:
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
timer->start -= qr.rem ;
if ((int16_t)timer->start < 0) timer->start=0;
if ((int32_t)timer->start > 86399) timer->start=86399; // 23h59:59
break;
}
}
@@ -685,7 +686,7 @@ void menuModelSetup(uint8_t event)
if (checkIncDec_Ret) {
g_model.moduleData[EXTERNAL_MODULE].rfProtocol = 0;
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
g_model.moduleData[EXTERNAL_MODULE].channelsCount = 0;
g_model.moduleData[EXTERNAL_MODULE].channelsCount = min<int8_t>(0, MAX_EXTERNAL_MODULE_CHANNELS());
}
break;
case 1:

Some files were not shown because too many files have changed in this diff Show More