I have a question of the significance of a #if vs. #ifdef in *pxPortInitialiseStack() in port.c -
The first statement with TI_VFP_SUPPORT has an #if - the second has an #ifdef - is this done on purpose to get a certain behavior out of the preprocessor or is that just a typo?
For instance, if I did #defineTI_VFP_SUPPORT 0
then that may end up with a behavior I don’t want; or is that done on purpose?
I searched the project and I don’t find any #defineTI_VFP_SUPPORT anywhere and I haven’t located anything (yet) in the project settings.
Both are wrong according to the coding standard really - only #if( test
== condition ) should be used. Other than that there is no real
significance in the two you highlight. I think
portPRELOAD_TASK_REGISTERS is not a constant provided to the user, and
is just their to assist development, so it is not necessarily defined
anywhere, hence it uses a #ifdef.
You are better off copying the Cortex-A port rather than that port though.
Does your R4 device use a standard ARM GIC (Generic Interrupt
Controller)? If so then look at a Cortex-A9 port (there is one for GCC,
IAR and ARM compilers if I recall correctly). If your R4 device does
not use a GIC then look at the Atmel Cortex-A5 port as that is more
generic (uses callbacks into the application for interrupt controller
handling, rather than assuming a GIC is available).
It’s an R4F using a VIC - Vectored Interrupt Controller.
The port I have is ‘working’ as long as the tasks are all the same priority (IDLE task is starving) and I don’t have the FPU working correctly yet with the flop test/task.