Compare commits

...

133 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 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
97 changed files with 912 additions and 1361 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
+64
View File
@@ -947,3 +947,67 @@ 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
+1 -1
View File
@@ -1,7 +1,7 @@
##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.
+21
View File
@@ -1,3 +1,24 @@
<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>
+1 -1
View File
@@ -2,7 +2,7 @@ PROJECT( companion )
SET(C9X_VERSION_MAJOR "2")
SET(C9X_VERSION_MINOR "1")
SET(C9X_VERSION_REVISION "8")
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})
+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;
}
}
}
+9 -3
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();
@@ -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, uint8_t defaultValue = 0) { 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, uint8_t defaultValue = 0) { 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
+11 -10
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 {
@@ -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++);
}
}
};
@@ -1153,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"));
}
@@ -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;
@@ -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"
+23 -37
View File
@@ -111,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;
@@ -153,27 +149,30 @@ void GeneralEdit::on_calretrieve_PB_clicked()
Byte=hwtypes.mid(i,1);
byte16=(int16_t)Byte.toInt(&ok,16);
qba=controlNames.mid(3*(i+NUM_STICKS),3).toAscii();
if (ok)
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)
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)
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"));
@@ -185,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();
+1
View File
@@ -277,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
-2
View File
@@ -46,8 +46,6 @@
#include <math.h>
static const double Pi = 3.14159265358979323846264338327950288419717;
Edge::Edge(Node *sourceNode, Node *destNode)
: arrowSize(10)
{
+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 -2
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;
}
@@ -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);
+21 -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;
+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();
+28 -17
View File
@@ -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").arg(destinationPath) + "\n");
// 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;
-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()
},
+39 -28
View File
@@ -147,31 +147,32 @@ void TelemetrySimulator::closeEvent(QCloseEvent *event)
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(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);
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_ratio->setValue(simulator->getSensorRatio(BATT_ID) / 10.0);
ui->A1_ratio->setValue(simulator->getSensorRatio(ADC1_ID) / 10.0);
@@ -283,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:
@@ -383,6 +384,11 @@ 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;
@@ -596,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);
@@ -644,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;
@@ -890,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/>
+1 -1
View File
@@ -430,7 +430,7 @@ May be different from firmware language</source>
<message>
<location filename="../apppreferencesdialog.ui" line="751"/>
<source>Google Earth Executable</source>
<translation>Google Earth *.EXE Datei</translation>
<translation>Ausführbare Datei Google Earth</translation>
</message>
<message>
<location filename="../apppreferencesdialog.ui" line="831"/>
+2 -2
View File
@@ -8070,8 +8070,8 @@ Mixage actif par défaut si non-renseigné.</translation>
</message>
<message>
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1156"/>
<source>Removes D8 and LR12 FrSky protocols that are not legal for use in the EU on radios sold after Jan 1st, 2015</source>
<translation>Supprime les protocoles RF D8 et LR12 qui ne sont plus utilisable légalementen Europe sur les radios vendues après le 1er janvier 2015</translation>
<source>Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015</source>
<translation>Supprime le protocole RF D8 qui n&apos;est plus utilisable légalement en Europe sur les radios vendues après le 1er janvier 2015</translation>
</message>
<message>
<location filename="../firmwares/opentx/opentxinterface.cpp" line="1157"/>
+35
View File
@@ -1,3 +1,38 @@
<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.
+3 -9
View File
@@ -387,10 +387,6 @@ LUA_COMPILER = NO
# Values = NO, YES
JITTER_MEASURE = NO
# Enable ADC jitter filtering
# Values = NO, YES
JITTER_FILTER = YES
#------- END BUILD OPTIONS ---------------------------
# Define programs and commands.
@@ -403,7 +399,7 @@ TRANSLATE = -python ../util/translate.py
VERSION_MAJOR = 2
VERSION_MINOR = 1
VERSION_REVISION = 8
VERSION_REVISION = 9
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)$(OPENTX_VERSION_SUFFIX)
@@ -966,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)
@@ -1078,9 +1075,6 @@ ifeq ($(PCB), TARANIS)
ifeq ($(JITTER_MEASURE), YES)
CPPDEFS += -DJITTER_MEASURE
endif
ifeq ($(JITTER_FILTER), YES)
CPPDEFS += -DJITTER_FILTER
endif
endif
CC = $(TRGT)gcc
+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]);
}
+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
+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 {
+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)
+1 -1
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()
+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;
+4 -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, y+5);
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcd_vline(x, y-1, 8);
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 {
+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 {
@@ -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));
@@ -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)
+1 -1
View File
@@ -686,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:
@@ -213,7 +213,7 @@ bool isSensorAvailable(int sensor)
#define SENSOR_AUTOOFFSET_ROWS (sensor->unit != UNIT_RPMS && sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
#define SENSOR_ONLYPOS_ROWS (sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
#define SENSOR_FILTER_ROWS (sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
#define SENSOR_PERSISTENT_ROWS ((sensor->type == TELEM_TYPE_CALCULATED && sensor->formula == TELEM_FORMULA_CONSUMPTION) || 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)
{
@@ -435,6 +435,9 @@ void menuModelSensor(uint8_t event)
case SENSOR_FIELD_PERSISTENT:
ON_OFF_MENU_ITEM(sensor->persistent, SENSOR_2ND_COLUMN, y, NO_INDENT(STR_PERSISTENT), attr, event);
if (checkIncDec_Ret && !sensor->persistent) {
sensor->persistentValue = 0;
}
break;
case SENSOR_FIELD_LOGS:
+20 -15
View File
@@ -207,20 +207,23 @@ void luaGetValueAndPush(int src)
getvalue_t value = getValue(src); // ignored for GPS, DATETIME, and CELLS
if (src >= MIXSRC_FIRST_TELEM && src <= MIXSRC_LAST_TELEM) {
src = (src-MIXSRC_FIRST_TELEM) / 3;
div_t qr = div(src-MIXSRC_FIRST_TELEM, 3);
// telemetry values
if (TELEMETRY_STREAMING() && telemetryItems[src].isAvailable()) {
TelemetrySensor & telemetrySensor = g_model.telemetrySensors[src];
if (TELEMETRY_STREAMING() && telemetryItems[qr.quot].isAvailable()) {
TelemetrySensor & telemetrySensor = g_model.telemetrySensors[qr.quot];
switch (telemetrySensor.unit) {
case UNIT_GPS:
luaPushLatLon(telemetrySensor, telemetryItems[src]);
luaPushLatLon(telemetrySensor, telemetryItems[qr.quot]);
break;
case UNIT_DATETIME:
luaPushTelemetryDateTime(telemetrySensor, telemetryItems[src]);
luaPushTelemetryDateTime(telemetrySensor, telemetryItems[qr.quot]);
break;
case UNIT_CELLS:
luaPushCells(telemetrySensor, telemetryItems[src]);
break;
if (qr.rem == 0) {
luaPushCells(telemetrySensor, telemetryItems[qr.quot]);
break;
}
// deliberate no break here to properly return `Cels-` and `Cels+`
default:
if (telemetrySensor.prec > 0)
lua_pushnumber(L, float(value)/telemetrySensor.getPrecDivisor());
@@ -403,9 +406,12 @@ case the returned value is 0):
* key (number) cell number (1 to number of cells)
* value (number) current cell voltage
@status current Introduced in 2.0.0, changed in 2.1.0
@status current Introduced in 2.0.0, changed in 2.1.0, `Cels+` and
`Cels-` added in 2.1.9
@notice Getting a value by its numerical identifier is faster then by its name.
While `Cels` sensor returns current values of all cells in a table, a `Cels+` or
`Cels-` will return a single value - the maximum or minimum Cels value.
*/
static int luaGetValue(lua_State *L)
{
@@ -593,21 +599,20 @@ static int luaPlayDuration(lua_State *L)
Play a tone
@param frequency (number) tone frequency in Hz
@param frequency (number) tone frequency in Hz (from 150 to 15000)
@param duration (number) length of the tone in (TODO units)
@param duration (number) length of the tone in milliseconds
@param pause (number) length of the pause in (TODO units)
@param pause (number) length of the silence after the tone in milliseconds
@param flags (number):
* `0 or not present` play with normal priority.
* `PLAY_BACKGROUND` play in background (built in vario function used this context)
* `PLAY_BACKGROUND` play in background (built in vario function uses this context)
* `PLAY_NOW` play immediately
@param freqIncr (number) positive number increases the tone pitch (frequency with time),
negative number decreases it. Bigger number has more effect
@notice Minimum played frequency is 150Hz even if a lower value is specified.
negative number decreases it. The frequency changes every 10 milliseconds, the change is `freqIncr * 10Hz`.
The valid range is from -127 to 127.
@status current Introduced in 2.1.0
*/
+3 -1
View File
@@ -335,7 +335,9 @@ enum BeeperMode {
uint32_t globalTimer; \
int8_t temperatureCalib; \
uint8_t btBaudrate; \
uint8_t optrexDisplay; \
uint8_t optrexDisplay:1; \
uint8_t jitterFilter:1; /* 0 - active */\
uint8_t spareArm:6; \
uint8_t sticksGain; \
uint8_t rotarySteps; \
uint8_t countryCode; \
+99 -47
View File
@@ -351,7 +351,6 @@ void defaultInputs()
for (int c=0; c<4; c++) {
g_model.inputNames[i][c] = char2idx(STR_INPUTNAMES[1+4*(stick_index-1)+c]);
}
g_model.inputNames[i][4] = '\0';
#else
for (int c=0; c<3; c++) {
g_model.inputNames[i][c] = char2idx(STR_VSRCRAW[2+4*stick_index+c]);
@@ -450,6 +449,14 @@ void modelDefault(uint8_t id)
}
#endif
#if defined(FLIGHT_MODES) && defined(ROTARY_ENCODERS)
for (int p=1; p<MAX_FLIGHT_MODES; p++) {
for (int i=0; i<ROTARY_ENCODERS; i++) {
g_model.flightModeData[p].rotaryEncoders[i] = ROTARY_ENCODER_MAX+1;
}
}
#endif
#if defined(MAVLINK)
g_model.mavlink.rc_rssi_scale = 15;
g_model.mavlink.pc_rssi_en = 1;
@@ -1429,17 +1436,36 @@ uint16_t BandGap ;
#endif
#if defined(JITTER_MEASURE)
JitterMeter<uint16_t> rawJitter[NUMBER_ANALOG];
JitterMeter<uint16_t> avgJitter[NUMBER_ANALOG];
tmr10ms_t jitterResetTime = 0;
#define JITTER_MEASURE_ACTIVE() (menuHandlers[menuLevel] == menuGeneralDiagAna)
#endif // defined(JITTER_MEASURE)
JitterMeter<uint16_t> rawJitter[NUMBER_ANALOG];
JitterMeter<uint16_t> avgJitter[NUMBER_ANALOG];
tmr10ms_t jitterResetTime = 0;
#define JITTER_MEASURE_ACTIVE() (menuHandlers[menuLevel] == menuGeneralDiagAna)
#endif
#if defined(VIRTUALINPUTS)
#define JITTER_FILTER_STRENGTH 4 // tune this value, bigger value - more filtering (range: 1-5) (see explanation below)
#define ANALOG_SCALE 1 // tune this value, bigger value - more filtering (range: 0-3) (see explanation below)
#define JITTER_ALPHA (1<<JITTER_FILTER_STRENGTH)
#define ANALOG_MULTIPLIER (1<<ANALOG_SCALE)
#define ANA_FILT(chan) (s_anaFilt[chan] / (JITTER_ALPHA * ANALOG_MULTIPLIER))
#if (JITTER_ALPHA * ANALOG_MULTIPLIER > 32)
#error "JITTER_FILTER_STRENGTH and ANALOG_SCALE are too big, their summ should be <= 5 !!!"
#endif
#else
#define ANALOG_SCALE 0
#define JITTER_ALPHA 1
#define ANALOG_MULTIPLIER 1
#define ANA_FILT(chan) (s_anaFilt[chan])
#endif
#if !defined(SIMU)
uint16_t anaIn(uint8_t chan)
{
#if defined(VIRTUALINPUTS)
return s_anaFilt[chan];
return ANA_FILT(chan);
#elif defined(PCBSKY9X) && !defined(REVA)
static const uint8_t crossAna[]={1,5,7,0,4,6,2,3};
if (chan == TX_CURRENT) {
@@ -1473,6 +1499,7 @@ void getADC()
#if defined(JITTER_MEASURE)
if (JITTER_MEASURE_ACTIVE() && jitterResetTime < get_tmr10ms()) {
// reset jitter measurement every second
for (uint32_t x=0; x<NUMBER_ANALOG; x++) {
rawJitter[x].reset();
avgJitter[x].reset();
@@ -1484,62 +1511,88 @@ void getADC()
for (uint32_t i=0; i<4; i++) {
adcRead();
for (uint32_t x=0; x<NUMBER_ANALOG; x++) {
#if defined(JITTER_MEASURE)
uint16_t val = getAnalogValue(x);
#if defined(JITTER_MEASURE)
if (JITTER_MEASURE_ACTIVE()) {
rawJitter[x].measure(val);
}
#endif
temp[x] += val;
#else
temp[x] += getAnalogValue(x);
#endif
}
#if defined(VIRTUALINPUTS)
if (calibrationState) break;
#endif
}
for (uint32_t x=0; x<NUMBER_ANALOG; x++) {
uint16_t v = temp[x] >> 3;
uint16_t v = temp[x] >> (3 - ANALOG_SCALE);
#if defined(VIRTUALINPUTS)
if (calibrationState) {
v = temp[x] >> 1;
}
#if defined(JITTER_FILTER)
else {
// jitter filter
uint16_t diff = (v > s_anaFilt[x]) ? (v - s_anaFilt[x]) : (s_anaFilt[x] - v);
if (diff < 10) {
// apply filter
v = (7 * s_anaFilt[x] + v) >> 3;
}
// Jitter filter:
// * pass trough any big change directly
// * for small change use Modified moving average (MMA) filter
//
// Explanation:
//
// Normal MMA filter has this formula:
// <out> = ((ALPHA-1)*<out> + <in>)/ALPHA
//
// If calculation is done this way with integer arithmetics, then any small change in
// input signal is lost. One way to combat that, is to rearrange the formula somewhat,
// to store a more precise (larger) number between iterations. The basic idea is to
// store undivided value between iterations. Therefore an new variable <filtered> is
// used. The new formula becomes:
// <filtered> = <filtered> - <filtered>/ALPHA + <in>
// <out> = <filtered>/ALPHA (use only when out is needed)
//
// The above formula with a maximum allowed ALPHA value (we are limited by
// the 16 bit s_anaFilt[]) was tested on the radio. The resulting signal still had
// some jitter (a value of 1 was observed). The jitter might be bigger on other
// radios.
//
// So another idea is to use larger input values for filtering. So instead of using
// input in a range from 0 to 2047, we use twice larger number (temp[x] is divided less)
//
// This also means that ALPHA must be lowered (remember 16 bit limit), but test results
// have proved that this kind of filtering gives better results. So the recommended values
// for filter are:
// JITTER_FILTER_STRENGTH 4
// ANALOG_SCALE 1
//
// Variables mapping:
// * <in> = v
// * <out> = s_anaFilt[x]
uint16_t previous = s_anaFilt[x] / JITTER_ALPHA;
uint16_t diff = (v > previous) ? (v - previous) : (previous - v);
if (!g_eeGeneral.jitterFilter && diff < (10*ANALOG_MULTIPLIER)) { // g_eeGeneral.jitterFilter is inverted, 0 - active
// apply jitter filter
s_anaFilt[x] = (s_anaFilt[x] - previous) + v;
}
else
#endif
{
//use unfiltered value
s_anaFilt[x] = v * JITTER_ALPHA;
}
#if defined(JITTER_MEASURE)
if (JITTER_MEASURE_ACTIVE()) {
avgJitter[x].measure(v);
avgJitter[x].measure(ANA_FILT(x));
}
#endif
#if defined(VIRTUALINPUTS)
#define ANAFILT_MAX (2 * RESX * JITTER_ALPHA * ANALOG_MULTIPLIER - 1)
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[x];
if (!calibrationState && IS_POT_MULTIPOS(x) && calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) {
uint8_t vShifted = (v >> 4);
s_anaFilt[x] = 2*RESX;
for (int i=0; i<calib->count; i++) {
if (!calibrationState && IS_POT_MULTIPOS(x) && IS_MULTIPOS_CALIBRATED(calib)) {
// TODO: consider adding another low pass filter to eliminate multipos switching glitches
uint8_t vShifted = ANA_FILT(x) >> 4;
s_anaFilt[x] = ANAFILT_MAX;
for (uint32_t i=0; i<calib->count; i++) {
if (vShifted < calib->steps[i]) {
s_anaFilt[x] = i*2*RESX/calib->count;
s_anaFilt[x] = (i * ANAFILT_MAX) / calib->count;
break;
}
}
}
else
#endif
{
s_anaFilt[x] = v;
}
#endif // defined(VIRTUALINPUTS)
}
}
#endif
@@ -1890,6 +1943,11 @@ void opentxStart()
#if defined(CPUARM) || defined(CPUM2560)
void opentxClose()
{
#if defined(CPUARM)
watchdogSetTimeout(2000/*20s*/);
#endif
pausePulses(); // stop mixer task to disable trims processing while in shutdown
AUDIO_BYE();
#if defined(FRSKY)
@@ -1913,15 +1971,9 @@ void opentxClose()
#if defined(CPUARM)
for (int i=0; i<MAX_SENSORS; i++) {
TelemetrySensor & sensor = g_model.telemetrySensors[i];
if (sensor.type == TELEM_TYPE_CALCULATED) {
if (sensor.persistent && sensor.persistentValue != telemetryItems[i].value) {
sensor.persistentValue = telemetryItems[i].value;
eeDirty(EE_MODEL);
}
else if (!sensor.persistent) {
sensor.persistentValue = 0;
eeDirty(EE_MODEL);
}
if (sensor.type == TELEM_TYPE_CALCULATED && sensor.persistent && sensor.persistentValue != telemetryItems[i].value) {
sensor.persistentValue = telemetryItems[i].value;
eeDirty(EE_MODEL);
}
}
#endif
+3 -5
View File
@@ -396,6 +396,7 @@
#endif
#define IS_POT(x) ((x)>=POT1 && (x)<=POT_LAST)
#define IS_MULTIPOS_CALIBRATED(cal) (cal->count>0 && cal->count<XPOTS_MULTIPOS_COUNT)
#define GET_LOWRES_POT_POSITION(i) (getValue(MIXSRC_FIRST_POT+(i)) >> 4)
#define SAVE_POT_POSITION(i) g_model.potsWarnPosition[i] = GET_LOWRES_POT_POSITION(i)
@@ -480,7 +481,8 @@
#endif
#if defined(CPUARM)
static const int8_t maxChannelsModules[] = { 0, 8, 8, -2, 8 }; // relative to 8!
// Order is the same as in enum Protocols in myeeprom.h (none, ppm, xjt, dsm, crossfire, multi)
static const int8_t maxChannelsModules[] = { 0, 8, 8, -2, 8, 8 }; // relative to 8!
static const int8_t maxChannelsXJT[] = { 0, 8, 0, 4 }; // relative to 8!
#define MAX_TRAINER_CHANNELS() (8)
#endif
@@ -1048,11 +1050,7 @@ void checkBacklight();
/// liefert Dimension eines Arrays
#define DIM(arr) (sizeof((arr))/sizeof((arr)[0]))
/// liefert Betrag des Arguments
template<class t> FORCEINLINE t abs(t a) { return a>0?a:-a; }
/// liefert das Minimum der Argumente
template<class t> FORCEINLINE t min(t a, t b) { return a<b?a:b; }
/// liefert das Maximum der Argumente
template<class t> FORCEINLINE t max(t a, t b) { return a>b?a:b; }
template<class t> FORCEINLINE t sgn(t a) { return a>0 ? 1 : (a < 0 ? -1 : 0); }
template<class t> FORCEINLINE t limit(t mi, t x, t ma) { return min(max(mi,x),ma); }
+1 -1
View File
@@ -80,7 +80,7 @@ void setupPulses(unsigned int port)
case MODULE_TYPE_XJT:
required_protocol = PROTO_PXX;
break;
#if defined(PCBTARANIS) && defined(DSM2)
#if defined(DSM2)
case MODULE_TYPE_DSM2:
required_protocol = limit<uint8_t>(PROTO_DSM2_LP45, PROTO_DSM2_LP45+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, PROTO_DSM2_DSMX);
// The module is set to OFF during one second before BIND start
+5
View File
@@ -477,3 +477,8 @@ uint16_t anaIn(uint8_t chan)
else
return 0;
}
uint16_t getAnalogValue(uint32_t index)
{
return anaIn(index);
}
+1 -1
View File
@@ -177,7 +177,7 @@ void getSwitchesPosition(bool startup)
for (int i=0; i<NUM_XPOTS; i++) {
if (IS_POT_MULTIPOS(POT1+i)) {
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[POT1+i];
if (calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) {
if (IS_MULTIPOS_CALIBRATED(calib)) {
uint8_t pos = anaIn(POT1+i) / (2*RESX/calib->count);
uint8_t previousPos = potsPos[i] >> 4;
uint8_t previousStoredPos = potsPos[i] & 0x0F;
+2 -2
View File
@@ -376,8 +376,8 @@ void *main_thread(void *)
sleep(10/*ms*/);
}
#if defined(LUA)
luaClose();
#if defined(CPUARM)
opentxClose();
#endif
#ifdef SIMU_EXCEPTIONS
+6
View File
@@ -41,6 +41,12 @@
#include "board.h"
#include "audio_driver.h"
#if defined(SIMU)
#define READ_AND_DISCARD(reg)
#else
#define READ_AND_DISCARD(reg) (void)(reg)
#endif
extern uint16_t ResetReason;
#define BOOTLOADER_SIZE 0x8000
+1 -1
View File
@@ -96,7 +96,7 @@ void i2cCheck()
#endif
TWI0->TWI_RCR = COPROC_RX_BUXSIZE - 1 ;
if ( TWI0->TWI_SR & TWI_SR_RXRDY ) {
(void) TWI0->TWI_RHR ;
READ_AND_DISCARD(TWI0->TWI_RHR);
}
TWI0->TWI_PTCR = TWI_PTCR_RXTEN ; // Start transfers
TWI0->TWI_CR = TWI_CR_START ; // Start Rx
+6 -6
View File
@@ -58,7 +58,7 @@ uint32_t eepromTransmitData(register uint8_t *command, register uint8_t *tx, reg
condition = SPI_SR_TXEMPTY ;
spiptr = SPI ;
spiptr->SPI_CR = 1 ; // Enable
(void) spiptr->SPI_RDR ; // Dump any rx data
READ_AND_DISCARD(spiptr->SPI_RDR);
(void) spiptr->SPI_SR ; // Clear error flags
spiptr->SPI_RPR = (uint32_t)discard_rx_command ;
spiptr->SPI_RCR = comlen ;
@@ -108,8 +108,8 @@ uint8_t eepromTransmitByte(uint8_t out, bool skipFirst)
spiptr = SPI;
spiptr->SPI_CR = 1; // Enable
(void) spiptr->SPI_RDR; // Dump any rx data
READ_AND_DISCARD(spiptr->SPI_RDR);
spiptr->SPI_TDR = out;
delay = 0;
@@ -119,9 +119,9 @@ uint8_t eepromTransmitByte(uint8_t out, bool skipFirst)
break;
}
}
if (skipFirst) {
(void) spiptr->SPI_RDR; // Dump the rx data
READ_AND_DISCARD(spiptr->SPI_RDR);
spiptr->SPI_TDR = 0;
delay = 0;
while ((spiptr->SPI_SR & SPI_SR_RDRF) == 0) {
@@ -222,8 +222,8 @@ extern "C" void SPI_IRQHandler()
spiptr = SPI ;
SPI->SPI_IDR = 0x07FF ; // All interrupts off
spiptr->SPI_CR = 2 ; // Disable
(void) spiptr->SPI_RDR ; // Dump any rx data
(void) spiptr->SPI_SR ; // Clear error flags
READ_AND_DISCARD(spiptr->SPI_RDR);
READ_AND_DISCARD(spiptr->SPI_SR); // Clear error flags
spiptr->SPI_PTCR = SPI_PTCR_RXTDIS | SPI_PTCR_TXTDIS ; // Stop tramsfers
Spi_complete = 1 ; // Indicate completion
+41 -27
View File
@@ -78,9 +78,23 @@ void init_main_ppm(uint32_t period, uint32_t out_enable)
pwmptr->PWM_ENA = PWM_ENA_CHID3 ; // Enable channel 3
pwmptr->PWM_IER1 = PWM_IER1_CHID3 ;
NVIC_SetPriority(PWM_IRQn, 3 ) ;
NVIC_EnableIRQ(PWM_IRQn) ;
}
void disable_main_ppm()
{
register Pio * pioptr = PIOA;
pioptr->PIO_PER = PIO_PA17; // Assign A17 to PIO
PWM->PWM_IDR1 = PWM_IDR1_CHID3;
}
void init_second_ppm(uint32_t period)
{
#if !defined(REVA)
// PWM1 for PPM2
configure_pins(PIO_PC15, PIN_PERIPHERAL | PIN_INPUT | PIN_PER_B | PIN_PORTC | PIN_NO_PULLUP ) ;
register Pwm * pwmptr = PWM;
configure_pins(PIO_PC15, PIN_PERIPHERAL | PIN_INPUT | PIN_PER_B | PIN_PORTC | PIN_NO_PULLUP ) ;
pwmptr->PWM_CH_NUM[1].PWM_CMR = 0x0000000B ; // CLKB
if (!g_model.moduleData[EXTRA_MODULE].ppmPulsePol) {
pwmptr->PWM_CH_NUM[1].PWM_CMR |= 0x00000200 ; // CPOL
@@ -88,13 +102,18 @@ void init_main_ppm(uint32_t period, uint32_t out_enable)
pwmptr->PWM_CH_NUM[1].PWM_CPDR = period ; // Period
pwmptr->PWM_CH_NUM[1].PWM_CPDRUPD = period ; // Period
pwmptr->PWM_CH_NUM[1].PWM_CDTY = g_model.moduleData[EXTRA_MODULE].ppmDelay*100+600 ; // Duty
pwmptr->PWM_CH_NUM[1].PWM_CDTYUPD = g_model.moduleData[EXTRA_MODULE].ppmDelay*100+600 ; // Duty
pwmptr->PWM_ENA = PWM_ENA_CHID1 ; // Enable channel 1
pwmptr->PWM_IER1 = PWM_IER1_CHID1 ;
pwmptr->PWM_CH_NUM[1].PWM_CDTYUPD = g_model.moduleData[EXTRA_MODULE].ppmDelay*100+600 ; // Duty pwmptr->PWM_ENA = PWM_ENA_CHID1 ; // Enable channel 1
pwmptr->PWM_IER1 = PWM_IER1_CHID1 ;
#endif
}
NVIC_SetPriority(PWM_IRQn, 3 ) ;
NVIC_EnableIRQ(PWM_IRQn) ;
void disable_second_ppm()
{
#if !defined(REVA)
register Pio * pioptr = PIOC;
pioptr->PIO_PER = PIO_PC15 ; // Assign C17 to PIO
PWM->PWM_IDR1 = PWM_IDR1_CHID1 ;
#endif
}
void init_no_pulses(uint32_t port)
@@ -123,26 +142,17 @@ void init_ppm(uint32_t port)
init_main_ppm(3000, 1);
}
else {
// TODO
init_second_ppm(3000);
}
}
void disable_ppm(uint32_t port)
{
register Pio *pioptr ;
if (port == EXTERNAL_MODULE) {
pioptr = PIOA ;
pioptr->PIO_PER = PIO_PA17 ; // Assign A17 to PIO
PWM->PWM_IDR1 = PWM_IDR1_CHID3 ;
disable_main_ppm();
}
else {
#if !defined(REVA)
pioptr = PIOC ;
pioptr->PIO_PER = PIO_PC17 ; // Assign C17 to PIO
PWM->PWM_IDR1 = PWM_IDR1_CHID1 ;
NVIC_DisableIRQ(PWM_IRQn) ;
#endif
disable_second_ppm();
}
}
@@ -154,13 +164,20 @@ void init_ssc()
PMC->PMC_PCER0 |= 0x00400000L ; // Enable peripheral clock to SSC
configure_pins( PIO_PA17, PIN_PERIPHERAL | PIN_INPUT | PIN_PER_A | PIN_PORTA | PIN_NO_PULLUP ) ;
configure_pins( PIO_PA17, PIN_PERIPHERAL | PIN_INPUT | PIN_PER_A | PIN_PORTA ) ;
sscptr = SSC ;
sscptr->SSC_THR = 0xFF ; // Make the output high.
sscptr->SSC_TFMR = 0x00000027 ; // 0000 0000 0000 0000 0000 0000 1010 0111 (8 bit data, lsb)
sscptr->SSC_CMR = Master_frequency / (125000*2) ; // 8uS per bit
sscptr->SSC_TCMR = 0 ; // 0000 0000 0000 0000 0000 0000 0000 0000
sscptr->SSC_TFMR = 0x00000027 ; // 0000 0000 0000 0000 0000 0000 1010 0111 (8 bit data, lsb)
sscptr->SSC_CR = SSC_CR_TXEN ;
#if defined(REVX)
PIOA->PIO_MDER = PIO_PA17; // Open Drain O/p in A17
#else
PIOA->PIO_MDDR = PIO_PA17; // Push Pull O/p in A17
#endif
}
void disable_ssc()
@@ -223,13 +240,10 @@ void disable_dsm2(uint32_t port)
#if !defined(SIMU)
extern "C" void PWM_IRQHandler(void)
{
register Pwm *pwmptr;
register Ssc *sscptr;
register Pwm * pwmptr = PWM;
uint32_t reason = pwmptr->PWM_ISR1;
uint32_t period;
uint32_t reason;
pwmptr = PWM;
reason = pwmptr->PWM_ISR1 ;
if (reason & PWM_ISR1_CHID3) {
// Use the current protocol, don't switch until set_up_pulses
switch (s_current_protocol[EXTERNAL_MODULE]) {
@@ -248,7 +262,7 @@ extern "C" void PWM_IRQHandler(void)
}
else {
// Kick off serial output here
sscptr = SSC;
register Ssc * sscptr = SSC;
sscptr->SSC_TPR = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].pxx.pulses);
sscptr->SSC_TCR = (uint8_t *)modulePulsesData[EXTERNAL_MODULE].pxx.ptr - (uint8_t *)modulePulsesData[EXTERNAL_MODULE].pxx.pulses;
sscptr->SSC_PTCR = SSC_PTCR_TXTEN; // Start transfers
@@ -272,7 +286,7 @@ extern "C" void PWM_IRQHandler(void)
}
else {
// Kick off serial output here
sscptr = SSC;
register Ssc * sscptr = SSC;
sscptr->SSC_TPR = CONVERT_PTR_UINT(modulePulsesData[EXTERNAL_MODULE].dsm2.pulses);
sscptr->SSC_TCR = (uint8_t *)modulePulsesData[EXTERNAL_MODULE].dsm2.ptr - (uint8_t *)modulePulsesData[EXTERNAL_MODULE].dsm2.pulses;
sscptr->SSC_PTCR = SSC_PTCR_TXTEN; // Start transfers
+1 -1
View File
@@ -252,7 +252,7 @@ void watchdogInit(unsigned int duration);
// ADC driver
void adcInit(void);
void adcRead(void);
inline uint16_t getAnalogValue(uint32_t value);
uint16_t getAnalogValue(uint32_t value);
#define BATT_SCALE 150
+1 -1
View File
@@ -17,7 +17,7 @@ void unlockFlash()
void lockFlash()
{
while (!FLASH->SR & FLASH_SR_BSY);
while (FLASH->SR & FLASH_SR_BSY);
FLASH->CR |= FLASH_CR_LOCK;
}
+3 -16
View File
@@ -83,14 +83,8 @@ void USB_OTG_BSP_Deinit(USB_OTG_CORE_HANDLE *pdev)
*/
void USB_OTG_BSP_EnableInterrupt(USB_OTG_CORE_HANDLE *pdev)
{
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = OTG_FS_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_SetPriority(OTG_FS_IRQn, 11); // Lower priority interrupt
NVIC_EnableIRQ(OTG_FS_IRQn);
}
/**
@@ -101,14 +95,7 @@ void USB_OTG_BSP_EnableInterrupt(USB_OTG_CORE_HANDLE *pdev)
*/
void USB_OTG_BSP_DisableInterrupt(USB_OTG_CORE_HANDLE *pdev)
{
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = OTG_FS_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3;
NVIC_InitStructure.NVIC_IRQChannelCmd = DISABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_DisableIRQ(OTG_FS_IRQn);
}
-2
View File
@@ -192,8 +192,6 @@ void menusTask(void * pdata)
topLcdOff();
#endif
BACKLIGHT_OFF();
#if defined(PCBTARANIS)
displaySleepBitmap();
#else
+6 -4
View File
@@ -192,16 +192,18 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t val, uint32
}
newVal += std.offsetAuto;
}
else if (sensor.filter) {
if (sensor.filter) {
if (!isAvailable()) {
for (int i=0; i<TELEMETRY_AVERAGE_COUNT; i++) {
std.filterValues[i] = newVal;
}
}
else {
// calculate the average from values[] and value
// also shift readings in values [] array
unsigned int sum = std.filterValues[0];
// Calculate the average from values[] and value,
// also shift readings in values [] array.
// There is a possibility of value overflow in `sum` but
// in reality no sensor value should be so big to cause it.
int32_t sum = std.filterValues[0];
for (int i=0; i<TELEMETRY_AVERAGE_COUNT-1; i++) {
int32_t tmp = std.filterValues[i+1];
std.filterValues[i] = tmp;
+5
View File
@@ -47,6 +47,11 @@ uint16_t anaIn(uint8_t chan)
return 0;
}
uint16_t getAnalogValue(uint32_t index)
{
return anaIn(index);
}
static char _zchar2stringResult[200];
const char * zchar2string(const char * zstring, int size)
{
+11 -10
View File
@@ -482,10 +482,10 @@ const pm_char STR_NO_SOUNDS_ON_SD[] PROGMEM = TR_NO_SOUNDS_ON_SD;
const pm_char STR_NO_MODELS_ON_SD[] PROGMEM = TR_NO_MODELS_ON_SD;
const pm_char STR_NO_BITMAPS_ON_SD[] PROGMEM = TR_NO_BITMAPS_ON_SD;
const pm_char STR_NO_SCRIPTS_ON_SD[] PROGMEM = TR_NO_SCRIPTS_ON_SD;
const pm_char STR_SCRIPT_SYNTAX_ERROR[] PROGMEM = TR_SCRIPT_SYNTAX_ERROR;
const pm_char STR_SCRIPT_PANIC[] PROGMEM = TR_SCRIPT_PANIC;
const pm_char STR_SCRIPT_KILLED[] PROGMEM = TR_SCRIPT_KILLED;
const pm_char STR_SCRIPT_ERROR[] PROGMEM = TR_SCRIPT_ERROR;
const pm_char STR_SCRIPT_SYNTAX_ERROR[] PROGMEM = TR_SCRIPT_SYNTAX_ERROR;
const pm_char STR_SCRIPT_PANIC[] PROGMEM = TR_SCRIPT_PANIC;
const pm_char STR_SCRIPT_KILLED[] PROGMEM = TR_SCRIPT_KILLED;
const pm_char STR_SCRIPT_ERROR[] PROGMEM = TR_SCRIPT_ERROR;
const pm_char STR_PLAY_FILE[] PROGMEM = TR_PLAY_FILE;
const pm_char STR_ASSIGN_BITMAP[] PROGMEM = TR_ASSIGN_BITMAP;
const pm_char STR_EXECUTE_FILE[] PROGMEM = TR_EXECUTE_FILE;
@@ -576,10 +576,10 @@ const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR;
const pm_char STR_TELEMETRYFULL[] PROGMEM = TR_TELEMETRYFULL;
const pm_char STR_INVERTED_SERIAL[] PROGMEM = TR_INVERTED_SERIAL;
const pm_char STR_IGNORE_INSTANCE[] PROGMEM = TR_IGNORE_INSTANCE;
const pm_char STR_DISCOVER_SENSORS[] PROGMEM = TR_DISCOVER_SENSORS;
const pm_char STR_DISCOVER_SENSORS[] PROGMEM = TR_DISCOVER_SENSORS;
const pm_char STR_STOP_DISCOVER_SENSORS[] PROGMEM = TR_STOP_DISCOVER_SENSORS;
const pm_char STR_DELETE_ALL_SENSORS[] PROGMEM = TR_DELETE_ALL_SENSORS;
const pm_char STR_CONFIRMDELETE[] PROGMEM = TR_CONFIRMDELETE;
const pm_char STR_CONFIRMDELETE[] PROGMEM = TR_CONFIRMDELETE;
#endif
#if defined(PCBTARANIS)
@@ -599,10 +599,10 @@ const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR;
const pm_char STR_SMOOTH[] PROGMEM = TR_SMOOTH;
const pm_char STR_COPY_STICKS_TO_OFS[] PROGMEM = TR_COPY_STICKS_TO_OFS;
const pm_char STR_COPY_TRIMS_TO_OFS[] PROGMEM = TR_COPY_TRIMS_TO_OFS;
const pm_char STR_INCDEC[] PROGMEM = TR_INCDEC;
const pm_char STR_GLOBALVAR[] PROGMEM = TR_GLOBALVAR;
const pm_char STR_MIXSOURCE[] PROGMEM = TR_MIXSOURCE;
const pm_char STR_CONSTANT[] PROGMEM = TR_CONSTANT;
const pm_char STR_INCDEC[] PROGMEM = TR_INCDEC;
const pm_char STR_GLOBALVAR[] PROGMEM = TR_GLOBALVAR;
const pm_char STR_MIXSOURCE[] PROGMEM = TR_MIXSOURCE;
const pm_char STR_CONSTANT[] PROGMEM = TR_CONSTANT;
const pm_char STR_TOP_BAR[] PROGMEM = TR_TOP_BAR;
const pm_char STR_ALTITUDE[] PROGMEM = TR_ALTITUDE;
const pm_char STR_SCALE[] PROGMEM = TR_SCALE;
@@ -628,6 +628,7 @@ const pm_char STR_MENU_LOGICAL_SWITCHES[] PROGMEM = TR_MENU_LOGICAL_SWITCHES;
const pm_char STR_MENU_TELEMETRY[] PROGMEM = TR_MENU_TELEMETRY;
const pm_char STR_MENU_OTHER[] PROGMEM = TR_MENU_OTHER;
const pm_char STR_MENU_INVERT[] PROGMEM = TR_MENU_INVERT;
const pm_char STR_JITTER_FILTER[] PROGMEM = TR_JITTER_FILTER;
#endif
#if MENUS_LOCK == 1
+11 -10
View File
@@ -665,10 +665,10 @@ extern const pm_char STR_NO_SOUNDS_ON_SD[];
extern const pm_char STR_NO_MODELS_ON_SD[];
extern const pm_char STR_NO_BITMAPS_ON_SD[];
extern const pm_char STR_NO_SCRIPTS_ON_SD[];
extern const pm_char STR_SCRIPT_SYNTAX_ERROR[];
extern const pm_char STR_SCRIPT_PANIC[];
extern const pm_char STR_SCRIPT_KILLED[];
extern const pm_char STR_SCRIPT_ERROR[];
extern const pm_char STR_SCRIPT_SYNTAX_ERROR[];
extern const pm_char STR_SCRIPT_PANIC[];
extern const pm_char STR_SCRIPT_KILLED[];
extern const pm_char STR_SCRIPT_ERROR[];
extern const pm_char STR_PLAY_FILE[];
extern const pm_char STR_ASSIGN_BITMAP[];
extern const pm_char STR_EXECUTE_FILE[];
@@ -795,10 +795,10 @@ extern const pm_char STR_BLCOLOR[];
extern const pm_char STR_TELEMETRYFULL[];
extern const pm_char STR_INVERTED_SERIAL[];
extern const pm_char STR_IGNORE_INSTANCE[];
extern const pm_char STR_DISCOVER_SENSORS[];
extern const pm_char STR_DISCOVER_SENSORS[];
extern const pm_char STR_STOP_DISCOVER_SENSORS[];
extern const pm_char STR_DELETE_ALL_SENSORS[];
extern const pm_char STR_CONFIRMDELETE[];
extern const pm_char STR_CONFIRMDELETE[];
#endif
#if defined(PCBTARANIS)
@@ -818,10 +818,10 @@ extern const pm_char STR_BLCOLOR[];
extern const pm_char STR_SMOOTH[];
extern const pm_char STR_COPY_STICKS_TO_OFS[];
extern const pm_char STR_COPY_TRIMS_TO_OFS[];
extern const pm_char STR_INCDEC[];
extern const pm_char STR_GLOBALVAR[];
extern const pm_char STR_MIXSOURCE[];
extern const pm_char STR_CONSTANT[];
extern const pm_char STR_INCDEC[];
extern const pm_char STR_GLOBALVAR[];
extern const pm_char STR_MIXSOURCE[];
extern const pm_char STR_CONSTANT[];
extern const pm_char STR_TOP_BAR[];
extern const pm_char STR_ALTITUDE[];
extern const pm_char STR_SCALE[];
@@ -847,6 +847,7 @@ extern const pm_char STR_BLCOLOR[];
extern const pm_char STR_MENU_TELEMETRY[];
extern const pm_char STR_MENU_OTHER[];
extern const pm_char STR_MENU_INVERT[];
extern const pm_char STR_JITTER_FILTER[];
#endif
#if MENUS_LOCK == 1
+1
View File
@@ -1104,6 +1104,7 @@
#define TR_MENU_TELEMETRY "\321Telemetrie"
#define TR_MENU_OTHER "Ostatní"
#define TR_MENU_INVERT "Invertovat"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+2 -1
View File
@@ -1102,7 +1102,8 @@
#define TR_MENU_TELEMETRY "\321Telemetrie"
#define TR_MENU_OTHER " Weitere"
#define TR_MENU_INVERT "Invertieren<!>"
// ----------------------------------------------------------------
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
#define ZSTR_A1 "A1"
+1
View File
@@ -1102,6 +1102,7 @@
#define TR_MENU_TELEMETRY "\321Telemetry"
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+1
View File
@@ -1057,6 +1057,7 @@
#define TR_MENU_TELEMETRY "\321Telemetry"
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+1
View File
@@ -1057,6 +1057,7 @@
#define TR_MENU_TELEMETRY "\321Telemetry"
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+1
View File
@@ -1094,6 +1094,7 @@
#define TR_MENU_TELEMETRY "\321Télémesure"
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+1
View File
@@ -1106,6 +1106,7 @@
#define TR_MENU_TELEMETRY "\321Telemetry"
#define TR_MENU_OTHER "Altro"
#define TR_MENU_INVERT "Inverti"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+1
View File
@@ -1126,6 +1126,7 @@
#define TR_MENU_TELEMETRY "\321Telemetrie"
#define TR_MENU_OTHER "Verdere"
#define TR_MENU_INVERT "Inverteer"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+1
View File
@@ -1107,6 +1107,7 @@
#define TR_MENU_TELEMETRY "\321Telemetry"
#define TR_MENU_OTHER "Inny "
#define TR_MENU_INVERT "Odwróć"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+1
View File
@@ -1057,6 +1057,7 @@
#define TR_MENU_TELEMETRY "\321Telemetry"
#define TR_MENU_OTHER "Other"
#define TR_MENU_INVERT "Invert"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+9 -8
View File
@@ -68,10 +68,10 @@
#define TR_VBEEPLEN "0====""=0===""==0==""===0=""====0"
#define LEN_VRENAVIG "\003"
#define TR_VRENAVIG "Ingen REaREb"
#define TR_VRENAVIG "IngREaREb"
#define LEN_VBLMODE TR("\005", "\010")
#define TR_VBLMODE TR("Av\0""Knapp""Spak\0""Båda\0""På\0 ", "Av\0 ""Knapp\0 ""Spakar\0 ""Båda\0 ""På\0 ")
#define TR_VBLMODE TR("Av\0 ""Knapp""Spak\0""Båda\0""På\0 ", "Av\0 ""Knapp\0 ""Spakar\0 ""Båda\0 ""På\0 ")
#define LEN_TRNMODE "\002"
#define TR_TRNMODE "Av""+="":="
@@ -88,8 +88,8 @@
#define LEN_POTTYPES "\020"
#define TR_POTTYPES "Ingen\0 ""Mittläges-pot\0 ""Flerlägesväljare""Potentiometer\0"
#define LEN_SLIDERTYPES "\008"
#define TR_SLIDERTYPES "Ingen\0""Skjutpot"
#define LEN_SLIDERTYPES "\010"
#define TR_SLIDERTYPES "Ingen\0 ""Skjutpot"
#define LEN_DATETIME "\005"
#define TR_DATETIME "DAG: ""TID: "
@@ -119,7 +119,7 @@
#define TR_VDISPLAYTRIMS "No\0 ""Change""Yes\0"
#define LEN_VBEEPCOUNTDOWN "\007"
#define TR_VBEEPCOUNTDOWN "Tyst\0 Pip\0 Röst\0 Vibrera"
#define TR_VBEEPCOUNTDOWN "Tyst\0 ""Pip\0 ""Röst\0 ""Vibrera"
#define LEN_VVARIOCENTER "\006"
#define TR_VVARIOCENTER "Tone\0 ""Silent"
@@ -441,7 +441,7 @@
#define TR_VTEMPLATES "Nolla Mixar\0\0""Enkel 4kanal\0""Gasklippning\0""V-Stjärt \0""Deltavinge \0""eCCPM \0""Helikopter \0""Servotest \0"
#define LEN_VSWASHTYPE "\004"
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0 "
#define LEN_VKEYS "\005"
#define TR_VKEYS TR("Menu\0""Exit\0""Ned\0 ""Upp\0 ""Höger""Vänst", "Menu\0""Exit\0""Enter""Page\0""Plus\0""Minus")
@@ -512,7 +512,7 @@
#define TR_EXTRA_VSRCRAW
#endif
#define TR_VSRCRAW "---\0""Rod\0""Hjd\0""Gas\0""Ske\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS "MAX\0" TR_CYC_VSRCRAW "TrmR" "TrmH" "TrmG" "TrmS" TR_SW_VSRCRAW
#define TR_VSRCRAW "---\0" TR_STICKS_VSRCRAW TR_POTS_VSRCRAW TR_ROTARY_ENCODERS "MAX\0" TR_CYC_VSRCRAW TR_TRIMS_VSRCRAW TR_SW_VSRCRAW TR_EXTRA_VSRCRAW
#define LEN_VTMRMODES "\003"
#define TR_VTMRMODES "Av\0""På\0""GAs""GA%""GAt"
@@ -597,7 +597,7 @@
#define TR_TTRACE TR("Följ Gas", INDENT "Följ Gas")
#define TR_TTRIM TR("Gastrim", INDENT "Gastrim")
#define TR_BEEPCTR TR("Cent.pip", "Centerpip")
#define TR_USE_GLOBAL_FUNCS TR("Glob.Funkt", "Använd Global Funktioner")
#define TR_USE_GLOBAL_FUNCS TR("Glob.Funkt", "Använd Global Funk.")
#if defined(PCBSKY9X) && defined(REVX)
#define TR_OUTPUT_TYPE INDENT "Output"
#endif
@@ -1102,6 +1102,7 @@
#define TR_MENU_TELEMETRY "\321Telemetri"
#define TR_MENU_OTHER "Annat"
#define TR_MENU_INVERT "Invertera"
#define TR_JITTER_FILTER "ADC Filter"
#define ZSTR_RSSI "RSSI"
#define ZSTR_SWR "SWR"
+11
View File
@@ -9,6 +9,17 @@ RUN apt-get update && \
cmake \
gcc \
git \
subversion \
libqtcore4 \
libqt4-dev \
qt4-qmake \
libxerces-c-dev \
xsdcxx \
libusb-1.0-0 \
libphonon-dev \
phonon \
libqtwebkit-dev \
python-qt4-dev \
lib32ncurses5 \
lib32z1 \
libfox-1.6-dev \