Few simple fixes that save RAM, as static strings are stored in RAM by default.

This commit is contained in:
daid303
2012-11-28 10:30:34 +01:00
parent c94ca24adc
commit 97fa2a9c30
6 changed files with 36 additions and 25 deletions

View File

@ -245,9 +245,9 @@ void CardReader::openFile(char* name,bool read)
SERIAL_PROTOCOLLNPGM(".");
return;
}
else
else
{
//SERIAL_ECHOLN("dive ok");
//SERIAL_ECHOLN("dive ok");
}
curDir=&myDir;
@ -341,9 +341,9 @@ void CardReader::removeFile(char* name)
SERIAL_PROTOCOLLNPGM(".");
return;
}
else
else
{
//SERIAL_ECHOLN("dive ok");
//SERIAL_ECHOLN("dive ok");
}
curDir=&myDir;
@ -432,7 +432,7 @@ void CardReader::checkautostart(bool force)
}
char autoname[30];
sprintf(autoname,"auto%i.g",lastnr);
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;
@ -452,9 +452,9 @@ void CardReader::checkautostart(bool force)
{
char cmd[30];
sprintf(cmd,"M23 %s",autoname);
sprintf_P(cmd, PSTR("M23 %s"), autoname);
enquecommand(cmd);
enquecommand("M24");
enquecommand_P(PSTR("M24"));
found=true;
}
}
@ -533,7 +533,7 @@ void CardReader::printingHasFinished()
if(SD_FINISHED_STEPPERRELEASE)
{
//finishAndDisableSteppers();
enquecommand(SD_FINISHED_RELEASECOMMAND);
enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
}
autotempShutdown();
}