Sobakava
Full Member level 6
PIC C Code Conversion
I'm converting a graphic LCD routine to CCS C Compiler:
?
I'm converting a graphic LCD routine to CCS C Compiler:
Code:
void LCD_PutPixel(unsigned char x, unsigned char y, unsigned char Set)
{
unsigned int XY;
unsigned char bitByte;
XY=0x200;
XY=XY+(y*40);
XY=XY+(x/6);
LCD_SendData(XY & 0x00FF);
LCD_SendData(XY>>8);
LCD_SendCmd(0x24); //pointer set
bitByte=5-(x % 6);
Set? bitByte|=0xF8: bitByte|=0xF0;
LCD_SendCmd(bitByte); //0b1111SXXX , s is set/reset, xxx is bit
///number xxx
//(Each memorybyte i six graphics bits (pixels))
}
CCS Did not recognized this line:
Set? bitByte|=0xF8: bitByte|=0xF0;
is it the same thing with:
if (Set==0) { bitByte|=0xf8;}
else
{bitByte|=0xf0;}
or should it be:
if (Set==1) { bitByte|=0xf8;}
else
{bitByte|=0xf0;}
?