Skip to content

Commit 1be135c

Browse files
authored
Merge pull request #3053 from adafruit/fix-sdfat-cardsize
replace cardSize() with sectorCount()
2 parents 2b0f726 + b793776 commit 1be135c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

MEMENTO/Memento_Face_Detect_Recognize/memento_platformio_camera/lib/Adafruit_PyCamera/Adafruit_PyCamera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ bool Adafruit_PyCamera::initSD(void) {
172172
}
173173

174174
Serial.println("Card successfully initialized");
175-
uint32_t size = sd.card()->cardSize();
175+
uint32_t size = sd.card()->sectorCount();
176176
if (size == 0) {
177177
Serial.println("Can't determine the card size");
178178
} else {
@@ -497,7 +497,7 @@ bool Adafruit_PyCamera::takePhoto(const char *filename_base,
497497
return false;
498498
}
499499

500-
if (!sd.card() || (sd.card()->cardSize() == 0)) {
500+
if (!sd.card() || (sd.card()->sectorCount() == 0)) {
501501
Serial.println("No SD card found");
502502
// try to initialize?
503503
if (!initSD())

MEMENTO/Memento_Face_Detect_Recognize/memento_platformio_camera/lib/Adafruit_PyCamera/Adafruit_PyCamera.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <Adafruit_AW9523.h>
77
#include <Adafruit_NeoPixel.h>
88
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
9-
#include <SdFat.h>
9+
#include <SdFat_Adafruit_Fork.h>
1010

1111
#ifndef TAG
1212
#define TAG "PYCAM"

MEMENTO/Memento_Shoulder_Robot/platformio_memento_shoulder_camera/lib/Adafruit_PyCamera/Adafruit_PyCamera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ bool Adafruit_PyCamera::initSD(void) {
172172
}
173173

174174
Serial.println("Card successfully initialized");
175-
uint32_t size = sd.card()->cardSize();
175+
uint32_t size = sd.card()->sectorCount();
176176
if (size == 0) {
177177
Serial.println("Can't determine the card size");
178178
} else {
@@ -497,7 +497,7 @@ bool Adafruit_PyCamera::takePhoto(const char *filename_base,
497497
return false;
498498
}
499499

500-
if (!sd.card() || (sd.card()->cardSize() == 0)) {
500+
if (!sd.card() || (sd.card()->sectorCount() == 0)) {
501501
Serial.println("No SD card found");
502502
// try to initialize?
503503
if (!initSD())

0 commit comments

Comments
 (0)