Interesting Battery find

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Interesting Battery find

Post by Art »

Ha. I lied.
If I could really quantify how interesting this is now that I'm over it,
the value would need a float for a very large negative number.

In the situation where there is enough power available at the connector to
power the PSP, but not enough to charge (say using an external battery),
the battery level returns as 1. When the battery is charging, you get the correct value.
After the battery has charged, so the charger stops, I don't know.

It is possible to receive enough power at the power socket for the PSP to
report through the XMB setting screen, and through sceispoweronline,
that the PSP is currently externally powered, but the PSP is still using the
battery, and the battery can go flat. while the PSP was telling lies the whole time.

So the PSP has a Twilight Zone.

If you want to monitor what sort of power is available because your PSP
is in charge of a rocket launcher you have real problems.

Code: Select all

if (scePowerIsBatteryExist()) {
			wehavepower = scePowerIsBatteryCharging();
			if (wehavepower != 1) {wehavepower = 0;} // should there really be more than two outcomes ?

			batt = scePowerGetBatteryLifePercent();
			if (batt == 100) {wehavepower = scePowerIsPowerOnline();}
} else {
			if (scePowerIsPowerOnline()) {wehavepower = 1;} // otherwise the program wouldn't be running
} // battery exist

Is not any sort of working useable code, but if you assume the battery exists, it is.
Cheers, Art.
If not actually, then potentially.
Post Reply