作者fmdjyl (小D(滴))
看板ASM
标题Fw: [问题] TI用C遇到的问题~~
时间Thu Mar 7 16:08:08 2013
※ [本文转录自 C_and_CPP 看板 #1HE4hJBI ]
作者: fmdjyl (小D(滴)) 看板: C_and_CPP
标题: [问题] TI用C遇到的问题~~
时间: Thu Mar 7 16:07:45 2013
原本在51上跑~是正常的~~
但换到TI上...这段都说有问题.
已弄不出语法上有什麽问题???
麻烦恳请指教~~
先谢谢大家
错误点在:Show_String(1,&Name,0x06,XLevel+0x00)
出现讯息为:
Error[Pe167]: argument of type "unsignhar (*)[9]" is incompatible whit parameter of type
"unsigned char *"
===============================================
int main( void )
{
unsigned char Name[]={1,1,1,1,1,1,1,1,0};
for(;;)
{
Show_String(1,&Name,0x06,XLevel+0x00);
}
}
unsigned char Ascii_1[5][5]={ // Refer to "Times New Roman" Font Database...
// Basic Characters
{0x3E,0x51,0x49,0x45,0x3E}, // ( 1)
{0x00,0x42,0x7F,0x40,0x00}, // ( 2)
{0x42,0x61,0x51,0x49,0x46}, // ( 3)
{0x21,0x41,0x45,0x4B,0x31}, // ( 4)
{0x18,0x14,0x12,0x7F,0x10}, // ( 5)
};
void Show_String(unsigned char a, unsigned char *Data_Pointer, unsigned char
b, unsigned char c)
{
unsigned char *Src_Pointer;
Src_Pointer=Data_Pointer;
Show_Font57(1,96,b,c); // No-Break Space
// Must be written first before the string start...
while(1)
{
Show_Font57(a,*Src_Pointer,b,c);
Src_Pointer++;
c+=6;
if(*Src_Pointer == 0) break;
}
}
void Show_Font57(unsigned char a, unsigned char b, unsigned char c, unsigned
char d)
{
unsigned char *Src_Pointer;
unsigned char i;
switch(a)
{
case 1:
Src_Pointer=&Ascii_1[(b-1)][0];
break;
}
Set_Start_Page(c);
Set_Start_Column(d);
I2C_Start();
I2C_O(0x40);
I2C_Ack();
for(i=0;i<5;i++)
{
I2C_O(*Src_Pointer);
I2C_Ack();
Src_Pointer++;
}
I2C_O(0x00);
I2C_Ack();
I2C_Stop();
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 60.251.176.110
※ 发信站: 批踢踢实业坊(ptt.cc)
※ 转录者: fmdjyl (60.251.176.110), 时间: 03/07/2013 16:08:08
1F:推 ruemann:改成 &Name[0] 看看 03/07 16:40
2F:推 kdjf:是直接 Name 吧 03/07 19:23
3F:→ fmdjyl:已测试成功.把&去掉就可以~只是还不知道为什麽KEILC~51可以 03/07 21:18
4F:→ fmdjyl:IAR的TI却不行这样写 ~~~ 03/07 21:18
5F:→ fmdjyl:谢谢楼上几位楼主的帮助~~万般感谢~~~ 03/07 21:19
6F:→ Jhih8051:不同的compile会有差,个人觉得IAR比较严谨,NAME直接就 03/09 00:29
7F:→ Jhih8051:是指向位址了,不用再加& 03/09 00:30
8F:→ syura945:keil可以compile不代表结果是对的 这程式明显写错 06/01 22:51