From da6a3bc5e525a05f301937b0d12f5c41a139eaf6 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Mon, 15 Jun 2009 20:18:53 +0200 Subject: pressure-control: set min pressure to 0.5bar Signed-off-by: Michael Buesch --- pressure_control/firmware/valves.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'pressure_control/firmware/valves.h') diff --git a/pressure_control/firmware/valves.h b/pressure_control/firmware/valves.h index 7586904..ddc043e 100644 --- a/pressure_control/firmware/valves.h +++ b/pressure_control/firmware/valves.h @@ -38,17 +38,20 @@ struct valves { uint8_t current_global_state; /* enum valves_global_state */ bool need_switch_to_idle; /* Need transition to VALVE_STATE_IDLE. */ jiffies_t switch_to_idle_time; /* Deadline for VALVE_STATE_IDLE transition. */ + + uint16_t state_force_threshold; /* Threshold for forcing the valve state */ }; -#define DEFINE_VALVE(name, _type, portid, bit0_open, bit0_close, bit1_open, bit1_close) \ +#define DEFINE_VALVE(name, _type, portid, bit0_open, bit0_close, bit1_open, bit1_close, force_thres) \ struct valves name = { \ - .type = _type, \ - .ddr = _SFR_ADDR(DDR##portid), \ - .port = _SFR_ADDR(PORT##portid), \ - .bit_0_open = bit0_open, \ - .bit_0_close = bit0_close, \ - .bit_1_open = bit1_open, \ - .bit_1_close = bit1_close, \ + .type = _type, \ + .ddr = _SFR_ADDR(DDR##portid), \ + .port = _SFR_ADDR(PORT##portid), \ + .bit_0_open = bit0_open, \ + .bit_0_close = bit0_close, \ + .bit_1_open = bit1_open, \ + .bit_1_close = bit1_close, \ + .state_force_threshold = force_thres, \ } #define VALVE_TOGGLE_MSEC 10 -- cgit v1.2.3