TimeSlice parameter for OS_CreateTask()/OS_CreateTaskEx()

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • TimeSlice parameter for OS_CreateTask()/OS_CreateTaskEx()

    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.
  • Hello,

    we will check if we add a test for this parameter in OS_CreateTask()/OS_CreateTaskEx().

    Regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.