diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 10c5437e..79cdba1a 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5343,7 +5343,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) // ---------------------------------- case 26: if(card.cardOK && code_seen('S')) { - card.setIndex(code_value_long()); + long index = code_value_long(); + card.setIndex(index); + sdpos_atomic = index; } break; @@ -9497,7 +9499,7 @@ void serialecho_temperatures() { SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(""); } -extern uint32_t sdpos_atomic; + #ifdef UVLO_SUPPORT void uvlo_() diff --git a/Firmware/cmdqueue.h b/Firmware/cmdqueue.h index 6c81db29..13185f17 100644 --- a/Firmware/cmdqueue.h +++ b/Firmware/cmdqueue.h @@ -45,6 +45,8 @@ extern bool cmdbuffer_front_already_processed; // Debugging information will be sent to serial line. //#define CMDBUFFER_DEBUG +extern uint32_t sdpos_atomic; + extern int serial_count; extern boolean comment_mode; extern char *strchr_pointer;