diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-04-25 15:02:42 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-04-30 11:26:19 -0400 |
commit | 8f76e53c0eef351576be7fa2acbb964af031d7b3 (patch) | |
tree | a2e5ca68c7846aa1de993c3ebd445cef36f3844a /src/stepper.c | |
parent | b1ea4f3befe202e681115fe4e6b4a5986a581e17 (diff) | |
download | kutter-8f76e53c0eef351576be7fa2acbb964af031d7b3.tar.gz kutter-8f76e53c0eef351576be7fa2acbb964af031d7b3.tar.xz kutter-8f76e53c0eef351576be7fa2acbb964af031d7b3.zip |
stepper: Remove min_stop_interval from mcu code
Now that the host never uses a min_stop_interval, remove it from the
mcu code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stepper.c')
-rw-r--r-- | src/stepper.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/stepper.c b/src/stepper.c index f191be6e..83da362d 100644 --- a/src/stepper.c +++ b/src/stepper.c @@ -44,7 +44,6 @@ struct stepper { struct gpio_out step_pin, dir_pin; uint32_t position; struct move_queue_head mq; - uint32_t min_stop_interval; // gcc (pre v6) does better optimization when uint8_t are bitfields uint8_t flags : 8; }; @@ -53,7 +52,7 @@ enum { POSITION_BIAS=0x40000000 }; enum { SF_LAST_DIR=1<<0, SF_NEXT_DIR=1<<1, SF_INVERT_STEP=1<<2, SF_HAVE_ADD=1<<3, - SF_LAST_RESET=1<<4, SF_NO_NEXT_CHECK=1<<5, SF_NEED_RESET=1<<6 + SF_LAST_RESET=1<<4, SF_NEED_RESET=1<<5 }; // Setup a stepper for the next move in its queue @@ -62,9 +61,6 @@ stepper_load_next(struct stepper *s, uint32_t min_next_time) { if (move_queue_empty(&s->mq)) { // There is no next move - the queue is empty - if (s->interval - s->add < s->min_stop_interval - && !(s->flags & SF_NO_NEXT_CHECK)) - shutdown("No next step"); s->count = 0; return SF_DONE; } @@ -186,16 +182,14 @@ command_config_stepper(uint32_t *args) struct stepper *s = oid_alloc(args[0], command_config_stepper, sizeof(*s)); if (!CONFIG_INLINE_STEPPER_HACK) s->time.func = stepper_event; - s->flags = args[4] ? SF_INVERT_STEP : 0; + s->flags = args[3] ? SF_INVERT_STEP : 0; s->step_pin = gpio_out_setup(args[1], s->flags & SF_INVERT_STEP); s->dir_pin = gpio_out_setup(args[2], 0); - s->min_stop_interval = args[3]; s->position = -POSITION_BIAS; move_queue_setup(&s->mq, sizeof(struct stepper_move)); } DECL_COMMAND(command_config_stepper, - "config_stepper oid=%c step_pin=%c dir_pin=%c" - " min_stop_interval=%u invert_step=%c"); + "config_stepper oid=%c step_pin=%c dir_pin=%c invert_step=%c"); // Return the 'struct stepper' for a given stepper oid struct stepper * @@ -223,10 +217,6 @@ command_queue_step(uint32_t *args) flags ^= SF_LAST_DIR; m->flags |= MF_DIR; } - flags &= ~SF_NO_NEXT_CHECK; - if (m->count == 1 && (m->flags || flags & SF_LAST_RESET)) - // count=1 moves after a reset or dir change can have small intervals - flags |= SF_NO_NEXT_CHECK; flags &= ~SF_LAST_RESET; if (s->count) { s->flags = flags; |