Skip to content

Commit f7a5240

Browse files
committed
Comment re gt911 reset bug
1 parent b4350b6 commit f7a5240

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

lib/gt911_touch.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,23 @@ def touches(self) -> List[dict]:
186186
return touchpoints
187187

188188
def _reset(self, address, res_pin, irq_pin=None) -> None:
189-
""" Initialize board - This sometimes fails, Ctrl-D reset to recover """
189+
"""
190+
Initialize board to use default I2C address of 0x5D
191+
192+
Some of the time, this function currently selects the
193+
secondary I2C address (0x14). A ctrl-D reset immediatly
194+
after the incorrect reset results in the correct I2C address
195+
being selected.
196+
197+
Alternatley the calling code can switch to the secondary
198+
address if a device is not found on the primary address
199+
200+
try:
201+
self._i2c = I2CDevice(i2c, 0x5D)
202+
except:
203+
self._i2c = I2CDevice(i2c, 0x14)
204+
"""
205+
190206
time.sleep(.0001)
191207
res_pin.direction = digitalio.Direction.OUTPUT
192208
res_pin.value = True

lib/pydos_ui_virt.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,18 @@ def __init__(self):
8383

8484
self._touched = False
8585

86-
#self._row1Keys = [600,555,510,465,420,375,330,285,240,195,150,105,60,0]
8786
self._row1Keys = [665,615,565,515,465,415,365,315,265,215,165,115,68,0]
8887
self._row1Letters = ['\x08','=','-','0','9','8','7','6','5','4','3','2','1','`']
8988
self._row1Uppers = ['\x08','+','_',')','(','*','&','^','%','$','#','@','!','~']
90-
#self._row2Keys = [615,570,525,485,440,395,350,305,260,215,175,130,80,0]
9189
self._row2Keys = [695,645,595,545,495,445,395,345,295,245,195,145,95,0]
9290
self._row2Letters = ['\\',']','[','p','o','i','u','y','t','r','e','w','q','\x09']
9391
self._row2Uppers = ['|','}','{']
94-
#self._row3Keys = [590,545,500,455,410,365,320,275,230,185,140,95,0]
9592
self._row3Keys = [650,600,550,500,450,400,350,300,250,200,150,100,0]
9693
self._row3Letters = ['\n',"'",';','l','k','j','h','g','f','d','s',"a",'C']
9794
self._row3Uppers = ['\n','"',':']
98-
#self._row4Keys = [565,520,475,430,385,340,295,250,205,160,115,0]
9995
self._row4Keys = [635,585,535,485,435,385,335,285,235,185,135,0]
10096
self._row4Letters = ['S','/','.',',','m','n','b','v','c','x','z','S']
10197
self._row4Uppers = ['S','?','>','<']
102-
#self._row5Keys = [640,460,200,110,0]
10398
self._row5Keys = [710,520,220,125,0]
10499
self._row5Letters = ['X','',' ','','\x1b']
105100

0 commit comments

Comments
 (0)