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] [December 2012 Threads] Structure visibility limitationsPosted by Mark Samarin on December 16, 2012 Having typedefs in the .c files rather than in the .h files makes things somewhat inconvenient.
For instance, I would like to look into the tskTaskControlBlock structure for some realtime diagnostics of my own but because the structure is invisible I have to make a copy of it locally, which of course is dangerous if any future changes to the structure are made.
Is this necessary because of the conditional compilation parameters?
RE: Structure visibility limitationsPosted by Dave on December 16, 2012 This has been discussed a few times and the answer is always "the source code follows good engineering practice". In a way you show the reason why in your question. Think of it in terms of a C++ class. There are the public definitions and the private definitions. The private definitions exist for a reason, one of which is to prevent users accessing the internal workings directly because the internal workings might change. So the private section prevents updates in the implementation of the C++ class breaking applications that make use of the class. FreeRTOS is not C++ but the principal is the same. “because the structure is invisible I have to make a copy of it locally, which of course is dangerous if any future changes to the structure are made” and if the structure was public and it changed that too would break your code so it makes no difference. Some people prefer it one way, the more academic engineers prefer it the other.
RE: Structure visibility limitationsPosted by Mark Samarin on December 24, 2012 because the structure is invisible I have to make a copy of it locally, which of course is dangerous if any future changes to the structure are made
"and if the structure was public and it changed that too would break your code so it makes no difference."
That's not true if I am accessing elements in the structure that have not changed and I fully rebuild. In most cases this would be the case as typically things would be added to the structure, not modified.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|