mirror of https://github.com/Desuuuu/klipper.git
display: Allow the ST7920_DISPLAY parameter to be configured
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
3ac9fc6e63
commit
d94c856118
|
@ -539,6 +539,10 @@
|
|||
#sid_pin:
|
||||
# The pins connected to an st7920 type lcd. These parameters must be
|
||||
# provided when using an st7920 display.
|
||||
#chip_delay:
|
||||
# This parameter specifies the internal command delay (in seconds)
|
||||
# on st7920 displays. It may be necessary to increase this if the
|
||||
# display shows garbled data. The default is 0.000020.
|
||||
|
||||
|
||||
# Custom thermistors (one may define any number of sections with a
|
||||
|
|
|
@ -182,6 +182,7 @@ class ST7920:
|
|||
self.mcu = mcu
|
||||
self.oid = self.mcu.create_oid()
|
||||
self.mcu.add_config_object(self)
|
||||
self.chip_delay = config.getfloat('chip_delay', ST7920_DELAY, minval=0.)
|
||||
self.send_data_cmd = self.send_cmds_cmd = None
|
||||
self.is_extended = False
|
||||
# framebuffers
|
||||
|
@ -196,7 +197,7 @@ class ST7920:
|
|||
"config_st7920 oid=%u cs_pin=%s sclk_pin=%s sid_pin=%s"
|
||||
" delay_ticks=%d" % (
|
||||
self.oid, self.pins[0], self.pins[1], self.pins[2],
|
||||
self.mcu.seconds_to_clock(ST7920_DELAY)))
|
||||
self.mcu.seconds_to_clock(self.chip_delay)))
|
||||
cmd_queue = self.mcu.alloc_command_queue()
|
||||
self.send_cmds_cmd = self.mcu.lookup_command(
|
||||
"st7920_send_cmds oid=%c cmds=%*s", cq=cmd_queue)
|
||||
|
|
Loading…
Reference in New Issue