Skip to content

Conversation

@non-bin
Copy link

@non-bin non-bin commented Aug 22, 2022

What's new

  • Add dynamic storage units for free/total in settings->sd info
  • Add free %

Verification

  • Built and tested (64GB SD)

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@non-bin non-bin marked this pull request as ready for review August 22, 2022 02:31
dialog_ex, "Try to reinsert\nor format SD\ncard.", 3, 19, AlignLeft, AlignTop);
dialog_ex_set_center_button_text(dialog_ex, "Ok");
} else {
char unit_kb[] = "KB";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to put it in ram, use const.

char unit_mb[] = "MB";
char unit_gb[] = "GB";

double sd_total_val = (double)sd_info.kb_total;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using float point math here is kinda overkill.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Especially using double. Float should be more than enough, use cast at the last moment when passing it to string_printf.

double sd_free_val = (double)sd_info.kb_free;
char* sd_free_unit = unit_kb;

if(sd_total_val > 1024) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better solution will be to implement formatting function that takes double* and const char**

@hedger hedger added the UI Affects UI label Aug 23, 2022
@skotopes
Copy link
Contributor

@non-bin do you plan to continue work on this PR?

@non-bin
Copy link
Author

non-bin commented Aug 27, 2022

Yeah I will

@skotopes skotopes closed this Oct 8, 2022
@skotopes
Copy link
Contributor

skotopes commented Oct 8, 2022

Feel free to reopen when it will be ready

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

Labels

UI Affects UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants