Skip to content

Clear and flush do not work before initialization. #234

@nor236

Description

@nor236

Before initialization, clear and flush did not function properly, which prevented the reset of the GRAM ,and resulted in a garbled screen display.

The following is the code for STM32F103:

   let interface = I2CDisplayInterface::new(i2c_ssd1306);
    let mut display = Ssd1306::new(interface, DisplaySize128x64, DisplayRotation::Rotate0)
        .into_buffered_graphics_mode();
    display.clear_buffer();
    display.flush().unwrap();  // not work
    display.init().unwrap();
    delay.delay_ms(2000u16);

When the I2C bus is connected to other I2C devices, such as the BPM280 and AHT20 devices, after power-on, there will be snowflakes output on the screen. Clearing the screen before initialization is ineffective. After initialization, clearing the screen still results in a small amount of snowflakes.
When adding a delay of 2 seconds after init, the same issue also occurs on both ESP32 and RP2040.

The expectation is that before turning on the screen, the video memory should be reset so that the screen remains clean ,and does not display any remaining data (possibly caused by capacitors) that has not been erased from GRAM.

Image Image

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