Logo F2FInterview

Embedded System Interview Questions

Q   |   QA

Macros and Inline functions are efficient than calling a normal function. The times spend in calling the function is saved in case of macros and inline functions as these are included directly into the code.

Macros and inline functions increased the size of executable code. 

Because in C when you say the name of the array it means the address of the first element.
example :
int a[];
func (a);
int func(int a[]);

In this when you call the function by passing the argument a actually &a[0](address of first element) gets passed. Hence it is impossible to pass by value in C. 

interrupt latency is the time required to return from the interrupt service routine after tackling a particular interrupt. We can reduce it by writing smaller ISR routines. 

1) Volatile:
A variable should be declared volatile whenever its value could change unexpectedly. In practice, only three types of variables could change:

  • Memory-mapped peripheral registers
  • Global variables modified by an interrupt service routine
  • Global variables within a multi-threaded application

2) Constant:
The addition of a 'const' qualifier indicates that the (relevant part of the) program may not modify the variable. 

Static variables can only be accesed in the files were they are declared.

Static variable within the scope of a function store it's values in consecutive calls of that function.

Static functions can only be caled within the file they are defined. 

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: