Skip to content

LTDC DisplayController::draw_rectangle is racy #201

@fhars

Description

@fhars

The first (few?) draw requests after a large rectangle will be garbled. Until the "safer DMA transfers" have landed, it may be better to block the call if a transfer is already in flight:

@@ -369,6 +369,9 @@ impl<T: 'static + SupportedWord> DisplayController<T> {
         bottom_right: (usize, usize),
         color: u32,
     ) {
+       // Block until the previous transfer is finished
+       while self._dma2d.cr.read().start().bit_is_set() {}
+
         // Output color format
         self._dma2d.opfccr.write(|w| {
             w.cm().bits(match &self.pixel_format {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions