目录
前往《Autosar深入理解-总目录》
前往《教你如何阅读Autosar代码-总目录》
1 P2VAR
/* P2VAR macro for the declaration and definition of pointers in RAM, pointing to variables
ptrtype type of the referenced variable memory class
memclass classification of the pointer variable itself
ptrclass defines the classification of the pointer’s distance
*/
# define P2VAR(ptrtype, memclass, ptrclass) ptrtype*
ptrtype:被指向的变量的类型;
memclass:指针变量本身的分类;
ptrclass:定义指针距离的分类;
编译器抽象应该定义P2VAR宏,用于在RAM中声明和定义指向变量的指针。
指针本身是可修改的(例如:ExamplePtr++)。
指针的目标是可修改的(例如*ExamplePtr = 5)。