McuXpresso Preprocessor ignored

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

McuXpresso Preprocessor ignored

跳至解决方案
4,767 次查看
SimoneColomboWEG
Contributor III

Hi,

im using mcuxpresso version 24.12 [Build 148] [2025-01-10], i'm usually use a preprocessor for global define but with a wrong behaviur of code i've checked that a preprocessor define is ignored by compiler and not by intellisense.

i've attached a immagine that show PROTOCOL_ACTIVATED on preprocessor , correctly the code is masked from intellisense but compile (i've generated an error).

#ifndef PROTOCOL_ACTIVATED

static bool err;

uint16_t sumT = 0;

uint16_t sumR = 0

for( int i = 0; i < TRANSFER_SIZE; i++ )

{

sumT += masterTxData[i];

sumR += masterRxData[i];

}

 

if( sumT != sumR )

{

if( err == false )

{

PRINTF( "SPI Data err\r\n" );

err = true;

}

}

else

{

err = false;

}

#else

static uint16_t Error;

Error = CNT_Spi_Handler(pCNT_SPI_RX_Data); //&masterRxData[0]

// To Be Done Gestione Errori! //

#endif

 

where is the problem?!

Simone

0 项奖励
回复
1 解答
4,586 次查看
SimoneColomboWEG
Contributor III

Goodmorning EdwinHz i was going to exportating the code then open a case on yoyur link but now i just saw that preprocessor is not ingnore anymore, i don't know because today works! anyway thanks for your support, i close my issue without understand where the issue was.  thanks again!

Simoone

在原帖中查看解决方案

0 项奖励
回复
4 回复数
4,587 次查看
SimoneColomboWEG
Contributor III

Goodmorning EdwinHz i was going to exportating the code then open a case on yoyur link but now i just saw that preprocessor is not ingnore anymore, i don't know because today works! anyway thanks for your support, i close my issue without understand where the issue was.  thanks again!

Simoone

0 项奖励
回复
4,719 次查看
SimoneColomboWEG
Contributor III

Thanks for replied, i can't build in release, i don't use a different profile. i think is a problem that comes from a particular configuration from by project, is more of curiosity instead a real problem. i can work with a general define on code. if you want i can share with you my code (privatelly if is possible) if you can help me to find the issue.

Simone

0 项奖励
回复
4,713 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @SimoneColomboWEG,

Of course. You can share your code privately via a ticket on the following link: https://support.nxp.com/s/?language=en_US

Simply tag my name on the ticket's description and I will continue supporting you via that medium.

BR,
Edwin.

0 项奖励
回复
4,744 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @SimoneColomboWEG,

That's interesting. On my tests, when the conditional code is not true, the error messages of the controlled text do not matter (i.e. the compiler ignores the syntax errors, opposite to what happens on your side):

2025-02-07_11-55-56.png2025-02-07_11-55-56.png

Does this happen in both Debug and Release build configurations for you?

BR,
Edwin.

 

0 项奖励
回复