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] [June 2006 Threads] two bugs in tasks.cPosted by ares.qi on June 23, 2006 hello , guys
I find two bugs in tasks.c. Feel free to correct me if i'm wrong.
1. In vTaskPrioritySet apart from changing a TCB's uxPriority, we still need to chang TCB's xEventListItem.xItemValue
pxTCB->uxPriority = uxNewPriority; /*---------------------------------------*/ /* we have to add on this , i think */ listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) uxNewPriority );
2. in vTaskCleanUpResources
first , please tell me when and where i need to use this function
second, we only remove xGenericListItem , but we may have to remove xEventListItem if necessisary , i think.
RE: two bugs in tasks.cPosted by Richard on June 23, 2006 > 1. In vTaskPrioritySet > apart from changing a TCB's uxPriority, we still need to chang TCB's > xEventListItem.xItemValue > > pxTCB->uxPriority = uxNewPriority; > /*---------------------------------------*/ > /* we have to add on this , i think */ > listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), configMAX_PRIORITIES - > ( portTickType ) uxNewPriority );
I think you are correct. Thank you for bringing this to my attention, I will add a 'known issue' to the list on the download page of the FreeRTOS.org site.
This will have the effect of potentially an incorrect task being woken by an event if (1) Tasks of more than one priority are blocked waiting for the same event and (2) one of the blocked tasks has had it priority dynamically changed.
> 2. in vTaskCleanUpResources > > first , please tell me when and where i need to use this function > > second, we only remove xGenericListItem , but we may have to remove xEventListItem > if necessisary , i think.
This function is only used by the demos that run on top of DOS. It is a tidy up exercise before returning to DOS following the conclusion of a debug session. It is in fact not required at all as DOS will automatically free memory allocated by a program when the program exists. I did not realise that at the time of writing - not being a DOS/Windows person.
Thanks ares.qi - keep up the good work!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|