rusefi/firmware/controllers/gauges/malfunction_central.h

43 lines
995 B
C

/**
* @file malfunction_central.h
* @brief This data structure holds current malfunction codes
*
* @date Dec 20, 2013
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
#include "obd_error_codes.h"
#define MAX_ERROR_CODES_COUNT 10
struct error_codes_set_s {
int count = 0;
ObdCode error_codes[MAX_ERROR_CODES_COUNT];
};
// TODO: wow this is not used by real firmware?!
#if EFI_UNIT_TEST
/**
* @brief Adds an error code into the set of current errors.
* The error code is placed into the fixed-size data structure if it fits into it.
* The error code stays in the data structure till it is removed by 'clearError'
*
*/
void addError(ObdCode errorCode);
/**
* @brief Removed the error code from the set of current errors.
*
*/
void removeError(ObdCode errorCode);
#endif // EFI_UNIT_TEST
void clearWarnings(void);
/**
* @brief Copies the current set of errors into the specified buffer
*/
void getErrorCodes(error_codes_set_s * buffer);
bool hasErrorCodes(void);