diff --git a/data/status.html b/data/status.html index 25d8d938..c5bd3a6f 100644 --- a/data/status.html +++ b/data/status.html @@ -5,8 +5,8 @@ + } + SmartSpin2K Web Server @@ -17,7 +17,7 @@

Main Index

Status

-
+ @@ -26,9 +26,13 @@

+ + - + + + @@ -107,7 +116,7 @@

var followElement = document.getElementById("follow"); var updatePending = false; var updateTimer = undefined; - + function onVisibilityChanged() { if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden) { stopUpdate(); @@ -125,7 +134,7 @@

//Update values on specified interval loading late because this tiny webserver hates frequent requests if (updateTimer === undefined) { updateTimer = setInterval(function () { - requestConfigValues(); + requestRuntimeValues(); }, 1500); } } @@ -154,11 +163,29 @@

document.getElementById("deviceName").value = obj.deviceName; document.getElementById("shiftStep").value = obj.shiftStep; document.getElementById("inclineMultiplier").value = obj.inclineMultiplier; - document.getElementById("incline").value = obj.incline; + //--- document.getElementById("ERGSensitivity").value = obj.ERGSensitivity; ---// + document.getElementById("connectedPowerMeter").value = obj.connectedPowerMeter; + } + }; + xhttp.open("GET", "/configJSON?includeDebugLog=true", true); + xhttp.send(); + } + } + + function requestRuntimeValues() { + if (!updatePending) { + updatePending = true + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function () { + updatePending = false; + if (this.readyState == 4 && this.status == 200) { + var obj = JSON.parse(this.responseText); + document.getElementById("currentIncline").value = obj.currentIncline; + document.getElementById("targetIncline").value = obj.targetIncline; document.getElementById("simulatedHr").value = obj.simulatedHr; document.getElementById("simulatedWatts").value = obj.simulatedWatts; + document.getElementById("targetWatts").value = obj.targetWatts; document.getElementById("simulatedCad").value = obj.simulatedCad; - document.getElementById("connectedPowerMeter").value = obj.connectedPowerMeter; if (debugElement.innerHTML == "Loading") { document.getElementById("debug").innerHTML = obj.debug; } else { @@ -167,7 +194,7 @@

updateDebugView(obj.debug); } }; - xhttp.open("GET", "/configJSON?includeDebugLog=true", true); + xhttp.open("GET", "/runtimeConfigJSON?includeDebugLog=true", true); xhttp.send(); } } @@ -184,6 +211,8 @@

//Delay loading css to not swamp webserver window.addEventListener('load', function () { setTimeout(loadCss, 100); + requestConfigValues(); + requestRuntimeValues(); startUpdate(); }, false); diff --git a/lib/ArduinoCompat/include/task.h b/lib/ArduinoCompat/include/task.h new file mode 100644 index 00000000..e6a665c9 --- /dev/null +++ b/lib/ArduinoCompat/include/task.h @@ -0,0 +1,3 @@ +#pragma once + +typedef void* TaskHandle_t; \ No newline at end of file diff --git a/test/native/test_PowerBuffer.cpp b/test/native/test_PowerBuffer.cpp index b16cdad0..39c1b67b 100644 --- a/test/native/test_PowerBuffer.cpp +++ b/test/native/test_PowerBuffer.cpp @@ -6,6 +6,7 @@ */ #include +#include #include "test.h" #include "ERG_Mode.h"

-

+

+

+
@@ -59,9 +63,13 @@

-

+

+

+
@@ -92,7 +100,8 @@

-
Loading
+
Loading