-
Notifications
You must be signed in to change notification settings - Fork 293
Thermal throttling +typos #2396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
72cbb00
f0ff093
1ab02fc
c3bdc34
c3b4b63
2f2d3b1
cd53186
29c0a6b
1e597cb
6c20640
daf35e4
ee4a4e5
1fea36f
a4ba9c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,13 +25,7 @@ public class SystemMonitorRaspberryPi extends SystemMonitor { | |
|
|
||
| @Override | ||
| public String getCpuThrottleReason() { | ||
| int state = 0; | ||
| String output = vcgencmd("get_throttled"); | ||
| try { | ||
| state = Integer.decode(output); | ||
| } catch (NumberFormatException e) { | ||
| logger.warn("Could not parse return value: " + output); | ||
| } | ||
| int state = getThrottleState(); | ||
| if ((state & 0x01) != 0) { | ||
| return "LOW VOLTAGE"; | ||
| } else if ((state & 0x08) != 0) { | ||
|
|
@@ -44,6 +38,22 @@ public String getCpuThrottleReason() { | |
| return "None"; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isThermallyThrottling() { | ||
| return (getThrottleState() & 0x08) != 0; | ||
| } | ||
|
|
||
| private int getThrottleState() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we breaking this out into a helper function?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, scattered mess rn with regionals... |
||
| int state = 0; | ||
| String output = vcgencmd("get_throttled"); | ||
| try { | ||
| state = Integer.decode(output); | ||
| } catch (NumberFormatException e) { | ||
| logger.warn("Could not parse return value: " + output); | ||
| } | ||
| return state; | ||
| } | ||
|
|
||
| @Override | ||
| public double getGpuMem() { | ||
| String output = vcgencmd("get_mem gpu"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.