ADS1.2中二维数组的问题 AT91RM9200驱动240*128点阵液晶屏(T6963C),程序中用二维数组存储字模数据,如下: unsigned char ASCII[][16]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18, // -!- 0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00, // -"- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C, // -#- 0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00, ***********等等 在程序中调用: void LcdDisString(uchar x,uchar y,uchar z,uchar *str,uchar mm,uchar bk) { uchar i,j,temp1,temp2; uint StartAddr,StartAddr1; uchar Line;
Line=x*8+z; StartAddr1=Line*LineChar+y; i=0; if(bk==0) { for(i=0;i<mm;i++) { StartAddr=StartAddr1+i; for(j=0;j<16;j++) { SendLcdData((uchar)StartAddr); SendLcdData((uchar)(StartAddr>>8)); SendLcdCommand(0x24); //定位 SendLcdData(ASCII[(str-32)][j]^LcdA);//这里调用二维数组 SendLcdCommand(0xc4); StartAddr=StartAddr+LineChar; } } } else { for(i=0;i<mm;i++) { StartAddr=StartAddr1+i; for(j=0;j<16;j++) { SendLcdData((uchar)StartAddr); SendLcdData((uchar)(StartAddr>>8)); SendLcdCommand(0x24); //定位 SendLcdData(~ASCII[(str-32)][j]^LcdA); SendLcdCommand(0xc4); StartAddr=StartAddr+LineChar; } } } } 其中str的指针指向二维数组基地址,程序中定义uchar StrFreq[] = "Freq.";// 调用LcdDisString(2,0,0,StrFreq,5,0); 单步执行来看,ASCII[(str-32)][j]的值不是我在二维数组中对应的点阵数据,而我在keil中编译通过,并且可以正确调 用二维数组显示字符, 难道ADS1.2中的编译器和keil中的相差很大,不支持这种写法?
|