Merge pull request #605 from yuht/patch-12
[BSP] update get “geometry” source
This commit is contained in:
commit
e2d596ae0f
|
@ -461,11 +461,13 @@ static rt_err_t rt_sdcard_control(rt_device_t dev, rt_uint8_t cmd, void *args)
|
|||
struct rt_device_blk_geometry *geometry;
|
||||
|
||||
geometry = (struct rt_device_blk_geometry *)args;
|
||||
|
||||
if (geometry == RT_NULL) return -RT_ERROR;
|
||||
|
||||
geometry->bytes_per_sector = SDCfg.sectorsize;
|
||||
geometry->block_size = SDCfg.blocksize;
|
||||
geometry->sector_count = SDCfg.sectorcnt;
|
||||
if (dev->user_data == RT_NULL) return -RT_ERROR;
|
||||
|
||||
geometry->bytes_per_sector = ((SDCFG *)dev->user_data)->sectorsize;
|
||||
geometry->block_size = ((SDCFG *)dev->user_data)->blocksize;
|
||||
geometry->sector_count = ((SDCFG *)dev->user_data)->sectorcnt;
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
|
|
Loading…
Reference in New Issue