mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-04 16:53:48 -04:00
boot: implement bc24193 driver, part of CheckBatteryCharge
This commit is contained in:
parent
ea90325535
commit
7c36a827da
7 changed files with 468 additions and 1 deletions
|
@ -296,3 +296,14 @@ Result BatteryDriver::InitializeBatteryParameters() {
|
|||
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result BatteryDriver::IsBatteryRemoved(bool *out) {
|
||||
/* N doesn't check result, but we will. */
|
||||
u16 val = 0;
|
||||
Result rc = this->Read(Max17050Status, &val);
|
||||
if (R_FAILED(rc)) {
|
||||
return rc;
|
||||
}
|
||||
*out = (val & 0x0008) == 0x0008;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue