mirror of
https://github.com/LumaTeam/Luma3DS.git
synced 2026-02-22 01:44:38 +00:00
rosalina: add battery info in debug info
This commit is contained in:
parent
2ddf5d334c
commit
2c49a04516
@ -68,6 +68,8 @@ typedef struct Menu {
|
||||
extern u32 menuCombo;
|
||||
extern bool isHidInitialized;
|
||||
extern u32 mcuFwVersion;
|
||||
extern u8 mcuInfoTable[9];
|
||||
extern bool mcuInfoTableRead;
|
||||
|
||||
// From main.c
|
||||
extern bool isN3DS;
|
||||
|
||||
@ -43,6 +43,8 @@
|
||||
u32 menuCombo = 0;
|
||||
bool isHidInitialized = false;
|
||||
u32 mcuFwVersion = 0;
|
||||
u8 mcuInfoTable[9] = {0};
|
||||
bool mcuInfoTableRead = false;
|
||||
|
||||
// libctru redefinition:
|
||||
|
||||
@ -226,6 +228,9 @@ static Result menuUpdateMcuInfo(void)
|
||||
mcuFwVersion = SYSTEM_VERSION(major - 0x10, minor, 0);
|
||||
}
|
||||
|
||||
if (!mcuInfoTableRead)
|
||||
mcuInfoTableRead = R_SUCCEEDED(MCUHWC_ReadRegister(0x7F, mcuInfoTable, sizeof(mcuInfoTable)));
|
||||
|
||||
svcCloseHandle(*mcuHwcHandlePtr);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -125,14 +125,18 @@ void RosalinaMenu_ShowDebugInfo(void)
|
||||
10, posY, COLOR_WHITE, "Kernel version: %lu.%lu-%lu\n",
|
||||
GET_VERSION_MAJOR(kernelVer), GET_VERSION_MINOR(kernelVer), GET_VERSION_REVISION(kernelVer)
|
||||
);
|
||||
if (mcuFwVersion != 0)
|
||||
if (mcuFwVersion != 0 && mcuInfoTableRead)
|
||||
{
|
||||
posY = Draw_DrawFormattedString(
|
||||
10, posY, COLOR_WHITE, "MCU FW version: %lu.%lu\n",
|
||||
GET_VERSION_MAJOR(mcuFwVersion), GET_VERSION_MINOR(mcuFwVersion)
|
||||
10, posY, COLOR_WHITE, "MCU FW version: %lu.%lu (PMIC vendor: %hhu)\n",
|
||||
GET_VERSION_MAJOR(mcuFwVersion), GET_VERSION_MINOR(mcuFwVersion),
|
||||
mcuInfoTable[1]
|
||||
);
|
||||
posY = Draw_DrawFormattedString(
|
||||
10, posY, COLOR_WHITE, "Battery: vendor: %hhu gauge IC ver.: %hhu.%hhu RCOMP: %hhu\n",
|
||||
mcuInfoTable[2], mcuInfoTable[3], mcuInfoTable[4], mcuInfoTable[4]
|
||||
);
|
||||
}
|
||||
|
||||
if (R_SUCCEEDED(FSUSER_GetSdmcSpeedInfo(&speedInfo)))
|
||||
{
|
||||
u32 clkDiv = 1 << (1 + (speedInfo.sdClkCtrl & 0xFF));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user