Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions tests/host/common/MockEsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,40 @@ uint32_t EspClass::getFreeHeap()
return 30000;
}

String EspClass::getResetReason()
{
return "Power on";
}

uint32_t EspClass::getFreeSketchSpace()
{
return 4 * 1024 * 1024;
}

uint8_t EspClass::getCpuFreqMHz()
{
return 160;
}

const char *EspClass::getSdkVersion()
{
return "2.5.0";
}

uint32_t EspClass::getFlashChipSpeed()
{
return 40;
}

void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag) {
uint32_t hf = 10 * 1024;
float hm = 1 * 1024;

if (hfree) *hfree = hf;
if (hmax) *hmax = hm;
if (hfrag) *hfrag = 100 - (sqrt(hm) * 100) / hf;
}

bool EspClass::flashEraseSector(uint32_t sector)
{
return true;
Expand Down