mirror of
https://github.com/joel16/SwitchIdent.git
synced 2024-11-23 11:49:43 +00:00
Properly display voltage state
This commit is contained in:
parent
1534eaef0c
commit
dba7cd6818
@ -204,31 +204,20 @@ char *SwitchIdent_GetVoltageState(Service *srv) {
|
||||
|
||||
char *states[]=
|
||||
{
|
||||
"max77620_sd0",
|
||||
"max77620_sd1",
|
||||
"max77620_sd2",
|
||||
"max77620_sd3",
|
||||
"max77620_ldo0 -> 1.2 V",
|
||||
"max77620_ldo1",
|
||||
"max77620_ldo2 -> 3.3 V - 1.8 V",
|
||||
"max77620_ldo3",
|
||||
"max77620_ldo4 -> 0.85 V",
|
||||
"max77620_ldo5",
|
||||
"max77620_ldo6 -> 2.9 V",
|
||||
"max77620_ldo7",
|
||||
"max77620_ldo8 -> 1.05 V",
|
||||
"max77621_cpu",
|
||||
"max77621_gpu",
|
||||
"Power state needs shutdown",
|
||||
"Power state needs sleep",
|
||||
"Performance boost cannot be entered",
|
||||
"Normal",
|
||||
"Unknown"
|
||||
};
|
||||
|
||||
if (R_SUCCEEDED(ret = psmGetBatteryVoltageState(&out))) {
|
||||
if (out < 15)
|
||||
if (out < 4)
|
||||
return states[out];
|
||||
}
|
||||
|
||||
printf("psmGetBatteryVoltageState() failed: 0x%x.\n\n", ret);
|
||||
return states[15];
|
||||
return states[4];
|
||||
}
|
||||
|
||||
u64 SwitchIdent_GetRawBatteryChargePercentage(Service *srv) {
|
||||
|
@ -108,7 +108,7 @@ int main(int argc, char **argv) {
|
||||
char hostname[128];
|
||||
Result ret = gethostname(hostname, sizeof(hostname));
|
||||
// 21
|
||||
printf("\x1b[21;0H");
|
||||
printf("\x1b[22;0H");
|
||||
printf("\x1b[36;1m*\x1b[0m IP: \x1b[36;1m%s\n", R_SUCCEEDED(ret)? hostname : NULL);
|
||||
printf("\x1b[36;1m*\x1b[0m Wireless LAN: \x1b[36;1m%s\n", SwitchIdent_GetFlag(SetSysFlag_WirelessLanEnable)? "Enabled" : "Disabled");
|
||||
printf("\x1b[36;1m*\x1b[0m Bluetooth: \x1b[36;1m%s\n", SwitchIdent_GetFlag(SetSysFlag_BluetoothEnable)? "Enabled" : "Disabled");
|
||||
@ -131,7 +131,7 @@ int main(int argc, char **argv) {
|
||||
Utils_GetSizeString(nand_s_free_str, SwitchIdent_GetFreeStorage(FsStorageId_NandSystem));
|
||||
Utils_GetSizeString(nand_s_used_str, SwitchIdent_GetUsedStorage(FsStorageId_NandSystem));
|
||||
|
||||
printf("\x1b[31;0H");
|
||||
printf("\x1b[32;0H");
|
||||
printf("\x1b[35;1m*\x1b[0m Total SD Capacity: \x1b[35;1m%s\n", sd_total_str);
|
||||
printf("\x1b[35;1m*\x1b[0m Free SD Capacity: \x1b[35;1m%s\n", sd_free_str);
|
||||
printf("\x1b[35;1m*\x1b[0m Used storage: \x1b[35;1m%s\n", sd_used_str);
|
||||
@ -161,13 +161,12 @@ int main(int argc, char **argv) {
|
||||
*/
|
||||
printf("\x1b[16;0H");
|
||||
printf("\x1b[94;1m*\x1b[0m Battery percentage: \x1b[94;1m%lu %%\x1b[0m (\x1b[94;1m%s\x1b[0m) \x1b[0m \n", SwitchIdent_GetBatteryPercent(), SwitchIdent_IsCharging()? "charging" : "not charging");
|
||||
// Voltage state needs more clarification
|
||||
//printf("\x1b[94;1m*\x1b[0m Battery voltage state: \x1b[94;1m%s \n", SwitchIdent_GetVoltageState(&psm_service));
|
||||
printf("\x1b[94;1m*\x1b[0m Battery voltage state: \x1b[94;1m%s \n", SwitchIdent_GetVoltageState(&psm_service));
|
||||
printf("\x1b[94;1m*\x1b[0m Battery charger type: \x1b[94;1m%s \n", SwitchIdent_GetChargerType());
|
||||
printf("\x1b[94;1m*\x1b[0m Battery charging enabled: \x1b[94;1m%s \n", SwitchIdent_IsChargingEnabled(&psm_service)? "Yes" : "No");
|
||||
printf("\x1b[94;1m*\x1b[0m Battery ample power supplied: \x1b[94;1m%s \n\n", SwitchIdent_IsEnoughPowerSupplied(&psm_service)? "Yes" : "No");
|
||||
|
||||
printf("\x1b[27;0H");
|
||||
printf("\x1b[28;0H");
|
||||
printf("\x1b[36;1m*\x1b[0m State: \x1b[36;1m%s \n", SwitchIdent_GetOperationMode());
|
||||
printf("\x1b[36;1m*\x1b[0m SD card status: \x1b[36;1m%s \n", isSDInserted? "Inserted" : "Not inserted");
|
||||
printf("\x1b[36;1m*\x1b[0m Game card status: \x1b[36;1m%s \n\n", isGameCardInserted? "Inserted" : "Not inserted");
|
||||
|
@ -53,10 +53,10 @@ static void Menu_System(void) {
|
||||
|
||||
static void Menu_Power(void) {
|
||||
Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 50, "Battery percentage:", "%lu %% (%s)", SwitchIdent_GetBatteryPercent(), SwitchIdent_IsCharging()? "charging" : "not charging");
|
||||
//Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 100, "Battery voltage state:", SwitchIdent_GetVoltageState(&psm_service));
|
||||
Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 100, "Battery charger type:", SwitchIdent_GetChargerType());
|
||||
Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 150, "Battery charging enabled:", SwitchIdent_IsChargingEnabled(&psm_service)? "Yes" : "No");
|
||||
Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 200, "Battery ample power supplied:", SwitchIdent_IsEnoughPowerSupplied(&psm_service)? "Yes" : "No");
|
||||
Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 100, "Battery voltage state:", SwitchIdent_GetVoltageState(&psm_service));
|
||||
Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 150, "Battery charger type:", SwitchIdent_GetChargerType());
|
||||
Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 200, "Battery charging enabled:", SwitchIdent_IsChargingEnabled(&psm_service)? "Yes" : "No");
|
||||
Menu_DrawItem(450, 250 + ((MENU_Y_DIST - item_height) / 2) + 250, "Battery ample power supplied:", SwitchIdent_IsEnoughPowerSupplied(&psm_service)? "Yes" : "No");
|
||||
}
|
||||
|
||||
static void Menu_Storage(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user