..\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
求高手指教!有点急,万分感激! |