We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f39aa92 commit 742924cCopy full SHA for 742924c
src/sensors/HallSensor.cpp
@@ -53,7 +53,6 @@ void HallSensor::updateState() {
53
hall_state = new_hall_state;
54
55
int8_t new_electric_sector = ELECTRIC_SECTORS[hall_state];
56
- static Direction old_direction;
57
if (new_electric_sector - electric_sector > 3) {
58
//underflow
59
direction = Direction::CCW;
src/sensors/HallSensor.h
@@ -62,6 +62,7 @@ class HallSensor: public Sensor{
62
63
// whether last step was CW (+1) or CCW (-1).
64
Direction direction;
65
+ Direction old_direction;
66
67
void attachSectorCallback(void (*onSectorChange)(int a) = nullptr);
68
0 commit comments