[Horus] Massstorage working now

Still a problem on Windows which doesn't want to format the SD card.
Also it seems I am not able to rename the card. It reminds me some issue
we already had on Taranis.
This commit is contained in:
Bertrand Songis
2015-11-03 21:02:28 +01:00
parent a556c50956
commit 62e6e30481
2 changed files with 4 additions and 13 deletions
+2 -2
View File
@@ -259,12 +259,12 @@ DRESULT disk_ioctl (
switch (ctrl) { switch (ctrl) {
case GET_SECTOR_COUNT : /* Get number of sectors on the disk (DWORD) */ case GET_SECTOR_COUNT : /* Get number of sectors on the disk (DWORD) */
*(DWORD*)buff = SDCardInfo.CardCapacity / BLOCK_SIZE; *(DWORD*)buff = SDCardInfo.CardCapacity / SDCardInfo.CardBlockSize;
res = RES_OK; res = RES_OK;
break; break;
case GET_SECTOR_SIZE : /* Get R/W sector size (WORD) */ case GET_SECTOR_SIZE : /* Get R/W sector size (WORD) */
*(WORD*)buff = BLOCK_SIZE; *(WORD*)buff = SDCardInfo.CardBlockSize;
res = RES_OK; res = RES_OK;
break; break;
} }
+2 -11
View File
@@ -131,17 +131,8 @@ int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_si
if (!SD_CARD_PRESENT()) if (!SD_CARD_PRESENT())
return -1; return -1;
*block_size = BLOCKSIZE; *block_size = SDCardInfo.CardBlockSize;
*block_num = (SDCardInfo.CardCapacity / SDCardInfo.CardBlockSize) - 1;
static DWORD sector_count = 0;
if (sector_count == 0) {
if (disk_ioctl(0, GET_SECTOR_COUNT, &sector_count) != RES_OK) {
sector_count = 0;
return -1;
}
}
*block_num = sector_count; // sector_count;
return 0; return 0;
} }