]> rtime.felk.cvut.cz Git - arc.git/blobdiff - diagnostic/Dcm/Dcm_Dsp.c
Removed REVIEW comments. Changed management to avoid sending PDids at the same time...
[arc.git] / diagnostic / Dcm / Dcm_Dsp.c
index c4c436ded7641def70d958e48ee47e85eeb1e481..47f9c8c35753798e5bd2ab482a87e3b559c1f2da 100644 (file)
@@ -190,6 +190,8 @@ void DspMemoryMainFunction(void)
 void DspPeriodicDIDMainFunction()\r
 {\r
        uint8 i;\r
+       boolean sentResponseThisLoop = FALSE;\r
+\r
        for(i = 0;i < dspPDidRef.PDidNr; i++)\r
        {\r
                if(dspPDidRef.dspPDid[i].PDidTxCounterNumber > dspPDidRef.dspPDid[i].PDidTxCounter)\r
@@ -198,9 +200,15 @@ void DspPeriodicDIDMainFunction()
                }\r
                else\r
                {\r
-                       dspPDidRef.dspPDid[i].PDidTxCounter = 0;\r
-                       /*AutoSar  DCM  8.10.5 */\r
-                       DslInternal_ResponseOnOneDataByPeriodicId(dspPDidRef.dspPDid[i].PeriodicDid);\r
+                       if( sentResponseThisLoop  == FALSE ) {\r
+                               dspPDidRef.dspPDid[i].PDidTxCounter = 0;\r
+                               /*AutoSar  DCM  8.10.5 */\r
+                               DslInternal_ResponseOnOneDataByPeriodicId(dspPDidRef.dspPDid[i].PeriodicDid);\r
+                               sentResponseThisLoop = TRUE;\r
+                       }\r
+                       else {\r
+                               /* Don't do anything - PDid will be sent next loop */\r
+                       }\r
                }       \r
        }\r
 }\r
@@ -1591,7 +1599,6 @@ void DspDcmConfirmation(PduIdType confirmPduId)
 }\r
 \r
 \r
-/* REVIEW JB 2012-06-05: Removed iSoft function header - please don't add iSoft specific headers in the future */\r
 static boolean CheckReadMemoryByAddress( boolean useId,uint32 memoryAddress,\r
                                                                                uint8 memoryAddressFormat,\r
                                                                                uint32 memorySize,\r
@@ -1795,7 +1802,6 @@ static boolean checkWriteMemoryByAddress(boolean useId,uint32 memoryAddress,
        else\r
        {\r
                MemoryId = (uint8)(memoryAddress >> ((memoryAddressFormat - 1)*8));\r
-               /* REVIEW JB 2012-06-05: See comment for corresponding read function */\r
                memoryAddress = memoryAddress & DCM_MEMORY_ADDRESS_MASK;\r
 \r
                if((MemoryId == dspMemory->MemoryIdValue) &&\r
@@ -1978,7 +1984,6 @@ static boolean checkPeriodicIdentifierBuffer(uint8 PeriodicDid,uint8 Length,uint
        return ret;\r
 }\r
 \r
-/* REVIEW JB 2012-06-05: Please describe the buffer algorithm because it is not obvious when looking at this function. */\r
 static void ClearPeriodicIdentifierBuffer(uint8 BufferEnd,uint8 postion)\r
 {\r
        dspPDidRef.dspPDid[postion].PeriodicDid = dspPDidRef.dspPDid[BufferEnd ].PeriodicDid;\r
@@ -2106,9 +2111,7 @@ static Dcm_NegativeResponseCodeType DspSavePeriodicData(uint16 didNr, uint32 per
        if(responseCode == DCM_E_POSITIVERESPONSE)\r
        {\r
                dspPDidRef.dspPDid[PdidBufferNr].PeriodicDid = (uint8)didNr & DCM_DID_LOW_MASK;\r
-                       /* REVIEW JB 2012-06-05: Why is TxCounter set to PdidBufferNr - it seems wrong. */\r
-               dspPDidRef.dspPDid[PdidBufferNr].PDidTxCounter = PdidBufferNr*3;\r
-\r
+               dspPDidRef.dspPDid[PdidBufferNr].PDidTxCounter = 0;\r
                dspPDidRef.dspPDid[PdidBufferNr].PDidTxCounterNumber = periodicTransmitCounter;\r
        }\r
        return responseCode;\r
@@ -2450,7 +2453,6 @@ static Dcm_NegativeResponseCodeType dynamicallyDefineDataIdentifierbyAddress(uin
                {\r
                        if((Length != 0)&&( Length * (AddressFormat + MemorySizeFormat) == (pduRxData->SduLength - 5) ))\r
                        {\r
-                               /* REVIEW JB 2012-06-05: Use better names than i and j to increase readability */\r
                                for(LengthCount = 0; (LengthCount < Length) && (responseCode == DCM_E_POSITIVERESPONSE); LengthCount++)\r
                                {\r
                                        MemoryAddress = 0;\r
@@ -2589,7 +2591,7 @@ void DspDynamicallyDefineDataIdentifier(const PduInfoType *pduRxData,PduInfoType
        uint16 DDIdentifier = ((((uint16)pduRxData->SduDataPtr[2]) << 8) & DCM_DID_HIGH_MASK) + (pduRxData->SduDataPtr[3] & DCM_DID_LOW_MASK);\r
        if(pduRxData->SduLength > 2)\r
        {\r
-               /* REVIEW JB 2012-06-05: Clarify that F2 and F3 is included by comment */\r
+               /* Check if DDID equals 0xF2 or 0xF3 */\r
                if((pduRxData->SduDataPtr[2] & 0xF2) == 0xF2)\r
                {\r
                        switch(pduRxData->SduDataPtr[1])        /*UDS_REQ_0x2C_2,DCM 646*/\r