OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 7774|回复: 1

STM32文件系统移植 error: argument of type "uint8_t" is incompatible with parameter of type "const void *"

[复制链接]

3

主题

8

帖子

0

精华

新手上路

积分
42
金钱
42
注册时间
2013-10-7
在线时间
0 小时
发表于 2015-6-10 15:22:13 | 显示全部楼层 |阅读模式
5金钱
..\HARDWARE\SDff\SDff.c(131): error:  #167: argument of type "uint8_t" is incompatible with parameter of type "const void *"

Code:
void writeFile(uint8_t *str)
{
    res = f_open(&fsrc, "0:/longfilenametest.txt", FA_OPEN_ALWAYS | FA_WRITE);
    if(res != FR_OK)
    {
        printf("open file error : %d\n\r",res);
    }
    else
    {
       res = f_write(&fsrc, *str, sizeof(*str), &bw);   /* Write it to the dst file */
        if(res == FR_OK)
        {
            printf("write data ok! %d\n\r",bw);
        }
        else
        {
            printf("write data error : %d\n\r",res);
        }
        f_close(&fsrc);
    }
}


原函数:
FRESULT f_write (
    FIL* fp, /* [IN] Pointer to the file object structure */ [/mw_shl_code]
    const void* buff, /* [IN] Pointer to the data to be written */ [/mw_shl_code]
    UINT btw, /* [IN] Number of bytes to write */ [/mw_shl_code]
    UINT* bw /* [OUT] Pointer to the variable to return number of bytes written */ [/mw_shl_code]
);[/mw_shl_code]
原函数来源:http://elm-chan.org/fsw/ff/en/write.html

求高手指教!有点急,万分感激!

最佳答案

查看完整内容[请看2#楼]

*str -> (void*)str
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

2

主题

239

帖子

0

精华

高级会员

Rank: 4

积分
545
金钱
545
注册时间
2015-6-5
在线时间
110 小时
发表于 2015-6-10 15:22:14 | 显示全部楼层
回复

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-21 18:10

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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