This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: Replacing delay_cycles with task sleep

Part Number: MSP432E401Y

Hello forum!

Using software delay routines in a RTOS is not a good idea, because the execution of other tasks is blocked.

But I have some pieces of code where this is done. So I decided to replace them with task_sleep functions. When there argument of the delay_cycles function is small, than it mazbe makes no sense to switch to antohher task instead. But if the argument is big, than it's worth to switch to another task.

Is there a rule of thumb when to choose task_sleep over delay_cycles? I would say if the resulting delay is more than a millisecond, the period of the system clock.

BR Guenther

  • Hello Guenther,

    To be perfectly candid, our support team for this device family is more experts on microcontroller hardware than RTOS software development. If there is a rule of thumb of note, it's beyond our knowledge to really comment on such.

    You may want to try a more general software forum like stackoverflow to get the inputs of developers there.

    Best Regards,

    Ralph Jacobi

  • Hi,
    I think the argument to Task_sleep() is in milliseconds, so one ms is the minimum delay. Even that is quite a long time (120,000 clock cycles) so my instinct would be to use it. It also gives the OS an opportunity to do something more important if necessary Slight smile

    Best regards

    Jim