Commit 15c6606c authored by MagoKimbra's avatar MagoKimbra

Fix pause end filament

parent d8fb5208
......@@ -47,7 +47,7 @@
//#define FIRMWARE_TEST
#ifdef FIRMWARE_TEST
#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
/***********************************************************************\
......
......@@ -355,7 +355,7 @@ void Config_ResetDefault()
#ifdef PIDTEMP
#ifndef SINGLENOZZLE
for (short e=0;e<EXTRUDERS;e++)
for (int e=0;e<EXTRUDERS;e++)
#else
int e = 0; // only need to write once
#endif //SINGLENOZZLE
......
......@@ -456,7 +456,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#ifdef FILAMENTCHANGEENABLE
#define FILAMENTCHANGE_XPOS 3
#define FILAMENTCHANGE_YPOS 3
#define FILAMENTCHANGE_ZADD 10
#define FILAMENTCHANGE_ZADD 5
#define FILAMENTCHANGE_FIRSTRETRACT -2
#define FILAMENTCHANGE_FINALRETRACT -100
#endif
......
......@@ -14,10 +14,14 @@
// it is a Russian alphabet translation
// except 0401 --> 0xa2 = ╗, 0451 --> 0xb5
const PROGMEM uint8_t utf_recode[] =
{ 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,
0xa8,0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,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
{ 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,
0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,0xa8,
0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,
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:
......
This diff is collapsed.
......@@ -65,7 +65,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
createFilename(lfilename,p);
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,"/");
}
......
......@@ -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) {
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);
......@@ -377,18 +377,18 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
uint8_t char_width = DOG_CHAR_WIDTH;
#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);
lcd_width = LCD_WIDTH_EDIT + 1;
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 {
u8g.setFont(FONT_MENU);
}
#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;
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) {
u8g.setPrintPos(0, rowHeight + kHalfChar);
lcd_printPGM(pstr);
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);
}
......
......@@ -65,9 +65,11 @@ float current_temperature_bed = 0.0;
float redundant_temperature = 0.0;
#endif
#ifdef PIDTEMP
float Kp[4];
float Ki[4];
float Kd[4];
#ifndef SINGLENOZZLE
float Kp[EXTRUDERS],Ki[EXTRUDERS],Kd[EXTRUDERS];
#else
float Kp[1],Ki[1],Kd[1];
#endif
#endif //PIDTEMP
#ifdef PIDTEMPBED
......@@ -400,9 +402,7 @@ void updatePID()
temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki[e];
}
#else
for(int e = 0; e < 1; e++) {
temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki[0];
}
temp_iState_max[0] = PID_INTEGRAL_DRIVE_MAX / Ki[0];
#endif
#endif
#ifdef PIDTEMPBED
......@@ -538,7 +538,7 @@ void manage_heater()
#ifndef SINGLENOZZLE
for(int e = 0; e < EXTRUDERS; e++)
#else
for(int e = 0; e < 1; e++)
int e = 0;
#endif // !SINLGENOZZE
{
......@@ -1145,19 +1145,18 @@ void setWatch()
{
#ifdef WATCH_TEMP_PERIOD
#ifndef SINGLENOZZLE
for (uint8_t e = 0; e < EXTRUDERS; e++)
{
for (int e = 0; e < EXTRUDERS; e++)
#else
uint8_t e = 0;
{
int e = 0;
#endif // !SINGLENOZZLE
if(degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2))
{
watch_start_temp[e] = degHotend(e);
watchmillis[e] = millis();
}
}
#endif
{
if(degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2))
{
watch_start_temp[e] = degHotend(e);
watchmillis[e] = millis();
}
}
#endif //WATCH_TEMP_PERIOD
}
#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
void disable_heater()
{
#ifndef SINGLENOZZLE
for(uint8_t i=0;i<EXTRUDERS;i++)
for(int i=0;i<EXTRUDERS;i++)
#else
uint8_t i=0;
int i=0;
#endif // !SINGLENOZZLE
setTargetHotend(0,i);
setTargetBed(0);
#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
target_temperature[0]=0;
soft_pwm[0]=0;
#if defined(HEATER_0_PIN) && HEATER_0_PIN > -1
WRITE(HEATER_0_PIN,LOW);
#endif
target_temperature[0]=0;
soft_pwm[0]=0;
#if defined(HEATER_0_PIN) && HEATER_0_PIN > -1
WRITE(HEATER_0_PIN,LOW);
#endif
#endif
#ifndef SINGLENOZZLE
......
......@@ -41,19 +41,19 @@ void manage_heater(); //it is critical that this is called periodically.
// low level conversion routines
// do not use these routines and variables outside of temperature.cpp
#ifndef SINGLENOZZLE
extern int target_temperature[EXTRUDERS];
extern float current_temperature[EXTRUDERS];
#ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[EXTRUDERS];
extern int current_temperature_bed_raw;
#endif
extern int target_temperature[EXTRUDERS];
extern float current_temperature[EXTRUDERS];
#ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[EXTRUDERS];
extern int current_temperature_bed_raw;
#endif
#else
extern int target_temperature[1];
extern float current_temperature[1];
#ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[1];
extern int current_temperature_bed_raw;
#endif
extern int target_temperature[1];
extern float current_temperature[1];
#ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[1];
extern int current_temperature_bed_raw;
#endif
#endif //SINGLENOZZLE
extern int target_temperature_bed;
......@@ -67,19 +67,21 @@ extern float current_temperature_bed;
#endif
#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_d(float d);
float unscalePID_i(float i);
float unscalePID_d(float d);
#endif
#ifdef PIDTEMPBED
extern float bedKp,bedKi,bedKd;
#endif
#ifdef BABYSTEPPING
extern volatile int babystepsTodo[3];
#endif
......
......@@ -1095,6 +1095,16 @@ const short temptable_1047[][2] PROGMEM = {
};
#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) _TT_NAME(_N)
......
This diff is collapsed.
......@@ -4,7 +4,8 @@
#include "Marlin.h"
#ifdef ULTRA_LCD
int lcd_strlen(char *s);
int lcd_strlen_P(const char *s);
void lcd_update();
void lcd_init();
void lcd_setstatus(const char* message);
......
......@@ -660,7 +660,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c
{
lcd.print(c);
pstr++;
n--;
if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
}
while(n--)
lcd.print(' ');
......@@ -672,9 +672,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const
char c;
//Use all characters in narrow LCDs
#if LCD_WIDTH < 20
uint8_t n = LCD_WIDTH - 1 - 1 - strlen(data);
uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen(data);
#else
uint8_t n = LCD_WIDTH - 1 - 2 - strlen(data);
uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen(data);
#endif
lcd.setCursor(0, row);
lcd.print(pre_char);
......@@ -682,7 +682,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const
{
lcd.print(c);
pstr++;
n--;
if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
}
lcd.print(':');
while(n--)
......@@ -694,9 +694,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons
char c;
//Use all characters in narrow LCDs
#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
uint8_t n = LCD_WIDTH - 1 - 2 - strlen_P(data);
uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen_P(data);
#endif
lcd.setCursor(0, row);
lcd.print(pre_char);
......@@ -704,7 +704,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons
{
lcd.print(c);
pstr++;
n--;
if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
}
lcd.print(':');
while(n--)
......@@ -757,9 +757,9 @@ void lcd_implementation_drawedit(const char* pstr, char* value)
lcd_printPGM(pstr);
lcd.print(':');
#if LCD_WIDTH < 20
lcd.setCursor(LCD_WIDTH - strlen(value), 1);
lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
#else
lcd.setCursor(LCD_WIDTH -1 - strlen(value), 1);
lcd.setCursor(LCD_WIDTH -1 - lcd_strlen(value), 1);
#endif
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