Macro manage_cycle_time_thermal

Source
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:

  1. Calculating the loop’s execution duration.
  2. Sleeping for the remaining time to meet the target cycle duration.
  3. Logging a “log-once” warning if the execution time exceeds the target.
  4. Resetting the cycle timer and associated flags for the next iteration.