This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

custom defines ineffetiveness issue

Hi, I am developing an application using Zephyr for nRF5340CPU. In the program there are the statements inserted to conditionaly display few parameters  on norma 16x2 alphanueric LCD. To conditionaly, include the LCD code in compilation, #define SEND_TO_LCD 1 is declared in main.h file. The code for LCD is written in another file (esp8266.c).  The code below is not included and remains unheiglighted as shown in attached iamge.

#ifdef SEND_TO_LCD 

while(temp<k){
lcd_data_byte(esp_buffer[temp]);
temp++;
if(temp==20)lcd_goto2(0);
else if(temp==40)lcd_goto3(0);
else if(temp==80)lcd_goto4(0);
}
#endif

Gulzar Singh

Parents
  • Hi Gulzar,

    Is the main.h file included in your esp8266.c? If it is, then the define will be there and it will be included by the preprocessor during the build.

    However, due to the way the nRF Connect SDK and Segger Embedded Studio is integrated you cannot always trust that the inactive code opacity works as expected. If that causes confusion or is annoying I suggest you turn it off to avoid confusion (Tools -> Options..., Then search for "Inactive" and set the Inactive Code Opacity).

    Einar

Reply
  • Hi Gulzar,

    Is the main.h file included in your esp8266.c? If it is, then the define will be there and it will be included by the preprocessor during the build.

    However, due to the way the nRF Connect SDK and Segger Embedded Studio is integrated you cannot always trust that the inactive code opacity works as expected. If that causes confusion or is annoying I suggest you turn it off to avoid confusion (Tools -> Options..., Then search for "Inactive" and set the Inactive Code Opacity).

    Einar

Children
Related