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

Ensure 64bit math for SD card FSInfo #1553

Merged
merged 2 commits into from
Jun 23, 2023
Merged

Ensure 64bit math for SD card FSInfo #1553

merged 2 commits into from
Jun 23, 2023

Conversation

earlephilhower
Copy link
Owner

Fixes #1552

Ensure that 64 bit multiplication is done when calculating the total size available and used for SDFS.

Fixes #1552

Ensure that 64 bit multiplication is done when calculating the total size
available and used for SDFS.
@LinusHeu
Copy link
Contributor

It works for me.
Before (master):
before
After (sd1):
after

#include <Arduino.h>
#include <SDFS.h>

void setup() {
  Serial.begin();
  while(!Serial);
  delay(1000);
  Serial.println("Hallo");

  SDFSConfig sdconf;
  sdconf.setCSPin(17);
  //SPI.setCS(17);
  SPI.setRX(16);
  SPI.setTX(19);
  SPI.setSCK(18);
  SDFS.setConfig(sdconf);
  Serial.println(SDFS.begin());
  FSInfo64 fsinfo;
  SDFS.info64(fsinfo);
  Serial.println(fsinfo.totalBytes);
  Serial.println(fsinfo.usedBytes);
  
}

void loop() {
  // put your main code here, to run repeatedly:
}

@earlephilhower
Copy link
Owner Author

Thanks, @LinusHeu !

@earlephilhower earlephilhower merged commit 9e89dda into master Jun 23, 2023
@earlephilhower earlephilhower deleted the sd1 branch June 23, 2023 15:25
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

Successfully merging this pull request may close these issues.

Incorrect SD card size and usedBytes > totalBytes reported by SDFS
2 participants