Skip to content

Commit

Permalink
tacd: digital_io: update gpio_cdev and make LineRequestFlags non-Copy
Browse files Browse the repository at this point in the history
The `LineRequestFlags` struct is no longer `Copy` in version 0.6.0,
which is why we need to `.clone()` it explicitly.

Signed-off-by: Leonard Göhrs <[email protected]>
  • Loading branch information
hnez committed Nov 18, 2024
1 parent 6932c78 commit b71d722
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
19 changes: 15 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ framebuffer = "0.3"
futures = "0.3"
futures-lite = "1.12"
futures-util = "0.3"
gpio-cdev = "0.5"
gpio-cdev = "0.6"
html-escape = "0.2"
industrial-io = { version = "0.5", default-features = false }
log = { version = "0.4", features = ["release_max_level_warn"]}
Expand Down
2 changes: 1 addition & 1 deletion src/digital_io/gpio/demo_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl LineHandle {
}

#[allow(clippy::upper_case_acronyms, non_camel_case_types)]
#[derive(Clone, Copy)]
#[derive(Clone)]
pub enum LineRequestFlags {
OUTPUT,
OPEN_DRAIN,
Expand Down
2 changes: 1 addition & 1 deletion src/digital_io/gpio/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl LineHandle {
}

#[allow(clippy::upper_case_acronyms, non_camel_case_types)]
#[derive(Clone, Copy)]
#[derive(Clone)]
pub enum LineRequestFlags {
OUTPUT,
OPEN_DRAIN,
Expand Down
2 changes: 1 addition & 1 deletion src/dut_power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl DutPwrThread {
.ok_or_else(|| anyhow!("Could not find GPIO line DUT_PWR_DISCH"))?;

let flags = hardware_generation.output_flags();
let pwr_line = pwr_line.request(flags, 1 - PWR_LINE_ASSERTED, "tacd")?;
let pwr_line = pwr_line.request(flags.clone(), 1 - PWR_LINE_ASSERTED, "tacd")?;
let discharge_line = discharge_line.request(flags, DISCHARGE_LINE_ASSERTED, "tacd")?;

// The realtime priority must be set up inside the thread, but
Expand Down

0 comments on commit b71d722

Please sign in to comment.