From cfcb5b22a0e66397c5da2bc324705be0ef26a25d Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Thu, 15 Feb 2018 21:20:30 -0800 Subject: [PATCH] Load limit duty cycle w/ lockout --- src/pwr/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pwr/main.c b/src/pwr/main.c index 9ad0648..0db219a 100644 --- a/src/pwr/main.c +++ b/src/pwr/main.c @@ -180,11 +180,11 @@ static void measure_nominal_voltage() { static void check_load(load_t *load) { bool overtemp = CURRENT_OVERTEMP * 100 < regs[load->reg]; if (overtemp && !load->lockout) { - load->lockout = 210; // About 1s + load->lockout = true; if (load->limit < LOAD_LIMIT_TICKS) load->limit++; } - if (load->lockout) load->lockout--; + if (!overtemp) load->lockout = false; } -- 2.27.0