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 2008 Threads] small suggestion / requestPosted by Ben on February 1, 2008 Can I ask for a small modification to FreeRTOS. I like the configUSE_TRACE_FACILITY option but I notice you are using sprintf to format the output, which has a rather large overhead by the time the appropriate library functions are included. It is something like 20k under GCC, while the RTOS code that gets included is only around 600 bytes.
As it happens I have my own cut down version of sprintf which of course I can easily substitute in task.c, but of course this will get over written should I upgrade it at any time, so my suggestion would be to add
#ifndef SPRINTF_FUNCTION #define SPRINTF_FUNCTIONsprintf #endif
to the top of task.c, and change
sprintf( pcStatusString, ( portCHAR * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );
to
SPRINTF_FUNCTION( pcStatusString, ( portCHAR * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );
that way it can easily be overridden from FreeRTOSConfig.h to point to an alternative function.
RE: small suggestion / requestPosted by woops_ on February 1, 2008 That is a good idea. There are two small sprintf implementations in the FreeRTOS code already. One in the cortex code and another somewhere I forget. Once of these could be used by default using this method.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|