From 2fd9605d212b55a6f530680558947d9876e46d1f Mon Sep 17 00:00:00 2001 From: Clay Dugo Date: Fri, 3 Nov 2023 17:36:24 -0400 Subject: [PATCH 1/2] Extend max digital pulse duration --- src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c623a07..e39a18a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -460,9 +460,10 @@ int gpio_digital_pulse(CommandRouter *cmd, int argc, const char **argv) { return EINVAL; duration = strtod(argv[4], nullptr); - // limit the duration to 500 ms so as not to have - // things be too slow - if (duration < 0 || duration > 500E-3) { + + // allow for 3 mins which should accomodate + // any reasonable use case + if (duration < 0 || duration > 180000-3) { return EINVAL; } From 04951d3ea75ae47b2aa7b0174fc7c1a4aa3a0488 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Fri, 3 Nov 2023 18:08:08 -0400 Subject: [PATCH 2/2] simplify notation --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index e39a18a..3b6cac9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -463,7 +463,7 @@ int gpio_digital_pulse(CommandRouter *cmd, int argc, const char **argv) { // allow for 3 mins which should accomodate // any reasonable use case - if (duration < 0 || duration > 180000-3) { + if (duration < 0 || duration > 180.1) { return EINVAL; }