sched: Rename sched_timer() to sched_add_timer()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
cdd5a772e8
commit
944d176856
|
@ -54,7 +54,7 @@ functions should never pause, delay, or do any work that lasts more
|
|||
than a few micro-seconds. These functions schedule work at specific
|
||||
times by scheduling timers.
|
||||
|
||||
Timer functions are scheduled by calling sched_timer() (located in
|
||||
Timer functions are scheduled by calling sched_add_timer() (located in
|
||||
**src/sched.c**). The scheduler code will arrange for the given
|
||||
function to be called at the requested clock time. Timer interrupts
|
||||
are initially handled in an architecture specific interrupt handler
|
||||
|
|
|
@ -74,7 +74,7 @@ command_query_analog_in(uint32_t *args)
|
|||
a->max_value = args[6];
|
||||
if (! a->sample_count)
|
||||
return;
|
||||
sched_timer(&a->timer);
|
||||
sched_add_timer(&a->timer);
|
||||
}
|
||||
DECL_COMMAND(command_query_analog_in,
|
||||
"query_analog_in oid=%c clock=%u sample_ticks=%u sample_count=%c"
|
||||
|
|
|
@ -209,7 +209,7 @@ command_start_group(uint32_t *args)
|
|||
sched_del_timer(&group_timer);
|
||||
group_timer.func = group_end_event;
|
||||
group_timer.waketime = args[0];
|
||||
sched_timer(&group_timer);
|
||||
sched_add_timer(&group_timer);
|
||||
}
|
||||
DECL_COMMAND(command_start_group, "start_group clock=%u");
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ command_end_stop_home(uint32_t *args)
|
|||
return;
|
||||
}
|
||||
e->flags = ESF_HOMING | (args[3] ? ESF_PIN_HIGH : 0);
|
||||
sched_timer(&e->time);
|
||||
sched_add_timer(&e->time);
|
||||
}
|
||||
DECL_COMMAND(command_end_stop_home,
|
||||
"end_stop_home oid=%c clock=%u rest_ticks=%u pin_value=%c");
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "board/gpio.h" // struct gpio_out
|
||||
#include "board/irq.h" // irq_disable
|
||||
#include "command.h" // DECL_COMMAND
|
||||
#include "sched.h" // sched_timer
|
||||
#include "sched.h" // sched_add_timer
|
||||
|
||||
|
||||
/****************************************************************
|
||||
|
@ -61,7 +61,7 @@ command_schedule_digital_out(uint32_t *args)
|
|||
d->timer.func = digital_out_event;
|
||||
d->timer.waketime = args[1];
|
||||
d->value = args[2];
|
||||
sched_timer(&d->timer);
|
||||
sched_add_timer(&d->timer);
|
||||
}
|
||||
DECL_COMMAND(command_schedule_digital_out,
|
||||
"schedule_digital_out oid=%c clock=%u value=%c");
|
||||
|
@ -202,7 +202,7 @@ command_schedule_soft_pwm_out(uint32_t *args)
|
|||
sched_del_timer(&s->timer);
|
||||
s->timer.waketime = time;
|
||||
s->timer.func = soft_pwm_load_event;
|
||||
sched_timer(&s->timer);
|
||||
sched_add_timer(&s->timer);
|
||||
}
|
||||
irq_enable();
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "basecmd.h" // oid_alloc
|
||||
#include "board/gpio.h" // struct gpio_pwm
|
||||
#include "command.h" // DECL_COMMAND
|
||||
#include "sched.h" // sched_timer
|
||||
#include "sched.h" // sched_add_timer
|
||||
|
||||
struct pwm_out_s {
|
||||
struct timer timer;
|
||||
|
@ -54,7 +54,7 @@ command_schedule_pwm_out(uint32_t *args)
|
|||
p->timer.func = pwm_event;
|
||||
p->timer.waketime = args[1];
|
||||
p->value = args[2];
|
||||
sched_timer(&p->timer);
|
||||
sched_add_timer(&p->timer);
|
||||
}
|
||||
DECL_COMMAND(command_schedule_pwm_out,
|
||||
"schedule_pwm_out oid=%c clock=%u value=%c");
|
||||
|
|
|
@ -97,7 +97,7 @@ static struct timer *timer_list = &ms_timer;
|
|||
|
||||
// Schedule a function call at a supplied time.
|
||||
void
|
||||
sched_timer(struct timer *add)
|
||||
sched_add_timer(struct timer *add)
|
||||
{
|
||||
uint32_t waketime = add->waketime;
|
||||
irqstatus_t flag = irq_save();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// Declare a shutdown function (called on an emergency stop)
|
||||
#define DECL_SHUTDOWN(FUNC) _DECL_CALLBACK(shutdownfuncs, FUNC)
|
||||
|
||||
// Timer structure for scheduling timed events (see sched_timer() )
|
||||
// Timer structure for scheduling timed events (see sched_add_timer() )
|
||||
struct timer {
|
||||
struct timer *next;
|
||||
uint_fast8_t (*func)(struct timer*);
|
||||
|
@ -26,7 +26,7 @@ uint8_t sched_check_periodic(uint16_t time, uint16_t *pnext);
|
|||
uint32_t sched_from_us(uint32_t us);
|
||||
uint32_t sched_read_time(void);
|
||||
uint8_t sched_is_before(uint32_t time1, uint32_t time2);
|
||||
void sched_timer(struct timer*);
|
||||
void sched_add_timer(struct timer*);
|
||||
void sched_del_timer(struct timer *del);
|
||||
void sched_timer_kick(void);
|
||||
uint8_t sched_is_shutdown(void);
|
||||
|
|
|
@ -202,7 +202,7 @@ command_queue_step(uint32_t *args)
|
|||
} else {
|
||||
s->first = m;
|
||||
stepper_load_next(s, s->next_step_time + m->interval);
|
||||
sched_timer(&s->time);
|
||||
sched_add_timer(&s->time);
|
||||
}
|
||||
irq_enable();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue