Selaa lähdekoodia

Merge pull request #553 from iXce/req413

Update #413 for merging, fix languages.h
ErikZalm 11 vuotta sitten
vanhempi
commit
e578f988d3
5 muutettua tiedostoa jossa 1597 lisäystä ja 1522 poistoa
  1. 1
    0
      Marlin/Configuration.h
  2. 26
    5
      Marlin/Marlin_main.cpp
  3. 1537
    1506
      Marlin/language.h
  4. 24
    11
      Marlin/pins.h
  5. 9
    0
      Marlin/ultralcd.cpp

+ 1
- 0
Marlin/Configuration.h Näytä tiedosto

@@ -28,6 +28,7 @@
28 28
 // 3  = MEGA/RAMPS up to 1.2 = 3
29 29
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
30 30
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
31
+// 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
31 32
 // 4  = Duemilanove w/ ATMega328P pin assignment
32 33
 // 5  = Gen6
33 34
 // 51 = Gen6 deluxe

+ 26
- 5
Marlin/Marlin_main.cpp Näytä tiedosto

@@ -194,6 +194,10 @@ int EtoPPressure=0;
194 194
   float retract_recover_length=0, retract_recover_feedrate=8*60;
195 195
 #endif
196 196
 
197
+#ifdef ULTIPANEL
198
+	bool powersupply = true;
199
+#endif
200
+
197 201
 //===========================================================================
198 202
 //=============================private variables=============================
199 203
 //===========================================================================
@@ -1390,14 +1394,26 @@ void process_commands()
1390 1394
     #endif
1391 1395
 
1392 1396
     #if defined(PS_ON_PIN) && PS_ON_PIN > -1
1393
-      case 80: // M80 - ATX Power On
1397
+      case 80: // M80 - Turn on Power Supply
1394 1398
         SET_OUTPUT(PS_ON_PIN); //GND
1395 1399
         WRITE(PS_ON_PIN, PS_ON_AWAKE);
1400
+        #ifdef ULTIPANEL
1401
+          powersupply = true;
1402
+          LCD_MESSAGEPGM(WELCOME_MSG);
1403
+          lcd_update();
1404
+        #endif
1396 1405
         break;
1397 1406
       #endif
1398
-
1399
-      case 81: // M81 - ATX Power Off
1400
-
1407
+      
1408
+      case 81: // M81 - Turn off Power Supply
1409
+        disable_heater();
1410
+        st_synchronize();
1411
+        disable_e0();
1412
+        disable_e1();
1413
+        disable_e2();
1414
+        finishAndDisableSteppers();
1415
+        fanSpeed = 0;
1416
+        delay(1000); // Wait a little before to switch off
1401 1417
       #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
1402 1418
         st_synchronize();
1403 1419
         suicide();
@@ -1405,7 +1421,12 @@ void process_commands()
1405 1421
         SET_OUTPUT(PS_ON_PIN);
1406 1422
         WRITE(PS_ON_PIN, PS_ON_ASLEEP);
1407 1423
       #endif
1408
-        break;
1424
+      #ifdef ULTIPANEL
1425
+        powersupply = false;
1426
+        LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");
1427
+        lcd_update();
1428
+      #endif
1429
+	  break;
1409 1430
 
1410 1431
     case 82:
1411 1432
       axis_relative_modes[3] = false;

+ 1537
- 1506
Marlin/language.h
File diff suppressed because it is too large
Näytä tiedosto


+ 24
- 11
Marlin/pins.h Näytä tiedosto

@@ -298,7 +298,7 @@
298 298
 * Arduino Mega pin assignment
299 299
 *
300 300
 ****************************************************************************************/
301
-#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
301
+#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
302 302
 #define KNOWN_BOARD 1
303 303
 
304 304
 //////////////////FIX THIS//////////////
@@ -314,7 +314,7 @@
314 314
 // #define RAMPS_V_1_0
315 315
 
316 316
 
317
-#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
317
+#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
318 318
 
319 319
   #define LARGE_FLASH true
320 320
   
@@ -392,7 +392,7 @@
392 392
     #define LED_PIN            13
393 393
   #endif
394 394
 
395
-  #if MOTHERBOARD == 33
395
+  #if MOTHERBOARD == 33 || MOTHERBOARD == 35
396 396
     #define FAN_PIN            9 // (Sprinter config)
397 397
   #else
398 398
     #define FAN_PIN            4 // IO pin. Buffer needed
@@ -401,6 +401,10 @@
401 401
   #if MOTHERBOARD == 77
402 402
     #define FAN_PIN            8 
403 403
   #endif
404
+  
405
+  #if MOTHERBOARD == 35
406
+    #define CONTROLLERFAN_PIN  10 //Pin used for the fan to cool controller
407
+  #endif
404 408
 
405 409
   #define PS_ON_PIN          12
406 410
 
@@ -410,12 +414,18 @@
410 414
     #define KILL_PIN           -1
411 415
   #endif
412 416
 
413
-  #define HEATER_0_PIN       10   // EXTRUDER 1
417
+  #if MOTHERBOARD == 35
418
+    #define HEATER_0_PIN       8
419
+  #else
420
+    #define HEATER_0_PIN       10   // EXTRUDER 1
421
+  #endif
422
+
414 423
   #if MOTHERBOARD == 33 
415 424
     #define HEATER_1_PIN       -1
416 425
   #else
417 426
     #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
418 427
   #endif
428
+
419 429
   #define HEATER_2_PIN       -1 
420 430
 
421 431
   #if MOTHERBOARD == 77
@@ -427,10 +437,15 @@
427 437
   #define TEMP_0_PIN         13   // ANALOG NUMBERING
428 438
   #define TEMP_1_PIN         15   // ANALOG NUMBERING
429 439
   #define TEMP_2_PIN         -1   // ANALOG NUMBERING
430
-  #if MOTHERBOARD == 77
431
-    #define HEATER_BED_PIN     9    // BED
440
+
441
+  #if MOTHERBOARD == 35
442
+    #define HEATER_BED_PIN     -1    // NO BED
432 443
   #else
433
-    #define HEATER_BED_PIN     8    // BED
444
+    #if MOTHERBOARD == 77
445
+      #define HEATER_BED_PIN     9    // BED
446
+    #else
447
+      #define HEATER_BED_PIN     8    // BED
448
+    #endif
434 449
   #endif
435 450
   #define TEMP_BED_PIN       14   // ANALOG NUMBERING
436 451
 
@@ -578,7 +593,7 @@
578 593
 #define TEMP_2_PIN          -1   
579 594
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
580 595
 
581
-#endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
596
+#endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
582 597
 
583 598
 // SPI for Max6675 Thermocouple 
584 599
 
@@ -592,9 +607,7 @@
592 607
   #define MAX6675_SS       49
593 608
 #endif
594 609
 
595
-#endif //MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
596
-
597
-
610
+#endif //MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
598 611
 
599 612
 /****************************************************************************************
600 613
 * Duemilanove w/ ATMega328P pin assignment

+ 9
- 0
Marlin/ultralcd.cpp Näytä tiedosto

@@ -40,6 +40,7 @@ void copy_and_scalePID_d();
40 40
 /* Different menus */
41 41
 static void lcd_status_screen();
42 42
 #ifdef ULTIPANEL
43
+extern bool powersupply;
43 44
 static void lcd_main_menu();
44 45
 static void lcd_tune_menu();
45 46
 static void lcd_prepare_menu();
@@ -348,6 +349,14 @@ static void lcd_prepare_menu()
348 349
     MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla);
349 350
     MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs);
350 351
     MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
352
+#if PS_ON_PIN > -1
353
+    if (powersupply)
354
+    {
355
+        MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
356
+    }else{
357
+        MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
358
+    }
359
+#endif
351 360
     MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
352 361
     END_MENU();
353 362
 }

Loading…
Peruuta
Tallenna