unsigned int id[5];
//unsigned char id[5];
id[0] = CBYTE[0x3FFA];
id[1] = CBYTE[0x3FFC];
id[2] = CBYTE[0x3FFD];
id[3] = CBYTE[0x3FFE];
id[4] = CBYTE[0x3FFF];
读出 [1~4] 都是0xFF?
unsigned int id[5];
//unsigned char id[5];
id[0] = CBYTE[0x3FFA];
id[1] = CBYTE[0x3FFC];
id[2] = CBYTE[0x3FFD];
id[3] = CBYTE[0x3FFE];
id[4] = CBYTE[0x3FFF];
读出 [1~4] 都是0xFF?
#define LAST (*(UINT16 code *)(0x3FFA)) /* 0x3FFB 是保留字 */
#define FIRST (*(UINT16 code *)(0x3FFC))
#define SECOND (*(UINT16 code *)(0x3FFE))
LAST = 0x61D2, FIRST = 0xFFFF, SECOND= 0xFFFF
怎么这么奇怪。。。
这个读的不对呀。
关键在于MOVC的访问方式,也就是加上code。
还可以换个方式,都是一样的。
printf("ID0 = %02x %02x \n",(UINT16)*(PUINT8C)(0x3FFA),(UINT16)*(PUINT8C)(0x3FFB));
printf("ID1 = %02x %02x \n",(UINT16)*(PUINT8C)(0x3FFC),(UINT16)*(PUINT8C)(0x3FFD));
printf("ID2 = %02x %02x \n",(UINT16)*(PUINT8C)(0x3FFE),(UINT16)*(PUINT8C)(0x3FFF));