Merge branch 'another_logic_fix_cds_stamp' into add_time_helpers

This commit is contained in:
Robin Müller 2023-01-14 17:50:10 +01:00
commit a24c9fc042
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 12 additions and 1 deletions

View File

@ -14,6 +14,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
from `chrono::DateTime<Utc>` and a generic UNIX timestamp (`i64` seconds from `chrono::DateTime<Utc>` and a generic UNIX timestamp (`i64` seconds
and subsecond milliseconds). and subsecond milliseconds).
# [v0.4.2] 14.01.2023
## Fixed
- CDS timestamp: Fixed another small logic error for stamp creation from the current
time with picosecond precision.
PR: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/8
# [v0.4.1] 14.01.2023 # [v0.4.1] 14.01.2023
## Fixed ## Fixed
@ -21,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- CDS timestamp: The conversion function from the current time were buggy - CDS timestamp: The conversion function from the current time were buggy
when specifying picoseconds precision, which could lead to overflow when specifying picoseconds precision, which could lead to overflow
multiplications and/or incorrect precision fields. multiplications and/or incorrect precision fields.
PR: https://egit.irs.uni-stuttgart.de/rust/spacepackets/pulls/7
# [v0.4.0] 10.01.2023 # [v0.4.0] 10.01.2023

View File

@ -311,7 +311,9 @@ impl ConversionFromNow {
)); ));
} }
SubmillisPrecision::Picoseconds(_) => { SubmillisPrecision::Picoseconds(_) => {
prec = Some(SubmillisPrecision::Picoseconds((now.subsec_nanos() % 10_u32.pow(6)) * 1000)); prec = Some(SubmillisPrecision::Picoseconds(
(now.subsec_nanos() % 10_u32.pow(6)) * 1000,
));
} }
_ => (), _ => (),
} }