diff --git a/display_ili9341b.py b/display_ili9341b.py index 522d1605..a9f2313e 100644 --- a/display_ili9341b.py +++ b/display_ili9341b.py @@ -175,7 +175,7 @@ def _display_loop(self): if self.displaycommand == 'splash': self._display_splash() self.displaytimeout = time.time() + 3 - self.displaycommand = None + self.displaycommand = 'clear' time.sleep(3) # Hold splash screen for 3 seconds if self.displaycommand == 'text': @@ -199,11 +199,11 @@ def _display_loop(self): self.menuactive = False self.menu['current']['mode'] = 'none' self.menu['current']['option'] = 0 + if not self.displayactive: + self.displaycommand = 'clear' elif (not self.displaytimeout) and (self.displayactive): if (self.in_data is not None) and (self.status_data is not None): self._display_current(self.in_data, self.status_data) - elif (not self.displaytimeout): - self.displaycommand = 'clear' time.sleep(0.1) @@ -317,8 +317,8 @@ def _display_clear(self): def _display_canvas(self, canvas): # Display canvas to screen for ILI9341 - self.device.backlight(True) self.device.show() + self.device.backlight(True) self.device.display(canvas) def _display_splash(self): diff --git a/display_ili9341e.py b/display_ili9341e.py index 016e0fdc..c76945b0 100644 --- a/display_ili9341e.py +++ b/display_ili9341e.py @@ -61,7 +61,6 @@ def _init_display_device(self): # Init Device self.serial = spi(port=0, device=0, gpio_DC=24, gpio_RST=25, bus_speed_hz=32000000, reset_hold_time=0.2, reset_release_time=0.2) self.device = ili9341(self.serial, active_low=False, width=self.WIDTH, height=self.HEIGHT, gpio_LIGHT=5, rotate=self.rotation) - # Setup & Start Display Loop Thread display_thread = threading.Thread(target=self._display_loop) display_thread.start() @@ -163,7 +162,7 @@ def _display_loop(self): if self.displaycommand == 'splash': self._display_splash() self.displaytimeout = time.time() + 3 - self.displaycommand = None + self.displaycommand = 'clear' time.sleep(3) # Hold splash screen for 3 seconds if self.displaycommand == 'text': @@ -187,11 +186,11 @@ def _display_loop(self): self.menuactive = False self.menu['current']['mode'] = 'none' self.menu['current']['option'] = 0 + if not self.displayactive: + self.displaycommand = 'clear' elif (not self.displaytimeout) and (self.displayactive): if (self.in_data is not None) and (self.status_data is not None): self._display_current(self.in_data, self.status_data) - elif (not self.displaytimeout): - self.displaycommand = 'clear' time.sleep(0.1) @@ -307,8 +306,8 @@ def _display_clear(self): def _display_canvas(self, canvas): # Display canvas to screen for ILI9341 - self.device.backlight(True) self.device.show() + self.device.backlight(True) self.device.display(canvas) def _display_splash(self): diff --git a/display_ili9341em.py b/display_ili9341em.py index da481b44..d09e288d 100644 --- a/display_ili9341em.py +++ b/display_ili9341em.py @@ -166,7 +166,7 @@ def _display_loop(self): if self.displaycommand == 'splash': self._display_splash() self.displaytimeout = time.time() + 3 - self.displaycommand = None + self.displaycommand = 'clear' time.sleep(3) # Hold splash screen for 3 seconds if self.displaycommand == 'text': @@ -190,11 +190,11 @@ def _display_loop(self): self.menuactive = False self.menu['current']['mode'] = 'none' self.menu['current']['option'] = 0 + if not self.displayactive: + self.displaycommand = 'clear' elif (not self.displaytimeout) and (self.displayactive): if (self.in_data is not None) and (self.status_data is not None): self._display_current(self.in_data, self.status_data) - elif (not self.displaytimeout): - self.displaycommand = 'clear' time.sleep(0.1) @@ -310,8 +310,8 @@ def _display_clear(self): def _display_canvas(self, canvas): # Display canvas to screen for ILI9341 - self.device.backlight(True) self.device.show() + self.device.backlight(True) self.device.display(canvas) def _display_splash(self): diff --git a/display_pygame_240x320b.py b/display_pygame_240x320b.py index 82c89dc8..266d150d 100755 --- a/display_pygame_240x320b.py +++ b/display_pygame_240x320b.py @@ -164,7 +164,7 @@ def _display_loop(self): if self.displaycommand == 'splash': self._display_splash() self.displaytimeout = time.time() + 3 - self.displaycommand = None + self.displaycommand = 'clear' pygame.time.delay(3000) # Hold splash screen for 3 seconds if self.displaycommand == 'text': @@ -188,11 +188,11 @@ def _display_loop(self): self.menuactive = False self.menu['current']['mode'] = 'none' self.menu['current']['option'] = 0 + if not self.displayactive: + self.displaycommand = 'clear' elif (not self.displaytimeout) and (self.displayactive): if (self.in_data is not None) and (self.status_data is not None): self._display_current(self.in_data, self.status_data) - elif (not self.displaytimeout): - self.displaycommand = 'clear' pygame.quit() @@ -288,6 +288,7 @@ def _draw_auger_icon(self, canvas): return(canvas) def _display_clear(self): + print(f'[{time.time()}] Screen Cleared.') self.display_surface.fill((0,0,0)) pygame.display.update() diff --git a/display_st7789_240x320b.py b/display_st7789_240x320b.py index 52afa1fd..ee8f0427 100644 --- a/display_st7789_240x320b.py +++ b/display_st7789_240x320b.py @@ -185,7 +185,7 @@ def _display_loop(self): if self.displaycommand == 'splash': self._display_splash() self.displaytimeout = time.time() + 3 - self.displaycommand = None + self.displaycommand = 'clear' time.sleep(3) # Hold splash screen for 3 seconds if self.displaycommand == 'text': @@ -209,11 +209,11 @@ def _display_loop(self): self.menuactive = False self.menu['current']['mode'] = 'none' self.menu['current']['option'] = 0 + if not self.displayactive: + self.displaycommand = 'clear' elif (not self.displaytimeout) and (self.displayactive): if (self.in_data is not None) and (self.status_data is not None): self._display_current(self.in_data, self.status_data) - elif (not self.displaytimeout): - self.displaycommand = 'clear' time.sleep(0.1) diff --git a/display_st7789_240x320e.py b/display_st7789_240x320e.py index 83fd2eea..a27dc75c 100644 --- a/display_st7789_240x320e.py +++ b/display_st7789_240x320e.py @@ -173,7 +173,7 @@ def _display_loop(self): if self.displaycommand == 'splash': self._display_splash() self.displaytimeout = time.time() + 3 - self.displaycommand = None + self.displaycommand = 'clear' time.sleep(3) # Hold splash screen for 3 seconds if self.displaycommand == 'text': @@ -197,11 +197,11 @@ def _display_loop(self): self.menuactive = False self.menu['current']['mode'] = 'none' self.menu['current']['option'] = 0 + if not self.displayactive: + self.displaycommand = 'clear' elif (not self.displaytimeout) and (self.displayactive): if (self.in_data is not None) and (self.status_data is not None): self._display_current(self.in_data, self.status_data) - elif (not self.displaytimeout): - self.displaycommand = 'clear' time.sleep(0.1)