本帖最后由 万能的互联网 于 2023-10-31 14:10 编辑
这个宏不打开,就会全部糊掉。
//看看头文件内容,感觉没啥问题
#if LV_COLOR_16_SWAP == 0
# define _LV_COLOR_ZERO_INITIALIZER16 {{0x00, 0x00, 0x00}}
# define LV_COLOR_MAKE16(r8, g8, b8) {{(uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x3FU), (uint8_t)((r8 >> 3) & 0x1FU)}}
#else
# define _LV_COLOR_ZERO_INITIALIZER16 {{0x00, 0x00, 0x00, 0x00}}
# define LV_COLOR_MAKE16(r8, g8, b8) {{(uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 3) & 0x1FU), (uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x7U)}}
我也觉得是RGB高低字节的问题,8bit和16bit画点函数的差异
//8bit
void lcd_write_one_point(uint16_t color)
{
lcd_wr_data(~(color) >> 8);
lcd_wr_data(~color);
}
//16 bit
void lcd_write_one_point(uint16_t color)
{
lcd_wr_data(color);
}
但是在dma中,已经用不到 lcd_write_one_point 这个画点函数
//现在怀疑最有可能的突破口,这一句
DMA1_CHANNEL5->paddr = (uint32_t)color_p;
keil5打不开这个结构体指针的定义,我想能不能在这里,对color的高低字节进行处理。或者,有其他更好的办法。
没想到整个问题,最后的重点还是color
|