mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-30 22:46:07 +00:00
pause-on-battery: Support macsmc-battery driver and sysfs node
This commit is contained in:
parent
e7de104d88
commit
5ac6d438fa
1 changed files with 6 additions and 0 deletions
|
@ -169,6 +169,12 @@ bool xmrig::Platform::isOnBatteryPower()
|
||||||
return (status == "Discharging");
|
return (status == "Discharging");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::ifstream f("/sys/class/power_supply/macsmc-battery/status");
|
||||||
|
if (f.is_open()) {
|
||||||
|
std::string status;
|
||||||
|
f >> status;
|
||||||
|
return (status == "Discharging");
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue