Compare commits

..

No commits in common. "5121dcb74f253699705d75d8bbd7690e5924919a" and "2b54a8ffe826e96e1d9282ba71160b7e04985510" have entirely different histories.

5 changed files with 8 additions and 21 deletions

View File

@ -11,7 +11,7 @@ extern "C" {
#include "util.h" #include "util.h"
CountedEnum(ParamType, size_t, PF_BBAL, PF_SLIPREF, PF_MUMAX, PF_ASRP, PF_ASRON, CountedEnum(ParamType, size_t, PF_BBAL, PF_SLIPREF, PF_MUMAX, PF_ASRP, PF_ASRON,
PF_ASRI, PF_PLIM); PF_ASRI);
typedef struct { typedef struct {
float bbal; float bbal;
@ -20,7 +20,6 @@ typedef struct {
unsigned asrp; unsigned asrp;
unsigned asri; unsigned asri;
unsigned asron; unsigned asron;
unsigned plim;
} Params; } Params;
extern Params params; extern Params params;

View File

@ -4,10 +4,7 @@
Params params = {0}; Params params = {0};
void params_init() { void params_init() { params.bbal = 50; }
params.bbal = 50;
params.plim = 20;
}
void params_inc(ParamType param) { void params_inc(ParamType param) {
switch (param) { switch (param) {
@ -32,9 +29,6 @@ void params_inc(ParamType param) {
case PF_ASRON: case PF_ASRON:
params.asron = 1; params.asron = 1;
break; break;
case PF_PLIM:
params.plim = (params.plim < 80) ? params.plim + 1 : 80;
break;
} }
} }
@ -69,9 +63,6 @@ void params_dec(ParamType param) {
case PF_ASRON: case PF_ASRON:
params.asron = 0; params.asron = 0;
break; break;
case PF_PLIM:
params.plim = (params.plim > 2) ? params.plim - 1 : 2;
break;
} }
} }
@ -96,8 +87,6 @@ void params_broadcast(ParamType param) {
case PF_ASRON: case PF_ASRON:
value = params.asron; value = params.asron;
break; break;
case PF_PLIM:
value = params.plim;
default: default:
return; return;
} }

View File

@ -78,19 +78,19 @@ void VehicleConfigViewBase::handleKeyEvent(uint8_t key)
} }
if(107 == key) if(106 == key)
{ {
//DecreaseParam //DecreaseParam
//When hardware button 107 clicked call virtual function //When hardware button 106 clicked call virtual function
//Call decParam //Call decParam
decParam(); decParam();
} }
if(106 == key) if(107 == key)
{ {
//IncreaseParam //IncreaseParam
//When hardware button 106 clicked call virtual function //When hardware button 107 clicked call virtual function
//Call incParam //Call incParam
incParam(); incParam();

View File

@ -316,7 +316,6 @@ NamedFieldDescription paramFieldDescs[] = {
[PF_ASRP] = {NamedFieldKind::Int, "ASR-P", 2, 0, PARAM_FIELD(asrp)}, [PF_ASRP] = {NamedFieldKind::Int, "ASR-P", 2, 0, PARAM_FIELD(asrp)},
[PF_ASRON] = {NamedFieldKind::Int, "ASR-ON", 2, 0, PARAM_FIELD(asron)}, [PF_ASRON] = {NamedFieldKind::Int, "ASR-ON", 2, 0, PARAM_FIELD(asron)},
[PF_ASRI] = {NamedFieldKind::Int, "ASR-I", 2, 0, PARAM_FIELD(asri)}, [PF_ASRI] = {NamedFieldKind::Int, "ASR-I", 2, 0, PARAM_FIELD(asri)},
[PF_PLIM] = {NamedFieldKind::Int, "PLIM", 2, 0, PARAM_FIELD(plim)},
}; };
static_assert(sizeof(paramFieldDescs) / sizeof(paramFieldDescs[0]) == static_assert(sizeof(paramFieldDescs) / sizeof(paramFieldDescs[0]) ==

View File

@ -1185,7 +1185,7 @@
"InteractionName": "DecreaseParam", "InteractionName": "DecreaseParam",
"Trigger": { "Trigger": {
"Type": "TriggerPhysicalButtonClicked", "Type": "TriggerPhysicalButtonClicked",
"ButtonKey": 107 "ButtonKey": 106
}, },
"Action": { "Action": {
"Type": "ActionCustom", "Type": "ActionCustom",
@ -1196,7 +1196,7 @@
"InteractionName": "IncreaseParam", "InteractionName": "IncreaseParam",
"Trigger": { "Trigger": {
"Type": "TriggerPhysicalButtonClicked", "Type": "TriggerPhysicalButtonClicked",
"ButtonKey": 106 "ButtonKey": 107
}, },
"Action": { "Action": {
"Type": "ActionCustom", "Type": "ActionCustom",