Commit 15c6606c authored by MagoKimbra's avatar MagoKimbra

Fix pause end filament

parent d8fb5208
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
//#define FIRMWARE_TEST //#define FIRMWARE_TEST
#ifdef FIRMWARE_TEST #ifdef FIRMWARE_TEST
#undef BAUDRATE #undef BAUDRATE
#define BAUDRATE 115200 // Baudrate setting to 115200 because serial monitor arduino fuction at max 115200 baudrate. #define BAUDRATE 115200 // Baudrate setting to 115200 because serial monitor arduino function at max 115200 baudrate.
#endif #endif
/***********************************************************************\ /***********************************************************************\
......
...@@ -355,7 +355,7 @@ void Config_ResetDefault() ...@@ -355,7 +355,7 @@ void Config_ResetDefault()
#ifdef PIDTEMP #ifdef PIDTEMP
#ifndef SINGLENOZZLE #ifndef SINGLENOZZLE
for (short e=0;e<EXTRUDERS;e++) for (int e=0;e<EXTRUDERS;e++)
#else #else
int e = 0; // only need to write once int e = 0; // only need to write once
#endif //SINGLENOZZLE #endif //SINGLENOZZLE
......
...@@ -456,7 +456,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st ...@@ -456,7 +456,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#ifdef FILAMENTCHANGEENABLE #ifdef FILAMENTCHANGEENABLE
#define FILAMENTCHANGE_XPOS 3 #define FILAMENTCHANGE_XPOS 3
#define FILAMENTCHANGE_YPOS 3 #define FILAMENTCHANGE_YPOS 3
#define FILAMENTCHANGE_ZADD 10 #define FILAMENTCHANGE_ZADD 5
#define FILAMENTCHANGE_FIRSTRETRACT -2 #define FILAMENTCHANGE_FIRSTRETRACT -2
#define FILAMENTCHANGE_FINALRETRACT -100 #define FILAMENTCHANGE_FINALRETRACT -100
#endif #endif
......
...@@ -14,10 +14,14 @@ ...@@ -14,10 +14,14 @@
// it is a Russian alphabet translation // it is a Russian alphabet translation
// except 0401 --> 0xa2 = ╗, 0451 --> 0xb5 // except 0401 --> 0xa2 = ╗, 0451 --> 0xb5
const PROGMEM uint8_t utf_recode[] = const PROGMEM uint8_t utf_recode[] =
{ 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f, { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,
0xa8,0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1, 0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,0xa8,
0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f, 0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,
0xbe,0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7 0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1,
0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,
0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,0xbe,
0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,
0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7
}; };
// When the display powers up, it is configured as follows: // When the display powers up, it is configured as follows:
......
This diff is collapsed.
...@@ -65,7 +65,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m ...@@ -65,7 +65,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
createFilename(lfilename,p); createFilename(lfilename,p);
path[0]=0; path[0]=0;
if(strlen(prepend)==0) //avoid leading / if already in prepend if(prepend[0]==0) //avoid leading / if already in prepend
{ {
strcat(path,"/"); strcat(path,"/");
} }
......
...@@ -315,7 +315,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c ...@@ -315,7 +315,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c
static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) { static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) {
char c; char c;
uint8_t n = LCD_WIDTH - 2 - (pgm ? strlen_P(data) : (strlen(data))); uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
lcd_implementation_mark_as_selected(row, pre_char); lcd_implementation_mark_as_selected(row, pre_char);
...@@ -377,18 +377,18 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { ...@@ -377,18 +377,18 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
uint8_t char_width = DOG_CHAR_WIDTH; uint8_t char_width = DOG_CHAR_WIDTH;
#ifdef USE_BIG_EDIT_FONT #ifdef USE_BIG_EDIT_FONT
if (strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) { if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
u8g.setFont(FONT_MENU_EDIT); u8g.setFont(FONT_MENU_EDIT);
lcd_width = LCD_WIDTH_EDIT + 1; lcd_width = LCD_WIDTH_EDIT + 1;
char_width = DOG_CHAR_WIDTH_EDIT; char_width = DOG_CHAR_WIDTH_EDIT;
if (strlen_P(pstr) >= LCD_WIDTH_EDIT - strlen(value)) rows = 2; if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - lcd_strlen(value)) rows = 2;
} }
else { else {
u8g.setFont(FONT_MENU); u8g.setFont(FONT_MENU);
} }
#endif #endif
if (strlen_P(pstr) > LCD_WIDTH - 2 - strlen(value)) rows = 2; if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - lcd_strlen(value)) rows = 2;
const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2; const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2;
float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3 float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
...@@ -396,7 +396,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) { ...@@ -396,7 +396,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
u8g.setPrintPos(0, rowHeight + kHalfChar); u8g.setPrintPos(0, rowHeight + kHalfChar);
lcd_printPGM(pstr); lcd_printPGM(pstr);
u8g.print(':'); u8g.print(':');
u8g.setPrintPos((lcd_width-1-strlen(value)) * char_width, rows * rowHeight + kHalfChar); u8g.setPrintPos((lcd_width-1-lcd_strlen(value)) * char_width, rows * rowHeight + kHalfChar);
u8g.print(value); u8g.print(value);
} }
......
...@@ -65,9 +65,11 @@ float current_temperature_bed = 0.0; ...@@ -65,9 +65,11 @@ float current_temperature_bed = 0.0;
float redundant_temperature = 0.0; float redundant_temperature = 0.0;
#endif #endif
#ifdef PIDTEMP #ifdef PIDTEMP
float Kp[4]; #ifndef SINGLENOZZLE
float Ki[4]; float Kp[EXTRUDERS],Ki[EXTRUDERS],Kd[EXTRUDERS];
float Kd[4]; #else
float Kp[1],Ki[1],Kd[1];
#endif
#endif //PIDTEMP #endif //PIDTEMP
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
...@@ -400,9 +402,7 @@ void updatePID() ...@@ -400,9 +402,7 @@ void updatePID()
temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki[e]; temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki[e];
} }
#else #else
for(int e = 0; e < 1; e++) { temp_iState_max[0] = PID_INTEGRAL_DRIVE_MAX / Ki[0];
temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki[0];
}
#endif #endif
#endif #endif
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
...@@ -538,7 +538,7 @@ void manage_heater() ...@@ -538,7 +538,7 @@ void manage_heater()
#ifndef SINGLENOZZLE #ifndef SINGLENOZZLE
for(int e = 0; e < EXTRUDERS; e++) for(int e = 0; e < EXTRUDERS; e++)
#else #else
for(int e = 0; e < 1; e++) int e = 0;
#endif // !SINLGENOZZE #endif // !SINLGENOZZE
{ {
...@@ -1145,19 +1145,18 @@ void setWatch() ...@@ -1145,19 +1145,18 @@ void setWatch()
{ {
#ifdef WATCH_TEMP_PERIOD #ifdef WATCH_TEMP_PERIOD
#ifndef SINGLENOZZLE #ifndef SINGLENOZZLE
for (uint8_t e = 0; e < EXTRUDERS; e++) for (int e = 0; e < EXTRUDERS; e++)
{
#else #else
uint8_t e = 0; int e = 0;
{
#endif // !SINGLENOZZLE #endif // !SINGLENOZZLE
if(degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
{ if(degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2))
watch_start_temp[e] = degHotend(e); {
watchmillis[e] = millis(); watch_start_temp[e] = degHotend(e);
} watchmillis[e] = millis();
} }
#endif }
#endif //WATCH_TEMP_PERIOD
} }
#if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0 #if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0
...@@ -1225,18 +1224,18 @@ void thermal_runaway_protection(int *state, unsigned long *timer, float temperat ...@@ -1225,18 +1224,18 @@ void thermal_runaway_protection(int *state, unsigned long *timer, float temperat
void disable_heater() void disable_heater()
{ {
#ifndef SINGLENOZZLE #ifndef SINGLENOZZLE
for(uint8_t i=0;i<EXTRUDERS;i++) for(int i=0;i<EXTRUDERS;i++)
#else #else
uint8_t i=0; int i=0;
#endif // !SINGLENOZZLE #endif // !SINGLENOZZLE
setTargetHotend(0,i); setTargetHotend(0,i);
setTargetBed(0); setTargetBed(0);
#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
target_temperature[0]=0; target_temperature[0]=0;
soft_pwm[0]=0; soft_pwm[0]=0;
#if defined(HEATER_0_PIN) && HEATER_0_PIN > -1 #if defined(HEATER_0_PIN) && HEATER_0_PIN > -1
WRITE(HEATER_0_PIN,LOW); WRITE(HEATER_0_PIN,LOW);
#endif #endif
#endif #endif
#ifndef SINGLENOZZLE #ifndef SINGLENOZZLE
......
...@@ -41,19 +41,19 @@ void manage_heater(); //it is critical that this is called periodically. ...@@ -41,19 +41,19 @@ void manage_heater(); //it is critical that this is called periodically.
// low level conversion routines // low level conversion routines
// do not use these routines and variables outside of temperature.cpp // do not use these routines and variables outside of temperature.cpp
#ifndef SINGLENOZZLE #ifndef SINGLENOZZLE
extern int target_temperature[EXTRUDERS]; extern int target_temperature[EXTRUDERS];
extern float current_temperature[EXTRUDERS]; extern float current_temperature[EXTRUDERS];
#ifdef SHOW_TEMP_ADC_VALUES #ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[EXTRUDERS]; extern int current_temperature_raw[EXTRUDERS];
extern int current_temperature_bed_raw; extern int current_temperature_bed_raw;
#endif #endif
#else #else
extern int target_temperature[1]; extern int target_temperature[1];
extern float current_temperature[1]; extern float current_temperature[1];
#ifdef SHOW_TEMP_ADC_VALUES #ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[1]; extern int current_temperature_raw[1];
extern int current_temperature_bed_raw; extern int current_temperature_bed_raw;
#endif #endif
#endif //SINGLENOZZLE #endif //SINGLENOZZLE
extern int target_temperature_bed; extern int target_temperature_bed;
...@@ -67,19 +67,21 @@ extern float current_temperature_bed; ...@@ -67,19 +67,21 @@ extern float current_temperature_bed;
#endif #endif
#ifdef PIDTEMP #ifdef PIDTEMP
extern float Kp[4],Ki[4],Kd[4]; #ifndef SINGLENOZZLE
extern float Kp[EXTRUDERS],Ki[EXTRUDERS],Kd[EXTRUDERS];
#else
extern float Kp[1],Ki[1],Kd[1];
#endif
float scalePID_i(float i); float scalePID_i(float i);
float scalePID_d(float d); float scalePID_d(float d);
float unscalePID_i(float i); float unscalePID_i(float i);
float unscalePID_d(float d); float unscalePID_d(float d);
#endif #endif
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
extern float bedKp,bedKi,bedKd; extern float bedKp,bedKi,bedKd;
#endif #endif
#ifdef BABYSTEPPING #ifdef BABYSTEPPING
extern volatile int babystepsTodo[3]; extern volatile int babystepsTodo[3];
#endif #endif
......
...@@ -1095,6 +1095,16 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1095,6 +1095,16 @@ const short temptable_1047[][2] PROGMEM = {
}; };
#endif #endif
#if (THERMISTORHEATER_0 == 999) || (THERMISTORHEATER_1 == 999) || (THERMISTORHEATER_2 == 999) || (THERMISTORHEATER_3 == 999) || (THERMISTORBED == 999) //User defined table
// Dummy Thermistor table.. It will ALWAYS read 25C.
const short temptable_999[][2] PROGMEM = {
{1*OVERSAMPLENR, 25},
{1023*OVERSAMPLENR, 25}
};
#endif
#define _TT_NAME(_N) temptable_ ## _N #define _TT_NAME(_N) temptable_ ## _N
#define TT_NAME(_N) _TT_NAME(_N) #define TT_NAME(_N) _TT_NAME(_N)
......
This diff is collapsed.
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#include "Marlin.h" #include "Marlin.h"
#ifdef ULTRA_LCD #ifdef ULTRA_LCD
int lcd_strlen(char *s);
int lcd_strlen_P(const char *s);
void lcd_update(); void lcd_update();
void lcd_init(); void lcd_init();
void lcd_setstatus(const char* message); void lcd_setstatus(const char* message);
......
...@@ -660,7 +660,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c ...@@ -660,7 +660,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c
{ {
lcd.print(c); lcd.print(c);
pstr++; pstr++;
n--; if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
} }
while(n--) while(n--)
lcd.print(' '); lcd.print(' ');
...@@ -672,9 +672,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const ...@@ -672,9 +672,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const
char c; char c;
//Use all characters in narrow LCDs //Use all characters in narrow LCDs
#if LCD_WIDTH < 20 #if LCD_WIDTH < 20
uint8_t n = LCD_WIDTH - 1 - 1 - strlen(data); uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen(data);
#else #else
uint8_t n = LCD_WIDTH - 1 - 2 - strlen(data); uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen(data);
#endif #endif
lcd.setCursor(0, row); lcd.setCursor(0, row);
lcd.print(pre_char); lcd.print(pre_char);
...@@ -682,7 +682,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const ...@@ -682,7 +682,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const
{ {
lcd.print(c); lcd.print(c);
pstr++; pstr++;
n--; if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
} }
lcd.print(':'); lcd.print(':');
while(n--) while(n--)
...@@ -694,9 +694,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons ...@@ -694,9 +694,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons
char c; char c;
//Use all characters in narrow LCDs //Use all characters in narrow LCDs
#if LCD_WIDTH < 20 #if LCD_WIDTH < 20
uint8_t n = LCD_WIDTH - 1 - 1 - strlen_P(data); uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen_P(data);
#else #else
uint8_t n = LCD_WIDTH - 1 - 2 - strlen_P(data); uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen_P(data);
#endif #endif
lcd.setCursor(0, row); lcd.setCursor(0, row);
lcd.print(pre_char); lcd.print(pre_char);
...@@ -704,7 +704,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons ...@@ -704,7 +704,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons
{ {
lcd.print(c); lcd.print(c);
pstr++; pstr++;
n--; if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
} }
lcd.print(':'); lcd.print(':');
while(n--) while(n--)
...@@ -757,9 +757,9 @@ void lcd_implementation_drawedit(const char* pstr, char* value) ...@@ -757,9 +757,9 @@ void lcd_implementation_drawedit(const char* pstr, char* value)
lcd_printPGM(pstr); lcd_printPGM(pstr);
lcd.print(':'); lcd.print(':');
#if LCD_WIDTH < 20 #if LCD_WIDTH < 20
lcd.setCursor(LCD_WIDTH - strlen(value), 1); lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
#else #else
lcd.setCursor(LCD_WIDTH -1 - strlen(value), 1); lcd.setCursor(LCD_WIDTH -1 - lcd_strlen(value), 1);
#endif #endif
lcd.print(value); lcd.print(value);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment