From 34e7594ae2a586acfcf7cc79811d1cfed6189f90 Mon Sep 17 00:00:00 2001 From: Chris Liebman Date: Sun, 21 Jul 2024 07:08:02 -0700 Subject: [PATCH] lcd_cam: use new async interrupt semantics from #1835 --- esp-hal/src/lcd_cam/mod.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/esp-hal/src/lcd_cam/mod.rs b/esp-hal/src/lcd_cam/mod.rs index 39a357ecb80..878a084a407 100644 --- a/esp-hal/src/lcd_cam/mod.rs +++ b/esp-hal/src/lcd_cam/mod.rs @@ -141,18 +141,25 @@ pub mod asynch { .unwrap(); TX_WAKER.register(cx.waker()); - if Instance::is_listening_lcd_done() { - Poll::Pending - } else { + if Instance::is_lcd_done_set() { + Instance::clear_lcd_done(); Poll::Ready(()) + } else { + Poll::Pending } } } + + impl Drop for LcdDoneFuture { + fn drop(&mut self) { + Instance::unlisten_lcd_done(); + } + } + #[handler] fn interrupt_handler() { // TODO: this is a shared interrupt with Camera and here we ignore that! if Instance::is_lcd_done_set() { - Instance::clear_lcd_done(); Instance::unlisten_lcd_done(); TX_WAKER.wake() }