From 789ba02d43a2b940a032d0e4f87a0b92c920a940 Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Thu, 3 May 2012 14:13:53 +0200 Subject: [PATCH 01/10] fixed typo in comment --- Marlin/Marlin.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 1f29087665..0164a761ad 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -1246,7 +1246,7 @@ void process_commands() } break; - case 302: // finish all moves + case 302: // allow cold extrudes { allow_cold_extrudes(true); } From 060b38de5c72dd0a98e222f8d7f5e000f7cc6fdf Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Thu, 3 May 2012 14:15:46 +0200 Subject: [PATCH 02/10] delete obsolete and wrong code "i" runs from 0 to 4 but "add_homeing" array size is 3 only. On the other hand the calculated value gets overwritten by either one of the if choice. --- Marlin/Marlin.pde | 1 - 1 file changed, 1 deletion(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 0164a761ad..2facb9429c 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -687,7 +687,6 @@ void process_commands() st_synchronize(); for(int8_t i=0; i < NUM_AXIS; i++) { if(code_seen(axis_codes[i])) { - current_position[i] = code_value()+add_homeing[i]; if(i == E_AXIS) { current_position[i] = code_value(); plan_set_e_position(current_position[E_AXIS]); From bd1ad7c76a8d6eb770c5a982817f4ce206f95770 Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Thu, 3 May 2012 14:22:43 +0200 Subject: [PATCH 03/10] explicit includes to make it compile with AVRStudio/Eclipse --- Marlin/ultralcd.pde | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index c6cd15bb04..a10fbb3421 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -1,6 +1,9 @@ #include "ultralcd.h" #ifdef ULTRA_LCD #include "Marlin.h" +#include "language.h" +#include "temperature.h" +#include "EEPROMwrite.h" #include //=========================================================================== //=============================imported variables============================ @@ -13,6 +16,7 @@ extern volatile int extrudemultiply; extern long position[4]; #ifdef SDSUPPORT +#include "cardreader.h" extern CardReader card; #endif From 032df0b2c6dde69303f60ee05681e046b1a4aab3 Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Thu, 3 May 2012 14:28:17 +0200 Subject: [PATCH 04/10] Moved LCD initialization out of constructor Since the class "MainMenu" was used within a static variable the initialization of the object (constructor call) was done before Arduino library startup. It always caused a crash when using AVRStudio with JTAG debugger (caused from calling the LCD initialization / the lot of I/O work / the stack used during this calls). By moving the LCD_INIT out of the constructor and using an explicit call inside of Arduino setup() implementation immediately fixed all problems and the JTAG debugger runs fine. --- Marlin/Marlin.pde | 2 ++ Marlin/ultralcd.h | 3 ++- Marlin/ultralcd.pde | 7 +++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 2facb9429c..c9cff67de0 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -300,6 +300,8 @@ void setup() st_init(); // Initialize stepper; wd_init(); setup_photpin(); + + LCD_INIT; } diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 253149cbba..39d262222e 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -134,11 +134,12 @@ char *ftostr3(const float &x); - + #define LCD_INIT lcd_init(); #define LCD_MESSAGE(x) lcd_status(x); #define LCD_MESSAGEPGM(x) lcd_statuspgm(MYPGM(x)); #define LCD_STATUS lcd_status() #else //no lcd + #define LCD_INIT #define LCD_STATUS #define LCD_MESSAGE(x) #define LCD_MESSAGEPGM(x) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index a10fbb3421..9124022944 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -99,6 +99,9 @@ FORCE_INLINE void clear() void lcd_init() { //beep(); + #ifdef ULTIPANEL + buttons_init(); + #endif byte Degree[8] = { @@ -306,10 +309,6 @@ MainMenu::MainMenu() displayStartingRow=0; activeline=0; force_lcd_update=true; - #ifdef ULTIPANEL - buttons_init(); - #endif - lcd_init(); linechanging=false; tune=false; } From 3682d9bd5b34bdc6560d97278d6d7eff3243bddc Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Thu, 3 May 2012 15:43:23 +0200 Subject: [PATCH 05/10] magic PROGMEM defines to avoid hundreds of wrong GCC warnings --- Marlin/Marlin.h | 7 +++++++ Marlin/thermistortables.h | 14 +++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 5bb728c6fa..5982302dac 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -20,6 +20,13 @@ #include #include +//do some magic defines in order to prevent hundreds of wrong warnings in gcc +//more info here: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=646359 +typedef short prog_short PROGMEM; +#undef PROGMEM +#define PROGMEM __attribute__(( section(".progmem.data") )) +#undef PSTR +#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];})) #include "fastio.h" #include "Configuration.h" diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index 3071a6b5bb..0ac03d5109 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -7,7 +7,7 @@ #if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORHEATER_2 == 1) || (THERMISTORBED == 1) //100k bed thermistor -const short temptable_1[][2] PROGMEM = { +const prog_short temptable_1[][2] = { { 23*OVERSAMPLENR , 300 }, { 25*OVERSAMPLENR , 295 }, { 27*OVERSAMPLENR , 290 }, @@ -72,7 +72,7 @@ const short temptable_1[][2] PROGMEM = { }; #endif #if (THERMISTORHEATER_0 == 2) || (THERMISTORHEATER_1 == 2) || (THERMISTORHEATER_2 == 2) || (THERMISTORBED == 2) //200k bed thermistor -const short temptable_2[][2] PROGMEM = { +const prog_short temptable_2[][2] = { {1*OVERSAMPLENR, 848}, {54*OVERSAMPLENR, 275}, {107*OVERSAMPLENR, 228}, @@ -98,7 +98,7 @@ const short temptable_2[][2] PROGMEM = { #endif #if (THERMISTORHEATER_0 == 3) || (THERMISTORHEATER_1 == 3) || (THERMISTORHEATER_2 == 3) || (THERMISTORBED == 3) //mendel-parts -const short temptable_3[][2] PROGMEM = { +const prog_short temptable_3[][2] = { {1*OVERSAMPLENR,864}, {21*OVERSAMPLENR,300}, {25*OVERSAMPLENR,290}, @@ -131,7 +131,7 @@ const short temptable_3[][2] PROGMEM = { #endif #if (THERMISTORHEATER_0 == 4) || (THERMISTORHEATER_1 == 4) || (THERMISTORHEATER_2 == 4) || (THERMISTORBED == 4) //10k thermistor -const short temptable_4[][2] PROGMEM = { +const prog_short temptable_4[][2] = { {1*OVERSAMPLENR, 430}, {54*OVERSAMPLENR, 137}, {107*OVERSAMPLENR, 107}, @@ -156,7 +156,7 @@ const short temptable_4[][2] PROGMEM = { #endif #if (THERMISTORHEATER_0 == 5) || (THERMISTORHEATER_1 == 5) || (THERMISTORHEATER_2 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2) -const short temptable_5[][2] PROGMEM = { +const prog_short temptable_5[][2] = { {1*OVERSAMPLENR, 713}, {18*OVERSAMPLENR, 316}, {35*OVERSAMPLENR, 266}, @@ -222,7 +222,7 @@ const short temptable_5[][2] PROGMEM = { #endif #if (THERMISTORHEATER_0 == 6) || (THERMISTORHEATER_1 == 6) || (THERMISTORHEATER_2 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor -const short temptable_6[][2] PROGMEM = { +const prog_short temptable_6[][2] = { {28*OVERSAMPLENR, 250}, {31*OVERSAMPLENR, 245}, {35*OVERSAMPLENR, 240}, @@ -263,7 +263,7 @@ const short temptable_6[][2] PROGMEM = { #endif #if (THERMISTORHEATER_0 == 7) || (THERMISTORHEATER_1 == 7) || (THERMISTORHEATER_2 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01 -const short temptable_7[][2] PROGMEM = { +const prog_short temptable_7[][2] = { {46*OVERSAMPLENR, 270}, {50*OVERSAMPLENR, 265}, {54*OVERSAMPLENR, 260}, From d188ae4c9d32ab87a31ac67e2bc587b7ed6c4d08 Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Thu, 3 May 2012 15:48:44 +0200 Subject: [PATCH 06/10] added missing declaration of buttons_init() This is required when moving the buttons_init() function to the lcd_init() function --- Marlin/ultralcd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 39d262222e..ab5675d598 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -7,6 +7,7 @@ void lcd_init(); void lcd_status(const char* message); void beep(); + void buttons_init(); void buttons_check(); #define LCD_UPDATE_INTERVAL 100 From b657a18449356fb002199d17fbfc59fb21e8da0e Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Fri, 4 May 2012 12:24:07 +0200 Subject: [PATCH 07/10] Revert "magic PROGMEM defines to avoid hundreds of wrong GCC warnings" This reverts commit 3682d9bd5b34bdc6560d97278d6d7eff3243bddc. --- Marlin/Marlin.h | 7 ------- Marlin/thermistortables.h | 14 +++++++------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 5982302dac..5bb728c6fa 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -20,13 +20,6 @@ #include #include -//do some magic defines in order to prevent hundreds of wrong warnings in gcc -//more info here: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=646359 -typedef short prog_short PROGMEM; -#undef PROGMEM -#define PROGMEM __attribute__(( section(".progmem.data") )) -#undef PSTR -#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];})) #include "fastio.h" #include "Configuration.h" diff --git a/Marlin/thermistortables.h b/Marlin/thermistortables.h index 0ac03d5109..3071a6b5bb 100644 --- a/Marlin/thermistortables.h +++ b/Marlin/thermistortables.h @@ -7,7 +7,7 @@ #if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORHEATER_2 == 1) || (THERMISTORBED == 1) //100k bed thermistor -const prog_short temptable_1[][2] = { +const short temptable_1[][2] PROGMEM = { { 23*OVERSAMPLENR , 300 }, { 25*OVERSAMPLENR , 295 }, { 27*OVERSAMPLENR , 290 }, @@ -72,7 +72,7 @@ const prog_short temptable_1[][2] = { }; #endif #if (THERMISTORHEATER_0 == 2) || (THERMISTORHEATER_1 == 2) || (THERMISTORHEATER_2 == 2) || (THERMISTORBED == 2) //200k bed thermistor -const prog_short temptable_2[][2] = { +const short temptable_2[][2] PROGMEM = { {1*OVERSAMPLENR, 848}, {54*OVERSAMPLENR, 275}, {107*OVERSAMPLENR, 228}, @@ -98,7 +98,7 @@ const prog_short temptable_2[][2] = { #endif #if (THERMISTORHEATER_0 == 3) || (THERMISTORHEATER_1 == 3) || (THERMISTORHEATER_2 == 3) || (THERMISTORBED == 3) //mendel-parts -const prog_short temptable_3[][2] = { +const short temptable_3[][2] PROGMEM = { {1*OVERSAMPLENR,864}, {21*OVERSAMPLENR,300}, {25*OVERSAMPLENR,290}, @@ -131,7 +131,7 @@ const prog_short temptable_3[][2] = { #endif #if (THERMISTORHEATER_0 == 4) || (THERMISTORHEATER_1 == 4) || (THERMISTORHEATER_2 == 4) || (THERMISTORBED == 4) //10k thermistor -const prog_short temptable_4[][2] = { +const short temptable_4[][2] PROGMEM = { {1*OVERSAMPLENR, 430}, {54*OVERSAMPLENR, 137}, {107*OVERSAMPLENR, 107}, @@ -156,7 +156,7 @@ const prog_short temptable_4[][2] = { #endif #if (THERMISTORHEATER_0 == 5) || (THERMISTORHEATER_1 == 5) || (THERMISTORHEATER_2 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2) -const prog_short temptable_5[][2] = { +const short temptable_5[][2] PROGMEM = { {1*OVERSAMPLENR, 713}, {18*OVERSAMPLENR, 316}, {35*OVERSAMPLENR, 266}, @@ -222,7 +222,7 @@ const prog_short temptable_5[][2] = { #endif #if (THERMISTORHEATER_0 == 6) || (THERMISTORHEATER_1 == 6) || (THERMISTORHEATER_2 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor -const prog_short temptable_6[][2] = { +const short temptable_6[][2] PROGMEM = { {28*OVERSAMPLENR, 250}, {31*OVERSAMPLENR, 245}, {35*OVERSAMPLENR, 240}, @@ -263,7 +263,7 @@ const prog_short temptable_6[][2] = { #endif #if (THERMISTORHEATER_0 == 7) || (THERMISTORHEATER_1 == 7) || (THERMISTORHEATER_2 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01 -const prog_short temptable_7[][2] = { +const short temptable_7[][2] PROGMEM = { {46*OVERSAMPLENR, 270}, {50*OVERSAMPLENR, 265}, {54*OVERSAMPLENR, 260}, From 1efe9ab49719b9d501f6cb339f824a9d86b8685f Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Fri, 11 May 2012 15:19:09 +0200 Subject: [PATCH 08/10] changed encoder pos from int to long to fix problems setting x/y/z/e stepps_per_mm using the lcd menu --- Marlin/ultralcd.h | 6 ++-- Marlin/ultralcd.pde | 80 ++++++++++++++++++++++----------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index ab5675d598..b01368bc14 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -70,7 +70,7 @@ void showAxisMove(); void showSD(); bool force_lcd_update; - int lastencoderpos; + long lastencoderpos; int8_t lineoffset; int8_t lastlineoffset; @@ -79,11 +79,11 @@ bool tune; private: - FORCE_INLINE void updateActiveLines(const uint8_t &maxlines,volatile int &encoderpos) + FORCE_INLINE void updateActiveLines(const uint8_t &maxlines,volatile long &encoderpos) { if(linechanging) return; // an item is changint its value, do not switch lines hence lastlineoffset=lineoffset; - int curencoderpos=encoderpos; + long curencoderpos=encoderpos; force_lcd_update=false; if( (abs(curencoderpos-lastencoderpos)9999) encoderpos=9999; - lcd.setCursor(13,line);lcd.print(itostr4(encoderpos)); + if(encoderpos>999999) encoderpos=999999; + lcd.setCursor(13,line);lcd.print(ftostr52(encoderpos/100.0)); } }break; @@ -1296,7 +1296,7 @@ void MainMenu::showControlTemp() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)Kp; + encoderpos=(long)Kp; } else { @@ -1331,7 +1331,7 @@ void MainMenu::showControlTemp() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)(Ki*10/PID_dT); + encoderpos=(long)(Ki*10/PID_dT); } else { @@ -1367,7 +1367,7 @@ void MainMenu::showControlTemp() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)(Kd/5./PID_dT); + encoderpos=(long)(Kd/5./PID_dT); } else { @@ -1403,7 +1403,7 @@ void MainMenu::showControlTemp() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)Kc; + encoderpos=(long)Kc; } else { @@ -1476,7 +1476,7 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)acceleration/100; + encoderpos=(long)acceleration/100; } else { @@ -1510,7 +1510,7 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)max_xy_jerk; + encoderpos=(long)max_xy_jerk; } else { @@ -1553,7 +1553,7 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)max_feedrate[i-ItemCM_vmaxx]; + encoderpos=(long)max_feedrate[i-ItemCM_vmaxx]; } else { @@ -1589,7 +1589,7 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)(minimumfeedrate); + encoderpos=(long)(minimumfeedrate); } else { @@ -1624,7 +1624,7 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)mintravelfeedrate; + encoderpos=(long)mintravelfeedrate; } else { @@ -1667,7 +1667,7 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)max_acceleration_units_per_sq_second[i-ItemCM_amaxx]/100; + encoderpos=(long)max_acceleration_units_per_sq_second[i-ItemCM_amaxx]/100; } else { @@ -1701,7 +1701,7 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)retract_acceleration/100; + encoderpos=(long)retract_acceleration/100; } else { @@ -1725,7 +1725,7 @@ void MainMenu::showControlMotion() if(force_lcd_update) { lcd.setCursor(0,line);lcdprintPGM(MSG_XSTEPS); - lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[0])); + lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[X_AXIS])); } if((activeline!=line) ) @@ -1736,13 +1736,13 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)(axis_steps_per_unit[0]*100.0); + encoderpos=(long)(axis_steps_per_unit[X_AXIS]*100.0); } else { - float factor=float(encoderpos)/100.0/float(axis_steps_per_unit[0]); + float factor=float(encoderpos)/100.0/float(axis_steps_per_unit[X_AXIS]); position[X_AXIS]=lround(position[X_AXIS]*factor); - //current_position[3]*=factor; + //current_position[X_AXIS]*=factor; axis_steps_per_unit[X_AXIS]= encoderpos/100.0; encoderpos=activeline*lcdslow; } @@ -1752,7 +1752,7 @@ void MainMenu::showControlMotion() if(linechanging) { if(encoderpos<5) encoderpos=5; - if(encoderpos>32000) encoderpos=32000;//TODO: This is a problem, encoderpos is 16bit, but steps_per_unit for e can be wel over 800 + if(encoderpos>999999) encoderpos=99999; lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0)); } @@ -1762,7 +1762,7 @@ void MainMenu::showControlMotion() if(force_lcd_update) { lcd.setCursor(0,line);lcdprintPGM(MSG_YSTEPS); - lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[1])); + lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[Y_AXIS])); } if((activeline!=line) ) @@ -1773,13 +1773,13 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)(axis_steps_per_unit[1]*100.0); + encoderpos=(long)(axis_steps_per_unit[Y_AXIS]*100.0); } else { - float factor=float(encoderpos)/100.0/float(axis_steps_per_unit[1]); + float factor=float(encoderpos)/100.0/float(axis_steps_per_unit[Y_AXIS]); position[Y_AXIS]=lround(position[Y_AXIS]*factor); - //current_position[3]*=factor; + //current_position[Y_AXIS]*=factor; axis_steps_per_unit[Y_AXIS]= encoderpos/100.0; encoderpos=activeline*lcdslow; @@ -1790,7 +1790,7 @@ void MainMenu::showControlMotion() if(linechanging) { if(encoderpos<5) encoderpos=5; - if(encoderpos>9999) encoderpos=9999; + if(encoderpos>999999) encoderpos=999999; lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0)); } @@ -1800,7 +1800,7 @@ void MainMenu::showControlMotion() if(force_lcd_update) { lcd.setCursor(0,line);lcdprintPGM(MSG_ZSTEPS); - lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[2])); + lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[Z_AXIS])); } if((activeline!=line) ) @@ -1811,13 +1811,13 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)(axis_steps_per_unit[2]*100.0); + encoderpos=(long)(axis_steps_per_unit[Z_AXIS]*100.0); } else { - float factor=float(encoderpos)/100.0/float(axis_steps_per_unit[2]); + float factor=float(encoderpos)/100.0/float(axis_steps_per_unit[Z_AXIS]); position[Z_AXIS]=lround(position[Z_AXIS]*factor); - //current_position[3]*=factor; + //current_position[Z_AXIS]*=factor; axis_steps_per_unit[Z_AXIS]= encoderpos/100.0; encoderpos=activeline*lcdslow; @@ -1828,7 +1828,7 @@ void MainMenu::showControlMotion() if(linechanging) { if(encoderpos<5) encoderpos=5; - if(encoderpos>9999) encoderpos=9999; + if(encoderpos>999999) encoderpos=999999; lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0)); } @@ -1839,7 +1839,7 @@ void MainMenu::showControlMotion() if(force_lcd_update) { lcd.setCursor(0,line);lcdprintPGM(MSG_ESTEPS); - lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[3])); + lcd.setCursor(11,line);lcd.print(ftostr52(axis_steps_per_unit[E_AXIS])); } if((activeline!=line) ) @@ -1850,13 +1850,13 @@ void MainMenu::showControlMotion() linechanging=!linechanging; if(linechanging) { - encoderpos=(int)(axis_steps_per_unit[3]*100.0); + encoderpos=(long)(axis_steps_per_unit[E_AXIS]*100.0); } else { - float factor=float(encoderpos)/100.0/float(axis_steps_per_unit[3]); + float factor=float(encoderpos)/100.0/float(axis_steps_per_unit[E_AXIS]); position[E_AXIS]=lround(position[E_AXIS]*factor); - //current_position[3]*=factor; + //current_position[E_AXIS]*=factor; axis_steps_per_unit[E_AXIS]= encoderpos/100.0; encoderpos=activeline*lcdslow; @@ -1867,7 +1867,7 @@ void MainMenu::showControlMotion() if(linechanging) { if(encoderpos<5) encoderpos=5; - if(encoderpos>9999) encoderpos=9999; + if(encoderpos>999999) encoderpos=999999; lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0)); } @@ -2381,4 +2381,4 @@ char *ftostr52(const float &x) #endif //ULTRA_LCD - + From e48f5aa6a7a55389979e1a4192b9e9462979e186 Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Fri, 11 May 2012 15:22:06 +0200 Subject: [PATCH 09/10] fixed typo --- Marlin/ultralcd.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index d57d160941..060b7208dc 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -1752,7 +1752,7 @@ void MainMenu::showControlMotion() if(linechanging) { if(encoderpos<5) encoderpos=5; - if(encoderpos>999999) encoderpos=99999; + if(encoderpos>999999) encoderpos=999999; lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0)); } From 159ae90874d6a4c9afa2906d09ef2ee279f1bc9e Mon Sep 17 00:00:00 2001 From: MaikStohn Date: Fri, 11 May 2012 15:23:10 +0200 Subject: [PATCH 10/10] bug fix for scrolling of main menu when using SMALL_DISPLAY (2 lines only) --- Marlin/ultralcd.pde | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 060b7208dc..69364acb06 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -2108,9 +2108,10 @@ void MainMenu::showMainMenu() } } clearIfNecessary(); - for(int8_t line=0;line