File tree Expand file tree Collapse file tree 3 files changed +2
-7
lines changed Expand file tree Collapse file tree 3 files changed +2
-7
lines changed Original file line number Diff line number Diff line change 5
5
#include " ../common/foc_utils.h"
6
6
7
7
8
- #if !defined(TARGET_RP2040) && !defined(_SAMD21_) && !defined(_SAMD51_) && !defined(_SAME51_) && !defined(ARDUINO_UNOR4_WIFI) && !defined(ARDUINO_UNOR4_MINIMA) && !defined(NRF52_SERIES) && !defined(ARDUINO_ARCH_MEGAAVR)
9
- #define PinStatus int
10
- #endif
11
-
12
-
13
8
/* *
14
9
* Step/Dir listenner class for easier interraction with this communication interface.
15
10
*/
@@ -53,7 +48,7 @@ class StepDirListener
53
48
int pin_step; // !< step pin
54
49
int pin_dir; // !< direction pin
55
50
long count; // !< current counter value - should be set to 0 for homing
56
- PinStatus polarity = RISING; // !< polarity of the step pin
51
+ decltype (RISING) polarity = RISING; // !< polarity of the step pin
57
52
58
53
private:
59
54
float * attached_variable = nullptr ; // !< pointer to the attached variable
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ void HallSensor::updateState() {
53
53
hall_state = new_hall_state;
54
54
55
55
int8_t new_electric_sector = ELECTRIC_SECTORS[hall_state];
56
- static Direction old_direction;
57
56
if (new_electric_sector - electric_sector > 3 ) {
58
57
// underflow
59
58
direction = Direction::CCW;
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ class HallSensor: public Sensor{
62
62
63
63
// whether last step was CW (+1) or CCW (-1).
64
64
Direction direction;
65
+ Direction old_direction;
65
66
66
67
void attachSectorCallback (void (*onSectorChange)(int a) = nullptr);
67
68
You can’t perform that action at this time.
0 commit comments