]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Added support for counterbased debouncing in Dem.
authorpete <devnull@localhost>
Thu, 27 May 2010 08:17:50 +0000 (10:17 +0200)
committerpete <devnull@localhost>
Thu, 27 May 2010 08:17:50 +0000 (10:17 +0200)
diagnostic/Dem/Dem.c
diagnostic/Dem/Dem_Lcfg.h
include/Dem.h

index 51ce518ec1f58eb4cf513aee506da6433391f7f7..5e6771f22654af8a817df6d60d0dee561e77f93e 100644 (file)
 #include "MemMap.h"\r
 #include "Mcu.h"\r
 \r
+/*\r
+ * Local defines\r
+ */\r
+#define DEBOUNCE_FDC_TEST_FAILED  127\r
+#define DEBOUNCE_FDC_TEST_PASSED -128\r
+\r
 /*\r
  * Local types\r
  */\r
@@ -54,10 +60,10 @@ typedef struct {
 typedef struct {\r
        Dem_EventIdType                         eventId;\r
        const Dem_EventParameterType *eventParamRef;\r
+       sint8                                           faultDetectionCounter;\r
        uint16                                          occurrence;\r
-       Dem_EventStatusType                     eventStatus;\r
-       boolean                                         eventStatusChanged;\r
        Dem_EventStatusExtendedType     eventStatusExtended;\r
+       boolean                                         errorStatusChanged;\r
 } EventStatusRecType;\r
 \r
 \r
@@ -92,6 +98,7 @@ typedef enum
   DEM_INITIALIZED\r
 } Dem_StateType;\r
 \r
+\r
 static Dem_StateType demState = DEM_UNINITIALIZED;\r
 \r
 // Help pointer to configuration set\r
@@ -310,6 +317,104 @@ void lookupEventIdParameter(Dem_EventIdType eventId, const Dem_EventParameterTyp
        }\r
 }\r
 \r
+\r
+/*\r
+ * Procedure:  PreDebounceNone\r
+ * Description:        Returns the result of the debouncing.\r
+ */\r
+Dem_EventStatusType PreDebounceNone(Dem_EventStatusType reportedStatus, EventStatusRecType* statusRecord) {\r
+       Dem_EventStatusType returnCode;\r
+\r
+       switch (reportedStatus) {\r
+       case DEM_EVENT_STATUS_FAILED:\r
+       case DEM_EVENT_STATUS_PASSED:\r
+               // Already debounced, do nothing.\r
+               break;\r
+\r
+       default:\r
+               // TODO: What to do with PREFAIL and PREPASSED on no debouncing?\r
+#if (DEM_DEV_ERROR_DETECT == STD_ON)\r
+                       Det_ReportError(MODULE_ID_DEM, 0, DEM_PREDEBOUNCE_NONE_ID, DEM_E_PARAM_DATA);\r
+#endif\r
+               break;\r
+       }\r
+\r
+       returnCode = reportedStatus;\r
+       return returnCode;\r
+}\r
+\r
+\r
+/*\r
+ * Procedure:  PreDebounceCounterBased\r
+ * Description:        Returns the result of the debouncing.\r
+ */\r
+Dem_EventStatusType PreDebounceCounterBased(Dem_EventStatusType reportedStatus, EventStatusRecType* statusRecord) {\r
+       Dem_EventStatusType returnCode;\r
+       const Dem_PreDebounceCounterBasedType* pdVars = statusRecord->eventParamRef->EventClass->PreDebounceAlgorithmClass->PreDebounceAlgorithm.PreDebounceCounterBased;\r
+\r
+       switch (reportedStatus) {\r
+       case DEM_EVENT_STATUS_PREFAILED:\r
+               if (statusRecord->faultDetectionCounter < DEBOUNCE_FDC_TEST_FAILED) {\r
+                       if (pdVars->JumpUp && (statusRecord->faultDetectionCounter < 0)) {\r
+                               statusRecord->faultDetectionCounter = 0;\r
+                       } else {\r
+                               if (((sint16)statusRecord->faultDetectionCounter + pdVars->CountInStepSize) < DEBOUNCE_FDC_TEST_FAILED) {\r
+                                       statusRecord->faultDetectionCounter += pdVars->CountInStepSize;\r
+                               } else {\r
+                                       statusRecord->faultDetectionCounter = DEBOUNCE_FDC_TEST_FAILED;\r
+                               }\r
+                       }\r
+               }\r
+               break;\r
+\r
+       case DEM_EVENT_STATUS_PREPASSED:\r
+               if (statusRecord->faultDetectionCounter > DEBOUNCE_FDC_TEST_PASSED) {\r
+                       if (pdVars->JumpDown && (statusRecord->faultDetectionCounter > 0)) {\r
+                               statusRecord->faultDetectionCounter = 0;\r
+                       } else {\r
+                               if (((sint16)statusRecord->faultDetectionCounter - pdVars->CountOutStepSize) > DEBOUNCE_FDC_TEST_PASSED) {\r
+                                       statusRecord->faultDetectionCounter -= pdVars->CountOutStepSize;\r
+                               } else {\r
+                                       statusRecord->faultDetectionCounter = DEBOUNCE_FDC_TEST_PASSED;\r
+                               }\r
+                       }\r
+               }\r
+               break;\r
+\r
+       case DEM_EVENT_STATUS_FAILED:\r
+               statusRecord->faultDetectionCounter = DEBOUNCE_FDC_TEST_FAILED;\r
+               break;\r
+\r
+       case DEM_EVENT_STATUS_PASSED:\r
+               statusRecord->faultDetectionCounter = DEBOUNCE_FDC_TEST_PASSED;\r
+               break;\r
+\r
+       default:\r
+#if (DEM_DEV_ERROR_DETECT == STD_ON)\r
+               Det_ReportError(MODULE_ID_DEM, 0, DEM_PREDEBOUNCE_COUNTER_BASED_ID, DEM_E_PARAM_DATA);\r
+#endif\r
+               break;\r
+\r
+       }\r
+\r
+       switch (statusRecord->faultDetectionCounter) {\r
+       case DEBOUNCE_FDC_TEST_FAILED:\r
+               returnCode = DEM_EVENT_STATUS_FAILED;\r
+               break;\r
+\r
+       case DEBOUNCE_FDC_TEST_PASSED:\r
+               returnCode = DEM_EVENT_STATUS_PASSED;\r
+               break;\r
+\r
+       default:\r
+               returnCode = reportedStatus;\r
+               break;\r
+       }\r
+\r
+       return returnCode;\r
+}\r
+\r
+\r
 /*\r
  * Procedure:  updateEventStatusRec\r
  * Description:        Update the status of "eventId", if not exist and "createIfNotExist" is\r
@@ -331,10 +436,10 @@ void updateEventStatusRec(const Dem_EventParameterType *eventParam, Dem_EventSta
                        // Create new event record\r
                        eventStatusRecPtr->eventId = eventParam->EventID;\r
                        eventStatusRecPtr->eventParamRef = eventParam;\r
+                       eventStatusRecPtr->faultDetectionCounter = 0;\r
                        eventStatusRecPtr->occurrence = 0;\r
-                       eventStatusRecPtr->eventStatus = DEM_EVENT_STATUS_PASSED;\r
-                       eventStatusRecPtr->eventStatusChanged = FALSE;\r
                        eventStatusRecPtr->eventStatusExtended = DEM_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR | DEM_TEST_NOT_COMPLETED_THIS_OPERATION_CYCLE;\r
+                       eventStatusRecPtr->errorStatusChanged = FALSE;\r
                }\r
                else {\r
                        // Error: Event status buffer full\r
@@ -344,27 +449,46 @@ void updateEventStatusRec(const Dem_EventParameterType *eventParam, Dem_EventSta
                }\r
        }\r
 \r
+\r
        if (eventStatusRecPtr != NULL) {\r
-               // Update event record\r
-               eventStatusRecPtr->eventStatusExtended &= ~(DEM_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR | DEM_TEST_NOT_COMPLETED_THIS_OPERATION_CYCLE);\r
+               // Handle debouncing\r
+               switch (eventParam->EventClass->PreDebounceAlgorithmClass->PreDebounceName) {\r
+               case DEM_NO_PRE_DEBOUNCE:\r
+                       eventStatus = PreDebounceNone(eventStatus, eventStatusRecPtr);\r
+                       break;\r
+\r
+               case DEM_PRE_DEBOUNCE_COUNTER_BASED:\r
+                       eventStatus = PreDebounceCounterBased(eventStatus, eventStatusRecPtr);\r
+                       break;\r
+\r
+               default:\r
+                       // Don't know how to handle this.\r
+#if (DEM_DEV_ERROR_DETECT == STD_ON)\r
+                       Det_ReportError(MODULE_ID_DEM, 0, DEM_UPDATE_EVENT_STATUS_ID, DEM_E_NOT_IMPLEMENTED_YET);\r
+#endif\r
+                       break;\r
+               }\r
+\r
+\r
+               eventStatusRecPtr->errorStatusChanged = FALSE;\r
 \r
+               // Check test failed\r
                if (eventStatus == DEM_EVENT_STATUS_FAILED) {\r
-                       eventStatusRecPtr->eventStatusExtended |= (DEM_TEST_FAILED | DEM_TEST_FAILED_THIS_OPERATION_CYCLE | DEM_TEST_FAILED_SINCE_LAST_CLEAR | DEM_PENDING_DTC);\r
-                       if (eventStatusRecPtr->eventStatus != eventStatus) {\r
+                       if (!(eventStatusRecPtr->eventStatusExtended & DEM_TEST_FAILED)) {\r
                                eventStatusRecPtr->occurrence++;\r
+                               eventStatusRecPtr->errorStatusChanged = TRUE;\r
                        }\r
+                       eventStatusRecPtr->eventStatusExtended |= (DEM_TEST_FAILED | DEM_TEST_FAILED_THIS_OPERATION_CYCLE | DEM_TEST_FAILED_SINCE_LAST_CLEAR | DEM_PENDING_DTC);\r
+                       eventStatusRecPtr->eventStatusExtended &= ~(DEM_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR | DEM_TEST_NOT_COMPLETED_THIS_OPERATION_CYCLE);\r
                }\r
 \r
+               // Check test passed\r
                if (eventStatus == DEM_EVENT_STATUS_PASSED) {\r
+                       if (eventStatusRecPtr->eventStatusExtended & DEM_TEST_FAILED) {\r
+                               eventStatusRecPtr->errorStatusChanged = TRUE;\r
+                       }\r
                        eventStatusRecPtr->eventStatusExtended &= ~DEM_TEST_FAILED;\r
-               }\r
-\r
-               if (eventStatusRecPtr->eventStatus != eventStatus) {\r
-                       eventStatusRecPtr->eventStatus = eventStatus;\r
-                       eventStatusRecPtr->eventStatusChanged = TRUE;\r
-               }\r
-               else {\r
-                       eventStatusRecPtr->eventStatusChanged = FALSE;\r
+                       eventStatusRecPtr->eventStatusExtended &= ~(DEM_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR | DEM_TEST_NOT_COMPLETED_THIS_OPERATION_CYCLE);\r
                }\r
 \r
                // Copy the record\r
@@ -373,10 +497,10 @@ void updateEventStatusRec(const Dem_EventParameterType *eventParam, Dem_EventSta
        else {\r
                // Copy an empty record to return data\r
                eventStatusRec->eventId = DEM_EVENT_ID_NULL;\r
-               eventStatusRec->eventStatus = DEM_EVENT_STATUS_PASSED;\r
+               eventStatusRecPtr->faultDetectionCounter = 0;\r
                eventStatusRec->occurrence = 0;\r
-               eventStatusRec->eventStatusChanged = FALSE;\r
                eventStatusRec->eventStatusExtended = DEM_TEST_NOT_COMPLETED_THIS_OPERATION_CYCLE | DEM_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR;\r
+               eventStatusRec->errorStatusChanged = FALSE;\r
        }\r
 \r
        McuE_ExitCriticalSection(state);\r
@@ -408,10 +532,10 @@ void mergeEventStatusRec(EventRecType *eventRec)
                        // Create new event, from stored event\r
                        eventStatusRecPtr->eventId = eventRec->eventId;\r
                        lookupEventIdParameter(eventRec->eventId, &eventStatusRecPtr->eventParamRef);\r
+                       eventStatusRecPtr->faultDetectionCounter = 0;\r
                        eventStatusRecPtr->occurrence = eventRec->occurrence;\r
-                       eventStatusRecPtr->eventStatus = DEM_EVENT_STATUS_PASSED;\r
-                       eventStatusRecPtr->eventStatusChanged = FALSE;\r
                        eventStatusRecPtr->eventStatusExtended = DEM_TEST_NOT_COMPLETED_THIS_OPERATION_CYCLE | DEM_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR;\r
+                       eventStatusRecPtr->errorStatusChanged = FALSE;\r
                }\r
                else {\r
                        // Error: Event status buffer full\r
@@ -463,8 +587,6 @@ void getEventStatusRec(Dem_EventIdType eventId, EventStatusRecType *eventStatusR
        }\r
        else {\r
                eventStatusRec->eventId = DEM_EVENT_ID_NULL;\r
-               eventStatusRec->eventStatus = DEM_EVENT_STATUS_PASSED;\r
-               eventStatusRec->occurrence = 0;\r
        }\r
 }\r
 \r
@@ -586,7 +708,7 @@ void getExtendedData(const Dem_EventParameterType *eventParam, ExtDataRecType *e
                        else {\r
                                // Error: Size of extended data record is bigger than reserved space.\r
 #if (DEM_DEV_ERROR_DETECT == STD_ON)\r
-                               Det_ReportError(MODULE_ID_DEM, 0, DEM_GET_EXTENDED_DATA_ID, DEM_E_EXT_DATA_TO_BIG);\r
+                               Det_ReportError(MODULE_ID_DEM, 0, DEM_GET_EXTENDED_DATA_ID, DEM_E_EXT_DATA_TOO_BIG);\r
 #endif\r
                                break;  // Break the loop\r
                        }\r
@@ -935,16 +1057,16 @@ void handlePreInitEvent(Dem_EventIdType eventId, Dem_EventStatusType eventStatus
        if (eventParam != NULL) {\r
                if (eventParam->EventClass->OperationCycleRef < DEM_OPERATION_CYCLE_ID_ENDMARK) {\r
                        if (operationCycleStateList[eventParam->EventClass->OperationCycleRef] == DEM_CYCLE_STATE_START) {\r
-                               if (eventStatus == DEM_EVENT_STATUS_PASSED) {\r
-                                       updateEventStatusRec(eventParam, eventStatus, FALSE, &eventStatusLocal);\r
+                               if (eventStatus == DEM_EVENT_STATUS_FAILED) {\r
+                                       updateEventStatusRec(eventParam, eventStatus, TRUE, &eventStatusLocal);\r
                                }\r
                                else {\r
-                                       updateEventStatusRec(eventParam, eventStatus, TRUE, &eventStatusLocal);\r
+                                       updateEventStatusRec(eventParam, eventStatus, FALSE, &eventStatusLocal);\r
                                }\r
 \r
-                               if (eventStatusLocal.eventStatusChanged) {\r
+                               if (eventStatusLocal.errorStatusChanged) {\r
 \r
-                                       if (eventStatusLocal.eventStatus == DEM_EVENT_STATUS_FAILED) {\r
+                                       if (eventStatusLocal.eventStatusExtended & DEM_TEST_FAILED) {\r
                                                // Collect freeze frame data\r
                                                getFreezeFrameData(eventParam, &freezeFrameLocal);\r
                                                if (freezeFrameLocal.eventId != DEM_EVENT_ID_NULL) {\r
@@ -996,8 +1118,8 @@ Std_ReturnType handleEvent(Dem_EventIdType eventId, Dem_EventStatusType eventSta
                        if (operationCycleStateList[eventParam->EventClass->OperationCycleRef] == DEM_CYCLE_STATE_START) {\r
                                if (!(disableDtcStorage.storageDisabled && checkDtcGroup(disableDtcStorage.dtcGroup, eventParam) && checkDtcKind(disableDtcStorage.dtcKind, eventParam)))  {\r
                                        updateEventStatusRec(eventParam, eventStatus, TRUE, &eventStatusLocal);\r
-                                       if (eventStatusLocal.eventStatusChanged) {\r
-                                               if (eventStatusLocal.eventStatus == DEM_EVENT_STATUS_FAILED) {\r
+                                       if (eventStatusLocal.errorStatusChanged) {\r
+                                               if (eventStatusLocal.eventStatusExtended & DEM_TEST_FAILED) {\r
                                                        storeEventEvtMem(eventParam, &eventStatusLocal);\r
                                                        // Collect freeze frame data\r
                                                        getFreezeFrameData(eventParam, &freezeFrameLocal);\r
@@ -1034,6 +1156,24 @@ Std_ReturnType handleEvent(Dem_EventIdType eventId, Dem_EventStatusType eventSta
 }\r
 \r
 \r
+/*\r
+ * Procedure:  resetEventStatus\r
+ * Description:        Resets the events status of eventId.\r
+ */\r
+void resetEventStatus(Dem_EventIdType eventId)\r
+{\r
+       imask_t state = McuE_EnterCriticalSection();\r
+       EventStatusRecType *eventStatusRecPtr;\r
+\r
+       lookupEventStatusRec(eventId, &eventStatusRecPtr);\r
+       if (eventStatusRecPtr != NULL) {\r
+               eventStatusRecPtr->eventStatusExtended &= ~DEM_TEST_FAILED;\r
+       }\r
+\r
+       McuE_ExitCriticalSection(state);\r
+}\r
+\r
+\r
 /*\r
  * Procedure:  getEventStatus\r
  * Description:        Returns the extended event status bitmask of eventId in "eventStatusExtended".\r
@@ -1122,11 +1262,26 @@ Std_ReturnType getFaultDetectionCounter(Dem_EventIdType eventId, sint8 *counter)
                        {\r
                        case DEM_NO_PRE_DEBOUNCE:\r
                                if (eventParam->EventClass->PreDebounceAlgorithmClass->PreDebounceAlgorithm.PreDebounceMonitorInternal != NULL) {\r
-                                       returnCode = eventParam->EventClass->PreDebounceAlgorithmClass->PreDebounceAlgorithm.PreDebounceMonitorInternal->CallbackGetFDCntFnc(counter);\r
+                                       if (eventParam->EventClass->PreDebounceAlgorithmClass->PreDebounceAlgorithm.PreDebounceMonitorInternal->CallbackGetFDCntFnc != NULL) {\r
+                                               returnCode = eventParam->EventClass->PreDebounceAlgorithmClass->PreDebounceAlgorithm.PreDebounceMonitorInternal->CallbackGetFDCntFnc(counter);\r
+                                       }\r
                                }\r
                                break;\r
 \r
                        case DEM_PRE_DEBOUNCE_COUNTER_BASED:\r
+                               {\r
+                                       EventStatusRecType *eventStatusRec;\r
+\r
+                                       lookupEventStatusRec(eventId, &eventStatusRec);\r
+                                       if (eventStatusRec != NULL) {\r
+                                               *counter = eventStatusRec->faultDetectionCounter;\r
+                                       } else {\r
+                                               *counter = 0;\r
+                                       }\r
+                                       returnCode = E_OK;\r
+                               }\r
+                               break;\r
+\r
                        case DEM_PRE_DEBOUNCE_FREQUENCY_BASED:\r
                        case DEM_PRE_DEBOUNCE_TIME_BASED:\r
 #if (DEM_DEV_ERROR_DETECT == STD_ON)\r
@@ -1252,10 +1407,11 @@ void Dem_PreInit(void)
        // Initialize the event status buffer\r
        for (i = 0; i < DEM_MAX_NUMBER_EVENT; i++) {\r
                eventStatusBuffer[i].eventId = DEM_EVENT_ID_NULL;\r
+               eventStatusBuffer[i].eventParamRef = NULL;\r
+               eventStatusBuffer[i].faultDetectionCounter = 0;\r
                eventStatusBuffer[i].occurrence = 0;\r
                eventStatusBuffer[i].eventStatusExtended = DEM_TEST_NOT_COMPLETED_THIS_OPERATION_CYCLE | DEM_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR;\r
-               eventStatusBuffer[i].eventStatus = DEM_EVENT_STATUS_PASSED;\r
-               eventStatusBuffer[i].eventStatusChanged = FALSE;\r
+               eventStatusBuffer[i].errorStatusChanged = FALSE;\r
        }\r
 \r
        // Initialize the pre init buffers\r
@@ -1432,16 +1588,11 @@ Std_ReturnType Dem_SetEventStatus(Dem_EventIdType eventId, Dem_EventStatusType e
  */\r
 Std_ReturnType Dem_ResetEventStatus(Dem_EventIdType eventId)\r
 {\r
-       const Dem_EventParameterType *eventParam;\r
-       EventStatusRecType eventStatusLocal;\r
        Std_ReturnType returnCode = E_OK;\r
 \r
        if (demState == DEM_INITIALIZED) // No action is taken if the module is not started\r
        {\r
-               lookupEventIdParameter(eventId, &eventParam);\r
-               if (eventParam != NULL) {\r
-                       updateEventStatusRec(eventParam, DEM_EVENT_STATUS_PASSED, FALSE, &eventStatusLocal);\r
-               }\r
+               resetEventStatus(eventId);\r
        }\r
        else\r
        {\r
@@ -1624,10 +1775,7 @@ void Dem_ReportErrorStatus( Dem_EventIdType eventId, Dem_EventStatusType eventSt
                        break;\r
 \r
                case DEM_INITIALIZED:\r
-                       // Handle report\r
-                       if ((eventStatus == DEM_EVENT_STATUS_PASSED) || (eventStatus == DEM_EVENT_STATUS_FAILED)) {\r
-                               (void)handleEvent(eventId, eventStatus);\r
-                       }\r
+                       (void)handleEvent(eventId, eventStatus);\r
                        break;\r
 \r
                case DEM_UNINITIALIZED:\r
index 27c296862c0c7ff0fcfa7d7fc75bd0521c6cd9d2..2f905d804a64382a511d4c1de601d905d8eed072 100644 (file)
@@ -157,27 +157,34 @@ typedef struct {
        Dem_IndicatorType               *LinkedIndicator;                       // (1)\r
 } Dem_IndicatorAttributeType;\r
 \r
+// 10.2.23 DemPreDebounceMonitorInternal\r
 typedef struct {\r
        Dem_CallbackGetFaultDetectionCounterFncType     CallbackGetFDCntFnc;    // (1)\r
 } Dem_PreDebounceMonitorInternalType;\r
 \r
+// 10.2.21 DemPreDebounceCounterBased\r
 typedef struct {\r
-       // TODO: Fill out\r
+       boolean JumpUp;\r
+       boolean JumpDown;\r
+       uint8   CountInStepSize;\r
+       uint8   CountOutStepSize;\r
 } Dem_PreDebounceCounterBasedType;\r
 \r
+// 10.2.22 DemPreDebounceFrequencyBased\r
 typedef struct {\r
        // TODO: Fill out\r
 } Dem_PreDebounceFrequencyBasedType;\r
 \r
+// 10.2.24 DemPreDebounceTimeBased\r
 typedef struct {\r
        // TODO: Fill out\r
 } Dem_PreDebounceTimeBasedType;\r
 \r
 typedef struct {\r
-       Dem_PreDebounceNameType         PreDebounceName;                                                // (1)\r
+       Dem_PreDebounceNameType                                         PreDebounceName;                                // (1)\r
        union {\r
        const Dem_PreDebounceMonitorInternalType        *PreDebounceMonitorInternal;    // (0..1)\r
-       const Dem_PreDebounceCounterBasedType           *PreDebounceCouterBased;                // (0..1)\r
+       const Dem_PreDebounceCounterBasedType           *PreDebounceCounterBased;               // (0..1)\r
        const Dem_PreDebounceFrequencyBasedType         *PreDebounceFrequencyBased;             // (0..1)\r
        const Dem_PreDebounceTimeBasedType                      *PreDebounceTimeBased;                  // (0..1)\r
        } PreDebounceAlgorithm;\r
index ca53a857f243285c97733afa25f4826c35604e68..6346a0b3bf828d24e7bc2c0d05aaf751c3c9e606 100644 (file)
@@ -49,7 +49,7 @@
 #define DEM_E_NODATAAVAILABLE                          0x30\r
 \r
 #define DEM_E_EVENT_STATUS_BUFF_FULL           0x40\r
-#define DEM_E_EXT_DATA_TO_BIG                          0x41\r
+#define DEM_E_EXT_DATA_TOO_BIG                         0x41\r
 #define DEM_E_PRE_INIT_EXT_DATA_BUFF_FULL      0x42\r
 #define DEM_E_PRI_MEM_EVENT_BUFF_FULL          0x43\r
 #define DEM_E_PRI_MEM_EXT_DATA_BUFF_FULL       0x44\r
@@ -77,7 +77,8 @@
 #define DEM_STORE_EXT_DATA_PRE_INIT_ID         0x83\r
 #define DEM_STORE_EVENT_PRI_MEM_ID                     0x84\r
 #define DEM_STORE_EXT_DATA_PRI_MEM_ID          0x85\r
-\r
+#define DEM_PREDEBOUNCE_NONE_ID                                0x86\r
+#define DEM_PREDEBOUNCE_COUNTER_BASED_ID       0x87\r
 #define DEM_GLOBAL_ID                                          0xff\r
 \r
 #endif\r