From 8f142cc44a6c95911f522fcfb7c4a39ee1a8c876 Mon Sep 17 00:00:00 2001 From: Mike Causer Date: Wed, 23 May 2018 17:01:09 +1000 Subject: [PATCH] Cosmetic changes --- epaper5in83.py | 4 ++-- epaper5in83b.py | 4 ++-- epaper7in5.py | 2 +- epaper7in5b.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epaper5in83.py b/epaper5in83.py index 71b1d1a..bc4a206 100644 --- a/epaper5in83.py +++ b/epaper5in83.py @@ -112,7 +112,7 @@ class EPD: self._command(TEMPERATURE_CALIBRATION, b'\x00') self._command(VCOM_AND_DATA_INTERVAL_SETTING, b'\x77') self._command(TCON_SETTING, b'\x22') - self._command(TCON_RESOLUTION, b'\x02\x58\x01\xC0') # 0x02 = source 600, 0x01 = gate 448 + self._command(TCON_RESOLUTION, ustruct.pack(">HH", EPD_WIDTH, EPD_HEIGHT)) self._command(VCM_DC_SETTING, b'\x1E') # decide by LUT file self._command(FLASH_MODE, b'\x03') @@ -130,7 +130,7 @@ class EPD: def display_frame(self, frame_buffer): if (frame_buffer != None): self._command(DATA_START_TRANSMISSION_1) - for i in range(0, self.width // 4 * self.height): + for i in range(0, self.width * self.height // 4): temp1 = frame_buffer[i] j = 0 while (j < 4): diff --git a/epaper5in83b.py b/epaper5in83b.py index 8450d89..c60dd52 100644 --- a/epaper5in83b.py +++ b/epaper5in83b.py @@ -112,7 +112,7 @@ class EPD: self._command(TEMPERATURE_CALIBRATION, b'\x00') self._command(VCOM_AND_DATA_INTERVAL_SETTING, b'\x77') self._command(TCON_SETTING, b'\x22') - self._command(TCON_RESOLUTION, b'\x02\x58\x01\xC0') # 0x02 = source 600, 0x01 = gate 448 + self._command(TCON_RESOLUTION, ustruct.pack(">HH", EPD_WIDTH, EPD_HEIGHT)) self._command(VCM_DC_SETTING, b'\x20') # decide by LUT file self._command(FLASH_MODE, b'\x03') @@ -130,7 +130,7 @@ class EPD: def display_frame(self, frame_buffer_black, frame_buffer_red): if (frame_buffer != None and frame_buffer_red != None): self._command(DATA_START_TRANSMISSION_1) - for i in range(0, self.width // 8 * self.height): + for i in range(0, self.width * self.height // 8): temp1 = frame_buffer_black[i] temp2 = frame_buffer_red[i] j = 0 diff --git a/epaper7in5.py b/epaper7in5.py index 8ec8cf1..9ec84b2 100644 --- a/epaper7in5.py +++ b/epaper7in5.py @@ -129,7 +129,7 @@ class EPD: # draw the current frame memory def display_frame(self, frame_buffer): self._command(DATA_START_TRANSMISSION_1) - for i in range(0, 30720): + for i in range(0, self.width * self.height // 8): temp1 = frame_buffer[i] j = 0 while (j < 8): diff --git a/epaper7in5b.py b/epaper7in5b.py index deef5e8..871abcd 100644 --- a/epaper7in5b.py +++ b/epaper7in5b.py @@ -131,7 +131,7 @@ class EPD: # draw the current frame memory def display_frame(self, frame_buffer): self._command(DATA_START_TRANSMISSION_1) - for i in range(0, self.width // 4 * self.height): + for i in range(0, self.width * self.height // 4): temp1 = frame_buffer[i] j = 0 while (j < 4):