| 30 | } |
| 31 | |
| 32 | void 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 | |
| 53 | void printPart(const String& partitionName) |
| 54 | { |
no test coverage detected