Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

two bugs in tasks.c

Posted 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.c

Posted 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!


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS