From 8584d3697d1e0bebe67e8d30184ef7dc04d873e6 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Tue, 11 Sep 2018 16:20:12 -0500
Subject: [PATCH] Fix servo count define conflict

`MAX_SERVOS` => `NUM_SERVO_PLUGS`
---
 Marlin/src/inc/SanityCheck.h              | 2 +-
 Marlin/src/module/configuration_store.cpp | 6 +++---
 Marlin/src/pins/pins.h                    | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index 6f2a674f22..7bf68c0099 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -756,7 +756,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
 /**
  * Limited number of servos
  */
-#if NUM_SERVOS > MAX_SERVOS
+#if NUM_SERVOS > NUM_SERVO_PLUGS
   #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
 #endif
 
diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp
index ae48b7e7a4..6a5d630473 100644
--- a/Marlin/src/module/configuration_store.cpp
+++ b/Marlin/src/module/configuration_store.cpp
@@ -181,7 +181,7 @@ typedef struct SettingsDataStruct {
   //
   // SERVO_ANGLES
   //
-  uint16_t servo_angles[MAX_SERVOS][2];                 // M281 P L U
+  uint16_t servo_angles[NUM_SERVO_PLUGS][2];                 // M281 P L U
 
   //
   // DELTA / [XYZ]_DUAL_ENDSTOPS
@@ -545,7 +545,7 @@ void MarlinSettings::postprocess() {
       #if ENABLED(SWITCHING_EXTRUDER)
         constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES;
       #endif
-      constexpr uint16_t servo_angles[MAX_SERVOS][2] = {
+      constexpr uint16_t servo_angles[NUM_SERVO_PLUGS][2] = {
         #if ENABLED(SWITCHING_EXTRUDER)
           [SWITCHING_EXTRUDER_SERVO_NR] = { sesa[0], sesa[1] }
           #if EXTRUDERS > 3
@@ -1167,7 +1167,7 @@ void MarlinSettings::postprocess() {
       // SERVO_ANGLES
       //
       #if !HAS_SERVOS || DISABLED(EDITABLE_SERVO_ANGLES)
-        uint16_t servo_angles[MAX_SERVOS][2];
+        uint16_t servo_angles[NUM_SERVO_PLUGS][2];
       #endif
       EEPROM_READ(servo_angles);
 
diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h
index 76c58576bd..6218dffcc9 100644
--- a/Marlin/src/pins/pins.h
+++ b/Marlin/src/pins/pins.h
@@ -627,8 +627,8 @@
   #define MAX_EXTRUDERS 5
 #endif
 
-#ifndef MAX_SERVOS
-  #define MAX_SERVOS 4
+#ifndef NUM_SERVO_PLUGS
+  #define NUM_SERVO_PLUGS 4
 #endif
 
 //
-- 
GitLab