From 242edd604aa8555d828c8a14d489390e6697ae62 Mon Sep 17 00:00:00 2001 From: liuyihui Date: Thu, 27 Apr 2023 01:43:37 +0800 Subject: [PATCH] feat: speed up LCD_Clear --- src/tftlcd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tftlcd.c b/src/tftlcd.c index 186e7df..fee2e9a 100644 --- a/src/tftlcd.c +++ b/src/tftlcd.c @@ -229,11 +229,12 @@ void LCD_D_Point(uint16_t x, uint16_t y, uint16_t color) { } void LCD_Clear(uint16_t color) { - // LCD_S_Rec(0, LCD_W - 1, 0, LCD_H - 1); - // for (uint32_t i = 0; i < LCD_W * LCD_H; i++) LCD_WR_DATA_16BIT(color); - for (uint16_t i = 0; i < LCD_W; i++) - for (uint16_t j = 0; j < LCD_H; j++) { - LCD_S_XY(i, j); - LCD_WR_REG_DATA_16BIT(LCD_RAM_WR, color); - } + LCD_S_Rec(0, LCD_W - 1, 0, LCD_H - 1); + LCD_WR_REG(LCD_RAM_WR); + for (uint32_t i = 0; i < LCD_W * LCD_H; i++) LCD_WR_DATA_16BIT(color); + // for (uint16_t i = 0; i < LCD_W; i++) + // for (uint16_t j = 0; j < LCD_H; j++) { + // LCD_S_XY(i, j); + // LCD_WR_REG_DATA_16BIT(LCD_RAM_WR, color); + // } }