Skip to content

Commit b63e960

Browse files
authored
Removed thread-safety previous additions
1 parent 37f065a commit b63e960

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
*This fork adds the following features:*
2-
- *FOCMotor: thread-safe 'target' and 'controller' fields*
32
- *BLDCMotor: make 'alignSensor()' virtual*
43
- *Commander: allow contexts on onCommand callbacks*
54

src/common/base_classes/FOCMotor.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef FOCMOTOR_H
22
#define FOCMOTOR_H
33

4-
#include <atomic>
5-
64
#include "Arduino.h"
75
#include "Sensor.h"
86
#include "CurrentSense.h"
@@ -152,7 +150,7 @@ class FOCMotor
152150
float electricalAngle();
153151

154152
// state variables
155-
std::atomic<float> target; //!< current target value - depends of the controller
153+
float target; //!< current target value - depends of the controller
156154
float feed_forward_velocity = 0.0f; //!< current feed forward velocity
157155
float shaft_angle;//!< current motor angle
158156
float electrical_angle;//!< current electrical angle
@@ -192,7 +190,7 @@ class FOCMotor
192190

193191
// configuration structures
194192
TorqueControlType torque_controller; //!< parameter determining the torque control type
195-
std::atomic<MotionControlType> controller; //!< parameter determining the control loop to be used
193+
MotionControlType controller; //!< parameter determining the control loop to be used
196194

197195
// controllers and low pass filters
198196
PIDController PID_current_q{DEF_PID_CURR_P,DEF_PID_CURR_I,DEF_PID_CURR_D,DEF_PID_CURR_RAMP, DEF_POWER_SUPPLY};//!< parameter determining the q current PID config

0 commit comments

Comments
 (0)