Vehicle Control Unit
0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Core
Src
Scheduler
Task.c
Go to the documentation of this file.
1
#include "../../Inc/Scheduler/Task.h"
2
3
void
TaskInit
(
Task
* task,
Updateable
* updateable,
int
hz) {
4
task->
updateable
= updateable;
5
task->
hz
= hz;
6
task->
nextExecTime
= 0;
7
}
8
9
void
TaskExecute
(
Task
* task) {
10
if
(task->
updateable
&& task->
updateable
->
update
) {
11
UPDATE
(task);
12
}
13
}
TaskInit
void TaskInit(Task *task, Updateable *updateable, int hz)
Initializes a task with the given sensor and update frequency.
Definition:
Task.c:3
TaskExecute
void TaskExecute(Task *task)
Executes the task by calling the sensor's update function.
Definition:
Task.c:9
UPDATE
#define UPDATE(item_)
Definition:
Updateable.h:8
Task
Definition:
Task.h:8
Task::hz
int hz
Definition:
Task.h:9
Task::updateable
Updateable * updateable
Definition:
Task.h:11
Task::nextExecTime
highResTime nextExecTime
Definition:
Task.h:10
Updateable
Definition:
Updateable.h:22
Updateable::update
void(* update)(void *self)
Definition:
Updateable.h:26
Generated by
1.9.5