task_ctrl
never blocks - which will prevent any task of equal or lower priority from ever running. So if task_player
is equal or lower priority the the task will never be scheduled even when the semaphore is given.task_ctrl
has lower priority that at least task_player1
(and lower than any task if it does not block - the idle task will never run in this case).task_ctrl
blocks - even if that is just a polling delay, so that it does not eat up all available CPU cycles.task_ctrl
is that it will give the semaphore continuously and repeatedly while the button is held. Some sort of state change detection and switch de-bounce rather then level polling might be preferable.