浏览代码

Merge pull request #4057 from thinkyhead/rc_babysteps_mm

Babystepping show millimeters on LCD
Scott Lahteine 9 年前
父节点
当前提交
cd9ecfdcb1
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8
    5
      Marlin/ultralcd.cpp

+ 8
- 5
Marlin/ultralcd.cpp 查看文件

575
 
575
 
576
   #if ENABLED(BABYSTEPPING)
576
   #if ENABLED(BABYSTEPPING)
577
 
577
 
578
-    int babysteps_done = 0;
578
+    long babysteps_done = 0;
579
 
579
 
580
     static void _lcd_babystep(const AxisEnum axis, const char* msg) {
580
     static void _lcd_babystep(const AxisEnum axis, const char* msg) {
581
       ENCODER_DIRECTION_NORMAL();
581
       ENCODER_DIRECTION_NORMAL();
582
       if (encoderPosition) {
582
       if (encoderPosition) {
583
-        int distance = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
583
+        int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
584
         encoderPosition = 0;
584
         encoderPosition = 0;
585
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
585
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
586
-        thermalManager.babystep_axis(axis, distance);
587
-        babysteps_done += distance;
586
+        thermalManager.babystep_axis(axis, babystep_increment);
587
+        babysteps_done += babystep_increment;
588
       }
588
       }
589
-      if (lcdDrawUpdate) lcd_implementation_drawedit(msg, itostr3sign(babysteps_done));
589
+      if (lcdDrawUpdate)
590
+        lcd_implementation_drawedit(msg, ftostr43sign(
591
+          ((1000 * babysteps_done) / planner.axis_steps_per_mm[axis]) * 0.001f
592
+        ));
590
       if (LCD_CLICKED) lcd_goto_previous_menu(true);
593
       if (LCD_CLICKED) lcd_goto_previous_menu(true);
591
     }
594
     }
592
 
595
 

正在加载...
取消
保存