Compile Error - initializer fails to determine size of 'servo_delay'

Hello all,

I searched and could not find an answer to my problem. Any help would be appreciated.

I'm new to all of this so please excuse my ignorance. I've built a 3D printer from a kit (FLSun Prusa I3 C clone), and was able to compile a configuration and upload it to the board a few days ago with no problem. Yesterday I went to make a small change to the configuration (Invert Endstop), and compile it, and now I get the following error:

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from sketch\MarlinConfig.h:30:0,

from sketch\servo.cpp:53:

sketch\servo.cpp: In member function 'void Servo::move(int)':

Configuration.h:1545: error: initializer fails to determine size of 'servo_delay'

define SERVO_DELAY 300

^

sketch\servo.cpp:311:38: note: in expansion of macro 'SERVO_DELAY'

constexpr uint16_t servo_delay[] = SERVO_DELAY;

^

Configuration.h:1545: error: array must be initialized with a brace-enclosed initializer

define SERVO_DELAY 300

^

sketch\servo.cpp:311:38: note: in expansion of macro 'SERVO_DELAY'

constexpr uint16_t servo_delay[] = SERVO_DELAY;

^

servo.cpp:312: error: static assertion failed: SERVO_DELAY must be an array NUM_SERVOS long.

static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");

^

exit status 1 initializer fails to determine size of 'servo_delay'

How do I resolve this error?

Thanks in advance,

-Jorden

By the way, here is the current setting I have in my configuration.h

define SERVO_DELAY 300

OK, did some more troubleshooting. I still don't know why it's a problem, but here is some more info:

Using Marlin 1.1.2, these setting work fine, but won't work for me using Marlin 1.1.6:

//#define FIX_MOUNTED_PROBE

/** * Z Servo Probe, such as an endstop switch on a rotating arm. */

define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector.

define Z_SERVO_ANGLES {40,85} // Z Servo Deploy and Stow angles

. . .

define NUM_SERVOS 2 // Servo index starts with 0 for M280 command

// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it.

define SERVO_DELAY 500

// Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter.

define DEACTIVATE_SERVOS_AFTER_MOVE

Using Marlin 1.1.6, I have to set those settings to the following, in order to prevent the SERVO_DELAY error:

define FIX_MOUNTED_PROBE

/** * Z Servo Probe, such as an endstop switch on a rotating arm. */ //#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {40,85} // Z Servo Deploy and Stow angles

. . . //#define NUM_SERVOS 2 // Servo index starts with 0 for M280 command

// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. // 300ms is a good value but you can try less delay. // If the servo can't reach the requested position, increase it.

define SERVO_DELAY 300

// Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE

Any idea why?

Thanks in advance.

-Jorden