Skip to content

Fix card size with CSD v2.00#71

Open
giuseppedandrea wants to merge 2 commits intoarduino-libraries:masterfrom
giuseppedandrea:fix-card-size
Open

Fix card size with CSD v2.00#71
giuseppedandrea wants to merge 2 commits intoarduino-libraries:masterfrom
giuseppedandrea:fix-card-size

Conversation

@giuseppedandrea
Copy link
Copy Markdown

Fix position of "c_size_high" in struct "csd2_t" and cast 8 bits variable ("csd.v2.c_size_mid") to allow left shift by 8 in cardSize() method.

Byte 7 of register CSD v2.00 is so composed: the first 2 bits for "reserved3" and the remaining 6 bits for "c_size_high". Because of how the bits are arranged on little-endian systems, "c_size_high" must be positioned before "reserved3" in order to have "c_size_high", "c_size_mid" and "c_size_low" arraged contiguously.
Type of csd.v2.c_size_mid is uint8_t (8 bits). In order to left shift by 8 bits csd.v2.c_size_mid without losing informations (bits), is necessary to cast the variable to uint32_t.
@TravisBuddy
Copy link
Copy Markdown

Travis tests have failed

Hey @giuseppedandrea,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: dc865a00-e7b5-11e9-8e12-4bc655cb216a

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Apr 17, 2022
@per1234
Copy link
Copy Markdown
Contributor

per1234 commented Apr 17, 2022

This would supersede #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants