Quellcode durchsuchen

Adjust SdBaseFile spacing

Scott Lahteine vor 9 Jahren
Ursprung
Commit
e114662cfa
1 geänderte Dateien mit 9 neuen und 8 gelöschten Zeilen
  1. 9
    8
      Marlin/SdBaseFile.cpp

+ 9
- 8
Marlin/SdBaseFile.cpp Datei anzeigen

@@ -1097,8 +1097,9 @@ int16_t SdBaseFile::read(void* buf, uint16_t nbyte) {
1097 1097
  fail:
1098 1098
   return -1;
1099 1099
 }
1100
-//------------------------------------------------------------------------------
1101
-/** Read the next directory entry from a directory file.
1100
+
1101
+/**
1102
+ * Read the next entry in a directory.
1102 1103
  *
1103 1104
  * \param[out] dir The dir_t struct that will receive the data.
1104 1105
  *
@@ -1130,16 +1131,16 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
1130 1131
     // Fill the long filename if we have a long filename entry.
1131 1132
     // Long filename entries are stored before the short filename.
1132 1133
     if (longFilename != NULL && DIR_IS_LONG_NAME(dir)) {
1133
-    	vfat_t *VFAT = (vfat_t*)dir;
1134
-  		// Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0
1135
-    	if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) {
1136
-  			// TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
1137
-    		n = ((VFAT->sequenceNumber & 0x1F) - 1) * FILENAME_LENGTH;
1134
+      vfat_t *VFAT = (vfat_t*)dir;
1135
+      // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0
1136
+      if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) {
1137
+        // TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
1138
+        n = ((VFAT->sequenceNumber & 0x1F) - 1) * FILENAME_LENGTH;
1138 1139
         for (uint8_t i=0; i<FILENAME_LENGTH; i++)
1139 1140
           longFilename[n+i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i-5] : VFAT->name3[i-11];
1140 1141
         // If this VFAT entry is the last one, add a NUL terminator at the end of the string
1141 1142
         if (VFAT->sequenceNumber & 0x40) longFilename[n+FILENAME_LENGTH] = '\0';
1142
-  		}
1143
+      }
1143 1144
     }
1144 1145
     // Return if normal file or subdirectory
1145 1146
     if (DIR_IS_FILE_OR_SUBDIR(dir)) return n;

Laden…
Abbrechen
Speichern