0
794views
Structure of typical C source program for ARM based processor
1 Answer
0
2views

#include "Ipc214x.h" $\;$ // This is the header file that contains all info. about LPC 2148

/* Global variables - accessible by all functions */

int count, bob; $\;$ // global(static variables)


/* Function definitions */

int function1(char x){ $\;$ // parameter passed x to the fn, function returns an int value.

int i, j; $\;$ // Local(automatic) variable

--instructions to implement the function

}


/* Main program */

void main(void){

unsigned char sw1; $\;\;\;\Bigg\}$ Declare local variables

int k;

/* Initialisation section */

-- instns to initialise variables, I/O ports, devices, function register

/* Endless loop */

while(1){

-- instructions to be repeated $\;\;\;\Bigg\}$ Body of the program

}

}

Please log in to add an answer.