diff options
author | Marcio Teixeira <marcio@alephobjects.com> | 2018-02-21 08:15:20 -0700 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-03-06 14:01:10 -0500 |
commit | 04602b2470e9c3e12893fdceee72bb9c3402c708 (patch) | |
tree | f89230ef514db3b993f561fe7dfc468adea79d9c | |
parent | 923954772f5ee08d63dd5b0d4a22719e81adfea3 (diff) | |
download | kutter-04602b2470e9c3e12893fdceee72bb9c3402c708.tar.gz kutter-04602b2470e9c3e12893fdceee72bb9c3402c708.tar.xz kutter-04602b2470e9c3e12893fdceee72bb9c3402c708.zip |
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 <marcio@alephobjects.com>
-rw-r--r-- | klippy/extras/display.py | 4 |
1 files changed, 3 insertions, 1 deletions
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() |