aboutsummaryrefslogtreecommitdiffstats
path: root/src/stepper.c
Commit message (Collapse)AuthorAgeFilesLines
* basecmd: Use oid_ prefix for the oid manipulation functionsKevin O'Connor2017-03-091-5/+5
| | | | | | | Consistently use an "oid_" prefix on the oid functions - this makes them similar to other functions with a common prefix. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* basecmd: Generalize the "move queue" runtime storageKevin O'Connor2017-03-081-5/+15
| | | | | | | | | Detect the maximum size of each "move queue" item during the configuration phase instead of using the stepper move struct. This allows the stepper code to be contained entirely in stepper.c and it allows for future run time allocations from other types of objects. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Minor change - remove unneeded header filesKevin O'Connor2017-01-141-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Reset the next step time on a stepper stopKevin O'Connor2016-11-141-0/+1
| | | | | | | | | Automatically reset the next step time to zero on a stepper_stop() call. This makes the host code simpler as it no longer needs to schedule an explicit reset_step_clock command on the step after a homing operation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Default to a high direction pin meaning positive directionKevin O'Connor2016-11-081-2/+2
| | | | | | | | | Invert the default meaning of the stepper direction pin. Instead of treating a low value as position motion, treat a high value as positive motion. This matches what other firmwares do, and it matches what common stepper motor drivers document. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Disable "no next step" check for some count=1 queue_step commandsKevin O'Connor2016-09-221-5/+16
| | | | | | | | | It's possible for a "count=1" stepper move immediately after a set_next_step_dir or reset_step_clock command to be valid and have an interval less than min_stop_interval. Make sure this case does not result in a shutdown. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support rescheduling of step events on faster MCUsKevin O'Connor2016-06-141-19/+72
| | | | | | | | | | On faster MCUs the step and unstep events may be too close for the stepper motor driver. Add a CONFIG_NO_UNSTEP_DELAY build option and support the case where it is not set. This allows faster MCUs to schedule two events for each step (one for the step and one for the unstep). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Use uint_fast8_t for return type of timersKevin O'Connor2016-06-141-3/+3
| | | | | | | | Some architectures are faster passing regular integers than 8bit integers. Use uint_fast8_t so that the architecture chooses the appropriate type. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* irq: Prefer irq_disable/enable instead of irq_save/restore in cmds/tasksKevin O'Connor2016-06-131-3/+3
| | | | | | | | Task and command handlers always run with irqs enabled, so it is not necessary to save/restore the irq state when disabling irqs in these handlers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Optimize for case where add is zeroKevin O'Connor2016-06-131-11/+15
| | | | | | | At high rates, the "add" field is frequently zero. It's possible to optimize for that case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Use stepper_stop() instead of stepper_reset() in stepper_shutdown()Kevin O'Connor2016-06-021-13/+6
| | | | | | | The stepper_stop() function is equivalent to stepper_reset() during a shutdown event. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+202
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>