marlin
"Macro function is undefined if !ENCODER_RATE_MULTIPLIER
Macro function MENU_MULTIPLIER_ITEM_EDIT is called in lcd_tune_menu() function, but it is undefined if !ENCODER_RATE_MULTIPLIER TEMP_SENSOR_0 is always defined in Marlin (at least in the example configurations)"
Bug fixed by commit b8e79dce897
| Type | UndeclaredIdentifier |
| Config | "ULTRA_LCD && !ENCODER_RATE_MULTIPLIER && TEMP_SENSOR_0 != 0" (3rd degree) |
| Fix-in | code |
| Location | lcd/ |
#include <stdio.h>
#define MSG_NOZZLE "Nozzle"
#define HEATER_0_MAXTEMP 275
#ifdef ULTRA_LCD
#define MENU_ITEM(type, label, args...) do { \
printf("menu item");\
} while(0)
#define MENU_MULTIPLIER_ITEM(type, label, args...) do { \
printf("menu multiplier item");\
} while(0)
#ifdef ENCODER_RATE_MULTIPLIER
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, ## args )
#else
#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, ## args )
#endif
#endif
static void lcd_tune_menu()
{
#ifdef ULTRA_LCD
#if TEMP_SENSOR_0 != 0
MENU_MULTIPLIER_ITEM_EDIT(3, MSG_NOZZLE, 0, 0, HEATER_0_MAXTEMP - 15);
#endif
#endif
}
int main(void)
{
lcd_tune_menu();
return 0;
}
diff --git a/simple/b8e79dc.c b/simple/b8e79dc.c --- a/simple/b8e79dc.c +++ b/simple/b8e79dc.c @@ -15,7 +15,7 @@ #ifdef ENCODER_RATE_MULTIPLIER #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, ## args ) #else -#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, ## args ) +#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, ## args ) #endif #endif
#include <stdio.h>
#define MSG_NOZZLE "Nozzle"
#define HEATER_0_MAXTEMP 275
#ifdef ULTRA_LCD
#define MENU_ITEM(type, label, args...) do { \
printf("menu item");\
} while(0)
#define MENU_MULTIPLIER_ITEM(type, label, args...) do { \
printf("menu multiplier item");\
} while(0)
#ifdef ENCODER_RATE_MULTIPLIER
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, ## args )
#else
#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, ## args )
#endif
#endif
int main(void)
{
#ifdef ULTRA_LCD
#if TEMP_SENSOR_0 != 0
MENU_MULTIPLIER_ITEM_EDIT(3, MSG_NOZZLE, 0, 0, HEATER_0_MAXTEMP - 15);
#endif
#endif
return 0;
}
. call Marlin/ultra_lcd.cpp:460: MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15); . ERROR ultra_lcd.cpp:179: #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label) , ## args )