1 /*******************************************************************************
2 * FILE PURPOSE: A very simple test program used to verify IBL loading
3 *******************************************************************************
4 * FILE NAME: test1.c
5 *
6 * DESCRIPTION: A simple program that simply verifies the loading of
7 * several sections.
8 *
9 * @file test1.c
10 *
11 * @brief
12 * Verify the IBL
13 *
14 ********************************************************************************/
16 /**
17 * @brief Test loading some const sections
18 */
19 const unsigned int c1 = 0x12345678;
20 const unsigned int c2[] = { 0x11111111, 0x22222222 };
23 /**
24 * @brief Test load the cinit section
25 */
26 unsigned int cini1 = 0xabcd1234;
29 /**
30 * @brief The bss/far sections should not actually load
31 */
32 unsigned int cbss[100];
35 extern cregister volatile unsigned int TSCL;
36 /**
37 * @brief The text section which will include a switch
38 */
39 void main (void)
40 {
41 unsigned int v;
43 /* Start the system timer */
44 TSCL = 1;
47 /* Read the timer and put the value in the bss */
48 v = TSCL;
50 cbss[0] = v;
52 switch (v & 1) {
54 case 0: cbss[1] = c2[0];
55 break;
57 case 1: cbss[2] = c2[1];
58 break;
60 }
62 for (;;);
64 }