Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Classes | Functions
BrakePolice.h File Reference
#include "../MonitorSystem.h"
#include "../Controller/BrakeSystemControl.h"
Include dependency graph for BrakePolice.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BrakePolice
 

Functions

void initBrakePolice (BrakePolice *bp, BrakeSystemControl *bsc, int hz, int maxTemp)
 
int startBrakePolice (BrakePolice *bp)
 
int checkBrakePolice (void *bp)
 

Function Documentation

◆ checkBrakePolice()

int checkBrakePolice ( void *  bp)

Definition at line 23 of file BrakePolice.c.

23 {
24 BrakePolice* bpPtr = (BrakePolice*)bp;
25 BrakeSystemControl* bsc = bpPtr->bsc;
26 bsc->status = checkSensorLimits(bsc);
27 if (bsc->status != BRAKES_OK) {
28 return _FAILURE;
29 }
30
31 return _SUCCESS;
32}
@ BRAKES_OK
BrakeSystemStatus checkSensorLimits(BrakeSystemControl *bsc)
Checks if the brake system is within the defined limits and desired ranges.
#define _FAILURE
Definition: Common.h:6
#define _SUCCESS
Definition: Common.h:5
BrakeSystemControl * bsc
Definition: BrakePolice.h:11
BrakeSystemStatus status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initBrakePolice()

void initBrakePolice ( BrakePolice bp,
BrakeSystemControl bsc,
int  hz,
int  maxTemp 
)

Definition at line 5 of file BrakePolice.c.

5 {
7 bp->bsc = bsc;
8 bp->maxTemperatureAllowed = maxTemp;
9 bp->status = BRAKES_OK;
10}
int checkBrakePolice(void *bp)
Definition: BrakePolice.c:23
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_BRAKES
Definition: MonitorSystem.h:13
@ VEHICLE_SHUTDOWN
Definition: MonitorSystem.h:23
BrakeSystemStatus status
Definition: BrakePolice.h:10
MonitorSystem base
Definition: BrakePolice.h:8
int maxTemperatureAllowed
Definition: BrakePolice.h:9
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startBrakePolice()

int startBrakePolice ( BrakePolice bp)

Definition at line 13 of file BrakePolice.c.

13 {
14 if (bp->base.runMonitor == NULL) {
15 printf("Monitor function not set for BrakePolice\n");
16 return _FAILURE;
17 }
18 ENABLE(bp->base.system);
19 return _SUCCESS;
20}
#define ENABLE(item_)
Definition: Updateable.h:10
int(* runMonitor)(void *self)
Definition: MonitorSystem.h:30
Here is the caller graph for this function: