Attempt to fix "drop"
Remove infinite loop from is_temp_running, add logging
This commit is contained in:
parent
b351228df4
commit
6f1ac51630
1 changed files with 11 additions and 1 deletions
|
@ -332,13 +332,23 @@ impl Device{
|
||||||
pub fn is_temp_running(&mut self) -> bool {
|
pub fn is_temp_running(&mut self) -> bool {
|
||||||
self.go_to_lifecycle_menu();
|
self.go_to_lifecycle_menu();
|
||||||
self.usb_tty.write_to_device(Command::ReadTemp);
|
self.usb_tty.write_to_device(Command::ReadTemp);
|
||||||
loop {
|
for _ in 0..10 {
|
||||||
match self.usb_tty.read_from_device(None){
|
match self.usb_tty.read_from_device(None){
|
||||||
Response::TempSuccess => return true,
|
Response::TempSuccess => return true,
|
||||||
Response::TempFailed => return false,
|
Response::TempFailed => return false,
|
||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.usb_tty.write_to_device(Command::ReadTemp);
|
||||||
|
for _ in 0..10{
|
||||||
|
match self.usb_tty.read_from_device(None){
|
||||||
|
Response::TempSuccess => return true,
|
||||||
|
Response::TempFailed => return false,
|
||||||
|
_ => {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log::error!("Temp read failed!!!");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
pub fn is_bp_running(&mut self) -> bool {
|
pub fn is_bp_running(&mut self) -> bool {
|
||||||
self.go_to_lifecycle_menu();
|
self.go_to_lifecycle_menu();
|
||||||
|
|
Loading…
Add table
Reference in a new issue