Vehicle Control Unit
0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Core
Src
Systems
Monitors
RTDMonitor.c
Go to the documentation of this file.
1
#include "../../../Inc/Systems/Monitor/RTDMonitor.h"
2
#include "../../../Inc/Utils/Common.h"
3
4
void
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
9
int
startRTDMonitor
(
RTDMonitor
* rtdm) {
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
18
int
checkRTDMonitor
(
void
* rtdm) {
19
// RTD controller is always in a safe state
20
return
_SUCCESS
;
21
}
_FAILURE
#define _FAILURE
Definition:
Common.h:6
_SUCCESS
#define _SUCCESS
Definition:
Common.h:5
initMonitorSystem
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
@ m_RTD
Definition:
MonitorSystem.h:16
VEHICLE_SHUTDOWN
@ VEHICLE_SHUTDOWN
Definition:
MonitorSystem.h:23
checkRTDMonitor
int checkRTDMonitor(void *rtdm)
Checks the RTD Monitor.
Definition:
RTDMonitor.c:18
initRTDMonitor
void initRTDMonitor(RTDMonitor *rtdm, RTD *rtd, int hz)
Initializes the RTD Monitor with initial settings.
Definition:
RTDMonitor.c:4
startRTDMonitor
int startRTDMonitor(RTDMonitor *rtdm)
Starts the RTD Monitor.
Definition:
RTDMonitor.c:9
ENABLE
#define ENABLE(item_)
Definition:
Updateable.h:10
MonitorSystem::runMonitor
int(* runMonitor)(void *self)
Definition:
MonitorSystem.h:30
MonitorSystem::system
System system
Definition:
MonitorSystem.h:27
RTDMonitor
Definition:
RTDMonitor.h:7
RTDMonitor::rtd
RTD * rtd
Definition:
RTDMonitor.h:9
RTDMonitor::base
MonitorSystem base
Definition:
RTDMonitor.h:8
RTD
Definition:
RTD.h:11
Generated by
1.9.5