From 62f77f6bc56e0fcffdcdd4dcf2cfd6a7669099f2 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 27 Jul 2017 12:05:29 -0400 Subject: 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 --- src/sched.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sched.h') diff --git a/src/sched.h b/src/sched.h index ad5c2c08..bb6bb975 100644 --- a/src/sched.h +++ b/src/sched.h @@ -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); -- cgit v1.2.3-70-g09d2