gpiote: take borrow instead of owned pin.

This makes it possible to read the pin while the channel is created.
This commit is contained in:
Dario Nieuwenhuis
2020-09-29 04:17:32 +02:00
parent 32a9b3f4ae
commit c81d626254
2 changed files with 8 additions and 8 deletions

View File

@ -51,11 +51,11 @@ impl Gpiote {
}
}
pub fn new_input_channel<T>(
&self,
pin: GpioPin<Input<T>>,
pub fn new_input_channel<'a, T>(
&'a self,
pin: &'a GpioPin<Input<T>>,
trigger_mode: EventPolarity,
) -> Result<Channel<'_>, NewChannelError> {
) -> Result<Channel<'a>, NewChannelError> {
interrupt::free(|_| {
unsafe { INSTANCE = self };