From 4d5bfc2adf630e42fdbd223c8febe0501af58fdb Mon Sep 17 00:00:00 2001 From: Nikhil Jha Date: Sun, 27 Oct 2019 14:20:54 -0700 Subject: [PATCH] maybe actually fix now Signed-off-by: Nikhil Jha --- .../ui/hw/libs/waveshare/v213d/epd2in13d.py | 2 +- pwnagotchi/ui/hw/waveshare213d.py | 40 +++++-------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/pwnagotchi/ui/hw/libs/waveshare/v213d/epd2in13d.py b/pwnagotchi/ui/hw/libs/waveshare/v213d/epd2in13d.py index de02f86..81199c7 100644 --- a/pwnagotchi/ui/hw/libs/waveshare/v213d/epd2in13d.py +++ b/pwnagotchi/ui/hw/libs/waveshare/v213d/epd2in13d.py @@ -331,7 +331,7 @@ class EPD: 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) diff --git a/pwnagotchi/ui/hw/waveshare213d.py b/pwnagotchi/ui/hw/waveshare213d.py index 0d9dfcc..a00d548 100644 --- a/pwnagotchi/ui/hw/waveshare213d.py +++ b/pwnagotchi/ui/hw/waveshare213d.py @@ -53,38 +53,16 @@ class Waveshare213d(DisplayImpl): 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()