Welcome! Log In Create A New Profile

Advanced

Weird out of scope error: Marlin + LCD screen issues.

Posted by Qcks_ 
Weird out of scope error: Marlin + LCD screen issues.
January 10, 2015 06:31PM
So I've been tweeking firmware for the last couple of days, and i decided i should probably enable the LCD screen on my RepRapDiscount Smart Controller.

The Arduino IDE does not like the LCD code.

I keep getting this error:

ultralcd.cpp: In function 'void lcd_tune_menu()':
ultralcd.cpp:398:65: error: 'HEATER_0_MAXTEMP' was not declared in this scope
     MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
                                                                 ^
ultralcd.cpp:125:36: note: in definition of macro 'MENU_ITEM'
             menu_action_ ## type ( args ); \

This goes on to cascade into a bunch of other compiling errors.
I've tried dropping the - 15 operation from the string, but it doesn't help. I still get the out of scope variable.
Anybody else have this issue?
Re: Weird out of scope error: Marlin + LCD screen issues.
January 10, 2015 06:37PM
So have you checked whether HEATER_0_MAXTEMP is declared? In a copy of Marlin I have lying around, it is declared in Configuration.h after the thermistor type definitions.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Weird out of scope error: Marlin + LCD screen issues.
January 10, 2015 07:15PM
It's defined in Configure.h as 275.

it appears exactly like this in the code:

#define HEATER_0_MAXTEMP 275
#define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275
#define BED_MAXTEMP 150

So... the ultralcd.cpp file can't access the HEATER_0_MAXTEMP variable..... or more accurately the function MENU_ITEM_EDIT.

=_=
I wish programming would have been a thing back when i was going to school....

Edited 1 time(s). Last edit at 01/10/2015 10:11PM by Qcks_.
Re: Weird out of scope error: Marlin + LCD screen issues.
January 11, 2015 02:01AM
I found the issue.... the thermistor variable for the hotend was not correctly declared. (it was set to 0 or "not used" instead of... the generic 100k thermistor)

This caused another issue outside of the purely firmware compiling issue i was having (I need a new J head now...), but the problem with the LCD screen is resolved (yay?).
Sorry, only registered users may post in this forum.

Click here to login