Files
ESP8266lib/ext/sd/tests/Helper.h

27 lines
443 B
C

#pragma once
#define PLATFORM DESKTOP
#include "../Types.h"
struct TestDevice {
uint8_t buf[4096];
/** read a 512 byte block into dst */
bool readSingleBlock(LBA512 addr, uint8_t* dst) {
memcpy(dst, buf+addr*512, 512);
return true;
}
bool writeSingleBlock(LBA512 addr, uint8_t* src) {
memcpy(buf+addr*512, src, 512);
return true;
}
void reset(uint8_t val) {
for (int i = 0; i < sizeof(buf); ++i) {buf[i] = val;}
}
};