Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
RTDMonitor.c
Go to the documentation of this file.
1#include "../../../Inc/Systems/Monitor/RTDMonitor.h"
2#include "../../../Inc/Utils/Common.h"
3
4void initRTDMonitor(RTDMonitor* rtdm, RTD* rtd, int hz) {
5 initMonitorSystem(&rtdm->base, "RTD Monitor", hz, m_RTD, VEHICLE_SHUTDOWN, checkRTDMonitor);
6 rtdm->rtd = rtd;
7}
8
10 if (rtdm->base.runMonitor == NULL) {
11 printf("Monitor function not set for RTD Monitor\n");
12 return _FAILURE;
13 }
14 ENABLE(rtdm->base.system);
15 return _SUCCESS;
16}
17
18int checkRTDMonitor(void* rtdm) {
19 // RTD controller is always in a safe state
20 return _SUCCESS;
21}
#define _FAILURE
Definition: Common.h:6
#define _SUCCESS
Definition: Common.h:5
void initMonitorSystem(MonitorSystem *monitor, const char *name, int hz, MonitorType type, FaultType fault, int(*runMonitor)(void *self))
Initializes the Monitor System with initial settings.
Definition: MonitorSystem.c:3
@ m_RTD
Definition: MonitorSystem.h:16
@ VEHICLE_SHUTDOWN
Definition: MonitorSystem.h:23
int checkRTDMonitor(void *rtdm)
Checks the RTD Monitor.
Definition: RTDMonitor.c:18
void initRTDMonitor(RTDMonitor *rtdm, RTD *rtd, int hz)
Initializes the RTD Monitor with initial settings.
Definition: RTDMonitor.c:4
int startRTDMonitor(RTDMonitor *rtdm)
Starts the RTD Monitor.
Definition: RTDMonitor.c:9
#define ENABLE(item_)
Definition: Updateable.h:10
int(* runMonitor)(void *self)
Definition: MonitorSystem.h:30
RTD * rtd
Definition: RTDMonitor.h:9
MonitorSystem base
Definition: RTDMonitor.h:8
Definition: RTD.h:11