Moved LCD initialization out of constructor

Since the class "MainMenu" was used within a static variable the
initialization of the object (constructor call) was done before Arduino
library startup. It always caused a crash when using AVRStudio with
JTAG debugger (caused from calling the LCD initialization / the lot of
I/O work / the stack used during this calls). By moving the LCD_INIT
out of the constructor and using an explicit call inside of Arduino
setup() implementation immediately fixed all problems and the JTAG
debugger runs fine.
This commit is contained in:
MaikStohn
2012-05-03 14:28:17 +02:00
parent bd1ad7c76a
commit 032df0b2c6
3 changed files with 7 additions and 5 deletions

View File

@@ -99,6 +99,9 @@ FORCE_INLINE void clear()
void lcd_init()
{
//beep();
#ifdef ULTIPANEL
buttons_init();
#endif
byte Degree[8] =
{
@@ -306,10 +309,6 @@ MainMenu::MainMenu()
displayStartingRow=0;
activeline=0;
force_lcd_update=true;
#ifdef ULTIPANEL
buttons_init();
#endif
lcd_init();
linechanging=false;
tune=false;
}