Skip to content

Commit a2af2ac

Browse files
authored
lcd_cam: fix wrong buffer length used if 16bit and len<=8192 (#2085)
* lcd_cam: fix wrong buffer length used if 16bit and len<=8192 * changelog
1 parent 4d9ea52 commit a2af2ac

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

esp-hal/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
- SHA driver can now be safely used in multiple contexts concurrently (#2049)
2323

2424
- Fixed an issue with DMA transfers potentially not waking up the correct async task (#2065)
25+
- Fixed an issue with LCD_CAM i8080 where it would send double the clocks in 16bit mode (#2085)
2526

2627
### Removed
2728
- Removed `digest::Digest` implementation from SHA (#2049)

esp-hal/src/lcd_cam/lcd/i8080.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -488,21 +488,14 @@ impl<'d, CH: DmaChannel, P, DM: Mode> I8080<'d, CH, P, DM> {
488488
.lcd_user()
489489
.modify(|_, w| w.lcd_dout().clear_bit());
490490
} else {
491-
// Set transfer length.
492-
self.lcd_cam.lcd_user().modify(|_, w| unsafe {
493-
if len <= 8192 {
494-
// Data length in fixed mode. (13 bits)
495-
w.lcd_always_out_en()
496-
.clear_bit()
497-
.lcd_dout_cyclelen()
498-
.bits((len - 1) as _)
499-
} else {
500-
// Enable continuous output.
501-
w.lcd_always_out_en().set_bit()
502-
}
503-
.lcd_dout()
504-
.set_bit()
505-
});
491+
// Use continous mode for DMA. FROM the S3 TRM:
492+
// > In a continuous output, LCD module keeps sending data till:
493+
// > i. LCD_CAM_LCD_START is cleared;
494+
// > ii. or LCD_CAM_LCD_RESET is set;
495+
// > iii. or all the data in GDMA is sent out.
496+
self.lcd_cam
497+
.lcd_user()
498+
.modify(|_, w| w.lcd_always_out_en().set_bit().lcd_dout().set_bit());
506499

507500
unsafe {
508501
self.tx_chain.fill_for_tx(false, ptr, len)?;

0 commit comments

Comments
 (0)