refactor and improve ECSS module

This commit is contained in:
Robin Mueller
2025-09-10 14:58:11 +02:00
parent c6b74fecbd
commit 8fd46f6a30
14 changed files with 482 additions and 633 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
use crate::MAX_SEQ_COUNT;
use arbitrary_int::traits::Integer;
use core::cell::Cell;
use paste::paste;
@@ -101,7 +102,7 @@ pub struct SequenceCounterCcsdsSimple {
impl Default for SequenceCounterCcsdsSimple {
fn default() -> Self {
Self {
provider: SequenceCounterSimple::new_custom_max_val_u16(MAX_SEQ_COUNT),
provider: SequenceCounterSimple::new_custom_max_val_u16(MAX_SEQ_COUNT.as_u16()),
}
}
}
@@ -341,7 +342,7 @@ mod tests {
#[test]
fn test_ccsds_counter_overflow() {
let ccsds_counter = SequenceCounterCcsdsSimple::default();
for _ in 0..MAX_SEQ_COUNT + 1 {
for _ in 0..MAX_SEQ_COUNT.value() + 1 {
ccsds_counter.increment();
}
assert_eq!(ccsds_counter.get(), 0);