sched: Don't count milliseconds in the periodic timer

It's not necessary to keep a millisecond counter.  Replace the two
users of sched_check_periodic() with explicit task wakeup flags.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-07-27 12:05:29 -04:00
parent 88a10fb31c
commit 62f77f6bc5
4 changed files with 53 additions and 37 deletions

View file

@ -20,11 +20,17 @@ struct timer {
enum { SF_DONE=0, SF_RESCHEDULE=1 };
// Task waking struct
struct task_wake {
uint8_t wake;
};
// sched.c
uint8_t sched_check_periodic(uint16_t time, uint16_t *pnext);
void sched_add_timer(struct timer*);
void sched_del_timer(struct timer *del);
unsigned int sched_timer_dispatch(void);
void sched_wake_task(struct task_wake *w);
uint8_t sched_check_wake(struct task_wake *w);
uint8_t sched_is_shutdown(void);
void sched_clear_shutdown(void);
void sched_try_shutdown(uint_fast8_t reason);