From 36031f0a7ad6210e820ebb7bf33c4e4d4a046ab4 Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Thu, 15 Feb 2018 20:30:49 -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 df02d16..ea4d679 100644 --- a/src/pwr/main.c +++ b/src/pwr/main.c @@ -180,7 +180,7 @@ 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 = 32; + load->lockout = 16; if (load->limit < LOAD_LIMIT_TICKS) load->limit++; } @@ -189,7 +189,7 @@ static void check_load(load_t *load) { void limit_load(load_t *load) { - if (load->count < load->limit) { + if (load->count < load->limit || load->lockout) { IO_PORT_CLR(load->pin); // Lo IO_DDR_SET(load->pin); // Output -- 2.27.0