project progmem finished: total change with ultipanel: 2456 byte free ram initial. now: 4374 ram.
This commit is contained in:
@@ -29,20 +29,24 @@ void CardReader::initsd()
|
||||
if (!card.init(SPI_FULL_SPEED,SDSS))
|
||||
{
|
||||
//if (!card.init(SPI_HALF_SPEED,SDSS))
|
||||
SERIAL_ECHOLN("SD init fail");
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHOLNPGM("SD init fail");
|
||||
}
|
||||
else if (!volume.init(&card))
|
||||
{
|
||||
SERIAL_ERRORLN("volume.init failed");
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERRORLNPGM("volume.init failed");
|
||||
}
|
||||
else if (!root.openRoot(&volume))
|
||||
{
|
||||
SERIAL_ERRORLN("openRoot failed");
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERRORLNPGM("openRoot failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
cardOK = true;
|
||||
SERIAL_ECHOLN("SD card ok");
|
||||
SERIAL_ECHO_START;
|
||||
SERIAL_ECHOLNPGM("SD card ok");
|
||||
}
|
||||
#endif //SDSS
|
||||
}
|
||||
@@ -77,13 +81,16 @@ void CardReader::selectFile(char* name)
|
||||
|
||||
if (file.open(&root, name, O_READ)) {
|
||||
filesize = file.fileSize();
|
||||
SERIAL_PROTOCOLLN("File opened:"<<name<<" Size:"<<filesize);
|
||||
SERIAL_PROTOCOLPGM("File opened:");
|
||||
SERIAL_PROTOCOL(name);
|
||||
SERIAL_PROTOCOLPGM(" Size:");
|
||||
SERIAL_PROTOCOLLN(filesize);
|
||||
sdpos = 0;
|
||||
|
||||
SERIAL_PROTOCOLLN("File selected");
|
||||
SERIAL_PROTOCOLLNPGM("File selected");
|
||||
}
|
||||
else{
|
||||
SERIAL_PROTOCOLLN("file.open failed");
|
||||
SERIAL_PROTOCOLLNPGM("file.open failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,11 +105,14 @@ void CardReader::startFilewrite(char *name)
|
||||
|
||||
if (!file.open(&root, name, O_CREAT | O_APPEND | O_WRITE | O_TRUNC))
|
||||
{
|
||||
SERIAL_PROTOCOLLN("open failed, File: "<<name<<".");
|
||||
SERIAL_PROTOCOLPGM("open failed, File: ");
|
||||
SERIAL_PROTOCOL(name);
|
||||
SERIAL_PROTOCOLLNPGM(".");
|
||||
}
|
||||
else{
|
||||
saving = true;
|
||||
SERIAL_PROTOCOLLN("Writing to file: "<<name);
|
||||
SERIAL_PROTOCOLPGM("Writing to file: ");
|
||||
SERIAL_PROTOCOLLN(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,10 +120,13 @@ void CardReader::startFilewrite(char *name)
|
||||
void CardReader::getStatus()
|
||||
{
|
||||
if(cardOK){
|
||||
SERIAL_PROTOCOLLN("SD printing byte "<<sdpos<<"/"<<filesize);
|
||||
SERIAL_PROTOCOLPGM("SD printing byte ");
|
||||
SERIAL_PROTOCOL(sdpos);
|
||||
SERIAL_PROTOCOLPGM("/");
|
||||
SERIAL_PROTOCOLLN(filesize);
|
||||
}
|
||||
else{
|
||||
SERIAL_PROTOCOLLN("Not SD printing");
|
||||
SERIAL_PROTOCOLLNPGM("Not SD printing");
|
||||
}
|
||||
}
|
||||
void CardReader::write_command(char *buf)
|
||||
@@ -134,7 +147,8 @@ void CardReader::write_command(char *buf)
|
||||
file.write(begin);
|
||||
if (file.writeError)
|
||||
{
|
||||
SERIAL_ERRORLN("error writing to file");
|
||||
SERIAL_ERROR_START;
|
||||
SERIAL_ERRORLNPGM("error writing to file");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user