Skip to content

Commit

Permalink
[fix][actuators] Lisa-L with Asctech v2 motors only start after refla…
Browse files Browse the repository at this point in the history
…shing when a bus error was sensed on stm32-i2c. multiple re-init solves the problem.

closes #224
  • Loading branch information
flixr committed Jun 26, 2012
1 parent 72f4b21 commit 8e95d72
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c
Expand Up @@ -82,8 +82,10 @@ void actuators_set(bool_t motors_on) {
}
#endif

if (!actuators_asctec.i2c_trans.status == I2CTransSuccess)
if (actuators_asctec.i2c_trans.status != I2CTransSuccess) {
actuators_asctec.nb_err++;
return;
}

#ifdef KILL_MOTORS
actuators_asctec.cmds[PITCH] = 0;
Expand Down Expand Up @@ -143,11 +145,21 @@ void actuators_set(bool_t motors_on) {
void actuators_set(bool_t motors_on) {
#if defined ACTUATORS_START_DELAY && ! defined SITL
if (!actuators_delay_done) {
if (SysTimeTimer(actuators_delay_time) < USEC_OF_SEC(ACTUATORS_START_DELAY)) return;
if (SysTimeTimer(actuators_delay_time) < USEC_OF_SEC(ACTUATORS_START_DELAY)) {
//Lisa-L with Asctech v2 motors only start after reflashing when a bus error was sensed on stm32-i2c.
//multiple re-init solves the problem.
i2c1_init();
return;
}
else actuators_delay_done = TRUE;
}
#endif

if (actuators_asctec.i2c_trans.status != I2CTransSuccess) {
actuators_asctec.nb_err++;
return;
}

supervision_run(motors_on, FALSE, commands);
#ifdef KILL_MOTORS
actuators_asctec.i2c_trans.buf[0] = 0;
Expand Down

0 comments on commit 8e95d72

Please sign in to comment.