Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Functions
RTDMonitor.c File Reference
#include "../../../Inc/Systems/Monitor/RTDMonitor.h"
#include "../../../Inc/Utils/Common.h"
Include dependency graph for RTDMonitor.c:

Go to the source code of this file.

Functions

void initRTDMonitor (RTDMonitor *rtdm, RTD *rtd, int hz)
 Initializes the RTD Monitor with initial settings. More...
 
int startRTDMonitor (RTDMonitor *rtdm)
 Starts the RTD Monitor. More...
 
int checkRTDMonitor (void *rtdm)
 Checks the RTD Monitor. More...
 

Function Documentation

◆ checkRTDMonitor()

int checkRTDMonitor ( void *  rtdm)

Checks the RTD Monitor.

Parameters
rtdmA pointer to the RTDMonitor structure.
Returns
_SUCCESS if the monitor was checked, _FAILURE otherwise.

Definition at line 18 of file RTDMonitor.c.

18 {
19 // RTD controller is always in a safe state
20 return _SUCCESS;
21}
#define _SUCCESS
Definition: Common.h:5
Here is the caller graph for this function:

◆ initRTDMonitor()

void initRTDMonitor ( RTDMonitor rtdm,
RTD rtd,
int  hz 
)

Initializes the RTD Monitor with initial settings.

Parameters
rtdmA pointer to the RTDMonitor structure.
rtdA pointer to the RTD structure.
hzRate at which the sensor is called (in hz).
Returns
void

Definition at line 4 of file RTDMonitor.c.

4 {
5 initMonitorSystem(&rtdm->base, "RTD Monitor", hz, m_RTD, VEHICLE_SHUTDOWN, checkRTDMonitor);
6 rtdm->rtd = rtd;
7}
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
RTD * rtd
Definition: RTDMonitor.h:9
MonitorSystem base
Definition: RTDMonitor.h:8
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startRTDMonitor()

int startRTDMonitor ( RTDMonitor rtdm)

Starts the RTD Monitor.

Parameters
rtdmA pointer to the RTDMonitor structure.
Returns
_SUCCESS if the monitor was started, _FAILURE otherwise.

Definition at line 9 of file RTDMonitor.c.

9 {
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}
#define _FAILURE
Definition: Common.h:6
#define ENABLE(item_)
Definition: Updateable.h:10
int(* runMonitor)(void *self)
Definition: MonitorSystem.h:30
Here is the caller graph for this function: