rp: Fix BufferedUart drop code

Only unregister the interrupt handler when both parts are inactive
This commit is contained in:
Timo Kröger
2023-01-01 22:02:45 +01:00
parent 68c186309f
commit a24037edf9
3 changed files with 31 additions and 26 deletions

View File

@ -29,7 +29,7 @@ async fn main(spawner: Spawner) {
let irq = interrupt::take!(UART0_IRQ);
let tx_buf = &mut singleton!([0u8; 16])[..];
let rx_buf = &mut singleton!([0u8; 16])[..];
let mut uart = BufferedUart::new(uart, irq, tx_pin, rx_pin, tx_buf, rx_buf, Config::default());
let uart = BufferedUart::new(uart, irq, tx_pin, rx_pin, tx_buf, rx_buf, Config::default());
let (rx, mut tx) = uart.split();
unwrap!(spawner.spawn(reader(rx)));