Changed LCDMenuLib2 so constants are now stored in PROGMEM.

pull/112/head
Holger Wirtz 3 years ago
parent aa6f44dc33
commit acd4ec6bfc
  1. 10
      UI.hpp
  2. 2
      third-party/LCDMenuLib2/src/LCDMenuLib2.h
  3. 21
      third-party/LCDMenuLib2/src/LCDMenuLib2_macros.h

@ -2808,7 +2808,10 @@ void UI_func_epiano_pan_tremolo(uint8_t param)
lcd_display_bar_int("EP Trem. Width", configuration.epiano.pan_tremolo, 1.0, EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX, 3, false, false, false);
#if defined(USE_EPIANO)
ep.setPanTremolo(mapfloat(configuration.epiano.pan_tremolo, EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX, 0, 1.0));
if (configuration.epiano.pan_tremolo == 0)
ep.setPanTremolo(0.0);
else
ep.setPanTremolo(mapfloat(configuration.epiano.pan_tremolo, EP_PAN_TREMOLO_MIN, EP_PAN_TREMOLO_MAX, 0.0, 1.0));
#endif
}
@ -2847,7 +2850,10 @@ void UI_func_epiano_pan_lfo(uint8_t param)
lcd_display_bar_int("EP LFO", configuration.epiano.pan_lfo, 1.0, EP_PAN_LFO_MIN, EP_PAN_LFO_MAX, 3, false, false, false);
#if defined(USE_EPIANO)
ep.setPanLFO(mapfloat(configuration.epiano.pan_lfo, EP_PAN_LFO_MIN, EP_PAN_LFO_MAX, 0, 1.0));
if (configuration.epiano.pan_lfo == 0)
ep.setPanLFO(0.0);
else
ep.setPanLFO(mapfloat(configuration.epiano.pan_lfo, EP_PAN_LFO_MIN, EP_PAN_LFO_MAX, 0.0, 1.0));
#endif
}

@ -44,7 +44,7 @@
// ####################### //
// you can change this parameters
#define _LCDML_cfg_use_ram // enable this line when you want to use the ram mode
//#define _LCDML_cfg_use_ram // enable this line when you want to use the ram mode
// set the number of custom events (this could be a button ore something else)
#define _LCDML_CE_cb_function_cnt 4 // this is the number of custom event callback functions which are supported

@ -91,6 +91,24 @@
#define LCDML_DISP_initFunction(N) LCDML_DISP_func_repeat(N);
#ifndef _LCDML_cfg_use_ram
#if defined(__IMXRT1062__) || defined (ARDUINO_TEENSY40) || defined (ARDUINO_TEENSY41) || defined(__MK66FX1M0__) || defined (__MK64FX512__)
// stored in flash (Teensy-3.5/Teensy-3.6/Teensy-4.x)
#define LCDML_langDef(name, lang, content) \
const char g_LCDML_DISP_lang_ ## lang ## _ ## name ##_var[] = {content}
#define LCDML_getCustomContent(lang, var, id) \
if(id < _LCDML_NO_FUNC) {\
strcpy(var, g_LCDML_DISP_lang_ ## lang ## _table[id]); \
}
#define LCDML_createCustomLang(N, lang) \
const char * g_LCDML_DISP_lang_ ## lang ## _table[] = { LCDML_DISP_lang_repeat(N, lang) }
#define LCDML_getCustomElementName(lang, var, element_id) \
if(element_id < _LCDML_NO_FUNC && (sizeof(g_LCDML_DISP_lang_ ## lang ## _table)-1) >= element_id) {\
strcpy(var, g_LCDML_DISP_lang_ ## lang ## _table[element_id]);\
}
#else
// stored in flash (Arduino)
#define LCDML_langDef(name, lang, content) \
const char g_LCDML_DISP_lang_ ## lang ## _ ## name ##_var[] PROGMEM = {content}
@ -107,7 +125,7 @@
if(element_id < _LCDML_NO_FUNC && (sizeof(g_LCDML_DISP_lang_ ## lang ## _table)-1) >= element_id) {\
strcpy_P(var, (char*)pgm_read_word(&(g_LCDML_DISP_lang_ ## lang ## _table[element_id])));\
}
#endif
#else
// stored in ram (esp, stm, other controllers)
#define LCDML_langDef(name, lang, content) \
@ -125,7 +143,6 @@
if(element_id < _LCDML_NO_FUNC && (sizeof(g_LCDML_DISP_lang_ ## lang ## _table)-1) >= element_id) {\
strcpy(var, g_LCDML_DISP_lang_ ## lang ## _table[element_id]);\
}
#endif
#define LCDML_getElementName(var, element_id) \

Loading…
Cancel
Save