Move SD commands to cpp
This commit is contained in:
@ -20,11 +20,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M20: List SD card to serial output
|
||||
*/
|
||||
void gcode_M20() {
|
||||
void GcodeSuite::M20() {
|
||||
SERIAL_PROTOCOLLNPGM(MSG_BEGIN_FILE_LIST);
|
||||
card.ls();
|
||||
SERIAL_PROTOCOLLNPGM(MSG_END_FILE_LIST);
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,7 +20,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M21: Init SD Card
|
||||
*/
|
||||
void gcode_M21() { card.initsd(); }
|
||||
void GcodeSuite::M21() { card.initsd(); }
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,7 +20,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M22: Release SD Card
|
||||
*/
|
||||
void gcode_M22() { card.release(); }
|
||||
void GcodeSuite::M22() { card.release(); }
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,11 +20,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M23: Open a file
|
||||
*/
|
||||
void gcode_M23() {
|
||||
void GcodeSuite::M23() {
|
||||
// Simplify3D includes the size, so zero out all spaces (#7227)
|
||||
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
|
||||
card.openFile(parser.string_arg, true);
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,10 +20,22 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
#include "../../module/printcounter.h"
|
||||
|
||||
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
||||
#include "../queue.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M25: Pause SD Print
|
||||
*/
|
||||
void gcode_M25() {
|
||||
void GcodeSuite::M25() {
|
||||
card.pauseSDPrint();
|
||||
print_job_timer.pause();
|
||||
|
||||
@ -31,3 +43,5 @@ void gcode_M25() {
|
||||
enqueue_and_echo_commands_P(PSTR("M125")); // Must be enqueued with pauseSDPrint set to be last in the buffer
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,10 +20,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M26: Set SD Card file index
|
||||
*/
|
||||
void gcode_M26() {
|
||||
void GcodeSuite::M26() {
|
||||
if (card.cardOK && parser.seenval('S'))
|
||||
card.setIndex(parser.value_long());
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,7 +20,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M27: Get SD Card status
|
||||
*/
|
||||
void gcode_M27() { card.getStatus(); }
|
||||
void GcodeSuite::M27() { card.getStatus(); }
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,7 +20,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M28: Start SD Write
|
||||
*/
|
||||
void gcode_M28() { card.openFile(parser.string_arg, false); }
|
||||
void GcodeSuite::M28() { card.openFile(parser.string_arg, false); }
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,10 +20,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M29: Stop SD Write
|
||||
* Processed in write to file routine above
|
||||
*/
|
||||
void gcode_M29() {
|
||||
void GcodeSuite::M29() {
|
||||
// card.saving = false;
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,12 +20,21 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M30 <filename>: Delete SD Card file
|
||||
*/
|
||||
void gcode_M30() {
|
||||
void GcodeSuite::M30() {
|
||||
if (card.cardOK) {
|
||||
card.closefile();
|
||||
card.removeFile(parser.string_arg);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,10 +20,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
#include "../../module/stepper.h"
|
||||
#include "../../module/printcounter.h"
|
||||
|
||||
/**
|
||||
* M32: Select file and start SD Print
|
||||
*/
|
||||
void gcode_M32() {
|
||||
void GcodeSuite::M32() {
|
||||
if (IS_SD_PRINTING)
|
||||
stepper.synchronize();
|
||||
|
||||
@ -42,3 +51,5 @@ void gcode_M32() {
|
||||
if (!call_procedure) print_job_timer.start();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
@ -20,6 +20,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT) && ENABLED(LONG_FILENAME_HOST_SUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M33: Get the long full path of a file or folder
|
||||
*
|
||||
@ -32,6 +39,8 @@
|
||||
* Output:
|
||||
* /Miscellaneous/Armchair/Armchair.gcode
|
||||
*/
|
||||
void gcode_M33() {
|
||||
void GcodeSuite::M33() {
|
||||
card.printLongPath(parser.string_arg);
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT && LONG_FILENAME_HOST_SUPPORT
|
@ -20,10 +20,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT) && ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M34: Set SD Card Sorting Options
|
||||
*/
|
||||
void gcode_M34() {
|
||||
void GcodeSuite::M34() {
|
||||
if (parser.seen('S')) card.setSortOn(parser.value_bool());
|
||||
if (parser.seenval('F')) {
|
||||
const int v = parser.value_long();
|
||||
@ -31,3 +38,5 @@ void gcode_M34() {
|
||||
}
|
||||
//if (parser.seen('R')) card.setSortReverse(parser.value_bool());
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT && SDCARD_SORT_ALPHA && SDSORT_GCODE
|
@ -20,9 +20,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* M928: Start SD Write
|
||||
*/
|
||||
void gcode_M928() {
|
||||
void GcodeSuite::M928() {
|
||||
card.openLogFile(parser.string_arg);
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
Reference in New Issue
Block a user