Browse Source

Merge github.com:ErikZalm/Marlin into Marlin_v1

Conflicts:
	Marlin/language.h
Guillaume Seguin 12 years ago
parent
commit
34da3a0a3f

+ 27
- 6
Marlin/Configuration.h View File

37
 // 63 = Melzi
37
 // 63 = Melzi
38
 // 64 = STB V1.1
38
 // 64 = STB V1.1
39
 // 65 = Azteeg X1
39
 // 65 = Azteeg X1
40
+// 66 = Melzi with ATmega1284 (MaKr3d version)
40
 // 7  = Ultimaker
41
 // 7  = Ultimaker
41
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
42
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
42
 // 77 = 3Drag Controller
43
 // 77 = 3Drag Controller
126
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
127
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
127
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
128
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
128
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
129
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
130
+// 60 is 100k Maker's Tool Works Kapton Bed Thermister
129
 //
131
 //
130
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
132
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
131
 //                          (but gives greater accuracy and more stable PID)
133
 //                          (but gives greater accuracy and more stable PID)
258
 
260
 
259
 #ifndef ENDSTOPPULLUPS
261
 #ifndef ENDSTOPPULLUPS
260
   // fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined
262
   // fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined
261
-  #define ENDSTOPPULLUP_XMAX
262
-  #define ENDSTOPPULLUP_YMAX
263
-  #define ENDSTOPPULLUP_ZMAX
264
-  #define ENDSTOPPULLUP_XMIN
265
-  #define ENDSTOPPULLUP_YMIN
266
-  //#define ENDSTOPPULLUP_ZMIN
263
+  // #define ENDSTOPPULLUP_XMAX
264
+  // #define ENDSTOPPULLUP_YMAX
265
+  // #define ENDSTOPPULLUP_ZMAX
266
+  // #define ENDSTOPPULLUP_XMIN
267
+  // #define ENDSTOPPULLUP_YMIN
268
+  // #define ENDSTOPPULLUP_ZMIN
267
 #endif
269
 #endif
268
 
270
 
269
 #ifdef ENDSTOPPULLUPS
271
 #ifdef ENDSTOPPULLUPS
394
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
396
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
395
 //#define ULTIPANEL  //the ultipanel as on thingiverse
397
 //#define ULTIPANEL  //the ultipanel as on thingiverse
396
 
398
 
399
+// The MaKr3d Makr-Panel with graphic controller and SD support
400
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
401
+//#define MAKRPANEL
402
+
397
 // The RepRapDiscount Smart Controller (white PCB)
403
 // The RepRapDiscount Smart Controller (white PCB)
398
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
404
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
399
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER
405
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER
419
 //#define RA_CONTROL_PANEL
425
 //#define RA_CONTROL_PANEL
420
 
426
 
421
 //automatic expansion
427
 //automatic expansion
428
+#if defined (MAKRPANEL)
429
+ #define DOGLCD
430
+ #define SDSUPPORT
431
+ #define ULTIPANEL
432
+ #define NEWPANEL
433
+ #define DEFAULT_LCD_CONTRAST 17
434
+#endif
435
+
422
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
436
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
423
  #define DOGLCD
437
  #define DOGLCD
424
  #define U8GLIB_ST7920
438
  #define U8GLIB_ST7920
505
   #endif
519
   #endif
506
 #endif
520
 #endif
507
 
521
 
522
+// default LCD contrast for dogm-like LCD displays
523
+#ifdef DOGLCD
524
+# ifndef DEFAULT_LCD_CONTRAST
525
+#  define DEFAULT_LCD_CONTRAST 32
526
+# endif
527
+#endif
528
+
508
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
529
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
509
 //#define FAST_PWM_FAN
530
 //#define FAST_PWM_FAN
510
 
531
 

+ 12
- 1
Marlin/ConfigurationStore.cpp View File

37
 // the default values are used whenever there is a change to the data, to prevent
37
 // the default values are used whenever there is a change to the data, to prevent
38
 // wrong data being written to the variables.
38
 // wrong data being written to the variables.
39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
40
-#define EEPROM_VERSION "V07"
40
+#define EEPROM_VERSION "V08"
41
 
41
 
42
 #ifdef EEPROM_SETTINGS
42
 #ifdef EEPROM_SETTINGS
43
 void Config_StoreSettings() 
43
 void Config_StoreSettings() 
78
     EEPROM_WRITE_VAR(i,dummy);
78
     EEPROM_WRITE_VAR(i,dummy);
79
     EEPROM_WRITE_VAR(i,dummy);
79
     EEPROM_WRITE_VAR(i,dummy);
80
   #endif
80
   #endif
81
+  #ifndef DOGLCD
82
+    int lcd_contrast = 32;
83
+  #endif
84
+  EEPROM_WRITE_VAR(i,lcd_contrast);
81
   char ver2[4]=EEPROM_VERSION;
85
   char ver2[4]=EEPROM_VERSION;
82
   i=EEPROM_OFFSET;
86
   i=EEPROM_OFFSET;
83
   EEPROM_WRITE_VAR(i,ver2); // validate data
87
   EEPROM_WRITE_VAR(i,ver2); // validate data
198
         EEPROM_READ_VAR(i,Kp);
202
         EEPROM_READ_VAR(i,Kp);
199
         EEPROM_READ_VAR(i,Ki);
203
         EEPROM_READ_VAR(i,Ki);
200
         EEPROM_READ_VAR(i,Kd);
204
         EEPROM_READ_VAR(i,Kd);
205
+        #ifndef DOGLCD
206
+        int lcd_contrast;
207
+        #endif
208
+        EEPROM_READ_VAR(i,lcd_contrast);
201
 
209
 
202
 		// Call updatePID (similar to when we have processed M301)
210
 		// Call updatePID (similar to when we have processed M301)
203
 		updatePID();
211
 		updatePID();
244
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
252
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
245
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
253
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
246
 #endif
254
 #endif
255
+#ifdef DOGLCD
256
+    lcd_contrast = DEFAULT_LCD_CONTRAST;
257
+#endif
247
 #ifdef PIDTEMP
258
 #ifdef PIDTEMP
248
     Kp = DEFAULT_Kp;
259
     Kp = DEFAULT_Kp;
249
     Ki = scalePID_i(DEFAULT_Ki);
260
     Ki = scalePID_i(DEFAULT_Ki);

+ 25
- 6
Marlin/Configuration_adv.h View File

18
 //#define WATCH_TEMP_PERIOD 40000 //40 seconds
18
 //#define WATCH_TEMP_PERIOD 40000 //40 seconds
19
 //#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
19
 //#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
20
 
20
 
21
-// Wait for Cooldown
22
-// This defines if the M109 call should not block if it is cooling down.
23
-// example: From a current temp of 220, you set M109 S200. 
24
-// if CooldownNoWait is defined M109 will not wait for the cooldown to finish
25
-#define CooldownNoWait true
26
-
27
 #ifdef PIDTEMP
21
 #ifdef PIDTEMP
28
   // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
22
   // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
29
   // if Kc is choosen well, the additional required power due to increased melting should be compensated.
23
   // if Kc is choosen well, the additional required power due to increased melting should be compensated.
152
   #define EXTRUDERS 1
146
   #define EXTRUDERS 1
153
 #endif
147
 #endif
154
 
148
 
149
+// Enable this for dual x-carriage printers. 
150
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
151
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
152
+// allowing faster printing speeds.
153
+//#define DUAL_X_CARRIAGE
154
+#ifdef DUAL_X_CARRIAGE
155
+// Configuration for second X-carriage
156
+// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
157
+// the second x-carriage always homes to the maximum endstop.
158
+#define X2_MIN_POS 88     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
159
+#define X2_MAX_POS 350.45 // set maximum to the distance between toolheads when both heads are homed 
160
+#define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
161
+#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position 
162
+    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software 
163
+    // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
164
+    // without modifying the firmware (through the "M218 T1 X???" command).
165
+    // Remember: you should set the second extruder x-offset to 0 in your slicer.
166
+
167
+// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
168
+#define X2_ENABLE_PIN 29
169
+#define X2_STEP_PIN 25
170
+#define X2_DIR_PIN 23
171
+
172
+#endif // DUAL_X_CARRIAGE
173
+    
155
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
174
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
156
 #define X_HOME_RETRACT_MM 5 
175
 #define X_HOME_RETRACT_MM 5 
157
 #define Y_HOME_RETRACT_MM 5 
176
 #define Y_HOME_RETRACT_MM 5 

+ 6
- 0
Marlin/Makefile View File

114
 else ifeq  ($(HARDWARE_MOTHERBOARD),63)
114
 else ifeq  ($(HARDWARE_MOTHERBOARD),63)
115
 HARDWARE_VARIANT ?= Sanguino
115
 HARDWARE_VARIANT ?= Sanguino
116
 MCU              ?= atmega644p
116
 MCU              ?= atmega644p
117
+else ifeq  ($(HARDWARE_MOTHERBOARD),65)
118
+HARDWARE_VARIANT ?= Sanguino
119
+MCU              ?= atmega1284p
120
+else ifeq  ($(HARDWARE_MOTHERBOARD),66)
121
+HARDWARE_VARIANT ?= Sanguino
122
+MCU              ?= atmega1284p
117
 
123
 
118
 #Ultimaker
124
 #Ultimaker
119
 else ifeq  ($(HARDWARE_MOTHERBOARD),7)
125
 else ifeq  ($(HARDWARE_MOTHERBOARD),7)

+ 5
- 1
Marlin/Marlin.h View File

96
 
96
 
97
 void manage_inactivity();
97
 void manage_inactivity();
98
 
98
 
99
-#if defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1
99
+#if defined(DUAL_X_CARRIAGE) && defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 \
100
+    && defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
101
+  #define  enable_x() do { WRITE(X_ENABLE_PIN, X_ENABLE_ON); WRITE(X2_ENABLE_PIN, X_ENABLE_ON); } while (0)
102
+  #define disable_x() do { WRITE(X_ENABLE_PIN,!X_ENABLE_ON); WRITE(X2_ENABLE_PIN,!X_ENABLE_ON); } while (0)
103
+#elif defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1
100
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
104
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
101
   #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
105
   #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
102
 #else
106
 #else

+ 148
- 25
Marlin/Marlin_main.cpp View File

67
 // G91 - Use Relative Coordinates
67
 // G91 - Use Relative Coordinates
68
 // G92 - Set current position to cordinates given
68
 // G92 - Set current position to cordinates given
69
 
69
 
70
-//RepRap M Codes
70
+// M Codes
71
 // M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
71
 // M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
72
 // M1   - Same as M0
72
 // M1   - Same as M0
73
-// M104 - Set extruder target temp
74
-// M105 - Read current temp
75
-// M106 - Fan on
76
-// M107 - Fan off
77
-// M109 - Wait for extruder current temp to reach target temp.
78
-// M114 - Display current position
79
-
80
-//Custom M Codes
81
 // M17  - Enable/Power all stepper motors
73
 // M17  - Enable/Power all stepper motors
82
 // M18  - Disable all stepper motors; same as M84
74
 // M18  - Disable all stepper motors; same as M84
83
 // M20  - List SD card
75
 // M20  - List SD card
92
 // M29  - Stop SD write
84
 // M29  - Stop SD write
93
 // M30  - Delete file from SD (M30 filename.g)
85
 // M30  - Delete file from SD (M30 filename.g)
94
 // M31  - Output time since last M109 or SD card start to serial
86
 // M31  - Output time since last M109 or SD card start to serial
87
+// M32  - Select file and start SD print (Can be used when printing from SD card)
95
 // M42  - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
88
 // M42  - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
96
 // M80  - Turn on Power Supply
89
 // M80  - Turn on Power Supply
97
 // M81  - Turn off Power Supply
90
 // M81  - Turn off Power Supply
101
 //        or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
94
 //        or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
102
 // M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
95
 // M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
103
 // M92  - Set axis_steps_per_unit - same syntax as G92
96
 // M92  - Set axis_steps_per_unit - same syntax as G92
97
+// M104 - Set extruder target temp
98
+// M105 - Read current temp
99
+// M106 - Fan on
100
+// M107 - Fan off
101
+// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
102
+//        Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
104
 // M114 - Output current position to serial port
103
 // M114 - Output current position to serial port
105
 // M115 - Capabilities string
104
 // M115 - Capabilities string
106
 // M117 - display message
105
 // M117 - display message
110
 // M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
109
 // M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
111
 // M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
110
 // M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
112
 // M140 - Set bed target temp
111
 // M140 - Set bed target temp
113
-// M190 - Wait for bed current temp to reach target temp.
112
+// M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
113
+//        Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
114
 // M200 - Set filament diameter
114
 // M200 - Set filament diameter
115
 // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
115
 // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
116
 // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
116
 // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
125
 // M220 S<factor in percent>- set speed factor override percentage
125
 // M220 S<factor in percent>- set speed factor override percentage
126
 // M221 S<factor in percent>- set extrude factor override percentage
126
 // M221 S<factor in percent>- set extrude factor override percentage
127
 // M240 - Trigger a camera to take a photograph
127
 // M240 - Trigger a camera to take a photograph
128
+// M250 - Set LCD contrast C<contrast value> (value 0..63)
128
 // M280 - set servo position absolute. P: servo index, S: angle or microseconds
129
 // M280 - set servo position absolute. P: servo index, S: angle or microseconds
129
 // M300 - Play beepsound S<frequency Hz> P<duration ms>
130
 // M300 - Play beepsound S<frequency Hz> P<duration ms>
130
 // M301 - Set PID parameters P I and D
131
 // M301 - Set PID parameters P I and D
245
   Servo servos[NUM_SERVOS];
246
   Servo servos[NUM_SERVOS];
246
 #endif
247
 #endif
247
 
248
 
249
+bool CooldownNoWait = true;
250
+bool target_direction;
251
+
248
 //===========================================================================
252
 //===========================================================================
249
 //=============================ROUTINES=============================
253
 //=============================ROUTINES=============================
250
 //===========================================================================
254
 //===========================================================================
425
   servo_init();
429
   servo_init();
426
 
430
 
427
   lcd_init();
431
   lcd_init();
432
+  _delay_ms(1000);	// wait 1sec to display the splash screen
428
   
433
   
429
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
434
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
430
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
435
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
676
 XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
681
 XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
677
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
682
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
678
 
683
 
684
+#ifdef DUAL_X_CARRIAGE
685
+  #if EXTRUDERS == 1 || defined(COREXY) \
686
+      || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
687
+      || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
688
+      || !defined(X_MAX_PIN) || X_MAX_PIN < 0
689
+    #error "Missing or invalid definitions for DUAL_X_CARRIAGE mode."
690
+  #endif
691
+  #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
692
+    #error "Please use canonical x-carriage assignment" // the x-carriages are defined by their homing directions
693
+  #endif  
694
+    
695
+static float x_home_pos(int extruder) {
696
+  if (extruder == 0)
697
+    return base_home_pos(X_AXIS) + add_homeing[X_AXIS];
698
+  else
699
+    // In dual carriage mode the extruder offset provides an override of the
700
+    // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
701
+    // This allow soft recalibration of the second extruder offset position without firmware reflash 
702
+    // (through the M218 command).
703
+    return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
704
+}
705
+
706
+static int x_home_dir(int extruder) {
707
+  return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR;
708
+}
709
+
710
+static float inactive_x_carriage_pos = X2_MAX_POS;
711
+#endif     
712
+
679
 static void axis_is_at_home(int axis) {
713
 static void axis_is_at_home(int axis) {
714
+#ifdef DUAL_X_CARRIAGE
715
+  if (axis == X_AXIS && active_extruder != 0) {
716
+    current_position[X_AXIS] = x_home_pos(active_extruder);
717
+    min_pos[X_AXIS] =          X2_MIN_POS;
718
+    max_pos[X_AXIS] =          max(extruder_offset[X_AXIS][1], X2_MAX_POS);
719
+    return;
720
+  }
721
+#endif  
680
   current_position[axis] = base_home_pos(axis) + add_homeing[axis];
722
   current_position[axis] = base_home_pos(axis) + add_homeing[axis];
681
   min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
723
   min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
682
   max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
724
   max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
685
 static void homeaxis(int axis) {
727
 static void homeaxis(int axis) {
686
 #define HOMEAXIS_DO(LETTER) \
728
 #define HOMEAXIS_DO(LETTER) \
687
   ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
729
   ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
730
+
688
   if (axis==X_AXIS ? HOMEAXIS_DO(X) :
731
   if (axis==X_AXIS ? HOMEAXIS_DO(X) :
689
       axis==Y_AXIS ? HOMEAXIS_DO(Y) :
732
       axis==Y_AXIS ? HOMEAXIS_DO(Y) :
690
       axis==Z_AXIS ? HOMEAXIS_DO(Z) :
733
       axis==Z_AXIS ? HOMEAXIS_DO(Z) :
691
       0) {
734
       0) {
735
+    int axis_home_dir = home_dir(axis);
736
+#ifdef DUAL_X_CARRIAGE
737
+    if (axis == X_AXIS)
738
+      axis_home_dir = x_home_dir(active_extruder);
739
+#endif
692
 
740
 
693
     // Engage Servo endstop if enabled
741
     // Engage Servo endstop if enabled
694
-    #ifdef SERVO_ENDSTOPS[axis] > -1
695
-      servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
742
+    #ifdef SERVO_ENDSTOPS
743
+      if (SERVO_ENDSTOPS[axis] > -1) {
744
+        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
745
+      }
696
     #endif
746
     #endif
697
-
747
+      
698
     current_position[axis] = 0;
748
     current_position[axis] = 0;
699
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
749
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
700
-    destination[axis] = 1.5 * max_length(axis) * home_dir(axis);
750
+    destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
701
     feedrate = homing_feedrate[axis];
751
     feedrate = homing_feedrate[axis];
702
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
752
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
703
     st_synchronize();
753
     st_synchronize();
704
 
754
 
705
     current_position[axis] = 0;
755
     current_position[axis] = 0;
706
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
756
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
707
-    destination[axis] = -home_retract_mm(axis) * home_dir(axis);
757
+    destination[axis] = -home_retract_mm(axis) * axis_home_dir;
708
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
758
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
709
     st_synchronize();
759
     st_synchronize();
710
 
760
 
711
-    destination[axis] = 2*home_retract_mm(axis) * home_dir(axis);
761
+    destination[axis] = 2*home_retract_mm(axis) * axis_home_dir;
712
     feedrate = homing_feedrate[axis]/2 ;
762
     feedrate = homing_feedrate[axis]/2 ;
713
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
763
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
714
     st_synchronize();
764
     st_synchronize();
719
     endstops_hit_on_purpose();
769
     endstops_hit_on_purpose();
720
 
770
 
721
     // Retract Servo endstop if enabled
771
     // Retract Servo endstop if enabled
722
-    #ifdef SERVO_ENDSTOPS[axis] > -1
723
-      servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
772
+    #ifdef SERVO_ENDSTOPS
773
+      if (SERVO_ENDSTOPS[axis] > -1) {
774
+        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
775
+      }
724
     #endif
776
     #endif
725
   }
777
   }
726
 }
778
 }
846
 
898
 
847
 #else // NOT DELTA
899
 #else // NOT DELTA
848
 
900
 
849
-          home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
901
+      home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
850
 
902
 
851
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
903
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
852
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
904
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
859
       {
911
       {
860
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
912
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
861
 
913
 
914
+       #ifndef DUAL_X_CARRIAGE
915
+        int x_axis_home_dir = home_dir(X_AXIS);
916
+       #else
917
+        int x_axis_home_dir = x_home_dir(active_extruder);
918
+       #endif
919
+        
862
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
920
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
863
-        destination[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
921
+        destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
864
         feedrate = homing_feedrate[X_AXIS];
922
         feedrate = homing_feedrate[X_AXIS];
865
         if(homing_feedrate[Y_AXIS]<feedrate)
923
         if(homing_feedrate[Y_AXIS]<feedrate)
866
           feedrate =homing_feedrate[Y_AXIS];
924
           feedrate =homing_feedrate[Y_AXIS];
885
 
943
 
886
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
944
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
887
       {
945
       {
946
+      #ifdef DUAL_X_CARRIAGE
947
+        int tmp_extruder = active_extruder;
948
+        active_extruder = !active_extruder;
949
+        HOMEAXIS(X);
950
+        inactive_x_carriage_pos = current_position[X_AXIS];
951
+        active_extruder = tmp_extruder;
952
+      #endif         
888
         HOMEAXIS(X);
953
         HOMEAXIS(X);
889
       }
954
       }
890
 
955
 
917
         }
982
         }
918
       }
983
       }
919
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
984
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
920
-#endif // DELTA
985
+#endif // else DELTA
921
           
986
           
922
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
987
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
923
         enable_endstops(false);
988
         enable_endstops(false);
1057
         card.removeFile(strchr_pointer + 4);
1122
         card.removeFile(strchr_pointer + 4);
1058
       }
1123
       }
1059
       break;
1124
       break;
1125
+    case 32: //M32 - Select file and start SD print
1126
+      if(card.sdprinting) {
1127
+        st_synchronize();
1128
+        card.closefile();
1129
+        card.sdprinting = false;
1130
+      }
1131
+      starpos = (strchr(strchr_pointer + 4,'*'));
1132
+      if(starpos!=NULL)
1133
+        *(starpos-1)='\0';
1134
+      card.openFile(strchr_pointer + 4,true);
1135
+      card.startFileprint();
1136
+      starttime=millis();
1137
+      break;
1060
     case 928: //M928 - Start SD write
1138
     case 928: //M928 - Start SD write
1061
       starpos = (strchr(strchr_pointer + 5,'*'));
1139
       starpos = (strchr(strchr_pointer + 5,'*'));
1062
       if(starpos != NULL){
1140
       if(starpos != NULL){
1159
       #ifdef AUTOTEMP
1237
       #ifdef AUTOTEMP
1160
         autotemp_enabled=false;
1238
         autotemp_enabled=false;
1161
       #endif
1239
       #endif
1162
-      if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
1240
+      if (code_seen('S')) { 
1241
+        setTargetHotend(code_value(), tmp_extruder);
1242
+        CooldownNoWait = true;
1243
+      } else if (code_seen('R')) {
1244
+        setTargetHotend(code_value(), tmp_extruder);
1245
+        CooldownNoWait = false;
1246
+      }
1163
       #ifdef AUTOTEMP
1247
       #ifdef AUTOTEMP
1164
         if (code_seen('S')) autotemp_min=code_value();
1248
         if (code_seen('S')) autotemp_min=code_value();
1165
         if (code_seen('B')) autotemp_max=code_value();
1249
         if (code_seen('B')) autotemp_max=code_value();
1174
       codenum = millis();
1258
       codenum = millis();
1175
 
1259
 
1176
       /* See if we are heating up or cooling down */
1260
       /* See if we are heating up or cooling down */
1177
-      bool target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
1261
+      target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
1178
 
1262
 
1179
       #ifdef TEMP_RESIDENCY_TIME
1263
       #ifdef TEMP_RESIDENCY_TIME
1180
         long residencyStart;
1264
         long residencyStart;
1230
     case 190: // M190 - Wait for bed heater to reach target.
1314
     case 190: // M190 - Wait for bed heater to reach target.
1231
     #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
1315
     #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
1232
         LCD_MESSAGEPGM(MSG_BED_HEATING);
1316
         LCD_MESSAGEPGM(MSG_BED_HEATING);
1233
-        if (code_seen('S')) setTargetBed(code_value());
1317
+        if (code_seen('S')) { 
1318
+          setTargetBed(code_value());
1319
+          CooldownNoWait = true;
1320
+        } else if (code_seen('R')) {
1321
+          setTargetBed(code_value());
1322
+          CooldownNoWait = false;
1323
+        }
1234
         codenum = millis();
1324
         codenum = millis();
1235
-        while(isHeatingBed())
1325
+        
1326
+        target_direction = isHeatingBed(); // true if heating, false if cooling
1327
+        
1328
+        while ( target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) )
1236
         {
1329
         {
1237
           if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
1330
           if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
1238
           {
1331
           {
1716
       #endif
1809
       #endif
1717
      }
1810
      }
1718
     break;
1811
     break;
1812
+#ifdef DOGLCD
1813
+    case 250: // M250  Set LCD contrast value: C<value> (value 0..63)
1814
+     {
1815
+	  if (code_seen('C')) {
1816
+	   lcd_setcontrast( ((int)code_value())&63 );
1817
+          }
1818
+          SERIAL_PROTOCOLPGM("lcd contrast value: ");
1819
+          SERIAL_PROTOCOL(lcd_contrast);
1820
+          SERIAL_PROTOCOLLN("");
1821
+     }
1822
+    break;
1823
+#endif
1719
     #ifdef PREVENT_DANGEROUS_EXTRUDE
1824
     #ifdef PREVENT_DANGEROUS_EXTRUDE
1720
     case 302: // allow cold extrudes, or set the minimum extrude temperature
1825
     case 302: // allow cold extrudes, or set the minimum extrude temperature
1721
     {
1826
     {
1973
       if(tmp_extruder != active_extruder) {
2078
       if(tmp_extruder != active_extruder) {
1974
         // Save current position to return to after applying extruder offset
2079
         // Save current position to return to after applying extruder offset
1975
         memcpy(destination, current_position, sizeof(destination));
2080
         memcpy(destination, current_position, sizeof(destination));
2081
+      #ifdef DUAL_X_CARRIAGE
2082
+        // only apply Y extruder offset in dual x carriage mode (x offset is already used in determining home pos)
2083
+        current_position[Y_AXIS] = current_position[Y_AXIS] -
2084
+                     extruder_offset[Y_AXIS][active_extruder] +
2085
+                     extruder_offset[Y_AXIS][tmp_extruder];
2086
+
2087
+        float tmp_x_pos = current_position[X_AXIS];
2088
+
2089
+        // Set the new active extruder and position
2090
+        active_extruder = tmp_extruder;
2091
+        axis_is_at_home(X_AXIS); //this function updates X min/max values.
2092
+        current_position[X_AXIS] = inactive_x_carriage_pos;
2093
+        inactive_x_carriage_pos = tmp_x_pos;      
2094
+      #else    
1976
         // Offset extruder (only by XY)
2095
         // Offset extruder (only by XY)
1977
         int i;
2096
         int i;
1978
         for(i = 0; i < 2; i++) {
2097
         for(i = 0; i < 2; i++) {
1982
         }
2101
         }
1983
         // Set the new active extruder and position
2102
         // Set the new active extruder and position
1984
         active_extruder = tmp_extruder;
2103
         active_extruder = tmp_extruder;
2104
+      #endif //else DUAL_X_CARRIAGE
1985
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2105
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1986
         // Move to the old position if 'F' was in the parameters
2106
         // Move to the old position if 'F' was in the parameters
1987
         if(make_move && Stopped == false) {
2107
         if(make_move && Stopped == false) {
2226
        || !READ(E2_ENABLE_PIN)
2346
        || !READ(E2_ENABLE_PIN)
2227
     #endif
2347
     #endif
2228
     #if EXTRUDER > 1
2348
     #if EXTRUDER > 1
2349
+      #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
2350
+       || !READ(X2_ENABLE_PIN)
2351
+      #endif
2229
        || !READ(E1_ENABLE_PIN)
2352
        || !READ(E1_ENABLE_PIN)
2230
     #endif
2353
     #endif
2231
        || !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...
2354
        || !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...

+ 0
- 1
Marlin/cardreader.cpp View File

206
   if(cardOK)
206
   if(cardOK)
207
   {
207
   {
208
     sdprinting = true;
208
     sdprinting = true;
209
-    
210
   }
209
   }
211
 }
210
 }
212
 
211
 

+ 14
- 2
Marlin/dogm_lcd_implementation.h View File

74
 
74
 
75
 #define FONT_STATUSMENU	u8g_font_6x9
75
 #define FONT_STATUSMENU	u8g_font_6x9
76
 
76
 
77
+int lcd_contrast;
78
+
77
 // LCD selection
79
 // LCD selection
78
 #ifdef U8GLIB_ST7920
80
 #ifdef U8GLIB_ST7920
79
 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
81
 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
80
 U8GLIB_ST7920_128X64_RRD u8g(0);
82
 U8GLIB_ST7920_128X64_RRD u8g(0);
83
+#elif defined(MAKRPANEL)
84
+// The MaKrPanel display, ST7565 controller as well
85
+U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
81
 #else
86
 #else
87
+// for regular DOGM128 display with HW-SPI
82
 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);	// HW-SPI Com: CS, A0
88
 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);	// HW-SPI Com: CS, A0
83
 #endif
89
 #endif
84
 
90
 
85
 static void lcd_implementation_init()
91
 static void lcd_implementation_init()
86
 {
92
 {
93
+#ifdef LCD_PIN_BL
94
+	pinMode(LCD_PIN_BL, OUTPUT);	// Enable LCD backlight
95
+	digitalWrite(LCD_PIN_BL, HIGH);
96
+#endif
97
+
98
+        u8g.setContrast(lcd_contrast);	
87
 	//  Uncomment this if you have the first generation (V1.10) of STBs board
99
 	//  Uncomment this if you have the first generation (V1.10) of STBs board
88
 	//  pinMode(17, OUTPUT);	// Enable LCD backlight
100
 	//  pinMode(17, OUTPUT);	// Enable LCD backlight
89
 	//  digitalWrite(17, HIGH);
101
 	//  digitalWrite(17, HIGH);
117
 			u8g.setFont(u8g_font_6x10_marlin);
129
 			u8g.setFont(u8g_font_6x10_marlin);
118
 			u8g.drawStr(62,10,"MARLIN"); 
130
 			u8g.drawStr(62,10,"MARLIN"); 
119
 			u8g.setFont(u8g_font_5x8);
131
 			u8g.setFont(u8g_font_5x8);
120
-			u8g.drawStr(62,19,"V1.0.0 RC2");
132
+			u8g.drawStr(62,19,"V1.0.0 RC2-mm");
121
 			u8g.setFont(u8g_font_6x10_marlin);
133
 			u8g.setFont(u8g_font_6x10_marlin);
122
 			u8g.drawStr(62,28,"by ErikZalm");
134
 			u8g.drawStr(62,28,"by ErikZalm");
123
 			u8g.drawStr(62,41,"DOGM128 LCD");
135
 			u8g.drawStr(62,41,"DOGM128 LCD");
124
 			u8g.setFont(u8g_font_5x8);
136
 			u8g.setFont(u8g_font_5x8);
125
 			u8g.drawStr(62,48,"enhancements");
137
 			u8g.drawStr(62,48,"enhancements");
126
 			u8g.setFont(u8g_font_5x8);
138
 			u8g.setFont(u8g_font_5x8);
127
-			u8g.drawStr(62,55,"by STB");
139
+			u8g.drawStr(62,55,"by STB, MM");
128
 			u8g.drawStr(62,61,"uses u");
140
 			u8g.drawStr(62,61,"uses u");
129
 			u8g.drawStr90(92,57,"8");
141
 			u8g.drawStr90(92,57,"8");
130
 			u8g.drawStr(100,61,"glib");
142
 			u8g.drawStr(100,61,"glib");

+ 111
- 97
Marlin/language.h View File

84
 	#define MSG_PID_D "PID-D"
84
 	#define MSG_PID_D "PID-D"
85
 	#define MSG_PID_C "PID-C"
85
 	#define MSG_PID_C "PID-C"
86
 	#define MSG_ACC  "Accel"
86
 	#define MSG_ACC  "Accel"
87
-	#define MSG_VXY_JERK "Vxy-jerk"
88
-	#define MSG_VZ_JERK "Vz-jerk"
89
-	#define MSG_VE_JERK "Ve-jerk"
87
+	#define MSG_VXY_JERK "Vxy-jerk"
88
+	#define MSG_VZ_JERK "Vz-jerk"
89
+	#define MSG_VE_JERK "Ve-jerk"
90
 	#define MSG_VMAX "Vmax "
90
 	#define MSG_VMAX "Vmax "
91
 	#define MSG_X "x"
91
 	#define MSG_X "x"
92
 	#define MSG_Y "y"
92
 	#define MSG_Y "y"
103
 	#define MSG_RECTRACT "Rectract"
103
 	#define MSG_RECTRACT "Rectract"
104
 	#define MSG_TEMPERATURE "Temperature"
104
 	#define MSG_TEMPERATURE "Temperature"
105
 	#define MSG_MOTION "Motion"
105
 	#define MSG_MOTION "Motion"
106
+	#define MSG_CONTRAST "LCD contrast"
106
 	#define MSG_STORE_EPROM "Store memory"
107
 	#define MSG_STORE_EPROM "Store memory"
107
 	#define MSG_LOAD_EPROM "Load memory"
108
 	#define MSG_LOAD_EPROM "Load memory"
108
 	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
109
 	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
246
 	#define MSG_PID_C "PID-C"
247
 	#define MSG_PID_C "PID-C"
247
 	#define MSG_ACC  "Acc"
248
 	#define MSG_ACC  "Acc"
248
 	#define MSG_VXY_JERK "Zryw Vxy"
249
 	#define MSG_VXY_JERK "Zryw Vxy"
249
-	#define MSG_VZ_JERK "Zryw Vz"
250
-	#define MSG_VE_JERK "Zryw Ve"
250
+	#define MSG_VZ_JERK "Zryw Vz"
251
+	#define MSG_VE_JERK "Zryw Ve"
251
 	#define MSG_VMAX "Vmax"
252
 	#define MSG_VMAX "Vmax"
252
 	#define MSG_X "x"
253
 	#define MSG_X "x"
253
 	#define MSG_Y "y"
254
 	#define MSG_Y "y"
264
 	#define MSG_RECTRACT "Wycofanie"
265
 	#define MSG_RECTRACT "Wycofanie"
265
 	#define MSG_TEMPERATURE "Temperatura"
266
 	#define MSG_TEMPERATURE "Temperatura"
266
 	#define MSG_MOTION "Ruch"
267
 	#define MSG_MOTION "Ruch"
268
+	#define MSG_CONTRAST "LCD contrast"
267
 	#define MSG_STORE_EPROM "Zapisz w pamieci"
269
 	#define MSG_STORE_EPROM "Zapisz w pamieci"
268
 	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
270
 	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
269
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
271
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
409
 #define MSG_PID_C " PID-C: "
411
 #define MSG_PID_C " PID-C: "
410
 #define MSG_ACC " Acc:"
412
 #define MSG_ACC " Acc:"
411
 #define MSG_VXY_JERK "Vxy-jerk"
413
 #define MSG_VXY_JERK "Vxy-jerk"
412
-#define MSG_VZ_JERK "Vz-jerk"
413
-#define MSG_VE_JERK "Ve-jerk"
414
+#define MSG_VZ_JERK "Vz-jerk"
415
+#define MSG_VE_JERK "Ve-jerk"
414
 #define MSG_VMAX " Vmax "
416
 #define MSG_VMAX " Vmax "
415
 #define MSG_X "x:"
417
 #define MSG_X "x:"
416
 #define MSG_Y "y:"
418
 #define MSG_Y "y:"
429
 #define MSG_TEMPERATURE_WIDE " Temperature \x7E"
431
 #define MSG_TEMPERATURE_WIDE " Temperature \x7E"
430
 #define MSG_TEMPERATURE_RTN " Temperature \003"
432
 #define MSG_TEMPERATURE_RTN " Temperature \003"
431
 #define MSG_MOTION_WIDE " Mouvement \x7E"
433
 #define MSG_MOTION_WIDE " Mouvement \x7E"
434
+	#define MSG_CONTRAST "LCD contrast"
432
 #define MSG_STORE_EPROM " Sauvegarder memoire"
435
 #define MSG_STORE_EPROM " Sauvegarder memoire"
433
 #define MSG_LOAD_EPROM " Lire memoire"
436
 #define MSG_LOAD_EPROM " Lire memoire"
434
 #define MSG_RESTORE_FAILSAFE " Restaurer memoire"
437
 #define MSG_RESTORE_FAILSAFE " Restaurer memoire"
541
 
544
 
542
 	#define MSG_SD_INSERTED      "SDKarte erkannt"
545
 	#define MSG_SD_INSERTED      "SDKarte erkannt"
543
 	#define MSG_SD_REMOVED       "SDKarte entfernt"
546
 	#define MSG_SD_REMOVED       "SDKarte entfernt"
544
-	#define MSG_MAIN             "Hauptmneü"
547
+	#define MSG_MAIN             "Hauptmenü"
545
 	#define MSG_AUTOSTART        "Autostart"
548
 	#define MSG_AUTOSTART        "Autostart"
546
 	#define MSG_DISABLE_STEPPERS "Stepper abschalten"
549
 	#define MSG_DISABLE_STEPPERS "Stepper abschalten"
547
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
550
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
562
 	#define MSG_NOZZLE2          "Düse3"
565
 	#define MSG_NOZZLE2          "Düse3"
563
 	#define MSG_BED              "Bett"
566
 	#define MSG_BED              "Bett"
564
 	#define MSG_FAN_SPEED        "Lüftergeschw."
567
 	#define MSG_FAN_SPEED        "Lüftergeschw."
565
-	#define MSG_FLOW             "Fluß"
568
+	#define MSG_FLOW             "Fluss"
566
 	#define MSG_CONTROL          "Einstellungen"
569
 	#define MSG_CONTROL          "Einstellungen"
567
 	#define MSG_MIN              "\002 Min"
570
 	#define MSG_MIN              "\002 Min"
568
 	#define MSG_MAX              "\002 Max"
571
 	#define MSG_MAX              "\002 Max"
576
 	#define MSG_PID_C            "PID-C"
579
 	#define MSG_PID_C            "PID-C"
577
 	#define MSG_ACC              "Acc"
580
 	#define MSG_ACC              "Acc"
578
 	#define MSG_VXY_JERK         "Vxy-jerk"
581
 	#define MSG_VXY_JERK         "Vxy-jerk"
579
-	#define MSG_VZ_JERK          "Vz-jerk"
580
-	#define MSG_VE_JERK          "Ve-jerk"
582
+	#define MSG_VZ_JERK          "Vz-jerk"
583
+	#define MSG_VE_JERK          "Ve-jerk"
581
 	#define MSG_VMAX             "Vmax "
584
 	#define MSG_VMAX             "Vmax "
582
 	#define MSG_X                "x"
585
 	#define MSG_X                "x"
583
 	#define MSG_Y                "y"
586
 	#define MSG_Y                "y"
595
 	#define MSG_WATCH            "Beobachten"
598
 	#define MSG_WATCH            "Beobachten"
596
 	#define MSG_TEMPERATURE      "Temperatur"
599
 	#define MSG_TEMPERATURE      "Temperatur"
597
 	#define MSG_MOTION           "Bewegung"
600
 	#define MSG_MOTION           "Bewegung"
601
+	#define MSG_CONTRAST "LCD contrast"
598
 	#define MSG_STORE_EPROM      "EPROM speichern"
602
 	#define MSG_STORE_EPROM      "EPROM speichern"
599
 	#define MSG_LOAD_EPROM       "EPROM laden"
603
 	#define MSG_LOAD_EPROM       "EPROM laden"
600
 	#define MSG_RESTORE_FAILSAFE "Standardkonfig."
604
 	#define MSG_RESTORE_FAILSAFE "Standardkonfig."
700
 #if LANGUAGE_CHOICE == 5
704
 #if LANGUAGE_CHOICE == 5
701
 
705
 
702
 // LCD Menu Messages
706
 // LCD Menu Messages
703
-#define WELCOME_MSG MACHINE_NAME " Lista."
707
+#define WELCOME_MSG MACHINE_NAME "Lista."
704
 #define MSG_SD_INSERTED "Tarjeta SD Colocada"
708
 #define MSG_SD_INSERTED "Tarjeta SD Colocada"
705
 #define MSG_SD_REMOVED "Tarjeta SD Retirada"
709
 #define MSG_SD_REMOVED "Tarjeta SD Retirada"
706
-#define MSG_MAIN " Menu Principal \003"
710
+#define MSG_MAIN "Menu Principal"
707
 #define MSG_AUTOSTART " Autostart"
711
 #define MSG_AUTOSTART " Autostart"
708
-#define MSG_DISABLE_STEPPERS " Apagar Motores"
709
-#define MSG_AUTO_HOME " Llevar Ejes al Cero"
710
-#define MSG_SET_ORIGIN " Establecer Cero"
711
-#define MSG_COOLDOWN " Enfriar"
712
+#define MSG_DISABLE_STEPPERS "Apagar Motores"
713
+#define MSG_AUTO_HOME "Llevar al Origen" // "Llevar Ejes al Cero"
714
+#define MSG_SET_ORIGIN "Establecer Cero"
715
+#define MSG_PREHEAT_PLA "Precalentar PLA"
716
+#define MSG_PREHEAT_PLA_SETTINGS "Ajustar temp. PLA"
717
+#define MSG_PREHEAT_ABS "Precalentar ABS"
718
+#define MSG_PREHEAT_ABS_SETTINGS "Ajustar temp. ABS"
719
+#define MSG_COOLDOWN "Enfriar"
712
 #define MSG_SWITCH_PS_ON "Switch Power On"
720
 #define MSG_SWITCH_PS_ON "Switch Power On"
713
 #define MSG_SWITCH_PS_OFF "Switch Power Off"
721
 #define MSG_SWITCH_PS_OFF "Switch Power Off"
714
-#define MSG_EXTRUDE " Extruir"
715
-#define MSG_RETRACT " Retraer"
716
-#define MSG_PREHEAT_PLA " Precalentar PLA"
717
-#define MSG_PREHEAT_PLA_SETTINGS " Ajustar temp. PLA"
718
-#define MSG_PREHEAT_ABS " Precalentar ABS"
719
-#define MSG_PREHEAT_ABS_SETTINGS " Ajustar temp. ABS"
720
-#define MSG_MOVE_AXIS " Mover Ejes      \x7E"
721
-#define MSG_SPEED " Velocidad:"
722
-#define MSG_NOZZLE " \002Fusor:"
723
-#define MSG_NOZZLE1 " \002Fusor2:"
724
-#define MSG_NOZZLE2 " \002Fusor3:"
725
-#define MSG_BED " \002Base:"
726
-#define MSG_FAN_SPEED " Ventilador:"
727
-#define MSG_FLOW " Flujo:"
728
-#define MSG_CONTROL " Control \003"
729
-#define MSG_MIN " \002 Min:"
730
-#define MSG_MAX " \002 Max:"
731
-#define MSG_FACTOR " \002 Fact:"
732
-#define MSG_AUTOTEMP " Autotemp:"
733
-#define MSG_ON "On "
722
+#define MSG_EXTRUDE "Extruir"
723
+#define MSG_RETRACT "Retraer"
724
+#define MSG_MOVE_AXIS "Mover Ejes"
725
+#define MSG_SPEED "Velocidad"
726
+#define MSG_NOZZLE "Nozzle"
727
+#define MSG_NOZZLE1 "Nozzle2"
728
+#define MSG_NOZZLE2 "Nozzle3"
729
+#define MSG_BED "Base"
730
+#define MSG_FAN_SPEED "Ventilador"
731
+#define MSG_FLOW "Flujo"
732
+#define MSG_CONTROL "Control"
733
+#define MSG_MIN "\002 Min"
734
+#define MSG_MAX "\002 Max"
735
+#define MSG_FACTOR "\002 Fact"
736
+#define MSG_AUTOTEMP "Autotemp"
737
+#define MSG_ON "On"
734
 #define MSG_OFF "Off"
738
 #define MSG_OFF "Off"
735
-#define MSG_PID_P " PID-P: "
736
-#define MSG_PID_I " PID-I: "
737
-#define MSG_PID_D " PID-D: "
738
-#define MSG_PID_C " PID-C: "
739
-#define MSG_ACC  " Acc:"
740
-#define MSG_VXY_JERK " Vxy-agit: "
741
-#define MSG_VZ_JERK "Vz-agit"
742
-#define MSG_VE_JERK "Ve-agit"
743
-#define MSG_VMAX " Vmax "
744
-#define MSG_X "x:"
745
-#define MSG_Y "y:"
746
-#define MSG_Z "z:"
747
-#define MSG_E "e:"
748
-#define MSG_VMIN " Vmin:"
749
-#define MSG_VTRAV_MIN " VTrav min:"
750
-#define MSG_AMAX " Amax "
751
-#define MSG_A_RETRACT " A-retrac.:"
752
-#define MSG_XSTEPS " Xpasos/mm:"
753
-#define MSG_YSTEPS " Ypasos/mm:"
754
-#define MSG_ZSTEPS " Zpasos/mm:"
755
-#define MSG_ESTEPS " Epasos/mm:"
756
-#define MSG_MAIN_WIDE " Menu Principal  \003"
757
-#define MSG_RECTRACT_WIDE " Retraer         \x7E"
758
-#define MSG_TEMPERATURE_WIDE " Temperatura     \x7E"
759
-#define MSG_TEMPERATURE_RTN  " Temperatura     \003"
760
-#define MSG_MOTION_WIDE " Movimiento      \x7E"
761
-#define MSG_STORE_EPROM " Guardar Memoria"
762
-#define MSG_LOAD_EPROM " Cargar Memoria"
763
-#define MSG_RESTORE_FAILSAFE " Rest. de emergencia"
764
-#define MSG_REFRESH "\004Volver a cargar"
765
-#define MSG_WATCH " Monitorizar \003"
766
-#define MSG_PREPARE " Preparar \x7E"
767
-#define MSG_PREPARE_ALT " Preparar \003"
768
-#define MSG_CONTROL_ARROW " Control  \x7E"
769
-#define MSG_RETRACT_ARROW " Retraer  \x7E"
770
-#define MSG_TUNE " Ajustar \x7E"
771
-#define MSG_PAUSE_PRINT " Pausar Impresion \x7E"
772
-#define MSG_RESUME_PRINT " Reanudar Impresion \x7E"
773
-#define MSG_STOP_PRINT " Detener Impresion \x7E"
774
-#define MSG_CARD_MENU " Menu de SD    \x7E"
775
-#define MSG_NO_CARD " No hay Tarjeta SD"
739
+#define MSG_PID_P "PID-P"
740
+#define MSG_PID_I "PID-I"
741
+#define MSG_PID_D "PID-D"
742
+#define MSG_PID_C "PID-C"
743
+#define MSG_ACC  "Acel"
744
+#define MSG_VXY_JERK "Vxy-jerk"
745
+#define MSG_VZ_JERK "Vz-jerk"
746
+#define MSG_VE_JERK "Ve-jerk"
747
+#define MSG_VMAX "Vmax"
748
+#define MSG_X "x"
749
+#define MSG_Y "y"
750
+#define MSG_Z "z"
751
+#define MSG_E "e"
752
+#define MSG_VMIN "Vmin"
753
+#define MSG_VTRAV_MIN "VTrav min"
754
+#define MSG_AMAX "Amax"
755
+#define MSG_A_RETRACT "A-retrac."
756
+#define MSG_XSTEPS "X pasos/mm"
757
+#define MSG_YSTEPS "Y pasos/mm"
758
+#define MSG_ZSTEPS "Z pasos/mm"
759
+#define MSG_ESTEPS "E pasos/mm"
760
+#define MSG_RECTRACT "Retraer"
761
+#define MSG_TEMPERATURE "Temperatura"
762
+#define MSG_MOTION "Movimiento"
763
+#define MSG_STORE_EPROM "Guardar Memoria"
764
+#define MSG_LOAD_EPROM "Cargar Memoria"
765
+#define MSG_RESTORE_FAILSAFE "Rest. de emergencia"
766
+#define MSG_REFRESH "Volver a cargar"
767
+#define MSG_WATCH "Monitorizar"
768
+#define MSG_PREPARE "Preparar"
769
+#define MSG_TUNE "Ajustar"
770
+#define MSG_PAUSE_PRINT "Pausar Impresion"
771
+#define MSG_RESUME_PRINT "Reanudar Impresion"
772
+#define MSG_STOP_PRINT "Detener Impresion"
773
+#define MSG_CARD_MENU "Menu de SD"
774
+#define MSG_NO_CARD "No hay Tarjeta SD"
776
 #define MSG_DWELL "Reposo..."
775
 #define MSG_DWELL "Reposo..."
777
 #define MSG_USERWAIT "Esperando Ordenes..."
776
 #define MSG_USERWAIT "Esperando Ordenes..."
777
+#define MSG_RESUMING "Resumiendo Impresion"
778
 #define MSG_NO_MOVE "Sin movimiento"
778
 #define MSG_NO_MOVE "Sin movimiento"
779
-#define MSG_PART_RELEASE "Desacople Parcial"
780
 #define MSG_KILLED "PARADA DE EMERGENCIA. "
779
 #define MSG_KILLED "PARADA DE EMERGENCIA. "
781
-#define MSG_STOPPED "PARADA. "
782
-#define MSG_STEPPER_RELEASED "Desacoplada."
783
-#define MSG_CONTROL_RETRACT  " Retraer mm:"
784
-#define MSG_CONTROL_RETRACTF " Retraer  F:"
785
-#define MSG_CONTROL_RETRACT_ZLIFT " Levantar mm:"
786
-#define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
787
-#define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
788
-#define MSG_AUTORETRACT " AutoRetr.:"
780
+#define MSG_STOPPED "PARADA."
781
+#define MSG_CONTROL_RETRACT  "Retraer mm"
782
+#define MSG_CONTROL_RETRACTF "Retraer  F"
783
+#define MSG_CONTROL_RETRACT_ZLIFT "Levantar mm"
784
+#define MSG_CONTROL_RETRACT_RECOVER "DesRet +mm"
785
+#define MSG_CONTROL_RETRACT_RECOVERF "DesRet F"
786
+#define MSG_AUTORETRACT "AutoRetr."
789
 #define MSG_FILAMENTCHANGE "Change filament"
787
 #define MSG_FILAMENTCHANGE "Change filament"
788
+#define MSG_INIT_SDCARD "Iniciando. Tarjeta-SD"
789
+#define MSG_CNG_SDCARD "Cambiar Tarjeta-SD"
790
+#define MSG_RECTRACT_WIDE "Retraer"
791
+#define MSG_TEMPERATURE_WIDE "Temperatura"
792
+#define MSG_TEMPERATURE_RTN  "Temperatura"
793
+#define MSG_MAIN_WIDE "Menu Principal"
794
+#define MSG_MOTION_WIDE "Movimiento"
795
+#define MSG_PREPARE_ALT "Preparar"
796
+#define MSG_CONTROL_ARROW "Control"
797
+#define MSG_RETRACT_ARROW "Retraer"
798
+#define MSG_PART_RELEASE "Desacople Parcial"
799
+#define MSG_STEPPER_RELEASED "Desacoplada."
800
+
790
 // Serial Console Messages
801
 // Serial Console Messages
791
 
802
 
792
 #define MSG_Enqueing "En cola \""
803
 #define MSG_Enqueing "En cola \""
831
 #define MSG_Y_MIN "y_min: "
842
 #define MSG_Y_MIN "y_min: "
832
 #define MSG_Y_MAX "y_max: "
843
 #define MSG_Y_MAX "y_max: "
833
 #define MSG_Z_MIN "z_min: "
844
 #define MSG_Z_MIN "z_min: "
845
+#define MSG_Z_MAX "z_max: "
834
 #define MSG_M119_REPORT "Comprobando fines de carrera."
846
 #define MSG_M119_REPORT "Comprobando fines de carrera."
835
 #define MSG_ENDSTOP_HIT "PULSADO"
847
 #define MSG_ENDSTOP_HIT "PULSADO"
836
 #define MSG_ENDSTOP_OPEN "abierto"
848
 #define MSG_ENDSTOP_OPEN "abierto"
837
-#define MSG_HOTEND_OFFSET "Despl. Hotend:"
838
-        
849
+#define MSG_HOTEND_OFFSET "Hotend offsets:"
839
 #define MSG_SD_CANT_OPEN_SUBDIR "No se pudo abrir la subcarpeta."
850
 #define MSG_SD_CANT_OPEN_SUBDIR "No se pudo abrir la subcarpeta."
840
 #define MSG_SD_INIT_FAIL "Fallo al iniciar la SD"
851
 #define MSG_SD_INIT_FAIL "Fallo al iniciar la SD"
841
 #define MSG_SD_VOL_INIT_FAIL "Fallo al montar el volumen"
852
 #define MSG_SD_VOL_INIT_FAIL "Fallo al montar el volumen"
900
 #define MSG_PID_C							" PID-C: "
911
 #define MSG_PID_C							" PID-C: "
901
 #define MSG_ACC								" Acc:"
912
 #define MSG_ACC								" Acc:"
902
 #define MSG_VXY_JERK						" Vxy-jerk: "
913
 #define MSG_VXY_JERK						" Vxy-jerk: "
903
-#define MSG_VZ_JERK                         "Vz-jerk"
904
-#define MSG_VE_JERK                         "Ve-jerk"
914
+#define MSG_VZ_JERK                         "Vz-jerk"
915
+#define MSG_VE_JERK                         "Ve-jerk"
905
 #define MSG_VMAX							" Vmax "
916
 #define MSG_VMAX							" Vmax "
906
 #define MSG_X								"x:"
917
 #define MSG_X								"x:"
907
 #define MSG_Y								"y:"
918
 #define MSG_Y								"y:"
918
 #define MSG_RECTRACT    					" Откат подачи      \x7E"
929
 #define MSG_RECTRACT    					" Откат подачи      \x7E"
919
 #define MSG_TEMPERATURE  				" Температура       \x7E"
930
 #define MSG_TEMPERATURE  				" Температура       \x7E"
920
 #define MSG_MOTION						" Скорости          \x7E"
931
 #define MSG_MOTION						" Скорости          \x7E"
932
+	#define MSG_CONTRAST "LCD contrast"
921
 #define MSG_STORE_EPROM						" Сохранить настройки"
933
 #define MSG_STORE_EPROM						" Сохранить настройки"
922
 #define MSG_LOAD_EPROM						" Загрузить настройки"
934
 #define MSG_LOAD_EPROM						" Загрузить настройки"
923
 #define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
935
 #define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
1057
 	#define MSG_PID_C                "PID-C"
1069
 	#define MSG_PID_C                "PID-C"
1058
 	#define MSG_ACC                  "Accel"
1070
 	#define MSG_ACC                  "Accel"
1059
 	#define MSG_VXY_JERK             "Vxy-jerk"
1071
 	#define MSG_VXY_JERK             "Vxy-jerk"
1060
-	#define MSG_VZ_JERK              "Vz-jerk"
1061
-	#define MSG_VE_JERK              "Ve-jerk"
1072
+	#define MSG_VZ_JERK              "Vz-jerk"
1073
+	#define MSG_VE_JERK              "Ve-jerk"
1062
 	#define MSG_VMAX                 "Vmax"
1074
 	#define MSG_VMAX                 "Vmax"
1063
 	#define MSG_X                    "x"
1075
 	#define MSG_X                    "x"
1064
 	#define MSG_Y                    "y"
1076
 	#define MSG_Y                    "y"
1075
 	#define MSG_RECTRACT             "Ritrai"
1087
 	#define MSG_RECTRACT             "Ritrai"
1076
 	#define MSG_TEMPERATURE          "Temperatura"
1088
 	#define MSG_TEMPERATURE          "Temperatura"
1077
 	#define MSG_MOTION               "Movimento"
1089
 	#define MSG_MOTION               "Movimento"
1090
+	#define MSG_CONTRAST "LCD contrast"
1078
 	#define MSG_STORE_EPROM          "Salva in EEPROM"
1091
 	#define MSG_STORE_EPROM          "Salva in EEPROM"
1079
 	#define MSG_LOAD_EPROM           "Carica da EEPROM"
1092
 	#define MSG_LOAD_EPROM           "Carica da EEPROM"
1080
 	#define MSG_RESTORE_FAILSAFE     "Impostaz. default"
1093
 	#define MSG_RESTORE_FAILSAFE     "Impostaz. default"
1221
 	#define MSG_PID_C " PID-C: "
1234
 	#define MSG_PID_C " PID-C: "
1222
 	#define MSG_ACC  " Acc:"
1235
 	#define MSG_ACC  " Acc:"
1223
 	#define MSG_VXY_JERK " Vxy-jerk: "
1236
 	#define MSG_VXY_JERK " Vxy-jerk: "
1224
-	#define MSG_VZ_JERK "Vz-jerk"
1225
-	#define MSG_VE_JERK "Ve-jerk"
1237
+	#define MSG_VZ_JERK "Vz-jerk"
1238
+	#define MSG_VE_JERK "Ve-jerk"
1226
 	#define MSG_VMAX " Vmax "
1239
 	#define MSG_VMAX " Vmax "
1227
 	#define MSG_X "x:"
1240
 	#define MSG_X "x:"
1228
 	#define MSG_Y "y:"
1241
 	#define MSG_Y "y:"
1391
 	#define MSG_PID_C "PID-C"
1404
 	#define MSG_PID_C "PID-C"
1392
 	#define MSG_ACC  "Kiihtyv"
1405
 	#define MSG_ACC  "Kiihtyv"
1393
 	#define MSG_VXY_JERK "Vxy-jerk"
1406
 	#define MSG_VXY_JERK "Vxy-jerk"
1394
-	#define MSG_VZ_JERK "Vz-jerk"
1395
-	#define MSG_VE_JERK "Ve-jerk"
1407
+	#define MSG_VZ_JERK "Vz-jerk"
1408
+	#define MSG_VE_JERK "Ve-jerk"
1396
 	#define MSG_VMAX "Vmax "
1409
 	#define MSG_VMAX "Vmax "
1397
 	#define MSG_X "x"
1410
 	#define MSG_X "x"
1398
 	#define MSG_Y "y"
1411
 	#define MSG_Y "y"
1409
 	#define MSG_RECTRACT "Veda takaisin"
1422
 	#define MSG_RECTRACT "Veda takaisin"
1410
 	#define MSG_TEMPERATURE "Lampotila"
1423
 	#define MSG_TEMPERATURE "Lampotila"
1411
 	#define MSG_MOTION "Liike"
1424
 	#define MSG_MOTION "Liike"
1425
+	#define MSG_CONTRAST "LCD contrast"
1412
 	#define MSG_STORE_EPROM "Tallenna muistiin"
1426
 	#define MSG_STORE_EPROM "Tallenna muistiin"
1413
 	#define MSG_LOAD_EPROM "Lataa muistista"
1427
 	#define MSG_LOAD_EPROM "Lataa muistista"
1414
 	#define MSG_RESTORE_FAILSAFE "Palauta oletus"
1428
 	#define MSG_RESTORE_FAILSAFE "Palauta oletus"

+ 25
- 2
Marlin/pins.h View File

856
 #if MOTHERBOARD == 64
856
 #if MOTHERBOARD == 64
857
 #define STB
857
 #define STB
858
 #endif
858
 #endif
859
-#if MOTHERBOARD == 63
859
+#if MOTHERBOARD == 63 || MOTHERBOARD == 66
860
 #define MELZI
860
 #define MELZI
861
 #endif
861
 #endif
862
 #if MOTHERBOARD == 65
862
 #if MOTHERBOARD == 65
863
 #define AZTEEG_X1
863
 #define AZTEEG_X1
864
 #endif
864
 #endif
865
-#if MOTHERBOARD == 62 || MOTHERBOARD == 63 || MOTHERBOARD == 64 || MOTHERBOARD == 65
865
+#if MOTHERBOARD == 62 || MOTHERBOARD == 63 || MOTHERBOARD == 64 || MOTHERBOARD == 65 || MOTHERBOARD == 66
866
 #undef MOTHERBOARD
866
 #undef MOTHERBOARD
867
 #define MOTHERBOARD 6
867
 #define MOTHERBOARD 6
868
 #define SANGUINOLOLU_V_1_2
868
 #define SANGUINOLOLU_V_1_2
904
 
904
 
905
 #ifdef STB
905
 #ifdef STB
906
 #define FAN_PIN            4
906
 #define FAN_PIN            4
907
+	//  Uncomment this if you have the first generation (V1.10) of STBs board
908
+#define LCD_PIN_BL         17 // LCD backlight LED
907
 #endif
909
 #endif
908
 
910
 
909
 #ifdef AZTEEG_X1
911
 #ifdef AZTEEG_X1
988
    #endif //Newpanel
990
    #endif //Newpanel
989
  #endif //Ultipanel
991
  #endif //Ultipanel
990
 
992
 
993
+ #ifdef MAKRPANEL
994
+     #define BEEPER 29
995
+     // Pins for DOGM SPI LCD Support
996
+     #define DOGLCD_A0  30
997
+     #define DOGLCD_CS  17
998
+     #define LCD_PIN_BL	28	// backlight LED on PA3
999
+     // GLCD features
1000
+     #define LCD_CONTRAST 1
1001
+     // Uncomment screen orientation
1002
+     #define LCD_SCREEN_ROT_0
1003
+       // #define LCD_SCREEN_ROT_90
1004
+       // #define LCD_SCREEN_ROT_180
1005
+       // #define LCD_SCREEN_ROT_270
1006
+     //The encoder and click button
1007
+     #define BTN_EN1 11
1008
+     #define BTN_EN2 10
1009
+     #define BTN_ENC 16  //the click switch
1010
+     //not connected to a pin
1011
+     #define SDCARDDETECT -1    
1012
+ #endif //Makrpanel
1013
+
991
 #endif
1014
 #endif
992
 
1015
 
993
 
1016
 

+ 66
- 22
Marlin/stepper.cpp View File

348
 
348
 
349
     // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
349
     // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
350
     if((out_bits & (1<<X_AXIS))!=0){
350
     if((out_bits & (1<<X_AXIS))!=0){
351
-      WRITE(X_DIR_PIN, INVERT_X_DIR);
351
+      #ifdef DUAL_X_CARRIAGE
352
+      if (active_extruder != 0)
353
+        WRITE(X2_DIR_PIN,INVERT_X_DIR);
354
+      else
355
+      #endif        
356
+        WRITE(X_DIR_PIN, INVERT_X_DIR);
352
       count_direction[X_AXIS]=-1;
357
       count_direction[X_AXIS]=-1;
353
     }
358
     }
354
     else{
359
     else{
355
-      WRITE(X_DIR_PIN, !INVERT_X_DIR);
360
+      #ifdef DUAL_X_CARRIAGE
361
+      if (active_extruder != 0)
362
+        WRITE(X2_DIR_PIN,!INVERT_X_DIR);
363
+      else
364
+      #endif        
365
+        WRITE(X_DIR_PIN, !INVERT_X_DIR);
356
       count_direction[X_AXIS]=1;
366
       count_direction[X_AXIS]=1;
357
     }
367
     }
358
     if((out_bits & (1<<Y_AXIS))!=0){
368
     if((out_bits & (1<<Y_AXIS))!=0){
372
     #endif
382
     #endif
373
       CHECK_ENDSTOPS
383
       CHECK_ENDSTOPS
374
       {
384
       {
375
-        #if defined(X_MIN_PIN) && X_MIN_PIN > -1
376
-          bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
377
-          if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
378
-            endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
379
-            endstop_x_hit=true;
380
-            step_events_completed = current_block->step_event_count;
381
-          }
382
-          old_x_min_endstop = x_min_endstop;
383
-        #endif
385
+        #ifdef DUAL_X_CARRIAGE
386
+        // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
387
+        if ((active_extruder == 0 && X_HOME_DIR == -1) || (active_extruder != 0 && X2_HOME_DIR == -1))
388
+        #endif          
389
+        {
390
+          #if defined(X_MIN_PIN) && X_MIN_PIN > -1
391
+            bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
392
+            if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
393
+              endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
394
+              endstop_x_hit=true;
395
+              step_events_completed = current_block->step_event_count;
396
+            }
397
+            old_x_min_endstop = x_min_endstop;
398
+          #endif
399
+        }
384
       }
400
       }
385
     }
401
     }
386
     else { // +direction
402
     else { // +direction
387
       CHECK_ENDSTOPS 
403
       CHECK_ENDSTOPS 
388
       {
404
       {
389
-        #if defined(X_MAX_PIN) && X_MAX_PIN > -1
390
-          bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
391
-          if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
392
-            endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
393
-            endstop_x_hit=true;
394
-            step_events_completed = current_block->step_event_count;
395
-          }
396
-          old_x_max_endstop = x_max_endstop;
397
-        #endif
405
+        #ifdef DUAL_X_CARRIAGE
406
+        // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
407
+        if ((active_extruder == 0 && X_HOME_DIR == 1) || (active_extruder != 0 && X2_HOME_DIR == 1))
408
+        #endif          
409
+        {
410
+          #if defined(X_MAX_PIN) && X_MAX_PIN > -1
411
+            bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
412
+            if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
413
+              endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
414
+              endstop_x_hit=true;
415
+              step_events_completed = current_block->step_event_count;
416
+            }
417
+            old_x_max_endstop = x_max_endstop;
418
+          #endif
419
+        }  
398
       }
420
       }
399
     }
421
     }
400
 
422
 
507
 
529
 
508
         counter_x += current_block->steps_x;
530
         counter_x += current_block->steps_x;
509
         if (counter_x > 0) {
531
         if (counter_x > 0) {
510
-          WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
532
+          #ifdef DUAL_X_CARRIAGE
533
+          if (active_extruder != 0)
534
+            WRITE(X2_STEP_PIN,!INVERT_X_STEP_PIN);
535
+          else
536
+          #endif        
537
+            WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
511
           counter_x -= current_block->step_event_count;
538
           counter_x -= current_block->step_event_count;
512
           count_position[X_AXIS]+=count_direction[X_AXIS];   
539
           count_position[X_AXIS]+=count_direction[X_AXIS];   
513
-          WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
540
+          #ifdef DUAL_X_CARRIAGE
541
+          if (active_extruder != 0)
542
+            WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
543
+          else
544
+          #endif        
545
+            WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
514
         }
546
         }
515
   
547
   
516
         counter_y += current_block->steps_y;
548
         counter_y += current_block->steps_y;
685
   #if defined(X_DIR_PIN) && X_DIR_PIN > -1
717
   #if defined(X_DIR_PIN) && X_DIR_PIN > -1
686
     SET_OUTPUT(X_DIR_PIN);
718
     SET_OUTPUT(X_DIR_PIN);
687
   #endif
719
   #endif
720
+  #if defined(X2_DIR_PIN) && X2_DIR_PIN > -1
721
+    SET_OUTPUT(X2_DIR_PIN);
722
+  #endif
688
   #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 
723
   #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 
689
     SET_OUTPUT(Y_DIR_PIN);
724
     SET_OUTPUT(Y_DIR_PIN);
690
   #endif
725
   #endif
711
     SET_OUTPUT(X_ENABLE_PIN);
746
     SET_OUTPUT(X_ENABLE_PIN);
712
     if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
747
     if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
713
   #endif
748
   #endif
749
+  #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
750
+    SET_OUTPUT(X2_ENABLE_PIN);
751
+    if(!X_ENABLE_ON) WRITE(X2_ENABLE_PIN,HIGH);
752
+  #endif
714
   #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
753
   #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
715
     SET_OUTPUT(Y_ENABLE_PIN);
754
     SET_OUTPUT(Y_ENABLE_PIN);
716
     if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
755
     if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
788
     WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
827
     WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
789
     disable_x();
828
     disable_x();
790
   #endif  
829
   #endif  
830
+  #if defined(X2_STEP_PIN) && (X2_STEP_PIN > -1) 
831
+    SET_OUTPUT(X2_STEP_PIN);
832
+    WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
833
+    disable_x();
834
+  #endif  
791
   #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) 
835
   #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) 
792
     SET_OUTPUT(Y_STEP_PIN);
836
     SET_OUTPUT(Y_STEP_PIN);
793
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);
837
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);

+ 122
- 52
Marlin/ultralcd.cpp View File

8
 #include "stepper.h"
8
 #include "stepper.h"
9
 #include "ConfigurationStore.h"
9
 #include "ConfigurationStore.h"
10
 
10
 
11
+int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
12
+
11
 /* Configuration settings */
13
 /* Configuration settings */
12
 int plaPreheatHotendTemp;
14
 int plaPreheatHotendTemp;
13
 int plaPreheatHPBTemp;
15
 int plaPreheatHPBTemp;
48
 static void lcd_control_temperature_preheat_pla_settings_menu();
50
 static void lcd_control_temperature_preheat_pla_settings_menu();
49
 static void lcd_control_temperature_preheat_abs_settings_menu();
51
 static void lcd_control_temperature_preheat_abs_settings_menu();
50
 static void lcd_control_motion_menu();
52
 static void lcd_control_motion_menu();
53
+#ifdef DOGLCD
54
+static void lcd_set_contrast();
55
+#endif
51
 static void lcd_control_retract_menu();
56
 static void lcd_control_retract_menu();
52
 static void lcd_sdcard_menu();
57
 static void lcd_sdcard_menu();
53
 
58
 
123
 #ifndef REPRAPWORLD_KEYPAD
128
 #ifndef REPRAPWORLD_KEYPAD
124
 volatile uint8_t buttons;//Contains the bits of the currently pressed buttons.
129
 volatile uint8_t buttons;//Contains the bits of the currently pressed buttons.
125
 #else
130
 #else
126
-volatile uint16_t buttons;//Contains the bits of the currently pressed buttons (extended).
131
+volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad shiftregister values
127
 #endif
132
 #endif
128
-
129
 uint8_t currentMenuViewOffset;              /* scroll offset in the current menu */
133
 uint8_t currentMenuViewOffset;              /* scroll offset in the current menu */
130
 uint32_t blocking_enc;
134
 uint32_t blocking_enc;
131
 uint8_t lastEncoderBits;
135
 uint8_t lastEncoderBits;
132
-int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
133
 uint32_t encoderPosition;
136
 uint32_t encoderPosition;
134
 #if (SDCARDDETECT > 0)
137
 #if (SDCARDDETECT > 0)
135
 bool lcd_oldcardstatus;
138
 bool lcd_oldcardstatus;
174
     }
177
     }
175
 
178
 
176
     // Dead zone at 100% feedrate
179
     // Dead zone at 100% feedrate
177
-    if (feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100 ||
178
-            feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100)
180
+    if ((feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100) ||
181
+            (feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100))
179
     {
182
     {
180
         encoderPosition = 0;
183
         encoderPosition = 0;
181
         feedmultiply = 100;
184
         feedmultiply = 100;
364
     if (encoderPosition != 0)
367
     if (encoderPosition != 0)
365
     {
368
     {
366
         current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
369
         current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
367
-        if (current_position[X_AXIS] < X_MIN_POS)
370
+        if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
368
             current_position[X_AXIS] = X_MIN_POS;
371
             current_position[X_AXIS] = X_MIN_POS;
369
-        if (current_position[X_AXIS] > X_MAX_POS)
372
+        if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS)
370
             current_position[X_AXIS] = X_MAX_POS;
373
             current_position[X_AXIS] = X_MAX_POS;
371
         encoderPosition = 0;
374
         encoderPosition = 0;
372
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
375
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
388
     if (encoderPosition != 0)
391
     if (encoderPosition != 0)
389
     {
392
     {
390
         current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
393
         current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
391
-        if (current_position[Y_AXIS] < Y_MIN_POS)
394
+        if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
392
             current_position[Y_AXIS] = Y_MIN_POS;
395
             current_position[Y_AXIS] = Y_MIN_POS;
393
-        if (current_position[Y_AXIS] > Y_MAX_POS)
396
+        if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS)
394
             current_position[Y_AXIS] = Y_MAX_POS;
397
             current_position[Y_AXIS] = Y_MAX_POS;
395
         encoderPosition = 0;
398
         encoderPosition = 0;
396
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
399
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
412
     if (encoderPosition != 0)
415
     if (encoderPosition != 0)
413
     {
416
     {
414
         current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
417
         current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
415
-        if (current_position[Z_AXIS] < Z_MIN_POS)
418
+        if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
416
             current_position[Z_AXIS] = Z_MIN_POS;
419
             current_position[Z_AXIS] = Z_MIN_POS;
417
-        if (current_position[Z_AXIS] > Z_MAX_POS)
420
+        if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS)
418
             current_position[Z_AXIS] = Z_MAX_POS;
421
             current_position[Z_AXIS] = Z_MAX_POS;
419
         encoderPosition = 0;
422
         encoderPosition = 0;
420
-        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 60, active_extruder);
423
+        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);
421
         lcdDrawUpdate = 1;
424
         lcdDrawUpdate = 1;
422
     }
425
     }
423
     if (lcdDrawUpdate)
426
     if (lcdDrawUpdate)
499
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
502
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
500
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
503
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
501
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
504
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
505
+#ifdef DOGLCD
506
+//    MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
507
+    MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
508
+#endif
502
 #ifdef FWRETRACT
509
 #ifdef FWRETRACT
503
     MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
510
     MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
504
 #endif
511
 #endif
610
     END_MENU();
617
     END_MENU();
611
 }
618
 }
612
 
619
 
620
+#ifdef DOGLCD
621
+static void lcd_set_contrast()
622
+{
623
+    if (encoderPosition != 0)
624
+    {
625
+        lcd_contrast -= encoderPosition;
626
+        if (lcd_contrast < 0) lcd_contrast = 0;
627
+        else if (lcd_contrast > 63) lcd_contrast = 63;
628
+        encoderPosition = 0;
629
+        lcdDrawUpdate = 1;
630
+        u8g.setContrast(lcd_contrast);
631
+    }
632
+    if (lcdDrawUpdate)
633
+    {
634
+        lcd_implementation_drawedit(PSTR("Contrast"), itostr2(lcd_contrast));
635
+    }
636
+    if (LCD_CLICKED)
637
+    {
638
+        lcd_quick_feedback();
639
+        currentMenu = lcd_control_menu;
640
+        encoderPosition = 0;
641
+    }
642
+}
643
+#endif
644
+
613
 #ifdef FWRETRACT
645
 #ifdef FWRETRACT
614
 static void lcd_control_retract_menu()
646
 static void lcd_control_retract_menu()
615
 {
647
 {
743
 menu_edit_type(unsigned long, long5, ftostr5, 0.01)
775
 menu_edit_type(unsigned long, long5, ftostr5, 0.01)
744
 
776
 
745
 #ifdef REPRAPWORLD_KEYPAD
777
 #ifdef REPRAPWORLD_KEYPAD
746
-    static void reprapworld_keypad_move_y_down() {
747
-        encoderPosition = 1;
748
-        move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
749
-        lcd_move_y();
750
-    }
751
-    static void reprapworld_keypad_move_y_up() {
752
-        encoderPosition = -1;
753
-        move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
754
-        lcd_move_y();
755
-    }
756
-    static void reprapworld_keypad_move_home() {
757
-        //enquecommand_P((PSTR("G28"))); // move all axis home
758
-        // TODO gregor: move all axis home, i have currently only one axis on my prusa i3
759
-        enquecommand_P((PSTR("G28 Y")));
760
-    }
778
+	static void reprapworld_keypad_move_z_up() {
779
+    encoderPosition = 1;
780
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
781
+		lcd_move_z();
782
+  }
783
+	static void reprapworld_keypad_move_z_down() {
784
+    encoderPosition = -1;
785
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
786
+		lcd_move_z();
787
+  }
788
+	static void reprapworld_keypad_move_x_left() {
789
+    encoderPosition = -1;
790
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
791
+		lcd_move_x();
792
+  }
793
+	static void reprapworld_keypad_move_x_right() {
794
+    encoderPosition = 1;
795
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
796
+		lcd_move_x();
797
+	}
798
+	static void reprapworld_keypad_move_y_down() {
799
+    encoderPosition = 1;
800
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
801
+		lcd_move_y();
802
+	}
803
+	static void reprapworld_keypad_move_y_up() {
804
+		encoderPosition = -1;
805
+		move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
806
+    lcd_move_y();
807
+	}
808
+	static void reprapworld_keypad_move_home() {
809
+		enquecommand_P((PSTR("G28"))); // move all axis home
810
+	}
761
 #endif
811
 #endif
762
 
812
 
763
 /** End of menus **/
813
 /** End of menus **/
884
     if (lcd_next_update_millis < millis())
934
     if (lcd_next_update_millis < millis())
885
     {
935
     {
886
 #ifdef ULTIPANEL
936
 #ifdef ULTIPANEL
887
-        #ifdef REPRAPWORLD_KEYPAD
888
-        if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) {
889
-            reprapworld_keypad_move_y_down();
890
-        }
891
-        if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) {
892
-            reprapworld_keypad_move_y_up();
893
-        }
894
-        if (REPRAPWORLD_KEYPAD_MOVE_HOME) {
895
-            reprapworld_keypad_move_home();
896
-        }
897
-        #endif
937
+		#ifdef REPRAPWORLD_KEYPAD
938
+        	if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) {
939
+        		reprapworld_keypad_move_z_up();
940
+        	}
941
+        	if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) {
942
+        		reprapworld_keypad_move_z_down();
943
+        	}
944
+        	if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) {
945
+        		reprapworld_keypad_move_x_left();
946
+        	}
947
+        	if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) {
948
+        		reprapworld_keypad_move_x_right();
949
+        	}
950
+        	if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) {
951
+        		reprapworld_keypad_move_y_down();
952
+        	}
953
+        	if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) {
954
+        		reprapworld_keypad_move_y_up();
955
+        	}
956
+        	if (REPRAPWORLD_KEYPAD_MOVE_HOME) {
957
+        		reprapworld_keypad_move_home();
958
+        	}
959
+		#endif
898
         if (encoderDiff)
960
         if (encoderDiff)
899
         {
961
         {
900
             lcdDrawUpdate = 1;
962
             lcdDrawUpdate = 1;
969
     lcd_status_message_level = 0;
1031
     lcd_status_message_level = 0;
970
 }
1032
 }
971
 
1033
 
1034
+#ifdef DOGLCD
1035
+void lcd_setcontrast(uint8_t value)
1036
+{
1037
+    lcd_contrast = value & 63;
1038
+    u8g.setContrast(lcd_contrast);	
1039
+}
1040
+#endif
1041
+
972
 #ifdef ULTIPANEL
1042
 #ifdef ULTIPANEL
973
 /* Warning: This function is called from interrupt context */
1043
 /* Warning: This function is called from interrupt context */
974
 void lcd_buttons_update()
1044
 void lcd_buttons_update()
980
   #if BTN_ENC > 0
1050
   #if BTN_ENC > 0
981
     if((blocking_enc<millis()) && (READ(BTN_ENC)==0))
1051
     if((blocking_enc<millis()) && (READ(BTN_ENC)==0))
982
         newbutton |= EN_C;
1052
         newbutton |= EN_C;
983
-  #endif      
984
-  #ifdef REPRAPWORLD_KEYPAD
985
-    // for the reprapworld_keypad
986
-    uint8_t newbutton_reprapworld_keypad=0;
987
-    WRITE(SHIFT_LD,LOW);
988
-    WRITE(SHIFT_LD,HIGH);
989
-    for(int8_t i=0;i<8;i++) {
990
-        newbutton_reprapworld_keypad = newbutton_reprapworld_keypad>>1;
991
-        if(READ(SHIFT_OUT))
992
-            newbutton_reprapworld_keypad|=(1<<7);
993
-        WRITE(SHIFT_CLK,HIGH);
994
-        WRITE(SHIFT_CLK,LOW);
995
-    }
996
-    newbutton |= ((~newbutton_reprapworld_keypad) << REPRAPWORLD_BTN_OFFSET); //invert it, because a pressed switch produces a logical 0
997
   #endif
1053
   #endif
998
     buttons = newbutton;
1054
     buttons = newbutton;
1055
+    #ifdef REPRAPWORLD_KEYPAD
1056
+      // for the reprapworld_keypad
1057
+      uint8_t newbutton_reprapworld_keypad=0;
1058
+      WRITE(SHIFT_LD,LOW);
1059
+      WRITE(SHIFT_LD,HIGH);
1060
+      for(int8_t i=0;i<8;i++) {
1061
+          newbutton_reprapworld_keypad = newbutton_reprapworld_keypad>>1;
1062
+          if(READ(SHIFT_OUT))
1063
+              newbutton_reprapworld_keypad|=(1<<7);
1064
+          WRITE(SHIFT_CLK,HIGH);
1065
+          WRITE(SHIFT_CLK,LOW);
1066
+      }
1067
+      buttons_reprapworld_keypad=~newbutton_reprapworld_keypad; //invert it, because a pressed switch produces a logical 0
1068
+	#endif
999
 #else   //read it from the shift register
1069
 #else   //read it from the shift register
1000
     uint8_t newbutton=0;
1070
     uint8_t newbutton=0;
1001
     WRITE(SHIFT_LD,LOW);
1071
     WRITE(SHIFT_LD,LOW);

+ 49
- 1
Marlin/ultralcd.h View File

11
   void lcd_setstatuspgm(const char* message);
11
   void lcd_setstatuspgm(const char* message);
12
   void lcd_setalertstatuspgm(const char* message);
12
   void lcd_setalertstatuspgm(const char* message);
13
   void lcd_reset_alert_level();
13
   void lcd_reset_alert_level();
14
-  
14
+
15
+#ifdef DOGLCD
16
+  extern int lcd_contrast;
17
+  void lcd_setcontrast(uint8_t value);
18
+#endif
19
+
15
   static unsigned char blink = 0;	// Variable for visualisation of fan rotation in GLCD
20
   static unsigned char blink = 0;	// Variable for visualisation of fan rotation in GLCD
16
 
21
 
17
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
22
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
22
 
27
 
23
   #ifdef ULTIPANEL
28
   #ifdef ULTIPANEL
24
   void lcd_buttons_update();
29
   void lcd_buttons_update();
30
+  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
31
+  #ifdef REPRAPWORLD_KEYPAD
32
+    extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shiftregister values
33
+  #endif
25
   #else
34
   #else
26
   FORCE_INLINE void lcd_buttons_update() {}
35
   FORCE_INLINE void lcd_buttons_update() {}
27
   #endif
36
   #endif
37
   void lcd_buzz(long duration,uint16_t freq);
46
   void lcd_buzz(long duration,uint16_t freq);
38
   bool lcd_clicked();
47
   bool lcd_clicked();
39
 
48
 
49
+  #ifdef NEWPANEL
50
+    #define EN_C (1<<BLEN_C)
51
+    #define EN_B (1<<BLEN_B)
52
+    #define EN_A (1<<BLEN_A)
53
+
54
+    #define LCD_CLICKED (buttons&EN_C)
55
+    #ifdef REPRAPWORLD_KEYPAD
56
+  	  #define EN_REPRAPWORLD_KEYPAD_F3 (1<<BLEN_REPRAPWORLD_KEYPAD_F3)
57
+  	  #define EN_REPRAPWORLD_KEYPAD_F2 (1<<BLEN_REPRAPWORLD_KEYPAD_F2)
58
+  	  #define EN_REPRAPWORLD_KEYPAD_F1 (1<<BLEN_REPRAPWORLD_KEYPAD_F1)
59
+  	  #define EN_REPRAPWORLD_KEYPAD_UP (1<<BLEN_REPRAPWORLD_KEYPAD_UP)
60
+  	  #define EN_REPRAPWORLD_KEYPAD_RIGHT (1<<BLEN_REPRAPWORLD_KEYPAD_RIGHT)
61
+  	  #define EN_REPRAPWORLD_KEYPAD_MIDDLE (1<<BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
62
+  	  #define EN_REPRAPWORLD_KEYPAD_DOWN (1<<BLEN_REPRAPWORLD_KEYPAD_DOWN)
63
+  	  #define EN_REPRAPWORLD_KEYPAD_LEFT (1<<BLEN_REPRAPWORLD_KEYPAD_LEFT)
64
+
65
+  	  #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
66
+  	  #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
67
+  	  #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
68
+  	  #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
69
+  	  #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
70
+  	  #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
71
+  	  #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
72
+  	  #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
73
+    #endif //REPRAPWORLD_KEYPAD
74
+  #else
75
+    //atomatic, do not change
76
+    #define B_LE (1<<BL_LE)
77
+    #define B_UP (1<<BL_UP)
78
+    #define B_MI (1<<BL_MI)
79
+    #define B_DW (1<<BL_DW)
80
+    #define B_RI (1<<BL_RI)
81
+    #define B_ST (1<<BL_ST)
82
+    #define EN_B (1<<BLEN_B)
83
+    #define EN_A (1<<BLEN_A)
84
+    
85
+    #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
86
+  #endif//NEWPANEL
87
+
40
 #else //no lcd
88
 #else //no lcd
41
   FORCE_INLINE void lcd_update() {}
89
   FORCE_INLINE void lcd_update() {}
42
   FORCE_INLINE void lcd_init() {}
90
   FORCE_INLINE void lcd_init() {}

+ 12
- 10
README.md View File

41
 *   Heater power reporting. Useful for PID monitoring.
41
 *   Heater power reporting. Useful for PID monitoring.
42
 *   PID tuning
42
 *   PID tuning
43
 *   CoreXY kinematics (www.corexy.com/theory.html)
43
 *   CoreXY kinematics (www.corexy.com/theory.html)
44
+*   Delta kinematics
45
+*   Dual X-carriage support for multiple extruder systems
44
 *   Configurable serial port to support connection of wireless adaptors.
46
 *   Configurable serial port to support connection of wireless adaptors.
45
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
47
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
46
 *   RC Servo Support, specify angle or duration for continuous rotation servos.
48
 *   RC Servo Support, specify angle or duration for continuous rotation servos.
142
 *  G91 - Use Relative Coordinates
144
 *  G91 - Use Relative Coordinates
143
 *  G92 - Set current position to cordinates given
145
 *  G92 - Set current position to cordinates given
144
 
146
 
145
-RepRap M Codes
147
+M Codes
146
 *  M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
148
 *  M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
147
 *  M1   - Same as M0
149
 *  M1   - Same as M0
148
-*  M104 - Set extruder target temp
149
-*  M105 - Read current temp
150
-*  M106 - Fan on
151
-*  M107 - Fan off
152
-*  M109 - Wait for extruder current temp to reach target temp.
153
-*  M114 - Display current position
154
-
155
-Custom M Codes
156
 *  M17  - Enable/Power all stepper motors
150
 *  M17  - Enable/Power all stepper motors
157
 *  M18  - Disable all stepper motors; same as M84
151
 *  M18  - Disable all stepper motors; same as M84
158
 *  M20  - List SD card
152
 *  M20  - List SD card
167
 *  M29  - Stop SD write
161
 *  M29  - Stop SD write
168
 *  M30  - Delete file from SD (M30 filename.g)
162
 *  M30  - Delete file from SD (M30 filename.g)
169
 *  M31  - Output time since last M109 or SD card start to serial
163
 *  M31  - Output time since last M109 or SD card start to serial
164
+*  M32  - Select file and start SD print (Can be used when printing from SD card)
170
 *  M42  - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
165
 *  M42  - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
171
 *  M80  - Turn on Power Supply
166
 *  M80  - Turn on Power Supply
172
 *  M81  - Turn off Power Supply
167
 *  M81  - Turn off Power Supply
175
 *  M84  - Disable steppers until next move, or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
170
 *  M84  - Disable steppers until next move, or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
176
 *  M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
171
 *  M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
177
 *  M92  - Set axis_steps_per_unit - same syntax as G92
172
 *  M92  - Set axis_steps_per_unit - same syntax as G92
173
+*  M104 - Set extruder target temp
174
+*  M105 - Read current temp
175
+*  M106 - Fan on
176
+*  M107 - Fan off
177
+*  M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
178
+*         Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
178
 *  M114 - Output current position to serial port
179
 *  M114 - Output current position to serial port
179
 *  M115 - Capabilities string
180
 *  M115 - Capabilities string
180
 *  M117 - display message
181
 *  M117 - display message
184
 *  M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
185
 *  M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
185
 *  M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
186
 *  M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
186
 *  M140 - Set bed target temp
187
 *  M140 - Set bed target temp
187
-*  M190 - Wait for bed current temp to reach target temp.
188
+*  M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
189
+*         Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
188
 *  M200 - Set filament diameter
190
 *  M200 - Set filament diameter
189
 *  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
191
 *  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
190
 *  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
192
 *  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!

Loading…
Cancel
Save