Skip to content

Commit

Permalink
hw_pid: delete initial set_direction (#703)
Browse files Browse the repository at this point in the history
* delete initial set_direction

* detele unnecessary docstrings
  • Loading branch information
ykyohei authored Aug 12, 2024
1 parent a99fcd6 commit 7123ec5
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions socs/agents/hwp_pid/drivers/pid_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class PID:
Attributes:
verb (bool): Verbose output setting.
hex_freq (str): Currently declared rotation frequency in hexadecimal.
direction (int): Current direction of the HWP. 0 for forward and 1 for
backwards.
conn (socket.socket): Socket object with open connection to the PID
controller.
Expand All @@ -35,11 +33,7 @@ def __init__(self, ip, port, verb=False):
self.ip = ip
self.port = port
self.hex_freq = '00000'
self.direction = None
self.target = 0
# Need to setup connection before setting direction
self.conn = self._establish_connection(self.ip, int(self.port))
self.set_direction('0')

@staticmethod
def _establish_connection(ip, port, timeout=2):
Expand Down Expand Up @@ -128,12 +122,10 @@ def set_direction(self, direction):
if self.verb:
print('Forward')
resp = self.send_message("*W02400000")
self.direction = 0
elif direction == '1':
if self.verb:
print('Reverse')
resp = self.send_message("*W02401388")
self.direction = 1

if self.verb:
print(self.return_messages([resp])[0])
Expand Down

0 comments on commit 7123ec5

Please sign in to comment.