firmware: rolling-hour duty-cycle guard (0.1% default) with measured justification

This commit is contained in:
Lars Nolden
2026-09-01 11:33:04 +02:00
parent 6633cd6f92
commit cafc9dff26
4 changed files with 105 additions and 3 deletions
+5
View File
@@ -44,6 +44,11 @@ static void handle_set(char *args)
} else if (strcmp(key, "repeat_enabled") == 0) {
g_cfg.repeat_enabled = (val[0] == '1');
ack("set repeat_enabled", true, NULL);
} else if (strcmp(key, "duty_budget_ppm") == 0) {
long v = strtol(val, NULL, 10);
if (v < 0 || v > 100000) { ack("set", false, "range 0..100000 ppm"); return; }
g_cfg.duty_budget_ppm = (uint32_t)v;
ack("set duty_budget_ppm", true, v == 0 ? "guard disabled" : NULL);
} else if (strcmp(key, "preamble_bits") == 0) {
long v = strtol(val, NULL, 10);
uint8_t code;