FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2015 Threads] what is the function that returns an element of a listPosted by juhc on July 23, 2015 Hi,
What is the function that returns an element of a list without removing it in FreeRTOS?
I need to know the first task that was added in the list pxReadyTasksLists[configMAX_PRIORITIES-1].
Thanks in advance
what is the function that returns an element of a listPosted by rtel on July 23, 2015 The list functions are not part of the published API. I can probably tell you how to do what you want to do, but it is not clear what it is you want to do. Can you elaborate? When you say the "first task added in the list" do you mean the task that is at the front of the list, assuming tasks that were added after it are behind it in the list?
what is the function that returns an element of a listPosted by juhc on July 23, 2015 Yes, it is the task in the front of the list.
I want to know which task the scheduler will choose to execute at the next tick interrupt.
It's the task that has the highest priority, so if I'm not wrong, it's the task in the front of the ready list that contains the highest priority.
what is the function that returns an element of a listPosted by davedoors on July 23, 2015 You cant know which task the scheduler will choose to execute at the next tick interrupt until the tick interrupt executes because you cant predict if a task will unblock. Even when the tick interrupt executes you cant predict it because other interrupts might nest with the tick interrupt and unblock other tasks.
what is the function that returns an element of a listPosted by rtel on July 23, 2015 As already said, you can't tell which task will be selected in advance of it actually being selected, then you need to know which list to look in.
Which list to look in depends on the highest priority ready state task, which if you are using a port that supports port optimised task selection is determined by calling portGETHIGHESTPRIORITY() (that will use a count leading zero type instruction).
Once you know which list to look in you call listGETOWNEROFNEXTENTRY() to obtain the next TCB.
Look at the definition of taskSELECTHIGHESTPRIORITY_TASK() near the top of FreeRTOS/source/tasks.c to see how the macros are used.
Regards.
what is the function that returns an element of a listPosted by juhc on July 27, 2015 Thank you for your answer.
This is exactly what I wanted.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|