summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2022-05-21 00:57:51 -0700
committerH. Peter Anvin <hpa@zytor.com>2022-05-21 00:57:51 -0700
commit33ac49c4fe419ca36003c8fc7e578309f47eb844 (patch)
tree2d3535c6adc3fe5a703a7248030ecd4425483ebb
parent0074da1694238de1151ed5e0c71e3487032034dd (diff)
downloadblinktest-33ac49c4fe419ca36003c8fc7e578309f47eb844.tar.gz
blinktest-33ac49c4fe419ca36003c8fc7e578309f47eb844.tar.xz
blinktest-33ac49c4fe419ca36003c8fc7e578309f47eb844.zip
httpd: allow status refresh down to 2 s
Allow any second granularity; arbitrarily restrict to 2 s for now
-rw-r--r--esp32/max80/httpd.c7
-rw-r--r--esp32/output/max80.ino.binbin793712 -> 793712 bytes
-rw-r--r--esp32/www/status.html2
-rw-r--r--fpga/output/v1.fwbin747992 -> 747969 bytes
-rw-r--r--fpga/output/v2.fwbin747298 -> 747300 bytes
5 files changed, 4 insertions, 5 deletions
diff --git a/esp32/max80/httpd.c b/esp32/max80/httpd.c
index a20fcc1..08479ee 100644
--- a/esp32/max80/httpd.c
+++ b/esp32/max80/httpd.c
@@ -357,24 +357,23 @@ static esp_err_t httpd_set_config(httpd_req_t *req, const char *query)
return httpd_update_done(req, "Configuration", rv1 ? rv1 : rv2);
}
-#define MIN_STATUS_REF 2 /* Minimum refresh time in ms */
+#define MIN_STATUS_REF 1 /* Minimum refresh time in s */
static void httpd_get_status_extra(FILE *f, httpd_req_t *req)
{
static const char refresh_time_config[] = "http.status.refresh";
- const unsigned long min_status_ref = 5;
char timebuf[64];
size_t len;
struct timeval tv;
unsigned long statref;
- statref = Max(getenv_ul(refresh_time_config, 0), min_status_ref);
+ statref = Max(getenv_ul(refresh_time_config, 0), MIN_STATUS_REF);
if (httpd_req_get_url_query_str(req, timebuf, sizeof timebuf) == ESP_OK &&
*timebuf) {
char *ep;
unsigned long newstatref = strtoul(timebuf, &ep, 10);
- if (!*ep && newstatref >= min_status_ref && newstatref != statref) {
+ if (!*ep && newstatref >= MIN_STATUS_REF && newstatref != statref) {
statref = newstatref;
setenv_config(refresh_time_config, timebuf);
read_config(NULL, true); /* Save changed config */
diff --git a/esp32/output/max80.ino.bin b/esp32/output/max80.ino.bin
index a44b330..9fc536e 100644
--- a/esp32/output/max80.ino.bin
+++ b/esp32/output/max80.ino.bin
Binary files differ
diff --git a/esp32/www/status.html b/esp32/www/status.html
index bed46a1..8f3236e 100644
--- a/esp32/www/status.html
+++ b/esp32/www/status.html
@@ -127,7 +127,7 @@
<label class="refresh">
<span>Refresh interval:</span>
<input class="noro" id="refresh_time" type="number"
- name="http.status.refresh" value="10" step="5" min="5"
+ name="http.status.refresh" value="10" step="1" min="2"
onchange="ref_status(true)" />&nbsp;s
</label>
</fieldset>
diff --git a/fpga/output/v1.fw b/fpga/output/v1.fw
index 77e926b..bdbde78 100644
--- a/fpga/output/v1.fw
+++ b/fpga/output/v1.fw
Binary files differ
diff --git a/fpga/output/v2.fw b/fpga/output/v2.fw
index 55280ec..8f44c97 100644
--- a/fpga/output/v2.fw
+++ b/fpga/output/v2.fw
Binary files differ