aboutsummaryrefslogtreecommitdiffstats
path: root/src/sched.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-06-01 12:04:01 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-06-02 17:52:11 -0400
commited103822f5501f08c5d23216a1a505dbdd163f6c (patch)
tree17363ef740f2328076282e226539ffa85adc19e6 /src/sched.c
parentd68cb264c421be687c53066df91c7ffb661ab2d9 (diff)
downloadkutter-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.c12
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)