Skip to content

Nested ST7789_Select and ST7789_UnSelect cause confusion in image rendering #42

@wuhensoft

Description

@wuhensoft

During the pressure test of drawing 10 images in 100ms, there was a phenomenon of image displacement along the y-axis

Image

I have seen a large number of calls like this

/**
 * @brief Write command to ST7789 controller
 * @param cmd -> command to write
 * @return none
 */
static void ST7789_WriteCommand(uint8_t cmd)
{
	ST7789_Select();
	ST7789_DC_Clr();
	HAL_SPI_Transmit(&ST7789_SPI_PORT, &cmd, sizeof(cmd), HAL_MAX_DELAY);
	ST7789_UnSelect();
}

Nested select calls may lead to data confusion,For a single operation, such as drawing text or images, we should select at the beginning of the call and unselect after completion.

We should refactor the code to remove select/select from all internal operations, wrap internal operations in exposed interfaces, and remove nested calls.

After stress testing, the issue of occasional deviation in the y-axis of the image drawing has been resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions