This commit is contained in:
bsongis
2014-05-05 12:27:29 +02:00
parent 2810323cc7
commit 934961e999
3 changed files with 13 additions and 4 deletions
+8 -2
View File
@@ -329,8 +329,14 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
if (modified) model.funcSw[i].param = fswtchParam[i]->value();
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(-125);
fswtchParam[i]->setMaximum(125);
if (IS_ARM(GetEepromInterface()->getBoard())) {
fswtchParam[i]->setMinimum(-500);
fswtchParam[i]->setMaximum(500);
}
else {
fswtchParam[i]->setMinimum(-125);
fswtchParam[i]->setMaximum(125);
}
fswtchParam[i]->setValue(model.funcSw[i].param);
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM;
}
+3 -2
View File
@@ -4967,10 +4967,11 @@ void menuModelCustomFunctions(uint8_t event)
{
INCDEC_DECLARE_VARS();
int16_t val_displayed = CFN_PARAM(sd);
int8_t val_min = 0;
#if defined(CPUARM)
int16_t val_min = 0;
int16_t val_max = 255;
#else
int8_t val_min = 0;
uint8_t val_max = 255;
#endif
if (func == FUNC_SAFETY_CHANNEL) {
@@ -5084,7 +5085,7 @@ void menuModelCustomFunctions(uint8_t event)
switch (CFN_GVAR_MODE(sd)) {
case FUNC_ADJUST_GVAR_CONSTANT:
val_displayed = (int8_t)CFN_PARAM(sd);
val_min = -125; val_max = 125;
val_min = -CFN_GVAR_CST_MAX; val_max = +CFN_GVAR_CST_MAX;
lcd_outdezAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
break;
case FUNC_ADJUST_GVAR_SOURCE:
+2
View File
@@ -916,6 +916,7 @@ PACK(typedef struct t_CustomFnData { // Function Switches data
#define CFN_GVAR_MODE(p) ((p)->all.mode)
#define CFN_PARAM(p) ((p)->all.val)
#define CFN_RESET(p) ((p)->active=0, (p)->clear.val1=0, (p)->clear.val2=0)
#define CFN_GVAR_CST_MAX 500
#else
PACK(typedef struct t_CustomFnData {
PACK(union {
@@ -948,6 +949,7 @@ PACK(typedef struct t_CustomFnData {
#define CFN_GVAR_MODE(p) ((p)->gvar.mode)
#define CFN_PARAM(p) ((p)->value)
#define CFN_RESET(p) ((p)->all.active = 0, CFN_PARAM(p) = 0)
#define CFN_GVAR_CST_MAX 125
#endif
enum TelemetryUnit {