Skip to content

Commit 87516e6

Browse files
committed
v1.3.3 bugfix
readback_cell_V and readback_ai_v frame index fix
1 parent 92d9215 commit 87516e6

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2023, Bloomy Controls Inc.
3+
Copyright (c) 2024, Bloomy Controls Inc.
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "BS1200_driver"
3-
version = "1.3.2"
3+
version = "1.3.3"
44
authors = [{ name = "Mikhail Kharitonov", email = "[email protected]"}]
55
description= "Python interface to the Bloomy BS1200"
66
readme = "README.md"

src/bs1200/driver.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ def readback_cell_V(self, boxid: int, channel: int) -> float:
246246
readbacks = [self.rx_cache[288+boxid],
247247
self.rx_cache[304+boxid],
248248
self.rx_cache[320+boxid]]
249-
frame_i = channel // 4
250-
cell_i = (channel-1) % 4
249+
frame_i, cell_i = (channel-1) // 4, (channel-1) % 4
251250
rx_msg = readbacks[frame_i]
252251
cell_volts = self.scale_volts(unpack('<H', rx_msg.data[cell_i*2:cell_i*2+2])[0], True)
253252
return cell_volts
@@ -359,8 +358,7 @@ def readback_ai_v(self, boxid: int, channel: int) -> float:
359358
try:
360359
readbacks = [self.rx_cache[672+boxid],
361360
self.rx_cache[688+boxid]]
362-
frame_i = channel // 4
363-
cell_i = (channel-1) % 4
361+
frame_i, cell_i = (channel-1) // 4, (channel-1) % 4
364362
rx_msg = readbacks[frame_i]
365363

366364
ai_volts = self.scale_volts(unpack('<H', rx_msg.data[cell_i*2:cell_i*2+2])[0], True)

0 commit comments

Comments
 (0)