初级会员

- 积分
- 72
- 金钱
- 72
- 注册时间
- 2012-7-6
- 在线时间
- 0 小时
|
最近在移植FATFS到STM32上出现了一个问题:
DRESULT
disk_write (
BYTE drv, /* Physical drive
nmuber (0..) */
const BYTE *buff, /* Data to be written
*/
DWORD sector, /* Sector address (LBA) */
BYTE count /* Number of sectors to write (1..255)
*/
)
{
// DRESULT res;
u8 result;
switch (drv)
{
case MMC :
{
result
= SD_WriteDisk((u8*)buff, sector, count);
// translate the
reslut code here
}
}
return
RES_PARERR;
SD_WriteDisk的原型 u8 SD_WriteDisk(u8*buf,u32 sector,u8
cnt);
请教下大家一个问题,为什么const BYTE
*buff作为形参,SD_WriteDisk传进来的实参一定要是加(u8*)强制转换的呢(即(u8*)buff ),
不然编译不过提示
argument of type "const BYTE *" is incompatible with parameter of type "u8
*"
实在是不明白,请指教,谢谢!
|
|
|