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