multiple definitions of "microstepcurve"

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
W1CMC
 
Posts: 1
Joined: Tue Nov 25, 2014 8:02 am

multiple definitions of "microstepcurve"

Post by W1CMC »

If I try to use both the old and new motor shields in the same sketch, there are multiple definitions of the symbol "microstepcurve" at link time. This is easily fixed since the symbols do not need external linkage (arguably, they are externals only by accident): change

Code: Select all

#if (MICROSTEPS == 8)
uint8_t microstepcurve[] = {0, 50, 98, 142, 180, 212, 236, 250, 255};
#elif (MICROSTEPS == 16)
uint8_t microstepcurve[] = {0, 25, 50, 74, 98, 120, 141, 162, 180, 197, 212, 225, 236, 244, 250, 253, 255};
#endif
to

Code: Select all

#if (MICROSTEPS == 8)
static const uint8_t microstepcurve[] = {0, 50, 98, 142, 180, 212, 236, 250, 255};
#elif (MICROSTEPS == 16)
static const uint8_t microstepcurve[] = {0, 25, 50, 74, 98, 120, 141, 162, 180, 197, 212, 225, 236, 244, 250, 253, 255};
#endif
in both libraries.

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: multiple definitions of "microstepcurve"

Post by adafruit_support_bill »

Thanks for the feedback. I don't know of anyone else that has tried running that combination of shields.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”