Have a counter that increments or decrements based on both the hall sensor(s) and which direction the motor is running at the time the hall sensor(s) trigger.
Have a counter that increments or decrements based on both the hall sensor(s) and which direction the motor is running at the time the hall sensor(s) trigger.