解决了因为汉字在两个数据块直接导致的数据流乱码,
下个版本打算两字节两个字节的读取,这样就就不怕数据块中 换行太多导致显示不下。 Signed-off-by: 无闻风 <53944749+wuwenfengmi1998@users.noreply.github.com>
This commit is contained in:
+11
-5
@@ -361,6 +361,10 @@ void LCD_ShowString(uint16_t x,uint16_t y,uint8_t *p,uint8_t size,uint16_t bg,ui
|
||||
if(*p=='\r')
|
||||
{
|
||||
p++;
|
||||
if(*p!='\n')
|
||||
{
|
||||
return ;
|
||||
}
|
||||
}
|
||||
if(*p=='\n')
|
||||
{
|
||||
@@ -368,15 +372,17 @@ void LCD_ShowString(uint16_t x,uint16_t y,uint8_t *p,uint8_t size,uint16_t bg,ui
|
||||
y+=size;
|
||||
p++;
|
||||
}
|
||||
if(*p<127)
|
||||
{
|
||||
LCD_ShowChar(x,y,*p,size,bg,color);
|
||||
x+=(size/2);
|
||||
}else
|
||||
if(*p>127)
|
||||
{
|
||||
|
||||
|
||||
Show_Font(x,y,p,size,bg,color);
|
||||
p++;
|
||||
x+=size;
|
||||
}else
|
||||
{
|
||||
LCD_ShowChar(x,y,*p,size,bg,color);
|
||||
x+=(size/2);
|
||||
}
|
||||
p++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user