At least for min/max this will ensure types for both arguments are the
same.
This should be a little bit closer to the <cmath> definition that
simply overloads these functions instead.
This matches PulseGen::Position() and avoids confusion around the term
"current": Position() returns the head position in the queue, not the
"live" axis position.
We have PulseGen::CurPosition() now for this purpose, although we don't
expose it to Motion yet.
CurPosition() returns the live axis position, which in this
implementation is inherently expensive to compute.
This shouldn't be required for the MMU, but it /will/ come in handy to
check for the axis position/s in Motion tests.
Make ReadPin return the last value set by WritePin for proper testing.
Add a slow-path to TogglePin that goes through a read-write cycle. This
is useful both for testing and for platforms that don't have an
efficient toggle like AVR.
The cast to Level is incorrect, since the expression returns either 0 or
a positive value if the pin is set. The value is directly assigned to
the underlying uint8_t, meaning that Level::high won't match for levels
greater than 0.
Return a boolean and cast that to Level instead.
Instead of adding #ifdefs for missing headers, create a shim that can be
included everywhere.
"limits.h" includes a bare-bone implementation of numeric_limits (to be
extended as needed).
Instead of stepping halfway, step ~1/3 of the way through.
This ensures we can check if the steps performed is correct due to the
internal step subtraction.
Motion::Full() (without a specific axis) is counter-productive.
When planning new moves the axis needs to be known beforehand, so it
might be as well be given to Full() to check the proper queue.