xpress_embedo
Advanced Member level 4
I am having a very good experience with the HiTech C Compiler, but today when i am trying to experimenting something i get stuck in a strange error,
compiler givies me error that it can't create code for this expression,
can anyone help me to solve this problem..
i am using pic18f4550 for my programming purpose and attaching the small module which is giving error
Pls tell me how to solve this problem.
I had tried this code for 8051 Controller and it works fine in keil but when importing code for pic and using hi-tech c compiler it doesn't works, pls suggest me some thing.
Even changing lines to this doesn't solve my problem
Waiting for reply
Thanks in Advance
compiler givies me error that it can't create code for this expression,
can anyone help me to solve this problem..
i am using pic18f4550 for my programming purpose and attaching the small module which is giving error
Code:
#include <htc.h>
#ifndef GLCD_CS1
#define GLCD_CS1 PORTBbits.RB0 // Chip Selection 1
#endif
#ifndef GLCD_CS2
#define GLCD_CS2 PORTBbits.RB1 // Chip Selection 2
#endif
//Function Prototype
void Select_Side(bit side);
void main()
{
TRISB = 0x00;
Select_Side(0); [color:red][B][I]//ERROR at this line "can't generate code for this expression"[/I][/B][/color]
while(1);
}
//Function definition
void Select_Side(bit side)
{
if(side) [color:red][B][I]//ERROR at this line "can't generate code for this expression"[/I][/B][/color]
GLCD_CS2 = 1;
else
GLCD_CS1 = 1;
}
Pls tell me how to solve this problem.
I had tried this code for 8051 Controller and it works fine in keil but when importing code for pic and using hi-tech c compiler it doesn't works, pls suggest me some thing.
Even changing lines to this doesn't solve my problem
Code:
void Select_Side(bit side)
{
if(side == 1) [color:red][B][I]//ERROR at this line "can't generate code for this expression"[/I][/B][/color]
GLCD_CS2 = 1;
else
GLCD_CS1 = 1;
}
Waiting for reply
Thanks in Advance