bugfix for scheduling file

This commit is contained in:
Robin Müller 2023-01-24 11:37:25 +01:00
parent fbd62f1a3a
commit 3315017b9b
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 9 additions and 5 deletions

2
NOTICE
View File

@ -1,3 +1,3 @@
Workspace for the satrs framework development. Workspace for the satrs framework development.
This software contains code developed at the University of Stuttgart's Institute of Space Systems. This software contains code developed at the University of Stuttgart's Institute of Space Systems.

View File

@ -28,9 +28,9 @@ impl PusScheduler {
pub fn num_scheduled_telecommands(&self) -> u64 { pub fn num_scheduled_telecommands(&self) -> u64 {
let mut num_entries = 0; let mut num_entries = 0;
for entries in &self.tc_map { for entries in &self.tc_map {
num_entries += entries.1.len(); num_entries += entries.1.len() as u64;
} }
num_entries.into() num_entries
} }
pub fn is_enabled(&self) -> bool { pub fn is_enabled(&self) -> bool {
@ -63,8 +63,12 @@ impl PusScheduler {
return false; return false;
} }
match self.tc_map.entry(time_stamp) { match self.tc_map.entry(time_stamp) {
Entry::Vacant(e) => e.insert(vec![addr]), Entry::Vacant(e) => {
Entry::Occupied(mut v) => v.get_mut().push(addr), e.insert(vec![addr]);
},
Entry::Occupied(mut v) => {
v.get_mut().push(addr);
},
} }
true true
} }