Compare commits
362 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b359aa12ba | |||
| 5f81444ccb | |||
| e8aba51edb | |||
| 6393f10ae4 | |||
| 8a16b63b31 | |||
| a5d334b11d | |||
| b51060f8f8 | |||
| 0db8fc5ab2 | |||
| 1c696c28fd | |||
| f29d2074c1 | |||
| c12bc7326c | |||
| 6365292bfe | |||
| d74bdef2ea | |||
| 884698c7f7 | |||
| 1454764987 | |||
| fb35ff098d | |||
| 681064b11c | |||
| 87ebf0b90a | |||
| 1f63108753 | |||
| 649fffa439 | |||
| e3d08e9bab | |||
| b4cc92b3f0 | |||
| 9691d9f648 | |||
| f02b9699d5 | |||
| b78556275b | |||
| 1effa17204 | |||
| ff69164400 | |||
| 86e8687d32 | |||
| 85755312e4 | |||
| f826d77f18 | |||
| 9dc4756789 | |||
| afd04e0c44 | |||
| d718ca03db | |||
| ca4028cc7e | |||
| 9c0b13eb6b | |||
| 5a10d85ee0 | |||
| 2d80327ffd | |||
| 2a5ff5244f | |||
| 2ce1ec16fb | |||
| 607a93b604 | |||
| 75b7a0517b | |||
| cf54d28f35 | |||
| ffe8ee5a29 | |||
| 552e3d468a | |||
| 949369d6a8 | |||
| 3b2cf5d738 | |||
| 5468bacad7 | |||
| b8fea4d652 | |||
| 734480cc56 | |||
| 30e0d441e4 | |||
| 784238252a | |||
| 403a62478a | |||
| c73ab26bc4 | |||
| c0783948e6 | |||
| dc3ca96a2f | |||
| 5664b4a141 | |||
| 7e18f53cbe | |||
| 611e26d0bf | |||
| ae7a36deeb | |||
| 7c37277364 | |||
| 2230fbaa94 | |||
| 97bb1a4b4d | |||
| 82d385bcef | |||
| 34f9367e25 | |||
| 205e510468 | |||
| 414a482ce4 | |||
| b24d071493 | |||
| a50e2472e9 | |||
| 29c95fd2a3 | |||
| c9875525a4 | |||
| 6df7575ad8 | |||
| 86c8d4a878 | |||
| 6abc26c36a | |||
| 966398426a | |||
| d43a48f088 | |||
| 56b4698655 | |||
| 57f0c1b6f6 | |||
| b89e16e627 | |||
| 9e4e990d33 | |||
| a7c893607a | |||
| e477183026 | |||
| a4698287f8 | |||
| b035a8df64 | |||
| 223be49c5d | |||
| ac8312de36 | |||
| 46a9151bcf | |||
| 0e9536fea9 | |||
| 64d86c4c74 | |||
| 151a09149d | |||
| fd53eba65f | |||
| 393f599ecf | |||
| 1fbb4effed | |||
| fe95488a83 | |||
| c9b9de2c99 | |||
| 3adc4c20a6 | |||
| 227a886122 | |||
| de625fde01 | |||
| daad477250 | |||
| 334a718a8a | |||
| 5baaec1868 | |||
| c2ad82eb35 | |||
| c61c417f13 | |||
| 98f156301a | |||
| ef6fe0006e | |||
| 23358c254c | |||
| 6114245229 | |||
| e76880cf26 | |||
| f30dfa3365 | |||
| f4aa92ec20 | |||
| 2640ca9fea | |||
| f6a1420ce3 | |||
| 6c0f65411a | |||
| a7f1ace55b | |||
| b8dedd7940 | |||
| 2703118c56 | |||
| 8bfc7a497a | |||
| 87870c24a5 | |||
| 7610fb43d5 | |||
| 0263784e65 | |||
| 6f74624371 | |||
| 1c721b3817 | |||
| 67d97046bb | |||
| 19d9e6ab19 | |||
| 5d9883d47f | |||
| bb5f1d7d79 | |||
| 30087b4a3a | |||
| 61aa01b9b3 | |||
| 16e06cff70 | |||
| 2073a1f033 | |||
| 563b817b46 | |||
| 8b540a66f6 | |||
| b0b7657756 | |||
| 74d22b623f | |||
| bee01d9999 | |||
| d2055edf62 | |||
| c926ac557b | |||
| 3e2092e32f | |||
| 21054ffc54 | |||
| 350ece0b60 | |||
| 01a103f2e6 | |||
| 2e8e439d27 | |||
| 98e6a3dc21 | |||
| 3b324d076a | |||
| 91c922d5fb | |||
| eac918c2da | |||
| b5f9c0ec84 | |||
| d1f54b099b | |||
| 7b98ad55c0 | |||
| d2cb7cb3dd | |||
| be190b8bb1 | |||
| 4b2c02b2c5 | |||
| 142d3fee1a | |||
| 6a5e938ead | |||
| 2d9ae108ff | |||
| bae84e4e8c | |||
| f4944eefdb | |||
| 5d598cc6a1 | |||
| 945808d69b | |||
| dbe512e45a | |||
| 11efb5121e | |||
| f6274f38aa | |||
| cd1f20b8a0 | |||
| e61b931ddb | |||
| a7a9b61234 | |||
| 5ee95673d1 | |||
| 98c5b5e7bd | |||
| 6d434c0bf9 | |||
| ade7151796 | |||
| a7cd1f9aa0 | |||
| cb2c922542 | |||
| 8159a559da | |||
| ed826d8c62 | |||
| b57f5ab2ce | |||
| 8fbafa6f05 | |||
| 9243a59426 | |||
| ccf66831c7 | |||
| 06792b5696 | |||
| 6d4d871849 | |||
| 5a634a7991 | |||
| 69e504212e | |||
| 03e049c360 | |||
| 4ca893da1f | |||
| 66670cf713 | |||
| 271bb4a82e | |||
| e0eab648ef | |||
| 3235f43db9 | |||
| c12b0cfebe | |||
| 3e590d44f0 | |||
| 1f6d1799af | |||
| 8c813a87c9 | |||
| 5bdeedbd0e | |||
| e33f4cf415 | |||
| 61d745011a | |||
| 3e269a04ae | |||
| 341feaf78f | |||
| 19ddf6fc23 | |||
| 9b4b0d3c83 | |||
| dc1eebf40d | |||
| 752e13b9ab | |||
| b988bec5bd | |||
| 3c72afed20 | |||
| e7586f47c3 | |||
| f126b149f0 | |||
| 6b15c0c985 | |||
| db85f39ebc | |||
| dee1e4ce8d | |||
| df96504a85 | |||
| 0112a1e3e9 | |||
| 36481471a3 | |||
| dd08886f2c | |||
| 76ef4b5948 | |||
| eaa247f46d | |||
| 3ada9f7cf5 | |||
| 10a5e4dc89 | |||
| 50e4850745 | |||
| a92de216ac | |||
| 3f3708f0f1 | |||
| 72c433ce9d | |||
| f123b69521 | |||
| 80369f0e8f | |||
| 8cd67bf31e | |||
| 34ef060e16 | |||
| 1f07f88dce | |||
| 4db5bdd486 | |||
| 05ac0682f0 | |||
| f12c3072b5 | |||
| 35aea83c89 | |||
| cf9b5d05a8 | |||
| d5393be5cb | |||
| 10c9936fa0 | |||
| 7a74d3ac85 | |||
| 39edaff669 | |||
| c5aed5f79b | |||
| 9b07a77e14 | |||
| 380fe5e44d | |||
| 8bd2c120d6 | |||
| 741ef45f3e | |||
| 4103adf75d | |||
| c0e612531d | |||
| 55cb5dce87 | |||
| 12ba27247e | |||
| 1e33e99655 | |||
| 50acd1fd92 | |||
| c3626225aa | |||
| b71a96ed55 | |||
| d2fcd544d8 | |||
| 50997721e2 | |||
| 828372ab29 | |||
| 21ae270c0e | |||
| 1b2efd1121 | |||
| 8d6a7c9495 | |||
| 189becfbb2 | |||
| 5a19e147fd | |||
| 062f93ae38 | |||
| 9861a08150 | |||
| de15d0a5a4 | |||
| 1e77bb3c02 | |||
| adadbe06ad | |||
| 92f2c48de9 | |||
| 1d4fa2a8b0 | |||
| 5493776b9c | |||
| b166b77c3e | |||
| 0ecb978364 | |||
| c8d792d3d8 | |||
| e9663e40e2 | |||
| a7e906dea9 | |||
| 685ab3d101 | |||
| 77564d74a4 | |||
| a0142d65be | |||
| 662bf15562 | |||
| 79b928af56 | |||
| 8c28f4bc48 | |||
| 7a4d6c89a1 | |||
| 38347becca | |||
| 49036dbb40 | |||
| abf36de157 | |||
| 32afbf5a5a | |||
| cba4a02cc1 | |||
| 4062555605 | |||
| 9cb38ce839 | |||
| 905090ef09 | |||
| 62e5820082 | |||
| 2d21e16201 | |||
| 07303f4301 | |||
| 91228f803c | |||
| e5d7e1f7c2 | |||
| 81573537eb | |||
| 7a85328b86 | |||
| fd84c62ff4 | |||
| 13e0b21656 | |||
| 5949be30fa | |||
| 0117c2da68 | |||
| 943f70c599 | |||
| 52a48fc4b1 | |||
| 2712ffabb0 | |||
| fa8c8a7094 | |||
| 5907193571 | |||
| 45abfb872f | |||
| 4d5962b15b | |||
| eea1c3a84c | |||
| deed7fc20f | |||
| 62fca3f8b6 | |||
| 9377e58407 | |||
| 9b53f69038 | |||
| 3680149b52 | |||
| 93faeeafbe | |||
| 2d5d1cb357 | |||
| 2a5364dc8c | |||
| 7f47a4fe10 | |||
| a0cc428228 | |||
| 61985f7d6a | |||
| 3baf64f123 | |||
| 4fd40c154e | |||
| 3c360618b9 | |||
| 1d96731ad5 | |||
| 9d1d31d26a | |||
| 0b52ccfaf1 | |||
| 484566083e | |||
| 0f33dc6113 | |||
| 7f3778fc3c | |||
| 0a9dcc5ce6 | |||
| 2f01f139cc | |||
| fb3e615008 | |||
| ce6d0807fa | |||
| cab8f3db71 | |||
| 399a8b2e35 | |||
| 3d4a791940 | |||
| 7373ce2cae | |||
| 5da1e35efe | |||
| fe5b7bee8c | |||
| 2da1134796 | |||
| 83e47d9e35 | |||
| f0c76efaf7 | |||
| 2fe7d856c3 | |||
| a7c1f22b36 | |||
| d92620919b | |||
| 94bb21886b | |||
| 5db98a3fef | |||
| 763c7fbb7d | |||
| b2d1a4ed22 | |||
| e7211065ab | |||
| 68b8b0e38f | |||
| 644c833311 | |||
| 30b1f62e99 | |||
| 03aa787c8e | |||
| 79592d3b00 | |||
| 7ed527a328 | |||
| 3e0766f2bf | |||
| 71e7926045 | |||
| 8c3d47deac | |||
| 197f31d5a1 | |||
| 1a198c35ad | |||
| 2934fc4d23 | |||
| 4ae9585080 | |||
| 161016a02a | |||
| 559bb83864 | |||
| 9a37c3027e | |||
| 6548afcad3 | |||
| ee31c51275 | |||
| 63aadad10c | |||
| 30958a9a65 | |||
| 995183bf22 |
+122
@@ -518,3 +518,125 @@ Jens Lochmüller
|
||||
Anthony Witham
|
||||
Peter Hauke
|
||||
Arizona Action Photos
|
||||
Francis F Dale
|
||||
Willie Swanepoel
|
||||
Edward Hauser
|
||||
Adilson Oliveira
|
||||
Joseph Ordille
|
||||
Michael Shellim
|
||||
Teddie Holmes
|
||||
Alexandre Rault
|
||||
Eric Albin
|
||||
Lukas Kliment
|
||||
Bernard Philippe
|
||||
Bernard Delpy
|
||||
Didier Klein
|
||||
Arnaldo Guedes
|
||||
Cyberauto Systems
|
||||
John Alsbrooks
|
||||
John Kearney
|
||||
Christopher Borden
|
||||
Marc Virgilio Ricci
|
||||
Frederick Davie
|
||||
Jürgen Enders
|
||||
Terrence Pitts
|
||||
Thomas Sandner
|
||||
Marco Coltorti
|
||||
Harald Wilczak
|
||||
Rodney Lorimor
|
||||
Richard Davis
|
||||
Stephen Palmer
|
||||
Michael Napolitan
|
||||
Joshua Bardwell
|
||||
Fred Dawson
|
||||
Jim Wagner
|
||||
Peter Johnson
|
||||
Fredrik Lewerth
|
||||
Arvin Stenersen
|
||||
Daniel Morgan
|
||||
Roy Nixon
|
||||
Joachim Blunck
|
||||
Karl-Heinz Gansel
|
||||
Monrovia Mountain Enterprises
|
||||
Alessandro Villa
|
||||
Jan-Åke Nilsson
|
||||
Matthias Rei
|
||||
DVR Solutions BV
|
||||
Bertrand Condevaux Lanloy
|
||||
Henri Mirra
|
||||
Aurélien Planiol
|
||||
Kevin Caldwell
|
||||
Andrew Garello
|
||||
Tomasz Maziarz
|
||||
Russell Flack
|
||||
Fernando Rimoldi
|
||||
Greg Reid
|
||||
Dietmar Drees
|
||||
Holger Landwehr
|
||||
Arno Loehdorf
|
||||
Boon Sripattha
|
||||
Patrik Åkerfeldt
|
||||
Alonzo Fretwell
|
||||
Renjith Chandrasekharan
|
||||
Ruben Gomez Hernandez
|
||||
Michael Gardner
|
||||
Judith Green
|
||||
Timo Ruppell
|
||||
John Lipscomb
|
||||
Norbert Wenke
|
||||
Erik Frieberg
|
||||
Raimo Ruotsalainen
|
||||
Brian Harris
|
||||
Sebastian Blüml
|
||||
Efisio Maxia
|
||||
Jeff Theobald
|
||||
Anthony Rizzo
|
||||
Rodney Huddleston
|
||||
Dietmar Drees
|
||||
Jürgen Monden
|
||||
David Morgan
|
||||
Andrew Fernie
|
||||
Michel Baily
|
||||
Donald Burke
|
||||
Ronald Donker
|
||||
Fredie Singh
|
||||
Patrizio Simoncini (monthly)
|
||||
Harald Gabler
|
||||
Michael Brown
|
||||
Julien Gérard
|
||||
Alexandre d'Alton
|
||||
Peter Mergaerts
|
||||
Jan Houwers
|
||||
Gordon Stahl
|
||||
Christian Grandjean
|
||||
Roger Bergevin
|
||||
NorthSide
|
||||
Sigmund Martinsen
|
||||
Lionel Lafraise
|
||||
Gisli Ofeigsson
|
||||
The Gruvin9x Project
|
||||
Manuel McLure
|
||||
Fernando Rimoldi
|
||||
Hiltenkamp Stephan
|
||||
Sandeep Kishore Jain
|
||||
Sebastien Charpentier
|
||||
Greg Parker
|
||||
Norman Maaß
|
||||
Adriano Del Ben
|
||||
Justin Poole
|
||||
Kenneth Harrison
|
||||
Eugene LaFaille
|
||||
John O'Shaughnessy
|
||||
Uwe Jordt
|
||||
Stuart Olson
|
||||
Frédéric Devillard
|
||||
Cheung Leo
|
||||
Peter Webster
|
||||
Jean-Claude Bachetta
|
||||
Delfin Perena
|
||||
Sae-wook Yoon
|
||||
Focus on Excellence
|
||||
Jeffery Golias
|
||||
Nick Milton
|
||||
Paul Zasso
|
||||
Reidar Johannes Lillebotn
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,3 +1,52 @@
|
||||
<h2>Version 2.0.13 / 2014-11-20</h2>
|
||||
<ul>
|
||||
<li>Too many curves shown on non ARM boards</li>
|
||||
<li>Fixed vario limits</li>
|
||||
<li>Fixes in compare dialog</li>
|
||||
<li>Fixed receiver number range</li>
|
||||
<li>Virtual inputs not selectable in SF Volume and heli Collective Source</li>
|
||||
<li>Joystick calibration crash after channel assignment</li>
|
||||
<li>Gvar import error for limits</li>
|
||||
<li>Companion shows too many curve types in input/mixer for 9x</li>
|
||||
<li>NOT curves removed from inputs (for non ARM platforms)</li>
|
||||
<li>Companion again builds on OS X (Mac)</li>
|
||||
<li>Companion simulator Lua crash on OS X 64bit (Mac)</li>
|
||||
<li>Companion didn't take care of PlayScript functions</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.12 / 2014-09-15</h2>
|
||||
<ul>
|
||||
<li>Typos & Translations updated</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.11 / 2014-09-10</h2>
|
||||
<ul>
|
||||
<li>Limits EEPROM export was broken (all boards except Taranis)</li>
|
||||
<li>Fix issue when a GVAR was used as Offset</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.10 / 2014-09-08</h2>
|
||||
<ul>
|
||||
<li>Taranis is now the default board in General Settings</li>
|
||||
<li>GVARS allowed in Limits min/max/offset</li>
|
||||
<li>Limits displayed in us when ppmus option selected
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.8 / 2014-07-23</h2>
|
||||
<ul>
|
||||
<li>Compare dialog bugfixes</li>
|
||||
<li>Curve index correctly resetted when type changed</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.7</h2>
|
||||
<ul>
|
||||
<li>SafetyCH function was missing in simulator</li>
|
||||
<li>EEPROM export warning when exporting logical switches > L12 on 9X128</li>
|
||||
<li>FAS offset was not exported on 9X/9XR boards</li>
|
||||
<li>Trims modes bugfix on non Taranis boards</li>
|
||||
<li>It was impossible to open a backuped model from the Tx</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.6</h2>
|
||||
<ul>
|
||||
<li>Fix Mix curves bug on Sky9x boards</li>
|
||||
|
||||
@@ -2,7 +2,7 @@ PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "6" )
|
||||
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")
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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("<", "<").replace(">", ">");
|
||||
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("<", "<").replace(">", ">"));
|
||||
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>");
|
||||
|
||||
@@ -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>
|
||||
@@ -648,7 +661,7 @@ class ConversionField: public TransformedField {
|
||||
if (table->exportValue(_field, _field))
|
||||
return;
|
||||
if (!error.isEmpty())
|
||||
EEPROMWarnings += error + "\n";
|
||||
EEPROMWarnings.push_back(error);
|
||||
}
|
||||
|
||||
if (shift) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "helpers.h"
|
||||
#include "wizarddata.h"
|
||||
|
||||
QString EEPROMWarnings;
|
||||
std::list<QString> EEPROMWarnings;
|
||||
|
||||
const char * switches9X[] = { "3POS", "THR", "RUD", "ELE", "AIL", "GEA", "TRN" };
|
||||
const char * switchesX9D[] = { "SA", "SB", "SC", "SD", "SE", "SF", "SG", "SH" };
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -1198,7 +1205,7 @@ class EEPROMInterface
|
||||
|
||||
};
|
||||
|
||||
extern QString EEPROMWarnings;
|
||||
extern std::list<QString> EEPROMWarnings;
|
||||
|
||||
/* EEPROM string conversion functions */
|
||||
void setEEPROMString(char *dst, const char *src, int size);
|
||||
|
||||
@@ -344,6 +344,57 @@ unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion)
|
||||
{
|
||||
uint8_t *buf = (uint8_t *)src.data();
|
||||
unsigned int len = src.size();
|
||||
uint8_t zeroes = 0;
|
||||
uint8_t bRlc = 0;
|
||||
|
||||
dst.resize(0);
|
||||
|
||||
for( ; 1; ) {
|
||||
for (int i=0; i<zeroes; i++)
|
||||
dst.append((char)0);
|
||||
zeroes = 0;
|
||||
|
||||
if (len == 0)
|
||||
return dst.size();
|
||||
|
||||
for (int i=0; i<bRlc; i++) {
|
||||
dst.append(*buf++);
|
||||
if (--len == 0)
|
||||
return dst.size();
|
||||
}
|
||||
|
||||
bRlc = *buf++;
|
||||
--len;
|
||||
|
||||
if (!(bRlc & 0x7f)) {
|
||||
qDebug() << "RLC decoding error!";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rlcVersion == 2) {
|
||||
if (bRlc&0x80){ // if contains high byte
|
||||
zeroes = (bRlc>>4) & 0x07;
|
||||
bRlc = bRlc & 0x0f;
|
||||
}
|
||||
else if (bRlc&0x40){
|
||||
zeroes = bRlc & 0x3f;
|
||||
bRlc = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (bRlc&0x80){ // if contains high byte
|
||||
zeroes = bRlc & 0x7f;
|
||||
bRlc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dst.size();
|
||||
}
|
||||
|
||||
unsigned int RleFile::write1(uint8_t b)
|
||||
{
|
||||
return write(&b, 1);
|
||||
|
||||
@@ -146,4 +146,6 @@ public:
|
||||
unsigned int get_current_block_number(unsigned int block_no, uint16_t *p_size);
|
||||
};
|
||||
|
||||
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion=2);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -149,7 +148,7 @@ t_Open9xArmExpoData_v208::operator ExpoData ()
|
||||
c9x.chn = chn;
|
||||
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
@@ -179,7 +178,7 @@ t_Open9xArmExpoData_v210::operator ExpoData ()
|
||||
c9x.chn = chn;
|
||||
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ t_Open9xExpoData_v201::operator ExpoData ()
|
||||
c9x.mode = mode;
|
||||
c9x.chn = chn;
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
@@ -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,6 +48,7 @@
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#define FRSKY_STICKS
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define EEPROM_VARIANT SIMU_M128_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
#define FAS_OFFSET
|
||||
|
||||
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#define EEPROM_VARIANT 3
|
||||
#define HAPTIC
|
||||
#define REVPLUS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 5
|
||||
|
||||
@@ -148,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"
|
||||
@@ -155,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"
|
||||
|
||||
@@ -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++);
|
||||
}
|
||||
}
|
||||
@@ -235,8 +250,9 @@ class SourcesConversionTable: public ConversionTable {
|
||||
addConversion(RawSource(SOURCE_TYPE_SWITCH, i), val++);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
|
||||
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i), val++);
|
||||
}
|
||||
}
|
||||
|
||||
if (!afterrelease21March2013) {
|
||||
@@ -369,7 +385,8 @@ template <int N>
|
||||
class SwitchField: public ConversionField< SignedField<N> > {
|
||||
public:
|
||||
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), "Switch"),
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), "Switch",
|
||||
"Switch "+ sw.toString()+" cannot be exported on this board!"),
|
||||
sw(sw),
|
||||
_switch(0)
|
||||
{
|
||||
@@ -503,7 +520,8 @@ template <int N>
|
||||
class SourceField: public ConversionField< UnsignedField<N> > {
|
||||
public:
|
||||
SourceField(RawSource & source, BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0):
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags), "Source"),
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
|
||||
"Source", "Source "+ source.toString(ModelData())+" cannot be exported on this board!"),
|
||||
source(source),
|
||||
_source(0)
|
||||
{
|
||||
@@ -973,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;
|
||||
@@ -1021,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);
|
||||
}
|
||||
@@ -1080,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>());
|
||||
}
|
||||
@@ -1133,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) {
|
||||
@@ -1166,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));
|
||||
@@ -1183,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)) {
|
||||
@@ -1255,14 +1329,14 @@ class CurvesField: public TransformedField {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count);
|
||||
if (offset > maxPoints) {
|
||||
EEPROMWarnings += ::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints) + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count) - 5;
|
||||
if (offset > maxPoints - 5 * maxCurves) {
|
||||
EEPROMWarnings += ::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints) + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints));
|
||||
break;
|
||||
}
|
||||
_curves[i] = offset;
|
||||
@@ -1544,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) {
|
||||
@@ -1677,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++);
|
||||
@@ -1799,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;
|
||||
@@ -1818,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) {
|
||||
@@ -1881,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;
|
||||
}
|
||||
@@ -1893,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) {
|
||||
@@ -1986,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);
|
||||
}
|
||||
@@ -2046,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)
|
||||
@@ -2335,10 +2428,9 @@ class FrskyField: public StructField {
|
||||
Append(new UnsignedField<3>(frsky.varioSource));
|
||||
Append(new SignedField<5>(frsky.varioCenterMin));
|
||||
Append(new ConversionField< UnsignedField<3> >(frsky.currentSource, &telemetryCurrentSourceConversionTable, "Current Source"));
|
||||
Append(new SignedField<8>(frsky.varioCenterMax));
|
||||
Append(new SignedField<5>(frsky.varioCenterMax));
|
||||
if (version >= 216) {
|
||||
// TODO int8_t fasOffset;
|
||||
Append(new SpareBitsField<8>());
|
||||
Append(new SignedField<8>(frsky.fasOffset));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2394,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));
|
||||
@@ -2428,7 +2520,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
if (IS_ARM(board))
|
||||
internalField.Append(new UnsignedField<3>(modelData.telemetryProtocol));
|
||||
else
|
||||
internalField.Append(new ConversionField< UnsignedField<3> >((unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
|
||||
internalField.Append(new ConversionField< UnsignedField<3> >((unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this telemetry protocol")));
|
||||
|
||||
internalField.Append(new BoolField<1>(modelData.thrTrim));
|
||||
|
||||
@@ -2532,12 +2624,12 @@ 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 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) {
|
||||
modulesCount = 3;
|
||||
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
|
||||
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
|
||||
}
|
||||
|
||||
if (IS_ARM(board) && version >= 215) {
|
||||
@@ -2757,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
|
||||
|
||||
@@ -163,8 +163,20 @@ bool OpenTxEepromInterface::loadModelVariant(unsigned int index, ModelData &mode
|
||||
}
|
||||
else {
|
||||
// load from SD Backup, size is stored in index
|
||||
QByteArray eepromData((char *)data, index);
|
||||
open9xModel.Import(eepromData);
|
||||
QByteArray backupData((char *)data, index);
|
||||
QByteArray modelData;
|
||||
if (IS_SKY9X(board))
|
||||
modelData = backupData;
|
||||
else
|
||||
importRlc(modelData, backupData);
|
||||
if (modelData.size()) {
|
||||
open9xModel.Import(modelData);
|
||||
// open9xModel.Dump();
|
||||
model.used = true;
|
||||
}
|
||||
else {
|
||||
model.clear();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -402,10 +414,21 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
}
|
||||
}
|
||||
|
||||
if (!EEPROMWarnings.isEmpty())
|
||||
if (!EEPROMWarnings.empty()) {
|
||||
QString msg;
|
||||
int noErrorsToDisplay = std::min((int)EEPROMWarnings.size(),10);
|
||||
for (int n = 0; n < noErrorsToDisplay; n++) {
|
||||
msg += "-" + EEPROMWarnings.front() + "\n";
|
||||
EEPROMWarnings.pop_front();
|
||||
}
|
||||
if (!EEPROMWarnings.empty()) {
|
||||
msg = QObject::tr("(displaying only first 10 warnings)") + "\n" + msg;
|
||||
}
|
||||
EEPROMWarnings.clear();
|
||||
QMessageBox::warning(NULL,
|
||||
QObject::tr("Warning"),
|
||||
QObject::tr("EEPROM saved with these warnings:") + "\n- " + EEPROMWarnings.remove(EEPROMWarnings.length()-1, 1).replace("\n", "\n- "));
|
||||
QObject::tr("EEPROM saved with these warnings:") + "\n" + msg);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -557,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;
|
||||
@@ -621,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;
|
||||
@@ -640,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:
|
||||
@@ -707,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;
|
||||
}
|
||||
@@ -910,11 +938,32 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
|
||||
{
|
||||
std::cout << "trying " << getName() << " backup import...";
|
||||
|
||||
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0 || eeprom[3] != 0x30+board) {
|
||||
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0) {
|
||||
std::cout << " no\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
BoardEnum backupBoard = (BoardEnum)-1;
|
||||
switch (eeprom[3]) {
|
||||
case 0x33:
|
||||
backupBoard = BOARD_TARANIS;
|
||||
break;
|
||||
case 0x32:
|
||||
backupBoard = BOARD_SKY9X;
|
||||
break;
|
||||
case 0x31:
|
||||
backupBoard = BOARD_GRUVIN9X;
|
||||
break;
|
||||
default:
|
||||
std::cout << " unknown board\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (backupBoard != board) {
|
||||
std::cout << " not right board\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t version = eeprom[4];
|
||||
uint8_t bcktype = eeprom[5];
|
||||
uint16_t size = ((uint16_t)eeprom[7] << 8) + eeprom[6];
|
||||
@@ -1007,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);
|
||||
}
|
||||
|
||||
@@ -1051,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);
|
||||
@@ -1219,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);
|
||||
|
||||
@@ -1227,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -197,7 +197,7 @@ int8_t t_Th9xLogicalSwitchData::fromSource(RawSource source)
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
v1 = 1+source.index;
|
||||
else if (source.type == SOURCE_TYPE_ROTARY_ENCODER) {
|
||||
EEPROMWarnings += ::QObject::tr("th9x on this board doesn't have Rotary Encoders") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("th9x on this board doesn't have Rotary Encoders"));
|
||||
v1 = 5+source.index;
|
||||
}
|
||||
else if (source.type == SOURCE_TYPE_MAX)
|
||||
@@ -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;
|
||||
|
||||
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
@@ -1596,7 +1597,7 @@ void MainWindow::createActions()
|
||||
writeEepromAct = addAct("write_eeprom.png", tr("Write Models and Settings To Radio"), tr("Write Models and Settings to Radio"), SLOT(writeEeprom()));
|
||||
readEepromAct = addAct("read_eeprom.png", tr("Read Models and Settings From Radio"), tr("Read Models and Settings from Radio"), SLOT(readEeprom()));
|
||||
burnConfigAct = addAct("configure.png", tr("Configure Communications..."), tr("Configure software for communicating with the Radio"), SLOT(burnConfig()));
|
||||
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to to Radio"), SLOT(writeBackup()));
|
||||
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to Radio"), SLOT(writeBackup()));
|
||||
readBackupToFileAct = addAct("read_eeprom_file.png", tr("Backup Radio to File"), tr("Save a complete backup file of all settings and model data in the Radio"), SLOT(readBackup()));
|
||||
contributorsAct = addAct("contributors.png", tr("Contributors..."), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors()));
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
@@ -63,19 +63,25 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
trimsValue << ui->trim1Value << ui->trim2Value << ui->trim3Value << ui->trim4Value;
|
||||
trimsSlider << ui->trim1Slider << ui->trim2Slider << ui->trim3Slider << ui->trim4Slider;
|
||||
|
||||
BoardEnum board = firmware->getBoard();
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
trimsLabel[i]->setText(labels[CONVERT_MODE(i+1)-1]);
|
||||
|
||||
QComboBox * cb = trimsUse[i];
|
||||
cb->setProperty("index", i);
|
||||
cb->addItem(QObject::tr("Trim disabled"), -1);
|
||||
if (IS_TARANIS(board)) {
|
||||
cb->addItem(QObject::tr("Trim disabled"), -1);
|
||||
}
|
||||
for (int m=0; m<modesCount; m++) {
|
||||
if (m == phaseIdx) {
|
||||
cb->addItem(QObject::tr("Own Trim"), m*2);
|
||||
}
|
||||
else if (phaseIdx > 0) {
|
||||
cb->addItem(QObject::tr("Use Trim from Flight mode %1").arg(m), m*2);
|
||||
cb->addItem(QObject::tr("Use Trim from Flight mode %1 + Own Trim as an offset").arg(m), m*2+1);
|
||||
if (IS_TARANIS(board)) {
|
||||
cb->addItem(QObject::tr("Use Trim from Flight mode %1 + Own Trim as an offset").arg(m), m*2+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
connect(cb, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseTrimUse_currentIndexChanged(int)));
|
||||
@@ -157,7 +163,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
gvLayout->addWidget(gvValues[i], i, col++, 1, 1);
|
||||
|
||||
// Popups
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()) && (phaseIdx == 0)) {
|
||||
if (IS_TARANIS(board) && phaseIdx == 0) {
|
||||
gvPopups[i] = new QCheckBox(ui->gvGB);
|
||||
gvPopups[i]->setProperty("index", i);
|
||||
gvPopups[i]->setText(tr("Popup enabled"));
|
||||
@@ -270,7 +276,11 @@ void FlightModePanel::trimUpdate(unsigned int trim)
|
||||
trimsSlider[trim]->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
|
||||
BoardEnum board = firmware->getBoard();
|
||||
if (IS_TARANIS(board))
|
||||
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
|
||||
else
|
||||
trimsUse[trim]->setCurrentIndex(phase.trimRef[chn]);
|
||||
trimsValue[trim]->setEnabled(true);
|
||||
trimsSlider[trim]->setEnabled(true);
|
||||
}
|
||||
@@ -305,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();
|
||||
@@ -364,8 +374,15 @@ void FlightModePanel::phaseTrimUse_currentIndexChanged(int index)
|
||||
phase.trim[chn] = 0;
|
||||
}
|
||||
else {
|
||||
phase.trimMode[chn] = data % 2;
|
||||
phase.trimRef[chn] = data / 2;
|
||||
BoardEnum board = firmware->getBoard();
|
||||
if (IS_TARANIS(board)) {
|
||||
phase.trimMode[chn] = data % 2;
|
||||
phase.trimRef[chn] = data / 2;
|
||||
}
|
||||
else {
|
||||
phase.trimMode[chn] = 0;
|
||||
phase.trimRef[chn] = data / 2;
|
||||
}
|
||||
phase.trim[chn] = 0;
|
||||
}
|
||||
trimUpdate(trim);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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">
|
||||
@@ -658,10 +645,10 @@
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-1.500000000000000</double>
|
||||
<double>-12.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.500000000000000</double>
|
||||
<double>12.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
|
||||
@@ -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>");
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>No Radio was found!</p><p>Make sure that you hold the lower trim buttons towards the center while you turn it on.</p><p>Then connect the USB wire.</p></body></html></string>
|
||||
<string><html><head/><body><p>No Radio was found!</p><p>Make sure that you hold the lower trim buttons towards the center while you turn it on.</p><p>Then connect the USB wire.</p><p><span style=" font-family:'arial,sans-serif'; font-size:13px; font-style:italic; color:#222222; background-color:#ffffff;">Note: if you have a Taranis that has not had the firmware upgraded to 2.0 then this version of Companion will not work.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
|
||||
@@ -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] );
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+2117
-1967
File diff suppressed because it is too large
Load Diff
+2090
-1746
File diff suppressed because it is too large
Load Diff
+2749
-1894
File diff suppressed because it is too large
Load Diff
+2192
-2152
File diff suppressed because it is too large
Load Diff
+2066
-1814
File diff suppressed because it is too large
Load Diff
+2082
-1766
File diff suppressed because it is too large
Load Diff
+2066
-1814
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+2063
-1815
File diff suppressed because it is too large
Load Diff
+2066
-1818
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -24,5 +24,6 @@
|
||||
#define round(x) floor(x+0.5)
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _tcsnicmp
|
||||
#define snprintf _snprintf
|
||||
|
||||
#endif
|
||||
|
||||
+202
-106
@@ -1,182 +1,278 @@
|
||||
<h2>Version 2.0.6 / 2014-07-08</h2>
|
||||
<h2>Version 2.0.13 / 2014-11-20</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>
|
||||
|
||||
[9XR-PRO / Sky9x]
|
||||
<ul>
|
||||
<li>RTC time was not stored correctly
|
||||
<li>PPM polarity fix
|
||||
<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>
|
||||
|
||||
[Gruvin9x, 9X128, 9XR128]
|
||||
[9XR-PRO]
|
||||
<ul>
|
||||
<li>12 logical switches instead of 15 (the extra ones were not accessible in custom functions)
|
||||
<li>Coprocessor interface bugfix</li>
|
||||
</ul>
|
||||
|
||||
[Stock]
|
||||
<ul>
|
||||
<li>Fixed never ending haptic repeat</li>
|
||||
<li>Fixed curves display</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>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>
|
||||
<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>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<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 >= 10m
|
||||
<li>Check to avoid too long paths when playing SD files
|
||||
<li>Altitude played without decimal when >= 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>
|
||||
@@ -260,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]
|
||||
@@ -291,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]
|
||||
@@ -311,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>
|
||||
@@ -24,3 +24,6 @@
|
||||
/gtests
|
||||
/gtest_main.a
|
||||
/gtests.d
|
||||
/lua_exports.cpp
|
||||
/lua_exports.txt
|
||||
/lua_fields.txt
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
File diff suppressed because it is too large
Load Diff
+44
-43
@@ -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
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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--) {
|
||||
|
||||
@@ -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--) {
|
||||
|
||||
@@ -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--) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+107
-53
@@ -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.6
|
||||
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,7 +1458,10 @@ clean_list :
|
||||
$(REMOVE) *.lst
|
||||
$(REMOVE) allsrc.cpp
|
||||
$(REMOVE) stamp-opentx.h
|
||||
$(REMOVE) `find . -name "*.lbm"`
|
||||
$(REMOVE) *.lbm
|
||||
$(REMOVE) bitmaps/*.lbm
|
||||
$(REMOVE) fonts/*/*.lbm
|
||||
$(REMOVE) lua_exports.txt lua_exports.cpp lua_fields.txt
|
||||
$(MAKE) -C bootloader clean
|
||||
|
||||
#### Install
|
||||
@@ -1418,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)
|
||||
@@ -1490,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
@@ -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
@@ -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;
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
void _init (void)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
@@ -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
@@ -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)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user