1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

emulation on host: Add missing ESP.*() mocking methods to EspClass. (#5765)

This commit is contained in:
Clemens Kirchgatterer 2019-02-16 00:05:18 +01:00 committed by david gauchard
parent d3a2ab9bb4
commit 9ba89ebaf4

View File

@ -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;