Skip to content

Commit d57d32d

Browse files
author
Richard Unger
committed
change sensor_direction from int to Direction
1 parent 1496e51 commit d57d32d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/BLDCMotor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ int BLDCMotor::alignSensor() {
213213
if(!exit_flag) return exit_flag;
214214

215215
// if unknown natural direction
216-
if(!_isset(sensor_direction)){
216+
if(sensor_direction==Direction::UNKNOWN){
217217

218218
// find natural direction
219219
// move one electrical revolution forward

src/common/base_classes/FOCMotor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class FOCMotor
109109
* @param sensor_direction sensor natural direction - default is CW
110110
*
111111
*/
112-
virtual int initFOC( float zero_electric_offset = NOT_SET , Direction sensor_direction = Direction::CW)=0;
112+
virtual int initFOC(float zero_electric_offset = NOT_SET , Direction sensor_direction = Direction::CW)=0;
113113
/**
114114
* Function running FOC algorithm in real-time
115115
* it calculates the gets motor angle and sets the appropriate voltages
@@ -209,7 +209,7 @@ class FOCMotor
209209
// sensor related variabels
210210
float sensor_offset; //!< user defined sensor zero offset
211211
float zero_electric_angle = NOT_SET;//!< absolute zero electric angle - if available
212-
int sensor_direction = NOT_SET; //!< if sensor_direction == Direction::CCW then direction will be flipped to CW
212+
Direction sensor_direction = Direction::UNKNOWN; //!< if sensor_direction == Direction::CCW then direction will be flipped to CW
213213

214214
/**
215215
* Function providing BLDCMotor class with the

0 commit comments

Comments
 (0)