Skip to content

Commit

Permalink
Merge pull request #28 from claydugo/extended_max_pulse_duration
Browse files Browse the repository at this point in the history
Extend max digital pulse duration
  • Loading branch information
hmaarrfk authored Nov 3, 2023
2 parents 4894ebc + 04951d3 commit 6e85275
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 > 180.1) {
return EINVAL;
}

Expand Down

0 comments on commit 6e85275

Please sign in to comment.