初级会员

- 积分
- 160
- 金钱
- 160
- 注册时间
- 2014-5-25
- 在线时间
- 21 小时
|
2金钱
最近在做一个项目,用STM32F103和FATS文件系统,在SD卡中读取数据,但是现在发现用f_gets读出来的是乱码,大家帮帮忙看看什么问题,工程用的原子哥的FATS文件系统实验的,代码在下面[mw_shl_code=c,true]u8 GetSDInfo(void)
{
u8 i = 0;
u8 res;
char buf[10];
f_mount(fs[0],"0:",1);
res = f_open(&fneww,"0:/Plate.txt",FA_OPEN_EXISTING|FA_READ);
if(res == FR_OK)
{
printf("Open Plate.txt Success...\r\n");
f_gets(buf,8,&fneww);
printf("Read :%s\r\n",buf);
return 1;
}
else
{
printf("Open Plate.txt Failed...\r\n");
return 0;
}
f_close(&fnew); // 1رÕÎļt
f_mount(NULL, 0,1); // êí·Å»o3åÇø
}[/mw_shl_code]
|
|