Browse Source

Use NUM_SERVOS in EEPROM code

Fix #12015
Scott Lahteine 6 years ago
parent
commit
e8d677620c
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      Marlin/src/module/configuration_store.cpp

+ 6
- 3
Marlin/src/module/configuration_store.cpp View File

72
 
72
 
73
 #if HAS_SERVOS
73
 #if HAS_SERVOS
74
   #include "servo.h"
74
   #include "servo.h"
75
+#else
76
+  #undef NUM_SERVOS
77
+  #define NUM_SERVOS NUM_SERVO_PLUGS
75
 #endif
78
 #endif
76
 
79
 
77
 #if HAS_BED_PROBE
80
 #if HAS_BED_PROBE
185
   //
188
   //
186
   // SERVO_ANGLES
189
   // SERVO_ANGLES
187
   //
190
   //
188
-  uint16_t servo_angles[NUM_SERVO_PLUGS][2];                 // M281 P L U
191
+  uint16_t servo_angles[NUM_SERVOS][2];                 // M281 P L U
189
 
192
 
190
   //
193
   //
191
   // DELTA / [XYZ]_DUAL_ENDSTOPS
194
   // DELTA / [XYZ]_DUAL_ENDSTOPS
562
       #if ENABLED(SWITCHING_EXTRUDER)
565
       #if ENABLED(SWITCHING_EXTRUDER)
563
         constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES;
566
         constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES;
564
       #endif
567
       #endif
565
-      constexpr uint16_t servo_angles[NUM_SERVO_PLUGS][2] = {
568
+      constexpr uint16_t servo_angles[NUM_SERVOS][2] = {
566
         #if ENABLED(SWITCHING_EXTRUDER)
569
         #if ENABLED(SWITCHING_EXTRUDER)
567
           [SWITCHING_EXTRUDER_SERVO_NR] = { sesa[0][0], sesa[0][1] }
570
           [SWITCHING_EXTRUDER_SERVO_NR] = { sesa[0][0], sesa[0][1] }
568
           #if EXTRUDERS > 3
571
           #if EXTRUDERS > 3
1181
       // SERVO_ANGLES
1184
       // SERVO_ANGLES
1182
       //
1185
       //
1183
       #if !HAS_SERVOS || DISABLED(EDITABLE_SERVO_ANGLES)
1186
       #if !HAS_SERVOS || DISABLED(EDITABLE_SERVO_ANGLES)
1184
-        uint16_t servo_angles[NUM_SERVO_PLUGS][2];
1187
+        uint16_t servo_angles[NUM_SERVOS][2];
1185
       #endif
1188
       #endif
1186
       EEPROM_READ(servo_angles);
1189
       EEPROM_READ(servo_angles);
1187
 
1190
 

Loading…
Cancel
Save