119 uint32_t tmperr_Check[((uint16_t)
DIAG_ID_MAX + 31u) / 32u] = {0};
124 uint16_t checkfail = 0u;
127 if (checkfail > 0u) {
143 for (uint8_t i = 0; i < (uint8_t)(((uint16_t)
DIAG_ID_MAX + 31u) / 32u); i++) {
144 tmperr_Check[i] = 0u;
157 for (uint8_t c = 0; c < (uint8_t)(((uint16_t)
DIAG_ID_MAX + 31u) / 32u); c++) {
164 for (uint16_t entry = 0u; entry < (uint16_t)
DIAG_ID_MAX; entry++) {
177 const uint16_t errorThreshold =
183 if (thresholdCounter > errorThreshold) {
231 uint32_t *u32ptr_errCodemsk =
NULL_PTR;
232 uint32_t *u32ptr_warnCodemsk =
NULL_PTR;
233 uint16_t *u16ptr_threshcounter =
NULL_PTR;
234 uint16_t cfg_threshold = 0;
235 uint16_t err_enable_idx = 0;
236 uint32_t err_enable_bitmask = 0;
261 uint8_t stringID = 0u;
266 err_enable_idx = diag_id / 32;
267 err_enable_bitmask = 1 << (diag_id % 32);
279 if (((*u16ptr_threshcounter) == 0)) {
281 }
else if ((*u16ptr_threshcounter) > 1) {
282 (*u16ptr_threshcounter)--;
283 }
else if ((*u16ptr_threshcounter) == 1) {
286 *u32ptr_errCodemsk &= ~err_enable_bitmask;
287 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
288 (*u16ptr_threshcounter) = 0;
303 if ((*u16ptr_threshcounter) < cfg_threshold) {
304 (*u16ptr_threshcounter)++;
306 }
else if ((*u16ptr_threshcounter) == cfg_threshold) {
308 (*u16ptr_threshcounter)++;
309 *u32ptr_errCodemsk |= err_enable_bitmask;
310 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
323 }
else if (((*u16ptr_threshcounter) > cfg_threshold)) {
329 *u32ptr_errCodemsk &= ~err_enable_bitmask;
330 *u32ptr_warnCodemsk |= err_enable_bitmask;
336 *u32ptr_errCodemsk &= ~err_enable_bitmask;
337 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
338 (*u16ptr_threshcounter) = 0;
378 bool fatalErrorActive =
false;
383 fatalErrorActive =
true;
386 return fatalErrorActive;
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
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
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_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
const DIAG_DATABASE_SHIM_s diag_kDatabaseShim
DIAG_ID_CFG_s DIAG_ID_cfg[]
@ DIAG_EVALUATION_ENABLED
@ DIAG_EVALUATION_DISABLED
#define DIAG_MAX_ENTRIES_OF_ERROR
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#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