diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-06-01 12:04:01 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-06-02 17:52:11 -0400 |
commit | ed103822f5501f08c5d23216a1a505dbdd163f6c (patch) | |
tree | 17363ef740f2328076282e226539ffa85adc19e6 /src/sched.c | |
parent | d68cb264c421be687c53066df91c7ffb661ab2d9 (diff) | |
download | kutter-ed103822f5501f08c5d23216a1a505dbdd163f6c.tar.gz kutter-ed103822f5501f08c5d23216a1a505dbdd163f6c.tar.xz kutter-ed103822f5501f08c5d23216a1a505dbdd163f6c.zip |
sched: Change sched_from_ms() to sched_from_us()
Some code may require micro-second precision so update sched_from_ms()
to use micro-seconds.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/sched.c')
-rw-r--r-- | src/sched.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sched.c b/src/sched.c index 2f51515c..a25f43e2 100644 --- a/src/sched.c +++ b/src/sched.c @@ -9,9 +9,9 @@ #include <stddef.h> // NULL #include "autoconf.h" // CONFIG_* #include "board/irq.h" // irq_save -#include "board/timer.h" // timer_from_ms +#include "board/timer.h" // timer_from_us #include "command.h" // shutdown -#include "sched.h" // sched_from_ms +#include "sched.h" // sched_from_us #include "stepper.h" // stepper_event @@ -30,7 +30,7 @@ ms_event(struct timer *t) { millis++; timer_periodic(); - t->waketime += sched_from_ms(1); + t->waketime += sched_from_us(1000); return SF_RESCHEDULE; } @@ -52,11 +52,11 @@ sched_check_periodic(uint16_t time, uint16_t *pnext) return 1; } -// Return the number of clock ticks for a given number of milliseconds +// Return the number of clock ticks for a given number of microseconds uint32_t -sched_from_ms(uint32_t ms) +sched_from_us(uint32_t us) { - return timer_from_ms(ms); + return timer_from_us(us); } // Return the current time (in clock ticks) |