120 uint32_t tmperr_Check[((uint16_t)
DIAG_ID_MAX + 31u) / 32u] = {0};
125 uint16_t checkfail = 0u;
128 if (checkfail > 0u) {
144 for (uint8_t i = 0; i < (uint8_t)(((uint16_t)
DIAG_ID_MAX + 31u) / 32u); i++) {
145 tmperr_Check[i] = 0u;
158 for (uint8_t c = 0; c < (uint8_t)(((uint16_t)
DIAG_ID_MAX + 31u) / 32u); c++) {
165 for (uint16_t entry = 0u; entry < (uint16_t)
DIAG_ID_MAX; entry++) {
180 if (fatalErrorDetected && discardDelay) {
191 const uint16_t errorThreshold =
197 if (thresholdCounter > errorThreshold) {
245 uint32_t *u32ptr_errCodemsk =
NULL_PTR;
246 uint32_t *u32ptr_warnCodemsk =
NULL_PTR;
247 uint16_t *u16ptr_threshcounter =
NULL_PTR;
248 uint16_t cfg_threshold = 0;
249 uint16_t err_enable_idx = 0;
250 uint32_t err_enable_bitmask = 0;
275 uint8_t stringID = 0u;
280 err_enable_idx = diagId / 32;
281 err_enable_bitmask = 1 << (diagId % 32);
293 if (((*u16ptr_threshcounter) == 0)) {
295 }
else if ((*u16ptr_threshcounter) > 1) {
296 (*u16ptr_threshcounter)--;
297 }
else if ((*u16ptr_threshcounter) == 1) {
300 *u32ptr_errCodemsk &= ~err_enable_bitmask;
301 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
302 (*u16ptr_threshcounter) = 0;
318 if ((*u16ptr_threshcounter) < cfg_threshold) {
319 (*u16ptr_threshcounter)++;
321 }
else if ((*u16ptr_threshcounter) == cfg_threshold) {
323 (*u16ptr_threshcounter)++;
324 *u32ptr_errCodemsk |= err_enable_bitmask;
325 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
339 }
else if (((*u16ptr_threshcounter) > cfg_threshold)) {
345 *u32ptr_errCodemsk &= ~err_enable_bitmask;
346 *u32ptr_warnCodemsk |= err_enable_bitmask;
352 *u32ptr_errCodemsk &= ~err_enable_bitmask;
353 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
354 (*u16ptr_threshcounter) = 0;
389 bool fatalErrorActive =
false;
394 fatalErrorActive =
true;
397 return fatalErrorActive;
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
STD_RETURN_TYPE_e DIAG_CheckEvent(STD_RETURN_TYPE_e cond, DIAG_ID_e diagId, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_CheckEvent provides a simple interface to check an event for STD_OK.
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 DIAG_DIAGNOSIS_STATE_s diag
DIAG_RETURNTYPE_e DIAG_Handler(DIAG_ID_e diagId, DIAG_EVENT_e event, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_Handler provides generic error handling, based on diagnosis group.
static uint8_t diag_locked
STD_RETURN_TYPE_e DIAG_Initialize(DIAG_DEV_s *diag_dev_pointer)
DIAG_Init initializes all needed structures/buffers.
static void DIAG_Reset(void)
DIAG_Reset resetsall needed structures.
@ DIAG_STATE_UNINITIALIZED
@ 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
DIAG_ID_CFG_s diag_diagnosisIdConfiguration[]
const DIAG_DATABASE_SHIM_s diag_kDatabaseShim
@ DIAG_EVALUATION_ENABLED
@ DIAG_EVALUATION_DISABLED
#define DIAG_MAX_ENTRIES_OF_ERROR
#define DIAG_DELAY_DISCARDED
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
#define NULL_PTR
Null pointer.
Declaration of the OS wrapper interface.
uint8_t nrOfConfiguredDiagnosisEntries
DIAG_ID_CFG_s * pConfigurationOfDiagnosisEntries
DIAG_ID_CFG_s * pFatalErrorLinkTable[DIAG_ID_MAX]
uint16_t numberOfFatalErrors
uint32_t entry_event[DIAG_ID_MAX]
uint32_t errflag[(DIAG_ID_MAX+31)/32]
uint8_t entry_cnt[DIAG_ID_MAX]
uint16_t occurrenceCounter[BS_NR_OF_STRINGS][DIAG_ID_MAX]
DIAG_MODULE_STATE_e state
uint32_t warnflag[(DIAG_ID_MAX+31)/32]
uint8_t id2ch[DIAG_ID_MAX]
uint32_t err_enableflag[(DIAG_ID_MAX+31)/32]
DIAG_RECORDING_e enable_recording
DIAG_CALLBACK_FUNCTION_f * fpCallback
DIAG_EVALUATE_e enable_evaluate