浏览代码

Only print card size in byte if under 32GB

main
PaulStoffregen 9 年前
父节点
当前提交
ded90cc4a6
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. +5
    -4
      examples/CardInfo/CardInfo.ino

+ 5
- 4
examples/CardInfo/CardInfo.ino 查看文件

volumesize = volume.blocksPerCluster(); // clusters are collections of blocks volumesize = volume.blocksPerCluster(); // clusters are collections of blocks
volumesize *= volume.clusterCount(); // we'll have a lot of clusters volumesize *= volume.clusterCount(); // we'll have a lot of clusters
volumesize *= 512; // SD card blocks are always 512 bytes
Serial.print("Volume size (bytes): ");
Serial.println(volumesize);
if (volumesize < 8388608ul) {
Serial.print("Volume size (bytes): ");
Serial.println(volumesize * 512); // SD card blocks are always 512 bytes
}
Serial.print("Volume size (Kbytes): "); Serial.print("Volume size (Kbytes): ");
volumesize /= 1024;
volumesize /= 2;
Serial.println(volumesize); Serial.println(volumesize);
Serial.print("Volume size (Mbytes): "); Serial.print("Volume size (Mbytes): ");
volumesize /= 1024; volumesize /= 1024;

正在加载...
取消
保存