118 uint32_t tmperr_Check[((uint16_t)
DIAG_ID_MAX + 31u) / 32u] = {0};
123 uint16_t checkfail = 0u;
126 if (checkfail > 0u) {
131 for (uint8_t c = 0; c < diag_dev_pointer->
nr_of_ch; c++) {
132 id_nr = diag_dev_pointer->
ch_cfg[c].
id;
142 for (uint8_t i = 0; i < (uint8_t)(((uint16_t)
DIAG_ID_MAX + 31u) / 32u); i++) {
143 tmperr_Check[i] = 0u;
147 for (uint8_t i = 0; i < diag_dev_pointer->
nr_of_ch; i++) {
150 tmperr_Check[diag_dev_pointer->
ch_cfg[i].
id / 32] |= (1 << (diag_dev_pointer->
ch_cfg[i].
id % 32));
155 for (uint8_t c = 0; c < (uint8_t)(((uint16_t)
DIAG_ID_MAX + 31u) / 32u); c++) {
162 for (uint16_t entry = 0u; entry < (uint16_t)
DIAG_ID_MAX; entry++) {
180 if (thresholdCounter > errorThreshold) {
228 uint32_t *u32ptr_errCodemsk = NULL;
229 uint32_t *u32ptr_warnCodemsk = NULL;
230 uint16_t *u16ptr_threshcounter = NULL;
231 uint16_t cfg_threshold = 0;
232 uint16_t err_enable_idx = 0;
233 uint32_t err_enable_bitmask = 0;
258 uint8_t stringID = 0u;
263 err_enable_idx = diag_id / 32;
264 err_enable_bitmask = 1 << (diag_id % 32);
276 if (((*u16ptr_threshcounter) == 0)) {
278 }
else if ((*u16ptr_threshcounter) > 1) {
279 (*u16ptr_threshcounter)--;
280 }
else if ((*u16ptr_threshcounter) == 1) {
283 *u32ptr_errCodemsk &= ~err_enable_bitmask;
284 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
285 (*u16ptr_threshcounter) = 0;
300 if ((*u16ptr_threshcounter) < cfg_threshold) {
301 (*u16ptr_threshcounter)++;
303 }
else if ((*u16ptr_threshcounter) == cfg_threshold) {
305 (*u16ptr_threshcounter)++;
306 *u32ptr_errCodemsk |= err_enable_bitmask;
307 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
320 }
else if (((*u16ptr_threshcounter) > cfg_threshold)) {
326 *u32ptr_errCodemsk &= ~err_enable_bitmask;
327 *u32ptr_warnCodemsk |= err_enable_bitmask;
333 *u32ptr_errCodemsk &= ~err_enable_bitmask;
334 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
335 (*u16ptr_threshcounter) = 0;
375 bool fatalErrorActive =
false;
380 fatalErrorActive =
true;
383 return fatalErrorActive;
static DIAG_DEV_s * diag_devptr
static uint8_t DIAG_EntryWrite(uint8_t eventID, DIAG_EVENT_e event, uint32_t data)
DIAG_EntryWrite adds an error entry.
uint32_t DIAG_GetDelay(DIAG_ID_e diagnosisEntry)
Get configured delay of passed diagnosis entry.
void DIAG_PrintErrors(void)
Prints contents of the error buffer on user request.
STD_RETURN_TYPE_e DIAG_GetDiagnosisEntryState(DIAG_ID_e diagnosisEntry)
Checks if passed diagnosis entry has been triggered or not.
bool DIAG_IsAnyFatalErrorSet(void)
Check if any fatal error is set.
static uint8_t diag_locked
DIAG_RETURNTYPE_e DIAG_Handler(DIAG_ID_e diag_id, DIAG_EVENT_e event, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_Handler provides generic error handling, based on diagnosis group.
STD_RETURN_TYPE_e DIAG_Initialize(DIAG_DEV_s *diag_dev_pointer)
DIAG_Init initializes all needed structures/buffers.
STD_RETURN_TYPE_e DIAG_CheckEvent(STD_RETURN_TYPE_e cond, DIAG_ID_e diag_id, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_CheckEvent provides a simple interface to check an event for STD_OK.
static void DIAG_Reset(void)
DIAG_Reset resetsall needed structures.
@ DIAG_HANDLER_RETURN_NOT_READY
@ DIAG_HANDLER_INVALID_DATA
@ DIAG_HANDLER_RETURN_WRONG_ID
@ DIAG_HANDLER_RETURN_WARNING_OCCURRED
@ DIAG_HANDLER_RETURN_ERR_OCCURRED
@ DIAG_HANDLER_INVALID_ERR_IMPACT
@ DIAG_HANDLER_RETURN_UNKNOWN
enum DIAG_RETURNTYPE DIAG_RETURNTYPE_e
@ DIAG_STATE_UNINITIALIZED
const DIAG_DATABASE_SHIM_s diag_kDatabaseShim
DIAG_ID_CFG_s DIAG_ID_cfg[]
enum DIAG_EVENT DIAG_EVENT_e
enum DIAG_IMPACT_LEVEL DIAG_IMPACT_LEVEL_e
#define DIAG_MAX_ENTRIES_OF_ERROR
@ DIAG_EVALUATION_ENABLED
@ DIAG_EVALUATION_DISABLED
enum DIAG_RECORDING DIAG_RECORDING_e
enum DIAG_EVALUATE DIAG_EVALUATE_e
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define NULL_PTR
Null pointer.
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
Implementation of the tasks used by the system, headers.
DIAG_RECORDING_e enable_recording
DIAG_CALLBACK_FUNCTION_f * fpCallback
DIAG_EVALUATE_e enable_evaluate
DIAG_ID_CFG_s * pFatalErrorLinkTable[DIAG_ID_MAX]
uint16_t numberOfFatalErrors
uint8_t id2ch[DIAG_ID_MAX]
uint32_t err_enableflag[(DIAG_ID_MAX+31)/32]
uint8_t entry_cnt[DIAG_ID_MAX]
uint16_t occurrenceCounter[BS_NR_OF_STRINGS][DIAG_ID_MAX]
uint32_t errflag[(DIAG_ID_MAX+31)/32]
uint32_t warnflag[(DIAG_ID_MAX+31)/32]
uint32_t entry_event[DIAG_ID_MAX]