summaryrefslogtreecommitdiff
path: root/analog/motor-power-avr/src/mp_pwm_L_.c
diff options
context:
space:
mode:
authorGuillaume Chevillot2008-03-27 23:15:24 +0100
committerGuillaume Chevillot2008-03-27 23:15:24 +0100
commit4f88ee97a923151dea8f9bf8c1ea3620dc848d08 (patch)
tree320067570b3b8ccd16650a330d415fbb9c81bb48 /analog/motor-power-avr/src/mp_pwm_L_.c
parent0e4c3e1829be3a789b29ff174a3e1ab06dc28600 (diff)
Update current limitation to rise an IT on falling edge and no longer
at low level.
Diffstat (limited to 'analog/motor-power-avr/src/mp_pwm_L_.c')
-rw-r--r--analog/motor-power-avr/src/mp_pwm_L_.c8
1 files changed, 6 insertions, 2 deletions
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_)
{