Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Normalize the Time-I record timestamp to 1s. #105

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion evrApp/src/devEvrStringIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,18 @@ try {
if (ts.secPastEpoch==priv->last_bad)
return 0;

// Normalize the timestamp to seconds
epicsTimeStamp ts_sec = ts;
// Round the timestamp to 1s accuracy
if (ts_sec.nsec + 500000000u >= 1000000000u)
ts_sec.secPastEpoch += 1;

ts_sec.nsec = 0; // Remove the ns part

size_t r=epicsTimeToStrftime(prec->val,
sizeof(prec->val),
"%a, %d %b %Y %H:%M:%S %z",
&ts);
&ts_sec);
if(r==0||r==sizeof(prec->val)){
recGblRecordError(S_dev_badArgument, (void*)prec,
"Format string resulted in error");
Expand Down
2 changes: 1 addition & 1 deletion mrfCommon/src/mrfCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ struct SB {
*
* To quote the manual:
* Subrelease ID For production releases the subrelease ID counts up from 00.
* For pre-releases this ID is used backwards counting down from ff i.e. when
* For pre-releases this ID is used "backwards" counting down from ff i.e. when
* approacing release 12000207, we have prereleases 12FF0206, 12FE0206,
* 12FD0206 etc. in this order.
*/
Expand Down
Loading