#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
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;
\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
#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
#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
#define DEM_LCFG_H_
#include "Dem_Types.h"
+#if defined(USE_DCM)
#include "Dcm_Types.h"
+#endif
/*
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);
-/* -------------------------------- 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
;\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
// Setup ICU\r
// TODO\r
\r
- // Setup PWM\r
#if defined(USE_PWM)\r
// Setup PWM\r
Pwm_Init(ConfigPtr->PwmConfig);\r
CanIf_Init(ConfigPtr->CanIfConfig);\r
#endif\r
\r
+#if defined(USE_CANTP)
+ // Setup CAN TP
+ CanTp_Init();
+#endif
+
// Setup LIN\r
// TODO\r
\r
// 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