| Index: tools/telemetry/telemetry/core/platform/profiler/monsoon.py
|
| diff --git a/tools/telemetry/telemetry/core/platform/profiler/monsoon.py b/tools/telemetry/telemetry/core/platform/profiler/monsoon.py
|
| index 13990c28a1eb74f54b46f29fae5c32cd582c2d90..21cb6d2fe7727f2e3c5067034f2f65ff108410b2 100644
|
| --- a/tools/telemetry/telemetry/core/platform/profiler/monsoon.py
|
| +++ b/tools/telemetry/telemetry/core/platform/profiler/monsoon.py
|
| @@ -2,12 +2,13 @@
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| -"""Interface for a USB-connected Monsoon power meter
|
| -(http://msoon.com/LabEquipment/PowerMonitor/).
|
| +"""Interface for a USB-connected Monsoon power meter.
|
|
|
| +http://msoon.com/LabEquipment/PowerMonitor/
|
| Currently Unix-only. Relies on fcntl, /dev, and /tmp.
|
| """
|
|
|
| +import collections
|
| import logging
|
| import os
|
| import select
|
| @@ -20,6 +21,9 @@ util.AddDirToPythonPath(util.GetTelemetryDir(), 'third_party', 'pyserial')
|
| import serial # pylint: disable=F0401
|
|
|
|
|
| +Power = collections.namedtuple('Power', ['amps', 'volts'])
|
| +
|
| +
|
| class Monsoon:
|
| """Provides a simple class to use the power meter.
|
|
|
| @@ -210,7 +214,7 @@ class Monsoon:
|
| sample += ((usb & ~1) - self._coarse_zero) * self._coarse_scale
|
| else:
|
| sample += (usb - self._fine_zero) * self._fine_scale
|
| - out.append((sample, main_voltage_v))
|
| + out.append(Power(sample, main_voltage_v))
|
| return out
|
|
|
| elif packet_type == 1:
|
|
|