From df1437bd86bb2d30a35012bbeb43d4d213a3c41b Mon Sep 17 00:00:00 2001 From: Erik van der Zalm Date: Tue, 21 Feb 2012 23:05:43 +0100 Subject: [PATCH] Changed display format for some numbers. --- Marlin/Marlin.pde | 6 ------ Marlin/ultralcd.h | 9 +-------- Marlin/ultralcd.pde | 40 +++++++++++++++++++++++++++------------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 3c8c022169..bf31df2456 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -586,8 +586,6 @@ void process_commands() st_synchronize(); endstops_hit_on_purpose(); } - else - { #endif if((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) @@ -599,10 +597,6 @@ void process_commands() HOMEAXIS(Y); } - #ifdef QUICK_HOME - } - #endif - if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) { HOMEAXIS(Z); } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 6cfdc74ad1..c4392d26fc 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -9,18 +9,11 @@ void beep(); void buttons_check(); - #define LCD_UPDATE_INTERVAL 100 #define STATUSTIMEOUT 15000 - - - extern LiquidCrystal lcd; - - + #ifdef NEWPANEL - - #define EN_C (1<9999) encoderpos=9999; - lcd.setCursor(13,line);lcd.print(itostr4(encoderpos)); + if(encoderpos>99999) encoderpos=99999; + lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0)); } }break; @@ -2223,6 +2222,21 @@ char *ftostr51(const float &x) return conv; } +// convert float to string with +123.45 format +char *ftostr52(const float &x) +{ + int xx=x*100; + conv[0]=(xx>=0)?'+':'-'; + xx=abs(xx); + conv[1]=(xx/10000)%10+'0'; + conv[2]=(xx/1000)%10+'0'; + conv[3]=(xx/100)%10+'0'; + conv[4]='.'; + conv[5]=(xx/10)%10+'0'; + conv[6]=(xx)%10+'0'; + conv[7]=0; + return conv; +} #endif //ULTRA_LCD