Bläddra i källkod

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.
Bernhard Kubicek 12 år sedan
förälder
incheckning
c7ce99d495
7 ändrade filer med 67 tillägg och 13 borttagningar
  1. 3
    0
      Marlin/Configuration.h
  2. 33
    1
      Marlin/Marlin.pde
  3. 24
    11
      Marlin/language.h
  4. 1
    1
      Marlin/pins.h
  5. 2
    0
      Marlin/planner.cpp
  6. 1
    0
      Marlin/ultralcd.h
  7. 3
    0
      Marlin/ultralcd.pde

+ 3
- 0
Marlin/Configuration.h Visa fil

@@ -109,6 +109,9 @@
109 109
 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
110 110
 //can be software-disabled for whatever purposes by
111 111
 #define PREVENT_DANGEROUS_EXTRUDE
112
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
113
+#define PREVENT_LENGTHY_EXTRUDE
114
+
112 115
 #define EXTRUDE_MINTEMP 170
113 116
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
114 117
 

+ 33
- 1
Marlin/Marlin.pde Visa fil

@@ -56,6 +56,8 @@
56 56
 // G92 - Set current position to cordinates given
57 57
 
58 58
 //RepRap M Codes
59
+// M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
60
+// M1   - Same as M0
59 61
 // M104 - Set extruder target temp
60 62
 // M105 - Read current temp
61 63
 // M106 - Fan on
@@ -596,6 +598,7 @@ void process_commands()
596 598
       while(millis()  < codenum ){
597 599
         manage_heater();
598 600
         manage_inactivity(1);
601
+		LCD_STATUS;
599 602
       }
600 603
       break;
601 604
     case 28: //G28 Home all Axis one at a time
@@ -707,6 +710,35 @@ void process_commands()
707 710
   {
708 711
     switch( (int)code_value() ) 
709 712
     {
713
+#ifdef ULTRA_LCD
714
+    case 0: // M0 - Unconditional stop - Wait for user button press on LCD
715
+    case 1: // M1 - Conditional stop - Wait for user button press on LCD
716
+    {
717
+      LCD_MESSAGEPGM(MSG_USERWAIT);
718
+      codenum = 0;
719
+      if(code_seen('P')) codenum = code_value(); // milliseconds to wait
720
+      if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
721
+      
722
+      st_synchronize();
723
+      previous_millis_cmd = millis();
724
+	  if (codenum > 0)
725
+	  {
726
+        codenum += millis();  // keep track of when we started waiting
727
+        while(millis()  < codenum && !CLICKED){
728
+          manage_heater();
729
+          manage_inactivity(1);
730
+		  LCD_STATUS;
731
+		}
732
+      }else{
733
+        while(!CLICKED) {
734
+          manage_heater();
735
+          manage_inactivity(1);
736
+		  LCD_STATUS;
737
+		}
738
+	  }
739
+    }
740
+    break;
741
+#endif
710 742
     case 17:
711 743
         LCD_MESSAGEPGM(MSG_NO_MOVE);
712 744
         enable_x(); 
@@ -1259,7 +1291,7 @@ void process_commands()
1259 1291
       PID_autotune(temp);
1260 1292
     }
1261 1293
     break;
1262
-    case 400: // finish all moves
1294
+    case 400: // M400 finish all moves
1263 1295
     {
1264 1296
       st_synchronize();
1265 1297
     }

+ 24
- 11
Marlin/language.h Visa fil

@@ -10,11 +10,23 @@
10 10
 
11 11
 #define LANGUAGE_CHOICE 1  // Pick your language from the list above
12 12
 
13
+#define PROTOCOL_VERSION "1.0"
14
+
15
+#if MOTHERBOARD == 7 || MOTHERBOARD == 71
16
+	#define MACHINE_NAME "Ultimaker"
17
+	#define FIRMWARE_URL "http://firmware.ultimaker.com"
18
+#else
19
+	#define MACHINE_NAME "Mendel"
20
+	#define FIRMWARE_URL "http://www.mendel-parts.com"
21
+#endif
22
+
23
+#define STRINGIFY_(n) #n
24
+#define STRINGIFY(n) STRINGIFY_(n)
25
+
13 26
 #if LANGUAGE_CHOICE == 1
14 27
 
15 28
 // LCD Menu Messages
16
-
17
-	#define WELCOME_MSG "Printer Ready."
29
+	#define WELCOME_MSG MACHINE_NAME " Ready."
18 30
 	#define MSG_SD_INSERTED "Card inserted"
19 31
 	#define MSG_SD_REMOVED "Card removed"
20 32
 	#define MSG_MAIN " Main \003"
@@ -63,8 +75,8 @@
63 75
 	#define MSG_MAIN_WIDE " Main        \003"
64 76
 	#define MSG_TEMPERATURE_WIDE " Temperature \x7E"
65 77
 	#define MSG_MOTION_WIDE " Motion      \x7E"
66
-	#define MSG_STORE_EPROM " Store EPROM"
67
-	#define MSG_LOAD_EPROM " Load EPROM"
78
+	#define MSG_STORE_EPROM " Store memory"
79
+	#define MSG_LOAD_EPROM " Load memory"
68 80
 	#define MSG_RESTORE_FAILSAFE " Restore Failsafe"
69 81
 	#define MSG_REFRESH "\004Refresh"
70 82
 	#define MSG_WATCH " Watch   \003"
@@ -76,11 +88,12 @@
76 88
 	#define MSG_CARD_MENU " Card Menu    \x7E"
77 89
 	#define MSG_NO_CARD " No Card"
78 90
 	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Something is wrong in the MenuStructure."
79
-	#define MSG_DWELL "DWELL..."		
91
+	#define MSG_DWELL "Sleep..."
92
+	#define MSG_USERWAIT "Wait for user..."
80 93
 	#define MSG_NO_MOVE "No move."
81 94
 	#define MSG_PART_RELEASE "Partial Release"
82 95
 	#define MSG_KILLED "KILLED. "
83
-        #define MSG_STOPPED "STOPPED. "
96
+	#define MSG_STOPPED "STOPPED. "
84 97
 	#define MSG_PREHEAT_PLA " Preheat PLA"
85 98
 	#define MSG_PREHEAT_ABS " Preheat ABS"
86 99
 	#define MSG_STEPPER_RELEASED "Released."
@@ -94,7 +107,7 @@
94 107
 	#define MSG_BROWNOUT_RESET " Brown out Reset"
95 108
 	#define MSG_WATCHDOG_RESET " Watchdog Reset"
96 109
 	#define MSG_SOFTWARE_RESET " Software Reset"
97
-	#define MSG_MARLIN "Marlin: "
110
+	#define MSG_MARLIN "Marlin "
98 111
 	#define MSG_AUTHOR " | Author: "
99 112
 	#define MSG_CONFIGURATION_VER " Last Updated: "
100 113
 	#define MSG_FREE_MEMORY " Free Memory: "
@@ -116,7 +129,7 @@
116 129
 	#define MSG_HEATING_COMPLETE "Heating done."
117 130
 	#define MSG_BED_HEATING "Bed Heating."
118 131
 	#define MSG_BED_DONE "Bed done."
119
-	#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"
132
+	#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"
120 133
 	#define MSG_COUNT_X " Count X:"
121 134
 	#define MSG_ERR_KILLED "Printer halted. kill() called !!"
122 135
 	#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 @@
157 170
 
158 171
 // LCD Menu Messages
159 172
 
160
-	#define WELCOME_MSG "UltiMARLIN Ready."
173
+	#define WELCOME_MSG MACHINE_NAME " Ready."
161 174
 
162 175
 	#define MSG_SD_INSERTED "Card inserted"
163 176
 	#define MSG_SD_REMOVED "Card removed"
@@ -173,7 +186,7 @@
173 186
 	#define MSG_PREHEAT_PLA " Preheat PLA"
174 187
 	#define MSG_PREHEAT_ABS " Preheat ABS"
175 188
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
176
-        #define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
189
+	#define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
177 190
 	#define MSG_SPEED " Geschw:"
178 191
 	#define MSG_NOZZLE " \002Duese:"
179 192
 	#define MSG_NOZZLE1 " \002Duese2:"
@@ -263,7 +276,7 @@
263 276
 	#define MSG_HEATING_COMPLETE "Heating done."
264 277
 	#define MSG_BED_HEATING "Bed Heating."
265 278
 	#define MSG_BED_DONE "Bed done."
266
-	#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"
279
+	#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"
267 280
 	#define MSG_COUNT_X " Count X:"
268 281
 	#define MSG_ERR_KILLED "Printer halted. kill() called !!"
269 282
 	#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart!"

+ 1
- 1
Marlin/pins.h Visa fil

@@ -684,7 +684,7 @@
684 684
 
685 685
 #define E1_STEP_PIN         49
686 686
 #define E1_DIR_PIN          47
687
-#define E1_ENABLE_PIN       51
687
+#define E1_ENABLE_PIN       48
688 688
 
689 689
 #define SDPOWER            -1
690 690
 #define SDSS               53

+ 2
- 0
Marlin/planner.cpp Visa fil

@@ -495,12 +495,14 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
495 495
       SERIAL_ECHO_START;
496 496
       SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
497 497
     }
498
+    #ifdef PREVENT_LENGTHY_EXTRUDE
498 499
     if(labs(target[E_AXIS]-position[E_AXIS])>axis_steps_per_unit[E_AXIS]*EXTRUDE_MAXLENGTH)
499 500
     {
500 501
       position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
501 502
       SERIAL_ECHO_START;
502 503
       SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
503 504
     }
505
+    #endif
504 506
   #endif
505 507
   
506 508
   // Prepare to set up new block

+ 1
- 0
Marlin/ultralcd.h Visa fil

@@ -13,6 +13,7 @@
13 13
   #define LCD_UPDATE_INTERVAL 100
14 14
   #define STATUSTIMEOUT 15000
15 15
   extern LiquidCrystal lcd;
16
+  extern volatile char buttons;  //the last checked buttons in a bit array.
16 17
   
17 18
   #ifdef NEWPANEL
18 19
     #define EN_C (1<<BLEN_C)

+ 3
- 0
Marlin/ultralcd.pde Visa fil

@@ -1,3 +1,5 @@
1
+#include "language.h"
2
+#include "temperature.h"
1 3
 #include "ultralcd.h"
2 4
 #ifdef ULTRA_LCD
3 5
 #include "Marlin.h"
@@ -711,6 +713,7 @@ void MainMenu::showAxisMove()
711 713
           }
712 714
           break;
713 715
           case ItemAM_E:
716
+          // ErikDB: TODO: this length should be changed for volumetric.
714 717
           MENUITEM(  lcdprintPGM(MSG_EXTRUDE)  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E5");beepshort(); ) ;
715 718
           break;
716 719
           default:

Laddar…
Avbryt
Spara