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,7 +197,16 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
197 197
 //#define ULTRA_LCD  //general lcd support, also 16x2
198 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 210
 #ifdef ULTIPANEL
202 211
 //  #define NEWPANEL  //enable this if you have a click-encoder panel
203 212
   #define SDSUPPORT

+ 7
- 1
Marlin/Marlin.pde View File

@@ -609,7 +609,7 @@ void process_commands()
609 609
       feedrate = 0.0;
610 610
       home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
611 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 614
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;  
615 615
 
@@ -1100,6 +1100,12 @@ void process_commands()
1100 1100
       
1101 1101
       SERIAL_PROTOCOLLN("");
1102 1102
       break;
1103
+    case 120: // M120
1104
+      enable_endstops(false) ;
1105
+      break;
1106
+    case 121: // M121
1107
+      enable_endstops(true) ;
1108
+      break;
1103 1109
     case 119: // M119
1104 1110
       #if (X_MIN_PIN > -1)
1105 1111
         SERIAL_PROTOCOLPGM(MSG_X_MIN);

+ 5
- 1
Marlin/language.h View File

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

+ 12
- 4
Marlin/pins.h View File

@@ -729,10 +729,18 @@
729 729
     #define LCD_PINS_D7 19
730 730
     
731 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 745
     #define SDCARDDETECT -1
738 746
     //bits in the shift register that carry the buttons for:

+ 1
- 1
Marlin/stepper.cpp View File

@@ -85,7 +85,7 @@ volatile char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
85 85
 #ifdef ENDSTOPS_ONLY_FOR_HOMING
86 86
   #define CHECK_ENDSTOPS  if(check_endstops)
87 87
 #else
88
-  #define CHECK_ENDSTOPS
88
+  #define CHECK_ENDSTOPS  if(check_endstops)
89 89
 #endif
90 90
 
91 91
 // intRes = intIn1 * intIn2 >> 16

+ 4
- 2
Marlin/temperature.cpp View File

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

+ 4
- 0
Marlin/temperature.h View File

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

+ 119
- 23
Marlin/ultralcd.pde View File

@@ -95,6 +95,7 @@ FORCE_INLINE void clear()
95 95
 void lcd_init()
96 96
 {
97 97
   //beep();
98
+  
98 99
   byte Degree[8] =
99 100
   {
100 101
     B01100,
@@ -322,6 +323,8 @@ void MainMenu::showStatus()
322 323
     lcd.setCursor(0,0);lcdprintPGM("\002---/---\001 ");
323 324
     #if defined BED_USES_THERMISTOR || defined BED_USES_AD595 
324 325
       lcd.setCursor(10,0);lcdprintPGM("B---/---\001 ");
326
+    #elif EXTRUDERS > 1
327
+      lcd.setCursor(10,0);lcdprintPGM("\002---/---\001 ");
325 328
     #endif
326 329
   }
327 330
     
@@ -356,6 +359,23 @@ void MainMenu::showStatus()
356 359
       lcd.print(ftostr3(targetBed));
357 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 379
   #endif
360 380
   //starttime=2;
361 381
   static uint16_t oldtime=0;
@@ -430,10 +450,7 @@ void MainMenu::showStatus()
430 450
   if(force_lcd_update)  //initial display of content
431 451
   {
432 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 456
   int tHotEnd0=intround(degHotend0());
@@ -520,7 +537,7 @@ void MainMenu::showPrepare()
520 537
       beepshort(); );
521 538
       break;
522 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 541
       break;
525 542
 //    case ItemP_extrude:
526 543
   //    MENUITEM(  lcdprintPGM(" Extrude")  ,  BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
@@ -923,12 +940,18 @@ void MainMenu::showTune()
923 940
 //   
924 941
 
925 942
 enum {
926
-  ItemCT_exit,ItemCT_nozzle,
943
+  ItemCT_exit,ItemCT_nozzle0,
927 944
 #ifdef AUTOTEMP
928 945
   ItemCT_autotempactive,
929 946
   ItemCT_autotempmin,ItemCT_autotempmax,ItemCT_autotempfact,
930 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 955
 ItemCT_bed,
933 956
 #endif  
934 957
   ItemCT_fan,
@@ -946,7 +969,7 @@ void MainMenu::showControlTemp()
946 969
     case ItemCT_exit:
947 970
       MENUITEM(  lcdprintPGM(MSG_CONTROL)  ,  BLOCK;status=Main_Control;beepshort(); ) ;
948 971
       break;
949
-    case ItemCT_nozzle:
972
+    case ItemCT_nozzle0:
950 973
       {
951 974
         if(force_lcd_update)
952 975
         {
@@ -980,8 +1003,80 @@ void MainMenu::showControlTemp()
980 1003
         }
981 1004
         
982 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 1081
         if(force_lcd_update)
987 1082
         {
@@ -1015,7 +1110,7 @@ void MainMenu::showControlTemp()
1015 1110
         }
1016 1111
         
1017 1112
       }break;  
1018
-      case ItemCT_autotempmax:
1113
+    case ItemCT_autotempmax:
1019 1114
       {
1020 1115
         if(force_lcd_update)
1021 1116
         {
@@ -1049,7 +1144,7 @@ void MainMenu::showControlTemp()
1049 1144
         }
1050 1145
         
1051 1146
       }break;  
1052
-      case ItemCT_autotempfact:
1147
+    case ItemCT_autotempfact:
1053 1148
       {
1054 1149
         if(force_lcd_update)
1055 1150
         {
@@ -1083,7 +1178,7 @@ void MainMenu::showControlTemp()
1083 1178
         }
1084 1179
         
1085 1180
       }break;
1086
-      case ItemCT_autotempactive:
1181
+    case ItemCT_autotempactive:
1087 1182
       {
1088 1183
         if(force_lcd_update)
1089 1184
         {
@@ -1110,9 +1205,9 @@ void MainMenu::showControlTemp()
1110 1205
         }
1111 1206
         
1112 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 1212
         if(force_lcd_update)
1118 1213
         {
@@ -1145,8 +1240,8 @@ void MainMenu::showControlTemp()
1145 1240
           lcd.setCursor(13,line);lcd.print(itostr3(encoderpos));
1146 1241
         }
1147 1242
       }break;
1148
-      #endif
1149
-      case ItemCT_fan:
1243
+    #endif
1244
+    case ItemCT_fan:
1150 1245
       {
1151 1246
         if(force_lcd_update)
1152 1247
         {
@@ -1181,8 +1276,8 @@ void MainMenu::showControlTemp()
1181 1276
         }
1182 1277
         
1183 1278
       }break;
1184
-      	#ifdef PIDTEMP
1185
-      case ItemCT_PID_P: 
1279
+    #ifdef PIDTEMP
1280
+    case ItemCT_PID_P: 
1186 1281
       {
1187 1282
       if(force_lcd_update)
1188 1283
         {
@@ -1252,7 +1347,7 @@ void MainMenu::showControlTemp()
1252 1347
         }
1253 1348
         
1254 1349
       }break;
1255
-      case ItemCT_PID_D: 
1350
+    case ItemCT_PID_D: 
1256 1351
       {
1257 1352
       if(force_lcd_update)
1258 1353
         {
@@ -1324,8 +1419,8 @@ void MainMenu::showControlTemp()
1324 1419
         }
1325 1420
         
1326 1421
       }
1327
-      	#endif
1328 1422
       #endif
1423
+    #endif
1329 1424
       break;
1330 1425
     default:   
1331 1426
       break;
@@ -2080,6 +2175,7 @@ void MainMenu::update()
2080 2175
     {
2081 2176
       force_lcd_update=true;
2082 2177
       oldcardstatus=CARDINSERTED;
2178
+      lcd_init(); // to maybe revive the lcd if static electricty killed it.
2083 2179
       //Serial.println("echo: SD CHANGE");
2084 2180
       if(CARDINSERTED)
2085 2181
       {
@@ -2282,4 +2378,4 @@ char *ftostr52(const float &x)
2282 2378
 
2283 2379
 #endif //ULTRA_LCD
2284 2380
 
2285
-
2381
+

Loading…
Cancel
Save