Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
[package]
name = "tof-control"
version = "1.0.5"
version = "1.10.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[profile.release]
opt-level = "z"

[[bin]]
name = "calib-simulator"
path = "src/bin/dev/calib_simulator.rs"

[[bin]]
name = "rat-control"
path = "src/bin/rat_control.rs"
Expand All @@ -26,12 +30,11 @@ path = "src/bin/rat_tui.rs"

[[bin]]
name = "rb-mode"
path = "src/bin/rb_mode.rs"
path = "src/bin/dev/rb_mode.rs"

[[bin]]
name = "rb-dac"
path = "src/bin/rb_dac.rs"

path = "src/bin/dev/rb_dac.rs"
[[bin]]
name = "cpu-control"
path = "src/bin/cpu_control.rs"
Expand All @@ -54,7 +57,8 @@ indicatif = "0.17.7"
chrono-tz = "0.8.4"
ratatui = "0.25.0"
crossterm = "0.27.0"
once_cell = "1.21.3"

[build-dependencies]
bindgen = "0.64.0"
cc = "1.0.79"
cc = "1.0.79"
57 changes: 0 additions & 57 deletions src/bin/rb_dac.rs

This file was deleted.

213 changes: 0 additions & 213 deletions src/bin/rb_mode.rs

This file was deleted.

19 changes: 11 additions & 8 deletions src/cpc_control/cpc_temp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::constant::*;
use crate::helper::cpc_type::{CPCTemp, CPCError};
use crate::device::tmp1075;
use crate::i2c_bus_lock::with_i2c_bus_lock;

impl CPCTemp {
pub fn new() -> Self {
Expand All @@ -16,14 +17,16 @@ impl CPCTemp {
}
}
pub fn read_temp() -> Result<CPCTemp, CPCError> {
let cpc_tmp1075 = tmp1075::TMP1075::new(CPC_I2C_BUS, CPC_TMP1075_ADDRESS);
cpc_tmp1075.config()?;
let cpc_temp = cpc_tmp1075.read()?;
with_i2c_bus_lock(|| {
let cpc_tmp1075 = tmp1075::TMP1075::new(CPC_I2C_BUS, CPC_TMP1075_ADDRESS);
cpc_tmp1075.config()?;
let cpc_temp = cpc_tmp1075.read()?;

Ok(
CPCTemp {
cpc_temp,
}
)
Ok(
CPCTemp {
cpc_temp,
}
)
})
}
}
29 changes: 16 additions & 13 deletions src/cpc_control/cpc_vcp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::constant::*;
use crate::helper::cpc_type::{CPCVcp, CPCError};
use crate::device::ina219;
use crate::i2c_bus_lock::with_i2c_bus_lock;

impl CPCVcp {
pub fn new() -> Self {
Expand All @@ -16,19 +17,21 @@ impl CPCVcp {
}
}
pub fn read_vcp() -> Result<CPCVcp, CPCError> {
let cpc_ina219 = ina219::INA219::new(
CPC_I2C_BUS,
CPC_INA219_ADDRESS,
CPC_INA219_RSHUNT,
CPC_INA219_MEC,
);
cpc_ina219.configure()?;
let cpc_vcp = cpc_ina219.read()?;
with_i2c_bus_lock(|| {
let cpc_ina219 = ina219::INA219::new(
CPC_I2C_BUS,
CPC_INA219_ADDRESS,
CPC_INA219_RSHUNT,
CPC_INA219_MEC,
);
cpc_ina219.configure()?;
let cpc_vcp = cpc_ina219.read()?;

Ok(
CPCVcp{
cpc_vcp,
}
)
Ok(
CPCVcp{
cpc_vcp,
}
)
})
}
}
Loading