diff options
| author | Samuel Hunt <sam@maxxwave.co.uk> | 2026-01-12 18:34:52 +0000 |
|---|---|---|
| committer | Samuel Hunt <sam@maxxwave.co.uk> | 2026-01-12 18:34:52 +0000 |
| commit | 39b1f3e0bee9db081b130c8e11bf65b91c4ed81b (patch) | |
| tree | 9dbcb16fa60ae6cf58e8c910c49c75fd1aaae4d6 /src/fig | |
| parent | 0f5c94de4d88ed79b0e3047c600d733c5715b1f8 (diff) | |
| download | dabmux-39b1f3e0bee9db081b130c8e11bf65b91c4ed81b.tar.gz dabmux-39b1f3e0bee9db081b130c8e11bf65b91c4ed81b.tar.bz2 dabmux-39b1f3e0bee9db081b130c8e11bf65b91c4ed81b.zip | |
Re-added rate_increment_msnext
Diffstat (limited to 'src/fig')
| -rw-r--r-- | src/fig/FIGCarouselPriority.cpp | 2 | ||||
| -rw-r--r-- | src/fig/FIGCarouselPriority.h | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/fig/FIGCarouselPriority.cpp b/src/fig/FIGCarouselPriority.cpp index ff40533..5434968 100644 --- a/src/fig/FIGCarouselPriority.cpp +++ b/src/fig/FIGCarouselPriority.cpp @@ -522,7 +522,7 @@ size_t FIGCarouselPriority::fill_fib(uint8_t* buf, size_t max_size, int fib_inde // Pass 2: Any remaining FIGs that can send (to fill unused space) // Reset tried set - we want to try everything again, but only those we skipped - std::set<FIGEntryPriority*> tried_pass1 = tried_this_fib; + std::unordered_set<FIGEntryPriority*> tried_pass1 = tried_this_fib; for (int prio = 1; prio < NUM_PRIORITIES && remaining > 2; prio++) { if (m_priorities[prio].carousel.empty()) { 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 * |
