-
ContextI have built a hardware-servicing library for a mission-specific piece of hardware, whose functions are intended to be called from a separate Application. This library uses a global "LibData" structure similar to the AppData in cFS Applications to store status, counters, etc. The target platform uses armv5 Linux. QuestionIs it allowed to declare/define static variables in CFE_LIB objects? (Could these data be corrupted/dumped by other tasks?) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Sorry all. It was a dumb mistake. It turns out I missed there was another object named with an identical name elsewhere reserved for a test, which gets initialized just after the one I asked. Adding the static keyword eliminates the problem as it should. |
Beta Was this translation helpful? Give feedback.
-
|
Glad you figured it out! The answer is "yes" it's allowed but you do need to avoid conflicts! |
Beta Was this translation helpful? Give feedback.
Sorry all. It was a dumb mistake. It turns out I missed there was another object named with an identical name elsewhere reserved for a test, which gets initialized just after the one I asked. Adding the static keyword eliminates the problem as it should.