fix float errors in _lcd_update()

This commit is contained in:
Franzi 2020-09-26 11:27:39 +02:00
parent 58aa8673f8
commit 1058892564
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -113,6 +113,8 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
if self._lcd_updating:
return
bytes_per_send_cycle = int(self.cols*(self.rows/2))
self._lcd_updating = True
line1 = self._line1.ljust(self.cols, ' ')
@ -122,12 +124,12 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
message = line1 + line3
self._lcd_send_byte(self._lcd_line1, self._lcd_cmd)
for i in range(self.cols*self.rows/2):
for i in range(bytes_per_send_cycle):
self._lcd_send_byte(ord(message[i]), self._lcd_chr)
message = line2 + line4
self._lcd_send_byte(self._lcd_line2, self._lcd_cmd)
for i in range(self.cols*self.rows/2):
for i in range(bytes_per_send_cycle):
self._lcd_send_byte(ord(message[i]), self._lcd_chr)
self._lcd_updating = False