Просмотр исходного кода

Remove I2CPEM workspace offset

Scott Lahteine 6 лет назад
Родитель
Сommit
64f077fd2a
2 измененных файлов: 2 добавлений и 20 удалений
  1. 2
    15
      Marlin/I2CPositionEncoder.h
  2. 0
    5
      Marlin/Marlin_main.cpp

+ 2
- 15
Marlin/I2CPositionEncoder.h Просмотреть файл

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

+ 0
- 5
Marlin/Marlin_main.cpp Просмотреть файл

@@ -6219,11 +6219,6 @@ inline void gcode_G92() {
6219 6219
           #if HAS_POSITION_SHIFT
6220 6220
             position_shift[i] += v - p; // Offset the coordinate space
6221 6221
             update_software_endstops((AxisEnum)i);
6222
-
6223
-            #if ENABLED(I2C_POSITION_ENCODERS)
6224
-              I2CPEM.encoders[I2CPEM.idx_from_axis((AxisEnum)i)].set_axis_offset(position_shift[i]);
6225
-            #endif
6226
-
6227 6222
           #endif
6228 6223
         }
6229 6224
       #endif

Загрузка…
Отмена
Сохранить