Use NUM_SERVOS in EEPROM code

Fix #12015
This commit is contained in:
Scott Lahteine 2018-10-06 13:31:01 -05:00
parent 0fcdfdeed6
commit e8d677620c

View File

@ -72,6 +72,9 @@
#if HAS_SERVOS
#include "servo.h"
#else
#undef NUM_SERVOS
#define NUM_SERVOS NUM_SERVO_PLUGS
#endif
#if HAS_BED_PROBE
@ -185,7 +188,7 @@ typedef struct SettingsDataStruct {
//
// SERVO_ANGLES
//
uint16_t servo_angles[NUM_SERVO_PLUGS][2]; // M281 P L U
uint16_t servo_angles[NUM_SERVOS][2]; // M281 P L U
//
// DELTA / [XYZ]_DUAL_ENDSTOPS
@ -562,7 +565,7 @@ void MarlinSettings::postprocess() {
#if ENABLED(SWITCHING_EXTRUDER)
constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES;
#endif
constexpr uint16_t servo_angles[NUM_SERVO_PLUGS][2] = {
constexpr uint16_t servo_angles[NUM_SERVOS][2] = {
#if ENABLED(SWITCHING_EXTRUDER)
[SWITCHING_EXTRUDER_SERVO_NR] = { sesa[0][0], sesa[0][1] }
#if EXTRUDERS > 3
@ -1181,7 +1184,7 @@ void MarlinSettings::postprocess() {
// SERVO_ANGLES
//
#if !HAS_SERVOS || DISABLED(EDITABLE_SERVO_ANGLES)
uint16_t servo_angles[NUM_SERVO_PLUGS][2];
uint16_t servo_angles[NUM_SERVOS][2];
#endif
EEPROM_READ(servo_angles);