getter function for filesize

This commit is contained in:
PavelSindler 2017-09-14 14:21:16 +02:00
parent ff73fbc562
commit 026e3ecaac
3 changed files with 7 additions and 7 deletions

View File

@ -501,9 +501,9 @@ void CardReader::removeFile(char* name)
} }
void CardReader::getFileSize() uint32_t CardReader::getFileSize()
{ {
public_fileSize = filesize; return filesize;
} }
void CardReader::getStatus() void CardReader::getStatus()

View File

@ -27,7 +27,7 @@ public:
void release(); void release();
void startFileprint(); void startFileprint();
void pauseSDPrint(); void pauseSDPrint();
void getFileSize(); uint32_t getFileSize();
void getStatus(); void getStatus();
void printingHasFinished(); void printingHasFinished();
@ -70,7 +70,6 @@ public:
bool cardOK ; bool cardOK ;
char filename[13]; char filename[13];
uint16_t creationTime, creationDate; uint16_t creationTime, creationDate;
uint32_t public_fileSize;
char longFilename[LONG_FILENAME_LENGTH]; char longFilename[LONG_FILENAME_LENGTH];
bool filenameIsDir; bool filenameIsDir;
int lastnr; //last number of the autostart; int lastnr; //last number of the autostart;

View File

@ -4967,10 +4967,11 @@ static void menu_action_function(menuFunc_t data) {
static bool check_file(const char* filename) { static bool check_file(const char* filename) {
bool result = false; bool result = false;
uint32_t filesize;
card.openFile(filename, true); card.openFile(filename, true);
card.getFileSize(); filesize = card.getFileSize();
if (card.public_fileSize > END_FILE_SECTION) { if (fileSize > END_FILE_SECTION) {
card.setIndex((card.public_fileSize) - END_FILE_SECTION); card.setIndex(filesize - END_FILE_SECTION);
} }
while (!card.eof() && !result) { while (!card.eof() && !result) {