Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Casting issue... #87

Closed
trlafleur opened this issue Dec 18, 2019 · 1 comment
Closed

Type Casting issue... #87

trlafleur opened this issue Dec 18, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@trlafleur
Copy link

trlafleur commented Dec 18, 2019

This was discovered when we tried to use an RPM of less than zero...
In DRV8880.x RPM it's a short, but in BasicStepperDriver.x it's a float...

Changing casting on DRV8880.x from short to float fixes this issue...
This bug may be in other drivers.... (looks like other drivers do not re-define begin(), also the prototypes are most likely not needed in the driver as they are defined in: BasicStepperDriver.h)

In DRV8880.h

53    void begin(short rpm=60, short microsteps=1);

In DRV8800.cpp

42   void DRV8880::begin(short rpm, short microsteps){
      BasicStepperDriver::begin(rpm, microsteps);
      setCurrent(100);
     }

In BasicStepperDriver.h

118     void begin(float rpm=60, short microsteps=1);

In BasicStepperDriver.cpp

41      void BasicStepperDriver::begin(float rpm, short microsteps){
@trlafleur trlafleur added the bug label Dec 18, 2019
@laurb9 laurb9 added this to the 1.2.1 milestone May 13, 2020
@laurb9
Copy link
Owner

laurb9 commented May 13, 2020

Thank you for the report. It looks like #40 missed a few places.

laurb9 added a commit that referenced this issue May 13, 2020
Looks like af7501b missed a few places, which results
in A4988 and DRV8880 truncating an eventual float rpm.
@laurb9 laurb9 closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants