UINT8 i; i = CH375DiskQuery( ); mStopIfError( i ); i = CH375DiskSize( ); mStopIfError( i ); #ifdef DEBUG printf("The Free sec is :%u,%u,%u\n",CH375vSectorSize,mCmdParam.DiskSize.mDiskSizeSec,mCmdParam.Query.mFreeSector); #endif return((unsigned int)(mCmdParam.DiskSize.mDiskSizeSec*mCmdParam.Query.mFreeSector /1024/1024)); // 返回为以MB为单位的剩余容量
结果显示为The Free sec is :512,53503,31 计算得到的剩余空间为The Free Size is :3429M 我的U盘才1G的啊! 不知道错在什么地方了,是不是我的函数用错了?