Browse Source

Merge pull request #5562 from thinkyhead/rc_char_lcd_tweaks

Fix various LCD-related issues
Scott Lahteine 8 years ago
parent
commit
4213330d22

+ 2
- 0
Marlin/Conditionals_LCD.h View File

278
     #define BOOTSCREEN_TIMEOUT 2500
278
     #define BOOTSCREEN_TIMEOUT 2500
279
   #endif
279
   #endif
280
 
280
 
281
+  #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
282
+
281
   /**
283
   /**
282
    * Extruders have some combination of stepper motors and hotends
284
    * Extruders have some combination of stepper motors and hotends
283
    * so we separate these concepts into the defines:
285
    * so we separate these concepts into the defines:

+ 2
- 0
Marlin/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/Felix/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/K8200/Configuration_adv.h View File

467
     #define PROGRESS_MSG_EXPIRE   0
467
     #define PROGRESS_MSG_EXPIRE   0
468
     // Enable this to show messages for MSG_TIME then hide them
468
     // Enable this to show messages for MSG_TIME then hide them
469
     //#define PROGRESS_MSG_ONCE
469
     //#define PROGRESS_MSG_ONCE
470
+    // Add a menu item to test the progress bar:
471
+    //#define LCD_PROGRESS_BAR_TEST
470
   #endif
472
   #endif
471
 
473
 
472
   // This allows hosts to request long names for files and folders with M33
474
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/K8400/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

462
     #define PROGRESS_MSG_EXPIRE   0
462
     #define PROGRESS_MSG_EXPIRE   0
463
     // Enable this to show messages for MSG_TIME then hide them
463
     // Enable this to show messages for MSG_TIME then hide them
464
     //#define PROGRESS_MSG_ONCE
464
     //#define PROGRESS_MSG_ONCE
465
+    // Add a menu item to test the progress bar:
466
+    //#define LCD_PROGRESS_BAR_TEST
465
   #endif
467
   #endif
466
 
468
 
467
   // This allows hosts to request long names for files and folders with M33
469
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h View File

456
     #define PROGRESS_MSG_EXPIRE   0
456
     #define PROGRESS_MSG_EXPIRE   0
457
     // Enable this to show messages for MSG_TIME then hide them
457
     // Enable this to show messages for MSG_TIME then hide them
458
     //#define PROGRESS_MSG_ONCE
458
     //#define PROGRESS_MSG_ONCE
459
+    // Add a menu item to test the progress bar:
460
+    //#define LCD_PROGRESS_BAR_TEST
459
   #endif
461
   #endif
460
 
462
 
461
   // This allows hosts to request long names for files and folders with M33
463
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

456
     #define PROGRESS_MSG_EXPIRE   0
456
     #define PROGRESS_MSG_EXPIRE   0
457
     // Enable this to show messages for MSG_TIME then hide them
457
     // Enable this to show messages for MSG_TIME then hide them
458
     //#define PROGRESS_MSG_ONCE
458
     //#define PROGRESS_MSG_ONCE
459
+    // Add a menu item to test the progress bar:
460
+    //#define LCD_PROGRESS_BAR_TEST
459
   #endif
461
   #endif
460
 
462
 
461
   // This allows hosts to request long names for files and folders with M33
463
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

456
     #define PROGRESS_MSG_EXPIRE   0
456
     #define PROGRESS_MSG_EXPIRE   0
457
     // Enable this to show messages for MSG_TIME then hide them
457
     // Enable this to show messages for MSG_TIME then hide them
458
     //#define PROGRESS_MSG_ONCE
458
     //#define PROGRESS_MSG_ONCE
459
+    // Add a menu item to test the progress bar:
460
+    //#define LCD_PROGRESS_BAR_TEST
459
   #endif
461
   #endif
460
 
462
 
461
   // This allows hosts to request long names for files and folders with M33
463
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

461
     #define PROGRESS_MSG_EXPIRE   0
461
     #define PROGRESS_MSG_EXPIRE   0
462
     // Enable this to show messages for MSG_TIME then hide them
462
     // Enable this to show messages for MSG_TIME then hide them
463
     //#define PROGRESS_MSG_ONCE
463
     //#define PROGRESS_MSG_ONCE
464
+    // Add a menu item to test the progress bar:
465
+    //#define LCD_PROGRESS_BAR_TEST
464
   #endif
466
   #endif
465
 
467
 
466
   // This allows hosts to request long names for files and folders with M33
468
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

456
     #define PROGRESS_MSG_EXPIRE   0
456
     #define PROGRESS_MSG_EXPIRE   0
457
     // Enable this to show messages for MSG_TIME then hide them
457
     // Enable this to show messages for MSG_TIME then hide them
458
     //#define PROGRESS_MSG_ONCE
458
     //#define PROGRESS_MSG_ONCE
459
+    // Add a menu item to test the progress bar:
460
+    //#define LCD_PROGRESS_BAR_TEST
459
   #endif
461
   #endif
460
 
462
 
461
   // This allows hosts to request long names for files and folders with M33
463
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/makibox/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 2
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

454
     #define PROGRESS_MSG_EXPIRE   0
454
     #define PROGRESS_MSG_EXPIRE   0
455
     // Enable this to show messages for MSG_TIME then hide them
455
     // Enable this to show messages for MSG_TIME then hide them
456
     //#define PROGRESS_MSG_ONCE
456
     //#define PROGRESS_MSG_ONCE
457
+    // Add a menu item to test the progress bar:
458
+    //#define LCD_PROGRESS_BAR_TEST
457
   #endif
459
   #endif
458
 
460
 
459
   // This allows hosts to request long names for files and folders with M33
461
   // This allows hosts to request long names for files and folders with M33

+ 8
- 2
Marlin/language_en.h View File

51
 #ifndef MSG_DISABLE_STEPPERS
51
 #ifndef MSG_DISABLE_STEPPERS
52
   #define MSG_DISABLE_STEPPERS                _UxGT("Disable steppers")
52
   #define MSG_DISABLE_STEPPERS                _UxGT("Disable steppers")
53
 #endif
53
 #endif
54
+#ifndef MSG_DEBUG_MENU
55
+  #define MSG_DEBUG_MENU                      _UxGT("Debug Menu")
56
+#endif
57
+#ifndef MSG_PROGRESS_BAR_TEST
58
+  #define MSG_PROGRESS_BAR_TEST               _UxGT("Progress Bar Test")
59
+#endif
54
 #ifndef MSG_AUTO_HOME
60
 #ifndef MSG_AUTO_HOME
55
   #define MSG_AUTO_HOME                       _UxGT("Auto home")
61
   #define MSG_AUTO_HOME                       _UxGT("Auto home")
56
 #endif
62
 #endif
139
   #define MSG_LEVEL_BED                       _UxGT("Level bed")
145
   #define MSG_LEVEL_BED                       _UxGT("Level bed")
140
 #endif
146
 #endif
141
 #ifndef MSG_MOVING
147
 #ifndef MSG_MOVING
142
-  #define MSG_MOVING                          "Moving..."
148
+  #define MSG_MOVING                          _UxGT("Moving...")
143
 #endif
149
 #endif
144
 #ifndef MSG_FREE_XY
150
 #ifndef MSG_FREE_XY
145
-  #define MSG_FREE_XY                         "Free XY"
151
+  #define MSG_FREE_XY                         _UxGT("Free XY")
146
 #endif
152
 #endif
147
 #ifndef MSG_MOVE_X
153
 #ifndef MSG_MOVE_X
148
   #define MSG_MOVE_X                          _UxGT("Move X")
154
   #define MSG_MOVE_X                          _UxGT("Move X")

+ 70
- 13
Marlin/ultralcd.cpp View File

316
   #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
316
   #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
317
 
317
 
318
   // Used to print static text with no visible cursor.
318
   // Used to print static text with no visible cursor.
319
+  // Parameters: label [, bool center [, bool invert [, char *value] ] ]
319
   #define STATIC_ITEM(LABEL, ...) \
320
   #define STATIC_ITEM(LABEL, ...) \
320
     if (_menuLineNr == _thisItemNr) { \
321
     if (_menuLineNr == _thisItemNr) { \
321
       if (_skipStatic && encoderLine <= _thisItemNr) { \
322
       if (_skipStatic && encoderLine <= _thisItemNr) { \
623
 
624
 
624
   #endif // MENU_ITEM_CASE_LIGHT
625
   #endif // MENU_ITEM_CASE_LIGHT
625
 
626
 
627
+  #if ENABLED(LCD_PROGRESS_BAR_TEST)
628
+
629
+    static void progress_bar_test() {
630
+      static int8_t bar_percent = 0;
631
+      if (lcd_clicked) {
632
+        lcd_goto_previous_menu();
633
+        lcd_set_custom_characters(false);
634
+        return;
635
+      }
636
+      bar_percent += (int8_t)encoderPosition;
637
+      bar_percent = constrain(bar_percent, 0, 100);
638
+      encoderPosition = 0;
639
+      lcd_implementation_drawmenu_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true);
640
+      lcd.setCursor((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2);
641
+      lcd.print(itostr3(bar_percent)); lcd.print('%');
642
+      lcd.setCursor(0, LCD_HEIGHT - 1); lcd_draw_progress_bar(bar_percent);
643
+    }
644
+
645
+    void _progress_bar_test() {
646
+      lcd_goto_screen(progress_bar_test);
647
+      lcd_set_custom_characters();
648
+    }
649
+
650
+  #endif // LCD_PROGRESS_BAR_TEST
651
+
652
+  #if HAS_DEBUG_MENU
653
+
654
+    void lcd_debug_menu() {
655
+      START_MENU();
656
+
657
+      MENU_BACK(MSG_MAIN); // ^ Main
658
+
659
+      #if ENABLED(LCD_PROGRESS_BAR_TEST)
660
+        MENU_ITEM(submenu, MSG_PROGRESS_BAR_TEST, _progress_bar_test);
661
+      #endif
662
+
663
+      END_MENU();
664
+    }
665
+
666
+  #endif // HAS_DEBUG_MENU
667
+
626
   /**
668
   /**
627
    *
669
    *
628
    * "Main" menu
670
    * "Main" menu
634
     MENU_BACK(MSG_WATCH);
676
     MENU_BACK(MSG_WATCH);
635
 
677
 
636
     //
678
     //
679
+    // Debug Menu when certain options are enabled
680
+    //
681
+    #if HAS_DEBUG_MENU
682
+      MENU_ITEM(submenu, MSG_DEBUG_MENU, lcd_debug_menu);
683
+    #endif
684
+
685
+    //
637
     // Switch case light on/off
686
     // Switch case light on/off
638
     //
687
     //
639
     #if ENABLED(MENU_ITEM_CASE_LIGHT)
688
     #if ENABLED(MENU_ITEM_CASE_LIGHT)
1303
     #endif
1352
     #endif
1304
 
1353
 
1305
     //
1354
     //
1306
-    // Set Home Offsets
1307
-    //
1308
-    MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
1309
-    //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
1310
-
1311
-    //
1312
     // Level Bed
1355
     // Level Bed
1313
     //
1356
     //
1314
     #if HAS_ABL
1357
     #if HAS_ABL
1320
     #endif
1363
     #endif
1321
 
1364
 
1322
     //
1365
     //
1366
+    // Set Home Offsets
1367
+    //
1368
+    MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
1369
+    //MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
1370
+
1371
+    //
1323
     // Disable Steppers
1372
     // Disable Steppers
1324
     //
1373
     //
1325
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
1374
     MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
1341
     //
1390
     //
1342
     // Cooldown
1391
     // Cooldown
1343
     //
1392
     //
1344
-    MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
1393
+    bool has_heat = false;
1394
+    HOTEND_LOOP() if (thermalManager.target_temperature[e]) { has_heat = true; break; }
1395
+    #if HAS_TEMP_BED
1396
+      if (thermalManager.target_temperature_bed) has_heat = true;
1397
+    #endif
1398
+    if (has_heat) MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
1345
 
1399
 
1346
     //
1400
     //
1347
     // BLTouch Self-Test and Reset
1401
     // BLTouch Self-Test and Reset
2698
 
2752
 
2699
   #endif //SDSUPPORT
2753
   #endif //SDSUPPORT
2700
 
2754
 
2701
-  void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); }
2755
+  void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; }
2702
   void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callback) {
2756
   void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callback) {
2703
     menu_action_setting_edit_bool(pstr, ptr);
2757
     menu_action_setting_edit_bool(pstr, ptr);
2704
     (*callback)();
2758
     (*callback)();
2838
  *     - Before exiting the handler set lcdDrawUpdate to:
2892
  *     - Before exiting the handler set lcdDrawUpdate to:
2839
  *       - LCDVIEW_CLEAR_CALL_REDRAW to clear screen and set LCDVIEW_CALL_REDRAW_NEXT.
2893
  *       - LCDVIEW_CLEAR_CALL_REDRAW to clear screen and set LCDVIEW_CALL_REDRAW_NEXT.
2840
  *       - LCDVIEW_REDRAW_NOW or LCDVIEW_NONE to keep drawingm but only in this loop.
2894
  *       - LCDVIEW_REDRAW_NOW or LCDVIEW_NONE to keep drawingm but only in this loop.
2841
- *       - LCDVIEW_REDRAW_NEXT to keep drawing and draw on the next loop also.
2895
+ *       - LCDVIEW_CALL_REDRAW_NEXT to keep drawing and draw on the next loop also.
2842
  *       - LCDVIEW_CALL_NO_REDRAW to keep drawing (or start drawing) with no redraw on the next loop.
2896
  *       - LCDVIEW_CALL_NO_REDRAW to keep drawing (or start drawing) with no redraw on the next loop.
2843
  *     - NOTE: For graphical displays menu handlers may be called 2 or more times per loop,
2897
  *     - NOTE: For graphical displays menu handlers may be called 2 or more times per loop,
2844
  *             so don't change lcdDrawUpdate without considering this.
2898
  *             so don't change lcdDrawUpdate without considering this.
2951
 
3005
 
2952
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
3006
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
2953
           encoderDiff = 0;
3007
           encoderDiff = 0;
2954
-          #if ENABLED(DOGLCD)
2955
-            drawing_screen = false;  // refresh the complete screen for a encoder change (different menu-item/value)
2956
-          #endif
2957
         }
3008
         }
2958
         return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
3009
         return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
2959
-        lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
3010
+        lcdDrawUpdate =
3011
+          #if ENABLED(DOGLCD)
3012
+            LCDVIEW_CALL_REDRAW_NEXT
3013
+          #else
3014
+            LCDVIEW_REDRAW_NOW
3015
+          #endif
3016
+        ;
2960
       }
3017
       }
2961
     #endif // ULTIPANEL
3018
     #endif // ULTIPANEL
2962
 
3019
 

+ 25
- 15
Marlin/ultralcd_impl_HD44780.h View File

530
       safe_delay(2000);
530
       safe_delay(2000);
531
     #endif
531
     #endif
532
 
532
 
533
+    /*
534
+    lcd.clear();
535
+
533
     lcd_set_custom_characters(
536
     lcd_set_custom_characters(
534
       #if ENABLED(LCD_PROGRESS_BAR)
537
       #if ENABLED(LCD_PROGRESS_BAR)
535
         false
538
         false
536
       #endif
539
       #endif
537
     );
540
     );
541
+    //*/
538
   }
542
   }
539
 
543
 
540
 #endif // SHOW_BOOTSCREEN
544
 #endif // SHOW_BOOTSCREEN
569
   }
573
   }
570
 }
574
 }
571
 
575
 
576
+#if ENABLED(LCD_PROGRESS_BAR)
577
+
578
+  inline void lcd_draw_progress_bar(const uint8_t percent) {
579
+    int tix = (int)(percent * (LCD_WIDTH) * 3) / 100,
580
+      cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
581
+    char msg[LCD_WIDTH + 1], b = ' ';
582
+    msg[i] = '\0';
583
+    while (i--) {
584
+      if (i == cel - 1)
585
+        b = LCD_STR_PROGRESS[2];
586
+      else if (i == cel && rem != 0)
587
+        b = LCD_STR_PROGRESS[rem - 1];
588
+      msg[i] = b;
589
+    }
590
+    lcd.print(msg);
591
+  }
592
+
593
+#endif // LCD_PROGRESS_BAR
594
+
572
 /**
595
 /**
573
 Possible status screens:
596
 Possible status screens:
574
 16x2   |000/000 B000/000|
597
 16x2   |000/000 B000/000|
755
     if (card.isFileOpen()) {
778
     if (card.isFileOpen()) {
756
       // Draw the progress bar if the message has shown long enough
779
       // Draw the progress bar if the message has shown long enough
757
       // or if there is no message set.
780
       // or if there is no message set.
758
-      if (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0]) {
759
-        int tix = (int)(card.percentDone() * (LCD_WIDTH) * 3) / 100,
760
-          cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
761
-        char msg[LCD_WIDTH + 1], b = ' ';
762
-        msg[i] = '\0';
763
-        while (i--) {
764
-          if (i == cel - 1)
765
-            b = LCD_STR_PROGRESS[2];
766
-          else if (i == cel && rem != 0)
767
-            b = LCD_STR_PROGRESS[rem - 1];
768
-          msg[i] = b;
769
-        }
770
-        lcd.print(msg);
771
-        return;
772
-      }
781
+      if (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])
782
+        return lcd_draw_progress_bar(card.percentDone());
773
     } //card.isFileOpen
783
     } //card.isFileOpen
774
 
784
 
775
   #elif ENABLED(FILAMENT_LCD_DISPLAY)
785
   #elif ENABLED(FILAMENT_LCD_DISPLAY)

+ 1
- 1
Marlin/watchdog.cpp View File

43
 //=================================== ISR ===================================
43
 //=================================== ISR ===================================
44
 //===========================================================================
44
 //===========================================================================
45
 
45
 
46
-// Watchdog timer interrupt, called if main program blocks >1sec and manual reset is enabled.
46
+// Watchdog timer interrupt, called if main program blocks >4sec and manual reset is enabled.
47
 #if ENABLED(WATCHDOG_RESET_MANUAL)
47
 #if ENABLED(WATCHDOG_RESET_MANUAL)
48
   ISR(WDT_vect) {
48
   ISR(WDT_vect) {
49
     SERIAL_ERROR_START;
49
     SERIAL_ERROR_START;

Loading…
Cancel
Save