How to change the priority of the main(main thread) when using RTOS

It is the usual practice in the RTOS. I set the most lowest priority to main thread, to be used as an idle task.

change the priority of the main thread

#include "mbed.h"
#include "rtos.h"

int main()
{
    osThreadSetPriority(osThreadGetId(), osPriorityIdle);

    while (true) {
    ...
    }
}


1 comment on How to change the priority of the main(main thread) when using RTOS:

08 Mar 2018

Hello Takuya-san,

It's a very handy hint. Thank you so much for sharing!

Best regards,

Zoltan

Please log in to post comments.