diff --git a/sw/airborne/motor_bench/mb_asctech_twi_controller.c b/sw/airborne/motor_bench/mb_asctech_twi_controller.c deleted file mode 100644 index 0443714dfc..0000000000 --- a/sw/airborne/motor_bench/mb_asctech_twi_controller.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "mb_twi_controller.h" - -#include "i2c.h" - -#include "led.h" - -uint8_t mb_twi_command; - -uint8_t mb_twi_nb_overun; -uint8_t mb_twi_i2c_done; - - -#define MB_TWI_CONTROLLER_MAX_CMD 200 -#define MB_TWI_CONTROLLER_ADDR 0x02 - -void mb_twi_controller_init(void) { - mb_twi_nb_overun = 0; - mb_twi_i2c_done = TRUE; -} - -void mb_twi_controller_set( float throttle ) { - if (mb_twi_i2c_done) { - LED_TOGGLE(1); - uint8_t pitch = 100; - uint8_t roll = 100; - uint8_t yaw = 100; - mb_twi_command = throttle * MB_TWI_CONTROLLER_MAX_CMD; - i2c_buf[0] = pitch; - i2c_buf[1] = roll; - i2c_buf[2] = yaw; - i2c_buf[3] = mb_twi_command; - i2c_transmit(MB_TWI_CONTROLLER_ADDR, 4, &mb_twi_i2c_done); - } - else - mb_twi_nb_overun++; -} diff --git a/sw/airborne/motor_bench/mb_twi_controller_asctech.h b/sw/airborne/motor_bench/mb_twi_controller_asctech.h new file mode 100644 index 0000000000..f6bc66d59a --- /dev/null +++ b/sw/airborne/motor_bench/mb_twi_controller_asctech.h @@ -0,0 +1,12 @@ +#ifndef MB_TWI_CONTROLLER_ASCTECH_H +#define MB_TWI_CONTROLLER_ASCTECH_H + +extern bool_t mb_twi_controller_asctech_command; +extern uint8_t mb_twi_controller_asctech_command_type; + +#define mb_twi_controller_asctech_SetCommand(value) { \ + mb_twi_controller_asctech_command = TRUE; \ + mb_twi_controller_asctech_command_type = value; \ + } + +#endif /* MB_TWI_CONTROLLER_ASCTECH_H */