提交 54bc937f 编写于 作者: S Sean Young 提交者: Miguel Ojeda

auxdisplay: charlcd: no need to call charlcd_gotoxy() if nothing changes

If the line extends beyond the width to the screen, nothing changes. The
existing code will call charlcd_gotoxy every time for this case.
Signed-off-by: NSean Young <sean@mess.org>
Reviewed-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: NMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
上级 7223310f
...@@ -192,10 +192,11 @@ static void charlcd_print(struct charlcd *lcd, char c) ...@@ -192,10 +192,11 @@ static void charlcd_print(struct charlcd *lcd, char c)
c = lcd->char_conv[(unsigned char)c]; c = lcd->char_conv[(unsigned char)c];
lcd->ops->write_data(lcd, c); lcd->ops->write_data(lcd, c);
priv->addr.x++; priv->addr.x++;
/* prevents the cursor from wrapping onto the next line */
if (priv->addr.x == lcd->bwidth)
charlcd_gotoxy(lcd);
} }
/* prevents the cursor from wrapping onto the next line */
if (priv->addr.x == lcd->bwidth)
charlcd_gotoxy(lcd);
} }
static void charlcd_clear_fast(struct charlcd *lcd) static void charlcd_clear_fast(struct charlcd *lcd)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册