Skip to content

Commit

Permalink
updating coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
ruck314 committed May 9, 2024
1 parent 4aa7171 commit ab13f77
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions python/surf/devices/ti/_Ina237.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,12 @@ def __init__(self,
dependencies = [self.DIETEMP],
))

def convCurrent(self, dev, var, read):
with self.root.updateGroup():
adcRange = var.dependencies[0].get(read=read)
if adcRange == 0:
lsbScale = 5.0E-6 # 5 uV/LSB
else:
lsbScale = 1.23E-6 # 1.25 uV/LSB
value = var.dependencies[1].get(read=read)
fpValue = value*lsbScale
return (fpValue/var.dependencies[2].get(read=read))
def convCurrent(self, read): # Don't need dev and var since not used
adcRange = self.ADCRANGE.value() # Doesn't change in HW so shadow value is preferred
if adcRange == 0:
lsbScale = 5.0E-6 # 5 uV/LSB
else:
lsbScale = 1.23E-6 # 1.25 uV/LSB
value = self.VSHUNT.get(read=read) # Read the ADC value
fpValue = value*lsbScale
return (fpValue/self.SenseRes.value()) # SenseRes is LocalVariable

0 comments on commit ab13f77

Please sign in to comment.