I want to change sleep behaviour and for this I want to override vPortSuppressTicksAndSleep, which is the planned way I guess because it has attribute( ( weak ) ).
Now I created a new .c file with my own vPortSuppressTicksAndSleep in it, without attribute( ( weak ) ) and ran into these problems:
There are several defines in port.c needed in this function, I simply copied them to my file. But it is not so nice.
There are three static variables in port.c that I can’t access as extern in another file, I get linker errors
As another solution I tried to put my vPortSuppressTicksAndSleep in a file that I include at the end of port.c but that results in an error “redeclaration of…”
The only solution I see now is to change port.c directly, which I wanted to avoid and which would make the attribute( ( weak ) ) useless.
(working with STM CubeIDE with GCC 10.3.1)
Thanks for any help
Those #defines and those static variables are specific to the SysTick timer. If you write your own version of vPortSuppressTicksAndSleep(), presumably you would use a different timer. Thus you wouldn’t need access to those #defines and static variables.
(this is for using STM32 low power timer, not mine)
As you can see, really only the interfaces of FreeRTOS are used.
If you actually want to keep using Systick, maybe what you want to solve can already be achieved with configPRE_SLEEP_PROCESSING or configPOST_SLEEP_PROCESSING.