Skip to content

Commit ff547ee

Browse files
Remove Can::configure
1 parent a5ca0e4 commit ff547ee

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/lib.rs

-27
Original file line numberDiff line numberDiff line change
@@ -321,33 +321,6 @@ where
321321
self.instance
322322
}
323323

324-
/// Configure bit timings and silent/loop-back mode.
325-
///
326-
/// Acutal configuration happens on the `CanConfig` that is passed to the
327-
/// closure. It must be done this way because those configuration bits can
328-
/// only be set if the CAN controller is in a special init mode.
329-
/// Puts the peripheral in sleep mode afterwards. `Can::enable()` must be
330-
/// called to exit sleep mode and start reception and transmission.
331-
pub fn configure<F>(&mut self, f: F)
332-
where
333-
F: FnOnce(&mut CanConfig<I>),
334-
{
335-
let can = self.registers();
336-
337-
// Enter init mode.
338-
can.mcr
339-
.modify(|_, w| w.sleep().clear_bit().inrq().set_bit());
340-
loop {
341-
let msr = can.msr.read();
342-
if msr.slak().bit_is_clear() && msr.inak().bit_is_set() {
343-
break;
344-
}
345-
}
346-
347-
let mut config = CanConfig { _can: PhantomData };
348-
f(&mut config);
349-
}
350-
351324
/// Configure bit timings and silent/loop-back mode.
352325
pub fn modify_config(&mut self) -> CanConfig<'_, I> {
353326
let can = self.registers();

0 commit comments

Comments
 (0)