From 04602b2470e9c3e12893fdceee72bb9c3402c708 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Wed, 21 Feb 2018 08:15:20 -0700 Subject: [PATCH] display: Choose arrow character based on display Choose the arrow character based on whether the display is ST7920 or HD44780. Signed-off-by: Marcio Teixeira --- klippy/extras/display.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/klippy/extras/display.py b/klippy/extras/display.py index da878861..01aa1dc0 100644 --- a/klippy/extras/display.py +++ b/klippy/extras/display.py @@ -16,6 +16,7 @@ BACKGROUND_PRIORITY_CLOCK = 0x7fffffff00000000 HD44780_DELAY = .000037 class HD44780: + char_right_arrow = '\x7e' def __init__(self, config): self.printer = config.get_printer() # pin config @@ -110,6 +111,7 @@ class HD44780: ST7920_DELAY = .000020 # Spec says 72us, but faster is possible in practice class ST7920: + char_right_arrow = '\x1a' def __init__(self, config): printer = config.get_printer() # pin config @@ -434,7 +436,7 @@ class PrinterLCD: def format_temperature(self, info): temperature, target = info['temperature'], info['target'] if target and abs(temperature - target) > 2.: - return "%3d/%-3d" % (temperature, target) + return "%3d%s%-3d" % (temperature, self.lcd_chip.char_right_arrow, target) return "%3d" % (temperature) def work_event(self, eventtime): self.lcd_chip.clear()