Merge pull request #773 from danbev/embassy-rp-ouput-drop

Impl drop for embassy-rp gpio Output
This commit is contained in:
Dario Nieuwenhuis 2022-05-19 07:13:13 +02:00 committed by GitHub
commit dd7a34fdc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,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);
});
};
}
}