This post describes the types of variables and how to use them.
Variables are divided into static and dynamic variables (local and register variables). Static variables are assigned to static addresses in RAM and can retain their values after the function exits. Dynamic variables are allocated to the stack area or general-purpose registers and cannot retain their values after the function exits.
Usage Example
Static variables
Dynamic variables
var_a
var_b
var_c
var_d
var_e
Interface variables between c-files through header files.
Ex) Intercomponent interface variable (global variable)
Interface variables between functions in func.c.
Ex) Interface variable between unit functions within a component.
Static variables in func1 function.
Dynamic variables of func1 function.
Dynamic variables of func1 function. Processing time is fast.