From 0c99e4a2b1f7fb118fd7adef111fee9086d661fc Mon Sep 17 00:00:00 2001 From: maek Date: Wed, 18 May 2011 19:41:27 +0200 Subject: [PATCH] Starting 'pdur2' branch with copied content from remote repository. --- boards/board_common.mk | 5 +- communication/Com/Com_Com.c | 10 +- communication/PduR/PduR.c | 84 +++--- communication/PduR/PduR_CanIf.c | 34 +-- communication/PduR/PduR_CanTp.c | 47 +--- communication/PduR/PduR_Com.c | 20 +- communication/PduR/PduR_Dcm.c | 20 +- communication/PduR/PduR_If.c | 247 ------------------ communication/PduR/PduR_LinIf.c | 43 +-- communication/PduR/makefile | 15 -- communication/PduR/test/makefile | 102 -------- examples/pwm_node2/Hooks.c | 4 +- examples/pwm_node2/Tasks.c | 2 +- .../config/hcs12x_elmicro_tboard/CanIf_Cfg.h | 4 +- .../config/hcs12x_elmicro_tboard/Can_Cfg.h | 4 +- .../config/hcs12x_elmicro_tboard/Com_Cfg.h | 4 +- .../config/hcs12x_elmicro_tboard/Com_PbCfg.h | 4 +- .../config/hcs12x_elmicro_tboard/EcuM_Cfg.h | 4 +- .../config/hcs12x_elmicro_tboard/Os_Cfg.h | 4 +- .../config/hcs12x_elmicro_tboard/PduR_Cfg.h | 4 +- .../config/hcs12x_elmicro_tboard/PduR_PbCfg.h | 4 +- .../config/hcs12x_elmicro_tboard/Port_Cfg.h | 4 +- .../config/hcs12x_elmicro_tboard/Pwm_Cfg.h | 4 +- .../pwm_node2/config/mpc5516it/CanIf_Cfg.h | 4 +- examples/pwm_node2/config/mpc5516it/Can_Cfg.h | 4 +- examples/pwm_node2/config/mpc5516it/Com_Cfg.h | 4 +- .../pwm_node2/config/mpc5516it/Com_PbCfg.h | 4 +- .../pwm_node2/config/mpc5516it/EcuM_Cfg.h | 4 +- examples/pwm_node2/config/mpc5516it/Os_Cfg.h | 4 +- .../pwm_node2/config/mpc5516it/PduR_Cfg.h | 4 +- .../pwm_node2/config/mpc5516it/PduR_PbCfg.h | 4 +- .../pwm_node2/config/mpc5516it/Port_Cfg.h | 4 +- examples/pwm_node2/config/mpc5516it/Pwm_Cfg.h | 4 +- examples/switch_node/Hooks.c | 4 +- examples/switch_node/Tasks.c | 2 +- .../switch_node/config/mpc5516it/CanIf_Cfg.h | 4 +- .../switch_node/config/mpc5516it/Can_Cfg.h | 4 +- .../switch_node/config/mpc5516it/Com_Cfg.h | 4 +- .../switch_node/config/mpc5516it/Com_PbCfg.h | 4 +- .../switch_node/config/mpc5516it/EcuM_Cfg.h | 4 +- .../switch_node/config/mpc5516it/Os_Cfg.h | 4 +- .../switch_node/config/mpc5516it/PduR_Cfg.h | 4 +- .../switch_node/config/mpc5516it/PduR_PbCfg.h | 4 +- .../switch_node/config/mpc5516it/Port_Cfg.h | 4 +- .../config/mpc5567qrtech/CanIf_Cfg.h | 4 +- .../config/mpc5567qrtech/Can_Cfg.h | 4 +- .../config/mpc5567qrtech/Com_Cfg.h | 4 +- .../config/mpc5567qrtech/Com_PbCfg.h | 4 +- .../config/mpc5567qrtech/EcuM_Cfg.h | 4 +- .../switch_node/config/mpc5567qrtech/Os_Cfg.h | 4 +- .../config/mpc5567qrtech/PduR_Cfg.h | 4 +- .../config/mpc5567qrtech/PduR_PbCfg.h | 4 +- .../config/mpc5567qrtech/Port_Cfg.h | 4 +- include/CanIf_ConfigTypes.h | 2 +- include/Com_Com.h | 4 +- include/Modules.h | 1 + include/PduR.h | 45 ++-- include/PduR_CanIf.h | 25 +- include/PduR_CanTp.h | 32 +-- include/PduR_Com.h | 20 +- include/PduR_Dcm.h | 21 +- include/PduR_If.h | 25 +- include/PduR_LinIf.h | 26 +- include/PduR_Types.h | 144 ++++------ 64 files changed, 270 insertions(+), 866 deletions(-) delete mode 100644 communication/PduR/PduR_If.c delete mode 100644 communication/PduR/makefile delete mode 100644 communication/PduR/test/makefile diff --git a/boards/board_common.mk b/boards/board_common.mk index 1431945c..8fffe42f 100644 --- a/boards/board_common.mk +++ b/boards/board_common.mk @@ -3,7 +3,6 @@ _BOARD_COMMON_MK:=y # Include guard for backwards compatability obj-$(CFG_PPC) += crt0.o obj-$(CFG_HC1X) += crt0.o - vpath-$(CFG_ARM_CM3) += $(ROOTDIR)/$(ARCH_PATH-y)/kernel vpath-$(CFG_ARM_CM3) += $(ROOTDIR)/$(ARCH_PATH-y)/drivers/STM32F10x_StdPeriph_Driver/src vpath-$(CFG_ARM_CM3) += $(ROOTDIR)/$(ARCH_PATH-y)/drivers/STM32_ETH_Driver/src @@ -196,12 +195,14 @@ vpath-$(USE_COM) += $(ROOTDIR)/communication/Com # PduR obj-$(USE_PDUR) += PduR_Com.o -obj-$(USE_PDUR) += PduR_If.o +obj-$(USE_PDUR) += PduR_Logic.o obj-$(USE_PDUR) += PduR_LinIf.o obj-$(USE_PDUR) += PduR_PbCfg.o obj-$(USE_PDUR) += PduR_CanIf.o obj-$(USE_PDUR) += PduR_CanTp.o obj-$(USE_PDUR) += PduR_Dcm.o +obj-$(USE_PDUR) += PduR_SoAd.o +obj-$(USE_PDUR) += PduR_Routing.o obj-$(USE_PDUR) += PduR.o inc-$(USE_PDUR) += $(ROOTDIR)/communication/PduR inc-$(USE_COM) += $(ROOTDIR)/communication/PduR diff --git a/communication/Com/Com_Com.c b/communication/Com/Com_Com.c index c58676c4..94e101d7 100644 --- a/communication/Com/Com_Com.c +++ b/communication/Com/Com_Com.c @@ -72,7 +72,7 @@ uint8 Com_ReceiveSignal(Com_SignalIdType SignalId, void* SignalDataPtr) { return E_OK; } -Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, uint8 *SduPtr) { +Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, PduInfoType *PduInfoPtr) { PDU_ID_CHECK(ComTxPduId, 0x13, E_NOT_OK); /* * COM260: This function must not check the transmission mode of the I-PDU @@ -85,7 +85,7 @@ Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, uint8 *SduPtr) { const ComIPdu_type *IPdu = GET_IPdu(ComTxPduId); Com_Arc_IPdu_type *Arc_IPdu = GET_ArcIPdu(ComTxPduId); - memcpy(SduPtr, Arc_IPdu->ComIPduDataPtr, IPdu->ComIPduSize); + memcpy(PduInfoPtr->SduDataPtr, Arc_IPdu->ComIPduDataPtr, IPdu->ComIPduSize); return E_OK; } @@ -144,7 +144,7 @@ void Com_TriggerIPduSend(PduIdType ComTxPduId) { } //lint -esym(904, Com_RxIndication) //PC-Lint Exception of rule 14.7 -void Com_RxIndication(PduIdType ComRxPduId, const uint8* SduPtr) { +void Com_RxIndication(PduIdType ComRxPduId, const PduInfoType* PduInfoPtr) { PDU_ID_CHECK(ComRxPduId, 0x14); const ComIPdu_type *IPdu = GET_IPdu(ComRxPduId); @@ -157,7 +157,7 @@ void Com_RxIndication(PduIdType ComRxPduId, const uint8* SduPtr) { // Check callout status if (IPdu->ComIPduCallout != NULL) { - if (!IPdu->ComIPduCallout(ComRxPduId, SduPtr)) { + if (!IPdu->ComIPduCallout(ComRxPduId, PduInfoPtr)) { // TODO Report error to DET. // Det_ReportError(); return; @@ -165,7 +165,7 @@ void Com_RxIndication(PduIdType ComRxPduId, const uint8* SduPtr) { } // Copy IPDU data - memcpy(Arc_IPdu->ComIPduDataPtr, SduPtr, IPdu->ComIPduSize); + memcpy(Arc_IPdu->ComIPduDataPtr, PduInfoPtr->SduDataPtr, IPdu->ComIPduSize); // For each signal. const ComSignal_type *comSignal; diff --git a/communication/PduR/PduR.c b/communication/PduR/PduR.c index 9a5ed58c..c4fd6091 100644 --- a/communication/PduR/PduR.c +++ b/communication/PduR/PduR.c @@ -33,20 +33,19 @@ #include "McuExtensions.h" #include "debug.h" - /* * The state of the PDU router. */ PduR_StateType PduRState = PDUR_UNINIT; // 960, 31 PC-Lint: Borde åtgärdas -const PduR_PBConfigType * PduRConfig; - -/* ############### Zero Cost Operation Mode ############# */ -/* Only define the following functions if zero cost operation - * mode is not used! They are defined as macros in PduR.h otherwise. */ #if PDUR_ZERO_COST_OPERATION == STD_OFF + + +const PduR_PBConfigType * PduRConfig; + + /* * Initializes the PDU Router. */ @@ -75,50 +74,40 @@ void PduR_Init (const PduR_PBConfigType* ConfigPtr) { uint8 failed = 0; // Initialize buffers. + /* uint16 bufferNr = 0; - PduRRoutingPath_type *path; - PduRConfig->PduRRoutingTable->NRoutingPaths = 0; - for (uint16 i = 0; (!PduRConfig->PduRRoutingTable->PduRRoutingPath[i].PduR_Arc_EOL) && (!failed); i++) { - PduRConfig->PduRRoutingTable->NRoutingPaths++; - path = &PduRConfig->PduRRoutingTable->PduRRoutingPath[i]; - - if (path->PduRDestPdu.DataProvision != PDUR_NO_PROVISION) { - // Allocate memory for new buffer. - PduRTxBuffer_type *buffer = path->PduRDestPdu.TxBufferRef; - - if (bufferNr >= PDUR_MAX_TX_BUFFER_NUMBER) { - 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"); - failed = 1; - break; - } - // 586 PC-Lint (malloc) ticket #135 - if ((buffer->Buffer = (uint8 *)malloc(buffer->Depth * sizeof(uint8) * path->SduLength)) == 0) { - DEBUG(DEBUG_LOW,"PduR_Init: Initialization of buffer failed. Buffer space could not be allocated for buffer number %d\n", bufferNr); - failed = 1; - break; - } + for (uint16 i = 0; PduRConfig->RoutingPaths[i] != NULL && (!failed); i++) { + const PduRRoutingPath_type *path = PduRConfig->RoutingPaths[i]; - buffer->First = buffer->Buffer; - buffer->Last = buffer->Buffer; + for (uint8 j = 0; path->PduRDestPdus[j] != NULL; j++) { + const PduRDestPdu_type *destination = path->PduRDestPdus[j]; - // Initialize the new buffer. - buffer->BufferId = i; // Set buffer id. - buffer->BufferType = path->PduRDestPdu.DataProvision; // Set buffer data provision mode. - buffer->Length = path->SduLength; // Set buffer sdu length. + if (destination->DataProvision == PDUR_TRIGGER_TRANSMIT) { + // Allocate memory for new buffer. - if (path->PduRDestPdu.DataProvision == PDUR_TRIGGER_TRANSMIT) { - //memcpy(buffer->First, path->PduRDefaultValue.PduRDefaultValueElement->DefaultValueElement,path->SduLength); - PduR_BufferQueue(buffer, path->PduRDefaultValue.PduRDefaultValueElement->DefaultValueElement); - } - // Save pointer to the new buffer. - //PduR_RTable_LoIf.RoutingTable[i].TxBufferRef = &PduRBuffers[bufferNr]; + // Initialize the new buffer. + buffer->BufferId = i; // Set buffer id. + buffer->BufferType = destination->DataProvision; // Set buffer data provision mode. + buffer->Length = path->SduLength; // Set buffer sdu length. + + if (destination->DataProvision == PDUR_TRIGGER_TRANSMIT) { + //memcpy(buffer->First, path->PduRDefaultValue.PduRDefaultValueElement->DefaultValueElement,path->SduLength); + PduR_BufferQueue(buffer, path->PduRDefaultValue.PduRDefaultValueElement->DefaultValueElement); + } + + // Save pointer to the new buffer. + //PduR_RTable_LoIf.RoutingTable[i].TxBufferRef = &PduRBuffers[bufferNr]; + + DEBUG(DEBUG_LOW,"Initialized buffer %d. Id: %d, Type: %d, Depth: %d\n", bufferNr, buffer->BufferId, buffer->BufferType, buffer->Depth); + bufferNr++; + + } - DEBUG(DEBUG_LOW,"Initialized buffer %d. Id: %d, Type: %d, Depth: %d\n", bufferNr, buffer->BufferId, buffer->BufferType, buffer->Depth); - bufferNr++; } } + */ if (failed) { // TODO Report PDUR_E_INIT_FAILED to Dem. @@ -134,6 +123,7 @@ void PduR_Init (const PduR_PBConfigType* ConfigPtr) { } } +/* void PduR_BufferInc(PduRTxBuffer_type *Buffer, uint8 **ptr) { (*ptr) = (*ptr) + Buffer->Length; @@ -142,7 +132,7 @@ void PduR_BufferInc(PduRTxBuffer_type *Buffer, uint8 **ptr) { if ( *ptr >= ( Buffer->Buffer + (Buffer->Depth * Buffer->Length) ) ) { *ptr = Buffer->Buffer; } - //*val = (*val + 1) % Buffer->Depth; + // *val = (*val + 1) % Buffer->Depth; } void PduR_BufferQueue(PduRTxBuffer_type *Buffer, const uint8 * SduPtr) { @@ -201,6 +191,8 @@ uint8 PduR_BufferIsFull(PduRTxBuffer_type *Buffer) { McuE_ExitCriticalSection(state); return rv; } +*/ + #if PDUR_VERSION_INFO_API == STD_ON @@ -216,17 +208,15 @@ uint32 PduR_GetConfigurationId (void) { //PduR_DevCheck(0,1,0x18,E_NOT_OK); return PduRConfig->PduRConfigurationId; } -#endif // End of not Zero Cost Operation Mode Std_ReturnType PduR_CancelTransmitRequest(PduR_CancelReasonType PduCancelReason, PduIdType PduId) { // TODO Implement! - (void)PduCancelReason; - (void)PduId; return E_NOT_OK; } void PduR_ChangeParameterRequest(PduR_ParameterValueType PduParameterValue, PduIdType PduId) { // TODO Implement! - (void)PduParameterValue; - (void)PduId; + } + +#endif diff --git a/communication/PduR/PduR_CanIf.c b/communication/PduR/PduR_CanIf.c index 513aa64a..cd596c28 100644 --- a/communication/PduR/PduR_CanIf.c +++ b/communication/PduR/PduR_CanIf.c @@ -14,41 +14,17 @@ * -------------------------------- Arctic Core ------------------------------*/ - - - - #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) - -#include "Det.h" -#include "debug.h" - -void PduR_CanIfRxIndication(PduIdType CanRxPduId,const uint8* CanSduPtr) { -#if (PDUR_CANIF_SUPPORT == STD_ON) - PduR_DevCheck(CanRxPduId,CanSduPtr,0x0e); - - DEBUG(DEBUG_LOW,"----------------------\n"); - DEBUG(DEBUG_LOW,"PduR_CanIfRxIndication: received indication with id %d and data %d\n", CanRxPduId, *CanSduPtr); +#if PDUR_ZERO_COST_OPERATION == STD_OFF - PduR_LoIfRxIndication(CanRxPduId, CanSduPtr); - - DEBUG(DEBUG_LOW,"----------------------\n"); -#endif +void PduR_CanIfRxIndication(PduIdType CanRxPduId,const PduInfoType* PduInfoPtr) { + PduR_ARC_RxIndication(CanRxPduId, PduInfoPtr, 0x01); } void PduR_CanIfTxConfirmation(PduIdType CanTxPduId) { -#if (PDUR_CANIF_SUPPORT == STD_ON) - PduR_DevCheck(CanTxPduId,1,0x0f); - - DEBUG(DEBUG_LOW,"----------------------\n"); - DEBUG(DEBUG_LOW,"PduR_CanIfTxConfirmation: received confirmation with id %d\n", CanTxPduId); - - PduR_LoIfTxConfirmation(CanTxPduId); - - DEBUG(DEBUG_LOW,"----------------------\n"); -#endif + uint8 dummy = 0; + PduR_ARC_TxConfirmation(CanTxPduId,dummy,0x02); } #endif diff --git a/communication/PduR/PduR_CanTp.c b/communication/PduR/PduR_CanTp.c index 3e8a15fa..b197dd03 100644 --- a/communication/PduR/PduR_CanTp.c +++ b/communication/PduR/PduR_CanTp.c @@ -15,62 +15,31 @@ #include "PduR.h" - -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) #include "Det.h" #include "debug.h" +#if PDUR_ZERO_COST_OPERATION == STD_OFF BufReq_ReturnType PduR_CanTpProvideRxBuffer(PduIdType CanTpRxPduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) { - BufReq_ReturnType retVal = BUFREQ_NOT_OK; -#if (PDUR_CANTP_SUPPORT == STD_ON) - /* Gateway and multicast modes not supported. */ - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpRxPduId]; - retVal = Dcm_ProvideRxBuffer(route->PduRDestPdu.DestPduId, TpSduLength, PduInfoPtr); -#endif - return retVal; + return PduR_ARC_ProvideRxBuffer(CanTpRxPduId, TpSduLength, PduInfoPtr, 0x03); } void PduR_CanTpRxIndication(PduIdType CanTpRxPduId, NotifResultType Result) { -#if (PDUR_CANTP_SUPPORT == STD_ON) - - DEBUG(DEBUG_LOW,"----------------------\n"); - DEBUG(DEBUG_LOW,"PduR_CanTpRxIndication: received indication with id %d and data %d\n", CanTpRxPduId); - - /* Note that there is no support for CAN TP and gateway operation mode */ - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpRxPduId]; - Dcm_RxIndication(route->PduRDestPdu.DestPduId, Result); // Send PDU to next receptor. - - DEBUG(DEBUG_LOW,"----------------------\n"); -#endif + PduInfoType PduInfo = { + .SduDataPtr = &Result + }; + PduR_ARC_RxIndication(CanTpRxPduId, &PduInfo, 0x04); } BufReq_ReturnType PduR_CanTpProvideTxBuffer(PduIdType CanTpTxPduId, PduInfoType** PduInfoPtr, uint16 Length) { - BufReq_ReturnType retVal = BUFREQ_NOT_OK; -#if (PDUR_CANTP_SUPPORT == STD_ON) - /* Gateway and multicast modes not supported. */ - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpTxPduId]; - retVal = Dcm_ProvideTxBuffer(route->PduRSrcPdu.SrcPduId, PduInfoPtr, Length); -#endif - return retVal; + return PduR_ARC_ProvideTxBuffer(CanTpTxPduId, PduInfoPtr, Length, 0x03); } void PduR_CanTpTxConfirmation(PduIdType CanTpTxPduId, NotifResultType Result) { -#if (PDUR_CANTP_SUPPORT == STD_ON) - PduR_DevCheck(CanTpTxPduId,1,0x0f); - - DEBUG(DEBUG_LOW,"----------------------\n"); - DEBUG(DEBUG_LOW,"PduR_CanIfTxConfirmation: received confirmation with id %d\n", CanTxPduId); - - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpTxPduId]; - Dcm_TxConfirmation(route->PduRSrcPdu.SrcPduId, Result); // Forward confirmation - - DEBUG(DEBUG_LOW,"----------------------\n"); -#endif + PduR_ARC_TxConfirmation(CanTpTxPduId, Result, 0x0f); } - #endif diff --git a/communication/PduR/PduR_Com.c b/communication/PduR/PduR_Com.c index 7cfcfc87..13e2edab 100644 --- a/communication/PduR/PduR_Com.c +++ b/communication/PduR/PduR_Com.c @@ -15,28 +15,12 @@ - - - #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) -#include "Det.h" +#if PDUR_ZERO_COST_OPERATION == STD_OFF - -/** - * Called by the COM-layer in order to send a PDU through a protocol interface. - */ Std_ReturnType PduR_ComTransmit(PduIdType ComTxPduId, const PduInfoType* PduInfoPtr) { - BufReq_ReturnType retVal = BUFREQ_NOT_OK; -#if (PDUR_COM_SUPPORT == STD_ON) - PduR_DevCheck(ComTxPduId,PduInfoPtr,0x15, E_NOT_OK); - - //DEBUG(DEBUG_LOW,"PduR_ComTransmit: received transmit request with id %d and data %d\n", ComTxPduId, *PduInfoPtr->SduDataPtr); - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[ComTxPduId]; - retVal = route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, PduInfoPtr); -#endif - return retVal; + return PduR_ARC_Transmit(ComTxPduId, PduInfoPtr, 0x15); } #endif diff --git a/communication/PduR/PduR_Dcm.c b/communication/PduR/PduR_Dcm.c index bbbc192c..e1c85674 100644 --- a/communication/PduR/PduR_Dcm.c +++ b/communication/PduR/PduR_Dcm.c @@ -16,26 +16,10 @@ #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) - -#include "debug.h" - -#if (PDUR_DCM_SUPPORT == STD_ON) +#if PDUR_ZERO_COST_OPERATION == STD_OFF Std_ReturnType PduR_DcmTransmit(PduIdType DcmTxPduId, const PduInfoType* PduInfoPtr) { - BufReq_ReturnType retVal = BUFREQ_NOT_OK; -#if (PDUR_DCM_SUPPORT == STD_ON) - PduR_DevCheck(DcmTxPduId,PduInfoPtr,0x15, E_NOT_OK); - - //DEBUG(DEBUG_LOW,"PduR_ComTransmit: received transmit request with id %d and data %d\n", ComTxPduId, *PduInfoPtr->SduDataPtr); - - - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[DcmTxPduId]; - retVal = route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, PduInfoPtr); -#endif - return retVal; + return PduR_ARC_Transmit(DcmTxPduId, PduInfoPtr, 0x16); } #endif - -#endif diff --git a/communication/PduR/PduR_If.c b/communication/PduR/PduR_If.c deleted file mode 100644 index a1b505ba..00000000 --- a/communication/PduR/PduR_If.c +++ /dev/null @@ -1,247 +0,0 @@ -/* -------------------------------- Arctic Core ------------------------------ - * Arctic Core - the open source AUTOSAR platform http://arccore.com - * - * Copyright (C) 2009 ArcCore AB - * - * 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 . - * - * 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 ------------------------------*/ - - - - - - - - -#include "PduR.h" - -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) - -#include -#include "debug.h" -#if defined(USE_DEM) -#include "Dem.h" -#endif - -/** - * Helper function for the PduR_IfRxIndication functions. This helper performs the actions specified by PDUR255 and PDUR258. - * @param LinRxPduId - The id of the PDU to be routed. - * @param LinSduPtr - The payload of the PDU. - * @param LoIf_Transmit - */ -void PduR_LoIfRxIndication(PduIdType PduId, const uint8* SduPtr) { - - // Perform routing lookup. - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[PduId]; - - if (route->PduR_GatewayMode == 0) { - // This is an ordinary request. - // 534 PC-Lint (ignoring return value) ticket #134: - route->FctPtrs.TargetIndicationFctPtr(route->PduRDestPdu.DestPduId, SduPtr); // Send PDU to next receptor. - - - } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_NO_PROVISION) ) { - // This is a gateway request, but without any data provision (buffer usage). - PduInfoType PduInfo = { - .SduDataPtr = (uint8 *)SduPtr, // 926, 960 PC-Lint: Beror på att funktion PduR_LoIfRxIndication(...) fel-definerad TICKET 130 - .SduLength = route->SduLength - }; - // 534 PC-Lint (ignoring return value) ticket #134: - route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfo); // Send PDU to next receptor. - - - } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_TRIGGER_TRANSMIT) ) { - // Ths is a gateway request which uses trigger transmit data provision. PDUR255 - DEBUG(DEBUG_LOW,"\tUsing gateway mode with trigger transmit provision\n"); - - if (route->PduRDestPdu.TxBufferRef->TxConfP) { // Transfer confirmation pending. - // Enqueue the new I-PDU. This will flush the buffer if it is full according to the buffer specification. - PduR_BufferQueue(route->PduRDestPdu.TxBufferRef, SduPtr); - // TODO report PDUR_E_PDU_INSTANCE_LOST to DEM if needed. - } - - if (!route->PduRDestPdu.TxBufferRef->TxConfP) { // No transfer confirmation pending (anymore). - uint8 val[route->SduLength]; - PduInfoType PduInfo = { - .SduDataPtr = val, - .SduLength = route->SduLength - }; - PduR_BufferDeQueue(route->PduRDestPdu.TxBufferRef, val); - PduR_BufferQueue(route->PduRDestPdu.TxBufferRef, SduPtr); - if (route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfo) == E_OK) { - setTxConfP(route); - } - } - - } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_DIRECT) ) { - // This is a gateway request using a direct data provision fifo. PDUR258 - DEBUG(DEBUG_LOW,"\tUsing gateway mode with direct provision\n"); - - if (route->PduRDestPdu.TxBufferRef->TxConfP) { // Transfer confirmation pending. - DEBUG(DEBUG_LOW,"\tTransfer confirmation pending.\n"); - PduR_BufferQueue(route->PduRDestPdu.TxBufferRef, SduPtr); - // TODO report PDUR_E_PDU_INSTANCE_LOST to DEM if needed. - - } - - if (!route->PduRDestPdu.TxBufferRef->TxConfP) { // No transfer confirmation pending (anymore) - // TODO: Shall this function create a new I-PDU from LinSduPtr? - - // Make new PduInfoPackage - DEBUG(DEBUG_LOW,"\tNo transfer confirmation pending. Forwarding packet.\n"); - PduInfoType PduInfoPtr = { - .SduDataPtr = (uint8 *)SduPtr, // 926, 960 PC-Lint: Beror på att funktion PduR_LoIfRxIndication(...) fel-definerad TICKET 130 - .SduLength = route->SduLength - }; - if (route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfoPtr) == E_OK) { - setTxConfP(route); - - - } else { -#if defined(USE_DEM) - Dem_ReportErrorStatus(PDUR_E_PDU_INSTANCE_LOST, DEM_EVENT_STATUS_FAILED); -#endif - DEBUG(DEBUG_LOW,"\tTransmission failed. PDUR_E_PDU_INSTANCE_LOST\n"); - } - } - } else { - // Nothing to be done. - } -} - -// void PduR_LoIfTxConfirmation(PduIdType PduId, Std_ReturnType (*LoIf_Transmit)(PduIdType, const PduInfoType*)) { - -void PduR_LoIfTxConfirmation(PduIdType PduId) { - - // Perform routing lookup. - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[PduId]; - - // Find out if this is a gateway or ordinary confirmation. - - if (route->PduR_GatewayMode == 0) { - // This is an ordinary request. - route->FctPtrs.TargetConfirmationFctPtr(route->PduRDestPdu.DestPduId); // Forward confirmation - - } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_NO_PROVISION) ) { - // A gateway request without provision. Just forward confirmation. - route->FctPtrs.TargetConfirmationFctPtr(route->PduRDestPdu.DestPduId); // Forward confirmation - - - } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_TRIGGER_TRANSMIT) ) { - // The route is using gateway mode and trigger transmit data provision. PDUR256 - DEBUG(DEBUG_LOW,"\tUsing gateway mode with trigger transmit data provision.\n", PduId); - - while (1) { - - // If TxConfP is set process confirmation, ignore otherwise. - if (!route->PduRDestPdu.TxBufferRef->TxConfP) { // TxConfP not set, ignore! - DEBUG(DEBUG_LOW,"\tTxConfP was not set, ignoring confirmation.\n"); - break; - - - } else { // TxConfP is set - if (route->PduRDestPdu.TxBufferRef->NrItems == 1) { // Only one entry in buffer. - clearTxConfP(route); // Clear TxConfP - DEBUG(DEBUG_LOW,"\tOnly one entry in buffer and TxConfP set, cleared TxConfP.\n"); - break; - - - } else { // Buffer is not empty - // Dequeue the first fifo item. - DEBUG(DEBUG_LOW,"\tMore than one entry in buffer and TxConfP set, transmitting the next fifo entry.\n"); - uint8 val[route->SduLength]; - PduR_BufferDeQueue(route->PduRDestPdu.TxBufferRef, val); - - // TODO Does this need to be static? - PduInfoType PduInfo = { - .SduDataPtr = val, - .SduLength = route->SduLength - }; - // Transmit this item. - if (route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfo) == E_OK) { - DEBUG(DEBUG_LOW,"\tTransmit succeeded.\n"); - break; - - - } else { - DEBUG(DEBUG_LOW,"\tTransmit failed. Retrying with the next fifo entry.\n"); - } - } - } - } - - - } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_DIRECT) ) { - // The route is using a direct data provision fifo. PDUR259 - DEBUG(DEBUG_LOW,"\tUsing gateway mode with direct data provision.\n", PduId); - - while (1) { - - // If TxConfP is set process confirmation, ignore otherwise. - if (!route->PduRDestPdu.TxBufferRef->TxConfP) { // TxConfP not set, ignore! - DEBUG(DEBUG_LOW,"\tTxConfP was not set, ignoring confirmation.\n"); - break; - - - } else { // TxConfP is set - if (route->PduRDestPdu.TxBufferRef->NrItems == 0) { // Buffer is empty - clearTxConfP(route); // Clear TxConfP - DEBUG(DEBUG_LOW,"\tBuffer was empty and TxConfP set, cleared TxConfP.\n"); - break; - - - } else { // Buffer is not empty - // Dequeue the first fifo item. - DEBUG(DEBUG_LOW,"\tBuffer was not empty and TxConfP set, transmitting the next fifo entry.\n"); - uint8 val[route->SduLength]; - PduR_BufferDeQueue(route->PduRDestPdu.TxBufferRef, val); - - // TODO Does this need to be static? - PduInfoType PduInfo = { - .SduDataPtr = val, - .SduLength = route->SduLength - }; - // Transmit this item. - if (route->FctPtrs.TargetTransmitFctPtr(route->PduRDestPdu.DestPduId, &PduInfo) == E_OK) { - DEBUG(DEBUG_LOW,"\tTransmit succeeded.\n"); - break; - - - } else { - DEBUG(DEBUG_LOW,"\tTransmit failed. Retrying with the next fifo entry.\n"); - } - } - } - } - } else { - // Nothing to be done. - } -} - -void PduR_LoIfTriggerTransmit(PduIdType PduId, uint8* SduPtr) { - // Perform routing lookup. - PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[PduId]; - - // Find out if this is a gateway or ordinary trigger. - //if (route->PduRDestPdu.DataProvision == PDUR_NO_PROVISION) { // This is an ordinary trigger. - if (route->PduR_GatewayMode == 0) { // This is an ordinary trigger. - // 534 PC-Lint (ignoring return value) ticket #134: - route->FctPtrs.TargetTriggerTransmitFctPtr(route->PduRDestPdu.DestPduId, SduPtr); - - } else if ( (route->PduR_GatewayMode == 1) && (route->PduRDestPdu.DataProvision == PDUR_TRIGGER_TRANSMIT) ) { // The route is using a trigger transmit fifo. PDUR256 - DEBUG(DEBUG_LOW,"\tUsing gateway mode with trigger transmit data provision.\n", PduId); - memcpy((void *)SduPtr, (void *)route->PduRDestPdu.TxBufferRef->First, sizeof(uint8) * route->SduLength); - - } else { - // Nothing to be done. - } -} - -#endif diff --git a/communication/PduR/PduR_LinIf.c b/communication/PduR/PduR_LinIf.c index 6b11c584..a7faaffa 100644 --- a/communication/PduR/PduR_LinIf.c +++ b/communication/PduR/PduR_LinIf.c @@ -16,51 +16,20 @@ - - #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) - -#include "debug.h" - -void PduR_LinIfRxIndication(PduIdType LinRxPduId, const uint8* LinSduPtr) { -#if (PDUR_LINIF_SUPPORT == STD_ON) - PduR_DevCheck(LinRxPduId,LinSduPtr,0x0e); +#if PDUR_ZERO_COST_OPERATION == STD_OFF - DEBUG(DEBUG_LOW,"----------------------\n"); - DEBUG(DEBUG_LOW,"PduR_LinIfRxIndication: received indication with id %d and data %d\n", LinRxPduId, *LinSduPtr); - - PduR_LoIfRxIndication(LinRxPduId, LinSduPtr); - - DEBUG(DEBUG_LOW,"----------------------\n"); -#endif +void PduR_LinIfRxIndication(PduIdType LinRxPduId, const PduInfoType* PduInfoPtr) { + PduR_ARC_RxIndication(LinRxPduId, PduInfoPtr, 0x0e); } void PduR_LinIfTxConfirmation(PduIdType LinTxPduId) { -#if (PDUR_LINIF_SUPPORT == STD_ON) - PduR_DevCheck(LinTxPduId,1,0x0f); - - DEBUG(DEBUG_LOW,"----------------------\n"); - DEBUG(DEBUG_LOW,"PduR_LinIfTxConfirmation: received confirmation with id %d\n", LinTxPduId); - - PduR_LoIfTxConfirmation(LinTxPduId); - - DEBUG(DEBUG_LOW,"----------------------\n"); -#endif + PduR_ARC_TxConfirmation(LinTxPduId, NULL, 0x0f); } -void PduR_LinIfTriggerTransmit(PduIdType LinTxPduId, uint8* LinSduPtr) { -#if (PDUR_LINIF_SUPPORT == STD_ON) - PduR_DevCheck(LinTxPduId,LinSduPtr,0x10); - - DEBUG(DEBUG_LOW,"----------------------\n"); - DEBUG(DEBUG_LOW,"PduR_LinIfTriggerTransmit: received request with id %d\n", LinTxPduId); - - PduR_LoIfTriggerTransmit(LinTxPduId, LinSduPtr); - - DEBUG(DEBUG_LOW,"----------------------\n"); -#endif +Std_ReturnType PduR_LinIfTriggerTransmit(PduIdType LinTxPduId, PduInfoType* PduInfoPtr) { + return PduR_ARC_TriggerTransmit(LinTxPduId, PduInfoPtr, 0x10); } #endif diff --git a/communication/PduR/makefile b/communication/PduR/makefile deleted file mode 100644 index 4bf41066..00000000 --- a/communication/PduR/makefile +++ /dev/null @@ -1,15 +0,0 @@ - - -#obj-y += xfls_test.o -#obj-y += lin_test.o - -#VPATH += $(ROOTDIR)/arch/$(ARCH)/delivery/mpc5500_h7f/source -#inc-y += $(ROOTDIR)/arch/$(ARCH)/delivery/mpc5500_h7f/include - - -#linkfile -#ldcmdfile-$(CFG_MPC55XX) = $(ROOTDIR)/arch/$(ARCH)/scripts/linkscript_gcc.ldf - -#build-exe-y = ../../../$(target)_$(ARCH).$(TE) - - diff --git a/communication/PduR/test/makefile b/communication/PduR/test/makefile deleted file mode 100644 index 64817320..00000000 --- a/communication/PduR/test/makefile +++ /dev/null @@ -1,102 +0,0 @@ - - - -# Gpt -obj-y += Gpt.o -obj-y += Gpt_Cfg.o - -# Mcu -obj-y += Mcu.o -obj-y += Mcu_Cfg.o -obj-y += Mcu_Exceptions.o - -# Can -obj-y += Can.o -obj-y += Can_Lcfg.o -obj-y += CanIf.o -obj-y += CanIf_Cfg.o - -obj-y += Dio.o -obj-y += Dio_Lcfg.o - -obj-y += Port.o -obj-y += Port_Cfg.o - -# Spi -obj-y += Spi.o -obj-y += Spi_Lcfg.o - -#Eep -obj-y += Eep.o -obj-y += Eep_Lcfg.o -obj-y += Eeprom_Lcfg.o - -#Fls ext -obj-y += Fls_SST25xx.o -obj-y += Fls_SST25xx_Cfg.o - -# Misc -obj-y += Det.o - -# Lin -obj-y += Lin_PBcfg.o -obj-y += Lin_Lcfg.o -obj-y += LinIf_Lcfg.o -obj-y += LinIf_PBcfg.o -obj-y += LinSM_Lcfg.o -obj-y += LinSM_PBcfg.o -obj-y += LinSM_Cfg.o -obj-y += Lin.o -obj-y += LinIf.o -obj-y += LinSM.o - -# ComM -obj-y += ComM.o - -# Com -obj-y += Com.o - - -# Common -obj-y += xtoa.o -obj-y += ramlog.o -VPATH += $(ROOTDIR)/common - - -VPATH += $(ROOTDIR)/arch/$(ARCH)/kernel -VPATH += $(ROOTDIR)/arch/$(ARCH)/drivers -#VPATH += $(ROOTDIR)/arch/$(ARCH)/config -VPATH += $(ROOTDIR)/boards/$(BOARDDIR)/config -VPATH += $(ROOTDIR)/drivers -VPATH += $(ROOTDIR)/drivers/config -VPATH += $(ROOTDIR)/drivers/Lin -VPATH += $(ROOTDIR)/drivers/ComM -VPATH += $(ROOTDIR)/drivers/Com - - -inc-y += $(ROOTDIR)/drivers/PduR -inc-y += $(ROOTDIR)/drivers/Com -inc-y += $(ROOTDIR)/drivers/ComM -inc-y += $(ROOTDIR)/drivers/config -inc-y += $(ROOTDIR)/boards/$(BOARDDIR)/config -inc-y += $(ROOTDIR)/drivers/include -inc-y += $(ROOTDIR)/include -#inc-y += $(ROOTDIR)/arch/$(ARCH)/config -inc-y += $(ROOTDIR)/arch/$(ARCH)/drivers -inc-y += $(ROOTDIR)/arch/$(ARCH)/kernel - -inc-y += $(ROOTDIR)/embunit/embUnit -inc-y += $(ROOTDIR)/embunit/textui -inc-y += $(ROOTDIR)/embunit - - -#libs needed by us -libitem-y += $(ROOTDIR)/embunit/embUnit/obj_$(ARCH)/libembunit.a -libitem-y += $(ROOTDIR)/embunit/textui/obj_$(ARCH)/libtextui.a - -#linkfile -ldcmdfile-$(CFG_MPC55XX) = $(ROOTDIR)/arch/$(ARCH)/scripts/linkscript_$(COMPILER).ldf - -build-exe-y = ../../../$(target)_$(ARCH).$(TE) - - diff --git a/examples/pwm_node2/Hooks.c b/examples/pwm_node2/Hooks.c index 1d598bfd..fa550b29 100644 --- a/examples/pwm_node2/Hooks.c +++ b/examples/pwm_node2/Hooks.c @@ -44,14 +44,14 @@ void StartupHook( void ) { void ShutdownHook( StatusType Error ) { LDEBUG_FPUTS("## ShutdownHook\n"); - while(1) ; + while(1); } void ErrorHook( StatusType Error ) { DisableAllInterrupts(); LDEBUG_PRINTF("## ErrorHook err=%d\n",Error); - while(1) ; + while(1); } void PreTaskHook( void ) { diff --git a/examples/pwm_node2/Tasks.c b/examples/pwm_node2/Tasks.c index c57f12ab..410105e2 100644 --- a/examples/pwm_node2/Tasks.c +++ b/examples/pwm_node2/Tasks.c @@ -32,7 +32,7 @@ #include "debug.h" void OsIdle( void ) { - for(;;) ; + for(;;); } diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/CanIf_Cfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/CanIf_Cfg.h index 1ead3a2a..e6928a07 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/CanIf_Cfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/CanIf_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error CanIf: Configuration file expected BSW module version to be 1.3.* #endif diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Can_Cfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Can_Cfg.h index 3e92a8b9..a51140bb 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Can_Cfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Can_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Can: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Com_Cfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Com_Cfg.h index ed4addee..d715f73b 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Com_Cfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Com_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Com: Configuration file expected BSW module version to be 1.1.* #endif diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Com_PbCfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Com_PbCfg.h index 2ec6cab2..945518c0 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Com_PbCfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Com_PbCfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Com: Configuration file expected BSW module version to be 1.1.* #endif #ifndef COM_PBCFG_H diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/EcuM_Cfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/EcuM_Cfg.h index 915a5e42..34875044 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/EcuM_Cfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/EcuM_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* #endif diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Os_Cfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Os_Cfg.h index 295b8277..74a4f79c 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Os_Cfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Os_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Os: Configuration file expected BSW module version to be 2.0.* #endif diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/PduR_Cfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/PduR_Cfg.h index 3131e8ae..2f1f7278 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/PduR_Cfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/PduR_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error PduR: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/PduR_PbCfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/PduR_PbCfg.h index 5e8dc031..e93b6012 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/PduR_PbCfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/PduR_PbCfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error PduR: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Port_Cfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Port_Cfg.h index 7a1ea659..6f1a5555 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Port_Cfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Port_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Port: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Pwm_Cfg.h b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Pwm_Cfg.h index c6022345..e54806fb 100644 --- a/examples/pwm_node2/config/hcs12x_elmicro_tboard/Pwm_Cfg.h +++ b/examples/pwm_node2/config/hcs12x_elmicro_tboard/Pwm_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Pwm: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/CanIf_Cfg.h b/examples/pwm_node2/config/mpc5516it/CanIf_Cfg.h index 68d7c90e..99cac453 100644 --- a/examples/pwm_node2/config/mpc5516it/CanIf_Cfg.h +++ b/examples/pwm_node2/config/mpc5516it/CanIf_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error CanIf: Configuration file expected BSW module version to be 1.3.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/Can_Cfg.h b/examples/pwm_node2/config/mpc5516it/Can_Cfg.h index 5d95b86f..e5476397 100644 --- a/examples/pwm_node2/config/mpc5516it/Can_Cfg.h +++ b/examples/pwm_node2/config/mpc5516it/Can_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Can: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/Com_Cfg.h b/examples/pwm_node2/config/mpc5516it/Com_Cfg.h index fbd2dc34..c1361dd9 100644 --- a/examples/pwm_node2/config/mpc5516it/Com_Cfg.h +++ b/examples/pwm_node2/config/mpc5516it/Com_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Com: Configuration file expected BSW module version to be 1.1.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/Com_PbCfg.h b/examples/pwm_node2/config/mpc5516it/Com_PbCfg.h index 2a4b2d0b..5a59adec 100644 --- a/examples/pwm_node2/config/mpc5516it/Com_PbCfg.h +++ b/examples/pwm_node2/config/mpc5516it/Com_PbCfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Com: Configuration file expected BSW module version to be 1.1.* #endif #ifndef COM_PBCFG_H diff --git a/examples/pwm_node2/config/mpc5516it/EcuM_Cfg.h b/examples/pwm_node2/config/mpc5516it/EcuM_Cfg.h index 29442dc4..cfd56316 100644 --- a/examples/pwm_node2/config/mpc5516it/EcuM_Cfg.h +++ b/examples/pwm_node2/config/mpc5516it/EcuM_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/Os_Cfg.h b/examples/pwm_node2/config/mpc5516it/Os_Cfg.h index 9279a614..d30e6902 100644 --- a/examples/pwm_node2/config/mpc5516it/Os_Cfg.h +++ b/examples/pwm_node2/config/mpc5516it/Os_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Os: Configuration file expected BSW module version to be 2.0.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/PduR_Cfg.h b/examples/pwm_node2/config/mpc5516it/PduR_Cfg.h index 6b962942..81ab1c41 100644 --- a/examples/pwm_node2/config/mpc5516it/PduR_Cfg.h +++ b/examples/pwm_node2/config/mpc5516it/PduR_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error PduR: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/PduR_PbCfg.h b/examples/pwm_node2/config/mpc5516it/PduR_PbCfg.h index 578a1cfa..7348712d 100644 --- a/examples/pwm_node2/config/mpc5516it/PduR_PbCfg.h +++ b/examples/pwm_node2/config/mpc5516it/PduR_PbCfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error PduR: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/Port_Cfg.h b/examples/pwm_node2/config/mpc5516it/Port_Cfg.h index 88a6968b..7e92fd6e 100644 --- a/examples/pwm_node2/config/mpc5516it/Port_Cfg.h +++ b/examples/pwm_node2/config/mpc5516it/Port_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Port: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/pwm_node2/config/mpc5516it/Pwm_Cfg.h b/examples/pwm_node2/config/mpc5516it/Pwm_Cfg.h index c289be5c..d292ea35 100644 --- a/examples/pwm_node2/config/mpc5516it/Pwm_Cfg.h +++ b/examples/pwm_node2/config/mpc5516it/Pwm_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Pwm: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/switch_node/Hooks.c b/examples/switch_node/Hooks.c index 469b24cb..80456813 100644 --- a/examples/switch_node/Hooks.c +++ b/examples/switch_node/Hooks.c @@ -45,14 +45,14 @@ void StartupHook( void ) { void ShutdownHook( StatusType Error ) { LDEBUG_PRINTF("## ShutdownHook\n"); - while(1) ; + while(1); } void ErrorHook( StatusType Error ) { DisableAllInterrupts(); LDEBUG_PRINTF("## ErrorHook err=%d\n",Error); - while(1) ; + while(1); } void PreTaskHook( void ) { diff --git a/examples/switch_node/Tasks.c b/examples/switch_node/Tasks.c index 8ef01754..e02f3c22 100644 --- a/examples/switch_node/Tasks.c +++ b/examples/switch_node/Tasks.c @@ -32,7 +32,7 @@ #include "debug.h" void OsIdle( void ) { - for(;;) ; + for(;;); } diff --git a/examples/switch_node/config/mpc5516it/CanIf_Cfg.h b/examples/switch_node/config/mpc5516it/CanIf_Cfg.h index 2efcd7a1..187de63f 100644 --- a/examples/switch_node/config/mpc5516it/CanIf_Cfg.h +++ b/examples/switch_node/config/mpc5516it/CanIf_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error CanIf: Configuration file expected BSW module version to be 1.3.* #endif diff --git a/examples/switch_node/config/mpc5516it/Can_Cfg.h b/examples/switch_node/config/mpc5516it/Can_Cfg.h index a21036bb..384dbdc7 100644 --- a/examples/switch_node/config/mpc5516it/Can_Cfg.h +++ b/examples/switch_node/config/mpc5516it/Can_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Can: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/switch_node/config/mpc5516it/Com_Cfg.h b/examples/switch_node/config/mpc5516it/Com_Cfg.h index 017389d5..a375ab29 100644 --- a/examples/switch_node/config/mpc5516it/Com_Cfg.h +++ b/examples/switch_node/config/mpc5516it/Com_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Com: Configuration file expected BSW module version to be 1.1.* #endif diff --git a/examples/switch_node/config/mpc5516it/Com_PbCfg.h b/examples/switch_node/config/mpc5516it/Com_PbCfg.h index 88831fd9..3aba0125 100644 --- a/examples/switch_node/config/mpc5516it/Com_PbCfg.h +++ b/examples/switch_node/config/mpc5516it/Com_PbCfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Com: Configuration file expected BSW module version to be 1.1.* #endif #ifndef COM_PBCFG_H diff --git a/examples/switch_node/config/mpc5516it/EcuM_Cfg.h b/examples/switch_node/config/mpc5516it/EcuM_Cfg.h index f5f64917..6663972d 100644 --- a/examples/switch_node/config/mpc5516it/EcuM_Cfg.h +++ b/examples/switch_node/config/mpc5516it/EcuM_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* #endif diff --git a/examples/switch_node/config/mpc5516it/Os_Cfg.h b/examples/switch_node/config/mpc5516it/Os_Cfg.h index 8b4745e1..75c565c7 100644 --- a/examples/switch_node/config/mpc5516it/Os_Cfg.h +++ b/examples/switch_node/config/mpc5516it/Os_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Os: Configuration file expected BSW module version to be 2.0.* #endif diff --git a/examples/switch_node/config/mpc5516it/PduR_Cfg.h b/examples/switch_node/config/mpc5516it/PduR_Cfg.h index ccbe0b95..cfc9ee14 100644 --- a/examples/switch_node/config/mpc5516it/PduR_Cfg.h +++ b/examples/switch_node/config/mpc5516it/PduR_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error PduR: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/switch_node/config/mpc5516it/PduR_PbCfg.h b/examples/switch_node/config/mpc5516it/PduR_PbCfg.h index 6f1ae1ea..92a5508f 100644 --- a/examples/switch_node/config/mpc5516it/PduR_PbCfg.h +++ b/examples/switch_node/config/mpc5516it/PduR_PbCfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error PduR: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/switch_node/config/mpc5516it/Port_Cfg.h b/examples/switch_node/config/mpc5516it/Port_Cfg.h index 9eac4504..e20c905d 100644 --- a/examples/switch_node/config/mpc5516it/Port_Cfg.h +++ b/examples/switch_node/config/mpc5516it/Port_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Port: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/switch_node/config/mpc5567qrtech/CanIf_Cfg.h b/examples/switch_node/config/mpc5567qrtech/CanIf_Cfg.h index 76e987d1..1e271cf4 100644 --- a/examples/switch_node/config/mpc5567qrtech/CanIf_Cfg.h +++ b/examples/switch_node/config/mpc5567qrtech/CanIf_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error CanIf: Configuration file expected BSW module version to be 1.3.* #endif diff --git a/examples/switch_node/config/mpc5567qrtech/Can_Cfg.h b/examples/switch_node/config/mpc5567qrtech/Can_Cfg.h index a076a903..38fc5dc4 100644 --- a/examples/switch_node/config/mpc5567qrtech/Can_Cfg.h +++ b/examples/switch_node/config/mpc5567qrtech/Can_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Can: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/switch_node/config/mpc5567qrtech/Com_Cfg.h b/examples/switch_node/config/mpc5567qrtech/Com_Cfg.h index 772eeb29..ace4934d 100644 --- a/examples/switch_node/config/mpc5567qrtech/Com_Cfg.h +++ b/examples/switch_node/config/mpc5567qrtech/Com_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Com: Configuration file expected BSW module version to be 1.1.* #endif diff --git a/examples/switch_node/config/mpc5567qrtech/Com_PbCfg.h b/examples/switch_node/config/mpc5567qrtech/Com_PbCfg.h index 4c431031..8c2427d4 100644 --- a/examples/switch_node/config/mpc5567qrtech/Com_PbCfg.h +++ b/examples/switch_node/config/mpc5567qrtech/Com_PbCfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Com: Configuration file expected BSW module version to be 1.1.* #endif #ifndef COM_PBCFG_H diff --git a/examples/switch_node/config/mpc5567qrtech/EcuM_Cfg.h b/examples/switch_node/config/mpc5567qrtech/EcuM_Cfg.h index f38b5da0..c6557696 100644 --- a/examples/switch_node/config/mpc5567qrtech/EcuM_Cfg.h +++ b/examples/switch_node/config/mpc5567qrtech/EcuM_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* #endif diff --git a/examples/switch_node/config/mpc5567qrtech/Os_Cfg.h b/examples/switch_node/config/mpc5567qrtech/Os_Cfg.h index 7b7e0bb0..5466fc81 100644 --- a/examples/switch_node/config/mpc5567qrtech/Os_Cfg.h +++ b/examples/switch_node/config/mpc5567qrtech/Os_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Os: Configuration file expected BSW module version to be 2.0.* #endif diff --git a/examples/switch_node/config/mpc5567qrtech/PduR_Cfg.h b/examples/switch_node/config/mpc5567qrtech/PduR_Cfg.h index 772bcf43..90038aca 100644 --- a/examples/switch_node/config/mpc5567qrtech/PduR_Cfg.h +++ b/examples/switch_node/config/mpc5567qrtech/PduR_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error PduR: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/switch_node/config/mpc5567qrtech/PduR_PbCfg.h b/examples/switch_node/config/mpc5567qrtech/PduR_PbCfg.h index 32a29a9a..ac4f3625 100644 --- a/examples/switch_node/config/mpc5567qrtech/PduR_PbCfg.h +++ b/examples/switch_node/config/mpc5567qrtech/PduR_PbCfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error PduR: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/examples/switch_node/config/mpc5567qrtech/Port_Cfg.h b/examples/switch_node/config/mpc5567qrtech/Port_Cfg.h index 0663b3ee..2ff07099 100644 --- a/examples/switch_node/config/mpc5567qrtech/Port_Cfg.h +++ b/examples/switch_node/config/mpc5567qrtech/Port_Cfg.h @@ -14,8 +14,8 @@ */ -#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)) ) +#error Port: Configuration file expected BSW module version to be 1.0.* #endif diff --git a/include/CanIf_ConfigTypes.h b/include/CanIf_ConfigTypes.h index 80a69e0a..9692b1c6 100644 --- a/include/CanIf_ConfigTypes.h +++ b/include/CanIf_ConfigTypes.h @@ -255,7 +255,7 @@ typedef struct { /** Name of target indication services to target upper layers (PduRouter, * CanNm, CanTp and ComplexDeviceDrivers). If parameter is 0 no call-out * function is configured. */ - CanIf_FuncTypeCanSpecial CanIfUserRxIndication; + void *CanIfUserRxIndication; /** The HRH to which Rx L-PDU belongs to, is referred through this * parameter. */ diff --git a/include/Com_Com.h b/include/Com_Com.h index 9886a8e5..dc42a874 100644 --- a/include/Com_Com.h +++ b/include/Com_Com.h @@ -29,11 +29,11 @@ uint8 Com_SendSignal(Com_SignalIdType SignalId, const void *SignalDataPtr); uint8 Com_ReceiveSignal(Com_SignalIdType SignalId, void* SignalDataPtr); -Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, uint8 *SduPtr); +Std_ReturnType Com_TriggerTransmit(PduIdType ComTxPduId, PduInfoType *PduInfoPtr); void Com_TriggerIPduSend(PduIdType ComTxPduId); -void Com_RxIndication(PduIdType ComRxPduId, const uint8* SduPtr); // TODO: Parameter SduPtr should be const PduInfoType* PduInfoPtr +void Com_RxIndication(PduIdType ComRxPduId, const PduInfoType* PduInfoPtr); void Com_TxConfirmation(PduIdType ComTxPduId); diff --git a/include/Modules.h b/include/Modules.h index fc05ff42..756973b9 100644 --- a/include/Modules.h +++ b/include/Modules.h @@ -57,6 +57,7 @@ #define MODULE_ID_IPDUM (52) // IPDU Multiplexer #define MODULE_ID_DCM (53) // Diagnostic Communication Manager #define MODULE_ID_DEM (54) // Diagnostic Event Manager +#define MODULE_ID_SOAD (56) // Socket Adaptor #define MODULE_ID_CANIF (60) // CAN Interface #define MODULE_ID_FRIF (61) // Flexray interface diff --git a/include/PduR.h b/include/PduR.h index be087144..b9825ed0 100644 --- a/include/PduR.h +++ b/include/PduR.h @@ -23,7 +23,7 @@ #ifndef PDUR_H #define PDUR_H -#define PDUR_VENDOR_ID 1 +#define PDUR_VENDOR_ID 1 #define PDUR_AR_MAJOR_VERSION 2 #define PDUR_AR_MINOR_VERSION 2 #define PDUR_AR_PATCH_VERSION 2 @@ -48,6 +48,7 @@ #include "PduR_Types.h" #include "PduR_PbCfg.h" +#include "PduR_If.h" #include "PduR_Com.h" #include "PduR_CanIf.h" #include "PduR_LinIf.h" @@ -68,31 +69,40 @@ extern const PduR_PBConfigType *PduRConfig; */ extern PduR_StateType PduRState; +#define PduR_IsUpModule(_mod) ((_mod > ARC_PDUR_UP_MODULES) && (_mod < ARC_PDUR_LOIF_MODULES)) +#define PduR_IsIfModule(_mod) ((_mod > ARC_PDUR_LOIF_MODULES) && (_mod < ARC_PDUR_LOTP_MODULES)) +#define PduR_IsTpModule(_mod) ((_mod > ARC_PDUR_LOTP_MODULES) && (_mod < ARC_PDUR_END_OF_MODULES)) +#define PduR_IsLoModule(_mod) (PduR_IsIfModule(_mod) || PduR_IsTpModule(_mod)) + #if (PDUR_DEV_ERROR_DETECT == STD_ON) -#define PDUR_DET_REPORTERROR(_x,_y,_z,_q) Det_ReportError(_x,_y,_z,_q) +#define PDUR_DET_REPORTERROR(_x,_y,_z,_o) Det_ReportError(_x,_y,_z,_o) -// Define macro for state, parameter and data pointer checks. -// TODO Implement data range check if needed. -#define PduR_DevCheck(PduId,PduPtr,ApiId,...) \ +#define PDUR_VALIDATE_INITIALIZED(_api,...) \ if ((PduRState == PDUR_UNINIT) || (PduRState == PDUR_REDUCED)) { \ - PDUR_DET_REPORTERROR(MODULE_ID_PDUR, PDUR_INSTANCE_ID, ApiId, PDUR_E_INVALID_REQUEST); \ + Det_ReportError(MODULE_ID_PDUR, PDUR_INSTANCE_ID, _api, PDUR_E_INVALID_REQUEST); \ return __VA_ARGS__; \ - } \ - if ((PduPtr == 0) && (PDUR_DEV_ERROR_DETECT)) { \ - PDUR_DET_REPORTERROR(MODULE_ID_PDUR, PDUR_INSTANCE_ID, ApiId, PDUR_E_DATA_PTR_INVALID); \ + } + +#define PDUR_VALIDATE_PDUPTR(_api, _pduPtr, ...) \ + if ((_pduPtr == NULL) && (PDUR_DEV_ERROR_DETECT)) { \ + Det_ReportError(MODULE_ID_PDUR, PDUR_INSTANCE_ID, _api, PDUR_E_DATA_PTR_INVALID); \ return __VA_ARGS__; \ - } \ - if ((PduId >= PduRConfig->PduRRoutingTable->NRoutingPaths) && PDUR_DEV_ERROR_DETECT) { \ - PDUR_DET_REPORTERROR(MODULE_ID_PDUR, PDUR_INSTANCE_ID, ApiId, PDUR_E_PDU_ID_INVALID); \ + } + +#define PDUR_VALIDATE_PDUID(_api, _pduId, ...) \ + if ((_pduId >= PduRConfig->NRoutingPaths) && PDUR_DEV_ERROR_DETECT) { \ + Det_ReportError(MODULE_ID_PDUR, PDUR_INSTANCE_ID, _api, PDUR_E_PDU_ID_INVALID); \ return __VA_ARGS__; \ } #else -#define PDUR_DET_REPORTERROR(_x,_y,_z,_q) -#define PduR_DevCheck(...) +#define PDUR_DET_REPORTERROR(_x,_y,_z,_o) +#define PDUR_VALIDATE_INITIALIZED(_api,...) +#define PDUR_VALIDATE_PDUPTR(_api, _pduPtr, ...) +#define PDUR_VALIDATE_PDUID(_api, _pduId, ...) #endif @@ -127,12 +137,9 @@ void PduR_LoIfTriggerTransmit(PduIdType PduId, uint8* SduPtr); /* * Macros */ -#define setTxConfP(R) (R->PduRDestPdu.TxBufferRef->TxConfP = 1) -#define clearTxConfP(R) (R->PduRDestPdu.TxBufferRef->TxConfP = 0) +#define setTxConfP(_B) (_B->TxConfP = 1) +#define clearTxConfP(_B) (_B->TxConfP = 0) #endif -extern PduR_FctPtrType PduR_StdCanFctPtrs; -extern PduR_FctPtrType PduR_StdLinFctPtrs; - #endif /* PDUR_H */ diff --git a/include/PduR_CanIf.h b/include/PduR_CanIf.h index 3c3e96a0..c7d28dbb 100644 --- a/include/PduR_CanIf.h +++ b/include/PduR_CanIf.h @@ -25,28 +25,11 @@ #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) +#if PDUR_ZERO_COST_OPERATION == STD_OFF - void PduR_CanIfRxIndication (PduIdType CanRxPduId, const uint8 *CanSduPtr ); - void PduR_CanIfTxConfirmation(PduIdType CanTxPduId); - -#else // Zero cost operation active - - #if (PDUR_COM_SUPPORT == STD_ON) - - #include "Com_Com.h" - - #define PduR_CanIfRxIndication Com_RxIndication - #define PduR_CanIfTxConfirmation Com_TxConfirmation - - #else - - #define PduR_CanIfRxIndication(... ) - #define PduR_CanIfTxConfirmation(...) - - #endif - -#endif // Zero cost operation active +void PduR_CanIfRxIndication(PduIdType CanRxPduId,const PduInfoType* PduInfoPtr); +void PduR_CanIfTxConfirmation(PduIdType CanTxPduId); +#endif #endif /* PDUR_CANIF_H_ */ diff --git a/include/PduR_CanTp.h b/include/PduR_CanTp.h index eadd6a26..8920f7bf 100644 --- a/include/PduR_CanTp.h +++ b/include/PduR_CanTp.h @@ -20,33 +20,13 @@ #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) +#if PDUR_ZERO_COST_OPERATION == STD_OFF - BufReq_ReturnType PduR_CanTpProvideRxBuffer(PduIdType CanTpRxPduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr); - void PduR_CanTpRxIndication(PduIdType CanTpRxPduId, NotifResultType Result); - BufReq_ReturnType PduR_CanTpProvideTxBuffer(PduIdType CanTpTxPduId, PduInfoType** PduInfoPtr, uint16 Length); - void PduR_CanTpTxConfirmation(PduIdType CanTpTxPduId, NotifResultType Result); +BufReq_ReturnType PduR_CanTpProvideRxBuffer(PduIdType CanTpRxPduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr); +void PduR_CanTpRxIndication(PduIdType CanTpRxPduId, NotifResultType Result); +BufReq_ReturnType PduR_CanTpProvideTxBuffer(PduIdType CanTpTxPduId, PduInfoType** PduInfoPtr, uint16 Length); +void PduR_CanTpTxConfirmation(PduIdType CanTpTxPduId, NotifResultType Result); -#else // Zero cost operation active - - #if (PDUR_DCM_SUPPORT == STD_ON) - - #include "Dcm_Cbk.h" - - #define PduR_CanTpProvideRxBuffer Dcm_ProvideRxBuffer - #define PduR_CanTpRxIndication Dcm_RxIndication - #define PduR_CanTpProvideTxBuffer Dcm_ProvideTxBuffer - #define PduR_CanTpTxConfirmation Dcm_TxConfirmation - - #else - - #define PduR_CanTpProvideRxBuffer(...) - #define PduR_CanTpRxIndication(...) - #define PduR_CanTpProvideTxBuffer(...) - #define PduR_CanTpTxConfirmation(...) - - #endif - -#endif // Zero cost operation active +#endif #endif /* PDUR_CANTP_H_ */ diff --git a/include/PduR_Com.h b/include/PduR_Com.h index 9e234567..11481ac9 100644 --- a/include/PduR_Com.h +++ b/include/PduR_Com.h @@ -25,24 +25,10 @@ #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) +#if PDUR_ZERO_COST_OPERATION == STD_OFF - Std_ReturnType PduR_ComTransmit(PduIdType ComTxPduId, const PduInfoType* PduInfoPtr); +Std_ReturnType PduR_ComTransmit(PduIdType ComTxPduId, const PduInfoType* PduInfoPtr); -#else // Zero cost operation active - - #if (PDUR_CANIF_SUPPORT == STD_ON) - - #include "CanIf.h" - - #define PduR_ComTransmit CanIf_Transmit - - #else - - #define PduR_ComTransmit(... ) (E_OK) - - #endif - -#endif // Zero cost operation active +#endif #endif /* PDUR_COM_H_ */ diff --git a/include/PduR_Dcm.h b/include/PduR_Dcm.h index 309692a8..6e2b14b9 100644 --- a/include/PduR_Dcm.h +++ b/include/PduR_Dcm.h @@ -20,26 +20,11 @@ #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) +#if PDUR_ZERO_COST_OPERATION == STD_OFF - Std_ReturnType PduR_DcmTransmit(PduIdType DcmTxPduId, const PduInfoType* PduInfoPtr); - -#else // Zero cost operation active - - #if (PDUR_CANTP_SUPPORT == STD_ON) - - #include "CanTp.h" - - #define PduR_DcmTransmit CanTp_Transmit - - #else - - #define PduR_DcmTransmit(... ) E_OK - - #endif - -#endif // Zero cost operation active +Std_ReturnType PduR_DcmTransmit(PduIdType DcmTxPduId, const PduInfoType* PduInfoPtr); +#endif #endif /*PDUR_DCM_H_*/ diff --git a/include/PduR_If.h b/include/PduR_If.h index a9ea05b5..a6f9d10f 100644 --- a/include/PduR_If.h +++ b/include/PduR_If.h @@ -16,18 +16,29 @@ - - - - #ifndef PDUR_IF_H_ #define PDUR_IF_H_ #include "PduR.h" #include "Det.h" -void PduR_LoIfRxIndication(PduIdType PduId, const uint8* SduPtr); -void PduR_LoIfTxConfirmation(PduIdType PduId); -void PduR_LoIfTriggerTransmit(PduIdType PduId, uint8* SduPtr); +#if PDUR_ZERO_COST_OPERATION == STD_OFF + +Std_ReturnType PduR_ARC_RouteTransmit(const PduRDestPdu_type * destination, const PduInfoType * PduInfo); +void PduR_ARC_RouteRxIndication(const PduRDestPdu_type * destination, const PduInfoType *PduInfo); +void PduR_ARC_RouteTxConfirmation(const PduRRoutingPath_type *route, uint8 result); +Std_ReturnType PduR_ARC_RouteTriggerTransmit(const PduRRoutingPath_type *route, PduInfoType * PduInfo); +BufReq_ReturnType PduR_ARC_RouteProvideRxBuffer(const PduRDestPdu_type * destination, PduLengthType TpSduLength, PduInfoType** PduInfoPtr); +BufReq_ReturnType PduR_ARC_RouteProvideTxBuffer(const PduRRoutingPath_type *route, PduLengthType TpSduLength, PduInfoType** PduInfoPtr); + + +Std_ReturnType PduR_ARC_Transmit(PduIdType PduId, const PduInfoType* PduInfo, uint8 serviceId); +void PduR_ARC_RxIndication(PduIdType PduId, const PduInfoType* PduInfo, uint8 serviceId); +void PduR_ARC_TxConfirmation(PduIdType PduId, uint8 result, uint8 serviceId); +Std_ReturnType PduR_ARC_TriggerTransmit(PduIdType PduId, PduInfoType* PduInfo, uint8 serviceId); +BufReq_ReturnType PduR_ARC_ProvideRxBuffer(PduIdType PduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr, uint8 serviceId); +BufReq_ReturnType PduR_ARC_ProvideTxBuffer(PduIdType PduId, PduInfoType** PduInfoPtr, uint16 Length, uint8 serviceId); + +#endif #endif /* PDUR_IF_H_ */ diff --git a/include/PduR_LinIf.h b/include/PduR_LinIf.h index d07fca9e..181e5716 100644 --- a/include/PduR_LinIf.h +++ b/include/PduR_LinIf.h @@ -25,28 +25,12 @@ #include "PduR.h" -#if (PDUR_ZERO_COST_OPERATION == STD_OFF) +#if PDUR_ZERO_COST_OPERATION == STD_OFF - void PduR_LinIfRxIndication(PduIdType LinRxPduId,const uint8* LinSduPtr); - void PduR_LinIfTxConfirmation(PduIdType LinTxPduId); - void PduR_LinIfTriggerTransmit(PduIdType LinTxPduId,uint8* LinSduPtr); +void PduR_LinIfRxIndication(PduIdType LinRxPduId,const PduInfoType* PduInfoPtr); +void PduR_LinIfTxConfirmation(PduIdType LinTxPduId); +Std_ReturnType PduR_LinIfTriggerTransmit(PduIdType LinTxPduId,PduInfoType* PduInfoPtr); -#else // Zero cost operation active - - #if (PDUR_LINIF_SUPPORT == STD_ON) - - #define PduR_LinIfRxIndication Com_RxIndication - #define PduR_LinIfTxConfirmation Com_TxConfirmation - #define PduR_LinIfTriggerTransmit Com_TriggerTransmit - - #else - - #define PduR_LinIfRxIndication(...) - #define PduR_LinIfTxConfirmation(...) - #define PduR_LinIfTriggerTransmit(...) - - #endif - -#endif // Zero cost operation active +#endif #endif /*PDUR_LINIF_H_*/ diff --git a/include/PduR_Types.h b/include/PduR_Types.h index 515c5064..5f15bbec 100644 --- a/include/PduR_Types.h +++ b/include/PduR_Types.h @@ -25,6 +25,26 @@ #include "ComStack_Types.h" +typedef enum { + ARC_PDUR_UP_MODULES = 0, + ARC_PDUR_COM, + ARC_PDUR_DCM, + + ARC_PDUR_LOIF_MODULES, + ARC_PDUR_CANIF, + ARC_PDUR_LINIF, + ARC_PDUR_SOADIF, + + ARC_PDUR_LOTP_MODULES, + ARC_PDUR_CANTP, + ARC_PDUR_LINTP, + ARC_PDUR_SOADTP, + ARC_PDUR_SOAD, + + ARC_PDUR_END_OF_MODULES + +} ARC_PduR_ModuleType; + /** PduR_StateType defines the states of which the PDU router can be in */ typedef enum { PDUR_UNINIT, /**< PDU Router is not initialized. */ @@ -46,32 +66,9 @@ typedef enum { PDUR_DIRECT /**< Data provision type. */ } PduR_DataProvisionType; - - - -/* ################ NEW DEFINITIONS ################### */ +/* typedef struct { - Std_ReturnType (*TargetIndicationFctPtr)(PduIdType pduId, const uint8* data); /**< Pointer to target function in layer above PDU router. */ - Std_ReturnType (*TargetTransmitFctPtr)(PduIdType pduId, const PduInfoType* pduInfo); /**< Pointer to target function below PDU router. */ - - - void (*TargetConfirmationFctPtr)(PduIdType pduId); - - /** - * Target function for trigger transmit requests from the interface modules, e.g. Com_TriggerTransmit. Only - * needed if gateway mode is not used, that is, if .DataProvision is set to PDUR_NO_PROVISION. - */ - Std_ReturnType (*TargetTriggerTransmitFctPtr)(PduIdType pduId, uint8* data); - - Std_ReturnType (*TargetGatewayFctPtr)(PduIdType pduId, const PduInfoType* pduInfo); - -} PduR_FctPtrType; - -typedef struct { - /* - * Not part of autosar standard. Added by ArcCore. - */ uint16 BufferId; PduR_DataProvisionType BufferType; //uint8 SduLength; @@ -82,61 +79,48 @@ typedef struct { // uint8 TxIdx; // This is the same as First, hence left out. uint8 *Buffer; - /** - * Depth of buffer - */ + uint8 Depth; - /** - * Length of buffer - */ uint8 Length; } PduRTxBuffer_type; +*/ +typedef uint8 *PduRTxBuffer_type; -typedef struct { - /** - * The maximum numbers of Tx buffers. - */ - uint16 PduRMaxTxBufferNumber; // ??? - - PduRTxBuffer_type PduRTxBuffer[]; -} PduRTxBufferTable_type; +typedef enum { + PDUR_BUFFER_FREE = 0, + PDUR_BUFFER_RX_BUSY, + PDUR_BUFFER_TX_READY, + PDUR_BUFFER_TX_BUSY +} PduRTpBufferStatus_type; typedef struct { - /** - * PDU identifier assigned by the PDU router. - */ - uint16 SrcPduId; - - /** - * Reference to unique PDU identifier. - */ - // SrcPduRef - -} PduRSrcPdu_type; + PduInfoType *pduInfoPtr; + PduRTpBufferStatus_type status; +} PduRTpBufferInfo_type; typedef struct { /** * Data provision mode for this PDU. */ - PduR_DataProvisionType DataProvision; + const PduR_DataProvisionType DataProvision; /** * Reference to unique PDU identifier which shall * be used by the PDU router instead of the source identifier. */ - //DestPduRef - // For the moment replaced by this - uint16 DestPduId; + const uint16 DestPduId; /** * Reference to the assigned Tx buffer. * * Comment: Only required for non-TP gateway PDUs. */ - PduRTxBuffer_type *TxBufferRef; + PduRTxBuffer_type * const TxBufferRef; + + const ARC_PduR_ModuleType DestModule; } PduRDestPdu_type; @@ -152,19 +136,12 @@ typedef struct { } PduRDefaultValue_type; typedef struct { - /** - * Not part of standard - */ - PduR_FctPtrType FctPtrs; - uint8 PduR_Arc_EOL; - uint8 PduR_GatewayMode; - /** * Length of PDU data. * * Comment: Only required if a TX buffer is configured. */ - uint8 SduLength; + const uint8 SduLength; /** * Chunk size for routing on the fly. @@ -181,32 +158,21 @@ typedef struct { PduRDefaultValue_type PduRDefaultValue; /** - * Specifies the source of the PDU to be routed. + * Specifies the source ID of the PDU to be routed. */ - PduRSrcPdu_type PduRSrcPdu; + const uint16 SrcPduId; /** - * Specifies the destination(s) of the PDU to be routed. - * - * Comment: Multicast (many destinations) is not supported in this implementation. - */ - PduRDestPdu_type PduRDestPdu; - -} PduRRoutingPath_type; - -typedef struct { - /* - * Non-standards + * Specifies the source module for this route. */ - uint16 NRoutingPaths; + const ARC_PduR_ModuleType SrcModule; /** - * References to the routing paths defined for this configuration. + * Specifies the destination(s) of the PDU to be routed. */ - PduRRoutingPath_type PduRRoutingPath[]; - -} PduRRoutingTable_type; + const PduRDestPdu_type * const *PduRDestPdus; +} PduRRoutingPath_type; typedef struct { /** @@ -214,23 +180,15 @@ typedef struct { */ uint8 PduRConfigurationId; - /** - * The routing table of this PDU router configuration. - */ - PduRRoutingTable_type *PduRRoutingTable; - + uint8 NRoutingPaths; /** - * The buffers used for TP gateway operation. - * - * Comment: Not implemented in this version. + * The routing table of this PDU router configuration. */ - //PduRTpBufferTable_type PduRTpBufferTable; + const PduRRoutingPath_type * const*RoutingPaths; - /** - * The buffers used for non-TP gateway operation. - */ - PduRTxBufferTable_type *PduRTxBufferTable; + PduRTpBufferInfo_type *TpBuffers; + PduRTpBufferInfo_type **TpRouteBuffers; } PduR_PBConfigType; -- 2.39.2