Added mining on battery setting

This commit is contained in:
SChernykh 2020-07-22 20:12:16 +02:00
parent 5bc89fdc8b
commit 299b180b28
10 changed files with 95 additions and 18 deletions

View file

@ -157,3 +157,12 @@ void xmrig::Platform::setThreadPriority(int priority)
SetThreadPriority(GetCurrentThread(), prio);
}
bool xmrig::Platform::isOnBatteryPower()
{
SYSTEM_POWER_STATUS st;
if (GetSystemPowerStatus(&st)) {
return (st.ACLineStatus == 0);
}
return false;
}