mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-10 08:17:52 -06:00
sched: Introduce sched_wake_tasks() function to wake up tasks
Add function to indicate when tasks need to be run. This will allow the scheduler code to know if there are any tasks that need to be processed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
e9d2ec7c41
commit
a9982beacf
10 changed files with 74 additions and 10 deletions
10
src/sched.c
10
src/sched.c
|
@ -28,6 +28,9 @@ static struct timer sentinel_timer, deleted_timer;
|
|||
static uint_fast8_t
|
||||
periodic_event(struct timer *t)
|
||||
{
|
||||
// Make sure the stats task runs periodically
|
||||
sched_wake_tasks();
|
||||
// Reschedule timer
|
||||
periodic_timer.waketime += timer_from_us(100000);
|
||||
sentinel_timer.waketime = periodic_timer.waketime + 0x80000000;
|
||||
return SF_RESCHEDULE;
|
||||
|
@ -177,10 +180,17 @@ sched_timer_reset(void)
|
|||
* Task waking
|
||||
****************************************************************/
|
||||
|
||||
// Note that at least one task is ready to run
|
||||
void
|
||||
sched_wake_tasks(void)
|
||||
{
|
||||
}
|
||||
|
||||
// Note that a task is ready to run
|
||||
void
|
||||
sched_wake_task(struct task_wake *w)
|
||||
{
|
||||
sched_wake_tasks();
|
||||
writeb(&w->wake, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue