Skip to content

Commit 1f3880b

Browse files
committed
Update rppal and retry crates
1 parent 125804f commit 1f3880b

File tree

4 files changed

+16
-27
lines changed

4 files changed

+16
-27
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ colored = "2.1"
3838
serial_test = "3.1"
3939
pca9535 = "2.0"
4040
embedded-hal = "1.0"
41-
rppal = "0.17"
42-
retry = "1.3"
41+
rppal = "0.19"
42+
retry = "2.0"
4343
antidote = "1.0"
4444
nix = "0.29"
4545
# Testcandidate used in runner crate

controller/src/hardware/test_channel.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,25 +168,19 @@ impl CombinedTestChannel {
168168
std::thread::sleep(std::time::Duration::from_millis(100));
169169
function(self, target_info, tss.get_position())
170170
}
171-
Err(err) => match err {
172-
retry::Error::Operation { error, .. } => {
173-
log::error!(
171+
Err(err) => {
172+
log::error!(
174173
"Failed to connect testchannel {:?} to target {:?}: {}\nCaused by: {:?}",
175174
self.channel,
176175
Target::try_from(pos as u8).unwrap(),
177-
error,
178-
error.source()
176+
err.error,
177+
err.error.source()
179178

180179
);
181-
// At this point it is uncertain in which state the busswitches are. Therefore we try to disconnect all affected switches, so any remaining operations are not influenced by this error.
182-
// If disconnecting fails the testrack hardware is in an undefined and unrecoverable state, therefore the application panics as such errors need manual power reset and are likely caused by faulty hardware
183-
tss.inner.borrow_mut().disconnect_all().expect("Failed to disconnect tss successfully, this error cannot be recovered, as further operation in such a state may influence other testchannels.\n This is likely caused by a hardware issue in the I2C communication, please verify that your hardware is working correctly.");
184-
}
185-
retry::Error::Internal(string) => panic!(
186-
"Internal library error in retry crate: {}",
187-
string
188-
),
189-
},
180+
// At this point it is uncertain in which state the busswitches are. Therefore we try to disconnect all affected switches, so any remaining operations are not influenced by this error.
181+
// If disconnecting fails the testrack hardware is in an undefined and unrecoverable state, therefore the application panics as such errors need manual power reset and are likely caused by faulty hardware
182+
tss.inner.borrow_mut().disconnect_all().expect("Failed to disconnect tss successfully, this error cannot be recovered, as further operation in such a state may influence other testchannels.\n This is likely caused by a hardware issue in the I2C communication, please verify that your hardware is working correctly.");
183+
}
190184
}
191185
}
192186
}

ll-api/src/expander_gpio/bus_switch.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use embedded_hal::i2c::I2c;
33
use pca9535::expander::SyncExpander;
44
use pca9535::ExpanderError;
55
use pca9535::ExpanderOutputPin;
6-
use retry::{delay::Fixed, retry, Error};
6+
use retry::{delay::Fixed, retry};
77

88
use crate::StackShieldError;
99
use crate::Target;
@@ -56,12 +56,7 @@ where
5656
Fixed::from_millis(FIXED_RETRY_DELAY_MS).take(RETRY_LIMIT),
5757
|| self.disconnect_all(),
5858
)
59-
.map_err(|err| match err {
60-
Error::Internal(string) => {
61-
panic!("Internal library error in retry crate: {}", string)
62-
}
63-
Error::Operation { error, .. } => error,
64-
})?;
59+
.map_err(|err| err.error)?;
6560

6661
self.sw_test_channel[channel as usize]
6762
.set_low()

0 commit comments

Comments
 (0)