@@ -64,7 +64,7 @@ pub struct Delay;
64
64
impl embedded_hal:: blocking:: delay:: DelayUs < u8 > for Delay {
65
65
type Error = Infallible ;
66
66
67
- fn try_delay_us ( & mut self , n : u8 ) -> Result < ( ) , Self :: Error > {
67
+ fn delay_us ( & mut self , n : u8 ) -> Result < ( ) , Self :: Error > {
68
68
thread:: sleep ( Duration :: new ( 0 , u32 ( n) * 1000 ) ) ;
69
69
Ok ( ( ) )
70
70
}
@@ -73,7 +73,7 @@ impl embedded_hal::blocking::delay::DelayUs<u8> for Delay {
73
73
impl embedded_hal:: blocking:: delay:: DelayUs < u16 > for Delay {
74
74
type Error = Infallible ;
75
75
76
- fn try_delay_us ( & mut self , n : u16 ) -> Result < ( ) , Self :: Error > {
76
+ fn delay_us ( & mut self , n : u16 ) -> Result < ( ) , Self :: Error > {
77
77
thread:: sleep ( Duration :: new ( 0 , u32 ( n) * 1000 ) ) ;
78
78
Ok ( ( ) )
79
79
}
@@ -82,7 +82,7 @@ impl embedded_hal::blocking::delay::DelayUs<u16> for Delay {
82
82
impl embedded_hal:: blocking:: delay:: DelayUs < u32 > for Delay {
83
83
type Error = Infallible ;
84
84
85
- fn try_delay_us ( & mut self , n : u32 ) -> Result < ( ) , Self :: Error > {
85
+ fn delay_us ( & mut self , n : u32 ) -> Result < ( ) , Self :: Error > {
86
86
let secs = n / 1_000_000 ;
87
87
let nsecs = ( n % 1_000_000 ) * 1_000 ;
88
88
@@ -94,7 +94,7 @@ impl embedded_hal::blocking::delay::DelayUs<u32> for Delay {
94
94
impl embedded_hal:: blocking:: delay:: DelayUs < u64 > for Delay {
95
95
type Error = Infallible ;
96
96
97
- fn try_delay_us ( & mut self , n : u64 ) -> Result < ( ) , Self :: Error > {
97
+ fn delay_us ( & mut self , n : u64 ) -> Result < ( ) , Self :: Error > {
98
98
let secs = n / 1_000_000 ;
99
99
let nsecs = ( ( n % 1_000_000 ) * 1_000 ) as u32 ;
100
100
@@ -106,7 +106,7 @@ impl embedded_hal::blocking::delay::DelayUs<u64> for Delay {
106
106
impl embedded_hal:: blocking:: delay:: DelayMs < u8 > for Delay {
107
107
type Error = Infallible ;
108
108
109
- fn try_delay_ms ( & mut self , n : u8 ) -> Result < ( ) , Self :: Error > {
109
+ fn delay_ms ( & mut self , n : u8 ) -> Result < ( ) , Self :: Error > {
110
110
thread:: sleep ( Duration :: from_millis ( u64 ( n) ) ) ;
111
111
Ok ( ( ) )
112
112
}
@@ -115,7 +115,7 @@ impl embedded_hal::blocking::delay::DelayMs<u8> for Delay {
115
115
impl embedded_hal:: blocking:: delay:: DelayMs < u16 > for Delay {
116
116
type Error = Infallible ;
117
117
118
- fn try_delay_ms ( & mut self , n : u16 ) -> Result < ( ) , Self :: Error > {
118
+ fn delay_ms ( & mut self , n : u16 ) -> Result < ( ) , Self :: Error > {
119
119
thread:: sleep ( Duration :: from_millis ( u64 ( n) ) ) ;
120
120
Ok ( ( ) )
121
121
}
@@ -124,7 +124,7 @@ impl embedded_hal::blocking::delay::DelayMs<u16> for Delay {
124
124
impl embedded_hal:: blocking:: delay:: DelayMs < u32 > for Delay {
125
125
type Error = Infallible ;
126
126
127
- fn try_delay_ms ( & mut self , n : u32 ) -> Result < ( ) , Self :: Error > {
127
+ fn delay_ms ( & mut self , n : u32 ) -> Result < ( ) , Self :: Error > {
128
128
thread:: sleep ( Duration :: from_millis ( u64 ( n) ) ) ;
129
129
Ok ( ( ) )
130
130
}
@@ -133,7 +133,7 @@ impl embedded_hal::blocking::delay::DelayMs<u32> for Delay {
133
133
impl embedded_hal:: blocking:: delay:: DelayMs < u64 > for Delay {
134
134
type Error = Infallible ;
135
135
136
- fn try_delay_ms ( & mut self , n : u64 ) -> Result < ( ) , Self :: Error > {
136
+ fn delay_ms ( & mut self , n : u64 ) -> Result < ( ) , Self :: Error > {
137
137
thread:: sleep ( Duration :: from_millis ( n) ) ;
138
138
Ok ( ( ) )
139
139
}
@@ -176,7 +176,7 @@ impl I2cdev {
176
176
impl embedded_hal:: blocking:: i2c:: Read for I2cdev {
177
177
type Error = i2cdev:: linux:: LinuxI2CError ;
178
178
179
- fn try_read ( & mut self , address : u8 , buffer : & mut [ u8 ] ) -> Result < ( ) , Self :: Error > {
179
+ fn read ( & mut self , address : u8 , buffer : & mut [ u8 ] ) -> Result < ( ) , Self :: Error > {
180
180
self . set_address ( address) ?;
181
181
self . inner . read ( buffer)
182
182
}
@@ -185,7 +185,7 @@ impl embedded_hal::blocking::i2c::Read for I2cdev {
185
185
impl embedded_hal:: blocking:: i2c:: Write for I2cdev {
186
186
type Error = i2cdev:: linux:: LinuxI2CError ;
187
187
188
- fn try_write ( & mut self , address : u8 , bytes : & [ u8 ] ) -> Result < ( ) , Self :: Error > {
188
+ fn write ( & mut self , address : u8 , bytes : & [ u8 ] ) -> Result < ( ) , Self :: Error > {
189
189
self . set_address ( address) ?;
190
190
self . inner . write ( bytes)
191
191
}
@@ -194,7 +194,7 @@ impl embedded_hal::blocking::i2c::Write for I2cdev {
194
194
impl embedded_hal:: blocking:: i2c:: WriteRead for I2cdev {
195
195
type Error = i2cdev:: linux:: LinuxI2CError ;
196
196
197
- fn try_write_read (
197
+ fn write_read (
198
198
& mut self ,
199
199
address : u8 ,
200
200
bytes : & [ u8 ] ,
@@ -209,11 +209,7 @@ impl embedded_hal::blocking::i2c::WriteRead for I2cdev {
209
209
impl embedded_hal:: blocking:: i2c:: Transactional for I2cdev {
210
210
type Error = i2cdev:: linux:: LinuxI2CError ;
211
211
212
- fn try_exec (
213
- & mut self ,
214
- address : u8 ,
215
- operations : & mut [ I2cOperation ] ,
216
- ) -> Result < ( ) , Self :: Error > {
212
+ fn exec ( & mut self , address : u8 , operations : & mut [ I2cOperation ] ) -> Result < ( ) , Self :: Error > {
217
213
// Map operations from generic to linux objects
218
214
let mut messages: Vec < _ > = operations
219
215
. as_mut ( )
@@ -263,7 +259,7 @@ impl Spidev {
263
259
impl embedded_hal:: blocking:: spi:: Transfer < u8 > for Spidev {
264
260
type Error = io:: Error ;
265
261
266
- fn try_transfer < ' b > ( & mut self , buffer : & ' b mut [ u8 ] ) -> io:: Result < & ' b [ u8 ] > {
262
+ fn transfer < ' b > ( & mut self , buffer : & ' b mut [ u8 ] ) -> io:: Result < & ' b [ u8 ] > {
267
263
let tx = buffer. to_owned ( ) ;
268
264
self . 0
269
265
. transfer ( & mut SpidevTransfer :: read_write ( & tx, buffer) ) ?;
@@ -274,7 +270,7 @@ impl embedded_hal::blocking::spi::Transfer<u8> for Spidev {
274
270
impl embedded_hal:: blocking:: spi:: Write < u8 > for Spidev {
275
271
type Error = io:: Error ;
276
272
277
- fn try_write ( & mut self , buffer : & [ u8 ] ) -> io:: Result < ( ) > {
273
+ fn write ( & mut self , buffer : & [ u8 ] ) -> io:: Result < ( ) > {
278
274
self . 0 . write_all ( buffer)
279
275
}
280
276
}
@@ -285,7 +281,7 @@ pub use embedded_hal::blocking::spi::Operation as SpiOperation;
285
281
impl embedded_hal:: blocking:: spi:: Transactional < u8 > for Spidev {
286
282
type Error = io:: Error ;
287
283
288
- fn try_exec < ' a > ( & mut self , operations : & mut [ SpiOperation < ' a , u8 > ] ) -> Result < ( ) , Self :: Error > {
284
+ fn exec < ' a > ( & mut self , operations : & mut [ SpiOperation < ' a , u8 > ] ) -> Result < ( ) , Self :: Error > {
289
285
// Map types from generic to linux objects
290
286
let mut messages: Vec < _ > = operations
291
287
. iter_mut ( )
0 commit comments