macro_rules! manage_cycle_time_thermal {
(
$start_time:expr,
$cycle_time_duration:expr,
$cycle_time_millis_const:expr,
$spin_sleeper:expr,
$lock_warn_cycle_time_exceeded:expr,
$actuation_mutex_was_blocked:expr,
$location:expr
) => { ... };
}Expand description
A macro to manage the timing of a fixed-duration loop applicable to both thermal control modules.
This macro encapsulates the logic for:
- Calculating the loop’s execution duration.
- Sleeping for the remaining time to meet the target cycle duration.
- Logging a “log-once” warning if the execution time exceeds the target.
- Resetting the cycle timer and associated flags for the next iteration.