CMSIS_4 icon indicating copy to clipboard operation
CMSIS_4 copied to clipboard

add optional callback for task switching

Open menete opened this issue 9 years ago • 1 comments

For reasons of system monitoring it is sometimes desirable to have the ability to track task switches. This patch does add a function (rt_switch_prehook) implemented as weak reference. As of now this is implemented with __weak keyword of armcc. GCC (__attribute__((weak))) and IAR (#pragma weak) have similar features, but would require some compiler selective coding. If there is some feedback on this patch I can add support for those compilers.

menete avatar Jan 11 '16 17:01 menete

Such a hook would be really great. Please add it to the RTOS. Nitpicking: I would prefer if the function was called rt_preswitch_hook() because it is a hook that is executed before switching the context. What would a pre-hook be? :-)

ombre5733 avatar Jan 25 '16 09:01 ombre5733