Skip to content

Commit

Permalink
Fix bug where setting egpio was hardcoded to chip C
Browse files Browse the repository at this point in the history
  • Loading branch information
emericklaw committed Jun 5, 2024
1 parent 8ee0030 commit 6e1ddc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/tildagonos.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def set_egpio_pin(self, pin, state):
portstates = list(map(int, self.system_i2c.readfrom_mem(pin[0], 0x02, 2)))
if state:
self.system_i2c.writeto_mem(
0x5A, 0x02 + pin[1], bytes([portstates[pin[1]] | pin[2]])
pin[0], 0x02 + pin[1], bytes([portstates[pin[1]] | pin[2]])
)
else:
self.system_i2c.writeto_mem(
0x5A, 0x02 + pin[1], bytes([portstates[pin[1]] & (pin[2] ^ 0xFF)])
pin[0], 0x02 + pin[1], bytes([portstates[pin[1]] & (pin[2] ^ 0xFF)])
)

def read_egpios(self):
Expand Down

0 comments on commit 6e1ddc4

Please sign in to comment.