Browse Source

increased cpu clock; added autorestart line at cpu lag

master
parent
commit
8b923174eb
  1. 1
      platformio.ini
  2. 4
      src/CpuLoad.h

1
platformio.ini

@ -6,4 +6,5 @@ platform = espressif8266
board = nodemcuv2
framework = arduino
monitor_baud = 115200
board_f_cpu = 160000000L
lib_deps = ./lib/Json.zip, ./lib/WebSockets.zip

4
src/CpuLoad.h

@ -30,7 +30,9 @@ static void printCpuTime () {
static void printCpuLoad () {
if (millis() - cpuTimeLastUpdate > 2000) {
Serial.printf("CPU Load: %ld \n", cpuLoadAvgTime/10000);
int x = cpuLoadAvgTime/10000;
Serial.printf("CPU Load: %ld \n", x);
if (x > 400) ESP.restart();
cpuTimeLastUpdate = millis();
}
}

Loading…
Cancel
Save