fix(SDHC): Fix SDHC Get Capacity and Implement Get Sectors functionality #727
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
unsigned int MXC_SDHC_Lib_GetCapacity(mxc_sdhc_csd_regs_t* csd)
function returns wrong value.If 32 GB card is inserted to the SD card slot,
MXC_SDHC_Lib_GetCapacity
function can return at most UINT32_MAX as a result.Therefore, the function prototype is changed to
unsigned long long MXC_SDHC_Lib_GetCapacity(mxc_sdhc_csd_regs_t* csd)
to get the correct result.unsigned int MXC_SDHC_Lib_GetSectors(mxc_sdhc_csd_regs_t* csd, int i)
function is implemented in sdhc_lib.c file.Checklist Before Requesting Review