I mistakenly passed 0 as the TimeSlice parameter for OS_CreateTaskEx() calls when I was performing a wide-ranging refactoring; things continued to work at first glance, but with continued use things didn't behave well, but in a subtle, non-obvious way. I assume that 0 is invalid for a TimeSlice parameter, since the OS_SetTimeSlice() API docs mention:
1 <= TimeSlice <= 255
Note that this detail isn't called out in the OS_CreateTask()/OS_CreateTaskEx() API docs - it probably should be.
However, that wouldn't have prevented my problem, since it was an outright error by me. What would have helped me is if calling the task create APIs with an invalid TimeSlice would cause an OS_Error() (only if the DEBUG embOS build is in use, of course). I'm hoping you can add this API parameter debug check to a future embOS release so I'd get a fail-fast if I make this goof again by mistake.
1 <= TimeSlice <= 255
Note that this detail isn't called out in the OS_CreateTask()/OS_CreateTaskEx() API docs - it probably should be.
However, that wouldn't have prevented my problem, since it was an outright error by me. What would have helped me is if calling the task create APIs with an invalid TimeSlice would cause an OS_Error() (only if the DEBUG embOS build is in use, of course). I'm hoping you can add this API parameter debug check to a future embOS release so I'd get a fail-fast if I make this goof again by mistake.