From 1c5047f47a1e5e7e947d1a6b0a9f28e9a2ecca53 Mon Sep 17 00:00:00 2001 From: chunyexixiaoyu <834670833@qq.com> Date: Tue, 18 Jan 2022 15:54:54 +0800 Subject: [PATCH] Ubiquitous/RT_Thread/:change the default orientation of the MCU-ATK screen --- .../aiit_board/stm32f407_core/board/ports/drv_lcd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Ubiquitous/RT_Thread/aiit_board/stm32f407_core/board/ports/drv_lcd.c b/Ubiquitous/RT_Thread/aiit_board/stm32f407_core/board/ports/drv_lcd.c index 7112e0df5..04b5cffe2 100644 --- a/Ubiquitous/RT_Thread/aiit_board/stm32f407_core/board/ports/drv_lcd.c +++ b/Ubiquitous/RT_Thread/aiit_board/stm32f407_core/board/ports/drv_lcd.c @@ -498,11 +498,11 @@ void lcd_fill_array(rt_uint16_t x_start, rt_uint16_t y_start, rt_uint16_t x_end, pixel = (rt_uint16_t *)pcolor; - for(cycle_y = y_start; cycle_y <= y_end; ) + for(cycle_y = y_start; cycle_y <= y_end-1;) { LCD_SetCursor(x_start, cycle_y); LCD_WriteRAM_Prepare(); - for(x_offset = 0;x_start + x_offset <= x_end; x_offset++) + for(x_offset = 0;x_start + x_offset <= x_end-1; x_offset++) { LCD->RAM = *pixel++; } @@ -1868,12 +1868,9 @@ static rt_err_t drv_lcd_init(struct rt_device *device) FSMC_Bank1E->BWTR[6] |= 3 << 0; //地址建立时间(ADDSET)为3个HCLK =18ns FSMC_Bank1E->BWTR[6] |= 2 << 8; //数据保存时间(DATAST)为6ns*3个HCLK=18ns } - LCD_Display_Dir(1); //默认为横屏 - + LCD_Display_Dir(0); //默认为竖屏 rt_pin_write(LCD_BL, PIN_HIGH); - LCD_Clear(0xffff); - return RT_EOK; }