Skip to content

Commit 5ddebd3

Browse files
committed
Try to fix issue #1
1 parent 9f7c691 commit 5ddebd3

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

client/waveshare_epd/epd7in5_V2.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,22 @@ def send_data2(self, data):
128128
epdconfig.digital_write(self.cs_pin, 1)
129129

130130
def ReadBusy(self):
131-
logger.debug("e-Paper busy")
131+
logging.debug("e-Paper busy")
132132
self.send_command(0x71)
133-
busy = epdconfig.digital_read(self.busy_pin)
134-
while(busy == 0):
133+
iter = 0
134+
while epdconfig.digital_read(self.busy_pin) == 0:
135135
self.send_command(0x71)
136-
busy = epdconfig.digital_read(self.busy_pin)
137-
epdconfig.delay_ms(20)
138-
logger.debug("e-Paper busy release")
136+
epdconfig.delay_ms(100)
137+
iter += 1
138+
if iter > 150:
139+
logging.debug("Forced e-paper busy release")
140+
break
141+
logging.debug("e-Paper busy release")
142+
#busy = epdconfig.digital_read(self.busy_pin)
143+
#while(busy == 0):
144+
# self.send_command(0x71)
145+
# busy = epdconfig.digital_read(self.busy_pin)
146+
#epdconfig.delay_ms(200)
139147

140148
def SetLut(self, lut_vcom, lut_ww, lut_bw, lut_wb, lut_bb):
141149
self.send_command(0x20)

0 commit comments

Comments
 (0)