Save current changes before reorganizing drivers and cleaning workspace
This commit is contained in:
+12
-2
@@ -78,8 +78,18 @@ class FT6336U:
|
||||
return True
|
||||
|
||||
def is_touched(self):
|
||||
"""Returns True if screen is touched (the active-low INT pin is pulled LOW)."""
|
||||
return self.int() == 0
|
||||
"""Returns True if screen is touched by checking the TD_STATUS register and clearing coordinates."""
|
||||
if not self.initialized:
|
||||
return False
|
||||
td_status = self.read_reg(self.REG_TD_STATUS)
|
||||
if td_status is None:
|
||||
return False
|
||||
touch_count = td_status[0] & 0x0F
|
||||
if touch_count > 0 and touch_count < 3:
|
||||
# Read P1 coordinates to clear register/interrupt state on the chip
|
||||
self.read_reg(self.REG_P1_XH, 6)
|
||||
return True
|
||||
return False
|
||||
|
||||
def read_touch(self):
|
||||
"""Reads touch point coordinates.
|
||||
|
||||
Reference in New Issue
Block a user