cancel
Showing results for 
Search instead for 
Did you mean: 

Conflicting definitions for PI between TouchGFX and DSP

ERROR
Associate III

Look at this beauty. 

In touchgfx\framework\include\touchgfx\hal\Types.hpp:

static const float PI = 3.14159265358979323846f; ///< PI

In CMSIS-DSP\Include\dsp\fast_math_functions.h

#ifndef PI
  #define PI               3.14159265358979f
#endif

Fortunately, the conflict is caught at compile time.
It’s an exceptionally rare situation when you might need something from TouchGFX (e.g., instrumentation) and CMSIS-DSP at the same time — but when it happens, you get this delightful collision.

Just in case anyone is compiling a list of tricky interview questions.

0 REPLIES 0