mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
Impl drop for embassy-rp gpio Output
This commit implements drop for embassy-rp gpio Output which is currently a todo.
This commit is contained in:
parent
3d1501c020
commit
a3e0fcef0b
@ -135,7 +135,14 @@ impl<'d, T: Pin> Output<'d, T> {
|
||||
|
||||
impl<'d, T: Pin> Drop for Output<'d, T> {
|
||||
fn drop(&mut self) {
|
||||
// todo
|
||||
let val = 1 << self.pin.pin();
|
||||
unsafe {
|
||||
self.pin.sio_out().value_clr().write_value(val);
|
||||
self.pin.sio_oe().value_clr().write_value(val);
|
||||
self.pin.io().ctrl().write(|w| {
|
||||
w.set_funcsel(pac::io::vals::Gpio0CtrlFuncsel::NULL.0);
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user