From 4cf8eb254ee47d9069f3d7012ddb2d178cc216ef Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Thu, 15 Jul 2021 16:51:03 +0800 Subject: [PATCH] Report actual duty cycle on startup --- adaptive.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adaptive.c b/adaptive.c index 15ce920..39af6a8 100644 --- a/adaptive.c +++ b/adaptive.c @@ -182,11 +182,11 @@ void adaptive_init() adaptive_subblock_active = false; float N = roundf(adaptive_subblock_dutycycle_D * Modes.adaptive_duty_cycle); - if (N <= 0 || N > adaptive_subblock_dutycycle_D) { - fprintf(stderr, "warning: --adaptive-duty-cycle value %.1f%% is out of range, using 100%% instead\n", - Modes.adaptive_duty_cycle * 100.0); + if (N <= 0) + N = 1; + if (N > adaptive_subblock_dutycycle_D) N = adaptive_subblock_dutycycle_D; - } + fprintf(stderr, "adaptive: using %.0f%% duty cycle\n", 100.0 * N / adaptive_subblock_dutycycle_D); adaptive_subblock_dutycycle_N = (unsigned)N; adaptive_burst_window_remaining = adaptive_samples_per_window;