UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
2,319 Views
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
Community Manager
Community Manager
1,991 Views
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.

 

Regards

Sikta

0 Kudos