autosarzs / Dev

Development AUTOSAR
Mozilla Public License 2.0
52 stars 19 forks source link

Can if containers #54

Closed moh1139 closed 4 years ago

moh1139 commented 4 years ago

Made Modifications to follow our last meeting notes. Meeting Notes: 1- Add word to the suffix of each struct name, to follow the AUTOSAR naming convention

2- All #defines are in UpperCase, whether it's a pre-compile parameter or not, and with underscores between each word (after the module name) Example: _DISPATCH_USER_CHECK_TRCV_WAKE_FLAG_INDICATION_UL

3- Variables are in LowerCase with it's first letter in UpperCase

4- Data type of enum paramters in the structure has to be the same as the defined in the Cfg file Example: typedef uint8 CANIF_DISPATCH_USER_CTRL_BUS_OFF_UL;

define CAN_SM ((CANIF_DISPATCH_USER_CTRL_BUS_OFF_UL)0x00)

define CDD ((CANIF_DISPATCH_USER_CTRL_BUS_OFF_UL)0x01)

typedef struct{ CANIF_DISPATCH_USER_CTRL_BUS_OFF_UL CanIfDispatchUserCtrlBusOffUL; }CanIfDispatchCfgType;

5- Function names that will be passed, should be without () Example:

if(CANIF_DISPATCH_USER_CTRL_BUS_OFF_UL==CAN_SM)

#define CANIF_DISPATCH__USER_CTRL_BUS_OFF_NAME    CanSM_ControllerBusOff /* no ( ) at the end of the function name */

else if(CANIF_DISPATCH_USER_CTRL_BUS_OFF_UL==CDD)

#define CANIF_DISPATCH__USER_CTRL_BUS_OFF_NAME    Cdd_ControllerBusOff /* no ( ) at the end of the function name */

endif

6- PostBuild paramaters that has variables in the struct don't need to make a #define for its init value, it's value will be assigned from the PostBuild file (in the struct object)

Side Note: