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,6 +37,7 @@
37 37
 // 63 = Melzi
38 38
 // 64 = STB V1.1
39 39
 // 65 = Azteeg X1
40
+// 66 = Melzi with ATmega1284 (MaKr3d version)
40 41
 // 7  = Ultimaker
41 42
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
42 43
 // 77 = 3Drag Controller
@@ -126,6 +127,7 @@
126 127
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
127 128
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
128 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 132
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
131 133
 //                          (but gives greater accuracy and more stable PID)
@@ -258,12 +260,12 @@
258 260
 
259 261
 #ifndef ENDSTOPPULLUPS
260 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 269
 #endif
268 270
 
269 271
 #ifdef ENDSTOPPULLUPS
@@ -394,6 +396,10 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
394 396
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
395 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 403
 // The RepRapDiscount Smart Controller (white PCB)
398 404
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
399 405
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER
@@ -419,6 +425,14 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
419 425
 //#define RA_CONTROL_PANEL
420 426
 
421 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 436
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
423 437
  #define DOGLCD
424 438
  #define U8GLIB_ST7920
@@ -505,6 +519,13 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
505 519
   #endif
506 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 529
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
509 530
 //#define FAST_PWM_FAN
510 531
 

+ 12
- 1
Marlin/ConfigurationStore.cpp View File

@@ -37,7 +37,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
37 37
 // the default values are used whenever there is a change to the data, to prevent
38 38
 // wrong data being written to the variables.
39 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 42
 #ifdef EEPROM_SETTINGS
43 43
 void Config_StoreSettings() 
@@ -78,6 +78,10 @@ void Config_StoreSettings()
78 78
     EEPROM_WRITE_VAR(i,dummy);
79 79
     EEPROM_WRITE_VAR(i,dummy);
80 80
   #endif
81
+  #ifndef DOGLCD
82
+    int lcd_contrast = 32;
83
+  #endif
84
+  EEPROM_WRITE_VAR(i,lcd_contrast);
81 85
   char ver2[4]=EEPROM_VERSION;
82 86
   i=EEPROM_OFFSET;
83 87
   EEPROM_WRITE_VAR(i,ver2); // validate data
@@ -198,6 +202,10 @@ void Config_RetrieveSettings()
198 202
         EEPROM_READ_VAR(i,Kp);
199 203
         EEPROM_READ_VAR(i,Ki);
200 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 210
 		// Call updatePID (similar to when we have processed M301)
203 211
 		updatePID();
@@ -244,6 +252,9 @@ void Config_ResetDefault()
244 252
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
245 253
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
246 254
 #endif
255
+#ifdef DOGLCD
256
+    lcd_contrast = DEFAULT_LCD_CONTRAST;
257
+#endif
247 258
 #ifdef PIDTEMP
248 259
     Kp = DEFAULT_Kp;
249 260
     Ki = scalePID_i(DEFAULT_Ki);

+ 25
- 6
Marlin/Configuration_adv.h View File

@@ -18,12 +18,6 @@
18 18
 //#define WATCH_TEMP_PERIOD 40000 //40 seconds
19 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 21
 #ifdef PIDTEMP
28 22
   // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
29 23
   // if Kc is choosen well, the additional required power due to increased melting should be compensated.
@@ -152,6 +146,31 @@
152 146
   #define EXTRUDERS 1
153 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 174
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
156 175
 #define X_HOME_RETRACT_MM 5 
157 176
 #define Y_HOME_RETRACT_MM 5 

+ 6
- 0
Marlin/Makefile View File

@@ -114,6 +114,12 @@ MCU              ?= atmega644p
114 114
 else ifeq  ($(HARDWARE_MOTHERBOARD),63)
115 115
 HARDWARE_VARIANT ?= Sanguino
116 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 124
 #Ultimaker
119 125
 else ifeq  ($(HARDWARE_MOTHERBOARD),7)

+ 5
- 1
Marlin/Marlin.h View File

@@ -96,7 +96,11 @@ void process_commands();
96 96
 
97 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 104
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
101 105
   #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
102 106
 #else

+ 148
- 25
Marlin/Marlin_main.cpp View File

@@ -67,17 +67,9 @@
67 67
 // G91 - Use Relative Coordinates
68 68
 // G92 - Set current position to cordinates given
69 69
 
70
-//RepRap M Codes
70
+// M Codes
71 71
 // M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
72 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 73
 // M17  - Enable/Power all stepper motors
82 74
 // M18  - Disable all stepper motors; same as M84
83 75
 // M20  - List SD card
@@ -92,6 +84,7 @@
92 84
 // M29  - Stop SD write
93 85
 // M30  - Delete file from SD (M30 filename.g)
94 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 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 89
 // M80  - Turn on Power Supply
97 90
 // M81  - Turn off Power Supply
@@ -101,6 +94,12 @@
101 94
 //        or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
102 95
 // M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
103 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 103
 // M114 - Output current position to serial port
105 104
 // M115 - Capabilities string
106 105
 // M117 - display message
@@ -110,7 +109,8 @@
110 109
 // M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
111 110
 // M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
112 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 114
 // M200 - Set filament diameter
115 115
 // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
116 116
 // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
@@ -125,6 +125,7 @@
125 125
 // M220 S<factor in percent>- set speed factor override percentage
126 126
 // M221 S<factor in percent>- set extrude factor override percentage
127 127
 // M240 - Trigger a camera to take a photograph
128
+// M250 - Set LCD contrast C<contrast value> (value 0..63)
128 129
 // M280 - set servo position absolute. P: servo index, S: angle or microseconds
129 130
 // M300 - Play beepsound S<frequency Hz> P<duration ms>
130 131
 // M301 - Set PID parameters P I and D
@@ -245,6 +246,9 @@ bool Stopped=false;
245 246
   Servo servos[NUM_SERVOS];
246 247
 #endif
247 248
 
249
+bool CooldownNoWait = true;
250
+bool target_direction;
251
+
248 252
 //===========================================================================
249 253
 //=============================ROUTINES=============================
250 254
 //===========================================================================
@@ -425,6 +429,7 @@ void setup()
425 429
   servo_init();
426 430
 
427 431
   lcd_init();
432
+  _delay_ms(1000);	// wait 1sec to display the splash screen
428 433
   
429 434
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
430 435
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
@@ -676,7 +681,44 @@ XYZ_CONSTS_FROM_CONFIG(float, max_length,      MAX_LENGTH);
676 681
 XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
677 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 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 722
   current_position[axis] = base_home_pos(axis) + add_homeing[axis];
681 723
   min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
682 724
   max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
@@ -685,30 +727,38 @@ static void axis_is_at_home(int axis) {
685 727
 static void homeaxis(int axis) {
686 728
 #define HOMEAXIS_DO(LETTER) \
687 729
   ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
730
+
688 731
   if (axis==X_AXIS ? HOMEAXIS_DO(X) :
689 732
       axis==Y_AXIS ? HOMEAXIS_DO(Y) :
690 733
       axis==Z_AXIS ? HOMEAXIS_DO(Z) :
691 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 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 746
     #endif
697
-
747
+      
698 748
     current_position[axis] = 0;
699 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 751
     feedrate = homing_feedrate[axis];
702 752
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
703 753
     st_synchronize();
704 754
 
705 755
     current_position[axis] = 0;
706 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 758
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
709 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 762
     feedrate = homing_feedrate[axis]/2 ;
713 763
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
714 764
     st_synchronize();
@@ -719,8 +769,10 @@ static void homeaxis(int axis) {
719 769
     endstops_hit_on_purpose();
720 770
 
721 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 776
     #endif
725 777
   }
726 778
 }
@@ -846,7 +898,7 @@ void process_commands()
846 898
 
847 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 903
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
852 904
       if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
@@ -859,8 +911,14 @@ void process_commands()
859 911
       {
860 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 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 922
         feedrate = homing_feedrate[X_AXIS];
865 923
         if(homing_feedrate[Y_AXIS]<feedrate)
866 924
           feedrate =homing_feedrate[Y_AXIS];
@@ -885,6 +943,13 @@ void process_commands()
885 943
 
886 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 953
         HOMEAXIS(X);
889 954
       }
890 955
 
@@ -917,7 +982,7 @@ void process_commands()
917 982
         }
918 983
       }
919 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 987
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
923 988
         enable_endstops(false);
@@ -1057,6 +1122,19 @@ void process_commands()
1057 1122
         card.removeFile(strchr_pointer + 4);
1058 1123
       }
1059 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 1138
     case 928: //M928 - Start SD write
1061 1139
       starpos = (strchr(strchr_pointer + 5,'*'));
1062 1140
       if(starpos != NULL){
@@ -1159,7 +1237,13 @@ void process_commands()
1159 1237
       #ifdef AUTOTEMP
1160 1238
         autotemp_enabled=false;
1161 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 1247
       #ifdef AUTOTEMP
1164 1248
         if (code_seen('S')) autotemp_min=code_value();
1165 1249
         if (code_seen('B')) autotemp_max=code_value();
@@ -1174,7 +1258,7 @@ void process_commands()
1174 1258
       codenum = millis();
1175 1259
 
1176 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 1263
       #ifdef TEMP_RESIDENCY_TIME
1180 1264
         long residencyStart;
@@ -1230,9 +1314,18 @@ void process_commands()
1230 1314
     case 190: // M190 - Wait for bed heater to reach target.
1231 1315
     #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
1232 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 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 1330
           if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
1238 1331
           {
@@ -1716,6 +1809,18 @@ void process_commands()
1716 1809
       #endif
1717 1810
      }
1718 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 1824
     #ifdef PREVENT_DANGEROUS_EXTRUDE
1720 1825
     case 302: // allow cold extrudes, or set the minimum extrude temperature
1721 1826
     {
@@ -1973,6 +2078,20 @@ void process_commands()
1973 2078
       if(tmp_extruder != active_extruder) {
1974 2079
         // Save current position to return to after applying extruder offset
1975 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 2095
         // Offset extruder (only by XY)
1977 2096
         int i;
1978 2097
         for(i = 0; i < 2; i++) {
@@ -1982,6 +2101,7 @@ void process_commands()
1982 2101
         }
1983 2102
         // Set the new active extruder and position
1984 2103
         active_extruder = tmp_extruder;
2104
+      #endif //else DUAL_X_CARRIAGE
1985 2105
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1986 2106
         // Move to the old position if 'F' was in the parameters
1987 2107
         if(make_move && Stopped == false) {
@@ -2226,6 +2346,9 @@ void controllerFan()
2226 2346
        || !READ(E2_ENABLE_PIN)
2227 2347
     #endif
2228 2348
     #if EXTRUDER > 1
2349
+      #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
2350
+       || !READ(X2_ENABLE_PIN)
2351
+      #endif
2229 2352
        || !READ(E1_ENABLE_PIN)
2230 2353
     #endif
2231 2354
        || !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...

+ 0
- 1
Marlin/cardreader.cpp View File

@@ -206,7 +206,6 @@ void CardReader::startFileprint()
206 206
   if(cardOK)
207 207
   {
208 208
     sdprinting = true;
209
-    
210 209
   }
211 210
 }
212 211
 

+ 14
- 2
Marlin/dogm_lcd_implementation.h View File

@@ -74,16 +74,28 @@
74 74
 
75 75
 #define FONT_STATUSMENU	u8g_font_6x9
76 76
 
77
+int lcd_contrast;
78
+
77 79
 // LCD selection
78 80
 #ifdef U8GLIB_ST7920
79 81
 //U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
80 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 86
 #else
87
+// for regular DOGM128 display with HW-SPI
82 88
 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);	// HW-SPI Com: CS, A0
83 89
 #endif
84 90
 
85 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 99
 	//  Uncomment this if you have the first generation (V1.10) of STBs board
88 100
 	//  pinMode(17, OUTPUT);	// Enable LCD backlight
89 101
 	//  digitalWrite(17, HIGH);
@@ -117,14 +129,14 @@ static void lcd_implementation_init()
117 129
 			u8g.setFont(u8g_font_6x10_marlin);
118 130
 			u8g.drawStr(62,10,"MARLIN"); 
119 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 133
 			u8g.setFont(u8g_font_6x10_marlin);
122 134
 			u8g.drawStr(62,28,"by ErikZalm");
123 135
 			u8g.drawStr(62,41,"DOGM128 LCD");
124 136
 			u8g.setFont(u8g_font_5x8);
125 137
 			u8g.drawStr(62,48,"enhancements");
126 138
 			u8g.setFont(u8g_font_5x8);
127
-			u8g.drawStr(62,55,"by STB");
139
+			u8g.drawStr(62,55,"by STB, MM");
128 140
 			u8g.drawStr(62,61,"uses u");
129 141
 			u8g.drawStr90(92,57,"8");
130 142
 			u8g.drawStr(100,61,"glib");

+ 111
- 97
Marlin/language.h View File

@@ -84,9 +84,9 @@
84 84
 	#define MSG_PID_D "PID-D"
85 85
 	#define MSG_PID_C "PID-C"
86 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 90
 	#define MSG_VMAX "Vmax "
91 91
 	#define MSG_X "x"
92 92
 	#define MSG_Y "y"
@@ -103,6 +103,7 @@
103 103
 	#define MSG_RECTRACT "Rectract"
104 104
 	#define MSG_TEMPERATURE "Temperature"
105 105
 	#define MSG_MOTION "Motion"
106
+	#define MSG_CONTRAST "LCD contrast"
106 107
 	#define MSG_STORE_EPROM "Store memory"
107 108
 	#define MSG_LOAD_EPROM "Load memory"
108 109
 	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
@@ -246,8 +247,8 @@
246 247
 	#define MSG_PID_C "PID-C"
247 248
 	#define MSG_ACC  "Acc"
248 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 252
 	#define MSG_VMAX "Vmax"
252 253
 	#define MSG_X "x"
253 254
 	#define MSG_Y "y"
@@ -264,6 +265,7 @@
264 265
 	#define MSG_RECTRACT "Wycofanie"
265 266
 	#define MSG_TEMPERATURE "Temperatura"
266 267
 	#define MSG_MOTION "Ruch"
268
+	#define MSG_CONTRAST "LCD contrast"
267 269
 	#define MSG_STORE_EPROM "Zapisz w pamieci"
268 270
 	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
269 271
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
@@ -409,8 +411,8 @@
409 411
 #define MSG_PID_C " PID-C: "
410 412
 #define MSG_ACC " Acc:"
411 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 416
 #define MSG_VMAX " Vmax "
415 417
 #define MSG_X "x:"
416 418
 #define MSG_Y "y:"
@@ -429,6 +431,7 @@
429 431
 #define MSG_TEMPERATURE_WIDE " Temperature \x7E"
430 432
 #define MSG_TEMPERATURE_RTN " Temperature \003"
431 433
 #define MSG_MOTION_WIDE " Mouvement \x7E"
434
+	#define MSG_CONTRAST "LCD contrast"
432 435
 #define MSG_STORE_EPROM " Sauvegarder memoire"
433 436
 #define MSG_LOAD_EPROM " Lire memoire"
434 437
 #define MSG_RESTORE_FAILSAFE " Restaurer memoire"
@@ -541,7 +544,7 @@
541 544
 
542 545
 	#define MSG_SD_INSERTED      "SDKarte erkannt"
543 546
 	#define MSG_SD_REMOVED       "SDKarte entfernt"
544
-	#define MSG_MAIN             "Hauptmneü"
547
+	#define MSG_MAIN             "Hauptmenü"
545 548
 	#define MSG_AUTOSTART        "Autostart"
546 549
 	#define MSG_DISABLE_STEPPERS "Stepper abschalten"
547 550
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
@@ -562,7 +565,7 @@
562 565
 	#define MSG_NOZZLE2          "Düse3"
563 566
 	#define MSG_BED              "Bett"
564 567
 	#define MSG_FAN_SPEED        "Lüftergeschw."
565
-	#define MSG_FLOW             "Fluß"
568
+	#define MSG_FLOW             "Fluss"
566 569
 	#define MSG_CONTROL          "Einstellungen"
567 570
 	#define MSG_MIN              "\002 Min"
568 571
 	#define MSG_MAX              "\002 Max"
@@ -576,8 +579,8 @@
576 579
 	#define MSG_PID_C            "PID-C"
577 580
 	#define MSG_ACC              "Acc"
578 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 584
 	#define MSG_VMAX             "Vmax "
582 585
 	#define MSG_X                "x"
583 586
 	#define MSG_Y                "y"
@@ -595,6 +598,7 @@
595 598
 	#define MSG_WATCH            "Beobachten"
596 599
 	#define MSG_TEMPERATURE      "Temperatur"
597 600
 	#define MSG_MOTION           "Bewegung"
601
+	#define MSG_CONTRAST "LCD contrast"
598 602
 	#define MSG_STORE_EPROM      "EPROM speichern"
599 603
 	#define MSG_LOAD_EPROM       "EPROM laden"
600 604
 	#define MSG_RESTORE_FAILSAFE "Standardkonfig."
@@ -700,93 +704,100 @@
700 704
 #if LANGUAGE_CHOICE == 5
701 705
 
702 706
 // LCD Menu Messages
703
-#define WELCOME_MSG MACHINE_NAME " Lista."
707
+#define WELCOME_MSG MACHINE_NAME "Lista."
704 708
 #define MSG_SD_INSERTED "Tarjeta SD Colocada"
705 709
 #define MSG_SD_REMOVED "Tarjeta SD Retirada"
706
-#define MSG_MAIN " Menu Principal \003"
710
+#define MSG_MAIN "Menu Principal"
707 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 720
 #define MSG_SWITCH_PS_ON "Switch Power On"
713 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 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 775
 #define MSG_DWELL "Reposo..."
777 776
 #define MSG_USERWAIT "Esperando Ordenes..."
777
+#define MSG_RESUMING "Resumiendo Impresion"
778 778
 #define MSG_NO_MOVE "Sin movimiento"
779
-#define MSG_PART_RELEASE "Desacople Parcial"
780 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 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 801
 // Serial Console Messages
791 802
 
792 803
 #define MSG_Enqueing "En cola \""
@@ -831,11 +842,11 @@
831 842
 #define MSG_Y_MIN "y_min: "
832 843
 #define MSG_Y_MAX "y_max: "
833 844
 #define MSG_Z_MIN "z_min: "
845
+#define MSG_Z_MAX "z_max: "
834 846
 #define MSG_M119_REPORT "Comprobando fines de carrera."
835 847
 #define MSG_ENDSTOP_HIT "PULSADO"
836 848
 #define MSG_ENDSTOP_OPEN "abierto"
837
-#define MSG_HOTEND_OFFSET "Despl. Hotend:"
838
-        
849
+#define MSG_HOTEND_OFFSET "Hotend offsets:"
839 850
 #define MSG_SD_CANT_OPEN_SUBDIR "No se pudo abrir la subcarpeta."
840 851
 #define MSG_SD_INIT_FAIL "Fallo al iniciar la SD"
841 852
 #define MSG_SD_VOL_INIT_FAIL "Fallo al montar el volumen"
@@ -900,8 +911,8 @@
900 911
 #define MSG_PID_C							" PID-C: "
901 912
 #define MSG_ACC								" Acc:"
902 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 916
 #define MSG_VMAX							" Vmax "
906 917
 #define MSG_X								"x:"
907 918
 #define MSG_Y								"y:"
@@ -918,6 +929,7 @@
918 929
 #define MSG_RECTRACT    					" Откат подачи      \x7E"
919 930
 #define MSG_TEMPERATURE  				" Температура       \x7E"
920 931
 #define MSG_MOTION						" Скорости          \x7E"
932
+	#define MSG_CONTRAST "LCD contrast"
921 933
 #define MSG_STORE_EPROM						" Сохранить настройки"
922 934
 #define MSG_LOAD_EPROM						" Загрузить настройки"
923 935
 #define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
@@ -1057,8 +1069,8 @@
1057 1069
 	#define MSG_PID_C                "PID-C"
1058 1070
 	#define MSG_ACC                  "Accel"
1059 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 1074
 	#define MSG_VMAX                 "Vmax"
1063 1075
 	#define MSG_X                    "x"
1064 1076
 	#define MSG_Y                    "y"
@@ -1075,6 +1087,7 @@
1075 1087
 	#define MSG_RECTRACT             "Ritrai"
1076 1088
 	#define MSG_TEMPERATURE          "Temperatura"
1077 1089
 	#define MSG_MOTION               "Movimento"
1090
+	#define MSG_CONTRAST "LCD contrast"
1078 1091
 	#define MSG_STORE_EPROM          "Salva in EEPROM"
1079 1092
 	#define MSG_LOAD_EPROM           "Carica da EEPROM"
1080 1093
 	#define MSG_RESTORE_FAILSAFE     "Impostaz. default"
@@ -1221,8 +1234,8 @@
1221 1234
 	#define MSG_PID_C " PID-C: "
1222 1235
 	#define MSG_ACC  " Acc:"
1223 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 1239
 	#define MSG_VMAX " Vmax "
1227 1240
 	#define MSG_X "x:"
1228 1241
 	#define MSG_Y "y:"
@@ -1391,8 +1404,8 @@
1391 1404
 	#define MSG_PID_C "PID-C"
1392 1405
 	#define MSG_ACC  "Kiihtyv"
1393 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 1409
 	#define MSG_VMAX "Vmax "
1397 1410
 	#define MSG_X "x"
1398 1411
 	#define MSG_Y "y"
@@ -1409,6 +1422,7 @@
1409 1422
 	#define MSG_RECTRACT "Veda takaisin"
1410 1423
 	#define MSG_TEMPERATURE "Lampotila"
1411 1424
 	#define MSG_MOTION "Liike"
1425
+	#define MSG_CONTRAST "LCD contrast"
1412 1426
 	#define MSG_STORE_EPROM "Tallenna muistiin"
1413 1427
 	#define MSG_LOAD_EPROM "Lataa muistista"
1414 1428
 	#define MSG_RESTORE_FAILSAFE "Palauta oletus"

+ 25
- 2
Marlin/pins.h View File

@@ -856,13 +856,13 @@
856 856
 #if MOTHERBOARD == 64
857 857
 #define STB
858 858
 #endif
859
-#if MOTHERBOARD == 63
859
+#if MOTHERBOARD == 63 || MOTHERBOARD == 66
860 860
 #define MELZI
861 861
 #endif
862 862
 #if MOTHERBOARD == 65
863 863
 #define AZTEEG_X1
864 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 866
 #undef MOTHERBOARD
867 867
 #define MOTHERBOARD 6
868 868
 #define SANGUINOLOLU_V_1_2
@@ -904,6 +904,8 @@
904 904
 
905 905
 #ifdef STB
906 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 909
 #endif
908 910
 
909 911
 #ifdef AZTEEG_X1
@@ -988,6 +990,27 @@
988 990
    #endif //Newpanel
989 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 1014
 #endif
992 1015
 
993 1016
 

+ 66
- 22
Marlin/stepper.cpp View File

@@ -348,11 +348,21 @@ ISR(TIMER1_COMPA_vect)
348 348
 
349 349
     // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
350 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 357
       count_direction[X_AXIS]=-1;
353 358
     }
354 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 366
       count_direction[X_AXIS]=1;
357 367
     }
358 368
     if((out_bits & (1<<Y_AXIS))!=0){
@@ -372,29 +382,41 @@ ISR(TIMER1_COMPA_vect)
372 382
     #endif
373 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 402
     else { // +direction
387 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,10 +529,20 @@ ISR(TIMER1_COMPA_vect)
507 529
 
508 530
         counter_x += current_block->steps_x;
509 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 538
           counter_x -= current_block->step_event_count;
512 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 548
         counter_y += current_block->steps_y;
@@ -685,6 +717,9 @@ void st_init()
685 717
   #if defined(X_DIR_PIN) && X_DIR_PIN > -1
686 718
     SET_OUTPUT(X_DIR_PIN);
687 719
   #endif
720
+  #if defined(X2_DIR_PIN) && X2_DIR_PIN > -1
721
+    SET_OUTPUT(X2_DIR_PIN);
722
+  #endif
688 723
   #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 
689 724
     SET_OUTPUT(Y_DIR_PIN);
690 725
   #endif
@@ -711,6 +746,10 @@ void st_init()
711 746
     SET_OUTPUT(X_ENABLE_PIN);
712 747
     if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
713 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 753
   #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
715 754
     SET_OUTPUT(Y_ENABLE_PIN);
716 755
     if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
@@ -788,6 +827,11 @@ void st_init()
788 827
     WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
789 828
     disable_x();
790 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 835
   #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) 
792 836
     SET_OUTPUT(Y_STEP_PIN);
793 837
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);

+ 122
- 52
Marlin/ultralcd.cpp View File

@@ -8,6 +8,8 @@
8 8
 #include "stepper.h"
9 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 13
 /* Configuration settings */
12 14
 int plaPreheatHotendTemp;
13 15
 int plaPreheatHPBTemp;
@@ -48,6 +50,9 @@ static void lcd_control_temperature_menu();
48 50
 static void lcd_control_temperature_preheat_pla_settings_menu();
49 51
 static void lcd_control_temperature_preheat_abs_settings_menu();
50 52
 static void lcd_control_motion_menu();
53
+#ifdef DOGLCD
54
+static void lcd_set_contrast();
55
+#endif
51 56
 static void lcd_control_retract_menu();
52 57
 static void lcd_sdcard_menu();
53 58
 
@@ -123,13 +128,11 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
123 128
 #ifndef REPRAPWORLD_KEYPAD
124 129
 volatile uint8_t buttons;//Contains the bits of the currently pressed buttons.
125 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 132
 #endif
128
-
129 133
 uint8_t currentMenuViewOffset;              /* scroll offset in the current menu */
130 134
 uint32_t blocking_enc;
131 135
 uint8_t lastEncoderBits;
132
-int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
133 136
 uint32_t encoderPosition;
134 137
 #if (SDCARDDETECT > 0)
135 138
 bool lcd_oldcardstatus;
@@ -174,8 +177,8 @@ static void lcd_status_screen()
174 177
     }
175 178
 
176 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 183
         encoderPosition = 0;
181 184
         feedmultiply = 100;
@@ -364,9 +367,9 @@ static void lcd_move_x()
364 367
     if (encoderPosition != 0)
365 368
     {
366 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 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 373
             current_position[X_AXIS] = X_MAX_POS;
371 374
         encoderPosition = 0;
372 375
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
@@ -388,9 +391,9 @@ static void lcd_move_y()
388 391
     if (encoderPosition != 0)
389 392
     {
390 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 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 397
             current_position[Y_AXIS] = Y_MAX_POS;
395 398
         encoderPosition = 0;
396 399
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
@@ -412,12 +415,12 @@ static void lcd_move_z()
412 415
     if (encoderPosition != 0)
413 416
     {
414 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 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 421
             current_position[Z_AXIS] = Z_MAX_POS;
419 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 424
         lcdDrawUpdate = 1;
422 425
     }
423 426
     if (lcdDrawUpdate)
@@ -499,6 +502,10 @@ static void lcd_control_menu()
499 502
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
500 503
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
501 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 509
 #ifdef FWRETRACT
503 510
     MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
504 511
 #endif
@@ -610,6 +617,31 @@ static void lcd_control_motion_menu()
610 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 645
 #ifdef FWRETRACT
614 646
 static void lcd_control_retract_menu()
615 647
 {
@@ -743,21 +775,39 @@ menu_edit_type(float, float52, ftostr52, 100)
743 775
 menu_edit_type(unsigned long, long5, ftostr5, 0.01)
744 776
 
745 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 811
 #endif
762 812
 
763 813
 /** End of menus **/
@@ -884,17 +934,29 @@ void lcd_update()
884 934
     if (lcd_next_update_millis < millis())
885 935
     {
886 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 960
         if (encoderDiff)
899 961
         {
900 962
             lcdDrawUpdate = 1;
@@ -969,6 +1031,14 @@ void lcd_reset_alert_level()
969 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 1042
 #ifdef ULTIPANEL
973 1043
 /* Warning: This function is called from interrupt context */
974 1044
 void lcd_buttons_update()
@@ -980,22 +1050,22 @@ void lcd_buttons_update()
980 1050
   #if BTN_ENC > 0
981 1051
     if((blocking_enc<millis()) && (READ(BTN_ENC)==0))
982 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 1053
   #endif
998 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 1069
 #else   //read it from the shift register
1000 1070
     uint8_t newbutton=0;
1001 1071
     WRITE(SHIFT_LD,LOW);

+ 49
- 1
Marlin/ultralcd.h View File

@@ -11,7 +11,12 @@
11 11
   void lcd_setstatuspgm(const char* message);
12 12
   void lcd_setalertstatuspgm(const char* message);
13 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 20
   static unsigned char blink = 0;	// Variable for visualisation of fan rotation in GLCD
16 21
 
17 22
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
@@ -22,6 +27,10 @@
22 27
 
23 28
   #ifdef ULTIPANEL
24 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 34
   #else
26 35
   FORCE_INLINE void lcd_buttons_update() {}
27 36
   #endif
@@ -37,6 +46,45 @@
37 46
   void lcd_buzz(long duration,uint16_t freq);
38 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 88
 #else //no lcd
41 89
   FORCE_INLINE void lcd_update() {}
42 90
   FORCE_INLINE void lcd_init() {}

+ 12
- 10
README.md View File

@@ -41,6 +41,8 @@ Features:
41 41
 *   Heater power reporting. Useful for PID monitoring.
42 42
 *   PID tuning
43 43
 *   CoreXY kinematics (www.corexy.com/theory.html)
44
+*   Delta kinematics
45
+*   Dual X-carriage support for multiple extruder systems
44 46
 *   Configurable serial port to support connection of wireless adaptors.
45 47
 *   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
46 48
 *   RC Servo Support, specify angle or duration for continuous rotation servos.
@@ -142,17 +144,9 @@ Implemented G Codes:
142 144
 *  G91 - Use Relative Coordinates
143 145
 *  G92 - Set current position to cordinates given
144 146
 
145
-RepRap M Codes
147
+M Codes
146 148
 *  M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
147 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 150
 *  M17  - Enable/Power all stepper motors
157 151
 *  M18  - Disable all stepper motors; same as M84
158 152
 *  M20  - List SD card
@@ -167,6 +161,7 @@ Custom M Codes
167 161
 *  M29  - Stop SD write
168 162
 *  M30  - Delete file from SD (M30 filename.g)
169 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 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 166
 *  M80  - Turn on Power Supply
172 167
 *  M81  - Turn off Power Supply
@@ -175,6 +170,12 @@ Custom M Codes
175 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 171
 *  M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
177 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 179
 *  M114 - Output current position to serial port
179 180
 *  M115 - Capabilities string
180 181
 *  M117 - display message
@@ -184,7 +185,8 @@ Custom M Codes
184 185
 *  M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
185 186
 *  M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
186 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 190
 *  M200 - Set filament diameter
189 191
 *  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
190 192
 *  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!

Loading…
Cancel
Save