Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: remove duplicate diagram, kept copy of original diagram because it showed the correct preview

...

A typical sample application source code file is organized as follows:

Gliffy
imageAttachmentIdatt194084865
baseUrlhttps://dustcloud.atlassian.

...

net/wiki
migration1
namefile_organization Copy
diagramAttachmentIdatt194084869
containerId7503874


Module Variables

By convention, the variables of a module are grouped into a structure declared globally at the beginning of the file.

...

  • It reduces name collision with variables from other modules.
  • It allows a developer to watch all the variables at once during debug by watching a single structure.
  • It allows different functions to easily access the same variables without requiring pointers to be passed between functions.

    Note

    If different tasks access the same variables, make sure to protect the access to the variables, for example through a semaphoremutex.


  • Since The stack space does not need to change when variables are added/removed, since modules variables are statically allocated , rather than allocated from a task's stack, the stack space does not need to change when variables are added/removed.
  • These variables This structure can include the declaration of the stack space for the different tasks, which need to be done globally.

...

  • 4 spaces are used for indentation. Tabulations Tabs are never used.
  • Source code is written to not exceed a width of 80 columns.
  • Selected function functions are commented using Doxygen syntax.