#include <hidef.h> /* common defines and macros */
#include "xgate.h"
#include "MC9S12XEP100.h"
#pragma push
#pragma DATA_SEG SHARED_DATA /* allocate the following variables in the segment SHARED_DATA */
extern volatile word NumOfSDBuff1;
extern volatile word NumOfSDBuff2;
extern volatile word NumOfNetBuff1;
extern volatile word NumOfNetBuff2;
extern volatile byte DataValid;
extern volatile byte BuffSelect;
extern volatile byte SDBuff1[2048];
extern volatile byte SDBuff2[2048];
extern volatile byte NetBuff1[1024];
extern volatile byte NetBuff2[1024];
#pragma pop
#pragma DATA_SEG DEFAULT
volatile static byte CurrentBuff;
volatile static byte AddTime;
static
byte geth4bit(byte candata) /* 取字节高4位 转为对应字符*/
{
if((candata>>4 + 0x30) > 0x39) return (byte)(candata>>4 + 0x07);
return (byte)(candata>>4);
}
static
byte getl4bit(byte candata) /* 取字节低4位 转为对应字符*/
{
return ((candata&0x0F + 0x30)> 0x39) ? (candata>>4 + 0x07) : (candata&0x0F);
}
两个函数在编译时提示,返回值恒为0,这是怎么回事? |