Rename PulseGen::Move to PlanMoveTo
Make Motion and PulseGen intentionally very similar.pull/47/head
parent
be30314634
commit
1ff9b81630
|
|
@ -85,7 +85,7 @@ void PulseGen::CalculateTrapezoid(block_t *block, steps_t entry_speed, steps_t e
|
|||
block->final_rate = final_rate;
|
||||
}
|
||||
|
||||
bool PulseGen::Move(pos_t target, steps_t feed_rate) {
|
||||
bool PulseGen::PlanMoveTo(pos_t target, steps_t feed_rate) {
|
||||
// Prepare to set up new block
|
||||
if (block_index.full())
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -28,9 +28,12 @@ public:
|
|||
/// Set acceleration for the axis
|
||||
void SetAcceleration(steps_t accel) { acceleration = accel; }
|
||||
|
||||
/// Plan a single move (can only be executed when not Full())
|
||||
/// @returns True if the move has been planned
|
||||
bool Move(pos_t x, steps_t feed_rate);
|
||||
/// Enqueue a single move in steps starting and ending at zero speed with maximum
|
||||
/// feedrate. Moves can only be enqueued if the axis is not Full().
|
||||
/// @param pos target position
|
||||
/// @param feedrate maximum feedrate
|
||||
/// @returns true if the move has been enqueued
|
||||
bool PlanMoveTo(pos_t pos, steps_t feedrate);
|
||||
|
||||
/// stop whatever moves are being done
|
||||
void AbortPlannedMoves();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ TEST_CASE("pulse_gen::basic", "[pulse_gen]") {
|
|||
|
||||
for (int accel = 100; accel <= 5000; accel *= 2) {
|
||||
PulseGen pg(10, accel);
|
||||
pg.Move(100000, 10000);
|
||||
pg.PlanMoveTo(100000, 10000);
|
||||
|
||||
unsigned long ts = 0;
|
||||
st_timer_t next;
|
||||
|
|
|
|||
Loading…
Reference in New Issue