1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00

[SDCARD_SDIO] CardCapacity is in 512 byte blocks (#8703)

[SDCARD_SDIO] CardCapacity is in 512 byte blocks
This commit is contained in:
Michael Keller 2019-08-13 00:14:11 +12:00 committed by GitHub
commit 18c6f4d4aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -908,7 +908,7 @@ SD_Error_t SD_GetCardInfo(void)
SD_CardInfo.CardCapacity = (SD_CardInfo.SD_csd.DeviceSize + 1) ;
SD_CardInfo.CardCapacity *= (1 << (SD_CardInfo.SD_csd.DeviceSizeMul + 2));
SD_CardInfo.CardBlockSize = 1 << (SD_CardInfo.SD_csd.RdBlockLen);
SD_CardInfo.CardCapacity *= SD_CardInfo.CardBlockSize;
SD_CardInfo.CardCapacity = SD_CardInfo.CardCapacity * SD_CardInfo.CardBlockSize / 512; // In 512 byte blocks
}
else if(SD_CardType == SD_HIGH_CAPACITY)
{

View file

@ -890,7 +890,7 @@ SD_Error_t SD_GetCardInfo(void)
SD_CardInfo.CardCapacity = (SD_CardInfo.SD_csd.DeviceSize + 1) ;
SD_CardInfo.CardCapacity *= (1 << (SD_CardInfo.SD_csd.DeviceSizeMul + 2));
SD_CardInfo.CardBlockSize = 1 << (SD_CardInfo.SD_csd.RdBlockLen);
SD_CardInfo.CardCapacity *= SD_CardInfo.CardBlockSize;
SD_CardInfo.CardCapacity = SD_CardInfo.CardCapacity * SD_CardInfo.CardBlockSize / 512; // In 512 byte blocks
}
else if(SD_CardType == SD_HIGH_CAPACITY)
{

View file

@ -291,7 +291,7 @@ SD_Error_t SD_GetCardInfo(void)
SD_CardInfo.CardCapacity = (SD_CardInfo.SD_csd.DeviceSize + 1) ;
SD_CardInfo.CardCapacity *= (1 << (SD_CardInfo.SD_csd.DeviceSizeMul + 2));
SD_CardInfo.CardBlockSize = 1 << (SD_CardInfo.SD_csd.RdBlockLen);
SD_CardInfo.CardCapacity *= SD_CardInfo.CardBlockSize;
SD_CardInfo.CardCapacity = SD_CardInfo.CardCapacity * SD_CardInfo.CardBlockSize / 512; // In 512 byte blocks
} else if(SD_CardType == SD_HIGH_CAPACITY) {
// Byte 7
Temp = (uint8_t)(SD_Handle.CSD[1] & 0x000000FF);