Skip to content

Commit

Permalink
fix twos_complement for thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
bleykauf committed Sep 27, 2024
1 parent 84c9a00 commit afcf424
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions linien-server/linien_server/registers.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,12 @@ def write_registers(self):
)
new[f"logic_relock_watcher_should_watch_{channel}"] = should_watch
new[f"logic_relock_watcher_min_{channel}"] = twos_complement(
int(getattr(self.parameters, f"watch_lock_{channel}_min").value * 8191)
int(getattr(self.parameters, f"watch_lock_{channel}_min").value * 8191),
14,
)
new[f"logic_relock_watcher_max_{channel}"] = twos_complement(
int(getattr(self.parameters, f"watch_lock_{channel}_max").value * 8191)
int(getattr(self.parameters, f"watch_lock_{channel}_max").value * 8191),
14,
)

if self.parameters.lock.value:
Expand Down

0 comments on commit afcf424

Please sign in to comment.