Browse Source

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

Bernhard 13 years ago
parent
commit
12e8edcac3
5 changed files with 142 additions and 74 deletions
  1. 3
    2
      Marlin/Configuration.h
  2. 5
    0
      Marlin/Marlin.pde
  3. 9
    3
      Marlin/planner.cpp
  4. 123
    69
      Marlin/stepper.cpp
  5. 2
    0
      Marlin/stepper.h

+ 3
- 2
Marlin/Configuration.h View File

170
 const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
170
 const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. 
171
 // For optos H21LOB set to true, for Mendel-Parts newer optos TCST2103 set to false
171
 // For optos H21LOB set to true, for Mendel-Parts newer optos TCST2103 set to false
172
 
172
 
173
+//#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
173
 
174
 
174
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
175
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
175
 #define X_ENABLE_ON 0
176
 #define X_ENABLE_ON 0
279
 #ifdef ADVANCE
280
 #ifdef ADVANCE
280
   #define EXTRUDER_ADVANCE_K .3
281
   #define EXTRUDER_ADVANCE_K .3
281
 
282
 
282
-  #define D_FILAMENT 1.7
283
-  #define STEPS_MM_E 65
283
+  #define D_FILAMENT 2.85
284
+  #define STEPS_MM_E 836
284
   #define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
285
   #define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159)
285
   #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA)
286
   #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA)
286
 
287
 

+ 5
- 0
Marlin/Marlin.pde View File

529
       saved_feedmultiply = feedmultiply;
529
       saved_feedmultiply = feedmultiply;
530
       feedmultiply = 100;
530
       feedmultiply = 100;
531
       
531
       
532
+      enable_endstops(true);
533
+      
532
       for(int8_t i=0; i < NUM_AXIS; i++) {
534
       for(int8_t i=0; i < NUM_AXIS; i++) {
533
         destination[i] = current_position[i];
535
         destination[i] = current_position[i];
534
       }
536
       }
564
         HOMEAXIS(Z);
566
         HOMEAXIS(Z);
565
 	current_position[2]=code_value()+add_homeing[2];
567
 	current_position[2]=code_value()+add_homeing[2];
566
       }       
568
       }       
569
+      #ifdef ENDSTOPS_ONLY_FOR_HOMING
570
+        enable_endstops(false);
571
+      #endif
567
       
572
       
568
       feedrate = saved_feedrate;
573
       feedrate = saved_feedrate;
569
       feedmultiply = saved_feedmultiply;
574
       feedmultiply = saved_feedmultiply;

+ 9
- 3
Marlin/planner.cpp View File

200
   
200
   
201
  // block->accelerate_until = accelerate_steps;
201
  // block->accelerate_until = accelerate_steps;
202
  // block->decelerate_after = accelerate_steps+plateau_steps;
202
  // block->decelerate_after = accelerate_steps+plateau_steps;
203
-  
204
   CRITICAL_SECTION_START;  // Fill variables used by the stepper in a critical section
203
   CRITICAL_SECTION_START;  // Fill variables used by the stepper in a critical section
205
   if(block->busy == false) { // Don't update variables if block is busy.
204
   if(block->busy == false) { // Don't update variables if block is busy.
206
     block->accelerate_until = accelerate_steps;
205
     block->accelerate_until = accelerate_steps;
484
   // Bail if this is a zero-length block
483
   // Bail if this is a zero-length block
485
   if (block->step_event_count <=dropsegments) { return; };
484
   if (block->step_event_count <=dropsegments) { return; };
486
 
485
 
487
-  // Compute direction bits for this block
486
+  // Compute direction bits for this block 
488
   block->direction_bits = 0;
487
   block->direction_bits = 0;
489
   if (target[X_AXIS] < position[X_AXIS]) { block->direction_bits |= (1<<X_AXIS); }
488
   if (target[X_AXIS] < position[X_AXIS]) { block->direction_bits |= (1<<X_AXIS); }
490
   if (target[Y_AXIS] < position[Y_AXIS]) { block->direction_bits |= (1<<Y_AXIS); }
489
   if (target[Y_AXIS] < position[Y_AXIS]) { block->direction_bits |= (1<<Y_AXIS); }
725
     else {
724
     else {
726
       long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_st);
725
       long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_st);
727
       float advance = (STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K) * 
726
       float advance = (STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K) * 
728
-        (current_speed[E_AXIS] * current_speed[E_AXIS] * EXTRUTION_AREA * EXTRUTION_AREA / 3600.0)*65536;
727
+        (current_speed[E_AXIS] * current_speed[E_AXIS] * EXTRUTION_AREA * EXTRUTION_AREA)*256;
729
       block->advance = advance;
728
       block->advance = advance;
730
       if(acc_dist == 0) {
729
       if(acc_dist == 0) {
731
         block->advance_rate = 0;
730
         block->advance_rate = 0;
734
         block->advance_rate = advance / (float)acc_dist;
733
         block->advance_rate = advance / (float)acc_dist;
735
       }
734
       }
736
     }
735
     }
736
+    /*
737
+    SERIAL_ECHO_START;
738
+    SERIAL_ECHOPGM("advance :");
739
+    SERIAL_ECHO(block->advance/256.0);
740
+    SERIAL_ECHOPGM("advance rate :");
741
+    SERIAL_ECHOLN(block->advance_rate/256.0);
742
+    */
737
   #endif // ADVANCE
743
   #endif // ADVANCE
738
 
744
 
739
 
745
 

+ 123
- 69
Marlin/stepper.cpp View File

56
 volatile static unsigned long step_events_completed; // The number of step events executed in the current block
56
 volatile static unsigned long step_events_completed; // The number of step events executed in the current block
57
 #ifdef ADVANCE
57
 #ifdef ADVANCE
58
   static long advance_rate, advance, final_advance = 0;
58
   static long advance_rate, advance, final_advance = 0;
59
-  static short old_advance = 0;
59
+  static long old_advance = 0;
60
 #endif
60
 #endif
61
-static short e_steps;
61
+static long e_steps;
62
 static unsigned char busy = false; // TRUE when SIG_OUTPUT_COMPARE1A is being serviced. Used to avoid retriggering that handler.
62
 static unsigned char busy = false; // TRUE when SIG_OUTPUT_COMPARE1A is being serviced. Used to avoid retriggering that handler.
63
 static long acceleration_time, deceleration_time;
63
 static long acceleration_time, deceleration_time;
64
 //static unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate;
64
 //static unsigned long accelerate_until, decelerate_after, acceleration_rate, initial_rate, final_rate, nominal_rate;
79
 static bool old_z_min_endstop=false;
79
 static bool old_z_min_endstop=false;
80
 static bool old_z_max_endstop=false;
80
 static bool old_z_max_endstop=false;
81
 
81
 
82
+static bool check_endstops = true;
83
+
82
 volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0};
84
 volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0};
83
 volatile char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
85
 volatile char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
84
 
86
 
85
 //===========================================================================
87
 //===========================================================================
86
 //=============================functions         ============================
88
 //=============================functions         ============================
87
 //===========================================================================
89
 //===========================================================================
88
-  
90
+
91
+#ifdef ENDSTOPS_ONLY_FOR_HOMING
92
+  #define CHECK_ENDSTOPS  if(check_endstops)
93
+#else
94
+  #define CHECK_ENDSTOPS
95
+#endif
89
 
96
 
90
 // intRes = intIn1 * intIn2 >> 16
97
 // intRes = intIn1 * intIn2 >> 16
91
 // uses:
98
 // uses:
191
   endstop_z_hit=false;
198
   endstop_z_hit=false;
192
 }
199
 }
193
 
200
 
201
+void enable_endstops(bool check)
202
+{
203
+  check_endstops = check;
204
+}
205
+
194
 //         __________________________
206
 //         __________________________
195
 //        /|                        |\     _________________         ^
207
 //        /|                        |\     _________________         ^
196
 //       / |                        | \   /|               |\        |
208
 //       / |                        | \   /|               |\        |
254
   #ifdef ADVANCE
266
   #ifdef ADVANCE
255
     advance = current_block->initial_advance;
267
     advance = current_block->initial_advance;
256
     final_advance = current_block->final_advance;
268
     final_advance = current_block->final_advance;
269
+    // Do E steps + advance steps
270
+    e_steps += ((advance >>8) - old_advance);
271
+    old_advance = advance >>8;  
257
   #endif
272
   #endif
258
   deceleration_time = 0;
273
   deceleration_time = 0;
259
   // step_rate to timer interval
274
   // step_rate to timer interval
261
   acceleration_time = calc_timer(acc_step_rate);
276
   acceleration_time = calc_timer(acc_step_rate);
262
   OCR1A = acceleration_time;
277
   OCR1A = acceleration_time;
263
   OCR1A_nominal = calc_timer(current_block->nominal_rate);
278
   OCR1A_nominal = calc_timer(current_block->nominal_rate);
279
+  
280
+//    SERIAL_ECHO_START;
281
+//    SERIAL_ECHOPGM("advance :");
282
+//    SERIAL_ECHO(current_block->advance/256.0);
283
+//    SERIAL_ECHOPGM("advance rate :");
284
+//    SERIAL_ECHO(current_block->advance_rate/256.0);
285
+//    SERIAL_ECHOPGM("initial advance :");
286
+//  SERIAL_ECHO(current_block->initial_advance/256.0);
287
+//    SERIAL_ECHOPGM("final advance :");
288
+//    SERIAL_ECHOLN(current_block->final_advance/256.0);
289
+    
264
 }
290
 }
265
 
291
 
266
 // "The Stepper Driver Interrupt" - This timer interrupt is the workhorse.  
292
 // "The Stepper Driver Interrupt" - This timer interrupt is the workhorse.  
295
     if ((out_bits & (1<<X_AXIS)) != 0) {   // -direction
321
     if ((out_bits & (1<<X_AXIS)) != 0) {   // -direction
296
       WRITE(X_DIR_PIN, INVERT_X_DIR);
322
       WRITE(X_DIR_PIN, INVERT_X_DIR);
297
       count_direction[X_AXIS]=-1;
323
       count_direction[X_AXIS]=-1;
298
-      #if X_MIN_PIN > -1
299
-        bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
300
-        if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
301
-          endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
302
-          endstop_x_hit=true;
303
-          step_events_completed = current_block->step_event_count;
304
-        }
305
-        old_x_min_endstop = x_min_endstop;
306
-      #endif
324
+      CHECK_ENDSTOPS
325
+      {
326
+        #if X_MIN_PIN > -1
327
+          bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
328
+          if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
329
+            endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
330
+            endstop_x_hit=true;
331
+            step_events_completed = current_block->step_event_count;
332
+          }
333
+          old_x_min_endstop = x_min_endstop;
334
+        #endif
335
+      }
307
     }
336
     }
308
     else { // +direction 
337
     else { // +direction 
309
       WRITE(X_DIR_PIN,!INVERT_X_DIR);
338
       WRITE(X_DIR_PIN,!INVERT_X_DIR);
310
       count_direction[X_AXIS]=1;
339
       count_direction[X_AXIS]=1;
311
-      #if X_MAX_PIN > -1
312
-        bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
313
-        if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
314
-          endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
315
-          endstop_x_hit=true;
316
-          step_events_completed = current_block->step_event_count;
317
-        }
318
-        old_x_max_endstop = x_max_endstop;
319
-      #endif
340
+      CHECK_ENDSTOPS 
341
+      {
342
+        #if X_MAX_PIN > -1
343
+          bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
344
+          if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
345
+            endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
346
+            endstop_x_hit=true;
347
+            step_events_completed = current_block->step_event_count;
348
+          }
349
+          old_x_max_endstop = x_max_endstop;
350
+        #endif
351
+      }
320
     }
352
     }
321
 
353
 
322
     if ((out_bits & (1<<Y_AXIS)) != 0) {   // -direction
354
     if ((out_bits & (1<<Y_AXIS)) != 0) {   // -direction
323
       WRITE(Y_DIR_PIN,INVERT_Y_DIR);
355
       WRITE(Y_DIR_PIN,INVERT_Y_DIR);
324
       count_direction[Y_AXIS]=-1;
356
       count_direction[Y_AXIS]=-1;
325
-      #if Y_MIN_PIN > -1
326
-        bool y_min_endstop=(READ(Y_MIN_PIN) != Y_ENDSTOPS_INVERTING);
327
-        if(y_min_endstop && old_y_min_endstop && (current_block->steps_y > 0)) {
328
-          endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
329
-          endstop_y_hit=true;
330
-          step_events_completed = current_block->step_event_count;
331
-        }
332
-        old_y_min_endstop = y_min_endstop;
333
-      #endif
357
+      CHECK_ENDSTOPS
358
+      {
359
+        #if Y_MIN_PIN > -1
360
+          bool y_min_endstop=(READ(Y_MIN_PIN) != Y_ENDSTOPS_INVERTING);
361
+          if(y_min_endstop && old_y_min_endstop && (current_block->steps_y > 0)) {
362
+            endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
363
+            endstop_y_hit=true;
364
+            step_events_completed = current_block->step_event_count;
365
+          }
366
+          old_y_min_endstop = y_min_endstop;
367
+        #endif
368
+      }
334
     }
369
     }
335
     else { // +direction
370
     else { // +direction
336
     WRITE(Y_DIR_PIN,!INVERT_Y_DIR);
371
     WRITE(Y_DIR_PIN,!INVERT_Y_DIR);
337
       count_direction[Y_AXIS]=1;
372
       count_direction[Y_AXIS]=1;
338
-      #if Y_MAX_PIN > -1
339
-        bool y_max_endstop=(READ(Y_MAX_PIN) != Y_ENDSTOPS_INVERTING);
340
-        if(y_max_endstop && old_y_max_endstop && (current_block->steps_y > 0)){
341
-          endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
342
-          endstop_y_hit=true;
343
-          step_events_completed = current_block->step_event_count;
344
-        }
345
-        old_y_max_endstop = y_max_endstop;
346
-      #endif
373
+      CHECK_ENDSTOPS
374
+      {
375
+        #if Y_MAX_PIN > -1
376
+          bool y_max_endstop=(READ(Y_MAX_PIN) != Y_ENDSTOPS_INVERTING);
377
+          if(y_max_endstop && old_y_max_endstop && (current_block->steps_y > 0)){
378
+            endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
379
+            endstop_y_hit=true;
380
+            step_events_completed = current_block->step_event_count;
381
+          }
382
+          old_y_max_endstop = y_max_endstop;
383
+        #endif
384
+      }
347
     }
385
     }
348
 
386
 
349
     if ((out_bits & (1<<Z_AXIS)) != 0) {   // -direction
387
     if ((out_bits & (1<<Z_AXIS)) != 0) {   // -direction
350
       WRITE(Z_DIR_PIN,INVERT_Z_DIR);
388
       WRITE(Z_DIR_PIN,INVERT_Z_DIR);
351
       count_direction[Z_AXIS]=-1;
389
       count_direction[Z_AXIS]=-1;
352
-      #if Z_MIN_PIN > -1
353
-        bool z_min_endstop=(READ(Z_MIN_PIN) != Z_ENDSTOPS_INVERTING);
354
-        if(z_min_endstop && old_z_min_endstop && (current_block->steps_z > 0)) {
355
-          endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
356
-          endstop_z_hit=true;
357
-          step_events_completed = current_block->step_event_count;
358
-        }
359
-        old_z_min_endstop = z_min_endstop;
360
-      #endif
390
+      CHECK_ENDSTOPS
391
+      {
392
+        #if Z_MIN_PIN > -1
393
+          bool z_min_endstop=(READ(Z_MIN_PIN) != Z_ENDSTOPS_INVERTING);
394
+          if(z_min_endstop && old_z_min_endstop && (current_block->steps_z > 0)) {
395
+            endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
396
+            endstop_z_hit=true;
397
+            step_events_completed = current_block->step_event_count;
398
+          }
399
+          old_z_min_endstop = z_min_endstop;
400
+        #endif
401
+      }
361
     }
402
     }
362
     else { // +direction
403
     else { // +direction
363
       WRITE(Z_DIR_PIN,!INVERT_Z_DIR);
404
       WRITE(Z_DIR_PIN,!INVERT_Z_DIR);
364
-        count_direction[Z_AXIS]=1;
365
-      #if Z_MAX_PIN > -1
366
-        bool z_max_endstop=(READ(Z_MAX_PIN) != Z_ENDSTOPS_INVERTING);
367
-        if(z_max_endstop && old_z_max_endstop && (current_block->steps_z > 0)) {
368
-          endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
369
-          endstop_z_hit=true;
370
-          step_events_completed = current_block->step_event_count;
371
-        }
372
-        old_z_max_endstop = z_max_endstop;
373
-      #endif
405
+      count_direction[Z_AXIS]=1;
406
+      CHECK_ENDSTOPS
407
+      {
408
+        #if Z_MAX_PIN > -1
409
+          bool z_max_endstop=(READ(Z_MAX_PIN) != Z_ENDSTOPS_INVERTING);
410
+          if(z_max_endstop && old_z_max_endstop && (current_block->steps_z > 0)) {
411
+            endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
412
+            endstop_z_hit=true;
413
+            step_events_completed = current_block->step_event_count;
414
+          }
415
+          old_z_max_endstop = z_max_endstop;
416
+        #endif
417
+      }
374
     }
418
     }
375
 
419
 
376
     #ifndef ADVANCE
420
     #ifndef ADVANCE
383
         count_direction[E_AXIS]=-1;
427
         count_direction[E_AXIS]=-1;
384
       }
428
       }
385
     #endif //!ADVANCE
429
     #endif //!ADVANCE
430
+    
431
+
432
+    
386
     for(int8_t i=0; i < step_loops; i++) { // Take multiple steps per interrupt (For high speed moves) 
433
     for(int8_t i=0; i < step_loops; i++) { // Take multiple steps per interrupt (For high speed moves) 
387
       MSerial.checkRx(); // Check for serial chars. 
434
       MSerial.checkRx(); // Check for serial chars. 
388
       
435
       
391
       if (counter_e > 0) {
438
       if (counter_e > 0) {
392
         counter_e -= current_block->step_event_count;
439
         counter_e -= current_block->step_event_count;
393
         if ((out_bits & (1<<E_AXIS)) != 0) { // - direction
440
         if ((out_bits & (1<<E_AXIS)) != 0) { // - direction
394
-          CRITICAL_SECTION_START;
395
           e_steps--;
441
           e_steps--;
396
-          CRITICAL_SECTION_END;
397
         }
442
         }
398
         else {
443
         else {
399
-          CRITICAL_SECTION_START;
400
           e_steps++;
444
           e_steps++;
401
-          CRITICAL_SECTION_END;
402
         }
445
         }
403
       }    
446
       }    
404
-      // Do E steps + advance steps
405
-      e_steps += ((advance >> 16) - old_advance);
406
-      old_advance = advance >> 16;  
407
       #endif //ADVANCE
447
       #endif //ADVANCE
408
       
448
       
409
       counter_x += current_block->steps_x;
449
       counter_x += current_block->steps_x;
462
         for(int8_t i=0; i < step_loops; i++) {
502
         for(int8_t i=0; i < step_loops; i++) {
463
           advance += advance_rate;
503
           advance += advance_rate;
464
         }
504
         }
505
+        //if(advance > current_block->advance) advance = current_block->advance;
506
+        // Do E steps + advance steps
507
+        e_steps += ((advance >>8) - old_advance);
508
+        old_advance = advance >>8;  
509
+        
465
       #endif
510
       #endif
466
     } 
511
     } 
467
     else if (step_events_completed > (unsigned long int)current_block->decelerate_after) {   
512
     else if (step_events_completed > (unsigned long int)current_block->decelerate_after) {   
486
         for(int8_t i=0; i < step_loops; i++) {
531
         for(int8_t i=0; i < step_loops; i++) {
487
           advance -= advance_rate;
532
           advance -= advance_rate;
488
         }
533
         }
489
-        if(advance < final_advance)
490
-          advance = final_advance;
534
+        if(advance < final_advance) advance = final_advance;
535
+        // Do E steps + advance steps
536
+        e_steps += ((advance >>8) - old_advance);
537
+        old_advance = advance >>8;  
491
       #endif //ADVANCE
538
       #endif //ADVANCE
492
     }
539
     }
493
     else {
540
     else {
508
   // Timer 0 is shared with millies
555
   // Timer 0 is shared with millies
509
   ISR(TIMER0_COMPA_vect)
556
   ISR(TIMER0_COMPA_vect)
510
   {
557
   {
511
-    old_OCR0A += 25; // ~10kHz interrupt
558
+    old_OCR0A += 52; // ~10kHz interrupt (250000 / 26 = 9615kHz)
512
     OCR0A = old_OCR0A;
559
     OCR0A = old_OCR0A;
513
     // Set E direction (Depends on E direction + advance)
560
     // Set E direction (Depends on E direction + advance)
514
     for(unsigned char i=0; i<4;) {
561
     for(unsigned char i=0; i<4;) {
520
         e_steps++;
567
         e_steps++;
521
         WRITE(E_STEP_PIN, HIGH);
568
         WRITE(E_STEP_PIN, HIGH);
522
       } 
569
       } 
523
-      if (e_steps > 0) {
570
+      else if (e_steps > 0) {
524
         WRITE(E_DIR_PIN,!INVERT_E_DIR);
571
         WRITE(E_DIR_PIN,!INVERT_E_DIR);
525
         e_steps--;
572
         e_steps--;
526
         WRITE(E_STEP_PIN, HIGH);
573
         WRITE(E_STEP_PIN, HIGH);
649
     e_steps = 0;
696
     e_steps = 0;
650
     TIMSK0 |= (1<<OCIE0A);
697
     TIMSK0 |= (1<<OCIE0A);
651
   #endif //ADVANCE
698
   #endif //ADVANCE
699
+  
700
+  #ifdef ENDSTOPS_ONLY_FOR_HOMING
701
+    enable_endstops(false);
702
+  #else
703
+    enable_endstops(true);
704
+  #endif
705
+  
652
   sei();
706
   sei();
653
 }
707
 }
654
 
708
 

+ 2
- 0
Marlin/stepper.h View File

44
 void checkHitEndstops(); //call from somwhere to create an serial error message with the locations the endstops where hit, in case they were triggered
44
 void checkHitEndstops(); //call from somwhere to create an serial error message with the locations the endstops where hit, in case they were triggered
45
 void endstops_hit_on_purpose(); //avoid creation of the message, i.e. after homeing and before a routine call of checkHitEndstops();
45
 void endstops_hit_on_purpose(); //avoid creation of the message, i.e. after homeing and before a routine call of checkHitEndstops();
46
 
46
 
47
+void enable_endstops(bool check); // Enable/disable endstop checking
48
+
47
 void checkStepperErrors(); //Print errors detected by the stepper
49
 void checkStepperErrors(); //Print errors detected by the stepper
48
 
50
 
49
 void finishAndDisableSteppers();
51
 void finishAndDisableSteppers();

Loading…
Cancel
Save