Skip to content

Commit

Permalink
(bug) update rpm to float in all places (#87)
Browse files Browse the repository at this point in the history
Looks like af7501b missed a few places, which results
in A4988 and DRV8880 truncating an eventual float rpm.
  • Loading branch information
laurb9 committed May 13, 2020
1 parent 36dfa5b commit af16379
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/A4988.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ A4988::A4988(short steps, short dir_pin, short step_pin, short enable_pin, short
ms1_pin(ms1_pin), ms2_pin(ms2_pin), ms3_pin(ms3_pin)
{}

void A4988::begin(short rpm, short microsteps){
void A4988::begin(float rpm, short microsteps){
BasicStepperDriver::begin(rpm, microsteps);

if (!IS_CONNECTED(ms1_pin) || !IS_CONNECTED(ms2_pin) || !IS_CONNECTED(ms3_pin)){
Expand Down
2 changes: 1 addition & 1 deletion src/A4988.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class A4988 : public BasicStepperDriver {
A4988(short steps, short dir_pin, short step_pin);
A4988(short steps, short dir_pin, short step_pin, short enable_pin);

void begin(short rpm=60, short microsteps=1);
void begin(float rpm=60, short microsteps=1);
/*
* Fully wired. All the necessary control pins for A4988 are connected.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/DRV8880.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DRV8880::DRV8880(short steps, short dir_pin, short step_pin, short enable_pin, s
:BasicStepperDriver(steps, dir_pin, step_pin, enable_pin), m0(m0), m1(m1), trq0(trq0), trq1(trq1)
{}

void DRV8880::begin(short rpm, short microsteps){
void DRV8880::begin(float rpm, short microsteps){
BasicStepperDriver::begin(rpm, microsteps);
setCurrent(100);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DRV8880.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DRV8880 : public BasicStepperDriver {
DRV8880(short steps, short dir_pin, short step_pin, short m0, short m1, short trq0, short trq1);
DRV8880(short steps, short dir_pin, short step_pin, short enable_pin, short m0, short m1, short trq0, short trq1);

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

short setMicrostep(short microsteps) override;

Expand Down

0 comments on commit af16379

Please sign in to comment.