新手上路
- 积分
- 37
- 金钱
- 37
- 注册时间
- 2015-7-25
- 在线时间
- 2 小时
|
1金钱
void LCD_ShowChar(u16 x,u16 y,u8 num,u8 size,u8 mode)
{
u8 temp,t1,t;
u16 y0=y;
u8 csize=(size/8+((size%8)?1:0))*(size/2);
num=num-' ';
for(t=0;t<csize;t++)
{
if(size==12)
temp=asc2_1206[num][t];
else if(size==16)
temp=asc2_1608[num][t];
else if(size==24)
temp=asc2_2412[num][t];
else return;
for(t1=0;t1<8;t1++)
{
if(temp&0x80)LCD_Fast_DrawPoint(x,y,POINT_COLOR);
else if(mode==0)LCD_Fast_DrawPoint(x,y,BACK_COLOR);
temp<<=1;
y++;
if(y>=lcddev.height)return;
if((y-y0)==size)
{
y=y0;
x++;
if(x>=lcddev.width)return;
break;
}
}
}
}
原子哥我源程序
请教一下 中间这个加粗的判断 temp这个值在这条语句内是什么。
|
最佳答案
查看完整内容[请看2#楼]
如果单说这个语句,
if(temp & 0x80) ......
意思是如果temp的最高位 D7位如果是1 与 0X80相与后结果也是 1
条件为真,运行后面的哪个语句,
目的就是检查temp的D7位,是不是1
|