Merge pull request #172 from daid/Marlin_v1
Add M401 - Wait for user to press button on LCD (with optional timeout) minor fix in M115.
This commit is contained in:
		| @@ -109,6 +109,9 @@ | |||||||
| //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit | //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit | ||||||
| //can be software-disabled for whatever purposes by | //can be software-disabled for whatever purposes by | ||||||
| #define PREVENT_DANGEROUS_EXTRUDE | #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_MINTEMP 170 | ||||||
| #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances. | #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -56,6 +56,8 @@ | |||||||
| // G92 - Set current position to cordinates given | // G92 - Set current position to cordinates given | ||||||
|  |  | ||||||
| //RepRap M Codes | //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 | // M104 - Set extruder target temp | ||||||
| // M105 - Read current temp | // M105 - Read current temp | ||||||
| // M106 - Fan on | // M106 - Fan on | ||||||
| @@ -596,6 +598,7 @@ void process_commands() | |||||||
|       while(millis()  < codenum ){ |       while(millis()  < codenum ){ | ||||||
|         manage_heater(); |         manage_heater(); | ||||||
|         manage_inactivity(1); |         manage_inactivity(1); | ||||||
|  | 		LCD_STATUS; | ||||||
|       } |       } | ||||||
|       break; |       break; | ||||||
|     case 28: //G28 Home all Axis one at a time |     case 28: //G28 Home all Axis one at a time | ||||||
| @@ -707,6 +710,35 @@ void process_commands() | |||||||
|   { |   { | ||||||
|     switch( (int)code_value() )  |     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: |     case 17: | ||||||
|         LCD_MESSAGEPGM(MSG_NO_MOVE); |         LCD_MESSAGEPGM(MSG_NO_MOVE); | ||||||
|         enable_x();  |         enable_x();  | ||||||
| @@ -1259,7 +1291,7 @@ void process_commands() | |||||||
|       PID_autotune(temp); |       PID_autotune(temp); | ||||||
|     } |     } | ||||||
|     break; |     break; | ||||||
|     case 400: // finish all moves |     case 400: // M400 finish all moves | ||||||
|     { |     { | ||||||
|       st_synchronize(); |       st_synchronize(); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -10,11 +10,23 @@ | |||||||
|  |  | ||||||
| #define LANGUAGE_CHOICE 1  // Pick your language from the list above | #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 | #if LANGUAGE_CHOICE == 1 | ||||||
|  |  | ||||||
| // LCD Menu Messages | // LCD Menu Messages | ||||||
|  | 	#define WELCOME_MSG MACHINE_NAME " Ready." | ||||||
| 	#define WELCOME_MSG "Printer Ready." |  | ||||||
| 	#define MSG_SD_INSERTED "Card inserted" | 	#define MSG_SD_INSERTED "Card inserted" | ||||||
| 	#define MSG_SD_REMOVED "Card removed" | 	#define MSG_SD_REMOVED "Card removed" | ||||||
| 	#define MSG_MAIN " Main \003" | 	#define MSG_MAIN " Main \003" | ||||||
| @@ -63,8 +75,8 @@ | |||||||
| 	#define MSG_MAIN_WIDE " Main        \003" | 	#define MSG_MAIN_WIDE " Main        \003" | ||||||
| 	#define MSG_TEMPERATURE_WIDE " Temperature \x7E" | 	#define MSG_TEMPERATURE_WIDE " Temperature \x7E" | ||||||
| 	#define MSG_MOTION_WIDE " Motion      \x7E" | 	#define MSG_MOTION_WIDE " Motion      \x7E" | ||||||
| 	#define MSG_STORE_EPROM " Store EPROM" | 	#define MSG_STORE_EPROM " Store memory" | ||||||
| 	#define MSG_LOAD_EPROM " Load EPROM" | 	#define MSG_LOAD_EPROM " Load memory" | ||||||
| 	#define MSG_RESTORE_FAILSAFE " Restore Failsafe" | 	#define MSG_RESTORE_FAILSAFE " Restore Failsafe" | ||||||
| 	#define MSG_REFRESH "\004Refresh" | 	#define MSG_REFRESH "\004Refresh" | ||||||
| 	#define MSG_WATCH " Watch   \003" | 	#define MSG_WATCH " Watch   \003" | ||||||
| @@ -76,11 +88,12 @@ | |||||||
| 	#define MSG_CARD_MENU " Card Menu    \x7E" | 	#define MSG_CARD_MENU " Card Menu    \x7E" | ||||||
| 	#define MSG_NO_CARD " No Card" | 	#define MSG_NO_CARD " No Card" | ||||||
| 	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure." | 	#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_NO_MOVE "No move." | ||||||
| 	#define MSG_PART_RELEASE "Partial Release" | 	#define MSG_PART_RELEASE "Partial Release" | ||||||
| 	#define MSG_KILLED "KILLED. " | 	#define MSG_KILLED "KILLED. " | ||||||
|         #define MSG_STOPPED "STOPPED. " | 	#define MSG_STOPPED "STOPPED. " | ||||||
| 	#define MSG_PREHEAT_PLA " Preheat PLA" | 	#define MSG_PREHEAT_PLA " Preheat PLA" | ||||||
| 	#define MSG_PREHEAT_ABS " Preheat ABS" | 	#define MSG_PREHEAT_ABS " Preheat ABS" | ||||||
| 	#define MSG_STEPPER_RELEASED "Released." | 	#define MSG_STEPPER_RELEASED "Released." | ||||||
| @@ -94,7 +107,7 @@ | |||||||
| 	#define MSG_BROWNOUT_RESET " Brown out Reset" | 	#define MSG_BROWNOUT_RESET " Brown out Reset" | ||||||
| 	#define MSG_WATCHDOG_RESET " Watchdog Reset" | 	#define MSG_WATCHDOG_RESET " Watchdog Reset" | ||||||
| 	#define MSG_SOFTWARE_RESET " Software Reset" | 	#define MSG_SOFTWARE_RESET " Software Reset" | ||||||
| 	#define MSG_MARLIN "Marlin: " | 	#define MSG_MARLIN "Marlin " | ||||||
| 	#define MSG_AUTHOR " | Author: " | 	#define MSG_AUTHOR " | Author: " | ||||||
| 	#define MSG_CONFIGURATION_VER " Last Updated: " | 	#define MSG_CONFIGURATION_VER " Last Updated: " | ||||||
| 	#define MSG_FREE_MEMORY " Free Memory: " | 	#define MSG_FREE_MEMORY " Free Memory: " | ||||||
| @@ -116,7 +129,7 @@ | |||||||
| 	#define MSG_HEATING_COMPLETE "Heating done." | 	#define MSG_HEATING_COMPLETE "Heating done." | ||||||
| 	#define MSG_BED_HEATING "Bed Heating." | 	#define MSG_BED_HEATING "Bed Heating." | ||||||
| 	#define MSG_BED_DONE "Bed done." | 	#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_COUNT_X " Count X:" | ||||||
| 	#define MSG_ERR_KILLED "Printer halted. kill() called !!" | 	#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)" | 	#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 | // LCD Menu Messages | ||||||
|  |  | ||||||
| 	#define WELCOME_MSG "UltiMARLIN Ready." | 	#define WELCOME_MSG MACHINE_NAME " Ready." | ||||||
|  |  | ||||||
| 	#define MSG_SD_INSERTED "Card inserted" | 	#define MSG_SD_INSERTED "Card inserted" | ||||||
| 	#define MSG_SD_REMOVED "Card removed" | 	#define MSG_SD_REMOVED "Card removed" | ||||||
| @@ -173,7 +186,7 @@ | |||||||
| 	#define MSG_PREHEAT_PLA " Preheat PLA" | 	#define MSG_PREHEAT_PLA " Preheat PLA" | ||||||
| 	#define MSG_PREHEAT_ABS " Preheat ABS" | 	#define MSG_PREHEAT_ABS " Preheat ABS" | ||||||
| 	#define MSG_MOVE_AXIS " Move Axis      \x7E" | 	#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_SPEED " Geschw:" | ||||||
| 	#define MSG_NOZZLE " \002Duese:" | 	#define MSG_NOZZLE " \002Duese:" | ||||||
| 	#define MSG_NOZZLE1 " \002Duese2:" | 	#define MSG_NOZZLE1 " \002Duese2:" | ||||||
| @@ -263,7 +276,7 @@ | |||||||
| 	#define MSG_HEATING_COMPLETE "Heating done." | 	#define MSG_HEATING_COMPLETE "Heating done." | ||||||
| 	#define MSG_BED_HEATING "Bed Heating." | 	#define MSG_BED_HEATING "Bed Heating." | ||||||
| 	#define MSG_BED_DONE "Bed done." | 	#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_COUNT_X " Count X:" | ||||||
| 	#define MSG_ERR_KILLED "Printer halted. kill() called !!" | 	#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!" | 	#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart!" | ||||||
|   | |||||||
| @@ -684,7 +684,7 @@ | |||||||
|  |  | ||||||
| #define E1_STEP_PIN         49 | #define E1_STEP_PIN         49 | ||||||
| #define E1_DIR_PIN          47 | #define E1_DIR_PIN          47 | ||||||
| #define E1_ENABLE_PIN       51 | #define E1_ENABLE_PIN       48 | ||||||
|  |  | ||||||
| #define SDPOWER            -1 | #define SDPOWER            -1 | ||||||
| #define SDSS               53 | #define SDSS               53 | ||||||
|   | |||||||
| @@ -495,12 +495,14 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa | |||||||
|       SERIAL_ECHO_START; |       SERIAL_ECHO_START; | ||||||
|       SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); |       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) |     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 |       position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part | ||||||
|       SERIAL_ECHO_START; |       SERIAL_ECHO_START; | ||||||
|       SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); |       SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); | ||||||
|     } |     } | ||||||
|  |     #endif | ||||||
|   #endif |   #endif | ||||||
|    |    | ||||||
|   // Prepare to set up new block |   // Prepare to set up new block | ||||||
|   | |||||||
| @@ -13,6 +13,7 @@ | |||||||
|   #define LCD_UPDATE_INTERVAL 100 |   #define LCD_UPDATE_INTERVAL 100 | ||||||
|   #define STATUSTIMEOUT 15000 |   #define STATUSTIMEOUT 15000 | ||||||
|   extern LiquidCrystal lcd; |   extern LiquidCrystal lcd; | ||||||
|  |   extern volatile char buttons;  //the last checked buttons in a bit array. | ||||||
|    |    | ||||||
|   #ifdef NEWPANEL |   #ifdef NEWPANEL | ||||||
|     #define EN_C (1<<BLEN_C) |     #define EN_C (1<<BLEN_C) | ||||||
|   | |||||||
| @@ -1,3 +1,5 @@ | |||||||
|  | #include "language.h" | ||||||
|  | #include "temperature.h" | ||||||
| #include "ultralcd.h" | #include "ultralcd.h" | ||||||
| #ifdef ULTRA_LCD | #ifdef ULTRA_LCD | ||||||
| #include "Marlin.h" | #include "Marlin.h" | ||||||
| @@ -711,6 +713,7 @@ void MainMenu::showAxisMove() | |||||||
|           } |           } | ||||||
|           break; |           break; | ||||||
|           case ItemAM_E: |           case ItemAM_E: | ||||||
|  |           // ErikDB: TODO: this length should be changed for volumetric. | ||||||
|           MENUITEM(  lcdprintPGM(MSG_EXTRUDE)  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E5");beepshort(); ) ; |           MENUITEM(  lcdprintPGM(MSG_EXTRUDE)  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E5");beepshort(); ) ; | ||||||
|           break; |           break; | ||||||
|           default: |           default: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user