Temporary disable sticky-bit in set_pins too (#433)

This commit is contained in:
Wilfried Chauveau 2022-08-25 18:19:01 +01:00 committed by GitHub
parent 31469c232f
commit dbc691fb09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -598,6 +598,7 @@ impl<SM: ValidStateMachine> StateMachine<SM, Stopped> {
// `UninitStateMachine` byt adding a program.
pub fn set_pins(&mut self, pins: impl IntoIterator<Item = (u8, PinState)>) {
let saved_ctrl = self.sm.sm().sm_pinctrl.read();
let saved_execctrl = self.sm.sm().sm_execctrl.read();
for (pin_num, pin_state) in pins {
self.sm
.sm()
@ -611,10 +612,11 @@ impl<SM: ValidStateMachine> StateMachine<SM, Stopped> {
.encode(),
);
}
self.sm
.sm()
.sm_pinctrl
let sm = self.sm.sm();
sm.sm_pinctrl
.write(|w| unsafe { w.bits(saved_ctrl.bits()) });
sm.sm_execctrl
.write(|w| unsafe { w.bits(saved_execctrl.bits()) })
}
/// Set pin directions.
@ -645,13 +647,10 @@ impl<SM: ValidStateMachine> StateMachine<SM, Stopped> {
.encode(),
);
}
self.sm
.sm()
.sm_pinctrl
let sm = self.sm.sm();
sm.sm_pinctrl
.write(|w| unsafe { w.bits(saved_ctrl.bits()) });
self.sm
.sm()
.sm_execctrl
sm.sm_execctrl
.write(|w| unsafe { w.bits(saved_execctrl.bits()) });
}
}