Ver código fonte

Initialize stepper counts for Delta/SCARA

Scott Lahteine 9 anos atrás
pai
commit
f840c7de4d
1 arquivos alterados com 15 adições e 9 exclusões
  1. 15
    9
      Marlin/Marlin_main.cpp

+ 15
- 9
Marlin/Marlin_main.cpp Ver arquivo

485
 
485
 
486
 void gcode_M114();
486
 void gcode_M114();
487
 
487
 
488
+#if ENABLED(DELTA) || ENABLED(SCARA)
489
+  inline void sync_plan_position_delta() {
490
+    #if ENABLED(DEBUG_LEVELING_FEATURE)
491
+      if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_delta", current_position);
492
+    #endif
493
+    calculate_delta(current_position);
494
+    plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
495
+  }
496
+#endif
497
+
488
 #if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
498
 #if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
489
   float extrude_min_temp = EXTRUDE_MINTEMP;
499
   float extrude_min_temp = EXTRUDE_MINTEMP;
490
 #endif
500
 #endif
705
  */
715
  */
706
 void setup() {
716
 void setup() {
707
 
717
 
718
+  #if ENABLED(DELTA) || ENABLED(SCARA)
719
+    // Vital to init kinematic equivalent for X0 Y0 Z0
720
+    sync_plan_position_delta();
721
+  #endif
722
+
708
   #ifdef DISABLE_JTAG
723
   #ifdef DISABLE_JTAG
709
     // Disable JTAG on AT90USB chips to free up pins for IO
724
     // Disable JTAG on AT90USB chips to free up pins for IO
710
     MCUCR = 0x80;
725
     MCUCR = 0x80;
1306
   #endif
1321
   #endif
1307
   plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1322
   plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1308
 }
1323
 }
1309
-#if ENABLED(DELTA) || ENABLED(SCARA)
1310
-  inline void sync_plan_position_delta() {
1311
-    #if ENABLED(DEBUG_LEVELING_FEATURE)
1312
-      if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position_delta", current_position);
1313
-    #endif
1314
-    calculate_delta(current_position);
1315
-    plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1316
-  }
1317
-#endif
1318
 inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1324
 inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1319
 inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
1325
 inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
1320
 
1326
 

Carregando…
Cancelar
Salvar