Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/GCodes/GCodes2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply)
}
break;


case 99: // Return from Macro/Subprogram
FileMacroCyclesReturn(gb);
break;
Expand Down Expand Up @@ -3867,6 +3868,28 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply)
}
break;

case 704: // Run custom filament macro
if (gb.Seen('P'))
{
if (reprap.GetCurrentTool() != nullptr)
{
if (reprap.GetCurrentTool()->GetFilament() != nullptr)
{
String<MaxFilenameLength> filename;
gb.GetPossiblyQuotedString(filename.GetRef());
String<ScratchStringLength> scratchString;
scratchString.printf("%s%s/%s", FILAMENTS_DIRECTORY, reprap.GetCurrentTool()->GetFilament()->GetName(), filename.c_str());
DoFileMacro(gb, scratchString.c_str(), true);
}
}
else
{
result = GCodeResult::error;
reply.copy("No tool selected");
}
}
break;

#if SUPPORT_SCANNER
case 750: // Enable 3D scanner extension
reprap.GetScanner().Enable();
Expand Down