Quellcode durchsuchen

Initialize stepper counts for Delta/SCARA

Scott Lahteine vor 9 Jahren
Ursprung
Commit
f840c7de4d
1 geänderte Dateien mit 15 neuen und 9 gelöschten Zeilen
  1. 15
    9
      Marlin/Marlin_main.cpp

+ 15
- 9
Marlin/Marlin_main.cpp Datei anzeigen

@@ -485,6 +485,16 @@ void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P);
485 485
 
486 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 498
 #if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
489 499
   float extrude_min_temp = EXTRUDE_MINTEMP;
490 500
 #endif
@@ -705,6 +715,11 @@ void servo_init() {
705 715
  */
706 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 723
   #ifdef DISABLE_JTAG
709 724
     // Disable JTAG on AT90USB chips to free up pins for IO
710 725
     MCUCR = 0x80;
@@ -1306,15 +1321,6 @@ inline void sync_plan_position() {
1306 1321
   #endif
1307 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 1324
 inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1319 1325
 inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
1320 1326
 

Laden…
Abbrechen
Speichern