Skip to content

Commit

Permalink
maybe actually fix now
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Jha <hi@nikhiljha.com>
  • Loading branch information
nikhiljha committed Oct 27, 2019
1 parent 4814e10 commit 4d5bfc2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 32 deletions.
2 changes: 1 addition & 1 deletion pwnagotchi/ui/hw/libs/waveshare/v213d/epd2in13d.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def DisplayPartial(self, image):

self.TurnOnDisplay()

def Clear(self, color):
def Clear(self):
self.send_command(0x10)
for i in range(0, int(self.width * self.height / 8)):
self.send_data(0x00)
Expand Down
40 changes: 9 additions & 31 deletions pwnagotchi/ui/hw/waveshare213d.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,38 +53,16 @@ def layout(self):
return self._layout

def initialize(self):
if self.config['color'] == 'black':
logging.info("initializing waveshare v1 display in monochromatic mode")
from pwnagotchi.ui.hw.libs.waveshare.v1.epd2in13 import EPD
self._display = EPD()
self._display.init(self._display.lut_full_update)
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()
logging.info("initializing waveshare 213d display")
from pwnagotchi.ui.hw.libs.waveshare.v213d.epd2in13d import EPD
self._display = EPD()
self._display.init()
self._display.Clear()

def render(self, canvas):
if self.config['color'] == 'black':
buf = self._display.getbuffer(canvas)
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)
buf = self._display.getbuffer(canvas)
self._display.display(buf)

def clear(self):
self._display.Clear(0xff)
pass
#self._display.Clear()

0 comments on commit 4d5bfc2

Please sign in to comment.