mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-25 09:15:21 +03:00
[Companion] Current calibration masked on Taranis
This commit is contained in:
parent
ff2c2d41ad
commit
17302fb6e0
28 changed files with 88 additions and 83 deletions
|
@ -312,10 +312,10 @@ QString Profile::speaker() const { return _speaker; }
|
||||||
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
||||||
QString Profile::timeStamp() const { return _timeStamp; }
|
QString Profile::timeStamp() const { return _timeStamp; }
|
||||||
QString Profile::trainerCalib() const { return _trainerCalib; }
|
QString Profile::trainerCalib() const { return _trainerCalib; }
|
||||||
int Profile::currentCalib() const { return _currentCalib; }
|
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
|
||||||
int Profile::gsStickMode() const { return _gsStickMode; }
|
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||||
int Profile::vBatCalib() const { return _vBatCalib; }
|
int Profile::txVoltageCalibration() const { return _txVoltageCalibration; }
|
||||||
int Profile::vBatWarn() const { return _vBatWarn; }
|
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||||
int Profile::vBatMin() const { return _vBatMin; }
|
int Profile::vBatMin() const { return _vBatMin; }
|
||||||
int Profile::vBatMax() const { return _vBatMax; }
|
int Profile::vBatMax() const { return _vBatMax; }
|
||||||
|
@ -342,10 +342,10 @@ 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::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::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::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"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::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));}
|
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::txVoltageCalibration (const int x) { store(x, _txVoltageCalibration, "VbatCalib","Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::vBatMin (const int x) { store(x, _vBatMin, "VbatMin" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::vBatMin (const int x) { store(x, _vBatMin, "VbatMin" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
void Profile::vBatMax (const int x) { store(x, _vBatMax, "VbatMax" ,"Profiles", QString("profile%1").arg(index));}
|
void Profile::vBatMax (const int x) { store(x, _vBatMax, "VbatMax" ,"Profiles", QString("profile%1").arg(index));}
|
||||||
|
@ -378,10 +378,10 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||||
speaker ( rhs.speaker() );
|
speaker ( rhs.speaker() );
|
||||||
stickPotCalib( rhs.stickPotCalib() );
|
stickPotCalib( rhs.stickPotCalib() );
|
||||||
trainerCalib ( rhs.trainerCalib() );
|
trainerCalib ( rhs.trainerCalib() );
|
||||||
currentCalib ( rhs.currentCalib() );
|
txCurrentCalibration ( rhs.txCurrentCalibration() );
|
||||||
gsStickMode ( rhs.gsStickMode() );
|
gsStickMode ( rhs.gsStickMode() );
|
||||||
ppmMultiplier( rhs.ppmMultiplier() );
|
ppmMultiplier( rhs.ppmMultiplier() );
|
||||||
vBatCalib ( rhs.vBatCalib() );
|
txVoltageCalibration ( rhs.txVoltageCalibration() );
|
||||||
vBatWarn ( rhs.vBatWarn() );
|
vBatWarn ( rhs.vBatWarn() );
|
||||||
vBatMin ( rhs.vBatMin() );
|
vBatMin ( rhs.vBatMin() );
|
||||||
vBatMax ( rhs.vBatMax() );
|
vBatMax ( rhs.vBatMax() );
|
||||||
|
@ -424,10 +424,10 @@ void Profile::initFwVariables()
|
||||||
_timeStamp = "";
|
_timeStamp = "";
|
||||||
_trainerCalib = "";
|
_trainerCalib = "";
|
||||||
|
|
||||||
_currentCalib = 0;
|
_txCurrentCalibration = 0;
|
||||||
_gsStickMode = 0;
|
_gsStickMode = 0;
|
||||||
_ppmMultiplier = 0;
|
_ppmMultiplier = 0;
|
||||||
_vBatCalib = 0;
|
_txVoltageCalibration = 0;
|
||||||
_vBatWarn = 0;
|
_vBatWarn = 0;
|
||||||
_vBatMin = 0;
|
_vBatMin = 0;
|
||||||
_vBatMax = 0;
|
_vBatMax = 0;
|
||||||
|
@ -483,10 +483,10 @@ void Profile::flush()
|
||||||
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _timeStamp, "TimeStamp" ,"" ,"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( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _currentCalib, "currentCalib" ,0 ,"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( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
getset( _txVoltageCalibration, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _vBatMin, "VbatMin" ,0 ,"Profiles", QString("profile%1").arg(index));
|
getset( _vBatMin, "VbatMin" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
getset( _vBatMax, "VbatMax" ,0 ,"Profiles", QString("profile%1").arg(index));
|
getset( _vBatMax, "VbatMax" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||||
|
|
|
@ -125,10 +125,10 @@ class Profile: protected CompStoreObj
|
||||||
QString _stickPotCalib;
|
QString _stickPotCalib;
|
||||||
QString _timeStamp;
|
QString _timeStamp;
|
||||||
QString _trainerCalib;
|
QString _trainerCalib;
|
||||||
int _currentCalib;
|
int _txCurrentCalibration;
|
||||||
int _gsStickMode;
|
int _gsStickMode;
|
||||||
int _ppmMultiplier;
|
int _ppmMultiplier;
|
||||||
int _vBatCalib;
|
int _txVoltageCalibration;
|
||||||
int _vBatWarn;
|
int _vBatWarn;
|
||||||
int _vBatMin;
|
int _vBatMin;
|
||||||
int _vBatMax;
|
int _vBatMax;
|
||||||
|
@ -156,10 +156,10 @@ class Profile: protected CompStoreObj
|
||||||
QString stickPotCalib() const;
|
QString stickPotCalib() const;
|
||||||
QString timeStamp() const;
|
QString timeStamp() const;
|
||||||
QString trainerCalib() const;
|
QString trainerCalib() const;
|
||||||
int currentCalib() const;
|
int txCurrentCalibration() const;
|
||||||
int gsStickMode() const;
|
int gsStickMode() const;
|
||||||
int ppmMultiplier() const;
|
int ppmMultiplier() const;
|
||||||
int vBatCalib() const;
|
int txVoltageCalibration() const;
|
||||||
int vBatWarn() const;
|
int vBatWarn() const;
|
||||||
int vBatMin() const;
|
int vBatMin() const;
|
||||||
int vBatMax() const;
|
int vBatMax() const;
|
||||||
|
@ -186,10 +186,10 @@ class Profile: protected CompStoreObj
|
||||||
void stickPotCalib (const QString);
|
void stickPotCalib (const QString);
|
||||||
void timeStamp (const QString);
|
void timeStamp (const QString);
|
||||||
void trainerCalib (const QString);
|
void trainerCalib (const QString);
|
||||||
void currentCalib (const int);
|
void txCurrentCalibration (const int);
|
||||||
void gsStickMode (const int);
|
void gsStickMode (const int);
|
||||||
void ppmMultiplier (const int);
|
void ppmMultiplier (const int);
|
||||||
void vBatCalib (const int);
|
void txVoltageCalibration (const int);
|
||||||
void vBatWarn (const int);
|
void vBatWarn (const int);
|
||||||
void vBatMin (const int);
|
void vBatMin (const int);
|
||||||
void vBatMax (const int);
|
void vBatMax (const int);
|
||||||
|
|
|
@ -1083,8 +1083,8 @@ GeneralSettings::GeneralSettings()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString t_trainercalib=g.profile[g.id()].trainerCalib();
|
QString t_trainercalib=g.profile[g.id()].trainerCalib();
|
||||||
int8_t t_vBatCalib=(int8_t)g.profile[g.id()].vBatCalib();
|
int8_t t_txVoltageCalibration=(int8_t)g.profile[g.id()].txVoltageCalibration();
|
||||||
int8_t t_currentCalib=(int8_t)g.profile[g.id()].currentCalib();
|
int8_t t_txCurrentCalibration=(int8_t)g.profile[g.id()].txCurrentCalibration();
|
||||||
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].ppmMultiplier();
|
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].ppmMultiplier();
|
||||||
uint8_t t_stickMode=(uint8_t)g.profile[g.id()].gsStickMode();
|
uint8_t t_stickMode=(uint8_t)g.profile[g.id()].gsStickMode();
|
||||||
uint8_t t_vBatWarn=(uint8_t)g.profile[g.id()].vBatWarn();
|
uint8_t t_vBatWarn=(uint8_t)g.profile[g.id()].vBatWarn();
|
||||||
|
@ -1118,8 +1118,8 @@ GeneralSettings::GeneralSettings()
|
||||||
if (ok)
|
if (ok)
|
||||||
trainer.calib[i]=byte16;
|
trainer.calib[i]=byte16;
|
||||||
}
|
}
|
||||||
currentCalib=t_currentCalib;
|
txCurrentCalibration=t_txCurrentCalibration;
|
||||||
vBatCalib=t_vBatCalib;
|
txVoltageCalibration=t_txVoltageCalibration;
|
||||||
vBatWarn=t_vBatWarn;
|
vBatWarn=t_vBatWarn;
|
||||||
PPM_Multiplier=t_PPM_Multiplier;
|
PPM_Multiplier=t_PPM_Multiplier;
|
||||||
stickMode = t_stickMode;
|
stickMode = t_stickMode;
|
||||||
|
|
|
@ -1139,7 +1139,8 @@ class GeneralSettings {
|
||||||
unsigned int currModel; // 0..15
|
unsigned int currModel; // 0..15
|
||||||
unsigned int contrast;
|
unsigned int contrast;
|
||||||
unsigned int vBatWarn;
|
unsigned int vBatWarn;
|
||||||
int vBatCalib;
|
int txVoltageCalibration;
|
||||||
|
int txCurrentCalibration;
|
||||||
int vBatMin;
|
int vBatMin;
|
||||||
int vBatMax;
|
int vBatMax;
|
||||||
int backlightMode;
|
int backlightMode;
|
||||||
|
@ -1187,7 +1188,6 @@ class GeneralSettings {
|
||||||
int speakerVolume;
|
int speakerVolume;
|
||||||
unsigned int backlightBright;
|
unsigned int backlightBright;
|
||||||
int switchesDelay;
|
int switchesDelay;
|
||||||
int currentCalib;
|
|
||||||
int temperatureCalib;
|
int temperatureCalib;
|
||||||
int temperatureWarn;
|
int temperatureWarn;
|
||||||
unsigned int mAhWarn;
|
unsigned int mAhWarn;
|
||||||
|
@ -1318,7 +1318,7 @@ enum Capability {
|
||||||
PPMCenter,
|
PPMCenter,
|
||||||
PPMUnitMicroseconds,
|
PPMUnitMicroseconds,
|
||||||
SYMLimits,
|
SYMLimits,
|
||||||
HasCurrentCalibration,
|
HastxCurrentCalibration,
|
||||||
HasVolume,
|
HasVolume,
|
||||||
HasBrightness,
|
HasBrightness,
|
||||||
PerModelTimers,
|
PerModelTimers,
|
||||||
|
|
|
@ -70,7 +70,7 @@ Er9xGeneral::operator GeneralSettings ()
|
||||||
result.currModel = currModel;
|
result.currModel = currModel;
|
||||||
result.contrast = contrast;
|
result.contrast = contrast;
|
||||||
result.vBatWarn = vBatWarn;
|
result.vBatWarn = vBatWarn;
|
||||||
result.vBatCalib = vBatCalib;
|
result.txVoltageCalibration = txVoltageCalibration;
|
||||||
result.trainer = trainer;
|
result.trainer = trainer;
|
||||||
result.blightinv=blightinv;
|
result.blightinv=blightinv;
|
||||||
result.stickScroll=stickScroll;
|
result.stickScroll=stickScroll;
|
||||||
|
|
|
@ -61,7 +61,7 @@ PACK(typedef struct t_Er9xGeneral {
|
||||||
uint8_t currModel; //0..15
|
uint8_t currModel; //0..15
|
||||||
uint8_t contrast;
|
uint8_t contrast;
|
||||||
uint8_t vBatWarn;
|
uint8_t vBatWarn;
|
||||||
int8_t vBatCalib;
|
int8_t txVoltageCalibration;
|
||||||
int8_t lightSw;
|
int8_t lightSw;
|
||||||
Er9xTrainerData trainer;
|
Er9xTrainerData trainer;
|
||||||
uint8_t view;
|
uint8_t view;
|
||||||
|
|
|
@ -82,7 +82,7 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||||
result.currModel = currModel;
|
result.currModel = currModel;
|
||||||
result.contrast = contrast;
|
result.contrast = contrast;
|
||||||
result.vBatWarn = vBatWarn;
|
result.vBatWarn = vBatWarn;
|
||||||
result.vBatCalib = vBatCalib;
|
result.txVoltageCalibration = txVoltageCalibration;
|
||||||
|
|
||||||
result.backlightMode = 0;
|
result.backlightMode = 0;
|
||||||
if (lightSw == 22) {
|
if (lightSw == 22) {
|
||||||
|
@ -135,7 +135,7 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||||
result.switchWarningStates = switchWarningStates;
|
result.switchWarningStates = switchWarningStates;
|
||||||
result.speakerVolume = volume;
|
result.speakerVolume = volume;
|
||||||
result.backlightBright = bright ;
|
result.backlightBright = bright ;
|
||||||
result.currentCalib = current_calib;
|
result.txCurrentCalibration = current_calib;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ PACK(typedef struct t_Ersky9xGeneral {
|
||||||
uint8_t currModel; //0..15
|
uint8_t currModel; //0..15
|
||||||
uint8_t contrast;
|
uint8_t contrast;
|
||||||
uint8_t vBatWarn;
|
uint8_t vBatWarn;
|
||||||
int8_t vBatCalib;
|
int8_t txVoltageCalibration;
|
||||||
int8_t lightSw;
|
int8_t lightSw;
|
||||||
Ersky9xTrainerData trainer;
|
Ersky9xTrainerData trainer;
|
||||||
uint8_t view;
|
uint8_t view;
|
||||||
|
|
|
@ -70,7 +70,7 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
|
||||||
result.currModel = currModel;
|
result.currModel = currModel;
|
||||||
result.contrast = contrast;
|
result.contrast = contrast;
|
||||||
result.vBatWarn = vBatWarn;
|
result.vBatWarn = vBatWarn;
|
||||||
result.vBatCalib = vBatCalib;
|
result.txVoltageCalibration = txVoltageCalibration;
|
||||||
|
|
||||||
result.backlightMode = 0;
|
result.backlightMode = 0;
|
||||||
if (lightSw == 22) {
|
if (lightSw == 22) {
|
||||||
|
@ -127,7 +127,7 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
|
||||||
result.currModel = currModel;
|
result.currModel = currModel;
|
||||||
result.contrast = contrast;
|
result.contrast = contrast;
|
||||||
result.vBatWarn = vBatWarn;
|
result.vBatWarn = vBatWarn;
|
||||||
result.vBatCalib = vBatCalib;
|
result.txVoltageCalibration = txVoltageCalibration;
|
||||||
|
|
||||||
result.backlightMode = 0;
|
result.backlightMode = 0;
|
||||||
if (lightSw == 22) {
|
if (lightSw == 22) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v103 {
|
||||||
uint8_t currModel; //0..15
|
uint8_t currModel; //0..15
|
||||||
uint8_t contrast;
|
uint8_t contrast;
|
||||||
uint8_t vBatWarn;
|
uint8_t vBatWarn;
|
||||||
int8_t vBatCalib;
|
int8_t txVoltageCalibration;
|
||||||
int8_t lightSw;
|
int8_t lightSw;
|
||||||
Gruvin9xTrainerData_v103 trainer;
|
Gruvin9xTrainerData_v103 trainer;
|
||||||
uint8_t view; //index of subview in main scrren
|
uint8_t view; //index of subview in main scrren
|
||||||
|
@ -106,7 +106,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v104 {
|
||||||
uint8_t currModel; //0..15
|
uint8_t currModel; //0..15
|
||||||
uint8_t contrast;
|
uint8_t contrast;
|
||||||
uint8_t vBatWarn;
|
uint8_t vBatWarn;
|
||||||
int8_t vBatCalib;
|
int8_t txVoltageCalibration;
|
||||||
int8_t lightSw;
|
int8_t lightSw;
|
||||||
Gruvin9xTrainerData_v104 trainer;
|
Gruvin9xTrainerData_v104 trainer;
|
||||||
uint8_t view; //index of subview in main scrren
|
uint8_t view; //index of subview in main scrren
|
||||||
|
|
|
@ -3299,7 +3299,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||||
internalField.Append(new UnsignedField<8>(generalData.currModel));
|
internalField.Append(new UnsignedField<8>(generalData.currModel));
|
||||||
internalField.Append(new UnsignedField<8>(generalData.contrast));
|
internalField.Append(new UnsignedField<8>(generalData.contrast));
|
||||||
internalField.Append(new UnsignedField<8>(generalData.vBatWarn));
|
internalField.Append(new UnsignedField<8>(generalData.vBatWarn));
|
||||||
internalField.Append(new SignedField<8>(generalData.vBatCalib));
|
internalField.Append(new SignedField<8>(generalData.txVoltageCalibration));
|
||||||
internalField.Append(new SignedField<8>(generalData.backlightMode));
|
internalField.Append(new SignedField<8>(generalData.backlightMode));
|
||||||
|
|
||||||
for (int i=0; i<NUM_STICKS; i++)
|
for (int i=0; i<NUM_STICKS; i++)
|
||||||
|
@ -3383,7 +3383,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||||
|
|
||||||
if (IS_ARM(board)) {
|
if (IS_ARM(board)) {
|
||||||
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
|
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
|
||||||
internalField.Append(new SignedField<8>(generalData.currentCalib));
|
internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
|
||||||
if (version >= 213) {
|
if (version >= 213) {
|
||||||
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
||||||
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
|
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
|
||||||
|
|
|
@ -710,7 +710,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||||
return (IS_ARM(board) && !IS_9XRPRO(board)) ? 2 : 1;
|
return (IS_ARM(board) && !IS_9XRPRO(board)) ? 2 : 1;
|
||||||
case HasPPMStart:
|
case HasPPMStart:
|
||||||
return (IS_ARM(board) ? true : false);
|
return (IS_ARM(board) ? true : false);
|
||||||
case HasCurrentCalibration:
|
case HastxCurrentCalibration:
|
||||||
return (IS_SKY9X(board) ? true : false);
|
return (IS_SKY9X(board) ? true : false);
|
||||||
case HasVolume:
|
case HasVolume:
|
||||||
return (IS_ARM(board) ? true : false);
|
return (IS_ARM(board) ? true : false);
|
||||||
|
|
|
@ -62,7 +62,7 @@ Th9xGeneral::operator GeneralSettings ()
|
||||||
result.currModel = currModel;
|
result.currModel = currModel;
|
||||||
result.contrast = contrast;
|
result.contrast = contrast;
|
||||||
result.vBatWarn = vBatWarn;
|
result.vBatWarn = vBatWarn;
|
||||||
result.vBatCalib = vBatCalib;
|
result.txVoltageCalibration = txVoltageCalibration;
|
||||||
// result.lightSw = th9xToSwitch(lightSw);
|
// result.lightSw = th9xToSwitch(lightSw);
|
||||||
result.trainer = trainer;
|
result.trainer = trainer;
|
||||||
result.view = view;
|
result.view = view;
|
||||||
|
|
|
@ -64,7 +64,7 @@ PACK(typedef struct t_Th9xGeneral {
|
||||||
uint8_t currModel; //0..15
|
uint8_t currModel; //0..15
|
||||||
uint8_t contrast;
|
uint8_t contrast;
|
||||||
uint8_t vBatWarn;
|
uint8_t vBatWarn;
|
||||||
int8_t vBatCalib;
|
int8_t txVoltageCalibration;
|
||||||
int8_t lightSw;
|
int8_t lightSw;
|
||||||
Th9xTrainerData trainer;
|
Th9xTrainerData trainer;
|
||||||
uint8_t adcFilt:2;
|
uint8_t adcFilt:2;
|
||||||
|
|
|
@ -175,8 +175,8 @@ bool FlashEEpromDialog::patchCalibration()
|
||||||
QString calib = g.profile[g.id()].stickPotCalib();
|
QString calib = g.profile[g.id()].stickPotCalib();
|
||||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||||
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
||||||
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
|
int8_t txVoltageCalibration=(int8_t) g.profile[g.id()].txVoltageCalibration();
|
||||||
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
|
int8_t txCurrentCalibration=(int8_t) g.profile[g.id()].txCurrentCalibration();
|
||||||
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
||||||
|
|
||||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||||
|
@ -204,8 +204,8 @@ bool FlashEEpromDialog::patchCalibration()
|
||||||
radioData->generalSettings.trainer.calib[i] = byte16;
|
radioData->generalSettings.trainer.calib[i] = byte16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
radioData->generalSettings.currentCalib = currentCalib;
|
radioData->generalSettings.txCurrentCalibration = txCurrentCalibration;
|
||||||
radioData->generalSettings.vBatCalib = vBatCalib;
|
radioData->generalSettings.txVoltageCalibration = txVoltageCalibration;
|
||||||
radioData->generalSettings.PPM_Multiplier = PPM_Multiplier;
|
radioData->generalSettings.PPM_Multiplier = PPM_Multiplier;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,11 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
|
||||||
ui->serialPortLabel->hide();
|
ui->serialPortLabel->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!IS_SKY9X(firmware->getBoard())) {
|
||||||
|
ui->txCurrentCalibration->hide();
|
||||||
|
ui->txCurrentCalibrationLabel->hide();
|
||||||
|
}
|
||||||
|
|
||||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||||
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
|
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
|
||||||
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
|
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
|
||||||
|
@ -214,9 +219,9 @@ void CalibrationPanel::on_PPM4_editingFinished()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CalibrationPanel::on_CurrentCalib_SB_editingFinished()
|
void CalibrationPanel::on_txCurrentCalibration_editingFinished()
|
||||||
{
|
{
|
||||||
generalSettings.currentCalib = ui->CurrentCalib_SB->value();
|
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,8 +233,8 @@ void CalibrationPanel::on_bluetoothEnable_stateChanged(int)
|
||||||
|
|
||||||
void CalibrationPanel::setValues()
|
void CalibrationPanel::setValues()
|
||||||
{
|
{
|
||||||
ui->battCalibDSB->setValue((double)generalSettings.vBatCalib/10);
|
ui->txVoltageCalibration->setValue((double)generalSettings.txVoltageCalibration/10);
|
||||||
ui->CurrentCalib_SB->setValue((double)generalSettings.currentCalib);
|
ui->txCurrentCalibration->setValue((double)generalSettings.txCurrentCalibration);
|
||||||
|
|
||||||
ui->ana1Neg->setValue(generalSettings.calibSpanNeg[0]);
|
ui->ana1Neg->setValue(generalSettings.calibSpanNeg[0]);
|
||||||
ui->ana2Neg->setValue(generalSettings.calibSpanNeg[1]);
|
ui->ana2Neg->setValue(generalSettings.calibSpanNeg[1]);
|
||||||
|
@ -265,9 +270,9 @@ void CalibrationPanel::setValues()
|
||||||
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
|
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibrationPanel::on_battCalibDSB_editingFinished()
|
void CalibrationPanel::on_txVoltageCalibration_editingFinished()
|
||||||
{
|
{
|
||||||
generalSettings.vBatCalib = ui->battCalibDSB->value()*10;
|
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,14 +21,14 @@ class CalibrationPanel : public GeneralPanel
|
||||||
// virtual void update();
|
// virtual void update();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_battCalibDSB_editingFinished();
|
void on_txVoltageCalibration_editingFinished();
|
||||||
void on_PPM1_editingFinished();
|
void on_PPM1_editingFinished();
|
||||||
void on_PPM2_editingFinished();
|
void on_PPM2_editingFinished();
|
||||||
void on_PPM3_editingFinished();
|
void on_PPM3_editingFinished();
|
||||||
void on_PPM4_editingFinished();
|
void on_PPM4_editingFinished();
|
||||||
void on_PPM_MultiplierDSB_editingFinished();
|
void on_PPM_MultiplierDSB_editingFinished();
|
||||||
|
|
||||||
void on_CurrentCalib_SB_editingFinished();
|
void on_txCurrentCalibration_editingFinished();
|
||||||
void on_bluetoothEnable_stateChanged(int);
|
void on_bluetoothEnable_stateChanged(int);
|
||||||
|
|
||||||
void on_ana1Neg_editingFinished();
|
void on_ana1Neg_editingFinished();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>805</width>
|
<width>805</width>
|
||||||
<height>1269</height>
|
<height>1313</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -562,14 +562,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="42" column="0">
|
<item row="42" column="0">
|
||||||
<widget class="QLabel" name="label_22">
|
<widget class="QLabel" name="txVoltageCalibrationLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Battery</string>
|
<string>Battery Offset</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="42" column="1">
|
<item row="42" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="battCalibDSB">
|
<widget class="QDoubleSpinBox" name="txVoltageCalibration">
|
||||||
<property name="statusTip">
|
<property name="statusTip">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
|
@ -674,7 +674,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="43" column="1">
|
<item row="43" column="1">
|
||||||
<widget class="QSpinBox" name="CurrentCalib_SB">
|
<widget class="QSpinBox" name="txCurrentCalibration">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-49</number>
|
<number>-49</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -698,9 +698,9 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="43" column="0">
|
<item row="43" column="0">
|
||||||
<widget class="QLabel" name="label_CurrentCalib">
|
<widget class="QLabel" name="txCurrentCalibrationLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Current</string>
|
<string>Current Offset</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -88,8 +88,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString trainercalib = g.profile[profile_id].trainerCalib();
|
QString trainercalib = g.profile[profile_id].trainerCalib();
|
||||||
int8_t vBatCalib = (int8_t)g.profile[profile_id].vBatCalib();
|
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
|
||||||
int8_t currentCalib = (int8_t)g.profile[profile_id].currentCalib();
|
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
|
||||||
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
|
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
|
||||||
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode();
|
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode();
|
||||||
uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn();
|
uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn();
|
||||||
|
@ -123,8 +123,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||||
if (ok)
|
if (ok)
|
||||||
generalSettings.trainer.calib[i]=byte16;
|
generalSettings.trainer.calib[i]=byte16;
|
||||||
}
|
}
|
||||||
generalSettings.currentCalib=currentCalib;
|
generalSettings.txCurrentCalibration=txCurrentCalibration;
|
||||||
generalSettings.vBatCalib=vBatCalib;
|
generalSettings.txVoltageCalibration=txVoltageCalibration;
|
||||||
generalSettings.vBatWarn=vBatWarn;
|
generalSettings.vBatWarn=vBatWarn;
|
||||||
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||||
generalSettings.vBatMin = (int8_t) g.profile[profile_id].vBatMin();
|
generalSettings.vBatMin = (int8_t) g.profile[profile_id].vBatMin();
|
||||||
|
@ -225,8 +225,8 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||||
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
|
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
|
||||||
}
|
}
|
||||||
g.profile[profile_id].trainerCalib( calib );
|
g.profile[profile_id].trainerCalib( calib );
|
||||||
g.profile[profile_id].vBatCalib( generalSettings.vBatCalib );
|
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
|
||||||
g.profile[profile_id].currentCalib( generalSettings.currentCalib );
|
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
|
||||||
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
||||||
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||||
g.profile[profile_id].vBatMin( generalSettings.vBatMin );
|
g.profile[profile_id].vBatMin( generalSettings.vBatMin );
|
||||||
|
|
|
@ -69,7 +69,7 @@ void saveGeneralSettings(GeneralSettings & settings, global_settings & gs)
|
||||||
|
|
||||||
// TODO BSS settings.currModel;
|
// TODO BSS settings.currModel;
|
||||||
gs.contrast(settings.contrast);
|
gs.contrast(settings.contrast);
|
||||||
gs.battery(battery(settings.vBatCalib, settings.vBatWarn));
|
gs.battery(battery(settings.txVoltageCalibration, settings.vBatWarn));
|
||||||
|
|
||||||
gs.ppm_input_calibration(ppm_input_calibration(settings.PPM_Multiplier,
|
gs.ppm_input_calibration(ppm_input_calibration(settings.PPM_Multiplier,
|
||||||
PPMCalibration(settings.trainer.calib[0]),
|
PPMCalibration(settings.trainer.calib[0]),
|
||||||
|
|
|
@ -626,7 +626,7 @@ PACK(typedef struct {
|
||||||
int8_t currModel;
|
int8_t currModel;
|
||||||
uint8_t contrast;
|
uint8_t contrast;
|
||||||
uint8_t vBatWarn;
|
uint8_t vBatWarn;
|
||||||
int8_t vBatCalib;
|
int8_t txVoltageCalibration;
|
||||||
int8_t backlightMode;
|
int8_t backlightMode;
|
||||||
TrainerData trainer;
|
TrainerData trainer;
|
||||||
uint8_t view; // index of view in main screen
|
uint8_t view; // index of view in main screen
|
||||||
|
@ -659,7 +659,7 @@ PACK(typedef struct {
|
||||||
int8_t vBatMin;
|
int8_t vBatMin;
|
||||||
int8_t vBatMax;
|
int8_t vBatMax;
|
||||||
uint8_t backlightBright;
|
uint8_t backlightBright;
|
||||||
int8_t currentCalib;
|
int8_t txCurrentCalibration;
|
||||||
int8_t temperatureWarn;
|
int8_t temperatureWarn;
|
||||||
uint8_t mAhWarn;
|
uint8_t mAhWarn;
|
||||||
uint16_t mAhUsed;
|
uint16_t mAhUsed;
|
||||||
|
|
|
@ -77,7 +77,7 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
lcd_putsLeft(MENU_HEADER_HEIGHT+1+4*FH, STR_BATT_CALIB);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+1+4*FH, STR_BATT_CALIB);
|
||||||
static int32_t adcBatt;
|
static int32_t adcBatt;
|
||||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
||||||
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128) * 4191;
|
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.txVoltageCalibration)/128) * 4191;
|
||||||
batCalV /= 55296;
|
batCalV /= 55296;
|
||||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+4*FH, batCalV, (m_posVert==1 ? INVERS : 0));
|
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+4*FH, batCalV, (m_posVert==1 ? INVERS : 0));
|
||||||
#elif defined(PCBGRUVIN9X)
|
#elif defined(PCBGRUVIN9X)
|
||||||
|
@ -85,18 +85,18 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
// Gruvin wants 2 decimal places and instant update of volts calib field when button pressed
|
// Gruvin wants 2 decimal places and instant update of volts calib field when button pressed
|
||||||
static uint16_t adcBatt;
|
static uint16_t adcBatt;
|
||||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8; // running average, sourced directly (to avoid unending debate :P)
|
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8; // running average, sourced directly (to avoid unending debate :P)
|
||||||
uint32_t batCalV = ((uint32_t)adcBatt*1390 + (10*(int32_t)adcBatt*g_eeGeneral.vBatCalib)/8) / BandGap;
|
uint32_t batCalV = ((uint32_t)adcBatt*1390 + (10*(int32_t)adcBatt*g_eeGeneral.txVoltageCalibration)/8) / BandGap;
|
||||||
lcd_outdezNAtt(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, batCalV, PREC2|(m_posVert==1 ? INVERS : 0));
|
lcd_outdezNAtt(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, batCalV, PREC2|(m_posVert==1 ? INVERS : 0));
|
||||||
#else
|
#else
|
||||||
lcd_putsLeft(6*FH-2, STR_BATT_CALIB);
|
lcd_putsLeft(6*FH-2, STR_BATT_CALIB);
|
||||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, g_vbat100mV, (m_posVert==1 ? INVERS : 0));
|
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, 6*FH-2, g_vbat100mV, (m_posVert==1 ? INVERS : 0));
|
||||||
#endif
|
#endif
|
||||||
if (m_posVert==1) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatCalib, -127, 127);
|
if (m_posVert==1) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
|
||||||
|
|
||||||
#if defined(PCBSKY9X) && !defined(REVA)
|
#if defined(PCBSKY9X) && !defined(REVA)
|
||||||
lcd_putsLeft(6*FH+1, STR_CURRENT_CALIB);
|
lcd_putsLeft(6*FH+1, STR_CURRENT_CALIB);
|
||||||
putsValueWithUnit(LEN_CALIB_FIELDS*FW+4*FW, 6*FH+1, getCurrent(), UNIT_MILLIAMPS, (m_posVert==2 ? INVERS : 0)) ;
|
putsValueWithUnit(LEN_CALIB_FIELDS*FW+4*FW, 6*FH+1, getCurrent(), UNIT_MILLIAMPS, (m_posVert==2 ? INVERS : 0)) ;
|
||||||
if (m_posVert==2) CHECK_INCDEC_GENVAR(event, g_eeGeneral.currentCalib, -49, 49);
|
if (m_posVert==2) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txCurrentCalibration, -49, 49);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBSKY9X)
|
#if defined(PCBSKY9X)
|
||||||
|
|
|
@ -226,8 +226,8 @@ void displayVoltageOrAlarm()
|
||||||
if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) {
|
if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) {
|
||||||
putsValueWithUnit(6*FW-1, 2*FH, getTemperature(), UNIT_TEMPERATURE, BLINK|INVERS|DBLSIZE);
|
putsValueWithUnit(6*FW-1, 2*FH, getTemperature(), UNIT_TEMPERATURE, BLINK|INVERS|DBLSIZE);
|
||||||
}
|
}
|
||||||
else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.currentCalib)/8192/36) / 500 >= g_eeGeneral.mAhWarn) {
|
else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.txCurrentCalibration)/8192/36) / 500 >= g_eeGeneral.mAhWarn) {
|
||||||
putsValueWithUnit(7*FW-1, 2*FH, (g_eeGeneral.mAhUsed + Current_used*(488 + g_eeGeneral.currentCalib)/8192/36)/10, UNIT_MAH, BLINK|INVERS|DBLSIZE);
|
putsValueWithUnit(7*FW-1, 2*FH, (g_eeGeneral.mAhUsed + Current_used*(488 + g_eeGeneral.txCurrentCalibration)/8192/36)/10, UNIT_MAH, BLINK|INVERS|DBLSIZE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
displayBattVoltage();
|
displayBattVoltage();
|
||||||
|
|
|
@ -155,7 +155,7 @@ void menuStatisticsDebug(uint8_t event)
|
||||||
// current
|
// current
|
||||||
lcd_putsLeft(MENU_DEBUG_Y_CURRENT, STR_CPU_CURRENT);
|
lcd_putsLeft(MENU_DEBUG_Y_CURRENT, STR_CPU_CURRENT);
|
||||||
putsValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_CURRENT, getCurrent(), UNIT_MILLIAMPS, LEFT);
|
putsValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_CURRENT, getCurrent(), UNIT_MILLIAMPS, LEFT);
|
||||||
uint32_t current_scale = 488 + g_eeGeneral.currentCalib;
|
uint32_t current_scale = 488 + g_eeGeneral.txCurrentCalibration;
|
||||||
lcd_putc(MENU_DEBUG_COL2_OFS, MENU_DEBUG_Y_CURRENT, '>');
|
lcd_putc(MENU_DEBUG_COL2_OFS, MENU_DEBUG_Y_CURRENT, '>');
|
||||||
putsValueWithUnit(MENU_DEBUG_COL2_OFS+FW+1, MENU_DEBUG_Y_CURRENT, Current_max*10*current_scale/8192, UNIT_RAW, LEFT);
|
putsValueWithUnit(MENU_DEBUG_COL2_OFS+FW+1, MENU_DEBUG_Y_CURRENT, Current_max*10*current_scale/8192, UNIT_RAW, LEFT);
|
||||||
// consumption
|
// consumption
|
||||||
|
|
|
@ -62,9 +62,9 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
lcd_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_BATT_CALIB);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_BATT_CALIB);
|
||||||
static int32_t adcBatt;
|
static int32_t adcBatt;
|
||||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
||||||
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.vBatCalib)/128) * BATT_SCALE;
|
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.txVoltageCalibration)/128) * BATT_SCALE;
|
||||||
batCalV >>= 11;
|
batCalV >>= 11;
|
||||||
batCalV += 2; // because of the diode
|
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+5*FH, batCalV, s_editMode > 0 ? BLINK|INVERS : INVERS);
|
||||||
if (s_editMode > 0) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatCalib, -127, 127);
|
if (s_editMode > 0) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
|
||||||
}
|
}
|
||||||
|
|
|
@ -328,7 +328,7 @@ enum BeeperMode {
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
#define EXTRA_GENERAL_FIELDS_ARM \
|
#define EXTRA_GENERAL_FIELDS_ARM \
|
||||||
uint8_t backlightBright; \
|
uint8_t backlightBright; \
|
||||||
int8_t currentCalib; \
|
int8_t txCurrentCalibration; \
|
||||||
int8_t temperatureWarn; \
|
int8_t temperatureWarn; \
|
||||||
uint8_t mAhWarn; \
|
uint8_t mAhWarn; \
|
||||||
uint16_t mAhUsed; \
|
uint16_t mAhUsed; \
|
||||||
|
@ -754,7 +754,7 @@ PACK(typedef struct {
|
||||||
int8_t currModel;
|
int8_t currModel;
|
||||||
uint8_t contrast;
|
uint8_t contrast;
|
||||||
uint8_t vBatWarn;
|
uint8_t vBatWarn;
|
||||||
int8_t vBatCalib;
|
int8_t txVoltageCalibration;
|
||||||
int8_t backlightMode;
|
int8_t backlightMode;
|
||||||
TrainerData trainer;
|
TrainerData trainer;
|
||||||
uint8_t view; // index of view in main screen
|
uint8_t view; // index of view in main screen
|
||||||
|
|
|
@ -1881,7 +1881,7 @@ void opentxClose()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBSKY9X)
|
#if defined(PCBSKY9X)
|
||||||
uint32_t mAhUsed = g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.currentCalib) / 8192 / 36;
|
uint32_t mAhUsed = g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.txCurrentCalibration) / 8192 / 36;
|
||||||
if (g_eeGeneral.mAhUsed != mAhUsed) {
|
if (g_eeGeneral.mAhUsed != mAhUsed) {
|
||||||
g_eeGeneral.mAhUsed = mAhUsed;
|
g_eeGeneral.mAhUsed = mAhUsed;
|
||||||
}
|
}
|
||||||
|
@ -2008,16 +2008,16 @@ void checkBattery()
|
||||||
counter = 10;
|
counter = 10;
|
||||||
int32_t instant_vbat = anaIn(TX_VOLTAGE);
|
int32_t instant_vbat = anaIn(TX_VOLTAGE);
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
instant_vbat = (instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128) * BATT_SCALE;
|
instant_vbat = (instant_vbat + instant_vbat*(g_eeGeneral.txVoltageCalibration)/128) * BATT_SCALE;
|
||||||
instant_vbat >>= 11;
|
instant_vbat >>= 11;
|
||||||
instant_vbat += 2; // because of the diode
|
instant_vbat += 2; // because of the diode
|
||||||
#elif defined(PCBSKY9X)
|
#elif defined(PCBSKY9X)
|
||||||
instant_vbat = (instant_vbat + instant_vbat*(g_eeGeneral.vBatCalib)/128) * 4191;
|
instant_vbat = (instant_vbat + instant_vbat*(g_eeGeneral.txVoltageCalibration)/128) * 4191;
|
||||||
instant_vbat /= 55296;
|
instant_vbat /= 55296;
|
||||||
#elif defined(CPUM2560)
|
#elif defined(CPUM2560)
|
||||||
instant_vbat = (instant_vbat*1112 + instant_vbat*g_eeGeneral.vBatCalib + (BandGap<<2)) / (BandGap<<3);
|
instant_vbat = (instant_vbat*1112 + instant_vbat*g_eeGeneral.txVoltageCalibration + (BandGap<<2)) / (BandGap<<3);
|
||||||
#else
|
#else
|
||||||
instant_vbat = (instant_vbat*16 + instant_vbat*g_eeGeneral.vBatCalib/8) / BandGap;
|
instant_vbat = (instant_vbat*16 + instant_vbat*g_eeGeneral.txVoltageCalibration/8) / BandGap;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint8_t s_batCheck;
|
static uint8_t s_batCheck;
|
||||||
|
@ -2056,7 +2056,7 @@ void checkBattery()
|
||||||
else if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) {
|
else if (g_eeGeneral.temperatureWarn && getTemperature() >= g_eeGeneral.temperatureWarn) {
|
||||||
AUDIO_TX_TEMP_HIGH();
|
AUDIO_TX_TEMP_HIGH();
|
||||||
}
|
}
|
||||||
else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.currentCalib)/8192/36) / 500 >= g_eeGeneral.mAhWarn) {
|
else if (g_eeGeneral.mAhWarn && (g_eeGeneral.mAhUsed + Current_used * (488 + g_eeGeneral.txCurrentCalibration)/8192/36) / 500 >= g_eeGeneral.mAhWarn) {
|
||||||
AUDIO_TX_MAH_HIGH();
|
AUDIO_TX_MAH_HIGH();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -603,7 +603,7 @@ uint16_t getCurrent()
|
||||||
Current_count = 0 ;
|
Current_count = 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t current_scale = 488 + g_eeGeneral.currentCalib ;
|
uint32_t current_scale = 488 + g_eeGeneral.txCurrentCalibration ;
|
||||||
return (current_scale * Current) / 8192;
|
return (current_scale * Current) / 8192;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue