8000 Re-add original SD FAT info access methods by earlephilhower · Pull Request #6092 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Re-add original SD FAT info access methods #6092

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

Merged
merged 8 commits into from
May 19, 2019
Prev Previous commit
Next Next commit
Restore size_t, make it limit, add size64
Because size() is used in many printf()s, we can't just change its
return type to uint64.  Instead, when size is > size-max, return
size-max.

Add size64 which can be used by new apps who care about >4GB cards.
  • Loading branch information
earlephilhower committed May 15, 2019
commit b4d9834e7686e7733e8b145444b4be69e703f516
7 changes: 6 additions & 1 deletion libraries/SD/src/SD.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ class SDClass {
return blocksPerCluster() * blockSize();
}

uint64_t size() {
size_t size() {
uint64_t sz = size64();
return (size_t)std::min( (uint64_t)SIZE_MAX, sz );
}

uint64_t size64() {
return ((uint64_t)clusterSize() * (uint64_t)totalClusters());
}

Expand Down
0