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

Replace boolean with bool. #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/AccelStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void AccelStepper::move(long relative)
// Implements steps according to the current step interval
// You must call this at least once per step
// returns true if a step occurred
boolean AccelStepper::runSpeed()
bool AccelStepper::runSpeed()
{
// Dont do anything unless we actually have a step interval
if (!_stepInterval)
Expand Down Expand Up @@ -182,7 +182,7 @@ unsigned long AccelStepper::computeNewSpeed()
// You must call this at least once per step, preferably in your main loop
// If the motor is in the desired position, the cost is very small
// returns true if the motor is still running to the target position.
boolean AccelStepper::run()
bool AccelStepper::run()
{
if (runSpeed())
computeNewSpeed();
Expand Down Expand Up @@ -643,7 +643,7 @@ void AccelStepper::runToPosition()
YIELD; // Let system housekeeping occur
}

boolean AccelStepper::runSpeedToPosition()
bool AccelStepper::runSpeedToPosition()
{
if (_targetPos == _currentPos)
return false;
Expand Down
8 changes: 4 additions & 4 deletions src/AccelStepper.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,13 @@ class AccelStepper
/// preferably in your main loop. Note that each call to run() will make at most one step, and then only when a step is due,
/// based on the current speed and the time since the last step.
/// \return true if the motor is still running to the target position.
boolean run();
bool run();

/// Poll the motor and step it if a step is due, implementing a constant
/// speed as set by the most recent call to setSpeed(). You must call this as
/// frequently as possible, but at least once per step interval,
/// \return true if the motor was stepped.
boolean runSpeed();
bool runSpeed();

/// Sets the maximum permitted speed. The run() function will accelerate
/// up to the speed set by this function.
Expand Down Expand Up @@ -495,7 +495,7 @@ class AccelStepper
/// speed unless the target position has been reached.
/// Does not implement accelerations.
/// \return true if it stepped
boolean runSpeedToPosition();
bool runSpeedToPosition();

/// Moves the motor (with acceleration/deceleration)
/// to the new target position and blocks until it is at
Expand Down Expand Up @@ -650,7 +650,7 @@ class AccelStepper

/// Current direction motor is spinning in
/// Protected because some peoples subclasses need it to be so
boolean _direction; // 1 == CW
bool _direction; // 1 == CW

/// The current interval between steps in microseconds.
/// 0 means the motor is currently stopped with _speed == 0
Expand Down
6 changes: 3 additions & 3 deletions src/MultiStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MultiStepper::MultiStepper()
{
}

boolean MultiStepper::addStepper(AccelStepper& stepper)
bool MultiStepper::addStepper(AccelStepper& stepper)
{
if (_num_steppers >= MULTISTEPPER_MAX_STEPPERS)
return false; // No room for more
Expand Down Expand Up @@ -49,10 +49,10 @@ void MultiStepper::moveTo(long absolute[])
}

// Returns true if any motor is still running to the target position.
boolean MultiStepper::run()
bool MultiStepper::run()
{
uint8_t i;
boolean ret = false;
bool ret = false;
for (i = 0; i < _num_steppers; i++)
{
if ( _steppers[i]->distanceToGo() != 0)
Expand Down
4 changes: 2 additions & 2 deletions src/MultiStepper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MultiStepper
/// There is an upper limit of MULTISTEPPER_MAX_STEPPERS = 10 to the number of steppers that can be managed
/// \param[in] stepper Reference to a stepper to add to the managed list
/// \return true if successful. false if the number of managed steppers would exceed MULTISTEPPER_MAX_STEPPERS
boolean addStepper(AccelStepper& stepper);
bool addStepper(AccelStepper& stepper);

/// Set the target positions of all managed steppers
/// according to a coordinate array.
Expand All @@ -54,7 +54,7 @@ class MultiStepper
/// Calls runSpeed() on all the managed steppers
/// that have not acheived their target position.
/// \return true if any stepper is still in the process of running to its target position.
boolean run();
bool run();

/// Runs all managed steppers until they acheived their target position.
/// Blocks until all that position is acheived. If you dont
Expand Down