Skip to content
Snippets Groups Projects
Commit 9bbbb526 authored by bbartels's avatar bbartels
Browse files

quad: fix last issues on virt_quad with new i2c

parent 50ae506d
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ struct RCReceiverDriver create_unix_rc_receiver() {
struct I2CDriver create_unix_i2c() {
struct I2CDriver i2c;
i2c.state = NULL;
i2c.busId = 0;
i2c.reset = unix_i2c_reset;
i2c.write = unix_i2c_write;
i2c.read = unix_i2c_read;
......
......@@ -32,6 +32,7 @@ void help_sub_command(char *argv[]);
*/
int setup_hardware(hardware_t *hardware) {
hardware->i2c_0 = create_unix_i2c();
hardware->i2c_1 = create_unix_i2c();
hardware->rc_receiver = create_unix_rc_receiver();
hardware->motors = create_unix_motors();
hardware->uart = create_unix_uart();
......@@ -40,7 +41,7 @@ int setup_hardware(hardware_t *hardware) {
hardware->mio7_led = create_unix_mio7_led();
hardware->sys = create_unix_system();
hardware->imu = create_unix_imu(&hardware->i2c_0);
hardware->lidar = create_unix_lidar(&hardware->i2c_0);
hardware->lidar = create_unix_lidar(&hardware->i2c_1);
hardware->of = create_unix_optical_flow(&hardware->i2c_0);
return 0;
}
......@@ -121,6 +122,7 @@ void open_new_shm_io() {
pthread_mutex_init(&virt_quad_io->led_lock, &attr);
pthread_mutex_init(&virt_quad_io->motors_lock, &attr);
pthread_mutex_init(&virt_quad_io->rc_lock, &attr);
pthread_mutex_init(&virt_quad_io->i2c_lock, &attr);
}
void open_existing_shm_io() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment