Skip to content

Commit

Permalink
Optional M32 followup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Nov 10, 2020
1 parent cd893e8 commit f964943
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Marlin/src/sd/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ CardReader::CardReader() {
#endif
flag.sdprinting = flag.mounted = flag.saving = flag.logging = false;
filesize = sdpos = 0;
file_subcall_ctr = 0;

TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0);

workDirDepth = 0;
ZERO(workDirParents);
Expand Down Expand Up @@ -542,7 +543,7 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0*
switch (subcall_type) {
case 0: // Starting a new print. "Now fresh file: ..."
announceOpen(2, path);
file_subcall_ctr = 0;
TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0);
break;

#if HAS_MEDIA_SUBCALLS
Expand All @@ -561,7 +562,8 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0*

// Store current filename (based on workDirParents) and position
getAbsFilename(proc_filenames[file_subcall_ctr]);
filespos[file_subcall_ctr] = sdpos;

TERN_(HAS_MEDIA_SUBCALLS, filespos[file_subcall_ctr] = sdpos);

// For sub-procedures say 'SUBROUTINE CALL target: "..." parent: "..." pos12345'
SERIAL_ECHO_START();
Expand Down Expand Up @@ -609,7 +611,7 @@ void CardReader::openFileWrite(char * const path) {
if (!isMounted()) return;

announceOpen(2, path);
file_subcall_ctr = 0;
TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0);

endFilePrint();

Expand Down

0 comments on commit f964943

Please sign in to comment.