Add and apply REPEAT_1 macro

This commit is contained in:
Scott Lahteine
2021-05-08 01:41:40 -05:00
parent a03811f4e8
commit f09fa69e86
6 changed files with 10 additions and 7 deletions

View File

@@ -114,8 +114,8 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
PGM_P MarlinUI::get_preheat_label(const uint8_t m) {
#define _PDEF(N) static PGMSTR(preheat_##N##_label, PREHEAT_##N##_LABEL);
#define _PLBL(N) preheat_##N##_label,
REPEAT_S(1, INCREMENT(PREHEAT_COUNT), _PDEF);
static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT_S(1, INCREMENT(PREHEAT_COUNT), _PLBL) };
REPEAT_1(PREHEAT_COUNT, _PDEF);
static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT_1(PREHEAT_COUNT, _PLBL) };
return (PGM_P)pgm_read_ptr(&preheat_labels[m]);
}
#endif