Ubiquitous/RT_Thread/:change the default orientation of the MCU-ATK screen

This commit is contained in:
chunyexixiaoyu 2022-01-18 15:54:54 +08:00
parent bc87a72f5d
commit 1c5047f47a
1 changed files with 3 additions and 6 deletions

View File

@ -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;
}