Rename PulseGen::Move to PlanMoveTo

Make Motion and PulseGen intentionally very similar.
pull/47/head
Yuri D'Elia 2021-07-07 16:35:50 +02:00
parent be30314634
commit 1ff9b81630
3 changed files with 8 additions and 5 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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;