Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/monsoon.py

Issue 1013943002: Add SetStartupCurrent to monsoon profiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0c144e7ee3cd8186e8e20f44642700afd8ce7835..34c626521a9a8dd46c7e3cda51c6c55ff79725d6 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/monsoon.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/monsoon.py
@@ -156,12 +156,19 @@ class Monsoon(object):
else:
self._SendStruct('BBB', 0x01, 0x01, int((v - 2.0) * 100))
+ def SetStartupCurrent(self, a):
+ """Set the max startup output current. the unit of |a| : Amperes """
+ assert a >= 0 and a <= 8
- def SetMaxCurrent(self, i):
- """Set the max output current."""
- assert i >= 0 and i <= 8
+ val = 1023 - int((a/8.0)*1023)
+ self._SendStruct('BBB', 0x01, 0x08, val & 0xff)
+ self._SendStruct('BBB', 0x01, 0x09, val >> 8)
- val = 1023 - int((i/8)*1023)
+ def SetMaxCurrent(self, a):
+ """Set the max output current. the unit of |a| : Amperes """
+ assert a >= 0 and a <= 8
+
+ val = 1023 - int((a/8.0)*1023)
self._SendStruct('BBB', 0x01, 0x0a, val & 0xff)
self._SendStruct('BBB', 0x01, 0x0b, val >> 8)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698