-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockDevices: minor fixes to cleanup compile warnings #444
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just have a look on 2 small changes to avoid double cast
for(int i = 0; i < num_of_blocks && rv == FSP_SUCCESS; i++) { | ||
rv = R_SDHI_Read (&ctrl, (uint8_t *)(buffer + (i * read_block_size)), start_add_of_block + i, 1); | ||
for(uint32_t i = 0; i < num_of_blocks && rv == FSP_SUCCESS; i++) { | ||
rv = R_SDHI_Read (&ctrl, (uint8_t *)((uint8_t *)buffer + (i * read_block_size)), start_add_of_block + i, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just a matter of personal taste but I would prefer this way without the double cast (to me is clearer)
rv = R_SDHI_Read (&ctrl, (uint8_t *)((uint8_t *)buffer + (i * read_block_size)), start_add_of_block + i, 1); | |
uint8_t *buf = (uint8_t *)buffer; | |
rv = R_SDHI_Read (&ctrl, buf + (i * read_block_size), start_add_of_block + i, 1); |
for(int i = 0; i < num_of_blocks && rv == FSP_SUCCESS; i++) { | ||
rv = R_SDHI_Write (&ctrl, (uint8_t *)(buffer + (i * write_block_size)), start_block_number + i, 1); | ||
for(uint32_t i = 0; i < num_of_blocks && rv == FSP_SUCCESS; i++) { | ||
rv = R_SDHI_Write (&ctrl, (uint8_t *)((uint8_t *)buffer + (i * write_block_size)), start_block_number + i, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just a matter of personal taste but I would prefer this way without the double cast (to me is clearer)
rv = R_SDHI_Write (&ctrl, (uint8_t *)((uint8_t *)buffer + (i * write_block_size)), start_block_number + i, 1); | |
uint8_t *buf = (uint8_t *)buffer; | |
rv = R_SDHI_Write (&ctrl, buf + (i * write_block_size), start_block_number + i, 1); |
TestCodeFlash 👍
TestQSPI 👍
QSPIFormat 👍
QSPIReadPartitions 👍
FatFSOnQSPIFlash 👍
LittleFSOn QSPIFlash 👍
TestSDCard 👎 (also in released cores)