From 931f35da665d4945305b64e070d7d530623f17cc Mon Sep 17 00:00:00 2001 From: xnegativx Date: Mon, 18 Sep 2023 21:21:30 +0200 Subject: [PATCH] fix sharp display --- modules/display/mip_display.py | 1 - modules/display/mip_sharp_display.py | 15 +++++++-------- modules/helper/setting.py | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/display/mip_display.py b/modules/display/mip_display.py index 3546d768..b09f1a69 100644 --- a/modules/display/mip_display.py +++ b/modules/display/mip_display.py @@ -22,7 +22,6 @@ app_logger.info(f"MIP DISPLAY: {_SENSOR_DISPLAY}") - # https://qiita.com/hishi/items/669ce474fcd76bdce1f1 # LPM027M128C, LPM027M128B, diff --git a/modules/display/mip_sharp_display.py b/modules/display/mip_sharp_display.py index 0025f2e5..fda881eb 100644 --- a/modules/display/mip_sharp_display.py +++ b/modules/display/mip_sharp_display.py @@ -114,7 +114,7 @@ async def draw_worker(self): self.pi.write(GPIO_SCS, 0) self.draw_queue.task_done() - async def update(self, im_array, direct_update): + def update(self, im_array, direct_update): if not _SENSOR_DISPLAY or self.config.G_QUIT: return @@ -140,17 +140,16 @@ async def update(self, im_array, direct_update): time.sleep(0.000006) self.pi.write(GPIO_SCS, 0) else: - await self.draw_queue.put((self.img_buff_rgb8[diff_lines].tobytes())) + asyncio.create_task( + self.draw_queue.put((self.img_buff_rgb8[diff_lines].tobytes())) + ) - async def quit(self): - if not _SENSOR_DISPLAY: - return - - await self.draw_queue.put(None) + def quit(self): + asyncio.create_task(self.draw_queue.put(None)) self.clear() self.pi.write(GPIO_DISP, 1) - await asyncio.sleep(0.01) + time.sleep(0.01) self.pi.spi_close(self.spi) self.pi.stop() diff --git a/modules/helper/setting.py b/modules/helper/setting.py index 98b57bdd..f8dfcf11 100644 --- a/modules/helper/setting.py +++ b/modules/helper/setting.py @@ -162,7 +162,7 @@ def read_config(self): if "DISPLAY_PARAM" in self.config_parser: if "SPI_CLOCK" in self.config_parser["DISPLAY_PARAM"]: - self.config.G_DISPLAY_PARAM["SPI_CLOCK"] = float( + self.config.G_DISPLAY_PARAM["SPI_CLOCK"] = int( self.config_parser["DISPLAY_PARAM"]["SPI_CLOCK"] )