From 65ab7b1a486998b6d572e2869d8ba0e3c3dfb8a8 Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Sun, 9 Jan 2022 12:18:35 +0800 Subject: [PATCH] Fix info.usedBytes calculation giving weird result --- libraries/SDFS/src/SDFS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/SDFS/src/SDFS.h b/libraries/SDFS/src/SDFS.h index 6e13cdf24d..6a2ac32885 100644 --- a/libraries/SDFS/src/SDFS.h +++ b/libraries/SDFS/src/SDFS.h @@ -101,7 +101,7 @@ class SDFSImpl : public FSImpl info.pageSize = 0; // TODO ? info.maxPathLength = 255; // TODO ? info.totalBytes =_fs.vol()->clusterCount() * info.blockSize; - info.usedBytes = info.totalBytes - (_fs.vol()->freeClusterCount() * _fs.vol()->bytesPerCluster()); + info.usedBytes = (_fs.vol()->clusterCount() - _fs.vol()->freeClusterCount()) * info.blockSize; return true; }