8000 correct calculation of totalBlocks() in SD.h and SDFS.h · erpebe/arduino-pico@4ae6ecc · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ae6ecc

Browse files
committed
correct calculation of totalBlocks() in SD.h and SDFS.h
1 parent 3068cd0 commit 4ae6ecc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libraries/SD/src/SD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class SDClass {
128128
}
129129

130130
size_t totalBlocks() {
131-
return (totalClusters() / blocksPerCluster());
131+
return (totalClusters() * blocksPerCluster());
132132
}
133133

134134
size_t clusterSize() {

libraries/SDFS/src/SDFS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class SDFSImpl : public FSImpl {
183183
return _fs.vol()->clusterCount();
184184
}
185185
size_t totalBlocks() {
186-
return (totalClusters() / blocksPerCluster());
186+
return (totalClusters() * blocksPerCluster());
187187
}
188188
size_t clusterSize() {
189189
return _fs.vol()->bytesPerCluster();

0 commit comments

Comments
 (0)
0