반응형
https://marlinfw.org/docs/features/autostart.html
Autostart
If the printer has an SD card inserted at startup or reset, Marlin will look for the file auto0.g and execute it, followed in sequence by any other files with the same pattern (auto1.g, auto2.g, etc.) all the way up to auto9.g.
By default, Autostart is included in the firmware whenever SD card support is enabled. It can be disabled to save a little flash and SRAM if the feature is not needed.
Use-cases
- Provide alternative settings for all the files on an SD Card.
- Use the printer in “kiosk mode” to start a print simply by rebooting.
- Set the printer to a fresh state after a reboot.
- Run from the menu to set a fresh state at any time.
Configuration
- NO_SD_AUTOSTART completely removes Autostart from the firmware.
- MENU_ADDAUTOSTART adds a menu item that can be used to run all the auto#.g files at any time.
Credits
Originally created by bkubicek, Joris, and the Ultimaker guys in a pizza-powered hacking session at Protospace/Utrecht as a way to start a print as soon the printer is powered on.
void CardReader::checkautostart(bool force)
{
if(!force)
{
if(!autostart_stilltocheck)
return;
if(autostart_atmillis<millis())
return;
}
autostart_stilltocheck=false;
if(!cardOK)
{
initsd();
if(!cardOK) //fail
return;
}
char autoname[30];
sprintf_P(autoname, PSTR("auto%i.g"), lastnr);
for(int8_t i=0;i<(int8_t)strlen(autoname);i++)
autoname[i]=tolower(autoname[i]);
dir_t p;
root.rewind();
bool found=false;
while (root.readDir(p, NULL) > 0)
{
for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++)
p.name[i]=tolower(p.name[i]);
//Serial.print((char*)p.name);
//Serial.print(" ");
//Serial.println(autoname);
if(p.name[9]!='~') //skip safety copies
if(strncmp((char*)p.name,autoname,5)==0)
{
char cmd[30];
sprintf_P(cmd, PSTR("M23 %s"), autoname);
enquecommand(cmd);
enquecommand_P(PSTR("M24"));
found=true;
}
}
if(!found)
lastnr=-1;
else
lastnr++;
}
반응형
'3D프린팅' 카테고리의 다른 글
How to Use a 3D Printer as a Pen Plotter (0) | 2022.05.25 |
---|---|
2D Image to STL Converter (Windows) (0) | 2022.05.25 |
3D Prints Warping or Curling? – Why It Happens and How to Prevent It (0) | 2022.05.25 |
Print Quality Troubleshooting Guide (0) | 2022.05.25 |
리트렉션 쉽게 설정하기 (0) | 2022.05.25 |
댓글