Skip to content

Commit

Permalink
examples: Switch to SerialPortPhy
Browse files Browse the repository at this point in the history
SerialPortPhy is platform-independent so let's use it in the examples to
get people up-and-running more quickly.
  • Loading branch information
Rahix committed Nov 22, 2024
1 parent 6aa8b48 commit 2fc09ef
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/dp-scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() -> ! {
);

log::info!("Connecting to the bus...");
let mut phy = phy::LinuxRs485Phy::new(BUS_DEVICE, fdl.parameters().baudrate);
let mut phy = phy::SerialPortPhy::new(BUS_DEVICE, fdl.parameters().baudrate);

fdl.set_online();
loop {
Expand Down
2 changes: 1 addition & 1 deletion examples/encoder-fraba58.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn main() {
let sleep_time: std::time::Duration = (fdl.parameters().slot_time() / 2).into();

println!("Connecting to the bus...");
let mut phy = phy::LinuxRs485Phy::new(BUS_DEVICE, fdl.parameters().baudrate);
let mut phy = phy::SerialPortPhy::new(BUS_DEVICE, fdl.parameters().baudrate);

fdl.set_online();
dp_master.enter_operate();
Expand Down
2 changes: 1 addition & 1 deletion examples/live-list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn main() -> ! {
);

log::info!("Connecting to the bus...");
let mut phy = phy::LinuxRs485Phy::new(BUS_DEVICE, fdl.parameters().baudrate);
let mut phy = phy::SerialPortPhy::new(BUS_DEVICE, fdl.parameters().baudrate);

let mut last = profirust::time::Instant::now();

Expand Down
2 changes: 1 addition & 1 deletion examples/multi-application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fn main() -> ! {
let sleep_time: std::time::Duration = (fdl.parameters().slot_time() / 2).into();

log::info!("Connecting to the bus...");
let mut phy = phy::LinuxRs485Phy::new(BUS_DEVICE, fdl.parameters().baudrate);
let mut phy = phy::SerialPortPhy::new(BUS_DEVICE, fdl.parameters().baudrate);

fdl.set_online();
dp_master.enter_operate();
Expand Down
2 changes: 1 addition & 1 deletion examples/remote-io-wago-750-343.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn main() {
let sleep_time: std::time::Duration = (fdl.parameters().slot_time() / 2).into();

println!("Connecting to the bus...");
let mut phy = phy::LinuxRs485Phy::new(BUS_DEVICE, fdl.parameters().baudrate);
let mut phy = phy::SerialPortPhy::new(BUS_DEVICE, fdl.parameters().baudrate);

let start = profirust::time::Instant::now();

Expand Down
2 changes: 1 addition & 1 deletion examples/vfd-micromaster-4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ fn vfd_controller(param: sync::Arc<sync::Mutex<VfdParameters>>) {
let sleep_time: std::time::Duration = (fdl.parameters().slot_time() / 2).into();

log::info!("Connecting to the bus...");
let mut phy = phy::LinuxRs485Phy::new(BUS_DEVICE, fdl.parameters().baudrate);
let mut phy = phy::SerialPortPhy::new(BUS_DEVICE, fdl.parameters().baudrate);

fdl.set_online();
dp_master.enter_operate();
Expand Down

0 comments on commit 2fc09ef

Please sign in to comment.