maybe actually fix now
Signed-off-by: Nikhil Jha <hi@nikhiljha.com>
This commit is contained in:
parent
4814e10940
commit
4d5bfc2adf
@ -331,7 +331,7 @@ class EPD:
|
|||||||
|
|
||||||
self.TurnOnDisplay()
|
self.TurnOnDisplay()
|
||||||
|
|
||||||
def Clear(self, color):
|
def Clear(self):
|
||||||
self.send_command(0x10)
|
self.send_command(0x10)
|
||||||
for i in range(0, int(self.width * self.height / 8)):
|
for i in range(0, int(self.width * self.height / 8)):
|
||||||
self.send_data(0x00)
|
self.send_data(0x00)
|
||||||
|
@ -53,38 +53,16 @@ class Waveshare213d(DisplayImpl):
|
|||||||
return self._layout
|
return self._layout
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
if self.config['color'] == 'black':
|
logging.info("initializing waveshare 213d display")
|
||||||
logging.info("initializing waveshare v1 display in monochromatic mode")
|
from pwnagotchi.ui.hw.libs.waveshare.v213d.epd2in13d import EPD
|
||||||
from pwnagotchi.ui.hw.libs.waveshare.v1.epd2in13 import EPD
|
self._display = EPD()
|
||||||
self._display = EPD()
|
self._display.init()
|
||||||
self._display.init(self._display.lut_full_update)
|
self._display.Clear()
|
||||||
self._display.Clear(0xFF)
|
|
||||||
self._display.init(self._display.lut_partial_update)
|
|
||||||
elif self.config['color'] == 'fastAndFurious':
|
|
||||||
logging.info("initializing waveshare v1 3-color display in FAST MODE")
|
|
||||||
logging.info("THIS MAY BE POTENTIALLY DANGEROUS. NO WARRANTY IS PROVIDED")
|
|
||||||
logging.info("USE THIS DISPLAY IN THIS MODE AT YOUR OWN RISK")
|
|
||||||
from pwnagotchi.ui.hw.libs.waveshare.v1.epd2in13bcFAST import EPD
|
|
||||||
self._display = EPD()
|
|
||||||
self._display.init()
|
|
||||||
self._display.Clear()
|
|
||||||
else:
|
|
||||||
logging.info("initializing waveshare v1 display 3-color mode")
|
|
||||||
from pwnagotchi.ui.hw.libs.waveshare.v1.epd2in13bc import EPD
|
|
||||||
self._display = EPD()
|
|
||||||
self._display.init()
|
|
||||||
self._display.Clear()
|
|
||||||
|
|
||||||
def render(self, canvas):
|
def render(self, canvas):
|
||||||
if self.config['color'] == 'black':
|
buf = self._display.getbuffer(canvas)
|
||||||
buf = self._display.getbuffer(canvas)
|
self._display.display(buf)
|
||||||
self._display.display(buf)
|
|
||||||
elif self.config['color'] == 'fastAndFurious':
|
|
||||||
buf_black = self._display.getbuffer(canvas)
|
|
||||||
self._display.DisplayPartial(buf_black)
|
|
||||||
else:
|
|
||||||
buf_black = self._display.getbuffer(canvas)
|
|
||||||
self._display.displayBlack(buf_black)
|
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
self._display.Clear(0xff)
|
pass
|
||||||
|
#self._display.Clear()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user