Skip to content

Commit

Permalink
fix(Mount Matrix): Update mount matrix for multiple devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
pastaq authored and ShadowApex committed May 24, 2024
1 parent befa630 commit 94cabab
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 6 deletions.
4 changes: 4 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-ayaneo_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ source_devices:
- group: imu
iio:
name: i2c-BMI0160:00
mount_matrix:
x: [0, -1, 0]
y: [0, 0, -1]
z: [1, 0, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
Expand Down
6 changes: 5 additions & 1 deletion rootfs/usr/share/inputplumber/devices/50-ayaneo_2021.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ source_devices:
phys_path: isa0060/serio0/input0
- group: imu
iio:
name: i2c-BMI0160:00
name: i2c-10EC5280:00
mount_matrix:
x: [0, -1, 0]
y: [0, 0, -1]
z: [1, 0, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
Expand Down
4 changes: 4 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-ayaneo_2s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ source_devices:
- group: imu
iio:
name: i2c-BMI0160:00
mount_matrix:
x: [0, -1, 0]
y: [0, 0, -1]
z: [1, 0, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
Expand Down
4 changes: 4 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-ayaneo_air.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ source_devices:
- group: imu
iio:
name: i2c-BMI0160:00
mount_matrix:
x: [0, -1, 0]
y: [0, 0, -1]
z: [1, 0, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
Expand Down
4 changes: 4 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-ayaneo_air_plus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ source_devices:
- group: imu
iio:
name: bmi323-imu
mount_matrix:
x: [0, -1, 0]
y: [0, 0, 1]
z: [-1, 0, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
Expand Down
4 changes: 4 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-ayaneo_flip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ source_devices:
- group: imu
iio:
name: i2c-BMI0160:00
mount_matrix:
x: [0, -1, 0]
y: [0, 0, -1]
z: [1, 0, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
Expand Down
4 changes: 4 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-ayaneo_next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ source_devices:
- group: imu
iio:
name: i2c-BMI0160:00
mount_matrix:
x: [0, -1, 0]
y: [0, 0, -1]
z: [1, 0, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
Expand Down
4 changes: 4 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-ayn_loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ source_devices:
- group: imu
iio:
name: i2c-BMI0160:00
mount_matrix:
x: [1, 0, 0]
y: [0, 0, -1]
z: [0, 1, 0]

# The target input device(s) that the virtual device profile can use
target_devices:
Expand Down
2 changes: 1 addition & 1 deletion src/input/source/iio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl IIODevice {

// IIO IMU Driver
if glob_match(
"{i2c-BMI*,accel-display,bmi*-imu,gyro_3d,accel_3d}",
"{i2c-10EC5280*,i2c-BMI*,accel-display,bmi*-imu,gyro_3d,accel_3d}",
name.as_str(),
) {
log::info!("Detected IMU: {name}");
Expand Down
9 changes: 5 additions & 4 deletions src/input/source/iio/iio_imu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ fn receive_commands(
let mut commands_processed = 0;
loop {
match rx.try_recv() {
Ok(cmd) => match cmd {
SourceCommand::Stop => return Err("Device stopped".into()),
_ => {}
},
Ok(cmd) => {
if let SourceCommand::Stop = cmd {
return Err("Device stopped".into());
}
}
Err(e) => match e {
TryRecvError::Empty => return Ok(()),
TryRecvError::Disconnected => {
Expand Down

0 comments on commit 94cabab

Please sign in to comment.