I would like auto-skip the function if I compile project with bootkernel
Is it possible?
If you check the kernel files most of them already do something like this. You can see how DEBUG switch is implemented.
So in your case you might want to do this in the kernel file,
If you would like this function to be called, you can go to the Project-> Assembler-> Additional Options -> Type -DPLL_SDRAM
-D switch will direct the assembler to define a macro and pass it to the preprocessor. So if you compile and run the code pll_sdram() will be included.
If you remove this switch, then this function will not be included during boot.
I hope this was helpful.
It is possible. You can select which code needs to be compiled using #define.
Can you tell me how can I detect (in the code) that compilator will be compile loader file?
Does exist any flag?
Are you asking how u will detect if which piece of code was compiled by looking at the ldr file? I couldnt understand your previuos question.
I have got my own bootkernel, there is user initialization code for SDRAM and PLL etc.
if I compilie final code (ldr - that contain my bootkernel and application code) it is ok.
But during the debuging I have to use init_PLL_SDRAM() function that do the same as part of my bootkernel.
and for the final compilation I have to rem this function.
I wolud like to program code that auto skip function init_PLL_SDRAM()
if I complile the final code.
#if define "something like "NO - bootkernel""
Retrieving data ...