autosarzs / Dev

Development AUTOSAR
Mozilla Public License 2.0
50 stars 21 forks source link

Dev can write main write fixed #57

Closed Muhammed-ELGendy closed 4 years ago

Muhammed-ELGendy commented 4 years ago

Can_Write 1- Det_ReportError function is called not left as a comment. 2- ui32Base , hth_index , Hth_count , Hoh_count and real_hwObjectId are defined with zeros not declared only. 3- Made #endif correct as it was used in a wrong way. 4- including Std_Types.h before using STD_ON which is defined in Std_Types.h , While STD_ON was used in Can_Cfg.h before including Std_Types.h . 5- Edited the blocking loop problem, [SWS_Can_00275] The function Can_Write shall be non-blocking, while it is blocking to check CANIF1CRQ register. 6- Edited the code to perform no actions if the hardware transmit object is busy and return CAN_BUSY as [SWS_Can_00213] says.

Can main function write 1- [ECUC_Can_00318] CanTxProcessing is a parameter in CanController struct , I added CanTxProcessing inside CanController struct. 2- Using if statement for each controller ( to check for CONTROLLER_0/1_ID in the second if statement inside the loop, POLLING and MIXED or CAN_CONTROLLER_ACTIVATION ) is not generic . what if we have 5 or more controllers ?! To make it more generic , I have edited it using array. 3- NUM_OF_HOH should be declared by casting to uint8 4- In the second if statement inside the loop (left operand), &Global_Config is a wrong access. It should be written without ampersand operator according to Global_Config declaration. 5- In the second if statement inside the loop (left operand), CanControllerRef is accessed incorrectly as an array. CanControllerRef is a CanController pointer. In contrast, CanControllerRef is defined as an object of struct in Can_Pbcfg.c 6- MessageObjAssignedToHOH is not defined or declared in any file (HOH is not defined but HTH and HRH are defined).

Can_DeInit 1- Made Can_DeInit more generic instead of using if statement for each controller ( to check for ControllerState )

Can_Disable/EnableControllerInterrupts 1- Made Can_Disable/EnableControllerInterrupts more generic instead of using if statement for each controller 2- Added else in Can_EnableControllerInterrupts to fit MISRA