Skip to content

Commit

Permalink
Fix DMA wait check in LCD_CAM
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Fischer committed Jun 23, 2024
1 parent a8944a8 commit 0b6abc1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- ESP32-S3: Fix DMA waiting check in LCD_CAM (#1707)

### Changed

- Refactor `Dac1`/`Dac2` drivers into a single `Dac` driver (#1661)
Expand Down
24 changes: 16 additions & 8 deletions esp-hal/src/lcd_cam/cam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,22 @@ where

impl<'d, RX: Rx> DmaSupport for Camera<'d, RX> {
fn peripheral_wait_dma(&mut self, _is_tx: bool, _is_rx: bool) {
while !
// Wait for IN_SUC_EOF (i.e. VSYNC)
self.rx_channel.is_done() ||
// Or for IN_DSCR_EMPTY (i.e. No more buffer space)
self.rx_channel.has_dscr_empty_error() ||
// Or for IN_DSCR_ERR (i.e. bad descriptor)
self.rx_channel.has_error()
{}
loop {
// Wait for IN_SUC_EOF (i.e. VSYNC)
if self.rx_channel.is_done() {
break;
}

// Or for IN_DSCR_EMPTY (i.e. No more buffer space)
if self.rx_channel.has_dscr_empty_error() {
break;
}

// Or for IN_DSCR_ERR (i.e. bad descriptor)
if self.rx_channel.has_error() {
break;
}
}
}

fn peripheral_dma_stop(&mut self) {
Expand Down

0 comments on commit 0b6abc1

Please sign in to comment.