get optimization level at compile time Sysprogs forums › Forums › VisualGDB › get optimization level at compile time This topic has 0 replies, 1 voice, and was last updated 3 years, 10 months ago by Johanan. Log In Register Lost Password Viewing 1 post (of 1 total) Author Posts January 31, 2021 at 08:16 #29864 JohananParticipant Hi, Is there a way to know optimization level at compile time (STM32)? for example: //————————————- void _delay_us_x(int dly) { while (dly–) __NOP(); } #if (_OPTIMIZE_LEVEL_ == 0) #define delay_us(x) _delay_us_x(x*4) #else #define delay_us(x) _delay_us_x(x*8) #endif //—————————————— Thanks This topic was modified 3 years, 10 months ago by Johanan. Author Posts Log In Register Lost Password Viewing 1 post (of 1 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In