File tree Expand file tree Collapse file tree 5 files changed +18
-2
lines changed Expand file tree Collapse file tree 5 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1919 # The default target we're compiling on and for
2020 TARGET : [x86_64-unknown-linux-gnu, thumbv6m-none-eabi, thumbv7m-none-eabi]
2121
22+ FEATURES : ["", "--features std"]
23+
2224 include :
2325 # Test MSRV
2426 - rust : 1.40.0
4042 - uses : actions-rs/cargo@v1
4143 with :
4244 command : check
43- args : --target=${{ matrix.TARGET }}
45+ args : --target=${{ matrix.TARGET }} ${{ matrix.FEATURES }}
Original file line number Diff line number Diff line change 1414 strategy :
1515 matrix :
1616 rust : [stable]
17+ FEATURES : ["", "--features std"]
1718
1819 include :
1920 - rust : 1.40.0
3536 - uses : actions-rs/cargo@v1
3637 with :
3738 command : test
39+ args : ${{ matrix.FEATURES }}
Original file line number Diff line number Diff line change @@ -21,3 +21,6 @@ nb = "1"
2121[dev-dependencies .stm32f1 ]
2222version = " 0.12"
2323features = [" stm32f103" , " rt" ]
24+
25+ [features ]
26+ std = []
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ pub mod i2c {
5858 }
5959 }
6060 }
61+
62+ #[ cfg( feature = "std" ) ]
63+ impl std:: error:: Error for ErrorKind { }
6164}
6265
6366pub mod spi {
@@ -120,6 +123,9 @@ pub mod spi {
120123 }
121124 }
122125 }
126+
127+ #[ cfg( feature = "std" ) ]
128+ impl std:: error:: Error for ErrorKind { }
123129}
124130
125131pub mod serial {
@@ -177,4 +183,7 @@ pub mod serial {
177183 }
178184 }
179185 }
186+
187+ #[ cfg( feature = "std" ) ]
188+ impl std:: error:: Error for ErrorKind { }
180189}
Original file line number Diff line number Diff line change 413413
414414#![ doc( html_root_url = "https://docs.rs/embedded-hal/1.0.0-alpha.4" ) ]
415415#![ deny( missing_docs) ]
416- #![ no_std]
416+ #![ cfg_attr ( not ( feature = "std" ) , no_std) ]
417417
418418pub mod blocking;
419419mod errors;
You can’t perform that action at this time.
0 commit comments