Updating so waveshare 2.13 b/c models only have to maintain black color channel. Color channels aren't used so no need to maintain them

This commit is contained in:
Michael V. Swisher 2019-10-05 06:55:04 -07:00
parent defaa154e8
commit 23cd8ad599
2 changed files with 16 additions and 3 deletions
sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui

@ -208,9 +208,13 @@ class Display(View):
def _waveshare_bc_render(self):
buf_black = self._display.getbuffer(self.canvas)
emptyImage = Image.new('1', (self._display.height, self._display.width), 255)
buf_color = self._display.getbuffer(emptyImage)
self._display.display(buf_black,buf_color)
# emptyImage = Image.new('1', (self._display.height, self._display.width), 255)
# buf_color = self._display.getbuffer(emptyImage)
# self._display.display(buf_black,buf_color)
# Custom display function that only handles black
# Was included in epd2in13bc.py
self._display.displayBlack(buf_black)

@ -117,6 +117,15 @@ class EPD:
buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8))
return buf
def displayBlack(self, imageblack):
self.send_command(0x10)
for i in range(0, int(self.width * self.height / 8)):
self.send_data(imageblack[i])
self.send_command(0x92)
self.send_command(0x12) # REFRESH
self.ReadBusy()
def display(self, imageblack, imagecolor):
self.send_command(0x10)
for i in range(0, int(self.width * self.height / 8)):