|
foxBMS
1.0.0
The foxBMS Battery Management System API Documentation
|
Go to the documentation of this file.
116 uint32_t tmperr_Check[((uint16_t)
DIAG_ID_MAX + 31u) / 32u] = {0};
121 uint16_t checkfail = 0u;
124 if (checkfail > 0u) {
129 for (uint8_t c = 0; c < diag_dev_pointer->
nr_of_ch; c++) {
130 id_nr = diag_dev_pointer->
ch_cfg[c].
id;
140 for (uint8_t i = 0; i < (uint8_t)(((uint16_t)
DIAG_ID_MAX + 31u) / 32u); i++) {
141 tmperr_Check[i] = 0u;
145 for (uint8_t i = 0; i < diag_dev_pointer->
nr_of_ch; i++) {
148 tmperr_Check[diag_dev_pointer->
ch_cfg[i].
id / 32] |= (1 << (diag_dev_pointer->
ch_cfg[i].
id % 32));
153 for (uint8_t c = 0; c < (uint8_t)(((uint16_t)
DIAG_ID_MAX + 31u) / 32u); c++) {
201 uint32_t *u32ptr_errCodemsk = NULL;
202 uint32_t *u32ptr_warnCodemsk = NULL;
203 uint16_t *u16ptr_threshcounter = NULL;
204 uint16_t cfg_threshold = 0;
205 uint16_t err_enable_idx = 0;
206 uint32_t err_enable_bitmask = 0;
231 uint8_t stringID = 0u;
236 err_enable_idx = diag_id / 32;
237 err_enable_bitmask = 1 << (diag_id % 32);
249 if (((*u16ptr_threshcounter) == 0)) {
251 }
else if ((*u16ptr_threshcounter) > 1) {
252 (*u16ptr_threshcounter)--;
253 }
else if ((*u16ptr_threshcounter) == 1) {
256 *u32ptr_errCodemsk &= ~err_enable_bitmask;
257 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
258 (*u16ptr_threshcounter) = 0;
273 if ((*u16ptr_threshcounter) < cfg_threshold) {
274 (*u16ptr_threshcounter)++;
276 }
else if ((*u16ptr_threshcounter) == cfg_threshold) {
278 (*u16ptr_threshcounter)++;
279 *u32ptr_errCodemsk |= err_enable_bitmask;
280 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
293 }
else if (((*u16ptr_threshcounter) > cfg_threshold)) {
299 *u32ptr_errCodemsk &= ~err_enable_bitmask;
300 *u32ptr_warnCodemsk |= err_enable_bitmask;
306 *u32ptr_errCodemsk &= ~err_enable_bitmask;
307 *u32ptr_warnCodemsk &= ~err_enable_bitmask;
308 (*u16ptr_threshcounter) = 0;
Implementation of the tasks used by the system, headers.
enum DIAG_IMPACT_LEVEL DIAG_IMPACT_LEVEL_e
static DIAG_DEV_s * diag_devptr
@ DIAG_EVALUATION_ENABLED
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
@ DIAG_HANDLER_INVALID_ERR_IMPACT
static void DIAG_Reset(void)
DIAG_Reset resetsall needed structures.
uint32_t err_enableflag[(DIAG_ID_MAX+31)/32]
uint8_t id2ch[DIAG_ID_MAX]
const DIAG_DATABASE_SHIM_s diag_kDatabaseShim
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.
@ DIAG_STATE_UNINITIALIZED
uint32_t warnflag[(DIAG_ID_MAX+31)/32]
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
enum DIAG_RECORDING DIAG_RECORDING_e
@ DIAG_HANDLER_RETURN_UNKNOWN
uint32_t errflag[(DIAG_ID_MAX+31)/32]
STD_RETURN_TYPE_e DIAG_Initialize(DIAG_DEV_s *diag_dev_pointer)
DIAG_Init initializes all needed structures/buffers.
static uint8_t DIAG_EntryWrite(uint8_t eventID, DIAG_EVENT_e event, uint32_t data)
DIAG_EntryWrite adds an error entry.
DIAG_ID_CFG_s DIAG_ID_cfg[]
#define DIAG_MAX_ENTRIES_OF_ERROR
uint32_t entry_event[DIAG_ID_MAX]
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.
enum DIAG_EVALUATE DIAG_EVALUATE_e
DIAG_EVALUATE_e enable_evaluate
@ DIAG_HANDLER_RETURN_NOT_READY
void DIAG_PrintErrors(void)
Prints contents of the error buffer on user request.
enum DIAG_EVENT DIAG_EVENT_e
@ DIAG_HANDLER_RETURN_ERR_OCCURRED
enum DIAG_RETURNTYPE DIAG_RETURNTYPE_e
DIAG_RECORDING_e enable_recording
uint8_t entry_cnt[DIAG_ID_MAX]
DIAG_CALLBACK_FUNCTION_f * fpCallback
@ DIAG_HANDLER_RETURN_WRONG_ID
uint16_t occurrenceCounter[BS_NR_OF_STRINGS][DIAG_ID_MAX]
@ DIAG_EVALUATION_DISABLED
static uint8_t diag_locked
@ DIAG_HANDLER_RETURN_WARNING_OCCURRED
@ DIAG_HANDLER_INVALID_DATA