safety state and input error detection
This commit is contained in:
@ -6,7 +6,22 @@
|
||||
#define MAX_ERROR_STRING_SIZE 64U
|
||||
#define NUMBER_OF_SENSOR_SANITY_CHECKS 4U
|
||||
|
||||
typedef float (*GetSensorValue)(eMeasurementMode);
|
||||
typedef enum _SensorErrorState
|
||||
{
|
||||
SENSOR_NO_ERROR,
|
||||
SENSOR_TOO_HIGH,
|
||||
SENSOR_TOO_LOW,
|
||||
SENSOR_UNCHANGED,
|
||||
SENSOR_NOT_FOUND
|
||||
} eSensorErrorState;
|
||||
|
||||
typedef enum _SafetyState
|
||||
{
|
||||
SAFETY_NO_ERROR,
|
||||
SAFETY_SENSOR_ERROR,
|
||||
} eSafetyState;
|
||||
|
||||
typedef sMeasurement (*GetSensorValue)();
|
||||
typedef struct _TemperatureSensorLimit
|
||||
{
|
||||
float max; // Maximum temperature limit
|
||||
@ -14,7 +29,7 @@ typedef struct _TemperatureSensorLimit
|
||||
} sTemperatureSensorLimit;
|
||||
typedef struct _SensorSanityCheck
|
||||
{
|
||||
uint8_t status;
|
||||
eSensorErrorState status;
|
||||
char name[MAX_ERROR_STRING_SIZE];
|
||||
sTemperatureSensorLimit sSensorLimit;
|
||||
float fSensorTemperatureLast;
|
||||
@ -23,5 +38,5 @@ typedef struct _SensorSanityCheck
|
||||
} sSensorSanityCheck;
|
||||
|
||||
void initSafety(void);
|
||||
|
||||
//sSensorSanityCheck *getSafetyStates(void);
|
||||
void getSensorSanityStates(sSensorSanityCheck *pSensorSanityChecks);
|
||||
eSafetyState getSafetyState(void);
|
Reference in New Issue
Block a user