Skip to content

Commit

Permalink
Merge pull request #18 from tidewise/fix_pps_canwait_checks
Browse files Browse the repository at this point in the history
fix: test against PPS_CANWAIT in pps caps instead of params
  • Loading branch information
doudou authored Feb 10, 2025
2 parents e632ab7 + 101df3a commit 46bb335
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/chrony.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ PPS PPS::open(std::string const& path)
throw std::runtime_error(
"pps " + path + " does not support capturing the rising edge");
}
if (!(mode & PPS_CANWAIT)) {
throw std::runtime_error("need a PPS that has CANWAIT support");
}

pps_params_t params;
if (time_pps_getparams(handle, &params) < 0) {
throw UnixError("could not query PPS params for " + path);
}
if (!(params.mode & PPS_CANWAIT)) {
throw std::runtime_error("need a PPS that has CANWAIT support");
}

params.mode |= PPS_CAPTUREASSERT;
params.mode &= ~PPS_CAPTURECLEAR;
Expand Down

0 comments on commit 46bb335

Please sign in to comment.