diff --git a/sw/airborne/fly_by_wire/3dmg.c b/sw/airborne/fly_by_wire/3dmg.c new file mode 100644 index 0000000000..61008e5c47 --- /dev/null +++ b/sw/airborne/fly_by_wire/3dmg.c @@ -0,0 +1,140 @@ + + +#include "std.h" +#include +#include +#include +#include "3dmg.h" +#include "uart.h" + +volatile bool_t _3dmg_data_ready; +int16_t _3dmg_roll, _3dmg_pitch, _3dmg_yaw; +int16_t _3dmg_roll_dot, _3dmg_pitch_dot, _3dmg_yaw_dot; +uint16_t _3dmg_timer_tick; +uint8_t type, state; +uint16_t checksum_read, checksum_comp; + +void _3dmg_set_continuous_mode ( void ) { +#define REQ_CONT_LEN 5 + uint8_t msg[REQ_CONT_LEN] = { 0x10, 0x00, 0x31, 0x00, 0x41}; + uint8_t i; + for (i=0; i +#include "std.h" + +void _3dmg_capture_gyro_bias ( void ); +void _3dmg_set_continuous_mode ( void ); +extern volatile bool_t _3dmg_data_ready; +extern int16_t _3dmg_roll, _3dmg_pitch, _3dmg_yaw; +extern int16_t _3dmg_roll_dot, _3dmg_pitch_dot, _3dmg_yaw_dot; + +#endif /* _3DMG_G */ diff --git a/sw/airborne/fly_by_wire/Makefile b/sw/airborne/fly_by_wire/Makefile index a09804ac21..09c2e044bf 100644 --- a/sw/airborne/fly_by_wire/Makefile +++ b/sw/airborne/fly_by_wire/Makefile @@ -55,7 +55,9 @@ $(TARGET).srcs = \ spi.c \ uart.c \ adc_fbw.c \ - + 3dmg.c \ + imu.c \ + control.c \ include ../../../conf/Makefile.local include ../../../conf/Makefile.avr