\r
RTC.RTCC.B.CNTEN = 1; // start RTC\r
#else\r
- uint32 tmp;\r
\r
// Enable the TB\r
+ uint32_t tmp;\r
tmp = get_spr(SPR_HID0);\r
tmp |= HID0_TBEN;\r
set_spr(SPR_HID0, tmp);\r
\r
obj-$(CFG_PPC) += crt0.o\r
obj-$(CFG_HC1X) += crt0.o\r
-\r
vpath-$(CFG_ARM_CM3) += $(ROOTDIR)/$(ARCH_PATH-y)/kernel\r
vpath-$(CFG_ARM_CM3) += $(ROOTDIR)/$(ARCH_PATH-y)/drivers/STM32F10x_StdPeriph_Driver/src\r
vpath-$(CFG_ARM_CM3) += $(ROOTDIR)/$(ARCH_PATH-y)/drivers/STM32_ETH_Driver/src\r
\r
# PduR\r
obj-$(USE_PDUR) += PduR_Com.o\r
-obj-$(USE_PDUR) += PduR_If.o\r
+obj-$(USE_PDUR) += PduR_Logic.o\r
obj-$(USE_PDUR) += PduR_LinIf.o\r
obj-$(USE_PDUR) += PduR_PbCfg.o\r
obj-$(USE_PDUR) += PduR_CanIf.o\r
obj-$(USE_PDUR) += PduR_CanTp.o\r
obj-$(USE_PDUR) += PduR_Dcm.o\r
+obj-$(USE_PDUR) += PduR_SoAd.o\r
+obj-$(USE_PDUR) += PduR_Routing.o\r
obj-$(USE_PDUR) += PduR.o\r
inc-$(USE_PDUR) += $(ROOTDIR)/communication/PduR\r
inc-$(USE_COM) += $(ROOTDIR)/communication/PduR\r
#SLEEP\r
obj-$(USE_SLEEP) += sleep.o\r
\r
-obj-y += xtoa.o\r
+\r
\r
SELECT_CLIB?=CLIB_NEWLIB\r
\r
-ifeq ($(SELECT_CLIB),CLIB_CW)\r
+ifeq ($(SELECT_CLIB),CLIB_NATIVE)\r
+ # Just use native clib \r
+ \r
+else ifeq ($(SELECT_CLIB),CLIB_CW)\r
# This is not good, but don't know what to do right now....\r
+ obj-y += xtoa.o\r
obj-y += msl_port.o\r
else\r
# Newlib\r
+ obj-y += xtoa.o\r
obj-y += newlib_port.o\r
# If we have configured console output we include printf. \r
# Overridden to use lib implementation with CFG_NEWLIB_PRINTF\r
return E_OK;\r
}\r
\r
-Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, uint8 *SduPtr) {\r
+Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, PduInfoType *PduInfoPtr) {\r
PDU_ID_CHECK(ComTxPduId, 0x13, E_NOT_OK);\r
/*\r
* COM260: This function must not check the transmission mode of the I-PDU\r
const ComIPdu_type *IPdu = GET_IPdu(ComTxPduId);\r
Com_Arc_IPdu_type *Arc_IPdu = GET_ArcIPdu(ComTxPduId);\r
\r
- memcpy(SduPtr, Arc_IPdu->ComIPduDataPtr, IPdu->ComIPduSize);\r
+ memcpy(PduInfoPtr->SduDataPtr, Arc_IPdu->ComIPduDataPtr, IPdu->ComIPduSize);\r
return E_OK;\r
}\r
\r
}\r
\r
//lint -esym(904, Com_RxIndication) //PC-Lint Exception of rule 14.7\r
-void Com_RxIndication(PduIdType ComRxPduId, const uint8* SduPtr) {\r
+void Com_RxIndication(PduIdType ComRxPduId, const PduInfoType* PduInfoPtr) {\r
PDU_ID_CHECK(ComRxPduId, 0x14);\r
\r
const ComIPdu_type *IPdu = GET_IPdu(ComRxPduId);\r
\r
// Check callout status\r
if (IPdu->ComIPduCallout != NULL) {\r
- if (!IPdu->ComIPduCallout(ComRxPduId, SduPtr)) {\r
+ if (!IPdu->ComIPduCallout(ComRxPduId, PduInfoPtr)) {\r
// TODO Report error to DET.\r
// Det_ReportError();\r
return;\r
}\r
\r
// Copy IPDU data\r
- memcpy(Arc_IPdu->ComIPduDataPtr, SduPtr, IPdu->ComIPduSize);\r
+ memcpy(Arc_IPdu->ComIPduDataPtr, PduInfoPtr->SduDataPtr, IPdu->ComIPduSize);\r
\r
// For each signal.\r
const ComSignal_type *comSignal;\r
#include "McuExtensions.h"\r
#include "debug.h"\r
\r
-\r
/*\r
* The state of the PDU router.\r
*/\r
PduR_StateType PduRState = PDUR_UNINIT; // 960, 31 PC-Lint: Borde åtgärdas\r
\r
-const PduR_PBConfigType * PduRConfig;\r
-\r
\r
-/* ############### Zero Cost Operation Mode ############# */\r
-/* Only define the following functions if zero cost operation\r
- * mode is not used! They are defined as macros in PduR.h otherwise. */\r
#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
+\r
+\r
+const PduR_PBConfigType * PduRConfig;\r
+\r
+\r
/*\r
* Initializes the PDU Router.\r
*/\r
uint8 failed = 0;\r
\r
// Initialize buffers.\r
+ /*\r
uint16 bufferNr = 0;\r
- PduRRoutingPath_type *path;\r
- PduRConfig->PduRRoutingTable->NRoutingPaths = 0;\r
- for (uint16 i = 0; (!PduRConfig->PduRRoutingTable->PduRRoutingPath[i].PduR_Arc_EOL) && (!failed); i++) {\r
- PduRConfig->PduRRoutingTable->NRoutingPaths++;\r
- path = &PduRConfig->PduRRoutingTable->PduRRoutingPath[i];\r
-\r
- if (path->PduRDestPdu.DataProvision != PDUR_NO_PROVISION) {\r
- // Allocate memory for new buffer.\r
- PduRTxBuffer_type *buffer = path->PduRDestPdu.TxBufferRef;\r
-\r
- if (bufferNr >= PDUR_MAX_TX_BUFFER_NUMBER) {\r
- DEBUG(DEBUG_LOW,"PduR_Init: Initialization of buffer failed due to erroneous configuration.\nThe number of buffer exceeded the maximum number of allowed buffers.\n");\r
- failed = 1;\r
- break;\r
- }\r
- // 586 PC-Lint (malloc) ticket #135\r
- if ((buffer->Buffer = (uint8 *)malloc(buffer->Depth * sizeof(uint8) * path->SduLength)) == 0) {\r
- DEBUG(DEBUG_LOW,"PduR_Init: Initialization of buffer failed. Buffer space could not be allocated for buffer number %d\n", bufferNr);\r
- failed = 1;\r
- break;\r
- }\r
+ for (uint16 i = 0; PduRConfig->RoutingPaths[i] != NULL && (!failed); i++) {\r
+ const PduRRoutingPath_type *path = PduRConfig->RoutingPaths[i];\r
\r
- buffer->First = buffer->Buffer;\r
- buffer->Last = buffer->Buffer;\r
+ for (uint8 j = 0; path->PduRDestPdus[j] != NULL; j++) {\r
+ const PduRDestPdu_type *destination = path->PduRDestPdus[j];\r
\r
\r
- // Initialize the new buffer.\r
- buffer->BufferId = i; // Set buffer id.\r
- buffer->BufferType = path->PduRDestPdu.DataProvision; // Set buffer data provision mode.\r
- buffer->Length = path->SduLength; // Set buffer sdu length.\r
+ if (destination->DataProvision == PDUR_TRIGGER_TRANSMIT) {\r
+ // Allocate memory for new buffer.\r
\r
- if (path->PduRDestPdu.DataProvision == PDUR_TRIGGER_TRANSMIT) {\r
- //memcpy(buffer->First, path->PduRDefaultValue.PduRDefaultValueElement->DefaultValueElement,path->SduLength);\r
- PduR_BufferQueue(buffer, path->PduRDefaultValue.PduRDefaultValueElement->DefaultValueElement);\r
- }\r
\r
- // Save pointer to the new buffer.\r
- //PduR_RTable_LoIf.RoutingTable[i].TxBufferRef = &PduRBuffers[bufferNr];\r
+ // Initialize the new buffer.\r
+ buffer->BufferId = i; // Set buffer id.\r
+ buffer->BufferType = destination->DataProvision; // Set buffer data provision mode.\r
+ buffer->Length = path->SduLength; // Set buffer sdu length.\r
+\r
+ if (destination->DataProvision == PDUR_TRIGGER_TRANSMIT) {\r
+ //memcpy(buffer->First, path->PduRDefaultValue.PduRDefaultValueElement->DefaultValueElement,path->SduLength);\r
+ PduR_BufferQueue(buffer, path->PduRDefaultValue.PduRDefaultValueElement->DefaultValueElement);\r
+ }\r
+\r
+ // Save pointer to the new buffer.\r
+ //PduR_RTable_LoIf.RoutingTable[i].TxBufferRef = &PduRBuffers[bufferNr];\r
+\r
+ DEBUG(DEBUG_LOW,"Initialized buffer %d. Id: %d, Type: %d, Depth: %d\n", bufferNr, buffer->BufferId, buffer->BufferType, buffer->Depth);\r
+ bufferNr++;\r
+\r
+ }\r
\r
- DEBUG(DEBUG_LOW,"Initialized buffer %d. Id: %d, Type: %d, Depth: %d\n", bufferNr, buffer->BufferId, buffer->BufferType, buffer->Depth);\r
- bufferNr++;\r
}\r
}\r
+ */\r
\r
if (failed) {\r
// TODO Report PDUR_E_INIT_FAILED to Dem.\r
}\r
}\r
\r
+/*\r
void PduR_BufferInc(PduRTxBuffer_type *Buffer, uint8 **ptr) {\r
(*ptr) = (*ptr) + Buffer->Length;\r
\r
if ( *ptr >= ( Buffer->Buffer + (Buffer->Depth * Buffer->Length) ) ) {\r
*ptr = Buffer->Buffer;\r
}\r
- //*val = (*val + 1) % Buffer->Depth;\r
+ // *val = (*val + 1) % Buffer->Depth;\r
}\r
\r
void PduR_BufferQueue(PduRTxBuffer_type *Buffer, const uint8 * SduPtr) {\r
McuE_ExitCriticalSection(state);\r
return rv;\r
}\r
+*/\r
+\r
\r
\r
#if PDUR_VERSION_INFO_API == STD_ON\r
//PduR_DevCheck(0,1,0x18,E_NOT_OK);\r
return PduRConfig->PduRConfigurationId;\r
}\r
-#endif // End of not Zero Cost Operation Mode\r
\r
Std_ReturnType PduR_CancelTransmitRequest(PduR_CancelReasonType PduCancelReason, PduIdType PduId) {\r
// TODO Implement!\r
- (void)PduCancelReason;\r
- (void)PduId;\r
return E_NOT_OK;\r
}\r
\r
void PduR_ChangeParameterRequest(PduR_ParameterValueType PduParameterValue, PduIdType PduId) {\r
// TODO Implement!\r
- (void)PduParameterValue;\r
- (void)PduId;\r
+\r
}\r
+\r
+#endif\r
* -------------------------------- Arctic Core ------------------------------*/\r
\r
\r
-\r
-\r
-\r
-\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
-\r
-#include "Det.h"\r
-#include "debug.h"\r
-\r
-void PduR_CanIfRxIndication(PduIdType CanRxPduId,const uint8* CanSduPtr) {\r
-#if (PDUR_CANIF_SUPPORT == STD_ON)\r
- PduR_DevCheck(CanRxPduId,CanSduPtr,0x0e);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
- DEBUG(DEBUG_LOW,"PduR_CanIfRxIndication: received indication with id %d and data %d\n", CanRxPduId, *CanSduPtr);\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
- PduR_LoIfRxIndication(CanRxPduId, CanSduPtr);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+void PduR_CanIfRxIndication(PduIdType CanRxPduId,const PduInfoType* PduInfoPtr) {\r
+ PduR_ARC_RxIndication(CanRxPduId, PduInfoPtr, 0x01);\r
}\r
\r
void PduR_CanIfTxConfirmation(PduIdType CanTxPduId) {\r
-#if (PDUR_CANIF_SUPPORT == STD_ON)\r
- PduR_DevCheck(CanTxPduId,1,0x0f);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
- DEBUG(DEBUG_LOW,"PduR_CanIfTxConfirmation: received confirmation with id %d\n", CanTxPduId);\r
-\r
- PduR_LoIfTxConfirmation(CanTxPduId);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+ uint8 dummy = 0;\r
+ PduR_ARC_TxConfirmation(CanTxPduId,dummy,0x02);\r
}\r
\r
#endif\r
\r
\r
#include "PduR.h"\r
-\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
#include "Det.h"\r
#include "debug.h"\r
\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
BufReq_ReturnType PduR_CanTpProvideRxBuffer(PduIdType CanTpRxPduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) {\r
- BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
-#if (PDUR_CANTP_SUPPORT == STD_ON)\r
- /* Gateway and multicast modes not supported. */\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpRxPduId];\r
- retVal = Dcm_ProvideRxBuffer(route->PduRDestPdu.DestPduId, TpSduLength, PduInfoPtr);\r
-#endif\r
- return retVal;\r
+ return PduR_ARC_ProvideRxBuffer(CanTpRxPduId, TpSduLength, PduInfoPtr, 0x03);\r
}\r
\r
\r
void PduR_CanTpRxIndication(PduIdType CanTpRxPduId, NotifResultType Result) {\r
-#if (PDUR_CANTP_SUPPORT == STD_ON)\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
- DEBUG(DEBUG_LOW,"PduR_CanTpRxIndication: received indication with id %d and data %d\n", CanTpRxPduId);\r
-\r
- /* Note that there is no support for CAN TP and gateway operation mode */\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpRxPduId];\r
- Dcm_RxIndication(route->PduRDestPdu.DestPduId, Result); // Send PDU to next receptor.\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+ PduInfoType PduInfo = {\r
+ .SduDataPtr = &Result\r
+ };\r
+ PduR_ARC_RxIndication(CanTpRxPduId, &PduInfo, 0x04);\r
}\r
\r
\r
BufReq_ReturnType PduR_CanTpProvideTxBuffer(PduIdType CanTpTxPduId, PduInfoType** PduInfoPtr, uint16 Length) {\r
- BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
-#if (PDUR_CANTP_SUPPORT == STD_ON)\r
- /* Gateway and multicast modes not supported. */\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpTxPduId];\r
- retVal = Dcm_ProvideTxBuffer(route->PduRSrcPdu.SrcPduId, PduInfoPtr, Length);\r
-#endif\r
- return retVal;\r
+ return PduR_ARC_ProvideTxBuffer(CanTpTxPduId, PduInfoPtr, Length, 0x03);\r
}\r
\r
\r
void PduR_CanTpTxConfirmation(PduIdType CanTpTxPduId, NotifResultType Result) {\r
-#if (PDUR_CANTP_SUPPORT == STD_ON)\r
- PduR_DevCheck(CanTpTxPduId,1,0x0f);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
- DEBUG(DEBUG_LOW,"PduR_CanIfTxConfirmation: received confirmation with id %d\n", CanTxPduId);\r
-\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpTxPduId];\r
- Dcm_TxConfirmation(route->PduRSrcPdu.SrcPduId, Result); // Forward confirmation\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+ PduR_ARC_TxConfirmation(CanTpTxPduId, Result, 0x0f);\r
}\r
\r
-\r
#endif\r
\r
\r
\r
-\r
-\r
-\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
-#include "Det.h"\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
-\r
-/**\r
- * Called by the COM-layer in order to send a PDU through a protocol interface.\r
- */\r
Std_ReturnType PduR_ComTransmit(PduIdType ComTxPduId, const PduInfoType* PduInfoPtr) {\r
- BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
-#if (PDUR_COM_SUPPORT == STD_ON)\r
- PduR_DevCheck(ComTxPduId,PduInfoPtr,0x15, E_NOT_OK);\r
-\r
- //DEBUG(DEBUG_LOW,"PduR_ComTransmit: received transmit request with id %d and data %d\n", ComTxPduId, *PduInfoPtr->SduDataPtr);\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[ComTxPduId];\r
- retVal = route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, PduInfoPtr);\r
-#endif\r
- return retVal;\r
+ return PduR_ARC_Transmit(ComTxPduId, PduInfoPtr, 0x15);\r
}\r
\r
#endif\r
\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
-\r
-#include "debug.h"\r
-\r
-#if (PDUR_DCM_SUPPORT == STD_ON)\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
Std_ReturnType PduR_DcmTransmit(PduIdType DcmTxPduId, const PduInfoType* PduInfoPtr) {\r
- BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
-#if (PDUR_DCM_SUPPORT == STD_ON)\r
- PduR_DevCheck(DcmTxPduId,PduInfoPtr,0x15, E_NOT_OK);\r
-\r
- //DEBUG(DEBUG_LOW,"PduR_ComTransmit: received transmit request with id %d and data %d\n", ComTxPduId, *PduInfoPtr->SduDataPtr);\r
-\r
-\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[DcmTxPduId];\r
- retVal = route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, PduInfoPtr);\r
-#endif\r
- return retVal;\r
+ return PduR_ARC_Transmit(DcmTxPduId, PduInfoPtr, 0x16);\r
}\r
\r
#endif\r
-\r
-#endif\r
+++ /dev/null
-/* -------------------------------- 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
-#include "PduR.h"\r
-\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
-\r
-#include <string.h>\r
-#include "debug.h"\r
-#if defined(USE_DEM)\r
-#include "Dem.h"\r
-#endif\r
-\r
-/**\r
- * Helper function for the PduR_<LO>IfRxIndication functions. This helper performs the actions specified by PDUR255 and PDUR258.\r
- * @param LinRxPduId - The id of the PDU to be routed.\r
- * @param LinSduPtr - The payload of the PDU.\r
- * @param LoIf_Transmit\r
- */\r
-void PduR_LoIfRxIndication(PduIdType PduId, const uint8* SduPtr) {\r
-\r
- // Perform routing lookup.\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[PduId];\r
-\r
- if (route->PduR_GatewayMode == 0) {\r
- // This is an ordinary request.\r
- // 534 PC-Lint (ignoring return value) ticket #134:\r
- route->FctPtrs.TargetIndicationFctPtr(route->PduRDestPdu.DestPduId, SduPtr); // Send PDU to next receptor.\r
-\r
-\r
- } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_NO_PROVISION) ) {\r
- // This is a gateway request, but without any data provision (buffer usage).\r
- PduInfoType PduInfo = {\r
- .SduDataPtr = (uint8 *)SduPtr, // 926, 960 PC-Lint: Beror på att funktion PduR_LoIfRxIndication(...) fel-definerad TICKET 130\r
- .SduLength = route->SduLength\r
- };\r
- // 534 PC-Lint (ignoring return value) ticket #134:\r
- route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfo); // Send PDU to next receptor.\r
-\r
-\r
- } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_TRIGGER_TRANSMIT) ) {\r
- // Ths is a gateway request which uses trigger transmit data provision. PDUR255\r
- DEBUG(DEBUG_LOW,"\tUsing gateway mode with trigger transmit provision\n");\r
-\r
- if (route->PduRDestPdu.TxBufferRef->TxConfP) { // Transfer confirmation pending.\r
- // Enqueue the new I-PDU. This will flush the buffer if it is full according to the buffer specification.\r
- PduR_BufferQueue(route->PduRDestPdu.TxBufferRef, SduPtr);\r
- // TODO report PDUR_E_PDU_INSTANCE_LOST to DEM if needed.\r
- }\r
-\r
- if (!route->PduRDestPdu.TxBufferRef->TxConfP) { // No transfer confirmation pending (anymore).\r
- uint8 val[route->SduLength];\r
- PduInfoType PduInfo = {\r
- .SduDataPtr = val,\r
- .SduLength = route->SduLength\r
- };\r
- PduR_BufferDeQueue(route->PduRDestPdu.TxBufferRef, val);\r
- PduR_BufferQueue(route->PduRDestPdu.TxBufferRef, SduPtr);\r
- if (route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfo) == E_OK) {\r
- setTxConfP(route);\r
- }\r
- }\r
-\r
- } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_DIRECT) ) {\r
- // This is a gateway request using a direct data provision fifo. PDUR258\r
- DEBUG(DEBUG_LOW,"\tUsing gateway mode with direct provision\n");\r
-\r
- if (route->PduRDestPdu.TxBufferRef->TxConfP) { // Transfer confirmation pending.\r
- DEBUG(DEBUG_LOW,"\tTransfer confirmation pending.\n");\r
- PduR_BufferQueue(route->PduRDestPdu.TxBufferRef, SduPtr);\r
- // TODO report PDUR_E_PDU_INSTANCE_LOST to DEM if needed.\r
-\r
- }\r
-\r
- if (!route->PduRDestPdu.TxBufferRef->TxConfP) { // No transfer confirmation pending (anymore)\r
- // TODO: Shall this function create a new I-PDU from LinSduPtr?\r
-\r
- // Make new PduInfoPackage\r
- DEBUG(DEBUG_LOW,"\tNo transfer confirmation pending. Forwarding packet.\n");\r
- PduInfoType PduInfoPtr = {\r
- .SduDataPtr = (uint8 *)SduPtr, // 926, 960 PC-Lint: Beror på att funktion PduR_LoIfRxIndication(...) fel-definerad TICKET 130\r
- .SduLength = route->SduLength\r
- };\r
- if (route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfoPtr) == E_OK) {\r
- setTxConfP(route);\r
-\r
-\r
- } else {\r
-#if defined(USE_DEM)\r
- Dem_ReportErrorStatus(PDUR_E_PDU_INSTANCE_LOST, DEM_EVENT_STATUS_FAILED);\r
-#endif\r
- DEBUG(DEBUG_LOW,"\tTransmission failed. PDUR_E_PDU_INSTANCE_LOST\n");\r
- }\r
- }\r
- } else {\r
- // Nothing to be done.\r
- }\r
-}\r
-\r
-// void PduR_LoIfTxConfirmation(PduIdType PduId, Std_ReturnType (*LoIf_Transmit)(PduIdType, const PduInfoType*)) {\r
-\r
-void PduR_LoIfTxConfirmation(PduIdType PduId) {\r
-\r
- // Perform routing lookup.\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[PduId];\r
-\r
- // Find out if this is a gateway or ordinary confirmation.\r
-\r
- if (route->PduR_GatewayMode == 0) {\r
- // This is an ordinary request.\r
- route->FctPtrs.TargetConfirmationFctPtr(route->PduRDestPdu.DestPduId); // Forward confirmation\r
-\r
- } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_NO_PROVISION) ) {\r
- // A gateway request without provision. Just forward confirmation.\r
- route->FctPtrs.TargetConfirmationFctPtr(route->PduRDestPdu.DestPduId); // Forward confirmation\r
-\r
-\r
- } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_TRIGGER_TRANSMIT) ) {\r
- // The route is using gateway mode and trigger transmit data provision. PDUR256\r
- DEBUG(DEBUG_LOW,"\tUsing gateway mode with trigger transmit data provision.\n", PduId);\r
-\r
- while (1) {\r
-\r
- // If TxConfP is set process confirmation, ignore otherwise.\r
- if (!route->PduRDestPdu.TxBufferRef->TxConfP) { // TxConfP not set, ignore!\r
- DEBUG(DEBUG_LOW,"\tTxConfP was not set, ignoring confirmation.\n");\r
- break;\r
-\r
-\r
- } else { // TxConfP is set\r
- if (route->PduRDestPdu.TxBufferRef->NrItems == 1) { // Only one entry in buffer.\r
- clearTxConfP(route); // Clear TxConfP\r
- DEBUG(DEBUG_LOW,"\tOnly one entry in buffer and TxConfP set, cleared TxConfP.\n");\r
- break;\r
-\r
-\r
- } else { // Buffer is not empty\r
- // Dequeue the first fifo item.\r
- DEBUG(DEBUG_LOW,"\tMore than one entry in buffer and TxConfP set, transmitting the next fifo entry.\n");\r
- uint8 val[route->SduLength];\r
- PduR_BufferDeQueue(route->PduRDestPdu.TxBufferRef, val);\r
-\r
- // TODO Does this need to be static?\r
- PduInfoType PduInfo = {\r
- .SduDataPtr = val,\r
- .SduLength = route->SduLength\r
- };\r
- // Transmit this item.\r
- if (route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfo) == E_OK) {\r
- DEBUG(DEBUG_LOW,"\tTransmit succeeded.\n");\r
- break;\r
-\r
-\r
- } else {\r
- DEBUG(DEBUG_LOW,"\tTransmit failed. Retrying with the next fifo entry.\n");\r
- }\r
- }\r
- }\r
- }\r
-\r
-\r
- } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_DIRECT) ) {\r
- // The route is using a direct data provision fifo. PDUR259\r
- DEBUG(DEBUG_LOW,"\tUsing gateway mode with direct data provision.\n", PduId);\r
-\r
- while (1) {\r
-\r
- // If TxConfP is set process confirmation, ignore otherwise.\r
- if (!route->PduRDestPdu.TxBufferRef->TxConfP) { // TxConfP not set, ignore!\r
- DEBUG(DEBUG_LOW,"\tTxConfP was not set, ignoring confirmation.\n");\r
- break;\r
-\r
-\r
- } else { // TxConfP is set\r
- if (route->PduRDestPdu.TxBufferRef->NrItems == 0) { // Buffer is empty\r
- clearTxConfP(route); // Clear TxConfP\r
- DEBUG(DEBUG_LOW,"\tBuffer was empty and TxConfP set, cleared TxConfP.\n");\r
- break;\r
-\r
-\r
- } else { // Buffer is not empty\r
- // Dequeue the first fifo item.\r
- DEBUG(DEBUG_LOW,"\tBuffer was not empty and TxConfP set, transmitting the next fifo entry.\n");\r
- uint8 val[route->SduLength];\r
- PduR_BufferDeQueue(route->PduRDestPdu.TxBufferRef, val);\r
-\r
- // TODO Does this need to be static?\r
- PduInfoType PduInfo = {\r
- .SduDataPtr = val,\r
- .SduLength = route->SduLength\r
- };\r
- // Transmit this item.\r
- if (route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfo) == E_OK) {\r
- DEBUG(DEBUG_LOW,"\tTransmit succeeded.\n");\r
- break;\r
-\r
-\r
- } else {\r
- DEBUG(DEBUG_LOW,"\tTransmit failed. Retrying with the next fifo entry.\n");\r
- }\r
- }\r
- }\r
- }\r
- } else {\r
- // Nothing to be done.\r
- }\r
-}\r
-\r
-void PduR_LoIfTriggerTransmit(PduIdType PduId, uint8* SduPtr) {\r
- // Perform routing lookup.\r
- PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[PduId];\r
-\r
- // Find out if this is a gateway or ordinary trigger.\r
- //if (route->PduRDestPdu.DataProvision == PDUR_NO_PROVISION) { // This is an ordinary trigger.\r
- if (route->PduR_GatewayMode == 0) { // This is an ordinary trigger.\r
- // 534 PC-Lint (ignoring return value) ticket #134:\r
- route->FctPtrs.TargetTriggerTransmitFctPtr(route->PduRDestPdu.DestPduId, SduPtr);\r
-\r
- } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_TRIGGER_TRANSMIT) ) { // The route is using a trigger transmit fifo. PDUR256\r
- DEBUG(DEBUG_LOW,"\tUsing gateway mode with trigger transmit data provision.\n", PduId);\r
- memcpy((void *)SduPtr, (void *)route->PduRDestPdu.TxBufferRef->First, sizeof(uint8) * route->SduLength);\r
-\r
- } else {\r
- // Nothing to be done.\r
- }\r
-}\r
-\r
-#endif\r
\r
\r
\r
-\r
-\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
-\r
-#include "debug.h"\r
-\r
-void PduR_LinIfRxIndication(PduIdType LinRxPduId, const uint8* LinSduPtr) {\r
-#if (PDUR_LINIF_SUPPORT == STD_ON)\r
- PduR_DevCheck(LinRxPduId,LinSduPtr,0x0e);\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
- DEBUG(DEBUG_LOW,"PduR_LinIfRxIndication: received indication with id %d and data %d\n", LinRxPduId, *LinSduPtr);\r
-\r
- PduR_LoIfRxIndication(LinRxPduId, LinSduPtr);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+void PduR_LinIfRxIndication(PduIdType LinRxPduId, const PduInfoType* PduInfoPtr) {\r
+ PduR_ARC_RxIndication(LinRxPduId, PduInfoPtr, 0x0e);\r
}\r
\r
void PduR_LinIfTxConfirmation(PduIdType LinTxPduId) {\r
-#if (PDUR_LINIF_SUPPORT == STD_ON)\r
- PduR_DevCheck(LinTxPduId,1,0x0f);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
- DEBUG(DEBUG_LOW,"PduR_LinIfTxConfirmation: received confirmation with id %d\n", LinTxPduId);\r
-\r
- PduR_LoIfTxConfirmation(LinTxPduId);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+ PduR_ARC_TxConfirmation(LinTxPduId, NULL, 0x0f);\r
}\r
\r
-void PduR_LinIfTriggerTransmit(PduIdType LinTxPduId, uint8* LinSduPtr) {\r
-#if (PDUR_LINIF_SUPPORT == STD_ON)\r
- PduR_DevCheck(LinTxPduId,LinSduPtr,0x10);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
- DEBUG(DEBUG_LOW,"PduR_LinIfTriggerTransmit: received request with id %d\n", LinTxPduId);\r
-\r
- PduR_LoIfTriggerTransmit(LinTxPduId, LinSduPtr);\r
-\r
- DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+Std_ReturnType PduR_LinIfTriggerTransmit(PduIdType LinTxPduId, PduInfoType* PduInfoPtr) {\r
+ return PduR_ARC_TriggerTransmit(LinTxPduId, PduInfoPtr, 0x10);\r
}\r
\r
#endif\r
--- /dev/null
+/* -------------------------------- 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
+#include "PduR.h"\r
+\r
+#include <string.h>\r
+#include "debug.h"\r
+#include "Det.h"\r
+#if defined(USE_DEM)\r
+#include "Dem.h"\r
+#endif\r
+\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+#define PduRTpBuffer(_id) (&PduRConfig->TpBuffers[_id])\r
+#define PduRTpRouteBuffer(_id) (PduRConfig->TpRouteBuffers[_id])\r
+\r
+\r
+BufReq_ReturnType PduR_ARC_AllocateRxBuffer(PduIdType PduId, PduLengthType TpSduLength) {\r
+ BufReq_ReturnType failRetVal = BUFREQ_BUSY;\r
+ for (uint8 i = 0; PduRTpBuffer(i)->pduInfoPtr != NULL; i++) {\r
+ if (PduRTpBuffer(i)->status == PDUR_BUFFER_FREE) {\r
+ if (PduRTpBuffer(i)->pduInfoPtr->SduLength < TpSduLength) {\r
+ failRetVal = BUFREQ_OVFL;\r
+ } else {\r
+ PduRTpRouteBuffer(PduId) = PduRTpBuffer(i);\r
+ PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_RX_BUSY;\r
+ return BUFREQ_OK;\r
+ }\r
+ }\r
+ }\r
+ return failRetVal;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_AllocateTxBuffer(PduIdType PduId, uint16 length) {\r
+ if (PduRTpRouteBuffer(PduId)->status == PDUR_BUFFER_TX_READY) {\r
+ if (length >= PduRTpRouteBuffer(PduId)->pduInfoPtr->SduLength) {\r
+ PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_TX_BUSY;\r
+ return BUFREQ_OK;\r
+ } else {\r
+ return BUFREQ_NOT_OK;\r
+ }\r
+ }\r
+ return BUFREQ_BUSY;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_ReleaseRxBuffer(PduIdType PduId) {\r
+ if (PduRTpRouteBuffer(PduId) == NULL) return BUFREQ_OK;\r
+ if (PduRTpRouteBuffer(PduId)->status == PDUR_BUFFER_RX_BUSY) {\r
+ PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_TX_READY;\r
+ return BUFREQ_BUSY;\r
+ }\r
+ return BUFREQ_OK;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_ReleaseTxBuffer(PduIdType PduId) {\r
+ if (PduRTpRouteBuffer(PduId)->status == PDUR_BUFFER_TX_BUSY) {\r
+ PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_FREE;\r
+ PduRTpRouteBuffer(PduId) = NULL;\r
+ return BUFREQ_OK;\r
+ }\r
+ return BUFREQ_NOT_OK;\r
+}\r
+\r
+Std_ReturnType PduR_ARC_Transmit(PduIdType PduId, const PduInfoType* PduInfo, uint8 serviceId) {\r
+ PDUR_VALIDATE_INITIALIZED(serviceId,E_NOT_OK);\r
+ PDUR_VALIDATE_PDUPTR(serviceId, PduInfo, E_NOT_OK);\r
+ PDUR_VALIDATE_PDUID(serviceId, PduId, E_NOT_OK);\r
+\r
+ Std_ReturnType retVal = E_OK;\r
+ const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+ for (int i = 0; route->PduRDestPdus[i] != NULL; i++) {\r
+ const PduRDestPdu_type * destination = route->PduRDestPdus[i];\r
+\r
+ retVal |= PduR_ARC_RouteTransmit(destination, PduInfo);\r
+ }\r
+ return retVal;\r
+}\r
+\r
+void PduR_ARC_RxIndicationTT(const PduRDestPdu_type * destination, const PduInfoType *PduInfo, uint8 BufferLength) {\r
+ Std_ReturnType retVal = E_OK;\r
+\r
+ uint8 bytesToCopy = 0;\r
+ if (PduInfo->SduLength > BufferLength) bytesToCopy = BufferLength;\r
+ else bytesToCopy = PduInfo->SduLength;\r
+\r
+ if (!memcpy(destination->TxBufferRef, PduInfo->SduDataPtr, bytesToCopy)) retVal |= E_NOT_OK;\r
+ retVal |= PduR_ARC_RouteTransmit(destination, PduInfo);\r
+\r
+ if (retVal != E_OK) {\r
+#if defined(USE_DEM)\r
+ Dem_ReportErrorStatus(PDUR_E_PDU_INSTANCE_LOST, DEM_EVENT_STATUS_FAILED);\r
+#endif\r
+ }\r
+ /*\r
+ // This is a gateway request which uses trigger transmit data provision. PDUR255\r
+ if (destination->TxBufferRef->TxConfP) { // Transfer confirmation pending.\r
+ // Enqueue the new I-PDU. This will flush the buffer if it is full according to the buffer specification.\r
+ PduR_BufferQueue(destination->TxBufferRef, PduInfo->SduDataPtr);\r
+ // TODO report PDUR_E_PDU_INSTANCE_LOST to DEM if needed.\r
+ }\r
+\r
+ if (destination->TxBufferRef->TxConfP) { // No transfer confirmation pending (anymore).\r
+ uint8 val[PduInfo->SduLength];\r
+ PduInfoType NewPduInfo = {\r
+ .SduDataPtr = val,\r
+ .SduLength = PduInfo->SduLength\r
+ };\r
+ PduR_BufferDeQueue(destination->TxBufferRef, val);\r
+ PduR_BufferQueue(destination->TxBufferRef, PduInfo->SduDataPtr);\r
+ retVal = PduR_ARC_RouteTransmit(destination, &NewPduInfo);\r
+ if (retVal == E_OK) {\r
+ setTxConfP(destination->TxBufferRef);\r
+ }\r
+ }\r
+ */\r
+}\r
+\r
+void PduR_ARC_RxIndicationDirect(const PduRDestPdu_type * destination, const PduInfoType *PduInfo) {\r
+ Std_ReturnType retVal = PduR_ARC_RouteTransmit(destination, PduInfo);\r
+ if (retVal != E_OK) {\r
+#if defined(USE_DEM)\r
+ Dem_ReportErrorStatus(PDUR_E_PDU_INSTANCE_LOST, DEM_EVENT_STATUS_FAILED);\r
+#endif\r
+ }\r
+}\r
+\r
+void PduR_ARC_RxIndication(PduIdType PduId, const PduInfoType* PduInfo, uint8 serviceId) {\r
+ PDUR_VALIDATE_INITIALIZED(serviceId);\r
+ PDUR_VALIDATE_PDUPTR(serviceId, PduInfo);\r
+ PDUR_VALIDATE_PDUID(serviceId, PduId);\r
+\r
+ const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+\r
+ for (int i = 0; route->PduRDestPdus[i] != NULL; i++) {\r
+ const PduRDestPdu_type * destination = route->PduRDestPdus[i];\r
+\r
+ if (PduR_IsUpModule(destination->DestModule)) {\r
+ PduR_ARC_RouteRxIndication(destination, PduInfo);\r
+\r
+ } else if (PduR_IsLoModule(destination->DestModule)) {\r
+\r
+ if (PduR_IsTpModule(destination->DestModule)) { // TP Gateway\r
+ if (PduR_ARC_ReleaseRxBuffer(PduId) == BUFREQ_BUSY) {\r
+ // Transmit previous rx buffer\r
+ PduR_ARC_RouteTransmit(destination, PduRTpRouteBuffer(PduId)->pduInfoPtr);\r
+ }\r
+\r
+ } else if (destination->DataProvision == PDUR_TRIGGER_TRANSMIT) {\r
+ PduR_ARC_RxIndicationTT(destination, PduInfo, route->SduLength);\r
+\r
+ } else if (destination->DataProvision == PDUR_DIRECT) {\r
+ PduR_ARC_RxIndicationDirect(destination, PduInfo);\r
+\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+void PduR_ARC_TxConfirmation(PduIdType PduId, uint8 result, uint8 serviceId) {\r
+ PDUR_VALIDATE_INITIALIZED(serviceId);\r
+ PDUR_VALIDATE_PDUID(serviceId, PduId);\r
+\r
+ const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+\r
+ if (PduR_IsUpModule(route->SrcModule)) {\r
+ PduR_ARC_RouteTxConfirmation(route, result);\r
+\r
+ } else if (PduR_IsLoModule(route->SrcModule)) {\r
+ // Release any buffer hold by this route.\r
+ PduR_ARC_ReleaseTxBuffer(PduId);\r
+ }\r
+}\r
+\r
+Std_ReturnType PduR_ARC_TriggerTransmit(PduIdType PduId, PduInfoType* PduInfo, uint8 serviceId) {\r
+ PDUR_VALIDATE_INITIALIZED(serviceId, E_NOT_OK);\r
+ PDUR_VALIDATE_PDUPTR(serviceId, PduInfo, E_NOT_OK);\r
+ PDUR_VALIDATE_PDUID(serviceId, PduId, E_NOT_OK);\r
+\r
+ Std_ReturnType retVal = E_OK;\r
+ const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+ const PduRDestPdu_type * destination = route->PduRDestPdus[0];\r
+\r
+ if (PduR_IsUpModule(route->SrcModule)) {\r
+ retVal |= PduR_ARC_RouteTriggerTransmit(route, PduInfo);\r
+\r
+ } else if (PduR_IsLoModule(route->SrcModule)) {\r
+ if (destination->DataProvision == PDUR_TRIGGER_TRANSMIT) {\r
+ uint8 bytesToCopy = 0;\r
+ if (PduInfo->SduLength > route->SduLength) bytesToCopy = route->SduLength;\r
+ else bytesToCopy = PduInfo->SduLength;\r
+\r
+ if (!memcpy((void *)PduInfo->SduDataPtr, (void *)destination->TxBufferRef, bytesToCopy)) {\r
+ retVal = E_NOT_OK;\r
+ }\r
+ }\r
+ }\r
+ return retVal;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_ProvideRxBuffer(PduIdType PduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr, uint8 serviceId) {\r
+ PDUR_VALIDATE_INITIALIZED(serviceId,BUFREQ_NOT_OK);\r
+ PDUR_VALIDATE_PDUPTR(serviceId, PduInfoPtr, BUFREQ_NOT_OK);\r
+ PDUR_VALIDATE_PDUID(serviceId, PduId, BUFREQ_NOT_OK);\r
+\r
+ BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
+ const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+ const PduRDestPdu_type * destination = route->PduRDestPdus[0];\r
+\r
+ if (PduR_IsUpModule(destination->DestModule)) {\r
+ retVal = PduR_ARC_RouteProvideRxBuffer(destination, TpSduLength, PduInfoPtr);\r
+\r
+ } else if (PduR_IsLoModule(destination->DestModule)) {\r
+ if (PduR_ARC_ReleaseRxBuffer(PduId) == BUFREQ_BUSY) {\r
+ // Transmit previous rx buffer\r
+ PduR_ARC_RouteTransmit(destination, PduRTpRouteBuffer(PduId)->pduInfoPtr);\r
+ }\r
+\r
+ retVal = PduR_ARC_AllocateRxBuffer(PduId, TpSduLength);\r
+ if (retVal == BUFREQ_OK) {\r
+ *PduInfoPtr = PduRTpRouteBuffer(PduId)->pduInfoPtr;\r
+ }\r
+ }\r
+ return retVal;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_ProvideTxBuffer(PduIdType PduId, PduInfoType** PduInfoPtr, uint16 Length, uint8 serviceId) {\r
+ PDUR_VALIDATE_INITIALIZED(serviceId,BUFREQ_NOT_OK);\r
+ PDUR_VALIDATE_PDUPTR(serviceId, PduInfoPtr, BUFREQ_NOT_OK);\r
+ PDUR_VALIDATE_PDUID(serviceId, PduId, BUFREQ_NOT_OK);\r
+\r
+ BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
+ const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+\r
+ if (PduR_IsUpModule(route->SrcModule)) {\r
+ retVal = PduR_ARC_RouteProvideTxBuffer(route, Length, PduInfoPtr);\r
+\r
+ } else if (PduR_IsLoModule(route->SrcModule)) {\r
+ retVal = PduR_ARC_AllocateTxBuffer(PduId, Length);\r
+ if (retVal == BUFREQ_OK) {\r
+ *PduInfoPtr = PduRTpRouteBuffer(PduId)->pduInfoPtr;\r
+ }\r
+ }\r
+ return retVal;\r
+}\r
+\r
+\r
+\r
+#endif\r
--- /dev/null
+/* -------------------------------- 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
+#include "PduR.h"\r
+\r
+\r
+#include <string.h>\r
+#include "debug.h"\r
+#if defined(USE_DEM)\r
+#include "Dem.h"\r
+#endif\r
+\r
+\r
+#if PDUR_CANIF_SUPPORT == STD_ON\r
+#include "CanIf.h"\r
+#endif\r
+#if PDUR_CANTP_SUPPORT == STD_ON\r
+#include "CanTp.h"\r
+#endif\r
+#if PDUR_LINIF_SUPPORT == STD_ON\r
+#include "LinIf.h"\r
+#endif\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+#include "Com.h"\r
+#endif\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+#include "Dcm.h"\r
+#endif\r
+#if PDUR_SOAD_SUPPORT == STD_ON\r
+#include "SoAd.h"\r
+#endif\r
+\r
+\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+Std_ReturnType PduR_ARC_RouteTransmit(const PduRDestPdu_type * destination, const PduInfoType * pduInfo) {\r
+\r
+ switch (destination->DestModule) {\r
+ case ARC_PDUR_CANIF:\r
+#if PDUR_CANIF_SUPPORT == STD_ON\r
+ return CanIf_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+ break;\r
+ case ARC_PDUR_LINIF:\r
+#if PDUR_LINIF_SUPPORT == STD_ON\r
+ return LinIf_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+ break;\r
+ case ARC_PDUR_CANTP:\r
+#if PDUR_CANTP_SUPPORT == STD_ON\r
+ return CanTp_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+ break;\r
+ case ARC_PDUR_SOADIF:\r
+#if PDUR_SOAD_SUPPORT == STD_ON\r
+ return SoAdIf_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+ break;\r
+ case ARC_PDUR_SOADTP:\r
+#if PDUR_SOAD_SUPPORT == STD_ON\r
+ return SoAdTp_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ // TODO error reporting here.\r
+ return E_NOT_OK;\r
+}\r
+\r
+void PduR_ARC_RouteRxIndication(const PduRDestPdu_type * destination, const PduInfoType *PduInfo) {\r
+\r
+ switch (destination->DestModule) {\r
+ case ARC_PDUR_COM:\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+ Com_RxIndication(destination->DestPduId, PduInfo);\r
+#endif\r
+ break;\r
+ case ARC_PDUR_DCM:\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+ Dcm_RxIndication(destination->DestPduId, *PduInfo->SduDataPtr);\r
+#endif\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ // TODO error reporting here.\r
+}\r
+\r
+void PduR_ARC_RouteTxConfirmation(const PduRRoutingPath_type *route, uint8 result) {\r
+ switch (route->SrcModule) {\r
+ case ARC_PDUR_COM:\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+ Com_TxConfirmation(route->SrcPduId);\r
+#endif\r
+ break;\r
+ case ARC_PDUR_DCM:\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+ Dcm_TxConfirmation(route->SrcPduId, result);\r
+#endif\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ // TODO error reporting here.\r
+}\r
+\r
+Std_ReturnType PduR_ARC_RouteTriggerTransmit(const PduRRoutingPath_type *route, PduInfoType * pduInfo) {\r
+ switch (route->SrcModule) {\r
+ case ARC_PDUR_COM:\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+ return Com_TriggerTransmit(route->SrcPduId, pduInfo);\r
+#endif\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ // TODO error reporting here.\r
+ return E_NOT_OK;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_RouteProvideRxBuffer(const PduRDestPdu_type * destination, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) {\r
+ switch (destination->DestModule) {\r
+ case ARC_PDUR_DCM:\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+ return Dcm_ProvideRxBuffer(destination->DestPduId, TpSduLength, PduInfoPtr);\r
+#endif\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ // TODO error reporting here.\r
+ return BUFREQ_NOT_OK;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_RouteProvideTxBuffer(const PduRRoutingPath_type *route, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) {\r
+ switch (route->SrcModule) {\r
+ case ARC_PDUR_DCM:\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+ return Dcm_ProvideTxBuffer(route->SrcPduId, PduInfoPtr, TpSduLength);\r
+#endif\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ // TODO error reporting here.\r
+ return BUFREQ_NOT_OK;\r
+}\r
+\r
+#endif\r
--- /dev/null
+/* -------------------------------- 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
+#include "PduR.h"\r
+\r
+\r
+#include "Det.h"\r
+#include "debug.h"\r
+\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+BufReq_ReturnType PduR_SoAdTpProvideRxBuffer(PduIdType dcmRxPduId, PduLengthType sduLength, PduInfoType **pduInfoPtr) {\r
+ return PduR_ARC_ProvideRxBuffer(dcmRxPduId, sduLength, pduInfoPtr, 0x03);\r
+}\r
+\r
+void PduR_SoAdTpRxIndication(PduIdType dcmRxPduId, NotifResultType result)\r
+{\r
+ PduInfoType PduInfo = {\r
+ .SduDataPtr = &result\r
+ };\r
+ PduR_ARC_RxIndication(dcmRxPduId, &PduInfo, 0x04);\r
+}\r
+\r
+BufReq_ReturnType PduR_SoAdTpProvideTxBuffer(PduIdType dcmTxPduId, PduInfoType **pduInfoPtr, PduLengthType length)\r
+{\r
+ return PduR_ARC_ProvideTxBuffer(dcmTxPduId, pduInfoPtr, length, 0x03);\r
+}\r
+\r
+void PduR_SoAdTpTxConfirmation(PduIdType dcmTxPduId, NotifResultType Result)\r
+{\r
+ PduR_ARC_TxConfirmation(dcmTxPduId, Result, 0x0f);\r
+}\r
+\r
+\r
+/* PduR_SoAd interface API implementation */\r
+void PduR_SoAdIfRxIndication(PduIdType RxPduId, const uint8* SduPtr) {\r
+ PduInfoType PduInfo = {\r
+ .SduDataPtr = (uint8 *)SduPtr\r
+ };\r
+ PduR_ARC_RxIndication(RxPduId, &PduInfo, 0x01);\r
+}\r
+\r
+void PduR_SoAdIfTxConfirmation(PduIdType ComTxPduId) {\r
+ uint8 dummy = 0;\r
+ PduR_ARC_TxConfirmation(ComTxPduId, dummy, 0x02);\r
+}\r
+\r
+void PduR_SoAdIfTriggerTransmit(PduIdType TxPduId, uint8 *SduPtr) {\r
+ PduInfoType PduInfo = {\r
+ .SduDataPtr = SduPtr\r
+ };\r
+ PduR_ARC_TriggerTransmit(TxPduId, &PduInfo, 0x10);\r
+}\r
+\r
+#endif\r
+++ /dev/null
-\r
-\r
-#obj-y += xfls_test.o\r
-#obj-y += lin_test.o\r
-\r
-#VPATH += $(ROOTDIR)/arch/$(ARCH)/delivery/mpc5500_h7f/source\r
-#inc-y += $(ROOTDIR)/arch/$(ARCH)/delivery/mpc5500_h7f/include\r
-\r
-\r
-#linkfile\r
-#ldcmdfile-$(CFG_MPC55XX) = $(ROOTDIR)/arch/$(ARCH)/scripts/linkscript_gcc.ldf\r
-\r
-#build-exe-y = ../../../$(target)_$(ARCH).$(TE)\r
-\r
-\r
+++ /dev/null
-\r
-\r
-\r
-# Gpt\r
-obj-y += Gpt.o\r
-obj-y += Gpt_Cfg.o\r
-\r
-# Mcu\r
-obj-y += Mcu.o\r
-obj-y += Mcu_Cfg.o\r
-obj-y += Mcu_Exceptions.o\r
-\r
-# Can\r
-obj-y += Can.o\r
-obj-y += Can_Lcfg.o\r
-obj-y += CanIf.o\r
-obj-y += CanIf_Cfg.o\r
-\r
-obj-y += Dio.o\r
-obj-y += Dio_Lcfg.o\r
-\r
-obj-y += Port.o\r
-obj-y += Port_Cfg.o\r
-\r
-# Spi\r
-obj-y += Spi.o\r
-obj-y += Spi_Lcfg.o\r
-\r
-#Eep\r
-obj-y += Eep.o\r
-obj-y += Eep_Lcfg.o\r
-obj-y += Eeprom_Lcfg.o\r
-\r
-#Fls ext\r
-obj-y += Fls_SST25xx.o\r
-obj-y += Fls_SST25xx_Cfg.o\r
-\r
-# Misc\r
-obj-y += Det.o\r
-\r
-# Lin\r
-obj-y += Lin_PBcfg.o\r
-obj-y += Lin_Lcfg.o\r
-obj-y += LinIf_Lcfg.o\r
-obj-y += LinIf_PBcfg.o\r
-obj-y += LinSM_Lcfg.o\r
-obj-y += LinSM_PBcfg.o\r
-obj-y += LinSM_Cfg.o\r
-obj-y += Lin.o\r
-obj-y += LinIf.o\r
-obj-y += LinSM.o\r
-\r
-# ComM\r
-obj-y += ComM.o\r
-\r
-# Com\r
-obj-y += Com.o\r
-\r
-\r
-# Common\r
-obj-y += xtoa.o\r
-obj-y += ramlog.o\r
-VPATH += $(ROOTDIR)/common\r
-\r
-\r
-VPATH += $(ROOTDIR)/arch/$(ARCH)/kernel\r
-VPATH += $(ROOTDIR)/arch/$(ARCH)/drivers\r
-#VPATH += $(ROOTDIR)/arch/$(ARCH)/config\r
-VPATH += $(ROOTDIR)/boards/$(BOARDDIR)/config\r
-VPATH += $(ROOTDIR)/drivers\r
-VPATH += $(ROOTDIR)/drivers/config\r
-VPATH += $(ROOTDIR)/drivers/Lin\r
-VPATH += $(ROOTDIR)/drivers/ComM\r
-VPATH += $(ROOTDIR)/drivers/Com\r
-\r
-\r
-inc-y += $(ROOTDIR)/drivers/PduR\r
-inc-y += $(ROOTDIR)/drivers/Com\r
-inc-y += $(ROOTDIR)/drivers/ComM\r
-inc-y += $(ROOTDIR)/drivers/config\r
-inc-y += $(ROOTDIR)/boards/$(BOARDDIR)/config\r
-inc-y += $(ROOTDIR)/drivers/include\r
-inc-y += $(ROOTDIR)/include\r
-#inc-y += $(ROOTDIR)/arch/$(ARCH)/config\r
-inc-y += $(ROOTDIR)/arch/$(ARCH)/drivers\r
-inc-y += $(ROOTDIR)/arch/$(ARCH)/kernel\r
-\r
-inc-y += $(ROOTDIR)/embunit/embUnit\r
-inc-y += $(ROOTDIR)/embunit/textui\r
-inc-y += $(ROOTDIR)/embunit\r
-\r
-\r
-#libs needed by us\r
-libitem-y += $(ROOTDIR)/embunit/embUnit/obj_$(ARCH)/libembunit.a\r
-libitem-y += $(ROOTDIR)/embunit/textui/obj_$(ARCH)/libtextui.a\r
-\r
-#linkfile\r
-ldcmdfile-$(CFG_MPC55XX) = $(ROOTDIR)/arch/$(ARCH)/scripts/linkscript_$(COMPILER).ldf\r
-\r
-build-exe-y = ../../../$(target)_$(ARCH).$(TE)\r
-\r
-\r
\r
void ShutdownHook( StatusType Error ) {\r
LDEBUG_FPUTS("## ShutdownHook\n");\r
- while(1) ;\r
+ while(1);\r
}\r
\r
void ErrorHook( StatusType Error ) {\r
DisableAllInterrupts();\r
\r
LDEBUG_PRINTF("## ErrorHook err=%d\n",Error);\r
- while(1) ;\r
+ while(1);\r
}\r
\r
void PreTaskHook( void ) {\r
#include "debug.h"\r
\r
void OsIdle( void ) {\r
- for(;;) ;\r
+ for(;;);\r
}\r
\r
\r
*/\r
\r
-#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) )
-#error CanIf: Configuration file expected BSW module version to be 1.3.*
+#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) )\r
+#error CanIf: Configuration file expected BSW module version to be 1.3.*\r
#endif
\r
*/\r
\r
-#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )
-#error Can: Configuration file expected BSW module version to be 1.0.*
+#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )\r
+#error Can: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )
-#error Com: Configuration file expected BSW module version to be 1.1.*
+#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )\r
+#error Com: Configuration file expected BSW module version to be 1.1.*\r
#endif
\r
*/\r
\r
-#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )
-#error Com: Configuration file expected BSW module version to be 1.1.*
+#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )\r
+#error Com: Configuration file expected BSW module version to be 1.1.*\r
#endif
#ifndef COM_PBCFG_H\r
*/\r
\r
-#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) )
-#error EcuM: Configuration file expected BSW module version to be 2.0.*
+#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) )\r
+#error EcuM: Configuration file expected BSW module version to be 2.0.*\r
#endif
\r
*/\r
\r
-#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) )
-#error Os: Configuration file expected BSW module version to be 2.0.*
+#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) )\r
+#error Os: Configuration file expected BSW module version to be 2.0.*\r
#endif
\r
*/\r
\r
-#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )
-#error PduR: Configuration file expected BSW module version to be 1.0.*
+#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )\r
+#error PduR: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )
-#error PduR: Configuration file expected BSW module version to be 1.0.*
+#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )\r
+#error PduR: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )
-#error Port: Configuration file expected BSW module version to be 1.0.*
+#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )\r
+#error Port: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PWM_SW_MAJOR_VERSION == 1) && (PWM_SW_MINOR_VERSION == 0)) )
-#error Pwm: Configuration file expected BSW module version to be 1.0.*
+#if !(((PWM_SW_MAJOR_VERSION == 1) && (PWM_SW_MINOR_VERSION == 0)) )\r
+#error Pwm: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) )
-#error CanIf: Configuration file expected BSW module version to be 1.3.*
+#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) )\r
+#error CanIf: Configuration file expected BSW module version to be 1.3.*\r
#endif
\r
*/\r
\r
-#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )
-#error Can: Configuration file expected BSW module version to be 1.0.*
+#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )\r
+#error Can: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )
-#error Com: Configuration file expected BSW module version to be 1.1.*
+#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )\r
+#error Com: Configuration file expected BSW module version to be 1.1.*\r
#endif
\r
*/\r
\r
-#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )
-#error Com: Configuration file expected BSW module version to be 1.1.*
+#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )\r
+#error Com: Configuration file expected BSW module version to be 1.1.*\r
#endif
#ifndef COM_PBCFG_H\r
*/\r
\r
-#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) )
-#error EcuM: Configuration file expected BSW module version to be 2.0.*
+#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) )\r
+#error EcuM: Configuration file expected BSW module version to be 2.0.*\r
#endif
\r
*/\r
\r
-#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) )
-#error Os: Configuration file expected BSW module version to be 2.0.*
+#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) )\r
+#error Os: Configuration file expected BSW module version to be 2.0.*\r
#endif
\r
*/\r
\r
-#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )
-#error PduR: Configuration file expected BSW module version to be 1.0.*
+#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )\r
+#error PduR: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )
-#error PduR: Configuration file expected BSW module version to be 1.0.*
+#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )\r
+#error PduR: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )
-#error Port: Configuration file expected BSW module version to be 1.0.*
+#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )\r
+#error Port: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PWM_SW_MAJOR_VERSION == 1) && (PWM_SW_MINOR_VERSION == 0)) )
-#error Pwm: Configuration file expected BSW module version to be 1.0.*
+#if !(((PWM_SW_MAJOR_VERSION == 1) && (PWM_SW_MINOR_VERSION == 0)) )\r
+#error Pwm: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
\r
void ShutdownHook( StatusType Error ) {\r
LDEBUG_PRINTF("## ShutdownHook\n");\r
- while(1) ;\r
+ while(1);\r
}\r
\r
void ErrorHook( StatusType Error ) {\r
DisableAllInterrupts();\r
\r
LDEBUG_PRINTF("## ErrorHook err=%d\n",Error);\r
- while(1) ;\r
+ while(1);\r
}\r
\r
void PreTaskHook( void ) {\r
#include "debug.h"\r
\r
void OsIdle( void ) {\r
- for(;;) ;\r
+ for(;;);\r
}\r
\r
\r
*/\r
\r
-#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) )
-#error CanIf: Configuration file expected BSW module version to be 1.3.*
+#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) )\r
+#error CanIf: Configuration file expected BSW module version to be 1.3.*\r
#endif
\r
*/\r
\r
-#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )
-#error Can: Configuration file expected BSW module version to be 1.0.*
+#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )\r
+#error Can: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )
-#error Com: Configuration file expected BSW module version to be 1.1.*
+#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )\r
+#error Com: Configuration file expected BSW module version to be 1.1.*\r
#endif
\r
*/\r
\r
-#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )
-#error Com: Configuration file expected BSW module version to be 1.1.*
+#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )\r
+#error Com: Configuration file expected BSW module version to be 1.1.*\r
#endif
#ifndef COM_PBCFG_H\r
*/\r
\r
-#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) )
-#error EcuM: Configuration file expected BSW module version to be 2.0.*
+#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) )\r
+#error EcuM: Configuration file expected BSW module version to be 2.0.*\r
#endif
\r
*/\r
\r
-#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) )
-#error Os: Configuration file expected BSW module version to be 2.0.*
+#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) )\r
+#error Os: Configuration file expected BSW module version to be 2.0.*\r
#endif
\r
*/\r
\r
-#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )
-#error PduR: Configuration file expected BSW module version to be 1.0.*
+#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )\r
+#error PduR: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )
-#error PduR: Configuration file expected BSW module version to be 1.0.*
+#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )\r
+#error PduR: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )
-#error Port: Configuration file expected BSW module version to be 1.0.*
+#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )\r
+#error Port: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) )
-#error CanIf: Configuration file expected BSW module version to be 1.3.*
+#if !(((CANIF_SW_MAJOR_VERSION == 1) && (CANIF_SW_MINOR_VERSION == 3)) )\r
+#error CanIf: Configuration file expected BSW module version to be 1.3.*\r
#endif
\r
*/\r
\r
-#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )
-#error Can: Configuration file expected BSW module version to be 1.0.*
+#if !(((CAN_SW_MAJOR_VERSION == 1) && (CAN_SW_MINOR_VERSION == 0)) )\r
+#error Can: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )
-#error Com: Configuration file expected BSW module version to be 1.1.*
+#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )\r
+#error Com: Configuration file expected BSW module version to be 1.1.*\r
#endif
\r
*/\r
\r
-#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )
-#error Com: Configuration file expected BSW module version to be 1.1.*
+#if !(((COM_SW_MAJOR_VERSION == 1) && (COM_SW_MINOR_VERSION == 1)) )\r
+#error Com: Configuration file expected BSW module version to be 1.1.*\r
#endif
#ifndef COM_PBCFG_H\r
*/\r
\r
-#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) )
-#error EcuM: Configuration file expected BSW module version to be 2.0.*
+#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) )\r
+#error EcuM: Configuration file expected BSW module version to be 2.0.*\r
#endif
\r
*/\r
\r
-#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) )
-#error Os: Configuration file expected BSW module version to be 2.0.*
+#if !(((OS_SW_MAJOR_VERSION == 2) && (OS_SW_MINOR_VERSION == 0)) )\r
+#error Os: Configuration file expected BSW module version to be 2.0.*\r
#endif
\r
*/\r
\r
-#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )
-#error PduR: Configuration file expected BSW module version to be 1.0.*
+#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )\r
+#error PduR: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )
-#error PduR: Configuration file expected BSW module version to be 1.0.*
+#if !(((PDUR_SW_MAJOR_VERSION == 1) && (PDUR_SW_MINOR_VERSION == 0)) )\r
+#error PduR: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
*/\r
\r
-#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )
-#error Port: Configuration file expected BSW module version to be 1.0.*
+#if !(((PORT_SW_MAJOR_VERSION == 1) && (PORT_SW_MINOR_VERSION == 0)) )\r
+#error Port: Configuration file expected BSW module version to be 1.0.*\r
#endif
\r
/** Name of target indication services to target upper layers (PduRouter,\r
* CanNm, CanTp and ComplexDeviceDrivers). If parameter is 0 no call-out\r
* function is configured. */\r
- CanIf_FuncTypeCanSpecial CanIfUserRxIndication;\r
+ void *CanIfUserRxIndication;\r
\r
/** The HRH to which Rx L-PDU belongs to, is referred through this\r
* parameter. */\r
uint8 Com_SendSignal(Com_SignalIdType SignalId, const void *SignalDataPtr);\r
uint8 Com_ReceiveSignal(Com_SignalIdType SignalId, void* SignalDataPtr);\r
\r
-Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, uint8 *SduPtr);\r
+Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, PduInfoType *PduInfoPtr);\r
\r
void Com_TriggerIPduSend(PduIdType ComTxPduId);\r
\r
-void Com_RxIndication(PduIdType ComRxPduId, const uint8* SduPtr); // TODO: Parameter SduPtr should be const PduInfoType* PduInfoPtr\r
+void Com_RxIndication(PduIdType ComRxPduId, const PduInfoType* PduInfoPtr);\r
void Com_TxConfirmation(PduIdType ComTxPduId);\r
\r
\r
#define MODULE_ID_IPDUM (52) // IPDU Multiplexer\r
#define MODULE_ID_DCM (53) // Diagnostic Communication Manager\r
#define MODULE_ID_DEM (54) // Diagnostic Event Manager\r
+#define MODULE_ID_SOAD (56) // Socket Adaptor\r
\r
#define MODULE_ID_CANIF (60) // CAN Interface\r
#define MODULE_ID_FRIF (61) // Flexray interface\r
#ifndef PDUR_H\r
#define PDUR_H\r
\r
-#define PDUR_VENDOR_ID 1\r
+#define PDUR_VENDOR_ID 1\r
#define PDUR_AR_MAJOR_VERSION 2\r
#define PDUR_AR_MINOR_VERSION 2\r
#define PDUR_AR_PATCH_VERSION 2\r
-#define PDUR_SW_MAJOR_VERSION 1\r
+#define PDUR_SW_MAJOR_VERSION 2\r
#define PDUR_SW_MINOR_VERSION 0\r
#define PDUR_SW_PATCH_VERSION 0\r
\r
#include "PduR_Types.h"\r
#include "PduR_PbCfg.h"\r
\r
+#include "PduR_If.h"\r
#include "PduR_Com.h"\r
#include "PduR_CanIf.h"\r
#include "PduR_LinIf.h"\r
*/\r
extern PduR_StateType PduRState;\r
\r
+#define PduR_IsUpModule(_mod) ((_mod > ARC_PDUR_UP_MODULES) && (_mod < ARC_PDUR_LOIF_MODULES))\r
+#define PduR_IsIfModule(_mod) ((_mod > ARC_PDUR_LOIF_MODULES) && (_mod < ARC_PDUR_LOTP_MODULES))\r
+#define PduR_IsTpModule(_mod) ((_mod > ARC_PDUR_LOTP_MODULES) && (_mod < ARC_PDUR_END_OF_MODULES))\r
+#define PduR_IsLoModule(_mod) (PduR_IsIfModule(_mod) || PduR_IsTpModule(_mod))\r
+\r
\r
#if (PDUR_DEV_ERROR_DETECT == STD_ON)\r
\r
-#define PDUR_DET_REPORTERROR(_x,_y,_z,_q) Det_ReportError(_x,_y,_z,_q)\r
+#define PDUR_DET_REPORTERROR(_x,_y,_z,_o) Det_ReportError(_x,_y,_z,_o)\r
\r
-// Define macro for state, parameter and data pointer checks.\r
-// TODO Implement data range check if needed.\r
-#define PduR_DevCheck(PduId,PduPtr,ApiId,...) \\r
+#define PDUR_VALIDATE_INITIALIZED(_api,...) \\r
if ((PduRState == PDUR_UNINIT) || (PduRState == PDUR_REDUCED)) { \\r
- PDUR_DET_REPORTERROR(MODULE_ID_PDUR, PDUR_INSTANCE_ID, ApiId, PDUR_E_INVALID_REQUEST); \\r
+ Det_ReportError(MODULE_ID_PDUR, PDUR_INSTANCE_ID, _api, PDUR_E_INVALID_REQUEST); \\r
return __VA_ARGS__; \\r
- } \\r
- if ((PduPtr == 0) && (PDUR_DEV_ERROR_DETECT)) { \\r
- PDUR_DET_REPORTERROR(MODULE_ID_PDUR, PDUR_INSTANCE_ID, ApiId, PDUR_E_DATA_PTR_INVALID); \\r
+ }\r
+\r
+#define PDUR_VALIDATE_PDUPTR(_api, _pduPtr, ...) \\r
+ if ((_pduPtr == NULL) && (PDUR_DEV_ERROR_DETECT)) { \\r
+ Det_ReportError(MODULE_ID_PDUR, PDUR_INSTANCE_ID, _api, PDUR_E_DATA_PTR_INVALID); \\r
return __VA_ARGS__; \\r
- } \\r
- if ((PduId >= PduRConfig->PduRRoutingTable->NRoutingPaths) && PDUR_DEV_ERROR_DETECT) { \\r
- PDUR_DET_REPORTERROR(MODULE_ID_PDUR, PDUR_INSTANCE_ID, ApiId, PDUR_E_PDU_ID_INVALID); \\r
+ }\r
+\r
+#define PDUR_VALIDATE_PDUID(_api, _pduId, ...) \\r
+ if ((_pduId >= PduRConfig->NRoutingPaths) && PDUR_DEV_ERROR_DETECT) { \\r
+ Det_ReportError(MODULE_ID_PDUR, PDUR_INSTANCE_ID, _api, PDUR_E_PDU_ID_INVALID); \\r
return __VA_ARGS__; \\r
}\r
\r
\r
#else\r
-#define PDUR_DET_REPORTERROR(_x,_y,_z,_q)\r
-#define PduR_DevCheck(...)\r
+#define PDUR_DET_REPORTERROR(_x,_y,_z,_o)\r
+#define PDUR_VALIDATE_INITIALIZED(_api,...)\r
+#define PDUR_VALIDATE_PDUPTR(_api, _pduPtr, ...)\r
+#define PDUR_VALIDATE_PDUID(_api, _pduId, ...)\r
\r
#endif\r
\r
/*\r
* Macros\r
*/\r
-#define setTxConfP(R) (R->PduRDestPdu.TxBufferRef->TxConfP = 1)\r
-#define clearTxConfP(R) (R->PduRDestPdu.TxBufferRef->TxConfP = 0)\r
+#define setTxConfP(_B) (_B->TxConfP = 1)\r
+#define clearTxConfP(_B) (_B->TxConfP = 0)\r
\r
#endif\r
\r
-extern PduR_FctPtrType PduR_StdCanFctPtrs;\r
-extern PduR_FctPtrType PduR_StdLinFctPtrs;\r
-\r
#endif /* PDUR_H */\r
\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
- void PduR_CanIfRxIndication (PduIdType CanRxPduId, const uint8 *CanSduPtr );\r
- void PduR_CanIfTxConfirmation(PduIdType CanTxPduId);\r
-\r
-#else // Zero cost operation active\r
-\r
- #if (PDUR_COM_SUPPORT == STD_ON)\r
-\r
- #include "Com_Com.h"\r
-\r
- #define PduR_CanIfRxIndication Com_RxIndication\r
- #define PduR_CanIfTxConfirmation Com_TxConfirmation\r
-\r
- #else\r
-\r
- #define PduR_CanIfRxIndication(... )\r
- #define PduR_CanIfTxConfirmation(...)\r
-\r
- #endif\r
-\r
-#endif // Zero cost operation active\r
+void PduR_CanIfRxIndication(PduIdType CanRxPduId,const PduInfoType* PduInfoPtr);\r
+void PduR_CanIfTxConfirmation(PduIdType CanTxPduId);\r
\r
+#endif\r
\r
#endif /* PDUR_CANIF_H_ */\r
\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\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
- #if (PDUR_DCM_SUPPORT == STD_ON)\r
-\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(...)\r
- #define PduR_CanTpRxIndication(...)\r
- #define PduR_CanTpProvideTxBuffer(...)\r
- #define PduR_CanTpTxConfirmation(...)\r
-\r
- #endif\r
-\r
-#endif // Zero cost operation active\r
+#endif\r
\r
#endif /* PDUR_CANTP_H_ */\r
\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
- Std_ReturnType PduR_ComTransmit(PduIdType ComTxPduId, const PduInfoType* PduInfoPtr);\r
+Std_ReturnType PduR_ComTransmit(PduIdType ComTxPduId, const PduInfoType* PduInfoPtr);\r
\r
-#else // Zero cost operation active\r
-\r
- #if (PDUR_CANIF_SUPPORT == STD_ON)\r
-\r
- #include "CanIf.h"\r
-\r
- #define PduR_ComTransmit CanIf_Transmit\r
-\r
- #else\r
-\r
- #define PduR_ComTransmit(... ) (E_OK)\r
-\r
- #endif\r
-\r
-#endif // Zero cost operation active\r
+#endif\r
\r
#endif /* PDUR_COM_H_ */\r
\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
- Std_ReturnType PduR_DcmTransmit(PduIdType DcmTxPduId, const PduInfoType* PduInfoPtr);\r
-\r
-#else // Zero cost operation active\r
-\r
- #if (PDUR_CANTP_SUPPORT == STD_ON)\r
-\r
- #include "CanTp.h"\r
-\r
- #define PduR_DcmTransmit CanTp_Transmit\r
-\r
- #else\r
-\r
- #define PduR_DcmTransmit(... ) E_OK\r
-\r
- #endif\r
-\r
-#endif // Zero cost operation active\r
+Std_ReturnType PduR_DcmTransmit(PduIdType DcmTxPduId, const PduInfoType* PduInfoPtr);\r
\r
+#endif\r
\r
#endif /*PDUR_DCM_H_*/\r
\r
\r
\r
\r
-\r
-\r
-\r
-\r
#ifndef PDUR_IF_H_\r
#define PDUR_IF_H_\r
\r
#include "PduR.h"\r
#include "Det.h"\r
\r
-void PduR_LoIfRxIndication(PduIdType PduId, const uint8* SduPtr);\r
-void PduR_LoIfTxConfirmation(PduIdType PduId);\r
-void PduR_LoIfTriggerTransmit(PduIdType PduId, uint8* SduPtr);\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+Std_ReturnType PduR_ARC_RouteTransmit(const PduRDestPdu_type * destination, const PduInfoType * PduInfo);\r
+void PduR_ARC_RouteRxIndication(const PduRDestPdu_type * destination, const PduInfoType *PduInfo);\r
+void PduR_ARC_RouteTxConfirmation(const PduRRoutingPath_type *route, uint8 result);\r
+Std_ReturnType PduR_ARC_RouteTriggerTransmit(const PduRRoutingPath_type *route, PduInfoType * PduInfo);\r
+BufReq_ReturnType PduR_ARC_RouteProvideRxBuffer(const PduRDestPdu_type * destination, PduLengthType TpSduLength, PduInfoType** PduInfoPtr);\r
+BufReq_ReturnType PduR_ARC_RouteProvideTxBuffer(const PduRRoutingPath_type *route, PduLengthType TpSduLength, PduInfoType** PduInfoPtr);\r
+\r
+\r
+Std_ReturnType PduR_ARC_Transmit(PduIdType PduId, const PduInfoType* PduInfo, uint8 serviceId);\r
+void PduR_ARC_RxIndication(PduIdType PduId, const PduInfoType* PduInfo, uint8 serviceId);\r
+void PduR_ARC_TxConfirmation(PduIdType PduId, uint8 result, uint8 serviceId);\r
+Std_ReturnType PduR_ARC_TriggerTransmit(PduIdType PduId, PduInfoType* PduInfo, uint8 serviceId);\r
+BufReq_ReturnType PduR_ARC_ProvideRxBuffer(PduIdType PduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr, uint8 serviceId);\r
+BufReq_ReturnType PduR_ARC_ProvideTxBuffer(PduIdType PduId, PduInfoType** PduInfoPtr, uint16 Length, uint8 serviceId);\r
+\r
+#endif\r
\r
#endif /* PDUR_IF_H_ */\r
\r
#include "PduR.h"\r
\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
\r
- void PduR_LinIfRxIndication(PduIdType LinRxPduId,const uint8* LinSduPtr);\r
- void PduR_LinIfTxConfirmation(PduIdType LinTxPduId);\r
- void PduR_LinIfTriggerTransmit(PduIdType LinTxPduId,uint8* LinSduPtr);\r
+void PduR_LinIfRxIndication(PduIdType LinRxPduId,const PduInfoType* PduInfoPtr);\r
+void PduR_LinIfTxConfirmation(PduIdType LinTxPduId);\r
+Std_ReturnType PduR_LinIfTriggerTransmit(PduIdType LinTxPduId,PduInfoType* PduInfoPtr);\r
\r
-#else // Zero cost operation active\r
-\r
- #if (PDUR_LINIF_SUPPORT == STD_ON)\r
-\r
- #define PduR_LinIfRxIndication Com_RxIndication\r
- #define PduR_LinIfTxConfirmation Com_TxConfirmation\r
- #define PduR_LinIfTriggerTransmit Com_TriggerTransmit\r
-\r
- #else\r
-\r
- #define PduR_LinIfRxIndication(...)\r
- #define PduR_LinIfTxConfirmation(...)\r
- #define PduR_LinIfTriggerTransmit(...)\r
-\r
- #endif\r
-\r
-#endif // Zero cost operation active\r
+#endif\r
\r
#endif /*PDUR_LINIF_H_*/\r
--- /dev/null
+/* -------------------------------- 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
+#ifndef PDUR_SOAD_H_\r
+#define PDUR_SOAD_H_\r
+\r
+#include "PduR.h"\r
+\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+/* SoAd acts as transport protocol module */\r
+BufReq_ReturnType PduR_SoAdTpProvideRxBuffer(PduIdType dcmRxPduId, PduLengthType sduLength, PduInfoType **pduInfoPtr);\r
+void PduR_SoAdTpRxIndication(PduIdType dcmRxPduId, NotifResultType result);\r
+BufReq_ReturnType PduR_SoAdTpProvideTxBuffer(PduIdType dcmTxPduId, PduInfoType **pduInfoPtr, PduLengthType length);\r
+void PduR_SoAdTpTxConfirmation(PduIdType dcmTxPduId, NotifResultType result);\r
+\r
+/* SoAd acts as interface module */\r
+void PduR_SoAdIfRxIndication(PduIdType RxPduId, const uint8* SduPtr);\r
+void PduR_SoAdIfTxConfirmation(PduIdType ComTxPduId);\r
+void PduR_SoAdIfTriggerTransmit(PduIdType TxPduId, uint8 *SduPtr);\r
+\r
+#endif\r
+\r
+#endif /* PDUR_SOAD_H_ */\r
\r
#include "ComStack_Types.h"\r
\r
+typedef enum {\r
+ ARC_PDUR_UP_MODULES = 0,\r
+ ARC_PDUR_COM,\r
+ ARC_PDUR_DCM,\r
+\r
+ ARC_PDUR_LOIF_MODULES,\r
+ ARC_PDUR_CANIF,\r
+ ARC_PDUR_LINIF,\r
+ ARC_PDUR_SOADIF,\r
+\r
+ ARC_PDUR_LOTP_MODULES,\r
+ ARC_PDUR_CANTP,\r
+ ARC_PDUR_LINTP,\r
+ ARC_PDUR_SOADTP,\r
+ ARC_PDUR_SOAD,\r
+\r
+ ARC_PDUR_END_OF_MODULES\r
+\r
+} ARC_PduR_ModuleType;\r
+\r
/** PduR_StateType defines the states of which the PDU router can be in */\r
typedef enum {\r
PDUR_UNINIT, /**< PDU Router is not initialized. */\r
PDUR_DIRECT /**< Data provision type. */\r
} PduR_DataProvisionType;\r
\r
-\r
-\r
-\r
-/* ################ NEW DEFINITIONS ################### */\r
+/*\r
typedef struct {\r
- Std_ReturnType (*TargetIndicationFctPtr)(PduIdType pduId, const uint8* data); /**< Pointer to target function in layer above PDU router. */\r
- Std_ReturnType (*TargetTransmitFctPtr)(PduIdType pduId, const PduInfoType* pduInfo); /**< Pointer to target function below PDU router. */\r
-\r
-\r
- void (*TargetConfirmationFctPtr)(PduIdType pduId);\r
-\r
- /**\r
- * Target function for trigger transmit requests from the interface modules, e.g. Com_TriggerTransmit. Only\r
- * needed if gateway mode is not used, that is, if .DataProvision is set to PDUR_NO_PROVISION.\r
- */\r
- Std_ReturnType (*TargetTriggerTransmitFctPtr)(PduIdType pduId, uint8* data);\r
-\r
\r
- Std_ReturnType (*TargetGatewayFctPtr)(PduIdType pduId, const PduInfoType* pduInfo);\r
-\r
-} PduR_FctPtrType;\r
-\r
-typedef struct {\r
- /*\r
- * Not part of autosar standard. Added by ArcCore.\r
- */\r
uint16 BufferId;\r
PduR_DataProvisionType BufferType;\r
//uint8 SduLength;\r
// uint8 TxIdx; // This is the same as First, hence left out.\r
uint8 *Buffer;\r
\r
- /**\r
- * Depth of buffer\r
- */\r
+\r
uint8 Depth;\r
\r
- /**\r
- * Length of buffer\r
- */\r
uint8 Length;\r
\r
} PduRTxBuffer_type;\r
+*/\r
+typedef uint8 *PduRTxBuffer_type;\r
\r
-typedef struct {\r
- /**\r
- * The maximum numbers of Tx buffers.\r
- */\r
- uint16 PduRMaxTxBufferNumber; // ???\r
-\r
- PduRTxBuffer_type PduRTxBuffer[];\r
-} PduRTxBufferTable_type;\r
+typedef enum {\r
+ PDUR_BUFFER_FREE = 0,\r
+ PDUR_BUFFER_RX_BUSY,\r
+ PDUR_BUFFER_TX_READY,\r
+ PDUR_BUFFER_TX_BUSY\r
+} PduRTpBufferStatus_type;\r
\r
typedef struct {\r
- /**\r
- * PDU identifier assigned by the PDU router.\r
- */\r
- uint16 SrcPduId;\r
-\r
- /**\r
- * Reference to unique PDU identifier.\r
- */\r
- // SrcPduRef\r
-\r
-} PduRSrcPdu_type;\r
+ PduInfoType *pduInfoPtr;\r
+ PduRTpBufferStatus_type status;\r
+} PduRTpBufferInfo_type;\r
\r
typedef struct {\r
\r
/**\r
* Data provision mode for this PDU.\r
*/\r
- PduR_DataProvisionType DataProvision;\r
+ const PduR_DataProvisionType DataProvision;\r
\r
/**\r
* Reference to unique PDU identifier which shall\r
* be used by the PDU router instead of the source identifier.\r
*/\r
- //DestPduRef\r
- // For the moment replaced by this\r
- uint16 DestPduId;\r
+ const uint16 DestPduId;\r
\r
/**\r
* Reference to the assigned Tx buffer.\r
*\r
* Comment: Only required for non-TP gateway PDUs.\r
*/\r
- PduRTxBuffer_type *TxBufferRef;\r
+ PduRTxBuffer_type * const TxBufferRef;\r
+\r
+ const ARC_PduR_ModuleType DestModule;\r
\r
} PduRDestPdu_type;\r
\r
} PduRDefaultValue_type;\r
\r
typedef struct {\r
- /**\r
- * Not part of standard\r
- */\r
- PduR_FctPtrType FctPtrs;\r
- uint8 PduR_Arc_EOL;\r
- uint8 PduR_GatewayMode;\r
-\r
/**\r
* Length of PDU data.\r
*\r
* Comment: Only required if a TX buffer is configured.\r
*/\r
- uint8 SduLength;\r
+ const uint8 SduLength;\r
\r
/**\r
* Chunk size for routing on the fly.\r
PduRDefaultValue_type PduRDefaultValue;\r
\r
/**\r
- * Specifies the source of the PDU to be routed.\r
+ * Specifies the source ID of the PDU to be routed.\r
*/\r
- PduRSrcPdu_type PduRSrcPdu;\r
+ const uint16 SrcPduId;\r
\r
/**\r
- * Specifies the destination(s) of the PDU to be routed.\r
- *\r
- * Comment: Multicast (many destinations) is not supported in this implementation.\r
- */\r
- PduRDestPdu_type PduRDestPdu;\r
-\r
-} PduRRoutingPath_type;\r
-\r
-typedef struct {\r
- /*\r
- * Non-standards\r
+ * Specifies the source module for this route.
*/\r
- uint16 NRoutingPaths;\r
+ const ARC_PduR_ModuleType SrcModule;\r
\r
/**\r
- * References to the routing paths defined for this configuration.\r
+ * Specifies the destination(s) of the PDU to be routed.\r
*/\r
- PduRRoutingPath_type PduRRoutingPath[];\r
-\r
-} PduRRoutingTable_type;\r
+ const PduRDestPdu_type * const *PduRDestPdus;\r
\r
+} PduRRoutingPath_type;\r
\r
typedef struct {\r
/**\r
*/\r
uint8 PduRConfigurationId;\r
\r
- /**\r
- * The routing table of this PDU router configuration.\r
- */\r
- PduRRoutingTable_type *PduRRoutingTable;\r
-\r
+ uint8 NRoutingPaths;\r
\r
/**\r
- * The buffers used for TP gateway operation.\r
- *\r
- * Comment: Not implemented in this version.\r
+ * The routing table of this PDU router configuration.\r
*/\r
- //PduRTpBufferTable_type PduRTpBufferTable;\r
+ const PduRRoutingPath_type * const*RoutingPaths;\r
\r
- /**\r
- * The buffers used for non-TP gateway operation.\r
- */\r
- PduRTxBufferTable_type *PduRTxBufferTable;\r
+ PduRTpBufferInfo_type *TpBuffers;\r
+ PduRTpBufferInfo_type **TpRouteBuffers;\r
\r
} PduR_PBConfigType;\r
\r
\r
LDOUT = -o $@\r
TE = elf\r
-LDFLAGS += -Map $(subst .$(TE),.map, $@)\r
+\r
+# Don't use a map file if we are compiling for native target.\r
+ifneq ($(CROSS_COMPILE),) \r
+LDFLAGS += -Map $(subst .$(TE),.map, $@) \r
+endif\r
+\r
+\r
\r
libitem-y += $(libitem-yy)\r
\r
clean: FORCE\r
@echo\r
@echo " >> Cleaning $(CURDIR)"\r
- $(Q)-rm -f *.o *.d *.h *.elf *.a *.ldp *.lcf *.tmp *.s *.c *.map\r
+ $(Q)-rm -f *.o *.d *.h *.elf *.a *.ldp *.lcf *.tmp *.s *.c *.map *.out\r
@echo\r
\r
.PHONY config: \r