save bytes by moving tmp[] to globals

This commit is contained in:
nino-porcino 2022-02-10 17:53:41 +01:00
parent 06ed8bfc4d
commit 3de30bf525

View File

@ -204,6 +204,7 @@ const int ERR_RESPONSE = 255;
const int OK_RESPONSE = 0;
char filename[64];
char tmp[64];
// **************************************************************************************
// **************************************************************************************
@ -307,7 +308,6 @@ void comando_dir() {
void print_dir_entry(File dir, int what) {
while (true) {
if(TIMEOUT) break;
File entry = dir.openNextFile();
if(!entry) {
@ -317,7 +317,6 @@ void print_dir_entry(File dir, int what) {
// send file size or directory
entry.getName(filename, 64);
char tmp[40];
if((what == 0 && entry.isDirectory()) || (what == 1 && !entry.isDirectory())) {
if(entry.isDirectory()) {
@ -330,6 +329,8 @@ void print_dir_entry(File dir, int what) {
send_byte_to_cpu(tmp[t]);
if(TIMEOUT) break;
}
if(TIMEOUT) break;
Serial.println(tmp);
}
entry.close();