Skip to content

Commit cf84b82

Browse files
Merge pull request #46 from Candas1/dev
HybridStepperMotor::init() returns int now
2 parents 5de9220 + 3d751cc commit cf84b82

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/motors/HybridStepperMotor/HybridStepperMotor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ void HybridStepperMotor::linkDriver(BLDCDriver *_driver)
3333
}
3434

3535
// init hardware pins
36-
void HybridStepperMotor::init()
36+
int HybridStepperMotor::init()
3737
{
3838
if (!driver || !driver->initialized)
3939
{
4040
motor_status = FOCMotorStatus::motor_init_failed;
4141
SIMPLEFOC_DEBUG("MOT: Init not possible, driver not initialized");
42-
return;
42+
return 0;
4343
}
4444
motor_status = FOCMotorStatus::motor_initializing;
4545
SIMPLEFOC_DEBUG("MOT: Init");
@@ -70,6 +70,7 @@ void HybridStepperMotor::init()
7070
_delay(500);
7171

7272
motor_status = FOCMotorStatus::motor_uncalibrated;
73+
return 1;
7374
}
7475

7576
// disable motor driver

src/motors/HybridStepperMotor/HybridStepperMotor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class HybridStepperMotor : public FOCMotor
4242
BLDCDriver *driver;
4343

4444
/** Motor hardware init function */
45-
void init() override;
45+
int init() override;
4646
/** Motor disable function */
4747
void disable() override;
4848
/** Motor enable function */

0 commit comments

Comments
 (0)