Browse Source

Fix servo count define conflict

`MAX_SERVOS` => `NUM_SERVO_PLUGS`
pull/1/head
Scott Lahteine 6 years ago
parent
commit
8584d3697d
  1. 2
      Marlin/src/inc/SanityCheck.h
  2. 6
      Marlin/src/module/configuration_store.cpp
  3. 4
      Marlin/src/pins/pins.h

2
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 * 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." #error "The selected board doesn't support enough servos for your configuration. Reduce NUM_SERVOS."
#endif #endif

6
Marlin/src/module/configuration_store.cpp

@ -181,7 +181,7 @@ typedef struct SettingsDataStruct {
// //
// SERVO_ANGLES // 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 // DELTA / [XYZ]_DUAL_ENDSTOPS
@ -545,7 +545,7 @@ void MarlinSettings::postprocess() {
#if ENABLED(SWITCHING_EXTRUDER) #if ENABLED(SWITCHING_EXTRUDER)
constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES; constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES;
#endif #endif
constexpr uint16_t servo_angles[MAX_SERVOS][2] = { constexpr uint16_t servo_angles[NUM_SERVO_PLUGS][2] = {
#if ENABLED(SWITCHING_EXTRUDER) #if ENABLED(SWITCHING_EXTRUDER)
[SWITCHING_EXTRUDER_SERVO_NR] = { sesa[0], sesa[1] } [SWITCHING_EXTRUDER_SERVO_NR] = { sesa[0], sesa[1] }
#if EXTRUDERS > 3 #if EXTRUDERS > 3
@ -1167,7 +1167,7 @@ void MarlinSettings::postprocess() {
// SERVO_ANGLES // SERVO_ANGLES
// //
#if !HAS_SERVOS || DISABLED(EDITABLE_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 #endif
EEPROM_READ(servo_angles); EEPROM_READ(servo_angles);

4
Marlin/src/pins/pins.h

@ -627,8 +627,8 @@
#define MAX_EXTRUDERS 5 #define MAX_EXTRUDERS 5
#endif #endif
#ifndef MAX_SERVOS #ifndef NUM_SERVO_PLUGS
#define MAX_SERVOS 4 #define NUM_SERVO_PLUGS 4
#endif #endif
// //

Loading…
Cancel
Save