Compare commits
150 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63a10187c4 | |||
| 2e18e36844 | |||
| af38748d3a | |||
| 65d7fd0a29 | |||
| cc5b48516f | |||
| 2d8d865ee1 | |||
| 2fa78ada47 | |||
| c294f49cce | |||
| 61f24a134e | |||
| ef53705cc2 | |||
| 34457188ba | |||
| b1a619d404 | |||
| 73024a716d | |||
| c95b227732 | |||
| a705e19165 | |||
| a9bfa26264 | |||
| c51a7cdf7b | |||
| a4540862df | |||
| a341aebde6 | |||
| ccb6c11d3d | |||
| 3a314c5616 | |||
| 8a2add9849 | |||
| 22c8989a1c | |||
| ee6a180ae7 | |||
| a84c31aec6 | |||
| 079984a183 | |||
| 7d8be44189 | |||
| 373d0ef4a4 | |||
| b9bf10c6dd | |||
| 3c65c32d45 | |||
| a604d9cba2 | |||
| 41cf4af536 | |||
| 56dfb156fd | |||
| 349c2aa3b6 | |||
| bb1106ff82 | |||
| 662a20555d | |||
| e1bcbfa013 | |||
| 3f969acaa8 | |||
| dbd8abbfe8 | |||
| b468304819 | |||
| 0400e8896e | |||
| 2f2b6122b4 | |||
| cbf2b71bd7 | |||
| 5e6b0025b2 | |||
| 84020586d4 | |||
| bc4e2aba4e | |||
| 2c2a93dd17 | |||
| 8734a2e19c | |||
| 7ff8a1c13f | |||
| d7ae0d91cd | |||
| 06ec90a643 | |||
| 17d4536e9c | |||
| 9058737f86 | |||
| ec9ac82a70 | |||
| 189b7c0bfe | |||
| 825e0286f1 | |||
| 98996620a4 | |||
| d2a937c3f1 | |||
| 4f0d5f556e | |||
| 3728ebcdc9 | |||
| bf44994c34 | |||
| b736ec5f48 | |||
| bb8eff3488 | |||
| 456df25c0e | |||
| 055dc646dc | |||
| 0d13182733 | |||
| 0899bf49b6 | |||
| ce5daa0991 | |||
| 977ba3da46 | |||
| d1c1113a61 | |||
| 877b130e47 | |||
| 1deb60a734 | |||
| b25a5b8c5a | |||
| d402e2f340 | |||
| b7867af720 | |||
| 3f3ccc2668 | |||
| 45b5c0990d | |||
| 8a70229406 | |||
| 3df558d280 | |||
| d1f42b79de | |||
| ae8935aa40 | |||
| 282c05e272 | |||
| bb0c2e6443 | |||
| 43b97d3211 | |||
| a9a22628c3 | |||
| 68f873db2c | |||
| cbf14235a1 | |||
| 0ebbe08f3d | |||
| 77c9ec6dff | |||
| 75a819d9f6 | |||
| 58fe7c155e | |||
| 0ef3678374 | |||
| 5232d56701 | |||
| 13f5140457 | |||
| c2cb22b542 | |||
| 4d30ee4dd1 | |||
| 2a4dfdd8a4 | |||
| 3804f39eb0 | |||
| 2232306003 | |||
| f4081d4c21 | |||
| 292dfdd458 | |||
| 5e04eb91c7 | |||
| 0f19f75af6 | |||
| 2a557129e0 | |||
| 9f7ecf7595 | |||
| 37043f77c7 | |||
| 6c8e3b165e | |||
| 6382a50d4f | |||
| d35a42c442 | |||
| 82b4b5b546 | |||
| 20e0b674d8 | |||
| d0bb02cecf | |||
| e0fb81bf4a | |||
| 50ce9b3a0f | |||
| 948306657f | |||
| 3e90ab72cb | |||
| 30a7de6fa0 | |||
| 46bdd0eba4 | |||
| a77860c451 | |||
| 0404538854 | |||
| 0b04fb5407 | |||
| fff6ba4f27 | |||
| d124ce8317 | |||
| db7af1d676 | |||
| 0b91fa5b05 | |||
| d31f14816b | |||
| f8de9f9d99 | |||
| 759bdd586d | |||
| 0004b89532 | |||
| 5cb3ef82e2 | |||
| 69039ae560 | |||
| 0e1dda33cf | |||
| b358cc8965 | |||
| f023b61513 | |||
| 485fcb4fc4 | |||
| f4378038c7 | |||
| ed9a8c9975 | |||
| d9d0d9f1cd | |||
| 9fb7f12091 | |||
| 62ae0e010c | |||
| fcd07780c9 | |||
| b493754443 | |||
| ec2da1f6be | |||
| 53d3e35d77 | |||
| 56b04262a9 | |||
| b2386d7055 | |||
| 7fe82d4099 | |||
| deb64c0c91 | |||
| 2dafac5d94 | |||
| efc3364b32 |
+63
-1
@@ -9,6 +9,7 @@
|
||||
<a href="http://openpilot.com">David Ankers (OpenPilot)</a>
|
||||
<a href="http://3drobotics.com">3D Robotics</a>
|
||||
<a href="http://rcstudio.cz">RC Studio (monthly)</a>
|
||||
<a href="http://www.craftandtheoryllc.com">Craft & Theory (monthly)</a>
|
||||
|
||||
Mario Sette
|
||||
Felice Baratto
|
||||
@@ -332,7 +333,6 @@ Jose Sobral
|
||||
Heung Jin Choi
|
||||
Tomasz Janiak
|
||||
Fabien Gagné
|
||||
Joe Street
|
||||
Micha Ronen
|
||||
Albert Blondin
|
||||
Klaus Schuebel
|
||||
@@ -885,3 +885,65 @@ Gilles Dando
|
||||
Denis Roussille
|
||||
Olivier Anken
|
||||
Michel Motte
|
||||
David McDonald
|
||||
Tauno Rautakorpi
|
||||
Carsten Schlassa
|
||||
Angel de la Dehesa Calles
|
||||
Michel Garbarin
|
||||
Algirdas Tamosiunas
|
||||
Petr Kysela
|
||||
Pascal Roux
|
||||
Robert Whitfield
|
||||
InTheTubeDeep
|
||||
Jaromir Malek
|
||||
Joe Street
|
||||
Regin Poulsen
|
||||
Hervé Laveyssiere
|
||||
Walter Fowler
|
||||
Richard Wagner
|
||||
Kevin Hyman
|
||||
Herald Reichel
|
||||
Frederic Rouyre
|
||||
David Libby
|
||||
Hans Timmermans
|
||||
Adrian De Zee
|
||||
John Hanagan
|
||||
Didier van Steensel
|
||||
Julius Vicze
|
||||
Cristiano Merighi
|
||||
James Holley
|
||||
Chris Merry
|
||||
Jiri Fojtasek
|
||||
Thierry Laligand
|
||||
Hassouna Cherif
|
||||
Fred Thijssen
|
||||
Andrew Gardiner
|
||||
Christian Niß
|
||||
Douglas Penney
|
||||
Starck Associates
|
||||
Johannes Wollenweber
|
||||
Fred Page
|
||||
Jean Trouche
|
||||
Patrick Blanc
|
||||
Jean-Louis Tonnellier
|
||||
Masoud
|
||||
Mustafa Güven
|
||||
William Waters
|
||||
Joël Allamy
|
||||
William Mckinstry
|
||||
Jean-Jacques Pointel
|
||||
Frédéric Rouyre
|
||||
Jonathan Pruett
|
||||
Jörg Zieren
|
||||
Christopher Rhodes
|
||||
Marco Strack
|
||||
Stefano Boggia
|
||||
Dwayne Myers
|
||||
Stavros Papathanasiou
|
||||
Roland Nittby
|
||||
Courtney Puskas
|
||||
NorthSide
|
||||
Martin Polák
|
||||
Ulf Reinhardt
|
||||
Wolfgang Renisch
|
||||
Trevor Hinze
|
||||
|
||||
@@ -6,4 +6,11 @@
|
||||
|
||||
The ongoing development on 2.1.x is done in this branch.
|
||||
|
||||
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
|
||||
Refer to the [OpenTX wiki](https://github.com/opentx/opentx/wiki) for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
|
||||
|
||||
Useful links:
|
||||
* OpenTX Blog http://blog.open-tx.org/
|
||||
* OpenTX Main Site http://www.open-tx.org/
|
||||
* OpenTx University http://open-txu.org/
|
||||
* OpenTX User Manual https://www.gitbook.com/book/opentx/opentx-taranis-manual/details
|
||||
* OpenTX Lua Reference Guide https://www.gitbook.com/book/opentx/opentx-lua-reference-guide/details
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
<h2>Version 2.1.8 / 2016-04-14</h2>
|
||||
|
||||
<ul>
|
||||
<li>Telemetry Simulator sensor instance number fixed (<a href=https://github.com/opentx/opentx/issues/3207>#3207</a>)</li>
|
||||
<li>Fixed: Throttle Source combo-box was populated multiple times (<a href=https://github.com/opentx/opentx/issues/3222>#3222</a>)</li>
|
||||
<li>RTC option tool-tip corrected (<a href=https://github.com/opentx/opentx/issues/3225>#3225</a>)</li>
|
||||
<li>Fixed: Companion was looking for custom scripts at the wrong place (<a href=https://github.com/opentx/opentx/issues/3237>#3237</a>)</li>
|
||||
<li>Offset displayed in inputs screen (<a href=https://github.com/opentx/opentx/issues/3248>#3248</a>)</li>
|
||||
<li>Import/export handling was broken for Average formula telemetry sensors (<a href=https://github.com/opentx/opentx/issues/3262>#3262</a>)</li>
|
||||
<li>Fixed: Hardware Setup control types and names were not stored in profile (<a href=https://github.com/opentx/opentx/issues/3260>#3260</a>)</li>
|
||||
<li>Fixed voice language list (<a href=https://github.com/opentx/opentx/issues/3338>#3338</a>)</li>
|
||||
<li>Fixed data overflow in Special Functions Override Channel (<a href=https://github.com/opentx/opentx/issues/3347>#3347</a>)</li>
|
||||
<li>Fixed: Sync dialog new line problem (only present for some UI languages) (<a href=https://github.com/opentx/opentx/issues/3350>#3350</a>)</li>
|
||||
<li>Removed a few legacy timer limitations, fix non-working limit (<a href=https://github.com/opentx/opentx/issues/3301>#3301</a>)</li>
|
||||
<li>Default AVR fuse settings changed to disable JTAG interface (<a href=https://github.com/opentx/opentx/issues/3379>#3379</a>)</li>
|
||||
<li>Channel range fix (Start, Channels) in Model Settings, Setup page, int/ext module settings</li>
|
||||
<li>Use friendly GVAR names in dialogs (if available) (<a href=https://github.com/opentx/opentx/issues/3353>#3353</a>)</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.7 / 2016-01-04</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
@@ -2,7 +2,7 @@ PROJECT( companion )
|
||||
|
||||
SET(C9X_VERSION_MAJOR "2")
|
||||
SET(C9X_VERSION_MINOR "1")
|
||||
SET(C9X_VERSION_REVISION "7")
|
||||
SET(C9X_VERSION_REVISION "8")
|
||||
SET(C9X_VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
||||
|
||||
SET(C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION}${C9X_VERSION_SUFFIX})
|
||||
|
||||
@@ -312,6 +312,8 @@ QString Profile::speaker() const { return _speaker; }
|
||||
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
||||
QString Profile::timeStamp() const { return _timeStamp; }
|
||||
QString Profile::trainerCalib() const { return _trainerCalib; }
|
||||
QString Profile::controlTypes() const { return _controlTypes; }
|
||||
QString Profile::controlNames() const { return _controlNames; }
|
||||
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
|
||||
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||
@@ -342,6 +344,8 @@ void Profile::speaker (const QString x) { store(x, _speaker, "Speake
|
||||
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::controlTypes (const QString x) { store(x, _controlTypes, "ControlTypes" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::controlNames (const QString x) { store(x, _controlNames, "ControlNames" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
||||
@@ -378,6 +382,8 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||
speaker ( rhs.speaker() );
|
||||
stickPotCalib( rhs.stickPotCalib() );
|
||||
trainerCalib ( rhs.trainerCalib() );
|
||||
controlTypes ( rhs.controlTypes() );
|
||||
controlNames ( rhs.controlNames() );
|
||||
txCurrentCalibration ( rhs.txCurrentCalibration() );
|
||||
gsStickMode ( rhs.gsStickMode() );
|
||||
ppmMultiplier( rhs.ppmMultiplier() );
|
||||
@@ -423,6 +429,8 @@ void Profile::initFwVariables()
|
||||
_stickPotCalib = "";
|
||||
_timeStamp = "";
|
||||
_trainerCalib = "";
|
||||
_controlTypes = "";
|
||||
_controlNames = "";
|
||||
|
||||
_txCurrentCalibration = 0;
|
||||
_gsStickMode = 0;
|
||||
@@ -483,6 +491,8 @@ void Profile::flush()
|
||||
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _controlTypes, "ControlTypes" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _controlNames, "ControlNames" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _txCurrentCalibration, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
|
||||
@@ -125,6 +125,8 @@ class Profile: protected CompStoreObj
|
||||
QString _stickPotCalib;
|
||||
QString _timeStamp;
|
||||
QString _trainerCalib;
|
||||
QString _controlTypes;
|
||||
QString _controlNames;
|
||||
int _txCurrentCalibration;
|
||||
int _gsStickMode;
|
||||
int _ppmMultiplier;
|
||||
@@ -156,6 +158,8 @@ class Profile: protected CompStoreObj
|
||||
QString stickPotCalib() const;
|
||||
QString timeStamp() const;
|
||||
QString trainerCalib() const;
|
||||
QString controlTypes() const;
|
||||
QString controlNames() const;
|
||||
int txCurrentCalibration() const;
|
||||
int gsStickMode() const;
|
||||
int ppmMultiplier() const;
|
||||
@@ -186,6 +190,8 @@ class Profile: protected CompStoreObj
|
||||
void stickPotCalib (const QString);
|
||||
void timeStamp (const QString);
|
||||
void trainerCalib (const QString);
|
||||
void controlTypes (const QString);
|
||||
void controlNames (const QString);
|
||||
void txCurrentCalibration (const int);
|
||||
void gsStickMode (const int);
|
||||
void ppmMultiplier (const int);
|
||||
|
||||
@@ -1624,7 +1624,9 @@ class Firmware {
|
||||
}
|
||||
|
||||
virtual int getCapability(const Capability) = 0;
|
||||
|
||||
|
||||
virtual QTime getMaxTimerStart() = 0;
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
||||
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
|
||||
|
||||
@@ -54,7 +54,7 @@ class Er9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class Ersky9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
|
||||
|
||||
|
||||
@@ -2170,7 +2170,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
fn.param = (int8_t)value;
|
||||
fn.param = (int16_t)(uint16_t)value;
|
||||
}
|
||||
else if (fn.func >= FuncSetTimer1 && fn.func <= FuncSetTimer3) {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
@@ -2823,7 +2823,7 @@ class SensorField: public TransformedField {
|
||||
_instance = sensor.formula;
|
||||
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
|
||||
_param = (sensor.source) + (sensor.index << 8);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
|
||||
_param = ((uint8_t)sensor.sources[0]) + ((uint8_t)sensor.sources[1] << 8) + ((uint8_t)sensor.sources[2] << 16) + ((uint8_t)sensor.sources[3] << 24);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
|
||||
_param = (sensor.gps) + (sensor.alt << 8);
|
||||
@@ -2845,7 +2845,7 @@ class SensorField: public TransformedField {
|
||||
sensor.formula = _instance;
|
||||
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
|
||||
(sensor.source = _sources[0], sensor.index = _sources[1]);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
|
||||
for (int i=0; i<4; ++i)
|
||||
sensor.sources[i] = _sources[i];
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
|
||||
|
||||
@@ -805,6 +805,16 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
}
|
||||
}
|
||||
|
||||
QTime OpenTxFirmware::getMaxTimerStart()
|
||||
{
|
||||
if (IS_TARANIS(board))
|
||||
return QTime(23, 59, 59);
|
||||
else if (IS_ARM(board))
|
||||
return QTime(8, 59, 59);
|
||||
else
|
||||
return QTime(0, 59, 59);
|
||||
}
|
||||
|
||||
bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
|
||||
{
|
||||
if (IS_TARANIS(board) && (source == TELEMETRY_SOURCE_RSSI_TX))
|
||||
@@ -1168,8 +1178,109 @@ void registerOpenTxFirmwares()
|
||||
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
|
||||
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
|
||||
|
||||
/* Taranis Plus board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis board */
|
||||
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
|
||||
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis X9E board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR-Pro */
|
||||
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("Turnigy 9XR with m128 chip"), BOARD_M128);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nosplash", QObject::tr("No splash screen"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
firmware->addOption("imperial", QObject::tr("Imperial units"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board */
|
||||
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("Turnigy 9XR"), BOARD_STOCK);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nosplash", QObject::tr("No splash screen"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
firmware->addOption("imperial", QObject::tr("Imperial units"));
|
||||
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
|
||||
firmware->addOption("novario", QObject::tr("No vario support"));
|
||||
firmware->addOption("nogps", QObject::tr("No GPS support"));
|
||||
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
|
||||
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9x board */
|
||||
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X board"), BOARD_STOCK);
|
||||
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X with stock board"), BOARD_STOCK);
|
||||
firmware->addOptions(ext_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1205,7 +1316,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9x board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("M128 / 9X board"), BOARD_M128);
|
||||
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("9X with stock board and m128 chip"), BOARD_M128);
|
||||
firmware->addOptions(ext_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1234,69 +1345,52 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board */
|
||||
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("9XR"), BOARD_STOCK);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
/* ar9x board */
|
||||
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("9X with AR9X board"), BOARD_AR9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nosplash", QObject::tr("No splash screen"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
firmware->addOption("imperial", QObject::tr("Imperial units"));
|
||||
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
|
||||
firmware->addOption("novario", QObject::tr("No vario support"));
|
||||
firmware->addOption("nogps", QObject::tr("No GPS support"));
|
||||
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
|
||||
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
|
||||
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("9XR with M128 chip"), BOARD_M128);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
/* Sky9x board */
|
||||
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("9X with Sky9x board"), BOARD_SKY9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nosplash", QObject::tr("No splash screen"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
firmware->addOption("imperial", QObject::tr("Imperial units"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Gruvin9x board */
|
||||
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("Gruvin9x board / 9X"), BOARD_GRUVIN9X);
|
||||
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("9X with Gruvin9x board"), BOARD_GRUVIN9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
@@ -1321,7 +1415,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* MEGA2560 board */
|
||||
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("MEGA2560 board"), BOARD_MEGA2560);
|
||||
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("DIY MEGA2560 radio"), BOARD_MEGA2560);
|
||||
addOpenTxLcdOptions(firmware);
|
||||
firmware->addOption("PWR", QObject::tr("Power management by soft-off circuitry"));
|
||||
firmware->addOptions(ext_options);
|
||||
@@ -1332,7 +1426,7 @@ void registerOpenTxFirmwares()
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("sdcard", QObject::tr("Support for SD memory card"));
|
||||
//firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
//firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
@@ -1350,90 +1444,6 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Sky9x board */
|
||||
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("Sky9x board / 9X"), BOARD_SKY9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* ar9x board */
|
||||
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("ar9x board / 9X"), BOARD_AR9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
|
||||
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR-Pro */
|
||||
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("9XR-PRO"), BOARD_9XRPRO);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis board */
|
||||
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
|
||||
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis Plus board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis X9E board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
default_firmware_variant = GetFirmware("opentx-taranisplus-en");
|
||||
current_firmware_variant = default_firmware_variant;
|
||||
}
|
||||
|
||||
@@ -118,6 +118,8 @@ class OpenTxFirmware: public Firmware {
|
||||
virtual QString getFirmwareUrl();
|
||||
|
||||
virtual int getCapability(const Capability);
|
||||
|
||||
virtual QTime getMaxTimerStart();
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source);
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ macro(add_lua_export_target target)
|
||||
add_custom_target(lua_export_${target} DEPENDS ${RADIO_SRC_DIRECTORY}/lua/lua_exports_${target}.inc)
|
||||
endmacro(add_lua_export_target)
|
||||
|
||||
add_lua_export_target(taranis -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
|
||||
add_lua_export_target(taranis_x9e -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
|
||||
add_lua_export_target(taranis -DCPUARM -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
|
||||
add_lua_export_target(taranis_x9e -DCPUARM -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
|
||||
|
||||
set(OPENTX_SRC_FILES
|
||||
opentxsimulator.cpp
|
||||
|
||||
@@ -497,7 +497,7 @@ void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id)
|
||||
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id, uint8_t defaultValue)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
for (int i = 0; i<MAX_SENSORS; i++) {
|
||||
@@ -509,7 +509,7 @@ uint8_t OpenTxSimulator::getSensorInstance(uint16_t id)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
|
||||
|
||||
@@ -122,7 +122,7 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len);
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id);
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0);
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id);
|
||||
|
||||
|
||||
@@ -84,12 +84,15 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
{
|
||||
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
|
||||
QString calib=g.profile[profile_id].stickPotCalib();
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
|
||||
int numSwPots=GetCurrentFirmware()->getCapability(Switches)+GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
|
||||
if (calib.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
QString trainercalib = g.profile[profile_id].trainerCalib();
|
||||
QString hwtypes = g.profile[profile_id].controlTypes();
|
||||
QString controlNames=g.profile[profile_id].controlNames();
|
||||
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
|
||||
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
|
||||
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
|
||||
@@ -136,6 +139,45 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
} else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, radio calibration was not retrieved"));
|
||||
}
|
||||
if (hwtypes.length()==numSwPots) {
|
||||
QString Byte;
|
||||
int16_t byte16;
|
||||
QByteArray qba;
|
||||
int16_t offset;
|
||||
bool ok;
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
qba = controlNames.mid(3*i,3).toAscii();
|
||||
strcpy(generalSettings.stickName[i], qba.data());
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
|
||||
Byte=hwtypes.mid(i,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS),3).toAscii();
|
||||
if (ok)
|
||||
generalSettings.switchConfig[i]=byte16;
|
||||
strcpy(generalSettings.switchName[i], qba.data());
|
||||
}
|
||||
offset = GetCurrentFirmware()->getCapability(Switches);
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
|
||||
Byte=hwtypes.mid(i+offset,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toAscii();
|
||||
if (ok)
|
||||
generalSettings.potConfig[i]=byte16;
|
||||
strcpy(generalSettings.potName[i], qba.data());
|
||||
}
|
||||
offset += GetCurrentFirmware()->getCapability(Pots);
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
|
||||
Byte=hwtypes.mid(i+offset,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toAscii();
|
||||
if (ok)
|
||||
generalSettings.sliderConfig[i]=byte16;
|
||||
strcpy(generalSettings.sliderName[i], qba.data());
|
||||
}
|
||||
} else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, Switch/pot config not retrieved"));
|
||||
}
|
||||
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
|
||||
generalSettings.stickMode=GSStickMode;
|
||||
uint8_t byte8u;
|
||||
@@ -200,13 +242,15 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
|
||||
|
||||
QString name=g.profile[profile_id].name();
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
|
||||
if (name.isEmpty()) {
|
||||
ui->calstore_PB->setDisabled(true);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
QString calib=g.profile[profile_id].stickPotCalib();
|
||||
QString hwtypes=g.profile[profile_id].controlTypes();
|
||||
QString controlNames=g.profile[profile_id].controlNames();
|
||||
if (!(calib.isEmpty())) {
|
||||
int ret = QMessageBox::question(this, "Companion",
|
||||
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
|
||||
@@ -227,6 +271,25 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
|
||||
}
|
||||
g.profile[profile_id].trainerCalib( calib );
|
||||
hwtypes.clear();
|
||||
controlNames.clear();
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
controlNames.append(QString("%1").arg(generalSettings.stickName[i], -3));
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
|
||||
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.switchConfig[i], 1));
|
||||
controlNames.append(QString("%1").arg(generalSettings.switchName[i], -3));
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
|
||||
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.potConfig[i], 1));
|
||||
controlNames.append(QString("%1").arg(generalSettings.potName[i], -3));
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
|
||||
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.sliderConfig[i], 1));
|
||||
controlNames.append(QString("%1").arg(generalSettings.sliderName[i], -3));
|
||||
}
|
||||
g.profile[profile_id].controlTypes( hwtypes );
|
||||
g.profile[profile_id].controlNames( controlNames );
|
||||
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
|
||||
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
|
||||
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
||||
|
||||
@@ -275,8 +275,8 @@ void GeneralSetupPanel::populateBacklightCB()
|
||||
void GeneralSetupPanel::populateVoiceLangCB()
|
||||
{
|
||||
QComboBox * b = ui->voiceLang_CB;
|
||||
QString strings[] = { QObject::tr("English"), QObject::tr("Finnish"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), NULL};
|
||||
QString langcode[] = { "en", "fi","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", NULL};
|
||||
QString strings[] = { QObject::tr("English"), QObject::tr("Dutch"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), QObject::tr("Hungarian"), NULL};
|
||||
QString langcode[] = { "en", "nl","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", "hu", NULL};
|
||||
|
||||
b->clear();
|
||||
for (int i=0; strings[i]!=NULL; i++) {
|
||||
|
||||
@@ -658,7 +658,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="adjustRTC">
|
||||
<property name="toolTip">
|
||||
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
|
||||
<string>Automatically adjust the radio's clock if a GPS is connected to telemetry.</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
|
||||
+21
-14
@@ -103,7 +103,7 @@ void populatePhasesCB(QComboBox *b, int value)
|
||||
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
|
||||
}
|
||||
|
||||
GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
|
||||
GVarGroup::GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
|
||||
QObject(),
|
||||
weightGV(weightGV),
|
||||
weightSB(weightSB),
|
||||
@@ -115,7 +115,7 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox
|
||||
lock(true)
|
||||
{
|
||||
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
|
||||
populateGVCB(weightCB, weight);
|
||||
populateGVCB(*weightCB, weight, model);
|
||||
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
|
||||
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
}
|
||||
@@ -179,13 +179,14 @@ void GVarGroup::valuesChanged()
|
||||
}
|
||||
}
|
||||
|
||||
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
|
||||
CurveGroup::CurveGroup(QComboBox * curveTypeCB, QCheckBox * curveGVarCB, QComboBox * curveValueCB, QSpinBox * curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags):
|
||||
QObject(),
|
||||
curveTypeCB(curveTypeCB),
|
||||
curveGVarCB(curveGVarCB),
|
||||
curveValueCB(curveValueCB),
|
||||
curveValueSB(curveValueSB),
|
||||
curve(curve),
|
||||
model(model),
|
||||
flags(flags),
|
||||
lock(false),
|
||||
lastType(-1)
|
||||
@@ -219,7 +220,7 @@ void CurveGroup::update()
|
||||
curveGVarCB->setChecked(true);
|
||||
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
|
||||
lastType = curve.type;
|
||||
populateGVCB(curveValueCB, curve.value);
|
||||
populateGVCB(*curveValueCB, curve.value, model);
|
||||
}
|
||||
curveValueCB->show();
|
||||
curveValueSB->hide();
|
||||
@@ -478,33 +479,39 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
||||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
void populateGVCB(QComboBox *b, int value)
|
||||
void populateGVCB(QComboBox & b, int value, const ModelData & model)
|
||||
{
|
||||
bool selected = false;
|
||||
|
||||
b->clear();
|
||||
b.clear();
|
||||
|
||||
int pgvars = GetCurrentFirmware()->getCapability(Gvars);
|
||||
for (int i=-pgvars; i<=-1; i++) {
|
||||
int count = GetCurrentFirmware()->getCapability(Gvars);
|
||||
for (int i=-count; i<=-1; i++) {
|
||||
int16_t gval = (int16_t)(-10000+i);
|
||||
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
|
||||
if (strlen(model.gvars_names[-i-1]) > 0)
|
||||
b.addItem(QObject::tr("-GV%1 (%2)").arg(-i).arg(model.gvars_names[-i-1]), gval);
|
||||
else
|
||||
b.addItem(QObject::tr("-GV%1").arg(-i), gval);
|
||||
if (value == gval) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
b.setCurrentIndex(b.count()-1);
|
||||
selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=1; i<=pgvars; i++) {
|
||||
for (int i=1; i<=count; i++) {
|
||||
int16_t gval = (int16_t)(10000+i);
|
||||
b->addItem(QObject::tr("GV%1").arg(i), gval);
|
||||
if (strlen(model.gvars_names[i-1]) > 0)
|
||||
b.addItem(QObject::tr("GV%1 (%2)").arg(i).arg(model.gvars_names[i-1]), gval);
|
||||
else
|
||||
b.addItem(QObject::tr("GV%1").arg(i), gval);
|
||||
if (value == gval) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
b.setCurrentIndex(b.count()-1);
|
||||
selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!selected) {
|
||||
b->setCurrentIndex(pgvars);
|
||||
b.setCurrentIndex(count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class GVarGroup: public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
|
||||
GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
|
||||
|
||||
protected slots:
|
||||
void gvarCBChanged(int);
|
||||
@@ -71,7 +71,7 @@ class CurveGroup : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags=0);
|
||||
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags=0);
|
||||
void update();
|
||||
|
||||
protected slots:
|
||||
@@ -85,6 +85,7 @@ class CurveGroup : public QObject {
|
||||
QComboBox *curveValueCB;
|
||||
QSpinBox *curveValueSB;
|
||||
CurveReference & curve;
|
||||
const ModelData & model;
|
||||
unsigned int flags;
|
||||
bool lock;
|
||||
int lastType;
|
||||
@@ -117,8 +118,7 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase);
|
||||
#define GVARS_VARIANT 0x0001
|
||||
#define FRSKY_VARIANT 0x0002
|
||||
|
||||
// void populateGVarCB(QComboBox *b, int value, int min, int max,int pgvars=5); //TODO: Clean Up
|
||||
void populateGVCB(QComboBox *b, int value);
|
||||
void populateGVCB(QComboBox & b, int value, const ModelData & model);
|
||||
void populateSourceCB(QComboBox *b, const RawSource &source, const GeneralSettings generalSettings, const ModelData * model, unsigned int flags);
|
||||
QString image2qstring(QImage image);
|
||||
int findmult(float value, float base);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <QCheckBox>
|
||||
#include <QDoubleSpinBox>
|
||||
|
||||
LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, int min, int max, int deflt):
|
||||
LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout * tableLayout, int row, int col, int & value, const ModelData & model, int min, int max, int deflt):
|
||||
firmware(firmware),
|
||||
spinbox(new QDoubleSpinBox()),
|
||||
value(value),
|
||||
@@ -50,7 +50,7 @@ LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row,
|
||||
horizontalLayout->addWidget(cb);
|
||||
horizontalLayout->addWidget(spinbox);
|
||||
tableLayout->addLayout(row, col, horizontalLayout);
|
||||
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
|
||||
gvarGroup = new GVarGroup(gv, spinbox, cb, value, model, deflt, min, max, displayStep, allowGVars);
|
||||
}
|
||||
|
||||
LimitsGroup::~LimitsGroup()
|
||||
@@ -119,13 +119,13 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
}
|
||||
|
||||
// Channel offset
|
||||
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].offset, -1000, 1000, 0);
|
||||
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].offset, model, -1000, 1000, 0);
|
||||
|
||||
// Channel min
|
||||
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
|
||||
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].min, model, -model.getChannelsMax()*10, 0, -1000);
|
||||
|
||||
// Channel max
|
||||
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
|
||||
limitsGroups << new LimitsGroup(firmware, tableLayout, i, col++, model.limitData[i].max, model, 0, model.getChannelsMax()*10, 1000);
|
||||
|
||||
// Channel inversion
|
||||
QComboBox * invCB = new QComboBox(this);
|
||||
|
||||
@@ -10,7 +10,7 @@ class GVarGroup;
|
||||
class LimitsGroup
|
||||
{
|
||||
public:
|
||||
LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, int min, int max, int deflt);
|
||||
LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, const ModelData & model, int min, int max, int deflt);
|
||||
~LimitsGroup();
|
||||
|
||||
void updateMinMax(int max);
|
||||
|
||||
@@ -503,9 +503,8 @@ void Curves::resizeEvent(QResizeEvent *event)
|
||||
ModelPanel::resizeEvent(event);
|
||||
}
|
||||
|
||||
void Curves::on_curveType_currentIndexChanged()
|
||||
void Curves::on_curveType_currentIndexChanged(int index)
|
||||
{
|
||||
int index = ui->curveType->currentIndex();
|
||||
unsigned int flags = templates[index].flags;
|
||||
ui->curveCoeffLabel->setVisible(flags & CURVE_COEFF_ENABLE);
|
||||
ui->curveCoeff->setVisible(flags & CURVE_COEFF_ENABLE);
|
||||
|
||||
@@ -46,7 +46,7 @@ class Curves : public ModelPanel
|
||||
void onNodeMoved(int x, int y);
|
||||
void onNodeFocus();
|
||||
void onNodeUnfocus();
|
||||
void on_curveType_currentIndexChanged();
|
||||
void on_curveType_currentIndexChanged(int index);
|
||||
void on_curveApply_clicked();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -70,7 +70,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
s1.report("get tracks");
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
|
||||
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/FUNCTIONS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
if (functions[i].func==FuncPlayScript) {
|
||||
QString temp = functions[i].paramarm;
|
||||
@@ -403,7 +403,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
else if (func>=FuncSetTimer1 && func<=FuncSetTimer3) {
|
||||
if (modified) cfn.param = QTimeS(fswtchParamTime[i]->time()).seconds();
|
||||
fswtchParamTime[i]->setMinimumTime(QTime(0, 0, 0));
|
||||
fswtchParamTime[i]->setMaximumTime(QTime(0, 59, 59));
|
||||
fswtchParamTime[i]->setMaximumTime(firmware->getMaxTimerStart());
|
||||
fswtchParamTime[i]->setTime(QTimeS(cfn.param));
|
||||
widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM + CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
QRegExp rx(CHAR_FOR_NAMES_REGEX);
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, -100, 100);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, 0, -100, 100);
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, model, 100, -100, 100);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, model, 0, -100, 100);
|
||||
}
|
||||
else {
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, 0, 100);
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, model, 100, 0, 100);
|
||||
gvOffsetGroup = NULL;
|
||||
ui->offsetLabel->hide();
|
||||
ui->offsetGV->hide();
|
||||
@@ -33,7 +33,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
ui->offsetCB->hide();
|
||||
}
|
||||
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve,
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, model,
|
||||
firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
|
||||
|
||||
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings, MixesContext);
|
||||
|
||||
@@ -25,10 +25,10 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
|
||||
int limit = firmware->getCapability(OffsetWeight);
|
||||
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, model, 100, -limit, limit);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, model, 0, -limit, limit);
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB,
|
||||
md->curve, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
|
||||
md->curve, model, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
|
||||
|
||||
ui->MixDR_CB->setChecked(md->noExpo == 0);
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
|
||||
ui->countdownBeep->addItem(tr("Voice"), TimerData::COUNTDOWN_VOICE);
|
||||
ui->countdownBeep->addItem(tr("Haptic"), TimerData::COUNTDOWN_HAPTIC);
|
||||
}
|
||||
|
||||
ui->value->setMaximumTime(firmware->getMaxTimerStart());
|
||||
|
||||
ui->persistent->setField(timer.persistent, this);
|
||||
ui->persistent->addItem(tr("Not persistent"), 0);
|
||||
@@ -66,9 +68,11 @@ TimerPanel::~TimerPanel()
|
||||
|
||||
void TimerPanel::update()
|
||||
{
|
||||
int min = timer.val / 60;
|
||||
int sec = timer.val % 60;
|
||||
ui->value->setTime(QTime(0, min, sec));
|
||||
int hour = timer.val / 3600;
|
||||
int min = (timer.val - (hour * 3600)) / 60;
|
||||
int sec = (timer.val - (hour * 3600)) % 60;
|
||||
|
||||
ui->value->setTime(QTime(hour, min, sec));
|
||||
|
||||
if (firmware->getCapability(PermTimers)) {
|
||||
int sign = 1;
|
||||
@@ -94,7 +98,7 @@ QWidget * TimerPanel::getLastFocus()
|
||||
|
||||
void TimerPanel::on_value_editingFinished()
|
||||
{
|
||||
timer.val = ui->value->time().minute()*60 + ui->value->time().second();
|
||||
timer.val = ui->value->time().hour()*3600 + ui->value->time().minute()*60 + ui->value->time().second();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -327,8 +331,8 @@ void ModulePanel::update()
|
||||
ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES);
|
||||
|
||||
if (mask & MASK_CHANNELS_RANGE) {
|
||||
ui->channelsStart->setMaximum(32 - ui->channelsCount->value());
|
||||
ui->channelsCount->setMaximum(qMin(16, 32-ui->channelsStart->value()));
|
||||
ui->channelsStart->setMaximum(33 - ui->channelsCount->value());
|
||||
ui->channelsCount->setMaximum(qMin(16, 33-ui->channelsStart->value()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -774,6 +778,7 @@ void SetupPanel::populateThrottleSourceCB()
|
||||
|
||||
lock = true;
|
||||
|
||||
ui->throttleSource->clear();
|
||||
ui->throttleSource->addItem(QObject::tr("THR"));
|
||||
|
||||
if (IS_TARANIS_X9E(GetEepromInterface()->getBoard())) {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>-1</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
@@ -39,10 +39,10 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentSection">
|
||||
<enum>QDateTimeEdit::MinuteSection</enum>
|
||||
<enum>QDateTimeEdit::HourSection</enum>
|
||||
</property>
|
||||
<property name="displayFormat">
|
||||
<string notr="true">mm:ss</string>
|
||||
<string notr="true">hh:mm:ss</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -696,10 +696,10 @@ void TelemetrySensorPanel::on_unit_currentIndexChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetrySensorPanel::on_prec_valueChanged()
|
||||
void TelemetrySensorPanel::on_prec_valueChanged(double value)
|
||||
{
|
||||
if (!lock) {
|
||||
sensor.prec = ui->prec->value();
|
||||
sensor.prec = value;
|
||||
emit dataModified();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ class TelemetrySensorPanel: public ModelPanel
|
||||
void on_type_currentIndexChanged(int index);
|
||||
void on_formula_currentIndexChanged(int index);
|
||||
void on_unit_currentIndexChanged(int index);
|
||||
void on_prec_valueChanged();
|
||||
void on_prec_valueChanged(double value);
|
||||
|
||||
protected:
|
||||
void updateSourcesComboBox(AutoComboBox * cb, bool negative);
|
||||
|
||||
@@ -306,6 +306,9 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
|
||||
else if (input.carryTrim<0) str += " " + Qt::escape(RawSource(SOURCE_TYPE_TRIM, (-(input.carryTrim)-1)).toString(&model));
|
||||
}
|
||||
|
||||
if (input.offset)
|
||||
str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(input.offset)));
|
||||
|
||||
if (firmware->getCapability(HasExpoNames) && input.name[0])
|
||||
str += Qt::escape(QString(" [%1]").arg(input.name));
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ QString SyncProcess::updateEntry(const QString & path, const QDir & source, cons
|
||||
else {
|
||||
if (!destinationInfo.exists()) {
|
||||
// qDebug() << "Copy" << path << "to" << destinationPath;
|
||||
progress->addText(tr("Copy %1 to %2\n").arg(path).arg(destinationPath));
|
||||
progress->addText(tr("Copy %1 to %2").arg(path).arg(destinationPath) + "\n");
|
||||
if (!QFile::copy(path, destinationPath)) {
|
||||
return QObject::tr("Copy '%1' to '%2' failed").arg(path).arg(destinationPath);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ QString SyncProcess::updateEntry(const QString & path, const QDir & source, cons
|
||||
if (!destinationFile.open(QFile::WriteOnly)) {
|
||||
return QObject::tr("Write '%1' failed").arg(destinationPath);
|
||||
}
|
||||
progress->addText(tr("Write %1\n").arg(destinationPath));
|
||||
progress->addText(tr("Write %1").arg(destinationPath) + "\n");
|
||||
// qDebug() << "Write" << destinationPath;
|
||||
QTextStream destinationStream(&destinationFile);
|
||||
destinationStream << sourceContents;
|
||||
|
||||
@@ -191,7 +191,7 @@ void resetAvrdudeFuses(bool eepromProtect, ProgressWidget *progress)
|
||||
QStringList str;
|
||||
if (bcd.getMCU() == "m2560") {
|
||||
args << "-B8";
|
||||
QString erStr = eepromProtect ? "hfuse:w:0x11:m" : "hfuse:w:0x19:m";
|
||||
QString erStr = eepromProtect ? "hfuse:w:0x51:m" : "hfuse:w:0x59:m";
|
||||
str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
}
|
||||
@@ -220,7 +220,7 @@ void resetAvrdudeFuses(bool eepromProtect, ProgressWidget *progress)
|
||||
lfuses = "lfuse:w:0x3F:m";
|
||||
}
|
||||
|
||||
QString erStr = eepromProtect ? "hfuse:w:0x81:m" : "hfuse:w:0x89:m";
|
||||
QString erStr = eepromProtect ? "hfuse:w:0xC1:m" : "hfuse:w:0xC9:m";
|
||||
str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m";
|
||||
//use hfuse = 0x81 to prevent eeprom being erased with every flashing
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class SimulatorInterface
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) = 0;
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id) = 0;
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) = 0;
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id) = 0;
|
||||
|
||||
|
||||
@@ -143,37 +143,39 @@ void TelemetrySimulator::closeEvent(QCloseEvent *event)
|
||||
event->accept();
|
||||
}
|
||||
|
||||
#define SET_INSTANCE(control, id, def) ui->control->setText(QString::number(simulator->getSensorInstance(id, ((def) & 0x1F) + 1)))
|
||||
|
||||
void TelemetrySimulator::showEvent(QShowEvent *event)
|
||||
{
|
||||
SET_INSTANCE(rxbt_inst, BATT_ID, 0);
|
||||
SET_INSTANCE(rssi_inst, RSSI_ID, 24);
|
||||
SET_INSTANCE(swr_inst, SWR_ID, 24);
|
||||
SET_INSTANCE(a1_inst, ADC1_ID, 0);
|
||||
SET_INSTANCE(a2_inst, ADC2_ID, 0);
|
||||
SET_INSTANCE(a3_inst, A3_FIRST_ID, 0);
|
||||
SET_INSTANCE(a4_inst, A4_FIRST_ID, 0);
|
||||
SET_INSTANCE(t1_inst, T1_FIRST_ID, 0);
|
||||
SET_INSTANCE(t2_inst, T2_FIRST_ID, 0);
|
||||
SET_INSTANCE(rpm_inst, RPM_FIRST_ID, DATA_ID_RPM);
|
||||
SET_INSTANCE(fuel_inst, FUEL_FIRST_ID, 0);
|
||||
SET_INSTANCE(aspd_inst, AIR_SPEED_FIRST_ID, 0);
|
||||
SET_INSTANCE(vvspd_inst, VARIO_FIRST_ID, DATA_ID_VARIO);
|
||||
SET_INSTANCE(valt_inst, ALT_FIRST_ID, DATA_ID_VARIO);
|
||||
SET_INSTANCE(fasv_inst, VFAS_FIRST_ID, DATA_ID_FAS);
|
||||
SET_INSTANCE(fasc_inst, CURR_FIRST_ID, DATA_ID_FAS);
|
||||
SET_INSTANCE(cells_inst, CELLS_FIRST_ID, DATA_ID_FLVSS);
|
||||
SET_INSTANCE(gpsa_inst, GPS_ALT_FIRST_ID, DATA_ID_GPS);
|
||||
SET_INSTANCE(gpss_inst, GPS_SPEED_FIRST_ID, DATA_ID_GPS);
|
||||
SET_INSTANCE(gpsc_inst, GPS_COURS_FIRST_ID, DATA_ID_GPS);
|
||||
SET_INSTANCE(gpst_inst, GPS_TIME_DATE_FIRST_ID, DATA_ID_GPS);
|
||||
SET_INSTANCE(gpsll_inst, GPS_LONG_LATI_FIRST_ID, DATA_ID_GPS);
|
||||
SET_INSTANCE(accx_inst, ACCX_FIRST_ID, 0);
|
||||
SET_INSTANCE(accy_inst, ACCY_FIRST_ID, 0);
|
||||
SET_INSTANCE(accz_inst, ACCZ_FIRST_ID, 0);
|
||||
|
||||
ui->rxbt_inst->setText(QString::number(simulator->getSensorInstance(BATT_ID)));
|
||||
ui->rxbt_ratio->setValue(simulator->getSensorRatio(BATT_ID) / 10.0);
|
||||
ui->rssi_inst->setText(QString::number(simulator->getSensorInstance(RSSI_ID)));
|
||||
ui->swr_inst->setText(QString::number(simulator->getSensorInstance(SWR_ID)));
|
||||
ui->a1_inst->setText(QString::number(simulator->getSensorInstance(ADC1_ID)));
|
||||
ui->A1_ratio->setValue(simulator->getSensorRatio(ADC1_ID) / 10.0);
|
||||
ui->a2_inst->setText(QString::number(simulator->getSensorInstance(ADC2_ID)));
|
||||
ui->A2_ratio->setValue(simulator->getSensorRatio(ADC2_ID) / 10.0);
|
||||
ui->a3_inst->setText(QString::number(simulator->getSensorInstance(A3_FIRST_ID)));
|
||||
ui->a4_inst->setText(QString::number(simulator->getSensorInstance(A4_FIRST_ID)));
|
||||
ui->t1_inst->setText(QString::number(simulator->getSensorInstance(T1_FIRST_ID)));
|
||||
ui->t2_inst->setText(QString::number(simulator->getSensorInstance(T2_FIRST_ID)));
|
||||
ui->rpm_inst->setText(QString::number(simulator->getSensorInstance(RPM_FIRST_ID)));
|
||||
ui->fuel_inst->setText(QString::number(simulator->getSensorInstance(FUEL_FIRST_ID)));
|
||||
ui->aspd_inst->setText(QString::number(simulator->getSensorInstance(AIR_SPEED_FIRST_ID)));
|
||||
ui->vvspd_inst->setText(QString::number(simulator->getSensorInstance(VARIO_FIRST_ID)));
|
||||
ui->valt_inst->setText(QString::number(simulator->getSensorInstance(ALT_FIRST_ID)));
|
||||
ui->fasv_inst->setText(QString::number(simulator->getSensorInstance(VFAS_FIRST_ID)));
|
||||
ui->fasc_inst->setText(QString::number(simulator->getSensorInstance(CURR_FIRST_ID)));
|
||||
ui->cells_inst->setText(QString::number(simulator->getSensorInstance(CELLS_FIRST_ID)));
|
||||
ui->gpsa_inst->setText(QString::number(simulator->getSensorInstance(GPS_ALT_FIRST_ID)));
|
||||
ui->gpss_inst->setText(QString::number(simulator->getSensorInstance(GPS_SPEED_FIRST_ID)));
|
||||
ui->gpsc_inst->setText(QString::number(simulator->getSensorInstance(GPS_COURS_FIRST_ID)));
|
||||
ui->gpst_inst->setText(QString::number(simulator->getSensorInstance(GPS_TIME_DATE_FIRST_ID)));
|
||||
ui->gpsll_inst->setText(QString::number(simulator->getSensorInstance(GPS_LONG_LATI_FIRST_ID)));
|
||||
ui->accx_inst->setText(QString::number(simulator->getSensorInstance(ACCX_FIRST_ID)));
|
||||
ui->accy_inst->setText(QString::number(simulator->getSensorInstance(ACCY_FIRST_ID)));
|
||||
ui->accz_inst->setText(QString::number(simulator->getSensorInstance(ACCZ_FIRST_ID)));
|
||||
|
||||
ui->Simulate->setChecked(true);
|
||||
onSimulateToggled(true); // not sure why this doesn't fire automatically
|
||||
@@ -193,13 +195,27 @@ void setSportPacketCrc(uint8_t * packet)
|
||||
//TRACE("crc set: %x", packet[FRSKY_SPORT_PACKET_SIZE-1]);
|
||||
}
|
||||
|
||||
void generateSportPacket(uint8_t * packet, uint8_t dataId, uint8_t prim, uint16_t appId, uint32_t data)
|
||||
uint8_t getBit(uint8_t position, uint8_t value)
|
||||
{
|
||||
packet[0] = dataId;
|
||||
return (value & (uint8_t)(1 << position)) ? 1 : 0;
|
||||
}
|
||||
|
||||
bool generateSportPacket(uint8_t * packet, uint8_t dataId, uint8_t prim, uint16_t appId, uint32_t data)
|
||||
{
|
||||
if (dataId > 0x1B ) return false;
|
||||
|
||||
// generate Data ID field
|
||||
uint8_t bit5 = getBit(0, dataId) ^ getBit(1, dataId) ^ getBit(2, dataId);
|
||||
uint8_t bit6 = getBit(2, dataId) ^ getBit(3, dataId) ^ getBit(4, dataId);
|
||||
uint8_t bit7 = getBit(0, dataId) ^ getBit(2, dataId) ^ getBit(4, dataId);
|
||||
|
||||
packet[0] = (bit7 << 7) + (bit6 << 6) + (bit5 << 5) + dataId;
|
||||
// qDebug("dataID: 0x%02x (%d)", packet[0], dataId);
|
||||
packet[1] = prim;
|
||||
*((uint16_t *)(packet+2)) = appId;
|
||||
*((int32_t *)(packet+4)) = data;
|
||||
setSportPacketCrc(packet);
|
||||
return true;
|
||||
}
|
||||
|
||||
void TelemetrySimulator::generateTelemetryFrame()
|
||||
@@ -372,7 +388,7 @@ void TelemetrySimulator::generateTelemetryFrame()
|
||||
return;
|
||||
}
|
||||
|
||||
if (ok && buffer[0])
|
||||
if (ok && (buffer[2] || buffer[3]))
|
||||
simulator->sendTelemetry(buffer, FRSKY_SPORT_PACKET_SIZE);
|
||||
else
|
||||
onTimerEvent();
|
||||
|
||||
+1581
-1066
File diff suppressed because it is too large
Load Diff
+1867
-1323
File diff suppressed because it is too large
Load Diff
+1858
-1318
File diff suppressed because it is too large
Load Diff
+1828
-1285
File diff suppressed because it is too large
Load Diff
+1374
-1091
File diff suppressed because it is too large
Load Diff
+1843
-1303
File diff suppressed because it is too large
Load Diff
+1873
-1333
File diff suppressed because it is too large
Load Diff
+1804
-1264
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1848
-1308
File diff suppressed because it is too large
Load Diff
+1849
-1309
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,47 @@
|
||||
<h2>Version 2.1.8 / 2016-04-14</h2>
|
||||
|
||||
Notice: EDGE Logical Switch operation has changed. Users should check their setups, if they use EDGE with AND switch.
|
||||
This bug was introduced in version 2.1.2 and has been fixed in 2.1.8. (<a href=https://github.com/opentx/opentx/issues/2939>#2939</a>)
|
||||
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Improvements of Statistics screen (<a href=https://github.com/opentx/opentx/issues/3206>#3206</a>)</li>
|
||||
<li>Flight Modes screen layout fix (<a href=https://github.com/opentx/opentx/issues/3307>#3307</a>)</li>
|
||||
<li>Fixed: left slider was affecting the value of the right slider on X9E (<a href=https://github.com/opentx/opentx/issues/2639>#2639</a>)</li>
|
||||
<li>USB Joystick now supports 24 buttons (CH9-32) (<a href=https://github.com/opentx/opentx/issues/3268>#3268</a>)</li>
|
||||
<li>Main view adjustments for 3-char switch names (<a href=https://github.com/opentx/opentx/issues/3278>#3278</a>)</li>
|
||||
</ul>
|
||||
|
||||
[ARM (Taranis, Sky9x, 9XR-PRO, AR9X)]
|
||||
<ul>
|
||||
<li>Channel jitter reduced (<a href=https://github.com/opentx/opentx/issues/3233>#3233</a>)</li>
|
||||
<li>Fixed: EDGE Logical switch internal state was being reset by the AND switch, that affected its function (it looked like AND was applied before the EDGE processing, not after like it is done for other logical switch types) (<a href=https://github.com/opentx/opentx/issues/2939>#2939</a>)</li>
|
||||
</ul>
|
||||
|
||||
[Lua]
|
||||
<ul>
|
||||
<li>Some Lua fields were not available to scripts (<a href=https://github.com/opentx/opentx/issues/3223>#3223</a>)</li>
|
||||
<li>Fixed: only first 32 input lines (out of 64) were accessible in Lua (<a href=https://github.com/opentx/opentx/issues/3285>#3285</a>)</li>
|
||||
<li>playDuration() second parameter is now really optional (<a href=https://github.com/opentx/opentx/issues/3329>#3329</a>)</li>
|
||||
<li>Fixed Lua io.open() problem for non-existing files (<a href=https://github.com/opentx/opentx/issues/3342>#3342</a>)</li>
|
||||
</ul>
|
||||
|
||||
[Mega2560]
|
||||
<ul>
|
||||
<li>Fixed: First PPM pulse in the frame was longer (<a href=https://github.com/opentx/opentx/issues/2981>#2981</a>)</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>Various texts and translations corrections (se, it, pl, de)</li>
|
||||
<li>Text to speech fixes (hu, sp)</li>
|
||||
<li>Various small bug-fixes</li>
|
||||
<li>PowerBox telemetry sensor names changed</li>
|
||||
<li>Removed a few legacy timer limitations, fix non-working limit (<a href=https://github.com/opentx/opentx/issues/3301>#3301</a>)</li>
|
||||
<li>Removed the "RF signal low" alert before "Telemetry lost" when powering off the receiver (<a href=https://github.com/opentx/opentx/issues/2616>#2616</a>)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.7 / 2016-01-04</h2>
|
||||
|
||||
Notice: Lua model wizard was fixed (<a href=https://github.com/opentx/opentx/issues/3061>#3061</a>)
|
||||
|
||||
+22
-8
@@ -383,6 +383,14 @@ WARNINGS_AS_ERRORS = NO
|
||||
# Values = NO, YES
|
||||
LUA_COMPILER = NO
|
||||
|
||||
# Enable ADC jitter measurement
|
||||
# Values = NO, YES
|
||||
JITTER_MEASURE = NO
|
||||
|
||||
# Enable ADC jitter filtering
|
||||
# Values = NO, YES
|
||||
JITTER_FILTER = YES
|
||||
|
||||
#------- END BUILD OPTIONS ---------------------------
|
||||
|
||||
# Define programs and commands.
|
||||
@@ -395,7 +403,7 @@ TRANSLATE = -python ../util/translate.py
|
||||
|
||||
VERSION_MAJOR = 2
|
||||
VERSION_MINOR = 1
|
||||
VERSION_REVISION = 7
|
||||
VERSION_REVISION = 8
|
||||
|
||||
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)$(OPENTX_VERSION_SUFFIX)
|
||||
|
||||
@@ -712,7 +720,7 @@ ifeq ($(PCB), MEGA2560)
|
||||
TRGT = avr-
|
||||
MCU = atmega2560
|
||||
OPT = s
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBMEGA2560 -DCPUM2560 -DEEPROM_RLC -DEEPROM_VARIANT=0 -DAUDIO
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBMEGA2560 -DCPUM2560 -DEEPROM_RLC -DEEPROM_VARIANT=0
|
||||
SDCARD = NO
|
||||
BUZZER = YES
|
||||
THR_TRACE = YES
|
||||
@@ -721,7 +729,7 @@ ifeq ($(PCB), MEGA2560)
|
||||
BOARDSRC = main_avr.cpp targets/mega2560/board_mega2560.cpp
|
||||
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
|
||||
PULSESSRC = pulses/pulses_avr.cpp
|
||||
CPPSRC += audio_avr.cpp debug.cpp
|
||||
CPPSRC += debug.cpp
|
||||
BITMAPS += bitmaps/9X/splash.lbm bitmaps/9X/asterisk.lbm bitmaps/9X/about.lbm
|
||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
|
||||
|
||||
@@ -1067,6 +1075,12 @@ ifeq ($(PCB), TARANIS)
|
||||
ifeq ($(WATCHDOG_TEST), YES)
|
||||
CPPDEFS += -DWATCHDOG_TEST
|
||||
endif
|
||||
ifeq ($(JITTER_MEASURE), YES)
|
||||
CPPDEFS += -DJITTER_MEASURE
|
||||
endif
|
||||
ifeq ($(JITTER_FILTER), YES)
|
||||
CPPDEFS += -DJITTER_FILTER
|
||||
endif
|
||||
endif
|
||||
|
||||
CC = $(TRGT)gcc
|
||||
@@ -1518,12 +1532,12 @@ bootloader.lbm: targets/taranis/bootloader/bootloader_ramBoot.bin
|
||||
else ifeq ($(PCB), $(filter $(PCB), 9XRPRO AR9X))
|
||||
bootloader.lbm:
|
||||
@echo "Fetching Mike's bootloader..."
|
||||
wget http://ersky9x.googlecode.com/svn/trunk/src/bootloader/bootflash8.lbm
|
||||
wget https://github.com/MikeBland/OpenRcBootloader/releases/download/V1.9/bootflash8.lbm
|
||||
mv bootflash8.lbm $@
|
||||
else ifeq ($(PCB), SKY9X)
|
||||
bootloader.lbm:
|
||||
@echo "Fetching Mike's bootloader..."
|
||||
wget http://ersky9x.googlecode.com/svn/trunk/src/bootloader/bootflash4.lbm
|
||||
wget https://github.com/MikeBland/OpenRcBootloader/releases/download/V1.9/bootflash4.lbm
|
||||
mv bootflash4.lbm $@
|
||||
endif
|
||||
|
||||
@@ -1658,14 +1672,14 @@ endif
|
||||
|
||||
lua_exports_taranis.inc: myeeprom.h ../util/luaexport.py
|
||||
@echo "Generating a list of Lua exported constants in lua_exports_taranis.txt"
|
||||
@$(PARSER) -DEXPORT -DPCBTARANIS -DLUA -DVIRTUALINPUTS myeeprom.h | grep LEXP > lua_exports_taranis.txt
|
||||
@$(PARSER) -DEXPORT -DCPUARM -DPCBTARANIS -DLUA -DVIRTUALINPUTS myeeprom.h | grep LEXP > lua_exports_taranis.txt
|
||||
@echo "Parsing and generating C Lua exports in lua/lua_exports_taranis.inc"
|
||||
@$(PYTHON) ../util/luaexport.py $(VERSION) lua_exports_taranis.txt lua/lua_exports_taranis.inc lua_fields_taranis.txt
|
||||
@python ../util/luaexport.py $(VERSION) lua_exports_taranis.txt lua/lua_exports_taranis.inc lua_fields_taranis.txt
|
||||
@rm lua_exports_taranis.txt
|
||||
|
||||
lua_exports_taranis_x9e.inc: myeeprom.h ../util/luaexport.py
|
||||
@echo "Generating a list of Lua exported constants in lua_exports_taranis_x9e.txt"
|
||||
@$(PARSER) -DEXPORT -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS myeeprom.h | grep LEXP > lua_exports_taranis_x9e.txt
|
||||
@$(PARSER) -DEXPORT -DCPUARM -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS myeeprom.h | grep LEXP > lua_exports_taranis_x9e.txt
|
||||
@echo "Parsing and generating C Lua exports in lua/lua_exports_taranis_x9e.inc"
|
||||
@python ../util/luaexport.py $(VERSION) lua_exports_taranis_x9e.txt lua/lua_exports_taranis_x9e.inc lua_fields_taranis_x9e.txt
|
||||
@rm lua_exports_taranis_x9e.txt
|
||||
|
||||
@@ -160,5 +160,35 @@ void dumpTraceBuffer();
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(JITTER_MEASURE) && defined(__cplusplus)
|
||||
|
||||
template<class T> class JitterMeter {
|
||||
public:
|
||||
T min;
|
||||
T max;
|
||||
T measured;
|
||||
|
||||
JitterMeter() : min(~(T)0), max(0), measured(0) {};
|
||||
|
||||
void reset() {
|
||||
// store mesaurement
|
||||
measured = max - min;
|
||||
//reset - begin new measurement
|
||||
min = ~(T)0;
|
||||
max = 0;
|
||||
};
|
||||
|
||||
void measure(T value) {
|
||||
if (value > max) max = value;
|
||||
if (value < min) min = value;
|
||||
};
|
||||
|
||||
T get() const {
|
||||
return measured;
|
||||
};
|
||||
};
|
||||
|
||||
#endif // defined(JITTER_MEASURE)
|
||||
|
||||
#endif // #ifndef debug_h
|
||||
|
||||
|
||||
@@ -457,9 +457,9 @@ void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t
|
||||
}
|
||||
else if (smlsize) {
|
||||
x -= 2;
|
||||
lcd_plot(x+1, y+5);
|
||||
lcd_plot(x, y+5);
|
||||
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
||||
lcd_vline(x+1, y, 7);
|
||||
lcd_vline(x, y-1, 8);
|
||||
}
|
||||
}
|
||||
else if (tinsize) {
|
||||
@@ -625,7 +625,7 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||
|
||||
#if defined(CPUARM)
|
||||
char separator = ':';
|
||||
if (tme >= 3600 && (~att & DBLSIZE)) {
|
||||
if (tme >= 3600) {
|
||||
qr = div(qr.quot, 60);
|
||||
separator = CHR_HOUR;
|
||||
}
|
||||
@@ -633,6 +633,10 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||
#define separator ':'
|
||||
#endif
|
||||
lcd_outdezNAtt(x, y, qr.quot, att|LEADING0|LEFT, 2);
|
||||
#if defined(CPUARM)
|
||||
if (separator == CHR_HOUR)
|
||||
att &= ~DBLSIZE;
|
||||
#endif
|
||||
#if defined(CPUARM) && defined(RTCLOCK)
|
||||
if (att&TIMEBLINK)
|
||||
lcd_putcAtt(lcdLastPos, y, separator, BLINK);
|
||||
|
||||
@@ -211,7 +211,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||
#endif
|
||||
#if defined(CPUARM)
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
val_max = 59*60+59;
|
||||
val_max = 539*60+59;
|
||||
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -220,13 +220,14 @@ void menuModelSetup(uint8_t event)
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59);
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 539); // 8:59
|
||||
timer->start = qr.rem + qr.quot*60;
|
||||
break;
|
||||
case 2:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
|
||||
timer->start -= qr.rem ;
|
||||
if ((int16_t)timer->start < 0) timer->start=0;
|
||||
if ((int16_t)timer->start > 5999) timer->start=32399; // 8:59:59
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -299,7 +300,10 @@ void menuModelSetup(uint8_t event)
|
||||
break;
|
||||
case 2:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
|
||||
timer->start -= qr.rem ;
|
||||
if (timer->start >= qr.rem) {
|
||||
timer->start -= qr.rem ;
|
||||
}
|
||||
if ((int32_t)timer->start > 3599) timer->start=3599; // 59:59
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,9 +421,9 @@ void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t
|
||||
}
|
||||
else if (smlsize) {
|
||||
x -= 2;
|
||||
lcd_plot(x+1, y+5);
|
||||
lcd_plot(x, y+5);
|
||||
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
||||
lcd_vline(x+1, y, 7);
|
||||
lcd_vline(x, y-1, 8);
|
||||
}
|
||||
}
|
||||
else if (tinsize) {
|
||||
@@ -593,6 +593,8 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||
qr.quot = qr2.rem;
|
||||
if (att & MIDSIZE)
|
||||
x += 17;
|
||||
else if (att & BOLD)
|
||||
x += 15;
|
||||
else
|
||||
x += 13;
|
||||
}
|
||||
@@ -1036,6 +1038,7 @@ void lcd_plot(coord_t x, coord_t y, LcdFlags att)
|
||||
|
||||
void lcd_hlineStip(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att)
|
||||
{
|
||||
if (w < 0) { x += w; w = -w; }
|
||||
if (y < 0 || y >= LCD_H) return;
|
||||
if (x+w > LCD_W) {
|
||||
if (x >= LCD_W ) return;
|
||||
|
||||
@@ -43,28 +43,26 @@ void menuGeneralDiagAna(uint8_t event)
|
||||
STICK_SCROLL_DISABLE();
|
||||
|
||||
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
#if (NUM_STICKS+NUM_POTS) > 9
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/3)*FH;
|
||||
const uint8_t x_coord[] = {0, 70, 154};
|
||||
uint8_t x = x_coord[i%3];
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
|
||||
uint8_t x = i&1 ? LCD_W/2 + FW : 0;
|
||||
lcd_outdezNAtt(x, y, i+1, LEADING0|LEFT, 2);
|
||||
lcd_putc(x+2*FW-2, y, ':');
|
||||
#else
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
|
||||
uint8_t x = i&1 ? 64+5 : 0;
|
||||
putsStrIdx(x, y, PSTR("A"), i+1);
|
||||
lcd_putc(lcdNextPos, y, ':');
|
||||
#endif
|
||||
lcd_outhex4(x+3*FW-1, y, anaIn(i));
|
||||
#if defined(JITTER_MEASURE)
|
||||
lcd_outdezAtt(x+10*FW-1, y, rawJitter[i].get());
|
||||
lcd_outdezAtt(x+13*FW-1, y, avgJitter[i].get());
|
||||
lcd_outdez8(x+17*FW-1, y, (int16_t)calibratedStick[CONVERT_MODE(i)]*25/256);
|
||||
#else
|
||||
lcd_outdez8(x+10*FW-1, y, (int16_t)calibratedStick[CONVERT_MODE(i)]*25/256);
|
||||
#endif
|
||||
}
|
||||
|
||||
lcd_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_BATT_CALIB);
|
||||
lcd_putsLeft(MENU_HEADER_HEIGHT+1+6*FH, STR_BATT_CALIB);
|
||||
static int32_t adcBatt;
|
||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
||||
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.txVoltageCalibration)/128) * BATT_SCALE;
|
||||
batCalV >>= 11;
|
||||
batCalV += 2; // because of the diode
|
||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+5*FH, batCalV, s_editMode > 0 ? BLINK|INVERS : INVERS);
|
||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+6*FH, batCalV, s_editMode > 0 ? BLINK|INVERS : INVERS);
|
||||
if (s_editMode > 0) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
|
||||
}
|
||||
|
||||
@@ -272,8 +272,8 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
}
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
val_max = 59*60+59;
|
||||
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr);
|
||||
val_max = 539*60+59; //8:59:59
|
||||
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT|TIMEHOUR, attr);
|
||||
}
|
||||
else if (func == FUNC_PLAY_SOUND) {
|
||||
val_max = AU_FRSKY_LAST-AU_FRSKY_FIRST-1;
|
||||
|
||||
@@ -121,7 +121,7 @@ void menuModelFlightModesAll(uint8_t event)
|
||||
|
||||
case ITEM_FLIGHT_MODES_SWITCH:
|
||||
if (k>0) {
|
||||
putsSwitches((5+LEN_FLIGHT_MODE_NAME)*FW+FW/2, y, p->swtch, attr);
|
||||
putsSwitches((4+LEN_FLIGHT_MODE_NAME)*FW+FW/2, y, p->swtch, attr);
|
||||
if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -137,8 +137,8 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
|
||||
TimerData * timer = &g_model.timers[timerIdx];
|
||||
putsStrIdx(0*FW, y, STR_TIMER, timerIdx+1);
|
||||
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0);
|
||||
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, menuHorizontalPosition==1 ? attr : 0, menuHorizontalPosition==2 ? attr : 0);
|
||||
if (attr && menuHorizontalPosition < 0) drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);
|
||||
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, menuHorizontalPosition==1 ? attr|TIMEHOUR : TIMEHOUR, menuHorizontalPosition==2 ? attr|TIMEHOUR : TIMEHOUR);
|
||||
if (attr && menuHorizontalPosition < 0) drawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 11*FW, FH+1);
|
||||
if (attr && s_editMode>0) {
|
||||
div_t qr = div(timer->start, 60);
|
||||
switch (menuHorizontalPosition) {
|
||||
@@ -162,13 +162,14 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59);
|
||||
qr.quot = checkIncDec(event, qr.quot, 0, 1439, EE_MODEL | NO_INCDEC_MARKS); // 23h59
|
||||
timer->start = qr.rem + qr.quot*60;
|
||||
break;
|
||||
case 2:
|
||||
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
|
||||
timer->start -= qr.rem ;
|
||||
if ((int16_t)timer->start < 0) timer->start=0;
|
||||
if ((int32_t)timer->start > 86399) timer->start=86399; // 23h59:59
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
#include "../../timers.h"
|
||||
|
||||
#define BIGSIZE MIDSIZE
|
||||
#define LBOX_CENTERX (BOX_WIDTH/2 + 17)
|
||||
#define RBOX_CENTERX (LCD_W-LBOX_CENTERX)
|
||||
#define LBOX_CENTERX (BOX_WIDTH/2 + 16)
|
||||
#define RBOX_CENTERX (LCD_W-LBOX_CENTERX-1)
|
||||
#define MODELNAME_X (15)
|
||||
#define MODELNAME_Y (11)
|
||||
#define VBATT_X (MODELNAME_X+26)
|
||||
@@ -564,12 +564,12 @@ void menuMainView(uint8_t event)
|
||||
if (g_eeGeneral.view == VIEW_INPUTS) {
|
||||
div_t qr2 = div(qr.rem, 5);
|
||||
if (i >= 14) qr2.rem += 1;
|
||||
const coord_t x[4] = { 50, 144 };
|
||||
const coord_t x[4] = { 50, 142 };
|
||||
const coord_t y[4] = { 25, 42, 25, 42 };
|
||||
displaySwitch(x[qr.quot]+qr2.rem*4, y[qr2.quot], 3, i);
|
||||
}
|
||||
else {
|
||||
displaySwitch(15+qr.rem*6, 25+qr.quot*17, 5, i);
|
||||
displaySwitch(17+qr.rem*6, 25+qr.quot*17, 5, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -579,7 +579,7 @@ void menuMainView(uint8_t event)
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH+i);
|
||||
getvalue_t sw = ((val < 0) ? 3*i+1 : ((val == 0) ? 3*i+2 : 3*i+3));
|
||||
putsSwitches((g_eeGeneral.view == VIEW_INPUTS) ? (index<4 ? 8*FW+3 : 24*FW+1) : (index<4 ? 3*FW+2 : 8*FW-1), (index%4)*FH+3*FH, sw, 0);
|
||||
putsSwitches((g_eeGeneral.view == VIEW_INPUTS) ? (index<4 ? 8*FW+1 : 23*FW+2) : (index<4 ? 3*FW+1 : 8*FW-2), (index%4)*FH+3*FH, sw, 0);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,11 @@
|
||||
#include "../../opentx.h"
|
||||
#include "../../timers.h"
|
||||
|
||||
#define STATS_1ST_COLUMN FW/2
|
||||
#define STATS_2ND_COLUMN 12*FW+FW/2
|
||||
#define STATS_3RD_COLUMN 24*FW+FW/2
|
||||
#define STATS_LABEL_WIDTH 8*FW
|
||||
|
||||
void menuStatisticsView(uint8_t event)
|
||||
{
|
||||
TITLE(STR_MENUSTAT);
|
||||
@@ -58,21 +63,25 @@ void menuStatisticsView(uint8_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
lcd_puts( 1*FW, FH*0, STR_TOTTM1TM2THRTHP);
|
||||
putsTimer( 5*FW+5*FWNUM+1, FH*1, timersStates[0].val, 0, 0);
|
||||
putsTimer( 12*FW+5*FWNUM+1, FH*1, timersStates[1].val, 0, 0);
|
||||
// Session and Total timers
|
||||
lcd_putsAtt(STATS_1ST_COLUMN, FH*1+1, "SES", BOLD);
|
||||
putsTimer(STATS_1ST_COLUMN + STATS_LABEL_WIDTH, FH*1+1, sessionTimer, 0, 0);
|
||||
lcd_putsAtt(STATS_1ST_COLUMN, FH*2+1, "TOT", BOLD);
|
||||
putsTimer(STATS_1ST_COLUMN + STATS_LABEL_WIDTH, FH*2+1, g_eeGeneral.globalTimer + sessionTimer, TIMEHOUR, 0);
|
||||
|
||||
putsTimer( 5*FW+5*FWNUM+1, FH*2, s_timeCumThr, 0, 0);
|
||||
putsTimer( 12*FW+5*FWNUM+1, FH*2, s_timeCum16ThrP/16, 0, 0);
|
||||
// Throttle special timers
|
||||
lcd_putsAtt(STATS_2ND_COLUMN, FH*0+1, "THR", BOLD);
|
||||
putsTimer(STATS_2ND_COLUMN + STATS_LABEL_WIDTH, FH*0+1, s_timeCumThr, 0, 0);
|
||||
lcd_putsAtt(STATS_2ND_COLUMN, FH*1+1, "TH%", BOLD);
|
||||
putsTimer(STATS_2ND_COLUMN + STATS_LABEL_WIDTH, FH*1+1, s_timeCum16ThrP/16, 0, 0);
|
||||
|
||||
putsTimer( 12*FW+5*FWNUM+1, FH*0, sessionTimer, 0, 0);
|
||||
|
||||
lcd_puts( 24*FW, FH*0, "TOT");
|
||||
putsTimer( 28*FW+5*FWNUM+1, FH*0, g_eeGeneral.globalTimer + sessionTimer, TIMEHOUR, 0);
|
||||
|
||||
if (TIMERS == 3) {
|
||||
lcd_puts( 24*FW, FH*1, "TM3");
|
||||
putsTimer( 28*FW+5*FWNUM+1, FH*1, timersStates[2].val, TIMEHOUR, 0);
|
||||
// Timers
|
||||
for (int i=0; i<TIMERS; i++) {
|
||||
putsStrIdx(STATS_3RD_COLUMN, FH*i+1, "TM", i+1, BOLD);
|
||||
if (timersStates[i].val > 3600)
|
||||
putsTimer(STATS_3RD_COLUMN + STATS_LABEL_WIDTH, FH*i+1, timersStates[i].val, TIMEHOUR, 0);
|
||||
else
|
||||
putsTimer(STATS_3RD_COLUMN + STATS_LABEL_WIDTH, FH*i+1, timersStates[i].val, 0, 0);
|
||||
}
|
||||
|
||||
#if defined(THRTRACE)
|
||||
|
||||
@@ -121,6 +121,7 @@ void displayGaugesTelemetryScreen(FrSkyScreenData & screen)
|
||||
bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||
{
|
||||
// Custom Screen with numbers
|
||||
const coord_t pos[] = {0, 71, 143, 214};
|
||||
uint8_t fields_count = 0;
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
for (uint8_t j=0; j<NUM_LINE_ITEMS; j++) {
|
||||
@@ -137,11 +138,17 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||
}
|
||||
}
|
||||
if (field) {
|
||||
coord_t x = pos[j+1]-2;
|
||||
coord_t y = (i==3 ? 1+FH+2*FH*i:FH+2*FH*i);
|
||||
LcdFlags att = (i==3 ? NO_UNIT : DBLSIZE|NO_UNIT);
|
||||
coord_t pos[] = {0, 71, 143, 214};
|
||||
if (field >= MIXSRC_FIRST_TIMER && field <= MIXSRC_LAST_TIMER && i!=3) {
|
||||
// there is not enough space on LCD for displaying "Tmr1" or "Tmr2" and still see the - sign, we write "T1" or "T2" instead
|
||||
putsStrIdx(pos[j], 1+FH+2*FH*i, "T", field-MIXSRC_FIRST_TIMER+1, 0);
|
||||
if (timersStates[field-MIXSRC_FIRST_TIMER].val > 3600) {
|
||||
att += TIMEHOUR - DBLSIZE;
|
||||
x -= 3*FW;
|
||||
y += FH/2;
|
||||
}
|
||||
}
|
||||
else if (field >= MIXSRC_FIRST_TELEM && isGPSSensor(1+(field-MIXSRC_FIRST_TELEM)/3) && telemetryItems[(field-MIXSRC_FIRST_TELEM)/3].isAvailable()) {
|
||||
// we don't display GPS name, no space for it
|
||||
@@ -160,8 +167,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||
}
|
||||
}
|
||||
|
||||
putsChannel(pos[j+1]-2, (i==3 ? 1+FH+2*FH*i:FH+2*FH*i), field, att);
|
||||
|
||||
putsChannel(x, y, field, att);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,6 +332,12 @@ The list of valid sources is available:
|
||||
* for OpenTX 2.1.x Taranis and Taranis Plus at http://downloads-21.open-tx.org/firmware/lua_fields_taranis.txt
|
||||
* for OpenTX 2.1.x Taranis X9E at http://downloads-21.open-tx.org/firmware/lua_fields_taranis_x9e.txt
|
||||
|
||||
In OpenTX 2.1.x the telemetry sources no longer have a predefined name.
|
||||
To get a telemetry value simply use it's sensor name. For example:
|
||||
* Altitude sensor has a name "Alt"
|
||||
* to get the current altitude use the source "Alt"
|
||||
* to get the minimum altitude use the source "Alt-", to get the maximum use "Alt+"
|
||||
|
||||
@param name (string) name of the field
|
||||
|
||||
@retval table information about requested field, table elements:
|
||||
@@ -365,7 +371,9 @@ Returns the value of a source.
|
||||
|
||||
The list of valid sources is available:
|
||||
* for OpenTX 2.0.x at http://downloads-20.open-tx.org/firmware/lua_fields.txt
|
||||
* for OpenTX 2.1.x at http://downloads-21.open-tx.org/firmware/lua_fields.txt
|
||||
* for OpenTX 2.1.x at http://downloads-21.open-tx.org/firmware/lua_fields.txt (depreciated)
|
||||
* for OpenTX 2.1.x Taranis and Taranis Plus at http://downloads-21.open-tx.org/firmware/lua_fields_taranis.txt
|
||||
* for OpenTX 2.1.x Taranis X9E at http://downloads-21.open-tx.org/firmware/lua_fields_taranis_x9e.txt
|
||||
|
||||
In OpenTX 2.1.x the telemetry sources no longer have a predefined name.
|
||||
To get a telemetry value simply use it's sensor name. For example:
|
||||
@@ -496,7 +504,7 @@ OpenTX 2.0:
|
||||
|
||||
| Unit | Sound | File (.wav) | Automatic conversion rules |
|
||||
| --- | --- | --- | --- |
|
||||
| 0 | | | |
|
||||
| 0 | --- | --- (no unit played) | |
|
||||
| 1 | Volts | 116 | |
|
||||
| 2 | Amps | 118 | |
|
||||
| 3 | Meters per Second | 120 | |
|
||||
@@ -522,7 +530,8 @@ OpenTX 2.0:
|
||||
OpenTX 2.1:
|
||||
|
||||
| 2.1 Unit | Sound | Sound File (.wav) |
|
||||
| --- | --- | --- |
|
||||
| --- | --- | --- | --- |
|
||||
| 0 | --- | --- (no unit played) | |
|
||||
| 1 | Volts | 116 |
|
||||
| 2 | Amps | 118 |
|
||||
| 3 | Milliamps | 120 |
|
||||
@@ -574,7 +583,7 @@ Play a time value (text to speech)
|
||||
static int luaPlayDuration(lua_State *L)
|
||||
{
|
||||
int duration = luaL_checkinteger(L, 1);
|
||||
bool playTime = (luaL_checkinteger(L, 2) != 0);
|
||||
bool playTime = (luaL_optinteger(L, 2, 0) != 0);
|
||||
playDuration(duration, playTime ? PLAY_TIME : 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ static int luaModelResetTimer(lua_State *L)
|
||||
|
||||
static unsigned int getFirstInput(unsigned int chn)
|
||||
{
|
||||
for (unsigned int i=0; i<MAX_INPUTS; i++) {
|
||||
for (unsigned int i=0; i<MAX_EXPOS; i++) {
|
||||
ExpoData * expo = expoAddress(i);
|
||||
if (!expo->srcRaw || expo->chn >= chn) {
|
||||
return i;
|
||||
@@ -285,7 +285,7 @@ static unsigned int getFirstInput(unsigned int chn)
|
||||
static unsigned int getInputsCountFromFirst(unsigned int chn, unsigned int first)
|
||||
{
|
||||
unsigned int count = 0;
|
||||
for (unsigned int i=first; i<MAX_INPUTS; i++) {
|
||||
for (unsigned int i=first; i<MAX_EXPOS; i++) {
|
||||
ExpoData * expo = expoAddress(i);
|
||||
if (!expo->srcRaw || expo->chn!=chn) break;
|
||||
count++;
|
||||
|
||||
+55
-4
@@ -1428,6 +1428,13 @@ uint16_t BandGap = 2040 ;
|
||||
uint16_t BandGap ;
|
||||
#endif
|
||||
|
||||
#if defined(JITTER_MEASURE)
|
||||
JitterMeter<uint16_t> rawJitter[NUMBER_ANALOG];
|
||||
JitterMeter<uint16_t> avgJitter[NUMBER_ANALOG];
|
||||
tmr10ms_t jitterResetTime = 0;
|
||||
#define JITTER_MEASURE_ACTIVE() (menuHandlers[menuLevel] == menuGeneralDiagAna)
|
||||
#endif // defined(JITTER_MEASURE)
|
||||
|
||||
#if !defined(SIMU)
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
@@ -1464,10 +1471,28 @@ void getADC()
|
||||
{
|
||||
uint16_t temp[NUMBER_ANALOG] = { 0 };
|
||||
|
||||
#if defined(JITTER_MEASURE)
|
||||
if (JITTER_MEASURE_ACTIVE() && jitterResetTime < get_tmr10ms()) {
|
||||
for (uint32_t x=0; x<NUMBER_ANALOG; x++) {
|
||||
rawJitter[x].reset();
|
||||
avgJitter[x].reset();
|
||||
}
|
||||
jitterResetTime = get_tmr10ms() + 100; //every second
|
||||
}
|
||||
#endif
|
||||
|
||||
for (uint32_t i=0; i<4; i++) {
|
||||
adcRead();
|
||||
for (uint32_t x=0; x<NUMBER_ANALOG; x++) {
|
||||
#if defined(JITTER_MEASURE)
|
||||
uint16_t val = getAnalogValue(x);
|
||||
if (JITTER_MEASURE_ACTIVE()) {
|
||||
rawJitter[x].measure(val);
|
||||
}
|
||||
temp[x] += val;
|
||||
#else
|
||||
temp[x] += getAnalogValue(x);
|
||||
#endif
|
||||
}
|
||||
#if defined(VIRTUALINPUTS)
|
||||
if (calibrationState) break;
|
||||
@@ -1476,8 +1501,29 @@ void getADC()
|
||||
|
||||
for (uint32_t x=0; x<NUMBER_ANALOG; x++) {
|
||||
uint16_t v = temp[x] >> 3;
|
||||
|
||||
#if defined(VIRTUALINPUTS)
|
||||
if (calibrationState) v = temp[x] >> 1;
|
||||
|
||||
if (calibrationState) {
|
||||
v = temp[x] >> 1;
|
||||
}
|
||||
#if defined(JITTER_FILTER)
|
||||
else {
|
||||
// jitter filter
|
||||
uint16_t diff = (v > s_anaFilt[x]) ? (v - s_anaFilt[x]) : (s_anaFilt[x] - v);
|
||||
if (diff < 10) {
|
||||
// apply filter
|
||||
v = (7 * s_anaFilt[x] + v) >> 3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(JITTER_MEASURE)
|
||||
if (JITTER_MEASURE_ACTIVE()) {
|
||||
avgJitter[x].measure(v);
|
||||
}
|
||||
#endif
|
||||
|
||||
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[x];
|
||||
if (!calibrationState && IS_POT_MULTIPOS(x) && calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) {
|
||||
uint8_t vShifted = (v >> 4);
|
||||
@@ -1489,9 +1535,11 @@ void getADC()
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
#endif
|
||||
s_anaFilt[x] = v;
|
||||
{
|
||||
s_anaFilt[x] = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2473,9 +2521,12 @@ int main(void)
|
||||
#if defined(CPUM2560) || defined(CPUM2561)
|
||||
uint8_t mcusr = MCUSR; // save the WDT (etc) flags
|
||||
MCUSR = 0; // must be zeroed before disabling the WDT
|
||||
MCUCR = 0x80 ; // Disable JTAG port that can interfere with POT3
|
||||
MCUCR = 0x80 ; // Must be done twice
|
||||
#elif defined(PCBSTD)
|
||||
uint8_t mcusr = MCUCSR;
|
||||
MCUCSR = 0;
|
||||
MCUCSR = 0x80 ; // Disable JTAG port that can interfere with POT3
|
||||
MCUCSR = 0x80 ; // Must be done twice
|
||||
#endif
|
||||
#if defined(PCBTARANIS)
|
||||
g_eeGeneral.contrast=30;
|
||||
|
||||
@@ -1789,4 +1789,9 @@ extern Clipboard clipboard;
|
||||
extern uint16_t s_anaFilt[NUMBER_ANALOG];
|
||||
#endif
|
||||
|
||||
#if defined(JITTER_MEASURE)
|
||||
extern JitterMeter<uint16_t> rawJitter[NUMBER_ANALOG];
|
||||
extern JitterMeter<uint16_t> avgJitter[NUMBER_ANALOG];
|
||||
#endif // defined(JITTER_MEASURE)
|
||||
|
||||
#endif
|
||||
|
||||
+222
-234
@@ -73,8 +73,8 @@ inline void DSM2_EnableTXD(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void set_timer3_capture( void ) ;
|
||||
void set_timer3_ppm( void ) ;
|
||||
void set_timer3_capture(void);
|
||||
void set_timer3_ppm(void);
|
||||
|
||||
void startPulses()
|
||||
{
|
||||
@@ -110,58 +110,62 @@ uint8_t *pulses2MHzWPtr = pulses2MHz;
|
||||
#define CTRL_REP_1CMD -3
|
||||
#define CTRL_REP_2CMD -6
|
||||
|
||||
#define SETUP_PULSES_DURATION 1000/*500us*/
|
||||
#define SETUP_PULSES_DURATION 1000 // 500us
|
||||
uint8_t g_ppmPulsePolarity = 0; // Needed for Bit-bang PPM.
|
||||
|
||||
// TIMER1_COMPA_vect used for PPM and DSM2=SERIAL
|
||||
uint8_t g_ppmPulsePolarity = 0;
|
||||
ISR(TIMER1_COMPA_vect) //2MHz pulse generation (BLOCKING ISR)
|
||||
// TIMER1_COMPA_vect used for PPM and DSM2=SERIAL.
|
||||
ISR(TIMER1_COMPA_vect) // 2MHz pulse generation (BLOCKING ISR).
|
||||
{
|
||||
uint8_t dt = TCNT1L; // record Timer1 latency for DEBUG stats display
|
||||
|
||||
// Call setupPulses only after REST pulse had been sent.
|
||||
// Must do this before toggle PORTB to keep timing accurate
|
||||
uint8_t dt = TCNT1L; // Record Timer1 latency for DEBUG stats display.
|
||||
|
||||
// Call setupPulses only after "rest" period has elapsed.
|
||||
// Must do this before toggle PORTB to keep timing accurate.
|
||||
if (IS_DSM2_SERIAL_PROTOCOL(s_current_protocol[0]) || *((uint16_t*)pulses2MHzRPtr) == 0) {
|
||||
if (!IS_DSM2_SERIAL_PROTOCOL(s_current_protocol[0])) {
|
||||
OCR1A = SETUP_PULSES_DURATION;
|
||||
#if defined(CPUM2560) // CPUM2560 hardware toggled PPM out.
|
||||
OCR1B = OCR1A;
|
||||
if (g_model.pulsePol) {
|
||||
TCCR1A = (TCCR1A | (1<<COM1B1)) & ~(1<<COM1B0); // Set idle level.
|
||||
}
|
||||
else {
|
||||
TCCR1A |= 3<<COM1B0;
|
||||
}
|
||||
TCCR1C = 1<<FOC1B; // Strobe FOC1B.
|
||||
TCCR1A = (TCCR1A | (1<<COM1B0)) & ~(1<<COM1B1); // Toggle OC1B on next match.
|
||||
#endif
|
||||
}
|
||||
setupPulses(); // does not sei() for setupPulsesPPM
|
||||
setupPulses(); // Does not sei() for setupPulsesPPM.
|
||||
heartbeat |= HEART_TIMER_PULSES;
|
||||
return;
|
||||
}
|
||||
|
||||
#if !defined(CPUM2560)
|
||||
// Original bitbang for PPM
|
||||
if (s_current_protocol[0] != PROTO_NONE) {
|
||||
#if !defined(CPUM2560)
|
||||
// Original Bit-bang for PPM.
|
||||
if (g_ppmPulsePolarity) {
|
||||
PORTB |= (1<<OUT_B_PPM); // GCC optimisation should result in a single SBI instruction
|
||||
PORTB |= (1<<OUT_B_PPM); // GCC optimisation should result in a single SBI instruction
|
||||
g_ppmPulsePolarity = 0;
|
||||
}
|
||||
else {
|
||||
PORTB &= ~(1<<OUT_B_PPM);
|
||||
g_ppmPulsePolarity = 1;
|
||||
}
|
||||
}
|
||||
#else // defined(CPUM2560)
|
||||
// CPUM2560 zero jitter hardware toggled PPM_out
|
||||
OCR1B = *((uint16_t*)pulses2MHzRPtr); // duplicate capture (Timer1 in CTC mode, so restricted to OCR1A for int vector)
|
||||
|
||||
// Toggle bit: Can't read PPM_OUT I/O pin when OC1B is connected (on the ATmega2560 -- can on ATmega64A!)
|
||||
// so need to use pusePol register to keep track of PPM_out polarity.
|
||||
if (s_current_protocol[0] != PROTO_NONE) {
|
||||
if (g_ppmPulsePolarity) {
|
||||
TCCR1A = (3<<COM1B0); // SET the state of PB6(OC1B)/PPM_out on next TCNT1==OCR1B
|
||||
g_ppmPulsePolarity = 0;
|
||||
// CPUM2560 hardware toggled PPM out.
|
||||
if (*(uint16_t*)(pulses2MHzRPtr + sizeof(uint16_t)) == 0) {
|
||||
// Look one step ahead to see if we are currently the "rest" period.
|
||||
OCR1B = 0xffff; // Prevent next compare match hence toggle.
|
||||
}
|
||||
else {
|
||||
TCCR1A = (2<<COM1B0); // CLEAR the state of PB6(OC1B)/PPM_out on next TCNT1==OCR1B
|
||||
g_ppmPulsePolarity = 1;
|
||||
OCR1B = *((uint16_t*) pulses2MHzRPtr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
OCR1A = *((uint16_t*) pulses2MHzRPtr); // Schedule next Timer1 interrupt vector (to this function).
|
||||
pulses2MHzRPtr += sizeof(uint16_t); // Non PPM protocols use uint8_t pulse buffer.
|
||||
|
||||
OCR1A = *((uint16_t*)pulses2MHzRPtr); // Schedule next Timer1 interrupt vector (to this function)
|
||||
pulses2MHzRPtr += sizeof(uint16_t); // non PPM protocols use uint8_t pulse buffer
|
||||
|
||||
if (dt > g_tmr1Latency_max) g_tmr1Latency_max = dt;
|
||||
if (dt < g_tmr1Latency_min) g_tmr1Latency_min = dt;
|
||||
}
|
||||
@@ -242,67 +246,61 @@ const pm_uint16_t CRCTable[] PROGMEM =
|
||||
0x7bc7,0x6a4e,0x58d5,0x495c,0x3de3,0x2c6a,0x1ef1,0x0f78
|
||||
};
|
||||
|
||||
uint8_t PcmByte ;
|
||||
uint8_t PcmBitCount ;
|
||||
uint16_t PcmCrc ;
|
||||
uint8_t PcmOnesCount ;
|
||||
uint8_t PcmByte;
|
||||
uint8_t PcmBitCount;
|
||||
uint16_t PcmCrc;
|
||||
uint8_t PcmOnesCount;
|
||||
|
||||
void crc( uint8_t data )
|
||||
void crc(uint8_t data)
|
||||
{
|
||||
PcmCrc=(PcmCrc<<8)^pgm_read_word(&CRCTable[((PcmCrc>>8)^data) & 0xFF]);
|
||||
PcmCrc = (PcmCrc<<8) ^ pgm_read_word(&CRCTable[((PcmCrc >> 8) ^ data) & 0xFF]);
|
||||
}
|
||||
|
||||
|
||||
void putPcmPart( uint8_t value )
|
||||
void putPcmPart(uint8_t value)
|
||||
{
|
||||
PcmByte >>= 2 ;
|
||||
PcmByte |= value ;
|
||||
if ( ++PcmBitCount >= 4 )
|
||||
{
|
||||
*pulses2MHzWPtr++ = PcmByte ;
|
||||
PcmBitCount = PcmByte = 0 ;
|
||||
}
|
||||
PcmByte >>= 2;
|
||||
PcmByte |= value;
|
||||
if (++PcmBitCount >= 4) {
|
||||
*pulses2MHzWPtr++ = PcmByte;
|
||||
PcmBitCount = PcmByte = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void putPcmFlush()
|
||||
{
|
||||
while ( PcmBitCount != 0 )
|
||||
{
|
||||
putPcmPart( 0 ) ; // Empty
|
||||
}
|
||||
*pulses2MHzWPtr = 0 ; // Mark end
|
||||
while (PcmBitCount != 0) {
|
||||
putPcmPart(0); // Empty
|
||||
}
|
||||
*pulses2MHzWPtr = 0; // Mark end
|
||||
}
|
||||
|
||||
void putPcmBit( uint8_t bit )
|
||||
void putPcmBit(uint8_t bit)
|
||||
{
|
||||
if ( bit )
|
||||
{
|
||||
PcmOnesCount += 1 ;
|
||||
putPcmPart( 0x80 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
PcmOnesCount = 0 ;
|
||||
putPcmPart( 0xC0 ) ;
|
||||
}
|
||||
if ( PcmOnesCount >= 5 )
|
||||
{
|
||||
putPcmBit( 0 ) ; // Stuff a 0 bit in
|
||||
}
|
||||
if (bit) {
|
||||
PcmOnesCount += 1;
|
||||
putPcmPart(0x80);
|
||||
}
|
||||
else {
|
||||
PcmOnesCount = 0;
|
||||
putPcmPart(0xC0);
|
||||
}
|
||||
if (PcmOnesCount >= 5) {
|
||||
putPcmBit(0); // Stuff a 0 bit in
|
||||
}
|
||||
}
|
||||
|
||||
void putPcmByte( uint8_t byte )
|
||||
void putPcmByte(uint8_t byte)
|
||||
{
|
||||
uint8_t i ;
|
||||
uint8_t i;
|
||||
|
||||
crc( byte ) ;
|
||||
crc(byte);
|
||||
|
||||
for (i=0; i<8; i++)
|
||||
{
|
||||
putPcmBit( byte & 0x80 ) ;
|
||||
byte <<= 1 ;
|
||||
}
|
||||
for (i=0; i<8; i++) {
|
||||
putPcmBit(byte & 0x80);
|
||||
byte <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -310,57 +308,57 @@ void putPcmHead()
|
||||
{
|
||||
// send 7E, do not CRC
|
||||
// 01111110
|
||||
putPcmPart( 0xC0 ) ;
|
||||
putPcmPart( 0x80 ) ;
|
||||
putPcmPart( 0x80 ) ;
|
||||
putPcmPart( 0x80 ) ;
|
||||
putPcmPart( 0x80 ) ;
|
||||
putPcmPart( 0x80 ) ;
|
||||
putPcmPart( 0x80 ) ;
|
||||
putPcmPart( 0xC0 ) ;
|
||||
putPcmPart(0xC0);
|
||||
putPcmPart(0x80);
|
||||
putPcmPart(0x80);
|
||||
putPcmPart(0x80);
|
||||
putPcmPart(0x80);
|
||||
putPcmPart(0x80);
|
||||
putPcmPart(0x80);
|
||||
putPcmPart(0xC0);
|
||||
}
|
||||
|
||||
uint16_t scaleForPXX( uint8_t i )
|
||||
uint16_t scaleForPXX(uint8_t i)
|
||||
{
|
||||
int16_t value = ( ( i < 16 ) ? channelOutputs[i] * 3 / 4 : 0 ) + 1024;
|
||||
int16_t value = ((i < 16) ? channelOutputs[i] * 3 / 4 : 0) + 1024;
|
||||
return limit<uint16_t>(1, value, 2046);
|
||||
}
|
||||
|
||||
void setupPulsesPXX()
|
||||
{
|
||||
uint16_t chan ;
|
||||
uint16_t chan_1 ;
|
||||
uint16_t chan;
|
||||
uint16_t chan_1;
|
||||
|
||||
pulses2MHzWPtr = pulses2MHz;
|
||||
pulses2MHzRPtr = pulses2MHz;
|
||||
pulses2MHzWPtr = pulses2MHz;
|
||||
pulses2MHzRPtr = pulses2MHz;
|
||||
|
||||
PcmCrc = 0 ;
|
||||
PcmBitCount = PcmByte = 0 ;
|
||||
PcmOnesCount = 0 ;
|
||||
putPcmHead() ;
|
||||
putPcmByte(g_model.header.modelId[0]);
|
||||
uint8_t flag1 = 0;
|
||||
if (moduleFlag[0] == MODULE_BIND)
|
||||
flag1 |= (g_eeGeneral.countryCode << 1) | PXX_SEND_BIND;
|
||||
else if (moduleFlag[0] == MODULE_RANGECHECK)
|
||||
flag1 |= PXX_SEND_RANGECHECK;
|
||||
putPcmByte(flag1) ; // First byte of flags
|
||||
putPcmByte( 0 ) ; // Second byte of flags
|
||||
for (uint8_t i=0; i<8; i+=2) { // First 8 channels only
|
||||
chan = scaleForPXX(i);
|
||||
chan_1 = scaleForPXX(i+1);
|
||||
putPcmByte( chan ) ; // Low byte of channel
|
||||
putPcmByte( ( ( chan >> 8 ) & 0x0F ) | ( chan_1 << 4) ) ; // 4 bits each from 2 channels
|
||||
putPcmByte( chan_1 >> 4 ) ; // High byte of channel
|
||||
}
|
||||
putPcmByte(0);
|
||||
chan = PcmCrc ; // get the crc
|
||||
putPcmByte( chan>>8 ) ; // Checksum lo
|
||||
putPcmByte( chan ) ; // Checksum hi
|
||||
putPcmHead( ) ;
|
||||
putPcmFlush() ;
|
||||
OCR1C += 40000 ; // 20mS on
|
||||
PORTB |= (1<<OUT_B_PPM);
|
||||
PcmCrc = 0;
|
||||
PcmBitCount = PcmByte = 0;
|
||||
PcmOnesCount = 0;
|
||||
putPcmHead();
|
||||
putPcmByte(g_model.header.modelId[0]);
|
||||
uint8_t flag1 = 0;
|
||||
if (moduleFlag[0] == MODULE_BIND)
|
||||
flag1 |= (g_eeGeneral.countryCode << 1) | PXX_SEND_BIND;
|
||||
else if (moduleFlag[0] == MODULE_RANGECHECK)
|
||||
flag1 |= PXX_SEND_RANGECHECK;
|
||||
putPcmByte(flag1); // First byte of flags
|
||||
putPcmByte(0); // Second byte of flags
|
||||
for (uint8_t i=0; i<8; i+=2) { // First 8 channels only
|
||||
chan = scaleForPXX(i);
|
||||
chan_1 = scaleForPXX(i+1);
|
||||
putPcmByte(chan); // Low byte of channel
|
||||
putPcmByte(((chan >> 8) & 0x0F) | (chan_1 << 4)); // 4 bits each from 2 channels
|
||||
putPcmByte(chan_1 >> 4); // High byte of channel
|
||||
}
|
||||
putPcmByte(0);
|
||||
chan = PcmCrc; // get the crc
|
||||
putPcmByte(chan>>8); // Checksum lo
|
||||
putPcmByte(chan); // Checksum hi
|
||||
putPcmHead();
|
||||
putPcmFlush();
|
||||
OCR1C += 40000; // 20mS on
|
||||
PORTB |= (1<<OUT_B_PPM);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -369,7 +367,7 @@ void setupPulsesPXX()
|
||||
// DSM2 protocol pulled from th9x - Thanks thus!!!
|
||||
|
||||
//http://www.rclineforum.de/forum/board49-zubeh-r-elektronik-usw/fernsteuerungen-sender-und-emp/neuer-9-kanal-sender-f-r-70-au/Beitrag_3897736#post3897736
|
||||
//(dsm2( LP4DSM aus den RTF ( Ready To Fly ) Sendern von Spektrum.
|
||||
//(dsm2(LP4DSM aus den RTF (Ready To Fly) Sendern von Spektrum.
|
||||
//http://www.rcgroups.com/forums/showpost.php?p=18554028&postcount=237
|
||||
// /home/thus/txt/flieger/PPMtoDSM.c
|
||||
/*
|
||||
@@ -493,30 +491,30 @@ inline void _send_1(uint8_t v)
|
||||
#define BITLEN_DSM2 (8*2) //125000 Baud
|
||||
void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1
|
||||
{
|
||||
bool lev = 0;
|
||||
uint8_t len = BITLEN_DSM2; //max val: 9*16 < 256
|
||||
for (uint8_t i=0; i<=8; i++) { //8Bits + Stop=1
|
||||
bool nlev = b & 1; //lsb first
|
||||
if (lev == nlev){
|
||||
len += BITLEN_DSM2;
|
||||
}
|
||||
else {
|
||||
#if defined(CPUM2560)
|
||||
// G: Compensate for main clock synchronisation -- to get accurate 8us bit length
|
||||
// NOTE: This has now been tested as NOT required on the stock board, with the ATmega64A chip.
|
||||
_send_1(nlev ? len-5 : len+3);
|
||||
#else
|
||||
_send_1(len-1);
|
||||
#endif
|
||||
len = BITLEN_DSM2;
|
||||
lev = nlev;
|
||||
}
|
||||
b = (b>>1) | 0x80; //shift in stop bit
|
||||
bool lev = 0;
|
||||
uint8_t len = BITLEN_DSM2; //max val: 9*16 < 256
|
||||
for (uint8_t i=0; i<=8; i++) { //8Bits + Stop=1
|
||||
bool nlev = b & 1; //lsb first
|
||||
if (lev == nlev){
|
||||
len += BITLEN_DSM2;
|
||||
}
|
||||
#if defined (CPUM2560)
|
||||
_send_1(len+BITLEN_DSM2+3); // 2 stop bits
|
||||
else {
|
||||
#if defined(CPUM2560)
|
||||
// G: Compensate for main clock synchronisation -- to get accurate 8us bit length
|
||||
// NOTE: This has now been tested as NOT required on the stock board, with the ATmega64A chip.
|
||||
_send_1(nlev ? len-5 : len+3);
|
||||
#else
|
||||
_send_1(len+BITLEN_DSM2-1); // 2 stop bits
|
||||
_send_1(len-1);
|
||||
#endif
|
||||
len = BITLEN_DSM2;
|
||||
lev = nlev;
|
||||
}
|
||||
b = (b>>1) | 0x80; //shift in stop bit
|
||||
}
|
||||
#if defined (CPUM2560)
|
||||
_send_1(len+BITLEN_DSM2+3); // 2 stop bits
|
||||
#else
|
||||
_send_1(len+BITLEN_DSM2-1); // 2 stop bits
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -580,9 +578,6 @@ void setupPulsesDSM2()
|
||||
|
||||
/****** END DSM2=PPM ********/
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(IRPROTOS)
|
||||
static void _send_u8(uint8_t u8)
|
||||
{
|
||||
@@ -595,7 +590,7 @@ static void _send_u8(uint8_t u8)
|
||||
: [p]"=z"(pulses2MHzWPtr)
|
||||
: "%[p]"(pulses2MHzWPtr)
|
||||
, [u]"r"(u8)
|
||||
);
|
||||
);
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -611,7 +606,7 @@ static void _send_u16(uint16_t u16)
|
||||
: [p]"=z"(pulses2MHzWPtr)
|
||||
: "%[p]"(pulses2MHzWPtr)
|
||||
, [t0]"r"(u16)
|
||||
);
|
||||
);
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -676,26 +671,31 @@ void picco_sendBn(uint8_t bits, uint8_t n)
|
||||
while (n--) picco_sendB1(bits & (1<<n));
|
||||
}
|
||||
|
||||
|
||||
#define BITS 10
|
||||
#define BITS2 (BITS-1)
|
||||
|
||||
NOINLINE uint8_t reduce7u(int16_t v, uint8_t sfr)
|
||||
{
|
||||
v += (1<<BITS2);
|
||||
if(v < 0) v=0;
|
||||
if(v >= (1<<BITS)) v=(1<<BITS)-1;
|
||||
return v>>sfr;
|
||||
if (v < 0) v=0;
|
||||
if (v >= (1<<BITS)) v=(1<<BITS)-1;
|
||||
return v >> sfr;
|
||||
}
|
||||
|
||||
NOINLINE int8_t reduce7s(int16_t v, uint8_t sfr, uint8_t sf2, int8_t ofs2)
|
||||
{
|
||||
v += (1<<BITS2)+sf2;
|
||||
if(v&(1<<BITS)) v = (1<<BITS)-1; //no overflow
|
||||
v += (1<<BITS2) + sf2;
|
||||
if (v & (1<<BITS)) {
|
||||
v = (1<<BITS)-1; // no overflow
|
||||
}
|
||||
int8_t i8 = (uint16_t)v>>sfr;
|
||||
if(i8<=0) i8=1;
|
||||
i8-=ofs2;
|
||||
if(i8>=ofs2) i8=ofs2-1;//no overflow
|
||||
if (i8 <= 0) {
|
||||
i8 = 1;
|
||||
}
|
||||
i8 -= ofs2;
|
||||
if (i8 >= ofs2) {
|
||||
i8 = ofs2-1; //no overflow
|
||||
}
|
||||
return i8;
|
||||
}
|
||||
|
||||
@@ -751,21 +751,22 @@ void setupPulses()
|
||||
uint8_t required_protocol = g_model.protocol;
|
||||
|
||||
#if defined(DEBUG) && !defined(VOICE)
|
||||
PORTH |= 0x80; // PORTH:7 LOW->HIGH signals start of setupPulses()
|
||||
PORTH |= 0x80; // PORTH:7 LOW->HIGH signals start of setupPulses()
|
||||
#endif
|
||||
|
||||
if (s_pulses_paused)
|
||||
if (s_pulses_paused) {
|
||||
required_protocol = PROTO_NONE;
|
||||
}
|
||||
|
||||
#if defined(CPUM2560) && defined(DSM2_PPM) && defined(TX_CADDY)
|
||||
// This should be here, executed on every loop, to ensure re-setting of the
|
||||
// TX moudle power control output register, in case of electrical glitch.
|
||||
// (Following advice of Atmel for MCU's used in industrial / mission cricital
|
||||
// applications.)
|
||||
if (IS_DSM2_PROTOCOL(required_protocol))
|
||||
PORTH &= ~0x80;
|
||||
else
|
||||
PORTH |= 0x80;
|
||||
if (IS_DSM2_PROTOCOL(required_protocol))
|
||||
PORTH &= ~0x80;
|
||||
else
|
||||
PORTH |= 0x80;
|
||||
#endif
|
||||
|
||||
if (s_current_protocol[0] != required_protocol) {
|
||||
@@ -786,14 +787,13 @@ void setupPulses()
|
||||
TIMSK1 &= ~(1<<OCIE1C); // COMPC1 off
|
||||
TIFR1 = 0x2F;
|
||||
#else
|
||||
TIMSK &= ~0x3C ; // All interrupts off
|
||||
ETIMSK &= ~(1<<OCIE1C) ; // COMPC1 off
|
||||
TIFR = 0x3C ; // Clear all pending interrupts
|
||||
ETIFR = 0x3F ; // Clear all pending interrupts
|
||||
TIMSK &= ~0x3C; // All interrupts off
|
||||
ETIMSK &= ~(1<<OCIE1C); // COMPC1 off
|
||||
TIFR = 0x3C; // Clear all pending interrupts
|
||||
ETIFR = 0x3F; // Clear all pending interrupts
|
||||
#endif
|
||||
|
||||
switch (required_protocol) {
|
||||
|
||||
#if defined(DSM2_PPM) // For DSM2=SERIAL, the default: case is executed, below
|
||||
case PROTO_DSM2_LP45:
|
||||
case PROTO_DSM2_DSM2:
|
||||
@@ -843,7 +843,7 @@ void setupPulses()
|
||||
TIMSK |= 0x10; // Enable COMPA
|
||||
TCCR1A = (0<<WGM10);
|
||||
#endif
|
||||
TCCR1B = (1 << WGM12) | (2<<CS10) ; // CTC OCRA, 16MHz / 8
|
||||
TCCR1B = (1 << WGM12) | (2<<CS10); // CTC OCRA, 16MHz / 8
|
||||
setupPulsesPPM(PROTO_PPM16);
|
||||
OCR3A = 50000;
|
||||
OCR3B = 5000;
|
||||
@@ -859,7 +859,7 @@ void setupPulses()
|
||||
OCR3B = 5000;
|
||||
set_timer3_ppm();
|
||||
PORTB &= ~(1<<OUT_B_PPM); // Hold PPM output low
|
||||
break ;
|
||||
break;
|
||||
|
||||
#if defined(DSM2_SERIAL) && defined(FRSKY)
|
||||
case PROTO_DSM2_LP45:
|
||||
@@ -891,7 +891,6 @@ void setupPulses()
|
||||
}
|
||||
|
||||
switch(required_protocol) {
|
||||
|
||||
#if defined(PXX)
|
||||
case PROTO_PXX:
|
||||
// schedule next Mixer calculations
|
||||
@@ -940,9 +939,8 @@ void setupPulses()
|
||||
}
|
||||
|
||||
#if defined(DEBUG) && !defined(VOICE)
|
||||
PORTH &= ~0x80; // PORTH:7 HIGH->LOW signals end of setupPulses()
|
||||
PORTH &= ~0x80; // PORTH:7 HIGH->LOW signals end of setupPulses()
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifndef SIMU
|
||||
@@ -951,13 +949,12 @@ void setupPulses()
|
||||
ISR(TIMER1_CAPT_vect) // 2MHz pulse generation
|
||||
{
|
||||
#if defined (CPUM2560)
|
||||
|
||||
/*** G9X V4 hardware toggled PPM_out avoids any chance of output timing jitter ***/
|
||||
|
||||
// OCR1B output pin (PPM_OUT) is pre-SET in setupPulses -- on every new
|
||||
// frame, for safety -- and then configured to toggle on each OCR1B compare match.
|
||||
// Thus, all we need do here is update the compare regisiter(s) ...
|
||||
uint8_t x ;
|
||||
uint8_t x;
|
||||
x = *pulses2MHzRPtr++; // Byte size
|
||||
ICR1 = x;
|
||||
OCR1B = (uint16_t)x; // Duplicate capture compare value for OCR1B, because Timer1 is in CTC mode
|
||||
@@ -965,44 +962,36 @@ ISR(TIMER1_CAPT_vect) // 2MHz pulse generation
|
||||
// pin on OCR1A. Oh well.)
|
||||
|
||||
#else // manual bit-bang mode
|
||||
|
||||
uint8_t x ;
|
||||
uint8_t x;
|
||||
PORTB ^= (1<<OUT_B_PPM); // Toggle PPM_OUT
|
||||
x = *pulses2MHzRPtr++; // Byte size
|
||||
ICR1 = x ;
|
||||
ICR1 = x;
|
||||
if (x > 200) PORTB |= (1<<OUT_B_PPM); // Make sure pulses are the correct way up.
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if defined(PXX)
|
||||
ISR(TIMER1_COMPB_vect) // PXX main interrupt
|
||||
{
|
||||
uint8_t x ;
|
||||
PORTB ^= (1<<OUT_B_PPM) ;
|
||||
x = *pulses2MHzRPtr; // Byte size
|
||||
if ( ( x & 1 ) == 0 )
|
||||
{
|
||||
OCR1B += 32 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
OCR1B += 16 ;
|
||||
}
|
||||
if ( (x >>= 1) == 0 )
|
||||
{
|
||||
if ( *(++pulses2MHzRPtr) == 0 )
|
||||
{
|
||||
OCR1B = OCR1C + 2000 ; // 1mS on from OCR1B
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*pulses2MHzRPtr = x;
|
||||
uint8_t x;
|
||||
PORTB ^= (1<<OUT_B_PPM);
|
||||
x = *pulses2MHzRPtr; // Byte size
|
||||
if ((x & 1) == 0) {
|
||||
OCR1B += 32;
|
||||
}
|
||||
else {
|
||||
OCR1B += 16;
|
||||
}
|
||||
if ((x >>= 1) == 0) {
|
||||
if (*(++pulses2MHzRPtr) == 0) {
|
||||
OCR1B = OCR1C + 2000; // 1mS on from OCR1B
|
||||
}
|
||||
}
|
||||
else {
|
||||
*pulses2MHzRPtr = x;
|
||||
}
|
||||
|
||||
heartbeat |= HEART_TIMER_PULSES;
|
||||
heartbeat |= HEART_TIMER_PULSES;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1013,7 +1002,7 @@ ISR(TIMER1_COMPC_vect) // DSM2_PPM or PXX end of frame
|
||||
#endif
|
||||
|
||||
#if defined(DSM2_PPM)
|
||||
ICR1 = 41536 ; // next frame starts in 22ms 41536 = 2*(22000 - 14*11*8)
|
||||
ICR1 = 41536; // next frame starts in 22ms 41536 = 2*(22000 - 14*11*8)
|
||||
if (OCR1C < 255) {
|
||||
OCR1C = 39000; // delay setup pulses by 19.5ms to reduce system latency
|
||||
}
|
||||
@@ -1024,7 +1013,6 @@ ISR(TIMER1_COMPC_vect) // DSM2_PPM or PXX end of frame
|
||||
}
|
||||
|
||||
heartbeat |= HEART_TIMER_PULSES;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(DSM2_PPM) && defined(PXX)
|
||||
@@ -1034,7 +1022,7 @@ ISR(TIMER1_COMPC_vect) // DSM2_PPM or PXX end of frame
|
||||
|
||||
#if defined(PXX)
|
||||
// must be PXX
|
||||
setupPulses() ;
|
||||
setupPulses();
|
||||
#endif
|
||||
|
||||
#if defined(DSM2_PPM) && defined(PXX)
|
||||
@@ -1050,38 +1038,38 @@ void set_timer3_capture()
|
||||
{
|
||||
#ifndef SIMU
|
||||
#if defined (CPUM2560) || defined(CPUM2561) // TODO TIMSK3 in #define!
|
||||
TIMSK3 &= ~( (1<<OCIE3A) | (1<<OCIE3B) | (1<<OCIE3C) ) ; // Stop compare interrupts
|
||||
TIMSK3 &= ~((1<<OCIE3A) | (1<<OCIE3B) | (1<<OCIE3C)); // Stop compare interrupts
|
||||
#else
|
||||
ETIMSK &= ~( (1<<OCIE3A) | (1<<OCIE3B) | (1<<OCIE3C) ) ; // Stop compare interrupts
|
||||
ETIMSK &= ~((1<<OCIE3A) | (1<<OCIE3B) | (1<<OCIE3C)); // Stop compare interrupts
|
||||
#endif
|
||||
// TODO G: This can't work with V3.2/4.x boards. Select and use a different pin
|
||||
// for secondary 8-ch PPM output (PORTH or Spare1 or Spare2 maybe?)
|
||||
DDRE &= ~0x80; PORTE |= 0x80 ; // Bit 7 input + pullup
|
||||
// TODO G: This can't work with V3.2/4.x boards. Select and use a different pin
|
||||
// for secondary 8-ch PPM output (PORTH or Spare1 or Spare2 maybe?)
|
||||
DDRE &= ~0x80; PORTE |= 0x80; // Bit 7 input + pullup
|
||||
|
||||
TCCR3B = 0 ; // Stop counter
|
||||
TCCR3A = 0;
|
||||
// Noise Canceller enabled, neg. edge, clock at 16MHz / 8 (2MHz) (Correct for PCB V4.x+ also)
|
||||
TCCR3B = (1<<ICNC3) | (0b010 << CS30);
|
||||
TCCR3B = 0; // Stop counter
|
||||
TCCR3A = 0;
|
||||
// Noise Canceller enabled, neg. edge, clock at 16MHz / 8 (2MHz) (Correct for PCB V4.x+ also)
|
||||
TCCR3B = (1<<ICNC3) | (0b010 << CS30);
|
||||
|
||||
RESUME_PPMIN_INTERRUPT();
|
||||
RESUME_PPMIN_INTERRUPT();
|
||||
#endif
|
||||
}
|
||||
|
||||
void set_timer3_ppm()
|
||||
{
|
||||
#ifndef SIMU
|
||||
PAUSE_PPMIN_INTERRUPT();
|
||||
PAUSE_PPMIN_INTERRUPT();
|
||||
|
||||
DDRE |= 0x80; // Bit 7 output
|
||||
DDRE |= 0x80; // Bit 7 output
|
||||
|
||||
TCCR3B = 0 ; // Stop counter
|
||||
TCCR3A = (0<<WGM10);
|
||||
TCCR3B = (1 << WGM12) | (2<<CS10); // CTC OCR1A, 16MHz / 8
|
||||
TCCR3B = 0; // Stop counter
|
||||
TCCR3A = (0<<WGM10);
|
||||
TCCR3B = (1 << WGM12) | (2<<CS10); // CTC OCR1A, 16MHz / 8
|
||||
|
||||
#if defined (CPUM2560) || defined(CPUM2561)
|
||||
TIMSK3 |= ( (1<<OCIE3A) | (1<<OCIE3B) ); // enable immediately before mainloop
|
||||
TIMSK3 |= ((1<<OCIE3A) | (1<<OCIE3B)); // enable immediately before mainloop
|
||||
#else
|
||||
ETIMSK |= ( (1<<OCIE3A) | (1<<OCIE3B) ); // enable immediately before mainloop
|
||||
ETIMSK |= ((1<<OCIE3A) | (1<<OCIE3B)); // enable immediately before mainloop
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
@@ -1092,39 +1080,39 @@ void set_timer3_ppm()
|
||||
// and PPMSIM modes
|
||||
ISR(TIMER3_COMPA_vect) //2MHz pulse generation
|
||||
{
|
||||
static uint8_t pulsePol;
|
||||
static uint16_t *pulse2MHzPPM16RPtr = (uint16_t*) &pulses2MHz[PULSES_SIZE/2];
|
||||
static uint8_t pulsePol;
|
||||
static uint16_t * pulse2MHzPPM16RPtr = (uint16_t*) &pulses2MHz[PULSES_SIZE/2];
|
||||
|
||||
if (pulsePol) {
|
||||
PORTE |= 0x80 ; // (1<<OUT_B_PPM);
|
||||
pulsePol = 0;
|
||||
}
|
||||
else {
|
||||
PORTE &= ~0x80; // (1<<OUT_B_PPM);
|
||||
pulsePol = 1;
|
||||
}
|
||||
if (pulsePol) {
|
||||
PORTE |= 0x80; // (1<<OUT_B_PPM);
|
||||
pulsePol = 0;
|
||||
}
|
||||
else {
|
||||
PORTE &= ~0x80; // (1<<OUT_B_PPM);
|
||||
pulsePol = 1;
|
||||
}
|
||||
|
||||
OCR3A = *pulse2MHzPPM16RPtr++;
|
||||
OCR3B = B3_comp_value ;
|
||||
OCR3A = *pulse2MHzPPM16RPtr++;
|
||||
OCR3B = B3_comp_value;
|
||||
|
||||
if (*pulse2MHzPPM16RPtr == 0) {
|
||||
pulse2MHzPPM16RPtr = (uint16_t*) &pulses2MHz[PULSES_SIZE/2];
|
||||
pulsePol = g_model.pulsePol;
|
||||
}
|
||||
if (*pulse2MHzPPM16RPtr == 0) {
|
||||
pulse2MHzPPM16RPtr = (uint16_t*) &pulses2MHz[PULSES_SIZE/2];
|
||||
pulsePol = g_model.pulsePol;
|
||||
}
|
||||
|
||||
heartbeat |= HEART_TIMER_PULSES;
|
||||
heartbeat |= HEART_TIMER_PULSES;
|
||||
}
|
||||
|
||||
ISR(TIMER3_COMPB_vect) //2MHz pulse generation
|
||||
{
|
||||
sei() ;
|
||||
sei();
|
||||
if (s_current_protocol[0] != g_model.protocol) {
|
||||
if (s_current_protocol[0] == PROTO_PPMSIM) {
|
||||
setupPulses();
|
||||
}
|
||||
}
|
||||
else {
|
||||
setupPulsesPPM(g_model.protocol) ;
|
||||
setupPulsesPPM(g_model.protocol);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,12 @@ bool getLogicalSwitch(uint8_t idx)
|
||||
#endif
|
||||
|
||||
if (ls->func == LS_FUNC_NONE || (s && !getSwitch(s))) {
|
||||
#if defined(CPUARM)
|
||||
if (ls->func != LS_FUNC_STICKY && ls->func != LS_FUNC_EDGE ) {
|
||||
#else
|
||||
if (ls->func != LS_FUNC_STICKY) {
|
||||
#endif
|
||||
// AND switch must not affect STICKY and EDGE processing
|
||||
LS_LAST_VALUE(mixerCurrentFlightMode, idx) = CS_LAST_VALUE_INIT;
|
||||
}
|
||||
result = false;
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
#define PIN_PORTC 0x0200
|
||||
|
||||
// Sample time should exceed 1uS
|
||||
#define SAMPTIME 2 // sample time = 28 cycles
|
||||
#define SAMPTIME 2 // sample time = 28 cycles
|
||||
#define SAMPTIME_LONG 3 // sample time = 56 cycles
|
||||
|
||||
#if defined(REV9E)
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,1,-1,-1, -1,-1,-1,1, -1,1,1,1, -1};
|
||||
@@ -112,8 +113,8 @@ void adcInit()
|
||||
ADC3->SQR1 = (NUMBER_ANALOG_ADC3-1) << 20 ; // NUMBER_ANALOG Channels
|
||||
ADC3->SQR2 = 0;
|
||||
ADC3->SQR3 = (ADC_CHANNEL_POT1<<0) + (ADC_CHANNEL_SLIDER1<<5) + (ADC_CHANNEL_SLIDER2<<10) ; // conversions 1 to 3
|
||||
ADC3->SMPR1 = SAMPTIME + (SAMPTIME<<3) + (SAMPTIME<<6);
|
||||
ADC3->SMPR2 = 0;
|
||||
ADC3->SMPR1 = 0;
|
||||
ADC3->SMPR2 = (SAMPTIME_LONG<<(3*ADC_CHANNEL_POT1)) + (SAMPTIME_LONG<<(3*ADC_CHANNEL_SLIDER1)) + (SAMPTIME_LONG<<(3*ADC_CHANNEL_SLIDER2));
|
||||
|
||||
// Enable the DMA channel here, DMA2 stream 1, channel 2
|
||||
DMA2_Stream1->CR = DMA_SxCR_PL | DMA_SxCR_CHSEL_1 | DMA_SxCR_MSIZE_0 | DMA_SxCR_PSIZE_0 | DMA_SxCR_MINC;
|
||||
|
||||
@@ -47,7 +47,7 @@ void bluetoothInit(uint32_t baudrate)
|
||||
GPIO_InitStructure.GPIO_Pin = BT_GPIO_PIN_BRTS;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(BT_GPIO_BRTS, &GPIO_InitStructure);
|
||||
GPIO_SetBits(BT_GPIO_BRTS, BT_GPIO_PIN_BRTS);
|
||||
|
||||
@@ -241,11 +241,19 @@ void usbJoystickUpdate(void)
|
||||
static uint8_t HID_Buffer[HID_IN_PACKET];
|
||||
|
||||
//buttons
|
||||
HID_Buffer[0] = 0; //buttons
|
||||
HID_Buffer[0] = 0;
|
||||
HID_Buffer[1] = 0;
|
||||
HID_Buffer[2] = 0;
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
if ( channelOutputs[i+8] > 0 ) {
|
||||
HID_Buffer[0] |= (1 << i);
|
||||
}
|
||||
if ( channelOutputs[i+16] > 0 ) {
|
||||
HID_Buffer[1] |= (1 << i);
|
||||
}
|
||||
if ( channelOutputs[i+24] > 0 ) {
|
||||
HID_Buffer[2] |= (1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
//analog values
|
||||
@@ -254,7 +262,7 @@ void usbJoystickUpdate(void)
|
||||
int16_t value = channelOutputs[i] / 8;
|
||||
if ( value > 127 ) value = 127;
|
||||
else if ( value < -127 ) value = -127;
|
||||
HID_Buffer[i+1] = static_cast<int8_t>(value);
|
||||
HID_Buffer[i+3] = static_cast<int8_t>(value);
|
||||
}
|
||||
|
||||
USBD_HID_SendReport (&USB_OTG_dev, HID_Buffer, HID_IN_PACKET );
|
||||
|
||||
@@ -55,7 +55,7 @@ void hapticInit(void)
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = HAPTIC_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(HAPTIC_GPIO, &GPIO_InitStructure);
|
||||
@@ -80,7 +80,7 @@ void hapticInit(void)
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = HAPTIC_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(HAPTIC_GPIO, &GPIO_InitStructure);
|
||||
|
||||
@@ -9,7 +9,7 @@ void i2cInit()
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = I2C_GPIO_PIN_WP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
@@ -30,7 +30,7 @@ void i2cInit()
|
||||
GPIO_PinAFConfig(I2C_GPIO, I2C_GPIO_PinSource_SDA, I2C_GPIO_AF);
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = I2C_GPIO_PIN_SCL | I2C_GPIO_PIN_SDA;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
|
||||
@@ -276,7 +276,7 @@ void keysInit()
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ void backlightInit()
|
||||
#if defined(REV9E)
|
||||
GPIO_InitStructure.GPIO_Pin = BACKLIGHT_GPIO_PIN_1|BACKLIGHT_GPIO_PIN_2;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(BACKLIGHT_GPIO, &GPIO_InitStructure);
|
||||
@@ -275,7 +275,7 @@ void backlightInit()
|
||||
#elif defined(REVPLUS)
|
||||
GPIO_InitStructure.GPIO_Pin = BACKLIGHT_GPIO_PIN_1|BACKLIGHT_GPIO_PIN_2;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(BACKLIGHT_GPIO, &GPIO_InitStructure);
|
||||
@@ -293,7 +293,7 @@ void backlightInit()
|
||||
#else
|
||||
GPIO_InitStructure.GPIO_Pin = BACKLIGHT_GPIO_PIN_1;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(BACKLIGHT_GPIO, &GPIO_InitStructure);
|
||||
@@ -318,7 +318,7 @@ static void LCD_Hardware_Init()
|
||||
GPIO_InitStructure.GPIO_Pin = LCD_GPIO_PIN_MOSI | LCD_GPIO_PIN_CLK | LCD_GPIO_PIN_A0;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(LCD_GPIO_SPI, &GPIO_InitStructure);
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ static void intmoduleNoneStart()
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(INTMODULE_GPIO, &GPIO_InitStructure);
|
||||
@@ -212,7 +212,7 @@ static void extmoduleNoneStart()
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(EXTMODULE_GPIO, &GPIO_InitStructure);
|
||||
@@ -248,7 +248,7 @@ static void extmoduleCrossfireStart()
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(EXTMODULE_GPIO, &GPIO_InitStructure);
|
||||
@@ -293,7 +293,7 @@ static void intmodulePxxStart()
|
||||
GPIO_PinAFConfig(INTMODULE_GPIO, INTMODULE_GPIO_PinSource, INTMODULE_GPIO_AF);
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(INTMODULE_GPIO, &GPIO_InitStructure);
|
||||
@@ -439,7 +439,7 @@ void extmodulePxxStart()
|
||||
GPIO_PinAFConfig(EXTMODULE_GPIO, EXTMODULE_GPIO_PinSource, EXTMODULE_GPIO_AF);
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(EXTMODULE_GPIO, &GPIO_InitStructure);
|
||||
@@ -499,7 +499,7 @@ static void extmoduleDsm2Start()
|
||||
GPIO_PinAFConfig(EXTMODULE_GPIO, EXTMODULE_GPIO_PinSource, EXTMODULE_GPIO_AF);
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(EXTMODULE_GPIO, &GPIO_InitStructure);
|
||||
|
||||
@@ -45,7 +45,7 @@ void pwrInit()
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_GPIO_PIN_ON;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
||||
|
||||
@@ -53,7 +53,7 @@ void uart3Setup(unsigned int baudrate)
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_Init(SERIAL_GPIO, &GPIO_InitStructure);
|
||||
|
||||
USART_InitStructure.USART_BaudRate = baudrate;
|
||||
|
||||
@@ -55,7 +55,7 @@ void telemetryPortInit(uint32_t baudrate)
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_Init(TELEMETRY_GPIO, &GPIO_InitStructure);
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = TELEMETRY_GPIO_PIN_DIR;
|
||||
|
||||
@@ -240,7 +240,7 @@ void topLcdInit()
|
||||
GPIO_InitStructure.GPIO_Pin = TOPLCD_GPIO_PIN_DATA | TOPLCD_GPIO_PIN_WR |TOPLCD_GPIO_PIN_BL|TOPLCD_GPIO_PIN_CS1|TOPLCD_GPIO_PIN_CS2;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(TOPLCD_GPIO, &GPIO_InitStructure);
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ void init_sbus_on_heartbeat_capture()
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||||
|
||||
USART_InitStructure.USART_BaudRate = 100000;
|
||||
|
||||
@@ -49,7 +49,7 @@ void USB_OTG_BSP_Init(USB_OTG_CORE_HANDLE *pdev)
|
||||
|
||||
/* Configure DM and DP Pins */
|
||||
GPIO_InitStructure.GPIO_Pin = USB_GPIO_PIN_DM | USB_GPIO_PIN_DP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
@@ -60,7 +60,7 @@ void USB_OTG_BSP_Init(USB_OTG_CORE_HANDLE *pdev)
|
||||
|
||||
/* Configure VBUS Pin */
|
||||
GPIO_InitStructure.GPIO_Pin = USB_GPIO_PIN_VBUS;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#define HID_IN_EP 0x81
|
||||
#define HID_OUT_EP 0x01
|
||||
|
||||
#define HID_IN_PACKET 9
|
||||
#define HID_IN_PACKET 11
|
||||
#define HID_OUT_PACKET 9
|
||||
|
||||
#define CDC_IN_EP 0x81 /* EP1 for data IN */
|
||||
|
||||
@@ -118,13 +118,15 @@ static uint8_t USBD_HID_DataIn (void *pdev, uint8_t epnum);
|
||||
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
|
||||
/*
|
||||
This USB HID endpoint report description defines a device with:
|
||||
* 8 digital buttons
|
||||
* 24 digital buttons
|
||||
* 8 analog axes with 8bit resolution
|
||||
|
||||
Repot packet described as C struct is:
|
||||
|
||||
struct {
|
||||
uint8_t buttons; //bit 0 - button 1, bit 1 - button 2, ..., mapped to channels 9-16, on if channel > 0
|
||||
uint8_t buttons1; //bit 0 - button 1, bit 1 - button 2, ..., mapped to channels 9-16, on if channel > 0
|
||||
uint8_t buttons2; // mapped to channels 17-24, on if channel > 0
|
||||
uint8_t buttons3; // mapped to channels 25-32, on if channel > 0
|
||||
uint8_t X; //analog value, mapped to channel 1
|
||||
uint8_t Y; //analog value, mapped to channel 2
|
||||
uint8_t Z; //analog value, mapped to channel 3
|
||||
@@ -143,10 +145,10 @@ __ALIGN_BEGIN static const uint8_t HID_JOYSTICK_ReportDesc[] __ALIGN_END =
|
||||
0xa1, 0x00, // COLLECTION (Physical)
|
||||
0x05, 0x09, // USAGE_PAGE (Button)
|
||||
0x19, 0x01, // USAGE_MINIMUM (Button 1)
|
||||
0x29, 0x08, // USAGE_MAXIMUM (Button 8)
|
||||
0x29, 0x18, // USAGE_MAXIMUM (Button 24)
|
||||
0x15, 0x00, // LOGICAL_MINIMUM (0)
|
||||
0x25, 0x01, // LOGICAL_MAXIMUM (1)
|
||||
0x95, 0x08, // REPORT_COUNT (8)
|
||||
0x95, 0x18, // REPORT_COUNT (24)
|
||||
0x75, 0x01, // REPORT_SIZE (1)
|
||||
0x81, 0x02, // INPUT (Data,Var,Abs)
|
||||
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
||||
|
||||
@@ -84,12 +84,12 @@ const FrSkySportSensor sportSensors[] = {
|
||||
{ GPS_LONG_LATI_FIRST_ID, GPS_LONG_LATI_LAST_ID, 0, ZSTR_GPS, UNIT_GPS, 0 },
|
||||
{ FUEL_QTY_FIRST_ID, FUEL_QTY_LAST_ID, 0, ZSTR_FUEL, UNIT_MILLILITERS, 2 },
|
||||
{ GPS_COURS_FIRST_ID, GPS_COURS_LAST_ID, 0, ZSTR_HDG, UNIT_DEGREE, 2 },
|
||||
{ POWERBOX_BATT1_FIRST_ID, POWERBOX_BATT1_LAST_ID, 0, ZSTR_PBOX1, UNIT_VOLTS, 3 },
|
||||
{ POWERBOX_BATT2_FIRST_ID, POWERBOX_BATT2_LAST_ID, 0, ZSTR_PBOX2, UNIT_VOLTS, 3 },
|
||||
{ POWERBOX_BATT1_FIRST_ID, POWERBOX_BATT1_LAST_ID, 1, ZSTR_PBOX1, UNIT_AMPS, 2 },
|
||||
{ POWERBOX_BATT2_FIRST_ID, POWERBOX_BATT2_LAST_ID, 1, ZSTR_PBOX2, UNIT_AMPS, 2 },
|
||||
{ POWERBOX_CNSP_FIRST_ID, POWERBOX_CNSP_LAST_ID, 0, ZSTR_PBOX1, UNIT_MAH, 0 },
|
||||
{ POWERBOX_CNSP_FIRST_ID, POWERBOX_CNSP_LAST_ID, 1, ZSTR_PBOX2, UNIT_MAH, 0 },
|
||||
{ POWERBOX_BATT1_FIRST_ID, POWERBOX_BATT1_LAST_ID, 0, ZSTR_BATT1_VOLTAGE, UNIT_VOLTS, 3 },
|
||||
{ POWERBOX_BATT2_FIRST_ID, POWERBOX_BATT2_LAST_ID, 0, ZSTR_BATT2_VOLTAGE, UNIT_VOLTS, 3 },
|
||||
{ POWERBOX_BATT1_FIRST_ID, POWERBOX_BATT1_LAST_ID, 1, ZSTR_BATT1_CURRENT, UNIT_AMPS, 2 },
|
||||
{ POWERBOX_BATT2_FIRST_ID, POWERBOX_BATT2_LAST_ID, 1, ZSTR_BATT2_CURRENT, UNIT_AMPS, 2 },
|
||||
{ POWERBOX_CNSP_FIRST_ID, POWERBOX_CNSP_LAST_ID, 0, ZSTR_BATT1_CONSUMPTION, UNIT_MAH, 0 },
|
||||
{ POWERBOX_CNSP_FIRST_ID, POWERBOX_CNSP_LAST_ID, 1, ZSTR_BATT2_CONSUMPTION, UNIT_MAH, 0 },
|
||||
{ POWERBOX_STATE_FIRST_ID, POWERBOX_STATE_LAST_ID, 0, ZSTR_RX1_FAILSAFE, UNIT_RAW, 0 },
|
||||
{ POWERBOX_STATE_FIRST_ID, POWERBOX_STATE_LAST_ID, 1, ZSTR_RX1_LOSTFRAME, UNIT_RAW, 0 },
|
||||
{ POWERBOX_STATE_FIRST_ID, POWERBOX_STATE_LAST_ID, 2, ZSTR_RX2_FAILSAFE, UNIT_RAW, 0 },
|
||||
@@ -234,7 +234,10 @@ void processSportPacket(uint8_t * packet)
|
||||
if (id == RSSI_ID) {
|
||||
frskyStreaming = FRSKY_TIMEOUT10ms; // reset counter only if valid frsky packets are being detected
|
||||
data = SPORT_DATA_U8(packet);
|
||||
frskyData.rssi.set(data);
|
||||
if (data == 0)
|
||||
frskyData.rssi.reset();
|
||||
else
|
||||
frskyData.rssi.set(data);
|
||||
}
|
||||
#if defined(PCBTARANIS) && defined(REVPLUS)
|
||||
else if (id == XJT_VERSION_ID) {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 447 B |
Binary file not shown.
|
After Width: | Height: | Size: 469 B |
@@ -210,6 +210,16 @@ TEST(Lcd, vline_x_lt0)
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
TEST(Lcd, SmlsizeDecimalPoint)
|
||||
{
|
||||
lcd_clear();
|
||||
lcd_outdezNAtt(0, 1, 105, PREC1|SMLSIZE|LEFT);
|
||||
lcd_outdezNAtt(0, LCD_H-7, 105, PREC1|SMLSIZE|LEFT|INVERS);
|
||||
lcd_outdezNAtt(LCD_W, 1, 105, PREC2|SMLSIZE);
|
||||
lcd_outdezNAtt(LCD_W, LCD_H-7, 105, PREC2|SMLSIZE|INVERS);
|
||||
EXPECT_TRUE(checkScreenshot("SmlsizeDecimalPoint"));
|
||||
}
|
||||
|
||||
TEST(Lcd, Smlsize)
|
||||
{
|
||||
lcd_clear();
|
||||
|
||||
+565
-381
@@ -1,381 +1,565 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gtests.h"
|
||||
|
||||
#if !defined(PCBTARANIS)
|
||||
TEST(getSwitch, undefCSW)
|
||||
{
|
||||
MODEL_RESET();
|
||||
EXPECT_EQ(getSwitch(NUM_PSWITCH), false);
|
||||
EXPECT_EQ(getSwitch(-NUM_PSWITCH), true); // no good answer there!
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CPUARM)
|
||||
TEST(getSwitch, circularCSW)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
g_model.logicalSw[0] = { SWSRC_SW1, SWSRC_SW1, LS_FUNC_OR };
|
||||
g_model.logicalSw[1] = { SWSRC_SW1, SWSRC_SW1, LS_FUNC_AND };
|
||||
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(-SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
EXPECT_EQ(getSwitch(-SWSRC_SW2), true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define SET_LOGICAL_SWITCH(index, _func, _v1, _v2) ( \
|
||||
g_model.logicalSw[index].func = _func, \
|
||||
g_model.logicalSw[index].v1 = _v1, \
|
||||
g_model.logicalSw[index].v2 = _v2 )
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
TEST(getSwitch, OldTypeStickyCSW)
|
||||
{
|
||||
RADIO_RESET();
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
|
||||
SET_LOGICAL_SWITCH(0, LS_FUNC_AND, SWSRC_SA0, SWSRC_NONE);
|
||||
SET_LOGICAL_SWITCH(1, LS_FUNC_OR, SWSRC_SW1, SWSRC_SW2);
|
||||
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
// now trigger SA0, both switches should become true
|
||||
simuSetSwitch(0, -1);
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
// now release SA0 and SW2 should stay true
|
||||
simuSetSwitch(0, 0);
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
// now reset logical switches
|
||||
logicalSwitchesReset();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
}
|
||||
#endif // #if defined(PCBTARANIS)
|
||||
|
||||
TEST(getSwitch, nullSW)
|
||||
{
|
||||
MODEL_RESET();
|
||||
EXPECT_EQ(getSwitch(0), true);
|
||||
}
|
||||
|
||||
#if 0
|
||||
TEST(getSwitch, DISABLED_VfasWithDelay)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
memclear(&frskyData, sizeof(frskyData));
|
||||
/*
|
||||
Test for logical switch:
|
||||
L1 Vfas < 9.6 Delay (0.5s)
|
||||
|
||||
(gdb) print Open9xX9D::g_model.logicalSw[0]
|
||||
$3 = {v1 = -39 '\331', v2 = 96, v3 = 0, func = 4 '\004', delay = 5 '\005', duration = 0 '\000', andsw = 0 '\000'}
|
||||
*/
|
||||
g_model.logicalSw[0] = {int8_t(MIXSRC_FIRST_TELEM+TELEM_VFAS-1), 96, 0, 4, 5, 0, 0};
|
||||
frskyData.hub.vfas = 150; //unit is 100mV
|
||||
|
||||
//telemetry streaming is FALSE, so L1 should be FALSE no matter what value Vfas has
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//every logicalSwitchesTimerTick() represents 100ms
|
||||
//so now after 5 ticks we should still have a FALSE value
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now turn on telemetry
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), false);
|
||||
TELEMETRY_RSSI() = 50;
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), true);
|
||||
|
||||
//vfas is 15.0V so L1 should still be FALSE
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now reduce vfas to 9.5V and L1 should become TRUE after 0.5s
|
||||
frskyData.hub.vfas = 95;
|
||||
evalLogicalSwitches();
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
|
||||
//now stop telemetry, L1 should become FALSE immediatelly
|
||||
TELEMETRY_RSSI() = 0;
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), false);
|
||||
evalLogicalSwitches();
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
}
|
||||
|
||||
TEST(getSwitch, DISABLED_RssiWithDuration)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
memclear(&frskyData, sizeof(frskyData));
|
||||
/*
|
||||
Test for logical switch:
|
||||
L1 RSSI > 10 Duration (0.5s)
|
||||
|
||||
(gdb) print Open9xX9D::g_model.logicalSw[0]
|
||||
$1 = {v1 = -55 '\311', v2 = 10, v3 = 0, func = 3 '\003', delay = 0 '\000', duration = 5 '\005', andsw = 0 '\000'}
|
||||
*/
|
||||
|
||||
g_model.logicalSw[0] = {int8_t(MIXSRC_FIRST_TELEM+TELEM_RSSI_RX-1), 10, 0, 3, 0, 5, 0};
|
||||
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), false);
|
||||
|
||||
evalLogicalSwitches();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now set RSSI to 5, L1 should still be FALSE
|
||||
TELEMETRY_RSSI() = 5;
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now set RSSI to 100, L1 should become TRUE for 0.5s
|
||||
TELEMETRY_RSSI() = 100;
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//repeat telemetry streaming OFF and ON to test for duration processing
|
||||
TELEMETRY_RSSI() = 0;
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now set RSSI to 100, L1 should become TRUE for 0.5s
|
||||
TELEMETRY_RSSI() = 100;
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
}
|
||||
#endif // #if defined(PCBTARANIS) && defined(FRSKY)
|
||||
|
||||
|
||||
#if !defined(CPUARM)
|
||||
TEST(getSwitch, recursiveSW)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
|
||||
g_model.logicalSw[0] = { SWSRC_RUD, -SWSRC_SW2, LS_FUNC_OR };
|
||||
g_model.logicalSw[1] = { SWSRC_ELE, -SWSRC_SW1, LS_FUNC_OR };
|
||||
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
LS_RECURSIVE_EVALUATION_RESET();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
simuSetSwitch(1, 1);
|
||||
LS_RECURSIVE_EVALUATION_RESET();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
LS_RECURSIVE_EVALUATION_RESET();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
}
|
||||
#endif // #if !defined(CPUARM)
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
TEST(getSwitch, inputWithTrim)
|
||||
{
|
||||
MODEL_RESET();
|
||||
modelDefault(0);
|
||||
MIXER_RESET();
|
||||
|
||||
g_model.logicalSw[0] = { LS_FUNC_VPOS, MIXSRC_FIRST_INPUT, 0, 0 };
|
||||
|
||||
doMixerCalculations();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
setTrimValue(0, 0, 32);
|
||||
doMixerCalculations();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
TEST(evalLogicalSwitches, playFile)
|
||||
{
|
||||
SYSTEM_RESET();
|
||||
MODEL_RESET();
|
||||
modelDefault(0);
|
||||
MIXER_RESET();
|
||||
|
||||
extern uint64_t sdAvailableLogicalSwitchAudioFiles;
|
||||
sdAvailableLogicalSwitchAudioFiles = 0xffffffffffffffff;
|
||||
char filename[AUDIO_FILENAME_MAXLEN+1];
|
||||
isAudioFileReferenced((LOGICAL_SWITCH_AUDIO_CATEGORY << 24) + (0 << 16) + AUDIO_EVENT_OFF, filename);
|
||||
EXPECT_EQ(strcmp(filename, "/SOUNDS/en/MODEL01/L1-off.wav"), 0);
|
||||
isAudioFileReferenced((LOGICAL_SWITCH_AUDIO_CATEGORY << 24) + (0 << 16) + AUDIO_EVENT_ON, filename);
|
||||
EXPECT_EQ(strcmp(filename, "/SOUNDS/en/MODEL01/L1-on.wav"), 0);
|
||||
isAudioFileReferenced((LOGICAL_SWITCH_AUDIO_CATEGORY << 24) + (31 << 16) + AUDIO_EVENT_OFF, filename);
|
||||
EXPECT_EQ(strcmp(filename, "/SOUNDS/en/MODEL01/L32-off.wav"), 0);
|
||||
isAudioFileReferenced((LOGICAL_SWITCH_AUDIO_CATEGORY << 24) + (31 << 16) + AUDIO_EVENT_ON, filename);
|
||||
EXPECT_EQ(strcmp(filename, "/SOUNDS/en/MODEL01/L32-on.wav"), 0);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gtests.h"
|
||||
|
||||
#if !defined(PCBTARANIS)
|
||||
TEST(getSwitch, undefCSW)
|
||||
{
|
||||
MODEL_RESET();
|
||||
EXPECT_EQ(getSwitch(NUM_PSWITCH), false);
|
||||
EXPECT_EQ(getSwitch(-NUM_PSWITCH), true); // no good answer there!
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CPUARM)
|
||||
TEST(getSwitch, circularCSW)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
g_model.logicalSw[0] = { SWSRC_SW1, SWSRC_SW1, LS_FUNC_OR };
|
||||
g_model.logicalSw[1] = { SWSRC_SW1, SWSRC_SW1, LS_FUNC_AND };
|
||||
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(-SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
EXPECT_EQ(getSwitch(-SWSRC_SW2), true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
|
||||
void setLogicalSwitch(int index, uint16_t _func, int16_t _v1, int16_t _v2, int16_t _v3 = 0, uint8_t _delay = 0, uint8_t _duration = 0, int8_t _andsw = 0)
|
||||
{
|
||||
g_model.logicalSw[index].func = _func;
|
||||
g_model.logicalSw[index].v1 = _v1;
|
||||
g_model.logicalSw[index].v2 = _v2;
|
||||
g_model.logicalSw[index].v3 = _v3;
|
||||
g_model.logicalSw[index].delay = _delay;
|
||||
g_model.logicalSw[index].duration = _duration;
|
||||
g_model.logicalSw[index].andsw = _andsw;
|
||||
}
|
||||
|
||||
TEST(getSwitch, OldTypeStickyCSW)
|
||||
{
|
||||
RADIO_RESET();
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
|
||||
setLogicalSwitch(0, LS_FUNC_AND, SWSRC_SA0, SWSRC_NONE);
|
||||
setLogicalSwitch(1, LS_FUNC_OR, SWSRC_SW1, SWSRC_SW2);
|
||||
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
// now trigger SA0, both switches should become true
|
||||
simuSetSwitch(0, -1);
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
// now release SA0 and SW2 should stay true
|
||||
simuSetSwitch(0, 0);
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
// now reset logical switches
|
||||
logicalSwitchesReset();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
}
|
||||
#endif // #if defined(PCBTARANIS)
|
||||
|
||||
TEST(getSwitch, nullSW)
|
||||
{
|
||||
MODEL_RESET();
|
||||
EXPECT_EQ(getSwitch(0), true);
|
||||
}
|
||||
|
||||
#if 0
|
||||
TEST(getSwitch, DISABLED_VfasWithDelay)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
memclear(&frskyData, sizeof(frskyData));
|
||||
/*
|
||||
Test for logical switch:
|
||||
L1 Vfas < 9.6 Delay (0.5s)
|
||||
|
||||
(gdb) print Open9xX9D::g_model.logicalSw[0]
|
||||
$3 = {v1 = -39 '\331', v2 = 96, v3 = 0, func = 4 '\004', delay = 5 '\005', duration = 0 '\000', andsw = 0 '\000'}
|
||||
*/
|
||||
g_model.logicalSw[0] = {int8_t(MIXSRC_FIRST_TELEM+TELEM_VFAS-1), 96, 0, 4, 5, 0, 0};
|
||||
frskyData.hub.vfas = 150; //unit is 100mV
|
||||
|
||||
//telemetry streaming is FALSE, so L1 should be FALSE no matter what value Vfas has
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//every logicalSwitchesTimerTick() represents 100ms
|
||||
//so now after 5 ticks we should still have a FALSE value
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now turn on telemetry
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), false);
|
||||
TELEMETRY_RSSI() = 50;
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), true);
|
||||
|
||||
//vfas is 15.0V so L1 should still be FALSE
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now reduce vfas to 9.5V and L1 should become TRUE after 0.5s
|
||||
frskyData.hub.vfas = 95;
|
||||
evalLogicalSwitches();
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
|
||||
//now stop telemetry, L1 should become FALSE immediatelly
|
||||
TELEMETRY_RSSI() = 0;
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), false);
|
||||
evalLogicalSwitches();
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
}
|
||||
|
||||
TEST(getSwitch, DISABLED_RssiWithDuration)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
memclear(&frskyData, sizeof(frskyData));
|
||||
/*
|
||||
Test for logical switch:
|
||||
L1 RSSI > 10 Duration (0.5s)
|
||||
|
||||
(gdb) print Open9xX9D::g_model.logicalSw[0]
|
||||
$1 = {v1 = -55 '\311', v2 = 10, v3 = 0, func = 3 '\003', delay = 0 '\000', duration = 5 '\005', andsw = 0 '\000'}
|
||||
*/
|
||||
|
||||
g_model.logicalSw[0] = {int8_t(MIXSRC_FIRST_TELEM+TELEM_RSSI_RX-1), 10, 0, 3, 0, 5, 0};
|
||||
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), false);
|
||||
|
||||
evalLogicalSwitches();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now set RSSI to 5, L1 should still be FALSE
|
||||
TELEMETRY_RSSI() = 5;
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now set RSSI to 100, L1 should become TRUE for 0.5s
|
||||
TELEMETRY_RSSI() = 100;
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//repeat telemetry streaming OFF and ON to test for duration processing
|
||||
TELEMETRY_RSSI() = 0;
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), false);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
//now set RSSI to 100, L1 should become TRUE for 0.5s
|
||||
TELEMETRY_RSSI() = 100;
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(TELEMETRY_STREAMING(), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
}
|
||||
#endif // #if defined(PCBTARANIS) && defined(FRSKY)
|
||||
|
||||
|
||||
#if !defined(CPUARM)
|
||||
TEST(getSwitch, recursiveSW)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
|
||||
g_model.logicalSw[0] = { SWSRC_RUD, -SWSRC_SW2, LS_FUNC_OR };
|
||||
g_model.logicalSw[1] = { SWSRC_ELE, -SWSRC_SW1, LS_FUNC_OR };
|
||||
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
LS_RECURSIVE_EVALUATION_RESET();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
simuSetSwitch(1, 1);
|
||||
LS_RECURSIVE_EVALUATION_RESET();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
LS_RECURSIVE_EVALUATION_RESET();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
}
|
||||
#endif // #if !defined(CPUARM)
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
TEST(getSwitch, inputWithTrim)
|
||||
{
|
||||
MODEL_RESET();
|
||||
modelDefault(0);
|
||||
MIXER_RESET();
|
||||
|
||||
g_model.logicalSw[0] = { LS_FUNC_VPOS, MIXSRC_FIRST_INPUT, 0, 0 };
|
||||
|
||||
doMixerCalculations();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
|
||||
setTrimValue(0, 0, 32);
|
||||
doMixerCalculations();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
TEST(evalLogicalSwitches, playFile)
|
||||
{
|
||||
SYSTEM_RESET();
|
||||
MODEL_RESET();
|
||||
modelDefault(0);
|
||||
MIXER_RESET();
|
||||
|
||||
extern uint64_t sdAvailableLogicalSwitchAudioFiles;
|
||||
sdAvailableLogicalSwitchAudioFiles = 0xffffffffffffffff;
|
||||
char filename[AUDIO_FILENAME_MAXLEN+1];
|
||||
isAudioFileReferenced((LOGICAL_SWITCH_AUDIO_CATEGORY << 24) + (0 << 16) + AUDIO_EVENT_OFF, filename);
|
||||
EXPECT_EQ(strcmp(filename, "/SOUNDS/en/MODEL01/L1-off.wav"), 0);
|
||||
isAudioFileReferenced((LOGICAL_SWITCH_AUDIO_CATEGORY << 24) + (0 << 16) + AUDIO_EVENT_ON, filename);
|
||||
EXPECT_EQ(strcmp(filename, "/SOUNDS/en/MODEL01/L1-on.wav"), 0);
|
||||
isAudioFileReferenced((LOGICAL_SWITCH_AUDIO_CATEGORY << 24) + (31 << 16) + AUDIO_EVENT_OFF, filename);
|
||||
EXPECT_EQ(strcmp(filename, "/SOUNDS/en/MODEL01/L32-off.wav"), 0);
|
||||
isAudioFileReferenced((LOGICAL_SWITCH_AUDIO_CATEGORY << 24) + (31 << 16) + AUDIO_EVENT_ON, filename);
|
||||
EXPECT_EQ(strcmp(filename, "/SOUNDS/en/MODEL01/L32-on.wav"), 0);
|
||||
}
|
||||
|
||||
TEST(getSwitch, edgeInstant)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
// LS1 setup: EDGE SFup (0:instant)
|
||||
// LS2 setup: (EDGE SFup (0:instant)) AND SAup
|
||||
setLogicalSwitch(0, LS_FUNC_EDGE, SWSRC_SF2, -129, -1);
|
||||
setLogicalSwitch(1, LS_FUNC_EDGE, SWSRC_SF2, -129, -1, 0, 0, SWSRC_SA2 );
|
||||
|
||||
simuSetSwitch(0, -1); //SA down
|
||||
simuSetSwitch(5, 0); //SF down
|
||||
// EXPECT_EQ(getSwitch(SWSRC_SF2), false);
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
// now trigger SFup, LS1 should become true
|
||||
simuSetSwitch(5, 1); //SF up
|
||||
// EXPECT_EQ(getSwitch(SWSRC_SF2), true);
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
// now release SA0 and SW2 should stay true
|
||||
simuSetSwitch(5, 0); //SF down
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
// now reset logical switches
|
||||
logicalSwitchesReset();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
|
||||
// second part with SAup
|
||||
|
||||
simuSetSwitch(0, 1); //SA up
|
||||
simuSetSwitch(5, 0); //SF down
|
||||
// EXPECT_EQ(getSwitch(SWSRC_SF2), false);
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
// now trigger SFup, LS1 should become true
|
||||
simuSetSwitch(5, 1); //SF up
|
||||
// EXPECT_EQ(getSwitch(SWSRC_SF2), true);
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
// now release SA0 and SW2 should stay true
|
||||
simuSetSwitch(5, 0); //SF down
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
// now reset logical switches
|
||||
logicalSwitchesReset();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
// now bug #2939
|
||||
// SF is kept up and SA is toggled
|
||||
simuSetSwitch(0, -1); //SA down
|
||||
simuSetSwitch(5, 1); //SF up
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
simuSetSwitch(0, 1); //SA up
|
||||
simuSetSwitch(5, 1); //SF up
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
simuSetSwitch(0, -1); //SA down
|
||||
simuSetSwitch(5, 1); //SF up
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
//test what happens when EDGE condition is true and
|
||||
//logical switches are reset - the switch should fire again
|
||||
|
||||
simuSetSwitch(0, 1); //SA up
|
||||
simuSetSwitch(5, 1); //SF up
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false); //switch will not trigger, because SF was already up
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
logicalSwitchesReset();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
}
|
||||
|
||||
TEST(getSwitch, edgeRelease)
|
||||
{
|
||||
MODEL_RESET();
|
||||
MIXER_RESET();
|
||||
// test for issue #2728
|
||||
// LS1 setup: EDGE SFup (0:release)
|
||||
// LS2 setup: (EDGE SFup (0:release)) AND SAup
|
||||
setLogicalSwitch(0, LS_FUNC_EDGE, SWSRC_SF2, -129, 0);
|
||||
setLogicalSwitch(1, LS_FUNC_EDGE, SWSRC_SF2, -129, 0, 0, 0, SWSRC_SA2 );
|
||||
|
||||
simuSetSwitch(0, -1); //SA down
|
||||
simuSetSwitch(5, 0); //SF down
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
simuSetSwitch(5, 1); //SF up
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
simuSetSwitch(5, 0); //SF down
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
|
||||
// second part with SAup
|
||||
simuSetSwitch(0, 1); //SA up
|
||||
simuSetSwitch(5, 0); //SF down
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
simuSetSwitch(5, 1); //SF up
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
simuSetSwitch(5, 0); //SF down
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), true);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), true);
|
||||
|
||||
// with switches reset both should remain false
|
||||
logicalSwitchesReset();
|
||||
logicalSwitchesTimerTick();
|
||||
evalLogicalSwitches();
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW1), false);
|
||||
EXPECT_EQ(getSwitch(SWSRC_SW2), false);
|
||||
|
||||
}
|
||||
|
||||
#endif // #if defined(CPUARM)
|
||||
|
||||
+8
-3
@@ -253,9 +253,14 @@ static int io_open (lua_State *L) {
|
||||
else if (*md == 'a')
|
||||
mode = FA_WRITE | FA_OPEN_ALWAYS; // always open file (create it if necessary)
|
||||
FRESULT result = f_open(&p->f, filename, mode);
|
||||
if (result == FR_OK && *md == 'a')
|
||||
result = f_lseek(&p->f, f_size(&p->f)); // seek to the end of the file
|
||||
return result == FR_OK ? 1 : 0;
|
||||
if (result == FR_OK) {
|
||||
if (*md == 'a')
|
||||
f_lseek(&p->f, f_size(&p->f)); // seek to the end of the file
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return luaL_fileresult(L, 0, filename);
|
||||
}
|
||||
#else
|
||||
const char *mode = md; /* to traverse/check mode */
|
||||
luaL_argcheck(L, lua_checkmode(mode), 2, "invalid mode");
|
||||
|
||||
@@ -1130,8 +1130,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* German checked 27.09.2015 r096 opentx V2.1.4 für X9D,X9D+, X9E, Th9, 9XR, 9XR-Pro
|
||||
/* German checked 17.02.2016 r102 opentx V2.17 für X9D, X9D+, X9E, Th9, 9XR, 9XR-Pro
|
||||
* Authors (alphabetical order)
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bernet Andre <bernet.andre@gmail.com>
|
||||
@@ -104,15 +104,10 @@
|
||||
#define TR_COUNTRYCODES TR("US""JP""EU", "Amerika""Japan\0 ""Europa\0")
|
||||
|
||||
#define LEN_TARANIS_PROTOCOLS "\004"
|
||||
#define TR_TARANIS_PROTOCOLS "AUS\0""PPM\0""XJT\0""DSM?""CRSF"
|
||||
#define TR_TARANIS_PROTOCOLS "AUS\0""PPM\0""XJT\0""DSM2""CRSF"
|
||||
|
||||
#if defined(MODULE_D16_EU_ONLY_SUPPORT)
|
||||
#define LEN_XJT_PROTOCOLS "\007"
|
||||
#define TR_XJT_PROTOCOLS "AUS\0 ""D16-EU\0""D8\0 ""LR12-EU"
|
||||
#else
|
||||
#define LEN_XJT_PROTOCOLS "\004"
|
||||
#define TR_XJT_PROTOCOLS "AUS\0""X16\0""D8\0 ""LR12"
|
||||
#endif
|
||||
#define LEN_XJT_PROTOCOLS "\004"
|
||||
#define TR_XJT_PROTOCOLS "AUS\0""D16\0""D8\0 ""LR12"
|
||||
|
||||
#define LEN_DSM_PROTOCOLS "\004"
|
||||
#define TR_DSM_PROTOCOLS "LP45""DSM2""DSMX" //LP45 =Low Power 4 und 5 Kanal
|
||||
@@ -1085,7 +1080,7 @@
|
||||
#define TR_ONLYPOSITIVE "Nur Positiv"
|
||||
#define TR_FILTER "Filter aktiv"
|
||||
#define TR_TELEMETRYFULL "Telemetriezeilen voll!"
|
||||
#define TR_INVERTED_SERIAL INDENT "Invert."
|
||||
#define TR_INVERTED_SERIAL INDENT "Invert."
|
||||
#define TR_IGNORE_INSTANCE TR(INDENT "Keine ID", INDENT "Keine Multisen-ID") //unklar
|
||||
#define TR_DISCOVER_SENSORS INDENT "Start Sensorsuche"
|
||||
#define TR_STOP_DISCOVER_SENSORS INDENT "Stop Sensorsuche"
|
||||
@@ -1116,7 +1111,7 @@
|
||||
#define ZSTR_A4 "A4"
|
||||
#define ZSTR_BATT "RxBt"
|
||||
#define ZSTR_ALT "Alt"
|
||||
#define ZSTR_TEMP1 "Tmp1"
|
||||
#define ZSTR_TEMP1 "Tmp1"
|
||||
#define ZSTR_TEMP2 "Tmp2"
|
||||
#define ZSTR_RPM "RPM"
|
||||
#define ZSTR_FUEL "Fuel"
|
||||
@@ -1133,8 +1128,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -1128,8 +1128,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -1083,8 +1083,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -1083,8 +1083,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -1120,8 +1120,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
#define TR_VSENSORTYPES "Custom\0 ""Calcolato\0"
|
||||
|
||||
#define LEN_VFORMULAS "\011"
|
||||
#define TR_VFORMULAS "Somma\0 ""Media\0 ""Min\0 ""Max\0 ""Moltipl\0 ""Totalizza""Cella\0 ""Consumo\0 ""Distanza\0"
|
||||
#define TR_VFORMULAS "Somma\0 ""Media\0 ""Min\0 ""Max\0 ""Moltipl\0 ""Totalizza""Cella\0 ""Consumo\0 ""Distanza\0"
|
||||
|
||||
#define LEN_VPREC "\004"
|
||||
#define TR_VPREC "0.--""0.0 ""0.00"
|
||||
@@ -1132,8 +1132,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Data"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -1152,8 +1152,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -1085,7 +1085,7 @@
|
||||
#define TR_FILTER "Filtr"
|
||||
#define TR_TELEMETRYFULL "Wszyskie miejsca zajęte!"
|
||||
//TODO: translation
|
||||
#define TR_INVERTED SERIAL INDENT "Odwróć"
|
||||
#define TR_INVERTED_SERIAL INDENT "Odwróć"
|
||||
#define TR_IGNORE_INSTANCE INDENT "Ignoruj przypadek"
|
||||
#define TR_DISCOVER_SENSORS INDENT "Znajdź nowe czujniki"
|
||||
#define TR_STOP_DISCOVER_SENSORS INDENT "Szukanie STOP "
|
||||
@@ -1133,8 +1133,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
@@ -1083,8 +1083,12 @@
|
||||
#define ZSTR_GPSALT "GAlt"
|
||||
#define ZSTR_GPSDATETIME "Date"
|
||||
#define ZSTR_GPS "GPS"
|
||||
#define ZSTR_PBOX1 "PBx1"
|
||||
#define ZSTR_PBOX2 "PBx2"
|
||||
#define ZSTR_BATT1_VOLTAGE "RB1V"
|
||||
#define ZSTR_BATT2_VOLTAGE "RB2V"
|
||||
#define ZSTR_BATT1_CURRENT "RB1A"
|
||||
#define ZSTR_BATT2_CURRENT "RB2A"
|
||||
#define ZSTR_BATT1_CONSUMPTION "RB1C"
|
||||
#define ZSTR_BATT2_CONSUMPTION "RB2C"
|
||||
#define ZSTR_RX1_FAILSAFE "Rx1F"
|
||||
#define ZSTR_RX1_LOSTFRAME "Rx1L"
|
||||
#define ZSTR_RX1_CONN_LOST "Rx1C"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user