Context
I'm using the MCAL for the S32K344 version below
All modules have an Init function that takes in a configuration parameter
But in most examples, NULL is passed as this argument, as shown below
And I'm aware that this is somehow linked to the ConfiTimeSupport page in the ConfigTools, shown below
Questions
1. What is the difference between the two statements below?
2. How do I find the ConfigPtr for the module? I tried to find the Eth init parameter but had no luck
Thanks in advance for your help!
1. What is the difference between the two statements below?
If you configured Config Variant as Pre-Compile, you don't need to add Parameter for Init function (e.g Eth_Init(NULL) )
If you configured Config Variant as Post-Build, It's necessary to add pointer to your configure type name as parameter (e.g Eth_Init(&Eth_Config_BOARD_INITPERIPHERALS))
In Pre-Compile case, technically it will auto find the config in your module (normally, will be predefined for the name) and start the Init process.
In Post-Build case, Init function will find the config name which is given by Parameter in post-build time.
2. How do I find the ConfigPtr for the module?
You can check the generated files for corresponds module (for Eth, it can be Eth_BOARD_InitPeripherals_PBcfg.c then check config setup Eth_ConfigType, such as Eth_Config_BOARD_INITPERIPHERALS)