]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Updates mainly related to PduR interface.
authorpete <devnull@localhost>
Thu, 8 Apr 2010 09:52:57 +0000 (11:52 +0200)
committerpete <devnull@localhost>
Thu, 8 Apr 2010 09:52:57 +0000 (11:52 +0200)
boards/generic/CanTp_Cfg.h
communication/CanIf/CanIf.c
communication/PduR/PduR_CanIf.h
communication/PduR/PduR_CanTp.h
communication/PduR/PduR_Dcm.h
diagnostic/Dem/Dem_Lcfg.h
system/EcuM/EcuM_Callout_template.c

index 97ef96b7fa2cd9367344d196dd824b4ce5b3b4ab..45c344397c52203eafa0d361a05f6240af924b73 100644 (file)
@@ -20,7 +20,7 @@
 #include "CanTp_Types.h"\r
 \r
 #define MAIN_FUNCTION_PERIOD_TIME_MS   1000\r
-#define CONVERT_MS_TO_MAIN_CYCLES(x)   100\r
+#define CONVERT_MS_TO_MAIN_CYCLES(x)   ((x)/MAIN_FUNCTION_PERIOD_TIME_MS)\r
 \r
 //#define CANTP_RX_NSDU_CONFIG_LIST_CNT        3\r
 //#define CANTP_TX_NSDU_CONFIG_LIST_CNT        3\r
index b06da7e00cac7044d406da1d83331d4e1442c691..dd2af9429ae3d78c7ce8d83267b70046cd0db2a6 100644 (file)
@@ -759,7 +759,12 @@ void CanIf_RxIndication(uint8 Hrh, Can_IdType CanId, uint8 CanDlc,
         case CANIF_USER_TYPE_CAN_TP:
           // Send Can frame to CAN TP
 #if defined(USE_CANTP)
-            CanTp_RxIndication(entry->CanIfCanRxPduId,CanSduPtr);
+            {
+                   PduInfoType CanTpRxPdu;
+                   CanTpRxPdu.SduLength = CanDlc;
+                   CanTpRxPdu.SduDataPtr = (uint8 *)CanSduPtr;
+                CanTp_RxIndication(entry->CanIfCanRxPduId, &CanTpRxPdu);
+            }
             return;
 #endif
             break;
index 1d7ba27bad03f02475d7591ac7a167fdd3a28575..6a4a214248676e1a95e12e28032361931fa19477 100644 (file)
 \r
 #include "PduR.h"\r
 \r
-#ifdef PDUR_CANIF_SUPPORT\r
-#ifndef PDUR_ZERO_COST_OPERATION\r
+#ifdef PDUR_CANIF_SUPPORT
 \r
-void PduR_CanIfRxIndication (PduIdType CanRxPduId, const uint8 *CanSudPtr );\r
-void PduR_CanIfTxConfirmation(PduIdType CanTxPduId);\r
-\r
-\r
-#else // Zero cost operation active\r
-\r
-#define PduR_CanIfRxIndication Com_RxIndication\r
-#define PduR_CanIfTxConfirmation Com_TxConfirmation\r
-\r
-#endif\r
-#endif\r
+       #ifndef PDUR_ZERO_COST_OPERATION\r
+
+               void PduR_CanIfRxIndication (PduIdType CanRxPduId, const uint8 *CanSudPtr );\r
+               void PduR_CanIfTxConfirmation(PduIdType CanTxPduId);\r
+
+       #else // Zero cost operation active\r
+
+               #if PDUR_SINGLE_IF == CAN_IF && defined(PDUR_COM_SUPPORT)
+
+                       #include "Com_Com.h"
+
+                       #define PduR_CanIfRxIndication Com_RxIndication\r
+                       #define PduR_CanIfTxConfirmation Com_TxConfirmation
+
+               #else
+
+                       #define PduR_CanIfRxIndication (void)
+                       #define PduR_CanIfTxConfirmation (void)
+
+               #endif
+
+       #endif // Zero cost operation active
 \r
+#else
+
+       #define PduR_CanIfRxIndication (void)
+       #define PduR_CanIfTxConfirmation (void)
+
+#endif // CAN_IF not supported\r
+
 #endif /* PDUR_CANIF_H_ */\r
index e74f230f0ab458e2d303273c5e8869d00a4b1f49..5e5335dd49a725199569f9b57ac60142bd494080 100644 (file)
 #include "PduR.h"\r
 \r
 #ifdef PDUR_CANTP_SUPPORT\r
-#ifndef PDUR_ZERO_COST_OPERATION\r
 \r
+       #ifndef PDUR_ZERO_COST_OPERATION\r
 \r
-BufReq_ReturnType PduR_CanTpProvideRxBuffer(PduIdType CanTpRxPduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr);\r
-void PduR_CanTpRxIndication(PduIdType CanTpRxPduId, NotifResultType Result);\r
-BufReq_ReturnType PduR_CanTpProvideTxBuffer(PduIdType CanTpTxPduId, PduInfoType** PduInfoPtr, uint16 Length);\r
-void PduR_CanTpTxConfirmation(PduIdType CanTpTxPduId, NotifResultType Result);\r
+               BufReq_ReturnType PduR_CanTpProvideRxBuffer(PduIdType CanTpRxPduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr);\r
+               void PduR_CanTpRxIndication(PduIdType CanTpRxPduId, NotifResultType Result);\r
+               BufReq_ReturnType PduR_CanTpProvideTxBuffer(PduIdType CanTpTxPduId, PduInfoType** PduInfoPtr, uint16 Length);\r
+               void PduR_CanTpTxConfirmation(PduIdType CanTpTxPduId, NotifResultType Result);\r
 \r
+       #else // Zero cost operation active\r
 \r
-#else // Zero cost operation active\r
-#include "Dcm_Cbk.h"\r
+               #if PDUR_SINGLE_TP == CAN_TP && defined(PDUR_DCM_SUPPORT)\r
 \r
-#define PduR_CanTpProvideRxBuffer Dcm_ProvideRxBuffer\r
-#define PduR_CanTpRxIndication Dcm_RxIndication\r
-#define PduR_CanTpProvideTxBuffer Dcm_ProvideTxBuffer\r
-#define PduR_CanTpTxConfirmation Dcm_TxConfirmation\r
+                       #include "Dcm_Cbk.h"\r
 \r
+                       #define PduR_CanTpProvideRxBuffer Dcm_ProvideRxBuffer\r
+                       #define PduR_CanTpRxIndication Dcm_RxIndication\r
+                       #define PduR_CanTpProvideTxBuffer Dcm_ProvideTxBuffer\r
+                       #define PduR_CanTpTxConfirmation Dcm_TxConfirmation\r
 \r
+               #else\r
 \r
+                       #define PduR_CanTpProvideRxBuffer (void)\r
+                       #define PduR_CanTpRxIndication (void)\r
+                       #define PduR_CanTpProvideTxBuffer (void)\r
+                       #define PduR_CanTpTxConfirmation (void)\r
+\r
+               #endif\r
+\r
+       #endif // Zero cost operation active\r
+\r
+#else\r
+\r
+       #define PduR_CanTpProvideRxBuffer (void)\r
+       #define PduR_CanTpRxIndication (void)\r
+       #define PduR_CanTpProvideTxBuffer (void)\r
+       #define PduR_CanTpTxConfirmation (void)\r
 \r
-#endif\r
 #endif\r
 \r
 #endif /* PDUR_CANTP_H_ */\r
index fe7aa010f1126b0b8a4d8a852e57108c3b604935..639e02526f4b2f4a119113547474dd41702d4da3 100644 (file)
 #include "PduR.h"\r
 \r
 #ifdef PDUR_DCM_SUPPORT\r
-#ifndef PDUR_ZERO_COST_OPERATION\r
 \r
-Std_ReturnType PduR_DcmTransmit(PduIdType DcmTxPduId, const PduInfoType* PduInfoPtr);\r
+       #ifndef PDUR_ZERO_COST_OPERATION\r
 \r
-#else\r
-#include "CanTp.h"\r
+               Std_ReturnType PduR_DcmTransmit(PduIdType DcmTxPduId, const PduInfoType* PduInfoPtr);\r
 \r
-#define PduR_DcmTransmit CanTp_Transmit\r
+       #else\r
+\r
+               #include "CanTp.h"\r
+\r
+               #define PduR_DcmTransmit CanTp_Transmit\r
+\r
+       #endif\r
 \r
-#endif\r
 #endif\r
 \r
 \r
index d853de51bae57a459368c3a2debda34dad3158fa..cf90b287fc4277928270cff3f7fdc534ac27f664 100644 (file)
@@ -24,7 +24,9 @@
 #define DEM_LCFG_H_
 
 #include "Dem_Types.h"
+#if defined(USE_DCM)
 #include "Dcm_Types.h"
+#endif
 
 
 /*
@@ -44,9 +46,15 @@ typedef Std_ReturnType (*Dem_CallbackEventStatusChangedFncType)(Dem_EventStatusE
 typedef Std_ReturnType (*Dem_CallbackDTCStatusChangedFncType)(uint8 DTCStatusOld, uint8 DTCStatusNew);
 
 // DIDServices
+#if defined(USE_DCM)
 typedef Std_ReturnType (*Dem_CallbackConditionCheckReadFncType)(Dcm_NegativeResponseCodeType *Nrc);
 typedef Std_ReturnType (*Dem_CallbackReadDataFncType)(uint8 *Data);
 typedef Std_ReturnType (*Dem_CallbackReadDataLength)(uint16 *DidLength);
+#else
+typedef Std_ReturnType (*Dem_CallbackConditionCheckReadFncType)(uint8 *Nrc);
+typedef Std_ReturnType (*Dem_CallbackReadDataFncType)(uint8 *Data);
+typedef Std_ReturnType (*Dem_CallbackReadDataLength)(uint16 *DidLength);
+#endif
 
 // GetExtendedDataRecord
 typedef Std_ReturnType (*Dem_CallbackGetExtDataRecordFncType)(uint8 *ExtendedDataRecord);
index 005bdf6135c38881dd4ac9f873821c8b5dfc9edb..5399a5c55fa3b2d6107a711fc55b0e251f193d74 100644 (file)
@@ -1,34 +1,35 @@
-/* -------------------------------- Arctic Core ------------------------------\r
- * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
- *\r
- * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
- *\r
- * This source code is free software; you can redistribute it and/or modify it\r
- * under the terms of the GNU General Public License version 2 as published by the\r
- * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
- *\r
- * This program is distributed in the hope that it will be useful, but\r
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
- * for more details.\r
- * -------------------------------- Arctic Core ------------------------------*/\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-// This file is just examples of implementation for the stubs needed by\r
-// the EcuM. Every Autocore application should use an own version of this\r
-// file to implement the setup and tear down of the system.\r
+/* -------------------------------- Arctic Core ------------------------------
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com
+ *
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
+ *
+ * This source code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ * -------------------------------- Arctic Core ------------------------------*/
+
+
+
+
+
+
+
+
+// This file is just examples of implementation for the stubs needed by
+// the EcuM. Every Autocore application should use an own version of this
+// file to implement the setup and tear down of the system.
+
 \r
 #include "EcuM.h"\r
-#include "Det.h"\r
-#if defined(USE_DEM)\r
-#include "Dem.h"\r
-#endif\r
+#include "Det.h"
+#if defined(USE_DEM)
+#include "Dem.h"
+#endif
 #if defined(USE_MCU)\r
 #include "Mcu.h"\r
 #endif\r
 #if defined(USE_COM)\r
 #include "Com.h"\r
 #endif\r
+#if defined(USE_CANTP)
+#include "CanTp.h"
+#endif
+#if defined(USE_DCM)
+#include "Dcm.h"
+#endif
 #if defined(USE_PWM)\r
 #include "Pwm.h"\r
 #endif\r
 void EcuM_AL_DriverInitZero()\r
 {\r
        Det_Init();\r
-    Det_Start();\r
-\r
-#if defined(USE_DEM)\r
-       // Preinitialize DEM\r
-       Dem_PreInit();\r
-#endif\r
-\r
+    Det_Start();
 }\r
 \r
 EcuM_ConfigType* EcuM_DeterminePbConfiguration()\r
@@ -84,6 +85,11 @@ void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)
          ;\r
 #endif\r
 \r
+#if defined(USE_DEM)
+       // Preinitialize DEM
+       Dem_PreInit();
+#endif
+
 #if defined(USE_PORT)\r
        // Setup Port\r
        Port_Init(ConfigPtr->PortConfig);\r
@@ -111,7 +117,6 @@ void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)
        // Setup ICU\r
        // TODO\r
 \r
-       // Setup PWM\r
 #if defined(USE_PWM)\r
        // Setup PWM\r
        Pwm_Init(ConfigPtr->PwmConfig);\r
@@ -151,6 +156,11 @@ void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)
        CanIf_Init(ConfigPtr->CanIfConfig);\r
 #endif\r
 \r
+#if defined(USE_CANTP)
+       // Setup CAN TP
+       CanTp_Init();
+#endif
+
        // Setup LIN\r
        // TODO\r
 \r
@@ -163,24 +173,34 @@ void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)
        // Setup COM layer\r
        Com_Init(ConfigPtr->ComConfig);\r
 #endif\r
-       \r
+\r
+#if defined(USE_DCM)
+       // Setup DCM
+       Dcm_Init();
+#endif
+
 #if defined(USE_IOHWAB)\r
-       // Setup IO Hardware Abstraction\r
+       // Setup IO hardware abstraction layer\r
        IoHwAb_Init();\r
 #endif\r
-\r
-#if defined(USE_DEM)\r
-       // Initialize DEM\r
-       Dem_Init();\r
-#endif\r
-\r
 }\r
 \r
 void EcuM_AL_DriverInitThree(const EcuM_ConfigType ConfigPtr)\r
 {\r
+       // Setup ComM
+
+#if defined(USE_DEM)
+       // Setup DEM
+       Dem_Init();
+#endif
+
+       // Setup FIM
+
 #if defined(USE_CANIF)\r
-       // Startup the CAN interface; due to the missing COM manager\r
-       CanIf_InitController(CANIF_CHANNEL_0, CANIF_CHANNEL_0_CONFIG_0);\r
-       CanIf_SetControllerMode(CANIF_CHANNEL_0, CANIF_CS_STARTED);\r
-#endif\r
+       // Startup the CAN interafce; due to the missing COM manager\r
+//     CanIf_InitController(CANIF_Channel_1, CANIF_Channel_1_CONFIG_0);
+//     CanIf_SetControllerMode(CANIF_Channel_1, CANIF_CS_STARTED);\r
+#endif
+
+\r
 }\r