Commit 7bd1de66 authored by MagoKimbra's avatar MagoKimbra

Same fix

parent 2e30da9a
...@@ -319,8 +319,22 @@ ...@@ -319,8 +319,22 @@
//#define PROGRESS_MSG_ONCE //#define PROGRESS_MSG_ONCE
#endif #endif
// This allows hosts to request long names for files and folders with M33
//#define LONG_FILENAME_HOST_SUPPORT
#endif // SDSUPPORT #endif // SDSUPPORT
// for dogm lcd displays you can choose some additional fonts:
#ifdef DOGLCD
// save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
// we don't have a big font for Cyrillic, Kana
//#define USE_BIG_EDIT_FONT
// If you have spare 2300Byte of progmem and want to use a
// smaller font on the Info-screen uncomment the next line.
//#define USE_SMALL_INFOFONT
#endif // DOGLCD
// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation. // The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
//#define USE_WATCHDOG //#define USE_WATCHDOG
......
...@@ -3977,7 +3977,7 @@ inline void gcode_M31() { ...@@ -3977,7 +3977,7 @@ inline void gcode_M31() {
inline void gcode_M33() { inline void gcode_M33() {
char *args = seen_pointer + 4; char *args = seen_pointer + 4;
while (*args == ' ') ++args; while (*args == ' ') ++args;
clear_asterisk(args); //clear_asterisk(args);
card.printLongPath(args); card.printLongPath(args);
} }
...@@ -6351,6 +6351,7 @@ void process_next_command() { ...@@ -6351,6 +6351,7 @@ void process_next_command() {
case 109: // M109 Wait for temperature case 109: // M109 Wait for temperature
gcode_M109(); break; gcode_M109(); break;
case 110: break; // M110: Set line number - don't show "unknown command"
case 111: // M111 Set debug level case 111: // M111 Set debug level
gcode_M111(); break; gcode_M111(); break;
case 112: // M112 Emergency Stop case 112: // M112 Emergency Stop
......
...@@ -125,6 +125,67 @@ void CardReader::ls() { ...@@ -125,6 +125,67 @@ void CardReader::ls() {
lsDive("", root); lsDive("", root);
} }
#ifdef LONG_FILENAME_HOST_SUPPORT
/**
* Get a long pretty path based on a DOS 8.3 path
*/
void CardReader::printLongPath(char *path) {
lsAction = LS_GetFilename;
int i, pathLen = strlen(path);
// ECHO_M("Full Path: "); ECHO_EV(path);
// Zero out slashes to make segments
for (i = 0; i < pathLen; i++) if (path[i] == '/') path[i] = '\0';
SdFile diveDir = root; // start from the root for segment 1
for (i = 0; i < pathLen;) {
if (path[i] == '\0') i++; // move past a single nul
char *segment = &path[i]; // The segment after most slashes
// If a segment is empty (extra-slash) then exit
if (!*segment) break;
// Go to the next segment
while (path[++i]) { }
// ECHO_M("Looking for segment: "); ECHO_EV(segment);
// Find the item, setting the long filename
diveDir.rewind();
lsDive("", diveDir, segment);
// Print /LongNamePart to serial output
ECHO_C('/');
ECHO_V(longFilename[0] ? longFilename : "???");
// If the filename was printed then that's it
if (!filenameIsDir) break;
// ECHO_M("Opening dir: "); ECHO_EV(segment);
// Open the sub-item as the new dive parent
SdFile dir;
if (!dir.open(diveDir, segment, O_READ)) {
ECHO_E;
ECHO_SMV(DB, MSG_SD_CANT_OPEN_SUBDIR, segment);
break;
}
diveDir.close();
diveDir = dir;
} // while i<pathLen
ECHO_E;
}
#endif // LONG_FILENAME_HOST_SUPPORT
void CardReader::initsd() { void CardReader::initsd() {
cardOK = false; cardOK = false;
if (root.isOpen()) root.close(); if (root.isOpen()) root.close();
...@@ -274,7 +335,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -274,7 +335,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
if (read) { if (read) {
if (file.open(curDir, fname, O_READ)) { if (file.open(curDir, fname, O_READ)) {
filesize = file.fileSize(); filesize = file.fileSize();
ECHO_SMV(OK, MSG_SD_FILE_OPENED, fname); ECHO_MV(MSG_SD_FILE_OPENED, fname);
ECHO_EMV(MSG_SD_SIZE, filesize); ECHO_EMV(MSG_SD_SIZE, filesize);
sdpos = 0; sdpos = 0;
...@@ -283,17 +344,19 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -283,17 +344,19 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
lcd_setstatus(longFilename[0] ? longFilename : fname); lcd_setstatus(longFilename[0] ? longFilename : fname);
} }
else { else {
ECHO_LMV(ER, MSG_SD_OPEN_FILE_FAIL, fname); ECHO_MV(MSG_SD_OPEN_FILE_FAIL, fname);
ECHO_PGM(".\n");
} }
} }
else { //write else { //write
if (file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
saving = true; ECHO_MV(MSG_SD_OPEN_FILE_FAIL, fname);
ECHO_LMV(OK, MSG_SD_WRITE_TO_FILE, name); ECHO_PGM(".\n");
if(lcd_status) lcd_setstatus(fname);
} }
else { else {
ECHO_LMV(ER, MSG_SD_OPEN_FILE_FAIL, fname); saving = true;
ECHO_EMV(MSG_SD_WRITE_TO_FILE, name);
lcd_setstatus(fname);
} }
} }
} }
......
...@@ -30,6 +30,10 @@ public: ...@@ -30,6 +30,10 @@ public:
void getStatus(); void getStatus();
void printingHasFinished(); void printingHasFinished();
#ifdef LONG_FILENAME_HOST_SUPPORT
void printLongPath(char *path);
#endif
void getfilename(uint16_t nr, const char* const match = NULL); void getfilename(uint16_t nr, const char* const match = NULL);
uint16_t getnrfilenames(); uint16_t getnrfilenames();
......
...@@ -134,14 +134,15 @@ ...@@ -134,14 +134,15 @@
#define MSG_Z2_MAX "z2_max: " #define MSG_Z2_MAX "z2_max: "
#define MSG_Z_PROBE "z_probe: " #define MSG_Z_PROBE "z_probe: "
#define MSG_E_MIN "e_min: " #define MSG_E_MIN "e_min: "
#define MSG_ERR_MATERIAL_INDEX "M145 S<index> out of range (0-2)"
#define MSG_ERR_M428_TOO_FAR "Too far from reference point"
#define MSG_M119_REPORT "Reporting endstop status" #define MSG_M119_REPORT "Reporting endstop status"
#define MSG_ENDSTOP_HIT "TRIGGERED" #define MSG_ENDSTOP_HIT "TRIGGERED"
#define MSG_ENDSTOP_OPEN "NOT TRIGGERED" #define MSG_ENDSTOP_OPEN "NOT TRIGGERED"
#define MSG_HOTEND_OFFSET "Hotend offsets:" #define MSG_HOTEND_OFFSET "Hotend offsets:"
#define MSG_EMPTY_PLANE "Autolevel can only be execute on an actual plane, make sure width and height are not 0!" #define MSG_EMPTY_PLANE "Autolevel can only be execute on an actual plane, make sure width and height are not 0!"
#define MSG_ERR_MATERIAL_INDEX "M145 S<index> out of range (0-2)"
#define MSG_FILRUNOUT_PIN "filament_runout_pin: " #define MSG_FILRUNOUT_PIN "filament_runout_pin: "
#define MSG_ERR_M428_TOO_FAR "Too far from reference point"
#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir" #define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
#define MSG_SD_INIT_FAIL "SD init fail" #define MSG_SD_INIT_FAIL "SD init fail"
...@@ -206,19 +207,21 @@ ...@@ -206,19 +207,21 @@
#define MSG_T " T:" #define MSG_T " T:"
#define MSG_AT " @:" #define MSG_AT " @:"
#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h or send command M500 for save in EEPROM the new value!" #define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h or send command M500 for save in EEPROM the new value!"
#define MSG_PID_DEBUG " PID_DEBUG "
#define MSG_HEATING_FAILED "Heating failed" #define MSG_PID_DEBUG_INPUT ": Input "
#define MSG_THERMAL_RUNAWAY_STOP "Thermal Runaway, system stopped! Heater_ID: " #define MSG_PID_DEBUG_OUTPUT " Output "
#define MSG_THERMAL_RUNAWAY_BED "bed" #define MSG_PID_DEBUG_PTERM " pTerm "
#define MSG_TEMP_READ_ERROR "Temp measurement error!" #define MSG_PID_DEBUG_ITERM " iTerm "
#define MSG_TEMP_BED "bed" #define MSG_PID_DEBUG_DTERM " dTerm "
#define MSG_EXTRUDER_SWITCHED_OFF "Extruder switched off. Temperature difference between temp sensors is too high !"
#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !" #define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !"
#define MSG_SWITCHED_OFF_MAX " switched off. MAXTEMP triggered !!"
#define MSG_MINTEMP_EXTRUDER_OFF ": Extruder switched off. MINTEMP triggered !" #define MSG_HEATER_BED "bed"
#define MSG_MAXTEMP_EXTRUDER_OFF ": Extruder" MSG_SWITCHED_OFF_MAX #define MSG_STOPPED_HEATER ", system stopped! Heater_ID: "
#define MSG_MAXTEMP_BED_OFF "Heated bed" MSG_SWITCHED_OFF_MAX #define MSG_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !"
#define MSG_T_HEATING_FAILED "Heating failed"
#define MSG_T_THERMAL_RUNAWAY "Thermal Runaway"
#define MSG_T_MAXTEMP "MAXTEMP triggered"
#define MSG_T_MINTEMP "MINTEMP triggered"
#define MSG_ENDSTOP_XS "X" #define MSG_ENDSTOP_XS "X"
#define MSG_ENDSTOP_YS "Y" #define MSG_ENDSTOP_YS "Y"
...@@ -226,9 +229,6 @@ ...@@ -226,9 +229,6 @@
#define MSG_ENDSTOP_ZPS "ZP" #define MSG_ENDSTOP_ZPS "ZP"
#define MSG_ENDSTOP_ES "E" #define MSG_ENDSTOP_ES "E"
//watchdog.cpp
#define MSG_WATCHDOG_RESET "Something is wrong, please turn off the printer."
//other //other
#define MSG_COMPILED "Compiled: " #define MSG_COMPILED "Compiled: "
#define MSG_ERR_HOMING_DIV "The Homing Bump Feedrate Divisor cannot be less than 1" #define MSG_ERR_HOMING_DIV "The Homing Bump Feedrate Divisor cannot be less than 1"
...@@ -238,7 +238,6 @@ ...@@ -238,7 +238,6 @@
#define MSG_BED_LEVELLING_Z " Z: " #define MSG_BED_LEVELLING_Z " Z: "
// LCD Menu Messages // LCD Menu Messages
#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC )) #if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC ))
#define DISPLAY_CHARSET_HD44780_JAPAN #define DISPLAY_CHARSET_HD44780_JAPAN
#endif #endif
......
...@@ -143,21 +143,24 @@ ...@@ -143,21 +143,24 @@
#define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z" #define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_ENDSTOP_ABORT "Endstop abort"
#define MSG_END_DAY "days"
#define MSG_END_HOUR "hours"
#define MSG_END_MINUTE "minutes"
#define MSG_HEATING_FAILED_LCD "Heating failed" #define MSG_HEATING_FAILED_LCD "Heating failed"
#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR" #define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR"
#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" #define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
#define MSG_ERR_MAXTEMP "Err: MAXTEMP" #define MSG_ERR_MAXTEMP "Err: MAXTEMP"
#define MSG_ERR_MINTEMP "Err: MINTEMP" #define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED"
#define MSG_END_DAY "days"
#define MSG_END_HOUR "hours"
#define MSG_END_MINUTE "minutes"
// Debug
#define MSG_DEBUG_ECHO "DEBUG ECHO ENABLED" #define MSG_DEBUG_ECHO "DEBUG ECHO ENABLED"
#define MSG_DEBUG_INFO "DEBUG INFO ENABLED" #define MSG_DEBUG_INFO "DEBUG INFO ENABLED"
#define MSG_DEBUG_ERRORS "DEBUG ERRORS ENABLED" #define MSG_DEBUG_ERRORS "DEBUG ERRORS ENABLED"
#define MSG_DEBUG_DRYRUN "DEBUG DRYRUN ENABLED" #define MSG_DEBUG_DRYRUN "DEBUG DRYRUN ENABLED"
// Calibrate Delta
#ifdef DELTA #ifdef DELTA
#define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_X "Calibrate X"
...@@ -166,6 +169,7 @@ ...@@ -166,6 +169,7 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
// Scara
#ifdef SCARA #ifdef SCARA
#define MSG_XSCALE "X Scale" #define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale" #define MSG_YSCALE "Y Scale"
......
...@@ -79,18 +79,18 @@ ...@@ -79,18 +79,18 @@
#define MSG_E2 " E2" #define MSG_E2 " E2"
#define MSG_E3 " E3" #define MSG_E3 " E3"
#define MSG_E4 " E4" #define MSG_E4 " E4"
#define MSG_ACC "Accel." #define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
#define MSG_VE_JERK "Ve-jerk" #define MSG_VE_JERK "Ve-jerk"
#define MSG_VMAX "Vmax" #define MSG_VMAX "Vmax "
#define MSG_X "x" #define MSG_X "x"
#define MSG_Y "y" #define MSG_Y "y"
#define MSG_Z "z" #define MSG_Z "z"
#define MSG_E "e" #define MSG_E "e"
#define MSG_VMIN "Vmin" #define MSG_VMIN "Vmin"
#define MSG_VTRAV_MIN "VTrav min" #define MSG_VTRAV_MIN "VTrav min"
#define MSG_AMAX "Amax" #define MSG_AMAX "Amax "
#define MSG_A_RETRACT "A-retract" #define MSG_A_RETRACT "A-retract"
#define MSG_A_TRAVEL "A-travel" #define MSG_A_TRAVEL "A-travel"
#define MSG_XSTEPS "X steps/mm" #define MSG_XSTEPS "X steps/mm"
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
#define MSG_TEMPERATURE "Temperatura" #define MSG_TEMPERATURE "Temperatura"
#define MSG_MOTION "Movimento" #define MSG_MOTION "Movimento"
#define MSG_VOLUMETRIC "Filamento" #define MSG_VOLUMETRIC "Filamento"
#define MSG_VOLUMETRIC_ENABLED "E in mm³" #define MSG_VOLUMETRIC_ENABLED "E in mm3"
#define MSG_FILAMENT_SIZE_EXTRUDER "Diam. filo" #define MSG_FILAMENT_SIZE_EXTRUDER "Diam. filo"
#define MSG_CONTRAST "Contrasto LCD" #define MSG_CONTRAST "Contrasto LCD"
#define MSG_STORE_EPROM "Salva in EEPROM" #define MSG_STORE_EPROM "Salva in EEPROM"
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
#define MSG_CONTROL_RETRACTF "Ritrai V" #define MSG_CONTROL_RETRACTF "Ritrai V"
#define MSG_CONTROL_RETRACT_ZLIFT "Salta mm" #define MSG_CONTROL_RETRACT_ZLIFT "Salta mm"
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#define MSG_CONTROL_RETRACT_RECOVER_SWAP "Scamb. UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm"
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
#define MSG_AUTORETRACT "AutoArretramento" #define MSG_AUTORETRACT "AutoArretramento"
#define MSG_FILAMENTCHANGE "Cambia filamento" #define MSG_FILAMENTCHANGE "Cambia filamento"
...@@ -143,21 +143,24 @@ ...@@ -143,21 +143,24 @@
#define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z" #define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Finecorsa abort" #define MSG_ENDSTOP_ABORT "Finecorsa abort"
#define MSG_END_DAY "giorni"
#define MSG_END_HOUR "ore"
#define MSG_END_MINUTE "minuti"
#define MSG_HEATING_FAILED_LCD "Heating failed" #define MSG_HEATING_FAILED_LCD "Heating failed"
#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR" #define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR"
#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" #define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
#define MSG_ERR_MAXTEMP "Err: MAXTEMP" #define MSG_ERR_MAXTEMP "Err: MAXTEMP"
#define MSG_ERR_MINTEMP "Err: MINTEMP" #define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_ERR_MINTEMP_BED "Err: MINTEMP BED"
#define MSG_END_DAY "giorni"
#define MSG_END_HOUR "ore"
#define MSG_END_MINUTE "minuti"
// Debug
#define MSG_DEBUG_ECHO "DEBUG RIPETI" #define MSG_DEBUG_ECHO "DEBUG RIPETI"
#define MSG_DEBUG_INFO "DEBUG INFO" #define MSG_DEBUG_INFO "DEBUG INFO"
#define MSG_DEBUG_ERRORS "DEBUG ERRORI" #define MSG_DEBUG_ERRORS "DEBUG ERRORI"
#define MSG_DEBUG_DRYRUN "DEBUG STAMPA A VUOTO" #define MSG_DEBUG_DRYRUN "DEBUG STAMPA A VUOTO"
// Calibrate Delta
#ifdef DELTA #ifdef DELTA
#define MSG_DELTA_CALIBRATE "Calibraz. Delta" #define MSG_DELTA_CALIBRATE "Calibraz. Delta"
#define MSG_DELTA_CALIBRATE_X "Calibra X" #define MSG_DELTA_CALIBRATE_X "Calibra X"
...@@ -166,6 +169,7 @@ ...@@ -166,6 +169,7 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibra Centro" #define MSG_DELTA_CALIBRATE_CENTER "Calibra Centro"
#endif // DELTA #endif // DELTA
// Scara
#ifdef SCARA #ifdef SCARA
#define MSG_XSCALE "X Scale" #define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale" #define MSG_YSCALE "Y Scale"
......
...@@ -143,7 +143,9 @@ static int minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_LO_TEMP , HEAT ...@@ -143,7 +143,9 @@ static int minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_LO_TEMP , HEAT
static int maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP); static int maxttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP);
static int minttemp[HOTENDS] = { 0 }; static int minttemp[HOTENDS] = { 0 };
static int maxttemp[HOTENDS] = ARRAY_BY_HOTENDS( 16383, 16383, 16383, 16383 ); static int maxttemp[HOTENDS] = ARRAY_BY_HOTENDS( 16383, 16383, 16383, 16383 );
//static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; /* No bed mintemp error implemented?!? */ #ifdef BED_MINTEMP
static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP;
#endif
#ifdef BED_MAXTEMP #ifdef BED_MAXTEMP
static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP; static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP;
#endif #endif
...@@ -445,33 +447,32 @@ void checkExtruderAutoFans() ...@@ -445,33 +447,32 @@ void checkExtruderAutoFans()
// Temperature Error Handlers // Temperature Error Handlers
// //
inline void _temp_error(int e, const char *serial_msg, const char *lcd_msg) { inline void _temp_error(int e, const char *serial_msg, const char *lcd_msg) {
static bool killed = false;
if (IsRunning()) { if (IsRunning()) {
ECHO_S(ER); ECHO_S(ER);
if (e >= 0) ECHO_EV((int)e);
PS_PGM(serial_msg); PS_PGM(serial_msg);
ECHO_E; ECHO_M(MSG_STOPPED_HEATER);
if (e >= 0) ECHO_EV((int)e); else ECHO_EM(MSG_HEATER_BED);
#ifdef ULTRA_LCD #ifdef ULTRA_LCD
lcd_setalertstatuspgm(lcd_msg); lcd_setalertstatuspgm(lcd_msg);
#endif #endif
} }
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
Stop(); if (!killed) {
Running = false;
killed = true;
kill(lcd_msg);
}
else
disable_all_heaters(); // paranoia
#endif #endif
} }
void max_temp_error(uint8_t e) { void max_temp_error(uint8_t e) {
disable_all_heaters(); _temp_error(e, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP));
_temp_error(e, PSTR(MSG_MAXTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MAXTEMP));
} }
void min_temp_error(uint8_t e) { void min_temp_error(uint8_t e) {
disable_all_heaters(); _temp_error(e, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP));
_temp_error(e, PSTR(MSG_MINTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MINTEMP));
}
void bed_max_temp_error(void) {
#if HAS_HEATER_BED
WRITE_HEATER_BED(0);
#endif
_temp_error(-1, PSTR(MSG_MAXTEMP_BED_OFF), PSTR(MSG_ERR_MAXTEMP_BED));
} }
float get_pid_output(int e) { float get_pid_output(int e) {
...@@ -514,12 +515,12 @@ float get_pid_output(int e) { ...@@ -514,12 +515,12 @@ float get_pid_output(int e) {
#endif //PID_OPENLOOP #endif //PID_OPENLOOP
#ifdef PID_DEBUG #ifdef PID_DEBUG
ECHO_SMV(DB, " PID_DEBUG ", e); ECHO_SMV(DB, MSG_PID_DEBUG, e);
ECHO_MV(": Input ", current_temperature[e]); ECHO_MV(MSG_PID_DEBUG_INPUT, current_temperature[e]);
ECHO_MV(" Output ", pid_output); ECHO_MV(MSG_PID_DEBUG_OUTPUT, pid_output);
ECHO_MV(" pTerm ", pTerm[e]); ECHO_MV(MSG_PID_DEBUG_PTERM, pTerm[e]);
ECHO_MV(" iTerm ", iTerm[e]); ECHO_MV(MSG_PID_DEBUG_ITERM, iTerm[e]);
ECHO_EMV(" dTerm ", dTerm[e]); ECHO_EMV(MSG_PID_DEBUG_DTERM, dTerm[e]);
#endif //PID_DEBUG #endif //PID_DEBUG
#else /* PID off */ #else /* PID off */
...@@ -612,8 +613,7 @@ void manage_heater() { ...@@ -612,8 +613,7 @@ void manage_heater() {
// Has it failed to increase enough? // Has it failed to increase enough?
if (degHotend(e) < watch_target_temp[e]) { if (degHotend(e) < watch_target_temp[e]) {
// Stop! // Stop!
disable_all_heaters(); _temp_error(e, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
_temp_error(e, PSTR(MSG_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
} }
else { else {
// Start again if the target is still far off // Start again if the target is still far off
...@@ -625,7 +625,6 @@ void manage_heater() { ...@@ -625,7 +625,6 @@ void manage_heater() {
#ifdef TEMP_SENSOR_1_AS_REDUNDANT #ifdef TEMP_SENSOR_1_AS_REDUNDANT
if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) { if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
disable_all_heaters();
_temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP)); _temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP));
} }
#endif #endif
...@@ -1101,15 +1100,7 @@ void tp_init() { ...@@ -1101,15 +1100,7 @@ void tp_init() {
*state = TRRunaway; *state = TRRunaway;
break; break;
case TRRunaway: case TRRunaway:
ECHO_SM(ER, MSG_THERMAL_RUNAWAY_STOP); _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), PSTR(MSG_THERMAL_RUNAWAY));
if (heater_id < 0) ECHO_EM(MSG_THERMAL_RUNAWAY_BED); else ECHO_EV(heater_id);
LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
disable_all_heaters();
disable_all_steppers();
for (;;) {
manage_heater();
lcd_update();
}
} }
} }
...@@ -1651,10 +1642,8 @@ ISR(TIMER0_COMPB_vect) { ...@@ -1651,10 +1642,8 @@ ISR(TIMER0_COMPB_vect) {
#else #else
#define GEBED >= #define GEBED >=
#endif #endif
if (current_temperature_bed_raw GEBED bed_maxttemp_raw) { if (current_temperature_bed_raw GEBED bed_maxttemp_raw) _temp_error(-1, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP_BED));
target_temperature_bed = 0; if (bed_minttemp_raw GEBED current_temperature_bed_raw) _temp_error(-1, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP_BED));
bed_max_temp_error();
}
#endif #endif
} // temp_count >= OVERSAMPLENR } // temp_count >= OVERSAMPLENR
......
...@@ -48,7 +48,7 @@ char lcd_status_message[3*LCD_WIDTH+1] = WELCOME_MSG; // worst case is kana with ...@@ -48,7 +48,7 @@ char lcd_status_message[3*LCD_WIDTH+1] = WELCOME_MSG; // worst case is kana with
#ifdef DOGLCD #ifdef DOGLCD
#include "dogm_lcd_implementation.h" #include "dogm_lcd_implementation.h"
#define LCD_Printpos(x, y) u8g.setPrintPos(x, y) #define LCD_Printpos(x, y) u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH * x, (y + 1) * DOG_CHAR_HEIGHT)
#else #else
#include "ultralcd_implementation_hitachi_HD44780.h" #include "ultralcd_implementation_hitachi_HD44780.h"
#define LCD_Printpos(x, y) lcd.setCursor(x, y) #define LCD_Printpos(x, y) lcd.setCursor(x, y)
...@@ -74,6 +74,8 @@ static void lcd_status_screen(); ...@@ -74,6 +74,8 @@ static void lcd_status_screen();
static void lcd_control_temperature_preheat_gum_settings_menu(); static void lcd_control_temperature_preheat_gum_settings_menu();
static void lcd_control_motion_menu(); static void lcd_control_motion_menu();
static void lcd_control_volumetric_menu(); static void lcd_control_volumetric_menu();
static void config_lcd_level_bed();
static void lcd_level_bed();
#ifdef HAS_LCD_CONTRAST #ifdef HAS_LCD_CONTRAST
static void lcd_set_contrast(); static void lcd_set_contrast();
#endif #endif
...@@ -279,7 +281,7 @@ float raw_Ki, raw_Kd; ...@@ -279,7 +281,7 @@ float raw_Ki, raw_Kd;
/** /**
* General function to go directly to a menu * General function to go directly to a menu
*/ */
static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint32_t encoder=0) { static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const uint32_t encoder = 0) {
if (currentMenu != menu) { if (currentMenu != menu) {
currentMenu = menu; currentMenu = menu;
#ifdef NEWPANEL #ifdef NEWPANEL
...@@ -709,7 +711,7 @@ void lcd_cooldown() { ...@@ -709,7 +711,7 @@ void lcd_cooldown() {
lcd_return_to_status(); lcd_return_to_status();
} }
void config_lcd_level_bed() { static void config_lcd_level_bed() {
setTargetHotend(0,0); setTargetHotend(0,0);
ECHO_EM("Leveling..."); ECHO_EM("Leveling...");
...@@ -718,16 +720,16 @@ void config_lcd_level_bed() { ...@@ -718,16 +720,16 @@ void config_lcd_level_bed() {
pageShowInfo = 0; pageShowInfo = 0;
} }
void lcd_level_bed() { static void lcd_level_bed() {
if(ChangeScreen) { if(ChangeScreen) {
lcd_implementation_clear; lcd_implementation_clear();
switch(pageShowInfo) { switch(pageShowInfo) {
case 0: case 0:
{ {
LCD_Printpos(0, 1); LCD_Printpos(0, 1);
lcd_printPGM(PSTR(MSG_LP_INTRO)); lcd_printPGM(PSTR(MSG_LP_INTRO));
currentMenu = lcd_level_bed; currentMenu = lcd_level_bed;
ChangeScreen=false; ChangeScreen = false;
} }
break; break;
case 1: case 1:
...@@ -735,7 +737,7 @@ void lcd_level_bed() { ...@@ -735,7 +737,7 @@ void lcd_level_bed() {
LCD_Printpos(0, 1); LCD_Printpos(0, 1);
lcd_printPGM(PSTR(MSG_LP_1)); lcd_printPGM(PSTR(MSG_LP_1));
currentMenu = lcd_level_bed; currentMenu = lcd_level_bed;
ChangeScreen=false; ChangeScreen = false;
} }
break; break;
case 2: case 2:
...@@ -743,7 +745,7 @@ void lcd_level_bed() { ...@@ -743,7 +745,7 @@ void lcd_level_bed() {
LCD_Printpos(0, 1); LCD_Printpos(0, 1);
lcd_printPGM(PSTR(MSG_LP_2)); lcd_printPGM(PSTR(MSG_LP_2));
currentMenu = lcd_level_bed; currentMenu = lcd_level_bed;
ChangeScreen=false; ChangeScreen = false;
} }
break; break;
case 3: case 3:
...@@ -751,7 +753,7 @@ void lcd_level_bed() { ...@@ -751,7 +753,7 @@ void lcd_level_bed() {
LCD_Printpos(0, 1); LCD_Printpos(0, 1);
lcd_printPGM(PSTR(MSG_LP_3)); lcd_printPGM(PSTR(MSG_LP_3));
currentMenu = lcd_level_bed; currentMenu = lcd_level_bed;
ChangeScreen=false; ChangeScreen = false;
} }
break; break;
case 4: case 4:
...@@ -759,7 +761,7 @@ void lcd_level_bed() { ...@@ -759,7 +761,7 @@ void lcd_level_bed() {
LCD_Printpos(0, 1); LCD_Printpos(0, 1);
lcd_printPGM(PSTR(MSG_LP_4)); lcd_printPGM(PSTR(MSG_LP_4));
currentMenu = lcd_level_bed; currentMenu = lcd_level_bed;
ChangeScreen=false; ChangeScreen = false;
} }
break; break;
case 5: case 5:
...@@ -767,20 +769,20 @@ void lcd_level_bed() { ...@@ -767,20 +769,20 @@ void lcd_level_bed() {
LCD_Printpos(0, 1); LCD_Printpos(0, 1);
lcd_printPGM(PSTR(MSG_LP_5)); lcd_printPGM(PSTR(MSG_LP_5));
currentMenu = lcd_level_bed; currentMenu = lcd_level_bed;
ChangeScreen=false; ChangeScreen = false;
} }
break; break;
case 6: case 6:
{ {
LCD_Printpos(2, 2); LCD_Printpos(2, 2);
lcd_printPGM(PSTR(MSG_LP_6)); lcd_printPGM(PSTR(MSG_LP_6));
ChangeScreen=false; ChangeScreen = false;
delay(1200); delay(1200);
encoderPosition = 0; encoderPosition = 0;
lcd_implementation_clear(); lcd_implementation_clear();
currentMenu = lcd_status_screen; currentMenu = lcd_status_screen;
lcd_status_screen(); lcd_status_screen();
pageShowInfo=0; pageShowInfo = 0;
} }
break; break;
} }
...@@ -805,7 +807,14 @@ static void lcd_prepare_menu() { ...@@ -805,7 +807,14 @@ static void lcd_prepare_menu() {
// Auto Home // Auto Home
// //
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
#ifndef DELTA
//
// Level Bed
//
#ifdef ENABLE_AUTO_BED_LEVELING
if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS])
MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G29"));
#elif !defined(DELTA) && !defined(Z_SAFE_HOMING) && !defined(DOGLCD)
MENU_ITEM(function, MSG_BED_SETTING, config_lcd_level_bed); MENU_ITEM(function, MSG_BED_SETTING, config_lcd_level_bed);
#endif #endif
...@@ -826,16 +835,6 @@ static void lcd_prepare_menu() { ...@@ -826,16 +835,6 @@ static void lcd_prepare_menu() {
} }
#endif #endif
//
// Level Bed
//
#ifdef ENABLE_AUTO_BED_LEVELING
if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS])
MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G29"));
#elif !defined(DELTA)
MENU_ITEM(function, MSG_BED_SETTING, config_lcd_level_bed);
#endif
// //
// Move Axis // Move Axis
// //
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
void set_pageShowInfo(int value); void set_pageShowInfo(int value);
void set_ChangeScreen(boolean state); void set_ChangeScreen(boolean state);
void config_lcd_level_bed(void);
void lcd_level_bed(void);
#define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x)) #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x)) #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
......
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