Ver código fonte

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.
MaikStohn 13 anos atrás
pai
commit
032df0b2c6
3 arquivos alterados com 7 adições e 5 exclusões
  1. 2
    0
      Marlin/Marlin.pde
  2. 2
    1
      Marlin/ultralcd.h
  3. 3
    4
      Marlin/ultralcd.pde

+ 2
- 0
Marlin/Marlin.pde Ver arquivo

300
   st_init();    // Initialize stepper;
300
   st_init();    // Initialize stepper;
301
   wd_init();
301
   wd_init();
302
   setup_photpin();
302
   setup_photpin();
303
+  
304
+  LCD_INIT;
303
 }
305
 }
304
 
306
 
305
 
307
 

+ 2
- 1
Marlin/ultralcd.h Ver arquivo

134
   char *ftostr3(const float &x);
134
   char *ftostr3(const float &x);
135
 
135
 
136
 
136
 
137
-
137
+  #define LCD_INIT lcd_init();
138
   #define LCD_MESSAGE(x) lcd_status(x);
138
   #define LCD_MESSAGE(x) lcd_status(x);
139
   #define LCD_MESSAGEPGM(x) lcd_statuspgm(MYPGM(x));
139
   #define LCD_MESSAGEPGM(x) lcd_statuspgm(MYPGM(x));
140
   #define LCD_STATUS lcd_status()
140
   #define LCD_STATUS lcd_status()
141
 #else //no lcd
141
 #else //no lcd
142
+  #define LCD_INIT
142
   #define LCD_STATUS
143
   #define LCD_STATUS
143
   #define LCD_MESSAGE(x)
144
   #define LCD_MESSAGE(x)
144
   #define LCD_MESSAGEPGM(x)
145
   #define LCD_MESSAGEPGM(x)

+ 3
- 4
Marlin/ultralcd.pde Ver arquivo

99
 void lcd_init()
99
 void lcd_init()
100
 {
100
 {
101
   //beep();
101
   //beep();
102
+  #ifdef ULTIPANEL
103
+    buttons_init();
104
+  #endif
102
   
105
   
103
   byte Degree[8] =
106
   byte Degree[8] =
104
   {
107
   {
306
   displayStartingRow=0;
309
   displayStartingRow=0;
307
   activeline=0;
310
   activeline=0;
308
   force_lcd_update=true;
311
   force_lcd_update=true;
309
-  #ifdef ULTIPANEL
310
-    buttons_init();
311
-  #endif
312
-  lcd_init();
313
   linechanging=false;
312
   linechanging=false;
314
   tune=false;
313
   tune=false;
315
 }
314
 }

Carregando…
Cancelar
Salvar