Skip to content

Commit

Permalink
Merge pull request #46 from Candas1/dev
Browse files Browse the repository at this point in the history
HybridStepperMotor::init() returns int now
  • Loading branch information
runger1101001 authored Jul 21, 2024
2 parents 5de9220 + 3d751cc commit cf84b82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/motors/HybridStepperMotor/HybridStepperMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ void HybridStepperMotor::linkDriver(BLDCDriver *_driver)
}

// init hardware pins
void HybridStepperMotor::init()
int HybridStepperMotor::init()
{
if (!driver || !driver->initialized)
{
motor_status = FOCMotorStatus::motor_init_failed;
SIMPLEFOC_DEBUG("MOT: Init not possible, driver not initialized");
return;
return 0;
}
motor_status = FOCMotorStatus::motor_initializing;
SIMPLEFOC_DEBUG("MOT: Init");
Expand Down Expand Up @@ -70,6 +70,7 @@ void HybridStepperMotor::init()
_delay(500);

motor_status = FOCMotorStatus::motor_uncalibrated;
return 1;
}

// disable motor driver
Expand Down
2 changes: 1 addition & 1 deletion src/motors/HybridStepperMotor/HybridStepperMotor.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class HybridStepperMotor : public FOCMotor
BLDCDriver *driver;

/** Motor hardware init function */
void init() override;
int init() override;
/** Motor disable function */
void disable() override;
/** Motor enable function */
Expand Down

0 comments on commit cf84b82

Please sign in to comment.