Преглед изворни кода

Remove I2CPEM workspace offset

Scott Lahteine пре 7 година
родитељ
комит
d6aa127c76
2 измењених фајлова са 2 додато и 20 уклоњено
  1. 2
    15
      Marlin/src/feature/I2CPositionEncoder.h
  2. 0
    5
      Marlin/src/gcode/geometry/G92.cpp

+ 2
- 15
Marlin/src/feature/I2CPositionEncoder.h Прегледај датотеку

@@ -124,10 +124,7 @@ class I2CPositionEncoder {
124 124
               invert              = false,
125 125
               ec                  = true;
126 126
 
127
-    float     axisOffset          = 0;
128
-
129
-    int32_t   axisOffsetTicks     = 0,
130
-              zeroOffset          = 0,
127
+    int32_t   zeroOffset          = 0,
131 128
               lastPosition        = 0,
132 129
               position;
133 130
 
@@ -165,7 +162,7 @@ class I2CPositionEncoder {
165 162
     }
166 163
 
167 164
     FORCE_INLINE float get_position_mm() { return mm_from_count(get_position()); }
168
-    FORCE_INLINE int32_t get_position() { return get_raw_count() - zeroOffset - axisOffsetTicks; }
165
+    FORCE_INLINE int32_t get_position() { return get_raw_count() - zeroOffset; }
169 166
 
170 167
     int32_t get_axis_error_steps(const bool report);
171 168
     float get_axis_error_mm(const bool report);
@@ -216,16 +213,6 @@ class I2CPositionEncoder {
216 213
 
217 214
     FORCE_INLINE int get_stepper_ticks() { return stepperTicks; }
218 215
     FORCE_INLINE void set_stepper_ticks(const int ticks) { stepperTicks = ticks; }
219
-
220
-    FORCE_INLINE float get_axis_offset() { return axisOffset; }
221
-    FORCE_INLINE void set_axis_offset(const float newOffset) {
222
-      axisOffset = newOffset;
223
-      axisOffsetTicks = int32_t(axisOffset * get_encoder_ticks_mm());
224
-    }
225
-
226
-    FORCE_INLINE void set_current_position(const float newPositionMm) {
227
-      set_axis_offset(get_position_mm() - newPositionMm + axisOffset);
228
-    }
229 216
 };
230 217
 
231 218
 class I2CPositionEncodersMgr {

+ 0
- 5
Marlin/src/gcode/geometry/G92.cpp Прегледај датотеку

@@ -55,11 +55,6 @@ void GcodeSuite::G92() {
55 55
           #if HAS_POSITION_SHIFT
56 56
             position_shift[i] += v - p; // Offset the coordinate space
57 57
             update_software_endstops((AxisEnum)i);
58
-
59
-            #if ENABLED(I2C_POSITION_ENCODERS)
60
-              I2CPEM.encoders[I2CPEM.idx_from_axis((AxisEnum)i)].set_axis_offset(position_shift[i]);
61
-            #endif
62
-
63 58
           #endif
64 59
         }
65 60
       #endif

Loading…
Откажи
Сачувај