Showing results for 
Search instead for 
Did you mean: 
Registered: ‎11-07-2013

Why SDK uses so many macros instead of inline function?

I'm just a beginner for embedded design.


While I was reading SDK exam codes, I found so many macro functions for setting up peripherals.


Inline function looks more convenient for developers but why mostly(maybe only) macros functions are used?


Does any one have any idea?

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
Registered: ‎06-14-2012

Re: Why SDK uses so many macros instead of inline function?

Software developers typically build different versions of executables, with different settings used to build those executables. For example, an application that is built for debugging uses a certain set of options (such as compiler flags and macro definitions), while the same application is built with a different set of options for eventual release to customers. SDK makes it easier to maintain these different profiles using the concept of build configurations.

Each build configuration could customize:

  • Compiler Settings: Debug and Optimization levels
  • Macros passed for compilation
  • Linker Settings

Hope this helps.




0 Kudos