Conditional compilation according to selected TR module type, OS and DPA version

<< Click to Display Table of Contents >>

Navigation:  Tips and Tricks >

Conditional compilation according to selected TR module type, OS and DPA version

According to selected TR module, respective command line option (-DTR52D, -DTR54D etc.) is automatically inserted at compilation. This can be utilized also in user code. Example:

...

#ifdef TR52D

    ...  // my code

#endif

...

 

According to selected IQRF OS, respective command line option (-DIQRFOS=302, -DIQRFOS=303 etc.) is automatically inserted at compilation. This can be utilized also in user code. Example:

...

#if IQRFOS >= 303

 #message Compilation for IQRF OS version 3.03D or higher

#else

 #error Invalid IQRF OS version

#endif

...

 

According to selected DPA version, respective command line option (-DDPA=102, -DDPA=100 etc.) is automatically inserted at compilation. This can be utilized also in user code. Example:

...

#if DPA == 102

 #message Compilation for DPA version 1.02

#else

 #error Invalid DPA version

#endif

...