Skip to content
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

Demo sysinfo shows wrong SD card size. #122

Open
MartinNohr opened this issue Apr 13, 2021 · 0 comments
Open

Demo sysinfo shows wrong SD card size. #122

MartinNohr opened this issue Apr 13, 2021 · 0 comments

Comments

@MartinNohr
Copy link

You have an arithmetic overflow causing the SD card size to be shown incorrectly.
ez.canvas.print("SD size:"); ez.canvas.x(tab); ez.canvas.println(String((long)SD.cardSize() / 1000000) + " MB");
Should be:
ez.canvas.print("SD size:"); ez.canvas.x(tab); ez.canvas.println(String((long)(SD.cardSize() / 1000000)) + " MB");
The cast (long) need to be done after dividing by 1000000, not before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant