高级会员
- 积分
- 664
- 威望
- 380
- 贡献
- 160
- 兑换币
- 180
- 注册时间
- 2012-8-29
- 在线时间
- 62 小时
|
最近在弄TFT屏幕和SD卡,已经用51刷屏,显示图片,读卡了,移植到430单片机上时,可刷屏,可显示图片,可是读卡没成功。估计是c语言问题,请问keil里面的这一句“unsigned char xdata DATA[512];”,怎么改成IAR里面的语句啊。
unsigned char SdReadBlock( unsigned char *Block, unsigned long address,int len)
{
unsigned int count;//Block size is 512 bytes exactly
//First Lower SS
//printf("MMC_read_block\n");
SD_CS_0;
//Then send write command
SdCommand(0x11,address,0xff);
if(SdResponse()==0x00)
{
//command was a success - now send data
//start with DATA TOKEN = 0xFE
while(SdRead()!=0xfe);
for(count=0;count<len;count++) *Block++=SdRead();
for(;count<512;count++) SdRead();
//data block sent - now send checksum
SdRead();
SdRead();
//Now read in the DATA RESPONSE token
SD_CS_1;
SdRead();
return 1;
}
//printf("Command 0x11 (Read) was not received by the MMC.\n");
return 0;
}
对应的这一段怎么改,DATA[]就是指针*Block对应的数组、、、
|
|