timeout corrections

This commit is contained in:
Robin Mueller
2026-03-17 15:33:36 +01:00
parent 5aef864bb9
commit dbab19e10f
3 changed files with 9 additions and 5 deletions
+5 -3
View File
@@ -169,6 +169,7 @@ impl MgmHandlerLis3Mdl {
spi_com: SpiCommunication,
shared_mgm_set: Arc<Mutex<MgmData>>,
mode_leaf_helper: ModeLeafHelper,
mode_timeout: Duration
) -> Self {
Self {
id,
@@ -176,7 +177,7 @@ impl MgmHandlerLis3Mdl {
switch_helper,
spi_com,
shared_mgm_set,
mode_helpers: ModeHelper::new(DeviceMode::Off, Duration::from_millis(200)),
mode_helpers: ModeHelper::new(DeviceMode::Off, mode_timeout),
buffers: BufWrapper::default(),
stamp_helper: TimestampHelper::default(),
hk_helper: HkHelperSingleSet::new(false, Duration::from_millis(200)),
@@ -392,6 +393,7 @@ impl MgmHandlerLis3Mdl {
}
if self.mode_helpers.transition_state == TransitionState::PowerSwitching {
if self.switch_helper.is_switch_on(self.switch_id()) {
log::info!("switch is on");
self.mode_helpers.transition_state = TransitionState::Done;
} else if self.mode_helpers.timed_out() {
self.handle_mode_transition_failure();
@@ -420,13 +422,13 @@ impl MgmHandlerLis3Mdl {
// Should be called to complete a mode transition successfully.
fn handle_mode_reached(&mut self) {
let tc_commander = self.mode_helpers.finish(true);
self.announce_mode();
if let Some(requestor) = self.mode_helpers.tc_commander {
if let Some(requestor) = tc_commander {
self.send_mode_tm(requestor);
}
// Inform our parent about mode changes.
self.report_mode_to_parent();
self.mode_helpers.finish(true);
}
fn announce_mode(&self) {
+1 -1
View File
@@ -169,7 +169,7 @@ pub mod pool {
pub mod tasks {
pub const FREQ_MS_UDP_TMTC: u64 = 200;
pub const FREQ_MS_AOCS: u64 = 500;
pub const FREQ_MS_AOCS: u64 = 200;
pub const FREQ_MS_CONTROLLER: u64 = 200;
pub const SIM_CLIENT_IDLE_DELAY_MS: u64 = 5;
}
+3 -1
View File
@@ -188,6 +188,7 @@ fn main() {
request_rx: mgm_0_mode_request_rx,
report_tx: mgm_0_mode_report_tx,
},
Duration::from_millis(1000)
);
let mut mgm_1_handler = mgm::MgmHandlerLis3Mdl::new(
mgm::MgmId::_1,
@@ -202,6 +203,7 @@ fn main() {
request_rx: mgm_1_mode_request_rx,
report_tx: mgm_1_mode_report_tx,
},
Duration::from_millis(1000)
);
let mut mgm_assembly = mgm_assembly::Assembly::new(
mgm_assembly::ParentQueueHelper {
@@ -216,7 +218,7 @@ fn main() {
tc_rx: mgm_assembly_tc_rx,
tm_tx: tm_sink_tx.clone(),
},
Duration::from_millis(300),
Duration::from_millis(2000),
);
let pcdu_serial_interface = if let Some(sim_client) = opt_sim_client.as_mut() {