1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

platforms/arm: JunoEnergyInstrument fixes

- Make sure commands are updated after installing readenergy binary
  during setup.
- Add the missing channels argument to reset().
- Set the sample rate for the MeasurementCsv inside get_data().
This commit is contained in:
Sergei Trofimov 2017-12-11 17:14:00 +00:00 committed by marcbonnici
parent 75ff31c6c7
commit 56a5f8ab12

View File

@ -245,9 +245,11 @@ class JunoEnergyInstrument(Instrument):
def setup(self):
self.binary = self.target.install(os.path.join(PACKAGE_BIN_DIRECTORY,
self.target.abi, self.binname))
self.command = '{} -o {}'.format(self.binary, self.on_target_file)
self.command2 = '{}'.format(self.binary)
def reset(self, sites=None, kinds=None):
super(JunoEnergyInstrument, self).reset(sites, kinds)
def reset(self, sites=None, kinds=None, channels=None):
super(JunoEnergyInstrument, self).reset(sites, kinds, channels)
self.target.killall(self.binname, as_root=True)
def start(self):
@ -282,7 +284,7 @@ class JunoEnergyInstrument(Instrument):
write_row = [row[c] for c in select_columns]
writer.writerow(write_row)
return MeasurementsCsv(output_file, self.active_channels)
return MeasurementsCsv(output_file, self.active_channels, sample_rate_hz=10)
def take_measurement(self):
result = []