Browse Source

Merge pull request #220 from MaikStohn/1d224cc031

Implemented support for KILL_PIN / Fixed compilation errors for incomplete/bad translations
pull/1/head
ErikZalm 12 years ago
parent
commit
825adbd67b
  1. 2
      Marlin/Marlin.h
  2. 32
      Marlin/Marlin.pde
  3. 125
      Marlin/language.h
  4. 2
      Marlin/planner.cpp
  5. 2
      Marlin/stepper.cpp
  6. 3
      Marlin/ultralcd.h
  7. 12
      Marlin/ultralcd.pde

2
Marlin/Marlin.h

@ -107,7 +107,7 @@ FORCE_INLINE void serialprintPGM(const char *str)
void get_command();
void process_commands();
void manage_inactivity(byte debug);
void manage_inactivity();
#if X_ENABLE_PIN > -1
#define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)

32
Marlin/Marlin.pde

@ -245,6 +245,14 @@ void enquecommand(const char *cmd)
}
}
void setup_killpin()
{
#if( KILL_PIN>-1 )
pinMode(KILL_PIN,INPUT);
WRITE(KILL_PIN,HIGH);
#endif
}
void setup_photpin()
{
#ifdef PHOTOGRAPH_PIN
@ -277,6 +285,7 @@ void suicide()
void setup()
{
setup_killpin();
setup_powerhold();
MYSERIAL.begin(BAUDRATE);
SERIAL_PROTOCOLLNPGM("start");
@ -365,7 +374,7 @@ void loop()
}
//check heater every n milliseconds
manage_heater();
manage_inactivity(1);
manage_inactivity();
checkHitEndstops();
LCD_STATUS;
}
@ -653,7 +662,7 @@ void process_commands()
previous_millis_cmd = millis();
while(millis() < codenum ){
manage_heater();
manage_inactivity(1);
manage_inactivity();
LCD_STATUS;
}
break;
@ -816,18 +825,17 @@ void process_commands()
st_synchronize();
previous_millis_cmd = millis();
if (codenum > 0)
{
if (codenum > 0){
codenum += millis(); // keep track of when we started waiting
while(millis() < codenum && !CLICKED){
manage_heater();
manage_inactivity(1);
manage_inactivity();
LCD_STATUS;
}
}else{
while(!CLICKED){
manage_heater();
manage_inactivity(1);
manage_inactivity();
LCD_STATUS;
}
}
@ -1064,7 +1072,7 @@ void process_commands()
codenum = millis();
}
manage_heater();
manage_inactivity(1);
manage_inactivity();
LCD_STATUS;
#ifdef TEMP_RESIDENCY_TIME
/* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
@ -1102,7 +1110,7 @@ void process_commands()
codenum = millis();
}
manage_heater();
manage_inactivity(1);
manage_inactivity();
LCD_STATUS;
}
LCD_MESSAGEPGM(MSG_BED_DONE);
@ -1664,7 +1672,7 @@ void controllerFan()
}
#endif
void manage_inactivity(byte debug)
void manage_inactivity()
{
if( (millis() - previous_millis_cmd) > max_inactive_time )
if(max_inactive_time)
@ -1682,6 +1690,10 @@ void manage_inactivity(byte debug)
}
}
}
#if( KILL_PIN>-1 )
if( 0 == READ(KILL_PIN) )
kill();
#endif
#ifdef CONTROLLERFAN_PIN
controllerFan(); //Check if fan should be turned on to cool stepper drivers down
#endif
@ -1722,7 +1734,7 @@ void kill()
if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT);
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
LCD_MESSAGEPGM(MSG_KILLED);
LCD_ALERTMESSAGEPGM(MSG_KILLED);
suicide();
while(1); // Wait for reset
}

125
Marlin/language.h

@ -1,11 +1,16 @@
#ifndef LANGUAGE_H
#define LANGUAGE_H
// NOTE: IF YOU CHANGE THIS FILE / MERGE THIS FILE WITH CHANGES
//
// ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h"
// ==> ALSO TRY ALL AVAILABLE "LANGUAGE_CHOICE" OPTIONS
// Languages
// 1 Custom (For you to add your own messages)
// 2 English
// 1 English
// 2 -
// 3 French (Waiting translation)
// 4 German (Waiting translation)
// 4 German
// 5 Spanish
// 6 Etc
@ -35,9 +40,13 @@
#define MSG_DISABLE_STEPPERS " Disable Steppers"
#define MSG_AUTO_HOME " Auto Home"
#define MSG_SET_ORIGIN " Set Origin"
#define MSG_PREHEAT_PLA " Preheat PLA"
#define MSG_PREHEAT_PLA_SETTINGS " Preheat PLA Setting"
#define MSG_PREHEAT_ABS " Preheat ABS"
#define MSG_PREHEAT_ABS_SETTINGS " Preheat ABS Setting"
#define MSG_COOLDOWN " Cooldown"
#define MSG_EXTRUDE " Extrude"
#define MSG_RETRACT " Extract"
#define MSG_RETRACT " Retract"
#define MSG_PREHEAT_PLA " Preheat PLA"
#define MSG_PREHEAT_ABS " Preheat ABS"
#define MSG_MOVE_AXIS " Move Axis \x7E"
@ -87,24 +96,19 @@
#define MSG_PREPARE " Prepare \x7E"
#define MSG_PREPARE_ALT " Prepare \003"
#define MSG_CONTROL_ARROW " Control \x7E"
#define MSG_RETRACT_ARROW " Control \x7E"
#define MSG_RETRACT_ARROW " Retract \x7E"
#define MSG_TUNE " Tune \x7E"
#define MSG_PAUSE_PRINT " Pause Print \x7E"
#define MSG_RESUME_PRINT " Resume Print \x7E"
#define MSG_STOP_PRINT " Stop Print \x7E"
#define MSG_CARD_MENU " Card Menu \x7E"
#define MSG_NO_CARD " No Card"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
#define MSG_DWELL "Sleep..."
#define MSG_USERWAIT "Wait for user..."
#define MSG_NO_MOVE "No move."
#define MSG_PART_RELEASE "Partial Release"
#define MSG_KILLED "KILLED. "
#define MSG_STOPPED "STOPPED. "
#define MSG_PREHEAT_PLA " Preheat PLA"
#define MSG_PREHEAT_PLA_SETTINGS " Preheat PLA Setting"
#define MSG_PREHEAT_ABS_SETTINGS " Preheat ABS Setting"
#define MSG_PREHEAT_ABS " Preheat ABS"
#define MSG_STEPPER_RELEASED "Released."
#define MSG_CONTROL_RETRACT " Retract mm:"
#define MSG_CONTROL_RETRACTF " Retract F:"
@ -112,6 +116,7 @@
#define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
#define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:"
#define MSG_AUTORETRACT " AutoRetr.:"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
// Serial Console Messages
@ -184,31 +189,31 @@
// LCD Menu Messages
#define WELCOME_MSG MACHINE_NAME " Ready."
#define WELCOME_MSG MACHINE_NAME " Bereit."
#define MSG_SD_INSERTED "Card inserted"
#define MSG_SD_REMOVED "Card removed"
#define MSG_MAIN " Main \003"
#define MSG_SD_INSERTED "SDKarte erkannt"
#define MSG_SD_REMOVED "SDKarte entfernt"
#define MSG_MAIN " Hauptmneü \003"
#define MSG_AUTOSTART " Autostart"
#define MSG_DISABLE_STEPPERS " Stepper abschalten"
#define MSG_AUTO_HOME " Auto Heim"
#define MSG_SET_ORIGIN " Position setzen"
#define MSG_PREHEAT_PLA " Aufheizen PLA"
#define MSG_PREHEAT_ABS " Aufheizen ABS"
#define MSG_COOLDOWN " Abkuehlen"
#define MSG_AUTO_HOME " Auto Nullpunkt"
#define MSG_SET_ORIGIN " Setze Nullpunkt"
#define MSG_PREHEAT_PLA " Vorwärmen PLA"
#define MSG_PREHEAT_PLA_SETTINGS " Vorwärmen PLA Einstellungen"
#define MSG_PREHEAT_ABS " Vorwärmen ABS"
#define MSG_PREHEAT_ABS_SETTINGS " Vorwärmen ABS Einstellungen"
#define MSG_COOLDOWN " Abkühlen"
#define MSG_EXTRUDE " Extrude"
#define MSG_PREHEAT_PLA " Preheat PLA"
#define MSG_PREHEAT_ABS " Preheat ABS"
#define MSG_MOVE_AXIS " Move Axis \x7E"
#define MSG_MOVE_AXIS " Achsen verfahren \x7E"
#define MSG_RETRACT " Retract"
#define MSG_MOVE_AXIS " Achsen bewegen\x7E"
#define MSG_SPEED " Geschw:"
#define MSG_NOZZLE " \002Duese:"
#define MSG_NOZZLE1 " \002Duese2:"
#define MSG_NOZZLE2 " \002Duese3:"
#define MSG_NOZZLE " \002Düse:"
#define MSG_NOZZLE1 " \002Düse2:"
#define MSG_NOZZLE2 " \002Düse3:"
#define MSG_BED " \002Bett:"
#define MSG_FAN_SPEED " Luefter geschw.:"
#define MSG_FLOW " Fluss:"
#define MSG_CONTROL " Kontrolle \003"
#define MSG_FAN_SPEED " Lüftergeschw.:"
#define MSG_FLOW " Fluß:"
#define MSG_CONTROL " Einstellungen \003"
#define MSG_MIN " \002 Min:"
#define MSG_MAX " \002 Max:"
#define MSG_FACTOR " \002 Faktor:"
@ -229,38 +234,44 @@
#define MSG_VMIN " Vmin:"
#define MSG_VTRAV_MIN " VTrav min:"
#define MSG_AMAX " Amax "
#define MSG_A_RETRACT " A-retract:"
#define MSG_A_RETRACT " A-Retract:"
#define MSG_XSTEPS " Xsteps/mm:"
#define MSG_YSTEPS " Ysteps/mm:"
#define MSG_ZSTEPS " Zsteps/mm:"
#define MSG_ESTEPS " Esteps/mm:"
#define MSG_MAIN_WIDE " Main \003"
#define MSG_MAIN_WIDE " Hauptmenü \003"
#define MSG_RECTRACT_WIDE " Rectract \x7E"
#define MSG_WATCH " Beobachten \003"
#define MSG_TEMPERATURE_WIDE " Temperatur \x7E"
#define MSG_MOTION_WIDE " Motion \x7E"
#define MSG_TEMPERATURE_RTN " Temperatur \003"
#define MSG_MOTION_WIDE " Bewegung \x7E"
#define MSG_STORE_EPROM " EPROM speichern"
#define MSG_LOAD_EPROM " EPROM laden"
#define MSG_RESTORE_FAILSAFE " Standard Konfig."
#define MSG_REFRESH "\004Refresh"
#define MSG_WATCH " Beobachten \003"
#define MSG_PREPARE " Prepare \x7E"
#define MSG_PREPARE_ALT " Prepare \003"
#define MSG_CONTROL_ARROW " Control \x7E"
#define MSG_TUNE " Tune \x7E"
#define MSG_RESTORE_FAILSAFE " Standardkonfig."
#define MSG_REFRESH "\004Aktualisieren"
#define MSG_PREPARE " Vorbereitung \x7E"
#define MSG_PREPARE_ALT " Vorbereitung \003"
#define MSG_CONTROL_ARROW " Einstellungen \x7E"
#define MSG_TUNE " Justierung \x7E"
#define MSG_PAUSE_PRINT " Druck anhalten\x7E"
#define MSG_RESUME_PRINT " Druck fortsetz\x7E"
#define MSG_STOP_PRINT " Druck stoppen \x7E"
#define MSG_CARD_MENU " SDKarten Menue \x7E"
#define MSG_CARD_MENU " SDKarten Menü \x7E"
#define MSG_NO_CARD " Keine SDKarte"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in der Menuestruktur."
#define MSG_DWELL "DWELL..."
#define MSG_NO_MOVE "No move."
#define MSG_PART_RELEASE "Partial Release"
#define MSG_KILLED "KILLED. "
#define MSG_STOPPED "STOPPED. "
#define MSG_PREHEAT_PLA " Preheat PLA"
#define MSG_PREHEAT_ABS " Preheat ABS"
#define MSG_STEPPER_RELEASED "Released."
#define MSG_DWELL "Warten..."
#define MSG_USERWAIT "Warte auf Nutzer..."
#define MSG_NO_MOVE "Kein Zug."
#define MSG_PART_RELEASE "Stepper tlw frei"
#define MSG_KILLED "KILLED"
#define MSG_STOPPED "GESTOPPT"
#define MSG_STEPPER_RELEASED "Stepper frei"
#define MSG_CONTROL_RETRACT " Retract mm:"
#define MSG_CONTROL_RETRACTF " Retract F:"
#define MSG_CONTROL_RETRACT_ZLIFT " Hop mm:"
#define MSG_CONTROL_RETRACT_RECOVER " UnRet +mm:"
#define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:"
#define MSG_AUTORETRACT " AutoRetr.:"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Fehler in Menüstruktur."
// Serial Console Messages
@ -343,8 +354,11 @@
#define MSG_SET_ORIGIN " Establecer Cero"
#define MSG_COOLDOWN " Enfriar"
#define MSG_EXTRUDE " Extruir"
#define MSG_RETRACT " Retract"
#define MSG_PREHEAT_PLA " Precalentar PLA"
#define MSG_PREHEAT_PLA_SETTINGS " Precalentar PLA Setting"
#define MSG_PREHEAT_ABS " Precalentar ABS"
#define MSG_PREHEAT_ABS_SETTINGS " Precalentar ABS Setting"
#define MSG_MOVE_AXIS " Mover Ejes \x7E"
#define MSG_SPEED " Velocidad:"
#define MSG_NOZZLE " \002Nozzle:"
@ -382,6 +396,7 @@
#define MSG_MAIN_WIDE " Menu Principal \003"
#define MSG_RECTRACT_WIDE " Retraer \x7E"
#define MSG_TEMPERATURE_WIDE " Temperatura \x7E"
#define MSG_TEMPERATURE_RTN " Temperatura \003"
#define MSG_MOTION_WIDE " Movimiento \x7E"
#define MSG_STORE_EPROM " Guardar Memoria"
#define MSG_LOAD_EPROM " Cargar Memoria"
@ -393,18 +408,17 @@
#define MSG_CONTROL_ARROW " Control \x7E"
#define MSG_RETRACT_ARROW " Control \x7E"
#define MSG_TUNE " Ajustar \x7E"
#define MSG_PAUSE_PRINT " Pause Print \x7E"
#define MSG_RESUME_PRINT " Resume Print \x7E"
#define MSG_STOP_PRINT " Detener Impresion \x7E"
#define MSG_CARD_MENU " Menu de SD \x7E"
#define MSG_NO_CARD " No hay Tarjeta SD"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Hay un error en la estructura del menu"
#define MSG_DWELL "Reposo..."
#define MSG_USERWAIT "Esperando Ordenes..."
#define MSG_NO_MOVE "Sin movimiento"
#define MSG_PART_RELEASE "Desacople Parcial"
#define MSG_KILLED "PARADA DE EMERGENCIA. "
#define MSG_STOPPED "PARADA. "
#define MSG_PREHEAT_PLA " Precalentar PLA"
#define MSG_PREHEAT_ABS " Precalentar ABS"
#define MSG_STEPPER_RELEASED "Desacoplada."
#define MSG_CONTROL_RETRACT " Retraer mm:"
#define MSG_CONTROL_RETRACTF " Retraer F:"
@ -412,6 +426,7 @@
#define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
#define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
#define MSG_AUTORETRACT " AutoRetr.:"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Hay un error en la estructura del menu"
// Serial Console Messages

2
Marlin/planner.cpp

@ -501,7 +501,7 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
// Rest here until there is room in the buffer.
while(block_buffer_tail == next_buffer_head) {
manage_heater();
manage_inactivity(1);
manage_inactivity();
LCD_STATUS;
}

2
Marlin/stepper.cpp

@ -899,7 +899,7 @@ void st_synchronize()
{
while( blocks_queued()) {
manage_heater();
manage_inactivity(1);
manage_inactivity();
LCD_STATUS;
}
}

3
Marlin/ultralcd.h

@ -144,12 +144,14 @@
#define LCD_INIT lcd_init();
#define LCD_MESSAGE(x) lcd_status(x);
#define LCD_MESSAGEPGM(x) lcd_statuspgm(MYPGM(x));
#define LCD_ALERTMESSAGEPGM(x) lcd_alertstatuspgm(MYPGM(x));
#define LCD_STATUS lcd_status()
#else //no lcd
#define LCD_INIT
#define LCD_STATUS
#define LCD_MESSAGE(x)
#define LCD_MESSAGEPGM(x)
#define LCD_ALERTMESSAGEPGM(x)
FORCE_INLINE void lcd_status() {};
#define CLICKED false
@ -157,6 +159,7 @@
#endif
void lcd_statuspgm(const char* message);
void lcd_alertstatuspgm(const char* message);
char *ftostr3(const float &x);
char *itostr2(const uint8_t &x);

12
Marlin/ultralcd.pde

@ -92,6 +92,12 @@ void lcd_statuspgm(const char* message)
*target=0;
}
void lcd_alertstatuspgm(const char* message)
{
lcd_statuspgm(message);
menu.showStatus();
}
FORCE_INLINE void clear()
{
lcd.clear();
@ -2922,7 +2928,7 @@ char *ftostr31(const float &x)
char *ftostr32(const float &x)
{
int xx=x*100;
long xx=x*100;
conv[0]=(xx>=0)?'+':'-';
xx=abs(xx);
conv[1]=(xx/100)%10+'0';
@ -2967,7 +2973,7 @@ char *itostr4(const int &xx)
// convert float to string with +1234.5 format
char *ftostr51(const float &x)
{
int xx=x*10;
long xx=x*10;
conv[0]=(xx>=0)?'+':'-';
xx=abs(xx);
conv[1]=(xx/10000)%10+'0';
@ -2983,7 +2989,7 @@ char *ftostr51(const float &x)
// convert float to string with +123.45 format
char *ftostr52(const float &x)
{
int xx=x*100;
long xx=x*100;
conv[0]=(xx>=0)?'+':'-';
xx=abs(xx);
conv[1]=(xx/10000)%10+'0';

Loading…
Cancel
Save