Browse Source

Clean up digital pots and microsteps

Scott Lahteine 8 years ago
parent
commit
5fff8d148b
4 changed files with 177 additions and 141 deletions
  1. 4
    1
      Marlin/Conditionals_post.h
  2. 11
    10
      Marlin/Marlin_main.cpp
  3. 150
    124
      Marlin/stepper.cpp
  4. 12
    6
      Marlin/stepper.h

+ 4
- 1
Marlin/Conditionals_post.h View File

@@ -462,10 +462,13 @@
462 462
   #define HAS_SOLENOID_1 (PIN_EXISTS(SOL1))
463 463
   #define HAS_SOLENOID_2 (PIN_EXISTS(SOL2))
464 464
   #define HAS_SOLENOID_3 (PIN_EXISTS(SOL3))
465
-  #define HAS_MICROSTEPS (PIN_EXISTS(X_MS1))
465
+  #define HAS_MICROSTEPS_X (PIN_EXISTS(X_MS1))
466
+  #define HAS_MICROSTEPS_Y (PIN_EXISTS(Y_MS1))
467
+  #define HAS_MICROSTEPS_Z (PIN_EXISTS(Z_MS1))
466 468
   #define HAS_MICROSTEPS_E0 (PIN_EXISTS(E0_MS1))
467 469
   #define HAS_MICROSTEPS_E1 (PIN_EXISTS(E1_MS1))
468 470
   #define HAS_MICROSTEPS_E2 (PIN_EXISTS(E2_MS1))
471
+  #define HAS_MICROSTEPS (HAS_MICROSTEPS_X || HAS_MICROSTEPS_Y || HAS_MICROSTEPS_Z || HAS_MICROSTEPS_E0 || HAS_MICROSTEPS_E1 || HAS_MICROSTEPS_E2)
469 472
   #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET))
470 473
   #define HAS_X_ENABLE (PIN_EXISTS(X_ENABLE))
471 474
   #define HAS_X2_ENABLE (PIN_EXISTS(X2_ENABLE))

+ 11
- 10
Marlin/Marlin_main.cpp View File

@@ -6514,18 +6514,19 @@ inline void gcode_M503() {
6514 6514
 inline void gcode_M907() {
6515 6515
   #if HAS_DIGIPOTSS
6516 6516
     LOOP_XYZE(i)
6517
-      if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int());
6517
+    if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int());
6518 6518
     if (code_seen('B')) stepper.digipot_current(4, code_value_int());
6519 6519
     if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value_int());
6520
-  #endif
6521
-  #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
6522
-    if (code_seen('X')) stepper.digipot_current(0, code_value_int());
6523
-  #endif
6524
-  #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
6525
-    if (code_seen('Z')) stepper.digipot_current(1, code_value_int());
6526
-  #endif
6527
-  #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
6528
-    if (code_seen('E')) stepper.digipot_current(2, code_value_int());
6520
+  #elif HAS_MOTOR_CURRENT_PWM
6521
+    #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
6522
+      if (code_seen('X')) stepper.digipot_current(0, code_value_int());
6523
+    #endif
6524
+    #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
6525
+      if (code_seen('Z')) stepper.digipot_current(1, code_value_int());
6526
+    #endif
6527
+    #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
6528
+      if (code_seen('E')) stepper.digipot_current(2, code_value_int());
6529
+    #endif
6529 6530
   #endif
6530 6531
   #if ENABLED(DIGIPOT_I2C)
6531 6532
     // this one uses actual amps in floating point

+ 150
- 124
Marlin/stepper.cpp View File

@@ -733,19 +733,27 @@ void Stepper::isr() {
733 733
 
734 734
 void Stepper::init() {
735 735
 
736
-  digipot_init(); //Initialize Digipot Motor Current
737
-  microstep_init(); //Initialize Microstepping Pins
736
+  // Init Digipot Motor Current
737
+  #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
738
+    digipot_init();
739
+  #endif
738 740
 
739
-  // initialise TMC Steppers
741
+  // Init Microstepping Pins
742
+  #if HAS_MICROSTEPS
743
+    microstep_init();
744
+  #endif
745
+
746
+  // Init TMC Steppers
740 747
   #if ENABLED(HAVE_TMCDRIVER)
741 748
     tmc_init();
742 749
   #endif
743
-    // initialise L6470 Steppers
750
+
751
+  // Init L6470 Steppers
744 752
   #if ENABLED(HAVE_L6470DRIVER)
745 753
     L6470_init();
746 754
   #endif
747 755
 
748
-  // Initialize Dir Pins
756
+  // Init Dir Pins
749 757
   #if HAS_X_DIR
750 758
     X_DIR_INIT;
751 759
   #endif
@@ -777,8 +785,7 @@ void Stepper::init() {
777 785
     E3_DIR_INIT;
778 786
   #endif
779 787
 
780
-  //Initialize Enable Pins - steppers default to disabled.
781
-
788
+  // Init Enable Pins - steppers default to disabled.
782 789
   #if HAS_X_ENABLE
783 790
     X_ENABLE_INIT;
784 791
     if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH);
@@ -787,7 +794,6 @@ void Stepper::init() {
787 794
       if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH);
788 795
     #endif
789 796
   #endif
790
-
791 797
   #if HAS_Y_ENABLE
792 798
     Y_ENABLE_INIT;
793 799
     if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH);
@@ -796,7 +802,6 @@ void Stepper::init() {
796 802
       if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH);
797 803
     #endif
798 804
   #endif
799
-
800 805
   #if HAS_Z_ENABLE
801 806
     Z_ENABLE_INIT;
802 807
     if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH);
@@ -805,7 +810,6 @@ void Stepper::init() {
805 810
       if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH);
806 811
     #endif
807 812
   #endif
808
-
809 813
   #if HAS_E0_ENABLE
810 814
     E0_ENABLE_INIT;
811 815
     if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH);
@@ -823,9 +827,7 @@ void Stepper::init() {
823 827
     if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH);
824 828
   #endif
825 829
 
826
-  //
827
-  // Init endstops and pullups here
828
-  //
830
+  // Init endstops and pullups
829 831
   endstops.init();
830 832
 
831 833
   #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT
@@ -839,7 +841,7 @@ void Stepper::init() {
839 841
 
840 842
   #define E_AXIS_INIT(NUM) AXIS_INIT(e## NUM, E## NUM, E)
841 843
 
842
-  // Initialize Step Pins
844
+  // Init Step Pins
843 845
   #if HAS_X_STEP
844 846
     #if ENABLED(X_DUAL_STEPPER_DRIVERS) || ENABLED(DUAL_X_CARRIAGE)
845 847
       X2_STEP_INIT;
@@ -1164,134 +1166,158 @@ void Stepper::report_positions() {
1164 1166
 
1165 1167
 #endif //HAS_DIGIPOTSS
1166 1168
 
1167
-void Stepper::digipot_init() {
1168
-  #if HAS_DIGIPOTSS
1169
-    const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT;
1169
+#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
1170 1170
 
1171
-    SPI.begin();
1172
-    pinMode(DIGIPOTSS_PIN, OUTPUT);
1173
-    for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) {
1174
-      //digitalPotWrite(digipot_ch[i], digipot_motor_current[i]);
1175
-      digipot_current(i, digipot_motor_current[i]);
1176
-    }
1177
-  #endif
1178
-  #if HAS_MOTOR_CURRENT_PWM
1179
-    #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
1180
-      pinMode(MOTOR_CURRENT_PWM_XY_PIN, OUTPUT);
1181
-      digipot_current(0, motor_current_setting[0]);
1182
-    #endif
1183
-    #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
1184
-      pinMode(MOTOR_CURRENT_PWM_Z_PIN, OUTPUT);
1185
-      digipot_current(1, motor_current_setting[1]);
1186
-    #endif
1187
-    #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
1188
-      pinMode(MOTOR_CURRENT_PWM_E_PIN, OUTPUT);
1189
-      digipot_current(2, motor_current_setting[2]);
1190
-    #endif
1191
-    //Set timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise)
1192
-    TCCR5B = (TCCR5B & ~(_BV(CS50) | _BV(CS51) | _BV(CS52))) | _BV(CS50);
1193
-  #endif
1194
-}
1195
-
1196
-void Stepper::digipot_current(uint8_t driver, int current) {
1197
-  #if HAS_DIGIPOTSS
1198
-    const uint8_t digipot_ch[] = DIGIPOT_CHANNELS;
1199
-    digitalPotWrite(digipot_ch[driver], current);
1200
-  #elif HAS_MOTOR_CURRENT_PWM
1201
-    #define _WRITE_CURRENT_PWM(P) analogWrite(P, 255L * current / (MOTOR_CURRENT_PWM_RANGE))
1202
-    switch (driver) {
1171
+  void Stepper::digipot_init() {
1172
+    #if HAS_DIGIPOTSS
1173
+      static const uint8_t digipot_motor_current[] = DIGIPOT_MOTOR_CURRENT;
1174
+      SPI.begin();
1175
+      SET_OUTPUT(DIGIPOTSS_PIN);
1176
+      for (uint8_t i = 0; i < COUNT(digipot_motor_current); i++) {
1177
+        //digitalPotWrite(digipot_ch[i], digipot_motor_current[i]);
1178
+        digipot_current(i, digipot_motor_current[i]);
1179
+      }
1180
+    #elif HAS_MOTOR_CURRENT_PWM
1203 1181
       #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
1204
-        case 0: _WRITE_CURRENT_PWM(MOTOR_CURRENT_PWM_XY_PIN); break;
1182
+        SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN);
1183
+        digipot_current(0, motor_current_setting[0]);
1205 1184
       #endif
1206 1185
       #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
1207
-        case 1: _WRITE_CURRENT_PWM(MOTOR_CURRENT_PWM_Z_PIN); break;
1186
+        SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN);
1187
+        digipot_current(1, motor_current_setting[1]);
1208 1188
       #endif
1209 1189
       #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
1210
-        case 2: _WRITE_CURRENT_PWM(MOTOR_CURRENT_PWM_E_PIN); break;
1190
+        SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN);
1191
+        digipot_current(2, motor_current_setting[2]);
1211 1192
       #endif
1212
-    }
1213
-  #else
1214
-    UNUSED(driver);
1215
-    UNUSED(current);
1216
-  #endif
1217
-}
1193
+      //Set timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise)
1194
+      TCCR5B = (TCCR5B & ~(_BV(CS50) | _BV(CS51) | _BV(CS52))) | _BV(CS50);
1195
+    #endif
1196
+  }
1218 1197
 
1219
-void Stepper::microstep_init() {
1220
-  #if HAS_MICROSTEPS_E1
1221
-    pinMode(E1_MS1_PIN, OUTPUT);
1222
-    pinMode(E1_MS2_PIN, OUTPUT);
1223
-  #endif
1198
+  void Stepper::digipot_current(uint8_t driver, int current) {
1199
+    #if HAS_DIGIPOTSS
1200
+      const uint8_t digipot_ch[] = DIGIPOT_CHANNELS;
1201
+      digitalPotWrite(digipot_ch[driver], current);
1202
+    #elif HAS_MOTOR_CURRENT_PWM
1203
+      #define _WRITE_CURRENT_PWM(P) analogWrite(P, 255L * current / (MOTOR_CURRENT_PWM_RANGE))
1204
+      switch (driver) {
1205
+        #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
1206
+          case 0: _WRITE_CURRENT_PWM(MOTOR_CURRENT_PWM_XY_PIN); break;
1207
+        #endif
1208
+        #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
1209
+          case 1: _WRITE_CURRENT_PWM(MOTOR_CURRENT_PWM_Z_PIN); break;
1210
+        #endif
1211
+        #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
1212
+          case 2: _WRITE_CURRENT_PWM(MOTOR_CURRENT_PWM_E_PIN); break;
1213
+        #endif
1214
+      }
1215
+    #endif
1216
+  }
1224 1217
 
1225
-  #if HAS_MICROSTEPS
1226
-    pinMode(X_MS1_PIN, OUTPUT);
1227
-    pinMode(X_MS2_PIN, OUTPUT);
1228
-    pinMode(Y_MS1_PIN, OUTPUT);
1229
-    pinMode(Y_MS2_PIN, OUTPUT);
1230
-    pinMode(Z_MS1_PIN, OUTPUT);
1231
-    pinMode(Z_MS2_PIN, OUTPUT);
1232
-    pinMode(E0_MS1_PIN, OUTPUT);
1233
-    pinMode(E0_MS2_PIN, OUTPUT);
1234
-    const uint8_t microstep_modes[] = MICROSTEP_MODES;
1235
-    for (uint16_t i = 0; i < COUNT(microstep_modes); i++)
1236
-      microstep_mode(i, microstep_modes[i]);
1237
-  #endif
1238
-}
1218
+#endif
1239 1219
 
1240
-/**
1241
- * Software-controlled Microstepping
1242
- */
1220
+#if HAS_MICROSTEPS
1221
+
1222
+  /**
1223
+   * Software-controlled Microstepping
1224
+   */
1243 1225
 
1244
-void Stepper::microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) {
1245
-  if (ms1 >= 0) switch (driver) {
1246
-    case 0: digitalWrite(X_MS1_PIN, ms1); break;
1247
-    case 1: digitalWrite(Y_MS1_PIN, ms1); break;
1248
-    case 2: digitalWrite(Z_MS1_PIN, ms1); break;
1249
-    case 3: digitalWrite(E0_MS1_PIN, ms1); break;
1226
+  void Stepper::microstep_init() {
1227
+    SET_OUTPUT(X_MS1_PIN);
1228
+    SET_OUTPUT(X_MS2_PIN);
1229
+    #if HAS_MICROSTEPS_Y
1230
+      SET_OUTPUT(Y_MS1_PIN);
1231
+      SET_OUTPUT(Y_MS2_PIN);
1232
+    #endif
1233
+    #if HAS_MICROSTEPS_Z
1234
+      SET_OUTPUT(Z_MS1_PIN);
1235
+      SET_OUTPUT(Z_MS2_PIN);
1236
+    #endif
1237
+    #if HAS_MICROSTEPS_E0
1238
+      SET_OUTPUT(E0_MS1_PIN);
1239
+      SET_OUTPUT(E0_MS2_PIN);
1240
+    #endif
1250 1241
     #if HAS_MICROSTEPS_E1
1251
-      case 4: digitalWrite(E1_MS1_PIN, ms1); break;
1242
+      SET_OUTPUT(E1_MS1_PIN);
1243
+      SET_OUTPUT(E1_MS2_PIN);
1252 1244
     #endif
1245
+    static const uint8_t microstep_modes[] = MICROSTEP_MODES;
1246
+    for (uint16_t i = 0; i < COUNT(microstep_modes); i++)
1247
+      microstep_mode(i, microstep_modes[i]);
1253 1248
   }
1254
-  if (ms2 >= 0) switch (driver) {
1255
-    case 0: digitalWrite(X_MS2_PIN, ms2); break;
1256
-    case 1: digitalWrite(Y_MS2_PIN, ms2); break;
1257
-    case 2: digitalWrite(Z_MS2_PIN, ms2); break;
1258
-    case 3: digitalWrite(E0_MS2_PIN, ms2); break;
1259
-    #if PIN_EXISTS(E1_MS2)
1260
-      case 4: digitalWrite(E1_MS2_PIN, ms2); break;
1261
-    #endif
1249
+
1250
+  void Stepper::microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) {
1251
+    if (ms1 >= 0) switch (driver) {
1252
+      case 0: digitalWrite(X_MS1_PIN, ms1); break;
1253
+      #if HAS_MICROSTEPS_Y
1254
+        case 1: digitalWrite(Y_MS1_PIN, ms1); break;
1255
+      #endif
1256
+      #if HAS_MICROSTEPS_Z
1257
+        case 2: digitalWrite(Z_MS1_PIN, ms1); break;
1258
+      #endif
1259
+      #if HAS_MICROSTEPS_E0
1260
+        case 3: digitalWrite(E0_MS1_PIN, ms1); break;
1261
+      #endif
1262
+      #if HAS_MICROSTEPS_E1
1263
+        case 4: digitalWrite(E1_MS1_PIN, ms1); break;
1264
+      #endif
1265
+    }
1266
+    if (ms2 >= 0) switch (driver) {
1267
+      case 0: digitalWrite(X_MS2_PIN, ms2); break;
1268
+      #if HAS_MICROSTEPS_Y
1269
+        case 1: digitalWrite(Y_MS2_PIN, ms2); break;
1270
+      #endif
1271
+      #if HAS_MICROSTEPS_Z
1272
+        case 2: digitalWrite(Z_MS2_PIN, ms2); break;
1273
+      #endif
1274
+      #if HAS_MICROSTEPS_E0
1275
+        case 3: digitalWrite(E0_MS2_PIN, ms2); break;
1276
+      #endif
1277
+      #if HAS_MICROSTEPS_E1
1278
+        case 4: digitalWrite(E1_MS2_PIN, ms2); break;
1279
+      #endif
1280
+    }
1262 1281
   }
1263
-}
1264 1282
 
1265
-void Stepper::microstep_mode(uint8_t driver, uint8_t stepping_mode) {
1266
-  switch (stepping_mode) {
1267
-    case 1: microstep_ms(driver, MICROSTEP1); break;
1268
-    case 2: microstep_ms(driver, MICROSTEP2); break;
1269
-    case 4: microstep_ms(driver, MICROSTEP4); break;
1270
-    case 8: microstep_ms(driver, MICROSTEP8); break;
1271
-    case 16: microstep_ms(driver, MICROSTEP16); break;
1283
+  void Stepper::microstep_mode(uint8_t driver, uint8_t stepping_mode) {
1284
+    switch (stepping_mode) {
1285
+      case 1: microstep_ms(driver, MICROSTEP1); break;
1286
+      case 2: microstep_ms(driver, MICROSTEP2); break;
1287
+      case 4: microstep_ms(driver, MICROSTEP4); break;
1288
+      case 8: microstep_ms(driver, MICROSTEP8); break;
1289
+      case 16: microstep_ms(driver, MICROSTEP16); break;
1290
+    }
1272 1291
   }
1273
-}
1274 1292
 
1275
-void Stepper::microstep_readings() {
1276
-  SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins");
1277
-  SERIAL_PROTOCOLPGM("X: ");
1278
-  SERIAL_PROTOCOL(READ(X_MS1_PIN));
1279
-  SERIAL_PROTOCOLLN(READ(X_MS2_PIN));
1280
-  SERIAL_PROTOCOLPGM("Y: ");
1281
-  SERIAL_PROTOCOL(READ(Y_MS1_PIN));
1282
-  SERIAL_PROTOCOLLN(READ(Y_MS2_PIN));
1283
-  SERIAL_PROTOCOLPGM("Z: ");
1284
-  SERIAL_PROTOCOL(READ(Z_MS1_PIN));
1285
-  SERIAL_PROTOCOLLN(READ(Z_MS2_PIN));
1286
-  SERIAL_PROTOCOLPGM("E0: ");
1287
-  SERIAL_PROTOCOL(READ(E0_MS1_PIN));
1288
-  SERIAL_PROTOCOLLN(READ(E0_MS2_PIN));
1289
-  #if HAS_MICROSTEPS_E1
1290
-    SERIAL_PROTOCOLPGM("E1: ");
1291
-    SERIAL_PROTOCOL(READ(E1_MS1_PIN));
1292
-    SERIAL_PROTOCOLLN(READ(E1_MS2_PIN));
1293
-  #endif
1294
-}
1293
+  void Stepper::microstep_readings() {
1294
+    SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins");
1295
+    SERIAL_PROTOCOLPGM("X: ");
1296
+    SERIAL_PROTOCOL(READ(X_MS1_PIN));
1297
+    SERIAL_PROTOCOLLN(READ(X_MS2_PIN));
1298
+    #if HAS_MICROSTEPS_Y
1299
+      SERIAL_PROTOCOLPGM("Y: ");
1300
+      SERIAL_PROTOCOL(READ(Y_MS1_PIN));
1301
+      SERIAL_PROTOCOLLN(READ(Y_MS2_PIN));
1302
+    #endif
1303
+    #if HAS_MICROSTEPS_Z
1304
+      SERIAL_PROTOCOLPGM("Z: ");
1305
+      SERIAL_PROTOCOL(READ(Z_MS1_PIN));
1306
+      SERIAL_PROTOCOLLN(READ(Z_MS2_PIN));
1307
+    #endif
1308
+    #if HAS_MICROSTEPS_E0
1309
+      SERIAL_PROTOCOLPGM("E0: ");
1310
+      SERIAL_PROTOCOL(READ(E0_MS1_PIN));
1311
+      SERIAL_PROTOCOLLN(READ(E0_MS2_PIN));
1312
+    #endif
1313
+    #if HAS_MICROSTEPS_E1
1314
+      SERIAL_PROTOCOLPGM("E1: ");
1315
+      SERIAL_PROTOCOL(READ(E1_MS1_PIN));
1316
+      SERIAL_PROTOCOLLN(READ(E1_MS2_PIN));
1317
+    #endif
1318
+  }
1319
+
1320
+#endif // HAS_MICROSTEPS
1295 1321
 
1296 1322
 #if ENABLED(LIN_ADVANCE)
1297 1323
 

+ 12
- 6
Marlin/stepper.h View File

@@ -239,13 +239,16 @@ class Stepper {
239 239
     //
240 240
     static FORCE_INLINE bool motor_direction(AxisEnum axis) { return TEST(last_direction_bits, axis); }
241 241
 
242
-    #if HAS_DIGIPOTSS
242
+    #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
243 243
       static void digitalPotWrite(int address, int value);
244
+      static void digipot_current(uint8_t driver, int current);
245
+    #endif
246
+
247
+    #if HAS_MICROSTEPS
248
+      static void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2);
249
+      static void microstep_mode(uint8_t driver, uint8_t stepping);
250
+      static void microstep_readings();
244 251
     #endif
245
-    static void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2);
246
-    static void digipot_current(uint8_t driver, int current);
247
-    static void microstep_mode(uint8_t driver, uint8_t stepping);
248
-    static void microstep_readings();
249 252
 
250 253
     #if ENABLED(Z_DUAL_ENDSTOPS)
251 254
       static FORCE_INLINE void set_homing_flag(bool state) { performing_homing = state; }
@@ -380,7 +383,10 @@ class Stepper {
380 383
     }
381 384
 
382 385
     static void digipot_init();
383
-    static void microstep_init();
386
+
387
+    #if HAS_MICROSTEPS
388
+      static void microstep_init();
389
+    #endif
384 390
 
385 391
 };
386 392
 

Loading…
Cancel
Save