Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
titleListing - Listing 1.1 Example #1, TEST.C
linenumberstrue
#include  "includes.h"                                           (1)
 
#define       TASK_STK_SIZE            512                       (2)
#define       N_TASKS                   10
 
 
OS_STK        TaskStk[N_TASKS][TASK_STK_SIZE];                   (3)
OS_STK        TaskStartStk[TASK_STK_SIZE];                       (4)
char          TaskData[N_TASKS];                                 (5)
OS_EVENT     *RandomSem;                                         (6)


Panel
bgColor#f0f0f0

(1) First, you will notice that there is only a single #include statement. That’s because I like to place all my header files in a ‘master’ header file called INCLUDES.H. Each source file always references this single include file and thus, I never need to worry about determining which headers I need; they all get included via INCLUDES.H. You can use your code editor to view the contents of INCLUDES.H which is also found in the SOURCE directory.

I will get back to Listing 1.1 later as needed. Like most C programs, we need a main() as shown in Listing 1.2.

...