worked on FileSystem, started to migrate logging class
This commit is contained in:
26
ext/sd/tests/Helper.h
Normal file
26
ext/sd/tests/Helper.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#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;}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user