Embedded "C" Basic Concepts
Ali Shan??
Digital Design Engineer | Verification | Semiconductor Industry | FPGA Prototyping | Soc | Verification | RTL | Xilinx | PCIe | SDR | Biomedical | IEC62304
Basic Data Types
A data type is a classification of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support various types of data, including integer, real, character or string, and Boolean.
Eclipse "SDK" Basic Data Types
xbasic_types.h
xil_types.h
Local vs Global Variables
Variables in C can be classified by their scope
Local Variables
领英推荐
Global Variables
Other Application for the ‘static’ modifier
By default, all functions and variables declared in global space have external ?linkage and are visible to the entire program. Sometimes you require global ?variables or functions that have internal linkage: they should be visible ?within a single compilation unit, but not outside. Use the static keyword to ?restrict the scope of variables.
Volatile Variable
The value of volatile variables may change from outside the program.
For example, you may wish to read an A/D converter or a port whose value is ?changing.
Often your compiler may eliminate code to read the port as part of the compiler's ?code optimization process if it does not realize that some outside process is ?changing the port's value.
You can avoid this by declaring the variable volatile.