void PutMsg(unsigned char left, unsigned char tLine, unsigned char *msg){
unsigned char side;
screen_left = left;
screen_line = tLine;
if(screen_left > 64){
screen_left -= 64;
SetPin(GLCD_CS1);
ClrPin(GLCD_CS2);
side = 1;
}else{
SetPin(GLCD_CS2);
ClrPin(GLCD_CS1);
side = 0;
}
GLCD_Write_Cmd(0xB8+screen_line);
GLCD_Write_Cmd(0x40+screen_left);
while(*msg){
if(screen_left > 63){
screen_left=0;
if(side == 0){
SetPin(GLCD_CS1);
ClrPin(GLCD_CS2);
side = 1;
GLCD_Write_Cmd(0xB8+screen_line);
GLCD_Write_Cmd(0x40);
} else {
screen_line+=1;
SetPin(GLCD_CS2);
ClrPin(GLCD_CS1);
side = 0;
GLCD_Write_Cmd(0xB8+screen_line);
GLCD_Write_Cmd(0x40);
}
}
PutChar(*msg++);
screen_left += 8;
}
}