FW Profile - C1 Implementation
FwDaCurCheck.h File Reference

Definition of the Current Failure Detection (FD) Check. More...

Go to the source code of this file.

Macros

#define CUR_FD_CHECK_ID   1
 Identifier of the Current FD Check. More...
 
#define HW_DEV_CUR_MAX_NOM   0.75
 Maximum nominal current absorbed by the Hardware Device. More...
 
#define HW_DEV_CUR_CNT_LIMIT   2
 Counter limit for the Current FD Check. More...
 

Functions

FwSmDesc_t GetCurCheckSm ()
 Retrieve the descriptor of the Current FD Check State Machine. More...
 

Detailed Description

Definition of the Current Failure Detection (FD) Check.

This FD Check is encapsulated in a state machine which is derived from the FD Check State Machine. The Current Check reports "anomaly detected" if the current absorbed by the hardware device is above a certain threshold. If the FD Check declares a failure, its recovery action consists in starting the Current Recovery Action Procedure of FwDaCurRecAction.h.

Author
Vaclav Cechticky, Alessandro Pasetti

Definition in file FwDaCurCheck.h.

Macro Definition Documentation

#define CUR_FD_CHECK_ID   1

Identifier of the Current FD Check.

Definition at line 22 of file FwDaCurCheck.h.

#define HW_DEV_CUR_CNT_LIMIT   2

Counter limit for the Current FD Check.

If the Current FD Check detects an anomaly for longer than HW_DEV_CUR_CNT_LIMIT cycles, then a failure is declared and the Recovery Action associated to the check is executed.

Definition at line 40 of file FwDaCurCheck.h.

#define HW_DEV_CUR_MAX_NOM   0.75

Maximum nominal current absorbed by the Hardware Device.

If the current absorbed by the Hardware Device exceeds this limit, the Current FD Check declares an anomaly and if the anomaly persists for longer than HW_DEV_CUR_CNT_LIMIT cycles, the Hardware Device must be switched off.

Definition at line 31 of file FwDaCurCheck.h.

Function Documentation

FwSmDesc_t GetCurCheckSm ( )

Retrieve the descriptor of the Current FD Check State Machine.

The Current FD Check State Machine is a singleton. The first time this function is called, it creates and configures the state machine descriptor. Subsequently, it always returns the same descriptor.

The Current FD Check State Machine is built as an extension of the generic FD Check State Machine (see FwDaFailDetCheck.h) with the following changes:

  • The Default Anomaly Detection Check (function DefAnomalyDetCheck) is overridden to report "anomaly detected" if the current absorbed by the hardware device is above HW_DEV_CUR_MAX_NOM.
  • The Default Recovery Action (function DefRecoveryAction) is overridden to send a switch-off command to the Hardware Device.
  • The counter limit cntLimit is set to HW_DEV_CUR_CNT_LIMIT.

Thus, this FD Check monitors the current absorbed by the Hardware Device and, if it finds that it is out-of-limits for more than HW_DEV_CUR_CNT_LIMIT consecutive cycles, it switches off the Hardware Device.

Returns
the descriptor of the FD Check State Machine or NULL if the state machine could not be created.

Definition at line 39 of file FwDaCurCheck.c.

P&P Software GmbH, Copyright 2011, All Rights Reserved