Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw_pid: delete initial set_direction #703

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -14,8 +14,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 @@ -26,11 +24,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 @@ -119,12 +113,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