Converted lambdas to normal functions to save RAM
This commit is contained in:
parent
9561556302
commit
e08a3a5291
1 changed files with 29 additions and 20 deletions
|
@ -32,6 +32,10 @@ static bool refreshScreen;
|
|||
|
||||
//***********************************************************
|
||||
|
||||
static void breathSave(const AdjustMenuEntry& e) {
|
||||
writeSetting(BREATH_THR_ADDR, *e.entries[0].value);
|
||||
writeSetting(BREATH_MAX_ADDR, *e.entries[1].value);
|
||||
}
|
||||
|
||||
const AdjustMenuEntry breathAdjustMenu = {
|
||||
"BREATH",
|
||||
|
@ -39,57 +43,63 @@ const AdjustMenuEntry breathAdjustMenu = {
|
|||
{ &breathThrVal, breathLoLimit, breathHiLimit },
|
||||
{ &breathMaxVal, breathLoLimit, breathHiLimit }
|
||||
},
|
||||
[] (const AdjustMenuEntry& e) {
|
||||
writeSetting(BREATH_THR_ADDR, *e.entries[0].value);
|
||||
writeSetting(BREATH_MAX_ADDR, *e.entries[1].value);
|
||||
}
|
||||
breathSave
|
||||
};
|
||||
|
||||
static void portamentoSave(const AdjustMenuEntry& e) {
|
||||
writeSetting(PORTAM_THR_ADDR, *e.entries[0].value);
|
||||
writeSetting(PORTAM_MAX_ADDR, *e.entries[1].value);
|
||||
}
|
||||
|
||||
const AdjustMenuEntry portamentoAdjustMenu = {
|
||||
"PORTAMENTO",
|
||||
{
|
||||
{ &portamThrVal, portamLoLimit, portamHiLimit },
|
||||
{ &portamMaxVal, portamLoLimit, portamHiLimit }
|
||||
},
|
||||
[] (const AdjustMenuEntry& e) {
|
||||
writeSetting(PORTAM_THR_ADDR, *e.entries[0].value);
|
||||
writeSetting(PORTAM_MAX_ADDR, *e.entries[1].value);
|
||||
}
|
||||
portamentoSave
|
||||
};
|
||||
|
||||
static void pbSave(const AdjustMenuEntry& e) {
|
||||
writeSetting(PITCHB_THR_ADDR, *e.entries[0].value);
|
||||
writeSetting(PITCHB_MAX_ADDR, *e.entries[1].value);
|
||||
}
|
||||
|
||||
const AdjustMenuEntry pitchBendAdjustMenu = {
|
||||
"PITCH BEND",
|
||||
{
|
||||
{ &pitchbThrVal, pitchbLoLimit, pitchbHiLimit },
|
||||
{ &pitchbMaxVal, pitchbLoLimit, pitchbHiLimit }
|
||||
},
|
||||
[] (const AdjustMenuEntry& e) {
|
||||
writeSetting(PITCHB_THR_ADDR, *e.entries[0].value);
|
||||
writeSetting(PITCHB_MAX_ADDR, *e.entries[1].value);
|
||||
}
|
||||
pbSave
|
||||
};
|
||||
|
||||
static void extracSave(const AdjustMenuEntry& e) {
|
||||
writeSetting(EXTRAC_THR_ADDR, *e.entries[0].value);
|
||||
writeSetting(EXTRAC_MAX_ADDR, *e.entries[1].value);
|
||||
}
|
||||
|
||||
const AdjustMenuEntry extraSensorAdjustMenu = {
|
||||
"EXTRA CONTROLLER",
|
||||
{
|
||||
{ &extracThrVal, extracLoLimit, extracHiLimit },
|
||||
{ &extracMaxVal, extracLoLimit, extracHiLimit }
|
||||
},
|
||||
[] (const AdjustMenuEntry& e) {
|
||||
writeSetting(EXTRAC_THR_ADDR, *e.entries[0].value);
|
||||
writeSetting(EXTRAC_MAX_ADDR, *e.entries[1].value);
|
||||
}
|
||||
extracSave
|
||||
};
|
||||
|
||||
|
||||
static void ctouchThrSave(const AdjustMenuEntry& e) {
|
||||
writeSetting(CTOUCH_THR_ADDR, *e.entries[0].value);
|
||||
}
|
||||
|
||||
const AdjustMenuEntry ctouchAdjustMenu = {
|
||||
"TOUCH SENSE",
|
||||
{
|
||||
{ &ctouchThrVal, ctouchLoLimit, ctouchHiLimit },
|
||||
{ nullptr, 0, 0 }
|
||||
},
|
||||
[] (const AdjustMenuEntry& e) {
|
||||
writeSetting(CTOUCH_THR_ADDR, *e.entries[0].value);
|
||||
}
|
||||
ctouchThrSave
|
||||
};
|
||||
|
||||
const AdjustMenuEntry* adjustMenuEntries[] = {
|
||||
|
@ -234,7 +244,6 @@ void plotSensorPixels(){
|
|||
forcePix = 0;
|
||||
}
|
||||
|
||||
|
||||
//***********************************************************
|
||||
|
||||
static bool drawAdjustBar(uint16_t buttons, int row, const AdjustValue* entry, uint16_t *pos) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue