Undefined Priority

aczento wrote on Saturday, July 26, 2008:

Hi there,

I examined FreeRTOS in depth a little bit the last few days and came across some questions I’d like to discuss with you. I will start a new thread for each question, because they belong to different categories. I also need some webspace for uploading images to explain my other questions, it will take while before I will post them. So lets beginn with the first simple one:

In the FreeRTOS configuration I specified 8 priorities as: #define configMAX_PRIORITIES    ( ( unsigned portBASE_TYPE ) 8 ).
Then I created a task with a priority of 41. Well, compiling the sources and running it (on ATmega128) shows that everything is working well. Even the task with 41 priority. Examination with a logic analyzer showed, that this task executes as a task with mid Priority such as 3 or 4.

Can anyone explain that behaviour?

Best Regards,
Alex

woops_ wrote on Saturday, July 26, 2008:

If you study the source code then you see the code

    if( uxPriority >= configMAX_PRIORITIES )
    {
        uxPriority = configMAX_PRIORITIES - 1;
    }
so it is limited.

aczento wrote on Saturday, July 26, 2008:

Thanks for the answer. I think I missed that line in the sources.

Best Regards,
Alex