Skip to content

Commit

Permalink
change sensor_direction from int to Direction
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Unger committed Jun 24, 2023
1 parent 1496e51 commit d57d32d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/BLDCMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ int BLDCMotor::alignSensor() {
if(!exit_flag) return exit_flag;

// if unknown natural direction
if(!_isset(sensor_direction)){
if(sensor_direction==Direction::UNKNOWN){

// find natural direction
// move one electrical revolution forward
Expand Down
4 changes: 2 additions & 2 deletions src/common/base_classes/FOCMotor.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class FOCMotor
* @param sensor_direction sensor natural direction - default is CW
*
*/
virtual int initFOC( float zero_electric_offset = NOT_SET , Direction sensor_direction = Direction::CW)=0;
virtual int initFOC(float zero_electric_offset = NOT_SET , Direction sensor_direction = Direction::CW)=0;
/**
* Function running FOC algorithm in real-time
* it calculates the gets motor angle and sets the appropriate voltages
Expand Down Expand Up @@ -209,7 +209,7 @@ class FOCMotor
// sensor related variabels
float sensor_offset; //!< user defined sensor zero offset
float zero_electric_angle = NOT_SET;//!< absolute zero electric angle - if available
int sensor_direction = NOT_SET; //!< if sensor_direction == Direction::CCW then direction will be flipped to CW
Direction sensor_direction = Direction::UNKNOWN; //!< if sensor_direction == Direction::CCW then direction will be flipped to CW

/**
* Function providing BLDCMotor class with the
Expand Down

0 comments on commit d57d32d

Please sign in to comment.