From 39b1f3e0bee9db081b130c8e11bf65b91c4ed81b Mon Sep 17 00:00:00 2001 From: Samuel Hunt Date: Mon, 12 Jan 2026 18:34:52 +0000 Subject: Re-added rate_increment_ms --- src/fig/FIGCarouselPriority.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/fig/FIGCarouselPriority.h') diff --git a/src/fig/FIGCarouselPriority.h b/src/fig/FIGCarouselPriority.h index fc41616..76be671 100644 --- a/src/fig/FIGCarouselPriority.h +++ b/src/fig/FIGCarouselPriority.h @@ -58,6 +58,23 @@ constexpr int PRIORITY_CRITICAL = 0; // Debug flag for repetition rate statistics - logs actual vs required rates #define PRIORITY_RATE_STATS_DEBUG 0 +/* Helper function to calculate the deadline for the next transmission, in milliseconds. + * All values are multiples of 24ms (ETI frame duration) for easier reasoning. + */ +inline int rate_increment_ms(FIG_rate rate) +{ + switch (rate) { + case FIG_rate::FIG0_0: return 96; // Special case for FIG 0/0 + case FIG_rate::A: return 240; // At least 10 times per second + case FIG_rate::A_B: return 480; // Between 10 times and once per second + case FIG_rate::B: return 960; // Once per second + case FIG_rate::C: return 24000; // Once every 10 seconds + case FIG_rate::D: return 30000; // Less than once every 10 seconds + case FIG_rate::E: return 120000; // All in two minutes + } + return 960; // Default to rate B if unknown +} + /* * FIGEntryPriority - Holds a FIG and its scheduling state * -- cgit v1.2.3