Browse Source

Merge branch 'Marlin_v1' of github.com:ErikZalm/Marlin into Marlin_v1

Erik van der Zalm 13 years ago
parent
commit
e3821bd86f
8 changed files with 162 additions and 33 deletions
  1. 10
    1
      Marlin/Configuration.h
  2. 7
    1
      Marlin/Marlin.pde
  3. 5
    1
      Marlin/language.h
  4. 12
    4
      Marlin/pins.h
  5. 1
    1
      Marlin/stepper.cpp
  6. 4
    2
      Marlin/temperature.cpp
  7. 4
    0
      Marlin/temperature.h
  8. 119
    23
      Marlin/ultralcd.pde

+ 10
- 1
Marlin/Configuration.h View File

197
 //#define ULTRA_LCD  //general lcd support, also 16x2
197
 //#define ULTRA_LCD  //general lcd support, also 16x2
198
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
198
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
199
 
199
 
200
-#define ULTIPANEL
200
+//#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
201
+//#define ULTIPANEL  //the ultipanel as on thingiverse
202
+
203
+
204
+#ifdef ULTIMAKERCONTROLLER    //automatic expansion
205
+ #define ULTIPANEL
206
+ #define NEWPANEL
207
+#endif 
208
+ 
209
+
201
 #ifdef ULTIPANEL
210
 #ifdef ULTIPANEL
202
 //  #define NEWPANEL  //enable this if you have a click-encoder panel
211
 //  #define NEWPANEL  //enable this if you have a click-encoder panel
203
   #define SDSUPPORT
212
   #define SDSUPPORT

+ 7
- 1
Marlin/Marlin.pde View File

609
       feedrate = 0.0;
609
       feedrate = 0.0;
610
       home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
610
       home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
611
       #ifdef QUICK_HOME
611
       #ifdef QUICK_HOME
612
-      if( code_seen(axis_codes[X_AXIS]) && code_seen(axis_codes[Y_AXIS]) )  //first diagonal move
612
+      if((home_all_axis)||( code_seen(axis_codes[X_AXIS]) && code_seen(axis_codes[Y_AXIS])) )  //first diagonal move
613
       {
613
       {
614
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;  
614
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;  
615
 
615
 
1100
       
1100
       
1101
       SERIAL_PROTOCOLLN("");
1101
       SERIAL_PROTOCOLLN("");
1102
       break;
1102
       break;
1103
+    case 120: // M120
1104
+      enable_endstops(false) ;
1105
+      break;
1106
+    case 121: // M121
1107
+      enable_endstops(true) ;
1108
+      break;
1103
     case 119: // M119
1109
     case 119: // M119
1104
       #if (X_MIN_PIN > -1)
1110
       #if (X_MIN_PIN > -1)
1105
         SERIAL_PROTOCOLPGM(MSG_X_MIN);
1111
         SERIAL_PROTOCOLPGM(MSG_X_MIN);

+ 5
- 1
Marlin/language.h View File

29
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
29
 	#define MSG_MOVE_AXIS " Move Axis      \x7E"
30
 	#define MSG_SPEED " Speed:"
30
 	#define MSG_SPEED " Speed:"
31
 	#define MSG_NOZZLE " \002Nozzle:"
31
 	#define MSG_NOZZLE " \002Nozzle:"
32
+	#define MSG_NOZZLE1 " \002Nozzle2:"
33
+	#define MSG_NOZZLE2 " \002Nozzle3:"
32
 	#define MSG_BED " \002Bed:"
34
 	#define MSG_BED " \002Bed:"
33
 	#define MSG_FAN_SPEED " Fan speed:"
35
 	#define MSG_FAN_SPEED " Fan speed:"
34
 	#define MSG_FLOW " Flow:"
36
 	#define MSG_FLOW " Flow:"
174
         #define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
176
         #define MSG_MOVE_AXIS " Achsen verfahren   \x7E"
175
 	#define MSG_SPEED " Geschw:"
177
 	#define MSG_SPEED " Geschw:"
176
 	#define MSG_NOZZLE " \002Duese:"
178
 	#define MSG_NOZZLE " \002Duese:"
179
+	#define MSG_NOZZLE1 " \002Duese2:"
180
+	#define MSG_NOZZLE2 " \002Duese3:"
177
 	#define MSG_BED " \002Bett:"
181
 	#define MSG_BED " \002Bett:"
178
 	#define MSG_FAN_SPEED " Luefter geschw.:"
182
 	#define MSG_FAN_SPEED " Luefter geschw.:"
179
 	#define MSG_FLOW " Fluss:"
183
 	#define MSG_FLOW " Fluss:"
296
 	#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
300
 	#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
297
 
301
 
298
 #endif
302
 #endif
299
-#endif // ifndef LANGUAGE_H
303
+#endif // ifndef LANGUAGE_H

+ 12
- 4
Marlin/pins.h View File

729
     #define LCD_PINS_D7 19
729
     #define LCD_PINS_D7 19
730
     
730
     
731
     //encoder rotation values
731
     //encoder rotation values
732
-    #define encrot0 0
733
-    #define encrot1 2
734
-    #define encrot2 3
735
-    #define encrot3 1
732
+    #ifndef ULTIMAKERCONTROLLER
733
+     #define encrot0 0
734
+     #define encrot1 2
735
+     #define encrot2 3
736
+     #define encrot3 1
737
+    #else
738
+     #define encrot0 0
739
+     #define encrot1 1
740
+     #define encrot2 3
741
+     #define encrot3 2
742
+
743
+    #endif
736
 
744
 
737
     #define SDCARDDETECT -1
745
     #define SDCARDDETECT -1
738
     //bits in the shift register that carry the buttons for:
746
     //bits in the shift register that carry the buttons for:

+ 1
- 1
Marlin/stepper.cpp View File

85
 #ifdef ENDSTOPS_ONLY_FOR_HOMING
85
 #ifdef ENDSTOPS_ONLY_FOR_HOMING
86
   #define CHECK_ENDSTOPS  if(check_endstops)
86
   #define CHECK_ENDSTOPS  if(check_endstops)
87
 #else
87
 #else
88
-  #define CHECK_ENDSTOPS
88
+  #define CHECK_ENDSTOPS  if(check_endstops)
89
 #endif
89
 #endif
90
 
90
 
91
 // intRes = intIn1 * intIn2 >> 16
91
 // intRes = intIn1 * intIn2 >> 16

+ 4
- 2
Marlin/temperature.cpp View File

710
   disable_heater();
710
   disable_heater();
711
   if(IsStopped() == false) {
711
   if(IsStopped() == false) {
712
     SERIAL_ERROR_START;
712
     SERIAL_ERROR_START;
713
-    SERIAL_ERRORLN(e);
713
+    SERIAL_ERRORLN((int)e);
714
     SERIAL_ERRORLNPGM(": Extruder switched off. MAXTEMP triggered !");
714
     SERIAL_ERRORLNPGM(": Extruder switched off. MAXTEMP triggered !");
715
   }
715
   }
716
 }
716
 }
719
   disable_heater();
719
   disable_heater();
720
   if(IsStopped() == false) {
720
   if(IsStopped() == false) {
721
     SERIAL_ERROR_START;
721
     SERIAL_ERROR_START;
722
-    SERIAL_ERRORLN(e);
722
+    SERIAL_ERRORLN((int)e);
723
     SERIAL_ERRORLNPGM(": Extruder switched off. MINTEMP triggered !");
723
     SERIAL_ERRORLNPGM(": Extruder switched off. MINTEMP triggered !");
724
   }
724
   }
725
 }
725
 }
726
 
726
 
727
 void bed_max_temp_error(void) {
727
 void bed_max_temp_error(void) {
728
+#if HEATER_BED_PIN > -1
728
   WRITE(HEATER_BED_PIN, 0);
729
   WRITE(HEATER_BED_PIN, 0);
730
+#endif
729
   if(IsStopped() == false) {
731
   if(IsStopped() == false) {
730
     SERIAL_ERROR_START;
732
     SERIAL_ERROR_START;
731
     SERIAL_ERRORLNPGM("Temperature heated bed switched off. MAXTEMP triggered !!");
733
     SERIAL_ERRORLNPGM("Temperature heated bed switched off. MAXTEMP triggered !!");

+ 4
- 0
Marlin/temperature.h View File

129
 #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1)
129
 #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1)
130
 #define isHeatingHotend1() isHeatingHotend(1)
130
 #define isHeatingHotend1() isHeatingHotend(1)
131
 #define isCoolingHotend1() isCoolingHotend(1)
131
 #define isCoolingHotend1() isCoolingHotend(1)
132
+#else
133
+#define setTargetHotend1(_celsius) do{}while(0)
132
 #endif
134
 #endif
133
 #if EXTRUDERS > 2
135
 #if EXTRUDERS > 2
134
 #define degHotend2() degHotend(2)
136
 #define degHotend2() degHotend(2)
136
 #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2)
138
 #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2)
137
 #define isHeatingHotend2() isHeatingHotend(2)
139
 #define isHeatingHotend2() isHeatingHotend(2)
138
 #define isCoolingHotend2() isCoolingHotend(2)
140
 #define isCoolingHotend2() isCoolingHotend(2)
141
+#else
142
+#define setTargetHotend2(_celsius) do{}while(0)
139
 #endif
143
 #endif
140
 #if EXTRUDERS > 3
144
 #if EXTRUDERS > 3
141
 #error Invalid number of extruders
145
 #error Invalid number of extruders

+ 119
- 23
Marlin/ultralcd.pde View File

95
 void lcd_init()
95
 void lcd_init()
96
 {
96
 {
97
   //beep();
97
   //beep();
98
+  
98
   byte Degree[8] =
99
   byte Degree[8] =
99
   {
100
   {
100
     B01100,
101
     B01100,
322
     lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
323
     lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
323
     #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
324
     #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
324
       lcd.setCursor(10,0);lcdprintPGM("B---/---\001 ");
325
       lcd.setCursor(10,0);lcdprintPGM("B---/---\001 ");
326
+    #elif EXTRUDERS > 1
327
+      lcd.setCursor(10,0);lcdprintPGM("\002---/---\001 ");
325
     #endif
328
     #endif
326
   }
329
   }
327
     
330
     
356
       lcd.print(ftostr3(targetBed));
359
       lcd.print(ftostr3(targetBed));
357
       oldtargetBed=targetBed;
360
       oldtargetBed=targetBed;
358
     }
361
     }
362
+  #elif EXTRUDERS > 1
363
+    static int olddegHotEnd1=-1;
364
+    static int oldtargetHotEnd1=-1;
365
+    int tHotEnd1=intround(degHotend1());
366
+    if((tHotEnd1!=olddegHotEnd1)||force_lcd_update)
367
+    {
368
+      lcd.setCursor(11,0);
369
+      lcd.print(ftostr3(tHotEnd1));
370
+      olddegHotEnd1=tHotEnd1;
371
+    }
372
+    int ttHotEnd1=intround(degTargetHotend1());
373
+    if((ttHotEnd1!=oldtargetHotEnd1)||force_lcd_update)
374
+    {
375
+      lcd.setCursor(15,0);
376
+      lcd.print(ftostr3(ttHotEnd1));
377
+      oldtargetHotEnd1=ttHotEnd1;
378
+    }
359
   #endif
379
   #endif
360
   //starttime=2;
380
   //starttime=2;
361
   static uint16_t oldtime=0;
381
   static uint16_t oldtime=0;
430
   if(force_lcd_update)  //initial display of content
450
   if(force_lcd_update)  //initial display of content
431
   {
451
   {
432
     encoderpos=feedmultiply;
452
     encoderpos=feedmultiply;
433
-    lcd.setCursor(0,0);lcdprintPGM("\002123/567\001 ");
434
-    #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
435
-    lcd.setCursor(10,0);lcdprintPGM("B123/567\001 ");
436
-    #endif
453
+    lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
437
   }
454
   }
438
     
455
     
439
   int tHotEnd0=intround(degHotend0());
456
   int tHotEnd0=intround(degHotend0());
520
       beepshort(); );
537
       beepshort(); );
521
       break;
538
       break;
522
     case ItemP_cooldown:
539
     case ItemP_cooldown:
523
-      MENUITEM(  lcdprintPGM(MSG_COOLDOWN)  ,  BLOCK;setTargetHotend0(0);setTargetBed(0);beepshort(); ) ;
540
+      MENUITEM(  lcdprintPGM(MSG_COOLDOWN)  ,  BLOCK;setTargetHotend0(0);setTargetHotend1(0);setTargetHotend2(0);setTargetBed(0);beepshort(); ) ;
524
       break;
541
       break;
525
 //    case ItemP_extrude:
542
 //    case ItemP_extrude:
526
   //    MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
543
   //    MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
923
 //   
940
 //   
924
 
941
 
925
 enum {
942
 enum {
926
-  ItemCT_exit,ItemCT_nozzle,
943
+  ItemCT_exit,ItemCT_nozzle0,
927
 #ifdef AUTOTEMP
944
 #ifdef AUTOTEMP
928
   ItemCT_autotempactive,
945
   ItemCT_autotempactive,
929
   ItemCT_autotempmin,ItemCT_autotempmax,ItemCT_autotempfact,
946
   ItemCT_autotempmin,ItemCT_autotempmax,ItemCT_autotempfact,
930
 #endif
947
 #endif
931
-#if (HEATER_BED_PIN > -1)
948
+#if EXTRUDERS > 1
949
+  ItemCT_nozzle1,
950
+#endif
951
+#if EXTRUDERS > 2
952
+  ItemCT_nozzle2,
953
+#endif
954
+#if defined BED_USES_THERMISTOR || BED_USES_AD595
932
 ItemCT_bed,
955
 ItemCT_bed,
933
 #endif  
956
 #endif  
934
   ItemCT_fan,
957
   ItemCT_fan,
946
     case ItemCT_exit:
969
     case ItemCT_exit:
947
       MENUITEM(  lcdprintPGM(MSG_CONTROL)  ,  BLOCK;status=Main_Control;beepshort(); ) ;
970
       MENUITEM(  lcdprintPGM(MSG_CONTROL)  ,  BLOCK;status=Main_Control;beepshort(); ) ;
948
       break;
971
       break;
949
-    case ItemCT_nozzle:
972
+    case ItemCT_nozzle0:
950
       {
973
       {
951
         if(force_lcd_update)
974
         if(force_lcd_update)
952
         {
975
         {
980
         }
1003
         }
981
         
1004
         
982
       }break;
1005
       }break;
983
-      #ifdef AUTOTEMP
984
-      case ItemCT_autotempmin:
1006
+    #if EXTRUDERS > 1
1007
+    case ItemCT_nozzle1:
1008
+      {
1009
+        if(force_lcd_update)
1010
+        {
1011
+          lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE1);
1012
+          lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend1())));
1013
+        }
1014
+        
1015
+        if((activeline!=line) )
1016
+          break;
1017
+        
1018
+        if(CLICKED)
1019
+        {
1020
+          linechanging=!linechanging;
1021
+          if(linechanging)
1022
+          {
1023
+              encoderpos=intround(degTargetHotend1());
1024
+          }
1025
+          else
1026
+          {
1027
+            setTargetHotend1(encoderpos);
1028
+            encoderpos=activeline*lcdslow;
1029
+            beepshort();
1030
+          }
1031
+          BLOCK;
1032
+        }
1033
+        if(linechanging)
1034
+        {
1035
+          if(encoderpos<0) encoderpos=0;
1036
+          if(encoderpos>260) encoderpos=260;
1037
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1038
+        }
1039
+        
1040
+      }break;
1041
+    #endif
1042
+    #if EXTRUDERS > 2
1043
+    case ItemCT_nozzle2:
1044
+      {
1045
+        if(force_lcd_update)
1046
+        {
1047
+          lcd.setCursor(0,line);lcdprintPGM(MSG_NOZZLE2);
1048
+          lcd.setCursor(13,line);lcd.print(ftostr3(intround(degTargetHotend2())));
1049
+        }
1050
+        
1051
+        if((activeline!=line) )
1052
+          break;
1053
+        
1054
+        if(CLICKED)
1055
+        {
1056
+          linechanging=!linechanging;
1057
+          if(linechanging)
1058
+          {
1059
+              encoderpos=intround(degTargetHotend2());
1060
+          }
1061
+          else
1062
+          {
1063
+            setTargetHotend1(encoderpos);
1064
+            encoderpos=activeline*lcdslow;
1065
+            beepshort();
1066
+          }
1067
+          BLOCK;
1068
+        }
1069
+        if(linechanging)
1070
+        {
1071
+          if(encoderpos<0) encoderpos=0;
1072
+          if(encoderpos>260) encoderpos=260;
1073
+          lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1074
+        }
1075
+        
1076
+      }break;
1077
+    #endif
1078
+    #ifdef AUTOTEMP
1079
+    case ItemCT_autotempmin:
985
       {
1080
       {
986
         if(force_lcd_update)
1081
         if(force_lcd_update)
987
         {
1082
         {
1015
         }
1110
         }
1016
         
1111
         
1017
       }break;  
1112
       }break;  
1018
-      case ItemCT_autotempmax:
1113
+    case ItemCT_autotempmax:
1019
       {
1114
       {
1020
         if(force_lcd_update)
1115
         if(force_lcd_update)
1021
         {
1116
         {
1049
         }
1144
         }
1050
         
1145
         
1051
       }break;  
1146
       }break;  
1052
-      case ItemCT_autotempfact:
1147
+    case ItemCT_autotempfact:
1053
       {
1148
       {
1054
         if(force_lcd_update)
1149
         if(force_lcd_update)
1055
         {
1150
         {
1083
         }
1178
         }
1084
         
1179
         
1085
       }break;
1180
       }break;
1086
-      case ItemCT_autotempactive:
1181
+    case ItemCT_autotempactive:
1087
       {
1182
       {
1088
         if(force_lcd_update)
1183
         if(force_lcd_update)
1089
         {
1184
         {
1110
         }
1205
         }
1111
         
1206
         
1112
       }break;  
1207
       }break;  
1113
-      #endif //autotemp
1114
-      #if (HEATER_BED_PIN > -1)
1115
-      case ItemCT_bed:
1208
+    #endif //autotemp
1209
+    #if defined BED_USES_THERMISTOR || BED_USES_AD595
1210
+    case ItemCT_bed:
1116
       {
1211
       {
1117
         if(force_lcd_update)
1212
         if(force_lcd_update)
1118
         {
1213
         {
1145
           lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1240
           lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1146
         }
1241
         }
1147
       }break;
1242
       }break;
1148
-      #endif
1149
-      case ItemCT_fan:
1243
+    #endif
1244
+    case ItemCT_fan:
1150
       {
1245
       {
1151
         if(force_lcd_update)
1246
         if(force_lcd_update)
1152
         {
1247
         {
1181
         }
1276
         }
1182
         
1277
         
1183
       }break;
1278
       }break;
1184
-      	#ifdef PIDTEMP
1185
-      case ItemCT_PID_P: 
1279
+    #ifdef PIDTEMP
1280
+    case ItemCT_PID_P: 
1186
       {
1281
       {
1187
       if(force_lcd_update)
1282
       if(force_lcd_update)
1188
         {
1283
         {
1252
         }
1347
         }
1253
         
1348
         
1254
       }break;
1349
       }break;
1255
-      case ItemCT_PID_D: 
1350
+    case ItemCT_PID_D: 
1256
       {
1351
       {
1257
       if(force_lcd_update)
1352
       if(force_lcd_update)
1258
         {
1353
         {
1324
         }
1419
         }
1325
         
1420
         
1326
       }
1421
       }
1327
-      	#endif
1328
       #endif
1422
       #endif
1423
+    #endif
1329
       break;
1424
       break;
1330
     default:   
1425
     default:   
1331
       break;
1426
       break;
2080
     {
2175
     {
2081
       force_lcd_update=true;
2176
       force_lcd_update=true;
2082
       oldcardstatus=CARDINSERTED;
2177
       oldcardstatus=CARDINSERTED;
2178
+      lcd_init(); // to maybe revive the lcd if static electricty killed it.
2083
       //Serial.println("echo: SD CHANGE");
2179
       //Serial.println("echo: SD CHANGE");
2084
       if(CARDINSERTED)
2180
       if(CARDINSERTED)
2085
       {
2181
       {
2282
 
2378
 
2283
 #endif //ULTRA_LCD
2379
 #endif //ULTRA_LCD
2284
 
2380
 
2285
-
2381
+

Loading…
Cancel
Save