智能车制作

 找回密码
 注册

扫一扫,访问微社区

查看: 1074|回复: 0
打印 上一主题 下一主题

求高手

[复制链接]

3

主题

8

帖子

0

精华

高级会员

Rank: 4

积分
664
威望
380
贡献
160
兑换币
180
注册时间
2012-8-29
在线时间
62 小时
跳转到指定楼层
1#
发表于 2013-4-20 14:18:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
最近在弄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对应的数组、、、



您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们|联系我们|小黑屋|亿加合和智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-5-4 15:50 , Processed in 0.055165 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表