From ef1966713a4f816ff5ef2fbfc6a3456804ca44f3 Mon Sep 17 00:00:00 2001 From: maek Date: Thu, 16 Jun 2011 14:29:40 +0200 Subject: [PATCH] Com development error detection is now configurable. Removed unneeded variable in Com. --- communication/Com/Com.c | 1 - communication/Com/Com_Arc_Types.h | 1 - communication/Com/Com_Internal.h | 8 ++++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/communication/Com/Com.c b/communication/Com/Com.c index 0b8120aa..8e749b36 100644 --- a/communication/Com/Com.c +++ b/communication/Com/Com.c @@ -49,7 +49,6 @@ void Com_Init(const Com_ConfigType *config ) { const ComSignal_type *Signal; const ComGroupSignal_type *GroupSignal; for (uint16 i = 0; !ComConfig->ComIPdu[i].Com_Arc_EOL; i++) { - Com_Arc_Config.ComNIPdu++; const ComIPdu_type *IPdu = GET_IPdu(i); Com_Arc_IPdu_type *Arc_IPdu = GET_ArcIPdu(i); diff --git a/communication/Com/Com_Arc_Types.h b/communication/Com/Com_Arc_Types.h index 71e1c294..7a8c34e6 100644 --- a/communication/Com/Com_Arc_Types.h +++ b/communication/Com/Com_Arc_Types.h @@ -63,7 +63,6 @@ typedef struct { } Com_Arc_IPdu_type; typedef struct { - uint16 ComNIPdu; Com_Arc_IPdu_type *ComIPdu; // Only used in PduIdCheck() Com_Arc_Signal_type *ComSignal; Com_Arc_GroupSignal_type *ComGroupSignal; diff --git a/communication/Com/Com_Internal.h b/communication/Com/Com_Internal.h index e745dcc5..147ab348 100644 --- a/communication/Com/Com_Internal.h +++ b/communication/Com/Com_Internal.h @@ -29,7 +29,7 @@ extern Com_Arc_Config_type Com_Arc_Config; -#ifdef COM_DEV_ERROR_DETECT +#if COM_DEV_ERROR_DETECT == STD_ON #include "Det.h" #define DET_REPORTERROR(_x,_y,_z,_q) Det_ReportError(_x,_y,_z,_q) @@ -37,14 +37,14 @@ extern Com_Arc_Config_type Com_Arc_Config; // Define macro for parameter check. #define PDU_ID_CHECK(PduId,ApiId,...) \ - if (PduId >= Com_Arc_Config.ComNIPdu) { \ + if (PduId >= COM_N_IPDUS) { \ DET_REPORTERROR(COM_MODULE_ID, COM_INSTANCE_ID, ApiId, COM_INVALID_PDU_ID); \ return __VA_ARGS__; \ } \ #define VALIDATE_SIGNAL(SignalId, ApiId, ...) \ - if (ComConfig->ComSignal[SignalId].Com_Arc_IsSignalGroup) { \ - DET_REPORTERROR(COM_MODULE_ID, COM_INSTANCE_ID, ApiId, COM_ERROR_SIGNAL_IS_SIGNALGROUP); \ + if (SignalId >= COM_N_SIGNALS) { \ + DET_REPORTERROR(COM_MODULE_ID, COM_INSTANCE_ID, ApiId, COM_INVALID_SIGNAL_ID); \ return __VA_ARGS__; \ } \ -- 2.39.2