SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
FaultConfig.def File Reference

Configure fault checking. More...

#include "ECUGlobalConfig.h"
#include "Log.h"
#include "PPhelp.h"
#include "Pins.h"

Go to the source code of this file.

Macros

#define HARD_PIN_FAULTS
 Defines Pins that should be checked for hard faults.
 
#define SOFT_PIN_FAULTS
 Defines Pins that should be checked for hard faults.
 
#define HARD_FAULT_ADD
 Defines CAN addresses that should be checked for hard faults.
 
#define SOFT_FAULT_ADD
 Defines CAN addresses that should be checked for soft faults.
 
#define CAN_FAULT_IDS
 Defines address bit field identifiers.
 

Detailed Description

Configure fault checking.

Author
IR
Version
0.1
Date
2021-01-27

This configuration defines all the faults to check for.

Definition in file FaultConfig.def.

Macro Definition Documentation

◆ CAN_FAULT_IDS

#define CAN_FAULT_IDS

Defines address bit field identifiers.

If a bit on an address has an identifier we will know exactly what fault occurred and can notify it through Log

Note
The identity calls the function _LogPrebuildString, this is used to notify Pre_Build.py of the string

Unless it is the last entry, this is how to add a new address

X(CAN address, bitmask, _LogPrebuildString(identity)) \

Only the last entry should NOT have a '\'

Definition at line 104 of file FaultConfig.def.

◆ HARD_FAULT_ADD

#define HARD_FAULT_ADD

Defines CAN addresses that should be checked for hard faults.

Note
For documentation purposes, the last parameter is only used to identify what each message is for

Unless it is the last entry, this is how to add a new address

X(CAN address, mask, tag) \

Only the last entry should NOT have a '\'

Definition at line 71 of file FaultConfig.def.

◆ HARD_PIN_FAULTS

#define HARD_PIN_FAULTS
Value:
X(PINS_BACK_IMD_FAULT, >, 0, _LogPrebuildString("IMD Fault Signal")) \
X(PINS_BACK_BMS_FAULT, >, 0, _LogPrebuildString("BMS Fault Signal"))
#define _LogPrebuildString(x)
Refer to Pre_Build.py.
Definition Log.h:20

Defines Pins that should be checked for hard faults.

Note
The identity calls the function _LogPrebuildString, this is used to notify Pre_Build.py of the string

Unless it is the last entry, this is how to add a new address

X(pin, comparator, value, identity) \

Only the last entry should NOT have a '\'

Definition at line 37 of file FaultConfig.def.

◆ SOFT_FAULT_ADD

#define SOFT_FAULT_ADD
Value:
X(ADD_MC0_FAULTS, 0xffffffffffffffff, "Motor Controller 0 Faults") \
X(ADD_MC1_FAULTS, 0xffffffffffffffff, "Motor Controller 1 Faults")

Defines CAN addresses that should be checked for soft faults.

Note
For documentation purposes, the last parameter is only used to identify what each message is for

Unless it is the last entry, this is how to add a new address

X(CAN address, mask, tag) \

Only the last entry should NOT have a '\'

Definition at line 86 of file FaultConfig.def.

◆ SOFT_PIN_FAULTS

#define SOFT_PIN_FAULTS

Defines Pins that should be checked for hard faults.

Note
The identity calls the function _LogPrebuildString, this is used to notify Pre_Build.py of the string

Unless it is the last entry, this is how to add a new address

X(pin, comparator, value, identity) \

Only the last entry should NOT have a '\'

Definition at line 56 of file FaultConfig.def.