waveshare e-lnk 2.13 V3/V4 update

Optimize the initialization function to resolve the issue of noise in the first few frames caused by the lack of buffer initialization.

Signed-off-by: 铲屎将军 <37292630+wlmh110@users.noreply.github.com>
This commit is contained in:
铲屎将军
2024-08-21 22:43:47 +08:00
committed by GitHub
parent ea4f495ab8
commit fbe8211a10
2 changed files with 18 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import logging
import pwnagotchi.ui.fonts as fonts
from pwnagotchi.ui.hw.base import DisplayImpl
from PIL import Image,ImageDraw,ImageFont
class WaveshareV3(DisplayImpl):
@ -37,6 +38,14 @@ class WaveshareV3(DisplayImpl):
self._display = EPD()
self._display.init()
self._display.Clear(0xFF)
try:
new_image = Image.new('1', ( self._display.height, self._display.width), 255)
buf = self._display.getbuffer(new_image)
self._display.displayPartBaseImage(buf)
except Exception as e:
logging.info(e)
logging.info("initializing waveshare v3 display done")
def render(self, canvas):
buf = self._display.getbuffer(canvas)

View File

@ -3,6 +3,7 @@ import logging
import pwnagotchi.ui.fonts as fonts
from pwnagotchi.ui.hw.base import DisplayImpl
from PIL import Image,ImageDraw,ImageFont
class WaveshareV4(DisplayImpl):
def __init__(self, config):
@ -36,6 +37,14 @@ class WaveshareV4(DisplayImpl):
self._display = EPD()
self._display.init()
self._display.Clear(0xFF)
try:
new_image = Image.new('1', ( self._display.height, self._display.width), 255)
buf = self._display.getbuffer(new_image)
self._display.displayPartBaseImage(buf)
except Exception as e:
logging.info(e)
logging.info("initializing waveshare v2in13_V4 display done")
def render(self, canvas):
buf = self._display.getbuffer(canvas)