µTasker Forum > utFAT

latest version

<< < (2/2)

mark:
Neil

ptrDiskInfo->ulSD_sectors * ptrDiskInfo->utFAT.usBytesPerSector gives the size of the card.

fnDisplayDiskSize(ptrDiskInfo->ulSD_sectors, ptrDiskInfo->utFAT.usBytesPerSector);


--- Code: ---static void fnDisplayDiskSize(unsigned long ulSectors, unsigned short usBytesPerSector) // {43}
{
    if (ulSectors >= 0x800000) {                                         // note that 512 byte sectors are assumed
        fnDebugDec((ulSectors/2), 0);                                    // the number of bytes cannot be held in a 32 bit number so display it in kBytes
        fnDebugMsg(" kBytes");
    }
    else {
        fnDebugDec((ulSectors * 512), 0);                                // the value can be displayed in bytes
        fnDebugMsg(" bytes");
    }
}
--- End code ---

Regards

Mark



Navigation

[0] Message Index

[*] Previous page

Go to full version