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,6 +72,9 @@
72 72
 
73 73
 #if HAS_SERVOS
74 74
   #include "servo.h"
75
+#else
76
+  #undef NUM_SERVOS
77
+  #define NUM_SERVOS NUM_SERVO_PLUGS
75 78
 #endif
76 79
 
77 80
 #if HAS_BED_PROBE
@@ -185,7 +188,7 @@ typedef struct SettingsDataStruct {
185 188
   //
186 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 194
   // DELTA / [XYZ]_DUAL_ENDSTOPS
@@ -562,7 +565,7 @@ void MarlinSettings::postprocess() {
562 565
       #if ENABLED(SWITCHING_EXTRUDER)
563 566
         constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES;
564 567
       #endif
565
-      constexpr uint16_t servo_angles[NUM_SERVO_PLUGS][2] = {
568
+      constexpr uint16_t servo_angles[NUM_SERVOS][2] = {
566 569
         #if ENABLED(SWITCHING_EXTRUDER)
567 570
           [SWITCHING_EXTRUDER_SERVO_NR] = { sesa[0][0], sesa[0][1] }
568 571
           #if EXTRUDERS > 3
@@ -1181,7 +1184,7 @@ void MarlinSettings::postprocess() {
1181 1184
       // SERVO_ANGLES
1182 1185
       //
1183 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 1188
       #endif
1186 1189
       EEPROM_READ(servo_angles);
1187 1190
 

Loading…
Cancel
Save