Merge pull request #3566 from thinkyhead/rc_babystep_show_steps

Show steps done in the babystep display
2.0.x
Scott Lahteine 9 years ago
commit 5cb8ec68ae

@ -550,10 +550,12 @@ void lcd_set_home_offsets() {
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
int babysteps_done = 0;
static void _lcd_babystep(const int axis, const char* msg) { static void _lcd_babystep(const int axis, const char* msg) {
ENCODER_DIRECTION_NORMAL(); ENCODER_DIRECTION_NORMAL();
if (encoderPosition) { if (encoderPosition) {
int distance = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR; int distance = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
encoderPosition = 0; encoderPosition = 0;
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
#if ENABLED(COREXY) || ENABLED(COREXZ) #if ENABLED(COREXY) || ENABLED(COREXZ)
@ -580,16 +582,21 @@ void lcd_set_home_offsets() {
#else #else
babystepsTodo[axis] += distance; babystepsTodo[axis] += distance;
#endif #endif
babysteps_done += distance;
} }
if (lcdDrawUpdate) lcd_implementation_drawedit(msg, NULL); if (lcdDrawUpdate) lcd_implementation_drawedit(msg, itostr3sign(babysteps_done));
if (LCD_CLICKED) lcd_goto_previous_menu(true); if (LCD_CLICKED) lcd_goto_previous_menu(true);
} }
#if ENABLED(BABYSTEP_XY) #if ENABLED(BABYSTEP_XY)
static void lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); } static void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEPPING_X)); }
static void lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); } static void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEPPING_Y)); }
static void lcd_babystep_x() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_x); }
static void lcd_babystep_y() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_y); }
#endif #endif
static void lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); } static void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); }
static void lcd_babystep_z() { babysteps_done = 0; lcd_goto_menu(_lcd_babystep_z); }
#endif //BABYSTEPPING #endif //BABYSTEPPING
@ -2573,8 +2580,8 @@ char* ftostr32sp(const float& x) {
return conv; return conv;
} }
// Convert signed int to lj string with +012.0 / -012.0 format // Convert signed int to lj string with +012 / -012 format
char* itostr31(const int& x) { char* itostr3sign(const int& x) {
int xx; int xx;
if (x >= 0) { if (x >= 0) {
conv[0] = '+'; conv[0] = '+';

@ -162,7 +162,7 @@
#endif //ULTRA_LCD #endif //ULTRA_LCD
char* itostr2(const uint8_t& x); char* itostr2(const uint8_t& x);
char* itostr31(const int& x); char* itostr3sign(const int& x);
char* itostr3(const int& x); char* itostr3(const int& x);
char* itostr3left(const int& x); char* itostr3left(const int& x);
char* itostr4(const int& x); char* itostr4(const int& x);

Loading…
Cancel
Save