Compilation Errors. Microc Pro Problem

Beta Testing discussion on mikroC PRO for PIC.
Post Reply
Author
Message
CarlosfgCosta
Posts: 10
Joined: 23 Jan 2014 17:49

Compilation Errors. Microc Pro Problem

#1 Post by CarlosfgCosta » 30 May 2014 11:39

Hello.

I have a Program running on PIC32. I use MicroC Pro for developing.

I have a variable that I remove all the places where I was putting it to '1' -> so it is allways '0'.
In a function called in main I had:

Func_1
{
if(UART_COM.F_TramaRecebida)
{//indica que recebeu uma trama
DisableInterrupts();
.....
EnableInterrupts();
}
UART_COM.F_TramaRecebida = 0;
}

The UART strut it is like this:

typedef struct UART
{
unsigned char cEstadoCom;
unsigned char cDeviceID;
unsigned char cIdentityState;//F_IdentityResquest;
unsigned char cPrimeiroByteRecebido;
unsigned char cBufferRececao[KP_TamanhoBuffRececao_COM];
unsigned char cBufferEnvio[KP_TamanhoBuffEnvio_COM];
unsigned char cByteEnviado;
unsigned char cByteA_Enviar;
unsigned char cByte_MessageID;
unsigned char F_TramaRecebida; //Indica que foi recebida uma trama e que deve ser analisada
unsigned char cPosVecInic;//Posição inicial do vetor de dados recebidos da uart1
unsigned char cPosVecFinal;//Posição final do vetor de dados recebidos da uart1
unsigned char UniqueID[16]; //Unique ID do equipamento

unsigned int cTimeoutByte;
unsigned int cTimeoutAssignedAddress;
unsigned int cTpMIN_AssignedAddress;
};


----------------------

In a debug mode I had a breakpoint at 'DisableInterrupts();'. Runing the debugger when its stop on 'DisableInterrupts()' the value of
'UART_COM.F_TramaRecebida' it's '0'.

I think that there is something on the compiler..

I also tried with different code optimization and the result is the same.


I tried with Ño optimization (unchek 'SSA opti.') but as I am using Visual TFT and it report an error on
'TFT_Set_Active(Set_Index, Write_Command, Write_Data);'.



I allready had some problems with the compiler because of the optimizations.
for example:
If I have the instructions:
AAA;
BBB;
CCC;
DDD;
EEE;

The compiler don't use the same order, doing sometrhing like:
BBB;
DDD;
CCC;
EEE;
AAA;

Can you help me with this?

Tks
Carlos Costa

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: Compilation Errors. Microc Pro Problem

#2 Post by marina.petrovic » 02 Jun 2014 14:34

Hi,

Please, can you send me some small project (zipped project folder) which demonstrate problem that you have so I can test it on my system and try to find where the problem occurs?

Also, please, can you tell me which hardware you use?

Best regards,
Marina

CarlosfgCosta
Posts: 10
Joined: 23 Jan 2014 17:49

Re: Compilation Errors. Microc Pro Problem

#3 Post by CarlosfgCosta » 02 Jun 2014 14:50

Can you please send me your email to send my zip project file?

Tks.
Carlos Costa

MaGiK
Posts: 897
Joined: 19 Apr 2013 10:00

Re: Compilation Errors. Microc Pro Problem

#4 Post by MaGiK » 02 Jun 2014 18:17

Hello Carlos Costa :D

It's Marina/at/mikroe/dot/com

Best Regards
My hobby is collecting MikroElektronika products.
Gotta catch them all!

Post Reply

Return to “mikroC PRO for PIC Beta Testing”