Compare commits

..

326 Commits

Author SHA1 Message Date
bsongis b359aa12ba Fixes #1834
Fixes #1848
2014-11-19 22:35:35 +01:00
bsongis 5f81444ccb Release notes updated 2014-11-19 21:59:18 +01:00
bsongis e8aba51edb Fixes #1852 2014-11-19 20:27:57 +01:00
bsongis 6393f10ae4 Fixes #1851 2014-11-19 19:47:38 +01:00
bsongis 8a16b63b31 Mutex lock check added as suggested by projectkk2glider 2014-11-19 19:40:45 +01:00
bsongis a5d334b11d No more -O2 on all platforms 2014-11-19 07:12:13 +01:00
bsongis b51060f8f8 unexpectedShutdown sentinel removed 2014-11-18 23:29:27 +01:00
Bertrand Songis 0db8fc5ab2 Update DONATIONS.txt 2014-11-18 23:08:37 +01:00
bsongis 1c696c28fd ioMutex removed 2014-11-18 07:52:15 +01:00
bsongis f29d2074c1 openocd config file added 2014-11-18 00:30:01 +01:00
bsongis c12bc7326c Those ; are a little bit dangerous 2014-11-18 00:30:01 +01:00
Damjan Adamic 6365292bfe Updated release notes 2014-11-17 21:05:43 +01:00
bsongis d74bdef2ea Release notes updated (please update if I missed anything) 2014-11-17 19:06:50 +01:00
Bertrand Songis 884698c7f7 Update DONATIONS.txt 2014-11-17 07:37:25 +01:00
Damjan Adamic 1454764987 Enabled more complier warnings and removed one for Taranis. Other targets still have some warnings. 2014-11-15 11:43:52 +01:00
Bertrand Songis fb35ff098d Merge pull request #1843 from opentx/projectkk2glider/bmpload_fixes
Fixed bmpLoad():
2014-11-15 10:09:58 +01:00
bsongis 681064b11c Cosmetics 2014-11-15 10:09:33 +01:00
bsongis 87ebf0b90a Fixes #1834 - I will confirm with the JTAG that it is a compiler bug
later
2014-11-15 08:36:26 +01:00
Bertrand Songis 1f63108753 Update DONATIONS.txt 2014-11-14 19:57:52 +01:00
Damjan Adamic 649fffa439 Fixed bmpLoad():
* added gtests
 * fixed various memory leaks
 * fixed wrong display of images with width < 8
 * fixed wrong display of images with odd width and/or height
2014-11-12 19:45:00 +01:00
Bertrand Songis e3d08e9bab Update DONATIONS.txt 2014-11-12 07:08:06 +01:00
Bertrand Songis b4cc92b3f0 Update DONATIONS.txt 2014-11-11 20:35:17 +01:00
Bertrand Songis 9691d9f648 Update DONATIONS.txt 2014-11-11 09:04:08 +01:00
Damjan Adamic f02b9699d5 Re #1834 - fixed Companion simulator compilation for lastest FatFS 0.10c 2014-11-10 20:30:55 +01:00
bsongis b78556275b #1834 - Switch to lastest FatFS 0.10c 2014-11-10 18:53:37 +01:00
bsongis 1effa17204 #1834 ... In case we have negative indexes here ... 2014-11-09 22:53:24 +01:00
Damjan Adamic ff69164400 One more try for Windows Companion compile problem (lua_exports) 2014-11-09 21:08:18 +01:00
Damjan Adamic 86e8687d32 Possible solution for Windows Companion compile problem (lua_exports) 2014-11-09 20:44:09 +01:00
Damjan Adamic 85755312e4 Fixes #1839: Companion simulator Lua crash on Mac 2014-11-09 10:32:43 +01:00
Bertrand Songis f826d77f18 Merge pull request #1832 from opentx/projectkk2glider/issue_1783_for_master
Projectkk2glider/issue 1783 for master
2014-11-08 11:23:24 +01:00
bsongis 9dc4756789 In MixerDialog GVar checkbox for Curves was visible even when GVARS
disabled
2014-11-08 11:22:46 +01:00
Bertrand Songis afd04e0c44 Update DONATIONS.txt 2014-11-08 10:53:27 +01:00
Damjan Adamic d718ca03db This enables build of Companion on OS X
Remove the check for arm-gcc version when doing Companion build
2014-11-08 10:15:23 +01:00
Bertrand Songis ca4028cc7e Update DONATIONS.txt 2014-11-07 18:25:59 +01:00
Bertrand Songis 9c0b13eb6b Merge pull request #1827 from opentx/projectkk2glider/issue_1811_for_master
Fixes #1811: Companion 2.0.12 Gvar import error (for limits)
2014-11-03 23:56:42 +01:00
Damjan Adamic 5a10d85ee0 Re #1783: NOT curves removed from inputs (for non ARM platforms) 2014-11-03 22:15:05 +01:00
Damjan Adamic 2d80327ffd Re #1783: NOT curves exported incorrectly (for non ARM platforms) 2014-11-03 22:01:58 +01:00
Damjan Adamic 2a5ff5244f Re #1783: Companion shows too many curve types in input/mixer for 9x 2014-11-03 21:14:52 +01:00
Damjan Adamic 2ce1ec16fb Fixes #1811: Companion 2.0.12 Gvar import error (for limits) 2014-11-03 19:55:07 +01:00
Bertrand Songis 607a93b604 Update DONATIONS.txt 2014-11-03 18:36:57 +01:00
Bertrand Songis 75b7a0517b Merge pull request #1822 from opentx/projectkk2glider/issue_1731_for_master
Fixes #1731: Joystick calibration crash after channel assignment
2014-11-02 19:43:08 +01:00
Damjan Adamic cf54d28f35 Fixes #1731: Joystick calibration crash after channel assignment
also additional fixes to stick postion mapping
2014-11-02 18:58:06 +01:00
Bertrand Songis ffe8ee5a29 Update DONATIONS.txt 2014-11-02 18:06:42 +01:00
Bertrand Songis 552e3d468a Update DONATIONS.txt 2014-11-02 16:28:31 +01:00
Damjan Adamic 949369d6a8 Fixes #1815: Stick icons missing next to trim key states on switch diag page 2014-11-02 13:32:39 +01:00
Damjan Adamic 3b2cf5d738 Fixes #1737: virtual inputs not selectable in SF Volume and heli Collective Source 2014-11-02 12:52:45 +01:00
bsongis 5468bacad7 2.0.13 preparation 2014-11-02 11:07:47 +01:00
Bertrand Songis b8fea4d652 Merge pull request #1820 from opentx/projectkk2glider/issue_1818_for_master
Fixes #1818: added Lua model.resetTimer() function
2014-11-02 10:00:12 +01:00
Damjan Adamic 734480cc56 Fixes #1818: added Lua model.resetTimer() function 2014-11-02 09:26:36 +01:00
Bertrand Songis 30e0d441e4 Update DONATIONS.txt 2014-10-29 19:00:05 +01:00
bsongis 784238252a Simplification with a new #define. Also one test was inverted. 2014-10-28 18:07:46 +01:00
Andre Bernet 403a62478a Disable SWR if XJT version is 0xFF
Typo
2014-10-28 12:38:54 +04:00
bsongis c73ab26bc4 SWR readded to Taranis+ (when the hardware supports it) 2014-10-28 00:23:54 +01:00
bsongis c0783948e6 #1805 fixed 2014-10-26 15:57:00 +01:00
Damjan Adamic dc3ca96a2f Display message in case of Lua telemetry screen script error 2014-10-26 10:40:21 +01:00
Damjan Adamic 5664b4a141 Missing screenshots for previous commit 2014-10-25 20:04:16 +02:00
Damjan Adamic 7e18f53cbe Fixed buffer overflow in lcd_hlineStip() 2014-10-25 20:00:56 +02:00
Damjan Adamic 611e26d0bf Fixed buffer overflow in bmp_load() 2014-10-25 19:30:52 +02:00
bsongis ae7a36deeb A2- set to A2 if A2 > A2+ 2014-10-22 20:27:23 +02:00
bsongis 7c37277364 Little display problem for negative curves on 9X 2014-10-21 07:18:08 +02:00
bsongis 2230fbaa94 SWR added in the firmware as an option (SWR=YES) 2014-10-19 22:54:38 +02:00
bsongis 97bb1a4b4d Cosmetics 2014-10-19 22:54:38 +02:00
bsongis 82d385bcef SWR added for latest Taranis+ production 2014-10-19 22:54:38 +02:00
Bertrand Songis 34f9367e25 Update DONATIONS.txt 2014-10-19 18:46:19 +02:00
Bertrand Songis 205e510468 Update DONATIONS.txt 2014-10-19 09:55:22 +02:00
Andre Bernet 414a482ce4 Fix receiver number range (Fix #1790) 2014-10-17 22:44:57 +04:00
Damjan Adamic b24d071493 Bug in numbering of Lua multiple fields (only in generated documentation file, all numbers were too small by 1) 2014-10-16 18:26:42 +02:00
Bertrand Songis a50e2472e9 Update DONATIONS.txt 2014-10-15 21:33:41 +02:00
bsongis 29c95fd2a3 Cosmetics 2014-10-14 22:23:24 +02:00
Damjan Adamic c9875525a4 Re #1610:
* sport.log only active if SPORT_FILE_LOG=YES
* audio concurrent access fixes
* added IO mutex
* added Event Trace Buffer
* fixed SD card error
2014-10-14 22:14:36 +02:00
bsongis 6df7575ad8 Fixes #1785 2014-10-12 19:42:07 +02:00
bsongis 86c8d4a878 It was possible to have the Limits contextual menu displayed in
READ_ONLY mode
2014-10-11 21:47:12 +02:00
Bertrand Songis 6abc26c36a Update DONATIONS.txt 2014-10-10 19:25:08 +02:00
Bertrand Songis 966398426a Update DONATIONS.txt 2014-10-10 07:04:34 +02:00
mhotar d43a48f088 No special character in CZ names of Inputs.
Conflicts:
	radio/src/translations.cpp
	radio/src/translations.h
	radio/src/translations/cz.h.txt
2014-10-07 07:10:40 +02:00
mhotar 56b4698655 cz tts.py updated 2014-10-07 07:06:28 +02:00
Bertrand Songis 57f0c1b6f6 Update DONATIONS.txt 2014-10-06 21:14:51 +02:00
bsongis b89e16e627 Sky9x Coprocessor bug fix 2014-10-06 00:03:19 +02:00
bsongis 9e4e990d33 Sky9x binary was built with the bootloader present on disk (was not
removed by make clean). So 99% it was a Taranis bootloader.
2014-10-06 00:02:40 +02:00
bsongis a7c893607a Companion bug in model import fixed (after changing radio in the same
session)
2014-10-05 19:32:02 +02:00
Damjan Adamic e477183026 Fixes #1755 (on master branch): LUA get/setTimer(): inconsistent timer struct 2014-10-05 14:52:13 +02:00
bsongis a4698287f8 Note added to Companion: if you have a Taranis that has not had the
firmware upgraded to 2.0 then this version of Companion will not work
2014-10-03 16:36:42 +02:00
Damjan Adamic b035a8df64 Fixes #1657 (ported from next to master):
* corrected varioLimitCenterMin range
* removed varioLimitMinOff checkbox (it is not used anymore in any radio)
2014-10-01 19:38:56 +02:00
Damjan Adamic 223be49c5d Fixes #1696: fixed incorrect display of "<" and ">" characters (ported from next to master branch) 2014-10-01 19:30:13 +02:00
Bertrand Songis ac8312de36 Update DONATIONS.txt 2014-10-01 07:10:41 +02:00
Bertrand Songis 46a9151bcf Update DONATIONS.txt 2014-09-30 07:11:33 +02:00
Bertrand Songis 0e9536fea9 Update DONATIONS.txt 2014-09-28 22:01:22 +02:00
Bertrand Songis 64d86c4c74 Update DONATIONS.txt 2014-09-26 23:40:52 +02:00
Bertrand Songis 151a09149d Update DONATIONS.txt 2014-09-26 07:19:57 +02:00
Bertrand Songis fd53eba65f Update DONATIONS.txt 2014-09-25 10:36:31 +02:00
Bertrand Songis 393f599ecf Update DONATIONS.txt 2014-09-24 19:56:36 +02:00
bsongis 1fbb4effed Tests failure 2014-09-24 15:22:20 +02:00
Bertrand Songis fe95488a83 Update DONATIONS.txt 2014-09-24 14:52:04 +02:00
bsongis c9b9de2c99 Fixes #1630 - Thanks to projectkk2glider for his pull request #1738 - I
only added a google test
2014-09-24 10:04:18 +02:00
bsongis 3adc4c20a6 Automatic google tests fix 2014-09-24 09:24:02 +02:00
Bertrand Songis 227a886122 Update DONATIONS.txt 2014-09-24 07:24:38 +02:00
Bertrand Songis de625fde01 Update DONATIONS.txt 2014-09-23 08:27:32 +02:00
Bertrand Songis daad477250 Update DONATIONS.txt 2014-09-22 17:40:37 +02:00
Bertrand Songis 334a718a8a Update DONATIONS.txt 2014-09-22 10:33:37 +02:00
Bertrand Songis 5baaec1868 Update DONATIONS.txt 2014-09-20 19:01:31 +02:00
Bertrand Songis c2ad82eb35 Update DONATIONS.txt 2014-09-19 15:19:15 +02:00
Bertrand Songis c61c417f13 Update DONATIONS.txt 2014-09-19 12:58:46 +02:00
bsongis 98f156301a Fixes #1727 2014-09-18 08:35:12 +02:00
Bertrand Songis ef6fe0006e Update DONATIONS.txt 2014-09-17 23:35:57 +02:00
Bertrand Songis 23358c254c Update DONATIONS.txt 2014-09-17 15:53:33 +02:00
bsongis 6114245229 Release notes updated 2014-09-16 17:18:31 +02:00
Andre Bernet e76880cf26 French translations 2014-09-16 17:14:56 +02:00
bsongis f30dfa3365 Inversion of S3 on Taranis+ (S3 should be wired as S2) - Issue #1716 2014-09-16 17:14:47 +02:00
Andre Bernet f4aa92ec20 S2 inverted on T+ (Fix #1716) 2014-09-16 17:03:56 +02:00
Bertrand Songis 2640ca9fea Update DONATIONS.txt 2014-09-16 14:30:22 +02:00
bsongis f6a1420ce3 Version and release notes updated 2014-09-15 18:54:32 +02:00
bsongis 6c0f65411a Overflow on OverrideCHxx functions on ARM boards (range is now
-150:+150)
2014-09-15 18:41:25 +02:00
bsongis a7f1ace55b #1647 - bitmap set/get added to the Lua interpreter 2014-09-15 17:37:20 +02:00
bsongis b8dedd7940 #1647 - getCurve exported to the Lua interpreter 2014-09-15 17:32:45 +02:00
bsongis 2703118c56 Makefile typos from #1644 2014-09-15 12:24:09 +02:00
Bertrand Songis 8bfc7a497a Update DONATIONS.txt 2014-09-15 11:58:52 +02:00
bsongis 87870c24a5 Fixes #1709 2014-09-15 11:50:45 +02:00
bsongis 7610fb43d5 Fixes #1669 2014-09-15 11:28:46 +02:00
bsongis 0263784e65 MEGA2560 simu compilation now ok 2014-09-15 09:56:33 +02:00
Bertrand Songis 6f74624371 Update DONATIONS.txt 2014-09-14 22:45:37 +02:00
Bertrand Songis 1c721b3817 Update DONATIONS.txt 2014-09-14 17:51:22 +02:00
bsongis 67d97046bb Fixes #1656 - Throttle Source everywhere (english and french) 2014-09-14 14:56:12 +02:00
bsongis 19d9e6ab19 No THR warning when a new model is created / the wizard is called 2014-09-14 14:46:59 +02:00
bsongis 5d9883d47f Added NANO option in Makefile (default: NANO=NO) 2014-09-14 14:46:59 +02:00
bsongis bb5f1d7d79 Fixes #1715 2014-09-14 14:46:59 +02:00
bsongis 30087b4a3a This luaFree is not needed and could do a mess in RAM 2014-09-14 14:46:59 +02:00
Bertrand Songis 61aa01b9b3 Update DONATIONS.txt 2014-09-14 14:44:29 +02:00
mhotar 16e06cff70 CZ translations - Companion 2014-09-14 02:19:42 +02:00
mhotar 2073a1f033 CZ translations - Radio 2014-09-14 01:17:52 +02:00
bsongis 563b817b46 Fixes #1656 2014-09-13 18:15:28 +02:00
bsongis 8b540a66f6 Companion compilation failure (missing files) 2014-09-13 15:50:24 +02:00
bsongis b0b7657756 Version and release notes updated 2014-09-13 15:45:08 +02:00
bsongis 74d22b623f LTR patch (modified) applied. Saves around 8-10k RAM during the
interpreter initialization
2014-09-13 15:41:52 +02:00
bsongis bee01d9999 Tests added to avoid doing anything in the Lua interpreter after a Lua
Panic
2014-09-13 13:11:05 +02:00
Bertrand Songis d2055edf62 Merge pull request #1712 from opentx/mhotar/CZ_chars_in_Inputs
No special characters in edit fields for CZ language, but enabled in int...
2014-09-13 09:11:13 +02:00
mhotar c926ac557b No special characters in edit fields for CZ language, but enabled in internally defined strings.
It fixes autogenerated Input names.
2014-09-13 01:26:49 +02:00
bsongis 3e2092e32f Revert some last changes so that there is no problem with Lua 2014-09-13 01:03:24 +02:00
bsongis 21054ffc54 Fixes #1675 2014-09-12 12:36:48 +02:00
Bertrand Songis 350ece0b60 Update DONATIONS.txt 2014-09-12 10:24:34 +02:00
bsongis 01a103f2e6 Mega2560 target didn't compile 2014-09-12 07:47:06 +02:00
Bertrand Songis 2e8e439d27 Update DONATIONS.txt 2014-09-11 15:47:25 +02:00
Bertrand Songis 98e6a3dc21 Update DONATIONS.txt 2014-09-11 13:25:47 +02:00
Andre Bernet 3b324d076a Release notes updated 2014-09-10 20:41:00 +02:00
Andre Bernet 91c922d5fb Wording / French translations 2014-09-10 20:27:43 +02:00
Andre Bernet eac918c2da SG switch warning was unreachable on Taranis 2014-09-10 20:13:26 +02:00
Andre Bernet b5f9c0ec84 On Taranis S3 was only hidden when the cursor was in the pot positions line 2014-09-10 20:05:50 +02:00
bsongis d1f54b099b Compilation failure 2014-09-10 20:04:41 +02:00
bsongis 7b98ad55c0 #1692 - We flush the queue instead of stopping the audio (the TADA sound
is cut otherwise)
2014-09-10 19:56:46 +02:00
bsongis d2cb7cb3dd Fixes #1697 2014-09-10 19:28:55 +02:00
bsongis be190b8bb1 Support for Lua dump files removed 2014-09-10 16:19:34 +02:00
bsongis 4b2c02b2c5 The Lua Wizard was broken in 2.0.11 2014-09-10 15:35:06 +02:00
bsongis 142d3fee1a Small alignment problem in protocols on 9X/9XR 2014-09-10 12:12:16 +02:00
bsongis 6a5e938ead Fixes #1692 2014-09-10 12:11:53 +02:00
bsongis 2d9ae108ff Fixes #1566 2014-09-10 12:07:14 +02:00
bsongis bae84e4e8c Navigation bug in protocol selection (9X/9XR only) 2014-09-10 11:51:39 +02:00
bsongis f4944eefdb Fixes the neutral value for PXX as described in #1694 2014-09-10 11:51:00 +02:00
bsongis 5d598cc6a1 Version and release notes updated 2014-09-10 11:32:36 +02:00
bsongis 945808d69b Fixes #1695 2014-09-10 11:32:36 +02:00
Bertrand Songis dbe512e45a Update DONATIONS.txt 2014-09-10 10:58:32 +02:00
bsongis 11efb5121e Fixes #1690 2014-09-10 08:16:57 +02:00
Bertrand Songis f6274f38aa Update DONATIONS.txt 2014-09-09 21:58:17 +02:00
Bertrand Songis cd1f20b8a0 Update DONATIONS.txt 2014-09-09 10:41:57 +02:00
Bertrand Songis e61b931ddb Update DONATIONS.txt 2014-09-09 07:13:13 +02:00
Andre Bernet a7a9b61234 Typo in release notes 2014-09-08 23:01:04 +02:00
bsongis 5ee95673d1 Release notes updated 2014-09-08 22:25:10 +02:00
bsongis 98c5b5e7bd Little display bug in DEBUG page 2014-09-08 22:25:10 +02:00
Bertrand Songis 6d434c0bf9 Update DONATIONS.txt 2014-09-07 21:52:42 +02:00
Bertrand Songis ade7151796 Update DONATIONS.txt 2014-09-07 20:35:50 +02:00
Bertrand Songis a7cd1f9aa0 Update DONATIONS.txt 2014-09-07 11:24:59 +02:00
bsongis cb2c922542 DONATIONS.txt updated 2014-09-05 17:58:40 +02:00
bsongis 8159a559da Release notes updated 2014-09-05 17:20:24 +02:00
bsongis ed826d8c62 [Sky9x] Linker error (no newlib-nano needed, no _sbrk) 2014-09-05 17:17:43 +02:00
bsongis b57f5ab2ce Added DEBUG information (thanks again projectkk2glider!) 2014-09-05 17:03:01 +02:00
bsongis 8fbafa6f05 Fixes #1643 - Thanks to projectkk2glider for his help on this one 2014-09-05 16:23:55 +02:00
Damjan Adamic 9243a59426 Removed lua_fields.txt 2014-09-03 23:33:59 +02:00
Damjan Adamic ccf66831c7 Fixes #1666: fixed bootloader 2014-09-03 23:32:03 +02:00
Damjan Adamic 06792b5696 Fixes #1666: Missing constructor calls for static objects 2014-09-03 23:03:25 +02:00
bsongis 6d4d871849 Various Lua fixes (thanks projectkk2glider!) 2014-09-02 20:53:19 +02:00
bsongis 5a634a7991 Fixes #1656 2014-09-01 09:43:02 +02:00
bsongis 69e504212e Copy/Paste error on second serial port Rx 2014-08-31 22:45:36 +02:00
bsongis 03e049c360 Fixes #1658 2014-08-29 23:05:24 +02:00
bsongis 4ca893da1f Fixes #1655 2014-08-29 15:54:28 +02:00
bsongis 66670cf713 Fixes #1646 2014-08-29 11:53:20 +02:00
bsongis 271bb4a82e Version and release notes updated 2014-08-29 11:46:20 +02:00
bsongis e0eab648ef Fixes #1651 2014-08-28 21:54:33 +02:00
bsongis 3235f43db9 Companion part for #1646
Conflicts:
	companion/src/modeledit/logicalswitches.cpp
2014-08-28 16:42:31 +02:00
bsongis c12b0cfebe Fixes #1650 2014-08-28 15:26:08 +02:00
bsongis 3e590d44f0 Fixes #1646 2014-08-28 15:16:20 +02:00
bsongis 1f6d1799af Fixes #1643 - no more freeze but now I have to understand why we go over
4k there
2014-08-27 23:44:07 +02:00
bsongis 8c813a87c9 Fixes #1635 2014-08-27 23:14:59 +02:00
bsongis 5bdeedbd0e [9X] Display problem of the battery range 2014-08-27 20:44:38 +02:00
bsongis e33f4cf415 Compilation error 2014-08-27 20:44:22 +02:00
bsongis 61d745011a [9XR-PRO] Telemetry fix 2014-08-27 20:44:11 +02:00
bsongis 3e269a04ae lua_fields.txt removed from git as it is automatically generated 2014-08-27 12:25:43 +02:00
bsongis 341feaf78f Fixes #1621 2014-08-27 10:21:55 +02:00
bsongis 19ddf6fc23 [Companion] Servos limits are displayed in us if ppmus option selected 2014-08-26 16:55:58 +02:00
bsongis 9b4b0d3c83 Fixes #1596 2014-08-26 09:01:19 +02:00
bsongis dc1eebf40d RSSI initialization added in google tests 2014-08-25 11:51:15 +02:00
bsongis 752e13b9ab Fixes #1617 2014-08-25 11:39:34 +02:00
bsongis b988bec5bd Fixes #1636 2014-08-25 11:27:46 +02:00
Damjan Adamic 3c72afed20 Fixes #1622: Lua function script not called for SF >= 8 2014-08-25 11:11:06 +02:00
Damjan Adamic e7586f47c3 Re #1547: commit 5949be30fa disabled delay for STICKY (which was wrong) now disabled for EDGE 2014-08-25 10:45:40 +02:00
Bertrand Songis f126b149f0 Merge pull request #1642 from opentx/1641_rx_number_with_DSM
Receiver number wasn't showing up for DSM (Fix #1641)
2014-08-24 23:45:50 +02:00
Andre Bernet 6b15c0c985 Receiver number wasn't showing up for DSM (Fix #1641) 2014-08-24 10:29:36 +02:00
Damjan Adamic db85f39ebc Added generation of Lua fields documentation file: lua_fields.txt 2014-08-21 10:07:39 +02:00
bsongis dee1e4ce8d Fixes #1612 2014-08-16 11:17:45 +02:00
bsongis df96504a85 SWR hidden on Taranis+ 2014-08-15 17:20:35 +02:00
Kjell Kernen 0112a1e3e9 Changed description of the master branch. The text from the next branch had ended up here. 2014-08-14 10:44:04 +02:00
bsongis 36481471a3 Fixes #1595 2014-08-13 11:37:03 +02:00
Bertrand Songis dd08886f2c Update DONATIONS.txt 2014-08-10 19:20:33 +02:00
Bertrand Songis 76ef4b5948 Update DONATIONS.txt 2014-08-10 19:19:41 +02:00
Bertrand Songis eaa247f46d Update DONATIONS.txt 2014-08-08 22:44:53 +02:00
bsongis 3ada9f7cf5 Companion PrintDialog bugfixes 2014-08-08 18:08:42 +02:00
bsongis 10a5e4dc89 Fixes #1527 2014-08-08 17:05:12 +02:00
bsongis 50e4850745 Fixes #1580 2014-08-08 16:29:13 +02:00
bsongis a92de216ac Fixes #1585 2014-08-08 11:48:03 +02:00
bsongis 3f3708f0f1 Fixes #1546
// TODO check if the vario / background music are stopped correctly if
switching to a model which doesn't have these functions enabled
2014-08-08 11:19:04 +02:00
Bertrand Songis 72c433ce9d Update DONATIONS.txt 2014-08-06 20:58:31 +02:00
Damjan Adamic f123b69521 Fixes #1548: bad Swedish Cell translation 2014-08-05 20:35:16 +02:00
Bertrand Songis 80369f0e8f Update DONATIONS.txt 2014-08-05 10:56:27 +02:00
Kjell Kernen 8cd67bf31e Swedish OpenTX translation updated 2014-08-05 10:38:24 +02:00
Kjell Kernen 34ef060e16 Swedish Companion translation updated 2014-08-05 10:24:09 +02:00
Bertrand Songis 1f07f88dce Update DONATIONS.txt 2014-08-04 14:32:05 +02:00
Bertrand Songis 4db5bdd486 Update DONATIONS.txt 2014-08-04 12:03:46 +02:00
bsongis 05ac0682f0 Fixes #1583 2014-08-04 12:02:50 +02:00
bsongis f12c3072b5 Fixes #1579 2014-08-04 11:54:35 +02:00
bsongis 35aea83c89 Fixes #1582 2014-08-04 11:38:39 +02:00
bsongis cf9b5d05a8 Fixes #1568 2014-08-04 11:29:35 +02:00
bsongis d5393be5cb Fixes #1584 2014-08-04 11:20:07 +02:00
Bertrand Songis 10c9936fa0 Merge pull request #1586 from opentx/projectkk2glider/issue_1567
Projectkk2glider/issue 1567
2014-08-04 11:08:00 +02:00
Bertrand Songis 7a74d3ac85 Update DONATIONS.txt 2014-08-04 10:57:23 +02:00
bsongis 39edaff669 Problems with S3 on Taranis (not plus) 2014-08-04 10:19:31 +02:00
bsongis c5aed5f79b Companion MAC compilation fix 2014-08-04 10:01:32 +02:00
bsongis 9b07a77e14 #1566 Companion conversion issue when importing Logical Switches with a
stick as v1 or v2 in previous EEPROM
2014-08-04 10:01:32 +02:00
Bertrand Songis 380fe5e44d Update DONATIONS.txt 2014-08-04 09:58:11 +02:00
Damjan Adamic 8bd2c120d6 Re #1567: cleanup 2014-08-03 19:27:02 +02:00
Damjan Adamic 741ef45f3e Re #1567:
introduced generateProcessUniqueTempFileName() which is used everywhere we need temporary file
renamed unlink() into qunlink()
fixed missing deletion of curve pngs in print dialog
2014-08-03 19:21:46 +02:00
Damjan Adamic 4103adf75d Re #1567: introduced unlink() function that takes QString parameter 2014-08-03 18:03:13 +02:00
Damjan Adamic c0e612531d Re #1567: writeBackup(): added PID to temporary file name 2014-08-03 17:38:24 +02:00
Damjan Adamic 55cb5dce87 Re #1567: readEeprom():
* added PID to temporary file name
 * better error message
 * temporary file deletion
2014-08-03 17:38:24 +02:00
Bertrand Songis 12ba27247e Update DONATIONS.txt 2014-08-02 09:41:10 +02:00
Bertrand Songis 1e33e99655 Update DONATIONS.txt 2014-08-01 07:43:31 +02:00
Damjan Adamic 50acd1fd92 Expanded non regression tests for #1569 2014-07-31 20:23:11 +02:00
bsongis c3626225aa Non regression tests for #1569 2014-07-31 17:24:10 +02:00
Bertrand Songis b71a96ed55 Update DONATIONS.txt 2014-07-31 16:43:23 +02:00
Bertrand Songis d2fcd544d8 Merge pull request #1576 from opentx/projectkk2glider/dirty_hack_issue_1569
Projectkk2glider/dirty hack issue 1569
2014-07-31 16:06:55 +02:00
Damjan Adamic 50997721e2 Using anas instead for getValue 2014-07-31 15:57:50 +02:00
Damjan Adamic 828372ab29 Fix for the case of extended trims
Code cleanup
2014-07-31 15:47:32 +02:00
Damjan Adamic 21ae270c0e Fixes #1569 2014-07-31 15:08:37 +02:00
bsongis 1b2efd1121 Fixes #1572 2014-07-31 11:26:05 +02:00
bsongis 8d6a7c9495 Simu name fixed 2014-07-31 11:22:41 +02:00
bsongis 189becfbb2 Fixes #1569 2014-07-31 11:22:18 +02:00
Bertrand Songis 5a19e147fd Update DONATIONS.txt 2014-07-30 07:45:00 +02:00
Bertrand Songis 062f93ae38 Update DONATIONS.txt 2014-07-28 23:41:37 +02:00
bsongis 9861a08150 Fixes #1562 2014-07-28 21:02:42 +02:00
Bertrand Songis de15d0a5a4 Update DONATIONS.txt 2014-07-28 18:54:56 +02:00
Andre Bernet 1e77bb3c02 French translations 2014-07-27 18:40:16 +02:00
bsongis adadbe06ad Fixes #1559 2014-07-27 17:37:39 +02:00
Andre Bernet 92f2c48de9 French translation fix 2014-07-27 17:31:06 +02:00
Bertrand Songis 1d4fa2a8b0 Update DONATIONS.txt 2014-07-26 22:27:25 +02:00
Bertrand Songis 5493776b9c Update DONATIONS.txt 2014-07-26 19:48:32 +02:00
bsongis b166b77c3e New french TTS prompts 2014-07-26 19:47:40 +02:00
Bertrand Songis 0ecb978364 Update DONATIONS.txt 2014-07-26 19:14:46 +02:00
Bertrand Songis c8d792d3d8 Merge pull request #1556 from opentx/driver33/PL_TR
TR fixes
2014-07-26 12:24:22 +02:00
Jacek Drewniak e9663e40e2 TR fixes 2014-07-26 11:51:23 +02:00
bsongis a7e906dea9 All other Off are uppercase! 2014-07-25 23:30:19 +02:00
Bertrand Songis 685ab3d101 Update DONATIONS.txt 2014-07-25 22:25:49 +02:00
Bertrand Songis 77564d74a4 Merge pull request #1554 from opentx/MicheleVilla/IT_translation_FW
Update it.h.txt
2014-07-25 19:38:14 +02:00
Bertrand Songis a0142d65be Update DONATIONS.txt 2014-07-25 19:29:08 +02:00
bsongis 662bf15562 Fixes #1555 2014-07-25 19:28:08 +02:00
Bertrand Songis 79b928af56 Update DONATIONS.txt 2014-07-25 17:10:32 +02:00
Bertrand Songis 8c28f4bc48 Update DONATIONS.txt 2014-07-25 15:06:16 +02:00
bsongis 7a4d6c89a1 2.0.9 preparation 2014-07-25 12:05:34 +02:00
bsongis 38347becca Cosmetics 2014-07-25 12:05:34 +02:00
Michele 49036dbb40 Update it.h.txt
One change in Italian translation
2014-07-25 11:58:05 +02:00
Bertrand Songis abf36de157 Update DONATIONS.txt 2014-07-25 08:41:56 +02:00
bsongis 32afbf5a5a Fixes #1552 2014-07-25 08:39:41 +02:00
bsongis cba4a02cc1 Fixes #1551 2014-07-25 07:31:58 +02:00
bsongis 4062555605 FAI option tooltip updated (too many users select it without knowing
what it means)
2014-07-24 21:02:15 +02:00
bsongis 9cb38ce839 Companion default firmware is now OpenTX for Taranis 2014-07-24 20:51:31 +02:00
Bertrand Songis 905090ef09 Update DONATIONS.txt 2014-07-24 14:44:59 +02:00
Bertrand Songis 62e5820082 Update DONATIONS.txt 2014-07-24 12:07:18 +02:00
bsongis 2d21e16201 In Companion Wizard, Delta Wing has now 50% weight on elevons (as in
OpenTX Wizard)
2014-07-23 19:19:10 +02:00
bsongis 07303f4301 Taranis calibration better fix 2014-07-23 18:23:24 +02:00
bsongis 91228f803c snprintf undefined on VC++ 2014-07-23 18:02:46 +02:00
bsongis e5d7e1f7c2 Taranis calibration bug 2014-07-23 17:55:02 +02:00
bsongis 81573537eb Fixes #1549 2014-07-23 17:09:55 +02:00
bsongis 7a85328b86 #1549 (Firmware part) 2014-07-23 17:05:14 +02:00
bsongis fd84c62ff4 Dead code removed 2014-07-23 16:31:20 +02:00
bsongis 13e0b21656 The firmware should compile correctly on Windows now 2014-07-23 15:55:27 +02:00
bsongis 5949be30fa Fixes #1547 2014-07-23 15:46:51 +02:00
bsongis 0117c2da68 Fixes #1259 2014-07-23 15:15:26 +02:00
bsongis 943f70c599 OpenTX 2.0.8 preparation 2014-07-22 17:27:33 +02:00
Bertrand Songis 52a48fc4b1 Update DONATIONS.txt 2014-07-22 17:04:17 +02:00
Damjan Adamic 2712ffabb0 Re #1486: gtest improvements in Lua section 2014-07-22 11:39:36 +02:00
Bertrand Songis fa8c8a7094 Update DONATIONS.txt 2014-07-22 07:44:49 +02:00
bsongis 5907193571 Fixes #1543 2014-07-21 23:21:35 +02:00
bsongis 45abfb872f Fixes #1486 2014-07-21 22:25:55 +02:00
bsongis 4d5962b15b Fixes #1533 2014-07-21 20:41:57 +02:00
bsongis eea1c3a84c SAFETY renamed to OVERRIDE 2014-07-21 20:38:44 +02:00
bsongis deed7fc20f Curve index is correctly resetted when its type is changed 2014-07-21 20:23:56 +02:00
bsongis 62fca3f8b6 Fixes #1534 2014-07-21 20:09:39 +02:00
bsongis 9377e58407 Change Lua field name from vario-speed to vertical-speed 2014-07-21 19:22:40 +02:00
bsongis 9b53f69038 Fixes #1535 2014-07-21 19:15:24 +02:00
Bertrand Songis 3680149b52 Merge pull request #1529 from opentx/projectkk2glider/lua_constants_issue_1480
Projectkk2glider/lua constants issue 1480
2014-07-21 19:12:06 +02:00
Bertrand Songis 93faeeafbe Update DONATIONS.txt 2014-07-21 18:34:39 +02:00
Damjan Adamic 2d5d1cb357 Re #1480: couple corrections of field names 2014-07-21 12:04:08 +02:00
Damjan Adamic 2a5364dc8c Re #1480: wrong field.id for multiple fields 2014-07-21 11:51:30 +02:00
bsongis 7f47a4fe10 Fixes #1542 2014-07-20 18:51:24 +02:00
Bertrand Songis a0cc428228 Update DONATIONS.txt 2014-07-19 13:15:16 +02:00
Andre Bernet 61985f7d6a All companion translation files updated 2014-07-19 12:26:49 +02:00
Andre Bernet 3baf64f123 French translations 2014-07-19 12:26:10 +02:00
Andre Bernet 4fd40c154e Rename of "SafetyCH" to "OverrideCH" was not done in companion - UPDATE SERVER SCRIPT! 2014-07-19 12:22:32 +02:00
Andre Bernet 3c360618b9 nosafetych option was duplicated for 9x 2014-07-19 12:19:07 +02:00
Andre Bernet 1d96731ad5 Typo 2014-07-19 12:09:34 +02:00
Andre Bernet 9d1d31d26a lupdate-qt4 is just lupdate on Win 2014-07-19 12:09:04 +02:00
Bertrand Songis 0b52ccfaf1 Update DONATIONS.txt 2014-07-19 07:41:55 +02:00
bsongis 484566083e A little refactoring to avoid all the sprintf and too many string
comparaisons. Completely untested
2014-07-18 22:13:02 +02:00
Bertrand Songis 0f33dc6113 Update DONATIONS.txt 2014-07-18 18:49:59 +02:00
Damjan Adamic 7f3778fc3c Re #1480: units updated 2014-07-18 10:41:16 +02:00
Damjan Adamic 0a9dcc5ce6 Re #1480: added TELEM_MAX_ASPEED conversion in luaGetValueAndPush() 2014-07-18 10:41:16 +02:00
Damjan Adamic 2f01f139cc Re #1480: Cosmetics 2014-07-18 09:07:36 +02:00
Damjan Adamic fb3e615008 Fixes #1480: How to handle the increasing number of Lua constants 2014-07-18 08:59:38 +02:00
Bertrand Songis ce6d0807fa Update DONATIONS.txt 2014-07-17 23:14:29 +02:00
Bertrand Songis cab8f3db71 Update DONATIONS.txt 2014-07-17 08:53:18 +02:00
bsongis 399a8b2e35 Fixes #1517 2014-07-16 20:27:05 +02:00
192 changed files with 28289 additions and 21943 deletions
+115
View File
@@ -525,3 +525,118 @@ Adilson Oliveira
Joseph Ordille
Michael Shellim
Teddie Holmes
Alexandre Rault
Eric Albin
Lukas Kliment
Bernard Philippe
Bernard Delpy
Didier Klein
Arnaldo Guedes
Cyberauto Systems
John Alsbrooks
John Kearney
Christopher Borden
Marc Virgilio Ricci
Frederick Davie
Jürgen Enders
Terrence Pitts
Thomas Sandner
Marco Coltorti
Harald Wilczak
Rodney Lorimor
Richard Davis
Stephen Palmer
Michael Napolitan
Joshua Bardwell
Fred Dawson
Jim Wagner
Peter Johnson
Fredrik Lewerth
Arvin Stenersen
Daniel Morgan
Roy Nixon
Joachim Blunck
Karl-Heinz Gansel
Monrovia Mountain Enterprises
Alessandro Villa
Jan-Åke Nilsson
Matthias Rei
DVR Solutions BV
Bertrand Condevaux Lanloy
Henri Mirra
Aurélien Planiol
Kevin Caldwell
Andrew Garello
Tomasz Maziarz
Russell Flack
Fernando Rimoldi
Greg Reid
Dietmar Drees
Holger Landwehr
Arno Loehdorf
Boon Sripattha
Patrik Åkerfeldt
Alonzo Fretwell
Renjith Chandrasekharan
Ruben Gomez Hernandez
Michael Gardner
Judith Green
Timo Ruppell
John Lipscomb
Norbert Wenke
Erik Frieberg
Raimo Ruotsalainen
Brian Harris
Sebastian Blüml
Efisio Maxia
Jeff Theobald
Anthony Rizzo
Rodney Huddleston
Dietmar Drees
Jürgen Monden
David Morgan
Andrew Fernie
Michel Baily
Donald Burke
Ronald Donker
Fredie Singh
Patrizio Simoncini (monthly)
Harald Gabler
Michael Brown
Julien Gérard
Alexandre d'Alton
Peter Mergaerts
Jan Houwers
Gordon Stahl
Christian Grandjean
Roger Bergevin
NorthSide
Sigmund Martinsen
Lionel Lafraise
Gisli Ofeigsson
The Gruvin9x Project
Manuel McLure
Fernando Rimoldi
Hiltenkamp Stephan
Sandeep Kishore Jain
Sebastien Charpentier
Greg Parker
Norman Maaß
Adriano Del Ben
Justin Poole
Kenneth Harrison
Eugene LaFaille
John O'Shaughnessy
Uwe Jordt
Stuart Olson
Frédéric Devillard
Cheung Leo
Peter Webster
Jean-Claude Bachetta
Delfin Perena
Sae-wook Yoon
Focus on Excellence
Jeffery Golias
Nick Milton
Paul Zasso
Reidar Johannes Lillebotn
+3 -4
View File
@@ -1,8 +1,7 @@
##OpenTX Next Branch
##OpenTX Master Branch
You have found your way to the GitHub repository site for the OpenTX Next Branch. This code branch holds the source code for the ongoing development.
You have found your way to the GitHub repository site for the OpenTX Master Branch. This code branch holds the source code for the latest stable release.
The stable release code is not here, it is in the master branch.
Under no circumstances build and use software from this branch for real world application. At times you will be more or less guaranteed to crash your plane and destroy all your model settings.
The ongoing development is not done in this branch. It is performed in the branch called next.
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
+40
View File
@@ -1,3 +1,43 @@
<h2>Version 2.0.13 / 2014-11-20</h2>
<ul>
<li>Too many curves shown on non ARM boards</li>
<li>Fixed vario limits</li>
<li>Fixes in compare dialog</li>
<li>Fixed receiver number range</li>
<li>Virtual inputs not selectable in SF Volume and heli Collective Source</li>
<li>Joystick calibration crash after channel assignment</li>
<li>Gvar import error for limits</li>
<li>Companion shows too many curve types in input/mixer for 9x</li>
<li>NOT curves removed from inputs (for non ARM platforms)</li>
<li>Companion again builds on OS X (Mac)</li>
<li>Companion simulator Lua crash on OS X 64bit (Mac)</li>
<li>Companion didn't take care of PlayScript functions</li>
</ul>
<h2>Version 2.0.12 / 2014-09-15</h2>
<ul>
<li>Typos & Translations updated</li>
</ul>
<h2>Version 2.0.11 / 2014-09-10</h2>
<ul>
<li>Limits EEPROM export was broken (all boards except Taranis)</li>
<li>Fix issue when a GVAR was used as Offset</li>
</ul>
<h2>Version 2.0.10 / 2014-09-08</h2>
<ul>
<li>Taranis is now the default board in General Settings</li>
<li>GVARS allowed in Limits min/max/offset</li>
<li>Limits displayed in us when ppmus option selected
</ul>
<h2>Version 2.0.8 / 2014-07-23</h2>
<ul>
<li>Compare dialog bugfixes</li>
<li>Curve index correctly resetted when type changed</li>
</ul>
<h2>Version 2.0.7</h2>
<ul>
<li>SafetyCH function was missing in simulator</li>
+22 -3
View File
@@ -2,7 +2,7 @@ PROJECT( companion )
SET( C9X_VERSION_MAJOR "2" )
SET( C9X_VERSION_MINOR "0" )
SET( C9X_VERSION_REVISION "7" )
SET( C9X_VERSION_REVISION "13" )
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
@@ -87,6 +87,13 @@ add_custom_command(
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
add_custom_command(
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
COMMAND make PCB=TARANIS lua_exports.cpp
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/../..
@@ -112,6 +119,7 @@ set(common_SRCS
firmwares/ersky9x/ersky9xinterface.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
${RADIO_SRC_DIRECTORY}/lua_exports.inc
firmwares/opentx/opentxeeprom.cpp
firmwares/opentx/open9xStockeeprom.cpp
firmwares/opentx/open9xGruvin9xeeprom.cpp
@@ -312,6 +320,7 @@ set(simu_SRCS
${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
${RADIO_SRC_DIRECTORY}/translations/en.h
${RADIO_SRC_DIRECTORY}/lua_exports.inc
modeledit/node.cpp
modeledit/edge.cpp # TODO not needed
simulator.cpp
@@ -329,7 +338,11 @@ if(WIN32)
set(simu_SRCS ${simu_SRCS} icon.rc)
endif()
add_executable(simulator WIN32 ${simu_SRCS})
if(APPLE)
add_executable(simulator MACOSX_BUNDLE ${simu_SRCS})
else()
add_executable(simulator WIN32 ${simu_SRCS})
endif()
if(SDL_FOUND)
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
@@ -418,9 +431,15 @@ ADD_CUSTOM_TARGET( stamp
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
ADD_CUSTOM_TARGET( translations
IF(WIN32)
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
ELSE( )
ADD_CUSTOM_TARGET( translations
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND lupdate-qt4 ${CMAKE_SOURCE_DIR} -ts ${companion_TS} )
ENDIF( )
SET(CPACK_PACKAGE_NAME "COMPANION")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
+2 -2
View File
@@ -156,11 +156,11 @@ void avrOutputDialog::doCopy()
dest.close();
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.errorString());
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.fileName() + ", " + tr("reason") + ": " + dest.errorString());
}
}
else {
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.errorString());
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.fileName() + ", " + tr("reason") + ": " + source.errorString());
}
source.close();
+2 -4
View File
@@ -354,10 +354,8 @@ void burnConfigDialog::restFuses(bool eeProtect)
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
}
else {
QString tempDir = QDir::tempPath();
QString tempFile;
QString lfuses;
tempFile = tempDir + "/ftemp.bin";
QString tempFile = generateProcessUniqueTempFileName("ftemp.bin");
QStringList argread;
argread << "-c" << avrProgrammer << "-p" << avrMCU << args <<"-U" << "lfuse:r:"+tempFile+":r" ;
avrOutputDialog *ad = new avrOutputDialog(this, avrLoc, argread, "Reset Fuses",AVR_DIALOG_CLOSE_IF_SUCCESSFUL,FALSE);
@@ -376,7 +374,7 @@ void burnConfigDialog::restFuses(bool eeProtect)
lfuses="lfuse:w:0x3F:m";
}
file.close();
unlink(tempFile.toAscii());
qunlink(tempFile);
}
else {
lfuses="lfuse:w:0x3F:m";
+3 -5
View File
@@ -418,12 +418,11 @@ void burnDialog::on_BurnFlashButton_clicked()
image = pixmap->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
}
if (!image.isNull()) {
QString tempDir = QDir::tempPath();
QString tempFile;
if (getFileType(fileName) == FILE_TYPE_HEX)
tempFile = tempDir + "/flash.hex";
tempFile = generateProcessUniqueTempFileName("flash.hex");
else
tempFile = tempDir + "/flash.bin";
tempFile = generateProcessUniqueTempFileName("flash.bin");
FlashInterface flash(fileName);
flash.setSplash(image);
if (flash.saveFlash(tempFile) > 0) {
@@ -556,8 +555,7 @@ void burnDialog::on_BurnFlashButton_clicked()
}
if (patch) {
QString tempDir = QDir::tempPath();
QString fileName = tempDir + "/temp.bin";
QString fileName = generateProcessUniqueTempFileName("temp.bin");
QFile file(fileName);
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
+15 -30
View File
@@ -156,16 +156,12 @@ void CompareDialog::dropEvent(QDropEvent *event)
void CompareDialog::closeEvent(QCloseEvent *event)
{
QByteArray ba = curvefile5.toLatin1();
char *name = ba.data();
unlink(name);
ba = curvefile9.toLatin1();
name = ba.data();
unlink(name);
}
CompareDialog::~CompareDialog()
{
qunlink(curvefile5);
qunlink(curvefile9);
delete ui;
}
@@ -260,13 +256,10 @@ void CompareDialog::printSetup()
str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].polarityToString(), color));
color=getColor1(g_model1->thrTrim,g_model2->thrTrim);
str.append(fv(tr("Throttle Trim"), g_model1->thrTrim ? tr("Enabled") : tr("Disabled"), color));
color=getColor1(g_model1->thrExpo,g_model2->thrExpo);
str.append(fv(tr("Throttle Expo"), g_model1->thrExpo ? tr("Enabled") : tr("Disabled"),color));
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
color=getColor1(getTrimInc(g_model1),getTrimInc(g_model2));
str.append(fv(tr("Trim Increment"), getTrimInc(g_model1),color));
color=getColor1(getCenterBeep(g_model1),getCenterBeep(g_model2));
str.append(fv(tr("Center Beep"), getCenterBeep(g_model1),color)); // specify which channels beep
color = getColor1(getCenterBeepStr(g_model1), getCenterBeepStr(g_model2));
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model1), color)); // specify which channels beep
str.append("</table></td>");
str.append("<td><table border=0 cellspacing=0 cellpadding=3 width=\"50%\">");
color=getColor2(g_model1->name,g_model2->name);
@@ -283,13 +276,10 @@ void CompareDialog::printSetup()
str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].polarityToString(), color));
color=getColor2(g_model1->thrTrim,g_model2->thrTrim);
str.append(fv(tr("Throttle Trim"), g_model2->thrTrim ? tr("Enabled") : tr("Disabled"), color));
color=getColor2(g_model1->thrExpo,g_model2->thrExpo);
str.append(fv(tr("Throttle Expo"), g_model2->thrExpo ? tr("Enabled") : tr("Disabled"),color));
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
color=getColor2(getTrimInc(g_model1),getTrimInc(g_model2));
str.append(fv(tr("Trim Increment"), getTrimInc(g_model2),color));
color=getColor2(getCenterBeep(g_model1),getCenterBeep(g_model2));
str.append(fv(tr("Center Beep"), getCenterBeep(g_model2),color)); // specify which channels beep
color = getColor2(getCenterBeepStr(g_model1),getCenterBeepStr(g_model2));
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model2), color)); // specify which channels beep
str.append("</td></tr></table></td></tr></table>");
te->append(str);
}
@@ -506,11 +496,11 @@ void CompareDialog::printLimits()
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
}
color=getColor1(g_model1->limitData[i].offset,g_model2->limitData[i].offset);
str.append(doTR(QString::number((qreal)g_model1->limitData[i].offset/10, 'f', 1),color));
str.append(doTR(g_model1->limitData[i].offsetToString(), color));
color=getColor1(g_model1->limitData[i].min,g_model2->limitData[i].min);
str.append(doTR(QString::number(g_model1->limitData[i].min),color));
str.append(doTR(g_model1->limitData[i].minToString(), color));
color=getColor1(g_model1->limitData[i].max,g_model2->limitData[i].max);
str.append(doTR(QString::number(g_model1->limitData[i].max),color));
str.append(doTR(g_model1->limitData[i].maxToString(), color));
color=getColor1(g_model1->limitData[i].revert,g_model2->limitData[i].revert);
str.append(doTR(QString(g_model1->limitData[i].revert ? tr("INV") : tr("NOR")),color));
str.append("</tr>");
@@ -533,11 +523,11 @@ void CompareDialog::printLimits()
str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true));
}
color=getColor2(g_model1->limitData[i].offset,g_model2->limitData[i].offset);
str.append(doTR(QString::number((qreal)g_model2->limitData[i].offset/10, 'f', 1),color));
str.append(doTR(g_model2->limitData[i].offsetToString(), color));
color=getColor2(g_model1->limitData[i].min,g_model2->limitData[i].min);
str.append(doTR(QString::number(g_model2->limitData[i].min),color));
str.append(doTR(g_model2->limitData[i].minToString(), color));
color=getColor2(g_model1->limitData[i].max,g_model2->limitData[i].max);
str.append(doTR(QString::number(g_model2->limitData[i].max),color));
str.append(doTR(g_model2->limitData[i].maxToString(), color));
color=getColor2(g_model1->limitData[i].revert,g_model2->limitData[i].revert);
str.append(doTR(QString(g_model2->limitData[i].revert ? tr("INV") : tr("NOR")),color));
str.append("</tr>");
@@ -807,7 +797,7 @@ void CompareDialog::printMixers()
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
if (md->carryTrim) str += " " + tr("noTrim");
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
str += md->curve.toString().replace("<", "&lt;").replace(">", "&gt;");
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
@@ -885,8 +875,7 @@ void CompareDialog::printMixers()
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
if (md->carryTrim) str += " " + tr("noTrim");
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
// TODO if (md->differential) str += " "+ tr("Diff") + QString(" (%1%)").arg(getGVarString(md->differential));
// TODO if (md->curve) str += " " + tr("Curve") + QString("(%1)").arg(getCurveStr(md->curve).replace("<", "&lt;").replace(">", "&gt;"));
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
@@ -1032,11 +1021,7 @@ void CompareDialog::printSwitches()
str.append("<tr>");
color=getColor1(sw1,sw2);
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw1+"</font></td>");
if (i<9) {
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+QString("%1</b></td>").arg(i+1));
} else {
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+('A'+(i-9))+"</b></td>");
}
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("L%1").arg(i+1)+QString("</b></td>"));
color=getColor2(sw1,sw2);
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw2+"</font></td>");
str.append("</tr>");
+17 -4
View File
@@ -505,7 +505,7 @@ class ConversionTable {
{
after = 0;
for (std::list<ConversionTuple>::iterator it=internalTable.begin(); it!=internalTable.end(); it++) {
for (std::list<ConversionTuple>::iterator it=exportTable.begin(); it!=exportTable.end(); it++) {
ConversionTuple tuple = *it;
if (before == tuple.a) {
after = tuple.b;
@@ -520,7 +520,7 @@ class ConversionTable {
{
after = 0;
for (std::list<ConversionTuple>::iterator it=internalTable.begin(); it!=internalTable.end(); it++) {
for (std::list<ConversionTuple>::iterator it=importTable.begin(); it!=importTable.end(); it++) {
ConversionTuple tuple = *it;
if (before == tuple.b) {
after = tuple.a;
@@ -547,10 +547,23 @@ class ConversionTable {
void addConversion(const int a, const int b)
{
internalTable.push_back(ConversionTuple(a, b));
ConversionTuple conversion(a, b);
importTable.push_back(conversion);
exportTable.push_back(conversion);
}
std::list<ConversionTuple> internalTable;
void addImportConversion(const int a, const int b)
{
importTable.push_back(ConversionTuple(a, b));
}
void addExportConversion(const int a, const int b)
{
exportTable.push_back(ConversionTuple(a, b));
}
std::list<ConversionTuple> importTable;
std::list<ConversionTuple> exportTable;
};
template<class T>
+30 -6
View File
@@ -301,7 +301,7 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
break;
default:
result.max = (model.extendedLimits ? 125 : 100);
result.max = model.getChannelsMax(true);
result.min = -result.max;
break;
}
@@ -460,7 +460,7 @@ QString RawSwitch::toString()
};
static const QString timerModes[] = {
QObject::tr("OFF"), QObject::tr("ABS"),
QObject::tr("OFF"), QObject::tr("ON"),
QObject::tr("THs"), QObject::tr("TH%"), QObject::tr("THt")
};
@@ -723,8 +723,8 @@ void FuncSwData::clear()
QString FuncSwData::funcToString()
{
ModelData model;
if (func >= FuncSafetyCh1 && func <= FuncSafetyCh32)
return QObject::tr("Safety %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
else if (func == FuncTrainer)
return QObject::tr("Trainer");
else if (func == FuncTrainerRUD)
@@ -753,6 +753,8 @@ QString FuncSwData::funcToString()
return QObject::tr("Play Both");
else if (func == FuncPlayValue)
return QObject::tr("Play Value");
else if (func == FuncPlayScript)
return QObject::tr("Play Script");
else if (func == FuncLogs)
return QObject::tr("Start Logs");
else if (func == FuncVolume)
@@ -851,6 +853,28 @@ QString FuncSwData::repeatToString()
}
}
QString LimitData::minToString()
{
return QString::number((qreal)min/10);
}
QString LimitData::maxToString()
{
return QString::number((qreal)max/10);
}
QString LimitData::offsetToString()
{
return QString::number((qreal)offset/10, 'f', 1);
}
void LimitData::clear()
{
memset(this, 0, sizeof(LimitData));
min = -1000;
max = +1000;
}
GeneralSettings::GeneralSettings()
{
memset(this, 0, sizeof(GeneralSettings));
@@ -1287,9 +1311,9 @@ ModelData ModelData::removeGlobalVars()
return result;
}
int ModelData::getChannelsMax()
int ModelData::getChannelsMax(bool forceExtendedLimits) const
{
if (extendedLimits)
if (forceExtendedLimits || extendedLimits)
return IS_TARANIS(GetCurrentFirmware()->getBoard()) ? 150 : 125;
else
return 100;
+14 -7
View File
@@ -526,6 +526,8 @@ class GeneralSettings {
int temperatureCalib;
int temperatureWarn;
unsigned int mAhWarn;
unsigned int mAhUsed;
unsigned int globalTimer;
unsigned int btBaudrate;
unsigned int sticksGain;
unsigned int rotarySteps;
@@ -631,7 +633,10 @@ class LimitData {
bool symetrical;
char name[6+1];
CurveReference curve;
void clear() { memset(this, 0, sizeof(LimitData)); min = -1000; max = +1000; }
QString minToString();
QString maxToString();
QString offsetToString();
void clear();
};
enum MltpxValue {
@@ -722,8 +727,8 @@ class LogicalSwitchData { // Logical Switches data
};
enum AssignFunc {
FuncSafetyCh1 = 0,
FuncSafetyCh32 = FuncSafetyCh1+C9X_NUM_CHNOUT-1,
FuncOverrideCH1 = 0,
FuncOverrideCH32 = FuncOverrideCH1+C9X_NUM_CHNOUT-1,
FuncTrainer,
FuncTrainerRUD,
FuncTrainerELE,
@@ -739,6 +744,7 @@ enum AssignFunc {
FuncPlayPrompt,
FuncPlayBoth,
FuncPlayValue,
FuncPlayScript,
FuncLogs,
FuncVolume,
FuncBacklight,
@@ -752,7 +758,7 @@ enum AssignFunc {
class FuncSwData { // Function Switches data
public:
FuncSwData(AssignFunc func=FuncSafetyCh1) { clear(); this->func = func; }
FuncSwData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
RawSwitch swtch;
AssignFunc func;
int param;
@@ -916,7 +922,6 @@ class TimerData {
RawSwitch mode;
bool minuteBeep;
unsigned int countdownBeep;
bool dir; // 0=>Count Down, 1=>Count Up
unsigned int val;
unsigned int persistent;
int pvalue;
@@ -983,7 +988,6 @@ class ModelData {
char name[12+1];
TimerData timers[2];
bool thrTrim; // Enable Throttle Trim
bool thrExpo; // Enable Throttle Expo
int trimInc; // Trim Increments
bool disableThrottleWarning;
@@ -1042,7 +1046,7 @@ class ModelData {
void clearMixes();
void clearInputs();
int getChannelsMax();
int getChannelsMax(bool forceExtendedLimits=false) const;
protected:
void removeGlobalVar(int & var);
@@ -1128,6 +1132,7 @@ enum Capability {
HasSoundMixer,
NumModules,
PPMCenter,
PPMUnitMicroseconds,
SYMLimits,
HasCurrentCalibration,
HasVolume,
@@ -1154,6 +1159,8 @@ enum Capability {
MultiposPotsPositions,
SimulatorVariant,
MavlinkTelemetry,
HasInputDiff,
HasMixerExpo,
};
class SimulatorInterface;
+2 -4
View File
@@ -138,8 +138,8 @@ t_Er9xLimitData::t_Er9xLimitData()
t_Er9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -358,7 +358,6 @@ t_Er9xModelData::operator ModelData ()
c9x.used = true;
getEEPROMString(c9x.name, name, sizeof(name));
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
c9x.timers[0].dir = tmrDir;
c9x.timers[0].val = tmrVal;
switch(protocol) {
case 1:
@@ -377,7 +376,6 @@ t_Er9xModelData::operator ModelData ()
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
@@ -147,8 +147,8 @@ t_Ersky9xLimitData::t_Ersky9xLimitData()
t_Ersky9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -489,7 +489,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
getEEPROMString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++) {
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
c9x.timers[i].dir = timer[i].tmrDir;
c9x.timers[i].val = timer[i].tmrVal;
}
switch(protocol) {
@@ -509,7 +508,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
@@ -607,7 +605,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
getEEPROMString(c9x.name, name, sizeof(name));
for (int i=0; i<2; i++) {
c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA);
c9x.timers[i].dir = timer[i].tmrDir;
c9x.timers[i].val = timer[i].tmrVal;
}
switch(protocol) {
@@ -627,7 +624,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
@@ -201,8 +201,8 @@ t_Gruvin9xLimitData::t_Gruvin9xLimitData()
t_Gruvin9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -378,7 +378,6 @@ t_Gruvin9xTimerData::operator TimerData ()
TimerData c9x;
c9x.mode = getEr9xTimerMode(mode);
c9x.val = val;
c9x.dir = dir;
return c9x;
}
@@ -447,7 +446,6 @@ t_Gruvin9xModelData_v102::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -518,7 +516,6 @@ t_Gruvin9xModelData_v103::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -589,7 +586,6 @@ t_Gruvin9xModelData_v105::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -680,7 +676,6 @@ t_Gruvin9xModelData_v106::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -138,7 +138,6 @@ t_Open9xArmTimerData_v202::operator TimerData ()
*/
c9x.val = val;
c9x.persistent = false;
c9x.dir = (val == 0);
return c9x;
}
@@ -577,7 +576,7 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
FuncSwData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
if (c9x.func <= FuncSafetyCh32) {
if (c9x.func <= FuncOverrideCH32) {
c9x.enabled=param & 0x01;
c9x.param = (param>>1)<<1;
}
@@ -129,8 +129,8 @@ t_Open9xExpoData_v211::operator ExpoData ()
t_Open9xLimitData_v201::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -139,8 +139,8 @@ t_Open9xLimitData_v201::operator LimitData ()
t_Open9xLimitData_v211::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
c9x.symetrical=symetrical;
@@ -573,8 +573,8 @@ t_Open9xFuncSwData_v201::operator FuncSwData ()
}
enum Functions {
FUNC_SAFETY_CH1,
FUNC_SAFETY_CH16=FUNC_SAFETY_CH1+15,
FUNC_OVERRIDE_CH1,
FUNC_OVERRIDE_CH16=FUNC_OVERRIDE_CH1+15,
FUNC_TRAINER,
FUNC_TRAINER_RUD,
FUNC_TRAINER_ELE,
@@ -704,7 +704,6 @@ t_Open9xTimerData_v201::operator TimerData ()
// c9x.mode = TMRMODE_OFF;
c9x.val = val;
c9x.persistent = persistent;
c9x.dir = dir;
return c9x;
}
@@ -725,7 +724,6 @@ t_Open9xTimerData_v202::operator TimerData ()
*/
c9x.val = val;
c9x.persistent = false;
c9x.dir = (val == 0);
return c9x;
}
@@ -939,7 +937,6 @@ t_Open9xModelData_v201::operator ModelData ()
}
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc - 2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.beepANACenter = beepANACenter;
@@ -48,7 +48,7 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define SAFETY_CHANNEL_FUNCTION
#define OVERRIDE_CHANNEL_FUNCTION
#define EEPROM_VARIANT 3
@@ -48,7 +48,7 @@
#define FRSKY_STICKS
#define DSM2
#define DSM2_PPM
#define SAFETY_CHANNEL_FUNCTION
#define OVERRIDE_CHANNEL_FUNCTION
#define EEPROM_VARIANT SIMU_M128_VARIANTS
#define GAUGES
@@ -50,7 +50,7 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define SAFETY_CHANNEL_FUNCTION
#define OVERRIDE_CHANNEL_FUNCTION
#define FAS_OFFSET
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
@@ -54,7 +54,7 @@
#define GPS
#define FAI_CHOICE
#define FRSKY_STICKS
#define SAFETY_CHANNEL_FUNCTION
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 3
#define EEPROM_VARIANT 3
@@ -54,7 +54,7 @@
#define EEPROM_VARIANT 3
#define HAPTIC
#define REVPLUS
#define SAFETY_CHANNEL_FUNCTION
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 5
@@ -149,6 +149,7 @@ inline int geteepromsize() {
#include "radio/src/lua/src/lstate.c"
#include "radio/src/lua/src/lstring.c"
#include "radio/src/lua/src/ltable.c"
#include "radio/src/lua/src/lrotable.c"
#include "radio/src/lua/src/ltm.c"
#include "radio/src/lua/src/lundump.c"
#include "radio/src/lua/src/lvm.c"
@@ -156,6 +157,7 @@ inline int geteepromsize() {
#include "radio/src/lua/src/lbaselib.c"
#include "radio/src/lua/src/linit.c"
#include "radio/src/lua/src/lmathlib.c"
#include "radio/src/lua/src/lbitlib.c"
#include "radio/src/lua/src/loadlib.c"
#include "radio/src/lua/src/lauxlib.c"
#include "radio/src/lua/src/ltablib.c"
+127 -37
View File
@@ -40,11 +40,11 @@ inline int switchIndex(int i, BoardEnum board, unsigned int version)
class SwitchesConversionTable: public ConversionTable {
public:
SwitchesConversionTable(BoardEnum board, unsigned int version, unsigned long flags=0)
SwitchesConversionTable(BoardEnum board, unsigned int version, bool timer=false)
{
int val=0;
int offset=0;
if (flags & POPULATE_TIMER_MODES) {
if (timer) {
offset = 4;
for (int i=0; i<5; i++) {
addConversion(RawSwitch(SWITCH_TYPE_TIMER_MODE, i), val++);
@@ -56,8 +56,15 @@ class SwitchesConversionTable: public ConversionTable {
for (int i=1; i<=MAX_SWITCHES_POSITION(board); i++) {
int s = switchIndex(i, board, version);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val);
if (IS_TARANIS(board) && s>=21/*SHup/SHdown*/) {
addImportConversion(RawSwitch(SWITCH_TYPE_SWITCH, 21+22-s), -val+offset);
addExportConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
}
else {
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val+offset);
}
val++;
}
if (IS_TARANIS(board) && version >= 216) {
@@ -86,17 +93,15 @@ class SwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
}
if (!(flags & POPULATE_TIMER_MODES)) {
addConversion(RawSwitch(SWITCH_TYPE_OFF), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ON), val++);
if (version >= 216) {
addConversion(RawSwitch(SWITCH_TYPE_ONE, -1), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ONE, 1), val++);
if (IS_ARM(board)) {
for (int i=1; i<=MAX_FLIGHT_MODES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i), val++);
}
addConversion(RawSwitch(SWITCH_TYPE_OFF), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ON), val++);
if (version >= 216) {
addConversion(RawSwitch(SWITCH_TYPE_ONE, -1), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ONE, 1), val++);
if (IS_ARM(board)) {
for (int i=1; i<=MAX_FLIGHT_MODES(board, version); i++) {
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, -i), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i), val++);
}
}
}
@@ -124,6 +129,16 @@ class SwitchesConversionTable: public ConversionTable {
ConversionTable::addConversion(sw.toValue(), b);
}
void addImportConversion(const RawSwitch & sw, const int b)
{
ConversionTable::addImportConversion(sw.toValue(), b);
}
void addExportConversion(const RawSwitch & sw, const int b)
{
ConversionTable::addExportConversion(sw.toValue(), b);
}
class Cache {
public:
Cache(BoardEnum board, unsigned int version, unsigned long flags, SwitchesConversionTable * table):
@@ -187,8 +202,8 @@ class SourcesConversionTable: public ConversionTable {
if (IS_TARANIS(board) && version >= 216) {
for (int i=0; i<32; i++)
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
for (int i=0; i<GetCurrentFirmware()->getCapability(LuaScripts); i++) {
for (int j=0; j<GetCurrentFirmware()->getCapability(LuaOutputsPerScript); j++) {
for (int i=0; i<7; i++) {
for (int j=0; j<6; j++) {
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
}
}
@@ -976,7 +991,12 @@ class MixField: public TransformedField {
_destCh = mix.destCh - 1;
if (mix.curve.type == CurveReference::CURVE_REF_CUSTOM) {
_curveMode = true;
_curveParam = 6 + mix.curve.value;
if (mix.curve.value > 0) {
_curveParam = 6 + mix.curve.value;
}
else {
_curveParam = mix.curve.value;
}
}
else if (mix.curve.type == CurveReference::CURVE_REF_FUNC) {
_curveMode = true;
@@ -1024,6 +1044,8 @@ class MixField: public TransformedField {
mix.curve = CurveReference(CurveReference::CURVE_REF_DIFF, smallGvarToC9x(_curveParam));
else if (_curveParam > 6)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam-6);
else if (_curveParam < 0)
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam);
else
mix.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
}
@@ -1083,7 +1105,7 @@ class InputField: public TransformedField {
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
internalField.Append(new ZCharField<8>(expo.name));
internalField.Append(new SignedField<8>(expo.offset, "Offset"));
internalField.Append(new SignedField<8>(_offset, "Offset"));
internalField.Append(new CurveReferenceField(expo.curve, board, version));
internalField.Append(new SpareBitsField<8>());
}
@@ -1136,7 +1158,11 @@ class InputField: public TransformedField {
virtual void beforeExport()
{
_weight = smallGvarToEEPROM(expo.weight);
_weight = smallGvarToEEPROM(expo.weight);
if (IS_TARANIS(board) && version >= 216) {
_offset = smallGvarToEEPROM(expo.offset);
}
if (!IS_TARANIS(board) || version < 216) {
if (expo.curve.type==CurveReference::CURVE_REF_FUNC && expo.curve.value) {
@@ -1169,6 +1195,10 @@ class InputField: public TransformedField {
expo.weight = smallGvarToC9x(_weight);
if (IS_TARANIS(board) && version >= 216) {
expo.offset = smallGvarToC9x(_offset);
}
if (!IS_TARANIS(board) || version < 216) {
if (!_curveMode)
expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam));
@@ -1186,24 +1216,65 @@ class InputField: public TransformedField {
unsigned int version;
bool _curveMode;
int _weight;
int _offset;
int _curveParam;
};
class LimitField: public StructField {
public:
template <int shift>
static int exportLimitValue(int value)
{
const int GV1 = 4096;
if (value > 10000) {
return -GV1 + value - 10001;
}
if (value < -10000) {
return GV1 + value + 10000;
}
return value + shift;
}
template <int shift>
static int importLimitValue(int value)
{
/* GVARS mapping on radio:
GV1 = -4096
GV9 = -4088
-GV1 = 4095
-GV9 = 4087
*/
const int GV1 = 4096;
if (value >= GV1) {
return 10001 + value - GV1;
}
if (value >= GV1-9) {
return -10000 + value - GV1;
}
if (value < -GV1) {
return -10000 + value + GV1 + 1;
}
if (value < -GV1+9) {
return 10000 + value + GV1 + 1;
}
return value - shift;
}
LimitField(LimitData & limit, BoardEnum board, unsigned int version):
StructField("Limit")
{
if (IS_TARANIS(board) && version >= 216) {
Append(new ConversionField< SignedField<16> >(limit.min, +1000));
Append(new ConversionField< SignedField<16> >(limit.max, -1000));
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
Append(new SignedField<8>(limit.ppmCenter));
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
}
else {
Append(new ConversionField< SignedField<8> >(limit.min, +100, 10));
Append(new ConversionField< SignedField<8> >(limit.max, -100, 10));
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
}
Append(new SignedField<8>(limit.ppmCenter));
Append(new SignedField<14>(limit.offset));
Append(new BoolField<1>(limit.symetrical));
Append(new BoolField<1>(limit.revert));
if (HAS_LARGE_LCD(board)) {
@@ -1547,9 +1618,25 @@ class LogicalSwitchField: public TransformedField {
else if (csw.func >= LS_FN_EQUAL && csw.func <= LS_FN_ELESS) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
if (IS_TARANIS(board) && version < 216) {
RawSource val1(csw.val1);
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
csw.val1 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val1.index).toValue();
}
RawSource val2(csw.val2);
if (val2.type == SOURCE_TYPE_STICK && val2.index < NUM_STICKS) {
csw.val2 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val2.index).toValue();
}
}
}
else if (csw.func != LS_FN_OFF) {
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
if (IS_TARANIS(board) && version < 216) {
RawSource val1(csw.val1);
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
csw.val1 = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, val1.index).toValue();
}
}
csw.val2 = v2;
RawSource val1(csw.val1);
if (IS_ARM(board) && version < 216 && val1.type == SOURCE_TYPE_TELEMETRY) {
@@ -1680,7 +1767,10 @@ class CustomFunctionsConversionTable: public ConversionTable {
addConversion(FuncPlayValue, val++);
if (IS_ARM(board)) {
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
if (IS_TARANIS(board))
addConversion(FuncPlayScript, val++);
else
addConversion(FuncReserve, val++);
addConversion(FuncReserve, val++);
addConversion(FuncBackgroundMusic, val++);
addConversion(FuncBackgroundMusicPause, val++);
@@ -1802,10 +1892,10 @@ class ArmCustomFunctionField: public TransformedField {
else
_active = (fn.enabled ? 1 : 0);
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216) {
*((uint16_t *)_param) = fn.param;
*((uint8_t *)(_param+3)) = fn.func - FuncSafetyCh1;
*((uint8_t *)(_param+3)) = fn.func - FuncOverrideCH1;
}
else {
*((uint32_t *)_param) = fn.param;
@@ -1821,7 +1911,7 @@ class ArmCustomFunctionField: public TransformedField {
*((uint8_t *)(_param+3)) = fn.func - FuncSetTimer1;
}
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(_param, fn.paramarm, sizeof(_param));
}
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
@@ -1884,7 +1974,7 @@ class ArmCustomFunctionField: public TransformedField {
value = *((uint32_t *)_param);
}
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
fn.func = AssignFunc(fn.func + index);
fn.param = (int8_t)value;
}
@@ -1896,7 +1986,7 @@ class ArmCustomFunctionField: public TransformedField {
fn.func = AssignFunc(fn.func + index);
fn.param = value;
}
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
memcpy(fn.paramarm, _param, sizeof(fn.paramarm));
}
else if (fn.func == FuncVolume) {
@@ -1989,9 +2079,9 @@ class AvrCustomFunctionField: public TransformedField {
_param = fn.param;
_active = (fn.enabled ? 1 : 0);
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216)
_union_param = fn.func - FuncSafetyCh1;
_union_param = fn.func - FuncOverrideCH1;
else if (version >= 213)
_active += ((fn.func % 4) << 1);
}
@@ -2049,7 +2139,7 @@ class AvrCustomFunctionField: public TransformedField {
fn.enabled = (_active & 0x01);
}
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
if (version >= 216)
fn.func = AssignFunc(fn.func + _union_param);
else if (version >= 213)
@@ -2396,7 +2486,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
}
for (int i=0; i<O9X_MAX_TIMERS; i++) {
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, POPULATE_TIMER_MODES));
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
@@ -2534,7 +2624,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
if (IS_TARANIS(board)) {
modulesCount = 3;
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this rado protocol")));
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
internalField.Append(new UnsignedField<8>(modelData.trainerMode));
}
else if (IS_ARM(board) && version >= 216) {
@@ -2759,8 +2849,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
if (version >= 213) {
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
internalField.Append(new SpareBitsField<16>()); // mAhUsed
internalField.Append(new SpareBitsField<32>()); // globalTimer
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
@@ -580,7 +580,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
else
return 16;
case SafetyChannelCustomFunction:
return id.contains("nosafetych") ? 0 : 1;
return id.contains("noovveridech") ? 0 : 1;
case LogicalSwitches:
if (IS_ARM(board))
return 32;
@@ -644,7 +644,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
case HasCvNames:
return (IS_TARANIS(board) ? 1 : 0);
case Telemetry:
if (board == BOARD_GRUVIN9X || IS_ARM(board) || id.contains("frsky"))
if (board == BOARD_GRUVIN9X || IS_ARM(board) || id.contains("frsky") || id.contains("telemetrez"))
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
else
return 0;
@@ -663,7 +663,9 @@ int OpenTxFirmware::getCapability(const Capability capability)
case TelemetryMaxMultiplier:
return (IS_ARM(board) ? 32 : 8);
case PPMCenter:
return 1;
return (IS_TARANIS(board) || id.contains("ppmca")) ? 1 : 0;
case PPMUnitMicroseconds:
return id.contains("ppmus") ? 1 : 0;
case SYMLimits:
return 1;
case OptrexDisplay:
@@ -730,6 +732,9 @@ int OpenTxFirmware::getCapability(const Capability capability)
return 0;
case MavlinkTelemetry:
return id.contains("mavlink") ? 1 : 0;
case HasInputDiff:
case HasMixerExpo:
return (IS_ARM(board) ? true : false);
default:
return 0;
}
@@ -1051,8 +1056,8 @@ void addOpenTxCommonOptions(OpenTxFirmware * firmware)
{
firmware->addOption("ppmus", QObject::tr("Channel values displayed in us"));
firmware->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
firmware->addOption("nosafetych", QObject::tr("No SafetyCH functions available"));
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } };
firmware->addOption("nooverridech", QObject::tr("No OverrideCH functions available"));
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE (no telemetry) at field") }, { "faimode", QObject::tr("FAI MODE (no telemetry) always enabled") }, { NULL } };
firmware->addOptions(fai_options);
}
@@ -1095,7 +1100,6 @@ void registerOpenTxFirmwares()
openTx->addOption("novario", QObject::tr("No vario support"));
openTx->addOption("nogps", QObject::tr("No GPS support"));
openTx->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
openTx->addOption("nosafetych", QObject::tr("No SafetyCH functions available"));
openTx->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors"));
openTx->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
addOpenTxCommonOptions(openTx);
@@ -1263,6 +1267,7 @@ void registerOpenTxFirmwares()
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("haptic", QObject::tr("Haptic module installed"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
@@ -1271,10 +1276,11 @@ void registerOpenTxFirmwares()
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
addOpenTxCommonOptions(openTx);
firmwares.push_back(openTx);
default_firmware_variant = GetFirmware("opentx-9x-heli-templates-en");
default_firmware_variant = GetFirmware("opentx-taranis-en");
current_firmware_variant = default_firmware_variant;
}
+2 -3
View File
@@ -124,8 +124,8 @@ t_Th9xLimitData::t_Th9xLimitData()
t_Th9xLimitData::operator LimitData ()
{
LimitData c9x;
c9x.min = min-100;
c9x.max = max+100;
c9x.min = 10*(min-100);
c9x.max = 10*(max+100);
c9x.revert = revert;
c9x.offset = offset;
return c9x;
@@ -272,7 +272,6 @@ t_Th9xModelData::operator ModelData ()
/*c9x.protocol = (Protocol)protocol;
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
c9x.thrTrim = thrTrim;
c9x.thrExpo = thrExpo;
c9x.trimInc = trimInc;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncTrims2Offsets;
+22 -4
View File
@@ -275,7 +275,10 @@ These will be relevant for all models in the same EEPROM.</string>
<item>
<widget class="QSlider" name="backlightColor_SL">
<property name="maximum">
<number>100</number>
<number>20</number>
</property>
<property name="pageStep">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -3195,7 +3198,7 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<property name="text">
<string>Pot (normal)</string>
<string>Pot with detent (normal)</string>
</property>
</item>
<item>
@@ -3203,6 +3206,11 @@ p, li { white-space: pre-wrap; }
<string>Multipos Switch</string>
</property>
</item>
<item>
<property name="text">
<string>Pot without detent</string>
</property>
</item>
</widget>
</item>
<item row="6" column="0">
@@ -3236,7 +3244,7 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<property name="text">
<string>Pot (normal)</string>
<string>Pot with detent (normal)</string>
</property>
</item>
<item>
@@ -3244,6 +3252,11 @@ p, li { white-space: pre-wrap; }
<string>Multipos Switch</string>
</property>
</item>
<item>
<property name="text">
<string>Pot without detent</string>
</property>
</item>
</widget>
</item>
<item row="7" column="0">
@@ -3284,7 +3297,7 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<property name="text">
<string>Pot (normal)</string>
<string>Pot with detent (normal)</string>
</property>
</item>
<item>
@@ -3292,6 +3305,11 @@ p, li { white-space: pre-wrap; }
<string>Multipos Switch</string>
</property>
</item>
<item>
<property name="text">
<string>Pot without detent</string>
</property>
</item>
</widget>
</item>
<item row="6" column="3">
+155 -60
View File
@@ -1,4 +1,11 @@
#include <QtGui>
#if defined WIN32
#include <io.h>
#include <stdio.h>
#endif
#if !defined WIN32 && defined __GNUC__
#include <unistd.h>
#endif
#include "appdata.h"
#include "helpers.h"
#include "simulatordialog.h"
@@ -140,18 +147,18 @@ void populatePhasesCB(QComboBox *b, int value)
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
}
GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags):
GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
QObject(),
weightGV(weightGV),
weightSB(weightSB),
sb(dynamic_cast<QSpinBox *>(weightSB)),
dsb(dynamic_cast<QDoubleSpinBox *>(weightSB)),
weightCB(weightCB),
weight(weight),
flags(flags),
lock(false)
step(step),
lock(true)
{
lock = true;
if (GetCurrentFirmware()->getCapability(Gvars)) {
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
populateGVCB(weightCB, weight);
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
@@ -163,21 +170,32 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
}
}
weightSB->setMinimum(mini);
weightSB->setMaximum(maxi);
int val;
if (weight>maxi || weight<mini) {
val = deflt;
weightGV->setChecked(true);
weightSB->hide();
weightCB->show();
}
else {
val = weight;
weightGV->setChecked(false);
weightSB->setValue(weight);
weightSB->show();
weightCB->hide();
}
if (sb) {
sb->setMinimum(mini);
sb->setMaximum(maxi);
sb->setValue(val);
}
else {
dsb->setMinimum(mini*step);
dsb->setMaximum(maxi*step);
dsb->setValue(val*step);
}
connect(weightSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
lock = false;
@@ -186,16 +204,23 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
void GVarGroup::gvarCBChanged(int state)
{
weightCB->setVisible(state);
weightSB->setVisible(!state);
if (weightSB)
weightSB->setVisible(!state);
else
weightSB->setVisible(!state);
valuesChanged();
}
void GVarGroup::valuesChanged()
{
if (weightGV->isChecked())
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
else
weight = weightSB->value();
if (!lock) {
if (weightGV->isChecked())
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
else if (sb)
weight = sb->value();
else
weight = dsb->value()/step;
}
}
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
@@ -209,14 +234,14 @@ CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox
lock(false),
lastType(-1)
{
curveTypeCB->addItem(tr("Diff"));
curveTypeCB->addItem(tr("Expo"));
curveTypeCB->addItem(tr("Func"));
curveTypeCB->addItem(tr("Curve"));
if (!(flags & HIDE_DIFF)) curveTypeCB->addItem(tr("Diff"), 0);
if (!(flags & HIDE_EXPO)) curveTypeCB->addItem(tr("Expo"), 1);
curveTypeCB->addItem(tr("Func"), 2);
curveTypeCB->addItem(tr("Curve"), 3);
curveValueCB->setMaxVisibleItems(10);
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged(int)));
connect(curveGVarCB, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(curveValueCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveValueSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
@@ -228,10 +253,12 @@ void CurveGroup::update()
{
lock = true;
curveTypeCB->setCurrentIndex(curve.type);
int found = curveTypeCB->findData(curve.type);
if (found < 0) found = 0;
curveTypeCB->setCurrentIndex(found);
if (curve.type == CurveReference::CURVE_REF_DIFF || curve.type == CurveReference::CURVE_REF_EXPO) {
curveGVarCB->show();
curveGVarCB->setVisible(GetCurrentFirmware()->getCapability(Gvars));
if (curve.value > 100 || curve.value < -100) {
curveGVarCB->setChecked(true);
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
@@ -271,11 +298,13 @@ void CurveGroup::update()
if (lastType != curve.type) {
lastType = curve.type;
curveValueCB->clear();
for (int i=-numcurves; i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString());
for (int i= ((flags & HIDE_NEGATIVE_CURVES) ? 0 : -numcurves); i<=numcurves; i++) {
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString(), i);
if (i == curve.value) {
curveValueCB->setCurrentIndex(curveValueCB->count() - 1);
}
}
}
curveValueCB->setCurrentIndex(curve.value+numcurves);
break;
}
default:
@@ -300,10 +329,33 @@ void CurveGroup::gvarCBChanged(int state)
}
}
void CurveGroup::typeChanged(int value)
{
if (!lock) {
int type = curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt();
switch (type) {
case 0:
curve = CurveReference(CurveReference::CURVE_REF_DIFF, 0);
break;
case 1:
curve = CurveReference(CurveReference::CURVE_REF_EXPO, 0);
break;
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, 0);
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, 0);
break;
}
update();
}
}
void CurveGroup::valuesChanged()
{
if (!lock) {
switch (curveTypeCB->currentIndex()) {
switch (curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt()) {
case 0:
case 1:
{
@@ -312,14 +364,14 @@ void CurveGroup::valuesChanged()
value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
else
value = curveValueSB->value();
curve = CurveReference(curveTypeCB->currentIndex() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
curve = CurveReference(curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
break;
}
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, curveValueCB->currentIndex());
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetCurrentFirmware()->getCapability(NumCurves));
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->itemData(curveValueCB->currentIndex()).toInt());
break;
}
@@ -349,13 +401,13 @@ void populateBacklightCB(QComboBox *b, const uint8_t value)
}
}
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr)
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context)
{
RawSwitch item;
b->clear();
if (attr & POPULATE_ONOFF) {
if (context != MixesContext) {
// !FMx
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
for (int i=-GetCurrentFirmware()->getCapability(FlightModes); i<0; i++) {
@@ -364,14 +416,6 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
// !One
item = RawSwitch(SWITCH_TYPE_ONE, 1);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
// OFF
item = RawSwitch(SWITCH_TYPE_OFF);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=-GetCurrentFirmware()->getCapability(LogicalSwitches); i<0; i++) {
@@ -406,13 +450,13 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
//hide up and down for !SH and !SF, because they are redundant (!SFup == SFdown)
if (item.toString().contains("H") || item.toString().contains("F")) continue;
if (item.toString().contains("H") || item.toString().contains("F")) continue;
}
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (attr & POPULATE_TIMER_MODES) {
if (context == TimersContext) {
for (int i=0; i<5; i++) {
item = RawSwitch(SWITCH_TYPE_TIMER_MODE, i);
b->addItem(item.toString(), item.toValue());
@@ -459,7 +503,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (attr & POPULATE_ONOFF) {
if (context == CustomFunctionsContext) {
// ON
item = RawSwitch(SWITCH_TYPE_ON);
b->addItem(item.toString(), item.toValue());
@@ -468,7 +512,10 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
item = RawSwitch(SWITCH_TYPE_ONE, 1);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
// FMx
}
// FMx
if (context != MixesContext) {
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
for (int i=1; i<=GetCurrentFirmware()->getCapability(FlightModes); i++) {
item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i);
@@ -760,19 +807,35 @@ QString getFrSkySrc(int index)
QString getTrimInc(ModelData * g_model)
{
switch (g_model->trimInc) {
case (1): return QObject::tr("Extra Fine");
case (2): return QObject::tr("Fine");
case (3): return QObject::tr("Medium");
case (4): return QObject::tr("Coarse");
default: return QObject::tr("Exponential");
}
switch (g_model->trimInc) {
case -2:
return QObject::tr("Exponential");
case -1:
return QObject::tr("Extra Fine");
case 0:
return QObject::tr("Fine");
case 1:
return QObject::tr("Medium");
case 2:
return QObject::tr("Coarse");
default:
return QObject::tr("Unknown");
}
}
QString getTimerStr(TimerData & timer)
{
QString str = ", " + (timer.dir ? QObject::tr("Count Up") : QObject::tr("Count Down"));
return QObject::tr("%1:%2, ").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0')) + timer.mode.toString() + str;
QString result = QObject::tr("%1:%2").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0'));
result += QString(", ") + timer.mode.toString();
if (timer.persistent)
result += QObject::tr(", Persistent");
if (timer.minuteBeep)
result += QObject::tr(", MinuteBeep");
if (timer.countdownBeep == 1)
result += QObject::tr(", CountDown(Beeps)");
else if (timer.countdownBeep == 2)
result += QObject::tr(", CountDown(Voice)");
return result;
}
QString getProtocol(ModelData * g_model)
@@ -813,18 +876,37 @@ QString getPhasesStr(unsigned int phases, ModelData & model)
}
}
QString getCenterBeep(ModelData * g_model)
QString getCenterBeepStr(ModelData * g_model)
{
//RETA123
QStringList strl;
if(g_model->beepANACenter & 0x01) strl << QObject::tr("Rudder");
if(g_model->beepANACenter & 0x02) strl << QObject::tr("Elevator");
if(g_model->beepANACenter & 0x04) strl << QObject::tr("Throttle");
if(g_model->beepANACenter & 0x08) strl << QObject::tr("Aileron");
if(g_model->beepANACenter & 0x10) strl << "P1";
if(g_model->beepANACenter & 0x20) strl << "P2";
if(g_model->beepANACenter & 0x40) strl << "P3";
if(g_model->beepANACenter & 0x80) strl << "LS";
if (g_model->beepANACenter & 0x01)
strl << QObject::tr("Rudder");
if (g_model->beepANACenter & 0x02)
strl << QObject::tr("Elevator");
if (g_model->beepANACenter & 0x04)
strl << QObject::tr("Throttle");
if (g_model->beepANACenter & 0x08)
strl << QObject::tr("Aileron");
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
if (g_model->beepANACenter & 0x10)
strl << "S1";
if (g_model->beepANACenter & 0x20)
strl << "S2";
if (g_model->beepANACenter & 0x40)
strl << "S3";
if (g_model->beepANACenter & 0x80)
strl << "LS";
if (g_model->beepANACenter & 0x100)
strl << "RS";
}
else {
if (g_model->beepANACenter & 0x10)
strl << "P1";
if (g_model->beepANACenter & 0x20)
strl << "P2";
if (g_model->beepANACenter & 0x40)
strl << "P3";
}
return strl.join(", ");
}
@@ -942,3 +1024,16 @@ QString index2version(int index)
return QString();
}
}
int qunlink(const QString & fileName)
{
QByteArray ba = fileName.toLatin1();
return unlink(ba.constData());
}
QString generateProcessUniqueTempFileName(const QString & fileName)
{
QString sanitizedFileName = fileName;
sanitizedFileName.remove('/');
return QDir::tempPath() + QString("/%1-").arg(QCoreApplication::applicationPid()) + sanitizedFileName;
}
+26 -9
View File
@@ -6,7 +6,7 @@
extern const QColor colors[C9X_MAX_CURVES];
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetCurrentFirmware()->getCapability(LogicalSwitches)-1)
#define TMR_NUM_OPTION (TMRMODE_COUNT+2*9+2*GetCurrentFirmware()->getCapability(LogicalSwitches)-1)
//convert from mode 1 to mode generalSettings.stickMode
//NOTICE! => 1..4 -> 1..4
@@ -37,12 +37,12 @@ class CompanionIcon: public QIcon {
CompanionIcon(QString baseimage);
};
class GVarGroup : public QObject {
class GVarGroup: public QObject {
Q_OBJECT
public:
GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags=0);
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
protected slots:
void gvarCBChanged(int);
@@ -50,13 +50,19 @@ class GVarGroup : public QObject {
protected:
QCheckBox *weightGV;
QSpinBox *weightSB;
QAbstractSpinBox *weightSB;
QSpinBox *sb;
QDoubleSpinBox *dsb;
QComboBox *weightCB;
int & weight;
const unsigned int flags;
double step;
bool lock;
};
#define HIDE_DIFF 0x01
#define HIDE_EXPO 0x02
#define HIDE_NEGATIVE_CURVES 0x04
class CurveGroup : public QObject {
Q_OBJECT
@@ -67,6 +73,7 @@ class CurveGroup : public QObject {
protected slots:
void gvarCBChanged(int);
void typeChanged(int);
void valuesChanged();
protected:
@@ -80,9 +87,15 @@ class CurveGroup : public QObject {
int lastType;
};
#define POPULATE_ONOFF 0x01
#define POPULATE_TIMER_MODES 0x02
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr=0);
enum SwitchContext
{
LogicalSwitchesContext,
CustomFunctionsContext,
TimersContext,
MixesContext
};
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, SwitchContext context);
void populatePhasesCB(QComboBox *b, int value);
void populateGvarUseCB(QComboBox *b, unsigned int phase);
@@ -113,7 +126,7 @@ int findmult(float value, float base);
QString getTrimInc(ModelData * g_model);
QString getTimerStr(TimerData & timer);
QString getProtocol(ModelData * g_model);
QString getCenterBeep(ModelData * g_model);
QString getCenterBeepStr(ModelData * g_model);
/* FrSky helpers */
QString getFrSkyAlarmType(int alarm);
@@ -138,4 +151,8 @@ class QTimeS : public QTime
int seconds() const { return hour()*3600 + minute()*60 + second(); };
};
int qunlink(const QString & fileName);
QString generateProcessUniqueTempFileName(const QString & fileName);
#endif // HELPERS_H
+6 -6
View File
@@ -239,13 +239,13 @@ void logsDialog::on_mapsButton_clicked() {
itemSelected=n-1;
}
QString geFilename = QDir::tempPath() + "/track0.png";
if (QFile::exists(geFilename)) {
QFile::remove(geFilename);
QString geIconFilename = generateProcessUniqueTempFileName("track0.png");
if (QFile::exists(geIconFilename)) {
QFile::remove(geIconFilename);
}
QFile::copy(":/images/track0.png", geFilename);
QFile::copy(":/images/track0.png", geIconFilename);
geFilename = QDir::tempPath() + "/flight.kml";
QString geFilename = generateProcessUniqueTempFileName("flight.kml");
if (QFile::exists(geFilename)) {
QFile::remove(geFilename);
}
@@ -264,7 +264,7 @@ void logsDialog::on_mapsButton_clicked() {
QTextStream outputStream(&geFile);
outputStream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<kml xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\">\n";
outputStream << "\t<Document>\n\t\t<name>" << logFilename << "</name>\n";
outputStream << "\t\t<Style id=\"multiTrack_n\">\n\t\t\t<IconStyle>\n\t\t\t\t<Icon>\n\t\t\t\t\t<href>file://" << QDir::tempPath() << "/track0.png</href>\n\t\t\t\t</Icon>\n\t\t\t</IconStyle>\n\t\t\t<LineStyle>\n\t\t\t\t<color>991081f4</color>\n\t\t\t\t<width>6</width>\n\t\t\t</LineStyle>\n\t\t</Style>\n";
outputStream << "\t\t<Style id=\"multiTrack_n\">\n\t\t\t<IconStyle>\n\t\t\t\t<Icon>\n\t\t\t\t\t<href>file://" << geIconFilename << "</href>\n\t\t\t\t</Icon>\n\t\t\t</IconStyle>\n\t\t\t<LineStyle>\n\t\t\t\t<color>991081f4</color>\n\t\t\t\t<width>6</width>\n\t\t\t</LineStyle>\n\t\t</Style>\n";
outputStream << "\t\t<Style id=\"multiTrack_h\">\n\t\t\t<IconStyle>\n\t\t\t\t<scale>0</scale>\n\t\t\t\t<Icon>\n\t\t\t\t\t<href>file://" << QDir::tempPath() << "/track0.png</href>\n\t\t\t\t</Icon>\n\t\t\t</IconStyle>\n\t\t\t<LineStyle>\n\t\t\t\t<color>991081f4</color>\n\t\t\t\t<width>8</width>\n\t\t\t</LineStyle>\n\t\t</Style>\n";
outputStream << "\t\t<StyleMap id=\"multiTrack\">\n\t\t\t<Pair>\n\t\t\t\t<key>normal</key>\n\t\t\t\t<styleUrl>#multiTrack_n</styleUrl>\n\t\t\t</Pair>\n\t\t\t<Pair>\n\t\t\t\t<key>highlight</key>\n\t\t\t\t<styleUrl>#multiTrack_h</styleUrl>\n\t\t\t</Pair>\n\t\t</StyleMap>\n";
outputStream << "\t\t<Style id=\"lineStyle\">\n\t\t\t<LineStyle>\n\t\t\t\t<color>991081f4</color>\n\t\t\t\t<width>6</width>\n\t\t\t</LineStyle>\n\t\t</Style>\n";
+16 -15
View File
@@ -804,9 +804,9 @@ QStringList MainWindow::GetSambaArguments(const QString &tcl)
{
QStringList result;
QString tclFilename = QDir::tempPath() + "/temp.tcl";
QString tclFilename = generateProcessUniqueTempFileName("temp.tcl");
if (QFile::exists(tclFilename)) {
unlink(tclFilename.toAscii());
qunlink(tclFilename);
}
QFile tclFile(tclFilename);
if (!tclFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
@@ -946,21 +946,23 @@ QString MainWindow::FindMassstoragePath(QString filename)
void MainWindow::readEeprom()
{
QString tempDir = QDir::tempPath();
QString tempFile;
EEPROMInterface *eepromInterface = GetEepromInterface();
if (IS_ARM(eepromInterface->getBoard()))
tempFile = tempDir + "/temp.bin";
tempFile = generateProcessUniqueTempFileName("temp.bin");
else
tempFile = tempDir + "/temp.hex";
tempFile += generateProcessUniqueTempFileName("temp.hex");
qDebug() << "MainWindow::readEeprom(): using temp file: " << tempFile;
if (readEepromFromRadio(tempFile, tr("Read Models and Settings From Radio"))) {
MdiChild *child = createMdiChild();
child->newFile();
child->loadFile(tempFile, false);
child->show();
qunlink(tempFile);
}
}
@@ -1042,7 +1044,10 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
QFile file(filename);
if (file.exists()) {
file.remove();
if (!file.remove()) {
QMessageBox::warning(this, tr("Error"), tr("Could not delete temporary file: %1").arg(filename));
return false;
}
}
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
@@ -1165,13 +1170,12 @@ void MainWindow::writeBackup()
return;
}
int oldrev = getEpromVersion(fileName);
QString tempDir = QDir::tempPath();
QString tempFlash = tempDir + "/flash.bin";
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
if (!readFirmwareFromRadio(tempFlash))
return;
QString restoreFile = tempDir + "/compat.bin";
QString restoreFile = generateProcessUniqueTempFileName("compat.bin");
if (!convertEEPROM(fileName, restoreFile, tempFlash)) {
int ret = QMessageBox::question(this, "Error", tr("Cannot check Models and Settings compatibility! Continue anyway?") ,
QMessageBox::Yes | QMessageBox::No);
@@ -1188,9 +1192,7 @@ void MainWindow::writeBackup()
}
fileName = restoreFile;
}
QByteArray ba = tempFlash.toLatin1();
char *name = ba.data();
unlink(name);
qunlink(tempFlash);
}
else {
if (backupEnable) {
@@ -1304,8 +1306,7 @@ void MainWindow::writeFlash(QString fileToFlash)
if (!fileName.isEmpty()) {
g.backupOnFlash(backup);
if (backup) {
QString tempDir = QDir::tempPath();
QString backupFile = tempDir + "/backup.bin";
QString backupFile = generateProcessUniqueTempFileName("backup.bin");
bool backupEnable=g.enableBackup();
QString backupPath=g.backupDir();
if (!backupPath.isEmpty() && !IS_TARANIS(GetEepromInterface()->getBoard())) {
@@ -1330,7 +1331,7 @@ void MainWindow::writeFlash(QString fileToFlash)
sleep(2);
int res = writeFirmwareToRadio(fileName);
if (res) {
QString restoreFile = tempDir + "/restore.bin";
QString restoreFile = generateProcessUniqueTempFileName("restore.bin");
if (!convertEEPROM(backupFile, restoreFile, fileName)) {
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
restoreFile = backupFile;
+4 -7
View File
@@ -531,8 +531,7 @@ void MdiChild::writeEeprom() // write to Tx
}
QString stickCal=g.profile[g.id()].stickPotCalib();
burnConfigDialog bcd;
QString tempDir = QDir::tempPath();
QString tempFile = tempDir + "/temp.bin";
QString tempFile = generateProcessUniqueTempFileName("temp.bin");
saveFile(tempFile, false);
if(!QFileInfo(tempFile).exists()) {
QMessageBox::critical(this,tr("Error"), tr("Cannot write temporary file!"));
@@ -550,12 +549,12 @@ void MdiChild::writeEeprom() // write to Tx
return;
}
int oldrev=((MainWindow *)this->parent())->getEpromVersion(tempFile);
QString tempFlash=tempDir + "/flash.bin";
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
if (!((MainWindow *)this->parent())->readFirmwareFromRadio(tempFlash))
return;
QString restoreFile = tempDir + "/compat.bin";
QString restoreFile = generateProcessUniqueTempFileName("compat.bin");
if (!((MainWindow *)this->parent())->convertEEPROM(tempFile, restoreFile, tempFlash)) {
int ret = QMessageBox::question(this, tr("Error"), tr("Cannot check eeprom compatibility! Continue anyway?"), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::No)
@@ -571,9 +570,7 @@ void MdiChild::writeEeprom() // write to Tx
}
tempFile=restoreFile;
}
QByteArray ba = tempFlash.toLatin1();
char *name = ba.data();
unlink(name);
qunlink(tempFlash);
}
else {
if (backupEnable) {
+77 -71
View File
@@ -1,4 +1,5 @@
#include "channels.h"
#include "helpers.h"
#include <QLabel>
#include <QLineEdit>
#include <QSpinBox>
@@ -6,6 +7,70 @@
#include <QCheckBox>
#include <QDoubleSpinBox>
LimitsGroup::LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt):
firmware(firmware),
spinbox(new QDoubleSpinBox()),
value(value),
displayStep(0.1)
{
bool allowGVars = false;
int internalStep = 1;
spinbox->setProperty("index", row);
spinbox->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
spinbox->setAccelerated(true);
if (firmware->getCapability(PPMUnitMicroseconds)) {
displayStep = 0.512;
spinbox->setDecimals(1);
spinbox->setSuffix("us");
}
else {
spinbox->setDecimals(0);
spinbox->setSuffix("%");
}
if (IS_TARANIS(firmware->getBoard()) || deflt == 0 /*it's the offset*/) {
spinbox->setDecimals(1);
allowGVars = true;
}
else {
internalStep *= 10;
}
spinbox->setSingleStep(displayStep*internalStep);
QHBoxLayout * horizontalLayout = new QHBoxLayout();
QCheckBox * gv = new QCheckBox(QObject::tr("GV"));
horizontalLayout->addWidget(gv);
QComboBox * cb = new QComboBox();
horizontalLayout->addWidget(cb);
horizontalLayout->addWidget(spinbox);
gridLayout->addLayout(horizontalLayout, row, col, 1, 1);
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
}
LimitsGroup::~LimitsGroup()
{
delete gvarGroup;
}
void LimitsGroup::updateMinMax(int max)
{
if (spinbox->maximum() == 0) {
spinbox->setMinimum(-max*displayStep);
if (value < -max) {
value = -max;
}
}
if (spinbox->minimum() == 0) {
spinbox->setMaximum(max*displayStep);
if (value > max) {
value = max;
}
}
}
Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings, firmware)
{
@@ -13,8 +78,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
bool minimize = false;
int col = 1;
if (firmware->getCapability(ChannelsName))
{
if (firmware->getCapability(ChannelsName)) {
minimize=true;
addLabel(gridLayout, tr("Name"), col++);
}
@@ -52,44 +116,13 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
}
// Channel offset
QDoubleSpinBox * offset = new QDoubleSpinBox(this);
offset->setProperty("index", i);
offset->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
offset->setAccelerated(true);
offset->setDecimals(1);
offset->setMinimum(-100);
offset->setSingleStep(0.1);
offset->setValue(float(model.limitData[i].offset) / 10);
connect(offset, SIGNAL(editingFinished()), this, SLOT(offsetEdited()));
gridLayout->addWidget(offset, i+1, col++, 1, 1);
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].offset, -1000, 1000, 0);
// Channel min
QDoubleSpinBox * minSB = new QDoubleSpinBox(this);
minSB->setProperty("index", i);
minSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
minSB->setAccelerated(true);
minSB->setDecimals(1);
minSB->setMinimum(-model.getChannelsMax());
minSB->setSingleStep(0.1);
minSB->setMaximum(0);
minSB->setValue(float(model.limitData[i].min) / 10);
connect(minSB, SIGNAL(editingFinished()), this, SLOT(minEdited()));
gridLayout->addWidget(minSB, i+1, col++, 1, 1);
minSpins << minSB;
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
// Channel max
QDoubleSpinBox * maxSB = new QDoubleSpinBox(this);
maxSB->setProperty("index", i);
maxSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
maxSB->setAccelerated(true);
maxSB->setDecimals(1);
maxSB->setMinimum(0);
maxSB->setSingleStep(0.1);
maxSB->setMaximum(model.getChannelsMax());
maxSB->setValue(float(model.limitData[i].max) / 10);
connect(maxSB, SIGNAL(editingFinished()), this, SLOT(maxEdited()));
gridLayout->addWidget(maxSB, i+1, col++, 1, 1);
maxSpins << maxSB;
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
// Channel inversion
QComboBox * invCB = new QComboBox(this);
@@ -117,6 +150,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
QSpinBox * center = new QSpinBox(this);
center->setProperty("index", i);
center->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
center->setSuffix("us");
center->setMinimum(1375);
center->setMaximum(1625);
center->setValue(1500);
@@ -134,6 +168,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
gridLayout->addWidget(symlimits, i+1, col++, 1, 1);
}
}
// Push the rows up
addVSpring(gridLayout, 0,firmware->getCapability(Outputs)+1);
@@ -142,6 +177,9 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
Channels::~Channels()
{
foreach(LimitsGroup *group, limitsGroups) {
delete group;
}
}
void Channels::symlimitsEdited()
@@ -164,46 +202,14 @@ void Channels::nameEdited()
}
}
void Channels::offsetEdited()
{
QDoubleSpinBox *dsb = qobject_cast<QDoubleSpinBox*>(sender());
int index = dsb->property("index").toInt();
model.limitData[index].offset = round(dsb->value() * 10);
emit modified();
}
void Channels::minEdited()
{
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
int index = sb->property("index").toInt();
model.limitData[index].min = round(sb->value() * 10);
emit modified();
}
void Channels::maxEdited()
{
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
int index = sb->property("index").toInt();
model.limitData[index].max = round(sb->value() * 10);
emit modified();
}
void Channels::refreshExtendedLimits()
{
int channelMax = model.getChannelsMax();
int channelMaxValue = channelMax * 10;
for (int i=0; i<firmware->getCapability(Outputs); i++) {
QDoubleSpinBox * minDSB = minSpins[i];
QDoubleSpinBox * maxDSB = maxSpins[i];
minDSB->setMinimum(-channelMax);
maxDSB->setMaximum(+channelMax);
//reset any limit that is bigger than current maximum (dependent on extended limits setting)
if ( model.limitData[i].min < -channelMaxValue ) model.limitData[i].min = -channelMaxValue;
if ( model.limitData[i].max > +channelMaxValue ) model.limitData[i].max = +channelMaxValue;
foreach(LimitsGroup *group, limitsGroups) {
group->updateMinMax(10*channelMax);
}
emit modified();
}
+19 -5
View File
@@ -4,6 +4,24 @@
#include "modelpanel.h"
#include <QSpinBox>
class GVarGroup;
class LimitsGroup
{
public:
LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt);
~LimitsGroup();
void updateMinMax(int max);
protected:
FirmwareInterface * firmware;
QDoubleSpinBox * spinbox;
GVarGroup * gvarGroup;
int & value;
double displayStep;
};
class Channels : public ModelPanel
{
Q_OBJECT
@@ -13,8 +31,7 @@ class Channels : public ModelPanel
~Channels();
private:
QVector<QDoubleSpinBox *> minSpins;
QVector<QDoubleSpinBox *> maxSpins;
QVector<LimitsGroup *> limitsGroups;
public slots:
void refreshExtendedLimits();
@@ -22,9 +39,6 @@ class Channels : public ModelPanel
private slots:
void symlimitsEdited();
void nameEdited();
void offsetEdited();
void minEdited();
void maxEdited();
void invEdited();
void curveEdited();
void ppmcenterEdited();
+22 -8
View File
@@ -318,11 +318,12 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
int index = fswtchFunc[i]->currentIndex();
if (index>=FuncSafetyCh1 && index<=FuncSafetyCh32) {
if (index>=FuncOverrideCH1 && index<=FuncOverrideCH32) {
int channelsMax = model.getChannelsMax(true);
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(-125);
fswtchParam[i]->setMaximum(125);
fswtchParam[i]->setMinimum(-channelsMax);
fswtchParam[i]->setMaximum(channelsMax);
if (modified) {
model.funcSw[i].param = fswtchParam[i]->value();
}
@@ -469,6 +470,18 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
}
}
else if (index==FuncPlayScript) {
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (modified) {
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
int vml = 8/*TODO*/;
if (fswtchParamArmT[i]->currentText() != "----") {
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
model.funcSw[i].paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
}
}
}
}
else if (index==FuncBacklight && IS_TARANIS_PLUS(GetEepromInterface()->getBoard())) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchBLcolor[i]->value();
fswtchBLcolor[i]->setValue(model.funcSw[i].param);
@@ -506,7 +519,7 @@ void CustomFunctionsPanel::update()
lock = true;
for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
if (!initialized) {
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
populateGVmodeCB(fswtchGVmode[i], model.funcSw[i].adjustMode);
populateFuncParamCB(fswtchParamT[i], model, model.funcSw[i].func, model.funcSw[i].param, model.funcSw[i].adjustMode);
@@ -527,7 +540,7 @@ void CustomFunctionsPanel::fswPaste()
FuncSwData *fsw = &model.funcSw[selectedFunction];
memcpy(fsw, fswData.mid(0, sizeof(FuncSwData)).constData(), sizeof(FuncSwData));
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
populateGVmodeCB(fswtchGVmode[selectedFunction], model.funcSw[selectedFunction].adjustMode);
populateFuncParamCB(fswtchParamT[selectedFunction], model, model.funcSw[selectedFunction].func, model.funcSw[selectedFunction].param, model.funcSw[selectedFunction].adjustMode);
@@ -543,7 +556,7 @@ void CustomFunctionsPanel::fswDelete()
model.funcSw[selectedFunction].clear();
// TODO update switch and func
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
refreshCustomFunction(selectedFunction);
lock = false;
@@ -590,8 +603,9 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
b->clear();
for (unsigned int i=0; i<FuncCount; i++) {
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
if (((i>=FuncSafetyCh1 && i<=FuncSafetyCh32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
if (((i>=FuncOverrideCH1 && i<=FuncOverrideCH32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
((i==FuncPlayScript && !IS_TARANIS(firmware->getBoard()))) ||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
@@ -669,7 +683,7 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, const ModelData & m
b->setCurrentIndex(value);
}
else if (function==FuncVolume) {
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_TRIMS);
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS);
}
else if (function==FuncPlayValue) {
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRYEXT);
+2 -2
View File
@@ -31,9 +31,9 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
ui->offsetCB->hide();
}
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings);
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings, MixesContext);
ui->sideCB->setCurrentIndex(ed->mode-1);
+3 -3
View File
@@ -30,7 +30,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
// Phase switch
if (phaseIdx > 0) {
populateSwitchCB(ui->swtch, phase.swtch, generalSettings);
populateSwitchCB(ui->swtch, phase.swtch, generalSettings, MixesContext);
connect(ui->swtch, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseSwitch_currentIndexChanged(int)));
}
else {
@@ -315,10 +315,10 @@ void FlightModePanel::phaseGVUse_currentIndexChanged(int index)
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
int gvar = comboBox->property("index").toInt();
if (index == 0) {
phase.gvars[gvar]=0;
phase.gvars[gvar] = 0;
}
else {
phase.gvars[gvar] = 1024+index+(index>phaseIdx?1:0);
phase.gvars[gvar] = 1024 + index;
}
update();
emit modified();
+1 -1
View File
@@ -28,7 +28,7 @@ void HeliPanel::update()
lock = true;
ui->swashTypeCB->setCurrentIndex(model.swashRingData.type);
populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS);
populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
ui->swashRingValSB->setValue(model.swashRingData.value);
ui->swashInvertELE->setChecked(model.swashRingData.invertELE);
ui->swashInvertAIL->setChecked(model.swashRingData.invertAIL);
+1 -1
View File
@@ -174,7 +174,7 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
}
}
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
if (md->curve.value) str += " " + md->curve.toString();
QString phasesStr = getPhasesStr(md->phases, model);
if (!phasesStr.isEmpty()) str += " " + phasesStr;
+57 -36
View File
@@ -11,6 +11,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
ModelPanel(parent, model, generalSettings, firmware),
selectedSwitch(0)
{
int channelsMax = model.getChannelsMax(true);
QGridLayout * gridLayout = new QGridLayout(this);
int col = 1;
@@ -48,8 +50,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
gridLayout->addWidget(cswitchSource1[i], i+1, 2);
cswitchSource1[i]->setVisible(false);
cswitchValue[i] = new QDoubleSpinBox(this);
cswitchValue[i]->setMaximum(125);
cswitchValue[i]->setMinimum(-125);
cswitchValue[i]->setMaximum(channelsMax);
cswitchValue[i]->setMinimum(-channelsMax);
cswitchValue[i]->setAccelerated(true);
cswitchValue[i]->setDecimals(0);
cswitchValue[i]->setProperty("index", i);
@@ -66,8 +68,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
cswitchSource2[i]->setVisible(false);
cswitchOffset[i] = new QDoubleSpinBox(this);
cswitchOffset[i]->setProperty("index",i);
cswitchOffset[i]->setMaximum(125);
cswitchOffset[i]->setMinimum(-125);
cswitchOffset[i]->setMaximum(channelsMax);
cswitchOffset[i]->setMinimum(-channelsMax);
cswitchOffset[i]->setAccelerated(true);
cswitchOffset[i]->setDecimals(0);
connect(cswitchOffset[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
@@ -75,8 +77,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
v2Layout->addWidget(cswitchOffset[i]);
cswitchOffset2[i] = new QDoubleSpinBox(this);
cswitchOffset2[i]->setProperty("index",i);
cswitchOffset2[i]->setMaximum(125);
cswitchOffset2[i]->setMinimum(-125);
cswitchOffset2[i]->setMaximum(channelsMax);
cswitchOffset2[i]->setMinimum(-channelsMax);
cswitchOffset2[i]->setAccelerated(true);
cswitchOffset2[i]->setDecimals(0);
connect(cswitchOffset2[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
@@ -167,16 +169,20 @@ void LogicalSwitchesPanel::andEdited(int value)
void LogicalSwitchesPanel::durationEdited(double duration)
{
int index = sender()->property("index").toInt();
model.customSw[index].duration = (uint8_t)round(duration*10);
emit modified();
if (!lock) {
int index = sender()->property("index").toInt();
model.customSw[index].duration = (uint8_t)round(duration*10);
emit modified();
}
}
void LogicalSwitchesPanel::delayEdited(double delay)
{
int index = sender()->property("index").toInt();
model.customSw[index].delay = (uint8_t)round(delay*10);
emit modified();
if (!lock) {
int index = sender()->property("index").toInt();
model.customSw[index].delay = (uint8_t)round(delay*10);
emit modified();
}
}
void LogicalSwitchesPanel::edited()
@@ -184,19 +190,25 @@ void LogicalSwitchesPanel::edited()
if (!lock) {
lock = true;
int i = sender()->property("index").toInt();
int newFunc = csw[i]->itemData(csw[i]->currentIndex()).toInt();
bool chAr = (model.customSw[i].getFunctionFamily() != LogicalSwitchData(newFunc).getFunctionFamily());
model.customSw[i].func = newFunc;
if (chAr) {
if (model.customSw[i].getFunctionFamily() == LS_FAMILY_TIMER) {
CSFunctionFamily oldFuncFamily = model.customSw[i].getFunctionFamily();
model.customSw[i].func = csw[i]->itemData(csw[i]->currentIndex()).toInt();
CSFunctionFamily newFuncFamily = model.customSw[i].getFunctionFamily();
if (oldFuncFamily != newFuncFamily) {
if (newFuncFamily == LS_FAMILY_TIMER) {
model.customSw[i].val1 = -119;
model.customSw[i].val2 = -119;
}
else if (model.customSw[i].getFunctionFamily() == LS_FAMILY_STAY) {
else if (newFuncFamily == LS_FAMILY_STAY) {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = -129;
model.customSw[i].val3 = 0;
}
else if (newFuncFamily == LS_FAMILY_STICKY) {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = 0;
model.customSw[i].delay = 0;
}
else {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = 0;
@@ -207,7 +219,7 @@ void LogicalSwitchesPanel::edited()
RawSource source;
switch (model.customSw[i].getFunctionFamily())
switch (newFuncFamily)
{
case LS_FAMILY_VOFS:
{
@@ -229,6 +241,7 @@ void LogicalSwitchesPanel::edited()
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
break;
case LS_FAMILY_STAY:
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
if (sender() == cswitchOffset[i]) {
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
@@ -236,10 +249,12 @@ void LogicalSwitchesPanel::edited()
else {
model.customSw[i].val3 = TimToVal(cswitchOffset2[i]->value()) - model.customSw[i].val2;
}
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value());
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value()-0.1);
if (model.customSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
cswitchOffset2[i]->clear();
cswitchOffset2[i]->setSuffix("(release)");
}
else {
cswitchOffset2[i]->setSuffix("");
}
break;
default:
@@ -264,7 +279,6 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, doubl
else
sb->setSingleStep(0.1);
sb->setValue(value);
sb->setSuffix("");
}
#define SOURCE1_VISIBLE 0x1
@@ -273,12 +287,13 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, doubl
#define VALUE2_VISIBLE 0x8
#define VALUE3_VISIBLE 0x10
#define VALUE_TO_VISIBLE 0x20
#define DELAY_ENABLED 0x40
void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
{
lock = true;
unsigned int mask = 0;
unsigned int mask = DELAY_ENABLED;
RawSource source = RawSource(model.customSw[i].val1);
RawSourceRange range = source.getRange(model, generalSettings, model.customSw[i].getRangeFlags());
@@ -308,20 +323,25 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
cswitchOffset[i]->setValue(range.step*(model.customSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
}
break;
case LS_FAMILY_VBOOL:
case LS_FAMILY_STICKY:
// no break
case LS_FAMILY_VBOOL:
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings);
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2), generalSettings);
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2), generalSettings, LogicalSwitchesContext);
break;
case LS_FAMILY_STAY:
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE | VALUE3_VISIBLE;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings);
mask &= ~DELAY_ENABLED;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value());
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value()-0.1);
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
if (model.customSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
cswitchOffset2[i]->clear();
cswitchOffset2[i]->setSuffix(tr("(release)"));
}
else {
cswitchOffset2[i]->setSuffix("");
}
break;
case LS_FAMILY_VCOMP:
@@ -342,6 +362,11 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
cswitchOffset[i]->setVisible(mask & VALUE2_VISIBLE);
cswitchOffset2[i]->setVisible(mask & VALUE3_VISIBLE);
cswitchTOffset[i]->setVisible(mask & VALUE_TO_VISIBLE);
if (firmware->getCapability(LogicalSwitchesExt)) {
cswitchDelay[i]->setEnabled(mask & DELAY_ENABLED);
cswitchDuration[i]->setValue(model.customSw[i].duration/10.0);
cswitchDelay[i]->setValue(model.customSw[i].delay/10.0);
}
lock = false;
}
@@ -392,7 +417,7 @@ void LogicalSwitchesPanel::populateCSWCB(QComboBox *b, int value)
void LogicalSwitchesPanel::populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
{
if (IS_ARM(firmware->getBoard())) {
populateSwitchCB(b, value, generalSettings, POPULATE_ONOFF);
populateSwitchCB(b, value, generalSettings, LogicalSwitchesContext);
}
else {
RawSwitch item;
@@ -425,10 +450,6 @@ void LogicalSwitchesPanel::updateLine(int i)
setSwitchWidgetVisibility(i);
lock = true;
populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.customSw[i].andsw));
if (firmware->getCapability(LogicalSwitchesExt)) {
cswitchDuration[i]->setValue(model.customSw[i].duration/10.0);
cswitchDelay[i]->setValue(model.customSw[i].delay/10.0);
}
lock = false;
}
+2 -2
View File
@@ -26,7 +26,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve);
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
ui->MixDR_CB->setChecked(md->noExpo==0);
@@ -76,7 +76,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
}
}
populateSwitchCB(ui->switchesCB, md->swtch, generalSettings);
populateSwitchCB(ui->switchesCB, md->swtch, generalSettings, MixesContext);
ui->warningCB->setCurrentIndex(md->mixWarn);
ui->mltpxCB->setCurrentIndex(md->mltpx);
int scale=firmware->getCapability(SlowScale);
+18
View File
@@ -122,6 +122,15 @@ qreal Node::getX()
return 0;
}
void Node::setX(qreal newX)
{
if(scene())
{
QRectF rect = scene()->sceneRect();
QGraphicsObject::setX(rect.left() + (newX+1) * rect.width()/2);
}
}
qreal Node::getY()
{
if(scene())
@@ -132,6 +141,15 @@ qreal Node::getY()
return 0;
}
void Node::setY(qreal newY)
{
if(scene())
{
QRectF rect = scene()->sceneRect();
QGraphicsObject::setY(rect.top() + (newY+1) * rect.height()/2);
}
}
QList<Edge *> Node::edges() const
{
return edgeList;
+2
View File
@@ -72,6 +72,8 @@ class Node : public QGraphicsObject
int getBallSize() {return ballSize;}
qreal getX();
qreal getY();
void setX(qreal newX);
void setY(qreal newX);
void setCenteringX(bool val) {centerX = val;}
void setCenteringY(bool val) {centerY = val;}
+6 -3
View File
@@ -15,7 +15,7 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
lock = true;
// Mode
populateSwitchCB(ui->mode, timer.mode, generalSettings, POPULATE_TIMER_MODES);
populateSwitchCB(ui->mode, timer.mode, generalSettings, TimersContext);
if (!firmware->getCapability(PermTimers)) {
ui->persistent->hide();
@@ -179,6 +179,7 @@ void ModulePanel::update()
{
unsigned int mask = 0;
Protocol protocol = (Protocol)module.protocol;
unsigned int max_rx_num = 63;
if (moduleIdx >= 0) {
mask |= MASK_PROTOCOL;
@@ -195,6 +196,7 @@ void ModulePanel::update()
case DSMX:
mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER;
module.channelsCount = 6;
max_rx_num = 20;
break;
case PPM:
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
@@ -210,8 +212,9 @@ void ModulePanel::update()
ui->label_protocol->setVisible(mask & MASK_PROTOCOL);
ui->protocol->setVisible(mask & MASK_PROTOCOL);
ui->label_rxNumber->setVisible(mask & MASK_FAILSAFES);
ui->rxNumber->setVisible(mask & MASK_FAILSAFES);
ui->label_rxNumber->setVisible(mask & MASK_RX_NUMBER);
ui->rxNumber->setVisible(mask & MASK_RX_NUMBER);
ui->rxNumber->setMaximum(max_rx_num);
ui->rxNumber->setValue(model.modelId);
ui->label_channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
ui->channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
+3 -3
View File
@@ -507,16 +507,16 @@
<string/>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>125</number>
<number>63</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>1</number>
<number>0</number>
</property>
</widget>
</item>
+5 -31
View File
@@ -198,12 +198,14 @@ void TelemetryAnalog::on_CalibSB_editingFinished()
}
if (alarm2value<calib) {
alarm2value=calib;
} else if (alarm2value>(ratio+calib)) {
}
else if (alarm2value>(ratio+calib)) {
alarm2value=ratio+calib;
}
analog.alarms[0].value=round(((alarm1value-calib)*255)/ratio);
analog.alarms[1].value=round(((alarm2value-calib)*255)/ratio);
} else {
}
else {
analog.offset=0;
analog.alarms[0].value=0;
analog.alarms[1].value=0;
@@ -591,7 +593,6 @@ void TelemetryPanel::setup()
int varioCap = firmware->getCapability(HasVario);
if (!varioCap) {
ui->varioLimitMax_DSB->hide();
ui->varioLimitMinOff_ChkB->hide();
ui->varioLimitMin_DSB->hide();
ui->varioLimitCenterMin_DSB->hide();
ui->varioLimitCenterMax_DSB->hide();
@@ -605,7 +606,6 @@ void TelemetryPanel::setup()
}
else {
if (!firmware->getCapability(HasVarioSink)) {
ui->varioLimitMinOff_ChkB->hide();
ui->varioLimitMin_DSB->hide();
ui->varioLimitCenterMin_DSB->hide();
ui->VarioLabel_1->hide();
@@ -614,15 +614,7 @@ void TelemetryPanel::setup()
ui->varioLimitMin_DSB->setValue(model.frsky.varioMin-10);
ui->varioLimitMax_DSB->setValue(model.frsky.varioMax+10);
ui->varioLimitCenterMax_DSB->setValue((model.frsky.varioCenterMax/10.0)+0.5);
if (model.frsky.varioCenterMin==-16) {
ui->varioLimitMinOff_ChkB->setChecked(true);
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setDisabled(true);
}
else {
ui->varioLimitMinOff_ChkB->setChecked(false);
ui->varioLimitCenterMin_DSB->setValue((model.frsky.varioCenterMin/10.0)-0.5);
}
ui->varioLimitCenterMin_DSB->setValue((model.frsky.varioCenterMin/10.0)-0.5);
}
ui->altimetryGB->setVisible(firmware->getCapability(HasAltitudeSel) || firmware->getCapability(HasVario)),
@@ -799,24 +791,6 @@ void TelemetryPanel::on_varioLimitCenterMin_DSB_editingFinished()
}
}
void TelemetryPanel::on_varioLimitMinOff_ChkB_toggled(bool checked)
{
if (!lock) {
model.frsky.varioCenterMin = -16;
if (!checked) {
lock=true;
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setEnabled(true);
lock=false;
}
else {
ui->varioLimitCenterMin_DSB->setValue(-2.0);
ui->varioLimitCenterMin_DSB->setDisabled(true);
}
emit modified();
}
}
void TelemetryPanel::on_varioLimitCenterMax_DSB_editingFinished()
{
if (!lock) {
-1
View File
@@ -97,7 +97,6 @@ class TelemetryPanel : public ModelPanel
void on_varioLimitMin_DSB_editingFinished();
void on_varioLimitMax_DSB_editingFinished();
void on_varioLimitCenterMin_DSB_editingFinished();
void on_varioLimitMinOff_ChkB_toggled(bool checked);
void on_varioLimitCenterMax_DSB_editingFinished();
void on_fasOffset_DSB_editingFinished();
void on_mahCount_SB_editingFinished();
+2 -15
View File
@@ -281,10 +281,10 @@
<number>1</number>
</property>
<property name="minimum">
<double>-2.000000000000000</double>
<double>-2.100000000000000</double>
</property>
<property name="maximum">
<double>0.000000000000000</double>
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
@@ -363,19 +363,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="varioLimitMinOff_ChkB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Off</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="VarioLabel_2">
<property name="sizePolicy">
+13 -21
View File
@@ -31,12 +31,12 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
te->clear();
QString modelname=g_model->name;
if (modelname.isEmpty()) {
curvefile5=QString("%1/curve5.png").arg(qd->tempPath());
curvefile9=QString("%1/curve9.png").arg(qd->tempPath());
curvefile5=generateProcessUniqueTempFileName("curve5.png");
curvefile9=generateProcessUniqueTempFileName("curve9.png");
}
else {
curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname);
curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname);
curvefile5=generateProcessUniqueTempFileName(QString("%1-curve5.png").arg(modelname));
curvefile9=generateProcessUniqueTempFileName(QString("%1-curve9.png").arg(modelname));
}
printSetup();
if (gvars) {
@@ -60,19 +60,14 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS
void PrintDialog::closeEvent(QCloseEvent *event)
{
if (printfilename.isEmpty()) {
QByteArray ba = curvefile5.toLatin1();
char *name = ba.data();
unlink(name);
ba = curvefile9.toLatin1();
name = ba.data();
unlink(name);
}
}
PrintDialog::~PrintDialog()
{
delete ui;
// notice PrintDialog::closeEvent() is not called if user clicks on Close button
qunlink(curvefile5);
qunlink(curvefile9);
delete ui;
}
QString doTC(const QString s, const QString color="", bool bold=false)
@@ -121,10 +116,8 @@ void PrintDialog::printSetup()
str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay,
str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].polarityToString()));
str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled")));
str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled")));
// TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw)));
str.append(fv(tr("Trim Increment"), getTrimInc(g_model)));
str.append(fv(tr("Center Beep"), getCenterBeep(g_model))); // specify which channels beep
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model))); // specify which channels beep
str.append("</td></tr></table></td>");
if (!gvars) {
str.append("<td width=\"380\">");
@@ -340,7 +333,6 @@ void PrintDialog::printMixes()
if (firmware->getCapability(HasNoExpo) && md->noExpo) str += " " + Qt::escape(tr("No DR/Expo"));
if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset)));
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
int scale = firmware->getCapability(SlowScale);
if (scale == 0)
@@ -379,22 +371,22 @@ void PrintDialog::printLimits()
if (firmware->getCapability(HasChNames)) {
str.append("<tr><td><b>"+tr("Name")+"</b></td>");
for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(g_model->limitData[i].name,"green"));
str.append(doTR(g_model->limitData[i].name, "green"));
}
}
str.append("<tr><td><b>"+tr("Offset")+"</b></td>");
for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green"));
str.append(doTR(g_model->limitData[i].offsetToString(), "green"));
}
str.append("</tr>");
str.append("<tr><td><b>"+tr("Min")+"</b></td>");
for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green"));
str.append(doTR(g_model->limitData[i].minToString(), "green"));
}
str.append("</tr>");
str.append("<tr><td><b>"+tr("Max")+"</b></td>");
for(int i=0; i<firmware->getCapability(Outputs); i++) {
str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green"));
str.append(doTR(g_model->limitData[i].maxToString(), "green"));
}
str.append("</tr>");
str.append("<tr><td><b>"+tr("Invert")+"</b></td>");
+1 -1
View File
@@ -37,7 +37,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No Radio was found!&lt;/p&gt;&lt;p&gt;Make sure that you hold the lower trim buttons towards the center while you turn it on.&lt;/p&gt;&lt;p&gt;Then connect the USB wire.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No Radio was found!&lt;/p&gt;&lt;p&gt;Make sure that you hold the lower trim buttons towards the center while you turn it on.&lt;/p&gt;&lt;p&gt;Then connect the USB wire.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-family:'arial,sans-serif'; font-size:13px; font-style:italic; color:#222222; background-color:#ffffff;&quot;&gt;Note: if you have a Taranis that has not had the firmware upgraded to 2.0 then this version of Companion will not work.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
+3 -2
View File
@@ -137,8 +137,9 @@ void joystickDialog::on_okButton_clicked() {
QCheckBox * ib[]={ui->ChInv_1, ui->ChInv_2, ui->ChInv_3, ui->ChInv_4, ui->ChInv_5, ui->ChInv_6, ui->ChInv_7, ui->ChInv_8};
foreach(QComboBox *cb, findChildren<QComboBox *>(QRegExp("jsmapCB_[0-9]+"))) {
int axe=cb->objectName().mid(cb->objectName().lastIndexOf("_")+1).toInt()-1;
int stick=cb->currentIndex();
if (stick > 0) {
int stick=cb->currentIndex() - 1;
qDebug() << "joystick mapping " << cb->objectName() <<"axe:" << axe << "stick:" << stick;
if (stick >= 0) {
g.joystick[stick].stick_axe( axe );
g.joystick[stick].stick_max( jscal[axe][2] );
g.joystick[stick].stick_med( jscal[axe][1] );
+17 -26
View File
@@ -298,7 +298,7 @@ void SimulatorDialog::initUi(T * ui)
for (int j=0; j<8; j++){
int axe = g.joystick[j].stick_axe();
if (axe>=0 && axe<8) {
jsmap[axe]=j;
jsmap[axe]=j+1;
jscal[axe][0] = g.joystick[j].stick_min();
jscal[axe][1] = g.joystick[j].stick_med();
jscal[axe][2] = g.joystick[j].stick_max();
@@ -987,37 +987,28 @@ void SimulatorDialog::onjoystickAxisValueChanged(int axis, int value)
if (jscal[axis][3]==1) {
stickval*=-1;
}
if (stick==1 || stick==2) {
float currX=nodeRight->getX();
float currY=nodeRight->getY();
if (stick==1 ) {
nodeRight->setPos(currX*100-10,-stickval*100/1024-10);
}
if (stick==2) {
nodeRight->setPos(stickval*100/1024-10,currY*100-10);
}
}
else if (stick==3 || stick==4) {
float currX=nodeLeft->getX();
float currY=nodeLeft->getY();
if (stick==3) {
nodeLeft->setPos(currX*100-10,-stickval*100/1024-10);
}
if (stick==4) {
nodeLeft->setPos(stickval*100/1024-10,currY*100-10);
}
}
if (stick==5) {
if (stick==1 ) {
nodeRight->setY(-stickval/1024.0);
}
else if (stick==2) {
nodeRight->setX(stickval/1024.0);
}
else if (stick==3) {
nodeLeft->setY(-stickval/1024.0);
}
else if (stick==4) {
nodeLeft->setX(stickval/1024.0);
}
else if (stick==5) {
dialP_1->setValue(stickval);
}
if (stick==6) {
else if (stick==6) {
dialP_2->setValue(stickval);
}
if (stick==7) {
else if (stick==7) {
dialP_3->setValue(stickval);
}
if (stick==8 && dialP_4) {
else if (stick==8 && dialP_4) {
dialP_4->setValue(stickval);
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -628,8 +628,8 @@ void ElevonsPage::initializePage()
bool ElevonsPage::validatePage()
{
releaseBookings();
return (bookChannel(elevon1CB, AILERONS_INPUT, 100, ELEVATOR_INPUT, 100) &&
bookChannel(elevon2CB, AILERONS_INPUT, -100, ELEVATOR_INPUT, 100));
return (bookChannel(elevon1CB, AILERONS_INPUT, 50, ELEVATOR_INPUT, 50) &&
bookChannel(elevon2CB, AILERONS_INPUT, -50, ELEVATOR_INPUT, 50));
}
RudderPage::RudderPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage):
@@ -1002,7 +1002,7 @@ WizardPrinter::WizardPrinter(WizMix *wizMix)
mix = wizMix;
}
QString WizardPrinter::printChannel( Input input1, int weight1, Input input2, int weight2 )
QString WizardPrinter::printChannel( Input input1, int weight1, Input input2, int weight2 )
{
QString str;
str = QString("[%1, %2]").arg(inputName(input1)).arg(weight1);
-1
View File
@@ -136,7 +136,6 @@ void saveModel(ModelData & m, model & xm)
trims xtrims;
xtrims.extended(m.extendedTrims);
xtrims.throttleTrim(m.thrTrim);
xtrims.throttleTrimExpo(m.thrExpo);
xm.trims(xtrims);
}
if (m.beepANACenter) {
+1
View File
@@ -24,5 +24,6 @@
#define round(x) floor(x+0.5)
#define strcasecmp _stricmp
#define strncasecmp _tcsnicmp
#define snprintf _snprintf
#endif
+191 -104
View File
@@ -1,191 +1,278 @@
<h2>Version 2.0.7 / 2014-07-15</h2>
<h2>Version 2.0.13 / 2014-11-20</h2>
[Taranis]
<ul>
<li>Instant Trim problem when using a negative curve
<li>Compilation with -Os instead of -O2 because of a strange bug on LS1 (AND condition changed by itself on SD error)</li>
<li>Lua getTimer and setTimer parameters fixed (persistent and minuteBeep)</li>
<li>Lua resetTimer function added</li>
<li>SWR shown on newer Taranis+</li>
<li>BOLD, CONDENSED, FIXED constants exported to Lua</li>
<li>Disable mixer line that uses a Lua source if the Lua script is not running</li>
<li>Additional parameters for Lua model.getMix/insertMix</li>
<li>Fixed occasional SD card error</li>
<li>Fixed bitmap loading</li>
</ul>
[9XR-PRO]
<ul>
<li>Coprocessor interface bugfix</li>
</ul>
[Stock]
<ul>
<li>Fixed never ending haptic repeat</li>
<li>Fixed curves display</li>
</ul>
[All]
<ul>
<li>SafetyCH function was missing on the compilation server
<li>Stick icons missing next to trim key states on switch diag page</li>
</ul>
<h2>Version 2.0.12 / 2014-09-16</h2>
[Taranis]
<ul>
<li>LTR patch (modified) applied to the Lua code. Saves around 8-10k RAM</li>
<li>Lua hardening again!</li>
<li>bit32 lib added to the Lua interpreter</li>
<li>Audio tones distorsion (just after playing a wav file)</li>
<li>ABS changed to ON in Timers modes</li>
<li>S2 and S3 pots inverted on Taranis+</li>
</ul>
<h2>Version 2.0.11 / 2014-09-10</h2>
[9XR-PRO]
<ul>
<li>Audio broken (since we changed the ARM GCC compiler)</li>
</ul>
[Taranis]
<ul>
<li>Switch warning didn't allow access to SG</li>
<li>Pot warning would show S3 when the cursor wasn't on the Pot Warning line</li>
</ul>
<h2>Version 2.0.10 / 2014-09-08</h2>
[All]
<ul>
<li>Duration and AND fixed on Sticky and Edge logical switches</li>
</ul>
[Taranis]
<ul>
<li>CCPM issue on Helis when cross trims used</li>
<li>Taranis+ LCD color range and brightness adjusted</li>
<li>Taranis+ SWR removed</li>
<li>Lua small enhancements (TIMEHOUR constant, GVARS over 500)</li>
<li>Lua hardening, use of newlib-nano (optimizes RAM usage)</li>
<li>Incoming telemetry rejected if RSSI=0</li>
<li>Assign Bitmap impossible if filename length too big</li>
</ul>
[9XR-PRO]
<ul>
<li>Telemetry enabled</li>
</ul>
<h2>Version 2.0.8 / 2014-07-23</h2>
[Taranis]
<ul>
<li>Curve wrongly displayed when used in an Input with a positive offset</li>
<li>Telemetry Channels are now accessible through Lua</li>
<li>New string Lua fields added for accessing sources</li>
<li>Trims now applied on Inputs when used in Logical Switches</li>
<li>Option "nojoystick" added</li>
</ul>
<h2>Version 2.0.7 / 2014-07-15</h2>
[Taranis]
<ul>
<li>Instant Trim problem when using a negative curve</li>
</ul>
[All]
<ul>
<li>SafetyCH function was missing on the compilation server</li>
</ul>
<h2>Version 2.0.6 / 2014-07-13</h2>
[Taranis]
<ul>
<li>Telemetry Type field is hidden when only S.PORT is available
<li>Permanent timers may be not resetted on Flight Reset
<li>Instant Trim bugfix
<li>No sound on trim press when trim option disabled
<li>[Page] / [Page Long] allowed to change Telemetry screen
<li>XXL font added for Lua telemetry screens
<li>
<li>Telemetry Type field is hidden when only S.PORT is available</li>
<li>Permanent timers may be not resetted on Flight Reset</li>
<li>Instant Trim bugfix</li>
<li>No sound on trim press when trim option disabled</li>
<li>[Page] / [Page Long] allowed to change Telemetry screen</li>
<li>XXL font added for Lua telemetry screens</li>
</ul>
[9XR-PRO / Sky9x]
<ul>
<li>RTC time was not stored correctly
<li>PPM polarity fix
<li>RTC time was not stored correctly</li>
<li>PPM polarity fix</li>
</ul>
[Gruvin9x, 9X128, 9XR128]
<ul>
<li>12 logical switches instead of 15 (the extra ones were not accessible in custom functions)
<li>12 logical switches instead of 15 (the extra ones were not accessible in custom functions)</li>
</ul>
[All]
<ul>
<li>Logical switches were not resetted on Model load
<li>SafetyCH function can be hidden (depending on Companion options)
<li>MPH to km/h conversion improved
<li>Logical switches were not resetted on Model load</li>
<li>SafetyCH function can be hidden (depending on Companion options)</li>
<li>MPH to km/h conversion improved</li>
</ul>
<h2>Version 2.0.5 / 2014-06-26</h2>
[Taranis]
<ul>
<li>Add Flight Mode indication to the mixer/inputs screens
<li>Joystick emulation fixed
<li>Fixed float number display in Lua
<li>Fixed telemetry screens page order (Lua, custom, voltage, GPS)
<li>Fixed unability to disable switch warning for SG
<li>Lua bugfixes in getCustomFunction/setCustomFunction and getLogicalSwitch/setLogicalSwitch
<li>Add Flight Mode indication to the mixer/inputs screens</li>
<li>Joystick emulation fixed</li>
<li>Fixed float number display in Lua</li>
<li>Fixed telemetry screens page order (Lua, custom, voltage, GPS)</li>
<li>Fixed unability to disable switch warning for SG</li>
<li>Lua bugfixes in getCustomFunction/setCustomFunction and getLogicalSwitch/setLogicalSwitch</li>
</ul>
<h2>Version 2.0.4 / 2014-06-24</h2>
[Taranis]
<ul>
<li>Lua Telemetry custom screens added
<li>Lua wrong memory used indication
<li>Telemetry on the serial port in the battery bay
<li>
<li>Lua Telemetry custom screens added</li>
<li>Lua wrong memory used indication</li>
<li>Telemetry on the serial port in the battery bay</li>
</ul>
[All]
<ul>
<li>Air Speed added in Logs
<li>|d|>x bug fix
<li>Air Speed added in Logs</li>
<li>|d|>x bug fix</li>
<li>Timers played even if 00:00
</ul>
<h2>Version 2.0.3 / 2014-06-17</h2>
<ul>
<li>Bugfix on Reset Flight function (possible freeze of the menus)
<li>Imperial units bug (on altitude)
<li>FIRMWARE.BIN and EEPROM.BIN are not anymore marked as system files
<li>Bugfix on Reset Flight function (possible freeze of the menus)</li>
<li>Imperial units bug (on altitude)</li>
<li>FIRMWARE.BIN and EEPROM.BIN are not anymore marked as system files</li>
</ul>
<h2>Version 2.0.2 / 2014-06-12</h2>
<ul>
<li>RxBatt removed (merged with A1 as before)
<li>Bootloader accessible through the 2 trims (as 2.0.0)
<li>Delay on switches middle position only applied to Play functions
<li>Delay for Play functions is configurable (0-300ms)
<li>SWR, A3 and A4 now recorded in SD logs
<li>Persistent mAh was not correctly stored in EEPROM
<li>A lot of small bug fixes
<li>RxBatt removed (merged with A1 as before)</li>
<li>Bootloader accessible through the 2 trims (as 2.0.0)</li>
<li>Delay on switches middle position only applied to Play functions</li>
<li>Delay for Play functions is configurable (0-300ms)</li>
<li>SWR, A3 and A4 now recorded in SD logs</li>
<li>Persistent mAh was not correctly stored in EEPROM</li>
<li>A lot of small bug fixes</li>
</ul>
<h2>OpenTX 2.0.1 / 2014-02-05</h2>
[Taranis]
<ul>
<li>S.PORT / D protocol choice added in TELEMETRY menu
<li>Heli mixer fix (stick modes 2/3/4)
<li>Multipos switch fix
<li>Italian translations updated
<li>French translations fixes
<li>Multis Wizard added
<li>Bootloader now needs only one trim pressed
<li>S3 warning hidden (no S3 on Taranis)
<li>Persistent mAh was broken
<li>S.PORT / D protocol choice added in TELEMETRY menu</li>
<li>Heli mixer fix (stick modes 2/3/4)</li>
<li>Multipos switch fix</li>
<li>Italian translations updated</li>
<li>French translations fixes</li>
<li>Multis Wizard added</li>
<li>Bootloader now needs only one trim pressed</li>
<li>S3 warning hidden (no S3 on Taranis)</li>
<li>Persistent mAh was broken</li>
</ul>
[Stock]
<ul>
<li>Fix for LS used as source
<li>Fix for LS used as source</li>
</ul>
[All]
<ul>
<li>Fix on d>=x logical switches
<li>Fix on d>=x logical switches</li>
</ul>
<h2>OpenTX 2.0.0 / 2014-06-02</h2>
[Taranis]
<ul>
<li>Inputs layer with support for all physical inputs and telemetry
<li>Lua interpreter for runtime scripts and one-time configuration assistants
<li>GVARs useable for offsets and limits
<li>GVAR modification popup on home screen can be enabled/disabled for each GVAR
<li>Output curve assignable to each servo on the SERVOS page
<li>32 curves instead of 16, with smoothing, and any number of points between 2 and 17
<li>Pot position memory for the 4 pots, with startup warning
<li>Copy/paste/insert/delete of custom function lines
<li>Altitude can be displayed in the top bar
<li>FrSky Taranis will run at 120MHz instead of 60MHz
<li>New trim system (a mode's trims can be relative to that of another mode's)
<li>SPORT data form internal module available on the UART connector in the battery compartment in the Taranis
<li>Support for 6-position pots, with individual positions available in the switch selection list
<li>Taranis will be useable as a standard PC joystick through USB, 8 analogs and 8 buttons mapped to CH1-8 and 9-16 respectively
<li>Inputs layer with support for all physical inputs and telemetry</li>
<li>Lua interpreter for runtime scripts and one-time configuration assistants</li>
<li>GVARs useable for offsets and limits</li>
<li>GVAR modification popup on home screen can be enabled/disabled for each GVAR</li>
<li>Output curve assignable to each servo on the SERVOS page</li>
<li>32 curves instead of 16, with smoothing, and any number of points between 2 and 17</li>
<li>Pot position memory for the 4 pots, with startup warning</li>
<li>Copy/paste/insert/delete of custom function lines</li>
<li>Altitude can be displayed in the top bar</li>
<li>FrSky Taranis will run at 120MHz instead of 60MHz</li>
<li>New trim system (a mode's trims can be relative to that of another mode's)</li>
<li>SPORT data form internal module available on the UART connector in the battery compartment in the Taranis</li>
<li>Support for 6-position pots, with individual positions available in the switch selection list</li>
<li>Taranis will be useable as a standard PC joystick through USB, 8 analogs and 8 buttons mapped to CH1-8 and 9-16 respectively</li>
</ul>
[ARM Boards]
<ul>
<li>Measured consumption (mAh) can be stored on power off
<li>0.1% resolution for limits
<li>Sound repeat time settable in multiples of 1sec, call at model load can be disabled
<li>3 options for timer countdown voice output
<li>9 GVARS instead of 5 (ARM boards only)
<li>64 custom functions instead of 32
<li>Ability to read text files from the SD card. A file with the name of a model will be linked to it and easily accessible as "model notes". Can be displayed automatically at model load for use as a checklist
<li>Bootloader added, removes the need to install computer drivers to flash new firmware
<li>Radio can handle EEPROM conversion by itself (no need for companion)
<li>Improved vario sounds
<li>Default audio files can be placed on the SD card for each model for all switch positions (both for physical and logical switches).
<li>Support for up to 16 channels on trainer input
<li>Measured consumption (mAh) can be stored on power off</li>
<li>0.1% resolution for limits</li>
<li>Sound repeat time settable in multiples of 1sec, call at model load can be disabled</li>
<li>3 options for timer countdown voice output</li>
<li>9 GVARS instead of 5 (ARM boards only)</li>
<li>64 custom functions instead of 32</li>
<li>Ability to read text files from the SD card. A file with the name of a model will be linked to it and easily accessible as "model notes". Can be displayed automatically at model load for use as a checklist</li>
<li>Bootloader added, removes the need to install computer drivers to flash new firmware</li>
<li>Radio can handle EEPROM conversion by itself (no need for companion)</li>
<li>Improved vario sounds</li>
<li>Default audio files can be placed on the SD card for each model for all switch positions (both for physical and logical switches)</li>
<li>Support for up to 16 channels on trainer input</li>
</ul>
[All]
<ul>
<li>Proportional fonts
<li>Switch warnings can be disabled for switches you don't use on a given model
<li>Compensation for offset error of FrSky FAS-xx current sensors (option on m64)
<li>Companion merged into OpenTX
<li>Companion major code / graphics refactoring
<li>Sticky Logical Switches
<li>ASpd, dTE, Cel-, Vfas- added to Telemetry values
<li>Workaround for newer bogus FlySky modules that send out servo centers on powerup (9x only)
<li>Finnish language support
<li>Proportional fonts</li>
<li>Switch warnings can be disabled for switches you don't use on a given model</li>
<li>Compensation for offset error of FrSky FAS-xx current sensors (option on m64)</li>
<li>Companion merged into OpenTX</li>
<li>Companion major code / graphics refactoring</li>
<li>Sticky Logical Switches</li>
<li>ASpd, dTE, Cel-, Vfas- added to Telemetry values</li>
<li>Workaround for newer bogus FlySky modules that send out servo centers on powerup (9x only)</li>
<li>Finnish language support</li>
</ul>
<h2>2940 / 2014-02-02</h2>
[ARM Boards]
<ul>
<li>Wav files played even in silent mode
<li>GPS support had broken VFAS
<li>Wav files played even in silent mode</li>
<li>GPS support had broken VFAS</li>
</ul>
[All]
<ul>
<li>Custom function triggered by a CSW based on analog triggering erroneously at powerup
<li>Problem with mixer weight field when !GVARS
<li>PPM5 was broken
<li>Custom function triggered by a CSW based on analog triggering erroneously at powerup</li>
<li>Problem with mixer weight field when !GVARS</li>
<li>PPM5 was broken</li>
</ul>
<h2>2923 / 2014-01-08</h2>
[ARM Boards]
<ul>
<li>Audio freeze bug fixed
<li>Aurora gimbals support
<li>Audio freeze bug fixed</li>
<li>Aurora gimbals support</li>
</ul>
<h2>2834 / 2013-10-29</h2>
[ARM Boards]
<ul>
<li>Altitude played without decimal when &gt;= 10m
<li>Check to avoid too long paths when playing SD files
<li>Altitude played without decimal when &gt;= 10m</li>
<li>Check to avoid too long paths when playing SD files</li>
</ul>
[All]
<ul>
<li>Mixer bug when a MULTIPLY mix used with a slow
<li>GVAR popup removed
<li>Sticky virtual switches are reset when ResetFlight function is called
<li>Mixer bug when a MULTIPLY mix used with a slow</li>
<li>GVAR popup removed</li>
<li>Sticky virtual switches are reset when ResetFlight function is called </li>
</ul>
<h2>2768 / 2013-09-20</h2>
@@ -269,26 +356,26 @@
<ul>
<li>Flash savings</li>
<li>Vario sink tones removed</li>
<li>Audio files renumbered (see here) </li>
<li>Audio files renumbered (see here)</li>
</ul>
[Sky9x]
<ul>
<li>Audio mixer: several sounds can now be played simulataneously, and beeps won't interrupt and clear voice alerts anymore. Note that sound files now need to have sampling rates of either 8, 16 or 32kHz and may need to be replaced. </li>
<li>Audio mixer: several sounds can now be played simulataneously, and beeps won't interrupt and clear voice alerts anymore. Note that sound files now need to have sampling rates of either 8, 16 or 32kHz and may need to be replaced</li>
</ul>
<h2>2413 / 2013-05-22</h2>
[All]
<ul>
<li>Calibration screen automatically appears following an EEPROM format</li>
<li>Wraparound in popup menus </li>
<li>Wraparound in popup menus</li>
</ul>
[9X Stock]
<ul>
<li>More options supported (novario / nogps / nogauges)</li>
<li>Flash savings</li>
<li>Mavlink huge rework by Rienk! </li>
<li>Mavlink huge rework by Rienk!</li>
</ul>
[Sky9x]
@@ -300,17 +387,17 @@
<h2>2215 / 2013-04-05</h2>
[All]
<ul>
<li>New option AUTOSOURCE to automatically select the stick / pot / switch which is moved when editing a Mix source </li>
<li>New option AUTOSOURCE to automatically select the stick / pot / switch which is moved when editing a Mix source</li>
</ul>
[9X Stock]
<ul>
<li>All prompts renumbered to have the "custom" prompts starting at 0 and to be able to use PlayTrack?(GVAR) with Adjust(GVAR) to play tracks sequences </li>
<li>All prompts renumbered to have the "custom" prompts starting at 0 and to be able to use PlayTrack?(GVAR) with Adjust(GVAR) to play tracks sequences</li>
</ul>
[Gruvin9x]
<ul>
<li>Possibility to have both BEEPER and SPEAKER enable in the same time </li>
<li>Possibility to have both BEEPER and SPEAKER enable in the same time</li>
</ul>
[Sky9x]
@@ -320,5 +407,5 @@
<li>Possibility to have both BEEPER and SPEAKER enable in the same time</li>
<li>New menu in Main Views / Telemetry Views</li>
<li>Vario sounds improved!</li>
<li>SD Folders renamed. "9XSOUNDS" becomes "SOUNDS", don't forget to updateyour cards!</li>
<li>SD Folders renamed. "9XSOUNDS" becomes "SOUNDS", don't forget to update your SD card!</li>
</ul>
+3
View File
@@ -24,3 +24,6 @@
/gtests
/gtest_main.a
/gtests.d
/lua_exports.cpp
/lua_exports.txt
/lua_fields.txt
+1 -1
View File
@@ -20,7 +20,7 @@
#include <CoOS.h>
#define OsSchedLock() OSSchedLock++; /*!< Lock schedule */
#define OsSchedLock() { OSSchedLock++; asm volatile ("" : : : "memory"); } /*!< Lock schedule */
extern void OsSchedUnlock(void);
#endif
+28 -3
View File
@@ -1,4 +1,4 @@
FatFs Module Source Files R0.09b (C)ChaN, 2013
FatFs Module Source Files R0.10c (C)ChaN, 2014
FILES
@@ -24,7 +24,7 @@ AGREEMENTS
small embedded systems. This is a free software and is opened for education,
research and commercial developments under license policy of following trems.
Copyright (C) 2012, ChaN, all right reserved.
Copyright (C) 2014, ChaN, all right reserved.
* The FatFs module is a free software and there is NO WARRANTY.
* No restriction on use. You can use, modify and redistribute it for
@@ -134,5 +134,30 @@ REVISION HISTORY
Changed f_open() and f_opendir() reject null object pointer to avoid crash.
Changed option name _FS_SHARE to _FS_LOCK.
Jan 23,'13 R0.09b Added f_getlabel() and f_setlabel(). (_USE_LABEL == 1)
Jan 23,'13 R0.09b Added f_getlabel() and f_setlabel(). (_USE_LABEL)
Oct 02,'13 R0.10 Added selection of character encoding on the file. (_STRF_ENCODE)
Added f_closedir().
Added forced full FAT scan for f_getfree(). (_FS_NOFSINFO)
Added forced mount feature with changes of f_mount().
Improved behavior of volume auto detection.
Improved write throughput of f_puts() and f_printf().
Changed argument of f_chdrive(), f_mkfs(), disk_read() and disk_write().
Fixed f_write() can be truncated when the file size is close to 4GB.
Fixed f_open(), f_mkdir() and f_setlabel() can return incorrect error code.
Jan 15,'14 R0.10a Added arbitrary strings as drive number in the path name. (_STR_VOLUME_ID)
Added a configuration option of minimum sector size. (_MIN_SS)
2nd argument of f_rename() can have a drive number and it will be ignored.
Fixed f_mount() with forced mount fails when drive number is >= 1.
Fixed f_close() invalidates the file object without volume lock.
Fixed f_closedir() returns but the volume lock is left acquired.
Fixed creation of an entry with LFN fails on too many SFN collisions.
Mar 19,'14 R0.10b Fixed a hard error in the disk I/O layer can collapse the directory entry.
Fixed LFN entry is not deleted on delete/rename an object with lossy converted SFN.
Nov 09,'14 R0.10c Added a configuration option for the platforms without RTC. (_FS_NORTC)
Fixed volume label created by Mac OS X cannot be retrieved with f_getlabel().
Fixed a potential problem of FAT access that can appear on disk error.
Fixed null pointer dereference on attempting to delete the root direcotry.
+12 -20
View File
@@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------
/ Low level disk interface modlue include file (C)ChaN, 2013
/*-----------------------------------------------------------------------/
/ Low level disk interface modlue include file (C)ChaN, 2014 /
/-----------------------------------------------------------------------*/
#ifndef _DISKIO_DEFINED
@@ -34,12 +34,13 @@ typedef enum {
DSTATUS disk_initialize (BYTE pdrv);
DSTATUS disk_status (BYTE pdrv);
DRESULT disk_read (BYTE pdrv, BYTE*buff, DWORD sector, BYTE count);
DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, BYTE count);
DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
/* Disk Status Bits (DSTATUS) */
#define STA_NOINIT 0x01 /* Drive not initialized */
#define STA_NODISK 0x02 /* No medium in the drive */
#define STA_PROTECT 0x04 /* Write protected */
@@ -47,14 +48,14 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
/* Command code for disk_ioctrl fucntion */
/* Generic command (used by FatFs) */
#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
/* Generic command (Used by FatFs) */
#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
/* Generic command (not used by FatFs) */
/* Generic command (Not used by FatFs) */
#define CTRL_POWER 5 /* Get/Set power status */
#define CTRL_LOCK 6 /* Lock/Unlock media removal */
#define CTRL_EJECT 7 /* Eject media */
@@ -72,15 +73,6 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
#define ATA_GET_MODEL 21 /* Get model name */
#define ATA_GET_SN 22 /* Get serial number */
/* MMC card type flags (MMC_GET_TYPE) */
#define CT_MMC 0x01 /* MMC ver 3 */
#define CT_SD1 0x02 /* SD ver 1 */
#define CT_SD2 0x04 /* SD ver 2 */
#define CT_SDC (CT_SD1|CT_SD2) /* SD */
#define CT_BLOCK 0x08 /* Block addressing */
#ifdef __cplusplus
}
#endif
+1235 -955
View File
File diff suppressed because it is too large Load Diff
+44 -43
View File
@@ -1,11 +1,11 @@
/*---------------------------------------------------------------------------/
/ FatFs - FAT file system module include file R0.09b (C)ChaN, 2013
/ FatFs - FAT file system module include file R0.10c (C)ChaN, 2014
/----------------------------------------------------------------------------/
/ FatFs module is a generic FAT file system module for small embedded systems.
/ This is a free software that opened for education, research and commercial
/ developments under license policy of following terms.
/
/ Copyright (C) 2013, ChaN, all right reserved.
/ Copyright (C) 2014, ChaN, all right reserved.
/
/ * The FatFs module is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
@@ -15,7 +15,7 @@
/----------------------------------------------------------------------------*/
#ifndef _FATFS
#define _FATFS 82786 /* Revision ID */
#define _FATFS 80376 /* Revision ID */
#ifdef __cplusplus
extern "C" {
@@ -23,7 +23,6 @@ extern "C" {
#include "integer.h" /* Basic integer types */
#include "ffconf.h" /* FatFs configuration options */
#if _FATFS != _FFCONF
#error Wrong configuration file (ffconf.h).
#endif
@@ -43,7 +42,7 @@ extern PARTITION VolToPart[]; /* Volume - Partition resolution table */
#else /* Single partition configuration */
#define LD2PD(vol) (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */
#define LD2PT(vol) 0 /* Always mounts the 1st partition or in SFD */
#define LD2PT(vol) 0 /* Find first valid partition or in SFD */
#endif
@@ -53,7 +52,7 @@ extern PARTITION VolToPart[]; /* Volume - Partition resolution table */
#if _LFN_UNICODE /* Unicode string */
#if !_USE_LFN
#error _LFN_UNICODE must be 0 in non-LFN cfg.
#error _LFN_UNICODE must be 0 at non-LFN cfg.
#endif
#ifndef _INC_TCHAR
typedef WCHAR TCHAR;
@@ -78,12 +77,12 @@ typedef struct {
BYTE fs_type; /* FAT sub-type (0:Not mounted) */
BYTE drv; /* Physical drive number */
BYTE csize; /* Sectors per cluster (1,2,4...128) */
BYTE n_fats; /* Number of FAT copies (1,2) */
BYTE wflag; /* win[] dirty flag (1:must be written back) */
BYTE fsi_flag; /* fsinfo dirty flag (1:must be written back) */
BYTE n_fats; /* Number of FAT copies (1 or 2) */
BYTE wflag; /* win[] flag (b0:dirty) */
BYTE fsi_flag; /* FSINFO flags (b7:disabled, b0:dirty) */
WORD id; /* File system mount ID */
WORD n_rootdir; /* Number of root directory entries (FAT12/16) */
#if _MAX_SS != 512
#if _MAX_SS != _MIN_SS
WORD ssize; /* Bytes per sector (512, 1024, 2048 or 4096) */
#endif
#if _FS_REENTRANT
@@ -92,19 +91,18 @@ typedef struct {
#if !_FS_READONLY
DWORD last_clust; /* Last allocated cluster */
DWORD free_clust; /* Number of free clusters */
DWORD fsi_sector; /* fsinfo sector (FAT32) */
#endif
#if _FS_RPATH
DWORD cdir; /* Current directory start cluster (0:root) */
#endif
DWORD n_fatent; /* Number of FAT entries (= number of clusters + 2) */
DWORD n_fatent; /* Number of FAT entries, = number of clusters + 2 */
DWORD fsize; /* Sectors per FAT */
DWORD volbase; /* Volume start sector */
DWORD fatbase; /* FAT start sector */
DWORD dirbase; /* Root directory start sector (FAT32:Cluster#) */
DWORD database; /* Data start sector */
DWORD winsect; /* Current sector appearing in the win[] */
BYTE win[_MAX_SS]; /* Disk access window for Directory, FAT (and Data on tiny cfg) */
BYTE win[_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */
} FATFS;
@@ -114,25 +112,25 @@ typedef struct {
typedef struct {
FATFS* fs; /* Pointer to the related file system object (**do not change order**) */
WORD id; /* Owner file system mount ID (**do not change order**) */
BYTE flag; /* File status flags */
BYTE pad1;
DWORD fptr; /* File read/write pointer (0ed on file open) */
BYTE flag; /* Status flags */
BYTE err; /* Abort flag (error code) */
DWORD fptr; /* File read/write pointer (Zeroed on file open) */
DWORD fsize; /* File size */
DWORD sclust; /* File data start cluster (0:no data cluster, always 0 when fsize is 0) */
DWORD clust; /* Current cluster of fpter */
DWORD dsect; /* Current data sector of fpter */
DWORD sclust; /* File start cluster (0:no cluster chain, always 0 when fsize is 0) */
DWORD clust; /* Current cluster of fpter (not valid when fprt is 0) */
DWORD dsect; /* Sector number appearing in buf[] (0:invalid) */
#if !_FS_READONLY
DWORD dir_sect; /* Sector containing the directory entry */
BYTE* dir_ptr; /* Pointer to the directory entry in the window */
DWORD dir_sect; /* Sector number containing the directory entry */
BYTE* dir_ptr; /* Pointer to the directory entry in the win[] */
#endif
#if _USE_FASTSEEK
DWORD* cltbl; /* Pointer to the cluster link map table (null on file open) */
DWORD* cltbl; /* Pointer to the cluster link map table (Nulled on file open) */
#endif
#if _FS_LOCK
UINT lockid; /* File lock ID (index of file semaphore table Files[]) */
UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */
#endif
#if !_FS_TINY
BYTE buf[_MAX_SS]; /* File data read/write buffer */
BYTE buf[_MAX_SS]; /* File private data read/write window */
#endif
} FIL;
@@ -149,6 +147,9 @@ typedef struct {
DWORD sect; /* Current sector */
BYTE* dir; /* Pointer to the current SFN entry in the win[] */
BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
#if _FS_LOCK
UINT lockid; /* File lock ID (index of file semaphore table Files[]) */
#endif
#if _USE_LFN
WCHAR* lfn; /* Pointer to the LFN working buffer */
WORD lfn_idx; /* Last matched LFN index number (0xFFFF:No LFN) */
@@ -203,38 +204,39 @@ typedef enum {
/*--------------------------------------------------------------*/
/* FatFs module application interface */
FRESULT f_mount (BYTE vol, FATFS* fs); /* Mount/Unmount a logical drive */
FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode); /* Open or create a file */
FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br); /* Read data from a file */
FRESULT f_lseek (FIL* fp, DWORD ofs); /* Move file pointer of a file object */
FRESULT f_close (FIL* fp); /* Close an open file object */
FRESULT f_opendir (DIR* dj, const TCHAR* path); /* Open an existing directory */
FRESULT f_readdir (DIR* dj, FILINFO* fno); /* Read a directory item */
FRESULT f_stat (const TCHAR* path, FILINFO* fno); /* Get file status */
FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br); /* Read data from a file */
FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw); /* Write data to a file */
FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs); /* Get number of free clusters on the drive */
FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */
FRESULT f_lseek (FIL* fp, DWORD ofs); /* Move file pointer of a file object */
FRESULT f_truncate (FIL* fp); /* Truncate file */
FRESULT f_sync (FIL* fp); /* Flush cached data of a writing file */
FRESULT f_opendir (DIR* dp, const TCHAR* path); /* Open a directory */
FRESULT f_closedir (DIR* dp); /* Close an open directory */
FRESULT f_readdir (DIR* dp, FILINFO* fno); /* Read a directory item */
FRESULT f_mkdir (const TCHAR* path); /* Create a sub directory */
FRESULT f_unlink (const TCHAR* path); /* Delete an existing file or directory */
FRESULT f_mkdir (const TCHAR* path); /* Create a new directory */
FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */
FRESULT f_stat (const TCHAR* path, FILINFO* fno); /* Get file status */
FRESULT f_chmod (const TCHAR* path, BYTE value, BYTE mask); /* Change attribute of the file/dir */
FRESULT f_utime (const TCHAR* path, const FILINFO* fno); /* Change times-tamp of the file/dir */
FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */
FRESULT f_chdrive (BYTE drv); /* Change current drive */
FRESULT f_chdir (const TCHAR* path); /* Change current directory */
FRESULT f_chdrive (const TCHAR* path); /* Change current drive */
FRESULT f_getcwd (TCHAR* buff, UINT len); /* Get current directory */
FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* sn); /* Get volume label */
FRESULT f_setlabel (const TCHAR* label); /* Set volume label */
FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */
FRESULT f_mkfs (BYTE vol, BYTE sfd, UINT au); /* Create a file system on the drive */
FRESULT f_fdisk (BYTE pdrv, const DWORD szt[], void* work); /* Divide a physical drive into some partitions */
FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs); /* Get number of free clusters on the drive */
FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn); /* Get volume label */
FRESULT f_setlabel (const TCHAR* label); /* Set volume label */
FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt); /* Mount/Unmount a logical drive */
FRESULT f_mkfs (const TCHAR* path, BYTE sfd, UINT au); /* Create a file system on the volume */
FRESULT f_fdisk (BYTE pdrv, const DWORD szt[], void* work); /* Divide a physical drive into some partitions */
int f_putc (TCHAR c, FIL* fp); /* Put a character to the file */
int f_puts (const TCHAR* str, FIL* cp); /* Put a string to the file */
int f_printf (FIL* fp, const TCHAR* str, ...); /* Put a formatted string to the file */
TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */
#define f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
#define f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
#define f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
#define f_error(fp) ((fp)->err)
#define f_tell(fp) ((fp)->fptr)
#define f_size(fp) ((fp)->fsize)
@@ -249,7 +251,7 @@ TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the fil
/* Additional user defined functions */
/* RTC function */
#if !_FS_READONLY
#if !_FS_READONLY && !_FS_NORTC
DWORD get_fattime (void);
#endif
@@ -282,7 +284,6 @@ int ff_del_syncobj (_SYNC_t sobj); /* Delete a sync object */
#define FA_READ 0x01
#define FA_OPEN_EXISTING 0x00
#define FA__ERROR 0x80
#if !_FS_READONLY
#define FA_WRITE 0x02
+182 -101
View File
@@ -1,13 +1,8 @@
/*---------------------------------------------------------------------------/
/ FatFs - FAT file system module configuration file R0.09b (C)ChaN, 2013
/----------------------------------------------------------------------------/
/
/ CAUTION! Do not forget to make clean the project after any changes to
/ the configuration options.
/
/----------------------------------------------------------------------------*/
#ifndef _FFCONF
#define _FFCONF 82786 /* Revision ID */
/ FatFs - FAT file system module configuration file R0.10c (C)ChaN, 2014
/---------------------------------------------------------------------------*/
#define _FFCONF 80376 /* Revision ID */
#if defined(CPUARM) && !defined(SIMU)
#ifdef __cplusplus
@@ -21,69 +16,82 @@ extern "C" {
/*---------------------------------------------------------------------------/
/ Functions and Buffer Configurations
/----------------------------------------------------------------------------*/
/---------------------------------------------------------------------------*/
#define _FS_TINY 0
/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)
/ At the tiny configuration, size of the file object (FIL) is reduced _MAX_SS
/ bytes. Instead of private sector buffer eliminated from the file object,
/ common sector buffer in the file system object (FATFS) is used for the file
/ data transfer. */
#define _FS_TINY 0 /* 0:Normal or 1:Tiny */
/* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system
/ object instead of the sector buffer in the individual file object for file
/ data transfer. This reduces memory consumption 512 bytes each file object. */
#if defined(BOOT)
#define _FS_READONLY 1 /* 0:Read/Write or 1:Read only */
#define _FS_READONLY 1 /* 0:Read/Write or 1:Read only */
#else
#define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */
#define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */
#endif
/* Setting _FS_READONLY to 1 defines read only configuration. This removes
/ writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename,
/ f_truncate and useless f_getfree. */
/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
/ Read-only configuration removes basic writing API functions, f_write(),
/ f_sync(), f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(),
/ f_getfree() and optional writing functions as well. */
#if defined(BOOT)
#define _FS_MINIMIZE 1 /* 0 to 3 */
#define _FS_MINIMIZE 1 /* 0 to 3 */
#else
#define _FS_MINIMIZE 0 /* 0 to 3 */
#define _FS_MINIMIZE 0 /* 0 to 3 */
#endif
/* The _FS_MINIMIZE option defines minimization level to remove some functions.
/* This option defines minimization level to remove some API functions.
/
/ 0: Full function.
/ 1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate and f_rename
/ are removed.
/ 2: f_opendir and f_readdir are removed in addition to 1.
/ 3: f_lseek is removed in addition to 2. */
/ 0: All basic functions are enabled.
/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_chmod(), f_utime(),
/ f_truncate() and f_rename() function are removed.
/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
/ 3: f_lseek() function is removed in addition to 2. */
#if defined(BOOT)
#define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */
#define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */
#else
#define _USE_STRFUNC 1 /* 0:Disable or 1-2:Enable */
#define _USE_STRFUNC 1 /* 0:Disable or 1-2:Enable */
#endif
/* To enable string functions, set _USE_STRFUNC to 1 or 2. */
/* This option switches string functions, f_gets(), f_putc(), f_puts() and
/ f_printf().
/
/ 0: Disable string functions.
/ 1: Enable without LF-CRLF conversion.
/ 2: Enable with LF-CRLF conversion. */
#define _USE_MKFS 1 /* 0:Disable or 1:Enable */
/* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
#define _USE_MKFS 1
/* This option switches f_mkfs() function. (0:Disable or 1:Enable)
/ To enable it, also _FS_READONLY need to be set to 0. */
#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
/* To enable fast seek feature, set _USE_FASTSEEK to 1. */
#define _USE_FASTSEEK 0
/* This option switches fast seek feature. (0:Disable or 1:Enable) */
#define _USE_LABEL 0 /* 0:Disable or 1:Enable */
/* To enable volume label functions, set _USE_LAVEL to 1 */
#define _USE_LABEL 0
/* This option switches volume label functions, f_getlabel() and f_setlabel().
/ (0:Disable or 1:Enable) */
#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
/* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
#define _USE_FORWARD 0
/* This option switches f_forward() function. (0:Disable or 1:Enable) */
/* To enable it, also _FS_TINY need to be set to 1. */
/*---------------------------------------------------------------------------/
/ Locale and Namespace Configurations
/----------------------------------------------------------------------------*/
/---------------------------------------------------------------------------*/
#define _CODE_PAGE 1252
/* The _CODE_PAGE specifies the OEM code page to be used on the target system.
/* This option specifies the OEM code page to be used on the target system.
/ Incorrect setting of the code page can cause a file open failure.
/
/ 932 - Japanese Shift-JIS (DBCS, OEM, Windows)
/ 932 - Japanese Shift_JIS (DBCS, OEM, Windows)
/ 936 - Simplified Chinese GBK (DBCS, OEM, Windows)
/ 949 - Korean (DBCS, OEM, Windows)
/ 950 - Traditional Chinese Big5 (DBCS, OEM, Windows)
@@ -108,8 +116,8 @@ extern "C" {
/ 857 - Turkish (OEM)
/ 862 - Hebrew (OEM)
/ 874 - Thai (OEM, Windows)
/ 1 - ASCII only (Valid for non LFN cfg.)
*/
/ 1 - ASCII (No extended character. Valid for only non-LFN configuration.) */
#if defined(CPUARM)
#define _USE_LFN 2 /* 0 to 3 */
@@ -118,83 +126,130 @@ extern "C" {
#define _USE_LFN 1 /* 0 to 3 */
#define _MAX_LFN 32 /* Maximum LFN length to handle (12 to 255) */
#endif
/* The _USE_LFN option switches the LFN support.
/* The _USE_LFN option switches the LFN feature.
/
/ 0: Disable LFN feature. _MAX_LFN and _LFN_UNICODE have no effect.
/ 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
/ 0: Disable LFN feature. _MAX_LFN has no effect.
/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
/ 2: Enable LFN with dynamic working buffer on the STACK.
/ 3: Enable LFN with dynamic working buffer on the HEAP.
/
/ The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. To enable LFN,
/ Unicode handling functions ff_convert() and ff_wtoupper() must be added
/ to the project. When enable to use heap, memory control functions
/ ff_memalloc() and ff_memfree() must be added to the project. */
/ When enable the LFN feature, Unicode handling functions (option/unicode.c) must
/ be added to the project. The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes.
/ When use stack for the working buffer, take care on stack overflow. When use heap
/ memory for the working buffer, memory management functions, ff_memalloc() and
/ ff_memfree(), must be added to the project. */
#define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */
/* To switch the character code set on FatFs API to Unicode,
/ enable LFN feature and set _LFN_UNICODE to 1. */
#define _LFN_UNICODE 0
/* This option switches character encoding on the API. (0:ANSI/OEM or 1:Unicode)
/ To use Unicode string for the path name, enable LFN feature and set _LFN_UNICODE
/ to 1. This option also affects behavior of string I/O functions. */
#define _FS_RPATH 2 /* 0 to 2 */
/* The _FS_RPATH option configures relative path feature.
#define _STRF_ENCODE 3
/* When _LFN_UNICODE is 1, this option selects the character encoding on the file to
/ be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf().
/
/ 0: ANSI/OEM
/ 1: UTF-16LE
/ 2: UTF-16BE
/ 3: UTF-8
/
/ When _LFN_UNICODE is 0, this option has no effect. */
#define _FS_RPATH 2
/* This option configures relative path feature.
/
/ 0: Disable relative path feature and remove related functions.
/ 1: Enable relative path. f_chdrive() and f_chdir() are available.
/ 2: f_getcwd() is available in addition to 1.
/ 1: Enable relative path feature. f_chdir() and f_chdrive() are available.
/ 2: f_getcwd() function is available in addition to 1.
/
/ Note that output of the f_readdir fnction is affected by this option. */
/ Note that directory items read via f_readdir() are affected by this option. */
/*---------------------------------------------------------------------------/
/ Physical Drive Configurations
/----------------------------------------------------------------------------*/
/ Drive/Volume Configurations
/---------------------------------------------------------------------------*/
#define _VOLUMES 1
/* Number of volumes (logical drives) to be used. */
#define _MAX_SS 512 /* 512, 1024, 2048 or 4096 */
/* Maximum sector size to be handled.
/ Always set 512 for memory card and hard disk but a larger value may be
/ required for on-board flash memory, floppy disk and optical disk.
/ When _MAX_SS is larger than 512, it configures FatFs to variable sector size
/ and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */
#define _STR_VOLUME_ID 0
#define _VOLUME_STRS "RAM","NAND","CF","SD1","SD2","USB1","USB2","USB3"
/* _STR_VOLUME_ID option switches string volume ID feature.
/ When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
/ number in the path name. _VOLUME_STRS defines the drive ID strings for each
/ logical drives. Number of items must be equal to _VOLUMES. Valid characters for
/ the drive ID strings are: A-Z and 0-9. */
#define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
/* When set to 0, each volume is bound to the same physical drive number and
/ it can mount only first primaly partition. When it is set to 1, each volume
/ is tied to the partitions listed in VolToPart[]. */
#define _MULTI_PARTITION 0
/* This option switches multi-partition feature. By default (0), each logical drive
/ number is bound to the same physical drive number and only an FAT volume found on
/ the physical drive will be mounted. When multi-partition feature is enabled (1),
/ each logical drive number is bound to arbitrary physical drive and partition
/ listed in the VolToPart[]. Also f_fdisk() funciton will be enabled. */
#define _USE_ERASE 0 /* 0:Disable or 1:Enable */
/* To enable sector erase feature, set _USE_ERASE to 1. CTRL_ERASE_SECTOR command
/ should be added to the disk_ioctl functio. */
#define _MIN_SS 512
#define _MAX_SS 512
/* These options configure the range of sector size to be supported. (512, 1024,
/ 2048 or 4096) Always set both 512 for most systems, all type of memory cards and
/ harddisk. But a larger value may be required for on-board flash memory and some
/ type of optical media. When _MAX_SS is larger than _MIN_SS, FatFs is configured
/ to variable sector size and GET_SECTOR_SIZE command must be implemented to the
/ disk_ioctl() function. */
#define _USE_TRIM 0
/* This option switches ATA-TRIM feature. (0:Disable or 1:Enable)
/ To enable Trim feature, also CTRL_TRIM command should be implemented to the
/ disk_ioctl() function. */
#define _FS_NOFSINFO 0
/* If you need to know correct free space on the FAT32 volume, set bit 0 of this
/ option, and f_getfree() function at first time after volume mount will force
/ a full FAT scan. Bit 1 controls the use of last allocated cluster number.
/
/ bit0=0: Use free cluster count in the FSINFO if available.
/ bit0=1: Do not trust free cluster count in the FSINFO.
/ bit1=0: Use last allocated cluster number in the FSINFO if available.
/ bit1=1: Do not trust last allocated cluster number in the FSINFO.
*/
/*---------------------------------------------------------------------------/
/ System Configurations
/----------------------------------------------------------------------------*/
/---------------------------------------------------------------------------*/
#define _WORD_ACCESS 0 /* 0 or 1 */
/* Set 0 first and it is always compatible with all platforms. The _WORD_ACCESS
/ option defines which access method is used to the word data on the FAT volume.
#define _FS_NORTC 0
#define _NORTC_MON 11
#define _NORTC_MDAY 9
#define _NORTC_YEAR 2014
/* The _FS_NORTC option switches timestamp feature. If the system does not have
/ an RTC function or valid timestamp is not needed, set _FS_NORTC to 1 to disable
/ the timestamp feature. All objects modified by FatFs will have a fixed timestamp
/ defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR.
/ When timestamp feature is enabled (_FS_NORTC == 0), get_fattime() function need
/ to be added to the project to read current time form RTC. _NORTC_MON,
/ _NORTC_MDAY and _NORTC_YEAR have no effect.
/ These options have no effect at read-only configuration (_FS_READONLY == 1). */
#define _FS_LOCK 0
/* The _FS_LOCK option switches file lock feature to control duplicated file open
/ and illegal operation to open objects. This option must be 0 when _FS_READONLY
/ is 1.
/
/ 0: Byte-by-byte access.
/ 1: Word access. Do not choose this unless following condition is met.
/
/ When the byte order on the memory is big-endian or address miss-aligned word
/ access results incorrect behavior, the _WORD_ACCESS must be set to 0.
/ If it is not the case, the value can also be set to 1 to improve the
/ performance and code size.
*/
/* A header file that defines sync object types on the O/S, such as
/ windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
/ 0: Disable file lock feature. To avoid volume corruption, application program
/ should avoid illegal open, remove and rename to the open objects.
/ >0: Enable file lock feature. The value defines how many files/sub-directories
/ can be opened simultaneously under file lock control. Note that the file
/ lock feature is independent of re-entrancy. */
#if defined(CPUARM) && !defined(BOOT)
#define _FS_REENTRANT 1 /* 0:Disable or 1:Enable */
@@ -203,19 +258,45 @@ extern "C" {
#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
#endif
#define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */
#define _FS_TIMEOUT 1000
/* The _FS_REENTRANT option switches the reentrancy (thread safe) of the FatFs module.
/* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs
/ module itself. Note that regardless of this option, file access to different
/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
/ and f_fdisk() function, are always not re-entrant. Only file/directory access
/ to the same volume is under control of this feature.
/
/ 0: Disable reentrancy. _SYNC_t and _FS_TIMEOUT have no effect.
/ 1: Enable reentrancy. Also user provided synchronization handlers,
/ ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj
/ function must be added to the project. */
/ 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect.
/ 1: Enable re-entrancy. Also user provided synchronization handlers,
/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
/ function, must be added to the project. Samples are available in
/ option/syscall.c.
/
/ The _FS_TIMEOUT defines timeout period in unit of time tick.
/ The _SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*,
/ SemaphoreHandle_t and etc.. */
#define _FS_LOCK 0 /* 0:Disable or >=1:Enable */
/* To enable file lock control feature, set _FS_LOCK to 1 or greater.
The value defines how many files can be opened simultaneously. */
#define _WORD_ACCESS 0
/* The _WORD_ACCESS option is an only platform dependent option. It defines
/ which access method is used to the word data on the FAT volume.
/
/ 0: Byte-by-byte access. Always compatible with all platforms.
/ 1: Word access. Do not choose this unless under both the following conditions.
/
/ * Address misaligned memory access is always allowed to ALL instructions.
/ * Byte order on the memory is little-endian.
/
/ If it is the case, _WORD_ACCESS can also be set to 1 to reduce code size.
/ Following table shows allowable settings of some processor types.
/
/ ARM7TDMI 0 ColdFire 0 V850E 0
/ Cortex-M3 0 Z80 0/1 V850ES 0/1
/ Cortex-M0 0 x86 0/1 TLCS-870 0/1
/ AVR 0/1 RX600(LE) 0/1 TLCS-900 0/1
/ AVR32 0 RL78 0 R32C 0
/ PIC18 0/1 SH-2 0 M16C 0/1
/ PIC24 0 H8S 0 MSP430 0
/ PIC32 0 H8/300H 0 8051 0/1
*/
#endif /* _FFCONFIG */
+9 -13
View File
@@ -2,8 +2,8 @@
/* Integer type definitions for FatFs module */
/*-------------------------------------------*/
#ifndef _INTEGER
#define _INTEGER
#ifndef _FF_INTEGER
#define _FF_INTEGER
#ifdef _WIN32 /* FatFs development platform */
@@ -12,24 +12,20 @@
#else /* Embedded platform */
/* These types must be 16-bit, 32-bit or larger integer */
typedef int INT;
typedef unsigned int UINT;
/* These types must be 8-bit integer */
typedef char CHAR;
typedef unsigned char UCHAR;
/* This type MUST be 8 bit */
typedef unsigned char BYTE;
/* These types must be 16-bit integer */
/* These types MUST be 16 bit */
typedef short SHORT;
typedef unsigned short USHORT;
typedef unsigned short WORD;
typedef unsigned short WCHAR;
/* These types must be 32-bit integer */
/* These types MUST be 16 bit or 32 bit */
typedef int INT;
typedef unsigned int UINT;
/* These types MUST be 32 bit */
typedef long LONG;
typedef unsigned long ULONG;
typedef unsigned long DWORD;
#endif
+3 -3
View File
@@ -3739,10 +3739,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
#if !_TINY_TABLE
if (dir) { /* OEMCP to unicode */
p = sjis2uni;
hi = sizeof(sjis2uni) / 4 - 1;
hi = sizeof sjis2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2sjis;
hi = sizeof(uni2sjis) / 4 - 1;
hi = sizeof uni2sjis / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
@@ -3764,7 +3764,7 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
p -= 3;
c = *p;
} else { /* Unicode to OEMCP */
li = 0; hi = sizeof(uni2sjis) / 4 - 1;
li = 0; hi = sizeof uni2sjis / 4 - 1;
for (n = 16; n; n--) {
i = li + (hi - li) / 2;
if (chr == uni2sjis[i * 2]) break;
+2 -2
View File
@@ -10936,10 +10936,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
hi = sizeof(oem2uni) / 4 - 1;
hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
hi = sizeof(uni2oem) / 4 - 1;
hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
+2 -2
View File
@@ -8565,10 +8565,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
hi = sizeof(oem2uni) / 4 - 1;
hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
hi = sizeof(uni2oem) / 4 - 1;
hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
+2 -2
View File
@@ -6791,10 +6791,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
hi = sizeof(oem2uni) / 4 - 1;
hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
hi = sizeof(uni2oem) / 4 - 1;
hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
+1 -1
View File
@@ -444,7 +444,7 @@ const WCHAR Tbl[] = { /* CP1256(0x80-0xFF) to Unicode conversion table */
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2
}
};
#elif _CODE_PAGE == 1257
#define _TBLDEF 1
+27 -31
View File
@@ -1,10 +1,8 @@
/*------------------------------------------------------------------------*/
/* Sample code of OS dependent controls for FatFs */
/* (C)ChaN, 2012 */
/* (C)ChaN, 2014 */
/*------------------------------------------------------------------------*/
#include <stdlib.h> /* ANSI memory controls */
#include <malloc.h> /* ANSI memory controls */
#include "../ff.h"
@@ -13,33 +11,30 @@
/*------------------------------------------------------------------------*/
/* Create a Synchronization Object
/*------------------------------------------------------------------------*/
/* This function is called in f_mount function to create a new
/ synchronization object, such as semaphore and mutex. When a FALSE is
/ returned, the f_mount function fails with FR_INT_ERR.
/* This function is called in f_mount() function to create a new
/ synchronization object, such as semaphore and mutex. When a 0 is returned,
/ the f_mount() function fails with FR_INT_ERR.
*/
int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any error */
int ff_cre_syncobj ( /* !=0:Function succeeded, ==0:Could not create due to any error */
BYTE vol, /* Corresponding logical drive being processed */
_SYNC_t *sobj /* Pointer to return the created sync object */
)
{
int ret;
// static _SYNC_t sem[_VOLUMES]; /* FreeRTOS */
*sobj = CreateMutex(NULL, FALSE, NULL); /* Win32 */
ret = (*sobj != INVALID_HANDLE_VALUE);
ret = (int)(*sobj != INVALID_HANDLE_VALUE);
// *sobj = SyncObjects[vol]; /* uITRON (give a static created sync object) */
// ret = 1; /* The initial value of the semaphore must be 1. */
// *sobj = SyncObjects[vol]; /* uITRON (give a static created sync object) */
// ret = 1; /* The initial value of the semaphore must be 1. */
// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
// ret = (err == OS_NO_ERR);
// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
// ret = (int)(err == OS_NO_ERR);
// if (!sem[vol]) /* FreeRTOS */
// sem[vol] = xSemaphoreCreateMutex();
// *sobj = sem[vol];
// ret = (*sobj != NULL);
// *sobj = xSemaphoreCreateMutex(); /* FreeRTOS */
// ret = (int)(*sobj != NULL);
return ret;
}
@@ -49,12 +44,12 @@ int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any erro
/*------------------------------------------------------------------------*/
/* Delete a Synchronization Object */
/*------------------------------------------------------------------------*/
/* This function is called in f_mount function to delete a synchronization
/ object that created with ff_cre_syncobj function. When a FALSE is
/ returned, the f_mount function fails with FR_INT_ERR.
/* This function is called in f_mount() function to delete a synchronization
/ object that created with ff_cre_syncobj function. When a 0 is returned,
/ the f_mount() function fails with FR_INT_ERR.
*/
int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any error */
int ff_del_syncobj ( /* !=0:Function succeeded, ==0:Could not delete due to any error */
_SYNC_t sobj /* Sync object tied to the logical drive to be deleted */
)
{
@@ -66,9 +61,10 @@ int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any erro
// ret = 1; /* uITRON (nothing to do) */
// OSMutexDel(sobj, OS_DEL_ALWAYS, &err); /* uC/OS-II */
// ret = (err == OS_NO_ERR);
// ret = (int)(err == OS_NO_ERR);
// ret = 1; /* FreeRTOS (nothing to do) */
// vSemaphoreDelete(sobj); /* FreeRTOS */
// ret = 1;
return ret;
}
@@ -79,23 +75,23 @@ int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any erro
/* Request Grant to Access the Volume */
/*------------------------------------------------------------------------*/
/* This function is called on entering file functions to lock the volume.
/ When a FALSE is returned, the file function fails with FR_TIMEOUT.
/ When a 0 is returned, the file function fails with FR_TIMEOUT.
*/
int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */
int ff_req_grant ( /* 1:Got a grant to access the volume, 0:Could not get a grant */
_SYNC_t sobj /* Sync object to wait */
)
{
int ret;
ret = (WaitForSingleObject(sobj, _FS_TIMEOUT) == WAIT_OBJECT_0); /* Win32 */
ret = (int)(WaitForSingleObject(sobj, _FS_TIMEOUT) == WAIT_OBJECT_0); /* Win32 */
// ret = (wai_sem(sobj) == E_OK); /* uITRON */
// ret = (int)(wai_sem(sobj) == E_OK); /* uITRON */
// OSMutexPend(sobj, _FS_TIMEOUT, &err)); /* uC/OS-II */
// ret = (err == OS_NO_ERR);
// ret = (int)(err == OS_NO_ERR);
// ret = (xSemaphoreTake(sobj, _FS_TIMEOUT) == pdTRUE); /* FreeRTOS */
// ret = (int)(xSemaphoreTake(sobj, _FS_TIMEOUT) == pdTRUE); /* FreeRTOS */
return ret;
}
@@ -137,7 +133,7 @@ void* ff_memalloc ( /* Returns pointer to the allocated memory block */
UINT msize /* Number of bytes to allocate */
)
{
return malloc(msize);
return malloc(msize); /* Allocate a new memory block with POSIX API */
}
@@ -149,7 +145,7 @@ void ff_memfree (
void* mblock /* Pointer to the memory block to free */
)
{
free(mblock);
free(mblock); /* Discard the memory block with POSIX API */
}
#endif
+5 -5
View File
@@ -2,15 +2,15 @@
#if _USE_LFN != 0
#if _CODE_PAGE == 932
#if _CODE_PAGE == 932 /* Japanese Shift_JIS */
#include "cc932.c"
#elif _CODE_PAGE == 936
#elif _CODE_PAGE == 936 /* Simplified Chinese GBK */
#include "cc936.c"
#elif _CODE_PAGE == 949
#elif _CODE_PAGE == 949 /* Korean */
#include "cc949.c"
#elif _CODE_PAGE == 950
#elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */
#include "cc950.c"
#else
#else /* Small character-set */
#include "ccsbcs.c"
#endif
+105 -52
View File
@@ -69,7 +69,7 @@ FAI = NO
# the latests deliveries for Turnigy 9x transmitters (since 2 years now, 2014) do not stop sending if no pulses are generated.
# This fact totally breaks the nice throttle and switch warning concept, because even we prevent sending pulses the
# transmitter modul ignores this, and continous to send the last value or 0 at beginning. And 0 means in the middle of throttle -> 50%.
# transmitter module ignores this, and continues to send the last value or 0 at beginning. And 0 means in the middle of throttle -> 50%.
# To cope with this situation, we need a new concept how to handle throttle and switch warnings.
# if you have a 0 value (50% ) for throttle, while throttle warning is active, you should activate this switch
# Values = YES, NO
@@ -126,7 +126,7 @@ CORRECT_NEGATIVE_VALUES = YES
ARITHMETIC_OVERFLOW_CHECK = NO
# increases resolution for throttle statistics and throttle counting, in very rare cases.
# this will be only true if an output channel is used for throttle calculation, and this chanenel has changed limits, e.g. -90% to +80%
# this will be only true if an output channel is used for throttle calculation, and this channel has changed limits, e.g. -90% to +80%
# if you use standard limits for throttle or directly the throttle stick you do not need to bother about this option
# not valid for ARM based transmitters like Taranis, They do not have this rounding issue at all
# Values = YES, NO
@@ -161,7 +161,7 @@ FONT = STD
# Values = YES, NO
PPM_CENTER_ADJUSTABLE = NO
# PPM symetrical limits
# PPM symmetrical limits
# Values = YES, NO
PPM_LIMITS_SYMETRICAL = NO
@@ -169,9 +169,9 @@ PPM_LIMITS_SYMETRICAL = NO
# Values = PERCENT_PREC1, PERCENT_PREC0, US
PPM_UNIT = PERCENT_PREC1
# SafetyCHxx functions enable
# OverrideCHxx functions enable
# Values = YES, NO
SAFETY_CHANNEL_FUNCTION = YES
OVERRIDE_CHANNEL_FUNCTION = YES
# FrSky Hub
# Values = YES, NO
@@ -247,11 +247,15 @@ EEPROM_PROGRESS_BAR = NO
# Activates the DEBUG Mode (all boards)
# On G9X V4 board, when VOICE=NO:
# PORTH:7 --> Transistion LOW to HIGH = start of setupPulses(). Transistion HIGH to LOW = end of setupPulses().
# PORTH:7 --> Transition LOW to HIGH = start of setupPulses(). Transition HIGH to LOW = end of setupPulses().
# PORTH:6 --> LOW->HIGH = start of mixer calcs. HIGH->LOW, end of mixer calcs.
# Values = YES, NO
DEBUG = NO
# Activate writing of SPORT telemetry received data to sport.log file
# Values = YES, NO
SPORT_FILE_LOG = NO
# Flight Modes
# Values = YES, NO
FLIGHT_MODES = YES
@@ -282,13 +286,27 @@ MENUS_LOCK = NO
# MASSSTORAGE: The TX will appear as a drive
USB = JOYSTICK
# Channel monitor display behaviour
# Channel monitor display behavior
# Values = NO, YES
# YES - hide the fact that channel is inverted in limits tab
# and show inverted channel value with oposite sign
# NO - normal behaviour, show real channel values
# and show inverted channel value with opposite sign
# NO - normal behavior, show real channel values
CHANNELS_MONITOR_INV_HIDE = NO
# Use newlib-nano
# Values = NO, YES
NANO = NO
# Enable trace of events into Trace Buffer for debugging purposes
# Activating any of these options also activates DEBUG and DEBUG_TRACE_BUFFER
# Values = NO, YES
# TRACE_SD_CARD SD card operations (read, write, etc)
# TRACE_FATFS FatFs file operations
# TRACE_AUDIO Audio processing (not yet implemented)
TRACE_SD_CARD = NO
TRACE_FATFS = NO
TRACE_AUDIO = NO
#------- END BUILD OPTIONS ---------------------------
# Define programs and commands.
@@ -296,12 +314,14 @@ SHELL = sh
IMG2LBM = -python ../util/img2lbm.py
BIN2LBM = -python ../util/bin2lbm.py
TRANSLATE = -python ../util/translate.py
VERSION = 2.0.7
VERSION = 2.0.13
SRC =
CPPSRC =
INCDIRS = . translations
EXTRAINCDIRS =
LUADEP =
DEBUG_TRACE_BUFFER = NO
# MCU name
ifneq ($(PCB), $(filter $(PCB), STD 9X 9XR STD128 9X128 9XR128 9X2561 9XR2561 GRUVIN9X MEGA2560 SKY9X 9XRPRO TARANIS))
@@ -384,7 +404,7 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
ARCH = AVR
TRGT = avr-
MCU = atmega128
OPT = 2
OPT = s
SDCARD = NO
THR_TRACE = NO
EEPROM_VARIANT += ${M128_VARIANT}
@@ -444,7 +464,7 @@ ifeq ($(PCB), $(filter $(PCB), 9X2561))
ARCH = AVR
TRGT = avr-
MCU = atmega2561
OPT = 2
OPT = s
SDCARD = NO
THR_TRACE = YES
EEPROM_VARIANT += ${M2561_VARIANT}
@@ -505,7 +525,7 @@ ifeq ($(PCB), GRUVIN9X)
endif
TRGT = avr-
MCU = atmega2560
OPT = 2
OPT = s
CPPDEFS += -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DCPUM2560 -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC
SDCARD = NO
BUZZER = NO
@@ -545,7 +565,7 @@ ifeq ($(PCB), MEGA2560)
ARCH = AVR
TRGT = avr-
MCU = atmega2560
OPT = 2
OPT = s
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBMEGA2560 -DCPUM2560 -DEEPROM_VARIANT=0 -DAUDIO -DRTCLOCK
SDCARD = YES
THR_TRACE = YES
@@ -591,7 +611,7 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
endif
TRGT = arm-none-eabi-
MCU = cortex-m3
OPT = 2
OPT = s
SDCARD = YES
BUZZER = NO
THR_TRACE = YES
@@ -600,6 +620,9 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
CPPDEFS += -DROTARY_ENCODERS=1
CPPSRC += targets/sky9x/rotenc_driver.cpp
endif
ifeq ($(SPORT_FILE_LOG), YES)
CPPDEFS += -DSPORT_FILE_LOG
endif
INCDIRS += targets/sky9x CoOS/kernel CoOS/portable
BOARDSRC = targets/sky9x/board_sky9x.cpp
EXTRABOARDSRC = targets/sky9x/lcd_driver.cpp
@@ -615,31 +638,26 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
CPPSRC += audio_arm.cpp haptic.cpp gui/view_about.cpp gui/view_text.cpp
CPPSRC += targets/sky9x/telemetry_driver.cpp targets/sky9x/second_serial_driver.cpp targets/sky9x/pwr_driver.cpp targets/sky9x/adc_driver.cpp targets/sky9x/eeprom_driver.cpp targets/sky9x/pulses_driver.cpp targets/sky9x/keys_driver.cpp targets/sky9x/audio_driver.cpp targets/sky9x/buzzer_driver.cpp targets/sky9x/haptic_driver.cpp targets/sky9x/sdcard_driver.cpp targets/sky9x/massstorage.cpp
CPPSRC += loadboot.cpp
ifeq ($(SDCARD), YES)
CPPDEFS += -DVOICE
INCDIRS += FatFs FatFs/option
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/sky9x/diskio.cpp
endif
ifeq ($(BUZZER), YES)
CPPDEFS += -DBUZZER
CPPSRC += buzzer.cpp
endif
ifeq ($(RTCLOCK), YES)
CPPDEFS += -DRTCLOCK
CPPSRC += rtc.cpp targets/sky9x/rtc_driver.cpp
endif
ifeq ($(BLUETOOTH), YES)
CPPDEFS += -DBLUETOOTH
CPPSRC += targets/sky9x/bluetooth.cpp
CPPDEFS += -DBLUETOOTH
CPPSRC += targets/sky9x/bluetooth.cpp
endif
ifeq ($(DEBUG), YES)
CPPSRC += debug.cpp
SRC += targets/sky9x/syscalls.c
SRC += targets/sky9x/syscalls.c
endif
endif
@@ -656,10 +674,31 @@ ifeq ($(PCB), TARANIS)
else
CPPDEFS = -DREV4
endif
ifeq ($(SPORT_FILE_LOG), YES)
CPPDEFS += -DSPORT_FILE_LOG
endif
ifeq ($(TRACE_SD_CARD), YES)
DEBUG = YES
DEBUG_TRACE_BUFFER = YES
CPPDEFS += -DTRACE_SD_CARD
endif
ifeq ($(TRACE_FATFS), YES)
DEBUG = YES
DEBUG_TRACE_BUFFER = YES
CPPDEFS += -DTRACE_FATFS
endif
ifeq ($(TRACE_AUDIO), YES)
DEBUG = YES
DEBUG_TRACE_BUFFER = YES
CPPDEFS += -DTRACE_AUDIO
endif
ifeq ($(DEBUG_TRACE_BUFFER), YES)
CPPDEFS += -DDEBUG_TRACE_BUFFER
endif
LDSCRIPT = targets/taranis/stm32_flash_bl.ld
TRGT = arm-none-eabi-
MCU = cortex-m3
OPT = 2
OPT = s
CPPDEFS += -DHSE_VALUE=12000000
SDCARD = YES
THR_TRACE = YES
@@ -716,7 +755,11 @@ ifeq ($(PCB), TARANIS)
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
EXTRABOARDSRC += targets/taranis/usbd_storage_msd.cpp
endif
ifeq ($(NANO), YES)
# use newlib-nano for linking
NEWLIB_NANO_FLAGS = --specs=nano.specs -u _printf_float
CPPDEFS += -DNANO
endif
ifneq ($(LUA), NO)
ifeq ($(LUA), YES)
CPPDEFS += -DLUA_MODEL_SCRIPTS
@@ -725,50 +768,43 @@ ifeq ($(PCB), TARANIS)
INCDIRS += lua/src
CPPSRC += lua.cpp
LUASRC = lua/src/lapi.c lua/src/lcode.c lua/src/lctype.c lua/src/ldebug.c lua/src/ldo.c lua/src/ldump.c lua/src/lfunc.c lua/src/lgc.c lua/src/llex.c lua/src/lmem.c \
lua/src/lobject.c lua/src/lopcodes.c lua/src/lparser.c lua/src/lstate.c lua/src/lstring.c lua/src/ltable.c lua/src/ltm.c lua/src/lundump.c lua/src/lvm.c lua/src/lzio.c \
lua/src/lbaselib.c lua/src/linit.c lua/src/lmathlib.c lua/src/loadlib.c lua/src/lauxlib.c lua/src/ltablib.c lua/src/lcorolib.c
# lua/src/loslib.c lua/src/lbitlib.c lua/src/lstrlib.c lua/src/liolib.c lua/src/ldblib.c
lua/src/lobject.c lua/src/lopcodes.c lua/src/lparser.c lua/src/lstate.c lua/src/lstring.c lua/src/ltable.c lua/src/lrotable.c lua/src/ltm.c lua/src/lundump.c lua/src/lvm.c lua/src/lzio.c \
lua/src/lbaselib.c lua/src/linit.c lua/src/lmathlib.c lua/src/lbitlib.c lua/src/loadlib.c lua/src/lauxlib.c lua/src/ltablib.c lua/src/lcorolib.c
SRC += $(LUASRC)
LUADEP = lua_exports.cpp
endif
ifeq ($(SDCARD), YES)
EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/taranis/diskio.cpp
CPPDEFS += -DVOICE
INCDIRS += FatFs FatFs/option
endif
ifeq ($(RTCLOCK), YES)
CPPDEFS += -DRTCLOCK
CPPSRC += rtc.cpp targets/taranis/rtc_driver.cpp
endif
ifeq ($(DEBUG), YES)
CPPSRC += debug.cpp
endif
ifeq ($(DSM2), PPM)
CPPSRC += pulses/dsm2_arm.cpp
endif
ifeq ($(HUBSAN), YES)
CPPDEFS += -DHUBSAN
CPPSRC += pulses/hubsan.cpp
CPPSRC += targets/taranis/a7105_driver.cpp
endif
ifeq ($(HAPTIC), YES)
CPPDEFS += -DHAPTIC
CPPSRC += haptic.cpp
CPPSRC += targets/taranis/haptic_driver.cpp
endif
ifeq ($(CHANNELS_MONITOR_INV_HIDE), YES)
CPPDEFS += -DCHANNELS_MONITOR_INV_HIDE
endif
endif
CC = $(TRGT)gcc
CPP = $(TRGT)cpp
AS = $(TRGT)as
OBJCOPY = $(TRGT)objcopy
OBJDUMP = $(TRGT)objdump
@@ -967,7 +1003,7 @@ endif
ifeq ($(EXT), $(filter $(EXT), FRSKY FRSKY_SPORT TELEMETREZ))
CPPDEFS += -DFRSKY
ifeq ($(EXT), FRSKY_SPORT)
CPPSRC += telemetry/frsky.cpp telemetry/frsky_sport.cpp telemetry/frsky_d.cpp
CPPSRC += telemetry/frsky.cpp telemetry/frsky_sport.cpp telemetry/frsky_d.cpp
CPPDEFS += -DFRSKY_SPORT
else
CPPSRC += telemetry/frsky.cpp telemetry/frsky_d.cpp
@@ -1022,8 +1058,8 @@ ifeq ($(PPM_LIMITS_SYMETRICAL), YES)
CPPDEFS += -DPPM_LIMITS_SYMETRICAL
endif
ifeq ($(SAFETY_CHANNEL_FUNCTION), YES)
CPPDEFS += -DSAFETY_CHANNEL_FUNCTION
ifeq ($(OVERRIDE_CHANNEL_FUNCTION), YES)
CPPDEFS += -DOVERRIDE_CHANNEL_FUNCTION
endif
ifeq ($(PPM_UNIT), US)
@@ -1101,6 +1137,7 @@ CPPFLAGS += $(CPPDEFS)
CPPFLAGS += -Wall
CPPFLAGS += -fno-exceptions
CPPFLAGS += -Wno-strict-aliasing
CPPFLAGS += -Wformat -Wreturn-type -Wunused -Wuninitialized -Wunknown-pragmas -Wno-switch -Wtype-limits
INCFLAGS = $(patsubst %,-I%,$(INCDIRS))
EXTRAINCFLAGS = $(patsubst %,-I%,$(EXTRAINCDIRS))
@@ -1156,7 +1193,7 @@ all: begin gccversion sizebefore build sizeafter end
ifeq ($(ARCH), AVR)
build: stamp_header tra lbm allsrc.cpp elf remallsrc hex
else ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO TARANIS))
build: stamp_header tra lbm bootloader.lbm allsrc.cpp elf remallsrc bin
build: stamp_header tra lbm bootloader.lbm $(LUADEP) allsrc.cpp elf remallsrc bin
else
build: stamp_header tra lbm allsrc.cpp elf remallsrc bin
endif
@@ -1272,6 +1309,19 @@ bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/splash_9x.xbm bitmaps/splash_
$(IMG2LBM) bitmaps/about_taranis.png bitmaps/about_taranis.lbm bmp
$(IMG2LBM) bitmaps/about_9x.png bitmaps/about_9x.lbm img
$(IMG2LBM) bitmaps/asterisk_4bits.png bitmaps/asterisk_4bits.lbm bmp
ifeq ($(OS),Windows_NT)
PARSER = avr-cpp
else
PARSER = gcc -E -x c++
endif
lua_exports.cpp: myeeprom.h ../util/luaexport.py
@echo "Generating a list of Lua exported constants in lua_exports.txt"
@$(PARSER) -DPCBTARANIS -DCPUARM -DLUA -DEXPORT myeeprom.h | grep LEXP > lua_exports.txt
@echo "Parsing and generating C Lua exports in lua_exports.cpp"
@python ../util/luaexport.py $(VERSION) lua_exports.txt lua_exports.cpp lua_fields.txt
@rm lua_exports.txt
# Eye candy.
# AVR Studio 3.x does not check make's exit code but relies on
@@ -1313,8 +1363,8 @@ FOXLIB=-L/usr/local/lib \
-lFOX-1.6 \
-Wl,-rpath,$(FOXPATH)/src/.libs
simu: stamp_header $(BOARDSRC) $(CPPSRC) Makefile simu.cpp targets/simu/simpgmspace.cpp *.h tra lbm eeprom.bin
g++ $(CPPFLAGS) $(INCFLAGS) simu.cpp $(BOARDSRC) $(CPPSRC) $(LUASRC) targets/simu/simpgmspace.cpp -MD -DSIMU -O0 -o simu $(FOXINC) $(FOXLIB) -pthread -fexceptions
simu: $(LUADEP) stamp_header $(BOARDSRC) $(CPPSRC) Makefile simu.cpp targets/simu/simpgmspace.cpp *.h tra lbm eeprom.bin
g++ $(CPPFLAGS) $(INCFLAGS) simu.cpp $(BOARDSRC) $(CPPSRC) $(LUASRC) targets/simu/simpgmspace.cpp -MD -DSIMU -DLUA_USE_APICHECK -O0 -o simu $(FOXINC) $(FOXLIB) -pthread -fexceptions
eeprom.bin:
dd if=/dev/zero of=$@ bs=1 count=2048
@@ -1330,7 +1380,7 @@ else
%.hex: %.elf
@echo
@echo $(MSG_FLASH) $@
$(OBJCOPY) -O ihex opentx.elf opentx.hex
$(OBJCOPY) -O ihex opentx.elf opentx.hex
endif
%.bin: %.elf
@@ -1371,7 +1421,7 @@ ifeq ($(ARCH), AVR)
$(CC) $(AVRCPPFLAGS) $< --output $@ $(LDFLAGS)
else
%.o: %.c
$(CC) $(ARMCPPFLAGS) $< -o $@
$(CC) $(ARMCPPFLAGS) -Wimplicit $< -o $@
%.o: %.s
$(AS) $< -o $@
TMP = $(SRC:.c=.o)
@@ -1380,7 +1430,7 @@ OBJS = $(TMP:.s=.o)
@echo
@echo $(MSG_COMPILING) $@
$(CC) $(ARMCPPFLAGS) $< -o allsrc.o
$(CC) $(OBJS) allsrc.o -mcpu=cortex-m3 -mthumb -nostartfiles -lm -T$(LDSCRIPT) -Wl,-Map=$(TARGET).map,--cref,--no-warn-mismatch,--gc-sections -o $@
$(CC) $(OBJS) allsrc.o -mcpu=cortex-m3 -mthumb -nostartfiles -lm -T$(LDSCRIPT) -Wl,-Map=$(TARGET).map,--cref,--no-warn-mismatch,--gc-sections $(NEWLIB_NANO_FLAGS) -o $@
endif
# Target: clean project.
@@ -1408,8 +1458,10 @@ clean_list :
$(REMOVE) *.lst
$(REMOVE) allsrc.cpp
$(REMOVE) stamp-opentx.h
$(REMOVE) *.lbm
$(REMOVE) bitmaps/*.lbm
$(REMOVE) fonts/*/*.lbm
$(REMOVE) lua_exports.txt lua_exports.cpp lua_fields.txt
$(MAKE) -C bootloader clean
#### Install
@@ -1419,12 +1471,12 @@ AVRCOMMAND = $(AVRDUDE) $(AVRDEVICE)
WRITE_COMMAND = $(AVRCOMMAND) -U flash:w:opentx.hex:i
ifeq ($(RESTORE_EEPROM), YES)
BACKUP_EEPROM = YES
ifeq ($(DOUBLE_WRITE_OK), YES)
WRITE_COMMAND += -U eeprom:w:$(DATA_DIR)/eeprom-$(DATE).hex:i
else
SECOND_WRITE_COMMAND = -U eeprom:w:$(DATA_DIR)/eeprom-$(DATE).hex:i
endif
BACKUP_EEPROM = YES
ifeq ($(DOUBLE_WRITE_OK), YES)
WRITE_COMMAND += -U eeprom:w:$(DATA_DIR)/eeprom-$(DATE).hex:i
else
SECOND_WRITE_COMMAND = -U eeprom:w:$(DATA_DIR)/eeprom-$(DATE).hex:i
endif
endif
ifeq ($(BACKUP_FLASH), YES)
@@ -1491,4 +1543,5 @@ gtest_main.a : gtest-all.o gtest_main.o
GTEST_TESTS_SRCS = $(shell find tests/ -type f -name '*.cpp')
gtests: $(BOARDSRC) $(CPPSRC) $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp *.h gtest_main.a
g++ -std=gnu++0x $(CPPFLAGS) $(BOARDSRC) $(CPPSRC) $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp -I$(GTEST_DIR) ${INCFLAGS} -I$(GTEST_DIR)/include -o gtests -lpthread -MD -DSIMU -lQtCore -lQtGui gtest_main.a
g++ -std=gnu++0x $(CPPFLAGS) $(BOARDSRC) $(CPPSRC) $(LUASRC) $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp -I$(GTEST_DIR) ${INCFLAGS} -I$(GTEST_DIR)/include -o gtests -lpthread -MD -DSIMU -lQtCore -lQtGui gtest_main.a -fexceptions
+25 -22
View File
@@ -494,21 +494,6 @@ void audioTask(void* pdata)
}
#endif
void AudioQueue::pushBuffer(AudioBuffer *buffer)
{
buffer->state = AUDIO_BUFFER_FILLED;
__disable_irq();
bufferWIdx = nextBufferIdx(bufferWIdx);
if (dacQueue(buffer)) {
buffer->state = AUDIO_BUFFER_PLAYING;
}
__enable_irq();
}
void mixSample(uint16_t * result, int sample, unsigned int fade)
{
*result = limit(0, *result + ((sample >> fade) >> 4), 4095);
@@ -607,7 +592,6 @@ int WavContext::mixBuffer(AudioBuffer *buffer, int volume, unsigned int fade)
}
}
clear();
return -result;
}
#else
@@ -719,12 +703,18 @@ void AudioQueue::wakeup()
}
// mix the normal context (tones and wavs)
if (normalContext.fragment.type == FRAGMENT_TONE)
if (normalContext.fragment.type == FRAGMENT_TONE) {
result = normalContext.tone.mixBuffer(buffer, g_eeGeneral.beepVolume, fade);
else if (normalContext.fragment.type == FRAGMENT_FILE)
}
else if (normalContext.fragment.type == FRAGMENT_FILE) {
result = normalContext.wav.mixBuffer(buffer, g_eeGeneral.wavVolume, fade);
else
if (result < 0) {
normalContext.wav.clear();
}
}
else {
result = 0;
}
if (result > 0) {
size = max(size, result);
fade += 1;
@@ -732,7 +722,7 @@ void AudioQueue::wakeup()
else {
CoEnterMutexSection(audioMutex);
if (ridx != widx) {
normalContext.fragment = fragments[ridx];
normalContext.tone.setFragment(fragments[ridx]);
if (!fragments[ridx].repeat--) {
ridx = (ridx + 1) % AUDIO_QUEUE_LENGTH;
}
@@ -757,8 +747,11 @@ void AudioQueue::wakeup()
// push the buffer if needed
if (size > 0) {
__disable_irq();
bufferWIdx = nextBufferIdx(bufferWIdx);
buffer->size = size;
pushBuffer(buffer);
buffer->state = dacQueue(buffer) ? AUDIO_BUFFER_PLAYING : AUDIO_BUFFER_FILLED;
__enable_irq();
}
}
}
@@ -799,8 +792,9 @@ void AudioQueue::playTone(uint16_t freq, uint16_t len, uint16_t pause, uint8_t f
{
CoEnterMutexSection(audioMutex);
if (freq && freq < BEEP_MIN_FREQ)
if (freq && freq < BEEP_MIN_FREQ) {
freq = BEEP_MIN_FREQ;
}
if (flags & PLAY_BACKGROUND) {
AudioFragment & fragment = varioContext.fragment;
@@ -923,6 +917,15 @@ void AudioQueue::stopAll()
CoLeaveMutexSection(audioMutex);
}
void AudioQueue::flush()
{
CoEnterMutexSection(audioMutex);
widx = ridx; // clean the queue
varioContext.clear();
backgroundContext.clear();
CoLeaveMutexSection(audioMutex);
}
void audioEvent(uint8_t e, uint16_t f)
{
#if defined(HAPTIC)
+10 -2
View File
@@ -103,6 +103,12 @@ class ToneContext {
uint16_t pause;
} state;
inline void setFragment(AudioFragment & fragment)
{
this->fragment = fragment;
memset(&state, 0, sizeof(state));
}
inline void clear()
{
memset(this, 0, sizeof(ToneContext));
@@ -163,6 +169,8 @@ class AudioQueue {
void stopAll();
void flush();
void pause(uint16_t tLen);
void stopSD();
@@ -191,6 +199,7 @@ class AudioQueue {
AudioBuffer * buffer = &buffers[idx];
if (buffer->state == AUDIO_BUFFER_FILLED) {
buffer->state = AUDIO_BUFFER_PLAYING;
bufferRIdx = idx;
return buffer;
}
idx = nextBufferIdx(idx);
@@ -231,8 +240,6 @@ class AudioQueue {
else
return NULL;
}
void pushBuffer(AudioBuffer *buffer);
};
extern AudioQueue audioQueue;
@@ -328,6 +335,7 @@ void pushPrompt(uint16_t prompt, uint8_t id=0);
#define PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id))
#define STOP_PLAY(id) audioQueue.stopPlay((id))
#define AUDIO_RESET() audioQueue.stopAll()
#define AUDIO_FLUSH() audioQueue.flush()
#if defined(SDCARD)
extern tmr10ms_t timeAutomaticPromptsSilence;
+1
View File
@@ -154,6 +154,7 @@ void audioDefevent(uint8_t e);
#define AUDIO_HEARTBEAT() audio.heartbeat()
#define IS_AUDIO_BUSY() audio.busy()
#define AUDIO_RESET()
#define AUDIO_FLUSH()
#define PLAY_PHASE_OFF(phase)
#define PLAY_PHASE_ON(phase)
+16 -11
View File
@@ -44,7 +44,9 @@ const pm_char * bmpLoad(uint8_t *bmp, const char *filename, const xcoord_t width
uint8_t bmpBuf[LCD_W]; /* maximum with LCD_W */
uint8_t *buf = &bmpBuf[0];
assert(width <= LCD_W);
if (width > LCD_W) {
return STR_INCOMPATIBLE;
}
FRESULT result = f_open(&bmpFile, filename, FA_OPEN_EXISTING | FA_READ);
if (result != FR_OK) {
@@ -70,7 +72,7 @@ const pm_char * bmpLoad(uint8_t *bmp, const char *filename, const xcoord_t width
uint32_t fsize = *((uint32_t *)&buf[2]);
uint32_t hsize = *((uint32_t *)&buf[10]); /* header size */
uint32_t len = limit((uint32_t)0, (uint32_t)(hsize-14), (uint32_t)32);
uint32_t len = limit((uint32_t)4, (uint32_t)(hsize-14), (uint32_t)32);
result = f_read(&bmpFile, buf, len, &read);
if (result != FR_OK || read != len) {
f_close(&bmpFile);
@@ -152,16 +154,16 @@ const pm_char * bmpLoad(uint8_t *bmp, const char *filename, const xcoord_t width
*dest++ = w;
*dest++ = h;
memset(dest, 0, w*((h+7)/8)*4);
memset(dest, 0, BITMAP_BUFFER_SIZE(w, h) - 2);
uint32_t n;
uint32_t rowSize;
switch (depth) {
case 1:
n = w/8;
rowSize = ((w+31)/32)*4;
for (uint32_t i=0; i<h; i+=2) {
result = f_read(&bmpFile, buf, n*2, &read);
if (result != FR_OK || read != n*2) {
result = f_read(&bmpFile, buf, rowSize*2, &read);
if (result != FR_OK || read != rowSize*2) {
f_close(&bmpFile);
return SDCARD_ERROR(result);
}
@@ -170,30 +172,33 @@ const pm_char * bmpLoad(uint8_t *bmp, const char *filename, const xcoord_t width
uint8_t * dst = dest + (h-i-2)/2 * w + j;
if (!(buf[j/8] & (1<<(7-(j%8)))))
*dst |= 0xF0;
if (!(buf[n+j/8] & (1<<(7-(j%8)))))
if (!(buf[rowSize+j/8] & (1<<(7-(j%8)))))
*dst |= 0x0F;
}
}
break;
case 4:
rowSize = ((4*w+31)/32)*4;
for (int32_t i=h-1; i>=0; i--) {
result = f_read(&bmpFile, buf, ((w+7)/8)*4, &read);
if (result != FR_OK || read != ((w+7)/8)*4) {
result = f_read(&bmpFile, buf, rowSize, &read);
if (result != FR_OK || read != rowSize) {
f_close(&bmpFile);
return SDCARD_ERROR(result);
}
for (uint32_t j=0; j<w/2; j++) {
for (uint32_t j=0; j<rowSize; j++) {
uint8_t * dst = dest + (i/2)*w + j*2;
if (i & 1) {
uint8_t val = palette[(buf[j] >> 4) & 0x0F] << 4;
*dst |= val ^ 0xF0;
if ((j+1)*2 >= w) break;
val = palette[buf[j] & 0x0F] << 4;
*(dst+1) |= val ^ 0xF0;
}
else {
uint8_t val = palette[(buf[j] >> 4) & 0x0F];
*dst |= val ^ 0x0F;
if ((j+1)*2 >= w) break;
val = palette[buf[j] & 0x0F];
*(dst+1) |= val ^ 0x0F;
}
+3 -1
View File
@@ -116,6 +116,7 @@ else
EXTRAINCDIRS += ../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc
EXTRAINCDIRS += ../targets/taranis
EXTRAINCDIRS += ../fonts/std
EXTRAINCDIRS += ../
ifeq ($(PCBREV), REV3)
CPPDEFS += -DREV3
@@ -160,7 +161,8 @@ SRC = ../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/
../targets/taranis/aspi.c \
../targets/taranis/usb_bsp.c \
../targets/taranis/usb_driver.c \
../targets/taranis/pwr_driver.c
../targets/taranis/pwr_driver.c \
init.c
CPPSRC = ../targets/taranis/lcd_driver.cpp \
../targets/taranis/configure_pins.cpp \
+4
View File
@@ -0,0 +1,4 @@
void _init (void)
{
}
+1
View File
@@ -99,6 +99,7 @@ void beep(uint8_t val);
#define IS_AUDIO_BUSY() (g_beepCnt || beepAgain || beepOn)
#define AUDIO_RESET()
#define AUDIO_FLUSH()
#define PLAY_PHASE_OFF(phase)
#define PLAY_PHASE_ON(phase)
+63 -1
View File
@@ -38,7 +38,7 @@
#include <stdio.h>
#include <stdarg.h>
#if !defined(SIMU)
#if !defined(SIMU) && defined(DEBUG)
Fifo<512> debugRxFifo;
@@ -215,3 +215,65 @@ void debugTask(void* pdata)
}
}
#endif
#if defined(DEBUG_TRACE_BUFFER)
static struct TraceElement traceBuffer[TRACE_BUFFER_LEN];
static uint8_t traceBufferPos;
extern Fifo<512> uart3TxFifo;
gtime_t filltm(gtime_t *t, struct gtm *tp);
void trace_event(enum TraceEvent event, uint32_t data)
{
if (traceBufferPos >= TRACE_BUFFER_LEN) return;
__disable_irq();
struct TraceElement * p = &traceBuffer[traceBufferPos++];
__enable_irq();
p->time = g_rtcTime;
p->time_ms = g_ms100;
p->event = event;
p->data = data;
}
void trace_event_i(enum TraceEvent event, uint32_t data)
{
if (traceBufferPos >= TRACE_BUFFER_LEN) return;
struct TraceElement * p = &traceBuffer[traceBufferPos++];
p->time = g_rtcTime;
p->time_ms = g_ms100;
p->event = event;
p->data = data;
}
const struct TraceElement * getTraceElement(uint16_t idx)
{
if (idx < TRACE_BUFFER_LEN) return &traceBuffer[idx];
return 0;
}
#include "stamp-opentx.h"
void dumpTraceBuffer()
{
TRACE("Dump of Trace Buffer ("VERS_STR " " DATE_STR " " TIME_STR "):");
TRACE("# Time Event Data");
for(int n = 0; n < TRACE_BUFFER_LEN; ++n) {
struct gtm tp;
filltm(&traceBuffer[n].time, &tp);
TRACE_INFO_WP("%02d ", n);
TRACE_INFO_WP("%4d-%02d-%02d,%02d:%02d:%02d.%02d0", tp.tm_year+1900, tp.tm_mon+1, tp.tm_mday, tp.tm_hour, tp.tm_min, tp.tm_sec, traceBuffer[n].time_ms);
TRACE(" %03d 0x%08x", traceBuffer[n].event, traceBuffer[n].data);
if (traceBuffer[n].time == 0 && traceBuffer[n].time_ms == 0) break;
if ((n % 5) == 0) {
while (!uart3TxFifo.empty()) {
CoTickDelay(1);
}
}
}
TRACE("End of Trace Buffer dump");
}
#endif
+84
View File
@@ -38,6 +38,7 @@
#define debug_h
#include <inttypes.h>
#include "rtc.h"
#if defined(SIMU)
@@ -108,5 +109,88 @@ void debugTask(void* pdata);
#endif
#if defined(DEBUG_TRACE_BUFFER)
#define TRACE_BUFFER_LEN 50
enum TraceEvent {
trace_start = 1,
sd_wait_ready = 10,
sd_rcvr_datablock,
sd_xmit_datablock_wait_ready,
sd_xmit_datablock_rcvr_spi,
sd_send_cmd_wait_ready,
sd_send_cmd_rcvr_spi,
sd_SD_ReadSectors = 16,
sd_disk_read,
sd_SD_WriteSectors,
sd_disk_write,
sd_disk_ioctl_CTRL_SYNC = 20,
sd_disk_ioctl_GET_SECTOR_COUNT,
sd_disk_ioctl_MMC_GET_CSD,
sd_disk_ioctl_MMC_GET_CID,
sd_disk_ioctl_MMC_GET_OCR,
sd_disk_ioctl_MMC_GET_SDSTAT_1,
sd_disk_ioctl_MMC_GET_SDSTAT_2,
sd_spi_reset,
ff_f_write_validate = 30,
ff_f_write_flag,
ff_f_write_clst,
ff_f_write_sync_window,
ff_f_write_disk_write_dirty,
ff_f_write_clust2sect,
ff_f_write_disk_write,
ff_f_write_disk_read,
ff_f_write_move_window,
audio_getNextFilledBuffer_skip = 50,
};
struct TraceElement {
gtime_t time;
uint8_t time_ms;
uint8_t event;
uint32_t data;
};
void trace_event(enum TraceEvent event, uint32_t data);
void trace_event_i(enum TraceEvent event, uint32_t data);
const struct TraceElement * getTraceElement(uint16_t idx);
void dumpTraceBuffer();
#define TRACE_EVENT(condition, event, data) if (condition) { trace_event(event, data); }
#define TRACEI_EVENT(condition, event, data) if (condition) { trace_event_i(event, data); }
#else // #if defined(DEBUG_TRACE_BUFFER)
#define TRACE_EVENT(condition, event, data)
#define TRACEI_EVENT(condition, event, data)
#endif // #if defined(DEBUG_TRACE_BUFFER)
#if defined(TRACE_SD_CARD)
#define TRACE_SD_CARD_EVENT(condition, event, data) TRACE_EVENT(condition, event, data)
#else
#define TRACE_SD_CARD_EVENT(condition, event, data)
#endif
#if defined(TRACE_FATFS)
#define TRACE_FATFS_EVENT(condition, event, data) TRACE_EVENT(condition, event, data)
#else
#define TRACE_FATFS_EVENT(condition, event, data)
#endif
#if defined(TRACE_AUDIO)
#define TRACE_AUDIO_EVENT(condition, event, data) TRACE_EVENT(condition, event, data)
#define TRACEI_AUDIO_EVENT(condition, event, data) TRACEI_EVENT(condition, event, data)
#else
#define TRACE_AUDIO_EVENT(condition, event, data)
#define TRACEI_AUDIO_EVENT(condition, event, data)
#endif
#endif // #ifndef debug_h
+3 -3
View File
@@ -472,8 +472,8 @@ void ConvertModel_215_to_216(ModelData &model)
memcpy(&g_model.header, &oldModel.header, sizeof(g_model.header));
for (uint8_t i=0; i<2; i++) {
TimerData & timer = g_model.timers[i];
if (oldModel.timers[i].mode >= TMRMODE_FIRST_SWITCH)
timer.mode = TMRMODE_FIRST_SWITCH + ConvertSwitch_215_to_216(oldModel.timers[i].mode - TMRMODE_FIRST_SWITCH + 1) - 1;
if (oldModel.timers[i].mode >= TMRMODE_COUNT)
timer.mode = TMRMODE_COUNT + ConvertSwitch_215_to_216(oldModel.timers[i].mode - TMRMODE_COUNT + 1) - 1;
else
timer.mode = oldModel.timers[i].mode;
timer.start = oldModel.timers[i].start;
@@ -730,7 +730,7 @@ void ConvertModel_215_to_216(ModelData &model)
fn.func = oldModel.funcSw[i].func;
if (fn.func <= 15) {
fn.all.param = fn.func;
fn.func = FUNC_SAFETY_CHANNEL;
fn.func = FUNC_OVERRIDE_CHANNEL;
}
else if (fn.func <= 20) {
fn.all.param = fn.func - 16;
+1
View File
@@ -385,6 +385,7 @@ void eeLoadModel(uint8_t id)
read32_eeprom_data((File_system[id+1].block_no << 12) + sizeof(struct t_eeprom_header), (uint8_t *)&g_model, size) ;
}
AUDIO_FLUSH();
flightReset();
logicalSwitchesReset();
+7 -1
View File
@@ -964,16 +964,22 @@ void eeLoadModel(uint8_t id)
}
#endif
bool newModel = false;
if (sz < 256) {
modelDefault(id);
eeCheck(true);
newModel = true;
}
AUDIO_FLUSH();
flightReset();
logicalSwitchesReset();
if (pulsesStarted()) {
checkAll();
if (!newModel) {
checkAll();
}
resumePulses();
}
+5 -1
View File
@@ -47,6 +47,10 @@ class Fifo
{
}
bool empty() {
return (ridx == widx);
}
void push(uint8_t byte) {
uint32_t next = (widx+1) & (N-1);
if (next != ridx) {
@@ -56,7 +60,7 @@ class Fifo
}
bool pop(uint8_t & byte) {
if (ridx == widx) {
if (empty()) {
return false;
}
else {
+33 -33
View File
@@ -229,16 +229,16 @@ void menuGeneralSetup(uint8_t event)
#if defined(RTCLOCK)
case ITEM_SETUP_DATE:
lcd_putsLeft(y, STR_DATE);
lcd_putc(RADIO_SETUP_DATE_COLUMN+2, y, '-'); lcd_putc(RADIO_SETUP_DATE_COLUMN+3*FW, y, '-');
lcd_putc(RADIO_SETUP_DATE_COLUMN, y, '-'); lcd_putc(RADIO_SETUP_DATE_COLUMN+3*FW-2, y, '-');
for (uint8_t j=0; j<3; j++) {
uint8_t rowattr = (m_posHorz==j ? attr : 0);
switch (j) {
case 0:
lcd_outdezAtt(RADIO_SETUP_DATE_COLUMN+2, y, t.tm_year+1900, rowattr);
lcd_outdezAtt(RADIO_SETUP_DATE_COLUMN, y, t.tm_year+1900, rowattr);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_year = checkIncDec(event, t.tm_year, 112, 200, 0);
break;
case 1:
lcd_outdezNAtt(RADIO_SETUP_DATE_COLUMN+3*FW, y, t.tm_mon+1, rowattr|LEADING0, 2);
lcd_outdezNAtt(RADIO_SETUP_DATE_COLUMN+3*FW-2, y, t.tm_mon+1, rowattr|LEADING0, 2);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mon = checkIncDec(event, t.tm_mon, 0, 11, 0);
break;
case 2:
@@ -247,7 +247,7 @@ void menuGeneralSetup(uint8_t event)
int8_t dlim = (((((year%4==0) && (year%100!=0)) || (year%400==0)) && (t.tm_mon==1)) ? 1 : 0);
static const pm_uint8_t dmon[] PROGMEM = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
dlim += pgm_read_byte(&dmon[t.tm_mon]);
lcd_outdezNAtt(RADIO_SETUP_DATE_COLUMN+6*FW-2, y, t.tm_mday, rowattr|LEADING0, 2);
lcd_outdezNAtt(RADIO_SETUP_DATE_COLUMN+6*FW-4, y, t.tm_mday, rowattr|LEADING0, 2);
if (rowattr && (s_editMode>0 || p1valdiff)) t.tm_mday = checkIncDec(event, t.tm_mday, 1, dlim, 0);
break;
}
@@ -292,9 +292,9 @@ void menuGeneralSetup(uint8_t event)
#if defined(BATTGRAPH) || defined(PCBTARANIS)
case ITEM_SETUP_BATT_RANGE:
lcd_putsLeft(y, STR_BATTERY_RANGE);
lcd_putc(g_eeGeneral.vBatMin >= 10 ? RADIO_SETUP_2ND_COLUMN+2*FW+FWNUM-1 : RADIO_SETUP_2ND_COLUMN+2*FW+FWNUM-FW/2, y, '-');
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (m_posHorz==0 ? attr : 0)|LEFT|NO_UNIT);
putsVolts(RADIO_SETUP_2ND_COLUMN+4*FW-2, y, 120+g_eeGeneral.vBatMax, (m_posHorz>0 ? attr : 0)|LEFT|NO_UNIT);
lcd_putc(lcdLastPos, y, '-');
putsVolts(lcdLastPos+FW, y, 120+g_eeGeneral.vBatMax, (m_posHorz>0 ? attr : 0)|LEFT|NO_UNIT);
#if defined(PCBTARANIS)
if (attr && m_posHorz < 0) lcd_filled_rect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
#endif
@@ -531,8 +531,8 @@ void menuGeneralSetup(uint8_t event)
#if defined(PCBTARANIS) && defined(REVPLUS)
case ITEM_SETUP_BACKLIGHT_COLOR:
lcd_putsLeft(y, STR_BLCOLOR);
displaySlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 100, attr);
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 100, EE_GENERAL | NO_INCDEC_MARKS);
displaySlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 20, EE_GENERAL | NO_INCDEC_MARKS);
break;
#endif
@@ -859,12 +859,7 @@ void onSdManagerMenu(const char *result)
#endif
#if defined(PCBTARANIS)
else if (result == STR_ASSIGN_BITMAP) {
strcpy(lfn, reusableBuffer.sdmanager.lines[index]);
// TODO duplicated code for finding extension
uint8_t len = strlen(lfn) - 4;
memset(lfn+len, 0, sizeof(g_model.header.bitmap)-len);
// TODO duplicated code
memcpy(g_model.header.bitmap, lfn, sizeof(g_model.header.bitmap));
strAppendFilename(g_model.header.bitmap, reusableBuffer.sdmanager.lines[index], sizeof(g_model.header.bitmap));
LOAD_MODEL_BITMAP();
memcpy(modelHeaders[g_eeGeneral.currModel].bitmap, g_model.header.bitmap, sizeof(g_model.header.bitmap));
eeDirty(EE_MODEL);
@@ -983,7 +978,8 @@ void menuGeneralSdManager(uint8_t _event)
uint8_t index = m_posVert-1-s_pgOfs;
// TODO duplicated code for finding extension
char * ext = reusableBuffer.sdmanager.lines[index];
ext += strlen(ext) - 4;
int len = strlen(ext) - 4;
ext += len;
/* TODO if (!strcasecmp(ext, MODELS_EXT)) {
s_menu[s_menu_count++] = STR_LOAD_FILE;
}
@@ -992,7 +988,7 @@ void menuGeneralSdManager(uint8_t _event)
}
#endif
#if defined(PCBTARANIS)
else if (!strcasecmp(ext, BITMAPS_EXT) && !READ_ONLY()) {
else if (!strcasecmp(ext, BITMAPS_EXT) && !READ_ONLY() && len <= (int)sizeof(g_model.header.bitmap)) {
MENU_ADD_ITEM(STR_ASSIGN_BITMAP);
}
else if (!strcasecmp(ext, TEXT_EXT)) {
@@ -1254,7 +1250,7 @@ void menuGeneralDiagKeys(uint8_t event)
if (i<8) {
y = i/2*FH+FH*4;
lcd_img(14*FW, y, sticks, i/2, 0);
if (i&1) lcd_img(14*FW, y, sticks, i/2, 0);
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
}
@@ -1386,9 +1382,9 @@ void menuGeneralHardware(uint8_t event)
putsMixerSource(sizeof(TR_TYPE)*FW, y, MIXSRC_FIRST_POT+idx);
uint8_t potType = (g_eeGeneral.potsType & mask) >> shift;
if (potType == POT_TYPE_NONE && i < 2)
potType = POT_TYPE_POT;
potType = POT_TYPE_DETENT;
potType = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_TYPE, STR_POTTYPES, potType, 0, POT_TYPE_MAX, attr, event);
if (potType == POT_TYPE_POT && i < 2)
if (potType == POT_TYPE_DETENT && i < 2)
potType = POT_TYPE_NONE;
g_eeGeneral.potsType &= ~mask;
g_eeGeneral.potsType |= (potType << shift);
@@ -1397,7 +1393,7 @@ void menuGeneralHardware(uint8_t event)
case ITEM_SETUP_HW_UART3_MODE:
g_eeGeneral.uart3Mode = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_UART3MODE, STR_UART3MODES, g_eeGeneral.uart3Mode, 0, UART_MODE_MAX, attr, event);
if (checkIncDec_Ret) {
uart3Init(g_eeGeneral.uart3Mode, MODEL_TELEMETRY_PROTOCOL);
uart3Init(g_eeGeneral.uart3Mode, MODEL_TELEMETRY_PROTOCOL());
}
break;
}
@@ -1490,7 +1486,9 @@ void menuCommonCalib(uint8_t event)
reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[i]);
reusableBuffer.calib.hiVals[i] = max(vt, reusableBuffer.calib.hiVals[i]);
if (i >= POT1 && i <= POT_LAST) {
reusableBuffer.calib.midVals[i] = (reusableBuffer.calib.hiVals[i] + reusableBuffer.calib.loVals[i]) / 2;
if (IS_POT_WITHOUT_DETENT(i)) {
reusableBuffer.calib.midVals[i] = (reusableBuffer.calib.hiVals[i] + reusableBuffer.calib.loVals[i]) / 2;
}
#if defined(PCBTARANIS)
uint8_t idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
@@ -1585,23 +1583,25 @@ void menuCommonCalib(uint8_t event)
for (uint8_t i=POT1; i<=POT_LAST; i++) {
int idx = i - POT1;
int count = reusableBuffer.calib.xpotsCalib[idx].stepsCount;
if (IS_POT_MULTIPOS(i) && count > 1 && count <= XPOTS_MULTIPOS_COUNT) {
for (int j=0; j<count; j++) {
for (int k=j+1; k<count; k++) {
if (reusableBuffer.calib.xpotsCalib[idx].steps[k] < reusableBuffer.calib.xpotsCalib[idx].steps[j]) {
swap(reusableBuffer.calib.xpotsCalib[idx].steps[j], reusableBuffer.calib.xpotsCalib[idx].steps[k]);
if (IS_POT_MULTIPOS(i)) {
if (count > 1 && count <= XPOTS_MULTIPOS_COUNT) {
for (int j=0; j<count; j++) {
for (int k=j+1; k<count; k++) {
if (reusableBuffer.calib.xpotsCalib[idx].steps[k] < reusableBuffer.calib.xpotsCalib[idx].steps[j]) {
swap(reusableBuffer.calib.xpotsCalib[idx].steps[j], reusableBuffer.calib.xpotsCalib[idx].steps[k]);
}
}
}
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[i];
calib->count = count - 1;
for (int j=0; j<calib->count; j++) {
calib->steps[j] = (reusableBuffer.calib.xpotsCalib[idx].steps[j+1] + reusableBuffer.calib.xpotsCalib[idx].steps[j]) >> 5;
}
}
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[i];
calib->count = count - 1;
for (int j=0; j<calib->count; j++) {
calib->steps[j] = (reusableBuffer.calib.xpotsCalib[idx].steps[j+1] + reusableBuffer.calib.xpotsCalib[idx].steps[j]) >> 5;
else {
g_eeGeneral.potsType &= ~(0x03<<(2*idx));
}
}
else {
g_eeGeneral.potsType &= ~(1<<idx);
}
}
#endif
g_eeGeneral.chkSum = evalChkSum();
+48 -49
View File
@@ -1120,7 +1120,7 @@ void menuModelSetup(uint8_t event)
div_t qr = div(timer->start, 60);
switch (m_posHorz) {
case 0:
CHECK_INCDEC_MODELVAR(event, timer->mode, SWSRC_FIRST, TMR_VAROFS+SWSRC_LAST-1);
CHECK_INCDEC_MODELVAR_CHECK(event, timer->mode, SWSRC_FIRST, TMRMODE_COUNT+SWSRC_LAST-1/*SWSRC_None removed*/, isSwitchAvailableInTimers);
break;
case 1:
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59);
@@ -1224,7 +1224,7 @@ void menuModelSetup(uint8_t event)
if (attr) {
s_editMode = 0;
if (!READ_ONLY()) {
switch(event) {
switch (event) {
CASE_EVT_ROTARY_BREAK
case EVT_KEY_BREAK(KEY_ENTER):
#if defined(CPUM64)
@@ -1320,13 +1320,13 @@ void menuModelSetup(uint8_t event)
}
}
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""Off\0""Man\0""Auto"), potMode, attr & ((m_posHorz == 0) ? attr : !INVERS));
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), potMode, attr & ((m_posHorz == 0) ? attr : !INVERS));
if (potMode) {
uint8_t x = MODEL_SETUP_2ND_COLUMN+5*FW;
for (uint8_t i=0; i<NUM_POTS ; i++) {
#if !defined(REVPLUS)
if (i == POT3-POT1) {
if (m_posHorz==i+1) REPEAT_LAST_CURSOR_MOVE();
if (attr && (m_posHorz==i+1)) REPEAT_LAST_CURSOR_MOVE();
continue;
}
#endif
@@ -1353,7 +1353,7 @@ void menuModelSetup(uint8_t event)
uint8_t x = MODEL_SETUP_2ND_COLUMN+i*FW;
#if defined(PCBTARANIS) && !defined(REVPLUS)
if (i == POT3) {
if (m_posHorz == POT3) REPEAT_LAST_CURSOR_MOVE();
if (attr && m_posHorz == POT3) REPEAT_LAST_CURSOR_MOVE();
continue;
}
else if (i > POT3) {
@@ -1621,7 +1621,7 @@ void menuModelSetup(uint8_t event)
if (IS_PPM_PROTOCOL(protocol)) {
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+7*FW, y, STR_NCHANNELS, g_model.ppmNCH+2, m_posHorz!=0 ? attr : 0);
}
else if (attr) {
else if (m_posHorz>0 && attr) {
MOVE_CURSOR_FROM_HERE();
}
if (attr && (editMode>0 || p1valdiff || (!IS_PPM_PROTOCOL(protocol) && !IS_DSM2_PROTOCOL(protocol)))) {
@@ -1940,7 +1940,7 @@ void menuModelFlightModesAll(uint8_t event)
case ITEM_FLIGHT_MODES_SWITCH:
putsSwitches((5+LEN_FP_NAME)*FW+FW/2, y, p->swtch, attr);
if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_SHORT_LIST, SWSRC_LAST_SHORT_LIST);
if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
break;
case ITEM_FLIGHT_MODES_TRIM_RUD:
@@ -3097,12 +3097,13 @@ void menuModelExpoOne(uint8_t event)
if (ed->srcRaw >= MIXSRC_FIRST_TELEM) {
putsTelemetryChannel(LCD_W-8, 6*FH, ed->srcRaw - MIXSRC_FIRST_TELEM, x512, 0);
if (ed->scale > 0) x512 = (x512 * 1024) / convertTelemValue(ed->srcRaw - MIXSRC_FIRST_TELEM + 1, ed->scale);
x512 = limit(-1024, x512, 1024);
}
else {
lcd_outdezAtt(LCD_W-8, 6*FH, calcRESXto1000(x512), PREC1);
}
x512 = limit(-1024, x512, 1024);
int y512 = expoFn(x512);
y512 = limit(-1024, y512, 1024);
lcd_outdezAtt(LCD_W-8-6*FW, 1*FH, calcRESXto1000(y512), PREC1);
#else
int16_t x512 = calibratedStick[ed->chn];
@@ -3111,10 +3112,11 @@ void menuModelExpoOne(uint8_t event)
lcd_outdezAtt(LCD_W-8-6*FW, 1*FH, calcRESXto100(y512), 0);
#endif
x512 = X0+x512/(RESXu/WCHART);
#if defined(CPUARM)
x512 = X0+x512/(RESX/WCHART);
y512 = (LCD_H-1) - ((y512+RESX)/2) * (LCD_H-1) / RESX;
#else
x512 = X0+x512/(RESXu/WCHART);
y512 = (LCD_H-1) - (uint16_t)((y512+RESX)/2) * (LCD_H-1) / RESX;
#endif
@@ -3997,7 +3999,7 @@ void menuModelLimits(uint8_t event)
#if defined(PCBTARANIS)
putsChn(0, y, k+1, (sub==k && m_posHorz < 0) ? INVERS : 0);
if (sub==k && m_posHorz < 0 && event==EVT_KEY_LONG(KEY_ENTER)) {
if (sub==k && m_posHorz < 0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
killEvents(event);
MENU_ADD_ITEM(STR_RESET);
MENU_ADD_ITEM(STR_COPY_TRIMS_TO_OFS);
@@ -4359,6 +4361,22 @@ enum LogicalSwitchFields {
#define CHECK_INCDEC_PARAM(event, var, min, max) checkIncDec(event, var, min, max, incdecFlag)
#endif
#if defined(CPUARM)
void putsEdgeDelayParam(xcoord_t x, uint8_t y, LogicalSwitchData *cs, uint8_t lattr, uint8_t rattr)
{
lcd_putc(x-4, y, '[');
lcd_outdezAtt(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
lcd_putc(lcdLastPos, y, ':');
if (cs->v3 < 0)
lcd_putsAtt(lcdLastPos+3, y, "<<", rattr);
else if (cs->v3 == 0)
lcd_putsAtt(lcdLastPos+3, y, "--", rattr);
else
lcd_outdezAtt(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
lcd_putc(lcdLastPos, y, ']');
}
#endif
#if defined(CPUARM) && LCD_W < 212
#define CSWONE_2ND_COLUMN (11*FW)
@@ -4440,17 +4458,10 @@ void menuModelLogicalSwitchOne(uint8_t event)
v2_max = 99;
}
else if (cstate == LS_FAMILY_STAY) {
lcd_putc(CSWONE_2ND_COLUMN-4, y, '[');
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, lswTimerValue(cs->v2), LEFT|PREC1|(m_posHorz==0 ? attr : 0));
lcd_putc(lcdLastPos, y, ':');
if (cs->v3 == 0)
lcd_putsAtt(lcdLastPos+3, y, "--", (m_posHorz==1 ? attr : 0));
else
lcd_outdezAtt(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|(m_posHorz==1 ? attr : 0));
lcd_putc(lcdLastPos, y, ']');
putsEdgeDelayParam(CSWONE_2ND_COLUMN, y, cs, m_posHorz==0 ? attr : 0, m_posHorz==1 ? attr : 0);
if (s_editMode <= 0) continue;
if (attr && m_posHorz==1) {
CHECK_INCDEC_MODELVAR(event, cs->v3, 0, 222 - cs->v2);
CHECK_INCDEC_MODELVAR(event, cs->v3, -1, 222 - cs->v2);
break;
}
v2_min = -129; v2_max = 122;
@@ -4480,7 +4491,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
else
#endif
{
v2_min = -125; v2_max = 125;
v2_min = -LIMIT_EXT_PERCENT; v2_max = +LIMIT_EXT_PERCENT;
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, cs->v2, LEFT|attr);
}
}
@@ -4563,14 +4574,7 @@ void menuModelLogicalSwitches(uint8_t event)
}
else if (cstate == LS_FAMILY_STAY) {
putsSwitches(CSW_2ND_COLUMN, y, cs->v1, 0);
lcd_putc(CSW_3RD_COLUMN-4, y, '[');
lcd_outdezAtt(CSW_3RD_COLUMN, y, lswTimerValue(cs->v2), LEFT|PREC1);
lcd_putc(lcdLastPos, y, ':');
if (cs->v3 == 0)
lcd_puts(lcdLastPos+3, y, "--");
else
lcd_outdezAtt(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1);
lcd_putc(lcdLastPos-1, y, ']');
putsEdgeDelayParam(CSW_3RD_COLUMN, y, cs, 0, 0);
}
else if (cstate == LS_FAMILY_TIMER) {
lcd_outdezAtt(CSW_2ND_COLUMN, y, cs->v1+1, LEFT);
@@ -4682,7 +4686,7 @@ void menuModelLogicalSwitches(uint8_t event)
uint8_t cstate = lswFamily(cs->func);
#if defined(CPUARM)
int16_t v1_val=cs->v1, v1_min=0, v1_max=MIXSRC_LAST_TELEM, v2_min=0, v2_max=MIXSRC_LAST_TELEM;
int16_t v3_min=0, v3_max=100;
int16_t v3_min=-1, v3_max=100;
#else
int8_t v1_min=0, v1_max=MIXSRC_LAST_TELEM, v2_min=0, v2_max=MIXSRC_LAST_TELEM;
#define v1_val cs->v1
@@ -4691,28 +4695,21 @@ void menuModelLogicalSwitches(uint8_t event)
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
putsSwitches(CSW_2ND_COLUMN, y, cs->v1, attr1);
putsSwitches(CSW_3RD_COLUMN, y, cs->v2, attr2);
v1_min = SWSRC_OFF+1; v1_max = SWSRC_ON-1;
v2_min = SWSRC_OFF+1; v2_max = SWSRC_ON-1;
v1_min = SWSRC_FIRST_IN_LOGICAL_SWITCHES; v1_max = SWSRC_LAST_IN_LOGICAL_SWITCHES;
v2_min = SWSRC_FIRST_IN_LOGICAL_SWITCHES; v2_max = SWSRC_LAST_IN_LOGICAL_SWITCHES;
INCDEC_SET_FLAG(INCDEC_SWITCH);
INCDEC_ENABLE_CHECK(isSwitchAvailableInLogicalSwitches);
}
#if defined(CPUARM)
else if (cstate == LS_FAMILY_STAY) {
putsSwitches(CSW_2ND_COLUMN, y, cs->v1, attr1);
lcd_putc(CSW_3RD_COLUMN-4, y, '[');
lcd_outdezAtt(CSW_3RD_COLUMN, y, lswTimerValue(cs->v2), LEFT|PREC1|attr2);
lcd_putc(lcdLastPos, y, ':');
if (cs->v3 == 0)
lcd_putsAtt(lcdLastPos+3, y, "--", (horz==LS_FIELD_V3 ? attr : 0));
else
lcd_outdezAtt(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|(horz==LS_FIELD_V3 ? attr : 0));
lcd_putc(lcdLastPos, y, ']');
v1_min = SWSRC_OFF+1; v1_max = SWSRC_ON-1;
putsEdgeDelayParam(CSW_3RD_COLUMN, y, cs, attr2, horz==LS_FIELD_V3 ? attr : 0);
v1_min = SWSRC_FIRST_IN_LOGICAL_SWITCHES; v1_max = SWSRC_LAST_IN_LOGICAL_SWITCHES;
v2_min=-129; v2_max = 122;
v3_max = 222 - cs->v2;
if (horz == 1) {
INCDEC_SET_FLAG(INCDEC_SWITCH);
INCDEC_ENABLE_CHECK(isSwitchAvailable);
INCDEC_ENABLE_CHECK(isSwitchAvailableInLogicalSwitches);
}
else {
INCDEC_SET_FLAG(0);
@@ -4791,7 +4788,7 @@ void menuModelLogicalSwitches(uint8_t event)
else
#endif
{
v2_min = -125; v2_max = +125;
v2_min = -LIMIT_EXT_PERCENT; v2_max = +LIMIT_EXT_PERCENT;
}
}
#else
@@ -4801,7 +4798,7 @@ void menuModelLogicalSwitches(uint8_t event)
}
else {
lcd_outdezAtt(CSW_3RD_COLUMN, y, cs->v2, LEFT|attr2);
v2_min = -125; v2_max = 125;
v2_min = -LIMIT_EXT_PERCENT; v2_max = +LIMIT_EXT_PERCENT;
}
#endif
}
@@ -5042,7 +5039,7 @@ void menuModelCustomFunctions(uint8_t event)
switch (j) {
case 0:
putsSwitches(MODEL_CUSTOM_FUNC_1ST_COLUMN, y, CFN_SWITCH(sd), attr | ((activeFnSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
if (active || AUTOSWITCH_ENTER_LONG()) CHECK_INCDEC_MODELSWITCH(event, CFN_SWITCH(sd), SWSRC_FIRST, SWSRC_LAST);
if (active || AUTOSWITCH_ENTER_LONG()) CHECK_INCDEC_MODELSWITCH(event, CFN_SWITCH(sd), SWSRC_FIRST, SWSRC_LAST, isSwitchAvailableInCustomFunctions);
break;
case 1:
@@ -5068,8 +5065,8 @@ void menuModelCustomFunctions(uint8_t event)
case 2:
{
int8_t maxParam = NUM_CHNOUT-1;
#if defined(SAFETY_CHANNEL_FUNCTION)
if (func == FUNC_SAFETY_CHANNEL) {
#if defined(OVERRIDE_CHANNEL_FUNCTION)
if (func == FUNC_OVERRIDE_CHANNEL) {
putsChn(lcdNextPos, y, CFN_CH_INDEX(sd)+1, attr);
}
else
@@ -5120,10 +5117,12 @@ void menuModelCustomFunctions(uint8_t event)
val_max = FUNC_RESET_PARAM_LAST;
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_VFSWRESET, CFN_PARAM(sd), attr);
}
#if defined(SAFETY_CHANNEL_FUNCTION)
else if (func == FUNC_SAFETY_CHANNEL) {
#if defined(OVERRIDE_CHANNEL_FUNCTION)
else if (func == FUNC_OVERRIDE_CHANNEL) {
#if !defined(CPUARM)
val_displayed = (int8_t)CFN_PARAM(sd);
val_min = -125; val_max = 125;
#endif
val_min = -LIMIT_EXT_PERCENT; val_max = +LIMIT_EXT_PERCENT;
lcd_outdezAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
}
#endif
+71 -23
View File
@@ -1117,7 +1117,7 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t
{
lcd_putsColumnLeft(x, y, STR_SWITCH);
putsSwitches(x, y, value, attr);
if (attr) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST_SHORT_LIST, SWSRC_LAST_SHORT_LIST);
if (attr) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
return value;
}
@@ -1462,6 +1462,14 @@ bool isTelemetrySourceAvailable(int source)
bool isInputSourceAvailable(int source)
{
#if defined(PCBTARANIS) && !defined(REVPLUS)
if (source == MIXSRC_POT3)
return false;
#endif
if (source>=MIXSRC_Rud && source<=MIXSRC_MAX)
return true;
if (source>=MIXSRC_Rud && source<=MIXSRC_MAX)
return true;
@@ -1480,17 +1488,25 @@ bool isInputSourceAvailable(int source)
return false;
}
bool isSwitchAvailableInLogicalSwitches(int swtch)
enum SwitchContext
{
LogicalSwitchesContext,
CustomFunctionsContext,
TimersContext,
MixesContext
};
bool isSwitchAvailable(int swtch, SwitchContext context)
{
if (swtch < 0) {
if (swtch <= -SWSRC_ON)
return false;
#if defined(PCBTARANIS)
else if (swtch == -SWSRC_SF0 || swtch == -SWSRC_SF2 || swtch == -SWSRC_SH0 || swtch == -SWSRC_SH2)
if (swtch == -SWSRC_SF0 || swtch == -SWSRC_SF2 || swtch == -SWSRC_SH0 || swtch == -SWSRC_SH2)
return false;
#endif
else
swtch = -swtch;
if (swtch == -SWSRC_ON || swtch == -SWSRC_One) {
return false;
}
swtch = -swtch;
}
#if defined(PCBTARANIS)
@@ -1506,27 +1522,59 @@ bool isSwitchAvailableInLogicalSwitches(int swtch)
}
#endif
return true;
}
bool isSwitchAvailable(int swtch)
{
if (!isSwitchAvailableInLogicalSwitches(swtch)) {
return false;
}
if (swtch < 0) {
swtch = -swtch;
}
if (swtch >= SWSRC_FIRST_LOGICAL_SWITCH && swtch <= SWSRC_LAST_LOGICAL_SWITCH) {
if (context != LogicalSwitchesContext && swtch >= SWSRC_FIRST_LOGICAL_SWITCH && swtch <= SWSRC_LAST_LOGICAL_SWITCH) {
LogicalSwitchData * cs = lswAddress(swtch-SWSRC_FIRST_LOGICAL_SWITCH);
return (cs->func != LS_FUNC_NONE);
}
if (context != CustomFunctionsContext && (swtch == SWSRC_ON || swtch == SWSRC_One)) {
return false;
}
if (swtch >= SWSRC_FIRST_FLIGHT_MODE && swtch <= SWSRC_LAST_FLIGHT_MODE) {
if (context == MixesContext) {
return false;
}
else {
swtch -= SWSRC_FIRST_FLIGHT_MODE;
if (swtch == 0) {
return true;
}
FlightModeData * fm = flightModeAddress(swtch);
return (fm->swtch != SWSRC_NONE);
}
}
return true;
}
bool isSwitchAvailableInLogicalSwitches(int swtch)
{
return isSwitchAvailable(swtch, LogicalSwitchesContext);
}
bool isSwitchAvailableInCustomFunctions(int swtch)
{
return isSwitchAvailable(swtch, CustomFunctionsContext);
}
bool isSwitchAvailableInMixes(int swtch)
{
return isSwitchAvailable(swtch, MixesContext);
}
bool isSwitchAvailableInTimers(int swtch)
{
if (swtch >= 0) {
if (swtch < TMRMODE_COUNT) {
return true;
}
swtch -= TMRMODE_COUNT-1;
}
return isSwitchAvailable(swtch, TimersContext);
}
bool isThrottleSourceAvailable(int source)
{
#if defined(PCBTARANIS)
@@ -1544,8 +1592,8 @@ bool isLogicalSwitchFunctionAvailable(int function)
bool isAssignableFunctionAvailable(int function)
{
switch (function) {
#if !defined(SAFETY_CHANNEL_FUNCTION)
case FUNC_SAFETY_CHANNEL:
#if !defined(OVERRIDE_CHANNEL_FUNCTION)
case FUNC_OVERRIDE_CHANNEL:
#endif
#if !defined(HAPTIC)
case FUNC_HAPTIC:
+15 -5
View File
@@ -137,6 +137,9 @@ void menuModelCustomFunctions(uint8_t event);
void menuStatisticsView(uint8_t event);
void menuStatisticsDebug(uint8_t event);
void menuAboutView(uint8_t event);
#if defined(DEBUG_TRACE_BUFFER)
void menuTraceBuffer(uint8_t event);
#endif
#if !defined(CPUM64)
void displaySlider(uint8_t x, uint8_t y, uint8_t value, uint8_t max, uint8_t attr);
@@ -209,9 +212,13 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
var = checkIncDecModelZero(event,var,max)
#if defined(CPUARM)
#define CHECK_INCDEC_MODELVAR_CHECK(event, var, min, max, check) \
var = checkIncDec(event, var, min, max, EE_MODEL, check)
#define CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, var, max, check) \
var = checkIncDec(event, var, 0, max, EE_MODEL, check)
#else
#define CHECK_INCDEC_MODELVAR_CHECK(event, var, min, max, check) \
var = checkIncDec(event, var, min, max, EE_MODEL)
#define CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, var, max, check) \
CHECK_INCDEC_MODELVAR_ZERO(event, var, max)
#endif
@@ -220,19 +227,22 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
bool isThrottleSourceAvailable(int source);
bool isLogicalSwitchFunctionAvailable(int function);
bool isAssignableFunctionAvailable(int function);
bool isSwitchAvailable(int swtch);
bool isSwitchAvailableInLogicalSwitches(int swtch);
bool isSwitchAvailableInCustomFunctions(int swtch);
bool isSwitchAvailableInMixes(int swtch);
bool isSwitchAvailableInTimers(int swtch);
bool isModuleAvailable(int module);
#define AUTOSWITCH_ENTER_LONG() (attr && event==EVT_KEY_LONG(KEY_ENTER))
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max) \
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SWITCH|NO_INCDEC_MARKS, isSwitchAvailable)
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max, available) \
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SWITCH|NO_INCDEC_MARKS, available)
#elif defined(AUTOSWITCH)
#define AUTOSWITCH_ENTER_LONG() (attr && event==EVT_KEY_LONG(KEY_ENTER))
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max) \
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max, available) \
var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SWITCH)
#else
#define AUTOSWITCH_ENTER_LONG() (0)
#define CHECK_INCDEC_MODELSWITCH CHECK_INCDEC_MODELVAR
#define CHECK_INCDEC_MODELSWITCH(event, var, min, max, available) \
CHECK_INCDEC_MODELVAR(event, var, min, max)
#endif
#if defined(CPUARM)
+2 -2
View File
@@ -164,7 +164,7 @@ void displayTrims(uint8_t phase)
uint8_t att = ROUND;
int16_t val = getTrimValue(phase, i);
if (val < -125 || val > 125)
if (val < TRIM_MIN || val > TRIM_MAX)
att = BLINK|INVERS|ROUND;
if (val < -(TRIM_LEN+1)*4)
@@ -306,7 +306,7 @@ void displayTopBar()
}
/* Audio volume */
if (requiredSpeakerVolume == 0)
if (requiredSpeakerVolume == 0 || g_eeGeneral.beepMode == e_mode_quiet)
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER0);
else if (requiredSpeakerVolume < 10)
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER1);
+126 -42
View File
@@ -92,9 +92,20 @@ void menuStatisticsView(uint8_t event)
#if defined(PCBTARANIS)
#define MENU_DEBUG_COL1_OFS (11*FW-2)
#define MENU_DEBUG_Y_MIXMAX (2*FH-3)
#define MENU_DEBUG_Y_LUA (3*FH-2)
#define MENU_DEBUG_Y_FREE_RAM (4*FH-1)
#define MENU_DEBUG_Y_STACK (5*FH)
#define MENU_DEBUG_Y_RTOS (6*FH)
#elif defined(PCBSKY9X)
#define MENU_DEBUG_COL1_OFS (11*FW-3)
#define MENU_DEBUG_COL2_OFS (17*FW)
#define MENU_DEBUG_Y_CURRENT (1*FH)
#define MENU_DEBUG_Y_MAH (2*FH)
#define MENU_DEBUG_Y_CPU_TEMP (3*FH)
#define MENU_DEBUG_Y_COPROC (4*FH)
#define MENU_DEBUG_Y_MIXMAX (5*FH)
#define MENU_DEBUG_Y_RTOS (6*FH)
#else
#define MENU_DEBUG_COL1_OFS (14*FW)
#endif
@@ -130,6 +141,13 @@ void menuStatisticsDebug(uint8_t event)
maxMixerDuration = 0;
AUDIO_KEYPAD_UP();
break;
#if defined(DEBUG_TRACE_BUFFER)
case EVT_KEY_FIRST(KEY_UP):
pushMenu(menuTraceBuffer);
return;
#endif
case EVT_KEY_FIRST(KEY_DOWN):
chainMenu(menuStatisticsView);
return;
@@ -149,76 +167,87 @@ void menuStatisticsDebug(uint8_t event)
#if defined(PCBSKY9X) && !defined(REVA)
// current
lcd_putsLeft(1*FH, STR_CPU_CURRENT);
putsTelemetryValue(MENU_DEBUG_COL1_OFS, 1*FH, getCurrent(), UNIT_MILLIAMPS, LEFT);
lcd_putsLeft(MENU_DEBUG_Y_CURRENT, STR_CPU_CURRENT);
putsTelemetryValue(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_CURRENT, getCurrent(), UNIT_MILLIAMPS, LEFT);
uint32_t current_scale = 488 + g_eeGeneral.currentCalib;
lcd_putc(MENU_DEBUG_COL2_OFS, 1*FH, '>');
putsTelemetryValue(MENU_DEBUG_COL2_OFS+FW+1, 1*FH, Current_max*10*current_scale/8192, UNIT_RAW, LEFT);
lcd_putc(MENU_DEBUG_COL2_OFS, MENU_DEBUG_Y_CURRENT, '>');
putsTelemetryValue(MENU_DEBUG_COL2_OFS+FW+1, MENU_DEBUG_Y_CURRENT, Current_max*10*current_scale/8192, UNIT_RAW, LEFT);
// consumption
lcd_putsLeft(2*FH, STR_CPU_MAH);
putsTelemetryValue(MENU_DEBUG_COL1_OFS, 2*FH, g_eeGeneral.mAhUsed + Current_used*current_scale/8192/36, UNIT_MAH, LEFT|PREC1);
lcd_putsLeft(MENU_DEBUG_Y_MAH, STR_CPU_MAH);
putsTelemetryValue(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MAH, g_eeGeneral.mAhUsed + Current_used*current_scale/8192/36, UNIT_MAH, LEFT|PREC1);
#endif
#if defined(PCBSKY9X)
lcd_putsLeft(3*FH, STR_CPU_TEMP);
putsTelemetryValue(MENU_DEBUG_COL1_OFS, 3*FH, getTemperature(), UNIT_TEMPERATURE, LEFT);
lcd_putc(MENU_DEBUG_COL2_OFS, 3*FH, '>');
putsTelemetryValue(MENU_DEBUG_COL2_OFS+FW+1, 3*FH, maxTemperature+g_eeGeneral.temperatureCalib, UNIT_TEMPERATURE, LEFT);
lcd_putsLeft(MENU_DEBUG_Y_CPU_TEMP, STR_CPU_TEMP);
putsTelemetryValue(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_CPU_TEMP, getTemperature(), UNIT_TEMPERATURE, LEFT);
lcd_putc(MENU_DEBUG_COL2_OFS, MENU_DEBUG_Y_CPU_TEMP, '>');
putsTelemetryValue(MENU_DEBUG_COL2_OFS+FW+1, MENU_DEBUG_Y_CPU_TEMP, maxTemperature+g_eeGeneral.temperatureCalib, UNIT_TEMPERATURE, LEFT);
#endif
#if defined(COPROCESSOR)
lcd_putsLeft(4*FH, STR_COPROC_TEMP);
lcd_putsLeft(MENU_DEBUG_Y_COPROC, STR_COPROC_TEMP);
if (Coproc_read==0) {
lcd_putsAtt(MENU_DEBUG_COL1_OFS, 4*FH, PSTR("Co Proc NACK"),INVERS);
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Co Proc NACK"),INVERS);
}
else if (Coproc_read==0x81) {
lcd_putsAtt(MENU_DEBUG_COL1_OFS, 4*FH, PSTR("Inst.TinyApp"),INVERS);
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Inst.TinyApp"),INVERS);
}
else if (Coproc_read<3) {
lcd_putsAtt(MENU_DEBUG_COL1_OFS, 4*FH, PSTR("Upgr.TinyApp"),INVERS);
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Upgr.TinyApp"),INVERS);
}
else {
putsTelemetryValue(MENU_DEBUG_COL1_OFS, 4*FH, Coproc_temp, UNIT_TEMPERATURE, LEFT);
putsTelemetryValue(MENU_DEBUG_COL2_OFS, 4*FH, Coproc_maxtemp, UNIT_TEMPERATURE, LEFT);
putsTelemetryValue(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, Coproc_temp, UNIT_TEMPERATURE, LEFT);
putsTelemetryValue(MENU_DEBUG_COL2_OFS, MENU_DEBUG_Y_COPROC, Coproc_maxtemp, UNIT_TEMPERATURE, LEFT);
}
#endif
#if defined(PCBTARANIS) && !defined(SIMU)
lcd_putsLeft(3*FH, "Free Mem");
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, 3*FH, getAvailableMemory(), LEFT);
lcd_putsLeft(MENU_DEBUG_Y_FREE_RAM, "Free Mem");
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_FREE_RAM, getAvailableMemory(), LEFT);
lcd_puts(lcdLastPos, MENU_DEBUG_Y_FREE_RAM, "b");
#endif
#if defined(LUA)
lcd_putsLeft(4*FH, "Lua scripts");
lcd_putsAtt(MENU_DEBUG_COL1_OFS, 4*FH+1, "[Duration]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, 4*FH, 10*maxLuaDuration, LEFT);
lcd_putsAtt(lcdLastPos+2, 4*FH+1, "[Interval]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, 4*FH, 10*maxLuaInterval, LEFT);
lcd_putsLeft(MENU_DEBUG_Y_LUA, "Lua scripts");
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_LUA+1, "[Duration]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_LUA, 10*maxLuaDuration, LEFT);
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_LUA+1, "[Interval]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_LUA, 10*maxLuaInterval, LEFT);
#endif
#if defined(CPUARM)
lcd_putsLeft(5*FH, STR_TMIXMAXMS);
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, 5*FH, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
lcd_puts(lcdLastPos, 5*FH, "ms");
lcd_putsLeft(6*FH, STR_FREESTACKMINB);
#if LCD_W >= 212
lcd_putsAtt(MENU_DEBUG_COL1_OFS, 6*FH+1, "[Main]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, 6*FH, stack_free(0), UNSIGN|LEFT);
lcd_putsAtt(lcdLastPos+2, 6*FH+1, "[Mix]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, 6*FH, stack_free(1), UNSIGN|LEFT);
lcd_putsAtt(lcdLastPos+2, 6*FH+1, "[Audio]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, 6*FH, stack_free(2), UNSIGN|LEFT);
#else
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, 6*FH, stack_free(0), UNSIGN|LEFT);
lcd_puts(lcdLastPos, 6*FH, "/");
lcd_outdezAtt(lcdLastPos, 6*FH, stack_free(1), UNSIGN|LEFT);
lcd_puts(lcdLastPos, 6*FH, "/");
lcd_outdezAtt(lcdLastPos, 6*FH, stack_free(2), UNSIGN|LEFT);
lcd_putsLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
lcd_puts(lcdLastPos, MENU_DEBUG_Y_MIXMAX, "ms");
#endif
#else
#if 0
lcd_putsLeft(MENU_DEBUG_Y_STACK, STR_FREESTACKMINB);
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_STACK, stack_free(255), UNSIGN|LEFT);
lcd_puts(lcdLastPos, MENU_DEBUG_Y_STACK, "b");
#endif
#if defined(PCBTARANIS)
lcd_putsLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[Main]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(0), UNSIGN|LEFT);
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[Mix]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(1), UNSIGN|LEFT);
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[Audio]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(2), UNSIGN|LEFT);
#endif
#if defined(PCBSKY9X)
lcd_putsLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS, stack_free(0), UNSIGN|LEFT);
lcd_puts(lcdLastPos, MENU_DEBUG_Y_RTOS, "/");
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(1), UNSIGN|LEFT);
lcd_puts(lcdLastPos, MENU_DEBUG_Y_RTOS, "/");
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(2), UNSIGN|LEFT);
#endif
#if !defined(CPUARM)
lcd_putsLeft(1*FH, STR_TMR1LATMAXUS);
lcd_outdez8(MENU_DEBUG_COL1_OFS , 1*FH, g_tmr1Latency_max/2 );
lcd_putsLeft(2*FH, STR_TMR1LATMINUS);
@@ -234,3 +263,58 @@ void menuStatisticsDebug(uint8_t event)
lcd_puts(3*FW, 7*FH+1, STR_MENUTORESET);
lcd_status_line();
}
#if defined(DEBUG_TRACE_BUFFER)
#include "stamp-opentx.h"
void menuTraceBuffer(uint8_t event)
{
switch(event)
{
case EVT_KEY_LONG(KEY_ENTER):
dumpTraceBuffer();
killEvents(event);
break;
}
SIMPLE_SUBMENU("Trace Buffer " VERS_STR, TRACE_BUFFER_LEN);
/* RTC time */
struct gtm t;
gettime(&t);
putsTime(LCD_W+1, 0, t, TIMEBLINK);
uint8_t y = 0;
uint8_t k = 0;
int8_t sub = m_posVert;
lcd_putc(0, FH, '#');
lcd_puts(4*FW, FH, "Time");
lcd_puts(14*FW, FH, "Event");
lcd_puts(20*FW, FH, "Data");
for (uint8_t i=0; i<LCD_LINES-2; i++) {
y = 1 + (i+2)*FH;
k = i+s_pgOfs;
//item
lcd_outdezAtt(0, y, k, LEFT | (sub==k ? INVERS : 0));
const struct TraceElement * te = getTraceElement(k);
if (te) {
//time
putstime_t tme = te->time % SECS_PER_DAY;
putsTimer(4*FW, y, tme, TIMEHOUR|LEFT, TIMEHOUR|LEFT);
//event
lcd_outdezNAtt(14*FW, y, te->event, LEADING0|LEFT, 3);
//data
lcd_putsn (20*FW, y, "0x", 2);
lcd_outhex4(22*FW-2, y, (uint16_t)(te->data >> 16));
lcd_outhex4(25*FW, y, (uint16_t)(te->data & 0xFFFF));
}
}
}
#endif //#if defined(DEBUG_TRACE_BUFFER)

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