Changed LCDMenuLib2 so constants are now stored in PROGMEM.

pull/112/head
Holger Wirtz 3 years ago
parent aa6f44dc33
commit acd4ec6bfc
  1. 12
      UI.hpp
  2. 2
      third-party/LCDMenuLib2/src/LCDMenuLib2.h
  3. 53
      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); 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) #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 #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); 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) #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 #endif
} }
@ -7331,7 +7337,7 @@ void UI_func_save_performance(uint8_t param)
} }
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
if (mode < 0xff) if (mode < 0xff)

@ -44,7 +44,7 @@
// ####################### // // ####################### //
// you can change this parameters // 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) // 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 #define _LCDML_CE_cb_function_cnt 4 // this is the number of custom event callback functions which are supported

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

Loading…
Cancel
Save