That’s likely more about hardware than software, but one of these threads might be relevant:
I’ve worked on this before and the layout did not work decently. In the past I depended too heavily on the LFPAK outline I grabbed from the internet. When I saw RMM take a crack at the problem (#3441) the truth is I initially dismissed his work: I thought to myself “shows what he knows, that stuff won’t fit.” Later the idea kept rattling around in my head again and it occurred to me that both RMM and I have built the A17DD-SO8 drivers and know exactly how much space each component needs. Clearly…
I've been collecting flashlight firmwares into one place and I hope it can become a central place for everyone to keep their code. The repository is linked in my signature, or you can click here: Project: https://launchpad.net/flashlight-firmware Main code branch: https://code.launchpad.net/~toykeeper/flashlight-firmware/trunk Anyone can create an account, branch the code, upload modified versions, file or fix bugs, submit merge proposals, and so on. A quickstart is in the README (also incl…
The driver has a small capacitor to measure off-time, but it’s not enough power to keep the MCU running. The MCU itself also has some SRAM which decays slowly so it can hold values from one boot to the next if the off-time is fairly short. Both of these methods are used.
As for eeprom, it uses wear levelling. One byte is written per boot, levelling across 64 cells. The spec claims 100,000 write cycles, though independent tests suggest it usually gets over a million before seeing actual failures. So, in order to wear out the eeprom, you’d have to press the button 175 times per day for 100 years before it’d fall out of spec, and likely more like 2000 times per day in order to see an actual failure within one human life span.
Config data doesn’t use wear levelling, but it also doesn’t get written unless you enter config mode. The fastest way to wear out the eeprom would be if you left it in mode-group-select mode for about 3 years.