Hacker News new | past | comments | ask | show | jobs | submit login

I'm guessing you've not dealt with power electronics and batteries terribly much.

Depending on what limit has been hit, it's quite likely there is no way to log the cause of the error. Low voltage protection circuitry on most batteries doesn't have a status line. It's never supposed to trigger except in exceptional cases, and it just cuts power. All you know is that the power disappeared suddenly, and you've rebooted. Telling the difference between that and assorted other hardware faults, especially if you never designed the hardware to look for it, is really difficult.

You can certainly design a system that will latch the cause of the shutdown in the battery management IC - but you can't really add this in after the fact.






Sometimes things are much simpler than they seem at first. You set a nonvolatile flag at startup time: badShutdown=true. Prior to shutting down normally, you clear the flag. Then, if the flag is ever found to be set at startup time, you can assume that a crash occurred.

Whether the crash was really due to the battery can be inferred from the battery's age. If the battery is relatively new or is otherwise determined to be OK, don't issue this particular warning. If it's within, say, 90% of the expected service life, then the warning makes sense.

In any event, logic similar to the above was employed at some point to determine when to degrade the phone's performance. That is the point where the warning should have been issued. There are no valid excuses for not doing so.


So, no, you've not worked with batteries, battery management systems, or anything of the sort.

Determining battery health is hard.


LOL, so is building an iPhone.

Carrying water for a trillion-dollar corporation for free, though... that's so easy that anyone can do it. The only question is why.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: