Merge branch 'main' of egit.irs.uni-stuttgart.de:rust/spacepackets
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
This commit is contained in:
commit
00744a22fc
@ -12,7 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- Added `Sub` implementation for `UnixTimestamp` to calculate the duration between two timestamps.
|
- `From<$TY>` for the `EcssEnum$TY` ECSS enum type definitions.
|
||||||
|
- `Sub` implementation for `UnixTimestamp` to calculate the duration between two timestamps.
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
|
@ -360,10 +360,28 @@ impl<TYPE: Debug + Copy + Clone + PartialEq + Eq + ToBeBytes + Into<u64>> EcssEn
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type EcssEnumU8 = GenericEcssEnumWrapper<u8>;
|
macro_rules! generic_ecss_enum_typedefs_and_from_impls {
|
||||||
pub type EcssEnumU16 = GenericEcssEnumWrapper<u16>;
|
($($ty:ty => $Enum:ident),*) => {
|
||||||
pub type EcssEnumU32 = GenericEcssEnumWrapper<u32>;
|
$(
|
||||||
pub type EcssEnumU64 = GenericEcssEnumWrapper<u64>;
|
pub type $Enum = GenericEcssEnumWrapper<$ty>;
|
||||||
|
|
||||||
|
impl From<$ty> for $Enum {
|
||||||
|
fn from(value: $ty) -> Self {
|
||||||
|
Self::new(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)*
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generates EcssEnum<$TY> type definitions as well as a From<$TY> for EcssEnum<$TY>
|
||||||
|
// implementation.
|
||||||
|
generic_ecss_enum_typedefs_and_from_impls! {
|
||||||
|
u8 => EcssEnumU8,
|
||||||
|
u16 => EcssEnumU16,
|
||||||
|
u32 => EcssEnumU32,
|
||||||
|
u64 => EcssEnumU64
|
||||||
|
}
|
||||||
|
|
||||||
/// Generic trait for PUS packet abstractions which can written to a raw slice as their raw
|
/// Generic trait for PUS packet abstractions which can written to a raw slice as their raw
|
||||||
/// byte representation. This is especially useful for generic abstractions which depend only
|
/// byte representation. This is especially useful for generic abstractions which depend only
|
||||||
|
Loading…
Reference in New Issue
Block a user