Merge pull request #4057 from thinkyhead/rc_babysteps_mm
Babystepping show millimeters on LCD
This commit is contained in:
commit
cd9ecfdcb1
13
Marlin/ultralcd.cpp
Normal file → Executable file
13
Marlin/ultralcd.cpp
Normal file → Executable file
|
@ -575,18 +575,21 @@ static void lcd_status_screen() {
|
||||||
|
|
||||||
#if ENABLED(BABYSTEPPING)
|
#if ENABLED(BABYSTEPPING)
|
||||||
|
|
||||||
int babysteps_done = 0;
|
long babysteps_done = 0;
|
||||||
|
|
||||||
static void _lcd_babystep(const AxisEnum axis, const char* msg) {
|
static void _lcd_babystep(const AxisEnum axis, const char* msg) {
|
||||||
ENCODER_DIRECTION_NORMAL();
|
ENCODER_DIRECTION_NORMAL();
|
||||||
if (encoderPosition) {
|
if (encoderPosition) {
|
||||||
int distance = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
|
int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
|
||||||
encoderPosition = 0;
|
encoderPosition = 0;
|
||||||
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
||||||
thermalManager.babystep_axis(axis, distance);
|
thermalManager.babystep_axis(axis, babystep_increment);
|
||||||
babysteps_done += distance;
|
babysteps_done += babystep_increment;
|
||||||
}
|
}
|
||||||
if (lcdDrawUpdate) lcd_implementation_drawedit(msg, itostr3sign(babysteps_done));
|
if (lcdDrawUpdate)
|
||||||
|
lcd_implementation_drawedit(msg, ftostr43sign(
|
||||||
|
((1000 * babysteps_done) / planner.axis_steps_per_mm[axis]) * 0.001f
|
||||||
|
));
|
||||||
if (LCD_CLICKED) lcd_goto_previous_menu(true);
|
if (LCD_CLICKED) lcd_goto_previous_menu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue