mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
Brightness adjust from backlight function (#7680)
Adjust brightness from backlight function
This commit is contained in:
parent
ac9f510005
commit
035cc6c031
16 changed files with 76 additions and 46 deletions
|
@ -159,24 +159,24 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||||
if (func <= FuncInstantTrim) {
|
if (func <= FuncInstantTrim) {
|
||||||
return QString("%1").arg(param);
|
return QString("%1").arg(param);
|
||||||
}
|
}
|
||||||
else if (func==FuncLogs) {
|
else if (func == FuncLogs) {
|
||||||
return QString("%1").arg(param/10.0) + tr("s");
|
return QString("%1").arg(param/10.0) + tr("s");
|
||||||
}
|
}
|
||||||
else if (func==FuncPlaySound) {
|
else if (func == FuncPlaySound) {
|
||||||
CustomFunctionData::populatePlaySoundParams(qs);
|
CustomFunctionData::populatePlaySoundParams(qs);
|
||||||
if (param>=0 && param<(int)qs.count())
|
if (param>=0 && param<(int)qs.count())
|
||||||
return qs.at(param);
|
return qs.at(param);
|
||||||
else
|
else
|
||||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||||
}
|
}
|
||||||
else if (func==FuncPlayHaptic) {
|
else if (func == FuncPlayHaptic) {
|
||||||
CustomFunctionData::populateHapticParams(qs);
|
CustomFunctionData::populateHapticParams(qs);
|
||||||
if (param>=0 && param<(int)qs.count())
|
if (param>=0 && param<(int)qs.count())
|
||||||
return qs.at(param);
|
return qs.at(param);
|
||||||
else
|
else
|
||||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||||
}
|
}
|
||||||
else if (func==FuncReset) {
|
else if (func == FuncReset) {
|
||||||
QComboBox cb;
|
QComboBox cb;
|
||||||
CustomFunctionData::populateResetParams(model, &cb);
|
CustomFunctionData::populateResetParams(model, &cb);
|
||||||
int pos = cb.findData(param);
|
int pos = cb.findData(param);
|
||||||
|
@ -185,11 +185,11 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||||
else
|
else
|
||||||
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
return tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||||
}
|
}
|
||||||
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
|
else if (func == FuncVolume || func == FuncPlayValue || func == FuncBacklight) {
|
||||||
RawSource item(param);
|
RawSource item(param);
|
||||||
return item.toString(model);
|
return item.toString(model);
|
||||||
}
|
}
|
||||||
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
|
else if (func == FuncPlayPrompt || func == FuncPlayBoth) {
|
||||||
if ( getCurrentFirmware()->getCapability(VoicesAsNumbers)) {
|
if ( getCurrentFirmware()->getCapability(VoicesAsNumbers)) {
|
||||||
return QString("%1").arg(param);
|
return QString("%1").arg(param);
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||||
return paramarm;
|
return paramarm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((func>=FuncAdjustGV1) && (func<FuncCount)) {
|
else if (func >= FuncAdjustGV1 && func < FuncCount) {
|
||||||
switch (adjustMode) {
|
switch (adjustMode) {
|
||||||
case FUNC_ADJUST_GVAR_CONSTANT:
|
case FUNC_ADJUST_GVAR_CONSTANT:
|
||||||
return tr("Value ")+QString("%1").arg(param);
|
return tr("Value ")+QString("%1").arg(param);
|
||||||
|
@ -231,11 +231,12 @@ QString CustomFunctionData::repeatToString() const
|
||||||
|
|
||||||
QString CustomFunctionData::enabledToString() const
|
QString CustomFunctionData::enabledToString() const
|
||||||
{
|
{
|
||||||
if ((func>=FuncOverrideCH1 && func<=FuncOverrideCH32) ||
|
if ((func >= FuncOverrideCH1 && func <= FuncOverrideCH32) ||
|
||||||
(func>=FuncAdjustGV1 && func<=FuncAdjustGVLast) ||
|
(func >= FuncAdjustGV1 && func <= FuncAdjustGVLast) ||
|
||||||
(func==FuncReset) ||
|
(func == FuncReset) ||
|
||||||
(func>=FuncSetTimer1 && func<=FuncSetTimer2) ||
|
(func >= FuncSetTimer1 && func <= FuncSetTimer2) ||
|
||||||
(func==FuncVolume) ||
|
(func == FuncVolume) ||
|
||||||
|
(func == FuncBacklight) ||
|
||||||
(func <= FuncInstantTrim)) {
|
(func <= FuncInstantTrim)) {
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
return tr("DISABLED");
|
return tr("DISABLED");
|
||||||
|
@ -249,7 +250,7 @@ void CustomFunctionData::convert(RadioDataConversionState & cstate)
|
||||||
cstate.setComponent(tr("CFN"), 8);
|
cstate.setComponent(tr("CFN"), 8);
|
||||||
cstate.setSubComp(nameToString(cstate.subCompIdx, (cstate.toModel() ? false : true)));
|
cstate.setSubComp(nameToString(cstate.subCompIdx, (cstate.toModel() ? false : true)));
|
||||||
swtch.convert(cstate);
|
swtch.convert(cstate);
|
||||||
if (func == FuncVolume || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) {
|
if (func == FuncVolume || func == FuncBacklight || func == FuncPlayValue || (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast && adjustMode == 1)) {
|
||||||
param = RawSource(param).convert(cstate.withComponentField("PARAM")).toValue();
|
param = RawSource(param).convert(cstate.withComponentField("PARAM")).toValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -718,7 +718,7 @@ int ModelData::updateReference()
|
||||||
updateAssignFunc(cfd);
|
updateAssignFunc(cfd);
|
||||||
if (!cfd->isEmpty()) {
|
if (!cfd->isEmpty()) {
|
||||||
updateSwitchRef(cfd->swtch);
|
updateSwitchRef(cfd->swtch);
|
||||||
if (cfd->func == FuncVolume || cfd->func == FuncPlayValue || (cfd->func >= FuncAdjustGV1 && cfd->func <= FuncAdjustGVLast && (cfd->adjustMode == FUNC_ADJUST_GVAR_GVAR || cfd->adjustMode == FUNC_ADJUST_GVAR_SOURCE))) {
|
if (cfd->func == FuncVolume || cfd->func == FuncBacklight || cfd->func == FuncPlayValue || (cfd->func >= FuncAdjustGV1 && cfd->func <= FuncAdjustGVLast && (cfd->adjustMode == FUNC_ADJUST_GVAR_GVAR || cfd->adjustMode == FUNC_ADJUST_GVAR_SOURCE))) {
|
||||||
updateSourceIntRef(cfd->param);
|
updateSourceIntRef(cfd->param);
|
||||||
if (cfd->param == 0)
|
if (cfd->param == 0)
|
||||||
cfd->clear();
|
cfd->clear();
|
||||||
|
|
|
@ -462,7 +462,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||||
else if (func >= FuncSetFailsafeInternalModule && func <= FuncBindExternalModule) {
|
else if (func >= FuncSetFailsafeInternalModule && func <= FuncBindExternalModule) {
|
||||||
widgetsMask |= CUSTOM_FUNCTION_ENABLE;
|
widgetsMask |= CUSTOM_FUNCTION_ENABLE;
|
||||||
}
|
}
|
||||||
else if (func == FuncVolume) {
|
else if (func == FuncVolume || func == FuncBacklight) {
|
||||||
if (modified)
|
if (modified)
|
||||||
cfn.param = fswtchParamT[i]->currentData().toInt();
|
cfn.param = fswtchParamT[i]->currentData().toInt();
|
||||||
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
|
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
|
||||||
|
@ -554,12 +554,6 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||||
}
|
}
|
||||||
Helpers::populateFileComboBox(fswtchParamArmT[i], scriptsSet, cfn.paramarm);
|
Helpers::populateFileComboBox(fswtchParamArmT[i], scriptsSet, cfn.paramarm);
|
||||||
}
|
}
|
||||||
else if (func == FuncBacklight && IS_TARANIS_PLUS(getCurrentBoard())) {
|
|
||||||
if (modified)
|
|
||||||
cfn.param = (uint8_t)fswtchBLcolor[i]->value();
|
|
||||||
fswtchBLcolor[i]->setValue(cfn.param);
|
|
||||||
widgetsMask |= CUSTOM_FUNCTION_BL_COLOR;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
if (modified)
|
if (modified)
|
||||||
cfn.param = fswtchParam[i]->value();
|
cfn.param = fswtchParam[i]->value();
|
||||||
|
@ -701,28 +695,28 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, uint function, unsi
|
||||||
{
|
{
|
||||||
QStringList qs;
|
QStringList qs;
|
||||||
b->setModel(new QStandardItemModel(b)); // clear combo box but not any shared item model
|
b->setModel(new QStandardItemModel(b)); // clear combo box but not any shared item model
|
||||||
if (function==FuncPlaySound) {
|
if (function == FuncPlaySound) {
|
||||||
CustomFunctionData::populatePlaySoundParams(qs);
|
CustomFunctionData::populatePlaySoundParams(qs);
|
||||||
b->addItems(qs);
|
b->addItems(qs);
|
||||||
b->setCurrentIndex(value);
|
b->setCurrentIndex(value);
|
||||||
}
|
}
|
||||||
else if (function==FuncPlayHaptic) {
|
else if (function == FuncPlayHaptic) {
|
||||||
CustomFunctionData::populateHapticParams(qs);
|
CustomFunctionData::populateHapticParams(qs);
|
||||||
b->addItems(qs);
|
b->addItems(qs);
|
||||||
b->setCurrentIndex(value);
|
b->setCurrentIndex(value);
|
||||||
}
|
}
|
||||||
else if (function==FuncReset) {
|
else if (function == FuncReset) {
|
||||||
CustomFunctionData::populateResetParams(model, b, value);
|
CustomFunctionData::populateResetParams(model, b, value);
|
||||||
}
|
}
|
||||||
else if (function==FuncVolume) {
|
else if (function == FuncVolume || function == FuncBacklight) {
|
||||||
b->setModel(rawSrcInputsItemModel);
|
b->setModel(rawSrcInputsItemModel);
|
||||||
b->setCurrentIndex(b->findData(value));
|
b->setCurrentIndex(b->findData(value));
|
||||||
}
|
}
|
||||||
else if (function==FuncPlayValue) {
|
else if (function == FuncPlayValue) {
|
||||||
b->setModel(rawSrcAllItemModel);
|
b->setModel(rawSrcAllItemModel);
|
||||||
b->setCurrentIndex(b->findData(value));
|
b->setCurrentIndex(b->findData(value));
|
||||||
}
|
}
|
||||||
else if (function>=FuncAdjustGV1 && function<=FuncAdjustGVLast) {
|
else if (function >= FuncAdjustGV1 && function <= FuncAdjustGVLast) {
|
||||||
switch (adjustmode) {
|
switch (adjustmode) {
|
||||||
case 1:
|
case 1:
|
||||||
b->setModel(rawSrcInputsItemModel);
|
b->setModel(rawSrcInputsItemModel);
|
||||||
|
|
|
@ -340,7 +340,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||||
|
|
||||||
#if defined(VARIO)
|
#if defined(VARIO)
|
||||||
case FUNC_VARIO:
|
case FUNC_VARIO:
|
||||||
newActiveFunctions |= (1 << FUNCTION_VARIO);
|
newActiveFunctions |= (1u << FUNCTION_VARIO);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -348,15 +348,22 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
case FUNC_LOGS:
|
case FUNC_LOGS:
|
||||||
if (CFN_PARAM(cfn)) {
|
if (CFN_PARAM(cfn)) {
|
||||||
newActiveFunctions |= (1 << FUNCTION_LOGS);
|
newActiveFunctions |= (1u << FUNCTION_LOGS);
|
||||||
logDelay = CFN_PARAM(cfn);
|
logDelay = CFN_PARAM(cfn);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case FUNC_BACKLIGHT:
|
case FUNC_BACKLIGHT:
|
||||||
newActiveFunctions |= (1 << FUNCTION_BACKLIGHT);
|
{
|
||||||
|
getvalue_t raw = getValue(CFN_PARAM(cfn));
|
||||||
|
#if defined(COLORLCD)
|
||||||
|
requiredBacklightBright = (1024 - raw) * (BACKLIGHT_LEVEL_MAX - BACKLIGHT_LEVEL_MIN) / 2048;
|
||||||
|
#else
|
||||||
|
requiredBacklightBright = (1024 - raw) * 100 / 2048;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case FUNC_SCREENSHOT:
|
case FUNC_SCREENSHOT:
|
||||||
if (!(functionsContext.activeSwitches & switch_mask)) {
|
if (!(functionsContext.activeSwitches & switch_mask)) {
|
||||||
|
|
|
@ -50,6 +50,7 @@ extern uint8_t trimsDisplayMask;
|
||||||
extern uint16_t maxMixerDuration;
|
extern uint16_t maxMixerDuration;
|
||||||
|
|
||||||
extern uint8_t requiredSpeakerVolume;
|
extern uint8_t requiredSpeakerVolume;
|
||||||
|
extern uint8_t requiredBacklightBright;
|
||||||
|
|
||||||
enum MainRequest {
|
enum MainRequest {
|
||||||
REQUEST_SCREENSHOT,
|
REQUEST_SCREENSHOT,
|
||||||
|
|
|
@ -338,6 +338,14 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (func == FUNC_BACKLIGHT) {
|
||||||
|
val_max = MIXSRC_LAST_CH;
|
||||||
|
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||||
|
if (active) {
|
||||||
|
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||||
|
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||||
|
}
|
||||||
|
}
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
else if (func == FUNC_LOGS) {
|
else if (func == FUNC_LOGS) {
|
||||||
if (val_displayed) {
|
if (val_displayed) {
|
||||||
|
|
|
@ -338,14 +338,14 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||||
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);
|
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(PCBX9E) || defined(PCBX9DP)
|
|
||||||
else if (func == FUNC_BACKLIGHT) {
|
else if (func == FUNC_BACKLIGHT) {
|
||||||
drawSlider(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, CFN_PARAM(cfn), 100, attr);
|
val_max = MIXSRC_LAST_CH;
|
||||||
if (active) INCDEC_SET_FLAG(eeFlags | NO_INCDEC_MARKS);
|
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||||
val_min = 0;
|
if (active) {
|
||||||
val_max = 100;
|
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||||
|
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#if defined(GVARS)
|
#if defined(GVARS)
|
||||||
else if (func == FUNC_ADJUST_GVAR) {
|
else if (func == FUNC_ADJUST_GVAR) {
|
||||||
switch (CFN_GVAR_MODE(cfn)) {
|
switch (CFN_GVAR_MODE(cfn)) {
|
||||||
|
|
|
@ -333,6 +333,14 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (func == FUNC_BACKLIGHT) {
|
||||||
|
val_max = MIXSRC_LAST_CH;
|
||||||
|
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||||
|
if (active) {
|
||||||
|
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||||
|
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (func == FUNC_LOGS) {
|
else if (func == FUNC_LOGS) {
|
||||||
if (val_displayed) {
|
if (val_displayed) {
|
||||||
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT, 0, NULL, "s");
|
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT, 0, NULL, "s");
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
uint8_t currentSpeakerVolume = 255;
|
uint8_t currentSpeakerVolume = 255;
|
||||||
uint8_t requiredSpeakerVolume = 255;
|
uint8_t requiredSpeakerVolume = 255;
|
||||||
|
uint8_t currentBacklightBright = 255;
|
||||||
|
uint8_t requiredBacklightBright = 255;
|
||||||
uint8_t mainRequestFlags = 0;
|
uint8_t mainRequestFlags = 0;
|
||||||
|
|
||||||
#if defined(STM32)
|
#if defined(STM32)
|
||||||
|
|
|
@ -964,6 +964,7 @@ void evalMixes(uint8_t tick10ms)
|
||||||
// must be done before limits because of the applyLimit function: it checks for safety switches which would be not initialized otherwise
|
// must be done before limits because of the applyLimit function: it checks for safety switches which would be not initialized otherwise
|
||||||
if (tick10ms) {
|
if (tick10ms) {
|
||||||
requiredSpeakerVolume = g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF;
|
requiredSpeakerVolume = g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF;
|
||||||
|
requiredBacklightBright = g_eeGeneral.backlightBright;
|
||||||
|
|
||||||
if (!g_model.noGlobalFunctions) {
|
if (!g_model.noGlobalFunctions) {
|
||||||
evalFunctions(g_eeGeneral.customFn, globalFunctionsContext);
|
evalFunctions(g_eeGeneral.customFn, globalFunctionsContext);
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
#define IS_HAPTIC_FUNC(func) (0)
|
#define IS_HAPTIC_FUNC(func) (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HAS_ENABLE_PARAM(func) ((func) < FUNC_FIRST_WITHOUT_ENABLE)
|
#define HAS_ENABLE_PARAM(func) ((func) < FUNC_FIRST_WITHOUT_ENABLE || (func == FUNC_BACKLIGHT))
|
||||||
#define HAS_REPEAT_PARAM(func) (IS_PLAY_FUNC(func) || IS_HAPTIC_FUNC(func))
|
#define HAS_REPEAT_PARAM(func) (IS_PLAY_FUNC(func) || IS_HAPTIC_FUNC(func))
|
||||||
|
|
||||||
#define CFN_EMPTY(p) (!(p)->swtch)
|
#define CFN_EMPTY(p) (!(p)->swtch)
|
||||||
|
|
|
@ -689,12 +689,19 @@ void checkBacklight()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool backlightOn = (g_eeGeneral.backlightMode == e_backlight_mode_on || (g_eeGeneral.backlightMode != e_backlight_mode_off && lightOffCounter) || isFunctionActive(FUNCTION_BACKLIGHT));
|
bool backlightOn = (g_eeGeneral.backlightMode == e_backlight_mode_on || (g_eeGeneral.backlightMode != e_backlight_mode_off && lightOffCounter));
|
||||||
if (flashCounter) backlightOn = !backlightOn;
|
|
||||||
if (backlightOn)
|
if (flashCounter) {
|
||||||
|
backlightOn = !backlightOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (backlightOn) {
|
||||||
|
currentBacklightBright = requiredBacklightBright;
|
||||||
BACKLIGHT_ENABLE();
|
BACKLIGHT_ENABLE();
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
BACKLIGHT_DISABLE();
|
BACKLIGHT_DISABLE();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1951,6 +1958,7 @@ void opentxInit()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
currentSpeakerVolume = requiredSpeakerVolume = g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF;
|
currentSpeakerVolume = requiredSpeakerVolume = g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF;
|
||||||
|
currentBacklightBright = requiredBacklightBright = g_eeGeneral.backlightBright;
|
||||||
#if !defined(SOFTWARE_VOLUME)
|
#if !defined(SOFTWARE_VOLUME)
|
||||||
setScaledVolume(currentSpeakerVolume);
|
setScaledVolume(currentSpeakerVolume);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -487,6 +487,7 @@ void doMixerCalculations();
|
||||||
void scheduleNextMixerCalculation(uint8_t module, uint32_t period_ms);
|
void scheduleNextMixerCalculation(uint8_t module, uint32_t period_ms);
|
||||||
|
|
||||||
void checkTrims();
|
void checkTrims();
|
||||||
|
extern uint8_t currentBacklightBright;
|
||||||
void perMain();
|
void perMain();
|
||||||
void per10ms();
|
void per10ms();
|
||||||
|
|
||||||
|
@ -846,7 +847,6 @@ enum FunctionsActive {
|
||||||
FUNCTION_TRAINER_CHANNELS = FUNCTION_TRAINER_STICK1 + NUM_STICKS,
|
FUNCTION_TRAINER_CHANNELS = FUNCTION_TRAINER_STICK1 + NUM_STICKS,
|
||||||
FUNCTION_INSTANT_TRIM,
|
FUNCTION_INSTANT_TRIM,
|
||||||
FUNCTION_VARIO,
|
FUNCTION_VARIO,
|
||||||
FUNCTION_BACKLIGHT,
|
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
FUNCTION_LOGS,
|
FUNCTION_LOGS,
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -552,7 +552,7 @@ void backlightEnable(uint8_t dutyCycle = 0);
|
||||||
#else
|
#else
|
||||||
#define BACKLIGHT_LEVEL_MIN 46
|
#define BACKLIGHT_LEVEL_MIN 46
|
||||||
#endif
|
#endif
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable(globalData.unexpectedShutdown ? BACKLIGHT_LEVEL_MAX : BACKLIGHT_LEVEL_MAX - g_eeGeneral.backlightBright)
|
#define BACKLIGHT_ENABLE() backlightEnable(globalData.unexpectedShutdown ? BACKLIGHT_LEVEL_MAX : BACKLIGHT_LEVEL_MAX - currentBacklightBright)
|
||||||
#define BACKLIGHT_DISABLE() backlightEnable(globalData.unexpectedShutdown ? BACKLIGHT_LEVEL_MAX : ((g_eeGeneral.blOffBright == BACKLIGHT_LEVEL_MIN) && (g_eeGeneral.backlightMode != e_backlight_mode_off)) ? 0 : g_eeGeneral.blOffBright)
|
#define BACKLIGHT_DISABLE() backlightEnable(globalData.unexpectedShutdown ? BACKLIGHT_LEVEL_MAX : ((g_eeGeneral.blOffBright == BACKLIGHT_LEVEL_MIN) && (g_eeGeneral.backlightMode != e_backlight_mode_off)) ? 0 : g_eeGeneral.blOffBright)
|
||||||
#define isBacklightEnabled() true
|
#define isBacklightEnabled() true
|
||||||
|
|
||||||
|
|
|
@ -269,7 +269,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Backlight driver
|
// Backlight driver
|
||||||
#define backlightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY = g_eeGeneral.backlightBright)
|
#define backlightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY = currentBacklightBright)
|
||||||
#define backlightDisable() (PWM->PWM_CH_NUM[0].PWM_CDTY = 100)
|
#define backlightDisable() (PWM->PWM_CH_NUM[0].PWM_CDTY = 100)
|
||||||
#define isBacklightEnabled() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
#define isBacklightEnabled() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable()
|
#define BACKLIGHT_ENABLE() backlightEnable()
|
||||||
|
|
|
@ -665,10 +665,10 @@ uint8_t isBacklightEnabled();
|
||||||
#define backlightEnable(...)
|
#define backlightEnable(...)
|
||||||
#elif defined(PCBX9E) || defined(PCBX9DP)
|
#elif defined(PCBX9E) || defined(PCBX9DP)
|
||||||
void backlightEnable(uint8_t level = 0, uint8_t color = 0);
|
void backlightEnable(uint8_t level = 0, uint8_t color = 0);
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable(g_eeGeneral.backlightBright, g_eeGeneral.backlightColor)
|
#define BACKLIGHT_ENABLE() backlightEnable(currentBacklightBright, g_eeGeneral.backlightColor)
|
||||||
#else
|
#else
|
||||||
void backlightEnable(uint8_t level = 0);
|
void backlightEnable(uint8_t level = 0);
|
||||||
#define BACKLIGHT_ENABLE() backlightEnable(g_eeGeneral.backlightBright)
|
#define BACKLIGHT_ENABLE() backlightEnable(currentBacklightBright)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SIMU)
|
#if !defined(SIMU)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue