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] [February 2017 Threads]
I'm learning FreeRTOS currently, I will try to write down what I learned from the source code and share it in this forum. hope it can help the beginner, and if I have made some mistake, it will be highly appreciated if some one can point out.
Don't know how to insert picture, attached picture is how I understood the List of FreeRTOS.
Another picture to explain the function:
void vListInsert( Listt * const pxList, ListItemt * const pxNewListItem )
Picture to explain the function:
UBaseTypet uxListRemove( ListItemt * const pxItemToRemove )
Hi John, thanks for the clear pictures. That all looks correct to me.
As you can see, the List_t
type has been implemented with a minimum RAM footprint. All items (elements) know to which list they belong, if any. Each node in the list is part its object.
For instance, an example taken from FreeRTOS+TCP: a network buffer is either linked into a free list or into a list of occupied buffers. In order to make it linkable, it gets a ListItem_t
field:
~~~~
typedef struct xNETWORKBUFFER
{
ListItemt xBufferListItem; /* Used to reference the buffer form the free buffer list or a socket. /
uint32_t ulIPAddress; / Source or destination IP address, depending on usage scenario. /
uint8_t *pucEthernetBuffer; / Pointer to the start of the Ethernet frame. */
...
} NetworkBufferDescriptor_t;
~~~~
Now xBufferListItem
will always point to one of the two lists. You can add more ListItem_t
's to your objects to make them linkable to several lists.
The List_t
type has been exposed in a header file, but normally developers will not make use of them. It is a type definition "internal to the kernel". But you're free to use it, of course. Note that with a few additions (wrappers), you can create both FIFO's and stacks, based on List_t
.
Other objects are more important for most developers: Queue's, Semaphores, Event-Groups and the mechanisms to notify (and wake-up) a task.
Hello Hein, your explanation help me a lot to move forward, Thank you very much Sir!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.