Browse Source

Clean up DOGM code, comments

Scott Lahteine 8 years ago
parent
commit
76c3f326ff
1 changed files with 7 additions and 12 deletions
  1. 7
    12
      Marlin/ultralcd_impl_DOGM.h

+ 7
- 12
Marlin/ultralcd_impl_DOGM.h View File

201
 }
201
 }
202
 
202
 
203
 char lcd_print(const char* str) {
203
 char lcd_print(const char* str) {
204
-  char c;
205
   int i = 0;
204
   int i = 0;
206
-  char n = 0;
207
-  while ((c = str[i++])) {
208
-    n += lcd_print(c);
209
-  }
205
+  char c, n = 0;
206
+  while ((c = str[i++])) n += lcd_print(c);
210
   return n;
207
   return n;
211
 }
208
 }
212
 
209
 
213
-/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
210
+// Needed for Arduino < 1.0.0
214
 char lcd_printPGM(const char* str) {
211
 char lcd_printPGM(const char* str) {
215
-  char c;
216
-  char n = 0;
217
-  while ((c = pgm_read_byte(str++))) {
218
-    n += lcd_print(c);
219
-  }
212
+  char c, n = 0;
213
+  while ((c = pgm_read_byte(str++))) n += lcd_print(c);
220
   return n;
214
   return n;
221
 }
215
 }
222
 
216
 
223
-/* Warning: This function is called from interrupt context */
217
+// Initialize or re-initializw the LCD
224
 static void lcd_implementation_init() {
218
 static void lcd_implementation_init() {
225
 
219
 
226
   #if defined(LCD_PIN_BL) && LCD_PIN_BL > -1 // Enable LCD backlight
220
   #if defined(LCD_PIN_BL) && LCD_PIN_BL > -1 // Enable LCD backlight
291
   #endif // SHOW_BOOTSCREEN
285
   #endif // SHOW_BOOTSCREEN
292
 }
286
 }
293
 
287
 
288
+// The kill screen is displayed for unrecoverable conditions
294
 void lcd_kill_screen() {
289
 void lcd_kill_screen() {
295
   lcd_setFont(FONT_MENU);
290
   lcd_setFont(FONT_MENU);
296
   u8g.setPrintPos(0, u8g.getHeight()/4*1);
291
   u8g.setPrintPos(0, u8g.getHeight()/4*1);

Loading…
Cancel
Save