Skip to content

Commit

Permalink
Merge pull request #25 from Ptosiek/fix-display
Browse files Browse the repository at this point in the history
Fix MIP sharp display
  • Loading branch information
hishizuka authored Sep 27, 2023
2 parents ebfeb99 + 931f35d commit f00f5d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion modules/display/mip_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

app_logger.info(f"MIP DISPLAY: {_SENSOR_DISPLAY}")


# https://qiita.com/hishi/items/669ce474fcd76bdce1f1
# LPM027M128C, LPM027M128B,

Expand Down
15 changes: 7 additions & 8 deletions modules/display/mip_sharp_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
2 changes: 1 addition & 1 deletion modules/helper/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
)

Expand Down

0 comments on commit f00f5d5

Please sign in to comment.