From 4f88ee97a923151dea8f9bf8c1ea3620dc848d08 Mon Sep 17 00:00:00 2001 From: Guillaume Chevillot Date: Thu, 27 Mar 2008 23:15:24 +0100 Subject: Update current limitation to rise an IT on falling edge and no longer at low level. --- analog/motor-power-avr/src/mp_pwm_L_.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'analog/motor-power-avr/src/mp_pwm_L_.c') diff --git a/analog/motor-power-avr/src/mp_pwm_L_.c b/analog/motor-power-avr/src/mp_pwm_L_.c index d596cf95..1374dced 100644 --- a/analog/motor-power-avr/src/mp_pwm_L_.c +++ b/analog/motor-power-avr/src/mp_pwm_L_.c @@ -35,8 +35,12 @@ void init_pwm_L_ (void) { // PWM rising edge on timer overflow IT ISR(OVF_L_vect) { - // programs the state which is ordered by the core code - state_L_ = state_L_cmd; + if(!ILIM_L_io) + // stay in High-Z if current limitation still active + state_L_ = CMD_STATE_HIGH_Z; + else + // programs the state which is ordered by the core code + state_L_ = state_L_cmd; switch (state_L_) { -- cgit v1.2.3