Skip to content

Commit

Permalink
lcd_cam: use new async interrupt semantics from esp-rs#1835
Browse files Browse the repository at this point in the history
  • Loading branch information
liebman committed Jul 24, 2024
1 parent 1649c8c commit 34e7594
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions esp-hal/src/lcd_cam/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 34e7594

Please sign in to comment.