"undefined reference to custom function"
I am unsure of why this function keeps triggering the "undefined reference to function" error, especially since it seems to be able to find it perfectly well when I deliberately leave out arguments.
The function in question is shown below:
dc_init(DC1, DC_IN_1_Pin, DC_IN_2_Pin, GPIOA, GPIOC);Additionally, here are the relevant pieces from the .h and .cpp files
".h"
struct DC_Driver
{
uint16_t pos_pin;
uint16_t neg_pin;
GPIO_TypeDef *pos_port;
GPIO_TypeDef *neg_port;
}dc_driver;
void dc_init(struct DC_Driver driver, uint16_t Pos_Pin, uint16_t Neg_Pin, GPIO_TypeDef *Pos_Port, GPIO_TypeDef *Neg_Port);".cpp"
void dc_init(struct DC_Driver driver, uint16_t Pos_Pin, uint16_t Neg_Pin, GPIO_TypeDef *Pos_Port, GPIO_TypeDef *Neg_Port) {
driver.pos_pin = Pos_Pin;
driver.neg_pin = Neg_Pin;
driver.pos_port = Pos_Port;
driver.neg_port = Neg_Port;
}The dc_init function is meant to save the GPIO information for a motor driver, with a similar function stepper motors. The device is meant to control one DC motor and two stepper motors.
I'm sure it's probably something simple I'm missing, but I can't find it. I'll try to provide more information if needed.