Skip to content

Commit

Permalink
Introduce a delay after each step of initialization
Browse files Browse the repository at this point in the history
Introduce a short delay after each step of the initialization sequence.
This is a try to fix a problem with failing device initialization,
seen on some KVM switches.

This patch shortens the delay somewhat and places it in front of the
status polling loop. This is done to avoid introducing lag due to excessive
sleeping.

References #161
  • Loading branch information
X3n0m0rph59 committed Oct 5, 2022
1 parent b7358bc commit d470f49
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eruption/src/hwdevices/roccat_vulcan_1xx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ impl RoccatVulcan1xx {
} else if !self.is_opened {
Err(HwDeviceError::DeviceNotOpened {}.into())
} else {
// DEBUG: Does this help KVM switches to not fail to init the device?
// sleep for a short while
thread::sleep(Duration::from_millis(25));

loop {
let mut buf: [u8; 4] = [0; 4];
buf[0] = 0x04;
Expand All @@ -466,8 +470,6 @@ impl RoccatVulcan1xx {

Err(_) => return Err(HwDeviceError::InvalidResult {}.into()),
}

thread::sleep(Duration::from_millis(70));
}
}
}
Expand Down

0 comments on commit d470f49

Please sign in to comment.