MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / createFilename

Function createFilename

Marlin/src/sd/cardreader.cpp:194–203  ·  view source on GitHub ↗

Get a DOS 8.3 filename in its useful form, e.g., "MYFILE EXT" => "MYFILE.EXT"

Source from the content-addressed store, hash-verified

192// Get a DOS 8.3 filename in its useful form, e.g., "MYFILE EXT" => "MYFILE.EXT"
193//
194char *createFilename(char * const buffer, const dir_t &p) {
195 char *pos = buffer;
196 for (uint8_t i = 0; i < 11; ++i) {
197 if (p.name[i] == ' ') continue;
198 if (i == 8) *pos++ = '.';
199 *pos++ = p.name[i];
200 }
201 *pos++ = '\0';
202 return buffer;
203}
204
205inline bool extIsBIN(char *ext) {
206 return ext[0] == 'B' && ext[1] == 'I' && ext[2] == 'N';

Callers 5

selectByIndexMethod · 0.85
selectByNameMethod · 0.85
printListingMethod · 0.85
diveToNewestFileMethod · 0.85
loadAssetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected