WARNING: This message is intended for developers only. It may not be entirely safe for a noob to read further. I've been digging the battery status of my a570 100e occasionally ever since it was recently found that it (and a590, probably all others too) have stricter low battery shutdown limits for when CHDK runs (i.e. when started via a firmware upgrade) compared to normal operatio without CHDK.
There's a lot of disassembly to go through, and a lot of it seems to be only for factory mode and much of the functionality is unused but still mostly exists making the code bigger. I haven't found an explanation for that difference in shutdown limits just yet, but it looks like I have stumbled upon a way to disable Canon's battery warning, something that's been annoying me ever since I got the camera.
I know I'm not the only one, so I thought I'd post this now that I still remember it (I don't know when I'll have time to continue).
So... attached is a Lua script, which (as far as I can tell...) replaces tresholds called "PreWeak" and "Weak" (which in a570 100e are actually identical, but that's to be expected since there's only one level of battery warning information before shutdown) in RAM with values from a lower threshold called "LB" (obviously stands for "Low Battery").
It looks like tripping the "LB" threshold, or an ever lower threshold "SysLow" cause camera shutdown, while tripping the "Weak" threshold causes the battery icon to blink. If that's true, then decreasing the weak battery threshold down to be in par with a shutdown threshold clearly should suppress the warning icon without affecting safe low battery shutdown.
So, if you run this script on an a570 100e, the battery warning icon should not start to blink. But if it was already blinking when you ran the script, the icon will not disappear because the firmware remembers the worst state the battery was and never lets battery status improve.
I've only tested this shortly, but it appears to work and I believe it is safe. The camera still shuts down cleanly to low battery, demanding me to change the batteries as it should. There is one problem with this scripted demonstration approach: even if you make it autostart, powering up to rec mode with a weak battery will cause the icon to blink, because Canon firmware decides the battery is weak before the script runs and changes the thresholds. It's possible that this could be overcome by figuring out an early enough time to do it in CHDK code, but maybe not and it may not be worth the trouble. Powering up to PLAY mode will never cause the battery icon to blink.
Do NOT run this script on any other camera than an a570 100e,
not even on an a570 101a unless you check it uses the same values and addresses (for many things it does, but I haven't checked this) (edit: I checked it: 100e and 101a seem to use the same addresses...101a values could differ slightly, but that shouldn't cause problems in a quick test). Cameras other than an a570 will very likely be using different addresses, and the values that I'm writing to those addresses will probably different for each camera as well. Even the number of required pokes will likely differ. It's also likely that not all cameras do things this way at all.
Running this script on any other camera equals to writing odd values to random locations in RAM, which may result in all sorts of damage (typically only weird crashes or data loss, but worse things could happen).
Read the script before you run it. There is a safety switch in the script parameters. If you don't understand what it does, don't run the script. And again: if your camera is not a570 sub 100e, do not run it. If you don't understand what that means, don't run it. This script is not meant to be actually used by anyone regularly, just to demonstrate a proof of concept.
For those interested in where this comes from... A factory/repair mode debug printout function ShowBattChkAdj, 0xffde257c, reveals functions for these values:
Battery threshold addresses
Temperature PreWeak Weak LB SysLow
LOW_TEMPERTURE 0x54558 0x5455a 0x5455c 0x5455e
NORMAL_TEMPERTURE 0x54562 0x54564 0x54566 0x54568
HIGH_TEMPERTURE 0x5456c 0x5456e 0x54570 0x54572
Values: PreWeak Weak LB SysLow
LOW_TEMPERTURE 0x01F3 0x01F3 0x01B9 0x0196
NORMAL_TEMPERTURE 0x01F3 0x01F3 0x01B9 0x0196
HIGH_TEMPERTURE 0x01F3 0x01F3 0x01B9 0x0196
All values are 16-bit shorts from my a570 100e found using the CHDK
memory browser debug utility. Spelling is as found in the firmware...
There are separate thresholds for 3 different temperatures, but for the a570is (at least when CHDK is running) all temperatures have the same values.