Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d4a791940 | |||
| 7373ce2cae | |||
| 5da1e35efe | |||
| fe5b7bee8c | |||
| 2da1134796 | |||
| 83e47d9e35 | |||
| f0c76efaf7 | |||
| 2fe7d856c3 | |||
| a7c1f22b36 | |||
| d92620919b | |||
| 94bb21886b | |||
| 5db98a3fef | |||
| 763c7fbb7d | |||
| b2d1a4ed22 | |||
| e7211065ab | |||
| 68b8b0e38f | |||
| 644c833311 | |||
| 30b1f62e99 | |||
| 03aa787c8e | |||
| 79592d3b00 | |||
| 7ed527a328 | |||
| 3e0766f2bf | |||
| 71e7926045 | |||
| 8c3d47deac | |||
| 197f31d5a1 | |||
| 1a198c35ad | |||
| 2934fc4d23 | |||
| 4ae9585080 | |||
| 161016a02a | |||
| 559bb83864 | |||
| 9a37c3027e | |||
| 6548afcad3 | |||
| ee31c51275 | |||
| 63aadad10c | |||
| 30958a9a65 | |||
| 995183bf22 |
@@ -518,3 +518,10 @@ Jens Lochmüller
|
||||
Anthony Witham
|
||||
Peter Hauke
|
||||
Arizona Action Photos
|
||||
Francis F Dale
|
||||
Willie Swanepoel
|
||||
Edward Hauser
|
||||
Adilson Oliveira
|
||||
Joseph Ordille
|
||||
Michael Shellim
|
||||
Teddie Holmes
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<h2>Version 2.0.7</h2>
|
||||
<ul>
|
||||
<li>SafetyCH function was missing in simulator</li>
|
||||
<li>EEPROM export warning when exporting logical switches > L12 on 9X128</li>
|
||||
<li>FAS offset was not exported on 9X/9XR boards</li>
|
||||
<li>Trims modes bugfix on non Taranis boards</li>
|
||||
<li>It was impossible to open a backuped model from the Tx</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.6</h2>
|
||||
<ul>
|
||||
<li>Fix Mix curves bug on Sky9x boards</li>
|
||||
|
||||
@@ -2,7 +2,7 @@ PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "6" )
|
||||
SET( C9X_VERSION_REVISION "7" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
@@ -648,7 +648,7 @@ class ConversionField: public TransformedField {
|
||||
if (table->exportValue(_field, _field))
|
||||
return;
|
||||
if (!error.isEmpty())
|
||||
EEPROMWarnings += error + "\n";
|
||||
EEPROMWarnings.push_back(error);
|
||||
}
|
||||
|
||||
if (shift) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "helpers.h"
|
||||
#include "wizarddata.h"
|
||||
|
||||
QString EEPROMWarnings;
|
||||
std::list<QString> EEPROMWarnings;
|
||||
|
||||
const char * switches9X[] = { "3POS", "THR", "RUD", "ELE", "AIL", "GEA", "TRN" };
|
||||
const char * switchesX9D[] = { "SA", "SB", "SC", "SD", "SE", "SF", "SG", "SH" };
|
||||
|
||||
@@ -1198,7 +1198,7 @@ class EEPROMInterface
|
||||
|
||||
};
|
||||
|
||||
extern QString EEPROMWarnings;
|
||||
extern std::list<QString> EEPROMWarnings;
|
||||
|
||||
/* EEPROM string conversion functions */
|
||||
void setEEPROMString(char *dst, const char *src, int size);
|
||||
|
||||
@@ -344,6 +344,57 @@ unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion)
|
||||
{
|
||||
uint8_t *buf = (uint8_t *)src.data();
|
||||
unsigned int len = src.size();
|
||||
uint8_t zeroes = 0;
|
||||
uint8_t bRlc = 0;
|
||||
|
||||
dst.resize(0);
|
||||
|
||||
for( ; 1; ) {
|
||||
for (int i=0; i<zeroes; i++)
|
||||
dst.append((char)0);
|
||||
zeroes = 0;
|
||||
|
||||
if (len == 0)
|
||||
return dst.size();
|
||||
|
||||
for (int i=0; i<bRlc; i++) {
|
||||
dst.append(*buf++);
|
||||
if (--len == 0)
|
||||
return dst.size();
|
||||
}
|
||||
|
||||
bRlc = *buf++;
|
||||
--len;
|
||||
|
||||
if (!(bRlc & 0x7f)) {
|
||||
qDebug() << "RLC decoding error!";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rlcVersion == 2) {
|
||||
if (bRlc&0x80){ // if contains high byte
|
||||
zeroes = (bRlc>>4) & 0x07;
|
||||
bRlc = bRlc & 0x0f;
|
||||
}
|
||||
else if (bRlc&0x40){
|
||||
zeroes = bRlc & 0x3f;
|
||||
bRlc = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (bRlc&0x80){ // if contains high byte
|
||||
zeroes = bRlc & 0x7f;
|
||||
bRlc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dst.size();
|
||||
}
|
||||
|
||||
unsigned int RleFile::write1(uint8_t b)
|
||||
{
|
||||
return write(&b, 1);
|
||||
|
||||
@@ -146,4 +146,6 @@ public:
|
||||
unsigned int get_current_block_number(unsigned int block_no, uint16_t *p_size);
|
||||
};
|
||||
|
||||
unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersion=2);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -149,7 +149,7 @@ t_Open9xArmExpoData_v208::operator ExpoData ()
|
||||
c9x.chn = chn;
|
||||
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
@@ -179,7 +179,7 @@ t_Open9xArmExpoData_v210::operator ExpoData ()
|
||||
c9x.chn = chn;
|
||||
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
|
||||
@@ -89,7 +89,7 @@ t_Open9xExpoData_v201::operator ExpoData ()
|
||||
c9x.mode = mode;
|
||||
c9x.chn = chn;
|
||||
if (expo!=0 && curve!=0) {
|
||||
EEPROMWarnings += ::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX"));
|
||||
}
|
||||
else {
|
||||
if (curve == 0) {
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define SAFETY_CHANNEL_FUNCTION
|
||||
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#define FRSKY_STICKS
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define SAFETY_CHANNEL_FUNCTION
|
||||
|
||||
#define EEPROM_VARIANT SIMU_M128_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define SAFETY_CHANNEL_FUNCTION
|
||||
#define FAS_OFFSET
|
||||
|
||||
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define SAFETY_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#define EEPROM_VARIANT 3
|
||||
#define HAPTIC
|
||||
#define REVPLUS
|
||||
#define SAFETY_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 5
|
||||
|
||||
|
||||
@@ -235,8 +235,9 @@ class SourcesConversionTable: public ConversionTable {
|
||||
addConversion(RawSource(SOURCE_TYPE_SWITCH, i), val++);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
|
||||
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i), val++);
|
||||
}
|
||||
}
|
||||
|
||||
if (!afterrelease21March2013) {
|
||||
@@ -369,7 +370,8 @@ template <int N>
|
||||
class SwitchField: public ConversionField< SignedField<N> > {
|
||||
public:
|
||||
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), "Switch"),
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), "Switch",
|
||||
"Switch "+ sw.toString()+" cannot be exported on this board!"),
|
||||
sw(sw),
|
||||
_switch(0)
|
||||
{
|
||||
@@ -503,7 +505,8 @@ template <int N>
|
||||
class SourceField: public ConversionField< UnsignedField<N> > {
|
||||
public:
|
||||
SourceField(RawSource & source, BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0):
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags), "Source"),
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
|
||||
"Source", "Source "+ source.toString(ModelData())+" cannot be exported on this board!"),
|
||||
source(source),
|
||||
_source(0)
|
||||
{
|
||||
@@ -1255,14 +1258,14 @@ class CurvesField: public TransformedField {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count);
|
||||
if (offset > maxPoints) {
|
||||
EEPROMWarnings += ::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints) + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count) - 5;
|
||||
if (offset > maxPoints - 5 * maxCurves) {
|
||||
EEPROMWarnings += ::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints) + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints));
|
||||
break;
|
||||
}
|
||||
_curves[i] = offset;
|
||||
@@ -2335,10 +2338,9 @@ class FrskyField: public StructField {
|
||||
Append(new UnsignedField<3>(frsky.varioSource));
|
||||
Append(new SignedField<5>(frsky.varioCenterMin));
|
||||
Append(new ConversionField< UnsignedField<3> >(frsky.currentSource, &telemetryCurrentSourceConversionTable, "Current Source"));
|
||||
Append(new SignedField<8>(frsky.varioCenterMax));
|
||||
Append(new SignedField<5>(frsky.varioCenterMax));
|
||||
if (version >= 216) {
|
||||
// TODO int8_t fasOffset;
|
||||
Append(new SpareBitsField<8>());
|
||||
Append(new SignedField<8>(frsky.fasOffset));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2428,7 +2430,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
if (IS_ARM(board))
|
||||
internalField.Append(new UnsignedField<3>(modelData.telemetryProtocol));
|
||||
else
|
||||
internalField.Append(new ConversionField< UnsignedField<3> >((unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
|
||||
internalField.Append(new ConversionField< UnsignedField<3> >((unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this telemetry protocol")));
|
||||
|
||||
internalField.Append(new BoolField<1>(modelData.thrTrim));
|
||||
|
||||
@@ -2532,12 +2534,12 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
|
||||
if (IS_TARANIS(board)) {
|
||||
modulesCount = 3;
|
||||
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
|
||||
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[1].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this rado protocol")));
|
||||
internalField.Append(new UnsignedField<8>(modelData.trainerMode));
|
||||
}
|
||||
else if (IS_ARM(board) && version >= 216) {
|
||||
modulesCount = 3;
|
||||
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
|
||||
internalField.Append(new ConversionField< SignedField<8> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this radio protocol")));
|
||||
}
|
||||
|
||||
if (IS_ARM(board) && version >= 215) {
|
||||
|
||||
@@ -163,8 +163,20 @@ bool OpenTxEepromInterface::loadModelVariant(unsigned int index, ModelData &mode
|
||||
}
|
||||
else {
|
||||
// load from SD Backup, size is stored in index
|
||||
QByteArray eepromData((char *)data, index);
|
||||
open9xModel.Import(eepromData);
|
||||
QByteArray backupData((char *)data, index);
|
||||
QByteArray modelData;
|
||||
if (IS_SKY9X(board))
|
||||
modelData = backupData;
|
||||
else
|
||||
importRlc(modelData, backupData);
|
||||
if (modelData.size()) {
|
||||
open9xModel.Import(modelData);
|
||||
// open9xModel.Dump();
|
||||
model.used = true;
|
||||
}
|
||||
else {
|
||||
model.clear();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -402,10 +414,21 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
}
|
||||
}
|
||||
|
||||
if (!EEPROMWarnings.isEmpty())
|
||||
if (!EEPROMWarnings.empty()) {
|
||||
QString msg;
|
||||
int noErrorsToDisplay = std::min((int)EEPROMWarnings.size(),10);
|
||||
for (int n = 0; n < noErrorsToDisplay; n++) {
|
||||
msg += "-" + EEPROMWarnings.front() + "\n";
|
||||
EEPROMWarnings.pop_front();
|
||||
}
|
||||
if (!EEPROMWarnings.empty()) {
|
||||
msg = QObject::tr("(displaying only first 10 warnings)") + "\n" + msg;
|
||||
}
|
||||
EEPROMWarnings.clear();
|
||||
QMessageBox::warning(NULL,
|
||||
QObject::tr("Warning"),
|
||||
QObject::tr("EEPROM saved with these warnings:") + "\n- " + EEPROMWarnings.remove(EEPROMWarnings.length()-1, 1).replace("\n", "\n- "));
|
||||
QObject::tr("EEPROM saved with these warnings:") + "\n" + msg);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
@@ -910,11 +933,32 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
|
||||
{
|
||||
std::cout << "trying " << getName() << " backup import...";
|
||||
|
||||
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0 || eeprom[3] != 0x30+board) {
|
||||
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0) {
|
||||
std::cout << " no\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
BoardEnum backupBoard = (BoardEnum)-1;
|
||||
switch (eeprom[3]) {
|
||||
case 0x33:
|
||||
backupBoard = BOARD_TARANIS;
|
||||
break;
|
||||
case 0x32:
|
||||
backupBoard = BOARD_SKY9X;
|
||||
break;
|
||||
case 0x31:
|
||||
backupBoard = BOARD_GRUVIN9X;
|
||||
break;
|
||||
default:
|
||||
std::cout << " unknown board\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (backupBoard != board) {
|
||||
std::cout << " not right board\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t version = eeprom[4];
|
||||
uint8_t bcktype = eeprom[5];
|
||||
uint16_t size = ((uint16_t)eeprom[7] << 8) + eeprom[6];
|
||||
|
||||
@@ -197,7 +197,7 @@ int8_t t_Th9xLogicalSwitchData::fromSource(RawSource source)
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
v1 = 1+source.index;
|
||||
else if (source.type == SOURCE_TYPE_ROTARY_ENCODER) {
|
||||
EEPROMWarnings += ::QObject::tr("th9x on this board doesn't have Rotary Encoders") + "\n";
|
||||
EEPROMWarnings.push_back(::QObject::tr("th9x on this board doesn't have Rotary Encoders"));
|
||||
v1 = 5+source.index;
|
||||
}
|
||||
else if (source.type == SOURCE_TYPE_MAX)
|
||||
|
||||
@@ -1596,7 +1596,7 @@ void MainWindow::createActions()
|
||||
writeEepromAct = addAct("write_eeprom.png", tr("Write Models and Settings To Radio"), tr("Write Models and Settings to Radio"), SLOT(writeEeprom()));
|
||||
readEepromAct = addAct("read_eeprom.png", tr("Read Models and Settings From Radio"), tr("Read Models and Settings from Radio"), SLOT(readEeprom()));
|
||||
burnConfigAct = addAct("configure.png", tr("Configure Communications..."), tr("Configure software for communicating with the Radio"), SLOT(burnConfig()));
|
||||
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to to Radio"), SLOT(writeBackup()));
|
||||
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to Radio"), SLOT(writeBackup()));
|
||||
readBackupToFileAct = addAct("read_eeprom_file.png", tr("Backup Radio to File"), tr("Save a complete backup file of all settings and model data in the Radio"), SLOT(readBackup()));
|
||||
contributorsAct = addAct("contributors.png", tr("Contributors..."), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors()));
|
||||
|
||||
|
||||
@@ -63,19 +63,25 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
trimsValue << ui->trim1Value << ui->trim2Value << ui->trim3Value << ui->trim4Value;
|
||||
trimsSlider << ui->trim1Slider << ui->trim2Slider << ui->trim3Slider << ui->trim4Slider;
|
||||
|
||||
BoardEnum board = firmware->getBoard();
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
trimsLabel[i]->setText(labels[CONVERT_MODE(i+1)-1]);
|
||||
|
||||
QComboBox * cb = trimsUse[i];
|
||||
cb->setProperty("index", i);
|
||||
cb->addItem(QObject::tr("Trim disabled"), -1);
|
||||
if (IS_TARANIS(board)) {
|
||||
cb->addItem(QObject::tr("Trim disabled"), -1);
|
||||
}
|
||||
for (int m=0; m<modesCount; m++) {
|
||||
if (m == phaseIdx) {
|
||||
cb->addItem(QObject::tr("Own Trim"), m*2);
|
||||
}
|
||||
else if (phaseIdx > 0) {
|
||||
cb->addItem(QObject::tr("Use Trim from Flight mode %1").arg(m), m*2);
|
||||
cb->addItem(QObject::tr("Use Trim from Flight mode %1 + Own Trim as an offset").arg(m), m*2+1);
|
||||
if (IS_TARANIS(board)) {
|
||||
cb->addItem(QObject::tr("Use Trim from Flight mode %1 + Own Trim as an offset").arg(m), m*2+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
connect(cb, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseTrimUse_currentIndexChanged(int)));
|
||||
@@ -157,7 +163,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
gvLayout->addWidget(gvValues[i], i, col++, 1, 1);
|
||||
|
||||
// Popups
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()) && (phaseIdx == 0)) {
|
||||
if (IS_TARANIS(board) && phaseIdx == 0) {
|
||||
gvPopups[i] = new QCheckBox(ui->gvGB);
|
||||
gvPopups[i]->setProperty("index", i);
|
||||
gvPopups[i]->setText(tr("Popup enabled"));
|
||||
@@ -270,7 +276,11 @@ void FlightModePanel::trimUpdate(unsigned int trim)
|
||||
trimsSlider[trim]->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
|
||||
BoardEnum board = firmware->getBoard();
|
||||
if (IS_TARANIS(board))
|
||||
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
|
||||
else
|
||||
trimsUse[trim]->setCurrentIndex(phase.trimRef[chn]);
|
||||
trimsValue[trim]->setEnabled(true);
|
||||
trimsSlider[trim]->setEnabled(true);
|
||||
}
|
||||
@@ -364,8 +374,15 @@ void FlightModePanel::phaseTrimUse_currentIndexChanged(int index)
|
||||
phase.trim[chn] = 0;
|
||||
}
|
||||
else {
|
||||
phase.trimMode[chn] = data % 2;
|
||||
phase.trimRef[chn] = data / 2;
|
||||
BoardEnum board = firmware->getBoard();
|
||||
if (IS_TARANIS(board)) {
|
||||
phase.trimMode[chn] = data % 2;
|
||||
phase.trimRef[chn] = data / 2;
|
||||
}
|
||||
else {
|
||||
phase.trimMode[chn] = 0;
|
||||
phase.trimRef[chn] = data / 2;
|
||||
}
|
||||
phase.trim[chn] = 0;
|
||||
}
|
||||
trimUpdate(trim);
|
||||
|
||||
@@ -658,10 +658,10 @@
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-1.500000000000000</double>
|
||||
<double>-12.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.500000000000000</double>
|
||||
<double>12.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
|
||||
@@ -4270,7 +4270,7 @@ Chcete ho přesto zapsat ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1601"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation>Zapsat zálohu ze souboru do rádia</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -4232,7 +4232,7 @@ Do you want to download it now ?</source>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1589"/>
|
||||
<source>Firmware Changes...</source>
|
||||
<translation>Firmware Ändeurngen...</translation>
|
||||
<translation>Firmware Änderungen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1589"/>
|
||||
@@ -4336,7 +4336,7 @@ Do you want to download it now ?</source>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1601"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation>Schreibe Backup aus Datei in den Sender</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -4613,7 +4613,7 @@ Kirjoita se silti lähettimeen ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1676"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation>Kirjoita varmuuskopio tiedosto lähettimeen</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -3875,7 +3875,7 @@ Are you sure ?</source>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1603"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation>Transférer une sauvegarde à la radio</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -4004,7 +4004,7 @@ Do you want to download it now ?</source>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1601"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -4166,7 +4166,7 @@ Volete scaricarla ora ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1601"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation>Scrivi salvataggio dal file sulla Radio</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -3938,7 +3938,7 @@ Do you want to download it now ?</source>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1601"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -3775,7 +3775,7 @@ Chcesz pobrać teraz?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1600"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation>Zapisz Backup do radia z pliku</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -4039,7 +4039,7 @@ Do you want to download it now ?</source>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1601"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -4055,7 +4055,7 @@ Do you want to download it now ?</source>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="1601"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -3902,7 +3902,7 @@ Vill du ladda ned den nu ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+0"/>
|
||||
<source>Write Backup from file to to Radio</source>
|
||||
<source>Write Backup from file to Radio</source>
|
||||
<translation>Skriv Backup från en fil till radion</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
<h2>Version 2.0.6 / 2014-07-08</h2>
|
||||
<h2>Version 2.0.7 / 2014-07-15</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Instant Trim problem when using a negative curve
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>SafetyCH function was missing on the compilation server
|
||||
|
||||
<h2>Version 2.0.6 / 2014-07-13</h2>
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Telemetry Type field is hidden when only S.PORT is available
|
||||
|
||||
@@ -296,7 +296,7 @@ SHELL = sh
|
||||
IMG2LBM = -python ../util/img2lbm.py
|
||||
BIN2LBM = -python ../util/bin2lbm.py
|
||||
TRANSLATE = -python ../util/translate.py
|
||||
VERSION = 2.0.6
|
||||
VERSION = 2.0.7
|
||||
|
||||
SRC =
|
||||
CPPSRC =
|
||||
@@ -1408,7 +1408,8 @@ clean_list :
|
||||
$(REMOVE) *.lst
|
||||
$(REMOVE) allsrc.cpp
|
||||
$(REMOVE) stamp-opentx.h
|
||||
$(REMOVE) `find . -name "*.lbm"`
|
||||
$(REMOVE) bitmaps/*.lbm
|
||||
$(REMOVE) fonts/*/*.lbm
|
||||
$(MAKE) -C bootloader clean
|
||||
|
||||
#### Install
|
||||
|
||||
@@ -340,8 +340,8 @@ void displayTimers()
|
||||
// Main timer
|
||||
if (g_model.timers[0].mode) {
|
||||
TimerState & timerState = timersStates[0];
|
||||
putsTimer(TIMERS_X, TIMER1_Y, timerState.val, TIMEHOUR|MIDSIZE|LEFT, TIMEHOUR|MIDSIZE|LEFT);
|
||||
putsTimerMode(TIMERS_X, TIMER1_Y-6, g_model.timers[0].mode, SMLSIZE);
|
||||
putsTimer(TIMERS_X, TIMER1_Y, timerState.val, TIMEHOUR|MIDSIZE|LEFT, TIMEHOUR|MIDSIZE|LEFT);
|
||||
if (g_model.timers[0].persistent) lcd_putcAtt(TIMERS_R, TIMER1_Y+1, 'P', SMLSIZE);
|
||||
if (timerState.val < 0) {
|
||||
if (BLINK_ON_PHASE) {
|
||||
@@ -353,8 +353,8 @@ void displayTimers()
|
||||
// Second timer
|
||||
if (g_model.timers[1].mode) {
|
||||
TimerState & timerState = timersStates[1];
|
||||
putsTimer(TIMERS_X, TIMER2_Y, timerState.val, TIMEHOUR|MIDSIZE|LEFT, TIMEHOUR|MIDSIZE|LEFT);
|
||||
putsTimerMode(TIMERS_X, TIMER2_Y-6, g_model.timers[1].mode, SMLSIZE);
|
||||
putsTimer(TIMERS_X, TIMER2_Y, timerState.val, TIMEHOUR|MIDSIZE|LEFT, TIMEHOUR|MIDSIZE|LEFT);
|
||||
if (g_model.timers[1].persistent) lcd_putcAtt(TIMERS_R, TIMER2_Y+1, 'P', SMLSIZE);
|
||||
if (timerState.val < 0) {
|
||||
if (BLINK_ON_PHASE) {
|
||||
|
||||
@@ -310,7 +310,7 @@ bool displayGaugesTelemetryScreen(FrSkyScreenData & screen)
|
||||
else {
|
||||
#if defined(CPUARM)
|
||||
threshold = barsThresholds[source-TELEM_ALT];
|
||||
#else
|
||||
#elif defined(GAUGES)
|
||||
threshold = convertBarTelemValue(source, barsThresholds[source-TELEM_ALT]);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -51,7 +51,87 @@ uint8_t lcdLastPos;
|
||||
uint8_t lcdNextPos;
|
||||
|
||||
#if defined(CPUARM)
|
||||
void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags);
|
||||
void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags)
|
||||
{
|
||||
bool blink = false;
|
||||
bool inv = false;
|
||||
if (flags & BLINK) {
|
||||
if (BLINK_ON_PHASE) {
|
||||
if (flags & INVERS)
|
||||
inv = true;
|
||||
else {
|
||||
blink = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (flags & INVERS) {
|
||||
inv = true;
|
||||
}
|
||||
|
||||
uint8_t lines = (height+7)/8;
|
||||
assert(lines <= 5);
|
||||
|
||||
for (int8_t i=0; i<width+2; i++) {
|
||||
if (x<LCD_W) {
|
||||
uint8_t b[5] = { 0 };
|
||||
if (i==0) {
|
||||
if (x==0 || !inv) {
|
||||
lcdNextPos++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
// we need to work on the previous x when INVERS
|
||||
x--;
|
||||
}
|
||||
}
|
||||
else if (i<=width) {
|
||||
uint8_t skip = true;
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = pgm_read_byte(pattern++); /*top byte*/
|
||||
if (b[j] != 0xff) {
|
||||
skip = false;
|
||||
}
|
||||
}
|
||||
if (skip) {
|
||||
if (flags & FIXEDWIDTH) {
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((flags & CONDENSED) && i==2) {
|
||||
/*condense the letter by skipping column 3 */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
for (int8_t j=-1; j<=height; j++) {
|
||||
bool plot;
|
||||
if (j < 0 || j == height) {
|
||||
plot = false;
|
||||
if (height >= 12) continue;
|
||||
if (j<0 && !inv) continue;
|
||||
}
|
||||
else {
|
||||
uint8_t line = (j / 8);
|
||||
uint8_t pixel = (j % 8);
|
||||
plot = b[line] & (1 << pixel);
|
||||
}
|
||||
if (inv) plot = !plot;
|
||||
if (!blink) {
|
||||
lcd_plot(x, y+j, plot ? FORCE : ERASE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
x++;
|
||||
lcdNextPos++;
|
||||
}
|
||||
}
|
||||
|
||||
void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||
{
|
||||
#if !defined(BOOT)
|
||||
@@ -94,20 +174,22 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||
}
|
||||
else if (flags & MIDSIZE) {
|
||||
q = &font_8x10[((uint16_t)c-0x20)*16];
|
||||
lcdPutPattern(x, y, q, 8, 11, flags);
|
||||
lcdPutPattern(x, y, q, 8, 12, flags);
|
||||
}
|
||||
else if (flags & SMLSIZE) {
|
||||
q = (c < 0xc0 ? &font_4x6[(c-0x20)*5] : &font_4x6_extra[(c-0xc0)*5]);
|
||||
lcdPutPattern(x, y, q, 5, 6, flags);
|
||||
lcdPutPattern(x, y, q, 5, 7, flags);
|
||||
}
|
||||
else if (flags & TINSIZE) {
|
||||
q = &font_3x5[((uint16_t)c-0x2d)*3];
|
||||
lcdPutPattern(x, y, q, 3, 5, flags);
|
||||
}
|
||||
#if defined(BOLD_FONT)
|
||||
else if (flags & BOLD) {
|
||||
q = &font_5x7_B[c_remapped*5];
|
||||
lcdPutPattern(x, y, q, 5, 7, flags);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -38,110 +38,7 @@
|
||||
|
||||
#define LCD_BYTE_FILTER(p, keep, add) *(p) = (*(p) & (keep)) | (add)
|
||||
|
||||
#if defined(CPUARM)
|
||||
void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags)
|
||||
{
|
||||
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
|
||||
uint8_t *end = &displayBuf[ y / 8 * LCD_W + LCD_W ];
|
||||
|
||||
bool blink = false;
|
||||
bool inv = false;
|
||||
if (flags & BLINK) {
|
||||
if (BLINK_ON_PHASE) {
|
||||
if (flags & INVERS)
|
||||
inv = true;
|
||||
else {
|
||||
blink = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (flags & INVERS) {
|
||||
inv = true;
|
||||
}
|
||||
|
||||
uint8_t lines = (height+7)/8;
|
||||
assert(lines <= 5);
|
||||
|
||||
for (int8_t i=0; i<width+2; i++) {
|
||||
if (p<end) {
|
||||
uint8_t b[5] = { 0 };
|
||||
if (i==0) {
|
||||
if (x==0 || !inv) {
|
||||
lcdNextPos++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
// we need to work on the previous byte when INVERS
|
||||
p--;
|
||||
}
|
||||
}
|
||||
else if (i<=width) {
|
||||
uint8_t skip = true;
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = pgm_read_byte(pattern++); /*top byte*/
|
||||
if (b[j] != 0xff) {
|
||||
skip = false;
|
||||
}
|
||||
}
|
||||
if (skip) {
|
||||
if (flags & FIXEDWIDTH) {
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((flags & CONDENSED) && i==2) {
|
||||
/*condense the letter by skipping column 3 */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
const uint8_t ym8 = (y & 0x07);
|
||||
const uint8_t keepref = (1 << ((height&0x07)+1)) - 1;
|
||||
uint8_t * dest = p;
|
||||
for (uint8_t j=0; j<lines+1; j++) {
|
||||
if (dest < DISPLAY_END) {
|
||||
uint8_t b1=0, b2=0, keep=0;
|
||||
if (j>0) {
|
||||
b1 = b[j-1] >> (8-ym8);
|
||||
}
|
||||
else {
|
||||
keep = ~(keepref << ym8);
|
||||
}
|
||||
if (j<lines) {
|
||||
if (inv) {
|
||||
b[j] = ~b[j];
|
||||
}
|
||||
b2 = b[j] << ym8;
|
||||
}
|
||||
else {
|
||||
keep = ~(keepref >> (8-ym8));
|
||||
}
|
||||
if (!blink) {
|
||||
LCD_BYTE_FILTER(dest, keep, b1|b2);
|
||||
}
|
||||
dest += LCD_W;
|
||||
}
|
||||
}
|
||||
|
||||
if (inv && height<8) {
|
||||
if (ym8) {
|
||||
lcd_mask(p, 0x01 << (ym8-1), FORCE);
|
||||
}
|
||||
else if (y) {
|
||||
ASSERT_IN_DISPLAY(p - LCD_W);
|
||||
lcd_mask(p - LCD_W, 0x80, FORCE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p++;
|
||||
lcdNextPos++;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#if !defined(CPUARM)
|
||||
void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||
{
|
||||
uint8_t *p = &displayBuf[ y / 8 * LCD_W + x ];
|
||||
|
||||
@@ -36,86 +36,6 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags)
|
||||
{
|
||||
bool blink = false;
|
||||
bool inv = false;
|
||||
if (flags & BLINK) {
|
||||
if (BLINK_ON_PHASE) {
|
||||
if (flags & INVERS)
|
||||
inv = true;
|
||||
else {
|
||||
blink = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (flags & INVERS) {
|
||||
inv = true;
|
||||
}
|
||||
|
||||
uint8_t lines = (height+7)/8;
|
||||
assert(lines <= 5);
|
||||
|
||||
for (int8_t i=0; i<width+2; i++) {
|
||||
if (x<LCD_W) {
|
||||
uint8_t b[5] = { 0 };
|
||||
if (i==0) {
|
||||
if (x==0 || !inv) {
|
||||
lcdNextPos++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
// we need to work on the previous x when INVERS
|
||||
x--;
|
||||
}
|
||||
}
|
||||
else if (i<=width) {
|
||||
uint8_t skip = true;
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = pgm_read_byte(pattern++); /*top byte*/
|
||||
if (b[j] != 0xff) {
|
||||
skip = false;
|
||||
}
|
||||
}
|
||||
if (skip) {
|
||||
if (flags & FIXEDWIDTH) {
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((flags & CONDENSED) && i==2) {
|
||||
/*condense the letter by skipping column 3 */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
for (int8_t j=-1; j<=height; j++) {
|
||||
bool plot;
|
||||
if (j < 0 || j == height) {
|
||||
plot = false;
|
||||
if (j<0 && !inv) continue;
|
||||
}
|
||||
else {
|
||||
uint8_t line = (j / 8);
|
||||
uint8_t pixel = (j % 8);
|
||||
plot = b[line] & (1 << pixel);
|
||||
}
|
||||
if (inv) plot = !plot;
|
||||
if (!blink) {
|
||||
lcd_plot(x, y+j, plot ? FORCE : ERASE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
x++;
|
||||
lcdNextPos++;
|
||||
}
|
||||
}
|
||||
|
||||
void lcd_mask(uint8_t *p, uint8_t mask, LcdFlags att)
|
||||
{
|
||||
ASSERT_IN_DISPLAY(p);
|
||||
|
||||
@@ -3095,6 +3095,12 @@ ISR(USART0_UDRE_vect)
|
||||
|
||||
void instantTrim()
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
int16_t anas_0[NUM_INPUTS];
|
||||
evalInputs(e_perout_mode_notrainer | e_perout_mode_nosticks);
|
||||
memcpy(anas_0, anas, sizeof(anas_0));
|
||||
#endif
|
||||
|
||||
evalInputs(e_perout_mode_notrainer);
|
||||
|
||||
for (uint8_t stick=0; stick<NUM_STICKS; stick++) {
|
||||
@@ -3107,7 +3113,7 @@ void instantTrim()
|
||||
ExpoData * ed = expoAddress(e);
|
||||
if (!EXPO_VALID(ed)) break; // end of list
|
||||
if (ed->srcRaw-MIXSRC_Rud == stick) {
|
||||
delta = anas[ed->chn];
|
||||
delta = anas[ed->chn] - anas_0[ed->chn];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 513 B |
|
After Width: | Height: | Size: 558 B |
@@ -191,3 +191,46 @@ TEST(Lcd, vline)
|
||||
}
|
||||
EXPECT_TRUE(checkScreenshot("vline"));
|
||||
}
|
||||
|
||||
#if defined(CPUARM)
|
||||
TEST(Lcd, Smlsize)
|
||||
{
|
||||
lcd_clear();
|
||||
lcd_putsAtt(0, 0, "TESTgy,", SMLSIZE);
|
||||
lcd_putsAtt(10, 22, "TESTgy,", SMLSIZE|INVERS);
|
||||
lcd_filled_rect(8, 40, 100, 20);
|
||||
lcd_putsAtt(10, 42, "TESTgy,", SMLSIZE);
|
||||
EXPECT_TRUE(checkScreenshot("smlsize"));
|
||||
}
|
||||
|
||||
TEST(Lcd, Stdsize)
|
||||
{
|
||||
lcd_clear();
|
||||
lcd_putsAtt(0, 0, "TEST", 0);
|
||||
lcd_putsAtt(10, 22, "TEST", INVERS);
|
||||
lcd_filled_rect(8, 40, 100, 20);
|
||||
lcd_putsAtt(10, 42, "TEST", 0);
|
||||
EXPECT_TRUE(checkScreenshot("stdsize"));
|
||||
}
|
||||
|
||||
TEST(Lcd, Midsize)
|
||||
{
|
||||
lcd_clear();
|
||||
lcd_putsAtt(0, 0, "TEST", MIDSIZE);
|
||||
lcd_putsAtt(10, 22, "TEST", MIDSIZE|INVERS);
|
||||
lcd_filled_rect(8, 40, 100, 20);
|
||||
lcd_putsAtt(10, 42, "TEST", MIDSIZE);
|
||||
EXPECT_TRUE(checkScreenshot("midsize"));
|
||||
}
|
||||
|
||||
TEST(Lcd, Dblsize)
|
||||
{
|
||||
lcd_clear();
|
||||
lcd_putsAtt(2, 10, "TST", DBLSIZE);
|
||||
lcd_putsAtt(42, 10, "TST", DBLSIZE|INVERS);
|
||||
lcd_filled_rect(80, 8, 46, 24);
|
||||
lcd_putsAtt(82, 10, "TST", DBLSIZE);
|
||||
EXPECT_TRUE(checkScreenshot("dblsize"));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
After Width: | Height: | Size: 503 B |
|
After Width: | Height: | Size: 532 B |
@@ -50,6 +50,7 @@ void doMixerCalculations();
|
||||
|
||||
#define MODEL_RESET() \
|
||||
memset(&g_model, 0, sizeof(g_model)); \
|
||||
memset(&anaInValues, 0, sizeof(anaInValues)); \
|
||||
extern uint8_t s_mixer_first_run_done; \
|
||||
s_mixer_first_run_done = false; \
|
||||
lastFlightMode = 255;
|
||||
@@ -133,6 +134,33 @@ TEST(Trims, CopySticksToOffset)
|
||||
EXPECT_EQ(g_model.limitData[1].offset, -97);
|
||||
}
|
||||
|
||||
TEST(Trims, InstantTrim)
|
||||
{
|
||||
MODEL_RESET();
|
||||
modelDefault(0);
|
||||
anaInValues[AIL_STICK] = 50;
|
||||
instantTrim();
|
||||
EXPECT_EQ(25, getTrimValue(0, AIL_STICK));
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
TEST(Trims, InstantTrimNegativeCurve)
|
||||
{
|
||||
MODEL_RESET();
|
||||
modelDefault(0);
|
||||
ExpoData *expo = expoAddress(AIL_STICK);
|
||||
expo->curve.type = CURVE_REF_CUSTOM;
|
||||
expo->curve.value = 1;
|
||||
g_model.points[0] = -100;
|
||||
g_model.points[1] = -75;
|
||||
g_model.points[2] = -50;
|
||||
g_model.points[3] = -25;
|
||||
g_model.points[4] = 0;
|
||||
anaInValues[AIL_STICK] = 512;
|
||||
instantTrim();
|
||||
EXPECT_EQ(128, getTrimValue(0, AIL_STICK));
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(Curves, LinearIntpol)
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 389 B |
|
After Width: | Height: | Size: 559 B |
|
After Width: | Height: | Size: 596 B |
|
After Width: | Height: | Size: 483 B |
|
After Width: | Height: | Size: 507 B |