MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / usbReadCallback

Function usbReadCallback

src/massStorage.cpp:315–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315int32_t usbReadCallback(uint32_t lba, uint32_t offset, void *buffer, uint32_t bufsize) {
316 const uint32_t secSize = SDM.sectorSize();
317 if (secSize == 0 || offset != 0 || (bufsize % secSize) != 0) return -1;
318
319 const uint32_t blocks = bufsize / secSize;
320 for (uint32_t x = 0; x < blocks; ++x) {
321 if (!SDM.readRAW(reinterpret_cast<uint8_t *>(buffer) + (x * secSize), lba + x)) {
322 return -1; // read error
323 }
324 }
325 return bufsize;
326}
327
328bool usbStartStopCallback(uint8_t power_condition, bool start, bool load_eject) {
329 (void)power_condition;

Callers 1

tud_msc_read10_cbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected