diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6c5b97432..03f06a781 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -109,6 +109,9 @@ //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit //can be software-disabled for whatever purposes by #define PREVENT_DANGEROUS_EXTRUDE +//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately. +#define PREVENT_LENGTHY_EXTRUDE + #define EXTRUDE_MINTEMP 170 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances. diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 1063d5a75..c817be275 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -56,6 +56,8 @@ // G92 - Set current position to cordinates given //RepRap M Codes +// M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) +// M1 - Same as M0 // M104 - Set extruder target temp // M105 - Read current temp // M106 - Fan on @@ -596,6 +598,7 @@ void process_commands() while(millis() < codenum ){ manage_heater(); manage_inactivity(1); + LCD_STATUS; } break; case 28: //G28 Home all Axis one at a time @@ -707,6 +710,35 @@ void process_commands() { switch( (int)code_value() ) { +#ifdef ULTRA_LCD + case 0: // M0 - Unconditional stop - Wait for user button press on LCD + case 1: // M1 - Conditional stop - Wait for user button press on LCD + { + LCD_MESSAGEPGM(MSG_USERWAIT); + codenum = 0; + if(code_seen('P')) codenum = code_value(); // milliseconds to wait + if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait + + st_synchronize(); + previous_millis_cmd = millis(); + if (codenum > 0) + { + codenum += millis(); // keep track of when we started waiting + while(millis() < codenum && !CLICKED){ + manage_heater(); + manage_inactivity(1); + LCD_STATUS; + } + }else{ + while(!CLICKED) { + manage_heater(); + manage_inactivity(1); + LCD_STATUS; + } + } + } + break; +#endif case 17: LCD_MESSAGEPGM(MSG_NO_MOVE); enable_x(); @@ -1259,7 +1291,7 @@ void process_commands() PID_autotune(temp); } break; - case 400: // finish all moves + case 400: // M400 finish all moves { st_synchronize(); } diff --git a/Marlin/language.h b/Marlin/language.h index 4747ce626..aae99f709 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -10,11 +10,23 @@ #define LANGUAGE_CHOICE 1 // Pick your language from the list above +#define PROTOCOL_VERSION "1.0" + +#if MOTHERBOARD == 7 || MOTHERBOARD == 71 + #define MACHINE_NAME "Ultimaker" + #define FIRMWARE_URL "http://firmware.ultimaker.com" +#else + #define MACHINE_NAME "Mendel" + #define FIRMWARE_URL "http://www.mendel-parts.com" +#endif + +#define STRINGIFY_(n) #n +#define STRINGIFY(n) STRINGIFY_(n) + #if LANGUAGE_CHOICE == 1 // LCD Menu Messages - - #define WELCOME_MSG "Printer Ready." + #define WELCOME_MSG MACHINE_NAME " Ready." #define MSG_SD_INSERTED "Card inserted" #define MSG_SD_REMOVED "Card removed" #define MSG_MAIN " Main \003" @@ -63,8 +75,8 @@ #define MSG_MAIN_WIDE " Main \003" #define MSG_TEMPERATURE_WIDE " Temperature \x7E" #define MSG_MOTION_WIDE " Motion \x7E" - #define MSG_STORE_EPROM " Store EPROM" - #define MSG_LOAD_EPROM " Load EPROM" + #define MSG_STORE_EPROM " Store memory" + #define MSG_LOAD_EPROM " Load memory" #define MSG_RESTORE_FAILSAFE " Restore Failsafe" #define MSG_REFRESH "\004Refresh" #define MSG_WATCH " Watch \003" @@ -76,11 +88,12 @@ #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 "DWELL..." + #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_STOPPED "STOPPED. " #define MSG_PREHEAT_PLA " Preheat PLA" #define MSG_PREHEAT_ABS " Preheat ABS" #define MSG_STEPPER_RELEASED "Released." @@ -94,7 +107,7 @@ #define MSG_BROWNOUT_RESET " Brown out Reset" #define MSG_WATCHDOG_RESET " Watchdog Reset" #define MSG_SOFTWARE_RESET " Software Reset" - #define MSG_MARLIN "Marlin: " + #define MSG_MARLIN "Marlin " #define MSG_AUTHOR " | Author: " #define MSG_CONFIGURATION_VER " Last Updated: " #define MSG_FREE_MEMORY " Free Memory: " @@ -116,7 +129,7 @@ #define MSG_HEATING_COMPLETE "Heating done." #define MSG_BED_HEATING "Bed Heating." #define MSG_BED_DONE "Bed done." - #define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1\n" + #define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) "\n" #define MSG_COUNT_X " Count X:" #define MSG_ERR_KILLED "Printer halted. kill() called !!" #define MSG_ERR_STOPPED "Printer stopped deu to errors. Fix the error and use M999 to restart!. (Temperature is reset. Set it before restarting)" @@ -157,7 +170,7 @@ // LCD Menu Messages - #define WELCOME_MSG "UltiMARLIN Ready." + #define WELCOME_MSG MACHINE_NAME " Ready." #define MSG_SD_INSERTED "Card inserted" #define MSG_SD_REMOVED "Card removed" @@ -173,7 +186,7 @@ #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_MOVE_AXIS " Achsen verfahren \x7E" #define MSG_SPEED " Geschw:" #define MSG_NOZZLE " \002Duese:" #define MSG_NOZZLE1 " \002Duese2:" @@ -263,7 +276,7 @@ #define MSG_HEATING_COMPLETE "Heating done." #define MSG_BED_HEATING "Bed Heating." #define MSG_BED_DONE "Bed done." - #define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1\n" + #define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) "\n" #define MSG_COUNT_X " Count X:" #define MSG_ERR_KILLED "Printer halted. kill() called !!" #define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart!" diff --git a/Marlin/pins.h b/Marlin/pins.h index 95a036968..c4d56590f 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -684,7 +684,7 @@ #define E1_STEP_PIN 49 #define E1_DIR_PIN 47 -#define E1_ENABLE_PIN 51 +#define E1_ENABLE_PIN 48 #define SDPOWER -1 #define SDSS 53 diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index ac9ff19e8..bb1e84be1 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -495,12 +495,14 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); } + #ifdef PREVENT_LENGTHY_EXTRUDE if(labs(target[E_AXIS]-position[E_AXIS])>axis_steps_per_unit[E_AXIS]*EXTRUDE_MAXLENGTH) { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part SERIAL_ECHO_START; SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); } + #endif #endif // Prepare to set up new block diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index b01368bc1..72df26d1e 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -13,6 +13,7 @@ #define LCD_UPDATE_INTERVAL 100 #define STATUSTIMEOUT 15000 extern LiquidCrystal lcd; + extern volatile char buttons; //the last checked buttons in a bit array. #ifdef NEWPANEL #define EN_C (1<