这个警告怎么弄没warning C291: not every exit path returns a value
这是代码
unsigned char KeyScan(void)
{
unsigned char num,tmp;
KeyPort = 0xf0;
if((KeyPort & 0xf0) != 0xf0)
{
delayus(10);
if((KeyPort & 0xf0) != 0xf0)
{
num = 0xfe;
while((num & 0x10) != 0)
{
KeyPort = num;
if((KeyPort & 0xf0) != 0xf0)
{
tmp = (KeyPort & 0xf0)|0x0f;
return((~num)+(~tmp));
}
else
num = (num << 1)|0x01;
}
}
}
else
return 0;
} |