McuXpresso Preprocessor ignored

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

McuXpresso Preprocessor ignored

ソリューションへジャンプ
4,732件の閲覧回数
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,551件の閲覧回数
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,552件の閲覧回数
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,684件の閲覧回数
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,678件の閲覧回数
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,709件の閲覧回数
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.png

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

BR,
Edwin.

 

0 件の賞賛
返信