作者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
※ fmdjyl:轉錄至看板 ASM 03/07 16:08
→ james732:改成 Show_String(1,Name,0x06,XLevel+0x00); 試試? 03/07 16:27
→ fmdjyl:之前也有試過~~出現相同訊息~~~ 謝謝您~~ 03/07 16:35
→ fmdjyl:= = 對不起...這次再試一次~~就過了... 03/07 16:39
→ fmdjyl:我先瞭解一下~~之前弄掉&不過之問題~~並測試現在能否動作 03/07 16:40
→ fmdjyl:已測試成功.把&去掉就可以~只是還不知道為什麼KEILC~51可以 03/07 21:18
→ fmdjyl:IAR的TI卻不行這樣寫 ~~~ 03/07 21:19
→ fmdjyl:謝謝樓上幾位樓主的幫助~~萬般感謝~~~ 03/07 21:19
→ kdjf:我猜keil c51有warning你沒看到... 就C來看直接Name才是對的 03/07 22:02