MCPcopy Create free account
hub / github.com/SmingHub/Sming / printPart

Function printPart

samples/Basic_Storage/app/application.cpp:32–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void printPart(Storage::Partition part)
33{
34 size_t bufSize = std::min(storage_size_t(4096), part.size());
35 char buf[bufSize];
36 OneShotFastUs timer;
37 if(!part.read(0, buf, bufSize)) {
38 Serial << _F("Error reading from partition '") << part.name() << "'" << endl;
39 } else {
40 auto elapsed = timer.elapsedTime();
41 String s = part.getDeviceName();
42 s += '/';
43 s += part.name();
44 m_printHex(s.c_str(), buf, std::min(size_t(128U), bufSize));
45 Serial << _F("Elapsed: ") << elapsed.toString() << endl;
46 if(elapsed != 0) {
47 Serial << _F("Speed: ") << 1000 * bufSize / elapsed << " KB/s" << endl;
48 }
49 }
50 Serial.println();
51}
52
53void printPart(const String& partitionName)
54{

Callers 1

initFunction · 0.85

Calls 11

minFunction · 0.85
m_printHexFunction · 0.85
elapsedTimeMethod · 0.80
getDeviceNameMethod · 0.80
printlnMethod · 0.80
findPartitionFunction · 0.50
sizeMethod · 0.45
readMethod · 0.45
nameMethod · 0.45
c_strMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected