File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
//use pasts::Executor;
2
+ use futures:: executor:: block_on;
2
3
use rusty_zigbee_dongle:: {
3
4
cc253x:: CC253X ,
4
5
coordinator:: { Coordinator , CoordinatorError , LedStatus } ,
5
6
} ;
6
7
use std:: path:: PathBuf ;
7
- use futures:: executor:: block_on;
8
8
9
9
fn main ( ) {
10
10
let f = async {
11
11
let cc2531 = CC253X :: from_path ( PathBuf :: from ( "/dev/ttyACM0" ) , 115_200 ) . unwrap ( ) ;
12
12
13
13
// Not all firmware versions support LED write as far as I understood
14
14
let a = async {
15
+
15
16
cc2531. set_led ( LedStatus :: On ) . await . unwrap ( ) ;
16
17
Ok :: < ( ) , CoordinatorError > ( ( ) )
17
18
} ;
18
19
let b = async {
19
20
println ! ( "version: {:?}" , cc2531. version( ) . await ) ;
20
21
Ok :: < ( ) , CoordinatorError > ( ( ) )
21
22
} ;
22
- futures:: try_join!( a, b)
23
+ futures:: try_join!( a, b)
23
24
} ;
24
-
25
- let v = block_on ( f) ;
26
- println ! ( "version: {:?}" , v) ;
25
+
26
+ block_on ( f) . unwrap ( ) ;
27
27
}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ macro_rules! log {
6
6
println!( $( $arg) * ) ;
7
7
}
8
8
}
9
+ use futures:: executor:: block_on;
9
10
pub ( crate ) use log;
10
11
11
12
#[ allow( unused_macros) ]
@@ -17,7 +18,6 @@ macro_rules! warnn {
17
18
#[ allow( unused_imports) ]
18
19
pub ( crate ) use warnn;
19
20
20
-
21
21
macro_rules! err {
22
22
( $( $arg: tt) * ) => {
23
23
eprintln!( $( $arg) * ) ;
You can’t perform that action at this time.
0 commit comments