소스 검색

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

Conflicts:
	Marlin/Configuration.h
	Marlin/Marlin_main.cpp
fsantini 11 년 전
부모
커밋
6ae7f7870d

+ 22
- 0
ArduinoAddons/Arduino_1.x.x/Sanguino/boards.txt 파일 보기

@@ -61,3 +61,25 @@ atmega1284.build.f_cpu=16000000L
61 61
 atmega1284.build.core=arduino
62 62
 atmega1284.build.variant=standard
63 63
 #
64
+
65
+##############################################################
66
+
67
+atmega1284.name=Sanguino W/ ATmega1284p 16mhz ceramic resonator
68
+
69
+atmega1284.upload.protocol=stk500
70
+atmega1284.upload.maximum_size=131072
71
+atmega1284.upload.speed=57600
72
+
73
+atmega1284.bootloader.low_fuses=0xD6
74
+atmega1284.bootloader.high_fuses=0xDC
75
+atmega1284.bootloader.extended_fuses=0xFD
76
+atmega1284.bootloader.path=atmega
77
+atmega1284.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
78
+atmega1284.bootloader.unlock_bits=0x3F
79
+atmega1284.bootloader.lock_bits=0x0F
80
+
81
+atmega1284.build.mcu=atmega1284p
82
+atmega1284.build.f_cpu=16000000L
83
+atmega1284.build.core=arduino
84
+atmega1284.build.variant=standard
85
+#

+ 15
- 13
Marlin/Configuration.h 파일 보기

@@ -8,9 +8,9 @@
8 8
 //===========================================================================
9 9
 //============================= DELTA Printer ===============================
10 10
 //===========================================================================
11
-// For a Delta printer rplace the configuration files wilth the files in the 
11
+// For a Delta printer rplace the configuration files wilth the files in the
12 12
 // example_configurations/delta directory.
13
-// 
13
+//
14 14
 
15 15
 // User-specified version info of this build to display in [Pronterface, etc] terminal window during
16 16
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
@@ -36,7 +36,8 @@
36 36
 // 11 = Gen7 v1.1, v1.2 = 11
37 37
 // 12 = Gen7 v1.3
38 38
 // 13 = Gen7 v1.4
39
-// 20 = Sethi 3D_1 
39
+// 2  = Cheaptronic v1.0
40
+// 20 = Sethi 3D_1
40 41
 // 3  = MEGA/RAMPS up to 1.2 = 3
41 42
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
42 43
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
@@ -335,9 +336,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
335 336
 
336 337
   #define Z_RAISE_BEFORE_HOMING 4       // (in mm) Raise Z before homing (G28) for Probe Clearance.
337 338
                                         // Be sure you have this distance over your Z_MAX_POS in case
338
-    
339
+
339 340
   #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
340
-  
341
+
341 342
   #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
342 343
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
343 344
 
@@ -346,26 +347,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
346 347
   //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
347 348
   // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
348 349
 
349
-//  #define PROBE_SERVO_DEACTIVATION_DELAY 300  
350
+//  #define PROBE_SERVO_DEACTIVATION_DELAY 300
350 351
 
351 352
 
352
-//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing, 
353
+//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing,
353 354
 //it is highly recommended you let this Z_SAFE_HOMING enabled!!!
354 355
 
355
-  #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area. 
356
+  #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
356 357
                           // When defined, it will:
357 358
                           // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
358 359
                           // - If stepper drivers timeout, it will need X and Y homing again before Z homing
359 360
                           // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
360 361
                           // - Block Z homing only when the probe is outside bed area.
361
-  
362
+
362 363
   #ifdef Z_SAFE_HOMING
363
-    
364
+
364 365
     #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2)    // X point for Z homing when homing all axis (G28)
365 366
     #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2)    // Y point for Z homing when homing all axis (G28)
366
-    
367
+
367 368
   #endif
368
-  
369
+
369 370
   // with accurate bed leveling, the bed is sampled in a ACCURATE_BED_LEVELING_POINTSxACCURATE_BED_LEVELING_POINTS grid and least squares solution is calculated
370 371
   // Note: this feature occupies 10'206 byte
371 372
   #define ACCURATE_BED_LEVELING
@@ -443,6 +444,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
443 444
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
444 445
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
445 446
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
447
+//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
446 448
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
447 449
 //#define ULTIPANEL  //the ultipanel as on thingiverse
448 450
 
@@ -549,7 +551,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
549 551
 // Shift register panels
550 552
 // ---------------------
551 553
 // 2 wire Non-latching LCD SR from:
552
-// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
554
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
553 555
 //#define SR_LCD
554 556
 #ifdef SR_LCD
555 557
    #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister

+ 1
- 1
Marlin/Configuration_adv.h 파일 보기

@@ -161,7 +161,7 @@
161 161
   #define EXTRUDERS 1
162 162
 #endif
163 163
 
164
-#ifdef Z_DUAL_STEPPER_DRIVERS && Y_DUAL_STEPPER_DRIVERS
164
+#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
165 165
   #error "You cannot have dual drivers for both Y and Z"
166 166
 #endif
167 167
 

+ 95
- 91
Marlin/Marlin_main.cpp 파일 보기

@@ -50,7 +50,7 @@
50 50
 
51 51
 #ifdef BLINKM
52 52
 #include "BlinkM.h"
53
-#include "Wire.h" 
53
+#include "Wire.h"
54 54
 #endif
55 55
 
56 56
 #if NUM_SERVOS > 0
@@ -99,7 +99,7 @@
99 99
 // M29  - Stop SD write
100 100
 // M30  - Delete file from SD (M30 filename.g)
101 101
 // M31  - Output time since last M109 or SD card start to serial
102
-// M32  - Select file and start SD print (Can be used _while_ printing from SD card files): 
102
+// M32  - Select file and start SD print (Can be used _while_ printing from SD card files):
103 103
 //        syntax "M32 /path/filename#", or "M32 S<startpos bytes> !filename#"
104 104
 //        Call gcode file : "M32 P !filename#" and return to caller file after finishing (simiarl to #include).
105 105
 //        The '#' is necessary when calling from within sd files, as it stops buffer prereading
@@ -229,7 +229,11 @@ int EtoPPressure=0;
229 229
 #endif
230 230
 
231 231
 #ifdef ULTIPANEL
232
-	bool powersupply = true;
232
+  #ifdef PS_DEFAULT_OFF
233
+    bool powersupply = false;
234
+  #else
235
+	  bool powersupply = true;
236
+  #endif
233 237
 #endif
234 238
 
235 239
 #ifdef DELTA
@@ -418,7 +422,7 @@ void servo_init()
418 422
 
419 423
   #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
420 424
   delay(PROBE_SERVO_DEACTIVATION_DELAY);
421
-  servos[servo_endstops[Z_AXIS]].detach();  
425
+  servos[servo_endstops[Z_AXIS]].detach();
422 426
   #endif
423 427
 }
424 428
 
@@ -639,17 +643,17 @@ void get_command()
639 643
   if(!card.sdprinting || serial_count!=0){
640 644
     return;
641 645
   }
642
-  
646
+
643 647
   //'#' stops reading from sd to the buffer prematurely, so procedural macro calls are possible
644
-  // if it occures, stop_buffering is triggered and the buffer is ran dry. 
648
+  // if it occures, stop_buffering is triggered and the buffer is ran dry.
645 649
   // this character _can_ occure in serial com, due to checksums. however, no checksums are used in sd printing
646
-  
650
+
647 651
   static bool stop_buffering=false;
648 652
   if(buflen==0) stop_buffering=false;
649
-  
650
-  while( !card.eof()  && buflen < BUFSIZE && !stop_buffering) { 
653
+
654
+  while( !card.eof()  && buflen < BUFSIZE && !stop_buffering) {
651 655
     int16_t n=card.get();
652
-    serial_char = (char)n; 
656
+    serial_char = (char)n;
653 657
     if(serial_char == '\n' ||
654 658
        serial_char == '\r' ||
655 659
        (serial_char == '#' && comment_mode == false) ||
@@ -674,7 +678,7 @@ void get_command()
674 678
       }
675 679
       if(serial_char=='#')
676 680
         stop_buffering=true;
677
-      
681
+
678 682
       if(!serial_count)
679 683
       {
680 684
         comment_mode = false; //for new command
@@ -746,13 +750,13 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
746 750
   #endif
747 751
   #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
748 752
     #error "Please use canonical x-carriage assignment" // the x-carriages are defined by their homing directions
749
-  #endif  
753
+  #endif
750 754
 
751 755
 #define DXC_FULL_CONTROL_MODE 0
752 756
 #define DXC_AUTO_PARK_MODE    1
753 757
 #define DXC_DUPLICATION_MODE  2
754 758
 static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
755
- 
759
+
756 760
 static float x_home_pos(int extruder) {
757 761
   if (extruder == 0)
758 762
     return base_home_pos(X_AXIS) + add_homeing[X_AXIS];
@@ -770,12 +774,12 @@ static int x_home_dir(int extruder) {
770 774
 
771 775
 static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1
772 776
 static bool active_extruder_parked = false; // used in mode 1 & 2
773
-static float raised_parked_position[NUM_AXIS]; // used in mode 1 
774
-static unsigned long delayed_move_time = 0; // used in mode 1 
777
+static float raised_parked_position[NUM_AXIS]; // used in mode 1
778
+static unsigned long delayed_move_time = 0; // used in mode 1
775 779
 static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
776 780
 static float duplicate_extruder_temp_offset = 0; // used in mode 2
777 781
 bool extruder_duplication_enabled = false; // used in mode 2
778
-#endif //DUAL_X_CARRIAGE    
782
+#endif //DUAL_X_CARRIAGE
779 783
 
780 784
 static void axis_is_at_home(int axis) {
781 785
 #ifdef DUAL_X_CARRIAGE
@@ -788,8 +792,8 @@ static void axis_is_at_home(int axis) {
788 792
     }
789 793
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
790 794
       current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homeing[X_AXIS];
791
-      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + add_homeing[X_AXIS]; 
792
-      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + add_homeing[X_AXIS], 
795
+      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + add_homeing[X_AXIS];
796
+      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + add_homeing[X_AXIS],
793 797
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
794 798
       return;
795 799
     }
@@ -881,7 +885,7 @@ static void run_z_probe() {
881 885
     st_synchronize();
882 886
 
883 887
     // move back down slowly to find bed
884
-    feedrate = homing_feedrate[Z_AXIS]/4; 
888
+    feedrate = homing_feedrate[Z_AXIS]/4;
885 889
     zPosition -= home_retract_mm(Z_AXIS) * 2;
886 890
     plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder);
887 891
     st_synchronize();
@@ -978,7 +982,7 @@ static void homeaxis(int axis) {
978 982
 
979 983
     current_position[axis] = 0;
980 984
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
981
-	
985
+
982 986
 
983 987
     // Engage Servo endstop if enabled
984 988
     #ifdef SERVO_ENDSTOPS
@@ -1036,7 +1040,7 @@ static void homeaxis(int axis) {
1036 1040
 #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1037 1041
     if (axis==Z_AXIS) retract_z_probe();
1038 1042
 #endif
1039
-    
1043
+
1040 1044
   }
1041 1045
 }
1042 1046
 #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
@@ -1110,7 +1114,7 @@ void process_commands()
1110 1114
         destination[Y_AXIS]=current_position[Y_AXIS];
1111 1115
         destination[Z_AXIS]=current_position[Z_AXIS];
1112 1116
         current_position[Z_AXIS]+=retract_zlift;
1113
-        destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length; 
1117
+        destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length;
1114 1118
         feedrate=retract_recover_feedrate;
1115 1119
         retracted=false;
1116 1120
         prepare_move();
@@ -1224,10 +1228,10 @@ void process_commands()
1224 1228
         // reset state used by the different modes
1225 1229
         memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
1226 1230
         delayed_move_time = 0;
1227
-        active_extruder_parked = true; 
1228
-      #else      
1231
+        active_extruder_parked = true;
1232
+      #else
1229 1233
         HOMEAXIS(X);
1230
-      #endif         
1234
+      #endif
1231 1235
       }
1232 1236
 
1233 1237
       if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
@@ -1246,7 +1250,7 @@ void process_commands()
1246 1250
           current_position[Y_AXIS]=code_value()+add_homeing[1];
1247 1251
         }
1248 1252
       }
1249
-      
1253
+
1250 1254
       #if Z_HOME_DIR < 0                      // If homing towards BED do Z last
1251 1255
         #ifndef Z_SAFE_HOMING
1252 1256
           if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
@@ -1258,14 +1262,14 @@ void process_commands()
1258 1262
             #endif
1259 1263
             HOMEAXIS(Z);
1260 1264
           }
1261
-        #else                      // Z Safe mode activated. 
1265
+        #else                      // Z Safe mode activated.
1262 1266
           if(home_all_axis) {
1263 1267
             destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER);
1264 1268
             destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER);
1265 1269
             destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);    // Set destination away from bed
1266 1270
             feedrate = XY_TRAVEL_SPEED;
1267 1271
             current_position[Z_AXIS] = 0;
1268
-			
1272
+
1269 1273
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1270 1274
             plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
1271 1275
             st_synchronize();
@@ -1283,7 +1287,7 @@ void process_commands()
1283 1287
               && (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER <= Y_MAX_POS)) {
1284 1288
 
1285 1289
               current_position[Z_AXIS] = 0;
1286
-              plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);			  
1290
+              plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1287 1291
               destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);    // Set destination away from bed
1288 1292
               feedrate = max_feedrate[Z_AXIS];
1289 1293
               plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
@@ -1303,8 +1307,8 @@ void process_commands()
1303 1307
         #endif
1304 1308
       #endif
1305 1309
 
1306
-      
1307
-     
1310
+
1311
+
1308 1312
       if(code_seen(axis_codes[Z_AXIS])) {
1309 1313
         if(code_value_long() != 0) {
1310 1314
           current_position[Z_AXIS]=code_value()+add_homeing[2];
@@ -1467,7 +1471,7 @@ void process_commands()
1467 1471
             run_z_probe();
1468 1472
             float z_at_xLeft_yFront = current_position[Z_AXIS];
1469 1473
             retract_z_probe();
1470
-            
1474
+
1471 1475
             SERIAL_PROTOCOLPGM("Bed x: ");
1472 1476
             SERIAL_PROTOCOL(LEFT_PROBE_BED_POSITION);
1473 1477
             SERIAL_PROTOCOLPGM(" y: ");
@@ -1485,7 +1489,7 @@ void process_commands()
1485 1489
             run_z_probe();
1486 1490
             float z_at_xRight_yFront = current_position[Z_AXIS];
1487 1491
             retract_z_probe(); // Retract Z Servo endstop if available
1488
-            
1492
+
1489 1493
             SERIAL_PROTOCOLPGM("Bed x: ");
1490 1494
             SERIAL_PROTOCOL(RIGHT_PROBE_BED_POSITION);
1491 1495
             SERIAL_PROTOCOLPGM(" y: ");
@@ -1500,10 +1504,10 @@ void process_commands()
1500 1504
          
1501 1505
             
1502 1506
 #endif // ACCURATE_BED_LEVELING
1503
-            st_synchronize();            
1507
+            st_synchronize();
1504 1508
 
1505 1509
             // The following code correct the Z height difference from z-probe position and hotend tip position.
1506
-            // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. 
1510
+            // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend.
1507 1511
             // When the bed is uneven, this height must be corrected.
1508 1512
             real_z = float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS];  //get the real Z (since the auto bed leveling is already correcting the plane)
1509 1513
             x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER;
@@ -1515,11 +1519,11 @@ void process_commands()
1515 1519
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1516 1520
         }
1517 1521
         break;
1518
-        
1522
+
1519 1523
     case 30: // G30 Single Z Probe
1520 1524
         {
1521 1525
             engage_z_probe(); // Engage Z Servo endstop if available
1522
-            
1526
+
1523 1527
             st_synchronize();
1524 1528
             // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly
1525 1529
             setup_for_endstop_move();
@@ -1670,14 +1674,14 @@ void process_commands()
1670 1674
         card.removeFile(strchr_pointer + 4);
1671 1675
       }
1672 1676
       break;
1673
-    case 32: //M32 - Select file and start SD print 
1677
+    case 32: //M32 - Select file and start SD print
1674 1678
     {
1675 1679
       if(card.sdprinting) {
1676 1680
         st_synchronize();
1677 1681
 
1678 1682
       }
1679
-      starpos = (strchr(strchr_pointer + 4,'*')); 
1680
-      
1683
+      starpos = (strchr(strchr_pointer + 4,'*'));
1684
+
1681 1685
       char* namestartpos = (strchr(strchr_pointer + 4,'!'));   //find ! to indicate filename string start.
1682 1686
       if(namestartpos==NULL)
1683 1687
       {
@@ -1685,16 +1689,16 @@ void process_commands()
1685 1689
       }
1686 1690
       else
1687 1691
         namestartpos++; //to skip the '!'
1688
-        
1692
+
1689 1693
       if(starpos!=NULL)
1690 1694
         *(starpos-1)='\0';
1691
-            
1695
+
1692 1696
       bool call_procedure=(code_seen('P'));
1693
-      
1694
-      if(strchr_pointer>namestartpos) 
1697
+
1698
+      if(strchr_pointer>namestartpos)
1695 1699
         call_procedure=false;  //false alert, 'P' found within filename
1696
-      
1697
-      if( card.cardOK ) 
1700
+
1701
+      if( card.cardOK )
1698 1702
       {
1699 1703
         card.openFile(namestartpos,true,!call_procedure);
1700 1704
         if(code_seen('S'))
@@ -1767,7 +1771,7 @@ void process_commands()
1767 1771
 #ifdef DUAL_X_CARRIAGE
1768 1772
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1769 1773
         setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1770
-#endif          
1774
+#endif
1771 1775
       setWatch();
1772 1776
       break;
1773 1777
     case 140: // M140 set bed temp
@@ -1823,7 +1827,7 @@ void process_commands()
1823 1827
             SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
1824 1828
           }
1825 1829
         #endif
1826
-		
1830
+
1827 1831
         SERIAL_PROTOCOLLN("");
1828 1832
       return;
1829 1833
       break;
@@ -1841,14 +1845,14 @@ void process_commands()
1841 1845
 #ifdef DUAL_X_CARRIAGE
1842 1846
         if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1843 1847
           setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1844
-#endif          
1848
+#endif
1845 1849
         CooldownNoWait = true;
1846 1850
       } else if (code_seen('R')) {
1847 1851
         setTargetHotend(code_value(), tmp_extruder);
1848 1852
 #ifdef DUAL_X_CARRIAGE
1849 1853
         if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1850 1854
           setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1851
-#endif          
1855
+#endif
1852 1856
         CooldownNoWait = false;
1853 1857
       }
1854 1858
       #ifdef AUTOTEMP
@@ -2012,7 +2016,7 @@ void process_commands()
2012 2016
             SET_OUTPUT(SUICIDE_PIN);
2013 2017
             WRITE(SUICIDE_PIN, HIGH);
2014 2018
         #endif
2015
-        
2019
+
2016 2020
         #ifdef ULTIPANEL
2017 2021
           powersupply = true;
2018 2022
           LCD_MESSAGEPGM(WELCOME_MSG);
@@ -2169,18 +2173,18 @@ void process_commands()
2169 2173
       #endif
2170 2174
       break;
2171 2175
       //TODO: update for all axis, use for loop
2172
-    #ifdef BLINKM  
2176
+    #ifdef BLINKM
2173 2177
     case 150: // M150
2174 2178
       {
2175 2179
         byte red;
2176 2180
         byte grn;
2177 2181
         byte blu;
2178
-        
2182
+
2179 2183
         if(code_seen('R')) red = code_value();
2180 2184
         if(code_seen('U')) grn = code_value();
2181 2185
         if(code_seen('B')) blu = code_value();
2182
-        
2183
-        SendColors(red,grn,blu);        
2186
+
2187
+        SendColors(red,grn,blu);
2184 2188
       }
2185 2189
       break;
2186 2190
     #endif //BLINKM
@@ -2302,7 +2306,7 @@ void process_commands()
2302 2306
       {
2303 2307
         extruder_offset[Z_AXIS][tmp_extruder] = code_value();
2304 2308
       }
2305
-      #endif       
2309
+      #endif
2306 2310
       SERIAL_ECHO_START;
2307 2311
       SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
2308 2312
       for(tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++)
@@ -2335,17 +2339,17 @@ void process_commands()
2335 2339
       }
2336 2340
     }
2337 2341
     break;
2338
-	
2342
+
2339 2343
 	case 226: // M226 P<pin number> S<pin state>- Wait until the specified pin reaches the state required
2340 2344
 	{
2341 2345
       if(code_seen('P')){
2342 2346
         int pin_number = code_value(); // pin number
2343 2347
         int pin_state = -1; // required pin state - default is inverted
2344
-        
2348
+
2345 2349
         if(code_seen('S')) pin_state = code_value(); // required pin state
2346
-      
2350
+
2347 2351
         if(pin_state >= -1 && pin_state <= 1){
2348
-        
2352
+
2349 2353
           for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++)
2350 2354
           {
2351 2355
             if (sensitive_pins[i] == pin_number)
@@ -2354,28 +2358,28 @@ void process_commands()
2354 2358
               break;
2355 2359
             }
2356 2360
           }
2357
-        
2361
+
2358 2362
           if (pin_number > -1)
2359 2363
           {
2360 2364
             st_synchronize();
2361
-            
2365
+
2362 2366
             pinMode(pin_number, INPUT);
2363
-            
2367
+
2364 2368
             int target;
2365 2369
             switch(pin_state){
2366 2370
             case 1:
2367 2371
               target = HIGH;
2368 2372
               break;
2369
-            
2373
+
2370 2374
             case 0:
2371 2375
               target = LOW;
2372 2376
               break;
2373
-            
2377
+
2374 2378
             case -1:
2375 2379
               target = !digitalRead(pin_number);
2376 2380
               break;
2377 2381
             }
2378
-            
2382
+
2379 2383
             while(digitalRead(pin_number) != target){
2380 2384
               manage_heater();
2381 2385
               manage_inactivity();
@@ -2385,7 +2389,7 @@ void process_commands()
2385 2389
         }
2386 2390
       }
2387 2391
     }
2388
-    break;	
2392
+    break;
2389 2393
 
2390 2394
     #if NUM_SERVOS > 0
2391 2395
     case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds
@@ -2561,13 +2565,13 @@ void process_commands()
2561 2565
         engage_z_probe();    // Engage Z Servo endstop if available
2562 2566
     }
2563 2567
     break;
2564
-    
2568
+
2565 2569
     case 402:
2566 2570
     {
2567 2571
         retract_z_probe();    // Retract Z Servo endstop if enabled
2568 2572
     }
2569 2573
     break;
2570
-#endif    
2574
+#endif
2571 2575
     case 500: // M500 Store settings in EEPROM
2572 2576
     {
2573 2577
         Config_StoreSettings();
@@ -2725,14 +2729,14 @@ void process_commands()
2725 2729
               //    M605 S0: Full control mode. The slicer has full control over x-carriage movement
2726 2730
               //    M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement
2727 2731
               //    M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn
2728
-              //                         millimeters x-offset and an optional differential hotend temperature of 
2732
+              //                         millimeters x-offset and an optional differential hotend temperature of
2729 2733
               //                         mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate
2730 2734
               //                         the first with a spacing of 100mm in the x direction and 2 degrees hotter.
2731 2735
               //
2732 2736
               //    Note: the X axis should be homed after changing dual x-carriage mode.
2733 2737
     {
2734 2738
         st_synchronize();
2735
-        
2739
+
2736 2740
         if (code_seen('S'))
2737 2741
           dual_x_carriage_mode = code_value();
2738 2742
 
@@ -2743,7 +2747,7 @@ void process_commands()
2743 2747
 
2744 2748
           if (code_seen('R'))
2745 2749
             duplicate_extruder_temp_offset = code_value();
2746
-            
2750
+
2747 2751
           SERIAL_ECHO_START;
2748 2752
           SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
2749 2753
           SERIAL_ECHO(" ");
@@ -2759,13 +2763,13 @@ void process_commands()
2759 2763
         {
2760 2764
           dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
2761 2765
         }
2762
-        
2766
+
2763 2767
         active_extruder_parked = false;
2764 2768
         extruder_duplication_enabled = false;
2765 2769
         delayed_move_time = 0;
2766 2770
     }
2767 2771
     break;
2768
-    #endif //DUAL_X_CARRIAGE         
2772
+    #endif //DUAL_X_CARRIAGE
2769 2773
 
2770 2774
     case 907: // M907 Set digital trimpot motor current using axis codes.
2771 2775
     {
@@ -2846,19 +2850,19 @@ void process_commands()
2846 2850
         // Save current position to return to after applying extruder offset
2847 2851
         memcpy(destination, current_position, sizeof(destination));
2848 2852
       #ifdef DUAL_X_CARRIAGE
2849
-        if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false && 
2853
+        if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false &&
2850 2854
             (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder)))
2851 2855
         {
2852 2856
           // Park old head: 1) raise 2) move to park position 3) lower
2853
-          plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT, 
2857
+          plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT,
2854 2858
                 current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
2855
-          plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT, 
2859
+          plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT,
2856 2860
                 current_position[E_AXIS], max_feedrate[X_AXIS], active_extruder);
2857
-          plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS], 
2861
+          plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS],
2858 2862
                 current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
2859 2863
           st_synchronize();
2860 2864
         }
2861
-        
2865
+
2862 2866
         // apply Y & Z extruder offset (x offset is already used in determining home pos)
2863 2867
         current_position[Y_AXIS] = current_position[Y_AXIS] -
2864 2868
                      extruder_offset[Y_AXIS][active_extruder] +
@@ -2866,7 +2870,7 @@ void process_commands()
2866 2870
         current_position[Z_AXIS] = current_position[Z_AXIS] -
2867 2871
                      extruder_offset[Z_AXIS][active_extruder] +
2868 2872
                      extruder_offset[Z_AXIS][tmp_extruder];
2869
-                     
2873
+
2870 2874
         active_extruder = tmp_extruder;
2871 2875
 
2872 2876
         // This function resets the max/min values - the current position may be overwritten below.
@@ -2874,18 +2878,18 @@ void process_commands()
2874 2878
 
2875 2879
         if (dual_x_carriage_mode == DXC_FULL_CONTROL_MODE)
2876 2880
         {
2877
-          current_position[X_AXIS] = inactive_extruder_x_pos; 
2881
+          current_position[X_AXIS] = inactive_extruder_x_pos;
2878 2882
           inactive_extruder_x_pos = destination[X_AXIS];
2879 2883
         }
2880 2884
         else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE)
2881 2885
         {
2882 2886
           active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position
2883 2887
           if (active_extruder == 0 || active_extruder_parked)
2884
-            current_position[X_AXIS] = inactive_extruder_x_pos; 
2888
+            current_position[X_AXIS] = inactive_extruder_x_pos;
2885 2889
           else
2886
-            current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset; 
2890
+            current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
2887 2891
           inactive_extruder_x_pos = destination[X_AXIS];
2888
-          extruder_duplication_enabled = false; 
2892
+          extruder_duplication_enabled = false;
2889 2893
         }
2890 2894
         else
2891 2895
         {
@@ -2895,7 +2899,7 @@ void process_commands()
2895 2899
           active_extruder_parked = true;
2896 2900
           delayed_move_time = 0;
2897 2901
         }
2898
-      #else    
2902
+      #else
2899 2903
         // Offset extruder (only by XY)
2900 2904
         int i;
2901 2905
         for(i = 0; i < 2; i++) {
@@ -3108,13 +3112,13 @@ void prepare_move()
3108 3112
     {
3109 3113
       // move duplicate extruder into correct duplication position.
3110 3114
       plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
3111
-      plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS], 
3115
+      plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS],
3112 3116
           current_position[E_AXIS], max_feedrate[X_AXIS], 1);
3113 3117
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
3114 3118
       st_synchronize();
3115 3119
       extruder_duplication_enabled = true;
3116 3120
       active_extruder_parked = false;
3117
-    }  
3121
+    }
3118 3122
     else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) // handle unparking of head
3119 3123
     {
3120 3124
       if (current_position[E_AXIS] == destination[E_AXIS])
@@ -3123,7 +3127,7 @@ void prepare_move()
3123 3127
         // be used as start of first non-travel move)
3124 3128
         if (delayed_move_time != 0xFFFFFFFFUL)
3125 3129
         {
3126
-          memcpy(current_position, destination, sizeof(current_position)); 
3130
+          memcpy(current_position, destination, sizeof(current_position));
3127 3131
           if (destination[Z_AXIS] > raised_parked_position[Z_AXIS])
3128 3132
             raised_parked_position[Z_AXIS] = destination[Z_AXIS];
3129 3133
           delayed_move_time = millis();
@@ -3133,9 +3137,9 @@ void prepare_move()
3133 3137
       delayed_move_time = 0;
3134 3138
       // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
3135 3139
       plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS],    current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
3136
-      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], 
3140
+      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS],
3137 3141
           current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder);
3138
-      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], 
3142
+      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
3139 3143
           current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
3140 3144
       active_extruder_parked = false;
3141 3145
     }
@@ -3301,7 +3305,7 @@ void manage_inactivity()
3301 3305
       // travel moves have been received so enact them
3302 3306
       delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
3303 3307
       memcpy(destination,current_position,sizeof(destination));
3304
-      prepare_move(); 
3308
+      prepare_move();
3305 3309
     }
3306 3310
   #endif
3307 3311
   #ifdef TEMP_STAT_LEDS

+ 105
- 13
Marlin/example_configurations/delta/Configuration.h 파일 보기

@@ -5,6 +5,13 @@
5 5
 // Advanced settings can be found in Configuration_adv.h
6 6
 // BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
7 7
 
8
+//===========================================================================
9
+//============================= DELTA Printer ===============================
10
+//===========================================================================
11
+// For a Delta printer rplace the configuration files wilth the files in the
12
+// example_configurations/delta directory.
13
+//
14
+
8 15
 // User-specified version info of this build to display in [Pronterface, etc] terminal window during
9 16
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
10 17
 // build by the user have been successfully uploaded into firmware.
@@ -18,13 +25,18 @@
18 25
 
19 26
 // This determines the communication speed of the printer
20 27
 #define BAUDRATE 250000
21
-//#define BAUDRATE 115200
28
+
29
+// This enables the serial port associated to the Bluetooth interface
30
+//#define BTENABLED              // Enable BT interface on AT90USB devices
31
+
22 32
 
23 33
 //// The following define selects which electronics board you have. Please choose the one that matches your setup
24 34
 // 10 = Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
25 35
 // 11 = Gen7 v1.1, v1.2 = 11
26 36
 // 12 = Gen7 v1.3
27 37
 // 13 = Gen7 v1.4
38
+// 2  = Cheaptronic v1.0
39
+// 20 = Sethi 3D_1
28 40
 // 3  = MEGA/RAMPS up to 1.2 = 3
29 41
 // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
30 42
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
@@ -38,6 +50,7 @@
38 50
 // 64 = STB V1.1
39 51
 // 65 = Azteeg X1
40 52
 // 66 = Melzi with ATmega1284 (MaKr3d version)
53
+// 67 = Azteeg X3
41 54
 // 7  = Ultimaker
42 55
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
43 56
 // 77 = 3Drag Controller
@@ -45,6 +58,7 @@
45 58
 // 80 = Rumba
46 59
 // 81 = Printrboard (AT90USB1286)
47 60
 // 82 = Brainwave (AT90USB646)
61
+// 83 = SAV Mk-I (AT90USB1286)
48 62
 // 9  = Gen3+
49 63
 // 70 = Megatronics
50 64
 // 701= Megatronics v2.0
@@ -61,6 +75,10 @@
61 75
 // Define this to set a custom name for your generic Mendel,
62 76
 // #define CUSTOM_MENDEL_NAME "This Mendel"
63 77
 
78
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
79
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
80
+// #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
81
+
64 82
 // This defines the number of extruders
65 83
 #define EXTRUDERS 1
66 84
 
@@ -70,6 +88,8 @@
70 88
 
71 89
 #define POWER_SUPPLY 1
72 90
 
91
+// Define this to have the electronics keep the powersupply off on startup. If you don't know what this is leave it.
92
+// #define PS_DEFAULT_OFF
73 93
 
74 94
 //===========================================================================
75 95
 //============================== Delta Settings =============================
@@ -125,9 +145,10 @@
125 145
 // 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
126 146
 // 3 is mendel-parts thermistor (4.7k pullup)
127 147
 // 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
128
-// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan) (4.7k pullup)
148
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
129 149
 // 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
130 150
 // 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
151
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
131 152
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
132 153
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
133 154
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
@@ -137,7 +158,7 @@
137 158
 //                          (but gives greater accuracy and more stable PID)
138 159
 // 51 is 100k thermistor - EPCOS (1k pullup)
139 160
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
140
-// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan) (1k pullup)
161
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
141 162
 
142 163
 #define TEMP_SENSOR_0 -1
143 164
 #define TEMP_SENSOR_1 -1
@@ -282,16 +303,15 @@
282 303
 #endif
283 304
 
284 305
 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
285
-const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
286
-const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
287
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
288
-const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
289
-const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
290
-const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
291
-
292
-// deltas never have min endstops
306
+const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
307
+const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
308
+const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
309
+const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
310
+const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
311
+const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
312
+//#define DISABLE_MAX_ENDSTOPS
313
+// Deltas never have min endstops
293 314
 #define DISABLE_MIN_ENDSTOPS
294
-
295 315
 // Disable max endstops for compatibility with endstop checking routine
296 316
 #if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
297 317
   #define DISABLE_MAX_ENDSTOPS
@@ -338,6 +358,58 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
338 358
 #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
339 359
 #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
340 360
 #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
361
+//============================= Bed Auto Leveling ===========================
362
+
363
+//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
364
+
365
+#ifdef ENABLE_AUTO_BED_LEVELING
366
+
367
+  // these are the positions on the bed to do the probing
368
+  #define LEFT_PROBE_BED_POSITION 15
369
+  #define RIGHT_PROBE_BED_POSITION 170
370
+  #define BACK_PROBE_BED_POSITION 180
371
+  #define FRONT_PROBE_BED_POSITION 20
372
+
373
+  // these are the offsets to the prob relative to the extruder tip (Hotend - Probe)
374
+  #define X_PROBE_OFFSET_FROM_EXTRUDER -25
375
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
376
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
377
+
378
+  #define Z_RAISE_BEFORE_HOMING 4       // (in mm) Raise Z before homing (G28) for Probe Clearance.
379
+                                        // Be sure you have this distance over your Z_MAX_POS in case
380
+
381
+  #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
382
+
383
+  #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
384
+  #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
385
+
386
+
387
+  //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
388
+  //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
389
+  // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
390
+
391
+//  #define PROBE_SERVO_DEACTIVATION_DELAY 300
392
+
393
+
394
+//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing,
395
+//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
396
+
397
+  #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
398
+                          // When defined, it will:
399
+                          // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
400
+                          // - If stepper drivers timeout, it will need X and Y homing again before Z homing
401
+                          // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
402
+                          // - Block Z homing only when the probe is outside bed area.
403
+
404
+  #ifdef Z_SAFE_HOMING
405
+
406
+    #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2)    // X point for Z homing when homing all axis (G28)
407
+    #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2)    // Y point for Z homing when homing all axis (G28)
408
+
409
+  #endif
410
+
411
+#endif
412
+
341 413
 
342 414
 // The position of the homing switches
343 415
 //#define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
@@ -406,7 +478,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
406 478
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
407 479
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
408 480
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
409
-
481
+//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
482
+//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
410 483
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
411 484
 //#define ULTIPANEL  //the ultipanel as on thingiverse
412 485
 
@@ -510,6 +583,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
510 583
   #define ULTIPANEL
511 584
 #endif
512 585
 
586
+// Shift register panels
587
+// ---------------------
588
+// 2 wire Non-latching LCD SR from:
589
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
590
+//#define SR_LCD
591
+#ifdef SR_LCD
592
+   #define SR_LCD_2W_NL    // Non latching 2 wire shiftregister
593
+   //#define NEWPANEL
594
+#endif
595
+
596
+
513 597
 #ifdef ULTIPANEL
514 598
 //  #define NEWPANEL  //enable this if you have a click-encoder panel
515 599
   #define SDSUPPORT
@@ -543,6 +627,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
543 627
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
544 628
 //#define FAST_PWM_FAN
545 629
 
630
+// Temperature status leds that display the hotend and bet temperature.
631
+// If alle hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
632
+// Otherwise the RED led is on. There is 1C hysteresis.
633
+//#define TEMP_STAT_LEDS
634
+
546 635
 // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
547 636
 // which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
548 637
 // is too low, you should also increment SOFT_PWM_SCALE.
@@ -564,6 +653,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
564 653
 // Support for the BariCUDA Paste Extruder.
565 654
 //#define BARICUDA
566 655
 
656
+//define BlinkM/CyzRgb Support
657
+//#define BLINKM
658
+
567 659
 /*********************************************************************\
568 660
 * R/C SERVO support
569 661
 * Sponsored by TrinityLabs, Reworked by codexmas

+ 84
- 6
Marlin/example_configurations/delta/Configuration_adv.h 파일 보기

@@ -40,6 +40,10 @@
40 40
   #define AUTOTEMP_OLDWEIGHT 0.98
41 41
 #endif
42 42
 
43
+//Show Temperature ADC value
44
+//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
45
+//#define SHOW_TEMP_ADC_VALUES
46
+
43 47
 //  extruder run-out prevention. 
44 48
 //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
45 49
 //#define EXTRUDER_RUNOUT_PREVENT  
@@ -146,6 +150,21 @@
146 150
   #define EXTRUDERS 1
147 151
 #endif
148 152
 
153
+// Same again but for Y Axis.
154
+//#define Y_DUAL_STEPPER_DRIVERS
155
+
156
+// Define if the two Y drives need to rotate in opposite directions
157
+#define INVERT_Y2_VS_Y_DIR true
158
+
159
+#ifdef Y_DUAL_STEPPER_DRIVERS
160
+  #undef EXTRUDERS
161
+  #define EXTRUDERS 1
162
+#endif
163
+
164
+#if defined (Z_DUAL_STEPPER_DRIVERS) && defined (Y_DUAL_STEPPER_DRIVERS)
165
+  #error "You cannot have dual drivers for both Y and Z"
166
+#endif
167
+
149 168
 // Enable this for dual x-carriage printers. 
150 169
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
151 170
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
@@ -155,8 +174,8 @@
155 174
 // Configuration for second X-carriage
156 175
 // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
157 176
 // 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 
177
+#define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
178
+#define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed 
160 179
 #define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
161 180
 #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position 
162 181
     // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software 
@@ -169,14 +188,35 @@
169 188
 #define X2_STEP_PIN 25
170 189
 #define X2_DIR_PIN 23
171 190
 
172
-#endif // DUAL_X_CARRIAGE
191
+// There are a few selectable movement modes for dual x-carriages using M605 S<mode>
192
+//    Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
193
+//                           as long as it supports dual x-carriages. (M605 S0)
194
+//    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
195
+//                           that additional slicer support is not required. (M605 S1)
196
+//    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all  
197
+//                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
198
+//                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
199
+
200
+// This is the default power-up mode which can be later using M605. 
201
+#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 
202
+
203
+// As the x-carriages are independent we can now account for any relative Z offset
204
+#define EXTRUDER1_Z_OFFSET 0.0           // z offset relative to extruder 0
205
+
206
+// Default settings in "Auto-park Mode" 
207
+#define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
208
+#define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
209
+
210
+// Default x offset in duplication mode (typically set to half print bed width)
211
+#define DEFAULT_DUPLICATION_X_OFFSET 100
212
+
213
+#endif //DUAL_X_CARRIAGE
173 214
     
174 215
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
175 216
 #define X_HOME_RETRACT_MM 5 
176
-#define Y_HOME_RETRACT_MM 5
217
+#define Y_HOME_RETRACT_MM 5 
177 218
 #define Z_HOME_RETRACT_MM 5 // deltas need the same for all three axis
178 219
 
179
-
180 220
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
181 221
 
182 222
 #define AXIS_RELATIVE_MODES {false, false, false, false}
@@ -238,6 +278,11 @@
238 278
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
239 279
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
240 280
 
281
+#define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the filesystem block order. 
282
+// if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that.
283
+// using:
284
+//#define MENU_ADDAUTOSTART
285
+
241 286
 // The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
242 287
 //#define USE_WATCHDOG
243 288
 
@@ -251,6 +296,26 @@
251 296
 // Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
252 297
 //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
253 298
 
299
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
300
+// it can e.g. be used to change z-positions in the print startup phase in realtime
301
+// does not respect endstops!
302
+//#define BABYSTEPPING
303
+#ifdef BABYSTEPPING
304
+  #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
305
+  #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
306
+  #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
307
+  
308
+  #ifdef COREXY
309
+    #error BABYSTEPPING not implemented for COREXY yet.
310
+  #endif
311
+
312
+  #ifdef DELTA
313
+    #ifdef BABYSTEP_XY
314
+      #error BABYSTEPPING only implemented for Z axis on deltabots.
315
+    #endif
316
+  #endif
317
+#endif
318
+
254 319
 // extruder advance constant (s2/mm3)
255 320
 //
256 321
 // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2
@@ -302,6 +367,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
302 367
   #define PS_ON_ASLEEP LOW
303 368
 #endif
304 369
 
370
+// Control heater 0 and heater 1 in parallel.
371
+//#define HEATERS_PARALLEL
372
+
305 373
 //===========================================================================
306 374
 //=============================Buffers           ============================
307 375
 //===========================================================================
@@ -332,7 +400,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
332 400
 
333 401
 //adds support for experimental filament exchange support M600; requires display
334 402
 #ifdef ULTIPANEL
335
-  //#define FILAMENTCHANGEENABLE
403
+  #define FILAMENTCHANGEENABLE
336 404
   #ifdef FILAMENTCHANGEENABLE
337 405
     #define FILAMENTCHANGE_XPOS 3
338 406
     #define FILAMENTCHANGE_YPOS 3
@@ -341,6 +409,12 @@ const unsigned int dropsegments=5; //everything with less than this number of st
341 409
     #define FILAMENTCHANGE_FINALRETRACT -100
342 410
   #endif
343 411
 #endif
412
+
413
+#ifdef FILAMENTCHANGEENABLE
414
+  #ifdef EXTRUDER_RUNOUT_PREVENT
415
+    #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
416
+  #endif 
417
+#endif
344 418
  
345 419
 //===========================================================================
346 420
 //=============================  Define Defines  ============================
@@ -349,6 +423,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
349 423
   #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
350 424
 #endif
351 425
 
426
+#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
427
+  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
428
+#endif
429
+
352 430
 #if TEMP_SENSOR_0 > 0
353 431
   #define THERMISTORHEATER_0 TEMP_SENSOR_0
354 432
   #define HEATER_0_USES_THERMISTOR

+ 101
- 0
Marlin/pins.h 파일 보기

@@ -2288,6 +2288,107 @@
2288 2288
 
2289 2289
 #endif
2290 2290
 
2291
+/****************************************************************************************
2292
+* Cheaptronic v1.0
2293
+*
2294
+****************************************************************************************/
2295
+#if MOTHERBOARD == 2
2296
+ #define KNOWN_BOARD 1
2297
+
2298
+ #ifndef __AVR_ATmega2560__
2299
+ #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
2300
+ #endif
2301
+
2302
+ #define LARGE_FLASH        true
2303
+
2304
+ //X motor stepper
2305
+ #define X_STEP_PIN 14
2306
+ #define X_DIR_PIN 15
2307
+ #define X_ENABLE_PIN 24
2308
+ 
2309
+ //X endstop
2310
+ #define X_MIN_PIN 3
2311
+ #define X_MAX_PIN -1
2312
+
2313
+ //Y motor stepper
2314
+ #define Y_STEP_PIN 35
2315
+ #define Y_DIR_PIN 36
2316
+ #define Y_ENABLE_PIN 31
2317
+
2318
+ //Y endstop
2319
+ #define Y_MIN_PIN 2
2320
+ #define Y_MAX_PIN -1
2321
+ 
2322
+ //Z motor stepper
2323
+ #define Z_STEP_PIN 40
2324
+ #define Z_DIR_PIN 41
2325
+ #define Z_ENABLE_PIN 37
2326
+
2327
+ //Z endstop
2328
+ #define Z_MIN_PIN 5
2329
+ #define Z_MAX_PIN -1
2330
+ 
2331
+ //Extruder 0 stepper
2332
+ #define E0_STEP_PIN 26
2333
+ #define E0_DIR_PIN 28
2334
+ #define E0_ENABLE_PIN 25
2335
+
2336
+ //Extruder 1 stepper
2337
+ #define E1_STEP_PIN 33
2338
+ #define E1_DIR_PIN 34
2339
+ #define E1_ENABLE_PIN 30
2340
+
2341
+ #define SDPOWER -1
2342
+ #define SDSS -1
2343
+ #define LED_PIN -1
2344
+
2345
+ //FAN
2346
+ #define FAN_PIN -1
2347
+
2348
+ #define PS_ON_PIN -1
2349
+ #define KILL_PIN -1
2350
+
2351
+ #define HEATER_0_PIN 19 // EXTRUDER 1
2352
+ #define HEATER_1_PIN 23 // EXTRUDER 2
2353
+ //HeatedBad
2354
+ #define HEATER_BED_PIN 22
2355
+ //Cheaptronic v1.0 hasent EXTRUDER 3
2356
+ #define HEATER_2_PIN -1
2357
+ 
2358
+ //Temperature sensors
2359
+ #define TEMP_0_PIN 15
2360
+ #define TEMP_1_PIN 14
2361
+ #define TEMP_2_PIN -1
2362
+ #define TEMP_BED_PIN 13
2363
+
2364
+ //Cheaptronic v1.0 dont support LCD
2365
+ #define LCD_PINS_RS -1
2366
+ #define LCD_PINS_ENABLE -1
2367
+ #define LCD_PINS_D4 -1
2368
+ #define LCD_PINS_D5 -1
2369
+ #define LCD_PINS_D6 -1
2370
+ #define LCD_PINS_D7 -1
2371
+
2372
+ //Cheaptronic v1.0 dont support keypad
2373
+ #define BTN_EN1 -1
2374
+ #define BTN_EN2 -1
2375
+ #define BTN_ENC -1
2376
+
2377
+ #define BLEN_C 2
2378
+ #define BLEN_B 1
2379
+ #define BLEN_A 0
2380
+
2381
+ //Cheaptronic v1.0 does not use this port
2382
+ #define SDCARDDETECT -1
2383
+
2384
+ //encoder rotation values
2385
+ #define encrot0 0
2386
+ #define encrot1 2
2387
+ #define encrot2 3
2388
+ #define encrot3 1
2389
+
2390
+#endif
2391
+
2291 2392
 
2292 2393
 
2293 2394
 #ifndef KNOWN_BOARD

+ 3
- 3
Marlin/planner.cpp 파일 보기

@@ -186,9 +186,9 @@ void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exi
186 186
 
187 187
   long acceleration = block->acceleration_st;
188 188
   int32_t accelerate_steps =
189
-    ceil(estimate_acceleration_distance(block->initial_rate, block->nominal_rate, acceleration));
189
+    ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, acceleration));
190 190
   int32_t decelerate_steps =
191
-    floor(estimate_acceleration_distance(block->nominal_rate, block->final_rate, -acceleration));
191
+    floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -acceleration));
192 192
 
193 193
   // Calculate the size of Plateau of Nominal Rate.
194 194
   int32_t plateau_steps = block->step_event_count-accelerate_steps-decelerate_steps;
@@ -197,7 +197,7 @@ void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exi
197 197
   // have to use intersection_distance() to calculate when to abort acceleration and start braking
198 198
   // in order to reach the final_rate exactly at the end of this block.
199 199
   if (plateau_steps < 0) {
200
-    accelerate_steps = ceil(intersection_distance(block->initial_rate, block->final_rate, acceleration, block->step_event_count));
200
+    accelerate_steps = ceil(intersection_distance(initial_rate, final_rate, acceleration, block->step_event_count));
201 201
     accelerate_steps = max(accelerate_steps,0); // Check limits due to numerical round-off
202 202
     accelerate_steps = min((uint32_t)accelerate_steps,block->step_event_count);//(We can cast here to unsigned, because the above line ensures that we are above zero)
203 203
     plateau_steps = 0;

+ 31
- 27
Marlin/ultralcd.cpp 파일 보기

@@ -90,12 +90,16 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
90 90
 #define ENCODER_FEEDRATE_DEADZONE 10
91 91
 
92 92
 #if !defined(LCD_I2C_VIKI)
93
-  #define ENCODER_STEPS_PER_MENU_ITEM 5
93
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
94
+    #define ENCODER_STEPS_PER_MENU_ITEM 5
95
+  #endif
94 96
   #ifndef ENCODER_PULSES_PER_STEP
95 97
     #define ENCODER_PULSES_PER_STEP 1
96 98
   #endif
97 99
 #else
98
-  #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
100
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
101
+    #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
102
+  #endif
99 103
   #ifndef ENCODER_PULSES_PER_STEP
100 104
     #define ENCODER_PULSES_PER_STEP 1
101 105
   #endif
@@ -207,7 +211,7 @@ static void lcd_status_screen()
207 211
     else if (feedmultiply == 100 && int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE)
208 212
     {
209 213
         feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE;
210
-        encoderPosition = 0;	
214
+        encoderPosition = 0;
211 215
     }
212 216
     else if (feedmultiply != 100)
213 217
     {
@@ -407,7 +411,7 @@ static void lcd_tune_menu()
407 411
 #endif
408 412
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
409 413
     MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
410
-    
414
+
411 415
 #ifdef BABYSTEPPING
412 416
     #ifdef BABYSTEP_XY
413 417
       MENU_ITEM(submenu, "Babystep X", lcd_babystep_x);
@@ -719,7 +723,7 @@ static void lcd_control_motion_menu()
719 723
     MENU_ITEM_EDIT(float52, MSG_XSTEPS, &axis_steps_per_unit[X_AXIS], 5, 9999);
720 724
     MENU_ITEM_EDIT(float52, MSG_YSTEPS, &axis_steps_per_unit[Y_AXIS], 5, 9999);
721 725
     MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &axis_steps_per_unit[Z_AXIS], 5, 9999);
722
-    MENU_ITEM_EDIT(float51, MSG_ESTEPS, &axis_steps_per_unit[E_AXIS], 5, 9999);    
726
+    MENU_ITEM_EDIT(float51, MSG_ESTEPS, &axis_steps_per_unit[E_AXIS], 5, 9999);
723 727
 #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
724 728
     MENU_ITEM_EDIT(bool, "Endstop abort", &abort_on_endstop_hit);
725 729
 #endif
@@ -781,7 +785,7 @@ static void lcd_sd_updir()
781 785
 
782 786
 void lcd_sdcard_menu()
783 787
 {
784
-    if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) 
788
+    if (lcdDrawUpdate == 0 && LCD_CLICKED == 0)
785 789
         return;	// nothing to do (so don't thrash the SD card)
786 790
     uint16_t fileCnt = card.getnrfilenames();
787 791
     START_MENU();
@@ -795,7 +799,7 @@ void lcd_sdcard_menu()
795 799
     }else{
796 800
         MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
797 801
     }
798
-    
802
+
799 803
     for(uint16_t i=0;i<fileCnt;i++)
800 804
     {
801 805
         if (_menuItemNr == _lineNr)
@@ -982,14 +986,14 @@ void lcd_init()
982 986
 
983 987
 #ifdef NEWPANEL
984 988
     pinMode(BTN_EN1,INPUT);
985
-    pinMode(BTN_EN2,INPUT); 
989
+    pinMode(BTN_EN2,INPUT);
986 990
     pinMode(SDCARDDETECT,INPUT);
987 991
     WRITE(BTN_EN1,HIGH);
988 992
     WRITE(BTN_EN2,HIGH);
989 993
   #if BTN_ENC > 0
990
-    pinMode(BTN_ENC,INPUT); 
994
+    pinMode(BTN_ENC,INPUT);
991 995
     WRITE(BTN_ENC,HIGH);
992
-  #endif    
996
+  #endif
993 997
   #ifdef REPRAPWORLD_KEYPAD
994 998
     pinMode(SHIFT_CLK,OUTPUT);
995 999
     pinMode(SHIFT_LD,OUTPUT);
@@ -1007,9 +1011,9 @@ void lcd_init()
1007 1011
      pinMode(SHIFT_EN,OUTPUT);
1008 1012
      pinMode(SHIFT_OUT,INPUT);
1009 1013
      WRITE(SHIFT_OUT,HIGH);
1010
-     WRITE(SHIFT_LD,HIGH); 
1014
+     WRITE(SHIFT_LD,HIGH);
1011 1015
      WRITE(SHIFT_EN,LOW);
1012
-   #endif // SR_LCD_2W_NL    
1016
+   #endif // SR_LCD_2W_NL
1013 1017
 #endif//!NEWPANEL
1014 1018
 
1015 1019
 #if (SDCARDDETECT > 0)
@@ -1020,28 +1024,28 @@ void lcd_init()
1020 1024
     slow_buttons = 0;
1021 1025
     #endif
1022 1026
     lcd_buttons_update();
1023
-#ifdef ULTIPANEL    
1027
+#ifdef ULTIPANEL
1024 1028
     encoderDiff = 0;
1025
-#endif    
1029
+#endif
1026 1030
 }
1027 1031
 
1028 1032
 void lcd_update()
1029 1033
 {
1030 1034
     static unsigned long timeoutToStatus = 0;
1031
-    
1035
+
1032 1036
     #ifdef LCD_HAS_SLOW_BUTTONS
1033 1037
     slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context
1034 1038
     #endif
1035
-    
1039
+
1036 1040
     lcd_buttons_update();
1037
-    
1041
+
1038 1042
     #if (SDCARDDETECT > 0)
1039 1043
     if((IS_SD_INSERTED != lcd_oldcardstatus))
1040 1044
     {
1041 1045
         lcdDrawUpdate = 2;
1042 1046
         lcd_oldcardstatus = IS_SD_INSERTED;
1043 1047
         lcd_implementation_init(); // to maybe revive the lcd if static electricty killed it.
1044
-        
1048
+
1045 1049
         if(lcd_oldcardstatus)
1046 1050
         {
1047 1051
             card.initsd();
@@ -1054,7 +1058,7 @@ void lcd_update()
1054 1058
         }
1055 1059
     }
1056 1060
     #endif//CARDINSERTED
1057
-    
1061
+
1058 1062
     if (lcd_next_update_millis < millis())
1059 1063
     {
1060 1064
 #ifdef ULTIPANEL
@@ -1095,7 +1099,7 @@ void lcd_update()
1095 1099
 #ifdef DOGLCD        // Changes due to different driver architecture of the DOGM display
1096 1100
         blink++;     // Variable for fan animation and alive dot
1097 1101
         u8g.firstPage();
1098
-        do 
1102
+        do
1099 1103
         {
1100 1104
             u8g.setFont(u8g_font_6x10_marlin);
1101 1105
             u8g.setPrintPos(125,0);
@@ -1105,7 +1109,7 @@ void lcd_update()
1105 1109
             (*currentMenu)();
1106 1110
             if (!lcdDrawUpdate)  break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next()
1107 1111
         } while( u8g.nextPage() );
1108
-#else        
1112
+#else
1109 1113
         (*currentMenu)();
1110 1114
 #endif
1111 1115
 
@@ -1159,7 +1163,7 @@ void lcd_reset_alert_level()
1159 1163
 void lcd_setcontrast(uint8_t value)
1160 1164
 {
1161 1165
     lcd_contrast = value & 63;
1162
-    u8g.setContrast(lcd_contrast);	
1166
+    u8g.setContrast(lcd_contrast);
1163 1167
 }
1164 1168
 #endif
1165 1169
 
@@ -1199,7 +1203,7 @@ void lcd_buttons_update()
1199 1203
     WRITE(SHIFT_LD,HIGH);
1200 1204
     unsigned char tmp_buttons=0;
1201 1205
     for(int8_t i=0;i<8;i++)
1202
-    { 
1206
+    {
1203 1207
         newbutton = newbutton>>1;
1204 1208
         if(READ(SHIFT_OUT))
1205 1209
             newbutton|=(1<<7);
@@ -1249,14 +1253,14 @@ void lcd_buttons_update()
1249 1253
 }
1250 1254
 
1251 1255
 void lcd_buzz(long duration, uint16_t freq)
1252
-{ 
1256
+{
1253 1257
 #ifdef LCD_USE_I2C_BUZZER
1254 1258
   lcd.buzz(duration,freq);
1255
-#endif   
1259
+#endif
1256 1260
 }
1257 1261
 
1258
-bool lcd_clicked() 
1259
-{ 
1262
+bool lcd_clicked()
1263
+{
1260 1264
   return LCD_CLICKED;
1261 1265
 }
1262 1266
 #endif//ULTIPANEL

Loading…
취소
저장