瀏覽代碼

Draw on LCD after value has changed

Scott Lahteine 8 年之前
父節點
當前提交
0f1e8c195d
共有 1 個文件被更改,包括 11 次插入10 次删除
  1. 11
    10
      Marlin/ultralcd.cpp

+ 11
- 10
Marlin/ultralcd.cpp 查看文件

236
    *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
236
    *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
237
    *
237
    *
238
    */
238
    */
239
-  #define _MENU_ITEM_PART_1(TYPE, LABEL, ...) \
239
+  #define _MENU_ITEM_PART_1(TYPE, ...) \
240
     if (_menuLineNr == _thisItemNr) { \
240
     if (_menuLineNr == _thisItemNr) { \
241
-      if (lcdDrawUpdate) \
242
-        lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \
243
       if (lcd_clicked && encoderLine == _thisItemNr) {
241
       if (lcd_clicked && encoderLine == _thisItemNr) {
244
 
242
 
245
-  #define _MENU_ITEM_PART_2(TYPE, ...) \
243
+  #define _MENU_ITEM_PART_2(TYPE, LABEL, ...) \
246
         menu_action_ ## TYPE(__VA_ARGS__); \
244
         menu_action_ ## TYPE(__VA_ARGS__); \
247
         if (screen_changed) return; \
245
         if (screen_changed) return; \
248
       } \
246
       } \
247
+      if (lcdDrawUpdate) \
248
+        lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \
249
     } \
249
     } \
250
     ++_thisItemNr
250
     ++_thisItemNr
251
 
251
 
252
   #define MENU_ITEM(TYPE, LABEL, ...) do { \
252
   #define MENU_ITEM(TYPE, LABEL, ...) do { \
253
       _skipStatic = false; \
253
       _skipStatic = false; \
254
-      _MENU_ITEM_PART_1(TYPE, LABEL, ## __VA_ARGS__); \
255
-      _MENU_ITEM_PART_2(TYPE, ## __VA_ARGS__); \
254
+      _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \
255
+      _MENU_ITEM_PART_2(TYPE, LABEL, ## __VA_ARGS__); \
256
     } while(0)
256
     } while(0)
257
 
257
 
258
   #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
258
   #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
281
      * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item
281
      * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item
282
      */
282
      */
283
     #define MENU_MULTIPLIER_ITEM(type, label, ...) do { \
283
     #define MENU_MULTIPLIER_ITEM(type, label, ...) do { \
284
-        _MENU_ITEM_PART_1(type, label, ## __VA_ARGS__); \
284
+        _MENU_ITEM_PART_1(type, ## __VA_ARGS__); \
285
         encoderRateMultiplierEnabled = true; \
285
         encoderRateMultiplierEnabled = true; \
286
         lastEncoderMovementMillis = 0; \
286
         lastEncoderMovementMillis = 0; \
287
-        _MENU_ITEM_PART_2(type, ## __VA_ARGS__); \
287
+        _MENU_ITEM_PART_2(type, label, ## __VA_ARGS__); \
288
       } while(0)
288
       } while(0)
289
 
289
 
290
   #else // !ENCODER_RATE_MULTIPLIER
290
   #else // !ENCODER_RATE_MULTIPLIER
581
     #endif
581
     #endif
582
   #endif // LCD_PROGRESS_BAR
582
   #endif // LCD_PROGRESS_BAR
583
 
583
 
584
-  lcd_implementation_status_screen();
585
-
586
   #if ENABLED(ULTIPANEL)
584
   #if ENABLED(ULTIPANEL)
587
 
585
 
588
     if (lcd_clicked) {
586
     if (lcd_clicked) {
595
         #endif
593
         #endif
596
       );
594
       );
597
       lcd_goto_screen(lcd_main_menu);
595
       lcd_goto_screen(lcd_main_menu);
596
+      return;
598
     }
597
     }
599
 
598
 
600
     #if ENABLED(ULTIPANEL_FEEDMULTIPLY)
599
     #if ENABLED(ULTIPANEL_FEEDMULTIPLY)
623
     feedrate_percentage = constrain(feedrate_percentage, 10, 999);
622
     feedrate_percentage = constrain(feedrate_percentage, 10, 999);
624
 
623
 
625
   #endif // ULTIPANEL
624
   #endif // ULTIPANEL
625
+
626
+  lcd_implementation_status_screen();
626
 }
627
 }
627
 
628
 
628
 /**
629
 /**

Loading…
取消
儲存